/* ==========================================================================
   HemoWallet — 디자인 시스템
   모바일 퍼스트(환자 앱) + 데스크톱 데이터 화면(기업 대시보드) 공통 토큰.
   컬러: Kick-off 문서 다이어그램의 Navy(Enterprise)·Mint(Patient) 팔레트를
   dataviz 검증 팔레트의 blue/aqua 슬롯과 정합시켜 사용.
   ========================================================================== */

:root {
  color-scheme: light;

  /* --- Surface / Ink --- */
  --surface-0: #f5f8f7;      /* 앱 배경 */
  --surface-1: #ffffff;      /* 카드 */
  --surface-2: #eef3f2;      /* 은은한 구획 배경 */
  --surface-sunken: #e8eef0; /* 입력창 등 오목한 배경 */
  --border: #dfe6e4;
  --border-strong: #c7d2cf;

  --text-primary: #0e1f2b;
  --text-secondary: #4c5f66;
  --text-muted: #7c8b90;
  --text-inverse: #ffffff;

  /* --- Brand --- */
  --ink: #143850;            /* 헤딩·로고 톤(Navy) */
  --enterprise: #2a78d6;     /* 검증 팔레트 slot1 blue — 기업 영역 */
  --enterprise-dark: #184f95;
  --enterprise-wash: #e8f1fb;
  --patient: #1baf7a;        /* 검증 팔레트 slot3 aqua — 환자 영역 */
  --patient-dark: #128a5f;
  --patient-wash: #e2f6ee;
  --accent: #eb6834;         /* 검증 팔레트 slot2 orange — CTA/강조 */
  --accent-wash: #fdece2;

  /* --- Status(고정) --- */
  --good: #0ca30c;
  --warning: #c98500;
  --serious: #ec835a;
  --critical: #d03b3b;
  --critical-wash: #fbe9e8;

  /* --- Radius / Shadow / Space --- */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(14, 31, 43, 0.06), 0 1px 1px rgba(14, 31, 43, 0.04);
  --shadow-md: 0 8px 24px rgba(14, 31, 43, 0.10), 0 2px 6px rgba(14, 31, 43, 0.06);
  --shadow-lg: 0 24px 60px rgba(14, 31, 43, 0.16), 0 6px 16px rgba(14, 31, 43, 0.08);
  --shadow-nav: 0 -2px 12px rgba(14, 31, 43, 0.08);
  --header-h: 56px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface-0: #0c1417;
    --surface-1: #131e22;
    --surface-2: #182226;
    --surface-sunken: #0f1a1d;
    --border: #24333770;
    --border-strong: #2e4247;
    --text-primary: #eef4f3;
    --text-secondary: #a9bdc1;
    --text-muted: #7c9095;
    --text-inverse: #0e1f2b;
    --ink: #cfe3ee;
    --enterprise: #3987e5;
    --enterprise-wash: #142433;
    --patient: #22c48c;
    --patient-wash: #102821;
    --accent: #ef7c4c;
    --accent-wash: #2b1c14;
    --critical-wash: #2b1614;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-0: #0c1417;
  --surface-1: #131e22;
  --surface-2: #182226;
  --surface-sunken: #0f1a1d;
  --border: #24333770;
  --border-strong: #2e4247;
  --text-primary: #eef4f3;
  --text-secondary: #a9bdc1;
  --text-muted: #7c9095;
  --text-inverse: #0e1f2b;
  --ink: #cfe3ee;
  --enterprise: #3987e5;
  --enterprise-wash: #142433;
  --patient: #22c48c;
  --patient-wash: #102821;
  --accent: #ef7c4c;
  --accent-wash: #2b1c14;
  --critical-wash: #2b1614;
}

