/* AP CSA practice site. Plain CSS, no build step. */

:root {
  --bg: #ffffff;
  --bg-soft: #f4f6fa;
  --text: #1e1e1e;
  --muted: #5f6673;
  --line: #d4d8e0;
  --line-strong: #9aa1ad;
  --accent: #2847c9;
  --accent-soft: #e8edff;
  --correct: #137a3a;
  --correct-soft: #e5f5ea;
  --wrong: #b3261e;
  --wrong-soft: #fbe9e7;
  --flag: #c2410c;
  --code-bg: #f6f8fa;
  --radius: 8px;
  --font: "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  --mono: "Consolas", "SFMono-Regular", "Menlo", "DejaVu Sans Mono", "Noto Sans Mono", monospace;
  --bar-h: 56px;
  --nav-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--accent); }
[hidden] { display: none !important; }
h1 { font-size: 1.6rem; margin: 0.4em 0 0.8em; }
h2 { font-size: 1.15rem; }
.muted { color: var(--muted); margin: 0; font-size: 0.9rem; }

/* --- buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0.4em 1.2em;
  border: 1px solid var(--accent); border-radius: 999px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #1f39a8; }
.btn-secondary { background: #fff; color: var(--accent); }
.btn-secondary:hover:not(:disabled) { background: var(--accent-soft); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-block { width: 100%; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid #f5b400; outline-offset: 2px;
}

/* --- site header (home, setup, result) ----------------------------------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.05rem; }
.user-box { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; color: var(--muted); }
.dev-switch { display: flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px dashed var(--line-strong); border-radius: 6px; }
.dev-switch select { font: inherit; }

.page { max-width: 960px; margin: 0 auto; padding: 16px 16px 48px; }
.breadcrumb { margin: 0; font-size: 0.9rem; color: var(--muted); }

/* --- home ------------------------------------------------------------------ */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card { display: block; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--text); text-decoration: none; }
.card h2 { margin: 0 0 0.4em; }
.card p { margin: 0 0 1em; color: var(--muted); }
.card-link:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(40, 71, 201, 0.12); }
.card-action { font-weight: 600; color: var(--accent); }
.card-disabled { background: var(--bg-soft); }
.card-disabled .card-action { color: var(--muted); }
.recent { margin-top: 32px; }
.recent-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); }

