/* IS MASTER(정보보안기사 실기 마스터) 테마를 따른다 */
:root {
  --bg: #0a0e17;
  --sidebar: #0f172a;
  --panel: #111827;
  --panel-2: rgba(255, 255, 255, 0.04);
  --primary: #38bdf8;
  --primary-strong: #0ea5e9;
  --blue: #2563eb;
  --gold: #fbbf24;
  --good: #34d399;
  --good-bg: rgba(52, 211, 153, 0.1);
  --bad: #f87171;
  --bad-bg: rgba(248, 113, 113, 0.1);
  --border: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --sub: #cbd5e1;
  --muted: #94a3b8;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
/* 화면이 넓을수록 글자·여백(rem)을 함께 키운다: 1400px≈14px, 1920px≈17px, 2560px 이상 18px */
html { font-size: clamp(14px, 0.45vw + 8px, 18px); }
body {
  background: var(--bg);
  color: var(--text);
  font: 0.95rem/1.6 "Inter", "Noto Sans KR", sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
[hidden] { display: none !important; }

#app { display: flex; height: 100vh; }

/* ── 사이드바 ── */
#sidebar {
  width: 15rem; flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 2rem 1.25rem 1.25rem;
  display: flex; flex-direction: column;
}
#app.quiz-mode #sidebar { display: none; }
.logo { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; margin: 0 0.5rem 2rem; }
.nav-links { list-style: none; flex: 1; }
.nav-links li {
  padding: 0.7rem 0.9rem; margin-bottom: 0.3rem; border-radius: 8px;
  color: var(--muted); font-weight: 600; cursor: pointer; transition: 0.15s;
}
.nav-links li:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.nav-links li.active { color: var(--primary); background: rgba(56, 189, 248, 0.06); }
.sidebar-foot {
  border-top: 1px solid var(--border); padding-top: 1rem;
  color: var(--muted); font-size: 0.8rem; text-align: center;
}

/* ── 본문 ── */
.content { flex: 1; overflow-y: auto; }
.view { padding: 3rem 3.5rem 4rem; max-width: 84rem; margin: 0 auto; }
h1 { font-size: 1.85rem; font-weight: 800; margin-bottom: 1.75rem; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; font-weight: 800; margin: 2.25rem 0 1rem; display: flex; align-items: center; gap: 0.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.page-head h1 { margin: 0; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* 알림 배너 */
.banner {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 1.4rem; border-radius: var(--radius);
  background: rgba(251, 191, 36, 0.07); border: 1px solid rgba(251, 191, 36, 0.35);
}
.banner .icon { font-size: 1.6rem; }
.banner .text { flex: 1; }
.banner strong { color: var(--gold); display: block; }
.banner.info { background: rgba(56, 189, 248, 0.06); border-color: rgba(56, 189, 248, 0.35); }
.banner.info strong { color: var(--primary); }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.7rem 1.2rem; border-radius: 10px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, 0.04);
  font-weight: 700; font-size: 0.92rem; transition: 0.15s; white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, 0.08); }
