/* ==========================================================================
   Raahaao — learning platform

   Loaded AFTER css/site.css, which supplies the colour, type and radius
   tokens. Nothing here redefines the brand; it reuses it in a different
   shape.

   The marketing site is a wide, scrolling document that sells. This is an
   application: a fixed rail, a working surface, and typography tuned for
   reading the same page for twenty minutes rather than skimming it once.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. App-scoped tokens
   -------------------------------------------------------------------------- */
:root {
  --rail-w: 264px;
  --reader-measure: 68ch;
  --app-gap: clamp(1.25rem, 3vw, 2.5rem);
  --ring-track: var(--border);
}

/* Gurmukhi needs its own stack, and a little more line height to breathe. */
:root[data-lang="pa"] body {
  font-family: var(--font-gurmukhi);
  line-height: 1.85;
}

/* --------------------------------------------------------------------------
   2. Shell
   -------------------------------------------------------------------------- */
body.learn {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  margin: 0;
}

.app {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* The shell (top bar, scrim, rail) is injected by app.js into one container.
   display:contents dissolves that container so its children still lay out as
   direct grid items of .app. */
#shell { display: contents; }

/* -- the rail ------------------------------------------------------------- */
.rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 1rem;
  background: var(--bg-raised);
  border-right: 1px solid var(--border);
  z-index: var(--z-header);
}

.rail__brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.25rem 0.5rem;
  color: var(--heading);
  text-decoration: none;
}
.rail__brand svg { width: 28px; height: 28px; color: var(--accent); flex: none; }
.rail__brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.rail__brand-name {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}
.rail__brand-sub {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.rail__nav { display: flex; flex-direction: column; gap: 0.125rem; }
.rail__nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background-color 0.15s var(--ease-out), color 0.15s var(--ease-out);
}
.rail__nav a svg { width: 18px; height: 18px; flex: none; }
.rail__nav a:hover { background: var(--surface); color: var(--text); }
.rail__nav a[aria-current="page"] {
  background: var(--surface-2);
  color: var(--heading);
}
/* The stepped-path motif reappears as the active marker, tying the app back
   to the logo without repeating the logo. */
.rail__nav a[aria-current="page"] {
  box-shadow: inset 3px 0 0 var(--accent);
}

.rail__spacer { flex: 1 1 auto; }

.rail__foot { display: flex; flex-direction: column; gap: 0.75rem; }
.rail__tools { display: flex; align-items: center; gap: 0.375rem; }

.lang-pick {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 2px;
  flex: 1 1 auto;
}
.lang-pick button {
  flex: 1 1 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  padding: 0.3125rem 0.25rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 0.15s var(--ease-out), color 0.15s var(--ease-out);
}
.lang-pick button:hover { color: var(--text); }
.lang-pick button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 17px; height: 17px; }

.rail__signout {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.875rem;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: start;
}
.rail__signout:hover { background: var(--surface); color: var(--text); }
.rail__signout svg { width: 17px; height: 17px; flex: none; }

/* -- main ----------------------------------------------------------------- */
.main { min-width: 0; padding: var(--app-gap); }
.main__inner { max-width: 1000px; margin: 0 auto; }

.page-head { margin-bottom: 2rem; }
.page-head h1 {
  font-size: clamp(1.625rem, 3.5vw, 2.125rem);
  margin: 0 0 0.375rem;
  letter-spacing: -0.02em;
}
.page-head p { color: var(--muted); margin: 0; }

.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 0.875rem;
  font-weight: 600;
}
:root[data-lang="pa"] .section-label { letter-spacing: 0.06em; }

/* -- mobile top bar ------------------------------------------------------- */
.topbar { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }

  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: var(--z-header);
  }

  .rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(85vw, var(--rail-w));
    transform: translateX(-100%);
    transition: transform 0.28s var(--ease-out);
    z-index: var(--z-nav);
    box-shadow: var(--shadow);
  }
  .rail[data-open="true"] { transform: translateX(0); }

  .rail-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s var(--ease-out);
    z-index: calc(var(--z-nav) - 1);
  }
  .rail-scrim[data-open="true"] { opacity: 1; pointer-events: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .rail, .rail-scrim { transition: none; }
}

