/* Layout: one 1120px column. The hero splits copy | clinic injection sheet on wide screens and stacks on phones;
   the tools are white sheets with inputs on the left and results on the right. */
:root {
  --paper: #f3f5f2;      /* 병원 안내문 종이 */
  --sheet: #ffffff;
  --ink: #1a2333;        /* 청흑색 본문 */
  --ink-soft: #586377;
  --rule: #d8dde3;
  --pen: #2a4c9e;        /* 볼펜 파랑: 주 강조색 */
  --pen-wash: #e4eaf8;
  --on-pen: #ffffff;
  --marker: #f6d55c;     /* 형광펜: '지금'과 꼭 볼 것 */
  --marker-ink: #2c2400;
  --good: #23704b;
  --good-wash: #e2f2e8;
  --quiet-wash: #eceff3;
  --warn: #9a4a12;
  --warn-wash: #fbeadd;
  --shadow: 0 1px 2px rgb(26 35 51 / 0.06), 0 10px 28px rgb(26 35 51 / 0.08);
  --font-display: "Hahmlet", "Noto Serif KR", "AppleMyungjo", "Batang", serif;
  --font-body: "IBM Plex Sans KR", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --font-hand: "Nanum Pen Script", "Hahmlet", "Apple SD Gothic Neo", cursive;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f131b;
    --sheet: #171d29;
    --ink: #e5e9f0;
    --ink-soft: #a0a9b9;
    --rule: #2a3343;
    --pen: #9db2ff;
    --pen-wash: #1f2a46;
    --on-pen: #0f131b;
    --marker: #e2bd47;
    --marker-ink: #211a00;
    --good: #79d3a3;
    --good-wash: #16352a;
    --quiet-wash: #232b3a;
    --warn: #f2a46f;
    --warn-wash: #3a2416;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 28px rgb(0 0 0 / 0.35);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #0f131b;
  --sheet: #171d29;
  --ink: #e5e9f0;
  --ink-soft: #a0a9b9;
  --rule: #2a3343;
  --pen: #9db2ff;
  --pen-wash: #1f2a46;
  --on-pen: #0f131b;
  --marker: #e2bd47;
  --marker-ink: #211a00;
  --good: #79d3a3;
  --good-wash: #16352a;
  --quiet-wash: #232b3a;
  --warn: #f2a46f;
  --warn-wash: #3a2416;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 28px rgb(0 0 0 / 0.35);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.375rem, 8vw, 4rem);
  line-height: 1.12;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.125rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0;
}

a {
  color: var(--pen);
}

mark {
  background: var(--marker);
  color: var(--marker-ink);
  padding: 0 0.25em;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

:focus-visible {
  outline: 3px solid var(--marker);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Buttons and links */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7em 1.4em;
  border: 0;
  border-radius: 999px;
  background: var(--pen);
  color: var(--on-pen);
  font: 600 1rem/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.btn-small {
  min-height: 40px;
  padding: 0.5em 1.1em;
  font-size: 0.9375rem;
}

.btn-ghost {
  background: transparent;
  color: var(--pen);
  box-shadow: inset 0 0 0 1.5px var(--pen);
}

.link {
  color: var(--pen);
  font-weight: 600;
  text-underline-offset: 5px;
}

.link-button {
  padding: 0.25em 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Header */
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 24px;
}

.brand-mark .a {
  fill: var(--pen);
}

.brand-mark .b {
  fill: none;
  stroke: var(--pen);
  stroke-width: 2.5;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1;
}

/* Hero */
.hero .wrap {
  display: grid;
  gap: 40px;
  align-items: center;
  padding-block: 24px 72px;
}

.hero-copy {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.lead {
  max-width: 32em;
  color: var(--ink-soft);
  font-size: 1.125rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  margin-top: 4px;
}

.fine {
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

/* The injection sheet: a printed clinic schedule with a ruled time column */
.sheet {
  min-width: 0;
  margin: 0;
  padding: 18px 20px 22px;
  border-radius: 6px;
  background: var(--sheet);
  box-shadow: var(--shadow);
}

.sheet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 16px;
}

.sheet-date {
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-weight: 500;
}

.sheet-note {
  color: var(--pen);
  font-family: var(--font-hand);
  font-size: 1.875rem;
  line-height: 1;
  transform: rotate(-4deg);
}

/* the ruled column between times and reminders, like a printed schedule */
.demo-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  background-image: linear-gradient(to right, transparent 63px, var(--rule) 63px, var(--rule) 64px, transparent 64px);
}

.demo-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  animation: settle 0.5s ease-out both;
}

.demo-row:nth-child(2) {
  animation-delay: 0.12s;
}

.demo-row:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes settle {
  from {
    transform: translateY(10px);
  }
  to {
    transform: none;
  }
}

.demo-time {
  padding-top: 11px;
  color: var(--pen);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.is-due .demo-time span {
  padding: 1px 5px;
  margin-left: -5px;
  border-radius: 3px;
  background: var(--marker);
  color: var(--marker-ink);
}

.bubble {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 14px 12px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--paper);
}

.is-due .bubble {
  border-color: var(--pen);
  box-shadow: 0 0 0 1px var(--pen);
}

.bubble-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.bubble-app {
  color: var(--ink);
  font-weight: 600;
}

.bubble-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.45;
}

