/* Road signs: the course page, the lesson player, review, the catalogue and a sign's page.
   Built on the site tokens in style.css and the shared pieces in world.css (numerals,
   gantry strip). Selected states use the accent; green and red only say right or wrong. */

.sx {
  --sx-line: var(--border);
  --sx-line-2: var(--border-strong);
  --sx-ground: var(--bg);
  --sx-panel: var(--bg-card);
  --sx-raised: var(--bg-soft);
  --sx-good: var(--correct);
  --sx-bad: var(--wrong);
  --sx-good-wash: color-mix(in srgb, var(--correct) 11%, transparent);
  --sx-bad-wash: color-mix(in srgb, var(--wrong) 10%, transparent);
  --sx-accent-wash: color-mix(in srgb, var(--accent) 8%, transparent);
  --sx-accent-line: color-mix(in srgb, var(--accent) 55%, transparent);
  width: min(1180px, 100% - 48px);
  margin: 0 auto;
  padding: 22px 0 80px;
  color: var(--text);
}
.sx [hidden] { display: none !important; }
.sx h1, .sx h2, .sx h3 { text-wrap: balance; }
.sx p { text-wrap: pretty; }
.sx-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sx :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sx-lede { color: var(--text-soft); font-size: 1.05rem; line-height: 1.62; max-width: 54ch; }
.sx-note { color: var(--text-muted); font-size: 0.84rem; line-height: 1.6; margin-top: 26px; }
.sx-note a, .facts-source a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.sl-note { color: var(--text-muted); font-size: 0.9rem; line-height: 1.55; }

/* Buttons sized for a thumb */
.sx .sx-btn { min-height: 48px; padding: 0 22px; border-radius: 12px; font-size: 0.95rem; font-weight: 700; justify-content: center; text-align: center; white-space: normal; line-height: 1.25; }
.sx .btn-ghost.sx-btn { color: var(--text); }
.sx .btn-ghost:disabled { opacity: 0.4; cursor: default; }
.sl-text-button { border: 0; background: none; color: var(--accent); font: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer; padding: 8px 0; min-height: 40px; text-align: left; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.sl-text-button:hover { color: var(--accent-strong); }

/* Top line: section tabs and the language switch */
.sx-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; margin-bottom: clamp(22px, 3vw, 34px); border-bottom: 1px solid var(--sx-line); }
.sx-topline .learning-navigation { flex: 1; min-width: 0; margin: 0; padding: 0; border: 0; }
.lesson-lang { display: inline-flex; flex: 0 0 auto; padding: 3px; border: 1px solid var(--sx-line-2); border-radius: 11px; background: var(--sx-panel); }
.lesson-lang .lang-btn { min-width: 40px; min-height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--text-muted); font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.lesson-lang .lang-btn:hover { color: var(--text); }
.lesson-lang .lang-btn.is-active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-ring); }

/* Shared: status dots and chips */
.sc-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
.sc-dot[data-state="new"], .sc-dot:not([data-state]) { display: none; }
.sc-dot[data-state="learning"] { box-shadow: inset 0 0 0 2px var(--accent); }
.sc-dot[data-state="learned"] { background: var(--sx-good); }
.sc-dot[data-state="due"] { background: var(--accent); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent); }
.lesson-code, .sign-code { color: var(--accent); font-size: 0.8rem; font-weight: 800; letter-spacing: 0.06em; }

/* ── Course page ─────────────────────────────────────────────────────────── */
.sx-hub-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr); gap: clamp(24px, 4vw, 56px); align-items: end; }
.sx-hub-intro h1, .sc-head h1 { font-size: clamp(2.2rem, 4.4vw, 3.6rem); font-weight: 800; letter-spacing: -0.045em; line-height: 1.02; margin-bottom: 16px; }
.sx-gantry { margin-top: 26px; }
.sx-next { position: relative; display: grid; gap: 12px; padding: clamp(20px, 2.6vw, 28px); border: 1px solid var(--sx-accent-line); border-radius: 22px;
  background: linear-gradient(180deg, var(--sx-accent-wash), transparent 62%), var(--sx-panel); }
.sx-next-kicker { color: var(--accent); font-size: 0.85rem; font-weight: 700; }
.sx-next-title { font-size: clamp(1.35rem, 2.2vw, 1.7rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.sx-next-copy { color: var(--text-soft); font-size: 0.95rem; line-height: 1.55; max-width: 48ch; }
.sx-next .sx-btn { justify-self: start; margin-top: 4px; }
.sx-next-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--sx-line); color: var(--text-muted); font-size: 0.84rem; }
.sx-next-foot a { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--sx-line-2); }
.sx-next-foot a:hover { text-decoration-color: var(--accent); }

.sx-method { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.35fr); margin: clamp(30px, 4vw, 44px) 0 0; padding: 0; list-style: none; border-top: 1px solid var(--sx-line); border-bottom: 1px solid var(--sx-line); }
.sx-method li { display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 0; min-width: 0; }
.sx-method li + li { padding-left: 16px; border-left: 1px solid var(--sx-line); }
.sx-method .wx-led { font-size: 1.7rem; line-height: 1; }
.sx-method strong { display: block; font-size: 0.95rem; font-weight: 800; letter-spacing: -0.01em; }
.sx-method small { display: block; color: var(--text-muted); font-size: 0.8rem; line-height: 1.4; }
.sx-days { display: flex !important; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-top: 2px; }
.sx-days .wx-led { font-size: 1.05rem; }

