/* ==========================================================================
   케어온 · 혈압·혈당 건강수첩 (Care On · Health Note)
   디자인 토큰 — 크림 종이 · 깊은 숲색 · 따뜻한 흙빛 · 금빛 강조
   어르신이 한 손으로 쓰는 화면 기준: 큰 숫자·높은 대비·넉넉한 버튼.
   ========================================================================== */

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

:root {
  --paper: #F8F4EA;
  --paper2: #F2ECDD;
  --card: #FFFDF8;
  --ink: #152A22;
  --ink2: #40574B;
  --ink3: #657A6E;
  --green: #0E5C43;
  --green-d: #0A4936;
  --green-l: #E7F1E9;
  --green-m: #CFE4D6;
  --terra: #BC5127;
  --terra-d: #9E3F1B;
  --terra-l: #FBEDE4;
  --gold: #A9791B;
  --gold-l: #F8E9BE;
  --blue: #2C5C8A;
  --blue-l: #E8F0F8;
  --line: #E1D9C6;
  --line2: #D2C7AC;
  --danger: #9B2C2C;
  --radius: 22px;
  --radius-s: 14px;
  --maxw: 1080px;
  --shadow: 0 1px 0 rgba(21, 42, 34, .05), 0 14px 34px -22px rgba(21, 42, 34, .45);
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
          "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --fs-base: 18px;
}

html { font-size: var(--fs-base); -webkit-text-size-adjust: 100%; }
html[data-fs="l"]  { --fs-base: 20px; }
html[data-fs="xl"] { --fs-base: 22px; }