.bubble-body {
  color: var(--ink-soft);
  font-size: 0.875rem;
  line-height: 1.5;
}

.sheet-caption {
  margin-top: 14px;
  padding-left: 76px;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--rule);
  font-size: 0.9375rem;
  cursor: pointer;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--quiet-wash);
  transition: background 0.2s;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sheet);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
  transition: transform 0.2s;
}

.switch input:checked + .switch-track {
  border-color: var(--pen);
  background: var(--pen);
}

.switch input:checked + .switch-track::after {
  transform: translateX(18px);
}

.switch input:focus-visible + .switch-track {
  outline: 3px solid var(--marker);
  outline-offset: 2px;
}

/* Sections */
.cycle .wrap,
.tools .wrap {
  display: grid;
  gap: 28px;
  padding-block: 56px;
}

.section-head {
  display: grid;
  gap: 10px;
  max-width: 40em;
}

.section-lead {
  color: var(--ink-soft);
}

.cycle-list {
  display: grid;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  list-style: none;
  counter-reset: stage;
}

.cycle-list li {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  gap: 4px 12px;
  padding-block: 18px;
  border-bottom: 1px solid var(--rule);
  counter-increment: stage;
}

.cycle-list li::before {
  content: counter(stage);
  grid-row: span 2;
  color: var(--pen);
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1.15;
}

.cycle-list h3 {
  font-size: 1.125rem;
}

.cycle-list p {
  color: var(--ink-soft);
}

/* Tools */
.tool {
  display: grid;
  gap: 24px;
  padding: 26px clamp(16px, 4vw, 40px) 24px;
  border-radius: var(--radius);
  background: var(--sheet);
  box-shadow: var(--shadow);
}

.tool-head {
  display: grid;
  gap: 8px;
  max-width: 44em;
}

.tool-head h3 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
}

.tool-body {
  display: grid;
  gap: 28px;
}

.tool-input,
.tool-output {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

label {
  font-size: 0.9375rem;
  font-weight: 600;
}

input[type="date"],
input[type="email"],
input[type="number"],
select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.row > input {
  flex: 1 1 180px;
  min-width: 0;
}

.row-between {
  align-items: center;
  justify-content: space-between;
}

.hint {
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.error-text {
  color: var(--warn);
  font-size: 0.875rem;
  font-weight: 500;
}

.date-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.date-chips li {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 36px;
  padding: 2px 4px 2px 12px;
  border-radius: 999px;
  background: var(--pen-wash);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.date-chips li:not(:has(button)) {
  padding-right: 12px;
}

.chip-remove {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}

.chip-remove:hover {
  background: var(--quiet-wash);
  color: var(--ink);
}

.example-tag {
  justify-self: start;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--marker);
  color: var(--marker-ink);
  font-size: 0.8125rem;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
  cursor: pointer;
}

.check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 3px 0 0;
  accent-color: var(--pen);
}

.tally {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  margin: 0;
}

.tally div {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--paper);
}

.tally dt {
  color: var(--ink-soft);
  font-size: 0.8125rem;
}

.tally dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.tally .is-paid dd {
  color: var(--good);
}

.tally .is-over dd {
  color: var(--warn);
}

.delta {
  font-size: 0.9375rem;
}

.table-wrap {
  overflow-x: auto;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.result-table th,
.result-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  white-space: nowrap;
}

.result-table thead th {
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 500;
}

.result-table tbody th {
  font-weight: 500;
}

.caps caption {
  padding-bottom: 4px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: left;
}

.chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.chip-paid {
  background: var(--good-wash);
  color: var(--good);
}

.chip-unpaid {
  background: var(--quiet-wash);
  color: var(--ink-soft);
}

.chip-over_limit {
  background: var(--warn-wash);
  color: var(--warn);
}

.gov {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--pen-wash);
  font-size: 0.9375rem;
}

.steppers {
  display: grid;
  gap: 12px;
}

.stepper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.stepper-ctrl {
  display: inline-grid;
  grid-template-columns: 44px 60px 44px;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper);
}

.stepper-ctrl button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--pen);
  font-size: 1.25rem;
  cursor: pointer;
}

.stepper-ctrl input[type="number"] {
  min-height: 44px;
  padding: 0;
  border: 0;
  border-inline: 1px solid var(--rule);
  border-radius: 0;
  background: var(--sheet);
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}

.stepper-ctrl input::-webkit-outer-spin-button,
.stepper-ctrl input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.meters {
  display: grid;
  gap: 10px;
}

.meter {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--paper);
}

.meter-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.meter-label {
  font-weight: 600;
}

.meter-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.meter-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--quiet-wash);
}

.meter-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--pen);
  transition: width 0.3s;
}

.meter-sub {
  color: var(--ink-soft);
  font-size: 0.8125rem;
}

.tip {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--paper);
  font-size: 0.9375rem;
}

.source {
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.8125rem;
}

.source a {
  color: inherit;
  text-underline-offset: 3px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
}

.site-footer .wrap {
  display: grid;
  gap: 6px;
  padding-block: 28px 40px;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

/* Wider screens */
@media (min-width: 760px) {
  .cycle-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 40px;
  }
}

@media (min-width: 900px) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 64px;
    padding-block: 48px 96px;
  }

  .tool-body {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 40px;
  }
}

@media (min-width: 1040px) {
  .cycle-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