.sx-course { margin-top: clamp(36px, 5vw, 56px); }
.sx-course-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 14px 24px; margin-bottom: 8px; }
.sx-course-head h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 800; letter-spacing: -0.035em; }
.lesson-discovery { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.lesson-discovery input[type="search"] { width: min(300px, 100%); min-height: 42px; padding: 9px 14px; border: 1px solid var(--sx-line-2); border-radius: 11px; background: var(--sx-panel); color: var(--text); font-size: 0.9rem; }
.lesson-discovery input[type="search"]:focus { border-color: var(--accent); }
.lesson-topic-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.lesson-topic-filters button, .signs-chip { min-height: 36px; padding: 0 12px; border: 1px solid var(--sx-line-2); border-radius: 999px; background: var(--sx-panel); color: var(--text-muted); font: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.lesson-topic-filters button:hover, .signs-chip:hover { color: var(--text); border-color: var(--text-muted); }
.lesson-topic-filters button[aria-pressed="true"], .signs-chip.is-active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-ring); }
.sx-topic { margin-top: 26px; }
.sx-topic-title { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; color: var(--text-muted); font-size: 0.92rem; font-weight: 700; letter-spacing: 0; }
.sx-topic-title small { font-weight: 600; color: var(--text-muted); opacity: 0.75; }
.sx-lessons { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sx-lesson { display: grid; grid-template-columns: 52px 132px minmax(0, 1fr) 210px; align-items: center; gap: 18px; padding: 14px 18px; border: 1px solid var(--sx-line); border-radius: 16px; background: var(--sx-panel); color: inherit; transition: border-color 0.15s ease, background 0.15s ease; }
.sx-lesson:hover { border-color: var(--sx-accent-line); }
.sx-lesson-num { font-size: 1.6rem; line-height: 1; }
.sx-lesson-art { display: flex; gap: 6px; }
.sx-lesson-art img { width: 40px; height: 40px; object-fit: contain; }
.sx-lesson-copy { display: grid; gap: 3px; min-width: 0; }
.sx-lesson-copy strong { font-size: 1.04rem; font-weight: 800; letter-spacing: -0.015em; line-height: 1.3; }
.sx-lesson-copy small { color: var(--text-muted); font-size: 0.84rem; line-height: 1.45; }
.lesson-meta { color: var(--text-muted); font-size: 0.78rem; opacity: 0.85; }
.sx-lesson-state { display: grid; gap: 7px; justify-items: start; }
.sx-state { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; color: var(--text-muted); box-shadow: inset 0 0 0 1px var(--sx-line-2); }
.sx-state[data-state="progress"] { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-ring); }
.sx-state[data-state="done"] { color: var(--sx-good); background: var(--sx-good-wash); box-shadow: none; }
.sx-state[data-state="review"] { color: var(--sx-bad); background: var(--sx-bad-wash); box-shadow: none; }
.sx-meter { display: block; width: 100%; max-width: 180px; height: 4px; border-radius: 4px; background: var(--sx-line-2); overflow: hidden; }
.sx-meter span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.lesson-result { color: var(--text-muted); font-size: 0.76rem; line-height: 1.35; }
.sx-empty { margin-top: 24px; padding: 28px; border: 1px dashed var(--sx-line-2); border-radius: 16px; display: grid; gap: 14px; justify-items: start; color: var(--text-muted); }
/* After the lessons: the four road sign tests, as cards like the test library. */
.sx-exam { margin-top: clamp(40px, 5vw, 64px); scroll-margin-top: 80px; }
.sx-exam-head { display: grid; gap: 8px; margin-bottom: 18px; }
.sx-exam-head h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; }
.sx-exam-head p { color: var(--text-soft); font-size: 1rem; line-height: 1.6; max-width: 70ch; }
.sx-exam-tests { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; list-style: none; }
.sx-exam-test { display: grid; height: 100%; overflow: hidden; border: 1px solid var(--sx-line-2); border-radius: 18px; background: var(--sx-panel); color: inherit; transition: border-color 0.15s ease, transform 0.15s ease; }
.sx-exam-test:hover { border-color: var(--sx-accent-line); }
.sx-exam-shot { position: relative; display: block; aspect-ratio: 5 / 3; overflow: hidden; background: var(--sx-raised); }
.sx-exam-shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sx-exam-num { position: absolute; left: 12px; top: 10px; color: #fff; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6); }
.sx-exam-copy { display: grid; gap: 4px; padding: 14px 16px 16px; }
.sx-exam-copy strong { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; }
.sx-exam-copy small { color: var(--text-muted); font-size: 0.88rem; }
.sx-exam-score.is-pass { color: var(--sx-good); font-weight: 700; }
.sx-exam-foot { margin-top: 14px; color: var(--text-muted); font-size: 0.9rem; line-height: 1.55; }
.sx-exam-foot a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.sx-catalogue-link { display: flex; align-items: center; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap; margin-top: clamp(36px, 5vw, 56px); padding: 22px 24px; border: 1px solid var(--sx-line); border-radius: 18px; background: var(--sx-panel); }
.sx-catalogue-link h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.sx-catalogue-link p { color: var(--text-muted); font-size: 0.9rem; max-width: 62ch; }

/* ── Lesson player ───────────────────────────────────────────────────────── */
.sl-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 22px; align-items: start; margin-bottom: 22px; }
.sl-number { font-size: clamp(2.6rem, 5vw, 4rem); line-height: 0.9; padding-top: 4px; }
.sl-kicker { color: var(--text-muted); font-size: 0.86rem; font-weight: 600; margin-bottom: 6px; }
.sl-head h1 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.06; }
.sl-focus { color: var(--text-soft); font-size: 1rem; line-height: 1.55; margin-top: 10px; max-width: 64ch; }
.sl-head > .btn-ghost { grid-column: 1 / -1; justify-self: start; margin-bottom: 8px; }