.btn.primary { background: linear-gradient(135deg, var(--blue), #1d4ed8); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.sky { background: linear-gradient(135deg, var(--primary-strong), var(--primary)); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3); }
.btn.gold { background: var(--gold); border-color: transparent; color: #1f1300; }
.btn.danger { color: var(--bad); border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.06); }
.btn.small { padding: 0.45rem 0.8rem; font-size: 0.82rem; border-radius: 8px; }
.btn:disabled { opacity: 0.4; cursor: default; filter: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.ghost-btn { background: none; border: none; color: var(--muted); padding: 0.35rem 0.55rem; border-radius: 6px; font-size: 1rem; }
.ghost-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

/* 모드 토글 */
.mode-toggle-group {
  display: flex; padding: 0.35rem; gap: 0.2rem;
  background: rgba(15, 23, 42, 0.6); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 10px;
}
.toggle-btn {
  background: transparent; border: none; color: var(--muted);
  padding: 0.6rem 1.2rem; border-radius: 7px; font-weight: 700; font-size: 0.9rem; transition: 0.2s;
}
.toggle-btn:hover { color: var(--text); }
.toggle-btn.active { background: linear-gradient(135deg, var(--primary-strong), var(--primary)); color: #fff; box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3); }
.mode-desc { color: var(--muted); font-size: 0.85rem; margin: -0.75rem 0 1.5rem; text-align: right; }

/* 기출 풀기 카드 */
.mode-layout { display: flex; flex-direction: column; gap: 1.25rem; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.big-card {
  display: flex; align-items: center; gap: 1.4rem; text-align: left; width: 100%;
  padding: 1.75rem 2rem; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--border); transition: 0.2s;
}
.big-card:hover { border-color: rgba(56, 189, 248, 0.5); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }
.big-card .emoji { font-size: 2.4rem; line-height: 1; }
.big-card h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 0.2rem; }
.big-card p { color: var(--muted); font-size: 0.88rem; }
.big-card.star { background: linear-gradient(135deg, rgba(251, 191, 36, 0.06), var(--panel)); border-color: rgba(251, 191, 36, 0.3); }
.big-card.star h3 { color: var(--gold); }
.big-card.active { border-color: var(--primary); }

.sub-list { margin-top: 1.5rem; }
.sub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.sub-card { display: flex; flex-direction: column; gap: 0.6rem; }
.sub-card h4 { font-size: 1.02rem; font-weight: 800; }
.sub-card .meta { color: var(--muted); font-size: 0.83rem; }

/* 대시보드 */
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; align-items: stretch; }
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.feature { padding: 1.25rem; }
.feature .ico {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.05); font-size: 1.2rem; margin-bottom: 0.9rem;
}
.feature h4 { font-weight: 800; margin-bottom: 0.25rem; }
.feature p { color: var(--muted); font-size: 0.85rem; }
.guide-card { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 1rem; color: var(--sub); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stat-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 1.3rem 1.4rem; }
.stat-card .label { color: var(--muted); font-size: 0.83rem; }
.stat-card .value { font-size: 1.9rem; font-weight: 800; margin-top: 0.35rem; color: var(--primary); line-height: 1.2; }
.stat-card .value small { font-size: 0.95rem; color: var(--muted); font-weight: 600; }

/* PDF 불러오기 */
.dropzone {
  border: 2px dashed rgba(56, 189, 248, 0.4); border-radius: var(--radius);
  padding: 2.5rem 1.5rem; text-align: center; cursor: pointer; transition: 0.2s;
  background: rgba(56, 189, 248, 0.03);
}
.dropzone:hover, .dropzone.over { background: rgba(56, 189, 248, 0.08); border-color: var(--primary); }
.dropzone .big { font-size: 2.4rem; }
.dropzone h3 { margin: 0.5rem 0 0.3rem; font-weight: 800; }
.unlock-card { border-color: rgba(56, 189, 248, 0.35); }
.unlock-card h3 { font-weight: 800; margin-bottom: 0.3rem; }
.check-row { display: flex; align-items: center; gap: 0.45rem; margin-top: 0.8rem; color: var(--muted); font-size: 0.85rem; cursor: pointer; }
.check-row input { width: 16px; height: 16px; accent-color: var(--primary); }
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.85em; background: rgba(255, 255, 255, 0.06); padding: 0.05rem 0.35rem; border-radius: 4px; }
.progress-bar { height: 8px; background: rgba(255, 255, 255, 0.06); border-radius: 4px; overflow: hidden; margin-top: 1rem; }
.progress-bar > div { height: 100%; background: linear-gradient(90deg, var(--primary-strong), var(--primary)); transition: width 0.15s; }

/* 막대 */
.bar { height: 8px; background: rgba(255, 255, 255, 0.06); border-radius: 4px; overflow: hidden; }
.bar > div { height: 100%; background: var(--primary); border-radius: 4px; }
.bar.low > div { background: var(--bad); }
.bar.mid > div { background: var(--gold); }

