:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #1b2230;
  --muted: #5b6678;
  --border: #d5dae3;
  --accent: #2557d6;
  --accent-ink: #ffffff;
  --bot: #eaf0ff;
  --me: #2557d6;
  --me-ink: #ffffff;
  --warn-bg: #fff3d6;
  --warn-ink: #6b4a00;
  --warn-border: #e6b84a;
  --err: #b3261e;
  --ok: #1f7a4d;
  --bar-bg: #dfe4ee;
  --focus: #1b3fa3;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f131a;
    --surface: #171c26;
    --surface-2: #1f2633;
    --text: #e8ecf3;
    --muted: #a3adbd;
    --border: #2f3849;
    --accent: #7da2ff;
    --accent-ink: #0b1220;
    --bot: #1d2640;
    --me: #4f7bff;
    --me-ink: #08101f;
    --warn-bg: #3a2f10;
    --warn-ink: #ffe3a0;
    --warn-border: #8a6a1f;
    --err: #ff8a80;
    --ok: #6fd6a0;
    --bar-bg: #2a3243;
    --focus: #a9c0ff;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; }
.top { flex-wrap: wrap; row-gap: 4px; }
.brand, .badge { white-space: nowrap; }
.userbar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; gap: 6px; margin-left: auto; }
@media (max-width: 520px) { .userbar { flex: 1 1 100%; } .userbar .who-name { margin-right: auto; } }
.who-name { font-size: 13px; color: var(--muted); max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-border); }

main { max-width: 720px; margin: 0 auto; padding: 16px; outline: none; }
h1 { font-size: 22px; line-height: 1.3; margin: 8px 0; }
h2 { font-size: 18px; margin: 28px 0 10px; }
.lead { color: var(--muted); margin: 0 0 16px; }
[hidden] { display: none !important; }