html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.62;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--green); text-underline-offset: 3px; }
b, strong { font-weight: 800; }
h1, h2, h3, h4 { margin: 0; line-height: 1.24; letter-spacing: -0.02em; font-weight: 800; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid #1F76B4; outline-offset: 3px; border-radius: 8px; }

.skip {
  position: fixed; left: 12px; top: -80px; z-index: 200;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px;
  text-decoration: none; font-weight: 700;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ------------------------------------------------------------------ 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 999px;
  font-weight: 800; line-height: 1.2; text-decoration: none;
  padding: 15px 24px; min-height: 52px;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
  white-space: normal; text-align: center;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn-sm { padding: 11px 18px; min-height: 44px; font-size: .92rem; }
.btn-md { padding: 17px 26px; min-height: 58px; font-size: 1.06rem; }

.btn-start {
  background: linear-gradient(180deg, #86F2C3 0%, #5FE0A6 55%, #3CC98C 100%);
  color: #06251B;
  font-size: 1.36rem;
  min-height: 80px;
  padding: 0 34px;
  border-radius: 999px;
  box-shadow: 0 3px 0 #2A9A6B, 0 18px 34px -14px rgba(42, 154, 107, .5), inset 0 1px 0 rgba(255,255,255,.45);
  letter-spacing: -0.01em;
}
.btn-start:hover { background: linear-gradient(180deg, #9BF6CE, #6BE8B0 55%, #45D295); }
.btn-start:active { box-shadow: 0 1px 0 #2A9A6B, 0 8px 20px -12px rgba(42,154,107,.5); }

.btn-green { background: var(--green); color: #F6FBF7; box-shadow: 0 2px 0 var(--green-d); }
.btn-green:hover { background: #0C6B4D; }
.btn-line { background: var(--card); color: var(--green); border: 1.6px solid var(--line2); }
.btn-line:hover { background: var(--green-l); border-color: var(--green-m); }
.btn-ghost { background: transparent; color: var(--ink2); border: 1.6px solid transparent; text-decoration: underline; text-underline-offset: 4px; font-weight: 700; min-height: 48px; padding: 10px 14px; }
.btn-ghost:hover { color: var(--green); background: rgba(14,92,67,.06); }
.btn-danger { background: #FFF6F4; color: var(--danger); border: 1.6px solid #E7C7C1; }
.btn-kakao { background: #FEE500; color: #3A2C0B; border-radius: 14px; font-weight: 800; padding: 12px 16px; min-height: 48px; }
.btn-kakao:hover { background: #F6DC00; }
.btn-icon { width: 46px; height: 46px; padding: 0; font-size: 1.5rem; border-radius: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row.center { justify-content: center; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.pill {
  display: inline-block; padding: 7px 13px; border-radius: 999px;
  background: var(--green-l); color: var(--green-d);
  font-size: .82rem; font-weight: 800; border: 1px solid var(--green-m);
  white-space: nowrap;
}
.pill.paid { background: var(--gold-l); border-color: #E4C87A; color: #6C4C0C; }
.topbar .pill { background: rgba(95, 224, 166, .14); border-color: rgba(95, 224, 166, .34); color: #BDF3D8; cursor: pointer; }
.topbar .pill.paid { background: rgba(255, 198, 92, .18); border-color: rgba(255, 198, 92, .45); color: #FFD98A; }
.topbar .btn-line { background: rgba(95, 224, 166, .12); border-color: rgba(95, 224, 166, .48); color: #D8FFEC; }
.topbar .btn-line:hover { background: rgba(95, 224, 166, .22); color: #FFFFFF; }

/* ---------------------------------------------------------------- 상단바 */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: #08231B;
  border-bottom: 1.5px solid #143B2D;
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset;
}
.topbar-in { display: flex; align-items: center; gap: 18px; min-height: 74px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #EAF7EF; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 13px; flex: 0 0 auto;
  background: #5FE0A6; color: #06251B;
  display: grid; place-items: center;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.18);
}
.brand-mark svg { width: 28px; height: 28px; }
.brand-mark.sm { width: 34px; height: 34px; border-radius: 10px; }
.brand-mark.sm svg { width: 22px; height: 22px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-txt b { font-size: 1.26rem; letter-spacing: -0.03em; }
.brand-txt i { font-style: normal; font-size: .74rem; color: #8FB3A3; font-weight: 700; letter-spacing: .04em; }
.topnav { display: flex; gap: 4px; margin-left: 10px; }
.topnav a {
  text-decoration: none; color: #C6E3D4; font-weight: 700; font-size: .95rem;
  padding: 10px 14px; border-radius: 999px;
}
.topnav a:hover { background: rgba(95, 224, 166, .14); color: #E9FFF4; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ------------------------------------------------------------------ 히어로 */
.hero { padding: 46px 0 10px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 36px; align-items: start; }
.eyebrow {
  display: inline-block; font-size: .82rem; font-weight: 800; letter-spacing: .04em;
  color: var(--green); background: var(--green-l); border: 1px solid var(--green-m);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 16px;
}
.hero h1 { font-size: clamp(2.4rem, 5.8vw, 3.6rem); letter-spacing: -0.045em; line-height: 1.06; }
.hero h1 em { font-style: normal; color: var(--terra); position: relative; }
.hero h1 em::after {
  content: ""; position: absolute; left: 2%; right: 2%; bottom: -6px; height: 10px;
  background: var(--gold-l); border-radius: 999px; z-index: -1; transform: rotate(-1deg);
}
.lead { margin-top: 18px; font-size: 1.08rem; color: var(--ink2); max-width: 34ch; }
.hero-cta { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.hero-sub { display: flex; gap: 6px; flex-wrap: wrap; margin-left: -12px; }
.free-note { margin-top: 20px; font-size: .94rem; color: var(--ink3); line-height: 1.7; }
.free-note b { color: var(--ink2); }

/* 오늘 카드 */
.today {
  background: var(--card); border: 1.5px solid var(--line2); border-radius: 26px;
  padding: 22px 22px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.today::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 7px;
  background: repeating-linear-gradient(90deg, var(--green) 0 18px, var(--green-m) 18px 36px);
  opacity: .5;
}
.today-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 4px; }
.today-top h2 { font-size: 1rem; color: var(--ink2); letter-spacing: 0; }
.today-top span { font-size: .86rem; color: var(--ink3); font-weight: 700; }

.bp-big { display: flex; align-items: flex-end; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.bp-big b { font-size: 3.5rem; line-height: 1; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.bp-big .slash { font-size: 2.6rem; line-height: 1.1; color: var(--ink3); font-weight: 700; margin: 0 2px; }
.bp-big i { font-style: normal; font-size: .86rem; font-weight: 800; color: var(--ink3); margin-left: 8px; }
.bp-big.empty b { color: #B4BDB6; }
.today-lines { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.today-cell {
  background: var(--paper); border: 1.2px solid var(--line); border-radius: 14px;
  padding: 10px 12px;
}
.today-cell span { display: block; font-size: .78rem; color: var(--ink3); font-weight: 800; }
.today-cell b { font-size: 1.32rem; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.today-cell b small { font-size: .76rem; color: var(--ink3); margin-left: 3px; font-weight: 700; }
.today-cell b.empty { color: #B4BDB6; }

.med-quick { margin-top: 14px; }
.med-quick > p { font-size: .82rem; font-weight: 800; color: var(--ink3); margin-bottom: 8px; display: flex; justify-content: space-between; }
.med-quick > p b { color: var(--ink); font-variant-numeric: tabular-nums; }
.med-chips { display: flex; gap: 8px; }
.med-chip {
  flex: 1; min-height: 58px; border-radius: 16px; border: 1.8px solid var(--line2);
  background: #FCFAF3; font-weight: 800; font-size: .95rem; color: var(--ink2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.med-chip small { font-size: .68rem; color: var(--ink3); font-weight: 700; }
.med-chip[aria-pressed="true"] {
  background: linear-gradient(180deg, #D9F5E5, #BCEFD4); border-color: #35A574; color: #08432F;
}
.med-chip[aria-pressed="true"] small { color: #1B6B4C; }
.med-chip[aria-pressed="true"] .tick { opacity: 1; }
.med-chip .tick { opacity: 0; font-size: .8rem; }

.today-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 16px; }
.today-actions .btn { min-height: 60px; font-size: 1rem; padding: 10px 12px; }
.today-actions .btn-photo { grid-column: 1 / -1; }
.today-actions .btn-photo span { font-size: .82rem; color: var(--gold); font-weight: 800; margin-left: 6px; }

.join-note {
  margin-top: 12px; border: 1.6px dashed var(--line2); border-radius: 16px;
  background: #FCF9F1; padding: 12px 14px; font-size: .88rem; color: var(--ink2); line-height: 1.6;
}
.join-note b { color: var(--ink); }

/* ------------------------------------------------------------------ 섹션 */
.sec { padding: 72px 0; }
.sec-alt { background: var(--paper2); border-top: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); }
.sec-head { max-width: 46rem; margin-bottom: 28px; }
.sec-head h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -0.04em; }
.sec-head > p:not(.eyebrow) { margin-top: 12px; color: var(--ink2); font-size: 1.02rem; }

/* ------------------------------------------------------------------ 데모 */
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.demo-card {
  position: relative; min-width: 0; background: var(--card); border: 1.5px solid var(--line2);
  border-radius: var(--radius); padding: 26px 24px 24px; box-shadow: var(--shadow);
}
.demo-tag {
  position: absolute; top: -12px; left: 22px;
  background: var(--ink); color: #F8F4EA; font-size: .74rem; font-weight: 800;
  padding: 4px 12px; border-radius: 999px; letter-spacing: .06em;
}
.demo-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.demo-card p { color: var(--ink2); font-size: .95rem; margin-bottom: 16px; }
.demo-shot {
  display: grid; grid-template-columns: 118px 1fr; gap: 14px; align-items: center;
  background: var(--paper); border: 1.2px solid var(--line); border-radius: 16px;
  padding: 10px; margin-bottom: 16px;
}
.demo-shot img { border-radius: 10px; border: 1px solid var(--line2); background: #fff; }
.demo-shot .dt { font-size: .84rem; color: var(--ink3); }
.demo-shot .dt b { display: block; font-size: 1.06rem; color: var(--ink); }
.demo-shot .dt u { text-decoration: none; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ 패널 */
.panel {
  min-width: 0;
  background: var(--card); border: 1.5px solid var(--line2); border-radius: var(--radius);
  padding: 24px 22px; box-shadow: var(--shadow); position: relative; margin-bottom: 20px;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-head h3 { font-size: 1.14rem; }
.panel-head p { font-size: .9rem; color: var(--ink3); font-weight: 700; }
.blk-t { font-size: 1.06rem; margin-bottom: 14px; }
.hr { border: 0; border-top: 1.5px solid var(--line); margin: 24px 0; }
.hint-sm { font-size: .86rem; color: var(--ink3); line-height: 1.6; margin-top: 8px; }

/* 탭 */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  border: 1.6px solid var(--line2); background: #FCFAF3; border-radius: 999px;
  padding: 9px 18px; font-weight: 800; font-size: .92rem; min-height: 44px; color: var(--ink2);
}
.tab[aria-selected="true"] { background: var(--green); border-color: var(--green); color: #fff; }

/* 차트 */
.chart-box { margin-top: 6px; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg text { font-family: var(--font); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: .82rem; color: var(--ink3); font-weight: 700; }
.legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.legend i.dot { width: 10px; height: 10px; border-radius: 50%; }
.chart-empty {
  border: 1.6px dashed var(--line2); border-radius: 18px; background: #FBF8EF;
  padding: 26px 18px; text-align: center; color: var(--ink3); font-size: .94rem;
}
.chart-empty b { display: block; color: var(--ink2); font-size: 1.02rem; margin-bottom: 4px; }

/* 최근 기록 표 */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.rec { width: 100%; border-collapse: collapse; font-size: .94rem; min-width: 520px; }
table.rec th, table.rec td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--line); }
table.rec th { font-size: .8rem; color: var(--ink3); font-weight: 800; white-space: nowrap; }
table.rec td { font-variant-numeric: tabular-nums; }
table.rec td b { font-size: 1.04rem; }
table.rec .kind { font-size: .74rem; font-weight: 800; border-radius: 999px; padding: 2px 8px; background: var(--paper2); color: var(--ink2); }
table.rec .kind.fast { background: var(--gold-l); color: #6C4C0C; }
table.rec .kind.after { background: var(--terra-l); color: var(--terra-d); }
table.rec .del { border: 0; background: none; color: var(--ink3); font-size: .84rem; text-decoration: underline; padding: 6px; min-height: 34px; }
table.rec .del:hover { color: var(--danger); }
.rec-empty { color: var(--ink3); font-size: .94rem; padding: 14px 0; }

/* 요약 리포트 */
.rep-opts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.rep-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.rep-sum > div { background: var(--paper); border: 1.2px solid var(--line); border-radius: 14px; padding: 12px; }
.rep-sum span { display: block; font-size: .76rem; color: var(--ink3); font-weight: 800; }
.rep-sum b { font-size: 1.34rem; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.rep-sum b small { font-size: .72rem; color: var(--ink3); margin-left: 3px; font-weight: 700; }
.rep-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }

/* 사진으로 읽기 */
.ocr-grid { display: grid; grid-template-columns: 1.02fr .98fr; gap: 20px; align-items: start; }
.drop {
  border: 2px dashed var(--line2); border-radius: 20px; background: #FCFAF3;
  min-height: 208px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 20px; gap: 6px; position: relative;
}
.drop.drag { border-color: var(--green); background: var(--green-l); }
.drop .dico { font-size: 2.2rem; }
.drop b { font-size: 1.04rem; }
.drop span { font-size: .86rem; color: var(--ink3); max-width: 26ch; }
.drop img.preview { border-radius: 14px; max-height: 260px; object-fit: contain; }
.drop-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.ocr-result { border: 1.5px solid var(--line2); border-radius: 18px; background: #FFFEF9; padding: 18px; }
.ocr-result h4 { font-size: 1rem; margin-bottom: 10px; }
.ocr-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.ocr-fields.two { grid-template-columns: 1fr 1fr; }
.ocr-note { font-size: .84rem; color: var(--ink3); margin-top: 8px; }
.ocr-busy { display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--ink2); }
.spinner {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  border: 3px solid var(--green-m); border-top-color: var(--green);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.try-sample { font-size: .84rem; color: var(--ink3); margin-top: 10px; }
.try-sample button { border: 0; background: none; color: var(--green); font-weight: 800; text-decoration: underline; padding: 4px; min-height: 0; }

/* 약 관리 */
.med-list { display: grid; gap: 10px; }
.med-row {
  display: flex; align-items: center; gap: 12px; background: #FCFAF3;
  border: 1.2px solid var(--line); border-radius: 14px; padding: 12px 14px;
}
.med-row .mn { flex: 1 1 auto; min-width: 0; }
.med-row .mn b { display: block; font-size: 1rem; }
.med-row .mn span { font-size: .82rem; color: var(--ink3); }
.med-row .btns { display: flex; gap: 6px; }

/* 설정 */
.field-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 7px; flex: 1 1 180px; min-width: 0; }
.field > span { font-size: .88rem; font-weight: 800; color: var(--ink2); }
input[type="text"], input[type="number"], input[type="time"], select {
  width: 100%; min-height: 54px; border-radius: 14px; border: 1.6px solid var(--line2);
  background: #FFFEFB; padding: 12px 16px; font-size: 1.02rem; font-weight: 700;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
input[type="text"]:focus, input[type="number"]:focus, input[type="time"]:focus, select:focus {
  border-color: var(--green); outline: 3px solid rgba(14,92,67,.18); outline-offset: 0;
}
input::placeholder { color: #A9B4AC; font-weight: 600; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 560px; }

.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.switch-row:last-child { border-bottom: 0; }
.switch-row b { display: block; font-size: 1rem; }
.switch-row span { font-size: .86rem; color: var(--ink3); }
.switch {
  width: 72px; height: 46px; border-radius: 999px; border: 1.6px solid var(--line2);
  background: #E9E2D2; position: relative; flex: 0 0 auto; transition: background .18s ease;
}
.switch span {
  position: absolute; top: 5px; left: 5px; width: 32px; height: 32px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .18s ease;
}
.switch[aria-pressed="true"] { background: var(--green); border-color: var(--green); }
.switch[aria-pressed="true"] span { left: 33px; }
.fs-row { flex-wrap: wrap; }
.fs-btns { display: flex; gap: 6px; }
.fs-btn { border: 1.6px solid var(--line2); background: #FCFAF3; border-radius: 999px; padding: 9px 15px; font-weight: 800; font-size: .86rem; min-height: 44px; }
.fs-btn[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green); }
.file-btn { position: relative; cursor: pointer; }

/* ------------------------------------------------------------------ 요금 */
.price-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 20px; margin-bottom: 22px; align-items: stretch; }
.price {
  background: var(--card); border: 1.5px solid var(--line2); border-radius: var(--radius);
  padding: 26px 24px; position: relative; box-shadow: var(--shadow); min-width: 0;
}
.price h3 { font-size: 1.14rem; color: var(--ink2); }
.price-num { margin-top: 8px; font-size: clamp(2.1rem, 8vw, 2.7rem); font-weight: 900; letter-spacing: -0.045em; line-height: 1; }
.price-num span { display: inline-block; font-size: .95rem; font-weight: 800; color: var(--ink3); margin-left: 6px; letter-spacing: 0; }
.price ul { margin-top: 18px; display: grid; gap: 9px; }
.price li { position: relative; padding-left: 26px; font-size: .97rem; color: var(--ink2); }
.price li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--green); font-weight: 900; }
.price.free li::before { content: "·"; color: var(--ink3); font-size: 1.2rem; line-height: 1.2; }
.price.pro { border: 2px solid var(--green); background: linear-gradient(180deg, #FFFDF7, #F3F8F2); }
.price-badge {
  position: absolute; top: -14px; right: 22px; background: var(--green); color: #fff;
  font-size: .76rem; font-weight: 800; padding: 5px 13px; border-radius: 999px; letter-spacing: .04em;
}
.price.pro .btn { width: 100%; margin-top: 20px; }
.price-note { margin-top: 10px; text-align: center; font-size: .84rem; color: var(--ink3); }

.pay-panel { margin-top: 6px; }
.pay-grid { display: grid; grid-template-columns: 210px 1fr; gap: 26px; align-items: start; }
.pay-grid.tight { grid-template-columns: 170px 1fr; gap: 18px; margin: 18px 0 6px; }
.pay-qr { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pay-qr img { border: 1.5px solid var(--line2); border-radius: 14px; background: #fff; padding: 6px; }
.pay-steps p { display: flex; gap: 10px; align-items: flex-start; font-size: .97rem; color: var(--ink2); margin-bottom: 12px; }
.pay-steps p b:first-child { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #fff; font-size: .86rem; display: grid; place-items: center; }
.pay-steps small { display: block; color: var(--ink3); font-size: .82rem; }
.pay-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.pay-form .field { flex: 1 1 150px; }
.pay-small { margin-top: 8px; font-size: .82rem; color: var(--ink3); }
.code-details { margin-top: 14px; border-top: 1px dashed var(--line2); padding-top: 12px; }
.code-details summary { cursor: pointer; font-weight: 800; font-size: .9rem; color: var(--ink2); padding: 6px 0; }
.code-details p { font-size: .86rem; color: var(--ink3); margin: 6px 0; }
.paid-state { margin-top: 14px; background: var(--gold-l); border: 1.5px solid #E3C477; border-radius: 16px; padding: 16px 18px; }
.paid-state b { color: #6C4C0C; }

/* ------------------------------------------------------------------ 시리즈 */
.fam-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.fam-card {
  position: relative; background: var(--card); border: 1.5px solid var(--line2);
  border-radius: 18px; padding: 18px 16px; text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; gap: 6px; min-height: 152px;
}
a.fam-card:hover { border-color: var(--green); background: #FBFDF9; }
.fam-card h3 { font-size: 1rem; }
.fam-card p { font-size: .84rem; color: var(--ink3); line-height: 1.5; }
.fam-no { font-size: .74rem; font-weight: 800; color: var(--ink3); letter-spacing: .06em; }
.fam-card.here { border-color: var(--green); border-width: 2px; background: var(--green-l); }
.here-b { display: inline-block; font-size: .68rem; background: var(--green); color: #fff; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.fam-card.soon { opacity: .78; }
.soon-b { position: absolute; right: 12px; top: 12px; font-size: .7rem; font-weight: 800; color: var(--ink3); background: #EFE9DA; border-radius: 999px; padding: 3px 9px; }

/* ------------------------------------------------------------------ FAQ */
.faq details { background: var(--card); border: 1.5px solid var(--line2); border-radius: 16px; margin-bottom: 10px; }
.faq summary {
  cursor: pointer; padding: 18px 20px; font-weight: 800; font-size: 1.02rem;
  list-style: none; display: flex; justify-content: space-between; gap: 14px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--green); font-weight: 800; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 20px 20px; color: var(--ink2); font-size: .96rem; }

/* ------------------------------------------------------------------ 푸터 */
.foot { background: #08231B; color: #DCE7DF; padding: 42px 0 38px; border-top: 1px solid #143B2D; }
.foot-brand { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 1rem; }
.foot-brand b { color: #fff; font-size: 1.1rem; }
.foot-brand span { color: #9FB5A8; font-size: .86rem; }
.foot-line { margin-top: 10px; font-size: .86rem; color: #A9BFB2; }
.foot-line a { color: #D9E6DC; }
.foot-c { margin-top: 16px; font-size: .8rem; color: #7E9488; }
.nonmed {
  margin-top: 14px; border: 1px solid #2A5544; border-radius: 14px; padding: 12px 14px;
  font-size: .84rem; color: #B9D2C4; line-height: 1.65; background: rgba(255,255,255,.03);
}

/* ================================================================ 모달 */
.modal { position: fixed; inset: 0; z-index: 140; display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.modal-mask { position: absolute; inset: 0; background: rgba(9, 24, 18, .62); backdrop-filter: blur(3px); }
.modal-card {
  position: relative; z-index: 1; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  background: var(--card); border-radius: 26px 26px 0 0; padding: 26px 22px max(22px, env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0,0,0,.3);
  animation: sheet .22s ease-out;
}
.modal-card.wide { max-width: 780px; }
@keyframes sheet { from { transform: translateY(18px); opacity: .6; } }
.modal-card h2 { font-size: 1.44rem; letter-spacing: -0.03em; }
.modal-lead { margin-top: 8px; color: var(--ink2); font-size: .96rem; }
.modal-x { position: absolute; top: 14px; right: 16px; background: none; border: 0; font-size: 1.3rem; color: var(--ink3); width: 44px; height: 44px; border-radius: 50%; }
.modal-x:hover { background: var(--paper2); }
.modal-btns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 20px; }
.modal-btns .btn { flex: 1 1 auto; }
.pw-list { margin: 16px 0 0; display: grid; gap: 8px; }
.pw-list li { padding-left: 26px; position: relative; color: var(--ink2); font-size: .96rem; }
.pw-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 900; }

/* 큰 숫자 입력 */
.stepper { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 10px 0 16px; }
.stepper button {
  width: 62px; height: 62px; border-radius: 18px; border: 1.8px solid var(--line2);
  background: #FCFAF3; font-size: 1.7rem; font-weight: 800; color: var(--green); flex: 0 0 auto;
}
.stepper button:hover { background: var(--green-l); border-color: var(--green-m); }
.stepper input {
  width: 100%; max-width: 210px; text-align: center; font-size: 2.6rem; font-weight: 900;
  min-height: 84px; border-radius: 18px; border: 2px solid var(--line2); letter-spacing: -0.03em;
  padding: 4px 8px;
}
/* 입력 시트가 한 화면에 들어오도록 낮춘 판 — 버튼은 그대로 큼직하게 */
.stepper.compact { margin: 4px 0 10px; gap: 8px; }
.stepper.compact button { width: 60px; height: 68px; border-radius: 16px; font-size: 1.45rem; }
.stepper.compact input { max-width: none; min-height: 68px; font-size: 2.1rem; border-radius: 16px; }
.entry-label.compact { margin-top: 8px; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input[type=number] { -moz-appearance: textfield; }
.entry-label { text-align: center; font-size: .9rem; font-weight: 800; color: var(--ink3); }
.entry-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.seg { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.seg button {
  flex: 1 1 auto; min-height: 52px; border-radius: 14px; border: 1.8px solid var(--line2);
  background: #FCFAF3; font-weight: 800; font-size: .94rem; color: var(--ink2); padding: 8px 10px;
}
.seg button[aria-checked="true"] { background: var(--green-l); border-color: var(--green); color: var(--green-d); }
.entry-sum { text-align: center; background: var(--paper); border-radius: 14px; padding: 10px; margin-top: 14px; font-size: .92rem; color: var(--ink2); }
.entry-sum b { font-size: 1.18rem; color: var(--ink); font-variant-numeric: tabular-nums; }

/* 결과/리포트 */
.report-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.report-toolbar > div { display: flex; gap: 8px; }
.report-doc { border: 1.5px solid var(--line2); border-radius: 16px; padding: 22px; background: #FFFEF9; }
.report-doc h1 { font-size: 1.44rem; margin-bottom: 4px; }
.report-doc .rp-sub { font-size: .86rem; color: var(--ink3); margin-bottom: 16px; }
.report-doc .rp-hero { display: flex; gap: 14px; flex-wrap: wrap; background: var(--paper); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.report-doc .rp-hero div { flex: 1 1 110px; }
.report-doc .rp-hero span { display: block; font-size: .78rem; color: var(--ink3); font-weight: 700; }
.report-doc .rp-hero b { font-size: 1.42rem; font-variant-numeric: tabular-nums; }
.report-doc .rp-hero b small { font-size: .8rem; color: var(--ink3); margin-left: 2px; }
.report-doc table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.report-doc th, .report-doc td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.report-doc th { font-size: .78rem; color: var(--ink3); }
.report-doc td { font-variant-numeric: tabular-nums; }
.report-doc .rp-foot { margin-top: 16px; font-size: .78rem; color: var(--ink3); }
.report-doc .rp-note { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--paper); font-size: .8rem; color: var(--ink2); }

/* 토스트 */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: rgba(17, 33, 26, .95); color: #F6FBF7; padding: 14px 22px; border-radius: 999px;
  font-weight: 700; font-size: .95rem; z-index: 180; max-width: calc(100% - 32px); text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: toastIn .2s ease-out;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ------------------------------------------------------------------ 반응형 */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-grid .today { order: -1; }
  .hero { padding-top: 26px; }
  .hero h1 { font-size: clamp(2.2rem, 9vw, 3rem); }
  .lead { max-width: none; font-size: 1.02rem; }
  .price-grid { grid-template-columns: 1fr; }
  .pay-grid { grid-template-columns: minmax(0, 1fr); }
  .pay-grid.tight { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .pay-steps { min-width: 0; }
  .pay-steps > p:not(.pay-small) { display: block; position: relative; padding-left: 36px; }
  .pay-steps > p:not(.pay-small) > b:first-child { position: absolute; left: 0; top: 0; }

  .pay-qr { flex-direction: row; justify-content: flex-start; gap: 16px; }
  .pay-qr img { width: 132px; height: 132px; }
  .fam-grid { grid-template-columns: 1fr 1fr; }
  .demo-grid { grid-template-columns: 1fr; }
  .ocr-grid { grid-template-columns: 1fr; }
  .rep-sum { grid-template-columns: 1fr 1fr; }
  .topnav { display: none; }
  .sec { padding: 54px 0; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .topbar-in { min-height: 66px; gap: 10px; }
  .brand-txt b { font-size: 1.1rem; }
  .brand-txt i { font-size: .68rem; }
  .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
  .brand-mark svg { width: 24px; height: 24px; }
  .topbar-right .pill { display: none; }
  .today { padding: 18px 16px; }
  .bp-big b { font-size: 3rem; }
  .bp-big .slash { font-size: 2.1rem; }
  .today-actions .btn { min-height: 56px; font-size: .95rem; }
  .hero-sub { margin-left: 0; width: 100%; }
  .hero-sub .btn { flex: 1 1 auto; }
  .modal-card { padding: 22px 16px max(18px, env(safe-area-inset-bottom)); }
  .fam-grid { grid-template-columns: 1fr; }
  .fam-card { min-height: 0; }
  .field-grid { grid-template-columns: 1fr; }
  .rep-sum { grid-template-columns: 1fr 1fr; }
  .ocr-fields { grid-template-columns: 1fr 1fr; }
  .ocr-fields.three { grid-template-columns: 1fr 1fr; }
  .price-num { font-size: 2.25rem; }
  .stepper button { width: 54px; height: 54px; font-size: 1.5rem; }
  .stepper input { min-height: 76px; font-size: 2.3rem; max-width: 170px; }
  .entry-row { grid-template-columns: 1fr; }
  .med-chip { min-height: 54px; font-size: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------------ 인쇄 */
@media print {
  html, body { background: #FFFFFF !important; }
  body > *:not(#reportModal) { display: none !important; }
  #reportModal { position: static; display: block !important; background: #FFFFFF; }
  #reportModal .modal-mask, .report-toolbar { display: none !important; }
  #reportModal .modal-card {
    box-shadow: none; max-height: none; padding: 0; max-width: none;
    border-radius: 0; background: #FFFFFF;
  }
  .report-doc { border: 0; padding: 0; }
  .report-doc .rp-hero { background: #F4F1E8; }
  @page { margin: 14mm; }
}
