/* 보험설계사 모의고사 — 모바일 우선 스타일 */
:root {
  --bg: #f1f4fa;
  --card: #ffffff;
  --ink: #131c33;
  --ink-2: #33405e;
  --muted: #6d7a96;
  --line: #e4e9f4;
  --navy: #12245c;
  --blue: #2f5fe0;
  --blue-soft: #e8eefc;
  --life: #2f5fe0;
  --nonlife: #0e8f83;
  --nonlife-soft: #e2f6f3;
  --pass: #0f8055;
  --pass-soft: #e3f6ec;
  --fail: #d0433f;
  --fail-soft: #fdeceb;
  --warn: #b8752a;
  --shadow: 0 6px 20px rgba(20, 34, 70, 0.07);
  --shadow-lg: 0 18px 44px rgba(12, 24, 54, 0.22);
  --r: 18px;
  --r-sm: 12px;
  --tab-h: 62px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: #e8edf7;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic",
    "Noto Sans KR", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body.locked { overflow: hidden; }

button, input, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

h1, h2, h3, p, ul, li, table { margin: 0; padding: 0; }
ul { list-style: none; }
button { cursor: pointer; border: 0; background: none; }
b { font-weight: 700; }

.app {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  overflow-x: hidden;
}

@media (min-width: 620px) {
  .app { box-shadow: 0 0 0 1px rgba(18, 36, 92, 0.06), 0 30px 80px rgba(18, 36, 92, 0.12); }
}

/* ── 부팅 화면 ───────────────────────────────────────────── */
.boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 100dvh;
  color: var(--navy);
}
.boot-logo {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  background: var(--navy); color: #fff;
  border-radius: 16px;
  font-size: 28px;
  margin-bottom: 8px;
}
.boot p { font-weight: 700; font-size: 17px; }
.boot small { color: var(--muted); }

/* ── 공통 ─────────────────────────────────────────────────── */
.screen { padding-bottom: 28px; }
.stack { display: flex; flex-direction: column; gap: 16px; padding: 16px 16px 0; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12.5px; }
.hint {
  background: #f4f7fd;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
  margin-top: 10px;
}
.hint.warn { background: #fff6ec; border-color: #f6dcbb; color: var(--warn); }
.center { text-align: center; }
.spacer { width: 32px; }
.warn { color: var(--warn); }

.card {
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 16px;
}
.block { display: block; }
.result .stack, .review .stack { padding-bottom: 26px; }
.card-h { font-size: 15px; margin-bottom: 10px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.chip-life { background: var(--blue-soft); color: var(--blue); }
.chip-nonlife { background: var(--nonlife-soft); color: var(--nonlife); }
.chip-soft { background: #eef1f8; color: var(--ink-2); font-weight: 600; }
.chip-point { background: #fff1e3; color: #b1650f; }
.chip-pass { background: var(--pass-soft); color: var(--pass); }
.chip-fail { background: var(--fail-soft); color: var(--fail); }

.notice {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  background: #eaeff9;
  border-radius: var(--r-sm);
  padding: 12px 14px;
}
.empty-line { color: var(--muted); font-size: 13px; padding: 10px 2px; }

/* ── 홈 히어로 ───────────────────────────────────────────── */
.hero {
  background:
    radial-gradient(1100px 320px at 88% -8%, rgba(90, 140, 255, 0.75), transparent 62%),
    linear-gradient(160deg, #12245c 0%, #1c3a8c 62%, #2450b8 100%);
  color: #fff;
  padding: calc(14px + env(safe-area-inset-top)) 18px 22px;
  border-radius: 0 0 26px 26px;
}
.hero-top { display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; }
.brand-mark {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-style: normal; font-size: 13px;
}
.hero h1 { font-size: 24px; line-height: 1.28; letter-spacing: -0.03em; margin: 18px 0 6px; }
.hero-sub { font-size: 13px; color: rgba(255, 255, 255, 0.78); }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 12px 8px;
}
.hero-stats div { text-align: center; }
.hero-stats b { display: block; font-size: 19px; }
.hero-stats span { font-size: 11px; color: rgba(255, 255, 255, 0.72); }

/* ── 이어서 / 빠른 실행 ──────────────────────────────────── */
.resume {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  background: #fff;
  border-radius: var(--r);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--blue);
}
.resume-label { font-size: 11.5px; font-weight: 700; color: var(--blue); }
.resume b { font-size: 15px; }
.resume .muted { font-size: 12.5px; }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 14px;
  border: 1px solid rgba(18, 36, 92, 0.04);
}
.quick-card:active { transform: scale(0.985); }
.quick-emoji { font-size: 20px; line-height: 1.2; }
.quick-card b { font-size: 14.5px; }
.done-badge {
  font-size: 11px; font-weight: 700;
  color: var(--pass); background: var(--pass-soft);
  padding: 2px 8px; border-radius: 999px;
}

.install {
  width: 100%;
  text-align: left;
  background: var(--pass-soft);
  color: var(--pass);
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--r-sm);
  padding: 12px 14px;
}

/* ── 시험 카드 ───────────────────────────────────────────── */
.block-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 4px 2px 10px;
}
.block-head h2 { font-size: 16px; letter-spacing: -0.02em; }
.link { color: var(--blue); font-size: 12.5px; font-weight: 700; }