/* 표 */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.75rem 0.8rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 0.82rem; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: rgba(255, 255, 255, 0.02); }
.ox-o { color: var(--good); font-weight: 800; }
.ox-x { color: var(--bad); font-weight: 800; }
.pass { color: var(--good); font-weight: 800; }
.fail { color: var(--bad); font-weight: 800; }

.empty-state { text-align: center; padding: 4rem 1rem; color: var(--muted); }
.empty-state .big { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { color: var(--sub); font-size: 1.25rem; margin-bottom: 0.4rem; }

/* ── 풀이 화면 ── */
.quiz-top {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0.9rem 1.75rem; background: rgba(15, 23, 42, 0.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.quiz-title-pill {
  justify-self: start; padding: 0.35rem 0.9rem; border-radius: 8px;
  background: rgba(56, 189, 248, 0.08); border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--primary); font-weight: 700; font-size: 0.85rem;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.quiz-timer { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.quiz-timer.low { color: var(--bad); }
.quiz-top-right { justify-self: end; display: flex; gap: 0.5rem; align-items: center; }
.quiz-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: rgba(255, 255, 255, 0.04); }
.quiz-progress > div { height: 100%; background: var(--primary); transition: width 0.2s; }

.quiz-body { padding: 2rem 1.5rem 4rem; display: flex; justify-content: center; }
.quiz-card {
  width: 100%; max-width: 54rem;
  background: linear-gradient(180deg, #151d2e, #111827);
  border: 1px solid var(--border); border-radius: 18px; padding: 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.q-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding-bottom: 0.85rem; border-bottom: 1px solid var(--border); }
.q-badge { background: var(--primary); color: #04111d; font-weight: 800; font-size: 0.82rem; padding: 0.2rem 0.6rem; border-radius: 6px; }
.q-tag { border: 1px solid var(--border); background: rgba(255, 255, 255, 0.04); font-size: 0.8rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 6px; color: var(--sub); }
.q-head .spacer { flex: 1; }
.star-btn {
  border: 1px solid rgba(251, 191, 36, 0.45); background: rgba(251, 191, 36, 0.08); color: var(--gold);
  padding: 0.3rem 0.75rem; border-radius: 7px; font-weight: 700; font-size: 0.82rem;
}
.star-btn.on { background: var(--gold); color: #1f1300; }
.src-btn { border: 1px solid var(--border); background: none; color: var(--muted); padding: 0.3rem 0.7rem; border-radius: 7px; font-weight: 600; font-size: 0.82rem; }
.src-btn:hover { color: var(--text); }
.src-btn.hint { color: var(--primary); border-color: rgba(56, 189, 248, 0.45); }
.q-source { color: var(--muted); font-size: 0.8rem; margin: 0.7rem 0 1.1rem; }
.q-stem { font-size: 1.12rem; font-weight: 700; line-height: 1.7; margin-bottom: 1.1rem; }
.bogi-box {
  border: 1px solid var(--border); background: rgba(255, 255, 255, 0.03); border-radius: 10px;
  padding: 0.9rem 1.1rem; margin: -0.2rem 0 1.25rem; font-size: 0.95rem; color: var(--sub);
}
.bogi-box div + div { margin-top: 0.35rem; }

.choices { display: flex; flex-direction: column; gap: 0.6rem; }
.choice {
  display: flex; gap: 0.75rem; align-items: flex-start; width: 100%; text-align: left;
  padding: 0.9rem 1.1rem; border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.09); background: rgba(10, 14, 23, 0.6);
  color: var(--sub); line-height: 1.65; font-size: 0.97rem; transition: 0.12s;
}
.choice:hover:not(:disabled) { border-color: rgba(56, 189, 248, 0.6); color: var(--text); }
.choice .mark { flex: none; font-weight: 800; color: var(--muted); font-size: 1.05rem; line-height: 1.55; }
.choice.selected { border-color: var(--primary); background: rgba(56, 189, 248, 0.1); color: var(--text); box-shadow: 0 0 0 1px var(--primary) inset; }
.choice.selected .mark { color: var(--primary); }
.choice.correct { border-color: var(--good); background: var(--good-bg); color: var(--text); }
.choice.correct .mark { color: var(--good); }
.choice.wrong { border-color: var(--bad); background: var(--bad-bg); }
.choice.wrong .mark { color: var(--bad); }
.choice:disabled { cursor: default; }

.feedback {
  margin-top: 1.25rem; padding: 1.1rem 1.25rem; border-radius: 12px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border);
}
.feedback .fb-title { font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-bottom: 0.35rem; }
.feedback .verdict { font-weight: 800; font-size: 1.05rem; margin-bottom: 0.5rem; }
.feedback .verdict.good { color: var(--good); }
.feedback .verdict.bad { color: var(--bad); }
.feedback .verdict.neutral { color: var(--primary); }
.feedback p { color: var(--sub); }

.quiz-actions { display: grid; grid-template-columns: auto 1fr auto; gap: 0.75rem; margin-top: 1.5rem; }
.quiz-actions .btn { padding: 0.95rem 1.2rem; }
.kbd-hint { color: var(--muted); font-size: 0.78rem; margin-top: 1rem; text-align: center; }
kbd { border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 0.3rem; font: inherit; font-size: 0.72rem; }

/* 문항표 패널 */
.side-tab {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 6;
  writing-mode: vertical-rl; padding: 1rem 0.55rem; border-radius: 10px 0 0 10px;
  background: var(--sidebar); border: 1px solid var(--border); border-right: none;
  color: var(--sub); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.1em;
}
.side-tab:hover { color: var(--primary); }
.side-panel {
  position: fixed; right: 0; top: 4.7rem; bottom: 0; width: 21rem; z-index: 7;
  background: var(--sidebar); border-left: 1px solid var(--border);
  padding: 1.25rem; overflow-y: auto; box-shadow: -10px 0 30px rgba(0, 0, 0, 0.35);
}
.side-panel .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; font-weight: 800; }
.omr { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem; }
.omr button {
  padding: 0.45rem 0; border-radius: 7px; border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03); color: var(--muted); font-size: 0.8rem; font-weight: 700;
}
.omr button.answered { background: rgba(56, 189, 248, 0.15); color: var(--primary); border-color: transparent; }
.omr button.correct { background: rgba(52, 211, 153, 0.15); color: var(--good); border-color: transparent; }
.omr button.wrong { background: rgba(248, 113, 113, 0.15); color: var(--bad); border-color: transparent; }
.omr button.current { outline: 2px solid var(--primary); outline-offset: 1px; }
.omr-legend { display: flex; gap: 0.8rem; flex-wrap: wrap; color: var(--muted); font-size: 0.75rem; margin: 0.9rem 0; }
.omr-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 0.3rem; vertical-align: -1px; }

/* 결과 */
.score-hero { display: flex; align-items: center; gap: 2.5rem; flex-wrap: wrap; }
.score-big { font-size: 3.2rem; font-weight: 900; line-height: 1; color: var(--primary); }
.score-big small { font-size: 1.2rem; color: var(--muted); font-weight: 700; }
.verdict-big { font-size: 1.6rem; font-weight: 900; }

/* 다시 볼 문제 (폴더) */
.folder-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.7rem 0.9rem; border-radius: 10px; transition: 0.12s;
}
.folder-row:hover { background: rgba(255, 255, 255, 0.03); }
.folder-row .name { flex: 1; font-weight: 700; cursor: pointer; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-row .count { color: var(--muted); font-size: 0.82rem; }
.folder-row .actions { display: flex; gap: 0.1rem; opacity: 0.6; }
.folder-row:hover .actions { opacity: 1; }
.folder-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.folder-items { margin: 0.2rem 0 0.6rem 2.2rem; border-left: 1px solid var(--border); padding-left: 0.8rem; }
.q-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.4rem; font-size: 0.88rem; }
.q-row .text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sub); cursor: pointer; }
.q-row .text:hover { color: var(--text); }
.twisty { width: 1.2rem; color: var(--muted); background: none; border: none; font-size: 0.75rem; }