.sl-stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; scroll-margin-top: 72px; }
.sl-stages a { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 9px 12px; border: 1px solid var(--sx-line); border-radius: 14px; background: var(--sx-panel); color: var(--text-muted); transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease; }
.sl-stages a:hover { color: var(--text); border-color: var(--sx-line-2); }
.sl-stages a > span:last-child { display: grid; min-width: 0; }
.sl-stages b { color: var(--text); font-size: 0.9rem; font-weight: 800; letter-spacing: -0.01em; }
.sl-stages small { font-size: 0.74rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-stage-num { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--sx-line-2); font-size: 0.8rem; font-weight: 800; color: var(--text-muted); }
.sl-stages a.is-done .sl-stage-num { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-ring); }
.sl-stages a[aria-current="step"] { border-color: var(--accent-ring); background: linear-gradient(180deg, var(--sx-accent-wash), transparent), var(--sx-panel); }
.sl-stages a[aria-current="step"] .sl-stage-num { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.sl-stages a[aria-disabled="true"] { opacity: 0.55; cursor: default; }

.sl-window { border: 1px solid var(--sx-line-2); border-radius: 22px; background: var(--sx-panel); padding: clamp(18px, 3vw, 32px); }
[data-theme="dark"] .sl-window { box-shadow: 0 44px 90px -40px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.sl-panel + .sl-panel { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--sx-line); }
.sign-lesson.is-player .sl-panel + .sl-panel { margin-top: 0; padding-top: 0; border-top: 0; }
.sl-panel { animation: sl-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes sl-in { from { opacity: 0; transform: translateY(6px); } }
.sl-panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 18px; margin-bottom: 18px; }
.sl-panel-head h2 { font-size: clamp(1.25rem, 2vw, 1.5rem); font-weight: 800; letter-spacing: -0.03em; }
.sl-counter { color: var(--text-muted); font-size: 0.86rem; font-variant-numeric: tabular-nums; max-width: 60ch; }
.sl-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 24px; }
/* The next sign stays one click away even when a road scene makes the card tall. */
.sign-lesson.is-player #lessonRead .sl-actions { position: sticky; bottom: 0; z-index: 5; padding: 14px 0 calc(14px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, transparent, var(--sx-panel) 32%); }

.sl-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.sl-thumb { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 1px solid var(--sx-line); border-radius: 12px; background: var(--sx-ground); cursor: pointer; opacity: 0.62; transition: opacity 0.15s ease, border-color 0.15s ease; }
.sl-thumb img { width: 32px; height: 32px; object-fit: contain; }
.sl-thumb:hover, .sl-thumb.is-seen { opacity: 1; }
.sl-thumb[aria-current="true"] { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.sign-lesson:not(.is-player) .sl-thumbs, .sign-lesson:not(.is-player) .sl-actions:has(#learnNext) { display: none; }

.lesson-notes { display: grid; gap: 28px; }
.sl-sign { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 16px clamp(20px, 3.4vw, 44px); align-items: start; scroll-margin-top: 80px; }
.sl-sign > .sl-sign-art { grid-column: 1; grid-row: 1; }
.sl-sign > .sl-sign-body { grid-column: 2; grid-row: 1 / span 2; }
.sl-sign > .lesson-photo { grid-column: 1; grid-row: 2; margin: 0; }
.sl-sign > .sl-example { grid-column: 2; grid-row: 2; margin: 0; max-width: 680px; }
.sl-sign:has(> .sl-example) > .sl-sign-body { grid-row: 1; }
.sl-sign > .lesson-photo figcaption { font-size: 0.82rem; }
/* An illustrated example: AI-made street, official sign drawing. Always labelled as such. */
.sl-example, .sd-example { display: grid; gap: 8px; }
.sl-example figcaption, .sd-example figcaption { color: var(--text-muted); font-size: 0.78rem; line-height: 1.45; }
.sl-example figcaption b, .sd-example figcaption b { display: block; color: var(--text-soft); font-size: 0.82rem; font-weight: 700; }
.sl-sign-art { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border: 1px solid var(--sx-line); border-radius: 20px; background: var(--sx-ground); }
.sl-sign-art img { width: 70%; height: 70%; object-fit: contain; }
.sl-sign-body { display: grid; gap: 12px; min-width: 0; }
.sl-sign-code { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.sl-sign-da { color: var(--text-muted); font-size: 0.86rem; }
.sl-sign h3 { font-size: clamp(1.45rem, 2.4vw, 1.9rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.12; }
.sl-rows { margin: 4px 0 0; border: 1px solid var(--sx-line-2); border-radius: 16px; background: var(--sx-ground); overflow: hidden; }
.sl-rows > div { padding: 13px 16px; }
.sl-rows > div + div { border-top: 1px solid var(--sx-line); }
.sl-rows dt { color: var(--text-muted); font-size: 0.8rem; font-weight: 700; margin-bottom: 4px; }
.sl-rows dd { margin: 0; color: var(--text-soft); font-size: 1rem; line-height: 1.6; }
.sl-row-mistake dt { display: flex; align-items: center; gap: 7px; }
.sl-row-mistake dt::before { content: "!"; display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 0.7rem; font-weight: 800; box-shadow: inset 0 0 0 1px var(--accent-ring); }
.lesson-detail-link { justify-self: start; color: var(--text-muted); font-size: 0.85rem; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--sx-line-2); }
.lesson-detail-link:hover { color: var(--accent); text-decoration-color: var(--accent); }

.lesson-photo { margin: 4px 0 0; display: grid; gap: 10px; }
.lesson-image-open { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--sx-line); border-radius: 14px; background: var(--sx-raised); overflow: hidden; cursor: zoom-in; }
.lesson-image-open img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 3; object-fit: cover; }
.lesson-image-hint { position: absolute; right: 10px; bottom: 10px; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.62); color: #fff; font-size: 0.76rem; font-weight: 700; }
.lesson-photo figcaption { color: var(--text-muted); font-size: 0.88rem; line-height: 1.55; }

.sl-pills, .sr-pills { display: flex; gap: 4px; }
.sl-pills { margin: -6px 0 18px; }
.sl-pills span, .sr-pills span { flex: 1 1 0; max-width: 46px; height: 5px; border-radius: 5px; background: var(--sx-line-2); transition: background 0.2s ease; }
.sl-pills .is-current, .sr-pills .is-current { background: var(--accent); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 50%, transparent); }
.sl-pills .is-right, .sr-pills .is-right { background: var(--sx-good); }
.sl-pills .is-wrong, .sr-pills .is-wrong { background: var(--sx-bad); }