/* --------------------------------------------------------------------------
   3. Auth screen — deliberately unlike both the app and the marketing site
   -------------------------------------------------------------------------- */
.auth {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

.auth__brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 5vw, 3.5rem);
  background:
    radial-gradient(120% 90% at 12% 8%, rgba(246, 161, 30, 0.16), transparent 62%),
    var(--bg-raised);
  border-right: 1px solid var(--border);
}
.auth__brand-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--heading);
  text-decoration: none;
  position: relative;
  z-index: 1;
}
.auth__brand-top svg { width: 34px; height: 34px; color: var(--accent); }
.auth__brand-top span {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  font-family: var(--font-latin);
}
.auth__pitch { position: relative; z-index: 1; max-width: 30ch; }
.auth__pitch h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 0.75rem;
  color: var(--heading);
}
.auth__pitch p { color: var(--muted); margin: 0; font-size: 1.0625rem; }
.auth__foot {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 0.8125rem;
}
.auth__foot a { color: var(--muted); }

/* Oversized stepped path, bled off the corner — the logo used as landscape. */
.auth__motif {
  position: absolute;
  right: -14%;
  bottom: -12%;
  width: 78%;
  max-width: 560px;
  color: var(--motif-faint);
  pointer-events: none;
}

.auth__panel {
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 5vw, 3rem);
  background: var(--bg);
}
.auth__card { width: 100%; max-width: 380px; }
.auth__card h1 {
  font-size: 1.625rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}
.auth__card > p.lede { color: var(--muted); margin: 0 0 1.75rem; }

.auth__switch {
  margin-top: 1.5rem;
  font-size: 0.9375rem;
  color: var(--muted);
  text-align: center;
}
.auth__switch button {
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand { display: none; }
  .auth__panel { align-items: start; padding-top: 2.5rem; }
  /* The brand panel is hidden at this width, so the mark comes back inline
     above the form (markup in index.html) to keep the page identifiable. */
  .auth__mark { display: block; }
}

.auth__mark {
  display: none;
  width: 40px;
  height: 40px;
  margin: 0 auto 1.25rem;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   4. Forms
   -------------------------------------------------------------------------- */
.field { margin-bottom: 1.125rem; }
.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4375rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.6875rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 1rem;   /* 16px stops iOS zooming on focus */
  transition: border-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(246, 161, 30, 0.22);
}
.field input[aria-invalid="true"] { border-color: var(--err); }
.field__hint { font-size: 0.8125rem; color: var(--muted); margin: 0.375rem 0 0; }
.field__row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.field__row a { font-size: 0.8125rem; }

.btn-block { width: 100%; justify-content: center; }

.form-msg {
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  margin-bottom: 1.125rem;
  border: 1px solid transparent;
}
.form-msg[data-tone="error"] {
  background: color-mix(in srgb, var(--err) 12%, transparent);
  border-color: color-mix(in srgb, var(--err) 40%, transparent);
  color: var(--err);
}
.form-msg[data-tone="ok"] {
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  border-color: color-mix(in srgb, var(--ok) 40%, transparent);
  color: var(--ok);
}
.form-msg[data-tone="info"] {
  background: var(--surface);
  border-color: var(--border);
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   5. Cards, course grid, progress rings
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.course-card {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s var(--ease-out), transform 0.18s var(--ease-out);
}
.course-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
  .course-card:hover { transform: none; }
}

.course-card__top { display: flex; align-items: flex-start; gap: 1rem; }
.course-card__title {
  margin: 0 0 0.1875rem;
  font-size: 1.0625rem;
  line-height: 1.3;
  color: var(--heading);
}
.course-card__sub {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.45;
}
.course-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: auto;
  padding-top: 0.25rem;
}

/* Progress ring — an SVG donut. Uses stroke-dasharray so it animates cheaply
   and reads accurately at any size. */
.ring { --size: 46px; width: var(--size); height: var(--size); flex: none; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring__track { fill: none; stroke: var(--ring-track); stroke-width: 4; }
.ring__value {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dasharray 0.5s var(--ease-out);
}
.ring__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-latin);
}
.ring[data-complete="true"] .ring__value { stroke: var(--ok); }

