/* 과학쌤과임용 — 어두운 남색 + 청록. 시험장처럼 차분하게, 타이머만 크게 */
:root {
  --bg: #0b1220; --bg2: #0f1a2e; --surface: #131f36; --surface2: #1a2945; --border: #26385a;
  --text: #e6edf7; --muted: #93a4bf; --accent: #0e7490; --accent-hi: #22b3d4;
  --good: #34d399; --warn: #fbbf24; --bad: #f87171;
  --r: 14px; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: 'Noto Sans KR', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --display: 'Black Han Sans', var(--font);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: radial-gradient(1200px 600px at 80% -10%, #12314a 0%, transparent 60%), var(--bg); color: var(--text); font: 16px/1.6 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent-hi); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
h1 { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 4vw, 40px); letter-spacing: .5px; }
h2 { font-size: 22px; } h3 { font-size: 17px; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); } .small { font-size: 13px; }

/* 머리·발 */
.top { display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: rgba(11, 18, 32, .85); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(8px); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 900; font-size: 18px; }
.logo { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--accent-hi)); display: grid; place-items: center; font-family: var(--display); font-weight: 400; color: #fff; }
.crumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.crumb { font-size: 12px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--border); color: var(--muted); }
.crumb.now { border-color: var(--accent-hi); color: var(--text); background: rgba(34, 179, 212, .15); }
.crumb.done { color: var(--good); border-color: rgba(52, 211, 153, .4); }
main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 28px 20px 48px; }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.badge { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 99px; background: rgba(251, 191, 36, .15); color: var(--warn); border: 1px solid rgba(251, 191, 36, .4); }
.loading { color: var(--muted); }

/* 카드·폼 */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card.flat { box-shadow: none; background: var(--bg2); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 700; }
select, input[type=text], textarea { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; width: 100%; }
select:focus, input:focus, textarea:focus { outline: 2px solid var(--accent-hi); outline-offset: 1px; }
textarea { resize: vertical; min-height: 120px; line-height: 1.7; }
.regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.chip { border: 1px solid var(--border); background: var(--bg2); border-radius: 10px; padding: 9px 6px; text-align: center; cursor: pointer; font-weight: 700; }
.chip small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
.chip[aria-pressed=true] { border-color: var(--accent-hi); background: rgba(34, 179, 212, .18); }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--bg2); padding: 9px 16px; cursor: pointer; }
.seg button[aria-pressed=true] { background: var(--accent); color: #fff; font-weight: 700; }
.toggles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.tog { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg2); cursor: pointer; }
.tog input { width: 18px; height: 18px; accent-color: var(--accent-hi); }

.btn { border: 1px solid var(--border); background: var(--surface2); border-radius: 11px; padding: 11px 18px; cursor: pointer; font-weight: 700; }
.btn:hover { border-color: var(--accent-hi); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #0b8fb0); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { background: rgba(248, 113, 113, .15); border-color: rgba(248, 113, 113, .5); color: #fecaca; }
.btn.big { font-size: 18px; padding: 14px 26px; }
.btn:disabled { opacity: .5; cursor: wait; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* 타임라인 */
.tl { list-style: none; padding: 0; margin: 0; position: relative; }
.tl li { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: start; padding: 14px 0; border-bottom: 1px dashed var(--border); }
.tl .num { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface2); border: 1px solid var(--accent); font-weight: 900; }
.tl .skip { opacity: .55; }
.tl .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 13px; }
.pill { padding: 2px 9px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--border); font-size: 12px; }
.pill.ok { color: var(--good); border-color: rgba(52, 211, 153, .4); }
.pill.warn { color: var(--warn); border-color: rgba(251, 191, 36, .4); }
.score { font-family: var(--display); font-size: 22px; color: var(--accent-hi); }