.sl-recall { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr); gap: clamp(18px, 3vw, 40px); align-items: start; }
.sl-recall-art { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border: 1px solid var(--sx-line); border-radius: 20px; background: var(--sx-ground); }
.sl-recall-art img { width: 70%; height: 70%; object-fit: contain; }
.sl-recall-body { display: grid; gap: 14px; min-width: 0; }
.sl-question, .lesson-question, .sr-question { font-size: clamp(1.12rem, 1.6vw, 1.32rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; }
.sl-options, .lesson-options, .sr-options { display: grid; gap: 8px; }
.sl-option, .lesson-option, .sr-option { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 11px 14px; border: 1px solid var(--sx-line-2); border-radius: 13px; background: var(--sx-ground); color: var(--text); font: inherit; font-size: 0.96rem; line-height: 1.4; text-align: left; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease; }
.sl-option:hover:not(:disabled), .lesson-option:hover:not(:disabled), .sr-option:hover:not(:disabled) { border-color: var(--sx-accent-line); background: var(--sx-accent-wash); }
.sl-option:disabled, .lesson-option:disabled, .sr-option:disabled { cursor: default; }
.lesson-option-key, .option-key { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--sx-line-2); color: var(--text-muted); font-size: 0.78rem; font-weight: 800; }
.sl-option-copy, .lesson-option-copy, .sr-option-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.lesson-option-badge, .sr-verdict { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.is-correct.sl-option, .is-correct.lesson-option, .is-correct.sr-option, .is-correct.sr-image-option { border-color: var(--sx-good); background: var(--sx-good-wash); }
.is-wrong.sl-option, .is-wrong.lesson-option, .is-wrong.sr-option, .is-wrong.sr-image-option { border-color: var(--sx-bad); background: var(--sx-bad-wash); }
.is-correct .lesson-option-badge, .is-correct .sr-verdict, .is-correct .lesson-option-key, .is-correct .option-key { color: var(--sx-good); }
.is-wrong .lesson-option-badge, .is-wrong .sr-verdict, .is-wrong .lesson-option-key, .is-wrong .option-key { color: var(--sx-bad); }
.sl-options:has(.is-correct) .sl-option:not(.is-correct):not(.is-wrong),
.lesson-options:has(.is-correct) .lesson-option:not(.is-correct):not(.is-wrong),
.sr-options:has(.is-correct) .sr-option:not(.is-correct):not(.is-wrong),
.sr-images:has(.is-correct) .sr-image-option:not(.is-correct):not(.is-wrong) { opacity: 0.55; }
/* Exam-style statements: tick the true ones, then check; after checking each row shows whether
   the statement is true and why. */
.lesson-statement-hint { margin: 0; color: var(--text-muted); font-size: 0.88rem; }
.lesson-statements { display: grid; gap: 8px; }
.lesson-statement { grid-template-columns: 24px minmax(0, 1fr); align-items: start; }
.lesson-statement-box { position: relative; width: 22px; height: 22px; margin-top: 1px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--sx-line-2); background: var(--sx-panel); }
.lesson-statement[aria-checked="true"] { border-color: var(--sx-accent-line); background: var(--sx-accent-wash); }
.lesson-statement[aria-checked="true"] .lesson-statement-box { background: var(--accent); box-shadow: none; }
.lesson-statement[aria-checked="true"] .lesson-statement-box::after { content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px; border: solid var(--accent-ink, #fff); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.lesson-statement.is-correct, .lesson-statement.is-correct[aria-checked="true"] { border-color: var(--sx-good); background: var(--sx-good-wash); }
.lesson-statement.is-wrong, .lesson-statement.is-wrong[aria-checked="true"] { border-color: var(--sx-bad); background: var(--sx-bad-wash); }
.lesson-statement.is-correct .lesson-option-badge, .lesson-statement.is-wrong .lesson-option-badge { color: var(--text-soft); }
.lesson-statement-why { flex-basis: 100%; color: var(--text-soft); font-size: 0.86rem; line-height: 1.45; }
.sl-why, .lesson-answer, .sr-why { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--sx-line); border-radius: 14px; background: var(--sx-raised); color: var(--text-soft); font-size: 0.94rem; line-height: 1.55; }
.sl-why strong, .lesson-answer strong, .sr-why-verdict { font-size: 0.98rem; font-weight: 800; }
.is-correct.sl-why strong, .lesson-answer.is-correct strong, .sr-why.is-correct .sr-why-verdict { color: var(--sx-good); }
.is-wrong.sl-why strong, .lesson-answer.is-wrong strong, .sr-why.is-wrong .sr-why-verdict { color: var(--sx-bad); }
.sl-why-name { color: var(--text); font-weight: 700; }
.sl-why-mistake { color: var(--text-soft); }
.sl-why-mistake::before { content: "! "; color: var(--accent); font-weight: 800; }
.sl-recall-body > .sx-btn, .sl-situation-body > .sx-btn { justify-self: start; }
.sl-recall-summary { display: grid; gap: 12px; justify-items: start; }
.sl-recall-score { font-size: clamp(3rem, 6vw, 4.4rem); line-height: 1; }
.sl-recall-copy { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; }
.sl-missed { display: flex; flex-wrap: wrap; gap: 8px; }
.sl-missed-item { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 14px 6px 8px; border: 1px solid var(--sx-line-2); border-radius: 12px; background: var(--sx-ground); color: var(--text); font: inherit; font-size: 0.88rem; cursor: pointer; }
.sl-missed-item:hover { border-color: var(--sx-accent-line); }
.sl-missed-item img { width: 32px; height: 32px; object-fit: contain; }
.sl-recall-summary .sl-actions { justify-content: flex-start; }

.lesson-compare { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 16px 28px; align-items: center; padding: 18px 20px; border: 1px solid var(--sx-line); border-radius: 16px; background: var(--sx-ground); }
.lesson-compare + .lesson-compare, .lesson-compare + .lesson-photo { margin-top: 12px; }
.lesson-compare-signs { display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; }
.lesson-compare-signs a { display: grid; justify-items: center; gap: 4px; width: 112px; padding: 10px 6px; border-radius: 12px; color: inherit; text-align: center; }
.lesson-compare-signs a:hover, .lesson-compare-signs a[aria-current="page"] { background: var(--sx-accent-wash); }
.lesson-compare-signs img { width: 72px; height: 72px; object-fit: contain; }
.lesson-compare-signs small { color: var(--text-muted); font-size: 0.74rem; line-height: 1.3; }
.lesson-compare > p { color: var(--text-soft); font-size: 1rem; line-height: 1.6; }

.lesson-counter { color: var(--text-muted); font-size: 0.86rem; font-weight: 600; margin-bottom: 14px; }
.sl-situation { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(18px, 3vw, 36px); align-items: start; }
.sl-situation:has(.lesson-quiz-art) { grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); }
.lesson-quiz-art { width: 100%; max-width: 190px; aspect-ratio: 1; object-fit: contain; padding: 18%; border: 1px solid var(--sx-line); border-radius: 20px; background: var(--sx-ground); }
.sl-situation-body { display: grid; gap: 14px; min-width: 0; }
.lesson-save-state { margin-top: 18px; color: var(--text-muted); font-size: 0.8rem; }
.sl-done { display: grid; gap: 14px; justify-items: start; color: var(--text-soft); }