/* Slim bar used in lists where a ring would be too loud. */
.bar {
  height: 5px;
  background: var(--ring-track);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
/* Scaled rather than resized: transform is composited, width is not, and the
   parent's overflow:hidden keeps the rounded ends. JS sets scaleX(0…1). */
.bar span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.5s var(--ease-out);
}
@media (prefers-reduced-motion: reduce) {
  .bar span, .ring__value { transition: none; }
}

.pill {
  display: inline-block;
  padding: 0.1875rem 0.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--border-strong);
  color: var(--muted);
}
.pill[data-tone="free"] {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  color: var(--accent);
}
.pill[data-tone="done"] {
  border-color: color-mix(in srgb, var(--ok) 50%, transparent);
  color: var(--ok);
}

/* -- language switcher (course page, owned subjects with 2+ variants) ----- */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.75rem 0 1.5rem;
}
.lang-switch a.pill {
  text-decoration: none;
  cursor: pointer;
}
.lang-switch a.pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* -- continue banner ------------------------------------------------------ */
.continue {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent 62%),
    var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
  margin-bottom: 2rem;
}
.continue__body { flex: 1 1 260px; min-width: 0; }
.continue__eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 0.3125rem;
}
.continue h2 {
  margin: 0 0 0.1875rem;
  font-size: 1.1875rem;
  line-height: 1.3;
  color: var(--heading);
}
.continue p { margin: 0; color: var(--muted); font-size: 0.875rem; }

/* --------------------------------------------------------------------------
   6. Course outline
   -------------------------------------------------------------------------- */
.module { margin-bottom: 1.75rem; }
.module__head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.625rem;
}
.module__head h2 { margin: 0; font-size: 1.0625rem; color: var(--heading); }
.module__count { font-size: 0.8125rem; color: var(--muted); margin-inline-start: auto; }
.module__summary { margin: 0 0 0.875rem; color: var(--muted); font-size: 0.9375rem; }

.lesson-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.lesson-list li + li { border-top: 1px solid var(--border); }

.lesson-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.125rem;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s var(--ease-out);
}
a.lesson-row:hover { background: var(--surface-2); }
.lesson-row[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

.lesson-row__mark {
  width: 22px;
  height: 22px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  color: var(--muted);
}
.lesson-row__mark svg { width: 12px; height: 12px; }
.lesson-row[data-done="true"] .lesson-row__mark {
  background: var(--ok);
  border-color: var(--ok);
  color: var(--bg);
}
.lesson-row__body { flex: 1 1 auto; min-width: 0; }
.lesson-row__title {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lesson-row__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.125rem;
}
.lesson-row__kind { display: inline-flex; align-items: center; gap: 0.25rem; }
.lesson-row__kind svg { width: 12px; height: 12px; }

/* --------------------------------------------------------------------------
   7. Lesson reader
   -------------------------------------------------------------------------- */
.reader { max-width: var(--reader-measure); margin: 0 auto; }

.reader__crumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.reader__crumb a { color: var(--muted); }
.reader__crumb a:hover { color: var(--text); }

.reader h1 {
  font-size: clamp(1.625rem, 3.4vw, 2.125rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}
.reader__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

/* Long-form reading: slightly larger and looser than the marketing site. */
.prose { font-size: 1.0625rem; line-height: 1.75; color: var(--text); }
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  font-size: 1.3125rem;
  letter-spacing: -0.01em;
  margin-top: 2.25em;
  margin-bottom: 0.6em;
  color: var(--heading);
}
.prose h3 { font-size: 1.0625rem; margin-top: 1.9em; margin-bottom: 0.5em; color: var(--heading); }
.prose ul, .prose ol { padding-inline-start: 1.35em; }
.prose li + li { margin-top: 0.45em; }
.prose strong { color: var(--heading); font-weight: 700; }
.prose a { color: var(--link); text-underline-offset: 3px; }
.prose code {
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}
.prose blockquote {
  margin-inline: 0;
  padding: 0.875rem 1.125rem;
  border-inline-start: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
}
.prose blockquote > :first-child { margin-top: 0; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  display: block;
  overflow-x: auto;   /* vocabulary tables must not push the page sideways */
}
.prose th, .prose td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
}
.prose th { background: var(--surface-2); color: var(--heading); font-weight: 600; }