/* 모달 */
.modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1rem;
  background: rgba(2, 6, 15, 0.7); backdrop-filter: blur(3px);
}
.modal-card {
  width: min(480px, 100%); max-height: 90vh; overflow-y: auto;
  background: #131b2c; border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.modal-card.wide { width: min(760px, 100%); }
.modal-card .q-stem { font-size: 1rem; }
.modal-card .choice { font-size: 0.9rem; padding: 0.7rem 0.9rem; }
.modal-card h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: 0.9rem; }
#dialog-body { color: var(--sub); }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.4rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.9rem; font-size: 0.85rem; color: var(--muted); }
.field input, .field select, select.input, input.input {
  padding: 0.65rem 0.8rem; border-radius: 9px; border: 1px solid var(--border);
  background: rgba(10, 14, 23, 0.8); color: var(--text); font-size: 0.92rem;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); }
.chip-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.4rem 0.25rem 0.7rem; border-radius: 999px; background: rgba(251, 191, 36, 0.1); color: var(--gold); font-size: 0.82rem; font-weight: 700; }
.chip button { background: none; border: none; color: inherit; opacity: 0.7; padding: 0 0.25rem; }
.chip button:hover { opacity: 1; }

/* 라이트박스 */
#lightbox { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: rgba(2, 6, 15, 0.86); }
.lightbox-bar { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 1rem; color: var(--sub); font-weight: 700; font-size: 0.9rem; }
.lightbox-tools { display: flex; gap: 0.25rem; }
.lightbox-tools .ghost-btn { font-size: 1.15rem; min-width: 2.2rem; }
#lightbox-stage { flex: 1; overflow: auto; cursor: grab; display: flex; }
#lightbox-stage.dragging { cursor: grabbing; }
#lightbox-canvas { margin: auto; display: block; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); background: #fff; }