/* --- Reset --- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard Variable", Pretendard,
               "Apple SD Gothic Neo", "Segoe UI", Roboto, "Malgun Gothic", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--patient-wash); }

/* --- Layout helpers --- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap-xs { gap: 6px; } .gap-sm { gap: 10px; } .gap-md { gap: 16px; } .gap-lg { gap: 24px; }
.grow { flex: 1; }
.center { text-align: center; }
.muted { color: var(--text-secondary); }
.faint { color: var(--text-muted); }
.hide-mobile { display: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
@media (min-width: 860px) {
  .hide-mobile { display: initial; }
  .hide-desktop { display: none; }
}

/* --- Typography scale --- */
.h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); line-height: 1.25; }
.h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); line-height: 1.3; }
.h3 { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--patient-dark);
}
.lede { font-size: 16px; color: var(--text-secondary); }
@media (min-width: 640px) {
  .h1 { font-size: 40px; }
  .h2 { font-size: 27px; }
}
@media (min-width: 1024px) {
  .h1 { font-size: 50px; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 20px; border-radius: var(--r-pill);
  font-weight: 700; font-size: 15px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
  -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-primary { background: var(--patient); color: #ffffff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-enterprise { background: var(--enterprise); color: #ffffff; box-shadow: var(--shadow-sm); }
.btn-enterprise:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: #ffffff; }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text-primary); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-danger { background: transparent; border-color: var(--critical); color: var(--critical); }
.btn-icon { width: 44px; height: 44px; padding: 0; border-radius: var(--r-pill); background: var(--surface-2); }

/* --- Cards --- */
.card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm);
}
.card-flat { background: var(--surface-2); border-radius: var(--r-md); padding: 16px; }
.card-link { transition: box-shadow .15s ease, transform .15s ease; }
.card-link:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.card-link:active { transform: scale(0.985) translateY(0); }

/* --- Badges / status chips --- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px;
  border-radius: var(--r-pill); font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-patient { background: var(--patient-wash); color: var(--patient-dark); }
.badge-enterprise { background: var(--enterprise-wash); color: var(--enterprise-dark); }
.badge-accent { background: var(--accent-wash); color: var(--accent); }
.badge-good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.badge-warning { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.badge-critical { background: var(--critical-wash); color: var(--critical); }
.badge-neutral { background: var(--surface-2); color: var(--text-secondary); }

/* --- Forms --- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.field .hint { font-size: 12.5px; color: var(--text-muted); }
.input, .select, textarea.input {
  height: 50px; border-radius: var(--r-sm); border: 1.5px solid var(--border-strong);
  background: var(--surface-sunken); padding: 0 16px; font-size: 15.5px; color: var(--text-primary);
  outline: none; transition: border-color .12s ease, background .12s ease; width: 100%;
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--patient); background: var(--surface-1); }
textarea.input { height: auto; min-height: 96px; padding: 14px 16px; resize: vertical; font-family: inherit; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%234c5f66'%3E%3Cpath d='M5.5 7.5l4.5 4.5 4.5-4.5' stroke='%234c5f66' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.error-text { font-size: 13px; color: var(--critical); min-height: 1.4em; }

.choice-grid { display: grid; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1.5px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface-1); cursor: pointer; transition: border-color .12s ease, background .12s ease;
}
.choice input { accent-color: var(--patient); width: 18px; height: 18px; flex-shrink: 0; }
.choice:has(input:checked) { border-color: var(--patient); background: var(--patient-wash); }
.choice .choice-text { display: flex; flex-direction: column; gap: 2px; }
.choice .choice-text small { color: var(--text-muted); font-weight: 400; }

/* --- Progress --- */
.progress-track { height: 8px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.progress-fill { height: 100%; border-radius: var(--r-pill); background: var(--patient); transition: width .3s ease; }
.progress-fill.enterprise { background: var(--enterprise); }

/* --- App shell: header --- */
.app-header {
  position: sticky; top: 0; z-index: 30; height: calc(var(--header-h) + var(--safe-t));
  padding-top: var(--safe-t);
  display: flex; align-items: center; background: color-mix(in srgb, var(--surface-0) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.app-header .wrap { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; color: var(--ink); }
.brand .logo-dot { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); position: relative; flex-shrink: 0; }
.brand .logo-dot::after {
  content: ""; position: absolute; inset: 6px; border-radius: 50%;
  border: 2.4px solid var(--patient); background: transparent;
}

/* --- Bottom tab bar (patient mobile nav) --- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--surface-1); border-top: 1px solid var(--border); box-shadow: var(--shadow-nav);
  display: flex;
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 11px; font-weight: 600; color: var(--text-muted); position: relative;
}
.tabbar a.active { color: var(--patient-dark); }
.tabbar a svg { width: 23px; height: 23px; }
.tabbar .dot-alert {
  position: absolute; top: 6px; right: calc(50% - 16px); width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--surface-1);
}
.app-main { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px); min-height: 60vh; }
.app-main.no-tabbar { padding-bottom: calc(40px + var(--safe-b)); }

/* --- Enterprise shell: sidebar --- */
.ent-shell { display: flex; min-height: 100vh; background: var(--surface-0); }
.ent-sidebar {
  width: 252px; flex-shrink: 0; background: var(--surface-1); border-right: 1px solid var(--border);
  padding: 18px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
}
.ent-sidebar .brand { padding: 6px 10px 16px; }
.ent-tenant-chip {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px; margin-bottom: 14px;
  background: var(--surface-2); border-radius: var(--r-md);
}
.ent-tenant-avatar {
  width: 32px; height: 32px; border-radius: 9px; background: var(--enterprise); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex-shrink: 0;
}
.ent-tenant-chip .name { font-size: 13px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.ent-tenant-chip .role { font-size: 11.5px; color: var(--text-muted); }
.ent-nav-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); padding: 14px 12px 6px;
}
.ent-nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--r-sm);
  font-size: 14.5px; font-weight: 600; color: var(--text-secondary); position: relative;
  transition: background .12s ease, color .12s ease;
}
.ent-nav a svg { width: 19px; height: 19px; flex-shrink: 0; }
.ent-nav a.active { background: var(--enterprise-wash); color: var(--enterprise-dark); font-weight: 700; }
.ent-nav a.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--enterprise);
}
.ent-nav a:hover:not(.active) { background: var(--surface-2); color: var(--text-primary); }
.ent-main { flex: 1; min-width: 0; padding: 28px 32px 60px; }
.ent-topbar { display: none; }