.sl-result-scores { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.sl-score-card { display: grid; align-content: start; gap: 6px; padding: 16px 18px; border: 1px solid var(--sx-line); border-radius: 16px; background: var(--sx-ground); }
.sl-score-card .lesson-kicker { color: var(--text-muted); font-size: 0.8rem; font-weight: 700; }
.sl-score-card .wx-led { font-size: clamp(2.2rem, 4vw, 3rem); line-height: 1.05; }
.sl-score-empty { opacity: 0.5; }
.sl-score-copy { color: var(--text-muted); font-size: 0.86rem; }
.lesson-reviewed-score { color: var(--sx-good); font-size: 0.86rem; font-weight: 700; }
.lesson-summary-copy { color: var(--text-soft); font-size: 1rem; max-width: 62ch; }
.lesson-mistakes { display: grid; gap: 8px; margin-top: 16px; }
.lesson-mistake { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--wrong) 45%, transparent); border-radius: 14px; background: var(--sx-bad-wash); }
.lesson-mistake.is-reviewed { border-color: color-mix(in srgb, var(--correct) 45%, transparent); background: var(--sx-good-wash); }
.lesson-mistake .lesson-kicker { font-size: 0.76rem; font-weight: 800; color: var(--sx-bad); }
.lesson-mistake.is-reviewed .lesson-kicker { color: var(--sx-good); }
.lesson-mistake h3 { font-size: 1rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.4; }
.lesson-mistake p { color: var(--text-soft); font-size: 0.92rem; }
.lesson-mistake .sl-text-button { justify-self: start; padding: 2px 0; min-height: 32px; }
#lessonResultStage .lesson-actions { justify-content: flex-start; align-items: center; }
.lesson-summary-next { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--sx-line); }
.lesson-summary-next .lesson-kicker { color: var(--text-muted); font-size: 0.86rem; font-weight: 700; }

.sl-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.sl-pager a { display: grid; gap: 2px; padding: 14px 18px; border: 1px solid var(--sx-line); border-radius: 14px; background: var(--sx-panel); color: inherit; min-width: 0; }
.sl-pager a:hover { border-color: var(--sx-accent-line); }
.sl-pager a.is-next { text-align: right; grid-column: 2; }
.sl-pager small { color: var(--text-muted); font-size: 0.78rem; }
.sl-pager span { font-weight: 700; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-sources { margin-top: 16px; color: var(--text-muted); font-size: 0.84rem; }
.lesson-sources summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; }
.lesson-sources p { margin-top: 6px; line-height: 1.6; }
.lesson-sources a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ── Review ──────────────────────────────────────────────────────────────── */
/* One room, like the test room: a slim bar with the title and progress, then the question at the
   top of the panel. The sign (or the meaning to match) sits on the left, the question and answers
   on the right; type is larger than in the lesson player because this is read at arm's length. */
