/* Quick Reading by RaiseSteady (P2-235): raisesteady.com's visual language on the app's own layout.
   Navy edges and text, paper, site yellow, light mint, coral and lilac; 2px navy edges, navy offset
   shadows, rounded cards, pill buttons, Orbitron titles, Geist text, RS Emoji first in every stack.
   Reading surfaces (reading paper, word-by-word reader, flash words, Schulte grid, pacer) stay quiet:
   paper, navy text, a plain edge, no shadow. Motion is short fades; reduced motion removes movement only. */

:root {
  /* House palette (nexodyne-d0ea97.webflow/css/library.css, emoji/tools/rs.py) */
  --navy: #282858;
  --navy-deep: #11112b;
  --ink: #1a1a1a;
  --paper: #f5f5f0;
  --white: #ffffff;
  --yellow: #fedb71;
  --yellow-soft: #fff6d6;
  --mint: #bfffe6;
  --mint-deep: #2f8f6c;
  --coral: #fb7d7e;
  --coral-soft: #ffe3e3;
  --lilac: #e9d9ff;
  --lilac-deep: #6f56d0;
  --hover: #f0f0f8;
  --focus: #4f46e5;

  /* Roles (light) */
  --bg: var(--paper);
  --surface: var(--white);
  --surface-2: var(--paper);
  --reading-bg: var(--paper);
  --fg: var(--navy);
  --fg-muted: #4a4a68;
  --edge-c: var(--navy);
  --shadow-c: var(--navy);
  --line: rgb(40 40 88 / 0.16);
  --line-hi: rgb(40 40 88 / 0.42);
  --primary-bg: var(--navy);
  --primary-fg: var(--yellow);
  --active-bg: var(--navy);
  --active-fg: var(--yellow);
  --chip-hover: var(--hover);

  --ok: #1d5c46;
  --ok-soft: var(--mint);
  --ok-line: var(--mint-deep);
  --danger: #8a1f1f;
  --danger-soft: var(--coral-soft);
  --danger-line: #d9534f;
  --accent-soft: var(--yellow-soft);
  --highlight: rgb(254 219 113 / 0.8);
  --chart-goal: var(--lilac-deep);

  /* Legacy names some rules still read */
  --signal: var(--yellow);
  --signal-deep: var(--navy);
  --ink-900: var(--navy);
  --ink-1000: var(--navy-deep);

  --edge: 2px solid var(--edge-c);
  --lift-sm: 3px 3px 0 var(--shadow-c);
  --lift: 4px 4px 0 var(--shadow-c);
  --lift-md: 6px 6px 0 var(--shadow-c);
  --lift-lg: 8px 8px 0 var(--shadow-c);

  --font-display: "RS Emoji", "Orbitron", "FiraGO", "Noto Sans Georgian", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-sans: "RS Emoji", "Geist", "Inter", "FiraGO", "Noto Sans Georgian", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: "RS Emoji", "Geist Mono", "FiraGO", "Noto Sans Georgian", ui-monospace, "SF Mono", Menlo, monospace;
  --font-serif: var(--font-sans);

  --radius: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --maxw: 76rem;
  --gutter: clamp(1rem, 2.6vw, 2.25rem);
  --fade: 0.15s ease;

  color-scheme: light;
}

/* Calm RaiseSteady dark: navy surfaces, paper text, the same yellow and mint accents. */
[data-theme="dark"] {
  --bg: #17173a;
  --surface: #282858;
  --surface-2: #20204a;
  --reading-bg: #1d1d44;
  --fg: #f5f5f0;
  --fg-muted: #cdcde4;
  --edge-c: #b9b9dc;
  --shadow-c: #0b0b20;
  --line: rgb(245 245 240 / 0.16);
  --line-hi: rgb(245 245 240 / 0.42);
  --primary-bg: var(--yellow);
  --primary-fg: var(--navy);
  --active-bg: var(--yellow);
  --active-fg: var(--navy);
  --chip-hover: #33336b;
  --focus: var(--yellow);

  --ok: var(--mint);
  --ok-soft: #173f37;
  --ok-line: #7fd9b5;
  --danger: #ffc2c2;
  --danger-soft: #45213a;
  --danger-line: var(--coral);
  --accent-soft: #33335f;
  --highlight: rgb(254 219 113 / 0.32);
  --chart-goal: #c4b2ff;
  --signal-deep: var(--yellow);

  color-scheme: dark;
}

html[data-font="large"],
[data-font-scale="large"] {
  font-size: 112.5%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1rem;
  overflow-x: clip;
  overflow-wrap: break-word;
  transition: background-color var(--fade), color var(--fade);
}

a {
  color: inherit;
}

