/* Just Endo It with AI — UI v0.3 (2026-11-21)
   의료·의학교육용 다크 테마. 외부 폰트·CDN 없음(시스템 폰트 스택). */
:root {
  --bg: #0a0d11;
  --bg-2: #0e1217;
  --surface: #12171d;
  --surface-2: #171d25;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #e9edf2;
  --text-2: #b7c0cb;
  --muted: #7d8794;
  --faint: #56606c;
  --accent: #5fc4d6;
  --accent-2: #3a9fb3;
  --accent-bg: rgba(95, 196, 214, 0.10);
  --ok: #52c48f;
  --ok-bg: rgba(82, 196, 143, 0.10);
  --warn: #e3b457;
  --warn-bg: rgba(227, 180, 87, 0.10);
  --ng: #e46c5e;
  --ng-bg: rgba(228, 108, 94, 0.10);
  --radius: 10px;
  --radius-sm: 6px;
  --font: "Pretendard", "Pretendard Variable", "Pretendard JP", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --mono: "JetBrains Mono", "D2Coding", Consolas, "SF Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; overflow: hidden;
  -webkit-font-smoothing: antialiased; letter-spacing: -0.005em; }
::selection { background: rgba(95, 196, 214, 0.35); }
h1, h2, h3, h4 { font-weight: 650; letter-spacing: -0.02em; }
h1 { font-size: 28px; margin: 0 0 8px; }
h2 { font-size: 19px; margin: 18px 0 8px; }
h3 { font-size: 16px; margin: 4px 0 6px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
b { font-weight: 650; }
.hidden { display: none !important; }
.small, .mutedText { font-size: 13px; color: var(--muted); line-height: 1.6; }
.mutedText.sm { font-size: 12.5px; }
.ok { color: var(--ok); } .ng { color: var(--ng); } .wn { color: var(--warn); }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
kbd { font-family: var(--mono); font-size: 11px; line-height: 1; padding: 3px 6px; border-radius: 4px; border: 1px solid var(--line-2);
  color: var(--text-2); background: rgba(255,255,255,0.04); margin-left: 8px; pointer-events: none; vertical-align: 1px; }

/* 버튼 위계: primary > default > ghost */
button { font: inherit; color: var(--text); cursor: pointer; }
.btn, .modal button, #pCls button, .debrief button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 40px; padding: 9px 16px;
  font-size: 14px; font-weight: 550; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  transition: background .15s, border-color .15s, color .15s; text-align: center; }
.btn:hover, .modal button:hover, #pCls button:hover, .debrief button:hover { background: #1e2630; border-color: rgba(255,255,255,0.2); }
.btn.primary, button.primary, .modal button.primary, #pCls button.primary, .debrief button.primary { background: var(--accent); border-color: var(--accent); color: #061418; font-weight: 650; }
.btn.primary:hover, button.primary:hover, .modal button.primary:hover, #pCls button.primary:hover, .debrief button.primary:hover { background: #79d2e1; border-color: #79d2e1; }
.btn.primary kbd, button.primary kbd { color: #0b2a31; border-color: rgba(6,20,24,0.25); background: rgba(6,20,24,0.08); }
.btn.ghost, button.ghost, .modal button.ghost, #pCls button.ghost, .debrief button.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover, button.ghost:hover, .modal button.ghost:hover, #pCls button.ghost:hover, .debrief button.ghost:hover { background: rgba(255,255,255,0.05); border-color: var(--line); color: var(--text); }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tagSm { font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 5px; margin-left: 6px; }

input { font: inherit; background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 9px 12px; }
input:focus { border-color: var(--accent-2); outline: none; }

/* ================= 메인 화면 ================= */
.screen { position: fixed; inset: 0; background: var(--bg); overflow-y: auto; z-index: 10; }
#menu { background:
  radial-gradient(1200px 600px at 78% -10%, rgba(95,196,214,0.07), transparent 60%),
  radial-gradient(900px 500px at -10% 20%, rgba(120,140,170,0.05), transparent 60%), var(--bg); }
.topBar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; height: 60px;
  padding: 0 clamp(28px, 4.5vw, 88px); background: rgba(10,13,17,0.78); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.wordmark { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; letter-spacing: -0.01em; }
.wmDot { width: 14px; height: 14px; border: 2px solid var(--accent); clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); background: radial-gradient(circle, rgba(95,196,214,0.5) 0 30%, transparent 32%); }
.topActions { display: flex; gap: 8px; }
.topActions .btn { min-height: 34px; padding: 6px 14px; font-size: 13px; }
.topMeta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.topMeta .sep { width: 1px; height: 12px; background: var(--line-2); }