.exam-card { border-top: 4px solid var(--line); }
.accent-life { border-top-color: var(--life); }
.accent-nonlife { border-top-color: var(--nonlife); }
.exam-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.exam-title h3 { font-size: 17px; margin: 6px 0 2px; letter-spacing: -0.02em; }
.cut-tag {
  flex: 0 0 auto;
  font-size: 10.5px; line-height: 1.25;
  text-align: center;
  color: var(--muted);
  background: #f4f6fb;
  border-radius: 10px;
  padding: 7px 8px;
}

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #eef1f8;
  border-radius: 11px;
  padding: 3px;
  margin: 14px 0 12px;
}
.seg button {
  padding: 8px 0;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.seg button.is-active { background: #fff; color: var(--navy); box-shadow: 0 2px 6px rgba(18, 36, 92, 0.08); }

.modes { display: flex; flex-direction: column; gap: 8px; }
.mode-btn {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: #f8faff;
  border: 1px solid #e6ebf7;
  border-radius: 13px;
  padding: 12px 13px;
}
.mode-btn:active { background: #eef3ff; }
.mode-main { display: flex; flex-direction: column; }
.mode-main b { font-size: 14px; }
.mode-main small { color: var(--muted); font-size: 11.5px; }
.mode-go {
  flex: 0 0 auto;
  font-size: 12px; font-weight: 700;
  color: #fff; background: var(--navy);
  border-radius: 999px;
  padding: 6px 12px;
}

.paper { margin-top: 12px; }
.paper summary {
  font-size: 12.5px; font-weight: 700; color: var(--muted);
  cursor: pointer;
  padding: 6px 0;
}
.paper ul { display: flex; flex-direction: column; gap: 6px; padding: 4px 0 2px; }
.paper li {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 12.5px; color: var(--ink-2);
  border-bottom: 1px dashed var(--line);
  padding-bottom: 6px;
}
.paper li em { font-style: normal; color: var(--muted); white-space: nowrap; }

/* ── 통계 / 기록 ─────────────────────────────────────────── */
.stat-card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 14px 8px;
  margin-bottom: 12px;
}
.stat-card.tight { margin-bottom: 0; }
.stat-card div { text-align: center; border-right: 1px solid var(--line); }
.stat-card div:last-child { border-right: 0; }
.stat-card b { display: block; font-size: 18px; letter-spacing: -0.02em; }
.stat-card span { font-size: 11px; color: var(--muted); }

.hist-list { display: flex; flex-direction: column; gap: 8px; }
.hist-row {
  background: var(--card);
  border-radius: 13px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.hist-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.hist-top b { font-size: 13.5px; }
.hist-top .muted { font-size: 11.5px; white-space: nowrap; }
.hist-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }

/* ── 하단 탭 ─────────────────────────────────────────────── */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  z-index: 30;
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10.5px; font-weight: 600; color: #93a0b8;
}
.tab-icon { font-size: 18px; line-height: 1; filter: grayscale(1) opacity(0.65); }
.tab.on { color: var(--navy); }
.tab.on .tab-icon { filter: none; }

.home .stack, .wrong .stack, .history .stack, .settings .stack { padding-bottom: calc(var(--tab-h) + 24px); }

/* ── 상단바 ──────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.topbar-title b { font-size: 14px; letter-spacing: -0.01em; }
.topbar-title small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon-btn {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: #f1f4fb;
  color: var(--ink-2);
  font-size: 15px;
}
.icon-btn.inverse { background: rgba(255, 255, 255, 0.16); color: #fff; }
.icon-btn:active { background: #e5eafa; }

.timer {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: var(--navy);
  background: var(--blue-soft);
  border-radius: 10px;
  padding: 6px 10px;
}
.timer.danger { color: #fff; background: var(--fail); animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.72; } }

.progress { height: 3px; background: #e3e9f4; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #2f5fe0, #5b8bff); transition: width 0.25s ease; }

/* ── 문제 화면 ───────────────────────────────────────────── */
.qwrap { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
.exam { padding-bottom: 0; }
.qmeta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.qno { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; margin-right: 2px; }
.flag {
  margin-left: auto;
  width: 34px; height: 30px;
  border-radius: 9px;
  background: #f1f4fb;
  color: #aab5c9;
  font-size: 14px;
}
.flag.on { background: #fff3d9; color: #c07a12; }

.stem { font-size: 17px; line-height: 1.55; letter-spacing: -0.02em; margin: 14px 0 18px; font-weight: 700; }

.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1.5px solid #e3e9f5;
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 14.5px;
  line-height: 1.5;
  transition: border-color 0.15s, background 0.15s;
}
.opt:active { background: #f6f9ff; }
.opt-mark {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #f1f4fb;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-top: 1px;
}
.opt-text { flex: 1; }
.opt-tag { flex: 0 0 auto; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.opt-tag.ok { background: var(--pass-soft); color: var(--pass); }
.opt-tag.no { background: var(--fail-soft); color: var(--fail); }

.opt.is-selected { border-color: var(--blue); background: #f3f7ff; }
.opt.is-selected .opt-mark { background: var(--blue); color: #fff; }
.opt.is-correct { border-color: var(--pass); background: var(--pass-soft); }
.opt.is-correct .opt-mark { background: var(--pass); color: #fff; }
.opt.is-wrong { border-color: var(--fail); background: var(--fail-soft); }
.opt.is-wrong .opt-mark { background: var(--fail); color: #fff; }
.opt[disabled] { cursor: default; opacity: 1; }
.opt[disabled]:not(.is-correct):not(.is-wrong) { opacity: 0.62; }

.feedback {
  margin-top: 16px;
  border-radius: 14px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  background: #fff;
}
.feedback.ok { background: #f1faf5; border-color: #cdecdb; }
.feedback.no { background: #fef5f4; border-color: #f7d6d3; }
.fb-head { font-size: 13px; font-weight: 800; }
.feedback.ok .fb-head { color: var(--pass); }
.feedback.no .fb-head { color: var(--fail); }
.fb-answer { font-size: 14px; font-weight: 700; margin: 6px 0; }
.fb-explain { font-size: 13.5px; line-height: 1.62; color: var(--ink-2); }
.fb-ref { font-size: 11.5px; color: var(--muted); margin-top: 8px; }

.qfoot-note { margin-top: 16px; }

.qfoot {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  z-index: 25;
}
.btn-ghost, .btn-primary, .btn-danger, .btn-omr {
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 16px;
  flex: 0 0 auto;
}
.btn-ghost { background: #f1f4fb; color: var(--ink-2); }
.btn-primary { background: var(--navy); color: #fff; flex: 1; }
.btn-primary.submit { background: var(--fail); }
.btn-danger { background: var(--fail-soft); color: var(--fail); }
.btn-omr { background: #eef2fb; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.btn-omr b { color: var(--blue); }
.btn-block { display: block; width: 100%; flex: none; }
.btn-ghost[disabled], .btn-primary[disabled] { opacity: 0.4; }

/* ── 바텀시트 / 오버레이 ─────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}
.overlay.open { display: block; }
.scrim { position: absolute; inset: 0; background: rgba(12, 20, 40, 0.46); backdrop-filter: blur(2px); }
.sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-lg);
  padding-bottom: env(safe-area-inset-bottom);
  animation: sheet-up 0.22s ease-out;
}
@keyframes sheet-up { from { transform: translate(-50%, 14px); opacity: 0.6; } to { transform: translate(-50%, 0); opacity: 1; } }
.sheet-head {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.sheet-head b { font-size: 15.5px; flex: 1; }
.sheet-body { padding: 16px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.sheet-body > .muted { margin-bottom: 10px; }
.sheet-foot {
  display: flex; gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
  flex: 0 0 auto;
}
.sheet-foot.column { flex-direction: column; }
.sheet-foot .btn-primary, .sheet-foot .btn-ghost { flex: 1; }

.term-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.term-grid div {
  text-align: center;
  background: #f5f8fe;
  border-radius: 12px;
  padding: 10px 4px;
}
.term-grid b { display: block; font-size: 18px; color: var(--navy); }
.term-grid span { font-size: 10.5px; color: var(--muted); }
.qual-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 0; }
.qual-list li {
  font-size: 12.5px;
  background: #f8faff;
  border-radius: 10px;
  padding: 9px 11px;
  line-height: 1.5;
}
.summary-lines { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; }
.summary-lines div { display: flex; justify-content: space-between; font-size: 14px; }
.summary-lines span { color: var(--muted); }

/* ── OMR ─────────────────────────────────────────────────── */
.omr-legend { display: flex; gap: 12px; align-items: center; padding: 10px 16px 0; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.omr-sheet { max-height: 92dvh; }
.omr-legend span { display: inline-flex; align-items: center; gap: 4px; }
.dot { width: 10px; height: 10px; border-radius: 3px; background: #eef1f8; border: 1px solid #dfe5f1; display: inline-block; }
.dot.answered { background: var(--blue); border-color: var(--blue); }
.dot.flagged { background: #fff0d2; border-color: #f0c878; }
.omr-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  padding: 12px 16px 16px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.omr-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  aspect-ratio: 1 / 1;
  border-radius: 11px;
  background: #f4f6fc;
  border: 1.5px solid #e3e9f5;
  font-variant-numeric: tabular-nums;
}
.omr-cell b { font-size: 15px; }
.omr-cell i { font-style: normal; font-size: 9.5px; color: var(--muted); }
.omr-cell.answered { background: var(--blue-soft); border-color: #b9cdfb; }
.omr-cell.answered b { color: var(--blue); }
.omr-cell.flagged::after {
  content: "";
  position: absolute; top: 5px; right: 5px;
  width: 6px; height: 6px; border-radius: 50%;
  background: #e6a219;
}
.omr-cell.current { border-color: var(--navy); box-shadow: 0 0 0 2px rgba(18, 36, 92, 0.12); }

/* ── 결과 ───────────────────────────────────────────────── */
.result-hero {
  padding: 22px 18px 20px;
  text-align: center;
  color: #fff;
}
.result-hero.pass { background: linear-gradient(160deg, #0d6b48, #12a269); }
.result-hero.fail { background: linear-gradient(160deg, #7a2a2c, #c04a44); }
.result-hero.plain { background: linear-gradient(160deg, #12245c, #2450b8); }
.result-hero .muted { color: rgba(255, 255, 255, 0.76); }
.hero-verdict { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; margin: 8px 0 2px; }
.big-score { margin: 10px 0 2px; }
.big-score b { font-size: 42px; font-weight: 800; letter-spacing: -0.03em; }
.big-score span { font-size: 14px; opacity: 0.8; margin-left: 4px; }

.qual-grid { display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 0; }
.qual {
  background: #fff;
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 15px 16px;
  border-left: 4px solid var(--line);
}
.qual.pass { border-left-color: var(--pass); }
.qual.fail { border-left-color: var(--fail); }
.qual-top { display: flex; align-items: center; justify-content: space-between; }
.qual-name { font-size: 14px; font-weight: 700; }
.stamp {
  font-size: 11.5px; font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1.5px solid currentColor;
  letter-spacing: 0.06em;
}
.stamp.pass { color: var(--pass); }
.stamp.fail { color: var(--fail); }
.qual-score { margin: 8px 0 10px; }
.qual-score b { font-size: 24px; letter-spacing: -0.02em; }
.qual-score span { font-size: 12.5px; color: var(--muted); margin-left: 4px; }
.bar { position: relative; height: 8px; background: #eef1f8; border-radius: 999px; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #2f5fe0, #5b8bff); }
.qual.pass .bar i { background: linear-gradient(90deg, #0f8055, #2bbd83); }
.qual.fail .bar i { background: linear-gradient(90deg, #c04a44, #e07b76); }
.bar .cut {
  position: absolute; top: -3px; bottom: -3px;
  width: 2px; background: rgba(19, 28, 51, 0.35);
  border-radius: 2px;
}
.qual-sub { font-size: 11.5px; color: var(--muted); margin-top: 8px; }

.sec-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sec-table th, .sec-table td { padding: 9px 4px; border-bottom: 1px solid var(--line); text-align: right; }
.sec-table thead th { font-size: 11px; color: var(--muted); font-weight: 600; }
.sec-table thead th:first-child { text-align: left; }
.sec-table tbody th { text-align: left; font-weight: 600; }
.sec-table tr:last-child th, .sec-table tr:last-child td { border-bottom: 0; }

.result-actions { display: flex; flex-direction: column; gap: 9px; }

/* ── 문항 해설 ───────────────────────────────────────────── */
.rev-list { display: flex; flex-direction: column; gap: 12px; }
.rev {
  background: #fff;
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 14px 15px;
  border-left: 4px solid var(--line);
}
.rev.ok { border-left-color: var(--pass); }
.rev.no { border-left-color: var(--fail); }
.rev-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rev-no { font-size: 15px; font-weight: 800; }
.rev-verdict { margin-left: auto; font-size: 11.5px; font-weight: 800; }
.rev.ok .rev-verdict { color: var(--pass); }
.rev.no .rev-verdict { color: var(--fail); }
.rev-stem { font-size: 14px; font-weight: 600; line-height: 1.5; margin: 8px 0 10px; }
.rev-opts { display: flex; flex-direction: column; gap: 5px; }
.rev-opt {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-2);
  background: #f7f9fd;
  border-radius: 8px;
  padding: 8px 10px;
}
.rev-opt.is-correct { background: var(--pass-soft); color: #0a6a45; font-weight: 700; }
.rev-opt.is-wrong { background: var(--fail-soft); color: #a5352f; }
.rev-mine { font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
.rev-explain { font-size: 12.5px; line-height: 1.62; color: var(--ink-2); }

/* ── 오답노트 ────────────────────────────────────────────── */
.filter-row { display: flex; gap: 7px; }
.filter-row.scroll {
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-row.scroll::-webkit-scrollbar { display: none; }
.fchip.small { font-size: 11.5px; padding: 6px 11px; white-space: nowrap; }
.fchip {
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}
.fchip.on { background: var(--navy); border-color: var(--navy); color: #fff; }

.wrong-list { display: flex; flex-direction: column; gap: 10px; }
.wrong-item {
  background: #fff;
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 13px 15px;
}
.wi-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wi-count { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--warn); }
.wi-stem {
  font-size: 13.5px;
  line-height: 1.5;
  margin: 8px 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wi-actions { display: flex; gap: 6px; }
.mini {
  font-size: 12px; font-weight: 700;
  padding: 7px 11px;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue);
}
.mini.ghost { background: #f3f5fa; color: var(--muted); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 44px 20px;
  background: #fff;
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.empty span { font-size: 30px; }
.empty b { font-size: 15px; }
.empty .muted { max-width: 260px; line-height: 1.6; }

.peek-stem { font-size: 15.5px; line-height: 1.55; margin: 10px 0 12px; }

/* ── 설정 ───────────────────────────────────────────────── */
.kv { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; font-size: 13.5px; border-bottom: 1px dashed var(--line); }
.kv:last-of-type { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 700; }
.perm.granted { color: var(--pass); }
.perm.denied { color: var(--fail); }
.perm.unsupported { color: var(--muted); }
.perm.default { color: var(--ink-2); }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 10px;
  border-top: 1px solid var(--line);
  margin-top: 10px;
  cursor: pointer;
}
.switch-row span { display: flex; flex-direction: column; }
.switch-row b { font-size: 14px; }
.switch-row small { font-size: 11.5px; color: var(--muted); }
.switch-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 46px; height: 27px;
  border-radius: 999px;
  background: #dfe5f1;
  position: relative;
  transition: background 0.18s;
  flex: 0 0 auto;
}
.switch-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s;
}
.switch-row input[type="checkbox"]:checked { background: var(--blue); }
.switch-row input[type="checkbox"]:checked::after { transform: translateX(19px); }

.field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 14px; font-size: 13.5px; }
.field input[type="time"] {
  border: 1px solid var(--line);
  background: #f8faff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.row .btn-ghost { flex: 1; }

.about .notice { margin-top: 10px; }
.version { text-align: center; font-size: 11px; color: #9aa6bd; padding: 6px 0 4px; }

/* ── 토스트 ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  max-width: min(88vw, 460px);
  background: rgba(19, 28, 51, 0.94);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  padding: 12px 16px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 80;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { background: rgba(150, 92, 20, 0.96); }

.noscript {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; gap: 10px;
  align-items: center; justify-content: center;
  background: #fff; padding: 30px; text-align: center;
  z-index: 99;
}
.noscript h1 { font-size: 18px; }
.noscript p { font-size: 13.5px; color: var(--muted); max-width: 320px; line-height: 1.6; }

/* 좁은 화면 보정 */
@media (max-width: 360px) {
  .hero h1 { font-size: 21px; }
  .stem { font-size: 16px; }
  .opt { padding: 12px; font-size: 14px; }
  .stat-card div, .term-grid div { padding-left: 2px; padding-right: 2px; }
  .mode-go { padding: 6px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