/* Keyboard focus: the site's ring (indigo on light, yellow on navy). Script focus draws none. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

[tabindex="-1"]:focus,
:focus:not(:focus-visible) {
  outline: none;
}

/* Read by screen readers, not shown (the live region in index.html), P2-235 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -120px;
  inset-inline-start: 1rem;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.skip-link:focus {
  position: fixed;
  inset-inline-start: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  z-index: 999;
  background: var(--yellow);
  color: var(--navy);
  border: 2px solid var(--navy);
  box-shadow: 4px 4px 0 var(--navy);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-weight: 700;
}

.container {
  width: min(100%, var(--maxw));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  color: var(--fg);
  border-bottom: var(--edge);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 0.75rem;
  min-height: 4.1rem;
  flex-wrap: wrap;
  padding-block: 0.55rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  text-decoration: none;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex: none;
  border: 2px solid var(--navy);
  border-radius: 10px;
  background: var(--yellow);
  box-shadow: 2px 2px 0 var(--shadow-c);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1;
}

.stop {
  color: var(--coral);
}

.age-switcher {
  display: inline-flex;
  background: var(--surface);
  border: var(--edge);
  border-radius: 999px;
  padding: 0.2rem;
  gap: 0.2rem;
}

.age-pill {
  border: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--fade), color var(--fade);
}

.age-pill:hover {
  background: var(--chip-hover);
}

.age-pill.active {
  background: var(--yellow);
  color: var(--navy);
  box-shadow: inset 0 0 0 2px var(--navy);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--fg);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  padding: 0.42rem 0.8rem;
  border: 2px solid transparent;
  border-radius: 999px;
  white-space: nowrap;
  transition: background-color var(--fade), color var(--fade), border-color var(--fade);
}

.nav-link:hover {
  background: var(--chip-hover);
}

.nav-link.active {
  background: var(--active-bg);
  color: var(--active-fg);
  border-color: var(--navy);
}

.header-utils {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-toggle,
.menu-toggle,
.lang-select {
  min-height: 2.5rem;
  border: var(--edge);
  background: var(--surface);
  color: var(--fg);
  border-radius: 999px;
  box-shadow: var(--lift-sm);
  padding: 0.35rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color var(--fade), box-shadow 0.12s ease, transform 0.12s ease;
}

.icon-toggle:hover,
.menu-toggle:hover,
.lang-select:hover {
  background: var(--yellow-soft);
}

[data-theme="dark"] .icon-toggle:hover,
[data-theme="dark"] .menu-toggle:hover,
[data-theme="dark"] .lang-select:hover {
  background: var(--chip-hover);
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  font-size: 1.05rem;
}

/* Hero: the site's yellow band (navy in dark) */
.hero-ink {
  --fg: var(--navy);
  --fg-muted: #3a3a62;
  background: var(--yellow);
  color: var(--fg);
  padding-block: clamp(2.2rem, 5vw, 4rem);
  border-bottom: 2px solid var(--navy);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: clamp(1.5rem, 3.5vw, 3rem);
  align-items: center;
}