.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.25em 0; }

/* -- media ---------------------------------------------------------------- */
.lesson-audio {
  width: 100%;
  margin-bottom: 2rem;
  border-radius: var(--radius);
}
.lesson-video {
  position: relative;
  aspect-ratio: 16 / 9;
  margin-bottom: 2rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}
.lesson-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* -- lesson footer nav ---------------------------------------------------- */
.reader__foot {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}
.reader__foot .spacer { flex: 1 1 auto; }

/* --------------------------------------------------------------------------
   8. States
   -------------------------------------------------------------------------- */
.empty {
  text-align: center;
  padding: clamp(2.5rem, 8vw, 4.5rem) 1.5rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.empty svg { width: 44px; height: 44px; color: var(--motif-faint); margin-bottom: 1rem; }
.empty h2 { margin: 0 0 0.5rem; font-size: 1.1875rem; color: var(--heading); }
.empty p { margin: 0 auto 1.5rem; color: var(--muted); max-width: 42ch; }

.locked-note {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.125rem 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-strong);
}
.locked-note p { margin: 0; color: var(--muted); flex: 1 1 240px; }

/* Skeleton shimmer while data loads — steadier than a spinner, and it shows
   the shape of what is coming. */
.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
.skeleton--line { height: 0.875rem; margin-bottom: 0.625rem; }
.skeleton--card { height: 132px; border-radius: var(--radius-lg); }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Keyboard focus must stay obvious everywhere in the app. */
.app :focus-visible,
.auth :focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   9. Print — a learner printing a lesson should get the lesson, not the app
   -------------------------------------------------------------------------- */
@media print {
  .rail, .topbar, .reader__foot, .reader__crumb { display: none !important; }
  .app { display: block; }
  .main { padding: 0; }
  .prose { font-size: 11pt; }
}

/* ---- hear the word -------------------------------------------------------
   A speaker tucked against the word it says. Small and quiet until wanted: the
   page is a reading surface first, and a column of loud icons down a vocabulary
   table would read as decoration rather than as a control. */
.term { white-space: normal; }
.say {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35em;
  height: 1.35em;
  margin-left: 0.3em;
  padding: 0;
  vertical-align: -0.2em;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}
.say svg { width: 0.9em; height: 0.9em; display: block; }
.say:hover { color: var(--accent); background: var(--surface-2); }
.say:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.say.is-speaking {
  color: var(--on-accent);
  background: var(--accent);
  transform: scale(1.08);
}
/* Touch targets need the room even though the icon does not. */
@media (pointer: coarse) {
  .say { width: 1.8em; height: 1.8em; }
}
@media (prefers-reduced-motion: reduce) {
  .say { transition: none; }
  .say.is-speaking { transform: none; }
}

/* --------------------------------------------------------------------------
   Public beta notice + consent tick (sign-up)
   -------------------------------------------------------------------------- */
.field--check { display: flex; align-items: flex-start; gap: 0.625rem; }
.field--check input[type="checkbox"] {
  width: 1.125rem; height: 1.125rem; flex: none; margin: 0.15rem 0 0;
  padding: 0; accent-color: var(--accent);
}
.field--check input[aria-invalid="true"] { outline: 2px solid var(--err); outline-offset: 2px; }
.field--check label { font-weight: 400; margin: 0; line-height: 1.5; }
.beta-gate {
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.25rem 1.25rem 0.5rem;
  margin-bottom: 1rem;
}
.beta-gate__tag {
  display: inline-block; margin: 0 0 0.5rem;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--on-accent); background: var(--accent);
  padding: 0.2rem 0.55rem; border-radius: 999px;
}
.beta-gate__title { font-size: 1.25rem; margin: 0 0 0.5rem; }
.beta-gate p { margin: 0 0 1rem; }
.beta-gate .btn { margin-bottom: 0.625rem; }