/* --- practice setup -------------------------------------------------------- */
.setup-form fieldset { border: none; padding: 0; margin: 0 0 24px; }
.setup-form legend { font-weight: 700; margin-bottom: 8px; }
.req { font-weight: 400; font-size: 0.85rem; color: var(--muted); margin-left: 6px; }
.option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.option-row { display: flex; flex-wrap: wrap; gap: 10px; }
.option {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; background: var(--bg);
}
.option-inline { align-items: center; padding: 8px 14px; }
.option input { margin-top: 0.3em; width: 18px; height: 18px; accent-color: var(--accent); }
.option-inline input { margin-top: 0; }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option small { color: var(--muted); }
.optional { margin-bottom: 24px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.optional summary { cursor: pointer; font-weight: 600; }
.optional fieldset { margin: 12px 0 8px; }
.hint { color: var(--muted); font-size: 0.9rem; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.error-box { padding: 12px 16px; border: 1px solid var(--wrong); border-radius: var(--radius); background: var(--wrong-soft); color: var(--wrong); }
.notice { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius); background: #fff6db; border: 1px solid #e8c45c; }

/* --- code ----------------------------------------------------------------- */
.code-block {
  display: flex; margin: 12px 0; border: 1px solid var(--line); border-radius: 6px;
  background: var(--code-bg); overflow: hidden;
}
.code-block pre {
  margin: 0; padding: 12px 14px; font-family: var(--mono); font-size: 0.92rem; line-height: 1.55;
  white-space: pre; tab-size: 4;
}
.code-block pre.code { flex: 1; min-width: 0; overflow-x: auto; }
.code-block .hljs { background: transparent; padding: 0; overflow: visible; }
.code-block .gutter {
  flex: none; padding-right: 10px; text-align: right; color: #8a929e; user-select: none;
  border-right: 1px solid var(--line); background: #eef0f4;
}
.inline-code { font-family: var(--mono); }

/* --- question screen ------------------------------------------------------- */
body.exam { padding-bottom: calc(var(--nav-h) + 16px); }
.exam-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: var(--bar-h); padding: 6px 16px; background: var(--bg);
  border-bottom: 2px dashed var(--line-strong);
}
.exam-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.exam-home { font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; }
.exam-section { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang-toggle { display: inline-flex; align-items: center; gap: 0; font-size: 0.85rem; }
.lang-caption { margin-right: 6px; color: var(--muted); }
.lang-toggle button {
  font: inherit; padding: 4px 10px; border: 1px solid var(--line-strong); background: #fff; cursor: pointer; color: var(--text);
}
.lang-toggle button:first-of-type { border-radius: 999px 0 0 999px; }
.lang-toggle button:last-of-type { border-radius: 0 999px 999px 0; border-left: none; }
.lang-toggle button[aria-pressed="true"] { background: var(--text); color: #fff; border-color: var(--text); }

.exam-main { padding: 16px; }
.q-layout { max-width: 820px; margin: 0 auto; }
.q-layout.two-pane {
  max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0;
}
.q-layout.two-pane .pane {
  max-height: calc(100vh - var(--bar-h) - var(--nav-h) - 48px); overflow-y: auto; padding: 4px 24px 24px;
}
.q-layout.two-pane .pane-passage { border-right: 4px solid var(--line); padding-left: 8px; }
.question-text, .stimulus-intro, .explain-text { white-space: pre-line; overflow-wrap: anywhere; }
.stem { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; }
.stem-code {
  font-family: var(--mono); font-size: 0.92em; padding: 0 3px; border-radius: 3px; background: var(--bg-soft);
}
.question-text { margin: 12px 0; font-weight: 500; }
.stimulus { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.table-wrap { overflow-x: auto; margin: 12px 0; }
.data-table { border-collapse: collapse; font-size: 0.92rem; }
.data-table th, .data-table td { border: 1px solid var(--line-strong); padding: 4px 10px; text-align: left; }
.data-table th { background: var(--bg-soft); }

.q-head {
  display: flex; align-items: center; gap: 12px; padding: 6px 0; margin-bottom: 4px;
  border-bottom: 2px solid var(--text); background: var(--bg-soft); padding: 4px 8px 4px 0;
}
.q-number {
  display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px;
  background: var(--text); color: #fff; font-weight: 700;
}
.btn-flag, .btn-strike-mode {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid transparent; border-radius: 6px;
  background: none; font: inherit; font-size: 0.9rem; cursor: pointer; color: var(--text);
}
.btn-strike-mode { margin-left: auto; border-color: var(--line-strong); }
.btn-flag:hover, .btn-strike-mode:hover { background: #fff; }
.flag-icon {
  width: 14px; height: 18px; border: 2px solid var(--text);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
  background: transparent;
}
.btn-flag[aria-pressed="true"] { color: var(--flag); font-weight: 700; }
.btn-flag[aria-pressed="true"] .flag-icon { background: var(--flag); border-color: var(--flag); }
.strike-icon { font-weight: 700; font-size: 0.8rem; text-decoration: line-through; }
.btn-strike-mode[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }

.statements { list-style: none; padding: 0; margin: 8px 0 12px; }
.statements li { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0; }
.statement-label { font-weight: 700; min-width: 2.2em; padding-top: 2px; }
.statements .code-block { margin: 0; flex: 1; min-width: 0; }

/* choices */
.choices { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.choice { display: flex; align-items: stretch; gap: 8px; }
.choice-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff;
  font: inherit; color: inherit; text-align: left; cursor: pointer; position: relative;
}
.choice-main:hover:not(:disabled) { border-color: var(--accent); }
.choice-main:disabled { cursor: default; color: inherit; }
.choice-letter {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border: 2px solid var(--text); border-radius: 50%; font-weight: 700; font-size: 0.95rem;
}
.choice-text { overflow-wrap: anywhere; }
.choice-main .code-block { margin: 0; flex: 1; min-width: 0; background: transparent; border: none; }
.choice-main .code-block pre { padding: 2px 0; }
.choice.selected .choice-main { border: 2px solid var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; padding: 9px 13px; }
.choice.selected .choice-letter { background: var(--accent); border-color: var(--accent); color: #fff; }
.choice.eliminated .choice-main { color: #8a8f99; }
.choice.eliminated .choice-main::after {
  content: ""; position: absolute; left: 8px; right: 8px; top: 50%; border-top: 2px solid #3b3f46;
}
.choice.eliminated .choice-letter { border-color: #8a8f99; }
.choice-strike {
  flex: none; display: none; width: 72px; border: none; background: none; cursor: pointer; font: inherit; font-size: 0.85rem; color: var(--text);
}
.choices.strike-mode .choice-strike, .choice.eliminated .choice-strike { display: inline-flex; align-items: center; justify-content: center; }
.strike-letter {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border: 1.5px solid var(--text); border-radius: 50%; font-weight: 700; position: relative;
}
.strike-letter::after { content: ""; position: absolute; left: -5px; right: -5px; top: 50%; border-top: 2px solid var(--text); }
.undo { text-decoration: underline; font-weight: 600; }
.choice.is-answer .choice-main { border: 2px solid var(--correct); background: var(--correct-soft); padding: 9px 13px; box-shadow: none; }
.choice.is-answer .choice-letter { background: var(--correct); border-color: var(--correct); color: #fff; }
.choice.is-wrong .choice-main { border: 2px solid var(--wrong); background: var(--wrong-soft); padding: 9px 13px; box-shadow: none; }
.choice.is-wrong .choice-letter { background: var(--wrong); border-color: var(--wrong); color: #fff; }

.answer-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 16px; }
.answer-hint { font-size: 0.85rem; color: var(--muted); }

/* feedback / review */
.review { margin-top: 8px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-soft); }
.review.is-correct { border-left: 6px solid var(--correct); }
.review.is-wrong { border-left: 6px solid var(--wrong); }
.verdict { display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px; font-size: 1.2rem; font-weight: 700; }
.verdict-correct { color: var(--correct); }
.verdict-wrong { color: var(--wrong); }
.verdict-sub { font-size: 1rem; color: var(--text); font-weight: 600; }
.explain h4 { margin: 12px 0 4px; font-size: 0.95rem; }
.explain-text { margin: 0; }
.misconception { margin: 6px 0 0; font-size: 0.9rem; }
.misconception-caption {
  display: inline-block; margin-right: 8px; padding: 0 8px; border-radius: 999px; background: #fff; border: 1px solid var(--line-strong); font-size: 0.8rem;
}
.statement-review { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.statement-review li { display: flex; gap: 6px; }
.statement-review .holds .holds-mark { color: var(--correct); font-weight: 600; }
.statement-review .fails .holds-mark { color: var(--wrong); font-weight: 600; }
.other-choices { margin-top: 12px; }
.other-choices summary { cursor: pointer; font-weight: 600; font-size: 0.95rem; }
.other-choice h5 { margin: 10px 0 2px; font-size: 0.9rem; }

/* bottom navigation */
.exam-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  min-height: var(--nav-h); padding: 8px 16px; background: #fff; border-top: 2px dashed var(--line-strong);
}
.nav-left { font-size: 0.9rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-center { position: relative; justify-self: center; }
.nav-right { justify-self: end; display: flex; gap: 8px; }
.btn-navigator {
  padding: 8px 16px; border: none; border-radius: 6px; background: var(--text); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.navigator {
  position: absolute; bottom: calc(100% + 14px); left: 50%; transform: translateX(-50%);
  width: min(440px, calc(100vw - 32px)); padding: 16px; background: #fff;
  border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}
.navigator-head { display: flex; justify-content: space-between; align-items: center; }
.navigator-close { border: none; background: none; font-size: 1.4rem; cursor: pointer; line-height: 1; }
.navigator-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; padding: 8px 0; margin: 0 0 8px; border-bottom: 1px solid var(--line); font-size: 0.8rem; }
.navigator-legend li { display: flex; align-items: center; gap: 4px; }
.legend-box { width: 14px; height: 14px; border: 1.5px dashed var(--line-strong); display: inline-block; }
.legend-box.answered { background: var(--accent); border: 1.5px solid var(--accent); }
.legend-box.current { border: 2px solid var(--text); }
.legend-flag { width: 10px; height: 13px; background: var(--flag); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%); display: inline-block; }
.navigator-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 10px; margin-bottom: 14px; }
.nav-cell {
  position: relative; height: 40px; border: 1.5px dashed var(--line-strong); background: #fff; color: var(--accent);
  font: inherit; font-weight: 700; cursor: pointer;
}
.nav-cell.answered { background: var(--accent); color: #fff; border: 1.5px solid var(--accent); }
.nav-cell.current { outline: 2px solid var(--text); outline-offset: 2px; }
.nav-cell.flagged::after {
  content: ""; position: absolute; top: -6px; right: -4px; width: 10px; height: 13px; background: var(--flag);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
}

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px); transform: translateX(-50%) translateY(20px);
  max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: var(--radius); background: #2b2b2b; color: #fff;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 40;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- result ---------------------------------------------------------------- */
.score-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); margin: 12px 0 24px; }
.score-card h1 { margin: 0 0 8px; font-size: 1.3rem; }
.score { margin: 0; font-size: 1.3rem; }
.score strong { font-size: 2.4rem; }
.score-percent { margin-left: 6px; color: var(--muted); }
.score-meta { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.breakdowns { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.breakdown h2 { margin: 0 0 8px; }
.bars { list-style: none; padding: 0; margin: 0; }
.bar-row { display: grid; grid-template-columns: minmax(0, 13em) minmax(60px, 1fr) auto; align-items: center; gap: 10px; padding: 6px 0; font-size: 0.92rem; }
.bar-label { overflow-wrap: anywhere; line-height: 1.3; }
.bar-track { height: 10px; border-radius: 999px; background: #e3e6ec; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); }
.bar-value { white-space: nowrap; color: var(--muted); }
.review-list { margin-top: 32px; }
.review-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 12px; }
.review-toolbar h2 { margin: 0; margin-right: auto; }
.only-wrong { font-size: 0.9rem; display: flex; align-items: center; gap: 6px; }
.review-item { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; background: #fff; }
.review-item > summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 16px; cursor: pointer; list-style-position: inside;
}
.mark { font-weight: 700; font-size: 1.1rem; }
.mark-correct { color: var(--correct); }
.mark-wrong { color: var(--wrong); }
.review-title { font-weight: 700; }
.review-tags { color: var(--muted); font-size: 0.9rem; }
.review-answers { margin-left: auto; font-size: 0.9rem; }
.review-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; padding: 4px 16px 16px; border-top: 1px solid var(--line); }

/* --- teacher screens ------------------------------------------------------------ */
.teacher-link { font-weight: 600; }
.page-wide { max-width: 1280px; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; margin: 12px 0; }
.filters label { display: flex; flex-direction: column; gap: 2px; font-size: 0.85rem; color: var(--muted); }
.filters select { font: inherit; font-size: 0.95rem; max-width: 22em; padding: 4px 6px; color: var(--text); }
.list-count { margin: 8px 0; font-weight: 600; }
.question-table td { vertical-align: top; }
.question-table .stem-cell { min-width: 16em; color: var(--muted); }
.status-badge {
  display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
  border: 1px solid var(--line-strong); background: var(--bg-soft); color: var(--text); vertical-align: middle;
}
.status-verified { border-color: #6b8cff; background: var(--accent-soft); }
.status-reviewed { border-color: #c79a1c; background: #fff6db; }
.status-published { border-color: var(--correct); background: var(--correct-soft); color: var(--correct); }
.status-retired { color: var(--muted); text-decoration: line-through; }
.verify-cell { display: inline-flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.verify-result { font-weight: 700; }
.verify-pass { color: var(--correct); }
.verify-fail { color: var(--wrong); }
.verify-manual, .verify-none { color: var(--muted); }
.verify-date { font-size: 0.85rem; color: var(--muted); }
.verify-stale { font-size: 0.8rem; color: var(--flag); font-weight: 600; }
.verify-result.verify-stale { font-size: inherit; font-weight: 700; }
.publish-panel { margin-top: 28px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); }
.publish-panel h2 { margin-top: 0; }
.publish-panel h3 { font-size: 0.95rem; margin: 16px 0 4px; }
.publish-form { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; }
.publish-form .option-row { align-items: center; }
.field { display: flex; flex-direction: column; gap: 2px; }
.field input { font: inherit; padding: 4px 8px; min-width: 16em; }
.field-label { font-size: 0.85rem; color: var(--muted); }
.selected-ids { overflow-wrap: anywhere; }
.command { display: flex; align-items: flex-start; gap: 8px; }
.command-text {
  flex: 1; min-width: 0; margin: 0; padding: 10px 12px; overflow-x: auto; white-space: pre;
  font-family: var(--mono); font-size: 0.88rem; background: #fff; border: 1px solid var(--line); border-radius: 6px;
}
.btn-small { min-height: 32px; padding: 0.2em 0.9em; font-size: 0.85rem; }
.warning-box { margin: 8px 0; padding: 8px 14px; border: 1px solid #e8c45c; border-radius: var(--radius); background: #fff6db; }
.warning-box p, .warning-box ul { margin: 4px 0; }
.preview-head h1 { margin-bottom: 4px; }
.version-switch { font-size: 0.9rem; margin-bottom: 8px; }
.meta-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 16px; margin: 8px 0 16px; font-size: 0.92rem; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; overflow-wrap: anywhere; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.student-frame { padding: 12px; border: 2px dashed var(--line-strong); border-radius: var(--radius); }
.review-checklist, .answer-section { margin-top: 24px; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.checklist label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.checklist input { width: 18px; height: 18px; accent-color: var(--accent); }
.checklist .hint { margin: 2px 0 0 26px; }
.answer-section summary { cursor: pointer; }
.answer-section summary h2 { display: inline; margin: 0 8px 0 0; }
.answer-choice { margin: 12px 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.answer-choice.is-answer { border: 2px solid var(--correct); }
.answer-choice h3 { margin: 0 0 4px; font-size: 1rem; }
.answer-mark { color: var(--correct); }
.bilingual { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 6px; }
.lang-tag { display: inline-block; font-size: 0.75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.verify-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 8px 0; }
.verify-dl dt { font-family: var(--mono); color: var(--muted); padding-top: 2px; }
.verify-dl dd { margin: 0; min-width: 0; }
.verify-dl .code-block { margin: 0; }
.verify-list { margin: 0; padding-left: 1.4em; }
.json { margin: 4px 0; padding: 8px 10px; font-family: var(--mono); font-size: 0.85rem; background: var(--code-bg); border-radius: 6px; overflow-x: auto; }
.record-list { list-style: none; padding: 0; }
.record-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.record-list p { margin: 4px 0; }
.ai-issues { list-style: none; padding: 0; margin: 6px 0; }
.ai-issues .ai-issue { padding: 6px 10px; margin: 6px 0; border-left: 4px solid var(--line); border-bottom: none; }
.ai-issues .ai-error { border-left-color: var(--wrong); }
.ai-issues .ai-warning { border-left-color: var(--flag); }

/* --- narrow screens ------------------------------------------------------------- */
@media (max-width: 900px) {
  .q-layout.two-pane { display: block; }
  .q-layout.two-pane .pane { max-height: none; overflow: visible; padding: 0; }
  .q-layout.two-pane .pane-passage { border-right: none; border-bottom: 4px solid var(--line); padding: 0 0 12px; margin-bottom: 12px; }
  .review-body { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .bilingual, .verify-dl { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  body { font-size: 15px; }
  .exam-main { padding: 12px 16px; }
  .exam-section, .lang-caption { display: none; }
  .exam-nav { grid-template-columns: auto 1fr; padding: 8px 12px; }
  .nav-left { display: none; }
  .nav-center { justify-self: start; position: static; }
  .navigator { position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 8px); width: auto; transform: none; }
  .btn-navigator { padding: 8px 10px; }
  .nav-right .btn { padding: 0.4em 0.9em; }
  .choice-strike { width: 48px; }
  .btn-strike-mode span:last-child { display: none; }
  .code-block pre { font-size: 0.85rem; }
  .review-answers { margin-left: 0; width: 100%; }
}

/* --- login and accounts ------------------------------------------------------ */
.page-narrow { max-width: 480px; }
.stack-form { display: flex; flex-direction: column; gap: 14px; margin: 16px 0; }
.stack-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.stack-form input { font: inherit; font-size: 1rem; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 6px; }
.notice-box { padding: 12px 16px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft); color: var(--text); }
.logout-form { margin: 0; }
.account-link { color: var(--muted); }
.dev-login { margin-top: 32px; padding: 12px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.dev-login h2 { font-size: 1rem; margin: 0 0 8px; }
.account-create { margin: 16px 0 24px; }
.filters input { font: inherit; font-size: 0.95rem; padding: 4px 6px; color: var(--text); }
.inline-fields { display: flex; gap: 6px; align-items: center; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.state-inactive { color: var(--wrong); font-weight: 600; }
.state-temporary { color: var(--muted); }