.folio,
.folio-light {
  display: inline-flex;
  align-self: flex-start;
  width: fit-content;
  align-items: center;
  max-width: 100%;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.folio {
  background: var(--yellow);
  color: var(--navy);
  border: 2px solid var(--navy);
}

.folio-light {
  background: var(--navy);
  color: var(--yellow);
  border: 2px solid var(--yellow);
}

.hero-ink .folio-light,
.countdown-stage .folio-light,
.hero-card .folio-light {
  border-color: var(--navy);
}

.countdown-stage .folio-light {
  align-self: center;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.3vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  font-weight: 800;
  color: var(--fg);
}

.hero-lead {
  color: var(--fg);
  font-size: 1.08rem;
  line-height: 1.6;
  max-width: 58ch;
  margin: 0 0 1.6rem;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.hero-card {
  --fg: var(--navy);
  --fg-muted: #4a4a68;
  background: var(--white);
  color: var(--fg);
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--navy);
  padding: 1.5rem;
}

.hero-card-title {
  margin: 0 0 0.4rem;
  font-size: 1.3rem;
  line-height: 1.2;
  font-family: var(--font-display);
  font-weight: 800;
}

.hero-card-sub {
  margin: 0 0 1.15rem;
  color: var(--fg-muted);
  font-size: 0.95rem;
}

.hero-norms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.norm-box {
  background: var(--paper);
  border: 2px solid rgb(40 40 88 / 0.3);
  border-radius: var(--radius-sm);
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.norm-box span {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.norm-box strong {
  font-family: var(--font-mono);
  font-size: 1.02rem;
  color: var(--navy);
}

.norm-box.highlight {
  background: var(--yellow);
  border-color: var(--navy);
}

.norm-box.highlight strong {
  color: var(--navy);
}

.age-quick-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.age-tab-btn {
  min-width: 0;
  border: 2px solid var(--navy);
  background: var(--white);
  color: var(--navy);
  border-radius: 999px;
  padding: 0.5rem 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  transition: background-color var(--fade);
}

.age-tab-btn:hover {
  background: var(--hover);
}

.age-tab-btn.active {
  background: var(--navy);
  color: var(--yellow);
}

[data-theme="dark"] .hero-ink {
  --fg: var(--paper);
  --fg-muted: #cdcde4;
  background: var(--navy);
  border-bottom-color: var(--navy-deep);
}

[data-theme="dark"] .hero-ink .folio-light {
  border-color: var(--yellow);
}

[data-theme="dark"] .hero-card {
  --fg: var(--paper);
  --fg-muted: #cdcde4;
  background: #20204a;
  border-color: #b9b9dc;
  box-shadow: 6px 6px 0 var(--navy-deep);
}

[data-theme="dark"] .hero-card .folio-light {
  border-color: var(--yellow);
}

[data-theme="dark"] .norm-box {
  background: var(--navy);
  border-color: rgb(245 245 240 / 0.3);
}

[data-theme="dark"] .norm-box strong {
  color: var(--paper);
}

[data-theme="dark"] .norm-box.highlight {
  background: var(--yellow);
  border-color: var(--yellow);
}

[data-theme="dark"] .norm-box.highlight span,
[data-theme="dark"] .norm-box.highlight strong {
  color: var(--navy);
}

[data-theme="dark"] .age-tab-btn {
  background: transparent;
  color: var(--paper);
  border-color: rgb(245 245 240 / 0.55);
}

[data-theme="dark"] .age-tab-btn:hover {
  background: var(--chip-hover);
}

[data-theme="dark"] .age-tab-btn.active {
  background: var(--yellow);
  color: var(--navy);
  border-color: var(--yellow);
}

/* Sections & Surfaces */
.page-sections {
  padding-block: clamp(1.8rem, 3.5vw, 3rem);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.section-block {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.section-head.compact {
  gap: 0.3rem;
}

.page-title,
.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.2;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  color: var(--fg);
}

.hero-title,
.page-title,
.section-title,
.panel-title,
.hero-card-title,
.banner-title,
.reading-title,
.catalog-title,
.program-title,
.pkg-name {
  overflow-wrap: break-word;
  hyphens: auto;
  hyphenate-limit-chars: 10 4 4; /* P2-235 review C1: only long words break with a hyphen */
}

/* Long Georgian and Russian words may need to break at heading size on a phone. */
:lang(ka) :is(.hero-title, .page-title, .section-title, .panel-title, .hero-card-title, .banner-title, .reading-title, .catalog-title, .program-title, .pkg-name),
:lang(ru) :is(.hero-title, .page-title, .section-title, .panel-title, .hero-card-title, .banner-title, .reading-title, .catalog-title, .program-title, .pkg-name) {
  overflow-wrap: anywhere;
  letter-spacing: 0;
}

.lead {
  color: var(--fg-muted);
  font-size: 1.05rem;
  margin: 0;
  max-width: 72ch;
}

.lead-sm {
  color: var(--fg-muted);
  margin: 0;
  font-size: 0.96rem;
}

.muted {
  color: var(--fg-muted);
  font-size: 0.93rem;
}

.panel,
.info-card,
.catalog-card,
.program-card,
.package-card,
.exercise-card,
.stat-box {
  background: var(--surface);
  color: var(--fg);
  border: var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--lift);
  padding: clamp(1rem, 2.2vw, 1.5rem);
  min-width: 0;
}

.panel-title {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
}

.accent-panel,
.offer-panel {
  background: var(--accent-soft);
}

.quiz-panel {
  scroll-margin-top: 5.5rem;
}

/* Navy panels: the finished-workout card, the workout runner head, the result banner, the eye warm-up. */
.ink-banner,
.ink-panel,
.eyegym-stage {
  --fg: var(--paper);
  --fg-muted: #d3d3ea;
  --edge-c: var(--paper);
  --shadow-c: var(--navy-deep);
  --surface: #323268;
  --surface-2: #3a3a75;
  --line: rgb(245 245 240 / 0.2);
  --line-hi: rgb(245 245 240 / 0.48);
  --chip-hover: #3a3a75;
  --focus: var(--yellow);
  --highlight: rgb(254 219 113 / 0.32);
  background: var(--navy);
  color: var(--fg);
}

.ink-panel {
  border-color: var(--navy);
  box-shadow: 4px 4px 0 var(--navy-deep);
}

[data-theme="dark"] .ink-banner,
[data-theme="dark"] .ink-panel,
[data-theme="dark"] .eyegym-stage {
  background: #12122e;
  --surface: #282858;
  --surface-2: #20204a;
}

[data-theme="dark"] .ink-panel {
  border-color: #b9b9dc;
}

/* Edges and shadows are built from --edge-c and --shadow-c; rebuild them where a panel changes those. */
.hero-ink,
.hero-card,
.countdown-stage,
.ink-banner,
.ink-panel,
.eyegym-stage {
  --edge: 2px solid var(--edge-c);
  --lift-sm: 3px 3px 0 var(--shadow-c);
  --lift: 4px 4px 0 var(--shadow-c);
  --lift-md: 6px 6px 0 var(--shadow-c);
  --lift-lg: 8px 8px 0 var(--shadow-c);
}

/* Grids */
.three-col-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.two-col-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.catalog-grid,
.program-grid,
.package-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

/* P2-235 review C1: layout names the scripts use that had no rules (cards touched and stood in one column) */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

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

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.85rem;
}

.diag-shell,
.diag-reading-shell,
.diag-result-shell {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.offer-header,
.pkg-top,
.banner-copy,
.quiz-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.form-actions,
.action-meta,
.focus-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.form-actions {
  margin-top: 1rem;
}

.exercise-subnav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.choice-grid {
  display: grid;
  gap: 0.9rem;
}

.choice-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-card {
  text-align: start;
  background: var(--surface);
  border: var(--edge);
  border-radius: var(--radius-md);
  box-shadow: var(--lift-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  min-width: 0;
  color: var(--fg);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background-color var(--fade), box-shadow 0.12s ease, transform 0.12s ease;
}

.choice-card:hover {
  background: var(--chip-hover);
}

.choice-card.active {
  background: var(--yellow);
  color: var(--navy);
  border-color: var(--navy);
  box-shadow: var(--lift);
}

.choice-card.active .choice-sub,
.choice-card.active .choice-badge {
  color: var(--navy);
}

.choice-badge {
  font-size: 0.76rem;
  color: var(--fg-muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.choice-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.choice-sub {
  font-size: 0.88rem;
  color: var(--fg-muted);
}

/* Buttons & Pills: the site's pill buttons with a navy offset shadow */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  max-width: 100%;
  border-radius: 999px;
  padding: 0.66rem 1.2rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  border: var(--edge);
  box-shadow: var(--lift);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color var(--fade), color var(--fade);
}

.btn:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--shadow-c);
}

/* the hover lift can slide a button from under a resting mouse; keep the hover area over the old spot */
.btn:hover:not(:disabled)::before {
  content: "";
  position: absolute;
  inset: -4px -6px -6px -4px;
}

.btn:active:not(:disabled) {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--shadow-c);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-lg {
  padding: 0.85rem 1.45rem;
  font-size: 1.02rem;
}

.btn-sm {
  padding: 0.42rem 0.85rem;
  font-size: 0.85rem;
  box-shadow: var(--lift-sm);
}

.btn.full {
  width: 100%;
}

.btn-primary {
  background: var(--primary-bg);
  color: var(--primary-fg);
  border-color: var(--navy);
}

.btn-signal {
  background: var(--yellow);
  color: var(--navy);
  border-color: var(--navy);
}

.btn-signal:hover:not(:disabled) {
  background: #ffe48f;
}

.btn-ink-outline {
  background: transparent;
  color: inherit;
  border-color: currentColor;
}

.btn-ink-outline:hover:not(:disabled) {
  background: rgb(255 255 255 / 0.12);
}

.hero-ink .btn-signal,
.countdown-stage .btn-signal {
  background: var(--navy);
  color: var(--yellow);
}

.hero-ink .btn-signal:hover:not(:disabled),
.countdown-stage .btn-signal:hover:not(:disabled) {
  background: #33336b;
}

[data-theme="dark"] .hero-ink .btn-signal,
[data-theme="dark"] .countdown-stage .btn-signal {
  background: var(--yellow);
  color: var(--navy);
}

.hero-ink .btn-ink-outline,
.countdown-stage .btn-ink-outline {
  background: var(--white);
  color: var(--navy);
  border-color: var(--navy);
}

[data-theme="dark"] .hero-ink .btn-ink-outline,
[data-theme="dark"] .countdown-stage .btn-ink-outline {
  background: transparent;
  color: var(--paper);
  border-color: var(--paper);
}

.btn-outline {
  background: var(--surface);
  color: var(--fg);
}

.btn-outline:hover:not(:disabled) {
  background: var(--chip-hover);
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--fg);
  border-color: var(--line-hi);
  box-shadow: none;
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--edge-c);
  box-shadow: var(--lift-sm);
}

.link-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: start;
  text-decoration: underline;
  text-decoration-color: var(--yellow);
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
  border-radius: 4px;
}