@media (max-width: 900px) {
  .ent-sidebar { display: none; }
  .ent-main { padding: 0 0 calc(90px + var(--safe-b)); }
  .ent-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: calc(14px + var(--safe-t)) 18px 14px; border-bottom: 1px solid var(--border);
    background: var(--surface-1); position: sticky; top: 0; z-index: 20;
  }
  .ent-topbar-inner { padding: 20px 18px 0; }
}

/* --- Tables --- */
.table-scroll { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--border); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
table.data th {
  text-align: left; padding: 12px 14px; background: var(--surface-2); color: var(--text-secondary);
  font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--surface-2); }

/* --- Chart primitives (dataviz skill mark specs) --- */
.viz-root { --gap: 2px; }
.funnel { display: flex; align-items: flex-end; gap: 14px; padding: 6px 2px 0; overflow-x: auto; }
.funnel-col { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 56px; flex: 1; }
.funnel-bar-track {
  width: 100%; max-width: 24px; height: 168px; display: flex; align-items: flex-end;
  border-radius: 4px 4px 0 0; cursor: default;
}
.funnel-bar-track:focus-visible { outline: 2px solid var(--enterprise); outline-offset: 3px; border-radius: 4px; }
.funnel-bar {
  width: 100%; border-radius: 4px 4px 0 0; background: var(--enterprise);
  transition: height .4s ease, opacity .12s ease; min-height: 3px;
}
.funnel-bar-track:hover .funnel-bar, .funnel-bar-track:focus-visible .funnel-bar { opacity: 0.75; }
.funnel-bar.stage-withdrawn { background: var(--critical); }
.funnel-value { font-size: 15px; font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.funnel-label { font-size: 11.5px; color: var(--text-secondary); text-align: center; line-height: 1.3; }
.funnel-pct { font-size: 10.5px; color: var(--text-muted); }

.hbar-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 7px 0; }
.hbar-label { font-size: 13.5px; color: var(--text-primary); }
.hbar-track {
  grid-column: 1 / -1; height: 10px; border-radius: 4px; background: var(--surface-2); overflow: hidden;
  cursor: default;
}
.hbar-track:focus-visible { outline: 2px solid var(--enterprise); outline-offset: 2px; }
.hbar-track:hover .hbar-fill, .hbar-track:focus-visible .hbar-fill { opacity: 0.8; }
.hbar-fill { height: 100%; border-radius: 4px; background: var(--patient); transition: opacity .12s ease; }
.hbar-fill.enterprise { background: var(--enterprise); }
.hbar-value { font-size: 12.5px; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }

.stat-tile { display: flex; flex-direction: column; gap: 10px; }
.stat-tile .icon-chip {
  width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: var(--enterprise-wash); color: var(--enterprise-dark); flex-shrink: 0;
}
.stat-tile .icon-chip svg { width: 17px; height: 17px; }
.stat-tile .icon-chip.patient { background: var(--patient-wash); color: var(--patient-dark); }
.stat-tile .icon-chip.accent { background: var(--accent-wash); color: var(--accent); }
.stat-tile .icon-chip.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.stat-tile .icon-chip.critical { background: var(--critical-wash); color: var(--critical); }
.stat-tile .label { font-size: 12.5px; font-weight: 700; color: var(--text-secondary); }
.stat-tile .value { font-size: 30px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.stat-tile .delta { font-size: 12.5px; font-weight: 700; }
.stat-tile .delta.up { color: var(--good); }
.stat-tile .delta.down { color: var(--critical); }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }

.scale-dist { display: flex; align-items: flex-end; gap: 6px; height: 64px; }
.scale-dist .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.scale-dist .bar { width: 100%; border-radius: 3px 3px 0 0; background: var(--patient); min-height: 2px; }
.scale-dist .n { font-size: 10.5px; color: var(--text-muted); }

/* --- 범용 아이콘 칩(건강기록 목록 등) --- */
.chip-icon {
  width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: var(--patient-wash); color: var(--patient-dark); flex-shrink: 0;
}
.chip-icon.muted-chip { background: var(--surface-2); color: var(--text-muted); }
.chip-icon.enterprise { background: var(--enterprise-wash); color: var(--enterprise-dark); }