.home { max-width: 1600px; margin: 0 auto; padding: 0 clamp(28px, 4.5vw, 88px) 56px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr); gap: clamp(32px, 5vw, 96px); align-items: center;
  padding: clamp(48px, 7vh, 96px) 0 clamp(40px, 6vh, 72px); }
.heroTitle { font-size: clamp(44px, 4.6vw, 76px); line-height: 1.02; letter-spacing: -0.035em; margin: 18px 0 14px; font-weight: 700;
  background: linear-gradient(180deg, #ffffff 0%, #c9d3dc 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.heroTag { font-size: clamp(18px, 1.5vw, 22px); color: var(--text); margin: 0 0 14px; font-weight: 500; letter-spacing: -0.015em; }
.heroIntro { font-size: 15.5px; line-height: 1.75; color: var(--text-2); margin: 0 0 32px; max-width: 620px; }
.heroMeta { display: grid; gap: 10px; margin: 0; padding-top: 22px; border-top: 1px solid var(--line); max-width: 640px; }
.heroMeta div { display: grid; grid-template-columns: 92px 1fr; gap: 12px; font-size: 13.5px; }
.heroMeta dt { color: var(--muted); }
.heroMeta dd { margin: 0; color: var(--text-2); }

.heroAside { display: flex; flex-direction: column; gap: 22px; align-items: stretch; }
.heroScope { position: relative; aspect-ratio: 4 / 3; background: #000; border-radius: 8px; border: 1px solid #1f242b;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.8), inset 0 0 0 6px #0b0d10; overflow: hidden; }
.hsOct { position: absolute; top: 7%; bottom: 7%; right: 5%; aspect-ratio: 1; clip-path: polygon(1.5% 33.5%, 33.5% 1.5%, 66.5% 1.5%, 98.5% 33.5%, 98.5% 66.5%, 66.5% 98.5%, 33.5% 98.5%, 1.5% 66.5%);
  background: #1a0b08 url("../assets/refphotos/body_gc_0.jpg") center / 118% auto no-repeat; }
.hsCap { position: absolute; left: 4%; bottom: 6%; font-size: 10px; color: rgba(255,255,255,0.32); line-height: 1.4; }
.hsOsd { position: absolute; left: 4%; top: 9%; font-family: var(--mono); font-size: 11px; line-height: 1.6; color: #dfe3e8; }
.hsOsd span { color: #8fb7c7; }
.heroStats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,0.015); }
.heroStats div { padding: 14px 16px; }
.heroStats div + div { border-left: 1px solid var(--line); }
.heroStats b { display: block; font-size: 24px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.heroStats span { font-size: 12px; color: var(--muted); }

/* 학습 트랙 스테퍼 */
.trackNav { scroll-margin-top: 72px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trackNav button { position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 16px; row-gap: 2px; align-items: baseline; padding: 22px 24px 22px 0;
  background: none; border: none; text-align: left; color: var(--muted); transition: color .15s; }
.trackNav button + button { padding-left: 28px; border-left: 1px solid var(--line); }
.trackNav button::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; transition: background .15s; }
.trackNav button + button::after { left: 28px; }
.trackNav button:hover { color: var(--text-2); }
.trackNav button.on { color: var(--text); }
.trackNav button.on::after { background: var(--accent); }
.tnNo { grid-row: span 2; font-family: var(--mono); font-size: 13px; color: var(--faint); }
.trackNav button.on .tnNo { color: var(--accent); }
.tnTitle { font-size: 17px; font-weight: 650; letter-spacing: -0.015em; }
.tnSub { font-size: 12.5px; color: var(--muted); }
.tnArrow { display: none; }

.trackBody { padding: 36px 0 12px; }
.trackHead { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 22px; }
.trackHead h2 { font-size: 24px; margin: 6px 0 0; letter-spacing: -0.025em; }
.trackHead p { margin: 0; max-width: 560px; font-size: 13.5px; color: var(--text-2); line-height: 1.65; }

.cardGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.card { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 172px; padding: 20px 22px 18px; text-align: left;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.008)); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); transition: border-color .18s, background .18s, transform .18s; }
.card:hover { border-color: rgba(95,196,214,0.45); background: linear-gradient(180deg, rgba(95,196,214,0.06), rgba(95,196,214,0.015)); }
.card:hover .cdGo { color: var(--accent); transform: translateX(3px); }
.cdMeta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.cdLevel { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); }
.cdLevel.l1 { color: #8fd9b6; border-color: rgba(82,196,143,0.35); }
.cdLevel.l2 { color: var(--accent); border-color: rgba(95,196,214,0.35); }
.cdLevel.l3 { color: #e9c37a; border-color: rgba(227,180,87,0.35); }
.cdLevel.l4 { color: #ee9488; border-color: rgba(228,108,94,0.35); }
.cdDot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.cdTitle { font-size: 16.5px; font-weight: 650; letter-spacing: -0.015em; line-height: 1.4; }
.cdNo { font-family: var(--mono); font-size: 12px; color: var(--faint); margin-right: 8px; font-weight: 500; }
.cdBlurb { font-size: 13.5px; line-height: 1.6; color: var(--text-2); flex: 1; }
.cdPt { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.cdFoot { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.cdGo { font-size: 13px; font-weight: 600; color: var(--text-2); transition: transform .18s, color .18s; }

.utilRow { margin-top: 40px; }
.settings { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,0.015); }
.settings summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 16px 22px; cursor: pointer; }
.settings summary::-webkit-details-marker { display: none; }
.sumTitle { font-weight: 650; font-size: 14.5px; }
.sumMeta { font-size: 12.5px; color: var(--muted); font-family: var(--mono); flex: 1; }
.chev { width: 8px; height: 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform .2s; margin-right: 4px; }
.settings[open] .chev { transform: rotate(-135deg); }
.setBody { display: grid; grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1.4fr) minmax(260px, 1fr); gap: 32px; padding: 6px 22px 22px; border-top: 1px solid var(--line); padding-top: 20px; }
.setFields { display: flex; gap: 12px; align-items: flex-start; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); flex: 1; }
.field.narrow { flex: 0 0 90px; }
.field input { width: 100%; }
.setToggles { display: grid; gap: 12px; }
.tgl { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; cursor: pointer; }
.tgl input { position: absolute; opacity: 0; pointer-events: none; }
.sw { position: relative; width: 34px; height: 20px; border-radius: 999px; background: #2a323c; transition: background .15s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #c8d0d9; transition: transform .15s; }
.tgl input:checked + .sw { background: var(--accent-2); }
.tgl input:checked + .sw::after { transform: translateX(14px); background: #fff; }
.tgl input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }
.tTxt { display: flex; flex-direction: column; gap: 1px; }
.tTxt b { font-size: 13.5px; font-weight: 600; }
.tTxt small { font-size: 12px; color: var(--muted); }
.setData { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

.homeFoot { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.homeFoot p { margin: 0; }
.warnLine { font-size: 12.5px; color: var(--warn); display: flex; align-items: center; gap: 8px; }
.warnLine::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); flex: none; }

/* ================= 시술 화면 ================= */
#app { display: flex; height: 100vh; padding: 18px; gap: 18px; background: #07090c; }
/* 내시경 모니터(4:3): 왼쪽 정보 열 + 오른쪽 팔각형 영상 */
#viewWrap { position: relative; flex: none; width: min(calc((100vh - 36px) * 4 / 3), 64vw); aspect-ratio: 4 / 3; align-self: center; background: #000;
  border: 10px solid #15171a; border-radius: 8px; box-shadow: 0 0 0 1px #2a2e33, 0 0 0 2px #0a0b0d, 0 24px 60px -20px rgba(0,0,0,0.9); }
#viewInner { position: absolute; top: 3.5%; bottom: 3.5%; right: 2.5%; aspect-ratio: 1 / 1; clip-path: polygon(1.5% 33.5%, 33.5% 1.5%, 66.5% 1.5%, 98.5% 33.5%, 98.5% 66.5%, 66.5% 98.5%, 33.5% 98.5%, 1.5% 66.5%); }
#view { width: 100%; height: 100%; display: block; }
.fx { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
#fxRed { background: radial-gradient(circle, rgba(200,40,30,0.85), rgba(150,20,15,0.95)); }
#fxWash { background: rgba(160,200,235,0.2); }
#fxFlash { background: #fff; }
.osdCol { position: absolute; left: 2.5%; top: 6%; bottom: 6%; width: 24%; font-family: var(--mono); font-size: clamp(10px, 1.05vw, 14px); color: #e6e6e6; line-height: 1.5; pointer-events: none; white-space: pre; overflow: hidden; }
.osdSel { display: inline-block; background: #1f3f9a; color: #fff; padding: 1px 8px; margin-bottom: 8px; letter-spacing: 0.04em; }
.osdMode { color: #9fd7ff; }
.osdIns { font-size: 1.5em; color: #fff; }
.osdGap { height: 1.2em; }
.monBadge { position: absolute; left: 2.5%; bottom: 3.2%; font-size: clamp(9px, 0.75vw, 11px); letter-spacing: 0.08em; color: rgba(255,255,255,0.28); pointer-events: none; font-weight: 600; }
.banner { position: absolute; left: 33%; right: 5%; padding: 10px 16px; text-align: center; border-radius: 8px; font-size: 15.5px; pointer-events: none; line-height: 1.5; backdrop-filter: blur(6px); }
#hint { top: 8%; background: rgba(32,24,6,0.82); color: #ffd98a; border: 1px solid rgba(227,180,87,0.35); }
#toast { bottom: 10%; left: 40%; right: 12%; background: rgba(8,10,13,0.82); color: #fff; border: 1px solid rgba(255,255,255,0.12); }

/* 모달(영상 영역 중앙) */
.modal { position: absolute; left: 62%; top: 50%; transform: translate(-50%, -50%); width: min(680px, 72%); max-height: 92%; overflow: auto;
  background: rgba(12,15,20,0.97); border: 1px solid var(--line-2); border-radius: 12px; padding: 26px 30px 24px;
  box-shadow: 0 30px 90px -20px rgba(0,0,0,0.95); backdrop-filter: blur(10px); }
.modal.modalSm { width: min(420px, 60%); }
.modal h2 { font-size: 22px; margin: 8px 0 12px; line-height: 1.35; }
.modal p { line-height: 1.65; margin: 6px 0; }
.modal .stack { display: grid; gap: 8px; margin-top: 18px; }
.modal .stack .btn { width: 100%; justify-content: space-between; }
.modal .stack .btn.primary { justify-content: space-between; }
.modal .btnRow, .btnRow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.modal .btnRow .spacer, .btnRow .spacer { flex: 1; }
.modal::-webkit-scrollbar, #panel ::-webkit-scrollbar, .screen::-webkit-scrollbar { width: 8px; }
.modal::-webkit-scrollbar-thumb, #panel ::-webkit-scrollbar-thumb, .screen::-webkit-scrollbar-thumb { background: #262d36; border-radius: 4px; }

.bfGrid { display: grid; gap: 0; margin: 14px 0 6px; border-top: 1px solid var(--line); }
.bfGrid > div { display: grid; grid-template-columns: 84px 1fr; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.6; }
.bfGrid dt { color: var(--muted); font-size: 13px; }
.bfGrid dd { margin: 0; color: var(--text); }
.taskList { margin: 0; padding: 0; list-style: none; counter-reset: t; display: grid; gap: 6px; }
.taskList li { counter-increment: t; display: grid; grid-template-columns: 22px 1fr; gap: 6px; }
.taskList li::before { content: counter(t); font-family: var(--mono); font-size: 12px; color: var(--accent); padding-top: 2px; }
.bfNote { margin-top: 12px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* 퀴즈 */
.qHead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qSteps { display: flex; gap: 4px; }
.qSteps i { width: 22px; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.12); }
.qSteps i.on { background: var(--accent); }
.qLoc { font-size: 13px; color: var(--muted); margin-top: 2px; }
.qText { font-size: 18px; font-weight: 600; line-height: 1.5; margin: 18px 0 14px !important; letter-spacing: -0.015em; }
.modal button.opt, #pCls button.clsOpt { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; width: 100%; margin: 0 0 8px; padding: 12px 14px;
  text-align: left; font-weight: 500; font-size: 14.5px; background: rgba(255,255,255,0.025); border-color: var(--line-2); }
.modal button.opt:hover, #pCls button.clsOpt:hover { border-color: rgba(95,196,214,0.55); background: var(--accent-bg); }
.optNo { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 5px; border: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.qRes { display: grid; grid-template-columns: 56px 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.qRes:first-of-type { border-top: none; }
.badge { display: inline-flex; align-items: center; justify-content: center; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 11.5px; font-weight: 650; letter-spacing: 0.02em; white-space: nowrap; }
.badge.ok { color: var(--ok); background: var(--ok-bg); border: 1px solid rgba(82,196,143,0.35); }
.badge.ng { color: var(--ng); background: var(--ng-bg); border: 1px solid rgba(228,108,94,0.35); }
.badge.wn { color: var(--warn); background: var(--warn-bg); border: 1px solid rgba(227,180,87,0.35); }
.badge.na { color: var(--muted); background: rgba(255,255,255,0.03); border: 1px solid var(--line-2); }
.qrQ { font-size: 13px; color: var(--muted); }
.qrA { font-size: 15px; font-weight: 600; margin: 3px 0; }
.qrSel { font-size: 13px; color: var(--ng); }
.qrSel::before { content: "선택 "; color: var(--muted); }
.qrWhy { font-size: 13.5px; color: var(--text-2); line-height: 1.65; margin-top: 4px; }

.final { position: relative; margin: 18px 0 8px; padding: 16px 18px 16px 20px; border-radius: 8px; background: linear-gradient(90deg, rgba(95,196,214,0.10), rgba(95,196,214,0.03));
  border: 1px solid rgba(95,196,214,0.28); }
.final::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: var(--accent); }
.finalLbl { font-size: 11px; letter-spacing: 0.12em; font-weight: 650; color: var(--accent); text-transform: uppercase; margin-bottom: 4px; }
.finalTxt { font-size: 16px; font-weight: 600; line-height: 1.55; color: #fff; }

/* 참고 사진 갤러리 */
.refTitle { margin: 18px 0 10px; font-size: 12px; letter-spacing: 0.08em; font-weight: 600; color: var(--muted); }
.refRow { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.refRow figure { margin: 0; background: #050607; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.refRow img { width: 100%; aspect-ratio: 6 / 5; object-fit: cover; display: block; background: #000; }
.refRow figcaption { font-size: 12.5px; color: var(--text-2); padding: 8px 10px 9px; line-height: 1.4; }
.refRow figcaption span { display: block; color: var(--faint); font-size: 10.5px; margin-top: 2px; line-height: 1.35; }
.refLinks { margin: 12px 0 4px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.refLinks a { color: var(--accent); }
.srcNote { font-size: 12px; color: var(--faint); margin-top: 14px !important; }

/* 패널 */
#panel { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; container-type: inline-size; }
.pHead { padding: 18px 22px 16px; border-bottom: 1px solid var(--line); }
.pHead h2 { font-size: 18px; margin: 6px 0 4px; line-height: 1.35; }
.pHead p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.pScroll { flex: 1; overflow-y: auto; padding: 14px 16px 6px; }
.pGrid { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@container (min-width: 600px) { .pGrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.pCol { min-width: 0; }
.sec { padding: 14px 6px; border-bottom: 1px solid var(--line); }
.pCol .sec:last-child { border-bottom: none; }
.secTitle { margin: 0 0 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; color: var(--muted); }

.statRow { display: grid; grid-template-columns: 1.1fr 1.3fr 0.9fr; gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stat .k { font-size: 11.5px; color: var(--muted); }
.stat .v { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.stat .v.sm { font-size: 16px; padding-top: 5px; }
.stat .v.mono { font-family: var(--mono); font-size: 20px; padding-top: 3px; }
.stat .sub { font-size: 11px; color: var(--faint); }
.retroTag { display: inline-block; font-size: 10.5px; font-weight: 650; letter-spacing: 0.06em; color: var(--accent); border: 1px solid rgba(95,196,214,0.4); border-radius: 4px; padding: 1px 6px; margin-top: 2px; width: max-content; }

.lbl { font-size: 12.5px; color: var(--text-2); margin: 0 0 5px; font-variant-numeric: tabular-nums; }
.lbl b { color: var(--text); }
.gaugeLbl { display: flex; justify-content: space-between; margin-top: 4px; }
.gaugeLbl + .bar { margin-bottom: 12px; }
.bar { position: relative; height: 6px; background: rgba(255,255,255,0.07); border-radius: 3px; }
.bar.zones { background: linear-gradient(90deg, rgba(227,180,87,0.16) 0 50%, rgba(82,196,143,0.14) 50% 80%, rgba(228,108,94,0.16) 80% 100%); }
.bar.big { height: 4px; width: min(420px, 70vw); margin-top: 18px; }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); border-radius: 3px; transition: width .12s linear; }
.bar .tick { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 1px; background: rgba(255,255,255,0.75); }
.bar .tick.dim { background: rgba(255,255,255,0.3); }

.angles { display: flex; gap: 22px; align-items: stretch; }
.udBox { flex: none; width: 58px; display: flex; flex-direction: column; align-items: center; padding-right: 18px; border-right: 1px solid var(--line); box-sizing: content-box; }
.udBar { position: relative; width: 6px; height: 84px; margin: 14px 0 16px; background: rgba(255,255,255,0.08); border-radius: 3px; }
.udBar .zero { position: absolute; left: -6px; right: -6px; height: 1px; top: 70%; background: rgba(255,255,255,0.35); }
.udBar .mark { position: absolute; left: -5px; right: -5px; height: 4px; margin-top: -2px; background: var(--accent); border-radius: 2px; box-shadow: 0 0 10px rgba(95,196,214,0.6); }
.end { position: absolute; font-family: var(--mono); font-size: 10px; color: var(--faint); }
.udBar .end.top { top: -15px; left: 50%; transform: translateX(-50%); }
.udBar .end.bot { bottom: -15px; left: 50%; transform: translateX(-50%); }
.udLbl { display: flex; flex-direction: column; align-items: center; gap: 0; margin: 0; font-size: 11.5px; color: var(--muted); }
.udLbl b { font-size: 16px; font-variant-numeric: tabular-nums; }
.rlBox { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.rowLbl { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 7px !important; color: var(--muted); font-size: 11.5px; }
.rowLbl b { font-size: 16px; font-variant-numeric: tabular-nums; }
.rowLbl em { font-style: normal; color: var(--warn); margin-left: 6px; }
.hBar { position: relative; height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; margin: 2px 14px 16px; }
.hBar.thin { height: 4px; margin-bottom: 4px; }
.hBar .zero { position: absolute; top: -5px; bottom: -5px; width: 1px; left: 50%; background: rgba(255,255,255,0.35); }
.hBar .mark { position: absolute; top: -4px; bottom: -4px; width: 4px; margin-left: -2px; background: var(--accent); border-radius: 2px; box-shadow: 0 0 10px rgba(95,196,214,0.6); }
.hBar .mark.warn { background: var(--warn); box-shadow: 0 0 10px rgba(227,180,87,0.5); }
.hBar .end.l { left: -13px; top: -4px; }
.hBar .end.r { right: -13px; top: -4px; }

.vitals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; padding: 10px 12px; background: #06080a; border: 1px solid var(--line); border-radius: 8px; font-family: var(--mono); }
.vt { display: flex; align-items: baseline; gap: 6px; }
.vt .k { font-size: 11px; color: var(--muted); width: 34px; }
.vt .v { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.vt .u { font-size: 11px; color: var(--faint); }
.vt.hr .v { color: #6fe39c; } .vt.sp .v { color: #6fd2ef; }

.countRow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.countRow .stat .v { font-size: 20px; }

.tut { margin: 2px 0 12px; padding: 14px 16px 15px; border-radius: 10px; background: linear-gradient(180deg, rgba(95,196,214,0.09), rgba(95,196,214,0.03)); border: 1px solid rgba(95,196,214,0.25); line-height: 1.6; font-size: 14px; }
.tutHead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.tutKind { font-size: 11px; font-weight: 650; letter-spacing: 0.12em; color: var(--accent); }
.tutStep { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.tutProg { height: 2px; background: rgba(255,255,255,0.08); border-radius: 1px; margin: 4px 0 10px; overflow: hidden; }
.tutProg i { display: block; height: 100%; background: var(--accent); }
.tutBody { color: var(--text); }
.bxCmd { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: #fff; margin: 2px 0 8px; line-height: 1.3; }
.bxCmd .bxNo { font-family: var(--mono); font-size: 14px; color: var(--accent); margin-right: 10px; font-weight: 600; vertical-align: 3px; }
.bxHow { font-size: 13px; color: var(--text-2); line-height: 1.6; }
.tut.done { background: linear-gradient(180deg, rgba(82,196,143,0.10), rgba(82,196,143,0.03)); border-color: rgba(82,196,143,0.3); }
.tut.done .tutKind { color: var(--ok); }

.tut.cls { background: var(--surface); border-color: var(--line-2); }
#pCls p { margin: 6px 0; line-height: 1.6; }
#pCls .clsQ { font-size: 16.5px; font-weight: 650; margin: 8px 0 12px; letter-spacing: -0.015em; }
#pCls .clsVerdict { display: flex; align-items: center; gap: 10px; margin: 8px 0 6px; font-size: 16px; font-weight: 650; }
#pCls .crit { margin-top: 10px; padding: 10px 12px; border-radius: 6px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); line-height: 1.65; }
#pCls .crit b { color: var(--muted); font-weight: 600; margin-right: 6px; }
#pCls .refRow { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
#pCls .btnRow { margin-top: 14px; }
.clsScore { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; margin: 4px 0; }
.clsScore small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.clsList { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.clsList li { display: grid; grid-template-columns: 50px 1fr; gap: 10px; align-items: center; color: var(--text-2); }

#pChecklist { font-size: 13px; }
.ckGroup { margin-bottom: 12px; }
.ckHead { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); font-weight: 600; margin-bottom: 6px; }
.ckHead span { font-family: var(--mono); color: var(--muted); font-weight: 500; }
.ckList { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 3px 12px; }
@container (min-width: 440px) and (max-width: 599px) { .ckList { grid-template-columns: 1fr 1fr; } }
.ckList li { display: flex; align-items: center; gap: 8px; color: var(--muted); line-height: 1.45; font-size: 12.5px; }
.ckList li::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid #3a434e; }
.ckList li.done { color: var(--text); }
.ckList li.done::before { background: var(--ok); border-color: var(--ok); }
#map { display: block; width: 100%; max-width: 240px; height: auto; aspect-ratio: 1; margin: 8px auto 0; background: #06080a; border: 1px solid var(--line); border-radius: 8px; }

.help { white-space: pre-line; font-family: var(--mono); font-size: 11.5px; line-height: 1.75; color: var(--muted); }
.help:empty { display: none; }
.helpSec:has(.help:empty) { display: none; }
.pFoot { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: rgba(0,0,0,0.15); }
.pFoot .btn.primary { flex: 1; justify-content: space-between; }

/* 로딩 */
.loadBox { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); text-align: left; }
.loadBox h2 { font-size: 20px; margin: 10px 0 0; font-weight: 600; }

/* ================= 결과 화면 ================= */
.screenInner { max-width: 1120px; margin: 0 auto; padding: 40px clamp(28px, 4vw, 64px) 64px; }
.debrief h2.secH { font-size: 12px; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; margin: 40px 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.dbHead { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.dbHead h1 { font-size: clamp(26px, 2.4vw, 34px); margin: 10px 0 10px; letter-spacing: -0.03em; line-height: 1.25; }
.dbFacts { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; color: var(--muted); }
.dbFacts b { color: var(--text-2); font-weight: 600; margin-left: 6px; font-variant-numeric: tabular-nums; }
.ring { position: relative; width: 148px; height: 148px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--rc) calc(var(--p) * 1%), rgba(255,255,255,0.07) 0); }
.ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--bg); }
.ring div { position: relative; text-align: center; }
.ring b { display: block; font-size: 44px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.ring span { font-size: 12px; color: var(--muted); }

.scoreRows { display: grid; gap: 0; }
.scoreRow { display: grid; grid-template-columns: 210px minmax(160px, 1fr) 76px minmax(0, 1.4fr); gap: 20px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.scoreRow .srL { font-size: 14px; font-weight: 600; }
.scoreRow .bar { height: 6px; }
.scoreRow .srV { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); text-align: right; }
.scoreRow .srV b { font-size: 20px; color: var(--text); font-weight: 650; }
.scoreRow .srD { font-size: 12.5px; color: var(--text-2); line-height: 1.55; }

.chipList { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 13px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); background: rgba(255,255,255,0.02); }
.chip.ng { border-color: rgba(228,108,94,0.35); color: #f0a196; }
.noteList { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.noteList li { padding: 12px 14px; border-radius: 8px; background: var(--warn-bg); border: 1px solid rgba(227,180,87,0.22); font-size: 13.5px; line-height: 1.6; color: #ecd7a8; }

.lesionRes { margin: 0 0 14px; padding: 20px 22px; background: rgba(255,255,255,0.018); border: 1px solid var(--line); border-radius: var(--radius); }
.lrHead { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 6px; }
.lrName { font-size: 16.5px; font-weight: 650; letter-spacing: -0.015em; }
.lrLoc { font-size: 13px; color: var(--muted); }
.lesionRes .qRes { grid-template-columns: 56px 1fr; }
.lesionRes .refRow { grid-template-columns: repeat(auto-fill, minmax(150px, 180px)); }

.bxTable { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 13.5px; }
.bxTable th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line-2); }
.bxTable td { padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--text-2); }
.bxTable td:first-child { font-family: var(--mono); color: var(--accent); width: 60px; }
.bxTable td:last-child { font-variant-numeric: tabular-nums; text-align: right; width: 90px; }
.bxTable th:last-child { text-align: right; }

.dbActions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.dbActions .spacer { flex: 1; }
.dbData { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dbData .lblInline { font-size: 12px; color: var(--muted); margin-right: 6px; letter-spacing: 0.04em; }
.debrief .dbData button { min-height: 34px; padding: 6px 12px; font-size: 13px; }

/* 반응형 */
@media (max-width: 1100px) {
  .setBody { grid-template-columns: 1fr 1fr; }
  .setData { grid-column: 1 / -1; }
}
@media (max-width: 1200px) {
  .hero { grid-template-columns: 1fr; }
  .heroAside { max-width: 560px; }
  .scoreRow { grid-template-columns: 160px 1fr 70px; }
  .scoreRow .srD { grid-column: 1 / -1; }
}

/* ---------- 실사 판독 (v0.1, 2026-11-22) ---------- */
.cdMeta .cdReal { color: #061418; background: var(--accent); border-radius: 4px; padding: 1px 7px; font-weight: 650; letter-spacing: 0.04em; }
.card.real { border-color: rgba(95,196,214,0.28); }
.reading { display: flex; flex-direction: column; overflow: hidden; }
.reading .topBar { flex: 0 0 auto; }
.rdTitle { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 14px; }
.rdProg { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--text-2); margin-right: 8px; }
.rdProg .bar { width: 120px; }
.rdBody { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 420px; }
.rdStage { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px; background: #000; min-height: 0; }
.rdMon { position: relative; flex: 1 1 auto; width: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; }
.rdOsd { position: absolute; left: 6px; top: 4px; font-family: var(--mono); font-size: 12px; line-height: 1.5; color: #d9dde2; z-index: 1; pointer-events: none; }
.rdOsd span { color: #8a939d; }
.rdImgWrap { position: relative; display: inline-block; line-height: 0; max-width: 100%; max-height: 100%; }
.rdImgWrap img { display: block; max-width: none; max-height: none; user-select: none; }
.rdImgWrap.clickable img { cursor: crosshair; }
.rdCap { flex: 0 0 auto; margin-top: 8px; font-size: 11.5px; color: var(--faint); }
.rdClick { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(0,0,0,0.6); pointer-events: none; }
.rdClick::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: #fff; }
.rdClick.ok { border-color: var(--ok); } .rdClick.ng { border-color: var(--ng); }
.rdRoi { position: absolute; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none;
  border: 2px dashed rgba(95,196,214,0.95); border-radius: 50%; box-shadow: 0 0 0 9999px rgba(0,0,0,0.0); }
.rdSide { border-left: 1px solid var(--line); background: var(--bg-2); overflow-y: auto; padding: 26px 26px 30px; }
.rdTask h2 { font-size: 20px; line-height: 1.35; margin: 8px 0 10px; }
.rdOpts { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.rdOpt { display: flex; align-items: center; gap: 12px; text-align: left; padding: 11px 14px; min-height: 46px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); font-size: 14.5px; line-height: 1.4; }
.rdOpt:hover:not([disabled]) { border-color: rgba(95,196,214,0.5); background: var(--surface-2); }
.rdOpt[disabled] { cursor: default; }
.rdOpt.ok { border-color: rgba(82,196,143,0.6); background: var(--ok-bg); color: var(--text); }
.rdOpt.ng { border-color: rgba(228,108,94,0.6); background: var(--ng-bg); }
.rdOpt.sel { border-color: var(--accent); background: var(--accent-bg); }
.rdOpt.dim { opacity: 0.5; }
.rdKey { flex: 0 0 auto; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11.5px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; }
.rdWhy { margin: 6px 0 16px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; line-height: 1.6; color: var(--text-2); background: var(--surface); border-left: 3px solid var(--muted); }
.rdWhy.ok { border-left-color: var(--ok); } .rdWhy.ng { border-left-color: var(--ng); }
.rdWhy b { color: var(--text); }
.rdBadges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.rdCls { display: inline-flex; align-items: baseline; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--accent-bg); border: 1px solid rgba(95,196,214,0.3); margin-bottom: 12px; }
.rdCls span { font-size: 12px; color: var(--accent); letter-spacing: 0.04em; } .rdCls b { font-size: 16px; }
.rdKV { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.6; color: var(--text-2); }
.rdKV span { font-size: 12px; color: var(--muted); padding-top: 2px; }
.rdQr { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); }
.rdQa { color: var(--text); margin-top: 3px; }
.rdMore { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.rdMore img { height: 96px; border-radius: 4px; border: 1px solid var(--line-2); }
.rdReview .btn.primary { margin-top: 14px; width: 100%; }
.rdTask > .btn { margin-top: 6px; }
.rdThumb { height: 54px; border-radius: 3px; display: block; }
.rdTable td:last-child { width: 70px; }
@media (max-width: 1100px) { .rdBody { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; } .rdStage { min-height: 52vh; } .rdSide { border-left: 0; border-top: 1px solid var(--line); } }
