/* ==========================================================
   Primary 4 English · Term 1 — quiz styling
   ========================================================== */

:root {
  --bg: #f6f1e7;
  --bg-glow-1: rgba(14, 124, 107, .10);
  --bg-glow-2: rgba(217, 85, 63, .09);
  --card: #fffdf8;
  --card-soft: #fbf7ee;
  --ink: #17242b;
  --ink-soft: #33474f;
  --muted: #6b7a80;
  --line: #e6ddcc;
  --line-strong: #d7cbb5;
  --teal: #0e7c6b;
  --teal-deep: #0a5f52;
  --teal-soft: #e0f2ed;
  --coral: #d9553f;
  --coral-soft: #fbe9e4;
  --amber: #a86b06;
  --amber-soft: #fbf0d9;
  --green: #217a4c;
  --green-soft: #e2f3e8;
  --red: #b23a2c;
  --red-soft: #fae6e1;
  --blue: #2d648c;
  --blue-soft: #e6f0f7;
  --shadow-sm: 0 1px 2px rgba(23, 36, 43, .06), 0 4px 14px rgba(23, 36, 43, .05);
  --shadow-md: 0 2px 6px rgba(23, 36, 43, .06), 0 18px 40px -18px rgba(23, 36, 43, .28);
  --radius: 18px;
  --radius-sm: 12px;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: "Segoe UI", "Segoe UI Variable Text", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  background:
    radial-gradient(50% 38% at 6% -4%, var(--bg-glow-1), transparent 70%),
    radial-gradient(42% 32% at 100% 2%, var(--bg-glow-2), transparent 70%),
    linear-gradient(180deg, #f8f4eb 0%, var(--bg) 48%, #f3ecdf 100%);
  background-attachment: fixed;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.015em;
  margin: 0;
}

p { margin: 0; }

button, input, textarea, select { font: inherit; color: inherit; }

button { cursor: pointer; }

a { color: var(--teal-deep); }

::selection { background: #cdebe3; }

.shell {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 10px 16px;
  border-radius: 0 0 10px 10px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 0; }

/* ---------------- Header ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248, 244, 235, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(215, 203, 181, .7);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 6px;
  margin-left: -6px;
  border-radius: 12px;
  text-align: left;
}
.brand:hover .brand-mark { transform: rotate(-4deg) scale(1.04); }

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--teal), #149784);
  color: #fff;
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: .02em;
  box-shadow: 0 6px 16px -6px rgba(14, 124, 107, .7);
  transition: transform .2s ease;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.brand-text strong {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}
.brand-text span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.header-meta { display: flex; align-items: center; gap: 10px; }

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, .7);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .01em;
}
.meta-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
}

.vocab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .01em;
  box-shadow: var(--shadow-sm);
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.vocab-btn .vocab-btn-icon { font-size: 15px; line-height: 1; }
.vocab-btn:hover {
  background: var(--teal-soft);
  border-color: #a9d8cd;
  color: var(--teal-deep);
  transform: translateY(-1px);
}
.vocab-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(14, 124, 107, .8);
}
.vocab-btn.active:hover { background: var(--teal-deep); }
.vocab-btn:focus-visible { outline: 3px solid rgba(14, 124, 107, .35); outline-offset: 2px; }

/* ---------------- Home ---------------- */

#app { padding-block: 42px 64px; outline: none; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: 40px;
  align-items: center;
  padding: 18px 0 40px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--teal-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--teal);
}

.hero h1 {
  font-size: clamp(38px, 5.6vw, 62px);
  color: var(--ink);
}
.hero h1 em {
  color: var(--teal);
  font-style: italic;
  white-space: nowrap;
}

.hero .lead {
  max-width: 56ch;
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 17px;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 24px;
}
.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, .75);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}
.hero-chip b { color: var(--teal-deep); }

.hero-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 26px;
  background:
    linear-gradient(165deg, rgba(255, 253, 248, .95), rgba(250, 245, 234, .9));
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.hero-panel::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -55px;
  top: -60px;
  border-radius: 50%;
  background: var(--teal-soft);
  opacity: .8;
}
.hero-panel h2 {
  position: relative;
  font-size: 22px;
  margin-bottom: 6px;
}
.hero-panel > p {
  position: relative;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}
