/* CE Boards Reviewer — styles (same look & feel as the ME Boards Practice Hub) */
:root {
  --ink: #1a1a1a;
  --sub: #5a5a5a;
  --line: #e2e2e2;
  --accent: #2e74b5;
  --accent-dark: #235a8f;
  --accent-soft: #eef5fb;
  --accent-line: #b8d4ea;
  --disabled-bg: #f2f2f2;
  --disabled-text: #aaaaaa;
  --ok: #1e8e3e;
  --bad: #d93025;
  --credit-h: 48px;
}
* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 80px;
  background: #fff;
  line-height: 1.5;
}
.view { display: none; }
.view.active { display: block; }
h1 { font-size: 24px; margin: 28px 0 6px; }
.subtitle { color: var(--sub); font-size: 14px; margin-bottom: 24px; }
h2 {
  font-size: 15px; color: var(--sub); margin: 32px 0 14px;
  border-bottom: 1px solid var(--line); padding-bottom: 8px; font-weight: normal;
}
h3 { font-size: 14px; margin: 22px 0 10px; }
.welcome-note {
  background: #f7f8fa; border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 16px; font-size: 13.5px; line-height: 1.6; margin-bottom: 28px;
}
.section-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); margin-top: 30px;
}
.subject-title { font-size: 13.5px; font-weight: 700; margin: 18px 0 8px; }

/* ---------- sticky header ---------- */
.made-by-credit {
  position: sticky; top: 0; z-index: 60;
  margin: 0 -24px; padding: 10px 16px;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 22px; font-family: Cambria, Georgia, "Times New Roman", serif; color: #d4af37;
  background: rgba(255,255,255,.96); backdrop-filter: blur(4px);
  border-bottom: 1px solid var(--line);
}
.credit-top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.header-title-slot { flex: 1; min-width: 0; font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: var(--ink); font-weight: 700; }
.header-filter-slot { width: 100%; font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: var(--ink); }
.header-filter-slot:empty { display: none; }
.header-filter-slot .topic-filter-wrap { margin: 0; }
.lax-brand { flex-shrink: 0; white-space: nowrap; }
.lax-a { font-size: .78em; vertical-align: .15em; margin-left: -.36em; margin-right: -.1em; }

/* ---------- home menu ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.menu-item {
  display: block; text-align: center; padding: 14px 10px; border-radius: 6px;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: bold;
  border: none; cursor: pointer; font-family: inherit; text-decoration: none;
}
.menu-item:hover { background: var(--accent-dark); }
.menu-item small { display: block; font-weight: normal; font-size: 11px; opacity: .85; margin-top: 3px; }
.menu-item.lesson { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
.menu-item.lesson:hover { background: var(--accent-soft); }
.menu-item.disabled {
  background: var(--disabled-bg); color: var(--disabled-text); cursor: default; pointer-events: none;
}
.menu-item.pending { filter: blur(1.2px); opacity: .6; }
.link-row { margin-top: 36px; font-size: 13px; color: var(--sub); }
.link-row a { color: var(--accent); cursor: pointer; text-decoration: none; }

.back-link {
  display: inline-block; margin: 14px 0; font-size: 13px; color: var(--accent);
  text-decoration: none; cursor: pointer; background: none; border: none; padding: 0; font-family: inherit;
}

/* ---------- quiz top bar ---------- */
.quiz-topbar {
  position: sticky; top: var(--credit-h); z-index: 20;
  background: rgba(255,255,255,.96); backdrop-filter: blur(4px);
  display: flex; align-items: center; gap: 10px;
  padding: 6px 4px; margin: 0 -4px 12px;
  border-bottom: 1px solid var(--line); font-size: 12px;
}
.quiz-topbar .back-link { margin: 0; font-size: 12px; flex-shrink: 0; }
.timer { flex: 1; text-align: center; font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; }
.pause-btn, .retake-btn {
  position: relative; overflow: hidden; flex-shrink: 0;
  background: none; border: 1px solid var(--line); color: var(--sub);
  font-size: 12px; padding: 4px 9px; border-radius: 5px; cursor: pointer; font-family: inherit;
}
.pause-btn:hover, .retake-btn:hover { background: #f2f2f2; }
.retake-btn .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(217,48,37,.22); }
.retake-btn.holding .fill { width: 100%; transition: width 1s linear; }
.retake-btn span.t { position: relative; }
.pause-overlay {
  display: none; position: fixed; inset: 0; z-index: 200; align-items: center; justify-content: center;
  cursor: pointer; background: rgba(255,255,255,.55); backdrop-filter: blur(6px);
}
.pause-overlay.active { display: flex; }
.pause-message {
  font-size: 22px; font-weight: bold; background: #fff; padding: 20px 32px;
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); text-align: center;
}
.pause-message small { display: block; font-size: 13px; font-weight: normal; color: var(--sub); margin-top: 6px; }

