:root {
  --bg: #f4f5f7; --card: #fff; --line: #e5e8eb; --text: #191f28; --sub: #4e5968; --muted: #8b95a1;
  --blue: #3182f6; --blue-weak: #e8f3ff; --green: #03a66d; --green-weak: #e5f7ef; --orange: #f08a00; --orange-weak: #fff3e0;
  --red: #f04452; --red-weak: #ffeeee; --radius: 16px; --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", "Noto Sans KR", sans-serif; -webkit-text-size-adjust: 100%; }
body { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 16px); overflow-wrap: anywhere; }
body.live-on { padding-bottom: calc(var(--safe-b) + 16px); }
a { color: var(--blue); text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1 { font-size: 22px; margin: 4px 0 12px; letter-spacing: -0.3px; }
h2 { font-size: 18px; margin: 0 0 10px; letter-spacing: -0.2px; }
h3 { font-size: 15px; margin: 14px 0 6px; color: var(--sub); }
p { margin: 6px 0; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }

.top { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 860px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; gap: 8px; align-items: center; color: var(--text); font-weight: 700; font-size: 17px; }
.device-badge { font-size: 12px; color: var(--sub); background: var(--bg); border-radius: 99px; padding: 3px 10px; }
.wrap { max-width: 860px; margin: 0 auto; padding: 16px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabbar a { flex: 1; height: var(--tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 12px; }
.tabbar svg { width: 24px; height: 24px; fill: currentColor; }
.tabbar a.on { color: var(--text); font-weight: 600; }
body.live-on .tabbar { display: none; }
@media (min-width: 900px) {
  .tabbar { position: fixed; top: 0; bottom: auto; left: 50%; right: auto; transform: translateX(-50%); height: 49px; align-items: center; border: 0; background: transparent; padding: 0; gap: 4px; z-index: 25; }
  .tabbar a { flex: 0 0 auto; flex-direction: row; height: 36px; padding: 0 14px; border-radius: 99px; font-size: 15px; gap: 6px; }
  .tabbar a.on { background: var(--bg); }
  .tabbar svg { width: 20px; height: 20px; }
  body { padding-bottom: 32px; }
}

.card { background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.row { display: flex; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.row.wrap-row { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }

.btn { border: 0; border-radius: 12px; padding: 10px 16px; background: var(--bg); color: var(--text); font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.weak { background: var(--blue-weak); color: var(--blue); }
.btn.danger { background: var(--red-weak); color: var(--red); }
.btn.ghost { background: transparent; color: var(--sub); }
.btn.lg { min-height: 54px; font-size: 17px; border-radius: 14px; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; fill: currentColor; }

.input, textarea.input, select.input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: inherit; background: #fff; color: var(--text); }
textarea.input { resize: vertical; min-height: 96px; }
.input:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: transparent; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 14px; color: var(--sub); margin-bottom: 6px; font-weight: 600; }

.notice { border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 10px 0; background: var(--blue-weak); color: #1b64da; }
.notice.warn { background: var(--orange-weak); color: #b25e00; }
.notice.err { background: var(--red-weak); color: #c9252f; }
.notice.ok { background: var(--green-weak); color: #027a50; }

.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .modes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mode { text-align: left; border: 2px solid transparent; background: var(--bg); border-radius: 14px; padding: 12px; min-height: 92px; color: var(--text); display: flex; flex-direction: column; gap: 4px; }
.mode b { font-size: 15px; }
.mode span { font-size: 12.5px; color: var(--sub); line-height: 1.4; }
.mode.on { border-color: var(--blue); background: var(--blue-weak); }
.mode:disabled { opacity: .5; }
.mode em { font-style: normal; font-size: 12px; color: var(--orange); }

.seg { display: flex; background: var(--bg); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 8px 4px; font-size: 14px; color: var(--sub); min-height: 38px; }
.seg button.on { background: #fff; color: var(--text); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 7px 14px; font-size: 14px; color: var(--sub); min-height: 38px; }
.chip.on { border-color: var(--blue); color: var(--blue); background: var(--blue-weak); font-weight: 600; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.switch input { width: 48px; height: 28px; appearance: none; background: #d1d6db; border-radius: 99px; position: relative; cursor: pointer; transition: .15s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked { background: var(--blue); }
.switch input:checked::after { left: 23px; }

details.more > summary { cursor: pointer; color: var(--sub); font-size: 14px; font-weight: 600; padding: 6px 0; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+ "; }
details.more[open] > summary::before { content: "− "; }

/* 면접 화면 */
.live-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--bg); color: var(--sub); }
.pill.blue { background: var(--blue-weak); color: var(--blue); }
.pill.orange { background: var(--orange-weak); color: var(--orange); }
.qcard { background: var(--card); border-radius: 20px; padding: 22px 20px; box-shadow: 0 2px 8px rgba(0,0,0,.05); margin-bottom: 14px; }
.qcard .q { font-size: 20px; font-weight: 700; line-height: 1.5; letter-spacing: -0.3px; margin: 10px 0 4px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px; color: var(--sub); }
.timer.over { color: var(--red); }
.mic-area { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0 4px; }
.mic { width: 88px; height: 88px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(49,130,246,.35); }
.mic svg { width: 40px; height: 40px; fill: currentColor; }
.mic.on { background: var(--red); box-shadow: 0 0 0 0 rgba(240,68,82,.5); animation: pulse 1.4s infinite; }
.mic:disabled { background: #b0b8c1; box-shadow: none; animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(240,68,82,.45); } 70% { box-shadow: 0 0 0 18px rgba(240,68,82,0); } 100% { box-shadow: 0 0 0 0 rgba(240,68,82,0); } }
.mic-label { font-size: 14px; color: var(--sub); font-weight: 600; }
.transcript { min-height: 110px; background: var(--card); border-radius: 16px; padding: 14px 16px; font-size: 16px; white-space: pre-wrap; border: 1px solid var(--line); }
.transcript .interim { color: var(--muted); }
.transcript.empty { color: var(--muted); }
.live-actions { display: flex; gap: 8px; margin-top: 12px; }
.live-actions .btn { flex: 1; }
.thinking { display: flex; align-items: center; gap: 10px; color: var(--sub); font-weight: 600; padding: 14px 0; }
.spin { width: 20px; height: 20px; border: 3px solid var(--blue-weak); border-top-color: var(--blue); border-radius: 50%; animation: sp .8s linear infinite; flex: none; }
@keyframes sp { to { transform: rotate(360deg); } }

/* 채팅 */
.chat { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.bubble { max-width: 82%; padding: 12px 14px; border-radius: 16px; font-size: 15.5px; white-space: pre-wrap; }
.bubble.ai { background: var(--card); align-self: flex-start; border-top-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.bubble.me { background: var(--blue); color: #fff; align-self: flex-end; border-top-right-radius: 4px; }
.bubble .meta { display: block; font-size: 12px; opacity: .7; margin-bottom: 2px; font-weight: 600; }
.composer { position: sticky; bottom: 0; background: var(--bg); padding: 8px 0 calc(var(--safe-b) + 4px); }
.composer textarea { min-height: 88px; max-height: 40vh; }
.composer .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 리포트 */
.score-head { display: flex; align-items: center; gap: 18px; }
.ring { --p: 0; width: 96px; height: 96px; border-radius: 50%; background: conic-gradient(var(--c, var(--blue)) calc(var(--p) * 1%), #e9edf1 0); display: grid; place-items: center; flex: none; }
.ring > div { width: 76px; height: 76px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 800; font-size: 26px; }
.ring small { font-size: 12px; color: var(--muted); font-weight: 600; display: block; margin-top: -6px; }
.bars { display: grid; gap: 8px; margin-top: 8px; }
.bar { display: grid; grid-template-columns: 64px 1fr 32px; gap: 8px; align-items: center; font-size: 13.5px; }
.bar .track { height: 8px; background: #e9edf1; border-radius: 99px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 99px; background: var(--blue); }
.bar b { text-align: right; font-variant-numeric: tabular-nums; }
ul.list { margin: 4px 0; padding-left: 20px; }
ul.list li { margin: 3px 0; }
.item { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.item:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.item-q { font-weight: 700; font-size: 16px; margin: 6px 0; }
.badge { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 8px; }
.badge.hi { background: var(--green-weak); color: var(--green); }
.badge.mid { background: var(--blue-weak); color: var(--blue); }
.badge.lo { background: var(--red-weak); color: var(--red); }
.box { border-radius: 12px; padding: 12px 14px; margin: 8px 0; font-size: 14.5px; }
.box h4 { margin: 0 0 4px; font-size: 13.5px; }
.box.good { background: var(--green-weak); } .box.good h4 { color: var(--green); }
.box.weak { background: var(--orange-weak); } .box.weak h4 { color: #b25e00; }
.box.mis { background: var(--red-weak); } .box.mis h4 { color: var(--red); }
.box.rec { background: var(--blue-weak); } .box.rec h4 { color: #1b64da; }
.box.plain { background: var(--bg); }
.box p { margin: 0; white-space: pre-wrap; }
.box ul { margin: 0; padding-left: 18px; }

.hist { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); color: var(--text); }
.hist:first-child { border-top: 0; }
.hist .sc { width: 52px; height: 52px; border-radius: 14px; background: var(--bg); display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none; }
.hist .sc.hi { background: var(--green-weak); color: var(--green); }
.hist .sc.mid { background: var(--blue-weak); color: var(--blue); }
.hist .sc.lo { background: var(--red-weak); color: var(--red); }

.doc { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.doc:first-child { border-top: 0; }
.doc .ext { width: 44px; height: 44px; border-radius: 12px; background: var(--blue-weak); color: var(--blue); font-weight: 800; font-size: 12px; display: grid; place-items: center; flex: none; text-transform: uppercase; }
.drop { display: block; cursor: pointer; margin-top: 12px; border: 2px dashed #c9d1da; border-radius: 16px; padding: 22px 16px; text-align: center; color: var(--sub); background: #fafbfc; }
.drop.over { border-color: var(--blue); background: var(--blue-weak); }
.empty-state { text-align: center; padding: 28px 12px; color: var(--sub); }

.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.sheet { background: #fff; width: 100%; max-width: 520px; border-radius: 22px 22px 0 0; padding: 22px 20px calc(var(--safe-b) + 18px); }
@media (min-width: 640px) { .modal { align-items: center; } .sheet { border-radius: 22px; } }
.sheet .acts { display: flex; gap: 8px; margin-top: 16px; }
.sheet .acts .btn { flex: 1; }
.toast[hidden] { display: none; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); width: max-content; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); z-index: 60; background: #333d4b; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14.5px; max-width: min(92vw, 520px); box-shadow: 0 6px 20px rgba(0,0,0,.2); display: flex; gap: 10px; align-items: flex-start; }
.toast.err { background: #c9252f; }
.toast button { background: transparent; border: 0; color: #fff; opacity: .8; font-size: 18px; line-height: 1; padding: 0 2px; }
body.live-on .toast { bottom: calc(var(--safe-b) + 24px); }

.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-box { background: #fff; padding: 32px 24px; border-radius: 22px; width: min(100%, 380px); text-align: center; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.login-box form { display: grid; gap: 12px; margin-top: 16px; }
