@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

/* ===================================================================
   본향한의원 사상체질 설문 — 비주얼 테마 (구조/클래스 동일, 스타일만)
   브랜드 컬러: 브라운(#6b5749) + 샌드베이지(#c9bca0) + 웜 크림
   =================================================================== */
:root {
  --bg: #f1ebe1;
  --bg-grad-1: #f6f1e8;
  --bg-grad-2: #ebe3d4;
  --card: #fffdf9;
  --line: #eae1d1;
  --line-soft: #f3ede2;
  --ink: #2a2019;
  --muted: #867b6c;
  --faint: #ab9f8d;
  --accent: #5e4736;
  --accent-strong: #44321f;
  --accent-soft: #efe6d9;
  --accent-tint: #f8f3eb;
  --tan: #b1936e;
  --tan-light: #ddd0b6;
  --gold: #bf9a57;
  --warn: #b4451f;
  --warn-soft: #f7e6dd;
  --ok: #5e7c4f;
  --ok-soft: #e9efe2;
  --ok-ink: #4a6b3a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(58,42,28,.05), 0 2px 6px rgba(58,42,28,.045);
  --shadow: 0 4px 12px rgba(58,42,28,.06), 0 16px 38px rgba(58,42,28,.07);
  --shadow-lg: 0 10px 28px rgba(58,42,28,.12), 0 28px 64px rgba(58,42,28,.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", system-ui, sans-serif;
  background: linear-gradient(180deg, var(--bg-grad-1), var(--bg-grad-2)) fixed;
  color: var(--ink);
  line-height: 1.65;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── 상단바 ─────────────────────────────────────────────── */
.topbar {
  background: linear-gradient(120deg, #6b5749 0%, #4f4035 100%);
  color: #fff;
  padding: 16px 0;
  position: sticky; top: 0; z-index: 20;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 6px 18px rgba(82,66,54,.20);
  cursor: pointer;
}
.topbar:hover { filter: brightness(1.06); }
/* 헤더 텍스트를 본문 카드와 같은 좌측 라인(740px 컨테이너)에 맞춤 */
.topbar-inner { max-width: 740px; margin: 0 auto; padding: 0 18px; }
.topbar .brand { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 28px; height: 28px; border-radius: 8px; flex: 0 0 auto; box-shadow: 0 2px 6px rgba(0,0,0,.28); }
.brand-div { font-weight: 500; opacity: .9; }
.brand-div::before { content: "·"; margin: 0 6px; opacity: .55; }
.topbar .sub { font-size: 12.5px; opacity: .8; margin-top: 4px; margin-left: 38px; font-weight: 400; }

.wrap { max-width: 740px; margin: 0 auto; padding: 26px 18px 80px; }

/* ── 카드 ───────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 26px;
  margin: 0 0 16px;
  transition: box-shadow .2s ease;
}
/* fieldset(q-card) 기본 여백·min-width 제거 → 다른 카드와 좌우 정렬 일치 */
fieldset.card, .q-card { min-width: 0; margin-inline: 0; }
.q-card .q-title { display: block; width: 100%; }
.cover {
  background: linear-gradient(180deg, #ffffff, var(--accent-tint));
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.cover::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--tan), var(--gold));
}
.cover h1 { margin: 6px 0 10px; font-size: 27px; font-weight: 800; letter-spacing: -0.035em; }
.lead { color: var(--muted); margin: 0 0 16px; font-size: 15px; }
.notice { margin: 0; padding: 0; list-style: none; }
.notice li { position: relative; padding-left: 22px; margin-bottom: 7px; color: var(--muted); font-size: 13.5px; }
.notice li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .55; }

.block-title { font-size: 17px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.02em; }
.block-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 16px; }