.panel-list { position: relative; display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.panel-list li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 14px;
  color: var(--ink-soft);
}
.panel-list .tick {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-size: 12px;
  font-weight: 800;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 14px 0 20px;
}
.section-heading h2 { font-size: 27px; }
.section-heading p { color: var(--muted); font-size: 14px; }
.section-heading .rule {
  flex: 1;
  height: 1px;
  background: var(--line);
  margin-bottom: 7px;
}

.exam-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.exam-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
}
.exam-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--accent, var(--teal));
}
.exam-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.exam-card:focus-within { outline: 2px solid var(--teal); outline-offset: 3px; }

.card-hit {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}
.card-hit:focus-visible { outline: 3px solid var(--accent, var(--teal)); outline-offset: -3px; }
.exam-card > :not(.card-hit) { position: relative; z-index: 1; }

.tone-1 { --accent: #0e7c6b; --accent-soft: #e0f2ed; }
.tone-2 { --accent: #c4553f; --accent-soft: #fbe9e4; }
.tone-3 { --accent: #3e6b9e; --accent-soft: #e6eef7; }
.tone-4 { --accent: #a06b16; --accent-soft: #f9efd9; }
.tone-5 { --accent: #7a5a9e; --accent-soft: #f0e9f7; }

.exam-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.exam-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--accent-soft, var(--teal-soft));
  font-size: 22px;
  line-height: 1;
}
.exam-no {
  color: var(--accent, var(--teal-deep));
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.exam-card h3 {
  font-size: 20.5px;
  min-height: 2.3em;
}
.exam-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: -2px;
}
.exam-breakdown span {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--card-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.exam-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.exam-status {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}
.exam-status.done { color: var(--green); }
.exam-status.progress { color: var(--amber); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 17px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .12s ease, box-shadow .15s ease;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(14, 124, 107, .35); outline-offset: 2px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(14, 124, 107, .8);
}
.btn-primary:hover:not([disabled]) { background: var(--teal-deep); }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line-strong);
}
.btn-ghost:hover:not([disabled]) { background: var(--card-soft); border-color: var(--ink-soft); }

.btn-soft {
  background: var(--card-soft);
  color: var(--ink-soft);
  border-color: var(--line);
}
.btn-soft:hover:not([disabled]) { background: #f3ecdd; }

.btn-danger {
  background: var(--red-soft);
  color: var(--red);
  border-color: #edc5bc;
}
.btn-danger:hover:not([disabled]) { background: #f7d8d1; }

.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }

.card-cta {
  border: 0;
  background: transparent;
  color: var(--accent, var(--teal-deep));
  font-size: 13.5px;
  font-weight: 800;
  padding: 6px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.card-cta .arrow { transition: transform .18s ease; }
.exam-card:hover .card-cta .arrow { transform: translateX(4px); }
.card-cta:focus-visible { outline: 2px solid var(--accent, var(--teal)); outline-offset: 3px; border-radius: 4px; }

/* ---------------- Vocabulary ---------------- */

.vocab-view { animation: rise .3s ease both; }

.vocab-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.vocab-title { flex: 1; min-width: 240px; }
.vocab-title .eyebrow { margin-bottom: 10px; }
.vocab-title h1 { font-size: clamp(34px, 4.6vw, 50px); }
.vocab-lead { margin-top: 10px; color: var(--ink-soft); font-size: 15.5px; max-width: 64ch; }

.vocab-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

.vocab-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.vocab-pill {
  border: 1px solid var(--line);
  background: var(--card-soft);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 700;
  transition: background .14s ease, border-color .14s ease, color .14s ease, transform .12s ease;
}
.vocab-pill:hover { border-color: var(--line-strong); background: #f3ecdd; transform: translateY(-1px); }
.vocab-pill.active { background: var(--teal); border-color: var(--teal); color: #fff; box-shadow: 0 6px 14px -8px rgba(14, 124, 107, .8); }
.vocab-pill.active:hover { background: var(--teal-deep); border-color: var(--teal-deep); }
.vocab-pill:focus-visible { outline: 3px solid rgba(14, 124, 107, .35); outline-offset: 2px; }

.vocab-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}
.vocab-select-wrap select {
  border: 1.5px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 600;
}
.vocab-select-wrap select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 124, 107, .12);
}

.vocab-count { margin: 0 2px 14px; color: var(--muted); font-size: 12.5px; font-weight: 600; }

.vocab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.vocab-card {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.vocab-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.vocab-card-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vocab-exam-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.vocab-theme {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vocab-word-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.vocab-word { font-size: 25px; color: var(--ink); letter-spacing: -.01em; overflow-wrap: anywhere; }
.vocab-arabic {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  color: var(--teal-deep);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.5;
}

.vocab-example {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-soft);
}
.vocab-example-en { color: var(--ink-soft); font-size: 13.5px; line-height: 1.55; }
.vocab-example-ar {
  margin-top: 5px;
  color: var(--muted);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 13.5px;
  line-height: 1.75;
}

.vocab-audio { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.vocab-speak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  transition: background .14s ease, border-color .14s ease, color .14s ease, transform .12s ease;
}
.vocab-speak:hover:not([disabled]) {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal-deep);
  transform: translateY(-1px);
}
.vocab-speak.speaking {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  animation: speak-pulse 1.2s ease-in-out infinite;
}
.vocab-speak[disabled] { opacity: .45; cursor: not-allowed; }
@keyframes speak-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(14, 124, 107, .28); }
  50% { box-shadow: 0 0 0 6px rgba(14, 124, 107, 0); }
}

.vocab-empty {
  grid-column: 1 / -1;
  padding: 40px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--card);
  color: var(--muted);
  text-align: center;
}