.toast {
  position: fixed; left: 50%; bottom: 2rem; transform: translateX(-50%); z-index: 70;
  background: #1e293b; border: 1px solid var(--border); color: var(--text);
  padding: 0.7rem 1.2rem; border-radius: 10px; font-weight: 600; font-size: 0.9rem;
  white-space: nowrap; max-width: calc(100vw - 2rem); overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* ── 반응형 ── */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  #app { flex-direction: column; height: auto; min-height: 100vh; }
  #sidebar {
    width: 100%; flex-direction: row; align-items: center; padding: 0.6rem 0.75rem; gap: 0.5rem;
    position: sticky; top: 0; z-index: 10; border-right: none; border-bottom: 1px solid var(--border);
  }
  .logo { display: none; }
  .nav-links { display: flex; overflow-x: auto; gap: 0.2rem; }
  .nav-links li { margin: 0; padding: 0.5rem 0.7rem; white-space: nowrap; font-size: 0.88rem; }
  .sidebar-foot { display: none; }
  .content { overflow: visible; }
  .view { padding: 1.5rem 1rem 3rem; }
  h1 { font-size: 1.5rem; margin-bottom: 1.25rem; }
  .row-3, .feature-grid { grid-template-columns: 1fr; }
  .big-card { padding: 1.25rem; }
  .quiz-top { padding: 0.7rem 1rem; grid-template-columns: 1fr auto; }
  .quiz-title-pill { display: none; }
  .quiz-top-right { grid-column: 2; }
  .quiz-body { padding: 1rem 0.75rem 3rem; }
  .quiz-card { padding: 1.25rem; border-radius: 14px; }
  .quiz-actions { grid-template-columns: 1fr 1fr; }
  .quiz-actions .main-action { grid-column: 1 / -1; grid-row: 1; }
  .side-panel { width: 100%; top: 56px; }
  .side-tab {
    writing-mode: horizontal-tb; top: auto; bottom: 1rem; right: 1rem; transform: none;
    padding: 0.65rem 1rem; border-radius: 999px; border-right: 1px solid var(--border);
    letter-spacing: 0; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  }
  .kbd-hint { display: none; }
  .mode-desc { text-align: left; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .stat-card { padding: 1rem; }
  .stat-card .value { font-size: 1.5rem; }
  .toggle-btn { padding: 0.55rem 0.7rem; font-size: 0.82rem; }
}