.sr-room { border: 1px solid var(--sx-line-2); border-radius: 22px; background: var(--sx-panel); overflow: hidden; }
[data-theme="dark"] .sr-room { box-shadow: 0 44px 90px -40px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.sr-roombar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 28px; padding: 16px clamp(18px, 3vw, 34px); border-bottom: 1px solid var(--sx-line); }
.sr-roomtitle { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; min-width: 0; }
.sr .sr-roomtitle h1 { margin: 0; font-size: clamp(1.25rem, 1.7vw, 1.5rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; }
.sr-scope { color: var(--text-muted); font-size: 0.98rem; line-height: 1.45; }
.sr-progress { display: flex; align-items: center; gap: 14px; color: var(--text-muted); font-size: 0.98rem; font-variant-numeric: tabular-nums; }
.sr-progress:has(.sr-counter:empty) { display: none; }
.sr-progress .sr-pills { width: clamp(110px, 16vw, 220px); }
.sr-counter, .sr-score { color: var(--text); font-weight: 700; white-space: nowrap; }
.sr-score:empty { display: none; }
.sr-stage { padding: clamp(22px, 3.2vw, 42px) clamp(18px, 3.2vw, 42px) clamp(26px, 3.6vw, 46px); min-height: 380px; }

.sr-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(22px, 3.6vw, 52px); align-items: start; }
.sr-card--name { grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr); }
.sr-prompt, .sr-answers { display: grid; gap: 18px; align-content: start; min-width: 0; }
.sr .sr-question { font-size: clamp(1.55rem, 2.3vw, 2.1rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.12; text-wrap: balance; }
.sr .sr-art { display: flex; align-items: center; justify-content: center; width: 100%; max-width: 440px; aspect-ratio: 1; margin: 0; border: 1px solid var(--sx-line); border-radius: 22px; background: var(--sx-ground); }
.sr .sr-art img { width: 70%; height: 70%; object-fit: contain; }
.sr-description { margin: 0; padding: clamp(18px, 2vw, 26px); border: 1px solid var(--sx-line-2); border-radius: 18px; background: var(--sx-ground); color: var(--text); font-size: clamp(1.15rem, 1.55vw, 1.38rem); line-height: 1.5; }
.sr-description--name { font-size: clamp(1.45rem, 2.1vw, 1.85rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.22; }
.sr .sr-options { gap: 10px; }
.sr .sr-option { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 14px; min-height: 66px; padding: 14px 18px; border-radius: 16px; font-size: clamp(1.05rem, 1.25vw, 1.18rem); line-height: 1.4; }
.sr .sr-option .sr-verdict { grid-column: 3; white-space: nowrap; }
.sr .option-key { width: 32px; height: 32px; border-radius: 9px; font-size: 0.9rem; }
.sr-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sr-image-option { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: clamp(150px, 15vw, 196px); padding: 22px 10px 14px; border: 1px solid var(--sx-line-2); border-radius: 18px; background: var(--sx-ground); cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease; }
.sr-image-option:hover:not(:disabled) { border-color: var(--sx-accent-line); background: var(--sx-accent-wash); }
.sr-image-option:disabled { cursor: default; }
.sr-image-option img { width: clamp(92px, 9vw, 128px); height: clamp(92px, 9vw, 128px); object-fit: contain; }
.sr-image-option .option-key { position: absolute; top: 10px; left: 10px; }
.sr-image-option .sr-verdict { font-size: 0.72rem; }
.sr .sr-why { gap: 10px; padding: 18px 20px; border-radius: 16px; font-size: 1.02rem; line-height: 1.6; }
.sr .sr-why-verdict { font-size: 1.12rem; }
.sr-why-head { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: 1.06rem; }
.sr-why-head img { width: 48px; height: 48px; object-fit: contain; }
.sr-why-head .explain-code { color: var(--accent); font-weight: 800; font-size: 0.86rem; letter-spacing: 0.05em; }
.sr-why-row b { color: var(--text); }
.sr-why-da { color: var(--text-muted); font-size: 0.9rem; }
.sr-why-link { justify-self: start; color: var(--accent); font-size: 0.92rem; text-decoration: underline; text-underline-offset: 3px; }
.sr-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sr .sr-actions .sx-btn { min-height: 54px; padding: 0 28px; font-size: 1rem; }

/* The result, read like a test result. */
.sr-summary { display: grid; gap: 18px; }
.sr-summary-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px clamp(20px, 3vw, 40px); }
.summary-score { color: var(--accent); font-size: clamp(3.4rem, 6vw, 4.8rem); font-weight: 800; letter-spacing: -0.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.sr .summary-line { font-size: clamp(1.5rem, 2.2vw, 2rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.sr-summary-copy { margin-top: 4px; color: var(--text-soft); font-size: 1.05rem; }
.sr-summary-label { color: var(--text-muted); font-size: 0.92rem; font-weight: 700; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.summary-item { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--sx-line-2); border-radius: 14px; background: var(--sx-ground); color: inherit; }
.summary-item:hover { border-color: var(--sx-accent-line); }
.summary-item.is-correct { border-color: color-mix(in srgb, var(--sx-good) 50%, transparent); }
.summary-item.is-wrong { border-color: color-mix(in srgb, var(--sx-bad) 60%, transparent); background: var(--sx-bad-wash); }
.summary-item img { width: 52px; height: 52px; object-fit: contain; }
.summary-item-copy { display: grid; gap: 3px; min-width: 0; color: var(--text-soft); font-size: 0.92rem; line-height: 1.35; }
.summary-item-verdict { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.summary-item.is-correct .summary-item-verdict { color: var(--sx-good); }
.summary-item.is-wrong .summary-item-verdict { color: var(--sx-bad); }
.sr-tests-link { font-size: 1rem; }

/* Under the room: plain facts and settings, out of the reading path. */
.sr-foot { display: grid; justify-items: start; gap: 6px; margin-top: 18px; }
.sr-facts { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 0; padding: 0; list-style: none; color: var(--text-muted); font-size: 0.95rem; }
.sr-facts b { color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; }
.sr-sync { min-height: 1.2em; color: var(--text-muted); font-size: 0.84rem; }
.sr-sync:empty { display: none; }
.sr-hint { color: var(--text-muted); font-size: 0.86rem; line-height: 1.55; max-width: 72ch; }
.sr-keys { color: var(--text-muted); font-size: 0.8rem; }
.sr-settings { margin-top: 8px; color: var(--text-muted); font-size: 0.86rem; }
.sr-settings summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; }
.sr-settings p { margin: 4px 0 10px; }

/* ── Catalogue ───────────────────────────────────────────────────────────── */
.sc-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 36px; margin-bottom: 24px; }
.sc-toolbar { position: sticky; top: 60px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 0; background: var(--bg); border-bottom: 1px solid var(--sx-line); }
.signs-search { flex: 1 1 260px; min-height: 44px; padding: 10px 14px; border: 1px solid var(--sx-line-2); border-radius: 12px; background: var(--sx-panel); color: var(--text); font-size: 0.95rem; }
.signs-search:focus { border-color: var(--accent); }
.sc-check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 0.86rem; color: var(--text-soft); cursor: pointer; }
.sc-check input { width: 18px; height: 18px; padding: 0; accent-color: var(--accent); }
.signs-chips { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.signs-chip small { margin-left: 4px; font-weight: 600; opacity: 0.7; }
.sc-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 6px; color: var(--text-muted); font-size: 0.78rem; }
.sc-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.sc-legend .sc-dot { display: inline-block; }
.sc-tag, .sc-tag-sample { display: inline-block; padding: 1px 7px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--sx-line-2); color: var(--text-muted); font-size: 0.66rem; font-style: normal; font-weight: 700; line-height: 1.6; }
.signs-group { margin-top: 30px; }
.signs-group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 4px; }
.signs-group-title { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em; }
.sc-group-code { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; margin-right: 4px; padding: 0 6px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 0.9rem; vertical-align: 2px; }
.signs-group-count { color: var(--text-muted); font-size: 0.82rem; }
.signs-group-note { color: var(--text-muted); font-size: 0.9rem; line-height: 1.55; max-width: 74ch; margin-bottom: 14px; }
.signs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.sign-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px 12px; border: 1px solid var(--sx-line); border-radius: 14px; background: var(--sx-panel); color: inherit; text-align: center; transition: border-color 0.15s ease; }
.sign-card:hover { border-color: var(--sx-accent-line); }
.sign-card img { width: 64px; height: 64px; object-fit: contain; }
.sign-card .sc-dot { position: absolute; top: 9px; right: 9px; }
.sign-card-code { font-size: 0.82rem; font-weight: 800; }
.sign-card-name { color: var(--text-muted); font-size: 0.76rem; line-height: 1.35; }
.signs-empty { padding: 40px 0; text-align: center; color: var(--text-muted); }
.facts-source { color: var(--text-muted); font-size: 0.84rem; line-height: 1.6; }