/* ── 기본정보 폼 ────────────────────────────────────────── */
.id-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--accent-strong); letter-spacing: -0.01em; }
.field input[type=text], .field input[type=tel], .field input[type=email], .login-box input {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 14px; font-size: 15px; font-family: inherit;
  background: #fcfbf9; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field input::placeholder { color: var(--faint); }
.field input:focus, .login-box input:focus, .search-row input:focus {
  outline: none; border-color: var(--accent);
  background: #fff; box-shadow: 0 0 0 4px var(--accent-soft);
}
.gender-row { display: flex; gap: 10px; }
.gender-row label {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px;
  cursor: pointer; font-weight: 600; color: var(--ink); background: #fcfbf9;
  transition: all .15s ease;
}
.gender-row input { accent-color: var(--accent); }
.gender-row label:hover { border-color: var(--accent); }
.gender-row label.checked { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 1px var(--accent); }
/* 추가 건강 정보(intake) 폼 */
.check-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 14px; padding: 8px 0 0; }
.check-grid label { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--ink); cursor: pointer; }
.check-grid input { accent-color: var(--accent); }
.select-input { border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 15px; font-family: inherit; background: #fbfcfb; color: var(--ink); cursor: pointer; }
.select-input:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.text-area { min-height: 80px; resize: vertical; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 11px 13px; font-size: 14.5px; font-family: inherit; background: #fbfcfb; line-height: 1.55; }
.text-area:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
@media (max-width: 600px) { .check-grid { grid-template-columns: repeat(2, 1fr); } }

.consent {
  display: flex; gap: 11px; align-items: flex-start; margin-top: 18px; font-size: 13.5px;
  color: var(--muted); background: var(--accent-tint); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 14px 15px; cursor: pointer;
}
.consent input { margin-top: 3px; accent-color: var(--accent); width: 17px; height: 17px; }

/* ── 진행률 ─────────────────────────────────────────────── */
.progress-wrap { position: sticky; top: 64px; z-index: 15; margin-bottom: 16px; padding: 10px 14px; background: rgba(248,244,237,.88); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 99px; box-shadow: var(--shadow-sm); }
.progress-bar { height: 9px; background: var(--accent-soft); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--tan), var(--accent)); border-radius: 99px; transition: width .3s cubic-bezier(.4,0,.2,1); }
.progress-text { font-size: 11.5px; color: var(--muted); margin-top: 6px; text-align: right; font-weight: 600; letter-spacing: 0; }

/* ── 섹션 제목 ──────────────────────────────────────────── */
.section-title { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 800; color: var(--accent-strong); letter-spacing: .02em; margin: 32px 4px 12px; }
.section-title::before { content: ""; width: 18px; height: 3px; border-radius: 2px; background: var(--accent); }