/* 단계 화면 */
.stage-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.stage-head .kicker { color: var(--accent-hi); font-weight: 700; font-size: 14px; }
.timer { font-family: var(--display); font-size: clamp(54px, 9vw, 96px); line-height: 1; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.timer.warn { color: var(--warn); } .timer.over { color: var(--bad); }
.timer-sub { color: var(--muted); font-size: 14px; display: flex; gap: 14px; }
.sheet { background: #f8fafc; color: #0f172a; border-radius: 10px; padding: 18px 20px; border-left: 6px solid var(--accent); }
.sheet h3 { color: #0e7490; }
.sheet dl { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; margin: 0 0 10px; font-size: 15px; }
.sheet dt { font-weight: 700; color: #334155; }
.sheet dd { margin: 0; }
.sheet ol { margin: 6px 0 10px 20px; padding: 0; }
.sheet .task { font-weight: 700; border-top: 1px solid #cbd5e1; padding-top: 10px; }
.saved { font-size: 12px; color: var(--muted); }

.segbar { display: flex; height: 34px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); position: relative; margin: 14px 0; }
.segbar > div { display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--muted); background: var(--bg2); border-right: 1px solid var(--border); }
.segbar > div.on { background: rgba(34, 179, 212, .25); color: var(--text); }
.segbar .cursor { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--accent-hi); box-shadow: 0 0 8px var(--accent-hi); }
.perform { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
@media (max-width: 860px) { .perform { grid-template-columns: 1fr; } }
.selfview { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 4/3; border: 1px solid var(--border); }
.selfview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.gaze-dot { position: absolute; top: 10px; right: 10px; width: 14px; height: 14px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 3px rgba(0, 0, 0, .4); }
.gaze-dot.on { background: var(--good); }
.stt-state { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.rec { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.rec.on { background: var(--bad); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.interim { color: var(--muted); font-style: italic; min-height: 1.6em; }
.bubbles { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.bubble { align-self: flex-start; background: #fef3c7; color: #1f2937; border-radius: 16px 16px 16px 4px; padding: 9px 14px; max-width: 92%; animation: pop .25s ease-out; }
.bubble b { color: #b45309; margin-right: 6px; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }

/* 면접위원 */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.tile { margin: 0; border-radius: 12px; overflow: hidden; background: #000; border: 2px solid var(--border); transition: border-color .2s, box-shadow .2s; }
.tile.speaking { border-color: var(--accent-hi); box-shadow: 0 0 0 3px rgba(34, 179, 212, .35); }
.tile-media { position: relative; aspect-ratio: 4/3; }
.tile-media > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-v { opacity: 0; transition: opacity .2s; }
.tile.live .v-idle { opacity: 1; }
.tile.speaking .v-talk { opacity: 1; }
.tile-name { padding: 6px 10px; font-size: 13px; background: var(--surface); display: flex; align-items: center; gap: 6px; }
.tile-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.tile.speaking .tile-dot { background: var(--good); }
.question { font-size: 19px; font-weight: 700; background: var(--surface2); border-left: 5px solid var(--accent-hi); padding: 14px 18px; border-radius: 10px; margin-bottom: 12px; }
.question .kind { display: block; font-size: 12px; color: var(--accent-hi); font-weight: 700; margin-bottom: 4px; }
.qlist { list-style: none; padding: 0; margin: 0 0 12px; font-size: 14px; }
.qlist li { padding: 4px 0; color: var(--muted); }
.qlist li.done { color: var(--good); }

/* 리포트 */
.total { display: flex; align-items: baseline; gap: 10px; }
.total b { font-family: var(--display); font-weight: 400; font-size: 64px; color: var(--accent-hi); line-height: 1; }
table.rub { width: 100%; border-collapse: collapse; font-size: 14px; margin: 10px 0; }
table.rub th, table.rub td { padding: 7px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.rub td.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar { height: 6px; background: var(--bg2); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: var(--accent-hi); }
.improve { counter-reset: n; list-style: none; padding: 0; margin: 8px 0; }
.improve li { counter-increment: n; padding: 8px 10px 8px 40px; position: relative; background: var(--bg2); border-radius: 8px; margin-bottom: 6px; }
.improve li::before { content: counter(n); position: absolute; left: 10px; top: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; display: grid; place-items: center; font-weight: 900; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 10px 0; }
.stat { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.stat b { display: block; font-size: 20px; }
.stat span { font-size: 12px; color: var(--muted); }
details { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin: 8px 0; }
details summary { cursor: pointer; font-weight: 700; }
details pre { white-space: pre-wrap; font: inherit; margin: 8px 0 0; font-size: 14px; }
.notice { padding: 10px 14px; border-radius: 10px; background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .35); color: #fde68a; font-size: 14px; margin-bottom: 14px; }
.notice.err { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .4); color: #fecaca; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--muted); border-top-color: var(--accent-hi); border-radius: 50%; animation: rot 1s linear infinite; vertical-align: -2px; }
@keyframes rot { to { transform: rotate(360deg); } }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 10px; }
.meter { height: 8px; background: var(--bg2); border-radius: 4px; overflow: hidden; width: 160px; }
.meter i { display: block; height: 100%; width: 0; background: var(--good); transition: width .1s; }
@media (max-width: 560px) { .tiles { grid-template-columns: repeat(3, 1fr); gap: 6px; } .tile-name { font-size: 11px; } main { padding: 18px 14px 40px; } .tl li { grid-template-columns: 36px 1fr; } .tl li > :last-child { grid-column: 2; } }