/* ---------- topic filter ---------- */
.topic-filter-wrap {
  position: relative; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #f0f4ff; border: 1px solid #c7d6f7; border-radius: 8px; padding: 10px 14px; margin: 4px 0 14px;
}
.topic-filter-label { font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.topic-filter-btn {
  flex: 1; min-width: 180px; font-size: 13px; padding: 6px 10px; border-radius: 6px;
  border: 1px solid var(--line); background: #fff; color: inherit; font-family: inherit; text-align: left; cursor: pointer;
}
.topic-filter-btn:hover { border-color: var(--accent); }
.topic-filter-panel {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 70; max-height: 340px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,.12); margin-top: 4px; padding: 4px 0;
}
.topic-filter-panel[hidden] { display: none; }
.topic-filter-row { padding: 6px 14px; font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-filter-row:hover { background: #eef2ff; }
.topic-filter-all { font-weight: 700; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.topic-filter-section { font-weight: 700; color: var(--accent); background: #f7f8fa; }
.topic-filter-subsection { font-weight: 600; font-style: italic; padding-left: 28px; }
.topic-filter-item { padding-left: 42px; }
.topic-filter-zero { color: #aaa; }

/* ---------- questions ---------- */
.status-banner {
  background: #f7f8fa; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 14px; font-size: 13px; margin: 4px 0 6px;
}
.status-banner.link { cursor: pointer; background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-dark); }
.question { border-top: 1px solid var(--line); padding: 24px 0; }
.question:last-of-type { border-bottom: 1px solid var(--line); }
.q-text { font-weight: bold; margin-bottom: 10px; font-size: 15px; white-space: pre-line; }
.q-num-tagged { cursor: help; border-bottom: 1px dotted var(--accent); }
.equation { text-align: center; margin: 10px 0; font-size: 15px; }
.question-image { display: flex; justify-content: center; margin: 12px 0; }
.question-image svg, .question-image img { max-width: 100%; height: auto; }
.choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 14px; margin-bottom: 14px; font-size: 15px; }
.choices.cols-2 { grid-template-columns: 1fr 1fr; grid-auto-flow: row; }
.choices.stacked { grid-template-columns: 1fr; }
.choice {
  display: flex; align-items: center; padding: 6px 10px; border-radius: 4px; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s; min-width: 0;
}
.choice:hover { background: #f2f2f2; }
.choice-inner { min-width: 0; overflow-wrap: anywhere; }
.choice.right { background: #e6f4ea; border-color: var(--ok); color: #17692f; font-weight: bold; }
.choice.wrong { background: #fdecea; border-color: var(--bad); color: #a01c14; font-weight: bold; }
.choice.locked { cursor: default; }
.choice.locked:hover:not(.right):not(.wrong) { background: none; }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.1; margin: 0 3px; position: relative; top: 2px; }
.frac .num { border-bottom: 1px solid currentColor; padding: 0 3px 1px; }
.frac .den { padding: 1px 3px 0; }
.latex { display: inline-block; vertical-align: middle; }

/* ---------- hints ---------- */
.hint-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.hint-btn {
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent);
  font-size: 12px; font-weight: 600; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  font-family: inherit; transition: background .15s, color .15s;
}
.hint-btn:hover { background: #dcebf7; }
.hint-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.hint-panel {
  display: none; margin-top: 8px; padding: 12px 16px; background: #f7f8fa;
  border: 1px solid var(--line); border-radius: 8px; font-size: 13px; line-height: 1.6;
  max-width: 100%; overflow-wrap: break-word;
}
.hint-panel.open { display: block; }
.hint-panel.hint-solution { background: var(--accent-soft); border-color: var(--accent-line); }
.hint-panel p { margin: 0 0 8px; }
.hint-panel p:last-child { margin-bottom: 0; }
.formula-block, .hint-formula {
  background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 10px 16px;
  margin: 8px 0; text-align: center; overflow-x: auto;
}
.formula-grid-2, .formula-grid-3, .formula-grid-4 { display: grid; gap: 8px; margin: 8px 0; }
.formula-grid-2 { grid-template-columns: repeat(2, 1fr); }
.formula-grid-3 { grid-template-columns: repeat(3, 1fr); }
.formula-grid-4 { grid-template-columns: repeat(4, 1fr); }
.formula-grid-2 .formula-block, .formula-grid-3 .formula-block, .formula-grid-4 .formula-block {
  margin: 0; display: flex; align-items: center; justify-content: center;
}
.hint-note { font-size: 12px; color: var(--sub); margin: 6px 0; }
.hint-given { font-size: 12.5px; font-style: italic; margin: 0 0 6px; }
.hint-answer {
  margin-top: 10px; padding: 10px 14px; border: 1px solid var(--accent-line); border-radius: 6px;
  background: #eef8f1; font-weight: bold; color: #17692f; text-align: center;
}

/* ---------- handouts / concept cards ---------- */
.concept-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin: 14px 0; background: #fff; }
.concept-card .cc-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; color: var(--accent-dark); }
.concept-card .cc-desc { font-size: 13px; color: var(--sub); margin-bottom: 8px; }
.formula-row {
  display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 8px; align-items: center;
  padding: 6px 0; border-top: 1px dashed var(--line); text-align: center;
}
.formula-row:first-of-type { border-top: none; }
.var-def-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.var-chip { border: 1px solid var(--line); border-radius: 6px; padding: 3px 9px; font-size: 12.5px; white-space: nowrap; background: #f7f8fa; }
.sample-problem { border-top: 1px solid var(--line); padding: 18px 0; }
.sp-title { font-weight: bold; margin-bottom: 8px; }
.sp-choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; margin: 8px 0; }
.sp-choice { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }

/* ---------- lessons (page images) ---------- */
.lesson-note { font-size: 13px; color: var(--sub); margin-bottom: 12px; }
.lesson-page { margin: 0 0 18px; }
.lesson-page img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.lesson-page figcaption { font-size: 11.5px; color: var(--sub); text-align: right; margin-top: 4px; }

/* ---------- misc ---------- */
.result-box { border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: 10px; padding: 18px; margin-top: 20px; text-align: center; }
.result-box .big { font-size: 32px; font-weight: 700; color: var(--accent-dark); }
.nav-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 26px; font-size: 13px; }
.nav-row a { color: var(--accent); cursor: pointer; text-decoration: none; }
.changelog-entry { border-top: 1px solid var(--line); padding: 14px 0; }
.changelog-entry .v { font-weight: 700; }
.changelog-entry .d { color: var(--sub); font-size: 12px; margin-left: 6px; }
.changelog-entry ul { margin: 8px 0 0; padding-left: 20px; font-size: 13.5px; }
.empty-note { border: 1px dashed var(--line); border-radius: 8px; padding: 22px; text-align: center; color: var(--sub); font-size: 13.5px; }

@media (max-width: 640px) {
  body { padding: 0 16px 60px; }
  .made-by-credit { margin: 0 -16px; }
  .choices { grid-template-columns: 1fr 1fr; }
  .choices.stacked { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .formula-grid-3, .formula-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .formula-row { grid-template-columns: 1fr; }
}
@media print {
  .made-by-credit, .quiz-topbar, .back-link, .nav-row { display: none; }
}
