:root {
  --ink: #172033;
  --muted: #697386;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-pale: #eff6ff;
  --surface: #ffffff;
  --canvas: #f7f8fc;
  --line: #dce2ef;
  --green: #047857;
  --red: #b91c1c;
  --gold: #a16207;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--blue-dark); text-underline-offset: 2px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.15; margin-bottom: .65rem; }
h2 { line-height: 1.25; }
button, input, select, textarea { font: inherit; }

.site-header { min-height: 68px; display: flex; justify-content: space-between; align-items: center; padding: 0 5vw; background: #fff; border-bottom: 1px solid var(--line); }
.brand { color: var(--ink); font-weight: 800; text-decoration: none; }
.site-header nav { display: flex; gap: 1rem; }
.site-header nav a { text-decoration: none; font-weight: 600; }
.container { width: min(1100px, 92vw); margin: 0 auto; padding: 3rem 0 4rem; }
.eyebrow { color: var(--blue-dark); font-size: .8rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.muted { color: var(--muted); }
.center { text-align: center; }
.narrow { max-width: 600px; margin: 1.5rem auto; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: clamp(1.25rem, 3vw, 2rem); box-shadow: 0 8px 20px rgba(23, 32, 51, .04); }
.button { display: inline-block; padding: .67rem 1rem; border: 1px solid var(--blue); border-radius: 9px; color: #fff; background: var(--blue); cursor: pointer; font-weight: 700; text-align: center; text-decoration: none; }
.button:hover { border-color: var(--blue-dark); background: var(--blue-dark); }
.button-large { padding: .85rem 1.4rem; font-size: 1.05rem; }
.button-secondary { color: var(--blue-dark); background: #fff; }
.button-secondary:hover { color: #fff; }

.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); padding: 0; margin: 1.2rem 0; text-align: left; }
.summary div { padding: .7rem 1rem; border-left: 1px solid var(--line); }
.summary div:first-child { border-left: 0; }
.summary dt { color: var(--muted); font-size: .83rem; }
.summary dd { margin: .1rem 0 0; font-size: 1.2rem; font-weight: 800; }
.compact dd { font-size: 1rem; }

.passage { margin: 0 0 1.5rem; padding: 1rem 1.1rem; border-left: 4px solid #93c5fd; background: var(--blue-pale); white-space: pre-line; }
.save-status { min-height: 1.45em; color: var(--muted); font-size: .9rem; }
.save-status.saving { color: var(--gold); }
.save-status.saved { color: var(--green); }
.save-status.error { color: var(--red); }

.admin-heading { margin-bottom: 1.1rem; }
.admin-heading h1 { margin: 0; font-size: 1.8rem; }
.admin-nav { display: flex; flex-wrap: wrap; gap: .7rem 1.1rem; padding: .85rem 0 1.35rem; }
.admin-nav a { font-weight: 700; }
.dashboard-grid, .split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.stack { display: grid; gap: 1rem; margin-top: 1rem; }
.section-title { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }

table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: .72rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
th { color: var(--muted); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.badge { display: inline-block; padding: .16rem .45rem; border-radius: 999px; color: #334155; background: #e2e8f0; font-size: .75rem; font-weight: 800; text-transform: capitalize; white-space: nowrap; }
.badge-new, .badge-weak, .badge-wrong { color: #991b1b; background: #fee2e2; }
.badge-review-needed, .badge-relearning, .badge-review { color: #92400e; background: #fef3c7; }
.badge-reviewed, .badge-improving, .badge-correct, .badge-mastered { color: #065f46; background: #d1fae5; }
.badge-expired { color: #7c2d12; background: #ffedd5; }
.badge-dont-know { color: #1e3a8a; background: #dbeafe; }
.badge-in-progress { color: #92400e; background: #fef3c7; }
.badge-finished { color: #065f46; background: #d1fae5; }

.form-stack { display: grid; gap: .85rem; }
.form-stack label, .filter-grid label { display: grid; gap: .35rem; color: #334155; font-weight: 700; font-size: .9rem; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { width: 100%; padding: .58rem .65rem; border: 1px solid #b8c2d4; border-radius: 8px; color: var(--ink); background: #fff; }
textarea { min-height: 76px; resize: vertical; }
fieldset { margin: 0; border: 1px solid var(--line); border-radius: 9px; }
legend { padding: 0 .35rem; font-weight: 800; }
.check-row { display: block !important; padding: .45rem .2rem; font-weight: 500 !important; }
.check-row input { margin-right: .35rem; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); align-items: end; gap: .8rem; margin-bottom: 1rem; }
.filter-grid .button { align-self: end; }
.answer-row { display: flex; justify-content: space-between; gap: 1rem; padding: 1.25rem; border: 1px solid var(--line); border-left-width: 5px; border-radius: 10px; background: #fff; }
.answer-row.correct { border-left-color: #34d399; }
.answer-row.wrong { border-left-color: #f87171; }
.answer-row p { margin: .35rem 0; }

.paper-question { padding: 1rem 0; border-top: 1px solid var(--line); }
.paper-part h2 + p + .paper-question { border-top: 0; }
.paper-question p { margin: .3rem 0; }
.paper-number { display: inline-block; min-width: 1.8rem; padding: .1rem .4rem; border-radius: 999px; color: #fff; background: var(--blue); font-size: .8rem; font-weight: 800; text-align: center; }
.paper-passage { margin: .5rem 0; padding: .7rem 1rem; border-left: 4px solid var(--line); background: #f8fafc; white-space: pre-wrap; }
.paper-prompt { font-weight: 700; }
.paper-choices { margin: .3rem 0; padding-left: 1.2rem; list-style: none; }
.paper-choice { padding: .15rem .4rem; border-radius: 6px; }
.paper-choice.is-correct { background: #d1fae5; }
.paper-key { color: #065f46; font-size: .75rem; font-weight: 800; }

@media (max-width: 760px) {
  .container { width: min(94vw, 1100px); padding-top: 1.7rem; }
  .site-header { padding: 0 3vw; }
  .dashboard-grid, .split { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .answer-row, .section-title { align-items: stretch; flex-direction: column; }
  .summary div { border-left: 0; border-top: 1px solid var(--line); }
  .summary div:first-child { border-top: 0; }
  table { min-width: 650px; }
  .card { overflow-x: auto; }
}

/* ---- Learner pages -------------------------------------------------------------------------
   One system for every part. A part sets --accent, --tint, --deep and --border on <body>
   (from its data); the layout classes below decide how its questions are drawn. */
body.learner {
  --accent: #17233B; --tint: #E9EDF5; --deep: #17233B; --border: #DCE3F0; --ink: #17233B; --muted: #5A6785; --line: #DCE3F0;
  color: var(--ink); background: #F3F6FB; font: 16px/1.5 "Nunito", "Zen Maru Gothic", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.lx-page { min-height: 100vh; display: flex; flex-direction: column; }
.lx-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px clamp(16px, 3.2vw, 40px) 0; }
.lx-brand { display: flex; align-items: center; gap: 12px; }
.lx-brand strong { display: block; font-size: 18px; font-weight: 800; line-height: 1.2; }
.lx-brand div span { display: block; color: var(--muted); font-size: 15px; font-weight: 600; }
.lx-logo { display: flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 50%; color: #fff; background: #17233B; font: 600 22px "Fredoka", sans-serif; }

.lx-progress { width: 100%; max-width: 1200px; margin: 0 auto; padding: 22px clamp(16px, 3.2vw, 40px) 0; }
.lx-progress-narrow { max-width: 560px; padding: 0; }
.lx-progress-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.lx-count { font: 600 48px/1 "Fredoka", sans-serif; }
.lx-count span { color: #8A96AF; font-weight: 500; }
.lx-chip { display: inline-flex; align-items: center; gap: 10px; padding: 9px 18px 9px 12px; border-radius: 999px; color: var(--deep); background: var(--tint); font-size: 18px; font-weight: 800; }
.lx-spacer { flex: 1; }
.lx-partof { color: var(--muted); font-size: 16px; font-weight: 700; }
.lx-bar { display: flex; gap: 8px; }
.lx-seg { height: 10px; overflow: hidden; border-radius: 999px; background: #DCE3F0; }
.lx-seg i { display: block; height: 100%; border-radius: 999px; background: var(--seg); transition: width .3s; }

.lx-main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 24px clamp(16px, 3.2vw, 40px) 40px; display: flex; flex-direction: column; gap: 28px; }
.lx-card { display: flex; flex-direction: column; gap: 30px; padding: clamp(24px, 4vw, 40px) clamp(20px, 4vw, 48px); border: 2px solid var(--border); border-radius: 32px; background: #fff; }
.lx-instruction { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--accent); font-size: 18px; font-weight: 800; }
.lx-flag { padding: 6px 14px; border-radius: 999px; color: #fff; background: #17233B; font-size: 15px; font-weight: 800; }
.lx-flag-line { margin: 0; }
.lx-prompt { margin: 0; font-size: clamp(28px, 4vw, 44px); font-weight: 800; line-height: 1.3; }
.lx-jp { display: inline-block; padding: 0 18px; border-radius: 16px; color: var(--deep); background: var(--tint); font-family: "Zen Maru Gothic", "Nunito", sans-serif; font-weight: 700; }

/* Answer options: a real input, hidden but focusable, drives the look of the box after it. */
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.opt-body { display: flex; border: 3px solid var(--border); background: #fff; color: var(--ink); font-weight: 800; transition: background .15s, border-color .15s; }
.opt:hover .opt-body { border-color: var(--accent); }
.opt input:focus-visible + .opt-body { outline: 3px solid #17233B; outline-offset: 3px; }
.mark { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; }
.mark .ic { display: none; }
.opt input:checked + .opt-body .mark .letter { display: none; }
.opt input:checked + .opt-body .mark .ic { display: block; }

.lx-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.opt-tile .opt-body { flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 26px; min-height: 150px; padding: 20px 24px; border-radius: 24px; font-size: clamp(26px, 3vw, 36px); }
.opt-tile .mark { width: 40px; height: 40px; font-size: 20px; color: var(--deep); background: var(--tint); }
.opt-tile .mark-dot { border-radius: 50%; }
.opt-tile .mark-box { border: 3px solid var(--accent); border-radius: 12px; background: #fff; box-sizing: border-box; }
.opt-tile input:checked + .opt-body { border-color: var(--accent); color: #fff; background: var(--accent); }
.opt-tile input:checked + .opt-body .mark { color: var(--accent); background: #fff; }
.opt-tile.opt-multi input:checked + .opt-body { color: var(--deep); background: var(--tint); }
.opt-tile.opt-multi input:checked + .opt-body .mark { border-color: var(--accent); color: #fff; background: var(--accent); }

.lx-pills { display: flex; flex-wrap: wrap; gap: 18px; }
.opt-pill .opt-body { align-items: center; gap: 14px; min-height: 64px; padding: 8px 32px 8px 10px; border-radius: 999px; font-size: clamp(22px, 2.6vw, 30px); }
.opt-pill .mark { width: 44px; height: 44px; border-radius: 50%; font-size: 20px; color: var(--deep); background: var(--tint); }
.opt-pill input:checked + .opt-body { border-color: var(--accent); color: #fff; background: var(--accent); }
.opt-pill input:checked + .opt-body .mark { color: var(--accent); background: #fff; }
.lx-sentence { padding: 10px 28px; border-radius: 24px; background-color: color-mix(in srgb, var(--tint) 40%, #fff); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 83px, var(--border) 83px, var(--border) 85px); font-size: clamp(26px, 3.4vw, 46px); font-weight: 700; line-height: 85px; }
.lx-slot { display: inline-block; min-width: 200px; height: 60px; margin: 0 4px; border-bottom: 4px dashed var(--accent); line-height: 60px; text-align: center; vertical-align: middle; }
.lx-slot.filled { min-width: 150px; padding: 0 20px; border-bottom-style: solid; border-radius: 14px; color: var(--deep); background: var(--tint); }

.lx-rows { display: flex; flex-direction: column; gap: 14px; }
.opt-row .opt-body { align-items: center; gap: 18px; min-height: 76px; padding: 12px 24px; border-radius: 22px; font-size: clamp(20px, 2.4vw, 28px); }
.mark-radio { width: 34px; height: 34px; border: 3px solid var(--accent); border-radius: 50%; color: #fff; background: #fff; box-sizing: border-box; }
.opt-multi .mark-radio { border-radius: 10px; }
.mark-radio .ic { display: block; width: 16px; height: 16px; }
.opt-row input:checked + .opt-body { border-color: var(--accent); color: var(--deep); background: var(--tint); }
.opt-row input:checked + .opt-body .mark-radio { background: var(--accent); }

/* "I don't know": quieter than the answers (dashed, grey) so it reads as an honest option, not a choice to pick by default. */
.lx-dk { margin-top: 22px; padding-top: 22px; border-top: 2px dashed var(--border); }
.opt-dk { display: inline-block; }
.opt-dk .opt-body { align-items: center; gap: 12px; min-height: 56px; padding: 8px 24px 8px 14px; border: 3px dashed #AEB6C6; border-radius: 999px; color: #4A5468; font-size: clamp(18px, 2vw, 22px); }
.opt-dk:hover .opt-body { border-color: #5B6478; }
.opt-dk .mark-radio { width: 28px; height: 28px; border-color: #8A93A6; border-radius: 8px; }
.opt-dk .lx-dk-ja { margin-left: 8px; font-family: "Zen Maru Gothic", "Nunito", sans-serif; font-weight: 700; }
.opt-dk input:checked + .opt-body { border-style: solid; border-color: #5B6478; color: #fff; background: #5B6478; }
.opt-dk input:checked + .opt-body .mark-radio { border-color: #fff; color: #5B6478; background: #fff; }

.lx-split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.lx-story { flex: 1 1 440px; min-width: 0; gap: 20px; padding: 28px 32px 34px; border-radius: 28px; background: color-mix(in srgb, var(--tint) 35%, #fff); }
.lx-story-head { display: flex; align-items: center; gap: 10px; padding-bottom: 16px; border-bottom: 2px solid var(--border); color: var(--deep); font-size: 18px; font-weight: 800; }
.lx-story p { margin: 0; font-size: clamp(20px, 2.3vw, 28px); font-weight: 600; line-height: 1.8; white-space: pre-line; }
.lx-question { flex: 1 1 440px; min-width: 0; gap: 24px; padding: 28px 32px 34px; border-radius: 28px; }
.lx-question .lx-prompt { font-size: clamp(26px, 3vw, 40px); }

.lx-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lx-nav .save-status { margin: 0; color: var(--muted); font-size: 16px; font-weight: 600; }
.lx-nav .save-status.saving { color: #7A4B00; }
.lx-nav .save-status.saved { color: var(--deep); }
.lx-nav .save-status.error { color: var(--red); }
.lx-nav form { margin-left: auto; }
.lx-next, .lx-go, .lx-start, .lx-home-link { display: inline-flex; align-items: center; gap: 10px; border: 0; border-radius: 999px; color: #fff; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.lx-next { min-height: 56px; padding: 0 32px; background: var(--accent); font-size: 20px; }
.lx-next:focus-visible, .lx-go:focus-visible, .lx-exam-open:focus-visible, .lx-home-link:focus-visible { outline: 3px solid #17233B; outline-offset: 3px; }

.lx-intro-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px clamp(16px, 3.2vw, 40px) 48px; }
.lx-intro { display: flex; width: 100%; max-width: 760px; flex-direction: column; align-items: center; gap: 20px; padding: clamp(28px, 5vw, 52px) clamp(20px, 5vw, 56px); border: 2px solid var(--border); border-radius: 36px; background: #fff; text-align: center; }
.lx-intro-icon, .lx-finish-icon { display: flex; width: 108px; height: 108px; align-items: center; justify-content: center; border-radius: 50%; color: var(--accent); background: var(--tint); }
.lx-kicker { color: var(--muted); font: 500 26px "Fredoka", sans-serif; }
.lx-intro-title { margin: 0; color: var(--deep); font: 600 clamp(44px, 7vw, 72px)/1.05 "Fredoka", "Zen Maru Gothic", sans-serif; }
.lx-ja { color: var(--accent); font: 700 28px "Zen Maru Gothic", sans-serif; }
.lx-intro-text { margin: 0; font-size: 28px; font-weight: 700; line-height: 1.4; }
.lx-go { min-height: 68px; margin-top: 10px; padding: 0 56px; background: var(--accent); font-size: 28px; }
.lx-note { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 19px; font-weight: 700; }

.lx-home { width: 100%; max-width: 860px; margin: 0 auto; padding: 56px clamp(16px, 3.2vw, 40px); display: flex; flex-direction: column; gap: 32px; }
.lx-hello { margin: 0; font: 600 clamp(40px, 6vw, 64px)/1.1 "Fredoka", sans-serif; }
.lx-sub { margin: 8px 0 0; color: var(--muted); font-size: 26px; font-weight: 700; }
.lx-exams { display: flex; flex-direction: column; gap: 18px; }
.lx-exam { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 22px 28px; border-radius: 28px; color: inherit; text-decoration: none; }
.lx-exam-open { border: 3px solid #17233B; background: #fff; }
.lx-exam-done { border: 2px solid var(--line); color: var(--muted); background: #EAEFF7; }
.lx-date { display: flex; width: 92px; height: 92px; flex-direction: column; align-items: center; justify-content: center; border-radius: 22px; color: #fff; background: #17233B; line-height: 1; }
.lx-date span { font-size: 18px; font-weight: 800; }
.lx-date b { font: 600 42px "Fredoka", sans-serif; }
.lx-exam-done .lx-date { background: #C9D2E3; }
.lx-exam-title { flex: 1 1 260px; min-width: 0; }
.lx-exam-title h2 { margin: 0 0 6px; font-size: 30px; font-weight: 800; line-height: 1.2; }
.lx-exam-meta { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 19px; font-weight: 700; }
.lx-exam-meta span { display: inline-flex; align-items: center; gap: 6px; }
.lx-start { min-height: 60px; padding: 0 36px; background: #17233B; font-size: 22px; }
.lx-done-badge { display: inline-flex; align-items: center; gap: 8px; padding: 10px 22px; border: 2px solid #C9D2E3; border-radius: 999px; background: #fff; font-size: 20px; font-weight: 800; }

.lx-finish-icon { color: #fff; background: #17233B; }
.lx-done-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.lx-done-chip { display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px 12px 14px; border-radius: 999px; color: var(--deep); background: var(--tint); font-size: 20px; font-weight: 800; }
.lx-home-link { min-height: 60px; padding: 0 44px; background: #17233B; font-size: 22px; }
.lx-score { display: flex; gap: 32px; margin: 0; }
.lx-score dt { color: var(--muted); font-size: 15px; font-weight: 700; }
.lx-score dd { margin: 0; font-size: 28px; font-weight: 800; }

@media (max-width: 560px) {
  .lx-count { font-size: 36px; }
  .lx-progress-row { gap: 12px; }
  .lx-card { gap: 22px; border-radius: 24px; }
  .lx-sentence { padding: 8px 18px; line-height: 72px; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 70px, var(--border) 70px, var(--border) 72px); }
  .lx-slot { min-width: 90px; height: 48px; line-height: 48px; }
  .lx-slot.filled { min-width: 0; padding: 0 12px; }
  .lx-next { width: 100%; justify-content: center; }
  .lx-nav form { width: 100%; margin-left: 0; }
  .lx-go { padding: 0 40px; }
}

/* Back (shown unless the teacher turned it off for the test) */
.lx-back { display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 28px; border: 2px solid var(--border); border-radius: 999px; color: var(--deep); background: #fff; font: inherit; font-size: 20px; font-weight: 800; text-decoration: none; }
.lx-back:hover { border-color: var(--accent); }
.lx-back:focus-visible { outline: 3px solid #17233B; outline-offset: 3px; }
.lx-back-intro { margin-top: 4px; min-height: 48px; font-size: 18px; }
@media (max-width: 560px) {
  .lx-nav { flex-direction: column-reverse; align-items: stretch; }
  .lx-nav .save-status { text-align: center; }
  .lx-back { justify-content: center; }
}

/* Site password page */
.lx-login { max-width: 560px; }
.lx-login-field { display: flex; width: 100%; flex-direction: column; gap: 8px; text-align: left; font-size: 18px; font-weight: 800; }
.lx-login-field input { width: 100%; min-height: 60px; padding: 0 20px; border: 3px solid var(--border); border-radius: 18px; background: #fff; font: inherit; font-size: 24px; }
.lx-login-field input:focus { border-color: var(--accent); outline: 3px solid #17233B; outline-offset: 2px; }
.lx-login-error { margin: 0; padding: 10px 18px; border-radius: 14px; color: #7A1D1D; background: #FDECEC; font-size: 18px; font-weight: 800; }
.app-version { margin: 28px 0 8px; color: var(--muted); font-size: 11px; line-height: 1; text-align: center; opacity: .7; }

/* Passage audio: the speaker button (exam.js plays the clip). Shown only when the passage has a pre-generated clip. */
[data-audio] .when-playing { display: none; }
[data-audio].is-playing .when-idle { display: none; }
[data-audio].is-playing .when-playing { display: inline-flex; }
.lx-listen { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; margin-left: auto; padding: 0 20px; border: 3px solid var(--deep); border-radius: 999px; color: var(--deep); background: #fff; font: inherit; font-size: 18px; font-weight: 800; cursor: pointer; }
.lx-listen .when-idle, .lx-listen .when-playing { align-items: center; gap: 8px; }
.lx-listen .when-idle { display: inline-flex; }
.lx-listen .lx-ja { font-family: "Zen Maru Gothic", sans-serif; font-size: 16px; font-weight: 700; }
.lx-listen:hover { background: var(--tint); }
.lx-listen.is-playing { color: #fff; background: var(--deep); }
.lx-listen:focus-visible { outline: 3px solid #17233B; outline-offset: 3px; }
.lx-listen-row { display: flex; margin: 0 0 12px; }
.paper-listen { margin: .3rem 0 .6rem; }
@media (max-width: 560px) {
  .lx-story-head { flex-wrap: wrap; }
  .lx-listen { min-height: 52px; }
}
/* Listen first: answers stay dimmed and locked until the story has played once (exam.js enableListenFirst). */
.lx-listen-hint { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 10px 16px; border-radius: 14px; color: var(--deep); background: var(--tint); font-size: 18px; font-weight: 800; }
.lx-listen-hint[hidden] { display: none; }
.lx-locked .lx-rows, .lx-locked .lx-dk { opacity: .45; }
.lx-locked .opt { cursor: not-allowed; }
/* While the answers are locked the Listen button pulses so it is the first thing she sees. Still for reduced-motion users (a heavier border instead). */
.lx-listen.lx-attention { border-width: 4px; background: var(--tint); box-shadow: 0 0 0 0 var(--accent); animation: lx-pulse 1.4s ease-in-out infinite; }
@keyframes lx-pulse {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  50%  { transform: scale(1.07); box-shadow: 0 0 0 14px color-mix(in srgb, var(--accent) 0%, transparent); }
  100% { transform: scale(1);    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .lx-listen.lx-attention { animation: none; } }

/* Voided attempts (teacher pages): kept for the record, visibly not counted. */
tr.is-voided td { color: var(--muted); text-decoration: line-through; text-decoration-color: #cbd5e1; }
tr.is-voided td:nth-child(4), tr.is-voided td:first-child { text-decoration: none; }
.badge-voided { color: #7a4b00; background: #fef3c7; }
.void-banner { border-left: 6px solid #d97706; background: #fffbeb; }
