:root {
  --bg: #17140f;
  --bg-panel: #211c15;
  --bg-panel-raised: #2a2318;
  --line: #423a2c;
  --cream: #f4efe4;
  --muted: #b7ac97;
  --orange: #ff6a13;
  --orange-deep: #c1470b;
  --teal: #3db3ac;
  --teal-deep: #1f7a74;
  --yellow: #ffc93c;
  --green: #5fae7d;
  --red: #dd5b52;
  --font-display: "Archivo Black", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

/* Author CSS that sets `display` on an element otherwise silently defeats
   the `hidden` attribute (author styles always beat the UA stylesheet
   regardless of specificity). This keeps `hidden` authoritative everywhere. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  line-height: 1.5;
}

/* Full-bleed backdrop so wide viewports don't read as empty void either
   side of the content column - a very faint grid plus two soft glows. */
body {
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(255,106,19,0.10), transparent 60%),
    radial-gradient(ellipse 900px 500px at 90% 10%, rgba(61,179,172,0.08), transparent 60%),
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: auto, auto, 42px 42px, 42px 42px;
  background-attachment: fixed;
}

.app { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }

.top-accent-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--orange), var(--teal));
}

.muted { color: var(--muted); }

code {
  font-family: var(--font-mono);
  background: var(--bg-panel-raised);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--yellow);
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.brand { display: flex; align-items: center; gap: 16px; }

.plate {
  width: 56px;
  height: 56px;
  flex: none;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.4));
}
.plate-svg { width: 100%; height: 100%; }
.plate-small .plate-svg { width: 100%; height: 100%; }

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0 0 6px;
  letter-spacing: 0.01em;
}

.stat-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.stat-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.stat-pill strong { color: var(--teal); font-weight: 700; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 6px;
  cursor: pointer;
}
.tab:hover { border-color: var(--teal); color: var(--cream); }
.tab.active { background: var(--orange); border-color: var(--orange); color: #17140f; font-weight: 600; }

/* ---------- Layout bits ---------- */
.lede { color: var(--muted); max-width: 62ch; margin: 0 0 20px; }

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.28);
}