/* --- 로그인 방식 탭(segmented) --- */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--r-pill); }
.seg button {
  flex: 1; height: 42px; border: 0; border-radius: var(--r-pill); background: transparent; cursor: pointer;
  font-weight: 700; font-size: 14.5px; color: var(--text-secondary); transition: background .12s ease, color .12s ease;
}
.seg button[aria-selected="true"] { background: var(--surface-1); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg button:focus-visible { outline: 2px solid var(--patient); outline-offset: 2px; }

/* --- 운영팀 미리보기 중 떠 있는 '돌아가기' --- */
.preview-pill {
  position: fixed; right: 14px; bottom: calc(var(--safe-b) + 16px); z-index: 120; display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 16px; border-radius: var(--r-pill); background: var(--ink); color: #fff;
  box-shadow: var(--shadow-md); font-size: 12.5px; font-weight: 700;
}
.preview-pill a { background: #fff; color: #0e2433; border-radius: var(--r-pill); padding: 8px 14px; font-weight: 800; white-space: nowrap; }
@media (max-width: 900px) { .preview-pill { bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); left: 14px; justify-content: space-between; } }

/* --- Empty / toast / modal --- */
.empty { text-align: center; padding: 48px 20px; color: var(--text-secondary); }
.empty svg { width: 56px; height: 56px; margin: 0 auto 14px; opacity: 0.5; }

.toast-host { position: fixed; top: calc(var(--safe-t) + 14px); left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast {
  background: var(--ink); color: #fff; padding: 13px 18px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-md); animation: toast-in .25s ease;
}
.toast.error { background: var(--critical); }
.toast.success { background: var(--patient-dark); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(10, 18, 22, 0.5); z-index: 80; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 81; background: var(--surface-1);
  border-radius: 22px 22px 0 0; padding: 22px 20px calc(24px + var(--safe-b)); max-height: 82vh; overflow-y: auto;
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s linear .28s;
  box-shadow: var(--shadow-md); visibility: hidden;   /* 닫힌 시트의 입력칸이 키보드 포커스를 받지 않게 */
}
.sheet.open { transform: translateY(0); visibility: visible; transition: transform .28s cubic-bezier(.2,.8,.2,1); }
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 0 auto 16px; }

/* 결과 목록처럼 길어질 수 있는 오른쪽 패널 — 넓은 화면에서는 따라다니되, 화면보다 길면 안에서 스크롤한다 */
@media (min-width: 900px) {
  .sticky-side { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; }
}

/* --- Landing page: 히어로 동영상 --- */
.hero-video {
  position: relative; isolation: isolate; overflow: hidden; background: #08182a; color: #fff;
  display: flex; align-items: center;
  /* 영상 비율(16:9)에 가깝게 — 아주 넓은 화면에서 위아래가 많이 잘려 헤더와 겹치는 것을 막는다 */
  min-height: clamp(580px, min(56.25vw, 92vh), 1400px);
  /* 투명 헤더 아래까지 영상이 깔리도록 헤더 높이만큼 끌어올린다 */
  margin-top: calc(-1 * (var(--header-h) + var(--safe-t)));
  padding: calc(var(--header-h) + var(--safe-t) + 32px) 0 108px;
}
.hero-video__media {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2;
  object-fit: cover; object-position: 72% 30%; background: #08182a;
}
.hero-video__scrim {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7,20,32,.92) 0%, rgba(7,20,32,.76) 34%, rgba(7,20,32,.22) 62%, rgba(7,20,32,0) 80%),
    linear-gradient(0deg, rgba(7,20,32,.88) 0%, rgba(7,20,32,0) 30%);
}
.hero-video > .wrap { width: 100%; }          /* flex 자식이 내용 폭으로 줄어 가운데로 쏠리지 않게 */
.hero-video__copy { max-width: 560px; }
.hero-video__copy .lede { max-width: 480px; margin-top: 14px; }
.hero-video .h1 { color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,.28); }
.hero-video .lede { color: rgba(255,255,255,.84); }
.hero-video .badge-neutral { background: rgba(255,255,255,.14); color: rgba(255,255,255,.9); }
.hero-video .badge-patient { background: rgba(27,175,122,.22); color: #86e8c0; }
.btn-hero-outline { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.42); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.btn-hero-outline:hover { background: rgba(255,255,255,.16); }
.hero-video__trust { position: absolute; left: 0; right: 0; bottom: 26px; }
.hero-video__trust ul { display: flex; flex-wrap: wrap; gap: 10px 28px; max-width: 580px; }   /* 영상 오른쪽 패널을 가리지 않는 폭 */
.hero-video__trust li { display: flex; align-items: flex-start; gap: 9px; max-width: 276px; font-size: 12.5px; line-height: 1.5; color: rgba(255,255,255,.76); }
.hero-video__trust li svg { flex-shrink: 0; margin-top: 2px; color: #86e8c0; }
.hero-video__trust strong { color: #fff; font-weight: 700; }
.hero-video__toggle {
  position: absolute; right: 20px; bottom: 22px; width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: rgba(8,24,42,.55); border: 1px solid rgba(255,255,255,.3); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hero-video__toggle[hidden] { display: none; }
.hero-video__toggle:hover { background: rgba(8,24,42,.8); }
.hero-video__toggle:focus-visible { outline: 2px solid #86e8c0; outline-offset: 3px; }

/* 영상 위의 헤더: 투명 + 흰 글자 → 스크롤하면 기존 불투명 헤더로 */
.app-header.app-header--hero { transition: background .2s ease, border-color .2s ease; }
.app-header.app-header--hero:not(.is-solid) {
  background: transparent; border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
}
.app-header--hero:not(.is-solid) .brand { color: #fff; }
.app-header--hero:not(.is-solid) nav a { color: rgba(255,255,255,.84); }
.app-header--hero:not(.is-solid) nav a:hover { color: #fff; }
.app-header--hero:not(.is-solid) .btn-ghost { color: #fff; }

@media (max-width: 1100px) {
  /* 좁은 화면에서는 영상의 패널이 문구 뒤로 들어오므로 왼쪽 스크림을 더 넓고 진하게 */
  .hero-video__scrim { background:
    linear-gradient(90deg, rgba(7,20,32,.94) 0%, rgba(7,20,32,.84) 46%, rgba(7,20,32,.4) 74%, rgba(7,20,32,.12) 100%),
    linear-gradient(0deg, rgba(7,20,32,.88) 0%, rgba(7,20,32,0) 30%); }
}
@media (max-width: 767px) {
  .hero-video { min-height: 0; padding-bottom: 32px; flex-direction: column; align-items: stretch; justify-content: center; }
  .hero-video__media { object-position: 76% center; }
  .hero-video__scrim { background: linear-gradient(180deg, rgba(7,20,32,.88) 0%, rgba(7,20,32,.8) 55%, rgba(7,20,32,.94) 100%); }
  .hero-video__trust { position: static; margin-top: 30px; }
  .hero-video__trust ul { flex-direction: column; gap: 10px; max-width: none; }
  .hero-video__trust li { max-width: none; }
  .hero-video__toggle { top: calc(var(--header-h) + var(--safe-t) + 8px); bottom: auto; right: 14px; }
}
@media (prefers-reduced-motion: reduce) { .hero-video__toggle { display: none; } }

/* --- Landing page --- */
.hero { position: relative; padding: 64px 0 44px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset: -140px -10% auto -10%; height: 620px;
  background:
    radial-gradient(560px 340px at 12% 15%, color-mix(in srgb, var(--patient) 17%, transparent), transparent 68%),
    radial-gradient(520px 340px at 88% 5%, color-mix(in srgb, var(--enterprise) 15%, transparent), transparent 68%);
}
.hero-badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.split { display: grid; gap: 40px; }
@media (min-width: 900px) { .split-2 { grid-template-columns: 1.1fr 0.9fr; align-items: center; } }
.section { padding: 52px 0; }
.section-alt { background: var(--surface-2); }
.pill-nav { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.pill-nav a {
  flex-shrink: 0; padding: 9px 16px; border-radius: var(--r-pill); background: var(--surface-2);
  font-size: 13.5px; font-weight: 700; color: var(--text-secondary);
}

/* --- Tabs (프로젝트 서브 내비 등 underline 스타일) --- */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a {
  flex-shrink: 0; display: flex; align-items: center; gap: 7px; padding: 4px 2px 13px;
  font-size: 14px; font-weight: 700; color: var(--text-muted); border-bottom: 2.5px solid transparent;
  transition: color .12s ease, border-color .12s ease; margin-bottom: -1px;
}
.tabs a svg { width: 16px; height: 16px; }
.tabs a:hover { color: var(--text-primary); }
.tabs a.active { color: var(--enterprise-dark); border-color: var(--enterprise); }
.feature-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.step-list { counter-reset: step; display: flex; flex-direction: column; gap: 0; position: relative; }
.step-list::before {
  content: ""; position: absolute; left: 17px; top: 17px; bottom: 17px; width: 2px; background: var(--border);
}
.step-list li { counter-increment: step; display: flex; gap: 16px; padding: 18px 0; position: relative; }
.step-list li:last-child { border-bottom: none; }
.step-list .num {
  width: 34px; height: 34px; border-radius: 50%; background: var(--patient-wash); color: var(--patient-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0;
  position: relative; z-index: 1; box-shadow: 0 0 0 5px var(--surface-1);
}
.section-alt .step-list .num { box-shadow: 0 0 0 5px var(--surface-2); }
.step-list li::before { content: none; }
.logo-strip { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; opacity: 0.72; font-weight: 700; color: var(--text-muted); font-size: 13px; }

.site-footer { border-top: 1px solid var(--border); padding: 36px 0 calc(36px + var(--safe-b)); }
.footer-grid { display: grid; gap: 24px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
.footer-grid a { display: block; padding: 5px 0; color: var(--text-secondary); font-size: 13.5px; }

/* --- Utility text sizes --- */
details.faq > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
details.faq > summary::-webkit-details-marker { display: none; }
details.faq .chev { flex-shrink: 0; color: var(--text-muted); transition: transform .18s ease; }
details.faq[open] .chev { transform: rotate(180deg); }

.text-xs { font-size: 12px; } .text-sm { font-size: 13.5px; } .text-lg { font-size: 17px; }
.fw-700 { font-weight: 700; } .fw-800 { font-weight: 800; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* --- QR display --- */
.qr-frame {
  background: #fff; border-radius: var(--r-lg); padding: 20px; display: flex; justify-content: center;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.qr-frame img { width: 100%; max-width: 240px; }

/* --- Consent doc block --- */
.consent-doc {
  background: var(--surface-2); border-radius: var(--r-md); padding: 18px 20px; font-size: 14px;
  color: var(--text-secondary); white-space: pre-line; max-height: 340px; overflow-y: auto; line-height: 1.7;
}

/* --- Skip link (a11y) --- */
.skip-link {
  position: absolute; left: 12px; top: -48px; background: var(--ink); color: #fff; padding: 10px 16px;
  border-radius: var(--r-sm); z-index: 200; transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* --- Wizard(Toss 스타일 단계별 입력 폼) --- */
.wizard { max-width: 560px; margin: 0 auto; }
.wizard-top { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.wizard-back {
  width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-secondary); flex-shrink: 0; border: none; cursor: pointer;
}
.wizard-progress { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.wizard-progress-fill { height: 100%; border-radius: 2px; background: var(--enterprise); transition: width .3s ease; }
.wizard-step-count { font-size: 12.5px; font-weight: 700; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.wizard-body { padding-bottom: 120px; }
.wizard-step { display: none; }
.wizard-step.active { display: block; animation: wizard-in .3s ease; }
@keyframes wizard-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.wizard-q { font-size: 25px; font-weight: 800; color: var(--ink); letter-spacing: -0.01em; line-height: 1.35; margin-bottom: 14px; }
.wizard-why {
  display: flex; gap: 10px; align-items: flex-start; background: var(--enterprise-wash); color: var(--enterprise-dark);
  border-radius: var(--r-md); padding: 14px 16px; font-size: 13.5px; line-height: 1.6; margin-bottom: 26px;
}
.wizard-why svg { flex-shrink: 0; margin-top: 2px; }
.wizard-live-count { margin-top: 18px; font-size: 13px; font-weight: 700; color: var(--enterprise-dark); }
.wizard-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 18px 32px calc(18px + var(--safe-b));
  background: linear-gradient(to top, var(--surface-0) 55%, transparent);
}
@media (min-width: 901px) { .wizard-footer { left: 252px; } }
.wizard-footer .inner { max-width: 560px; margin: 0 auto; }

/* --- 데이터 툴팁(차트 막대 호버/포커스) --- */
.data-tip {
  position: fixed; z-index: 120; transform: translate(-50%, -100%); pointer-events: none;
  background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 700; padding: 6px 11px;
  border-radius: 8px; white-space: nowrap; opacity: 0; transition: opacity .1s ease;
  box-shadow: var(--shadow-md); margin-top: -8px;
}
.data-tip.show { opacity: 1; }

/* --- Install banner --- */
.install-banner {
  position: fixed; left: 14px; right: 14px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); z-index: 50;
  background: var(--ink); color: #fff; border-radius: var(--r-md); padding: 14px 16px;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-md);
  transform: translateY(140%); transition: transform .3s ease;
}
.install-banner.show { transform: translateY(0); }
.install-banner .txt { flex: 1; font-size: 13px; }
.install-banner strong { display: block; font-size: 14px; margin-bottom: 2px; }