fieldset { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 14px; margin: 0 0 14px; }
legend { font-weight: 700; padding: 0 6px; }
label { display: block; font-weight: 600; margin: 10px 0 4px; }
input[type=text], input[type=password], textarea, input[type=file], select {
  width: 100%; font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
}
select { min-height: 44px; }
.opt { font-weight: 400; color: var(--muted); font-size: 13px; }
textarea { resize: vertical; min-height: 88px; }
input[type=file] { padding: 9px 10px; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.error { color: var(--err); font-weight: 600; margin: 8px 0; }
.note { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; font-size: 14px; color: var(--muted); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

button { font: inherit; cursor: pointer; border-radius: 12px; min-height: 44px; padding: 10px 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; width: 100%; }
button.primary:disabled { opacity: .45; cursor: not-allowed; }
button.ghost { min-height: 40px; padding: 6px 12px; font-size: 14px; }
button.link { background: none; border: none; color: var(--accent); text-decoration: underline; padding: 8px 0; min-height: 44px; }

.radios { display: flex; gap: 10px; margin-top: 10px; }
.radio { flex: 1; margin: 0; }
.radio input { position: absolute; opacity: 0; }
.radio span { display: flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.radio input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.radio input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.consent-list { margin: 0 0 8px; padding-left: 20px; color: var(--muted); font-size: 14px; }
.consent-list li { margin: 4px 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; margin-top: 10px; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.consent-all { margin: 4px 0 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.consent-all small { display: block; font-weight: 400; color: var(--muted); }

/* 대학·학과 고르기 칸 — 글자 일부를 치면 아래에 목록 */
.combo { position: relative; }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 4;
  margin: 0; padding: 4px; list-style: none; max-height: min(300px, 45vh); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
}
.combo-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.combo-list li[aria-selected="true"] { background: var(--bot); }
@media (hover: hover) { .combo-list li:hover { background: var(--bot); } }
.combo-list .nm { min-width: 0; overflow-wrap: anywhere; }
.combo-list .meta { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }
.combo-list .fit { color: var(--ok); font-weight: 700; }

/* 대학·전형 프로필 카드 */
.pcard { margin-top: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; font-size: 14px; }
.pcard .ttl { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; margin-bottom: 6px; }
.pcard .row { margin: 4px 0; }
.pcard .k { color: var(--muted); }
.pcard .chips { margin: 6px 0 2px; }
.pcard .warn { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-border); }
.st { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; }
.st.ok { color: var(--ok); border-color: var(--ok); }
.st.unk { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-border); }
.univ-total { font-weight: 700; margin: 10px 0 0; }
.meter.na .lbl span:last-child { font-style: italic; }
.meter.na .bar { opacity: .35; }

/* 채팅 */
.chat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.progress { flex: 1; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.bar { flex: 1; height: 10px; background: var(--bar-bg); border-radius: 999px; overflow: hidden; }
.bar.thin { height: 6px; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .3s; }
.banner { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-border); border-radius: 12px; padding: 10px 14px; margin: 8px 0; }
.log { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; min-height: 120px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.bot { align-self: flex-start; background: var(--bot); border-bottom-left-radius: 4px; }
.msg.me { align-self: flex-end; background: var(--me); color: var(--me-ink); border-bottom-right-radius: 4px; }
.msg .who { display: block; font-size: 12px; opacity: .75; margin-bottom: 2px; }
.msg.tag { align-self: center; background: none; color: var(--muted); font-size: 13px; padding: 2px; }
.typing { display: flex; gap: 5px; align-items: center; width: 64px; margin: 4px 0 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite both; }
.dot:nth-child(2) { animation-delay: .2s; }
.dot:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.composer {
  position: sticky; bottom: 0; background: var(--bg);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border);
}
.timer { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.timer .bar { flex: 1; }
.timer.over #timerText { color: var(--err); font-weight: 700; }
.timer.over .bar > i { background: var(--err); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.row .primary { width: auto; min-width: 140px; }

/* 리포트 */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.card .k { color: var(--muted); font-size: 13px; }
.card .v { font-size: 26px; font-weight: 800; }
.card.wide { grid-column: 1 / -1; }
.meter { margin: 6px 0; }
.meter .lbl { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; }
.item h3 { margin: 0 0 4px; font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
details { margin-top: 6px; }
summary { cursor: pointer; min-height: 32px; color: var(--accent); }
.qa { border-left: 3px solid var(--border); padding-left: 10px; margin: 8px 0; font-size: 14px; }
.qa .q { font-weight: 600; }
.qa .a { color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.tips { padding-left: 20px; }
.tips li { margin: 8px 0; }
.actions { margin-top: 24px; }

/* 내 연습 기록 */
.hist { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; }
.hist h3 { margin: 0 0 4px; font-size: 16px; overflow-wrap: anywhere; }
.hist .meta { color: var(--muted); font-size: 13px; }
.hist .btns { display: flex; gap: 8px; margin-top: 10px; }
.hist .btns button { flex: 1; }
button.danger { color: var(--err); border-color: var(--err); }

@media (prefers-reduced-motion: reduce) {
  .dot { animation: none; opacity: .6; }
  .bar > i { transition: none; }
}
@media (min-width: 640px) {
  main { padding: 24px; }
}

/* AI 고지 · 동의 */
.ai-notice { margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; }
.score-note { margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.consent-title { margin: 12px 0 4px; font-weight: 700; }
.voice-consent { margin: 0 0 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.voice-consent .check { margin-top: 6px; }

/* ───── 10회 과정 (docs/20) ───── */
.ccard { margin: 14px 0 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; font-size: 14px; }
.ccard .ttl { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.ccard .row { margin: 4px 0; }
.ccard .goal { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--bot); }
.ccard .cut { margin: 6px 0 0; color: var(--muted); }
.ccard.done .ttl { color: var(--err); }
#courseReport { margin: 6px 0 18px; }
.cwrap { overflow-x: auto; margin: 8px 0 12px; }
.ctable { border-collapse: collapse; width: 100%; font-size: 14px; }
.ctable th, .ctable td { border-bottom: 1px solid var(--border); padding: 6px 8px; text-align: right; white-space: nowrap; }
.ctable th:first-child, .ctable td:first-child { text-align: left; }
.ctable th { color: var(--muted); font-weight: 600; font-size: 13px; }
.ctable .up { color: var(--ok); font-weight: 700; }
.ctable .down { color: var(--err); font-weight: 700; }
.ctable .same { color: var(--muted); }
.clist { margin: 6px 0 0; padding-left: 18px; }
.cfix { margin: 6px 0 0; }
.cgoal p { margin: 6px 0 0; font-weight: 600; }
.cut-banner { color: var(--err); }
.ccard .date-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ccard .date-row input { width: auto; }

/* ───── 2026-10-11 프런트 1단계: 꼬리면접 · 휴대폰 우선 홈 · 면접 화면 ───── */
button.brand { background: none; border: none; padding: 0; min-height: 40px; display: flex; align-items: baseline; gap: 8px; font-size: 18px; font-weight: 800; color: var(--text); cursor: pointer; }
.brand-sub { font-size: 12px; font-weight: 500; color: var(--muted); }
@media (max-width: 380px) { .brand-sub { display: none; } }
button.big { min-height: 54px; font-size: 17px; }
button.ghost.wide { width: 100%; margin-top: 10px; }
button.link.back { min-height: 36px; padding: 0; text-decoration: none; }

.hcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 12px; }
.hcard .k { color: var(--muted); font-size: 13px; }
.hcard .v { font-size: 17px; font-weight: 700; margin: 2px 0; }
.hcard .v.big { font-size: 22px; }
.hcard .row { margin: 6px 0; }
.hcard.next { border: 2px solid var(--accent); }
.hcard.next.done { border-color: var(--border); }
.hcard .goal { margin: 10px 0 6px; padding: 10px 12px; border-radius: 10px; background: var(--bot); }
.hcard .goal .gv { font-weight: 700; font-size: 16px; margin: 2px 0; }
.hcard .warn-line { color: var(--warn-ink); background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 10px; padding: 6px 10px; }
.hcard h2 { margin: 0 0 8px; font-size: 16px; }
.dots { display: flex; gap: 4px; margin: 8px 0 6px; }
.dots span { flex: 1; height: 8px; border-radius: 4px; background: var(--bar-bg); }
.dots span.on { background: var(--accent); }
.dots span.now { background: transparent; border: 2px solid var(--accent); height: 8px; }
.date-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.date-row label { margin: 0; }
.date-row input[type=date] { font: inherit; font-size: 16px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; min-height: 44px; }
.pill { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-border); }

.tabs { margin: 4px 0 10px; }
.chip.tab { min-height: 36px; padding: 4px 12px; font-size: 13px; cursor: pointer; color: var(--text); }
.chip.tab[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.gbars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding: 4px 0; overflow-x: auto; }
.gcol { flex: 1 0 28px; display: flex; flex-direction: column; align-items: center; height: 100%; }
.gbar { flex: 1; width: 100%; max-width: 34px; display: flex; align-items: flex-end; background: var(--bar-bg); border-radius: 6px 6px 2px 2px; overflow: hidden; }
.gbar i { display: block; width: 100%; background: var(--accent); border-radius: 6px 6px 0 0; }
.gbar i.na { background: transparent; }
.gval { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.glab { font-size: 11px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
#courseBars { margin-bottom: 8px; }

/* 면접 화면 — 안내는 접고, 지금 답할 질문을 크게 */
.chatinfo { margin: 0 0 6px; font-size: 14px; }
.chatinfo summary { min-height: 36px; display: flex; align-items: center; }
.chatinfo ul { margin: 4px 0 8px; padding-left: 18px; color: var(--muted); }
.chatinfo li { margin: 4px 0; }
.msg.bot.latest { font-size: 17px; line-height: 1.55; border: 2px solid var(--accent); }
@media (max-width: 520px) {
  .msg { max-width: 94%; }
  .row .primary { min-width: 120px; }
}

/* 의견 남기기 */
.fb { margin: 18px 0 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 14px 10px; }
.fb summary { font-weight: 700; }
.fb-stars { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.fb textarea { margin-top: 4px; }
.fb .row .ghost { min-width: 96px; }

/* 카카오 로그인 (docs/24 §4) — 단추 색은 카카오 디자인 규칙대로 두 화면 모두 같은 노랑 */
.kakao-box { margin: 0 0 8px; }
.kakao-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: 12px; background: #fee500; color: rgba(0, 0, 0, .85); font-weight: 600; text-decoration: none; }
.kakao-btn svg { width: 18px; height: 18px; flex: none; }
.kakao-btn:hover { filter: brightness(.97); }
.kakao-btn.sm { display: inline-flex; min-height: 40px; font-size: 14px; }
.kakao-box .or { display: flex; align-items: center; gap: 10px; margin: 16px 0 4px; color: var(--muted); font-size: 13px; }
.kakao-box .or::before, .kakao-box .or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.kakao-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-border); font-size: 14px; }
.kakao-notice p { flex: 1 1 220px; margin: 0; }

/* «답의 뼈대» (docs/28) — 질문 아래 접힌 칸. 칸만, 완성 문장 없음 */
details.skeleton { margin: 4px 0 10px; padding: 8px 12px; border: 1px dashed var(--border); border-radius: 10px; background: var(--surface-2); font-size: 14px; }
details.skeleton > summary { cursor: pointer; color: var(--muted); font-weight: 600; }
details.skeleton .sk-head { margin: 8px 0 4px; font-weight: 600; }
details.skeleton .sk-cells { margin: 0 0 6px; padding-left: 20px; }
details.skeleton .sk-cells li { margin: 2px 0; }
details.skeleton .sk-kw { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
details.skeleton .sk-kw-lbl { color: var(--muted); font-size: 13px; }
details.skeleton .sk-unknown, details.skeleton .sk-note { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.qa .sk-line { margin-top: 4px; color: var(--muted); font-size: 13px; }

/* 면접관 질문 음성 (docs/29) — 실전 조건은 질문 글을 가리고 «음성 질문» 표시만 */
.qaudio { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; font-size: 13px; color: var(--muted); }
.qaudio .qaudio-lbl { margin-right: auto; }
.msg.bot .qmask { display: none; color: var(--muted); }
.log.hide-q .msg.bot .qtext { display: none; }
.log.hide-q .msg.bot .qmask { display: inline; }


/* 선생님께 보내기 · 선생님 피드백 (docs/34) */
.tch-box { background: var(--surface); border: 2px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; }
.tch-box h2 { margin: 0 0 6px; font-size: 17px; }
.tch-box .btns { margin-top: 10px; }
.tch-fb { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 6px; font-size: 15px; line-height: 1.6; }
.tch-badge { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.tch-badge.new { color: var(--accent); }
/* 선생님 로그인 (docs/32 §6) — 학생 로그인 화면 위쪽의 접힌 한 줄 */
.teacher-login { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.teacher-login summary { cursor: pointer; font-weight: 700; }
.teacher-login form { display: grid; gap: 6px; margin-top: 10px; }