.vocab-note { margin-top: 18px; color: var(--muted); font-size: 12px; }

/* ---------------- Quiz top ---------------- */

.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 8px 13px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  transition: background .15s, border-color .15s;
}
.back-btn:hover { background: var(--card-soft); border-color: var(--line-strong); }

.quiz-id {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}
.quiz-id .exam-label {
  color: var(--teal-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.quiz-id .theme-label {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quiz-hud { display: flex; align-items: center; gap: 9px; }
.hud-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 9px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.hud-item .hud-label { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.hud-item.score { background: var(--teal-soft); border-color: #c4e6dd; color: var(--teal-deep); }

.progress-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.progress {
  flex: 1;
  height: 9px;
  border-radius: 99px;
  background: #e9e0cf;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(23, 36, 43, .06);
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #28a98f);
  transition: width .35s ease;
}
.progress-count {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.jump-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 22px;
}
.jump-dot {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  padding: 0;
  transition: background .12s, border-color .12s, transform .12s;
}
.jump-dot:hover { border-color: var(--ink-soft); transform: translateY(-1px); }
.jump-dot.current { outline: 2px solid var(--ink); outline-offset: 1px; }
.jump-dot.correct { background: var(--green-soft); border-color: #b9dfc7; color: var(--green); }
.jump-dot.partial { background: var(--amber-soft); border-color: #ecd39d; color: var(--amber); }
.jump-dot.wrong { background: var(--red-soft); border-color: #ecc1b8; color: var(--red); }

/* ---------------- Question card ---------------- */

.question-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
  padding: 30px 34px 26px;
  animation: rise .28s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

.q-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.section-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal-deep);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.section-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
}
.marks-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: #7d5108;
  border: 1px solid #f0dcb0;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
  white-space: nowrap;
}

.q-section-title {
  font-size: 27px;
  margin: 2px 0 4px;
}
.q-instructions {
  color: var(--muted);
  font-size: 13.5px;
  max-width: 72ch;
}

.passage {
  margin: 18px 0 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card-soft);
  overflow: hidden;
}
.passage summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  user-select: none;
}
.passage summary::-webkit-details-marker { display: none; }
.passage summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--muted);
  transition: transform .2s;
}
.passage[open] summary::after { transform: rotate(180deg); }
.passage summary:hover { background: #f6f0e3; }
.passage-body {
  padding: 0 16px 15px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.72;
}
.passage-body .gap-mark {
  background: #ffe9a8;
  color: var(--ink);
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 700;
}
.passage-note {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}

.q-prompt {
  margin: 22px 0 16px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--ink);
}
.q-prompt .blank {
  display: inline-block;
  min-width: 76px;
  height: 1.05em;
  vertical-align: -.15em;
  border-bottom: 2px solid var(--teal);
  color: var(--teal-deep);
  text-align: center;
  font-weight: 700;
}

.writing-title {
  margin: -6px 0 12px;
  color: var(--ink-soft);
  font-size: 13.5px;
}
.writing-title strong { color: var(--muted); font-weight: 700; }

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 13px;
  margin: 0 0 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: #fcf8ef;
}
.word-bank-label {
  width: 100%;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.word-chip {
  border: 1px solid #d9cdb7;
  background: #fff;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 1px 1px rgba(23, 36, 43, .04);
  transition: background .12s, border-color .12s, transform .12s;
}
.word-chip:hover { background: var(--teal-soft); border-color: #a9d8cd; transform: translateY(-1px); }
.word-chip:disabled { opacity: .5; cursor: default; transform: none; }

/* choices */

.choices { display: grid; gap: 9px; }

.choice {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  transition: border-color .14s, background .14s, box-shadow .14s, transform .12s;
}
.choice:hover:not(:disabled) {
  border-color: #b9aa90;
  background: #fffdf7;
  transform: translateX(2px);
  box-shadow: 0 3px 10px -6px rgba(23, 36, 43, .3);
}
.choice:disabled { cursor: default; }
.choice .letter {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--card-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 800;
  text-transform: lowercase;
}
.choice .choice-text { flex: 1; }
.choice .mark-icon { flex: 0 0 auto; font-weight: 800; font-size: 15px; }

.choice.selected { border-color: var(--teal); background: var(--teal-soft); }
.choice.selected .letter { background: var(--teal); border-color: var(--teal); color: #fff; }
.choice.correct { border-color: #7cc39a; background: var(--green-soft); }
.choice.correct .letter { background: var(--green); border-color: var(--green); color: #fff; }
.choice.correct .mark-icon { color: var(--green); }
.choice.wrong { border-color: #e09c8f; background: var(--red-soft); }
.choice.wrong .letter { background: var(--red); border-color: var(--red); color: #fff; }
.choice.wrong .mark-icon { color: var(--red); }
.choice.dim { opacity: .6; }

.tf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 460px; }
.tf-btn {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 18px;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  background: #fff;
  text-align: left;
  transition: border-color .14s, background .14s, transform .12s, box-shadow .14s;
}
.tf-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: #b9aa90; }
.tf-btn:disabled { cursor: default; }
.tf-btn .tf-letter {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--card-soft);
  border: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--muted);
}
.tf-btn .tf-label { font-weight: 700; font-size: 15px; }
.tf-btn .tf-sub { display: block; color: var(--muted); font-size: 11.5px; font-weight: 500; }
.tf-btn.selected { border-color: var(--teal); background: var(--teal-soft); }
.tf-btn.selected .tf-letter { background: var(--teal); border-color: var(--teal); color: #fff; }
.tf-btn.correct { border-color: #7cc39a; background: var(--green-soft); }
.tf-btn.correct .tf-letter { background: var(--green); border-color: var(--green); color: #fff; }
.tf-btn.wrong { border-color: #e09c8f; background: var(--red-soft); }
.tf-btn.wrong .tf-letter { background: var(--red); border-color: var(--red); color: #fff; }

/* text answers */

.answer-input,
.answer-textarea {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 13px 15px;
  font-size: 16px;
  line-height: 1.5;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.answer-input { max-width: 560px; }
.answer-input::placeholder,
.answer-textarea::placeholder { color: #a7a094; }
.answer-input:focus,
.answer-textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(14, 124, 107, .12);
  background: #fffefb;
}
.answer-input:disabled,
.answer-textarea:disabled { background: var(--card-soft); color: var(--ink-soft); -webkit-text-fill-color: var(--ink-soft); opacity: 1; }
.answer-textarea { resize: vertical; min-height: 88px; }
.answer-textarea.writing { min-height: 220px; font-size: 15px; }

.input-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}
.input-hint kbd {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 5px;
  background: var(--card-soft);
}

.write-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12.5px;
}
.write-meta .wc { font-variant-numeric: tabular-nums; font-weight: 700; }
.write-meta .wc.ok { color: var(--green); }
.write-meta .wc.low { color: var(--amber); }

.required-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 2px 0 12px; }
.required-tag {
  padding: 4px 10px;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

/* feedback */

.feedback {
  margin-top: 20px;
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--card-soft);
  font-size: 14px;
  line-height: 1.6;
  animation: fade .2s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.feedback.ok { background: var(--green-soft); border-color: #b9dfc7; }
.feedback.no { background: var(--red-soft); border-color: #ecc1b8; }
.feedback.partial { background: var(--amber-soft); border-color: #ecd39d; }
.feedback.info { background: var(--blue-soft); border-color: #c8dced; }

.feedback-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .02em;
}
.feedback.ok .feedback-title { color: var(--green); }
.feedback.no .feedback-title { color: var(--red); }
.feedback.partial .feedback-title { color: var(--amber); }
.feedback.info .feedback-title { color: var(--blue); }

.feedback p { margin-top: 6px; color: var(--ink-soft); }
.feedback .answer-line { margin-top: 8px; }
.feedback .answer-line strong { color: var(--ink); }

.model-box {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #c8dced;
  background: #f4f9fd;
}
.model-box .model-label {
  color: var(--blue);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.model-box p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.65;
}

.self-grade {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(23, 36, 43, .1);
}
.self-grade .sg-label { color: var(--ink-soft); font-size: 12.5px; font-weight: 700; margin-right: 2px; }
.self-grade button {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}
.self-grade button:hover { border-color: var(--teal); background: var(--teal-soft); }
.self-grade button.chosen { background: var(--teal); border-color: var(--teal); color: #fff; }
.self-grade button:disabled { opacity: .45; cursor: default; }

.rubric {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #c8dced;
  border-radius: 12px;
  background: #f7fafd;
}
.rubric h4 {
  font-size: 17px;
  margin-bottom: 3px;
}
.rubric > p { color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.rubric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 10px; }
.rubric-field { display: flex; flex-direction: column; gap: 4px; }
.rubric-field label { color: var(--ink-soft); font-size: 11.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.rubric-field select {
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  padding: 7px 9px;
  font-size: 13px;
}
.rubric-field select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14, 124, 107, .12); }
.rubric-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #c8dced;
  font-size: 13px;
  color: var(--ink-soft);
}
.rubric-total strong { font-size: 17px; color: var(--teal-deep); font-variant-numeric: tabular-nums; }

.word-count-note { color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.word-count-note.low { color: var(--amber); }
.word-count-note.ok { color: var(--green); }

/* actions */

.q-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.q-actions .spacer { flex: 1; }
.q-actions .right-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.check-hint { color: var(--muted); font-size: 12px; }

/* ---------------- Results ---------------- */

.results { animation: rise .3s ease both; }

.result-hero {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(80% 100% at 100% 0%, rgba(14, 124, 107, .07), transparent 60%),
    var(--card);
  box-shadow: var(--shadow-md);
}

.score-ring {
  --pct: 0;
  position: relative;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: conic-gradient(var(--teal) calc(var(--pct) * 1%), #eae1d1 0);
  display: grid;
  place-items: center;
  transition: background .8s ease;
}
.score-ring::before {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: inset 0 1px 4px rgba(23, 36, 43, .06);
}
.score-ring-inner {
  position: relative;
  text-align: center;
  line-height: 1;
}
.score-ring-inner strong {
  display: block;
  font-family: var(--serif);
  font-size: 49px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.score-ring-inner span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.result-copy .eyebrow { margin-bottom: 10px; }
.result-copy h1 { font-size: clamp(30px, 4vw, 44px); }
.result-copy .result-message { margin-top: 10px; color: var(--ink-soft); font-size: 15.5px; max-width: 62ch; }
.result-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.result-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--card-soft);
  border-radius: 9px;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.result-chip b { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.result-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }

.breakdown {
  margin-top: 22px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.breakdown h2 { font-size: 21px; margin-bottom: 16px; }
.breakdown-rows { display: grid; gap: 11px; }
.breakdown-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 74px;
  align-items: center;
  gap: 14px;
}
.breakdown-row .bd-label { color: var(--ink-soft); font-size: 12.5px; font-weight: 700; }
.breakdown-row .bd-bar { height: 8px; border-radius: 99px; background: #ece3d4; overflow: hidden; }
.breakdown-row .bd-bar span { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.breakdown-row .bd-score { text-align: right; color: var(--muted); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.breakdown-row .bd-score b { color: var(--ink); }

.review-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 36px 0 16px;
  flex-wrap: wrap;
}
.review-head h2 { font-size: 27px; }
.review-head p { color: var(--muted); font-size: 13.5px; }
.review-legend { display: flex; flex-wrap: wrap; gap: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.legend-swatch { width: 9px; height: 9px; border-radius: 3px; }
.legend-swatch.correct { background: var(--green); }
.legend-swatch.partial { background: var(--amber); }
.legend-swatch.wrong { background: var(--red); }
.legend-swatch.unanswered { background: #c4bbaa; }

.review-section { margin-bottom: 26px; }
.review-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.review-section-title .line { flex: 1; height: 1px; background: var(--line); }
.review-section-title .pts { color: var(--muted); letter-spacing: .02em; text-transform: none; font-weight: 700; }

.review-item {
  border: 1px solid var(--line);
  border-left: 4px solid #c4bbaa;
  border-radius: 12px;
  background: var(--card);
  padding: 16px 18px;
  margin-bottom: 9px;
}
.review-item.correct { border-left-color: var(--green); }
.review-item.partial { border-left-color: var(--amber); }
.review-item.wrong { border-left-color: var(--red); }

.review-item-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.review-no {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.review-status {
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.review-status.correct { background: var(--green-soft); color: var(--green); }
.review-status.partial { background: var(--amber-soft); color: var(--amber); }
.review-status.wrong { background: var(--red-soft); color: var(--red); }
.review-status.unanswered { background: #f0ebe1; color: #857b6b; }
.review-pts { margin-left: auto; color: var(--muted); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.review-pts b { color: var(--ink); }

.review-q { font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.55; }
.review-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.review-answer {
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--card-soft);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}
.review-answer.correct-answer { background: #f2faf5; border-color: #cfe9d8; }
.review-answer .ra-label {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.review-answer .ra-value { white-space: pre-wrap; }
.review-answer .ra-value.empty { color: #a29a8a; font-style: italic; }

.review-item details {
  margin-top: 9px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.review-item details summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 700;
  font-size: 12px;
}
.review-item details .model-text {
  margin-top: 7px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f4f9fd;
  border: 1px solid #d4e4f0;
  white-space: pre-wrap;
  line-height: 1.6;
}

.results-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.results-foot p { color: var(--muted); font-size: 12.5px; }

/* ---------------- Footer ---------------- */

.site-footer { border-top: 1px solid var(--line); background: rgba(255, 253, 248, .45); }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-block: 22px;
  color: var(--muted);
  font-size: 12.5px;
}
.footer-inner strong { color: var(--ink-soft); }
.footer-note { text-align: right; }

/* ---------------- Responsive ---------------- */

@media (max-width: 980px) {
  .exam-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; gap: 26px; padding-bottom: 32px; }
  .hero-panel { max-width: 560px; }
}

@media (max-width: 720px) {
  .shell { width: calc(100% - 28px); }
  #app { padding-block: 26px 48px; }
  .header-meta .meta-pill { display: none; }
  .vocab-btn { padding: 7px 11px; font-size: 12px; }
  .header-inner { min-height: 62px; }
  .brand-text strong { font-size: 17px; }
  .brand-text span { font-size: 10.5px; }
  .brand-mark { width: 38px; height: 38px; font-size: 15px; }

  .hero h1 { font-size: clamp(34px, 9vw, 48px); }
  .hero h1 em { white-space: normal; }
  .hero .lead { font-size: 15.5px; }
  .hero-panel { padding: 20px; }
  .section-heading h2 { font-size: 23px; }
  .section-heading p { display: none; }

  .exam-grid { grid-template-columns: 1fr; }
  .exam-card h3 { min-height: 0; }

  .vocab-top { flex-direction: column; }
  .vocab-title h1 { font-size: clamp(32px, 8vw, 42px); }
  .vocab-toolbar { padding: 12px; }
  .vocab-grid { grid-template-columns: 1fr; }
  .vocab-word { font-size: 23px; }
  .vocab-arabic { font-size: 18px; }

  .quiz-top { gap: 10px; }
  .quiz-id { order: 3; width: 100%; }
  .quiz-id .theme-label { font-size: 16px; }
  .quiz-hud { margin-left: auto; }
  .hud-item .hud-label { display: none; }
  .hud-item { padding: 6px 10px; }

  .question-card { padding: 22px 18px 20px; border-radius: 17px; }
  .q-section-title { font-size: 23px; }
  .q-prompt { font-size: 16px; margin-top: 18px; }
  .tf-grid { grid-template-columns: 1fr; }
  .choice { padding: 12px 13px; font-size: 14.5px; }
  .q-actions { flex-direction: column; align-items: stretch; }
  .q-actions .right-actions { justify-content: flex-end; }
  .q-actions > .btn, .q-actions .right-actions .btn { flex: 1; }
  .q-actions .check-hint { display: none; }

  .result-hero { grid-template-columns: 1fr; gap: 22px; padding: 24px 20px; text-align: center; }
  .score-ring { width: 150px; height: 150px; margin-inline: auto; }
  .score-ring-inner strong { font-size: 40px; }
  .result-copy .eyebrow { justify-content: center; }
  .result-chips, .result-actions { justify-content: center; }
  .result-copy .result-message { margin-inline: auto; }
  .breakdown { padding: 20px 18px; }
  .breakdown-row { grid-template-columns: 108px minmax(0, 1fr) 62px; gap: 9px; }
  .review-answers { grid-template-columns: 1fr; }
  .review-head { margin-top: 28px; }
  .review-legend { gap: 9px; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 6px; }
  .footer-note { text-align: left; }
}

@media (max-width: 420px) {
  .result-actions .btn { flex: 1; }
  .jump-row { gap: 4px; }
  .jump-dot { width: 22px; height: 22px; }
  .vocab-btn { padding: 8px 10px; }
  .vocab-btn span:not(.vocab-btn-icon) { display: none; }
}

/* ---------------- Motion / print ---------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  body { background: #fff; }
  .site-header, .site-footer, .result-actions, .results-foot .btn, .q-actions, .skip-link { display: none !important; }
  #app { padding: 0; width: 100%; }
  .shell { width: 100%; }
  .result-hero, .breakdown, .review-item { box-shadow: none; break-inside: avoid; }
  .review-item details { display: block; }
  .review-item details summary { display: none; }
  .review-item details > * { display: block; }
}

/* ==========================================================
   Primary 4 additions — unit/model sets, section navigation
   and explicit Back / Forward controls
   ========================================================== */

.exam-card-sub {
  margin: -6px 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.panel-note {
  position: relative;
  margin: 14px 0 0;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--teal-soft);
  border: 1px solid #c9e7df;
  color: var(--teal-deep);
  font-size: 12.5px;
  line-height: 1.55;
}
.panel-note strong { font-weight: 800; }

.section-nav {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.section-step {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 13px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card-soft);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 700;
  transition: background .15s, border-color .15s, color .15s;
}
.section-step:hover:not([disabled]) {
  background: var(--teal-soft);
  border-color: #c4e6dd;
  color: var(--teal-deep);
}
.section-step[disabled] { opacity: .4; cursor: not-allowed; }

.section-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  flex: 1;
  padding: 2px;
  scrollbar-width: thin;
}

.section-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px 6px 6px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.section-pill:hover { background: var(--card-soft); color: var(--ink-soft); }
.section-pill .sp-no {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--card-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
}
.section-pill.done .sp-no { background: var(--green-soft); border-color: #b9dfc7; color: var(--green); }
.section-pill.active {
  background: var(--teal-soft);
  border-color: #c4e6dd;
  color: var(--teal-deep);
}
.section-pill.active .sp-no { background: var(--teal); border-color: var(--teal); color: #fff; }

.q-position {
  flex: 1;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.btn-forward { font-weight: 800; }
.q-back { min-width: 96px; }

@media (max-width: 720px) {
  .section-nav { flex-wrap: wrap; }
  .section-pills { order: 3; flex-basis: 100%; }
  .section-step { flex: 1; justify-content: center; }
  .q-position { order: 3; flex-basis: 100%; text-align: left; padding-top: 4px; }
}

@media (max-width: 520px) {
  .quiz-top { align-items: flex-start; }
  .quiz-hud { width: 100%; justify-content: space-between; }
  .section-pill { font-size: 11px; }
}