/* ---------- Category groups (Tests view) ---------- */
.groups { display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 820px) {
  .groups { display: block; column-count: 2; column-gap: 18px; }
  .groups .group-card { break-inside: avoid; margin-bottom: 18px; }
}
@media (min-width: 1300px) {
  .groups { column-count: 3; }
}
.group-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.24);
}
.group-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.group-badge {
  width: 34px; height: 34px;
  background: var(--orange-deep);
  transform: rotate(45deg);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.group-badge.tone-teal { background: var(--teal-deep); }
.group-badge svg { transform: rotate(-45deg); width: 17px; height: 17px; color: var(--cream); }
.group-head h3 { margin: 0; font-size: 1rem; }
.group-head .muted { font-size: 0.8rem; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  color: var(--cream);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.chip:hover { border-color: var(--teal); }
.chip .count { color: var(--muted); }

/* ---------- Category practice cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.category-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  cursor: pointer;
  text-align: left;
  color: var(--cream);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.24);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.category-card:hover { border-color: var(--orange); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,0.32); }
.category-card .diamond {
  width: 30px; height: 30px;
  background: var(--orange-deep);
  transform: rotate(45deg);
  display: flex; align-items: center; justify-content: center;
}
.category-card .diamond.tone-teal { background: var(--teal-deep); }
.category-card .diamond svg { transform: rotate(-45deg); width: 15px; height: 15px; color: var(--cream); }
.category-card h4 { margin: 0; font-size: 0.95rem; }
.category-card p { margin: 0; font-size: 0.78rem; color: var(--muted); }

/* ---------- Questions list ---------- */
.questions-panel { padding: 18px; }
.question-list-controls {
  display: grid;
  grid-template-columns: minmax(210px, 0.35fr) minmax(260px, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}
.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.filter-field span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.filter-field select {
  width: 100%;
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  color: var(--cream);
  border-radius: 7px;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 0.9rem;
}
.filter-field select:focus,
.search-input:focus {
  outline: 2px solid rgba(61,179,172,0.45);
  outline-offset: 1px;
  border-color: var(--teal);
}
.search-field .search-input { margin-bottom: 0; }
.questions-list-meta {
  font-size: 0.78rem;
  margin-bottom: 12px;
}
.questions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.question-list-card {
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 15px 16px;
}
.question-list-card-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 8px;
}
.question-list-card-head span:nth-child(2) {
  min-width: 0;
  overflow-wrap: anywhere;
}
.question-list-icon {
  width: 16px;
  height: 16px;
  color: var(--orange);
  flex: none;
}
.question-list-icon svg { width: 100%; height: 100%; }
.question-list-index {
  margin-left: auto;
  color: var(--teal);
}
.question-list-card h3 {
  font-size: 1rem;
  line-height: 1.4;
  margin: 0 0 12px;
  color: var(--cream);
}
.question-list-options {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.question-list-options li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  color: var(--muted);
}
.question-list-options li.correct {
  border-color: rgba(95,174,125,0.75);
  background: #1e3327;
  color: var(--cream);
}
.question-list-options li.correct .option-letter { color: var(--green); }
.empty-state { margin: 8px 0 0; }

/* ---------- Exam blueprint ---------- */
.exam-type-toggle { display: flex; gap: 8px; margin-bottom: 12px; }
.exam-type-btn {
  font-family: var(--font-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em;
  background: var(--bg-panel-raised); border: 1px solid var(--line); color: var(--muted);
  padding: 9px 16px; border-radius: 6px; cursor: pointer;
}
.exam-type-btn:hover { border-color: var(--teal); color: var(--cream); }
.exam-type-btn.active { background: var(--orange); border-color: var(--orange); color: #17140f; font-weight: 600; }
.exam-type-note { font-size: 0.8rem; color: var(--muted); margin: 0 0 18px; max-width: 60ch; }

.exam-controls { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.exam-controls label { font-size: 0.82rem; color: var(--muted); display: block; margin-bottom: 6px; }
.exam-controls input {
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  color: var(--cream);
  border-radius: 6px;
  padding: 9px 12px;
  width: 110px;
  font-family: var(--font-mono);
}
.field-with-hint { display: flex; flex-direction: column; }
.total-questions-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.default-source-select { display: inline-flex; align-items: center; gap: 6px; }
.default-source-label { font-size: 0.72rem; color: var(--muted); }
.default-source-select select {
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 6px;
  padding: 6px 8px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  cursor: pointer;
}
.default-source-select select:hover { color: var(--cream); border-color: var(--teal); }
.blueprint-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.blueprint-table th, .blueprint-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.blueprint-table th { color: var(--muted); font-weight: 500; font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; }
.blueprint-table td.warn { color: var(--red); }

/* ---------- Instructions directory ---------- */
.search-input {
  width: 100%;
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  color: var(--cream);
  border-radius: 7px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.instructions-meta { font-size: 0.78rem; margin-bottom: 10px; }
.legend { display: flex; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.legend-item { font-size: 0.76rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.instructions-list { display: flex; flex-direction: column; gap: 8px; }
.instruction-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  flex-wrap: wrap;
}
.instruction-row .lang-info { min-width: 0; }
.instruction-row .lang-name { font-weight: 600; }
.instruction-row .lang-flag { margin-right: 8px; font-size: 1.05em; }
.instruction-row .lang-note { font-size: 0.76rem; color: var(--muted); }
.instruction-row .lang-note a { color: var(--yellow); }
.instruction-row .hosted-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--teal);
  margin-left: 8px;
}
.instruction-row .hosted-tag.external { color: var(--yellow); }
.instruction-row .btn { flex: none; }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: 7px;
  padding: 11px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.9rem;
}
.btn-primary { background: var(--orange); color: #17140f; box-shadow: 0 4px 12px rgba(255,106,19,0.28); }
.btn-primary:hover { background: #ff7c30; box-shadow: 0 6px 16px rgba(255,106,19,0.36); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-outline { background: transparent; border-color: var(--orange-deep); color: var(--cream); }
.btn-outline:hover { background: rgba(193,71,11,0.16); border-color: var(--orange); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-ghost:hover { border-color: var(--teal); color: var(--cream); }

/* ---------- Quiz session (one question at a time, IMT-style) ---------- */
.quiz-banner {
  background: var(--orange-deep);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255,255,255,0.05) 0 14px,
    rgba(255,255,255,0) 14px 28px
  );
  color: var(--cream);
  border-radius: 10px 10px 0 0;
  padding: 16px 20px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.32);
  border-bottom: 2px solid var(--orange);
}
.quiz-banner-title { font-family: var(--font-display); font-size: 1rem; letter-spacing: 0.01em; }
.btn-on-banner { border-color: rgba(244,239,228,0.35); color: var(--cream); }
.btn-on-banner:hover { border-color: var(--cream); color: var(--cream); }

.quiz-body { border-radius: 0 0 10px 10px; }

.quiz-topline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.q-number { font-family: var(--font-display); font-size: 2.4rem; color: var(--orange-deep); line-height: 1; }
.q-progress-pill {
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted);
  background: var(--bg-panel-raised); border: 1px solid var(--line);
  border-radius: 20px; padding: 6px 14px;
}

.meta-line {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.meta-icon { width: 14px; height: 14px; display: inline-flex; color: var(--orange-deep); flex: none; }
.meta-icon svg { width: 100%; height: 100%; }
.question-text { font-size: 1.1rem; margin: 0 0 18px; line-height: 1.4; }

.options { display: flex; flex-direction: column; gap: 10px; }
.option-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--bg-panel-raised); border: 1px solid var(--line); border-radius: 8px;
  padding: 13px 16px; cursor: pointer; color: var(--cream); font-size: 0.95rem;
}
.option-row:hover { border-color: var(--orange); }
.option-letter { font-family: var(--font-mono); font-weight: 700; color: var(--orange-deep); flex: none; width: 1.2em; }
.option-text { flex: 1; }
.option-indicator {
  width: 20px; height: 20px; border-radius: 5px; border: 1px solid var(--line);
  flex: none; display: flex; align-items: center; justify-content: center;
}
.option-row.selected { border-color: var(--orange); }
.option-row.selected .option-indicator { background: var(--orange); border-color: var(--orange); }
.option-row.selected .option-indicator::after { content: ""; width: 8px; height: 8px; background: #17140f; border-radius: 2px; }

.quiz-nav { display: flex; align-items: center; gap: 10px; margin: 18px 0; }
.nav-arrow {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: none;
  background: var(--green); color: #0c1f14; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.nav-arrow:hover { filter: brightness(1.1); }
.nav-arrow:disabled { opacity: 0.3; cursor: default; }
.nav-strip-wrap {
  flex: 1; overflow-x: auto; -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, transparent 0, black 16px, black calc(100% - 16px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 16px, black calc(100% - 16px), transparent 100%);
  scrollbar-width: none; /* Firefox */
}
.nav-strip-wrap::-webkit-scrollbar { display: none; /* Chrome/Safari/overlay scrollbars */ }
.nav-strip { display: flex; gap: 5px; width: max-content; padding: 0 4px; }
.nav-strip button {
  flex: none; width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg-panel-raised); color: var(--muted); font-family: var(--font-mono);
  font-size: 0.76rem; cursor: pointer;
}
.nav-strip button.answered { color: var(--cream); border-color: var(--orange-deep); }
.nav-strip button.current { background: var(--orange); color: #17140f; border-color: var(--orange); font-weight: 700; }

.quiz-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Review (single compiled page, shown after Terminar) ---------- */
.summary-panel { margin-bottom: 20px; }
.summary-panel.passed { border-color: var(--green); }
.summary-panel.failed { border-color: var(--red); }
.quiz-questions { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.quiz-question {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.22);
}
.qq-toggle {
  display: flex;
  width: 100%; align-items: center; gap: 10px;
  background: none; border: none; color: var(--cream); cursor: pointer;
  padding: 0; font-family: var(--font-body); font-size: 0.92rem; text-align: left;
}
.qq-status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.status-correct .qq-status-dot, .jump-dot.status-correct { background: var(--green); }
.status-wrong .qq-status-dot, .jump-dot.status-wrong { background: var(--red); }
.status-unanswered .qq-status-dot, .jump-dot.status-unanswered { background: var(--muted); }
.qq-toggle-label { flex: 1; }
.qq-caret { color: var(--muted); transition: transform 0.15s ease; }
.quiz-question.collapsed .qq-caret { transform: rotate(-90deg); }
.quiz-question.collapsed .qq-body { display: none; }
.quiz-question.collapsed { padding: 14px 20px; }
.qq-body { margin-top: 14px; }

.option {
  text-align: left;
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  color: var(--cream);
  padding: 13px 16px;
  border-radius: 8px;
  cursor: default;
  font-size: 0.95rem;
  display: flex; align-items: center; gap: 12px;
}
.option .option-letter { font-family: var(--font-mono); font-weight: 700; color: var(--muted); flex: none; width: 1.2em; }
.option.correct { border-color: var(--green); background: #1e3327; }
.option.correct .option-letter { color: var(--green); }
.option.wrong { border-color: var(--red); background: #3a2220; }
.option.wrong .option-letter { color: var(--red); }

.feedback { padding: 10px 14px; border-radius: 8px; font-size: 0.85rem; margin-top: 12px; }
.feedback.ok { background: #1e3327; color: var(--green); }
.feedback.bad { background: #3a2220; color: #f2a49d; }

.quiz-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.quiz-head h2 { margin: 0; font-size: 1.1rem; font-family: var(--font-display); }

.score-line { font-family: var(--font-display); font-size: 1.6rem; margin: 0 0 4px; color: var(--cream); }
.score-line.passed { color: var(--green); }
.score-line.failed { color: var(--red); }
.pass-label { font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; margin: 0 0 12px; }
.pass-label.passed { color: var(--green); }
.pass-label.failed { color: var(--red); }

.breakdown { display: flex; flex-wrap: wrap; gap: 8px; }
.breakdown .pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 12px;
}

.review-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.review-jump-strip { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; min-width: 120px; }
.jump-dot { width: 14px; height: 14px; border-radius: 50%; border: none; cursor: pointer; padding: 0; }
.jump-dot:hover { outline: 2px solid var(--cream); outline-offset: 1px; }

.footnote {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.footnote-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 0.85rem; color: var(--muted);
  margin-bottom: 8px;
}
.plate-small { width: 26px; height: 26px; }
.footnote p { margin: 0; font-size: 0.75rem; color: var(--muted); max-width: 62ch; }

/* ---------- Quick reference tab ---------- */
.reference-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ref-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.22);
}
.ref-card.collapsed { padding: 14px 20px; }
.ref-card-toggle {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px;
  background: none; border: none; padding: 0; cursor: pointer; text-align: left;
}
.ref-card-body { margin-top: 14px; max-width: 640px; }
.ref-card.collapsed .ref-card-body { display: none; }
.ref-caret { color: var(--muted); transition: transform 0.15s ease; flex: none; }
.ref-card.collapsed .ref-caret { transform: rotate(-90deg); }
.ref-card h3 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  margin: 0;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.ref-source { font-family: var(--font-mono); font-size: 0.65rem; color: var(--teal); font-weight: 400; white-space: nowrap; }
.ref-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.ref-table td { padding: 7px 0; border-bottom: 1px solid var(--line); color: var(--cream); }
.ref-table td:last-child { text-align: right; color: var(--muted); white-space: nowrap; }
.ref-table-cols th { text-align: right; padding: 4px 0 8px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); }
.ref-table-cols th:first-child, .ref-table-cols td:first-child { text-align: left; color: var(--cream); }
.ref-table-cols td { text-align: right; }
.ref-table-prazos { table-layout: fixed; }
.ref-table-prazos th:nth-child(1), .ref-table-prazos td:nth-child(1) { width: 38%; }
.ref-table-prazos th:nth-child(2), .ref-table-prazos td:nth-child(2) { width: 26%; white-space: normal; }
.ref-table-prazos th:nth-child(3), .ref-table-prazos td:nth-child(3) { width: 36%; white-space: normal; }
.tunnel-table td:first-child {
  font-family: var(--font-mono); font-weight: 700; width: 1.6em; text-align: center;
  border-radius: 4px; color: #17140f;
}
.tunnel-a td:first-child { background: var(--green); }
.tunnel-b td:first-child { background: var(--yellow); }
.tunnel-c td:first-child { background: #e6a23c; }
.tunnel-d td:first-child { background: var(--orange); color: var(--cream); }
.tunnel-e td:first-child { background: var(--red); color: var(--cream); }
.tunnel-table td:last-child { text-align: left; color: var(--cream); white-space: normal; }
.ref-list { margin: 0 0 4px; padding-left: 20px; font-size: 0.88rem; color: var(--cream); }
.ref-list li { margin-bottom: 7px; }
.ref-group-label {
  font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--green); margin: 0 0 8px; padding-top: 4px;
}
.ref-group-label.ref-group-conditional { color: var(--yellow); margin-top: 16px; }
.ref-list-conditional li::marker { color: var(--yellow); }
.ref-when { display: block; font-size: 0.75rem; color: var(--muted); }
.ref-footnote { font-size: 0.72rem; color: var(--muted); margin: 10px 0 0; }

@media (max-width: 560px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .question-list-controls { grid-template-columns: 1fr; }
  .quiz-actions { justify-content: stretch; }
  .quiz-actions .btn { flex: 1; }
}

.ref-card h3 {
  color: var(--cream);
}

.pontos-table th { text-align: left; }
.pontos-table td:last-child { text-align: left; }