/* ── A sign's page ───────────────────────────────────────────────────────── */
.sd-card { display: grid; grid-template-columns: minmax(200px, 320px) minmax(0, 1fr); gap: clamp(22px, 4vw, 52px); align-items: start; }
.sd-art { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border: 1px solid var(--sx-line-2); border-radius: 22px; background-color: var(--sx-panel);
}
.sd-art img { width: 72%; height: 72%; object-fit: contain; }
.sd-body { display: grid; gap: 14px; min-width: 0; }
.sd-code { color: var(--text-muted); font-size: 0.86rem; }
.sign-name { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.sign-danish { color: var(--text-muted); font-size: 0.95rem; }
.sd-label { display: inline-block; margin-right: 6px; color: var(--text); font-size: 0.76rem; font-weight: 800; }
.sd-status { display: inline-flex; align-items: center; gap: 9px; justify-self: start; min-height: 30px; padding: 0 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--sx-line-2); color: var(--text-soft); font-size: 0.84rem; font-weight: 600; }
.sd-status[data-state="new"] .sc-dot { display: inline-block; box-shadow: inset 0 0 0 2px var(--sx-line-2); }
.sd-status .sc-dot { display: inline-block; }
.sd-status[data-state="learning"] .sc-dot { box-shadow: inset 0 0 0 2px var(--accent); }
.sd-status[data-state="learned"] .sc-dot { background: var(--sx-good); }
.sd-status[data-state="due"] .sc-dot { background: var(--accent); }
.sd-rows { margin-top: 0; }
.sd-source { color: var(--text-muted); font-size: 0.82rem; line-height: 1.6; }
.sd-source a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.sd-unchecked { display: grid; gap: 6px; padding: 16px 18px; border: 1px dashed var(--sx-line-2); border-radius: 16px; background: var(--sx-raised); }
.sd-unchecked h2 { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; }
.sd-unchecked p { color: var(--text-soft); font-size: 0.94rem; line-height: 1.6; }
.sign-note { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }
.sign-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.sd-section { margin-top: clamp(32px, 4vw, 48px); }
.sd-section > h2, .related-title { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.025em; margin-bottom: 14px; }
.sd-lessons { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sd-lessons a { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px; border: 1px solid var(--sx-line); border-radius: 14px; background: var(--sx-panel); color: inherit; font-weight: 700; }
.sd-lessons a:hover { border-color: var(--sx-accent-line); }
.sd-lessons .wx-led { font-size: 1.3rem; }
.sd-scene { margin-left: 0; margin-right: 0; display: grid; gap: 10px; }
.sd-scene img { width: 100%; height: auto; aspect-ratio: 5 / 3; object-fit: cover; border: 1px solid var(--sx-line); border-radius: 18px; background: var(--sx-raised); }
.sd-scene figcaption { color: var(--text-muted); font-size: 0.9rem; line-height: 1.55; max-width: 72ch; }
.related-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.related-head .related-title { margin-bottom: 12px; }
.related-hint { color: var(--text-muted); font-size: 0.86rem; }

/* ── Narrow screens ──────────────────────────────────────────────────────── */
@media (max-width: 1020px) {
  .sx-hub-head { grid-template-columns: 1fr; align-items: start; }
  .sx-method { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sx-method li, .sx-method li + li { padding: 14px 12px 14px 0; border-left: 0; }
  .sx-method li:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--sx-line); }
  .sx-method li:nth-child(n+3) { border-top: 1px solid var(--sx-line); }
  .sx-method-days { grid-column: 1 / -1; padding-left: 0 !important; border-left: 0 !important; }
  .sx-lesson { grid-template-columns: 44px minmax(0, 1fr) 170px; }
  .sx-lesson-art { display: none; }
  .sr-card, .sr-card--name { grid-template-columns: 1fr; }
  .sr .sr-art { width: min(240px, 60vw); justify-self: center; }
}
@media (max-width: 760px) {
  .sx { width: calc(100% - 28px); padding-top: 14px; }
  .sx-topline { gap: 8px; }
  .sx-topline .learning-home { display: none; }
  .sl-thumbs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 5px; }
  .sl-thumb { flex: 0 0 42px; width: 42px; height: 42px; }
  .sl-thumb img { width: 28px; height: 28px; }
  .sx-lesson { grid-template-columns: 38px minmax(0, 1fr); gap: 10px 12px; padding: 14px; }
  .sx-lesson-num { font-size: 1.35rem; padding-top: 2px; align-self: start; }
  .sx-lesson-copy small { display: none; }
  .sx-lesson-state { grid-column: 2; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 10px; }
  .sx-lesson-state .lesson-result { grid-column: 1 / -1; }
  .sx-course-head { align-items: stretch; }
  .lesson-discovery, .lesson-discovery input[type="search"] { width: 100%; }
  .lesson-topic-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin-right: -14px; padding-right: 14px; scrollbar-width: none; }
  .sl-head { grid-template-columns: 1fr; margin-bottom: 16px; }
  .sl-number { display: none; }
  .sl-stages { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .sl-stages a { flex-direction: column; justify-content: center; gap: 4px; min-height: 60px; padding: 6px 2px; text-align: center; border-radius: 12px; }
  .sl-stages b { font-size: 0.72rem; }
  .sl-stages small { display: none; }
  .sl-stage-num { width: 24px; height: 24px; flex-basis: 24px; font-size: 0.72rem; }
  .sl-window { padding: 16px; border-radius: 18px; }
  .sl-sign, .sl-recall, .sl-situation, .sl-situation:has(.lesson-quiz-art), .sd-card { grid-template-columns: 1fr; }
  .sl-sign { grid-template-rows: none; }
  .sl-sign > .sl-sign-art, .sl-sign > .sl-sign-body, .sl-sign > .lesson-photo, .sl-sign > .sl-example { grid-column: 1; grid-row: auto; }
  .sl-sign-art, .sl-recall-art { width: min(156px, 44vw); justify-self: center; }
  .lesson-quiz-art { max-width: 140px; justify-self: center; }
  .sd-art { width: min(220px, 62vw); justify-self: center; }
  .sign-lesson.is-player #lessonRead .sl-actions { position: sticky; bottom: 0; z-index: 5; margin: 18px -16px -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, transparent, var(--sx-panel) 28%); }
  .sl-actions { justify-content: stretch; }
  .sl-actions > * { flex: 1 1 140px; }
  .sl-result-scores { grid-template-columns: 1fr; }
  .sl-score-card { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 14px; }
  .sl-score-card .lesson-kicker { grid-column: 1 / -1; }
  .sl-score-card .wx-led { grid-row: span 2; }
  .lesson-compare { grid-template-columns: 1fr; padding: 14px; }
  .lesson-compare-signs { justify-content: center; }
  .lesson-compare-signs a { width: calc(50% - 5px); max-width: 130px; }
  .sl-pager { grid-template-columns: 1fr; }
  .sl-pager a.is-next { grid-column: 1; }
  .sr-room { border-radius: 18px; }
  .sr-roombar { padding: 12px 16px; }
  .sr-progress { width: 100%; gap: 10px; }
  .sr-progress .sr-pills { flex: 1; width: auto; }
  .sr-stage { padding: 18px 16px 20px; min-height: 0; }
  .sr .sr-question { font-size: clamp(1.3rem, 6vw, 1.55rem); }
  .sr .sr-art { width: min(200px, 56vw); }
  .sr .sr-option { grid-template-columns: 28px minmax(0, 1fr); min-height: 58px; padding: 12px 14px; font-size: 1.04rem; }
  .sr .sr-option .sr-verdict { grid-column: 2; }
  .sr .option-key { width: 28px; height: 28px; font-size: 0.82rem; }
  .sr-image-option { min-height: 136px; padding: 34px 10px 12px; }
  .sr-image-option img { width: 76px; height: 76px; }
  .sr-actions > * { flex: 1 1 160px; }
  .sr-summary-head { gap: 6px 18px; }
  .sc-toolbar { top: 60px; }
  .signs-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .signs-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
  .sign-card { padding: 14px 6px 10px; }
  .sign-card img { width: 54px; height: 54px; }
  .sx-catalogue-link { padding: 18px; }
}
@media (max-width: 420px) {
  .sx-hub-intro h1, .sc-head h1 { font-size: clamp(2rem, 9vw, 2.4rem); }
  .sx .wx-gantry { width: 100%; flex-wrap: nowrap; }
  .sx .wx-gantry li { min-width: 0; flex: 1 1 0; padding: 12px; }
  .sx .wx-gantry .wx-led { font-size: 1.6rem; }
  .sx-method { grid-template-columns: 1fr; }
  .sx-method li:nth-child(even) { padding-left: 0; border-left: 0; }
  .sx-method li:nth-child(n+2) { border-top: 1px solid var(--sx-line); }
}
@media (hover: none) { .sr-keys { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .sl-panel { animation: none; }
  .sx-meter span { transition: none; }
}

/* Phone pass (22 Oct 2026). The owner found the sign pages awkward on a phone. Less above the
   content (smaller headings, no method strip, no lesson lede while studying), compact lesson rows,
   and a solid action bar whose Next button stays on one line. */
@media (max-width: 760px) {
  .sx { padding-top: 10px; padding-bottom: 56px; }
  .sx-topline { padding-bottom: 10px; margin-bottom: 14px; }
  .sx-hub-intro h1, .sc-head h1 { font-size: clamp(1.8rem, 7.6vw, 2.1rem); margin-bottom: 8px; }
  .sx-lede { font-size: 0.96rem; line-height: 1.55; }
  .sx-gantry { margin-top: 16px; }
  .sx-method { display: none; }
  .sx-course { margin-top: 28px; }
  .sx-lesson { grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; padding: 10px 12px; border-radius: 14px; }
  .sx-lesson-state { grid-column: 3; grid-row: 1; display: grid; grid-template-columns: auto; justify-items: end; gap: 3px; }
  .sx-lesson-state .sx-meter { display: none; }
  .sx-lesson-num { font-size: 1.1rem; padding-top: 3px; }
  .sx-lesson-copy strong { font-size: 0.98rem; }
  .sx-lesson-copy .lesson-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sx-lesson-state .lesson-result { grid-column: auto; font-size: 0.72rem; white-space: nowrap; }
  .sx-lesson-state .lesson-result:empty { display: none; }
  .sx-state { min-height: 22px; padding: 0 8px; font-size: 0.72rem; }
  .sx-exam-tests { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sx-exam-copy { padding: 10px 12px 12px; }
  .sx-exam-copy strong { font-size: 0.92rem; }
  .sx-exam-copy small { font-size: 0.78rem; }
  .sx-exam-num { font-size: 1.25rem; left: 10px; top: 8px; }
  .sl-head { margin-bottom: 12px; }
  .sl-kicker { font-size: 0.8rem; margin-bottom: 2px; }
  .sl-head h1 { font-size: clamp(1.4rem, 6.2vw, 1.7rem); }
  .sign-lesson.is-player .sl-focus { display: none; }
  .sl-stages { margin-bottom: 10px; }
  .sl-stages a { min-height: 54px; }
  .sl-panel-head { margin-bottom: 12px; }
  .sign-lesson.is-player #lessonRead .sl-actions { padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--sx-line); background: var(--sx-panel); flex-wrap: nowrap; }
  #learnPrev { flex: 0 0 auto; padding: 0 16px; }
  #learnNext { flex: 1 1 auto; white-space: nowrap; }
  #lessonQuiz .sl-panel-head .sl-counter { display: none; }
  #lessonCheck { width: 100%; }
}
/* On touch screens a tapped answer keeps its hover look, which reads as "selected". Only real
   selections and verdicts may colour an answer there. */
@media (hover: none) {
  .sl-option:hover:not(:disabled):not([aria-checked="true"]):not(.is-correct):not(.is-wrong),
  .lesson-option:hover:not(:disabled):not([aria-checked="true"]):not(.is-correct):not(.is-wrong),
  .sr-option:hover:not(:disabled):not(.is-correct):not(.is-wrong),
  .sr-image-option:hover:not(:disabled):not(.is-correct):not(.is-wrong) { border-color: var(--sx-line-2); background: var(--sx-ground); }
}