/* ── 문항 카드 ──────────────────────────────────────────── */
.q-card { border: 1px solid var(--line); transition: border-color .2s ease, box-shadow .2s ease; }
.q-card.answered { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm); }
.q-title { font-weight: 700; font-size: 16.5px; padding: 0; letter-spacing: -0.02em; }
.q-hint { color: #4a453d; font-size: 13px; margin: 6px 0 13px; padding: 0; background: none; border: 0; }

.opts { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
/* 옵션이 많은 multi 문항 — 2단 그리드 */
.opts.opts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 10px; }
@media (max-width: 600px) { .opts.opts-grid { grid-template-columns: 1fr; } }
.opt {
  display: flex; align-items: flex-start; gap: 11px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 15px; cursor: pointer; background: #fcfbf9;
  transition: border-color .14s ease, background .14s ease, transform .06s ease;
}
.opt:hover { border-color: var(--accent); background: #fff; }
.opt:active { transform: scale(.995); }
.opt.checked { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.opt input { margin-top: 2px; accent-color: var(--accent); flex: 0 0 auto; width: 17px; height: 17px; }
.opt-label { font-size: 14.5px; line-height: 1.5; }

/* ── 버튼 ───────────────────────────────────────────────── */
.actions { display: flex; gap: 11px; margin: 22px 0 0; flex-wrap: wrap; }
.btn {
  font-family: inherit; font-size: 15px; font-weight: 700; border-radius: var(--radius-sm);
  padding: 14px 24px; cursor: pointer; border: 1.5px solid transparent;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: transform .08s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.btn.primary { background: linear-gradient(135deg, #6e533d 0%, var(--accent) 60%, var(--accent-strong) 100%); color: #fff; box-shadow: 0 4px 14px rgba(94,71,54,.28); }
.btn.primary:hover { filter: brightness(1.07); box-shadow: 0 7px 20px rgba(94,71,54,.36); transform: translateY(-1px); }
.btn.primary:active { transform: translateY(0); }
.btn.primary:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--muted); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent-strong); }

.submit-hint { font-size: 13.5px; color: var(--muted); margin-top: 12px; }
.submit-hint.warn { color: var(--warn); font-weight: 700; }
.footnote { text-align: center; color: var(--faint); font-size: 12px; padding: 24px; line-height: 1.7; }

/* ── 제출 완료 ──────────────────────────────────────────── */
.done { text-align: center; padding: 56px 24px; background: linear-gradient(180deg, #fff, var(--accent-tint)); }
.done h1 { font-size: 25px; margin: 0 0 10px; font-weight: 800; letter-spacing: -0.03em; }
.done p { color: var(--muted); font-size: 15px; }

/* ===================== 원장 페이지 ===================== */
.login-box { max-width: 420px; margin: 64px auto; box-shadow: var(--shadow); }
.login-box h1 { font-size: 22px; margin: 0 0 6px; font-weight: 800; letter-spacing: -0.03em; }
.login-box input { width: 100%; }
.search-row { display: flex; gap: 10px; }
.search-row input { flex: 1; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 13px 15px; font-size: 15px; font-family: inherit; background: #fcfbf9; }
.result-list { margin-top: 6px; }
.patient-row {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px;
  margin-bottom: 9px; cursor: pointer; background: #fcfbf9;
  transition: border-color .14s ease, background .14s ease, transform .08s ease, box-shadow .14s ease;
}
.patient-row:hover { border-color: var(--accent); background: #fff; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.pr-main { font-weight: 700; font-size: 15px; }
.pr-sub { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.pr-tag { font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent-strong); border-radius: 99px; padding: 5px 12px; white-space: nowrap; }
/* 데스크: 행 클릭 비활성(결과 페이지 없음) + 완료 칩 */
.desk-row { cursor: default; }
.desk-row:hover { transform: none; }
.pr-tag.tag-done { background: var(--ok-soft); color: var(--ok-ink); }
.muted-empty { color: var(--muted); font-size: 14px; padding: 14px 2px; }
.back-link { background: none; border: none; color: var(--accent-strong); cursor: pointer; font-size: 14px; font-weight: 600; padding: 4px 0; margin-bottom: 14px; display: inline-flex; align-items: center; gap: 4px; }
.back-link:hover { color: var(--accent); }

/* ── 결과 헤더 ──────────────────────────────────────────── */
.result-head { background: linear-gradient(165deg, #ffffff 0%, var(--accent-tint) 100%); position: relative; overflow: hidden; }
.result-head::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--accent), var(--tan), var(--gold)); }
.result-eyebrow { font-size: 11.5px; letter-spacing: .12em; color: var(--accent); font-weight: 800; text-transform: uppercase; }
.result-title { font-size: 34px; margin: 6px 0 6px; font-weight: 800; letter-spacing: -0.04em; }
.result-title .hanja { font-size: 18px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.patient-meta { font-size: 13px; color: var(--muted); margin-bottom: 12px; font-weight: 500; }
.gyeyeol-line { font-size: 16.5px; margin-bottom: 14px; font-weight: 600; }
.gyeyeol-line b { color: var(--accent-strong); }
.conf { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13.5px; padding: 8px 14px; border-radius: 99px; }
.conf .conf-detail { font-weight: 500; opacity: .9; font-size: 12px; }
.c-vhigh { background: var(--ok-soft); color: var(--ok-ink); } .c-high { background: #eef0e0; color: #6a6a2a; }
.c-mid { background: #f6eedd; color: #8a6a2a; } .c-low { background: var(--warn-soft); color: var(--warn); }
.conf-note { color: var(--muted); font-size: 14px; margin: 12px 0 0; }

/* ── 주의 노트 ──────────────────────────────────────────── */
.notes { border: 1px solid var(--warn-soft); border-left: 4px solid var(--warn); background: linear-gradient(180deg, #fff, #fdf6f2); }
.note-list { margin: 0; padding-left: 20px; } .note-list li { margin-bottom: 8px; font-size: 14px; }
.note-inline { background: var(--accent-tint); border-radius: 10px; padding: 10px 13px; font-size: 13.5px; margin: 10px 0; }

/* ── 진료 메모 + 리포트 활용 액션 카드 ──────────────────── */
.action-card { background: linear-gradient(135deg, var(--accent-tint), #fff); }
.action-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; }
.memo-box, .tool-box { display: flex; flex-direction: column; gap: 9px; }
.action-label { font-size: 12.5px; font-weight: 800; color: var(--accent-strong); letter-spacing: -0.01em; }
.muted-tiny { font-weight: 500; color: var(--faint); font-size: 11px; margin-left: 4px; }
.memo-area {
  min-height: 132px; resize: vertical; width: 100%;
  border: 1.5px solid #e7d9a8; border-radius: var(--radius-sm); padding: 13px 14px;
  font-family: inherit; font-size: 14px; line-height: 1.65; color: var(--ink);
  background: #fdf6df;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.03);
}
.memo-area::placeholder { color: #b6a373; }
.memo-area:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(176,136,66,.15); background: #fffbe9; }
.btn-sm { padding: 10px 16px; font-size: 14px; }
.tool-box .btn { width: 100%; }
.tool-hint { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
@media (max-width: 480px) { .action-grid { grid-template-columns: 1fr; } }

/* ── 원장 페이지: 검색은 760으로 헤더·카드 좌우 정렬 일치, 리포트만 1080 확장 ── */
.admin .wrap { max-width: 760px; }
.admin .topbar-inner { max-width: 760px; }
/* 리포트 화면일 때만 본문을 1080까지 확장 (사이드바 메모 2단 grid용) */
.admin .wrap.report-mode { max-width: 1080px; }
/* 카드는 wrap 폭 100% 사용 (강제 max-width 제거) */
.admin .wrap > .card { max-width: none; }

/* 리포트 2단 레이아웃: 본문(좌) + 사이드(우) */
.report-layout { display: flex; flex-direction: column; gap: 16px; }
.report-aside { order: -1; }
.report-aside .action-card { margin: 0; }
@media (min-width: 1080px) {
  .report-layout { display: grid; grid-template-columns: minmax(0,1fr) 308px; gap: 24px; align-items: start; }
  .report-aside { order: 0; position: sticky; top: 86px; }
  .report-aside .action-card { box-shadow: var(--shadow); }
  .report-aside .action-grid { grid-template-columns: 1fr; gap: 14px; }
  .report-aside .memo-area { min-height: 124px; }
}

/* ── 환자 응답 원문 흐름 ────────────────────────────────── */
.flow-row { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.flow-row:last-child { border-bottom: none; }
.flow-sec { font-size: 11.5px; color: #fff; background: var(--accent); font-weight: 700; padding: 3px 0; border-radius: 7px; text-align: center; height: fit-content; }
.flow-items { display: flex; flex-direction: column; gap: 5px; }
.flow-item { font-size: 14px; line-height: 1.5; }
.flow-item::before { content: "•"; color: var(--accent); font-weight: 700; margin-right: 7px; }

/* ── 판단 근거 ──────────────────────────────────────────── */
.evidence-group { margin-top: 16px; }
.eg-head { font-size: 12.5px; font-weight: 800; padding: 7px 12px; border-radius: 9px; margin-bottom: 10px; background: var(--accent-soft); color: var(--accent-strong); letter-spacing: -0.01em; }
.eg-head.ok { background: var(--ok-soft); color: var(--ok-ink); } .eg-head.no { background: var(--warn-soft); color: var(--warn); }
.ev-row { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.ev-row:last-child { border-bottom: none; }
.ev-sec { font-size: 11px; color: var(--faint); padding-top: 2px; font-weight: 600; }
.ev-ans { font-size: 14px; line-height: 1.5; }
.ev-clue { font-size: 12.5px; color: var(--accent-strong); margin-top: 3px; }
.ev-row.no .ev-clue { color: var(--muted); }
.ev-toward { font-size: 11px; font-weight: 700; background: #efe9e0; color: var(--muted); border-radius: 6px; padding: 2px 7px; margin-left: 5px; white-space: nowrap; }
.ev-row.no .ev-toward { background: var(--warn-soft); color: var(--warn); }

/* ── 점수 막대 ──────────────────────────────────────────── */
.score-row { display: grid; grid-template-columns: 92px 1fr 40px; align-items: center; gap: 12px; margin-bottom: 11px; }
.score-row.top .score-name { color: var(--accent-strong); font-weight: 800; }
.score-name { font-size: 14px; font-weight: 600; }
.score-name .rare { font-size: 10px; background: #efe9e0; color: var(--faint); border-radius: 5px; padding: 1px 6px; font-weight: 700; }
.score-track { background: var(--accent-soft); height: 16px; border-radius: 99px; overflow: hidden; }
.score-fill { height: 100%; background: linear-gradient(90deg, var(--tan-light), var(--tan)); border-radius: 99px; transition: width .5s cubic-bezier(.4,0,.2,1); }
.score-row.top .score-fill { background: linear-gradient(90deg, var(--tan), var(--accent-strong)); }
.score-val { text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; color: var(--muted); font-weight: 700; }

/* ── 4대 축 ─────────────────────────────────────────────── */
.axis-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.axis-cell { border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 14px 6px; text-align: center; background: #fcfbf9; }
.axis-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.axis-state { font-weight: 800; font-size: 14px; }
.axis-cell.ok { background: var(--ok-soft); border-color: #cdd9bf; } .axis-cell.ok .axis-state { color: var(--ok-ink); }
.axis-cell.no { background: var(--warn-soft); border-color: #e8c4b4; } .axis-cell.no .axis-state { color: var(--warn); }
.axis-cell.na { opacity: .5; }

/* ── 계열 ───────────────────────────────────────────────── */
.gyeyeol-head { font-size: 18px; margin-bottom: 8px; font-weight: 700; } .gyeyeol-name { font-weight: 800; }
.tag { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 99px; vertical-align: middle; margin-left: 6px; }
.tag.ok { background: var(--ok-soft); color: var(--ok-ink); } .tag.warn { background: #f6eedd; color: #8a6a2a; }
.rx { background: linear-gradient(135deg, var(--accent-tint), var(--accent-soft)); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 14px 16px; margin: 12px 0; }
.rx-label { font-size: 11.5px; color: var(--accent); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.rx-val { font-size: 15.5px; margin-top: 4px; font-weight: 600; }
.disclaimer { font-size: 12.5px; color: var(--warn); margin: 8px 0 0; }

/* ── 개요 ───────────────────────────────────────────────── */
.overview { display: grid; grid-template-columns: 132px 1fr; gap: 11px 16px; margin: 0; }
.overview dt { font-size: 13px; color: var(--accent-strong); font-weight: 700; }
.overview dd { font-size: 14px; margin: 0; line-height: 1.55; }

/* ── 반응형 ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .wrap { padding: 18px 14px 64px; }
  .card { padding: 18px; border-radius: 16px; }
  .cover h1 { font-size: 23px; }
  .id-grid { grid-template-columns: 1fr; }
  .actions { flex-direction: column; } .btn { width: 100%; }
  .result-title { font-size: 27px; }
  .axis-grid { grid-template-columns: repeat(2, 1fr); }
  .overview { grid-template-columns: 96px 1fr; }
  .progress-wrap { top: 60px; }
}

/* ===================================================================
   원장용(.admin) — 한의원 브랜딩 제거, 클리니컬(병원) 테마
   화이트 + 슬레이트 + 메디컬 블루. 변수 오버라이드로 전체 재색.
   =================================================================== */
.admin {
  --bg: #edf0f6;
  --bg-grad-1: #f4f6fb;
  --bg-grad-2: #e7ebf3;
  --card: #ffffff;
  --line: #e3e7ef;
  --line-soft: #eef1f7;
  --ink: #18233a;
  --muted: #5b6577;
  --faint: #97a0b2;
  --accent: #27406e;          /* 네이비 */
  --accent-strong: #1a2c52;
  --accent-soft: #e7ecf5;
  --accent-tint: #f3f5fb;
  --tan: #5a72a8;
  --tan-light: #c4d0e6;
  --gold: #3a5896;
  --warn: #b4453f;            /* 차분한 레드(주황 X) */
  --warn-soft: #f6e8e7;
  --ok: #27406e;              /* 긍정 = 네이비(초록 X) */
  --ok-soft: #e7ecf5;
  --ok-ink: #20396a;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(24,35,58,.06), 0 1px 3px rgba(24,35,58,.05);
  --shadow: 0 4px 14px rgba(24,35,58,.07), 0 14px 34px rgba(24,35,58,.08);
  --shadow-lg: 0 10px 28px rgba(24,35,58,.13), 0 28px 64px rgba(24,35,58,.13);
}
/* 화이트 헤더 + 네이비 액센트 마크 */
.admin .topbar { background: #ffffff; color: var(--ink); border-bottom: 1px solid var(--line); box-shadow: 0 1px 3px rgba(24,35,58,.04); }
.admin .topbar:hover { filter: none; background: #fafbfd; }
.admin .topbar .brand { color: var(--ink); font-weight: 800; letter-spacing: -0.03em; }
.admin .topbar .brand::before { content: ""; width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, #324f86, #1a2c52); box-shadow: 0 2px 6px rgba(39,64,110,.4); flex: 0 0 auto; }
.admin .topbar .sub { color: var(--muted); opacity: 1; margin-left: 32px; }
.admin .brand-div { color: var(--muted); }
.admin .brand-div::before { content: "/"; margin: 0 7px; opacity: .45; }
.admin .btn.primary { background: var(--accent); box-shadow: 0 2px 8px rgba(39,64,110,.3); }
.admin .btn.primary:hover { background: var(--accent-strong); box-shadow: 0 5px 16px rgba(39,64,110,.4); }
.admin .result-head { background: linear-gradient(165deg, #fff 0%, var(--accent-tint) 100%); border-top: 0 !important; }
.admin .result-head::before { background: linear-gradient(90deg, #324f86, #27406e); }
.admin .memo-area { background: #fafbfd; border-color: #dde2ec; box-shadow: inset 0 1px 2px rgba(24,35,58,.03); }
.admin .memo-area::placeholder { color: var(--faint); }
.admin .memo-area:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: #fff; }
.admin .action-card { background: #fff; border: 1px solid var(--line); }
.admin .flow-sec { background: var(--accent); }
.admin .score-fill { background: linear-gradient(90deg, #8a9fc8, #3a5896); }
.admin .score-row.top .score-fill { background: linear-gradient(90deg, #3a5896, var(--accent-strong)); }
.admin .card { border-color: var(--line); }
/* 신뢰도/태그 칩: 초록·주황 제거 → 네이비 / 그레이 / 차분한 레드 */
.admin .c-high { background: var(--accent-soft); color: var(--accent-strong); }
.admin .c-mid { background: #eef1f6; color: var(--muted); }
.admin .tag.warn { background: var(--warn-soft); color: var(--warn); }
.admin .axis-cell.ok { border-color: #c7d2e8; }
.admin .axis-cell.no { border-color: #e6c4c2; }

/* ── v24: 정확도 카드 + 환자행 확정 select ───────────────── */
.acc-card { background: linear-gradient(165deg, #fff 0%, var(--accent-tint) 100%); border-top: 4px solid var(--accent); }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 14px; }
.acc-cell { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.acc-label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: -.01em; margin-bottom: 6px; }
.acc-rate { font-size: 28px; font-weight: 800; color: var(--accent-strong); letter-spacing: -.04em; line-height: 1.1; }
.acc-rate .acc-unit { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.acc-detail { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.acc-confusion { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.acc-confusion-title { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.acc-confusion-row { font-size: 13px; color: var(--ink); padding: 4px 0; line-height: 1.6; }

@media (max-width: 720px) { .acc-grid { grid-template-columns: 1fr; } }

/* 환자 행: 좌(정보) / 중(검사+일치배지) / 우(확정 select) */
.patient-row-v24 { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 14px; align-items: center; }
.patient-row-v24 .pr-left { min-width: 0; }
.patient-row-v24 .pr-mid { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.patient-row-v24 .pr-right { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.confirm-label { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: -.01em; }
.confirm-select { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: #fff; color: var(--ink); cursor: pointer; }
.confirm-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.confirm-status { font-size: 11px; color: var(--muted); min-height: 14px; }
.confirm-status.ok { color: var(--ok); }
.confirm-status.warn { color: var(--warn); }

.match-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: -.01em; }
.match-badge.mb-na { background: #eef1f6; color: var(--muted); }
.match-badge.mb-ok { background: var(--ok-soft); color: var(--ok-ink); }
.match-badge.mb-warn { background: #fff4dd; color: #7a5b18; }
.match-badge.mb-no { background: var(--warn-soft); color: var(--warn); }

@media (max-width: 720px) {
  .patient-row-v24 { grid-template-columns: 1fr; gap: 10px; }
  .patient-row-v24 .pr-right { align-items: flex-start; }
}

/* 상세 페이지: 원장 확정 카드 */
.confirm-card { background: linear-gradient(165deg, #fff 0%, var(--accent-tint) 100%); }
.confirm-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.confirm-row .confirm-label { font-size: 13px; color: var(--ink); font-weight: 700; }
.confirm-row .confirm-select { flex: 1 1 280px; max-width: 380px; padding: 10px 12px; font-size: 14px; }
.confirm-verdict { margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; line-height: 1.5; }
.confirm-verdict.mb-na { background: #eef1f6; color: var(--muted); }
.confirm-verdict.mb-ok { background: var(--ok-soft); color: var(--ok-ink); }
.confirm-verdict.mb-warn { background: #fff4dd; color: #7a5b18; }
.confirm-verdict.mb-no { background: var(--warn-soft); color: var(--warn); }

/* ── 인쇄 ───────────────────────────────────────────────── */
@media print {
  body { background: #fff; }
  .topbar, .actions, .footnote, .back-link, .search-row, .acc-card, .confirm-card { display: none !important; }
  .card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
}