.link-btn:hover {
  text-decoration-color: currentColor;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill-group.compact {
  gap: 0.35rem;
}

.pill-btn {
  max-width: 100%;
  border: var(--edge);
  background: var(--surface);
  color: var(--fg);
  border-radius: 999px;
  padding: 0.42rem 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.87rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  transition: background-color var(--fade), color var(--fade);
}

.pill-btn:hover {
  background: var(--chip-hover);
}

.pill-btn.active {
  background: var(--active-bg);
  color: var(--active-fg);
  border-color: var(--navy);
}

[data-theme="dark"] .pill-btn.active {
  border-color: var(--yellow);
}

.badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  background: var(--surface-2);
  color: var(--fg);
  border: 1.5px solid var(--line-hi);
}

.badge-gold {
  background: var(--yellow);
  color: var(--navy);
  border-color: var(--navy);
}

.free-pill {
  background: var(--mint);
  color: var(--navy);
  border: 2px solid var(--navy);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0;
  padding: 0.12rem 0.5rem;
}

.mono-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.3;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--fg);
  border: 1.5px solid var(--line-hi);
  font-variant-numeric: tabular-nums;
}

.mono-pill.gold {
  background: var(--yellow);
  color: var(--navy);
  border-color: var(--navy);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--fg);
  box-shadow: inset 0 -0.4em 0 var(--highlight);
}

.spacer-sm {
  height: 0.75rem;
}

/* Reading papers (age-adapted): quiet paper, navy text, a plain edge, no shadow */
.reading-paper {
  background: var(--reading-bg);
  color: var(--fg);
  border: var(--edge);
  border-radius: var(--radius);
  padding: clamp(1.2rem, 3vw, 2.2rem);
  max-width: 68ch;
  margin-inline: auto;
}

.reading-paper.age-6-9 {
  font-size: 1.28rem;
  line-height: 1.88;
  letter-spacing: 0.015em;
}

.reading-paper.age-10-16 {
  font-size: 1.14rem;
  line-height: 1.74;
}

.reading-paper.age-adult {
  font-size: 1.08rem;
  line-height: 1.66;
}

.reading-title {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.reading-hint {
  color: var(--fg-muted);
  font-size: 0.92rem;
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--line);
}

.reading-paragraphs p {
  margin: 0 0 1rem;
}

/* Banners & KPIs */
.ink-banner {
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--yellow);
  padding: clamp(1.2rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

[data-theme="dark"] .ink-banner {
  border-color: var(--yellow);
  box-shadow: 6px 6px 0 var(--navy-deep);
}

.banner-title {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.2;
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
}

.banner-text {
  margin: 0;
  color: var(--fg-muted);
  max-width: 70ch;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.kpi-card {
  background: var(--surface);
  border: 2px solid var(--line-hi);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.kpi-card.highlight {
  background: var(--yellow);
  border-color: var(--yellow);
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.kpi-val {
  font-size: 1.55rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.kpi-unit {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.kpi-card.highlight .kpi-label,
.kpi-card.highlight .kpi-val,
.kpi-card.highlight .kpi-unit {
  color: var(--navy);
}

.stat-box {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-big {
  font-size: 1.7rem;
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Action bars & Toolbars */
.action-bar,
.reader-toolbar,
.exercise-controls,
.pacer-toolbar,
.mission-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block: 0.75rem;
}

.action-bar.compact {
  gap: 0.5rem;
  margin-block: 0.5rem;
}

.toolbar-right,
.toolbar-group,
.inline-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.inline-actions.stretch > button {
  flex: 1 1 auto;
}

/* Schulte Grid: plain cells, no shadows (the grid is the reading surface) */
.schulte-grid {
  display: grid;
  gap: 0.45rem;
  width: min(100%, 30rem);
  margin: 1rem auto;
}

.schulte-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.schulte-grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.schulte-grid.cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.schulte-grid.cols-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.schulte-cell {
  aspect-ratio: 1 / 1;
  min-width: 0;
  border: 2px solid var(--edge-c);
  background: var(--reading-bg);
  color: var(--fg);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color var(--fade), color var(--fade), border-color var(--fade);
}

.schulte-cell:hover {
  background: var(--chip-hover);
}

.schulte-cell.center-anchor {
  box-shadow: inset 0 0 0 3px var(--yellow);
}

.schulte-cell.done {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: var(--ok-line);
}

.schulte-cell.wrong {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-line);
}

/* Status strip */
.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.status-strip.compact {
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}

.stat-chip {
  flex: 1 1 8.5rem;
  min-width: 0;
  background: var(--surface-2);
  border: 2px solid var(--line-hi);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.85rem;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.stat-val {
  font-size: 1.08rem;
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.gold-text {
  color: var(--fg);
  box-shadow: inset 0 -0.4em 0 var(--highlight);
}

/* Flash & RSVP */
.flash-stage {
  min-height: 15rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
  padding: 1.5rem;
  background: var(--reading-bg);
  color: var(--fg);
  border-radius: var(--radius);
  border: var(--edge);
}

.flash-stage.done {
  background: var(--ok-soft);
  color: var(--fg);
}

.flash-crosshair {
  color: var(--fg);
  font-size: 1.3rem;
  font-weight: 700;
}

.flash-word {
  font-family: var(--font-sans);
  font-size: clamp(1.65rem, 3.6vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  max-width: 100%;
  padding: 0.6rem 1.4rem;
  background: var(--surface);
  color: var(--fg);
  border: var(--edge);
  border-radius: var(--radius-md);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  width: min(100%, 34rem);
}

.option-tile,
.option-btn {
  min-width: 0;
  padding: 0.78rem 1rem;
  border: var(--edge);
  background: var(--surface);
  color: var(--fg);
  border-radius: var(--radius-md);
  box-shadow: var(--lift-sm);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  text-align: start;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  transition: background-color var(--fade), box-shadow 0.12s ease, transform 0.12s ease;
}

.option-tile:hover,
.option-btn:hover {
  background: var(--chip-hover);
}

.option-tile {
  justify-content: center;
  text-align: center;
}

.option-btn.selected {
  background: var(--yellow);
  color: var(--navy);
  border-color: var(--navy);
}

.option-index {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 2px solid var(--line-hi);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  flex-shrink: 0;
}

.option-btn.selected .option-index {
  background: var(--navy);
  color: var(--yellow);
  border-color: var(--navy);
}

.rsvp-viewport {
  background: var(--reading-bg);
  color: var(--fg);
  border: var(--edge);
  border-radius: var(--radius);
  min-height: 11.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  position: relative;
}

.rsvp-guide-top,
.rsvp-guide-bottom {
  width: 2px;
  height: 14px;
  background: var(--fg);
  opacity: 0.45;
}

.rsvp-word-box {
  font-family: var(--font-sans);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  min-height: 3.6rem;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rsvp-pivot {
  color: inherit;
  box-shadow: inset 0 -0.16em 0 var(--yellow);
}

/* Pacer */
.pacer-word {
  transition: background-color 0.08s ease, opacity var(--fade);
  border-radius: 4px;
  padding-inline: 2px;
}

.pacer-word.active {
  background: var(--yellow);
  color: var(--navy);
}

.pacer-word.past {
  opacity: 0.35;
}

/* Word Hunt */
.scan-word {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 1px 3px;
  border-radius: 4px;
  cursor: pointer;
}

.scan-word:hover {
  background: var(--lilac);
  color: var(--navy);
}

.scan-word.found {
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 700;
  outline: 2px solid var(--ok-line);
}

/* Lookalike */
.lookalike-grid {
  display: grid;
  gap: 0.55rem;
  max-width: 38rem;
  margin: 0.85rem auto;
}

.lookalike-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.lookalike-grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.lookalike-cell {
  min-width: 0;
  border: 2px solid var(--edge-c);
  background: var(--reading-bg);
  color: var(--fg);
  border-radius: var(--radius-sm);
  padding: 0.9rem 0.45rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: background-color var(--fade), border-color var(--fade);
}

.lookalike-cell:hover {
  background: var(--chip-hover);
}

.lookalike-cell.found {
  background: var(--ok-soft);
  border-color: var(--ok-line);
  color: var(--ok);
}

/* Pyramid & Metronome */
.pyramid-stage {
  min-height: 11rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--reading-bg);
  color: var(--fg);
  border: var(--edge);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.pyramid-stage.gap-lvl-1 { gap: 2.5rem; }
.pyramid-stage.gap-lvl-2 { gap: 4.5rem; }
.pyramid-stage.gap-lvl-3 { gap: 7rem; }
.pyramid-stage.gap-lvl-4 { gap: 9.5rem; }
.pyramid-stage.gap-lvl-5 { gap: 12rem; }

.pyramid-word {
  font-size: 1.35rem;
  font-weight: 700;
}

.pyramid-center-dot {
  color: var(--coral);
  font-size: 1.35rem;
}

.metro-stops-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-block: 0.85rem;
}

.metro-stop {
  min-width: 0;
  text-align: center;
  padding: 0.55rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 2px solid var(--line-hi);
  font-weight: 600;
  font-size: 0.87rem;
  transition: background-color var(--fade), border-color var(--fade);
}

.metro-stop.active {
  background: var(--yellow);
  color: var(--navy);
  border-color: var(--navy);
}

/* Workout runner (inside the navy .ink-panel) */
.stage-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.step-pill {
  max-width: 100%;
  border: 2px solid var(--line-hi);
  background: transparent;
  color: var(--fg);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color var(--fade), color var(--fade), border-color var(--fade);
}

.step-pill:hover {
  background: var(--chip-hover);
}

.step-pill.current {
  background: var(--yellow);
  color: var(--navy);
  border-color: var(--yellow);
  font-weight: 700;
}

.step-pill.done {
  border-color: var(--mint);
  color: var(--mint);
}

.stage-preview-list {
  margin: 0.75rem 0 1rem;
  padding-inline-start: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  font-size: 0.92rem;
}

.stage-preview-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.stage-dur {
  font-family: var(--font-mono);
  color: var(--fg-muted);
  white-space: nowrap;
}

.rest-card {
  background: var(--ok-soft);
  color: var(--fg);
  border: var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--lift);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-items: flex-start;
}

.rest-steps {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.builder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-block: 1rem;
}

.field-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

/* The rule under a field (custom text: "at least 5 words"); it turns into the error when the text is too short */
.field-hint {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.field-hint.is-error {
  color: var(--danger);
  font-weight: 700;
}

.custom-text-box .field-label {
  margin-bottom: -0.35rem;
}

/* Packages & Forms */
.package-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* P2-235 review C1: the flex gap does the spacing; buttons line up at the bottom of cards of different lengths */
.package-card p {
  margin: 0;
}

.package-card > .btn:last-child,
.catalog-card > .btn:last-child {
  margin-top: auto;
}

.package-card.recommended {
  box-shadow: 6px 6px 0 var(--yellow);
}

.package-card.selected {
  background: var(--accent-soft);
}

.pkg-name {
  margin: 0.4rem 0 0.25rem;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.25;
  font-size: 1.18rem;
}

.pkg-price strong {
  font-size: 1.75rem;
  font-family: var(--font-mono);
}

.pkg-gain {
  background: var(--ok-soft);
  color: var(--ok);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  font-weight: 600;
  margin: 0;
}

.pkg-features,
.goal-list {
  margin: 0;
  padding-inline-start: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  font-size: 0.93rem;
}

.conversion-box {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--line);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-block: 0.85rem;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 0.62rem 0.85rem;
  border: var(--edge);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.4;
}

.textarea {
  resize: vertical;
}

.range-input {
  width: min(100%, 12rem);
  accent-color: var(--navy);
}

[data-theme="dark"] .range-input {
  accent-color: var(--yellow);
}

.alert {
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 0.93rem;
}

.alert-ok {
  background: var(--ok-soft);
  color: var(--ok);
  border: 2px solid var(--ok-line);
}

.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 2px solid var(--danger-line);
}

.result-inline {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.result-inline.ok {
  background: var(--ok-soft);
  color: var(--ok);
  border: 2px solid var(--ok-line);
}

.result-inline.bad {
  background: var(--danger-soft);
  color: var(--danger);
  border: 2px solid var(--danger-line);
}

.question-card {
  padding-block: 0.85rem;
  border-bottom: 2px solid var(--line);
}

.question-title {
  font-weight: 700;
  margin: 0 0 0.65rem;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.mini-module-list,
.history-list,
.custom-saved-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mini-module-btn,
.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.95rem;
  border: 2px solid var(--line-hi);
  background: var(--surface-2);
  color: var(--fg);
  border-radius: var(--radius-md);
  text-align: start;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background-color var(--fade), border-color var(--fade);
}

.mini-module-btn:hover,
.history-row:hover {
  border-color: var(--edge-c);
  background: var(--chip-hover);
}

.mini-module-btn strong,
.history-row strong {
  display: block;
}

.age-adapt-note {
  font-size: 0.87rem;
  padding: 0.55rem 0.8rem;
  background: var(--lilac);
  color: var(--navy);
  border-radius: var(--radius-sm);
  margin-block: 0.5rem 0.85rem;
}

[data-theme="dark"] .age-adapt-note {
  background: #3b3570;
  color: var(--paper);
}

.card-btn-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: auto;
}

.catalog-card,
.program-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.catalog-top,
.program-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.catalog-title,
.program-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.25;
  font-size: 1.12rem;
}

.catalog-sub {
  margin: 0;
  font-weight: 600;
  font-size: 0.9rem;
}

.settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.custom-text-box {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.summary-toggle {
  cursor: pointer;
  font-weight: 700;
  border-radius: 6px;
}

.review-list {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.review-item {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border-inline-start: 4px solid var(--ok-line);
  background: var(--surface-2);
}

.review-item.bad {
  border-inline-start-color: var(--danger-line);
}

/* Charts */
.chart-svg {
  width: 100%;
  max-width: 52rem; /* P2-235 review C1: stretched wider, the 11 px labels printed at about 20 px */
  height: auto;
  display: block;
  margin-inline: auto;
}

.chart-track {
  fill: var(--surface-2);
}

.chart-zone-avg {
  fill: rgb(254 219 113 / 0.45);
}

.chart-bar-effective {
  fill: var(--ok-line);
}

.chart-dot-current {
  fill: var(--navy);
  stroke: var(--yellow);
  stroke-width: 2.5;
}

[data-theme="dark"] .chart-dot-current {
  fill: var(--yellow);
  stroke: var(--navy);
}

.chart-dot-proj {
  fill: var(--ok-line);
}

.chart-marker-proj {
  stroke: var(--ok-line);
  stroke-width: 2;
}

.chart-tick {
  stroke: var(--line-hi);
  stroke-width: 1.5;
}

.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-line-wpm {
  stroke: var(--navy);
  stroke-width: 2.6;
}

[data-theme="dark"] .chart-line-wpm {
  stroke: var(--yellow);
}

.chart-line-eff {
  stroke: var(--ok-line);
  stroke-width: 2;
}

.chart-goal-line {
  stroke: var(--chart-goal);
  stroke-width: 1.8;
}

.chart-bar-goal {
  fill: var(--ok-line);
}

.chart-bar-muted {
  fill: var(--fg-muted);
  opacity: 0.5;
}

.chart-label-current,
.chart-label-proj,
.chart-tick-label,
.chart-axis-text,
.chart-empty {
  fill: var(--fg);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
}

.chart-tick-label,
.chart-axis-text {
  fill: var(--fg-muted);
  font-weight: 500;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  border-top: var(--edge);
  padding-block: 2rem;
  background: var(--surface);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
}

/* P2-235 review C1: the name, the line under it and the device note each on their own line */
.footer-brand {
  display: grid;
  gap: 0.25rem;
  max-width: 44rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
}

.footer-links a {
  padding-block: 0.7rem;
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
  font-weight: 600;
  font-size: 0.93rem;
  border-radius: 4px;
  transition: text-decoration-color var(--fade);
}

.footer-links a:hover {
  text-decoration-color: var(--yellow);
}

/* P2-235: the counting kit's "Cookie choices" box opens on its own row under the footer links (css/track.css) */
.footer-links .nxm-set {
  flex: 0 0 100%;
  margin: 0.5rem 0 0;
}

/* P2-235 review C1: every control a finger uses is at least 44 px high (px, so a larger font only makes it taller) */
.age-pill,
.pill-btn,
.nav-link,
.btn-sm,
.icon-toggle,
.menu-toggle,
.lang-select {
  min-height: 44px;
}

.age-pill,
.pill-btn,
.icon-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-link {
  display: inline-flex;
  align-items: center;
}

.menu-toggle {
  min-width: 44px;
}

/* The counting kit's settings box (css/track.css, loaded after this file): its buttons reach 44 px here too */
body .nxm-set .nxm-b {
  min-height: 44px;
}

/* P2-235 review C1: one header in every language on wide screens: the name left, ages and settings right, the menu on its own row */
@media (min-width: 62.01em) {
  .brand {
    margin-inline-end: auto;
  }

  .age-switcher {
    order: 2;
  }

  .header-utils {
    order: 3;
  }

  .main-nav {
    order: 4;
    flex: 1 1 100%;
  }
}

/* Responsive */
@media (max-width: 62em) {
  .grid-3,
  .grid-2,
  .hero-grid,
  .three-col-grid,
  .two-col-split,
  .catalog-grid,
  .program-grid,
  .package-grid,
  .choice-grid.three,
  .builder-grid,
  .form-grid,
  .kpi-strip {
    grid-template-columns: 1fr;
  }

  .choice-grid.two {
    grid-template-columns: 1fr;
  }

  .age-switcher {
    order: 3;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    border-radius: var(--radius-md);
  }

  .age-pill {
    flex: 1 1 auto;
    text-align: center;
    padding: 0.38rem 0.5rem;
    font-size: 0.82rem;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .main-nav {
    display: none;
    order: 4;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-top: 0.5rem;
    border-top: 2px solid var(--line);
  }

  .main-nav.open {
    display: flex;
  }

  .nav-link {
    white-space: normal;
  }
}

@media (max-width: 34em) {
  .options-grid {
    grid-template-columns: 1fr;
  }

  .btn,
  .pill-btn {
    white-space: normal;
    text-align: center;
  }

  .pyramid-stage.gap-lvl-3 { gap: 3rem; }
  .pyramid-stage.gap-lvl-4 { gap: 3.5rem; }
  .pyramid-stage.gap-lvl-5 { gap: 4.5rem; }
}

.reading-stage-anchor {
  scroll-margin-top: 5.5rem;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  max-width: 9.5rem;
  padding-inline-end: 2rem;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23282858' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 0.65rem auto;
}

[dir="rtl"] .lang-select {
  background-position: left 0.8rem center;
}

[data-theme="dark"] .lang-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23f5f5f0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.free-tracks-banner {
  margin-top: 0.4rem;
}

/* 3-2-1 countdown: a yellow card like the site's hero (navy in dark) */
.countdown-stage {
  --fg: var(--navy);
  --fg-muted: #3a3a62;
  background: var(--yellow);
  color: var(--fg);
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: var(--lift);
  padding: clamp(1.75rem, 4vw, 2.75rem) 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
  min-height: 18rem;
}

[data-theme="dark"] .countdown-stage {
  --fg: var(--paper);
  --fg-muted: #cdcde4;
  background: var(--navy);
  border-color: var(--yellow);
}

[data-theme="dark"] .countdown-stage .folio-light {
  border-color: var(--yellow);
}

.countdown-dial {
  position: relative;
  width: 8.2rem;
  height: 8.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.countdown-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.countdown-ring-track {
  fill: none;
  stroke: rgb(40 40 88 / 0.16);
  stroke-width: 8;
}

[data-theme="dark"] .countdown-ring-track {
  stroke: rgb(245 245 240 / 0.16);
}

.countdown-ring-progress {
  fill: none;
  stroke: var(--navy);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  transition: stroke-dashoffset 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] .countdown-ring-progress {
  stroke: var(--yellow);
}

.countdown-ring-progress.step-3 {
  stroke-dashoffset: 0;
}

.countdown-ring-progress.step-2 {
  stroke-dashoffset: 108.9;
}

.countdown-ring-progress.step-1 {
  stroke-dashoffset: 217.8;
}

@keyframes countdownPop {
  0% {
    transform: scale(0.88);
    opacity: 0.3;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes countdownFade {
  0% {
    opacity: 0.3;
  }
  100% {
    opacity: 1;
  }
}

.countdown-num {
  position: absolute;
  font-family: var(--font-display);
  font-size: 3.1rem;
  font-weight: 800;
  color: var(--fg);
  line-height: 1;
}

[data-theme="dark"] .countdown-num {
  color: var(--yellow);
}

.countdown-num.pop {
  animation: countdownPop 0.45s ease-out;
}

.countdown-sub {
  margin: 0;
  max-width: 44ch;
  color: var(--fg);
  font-size: 0.95rem;
}

/* Bold word starts & focus guide */
.bionic-lead {
  font-weight: 800;
  color: var(--fg);
}

.focus-guide-active .focus-para {
  opacity: 0.4;
  transition: opacity var(--fade), background-color var(--fade);
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.55rem;
  margin-inline: -0.55rem;
}

.focus-guide-active .focus-para.is-focused {
  opacity: 1;
  background: rgb(254 219 113 / 0.28);
}

/* Eye warm-up: a navy stage (set with the navy panels above) */
.eyegym-stage {
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.eyegym-svg {
  width: 100%;
  max-width: 34rem;
  height: auto;
  display: block;
}

.eyegym-guide-path {
  fill: none;
  stroke: rgb(245 245 240 / 0.22);
  stroke-width: 2;
  stroke-dasharray: 5 5;
}

.eyegym-anchor {
  fill: rgb(191 255 230 / 0.55);
}

.eyegym-halo {
  fill: rgb(254 219 113 / 0.38);
}

.eyegym-dot {
  fill: var(--yellow);
}

/* Word-by-word progress bar */
.rsvp-bar-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  margin-top: 0.95rem;
  overflow: hidden;
}

.rsvp-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--fg);
  border-radius: 999px;
  transition: width 0.14s linear;
}

.rsvp-chunk-phrase {
  font-size: clamp(1.35rem, 3vw, 2.15rem);
  color: var(--fg);
  text-align: center;
}

/* Progress level & badges */
.level-banner {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.level-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.level-bar-track {
  width: 100%;
  height: 0.9rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: var(--edge);
  overflow: hidden;
}

.level-bar-fill {
  height: 100%;
  background: var(--yellow);
  border-radius: 999px;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 0.75rem;
}

.ach-badge {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  border: 2px dashed var(--line-hi);
  background: var(--surface-2);
  color: var(--fg-muted);
}

.ach-badge:not(.unlocked) .badge-icon {
  filter: grayscale(1);
  opacity: 0.55;
}

.ach-badge.unlocked {
  border-style: solid;
  border-color: var(--edge-c);
  background: var(--yellow-soft);
  color: var(--navy);
  box-shadow: var(--lift-sm);
}

[data-theme="dark"] .ach-badge.unlocked {
  background: #3a3a6e;
  color: var(--paper);
}

.badge-icon {
  font-size: 1.5rem;
  line-height: 1;
  font-family: var(--font-sans);
}

.ach-badge strong {
  display: block;
  font-size: 0.93rem;
}

.ach-badge .muted {
  font-size: 0.82rem;
  color: inherit;
}

/* Scripts: Chinese text keeps a CJK face after Geist; Orbitron stays for Latin in headings. */
[lang="zh"] {
  --font-sans: "RS Emoji", "Geist", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-display: "RS Emoji", "Orbitron", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

:lang(zh) :is(.hero-title, .page-title, .section-title, .panel-title, .hero-card-title, .banner-title, .reading-title, .catalog-title, .program-title, .pkg-name, .brand) {
  letter-spacing: 0;
}

@media (max-width: 760px) {
  .header-inner {
    gap: 0.5rem;
  }

  .age-switcher {
    max-width: 100%;
    overflow-x: auto;
  }

  .lang-select {
    max-width: 7.6rem;
  }

  .builder-grid,
  .form-grid,
  .hero-norms {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Reduced motion: the same fades with the same timing; nothing moves or scales. */
@media (prefers-reduced-motion: reduce) {
  .btn:hover:not(:disabled),
  .btn:active:not(:disabled) {
    transform: none;
  }

  .countdown-num.pop {
    animation-name: countdownFade;
  }

  /* P2-235 review C1: the countdown ring and the word bar keep their own short, even change: without it they jumped each second */
}

/* P2-235: phones. The closed language picker shows only the code (the list still shows the names); the select sits
   invisible on top, so it stays the control for taps, keys and screen readers. The header scrolls away on phones:
   with the age row it is too tall to stay pinned on a small screen at large text sizes. */
.lang-pick {
  position: relative;
  display: inline-grid;
}

.lang-code {
  display: none;
}

@media (max-width: 34em) {
  .site-header {
    position: static;
  }

  .lang-code {
    display: inline-grid;
    place-items: center;
    min-width: 2.75rem;
    min-height: 44px;
    padding: 0 0.8rem;
    border: var(--edge);
    border-radius: 999px;
    background: var(--surface);
    color: var(--fg);
    box-shadow: var(--lift-sm);
    font-family: var(--font-sans);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1;
  }

  .lang-pick .lang-select {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: none;
    min-height: 0;
    opacity: 0;
  }

  .lang-pick:focus-within .lang-code {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
  }
}
