/* ==========================================================================
   StudyPulse.ai site layer. The engine (scrollcraft.css) is the mechanism;
   this file is the brand. Do not restyle .sc-stage or [data-sc-*] here.
   ========================================================================== */

/* ------------------------------------------------------------------ tokens */
:root {
  --sc-canvas:     #F3F5F2;
  --sc-surface:    #FFFFFF;
  --sc-ink:        #0B2144;          /* brand navy */
  --sc-ink-soft:   #4A5A72;          /* navy-tinted, never flat grey */
  --sc-accent:     var(--eco);       /* regraded by the ecosystem switch */
  --sc-accent-ink: #FFFFFF;

  --sc-font-display: "Bricolage Grotesque", "Geist", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --sc-font-text:    "Geist", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --sc-font-mono:    "Geist Mono", "IBM Plex Sans Arabic", ui-monospace, monospace;

  /* light-ground elevation, shadows tinted to the navy ink */
  --sc-shadow-color: 216 60% 16%;
  --sc-e1: 0 1px 2px hsl(var(--sc-shadow-color) / 0.06), 0 1px 1px hsl(var(--sc-shadow-color) / 0.04);
  --sc-e2: 0 2px 4px hsl(var(--sc-shadow-color) / 0.05), 0 8px 20px -6px hsl(var(--sc-shadow-color) / 0.12);
  --sc-e3: 0 4px 8px hsl(var(--sc-shadow-color) / 0.05), 0 24px 48px -12px hsl(var(--sc-shadow-color) / 0.2);
  --sc-edge: inset 0 1px 0 rgb(255 255 255 / 0.9);

  --paper: #FFFEFA;
  --line: color-mix(in oklab, var(--sc-ink) 11%, transparent);
  --line-strong: color-mix(in oklab, var(--sc-ink) 20%, transparent);
  --chrome-h: 64px;
  --r-1: 6px; --r-2: 10px; --r-3: 16px;

  --eco-tint: color-mix(in oklab, var(--eco) 11%, var(--sc-surface));
  --eco-wash: color-mix(in oklab, var(--eco) 5%, var(--sc-surface));
  --eco-mark: color-mix(in oklab, var(--eco) 22%, transparent);
}
/* The one control that regrades everything. One hue at a time. */
:root[data-eco="k12"]        { --eco: #15803D; --eco-deep: #0E5A2B; }
:root[data-eco="higher_ed"]  { --eco: #4338CA; --eco-deep: #2F2799; }
:root[data-eco="enterprise"] { --eco: #C2410C; --eco-deep: #8F2F08; }

html { scroll-padding-top: calc(var(--chrome-h) + 12px); }
body { font-feature-settings: "ss01" 0; }
h1, h2, h3, h4 { font-family: var(--sc-font-display); color: var(--sc-ink); margin: 0; font-weight: 650; letter-spacing: var(--sc-track-snug); text-wrap: balance; }
p { margin: 0; }
.i { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.2em; }

/* --------------------------------------------------------------- buttons */
.btn {
  --h: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  height: var(--h); padding-inline: 1.05rem;
  border-radius: var(--r-2); border: 1px solid transparent;
  font-weight: 560; font-size: 0.95rem; line-height: 1; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  transition: background-color 160ms var(--sc-ease-out), border-color 160ms var(--sc-ease-out),
              color 160ms var(--sc-ease-out), transform 120ms var(--sc-ease-out), box-shadow 160ms var(--sc-ease-out);
}
.btn:active { transform: translateY(1px) scale(0.985); }
.btn--lg { --h: 50px; padding-inline: 1.4rem; font-size: 1.02rem; }
.btn--primary { background: var(--sc-ink); color: #fff; box-shadow: var(--sc-e1), inset 0 1px 0 rgb(255 255 255 / 0.12); }
.btn--primary:hover { background: var(--eco-deep); }
.btn--ghost { background: var(--sc-surface); color: var(--sc-ink); border-color: var(--line-strong); box-shadow: var(--sc-e1); }
.btn--ghost:hover { border-color: var(--eco); color: var(--eco-deep); }
.btn--quiet { background: transparent; color: var(--sc-ink); }
.btn--quiet:hover { background: color-mix(in oklab, var(--sc-ink) 6%, transparent); }
.btn .i { transition: transform 160ms var(--sc-ease-out); }
@media (hover: hover) and (pointer: fine) { .btn--ghost:hover .i { transform: translateX(3px); } [dir="rtl"] .btn--ghost:hover .i { transform: translateX(-3px) scaleX(-1); } }

.link-arrow { display: inline-flex; align-items: center; gap: 0.4em; font-weight: 600; color: var(--eco-deep); text-decoration: none; }
.link-arrow:hover { text-decoration: underline; }

.tag {
  display: inline-flex; align-items: center; gap: 0.35em;
  font-family: var(--sc-font-mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.02em;
  padding: 0.28em 0.6em; border-radius: var(--r-1);
  background: color-mix(in oklab, var(--sc-ink) 6%, transparent); color: var(--sc-ink-soft);
}
.tag--sample { background: #FFF6DA; color: #7A5600; }
.tag--eco { background: var(--eco-tint); color: var(--eco-deep); }

/* ----------------------------------------------------------------- brand */
.brand { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--sc-ink); flex: none; }
/* Client logo (docs/brand, processed by tools/build-logo.mjs). Height sets the size. */
.brand__logo { display: block; height: 30px; width: auto; }
.brand--small .brand__logo { height: 30px; }

/* ---------------------------------------------------------------- chrome */
.chrome {
  position: fixed; inset: 0 0 auto 0; z-index: var(--sc-z-chrome);
  background: color-mix(in oklab, var(--sc-canvas) 94%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--sc-ease-out), background-color 200ms var(--sc-ease-out);
}
.chrome.is-scrolled { border-bottom-color: var(--line); background: var(--sc-canvas); }
.chrome__row {
  height: var(--chrome-h); max-width: 92rem; margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 2rem);
  display: flex; align-items: center; gap: clamp(0.75rem, 2vw, 1.75rem);
}
.chrome__nav { display: flex; gap: 0.15rem; margin-inline-start: auto; }
.chrome__nav a {
  font-size: 0.92rem; font-weight: 500; color: var(--sc-ink-soft); text-decoration: none; white-space: nowrap;
  padding: 0.5rem 0.55rem; border-radius: var(--r-1);
  transition: color 140ms var(--sc-ease-out), background-color 140ms var(--sc-ease-out);
}
.chrome__nav a:hover { color: var(--sc-ink); background: color-mix(in oklab, var(--sc-ink) 5%, transparent); }
.chrome__nav a[aria-current="true"] { color: var(--sc-ink); }
.chrome__nav a[hidden] { display: none; }
.chrome__actions { display: flex; gap: 0.35rem; align-items: center; }
.chrome__nav:empty + .chrome__actions, .chrome__nav.is-empty + .chrome__actions { margin-inline-start: auto; }

/* The ecosystem switch: a segmented control with a sliding thumb. */
.eco-switch {
  position: relative; display: inline-flex; padding: 3px; gap: 2px;
  background: color-mix(in oklab, var(--sc-ink) 6%, transparent);
  border-radius: var(--r-2);
}
.eco-switch__opt {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 0.4em;
  height: 34px; padding-inline: 0.8rem; border: 0; border-radius: 8px;
  background: transparent; color: var(--sc-ink-soft); cursor: pointer;
  font-size: 0.88rem; font-weight: 560; white-space: nowrap;
  transition: color 160ms var(--sc-ease-out);
}
.eco-switch__opt:hover { color: var(--sc-ink); }
.eco-switch__opt[aria-checked="true"] { color: var(--eco-deep); }
.eco-switch__opt:active { transform: scale(0.97); }
.eco-switch__thumb {
  position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0;
  width: var(--thumb-w, 0px); transform: translateX(var(--thumb-x, 0px));
  background: var(--sc-surface); border-radius: 8px; box-shadow: var(--sc-e1);
  transition: transform 260ms var(--sc-ease-drawer), width 260ms var(--sc-ease-drawer);
}
.eco-switch:not(.is-ready) .eco-switch__thumb { transition: none; }

@media (max-width: 1360px) { .chrome__nav { display: none; } .chrome__actions { margin-inline-start: auto; } }
@media (max-width: 960px) {
  :root { --chrome-h: 104px; }
  .chrome__row { height: auto; flex-wrap: wrap; row-gap: 0.4rem; padding-block: 0.55rem; }
  .eco-switch { order: 3; width: 100%; }
  .eco-switch__opt { flex: 1; justify-content: center; padding-inline: 0.4rem; }
  .chrome__actions .btn--quiet { display: none; }
}
@media (max-width: 400px) {
  .chrome__row { column-gap: 0.5rem; }
  .chrome__actions .btn--primary { padding-inline: 0.75rem; font-size: 0.88rem; }
}
@media (max-width: 480px) { .brand__logo { height: 24px; } }
@media (max-width: 374px) { .chrome__actions { gap: 0.2rem; } .brand__logo { height: 22px; } }
/* very narrow phones: crop the lockup to its mark (mark is 202x171 of the 1067x171 artwork) */
@media (max-width: 359px) { .chrome .brand__logo { height: 28px; width: calc(28px * 202 / 171); object-fit: cover; object-position: left center; } }

/* ======================================================== 1 · SOURCE (hero) */
.source-stage {
  display: grid; align-items: center;
  grid-template-columns: minmax(0, 4.6fr) minmax(0, 7.4fr);
  gap: clamp(1.5rem, 3.5vw, 4rem);
  padding: calc(var(--chrome-h) + 1.5rem) clamp(1.25rem, 4vw, 4rem) 2rem;
  max-width: 96rem; margin-inline: auto;
}
.source-copy { display: grid; gap: 1.4rem; align-content: center; max-width: 34rem; }
.hero-title {
  font-size: clamp(2.6rem, 1.6rem + 2.6vw, 4.4rem);
  font-weight: 640; line-height: 1; letter-spacing: -0.026em;
  font-variation-settings: "opsz" 96;
}
.hero-sub { font-size: var(--sc-t-lg); line-height: 1.45; color: var(--sc-ink-soft); max-width: 30ch; text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.4rem; }

/* The scene. Everything inside is sized in container units so the whole
   composition scales as one object. */
.scene {
  position: relative; width: 100%;
  height: min(calc(100svh - var(--chrome-h) - 4rem), 48rem);
  container-type: size;
}
.scene__inner { position: absolute; inset: 0; font-size: 1.42cqw; }
.plane { position: absolute; inset: 0; will-change: transform; }
.plane__p { position: absolute; inset: 0; transition: translate 600ms var(--sc-ease-out); }
.plane--pages  { z-index: 1; }
.plane--window { z-index: 3; }
.threads       { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.plane--front  { z-index: 5; }

/* source sheets */
.sheet {
  position: absolute; width: 45%; height: 36%;
  padding: 2.6cqw 2.8cqw;
  background: var(--paper); color: #2A3446;
  border-radius: 4px; overflow: hidden;
  box-shadow: 0 1px 1px hsl(var(--sc-shadow-color) / 0.06), 0 10px 30px -10px hsl(var(--sc-shadow-color) / 0.22);
  transform-origin: 30% 20%;
}
.sheet:nth-child(1) { top: 3%;  inset-inline-start: 0%;  rotate: -3.5deg; }
.sheet:nth-child(2) { top: 31%; inset-inline-start: 4%;  rotate: -1deg; }
.sheet:nth-child(3) { top: 59%; inset-inline-start: 1%;  rotate: 1.6deg; }
[dir="rtl"] .sheet { transform-origin: 70% 20%; }
[dir="rtl"] .sheet:nth-child(1) { rotate: 3.5deg; }
[dir="rtl"] .sheet:nth-child(2) { rotate: 1deg; }
[dir="rtl"] .sheet:nth-child(3) { rotate: -1.6deg; }
.sheet__run { display: flex; justify-content: space-between; font-family: var(--sc-font-mono); font-size: 0.78em; color: #7A8496; letter-spacing: 0.02em; }
.sheet__head { font-family: var(--sc-font-display); font-weight: 650; font-size: 1.32em; color: #1B2740; margin: 0.6em 0 0.35em; letter-spacing: -0.01em; }
.sheet__text { font-size: 1em; line-height: 1.55; }
.sheet__text mark {
  color: inherit; padding: 0.04em 0.1em; border-radius: 2px;
  background: linear-gradient(transparent 12%, var(--eco-mark) 12%, var(--eco-mark) 92%, transparent 92%);
  transition: background-color 200ms var(--sc-ease-out), box-shadow 200ms var(--sc-ease-out);
}
.sheet__text mark.is-lit { background: color-mix(in oklab, var(--eco) 30%, transparent); box-shadow: 0 0 0 1px color-mix(in oklab, var(--eco) 45%, transparent); }
.sheet { display: flex; flex-direction: column; }
.sheet__lines {
  flex: 1; margin-top: 0.9em; min-height: 0;
  background: repeating-linear-gradient(to bottom, #E9EBEE 0 0.45em, transparent 0.45em 1.55em);
  -webkit-mask-image: linear-gradient(to right, #000 70%, transparent); mask-image: linear-gradient(to right, #000 70%, transparent);
  border-radius: 1em;
}
[dir="rtl"] .sheet__lines { -webkit-mask-image: linear-gradient(to left, #000 70%, transparent); mask-image: linear-gradient(to left, #000 70%, transparent); }
.sheet__anchor { color: var(--eco-deep); font-weight: 600; }


/* mini workbench window (mid plane) */
.mwin {
  position: absolute; top: 9%; inset-inline-start: 52%; width: 48%;
  display: flex; flex-direction: column;
  background: var(--sc-surface); border-radius: 1.1cqw; overflow: hidden;
  box-shadow: var(--sc-e3), 0 0 0 1px var(--line);
}
.mwin__bar { display: flex; align-items: center; gap: 0.6em; padding: 0.9em 1.1em; border-bottom: 1px solid var(--line); }
.mwin__dots { display: flex; gap: 0.35em; }
.mwin__dots i { width: 0.6em; height: 0.6em; border-radius: 50%; background: #DDE1E7; }
.mwin__file { font-family: var(--sc-font-mono); font-size: 0.9em; color: var(--sc-ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mwin__tabs { display: flex; gap: 0.25em; padding: 0.6em 1.1em; border-bottom: 1px solid var(--line); }
.mwin__tab { display: inline-flex; align-items: center; gap: 0.35em; font-size: 0.86em; padding: 0.35em 0.6em; border-radius: 0.4em; color: var(--sc-ink-soft); white-space: nowrap; }
.mwin__tab.is-on { background: var(--eco-tint); color: var(--eco-deep); font-weight: 600; }
.mwin__tab .i { width: 1.1em; height: 1.1em; }
.mwin__body { flex: 1; padding: 0.4em 1.1em; display: grid; align-content: start; }
.mnote { position: relative; padding: 1em 0; border-bottom: 1px solid var(--line); }
.mnote:last-child { border-bottom: 0; }
.mnote__top { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; }
.mnote__label { font-family: var(--sc-font-display); font-weight: 650; font-size: 1.12em; color: var(--sc-ink); letter-spacing: -0.01em; }
.mnote__cite { font-family: var(--sc-font-mono); font-size: 0.82em; color: var(--eco-deep); background: var(--eco-tint); padding: 0.15em 0.45em; border-radius: 0.35em; white-space: nowrap; }
.mnote__text { font-size: 0.98em; line-height: 1.5; color: var(--sc-ink-soft); margin-top: 0.35em; }
.mnote__skel { position: absolute; inset: 1em 0 1em 0; display: grid; gap: 0.6em; align-content: start; opacity: 0; transition: opacity 260ms var(--sc-ease-out); }
.mnote__skel i { display: block; height: 0.75em; border-radius: 1em; background: linear-gradient(90deg, #EEF0F3, #F6F7F9, #EEF0F3); }
.mnote__skel i:nth-child(1) { width: 46%; height: 0.95em; }
.mnote__skel i:nth-child(3) { width: 72%; }
.mnote__real { transition: opacity 320ms var(--sc-ease-out); }
.mnote[data-state="pending"] .mnote__real { opacity: 0; }
.mnote[data-state="pending"] .mnote__skel { opacity: 1; }
.mnote.is-lit .mnote__label { color: var(--eco-deep); }
.mwin__guard { display: flex; gap: 0.6em; align-items: center; font-size: 0.9em; color: var(--sc-ink-soft); padding-top: 0.9em; }
.mwin__guard .i { color: var(--eco); width: 1.2em; height: 1.2em; }
.mwin__status {
  display: flex; align-items: center; gap: 0.5em;
  padding: 0.7em 1.1em; border-top: 1px solid var(--line); background: #FAFBFA;
  font-family: var(--sc-font-mono); font-size: 0.82em; color: var(--sc-ink-soft);
}
.mwin__status b { color: var(--sc-ink); font-weight: 600; }
.mwin__status .tag--sample { margin-inline-start: auto; font-size: 0.95em; }
.mwin__pip { width: 0.55em; height: 0.55em; border-radius: 50%; background: var(--eco); }

/* front plane: generated artefacts */
.fcard {
  position: absolute; top: 63%; inset-inline-start: 53%; width: 34%;
  background: var(--sc-surface); border-radius: 1cqw; padding: 1.2em 1.3em;
  box-shadow: var(--sc-e3), 0 0 0 1px var(--line);
}
.fcard__real { transition: opacity 320ms var(--sc-ease-out); }
.fcard[data-state="pending"] .fcard__real { opacity: 0; }
.fcard__skel { inset: auto 1.3em 1.2em 1.3em; top: 3.2em; }
.fcard[data-state="pending"] .fcard__skel { opacity: 1; }
.fcard__top { display: flex; justify-content: space-between; align-items: center; gap: 1em; font-size: 0.82em; color: var(--sc-ink-soft); }
.fcard__kind { display: inline-flex; align-items: center; gap: 0.4em; font-weight: 600; }
.fcard__kind .i { color: var(--eco); }
.fcard__q { font-family: var(--sc-font-display); font-weight: 650; font-size: 1.28em; line-height: 1.2; margin-top: 0.55em; color: var(--sc-ink); letter-spacing: -0.012em; }
.fcard__hint { font-size: 0.88em; color: var(--sc-ink-soft); margin-top: 0.5em; }
.fcard.is-lit .fcard__q { color: var(--eco-deep); }
.rchip {
  position: absolute; top: 80%; inset-inline-start: 73%; width: 27%;
  display: grid; grid-template-columns: auto 1fr; gap: 0.2em 0.8em; align-items: center;
  background: var(--sc-ink); color: #fff; border-radius: 1cqw; padding: 1em 1.2em;
  box-shadow: var(--sc-e3);
}
.rchip__icon { grid-row: span 2; width: 2.4em; height: 2.4em; border-radius: 0.6em; display: grid; place-items: center; background: color-mix(in oklab, var(--eco) 75%, #000 0%); }
.rchip__icon .i { width: 1.3em; height: 1.3em; color: #fff; }
.rchip__label { font-size: 0.8em; color: rgb(255 255 255 / 0.72); letter-spacing: 0.01em; }
.rchip__text { font-weight: 600; font-size: 1em; line-height: 1.25; }
.rchip__xp { grid-column: 2; font-family: var(--sc-font-mono); font-size: 0.8em; color: #A7F3C9; }
:root[data-eco="higher_ed"] .rchip__xp { color: #C7C3FF; }
:root[data-eco="enterprise"] .rchip__xp { color: #FFC9AE; }

/* threads */
.thread { fill: none; stroke: var(--eco); stroke-width: 1.6; stroke-linecap: round; }
.thread-dot { fill: var(--sc-surface); stroke: var(--eco); stroke-width: 1.6; transition: opacity 200ms var(--sc-ease-out); }
.thread-end { fill: var(--eco); transition: opacity 200ms var(--sc-ease-out); }
.threads .is-lit .thread { stroke-width: 2.4; }

/* ---------------------------------------------------------- hero mobile */
@media (max-width: 860px) {
  .source-stage {
    grid-template-columns: 1fr; align-content: start; gap: 1.1rem;
    padding: calc(var(--chrome-h) + 1.1rem) 1rem 1rem;
  }
  .source-copy { gap: 0.9rem; }
  .hero-title { font-size: clamp(2rem, 8.4vw, 2.6rem); }
  .hero-sub { font-size: 1.02rem; max-width: 36ch; }
  .hero-actions .btn--lg { --h: 46px; padding-inline: 1.1rem; font-size: 0.96rem; }
  /* Phone: a cropped detail of the same desk. Pages bleed off the left
     edge, the window off the right, and the threads cross the gap between. */
  .scene { height: calc(100svh - var(--chrome-h) - 17.5rem); min-height: 250px; max-height: 30rem; margin-inline: -1rem; width: calc(100% + 2rem); overflow: clip; }
  .scene__inner { font-size: 2.85cqw; }
  .sheet { width: 60%; height: 34%; inset-inline-start: -12% !important; padding-block: 2.4cqw; padding-inline: 14cqw 3cqw; }
  .sheet:nth-child(1) { top: 2%; }
  .sheet:nth-child(2) { top: 29%; }
  .sheet:nth-child(3) { top: 56%; }
  .sheet__run span:first-child { display: none; }
  .sheet__run { justify-content: flex-end; }
  .sheet__head { margin-top: 0.1em; }
  .sheet__text { font-size: 0.95em; }
  .sheet__before, .sheet__after, .sheet__lines { display: none; }
  .mwin { inset-inline-start: 53%; width: 62%; top: 4%; }
  .mwin__tabs, .mnote__text, .mwin__guard { display: none; }
  .mnote { padding: 0.75em 0; }
  .mnote__top { justify-content: flex-start; }
  .mwin__status { white-space: nowrap; }
  .fcard { inset-inline-start: 53%; width: 58%; top: 58%; }
  .fcard__hint { display: none; }
  .rchip { inset-inline-start: 60%; width: 50%; top: 80%; padding: 0.7em 0.9em; }
}
@media (max-width: 860px) and (max-height: 700px) {
  .hero-sub { display: none; }
}

/* ======================================================== 2 · WORKBENCH */
.act-wb { padding-top: clamp(4rem, 8vw, 8rem); }
.wb-head { display: grid; gap: 0.9rem; margin-bottom: clamp(1.75rem, 3vw, 2.75rem); max-width: 44rem; }
.section-title { font-size: var(--sc-t-2xl); line-height: 1.02; letter-spacing: -0.03em; font-weight: 640; font-variation-settings: "opsz" 72; }

.wb {
  background: var(--sc-surface); border-radius: var(--r-3);
  box-shadow: var(--sc-e2), 0 0 0 1px var(--line);
  overflow: hidden;
}
.wb__bar { display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--line); }
.wb__file-icon { color: var(--eco); width: 1.3rem; height: 1.3rem; }
.wb__file { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.75rem; min-width: 0; flex: 1; }
.wb__file-name { font-family: var(--sc-font-mono); font-size: 0.9rem; font-weight: 500; color: var(--sc-ink); }
.wb__file-meta { font-size: 0.85rem; color: var(--sc-ink-soft); }
.wb__body { display: grid; grid-template-columns: 17rem minmax(0, 1fr); min-height: 30rem; }
.wb__tabs { display: flex; flex-direction: column; padding: 0.75rem; gap: 2px; border-inline-end: 1px solid var(--line); background: #FAFBFA; }
.wb-tab {
  display: grid; grid-template-columns: auto 1fr; gap: 0.1rem 0.7rem; align-items: center;
  text-align: start; padding: 0.7rem 0.75rem; border: 0; border-radius: var(--r-2);
  background: transparent; cursor: pointer; color: var(--sc-ink-soft);
  transition: background-color 140ms var(--sc-ease-out), color 140ms var(--sc-ease-out);
}
.wb-tab .i { grid-row: span 2; width: 1.25rem; height: 1.25rem; }
.wb-tab__name { font-weight: 600; font-size: 0.95rem; color: var(--sc-ink); }
.wb-tab__desc { font-size: 0.8rem; line-height: 1.35; }
.wb-tab:hover { background: color-mix(in oklab, var(--sc-ink) 5%, transparent); }
.wb-tab[aria-selected="true"] { background: var(--sc-surface); box-shadow: var(--sc-e1), 0 0 0 1px var(--line); }
.wb-tab[aria-selected="true"] .i { color: var(--eco); }
.wb-tab:active { transform: scale(0.99); }
.wb__panel { padding: clamp(1.25rem, 2.4vw, 2.25rem); min-width: 0; outline-offset: -3px; }
.wb__foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1rem;
  padding: 0.95rem 1.25rem; border-top: 1px solid var(--line); background: #FAFBFA; font-size: 0.95rem; color: var(--sc-ink-soft);
}

/* panel content */
.pnl { display: grid; gap: 1.25rem; animation: pnl-in 260ms var(--sc-ease-out); }
@keyframes pnl-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pnl__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 0.5rem 1rem; }
.pnl__title { font-size: var(--sc-t-xl); line-height: 1.1; letter-spacing: -0.02em; font-weight: 640; max-width: 28ch; }
.pnl__lede { color: var(--sc-ink-soft); max-width: 60ch; }

.notes { list-style: none; margin: 0; padding: 0; display: grid; }
.note { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.35rem 1.25rem; padding: 1.1rem 0; border-top: 1px solid var(--line); }
.note:last-child { border-bottom: 1px solid var(--line); }
.note__label { font-family: var(--sc-font-display); font-weight: 640; font-size: 1.1rem; letter-spacing: -0.01em; }
.note__text { grid-column: 1; color: var(--sc-ink-soft); max-width: 62ch; }
.note__cite { grid-column: 2; grid-row: 1 / span 2; align-self: start; }

/* flashcards */
.deck { display: grid; gap: 1rem; justify-items: center; }
.deck__meta { font-size: 0.85rem; color: var(--sc-ink-soft); }
.flip { perspective: 1400px; width: min(100%, 36rem); }
.flip__card {
  position: relative; display: grid; width: 100%; min-height: 15rem; border: 0; padding: 0; cursor: pointer;
  background: none; transform-style: preserve-3d; transition: transform 520ms var(--sc-ease-drawer);
  border-radius: var(--r-3); text-align: center;
}
.flip__card.is-flipped { transform: rotateY(180deg); }
.flip__face {
  grid-area: 1 / 1; display: grid; place-content: center; gap: 0.8rem; padding: 2rem 2.25rem;
  border-radius: var(--r-3); backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--sc-surface); box-shadow: var(--sc-e2), 0 0 0 1px var(--line);
}
.flip__face--back { transform: rotateY(180deg); background: var(--eco-wash); box-shadow: var(--sc-e2), 0 0 0 1px color-mix(in oklab, var(--eco) 30%, transparent); }
.flip__q { font-family: var(--sc-font-display); font-size: 1.35rem; line-height: 1.22; font-weight: 640; letter-spacing: -0.015em; }
.flip__a { font-size: 1.05rem; line-height: 1.5; }
.flip__hook { font-size: 0.9rem; color: var(--eco-deep); font-weight: 560; }
.flip__label { font-family: var(--sc-font-mono); font-size: 0.72rem; color: var(--sc-ink-soft); letter-spacing: 0.04em; text-transform: uppercase; }
.deck__ctrl { display: flex; gap: 0.5rem; align-items: center; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: var(--r-2);
  border: 1px solid var(--line-strong); background: var(--sc-surface); color: var(--sc-ink); cursor: pointer;
  transition: border-color 140ms var(--sc-ease-out), transform 120ms var(--sc-ease-out);
}
.icon-btn:hover { border-color: var(--eco); }
.icon-btn:active { transform: scale(0.96); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* quiz */
.quiz__q { font-family: var(--sc-font-display); font-size: 1.25rem; font-weight: 620; line-height: 1.3; letter-spacing: -0.012em; max-width: 52ch; }
.quiz__opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.opt {
  display: flex; align-items: center; gap: 0.7rem; text-align: start;
  padding: 0.9rem 1rem; border-radius: var(--r-2); border: 1px solid var(--line-strong);
  background: var(--sc-surface); cursor: pointer; font-size: 0.98rem; line-height: 1.35;
  transition: border-color 140ms var(--sc-ease-out), background-color 140ms var(--sc-ease-out), transform 120ms var(--sc-ease-out);
}
.opt:hover { border-color: var(--eco); }
.opt:active { transform: scale(0.99); }
.opt__key { flex: none; width: 1.7rem; height: 1.7rem; display: grid; place-items: center; border-radius: var(--r-1); background: color-mix(in oklab, var(--sc-ink) 6%, transparent); font-family: var(--sc-font-mono); font-size: 0.8rem; font-weight: 600; }
.opt.is-right { border-color: var(--eco); background: var(--eco-wash); }
.opt.is-right .opt__key { background: var(--eco); color: #fff; }
.opt.is-wrong { border-color: #D9A7A7; background: #FDF6F5; }
.quiz__fb { min-height: 3.2rem; padding: 0.85rem 1rem; border-radius: var(--r-2); background: #F6F7F8; color: var(--sc-ink-soft); font-size: 0.95rem; display: flex; gap: 0.6rem; align-items: flex-start; }
.quiz__fb .i { margin-top: 0.15em; }
.quiz__fb.is-right { background: var(--eco-tint); color: var(--eco-deep); }
.quiz__fb.is-wrong { background: #FBEFEC; color: #8A2A1A; }

/* visual sim */
.sim { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.5rem; align-items: center; }
.sim__canvas { width: 100%; aspect-ratio: 16 / 10; border-radius: var(--r-2); background: #0D1B33; display: block; }
.sim__canvas--light { background: #FBFCFB; box-shadow: inset 0 0 0 1px var(--line); }
.sim__ctrl { display: grid; gap: 0.9rem; }
.sim__readout { font-family: var(--sc-font-display); font-size: 1.2rem; font-weight: 620; line-height: 1.25; letter-spacing: -0.01em; }
.sim__state { font-size: 0.95rem; color: var(--sc-ink-soft); }
.sim__scale { display: flex; justify-content: space-between; font-family: var(--sc-font-mono); font-size: 0.75rem; color: var(--sc-ink-soft); }
input[type="range"] { width: 100%; accent-color: var(--eco); height: 28px; cursor: pointer; }
.lanes { display: grid; gap: 0.4rem; }
.lane { display: grid; grid-template-columns: 3rem 1fr auto; gap: 0.75rem; align-items: center; padding: 0.6rem 0.8rem; border-radius: var(--r-2); background: #F6F7F8; color: var(--sc-ink-soft); font-size: 0.9rem; transition: background-color 180ms var(--sc-ease-out), color 180ms var(--sc-ease-out); }
.lane b { font-family: var(--sc-font-mono); color: var(--sc-ink); }
.lane.is-on { background: var(--sc-ink); color: rgb(255 255 255 / 0.8); }
.lane.is-on b { color: #fff; }
/* threshold explorer (live visual for any subject) */
.bands { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.band { display: grid; grid-template-columns: minmax(7rem, auto) 1fr; gap: 0.75rem; align-items: baseline; padding: 0.6rem 0.8rem; border-radius: var(--r-2); background: #F6F7F8; color: var(--sc-ink-soft); font-size: 0.9rem; line-height: 1.45; transition: background-color 180ms var(--sc-ease-out), color 180ms var(--sc-ease-out); }
.band b { font-family: var(--sc-font-mono); font-size: 0.82rem; color: var(--sc-ink); white-space: nowrap; }
.band.is-on { background: var(--sc-ink); color: rgb(255 255 255 / 0.85); }
.band.is-on b { color: #fff; }
@media (max-width: 600px) { .band { grid-template-columns: 1fr; gap: 0.2rem; } }
[data-nextq] { margin-top: 0.8rem; justify-self: start; }
[data-nextq][hidden] { display: none; }

/* video storyboard */
.reel { display: grid; gap: 1rem; }
.reel__screen {
  position: relative; border-radius: var(--r-2); background: #0D1B33; color: #fff; overflow: hidden;
  aspect-ratio: 16 / 7; display: grid; align-content: end; padding: 1.25rem 1.5rem;
}
.reel__scene-name { font-family: var(--sc-font-display); font-size: clamp(1.2rem, 2.2vw, 1.7rem); font-weight: 620; letter-spacing: -0.015em; }
.reel__caption { color: rgb(255 255 255 / 0.78); max-width: 52ch; margin-top: 0.3rem; }
.reel__time { position: absolute; top: 1rem; inset-inline-end: 1.25rem; font-family: var(--sc-font-mono); font-size: 0.8rem; color: rgb(255 255 255 / 0.7); }
.reel__glyph { position: absolute; top: 1rem; inset-inline-start: 1.25rem; width: 2.2rem; height: 2.2rem; color: color-mix(in oklab, var(--eco) 60%, #fff); }
.reel__bar { height: 4px; border-radius: 4px; background: #E6E9EC; overflow: hidden; }
.reel__fill { height: 100%; background: var(--eco); transform-origin: left; transform: scaleX(0); }
[dir="rtl"] .reel__fill { transform-origin: right; }
.reel__row { display: flex; align-items: center; gap: 0.75rem; }
.scenes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; }
.scene-btn {
  display: grid; gap: 0.2rem; text-align: start; padding: 0.7rem 0.8rem; border-radius: var(--r-2);
  border: 1px solid var(--line); background: var(--sc-surface); cursor: pointer; color: var(--sc-ink-soft); font-size: 0.82rem; line-height: 1.35;
  transition: border-color 140ms var(--sc-ease-out), background-color 140ms var(--sc-ease-out);
}
.scene-btn b { font-family: var(--sc-font-mono); font-weight: 500; font-size: 0.75rem; color: var(--sc-ink-soft); }
.scene-btn span { color: var(--sc-ink); font-weight: 600; }
.scene-btn[aria-current="true"] { border-color: var(--eco); background: var(--eco-wash); }

/* progress */
.prog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.stat { padding: 1rem 1.1rem; border-radius: var(--r-2); background: #F6F7F8; display: grid; gap: 0.25rem; }
.stat__k { font-size: 0.8rem; color: var(--sc-ink-soft); display: flex; align-items: center; gap: 0.4rem; }
.stat__k .i { color: var(--eco); }
.stat__v { font-family: var(--sc-font-display); font-size: 1.25rem; font-weight: 640; letter-spacing: -0.015em; line-height: 1.15; }
.skills { display: grid; gap: 1rem; }
.skill { display: grid; gap: 0.4rem; }
.skill__row { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.95rem; }
.skill__row b { font-family: var(--sc-font-mono); font-weight: 500; }
.skill__bar { height: 8px; border-radius: 8px; background: #E9ECEE; overflow: hidden; }
.skill__fill { height: 100%; background: var(--eco); border-radius: 8px; transform-origin: left; transform: scaleX(0); transition: transform 900ms var(--sc-ease-out); }
.skill.is-in .skill__fill { transform: scaleX(var(--v)); }

@media (max-width: 900px) {
  .wb__body { grid-template-columns: 1fr; min-height: 0; }
  .wb__tabs { flex-direction: row; overflow-x: auto; border-inline-end: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; padding: 0.5rem; }
  .wb-tab { grid-template-columns: auto auto; flex: none; padding: 0.55rem 0.75rem; }
  .wb-tab .i { grid-row: auto; }
  .wb-tab__desc { display: none; }
  .quiz__opts, .sim, .prog { grid-template-columns: 1fr; }
  .scenes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .note { grid-template-columns: 1fr; }
  .note__cite { grid-column: 1; grid-row: auto; justify-self: start; }
}

/* ------------------------------------------------------------------ foot */
.foot { border-top: 1px solid var(--line); padding-block: clamp(2.5rem, 5vw, 4rem) 1.5rem; background: var(--sc-surface); }
.foot__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr) 1.4fr; gap: 2rem; }
.foot__brand { display: grid; gap: 0.9rem; align-content: start; }
.foot__brand p { font-size: 0.92rem; color: var(--sc-ink-soft); max-width: 34ch; }
.foot h3 { margin-bottom: 0.8rem; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.foot li a, .foot li button {
  font: inherit; font-size: 0.92rem; color: var(--sc-ink-soft); text-decoration: none; background: none; border: 0; padding: 0.15rem 0; cursor: pointer; text-align: start;
  transition: color 140ms var(--sc-ease-out);
}
.foot li a:hover, .foot li button:hover { color: var(--sc-ink); text-decoration: underline; }
.foot__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--sc-ink-soft); }
.foot__base a { color: inherit; }
@media (max-width: 960px) {
  .foot__grid { grid-template-columns: 1fr 1fr; }
  .foot__brand { grid-column: 1 / -1; }
}

/* --------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .plane, .plane__p { transform: none !important; translate: none !important; }
  .pnl { animation: none; }
  .flip__card { transition: none; }
  .skill__fill { transition: none; }
  .eco-switch__thumb { transition: none; }
}

/* ============================================================ 3 · TUTOR */
.act-tutor { margin-top: clamp(4rem, 8vw, 8rem); }
.tutor-stage {
  display: grid; grid-template-columns: minmax(0, 4.4fr) minmax(0, 7.6fr); gap: clamp(1.5rem, 4vw, 4.5rem);
  align-items: center; max-width: 92rem; margin-inline: auto;
  padding: calc(var(--chrome-h) + 1.5rem) clamp(1.25rem, 4vw, 4rem) 1.5rem;
}
.tutor-side { display: grid; gap: 1.6rem; align-content: center; }
.tutor-intro { display: grid; gap: 0.8rem; }
.tutor-intro .sc-body { font-size: 1rem; }
.wlabel {
  display: block; font-family: var(--sc-font-mono); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--sc-ink-soft);
}
.tq { display: grid; gap: 0.45rem; padding: 1.1rem 1.25rem; border-radius: var(--r-3); background: var(--sc-ink); color: #fff; box-shadow: var(--sc-e2); }
.tq__who { font-size: 0.82rem; color: rgb(255 255 255 / 0.7); }
.tq__q { font-family: var(--sc-font-display); font-size: clamp(1.2rem, 0.9rem + 0.8vw, 1.55rem); font-weight: 620; line-height: 1.22; letter-spacing: -0.015em; text-wrap: balance; }
.tmodes-wrap { display: grid; gap: 0.6rem; }
.tmodes { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tmode {
  position: relative; width: 100%; display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.75rem; border: 0; border-radius: var(--r-2); background: transparent; cursor: pointer;
  color: var(--sc-ink-soft); font-size: 0.98rem; font-weight: 520; text-align: start;
  transition: background-color 180ms var(--sc-ease-out), color 180ms var(--sc-ease-out);
}
.tmode .i { width: 1.2rem; height: 1.2rem; transition: color 180ms var(--sc-ease-out); }
.tmode:hover { color: var(--sc-ink); background: color-mix(in oklab, var(--sc-ink) 5%, transparent); }
.tmode.is-past { color: var(--sc-ink); }
.tmode.is-past .i { color: var(--eco); }
.tmode[aria-current="true"] { background: var(--sc-surface); color: var(--sc-ink); font-weight: 620; box-shadow: var(--sc-e1), 0 0 0 1px var(--line); }
.tmode[aria-current="true"] .i { color: var(--eco); }
.tmode[aria-current="true"]::after {
  content: ""; position: absolute; inset-inline-end: 0.85rem; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--eco);
}

/* the answer frame: six answers stacked in one cell, one showing */
.tutor-frame { display: grid; min-width: 0; }
.tans {
  grid-area: 1 / 1; align-self: center; display: grid; gap: 1.1rem;
  padding: clamp(1.25rem, 2.2vw, 2rem); border-radius: var(--r-3);
  background: var(--sc-surface); box-shadow: var(--sc-e3), 0 0 0 1px var(--line);
  opacity: 0; transform: translateY(14px) scale(0.985); pointer-events: none;
  transition: opacity 320ms var(--sc-ease-out), transform 420ms var(--sc-ease-out);
}
.tans.is-past { transform: translateY(-14px) scale(0.985); }
.tans.is-on { opacity: 1; transform: none; pointer-events: auto; }
.tans__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; }
.tans__mode { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--sc-font-display); font-size: clamp(1.35rem, 1rem + 1vw, 1.85rem); font-weight: 650; letter-spacing: -0.02em; }
.tans__mode .i { width: 1.6rem; height: 1.6rem; color: var(--eco); padding: 0.35rem; box-sizing: content-box; border-radius: var(--r-2); background: var(--eco-tint); }
.tans__widget { font-family: var(--sc-font-mono); font-size: 0.78rem; color: var(--sc-ink-soft); background: #F3F4F6; padding: 0.25em 0.55em; border-radius: var(--r-1); }
.tans__rule { display: flex; gap: 0.75rem; align-items: baseline; font-size: 0.98rem; color: var(--sc-ink); padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.tans__rule span { flex: none; font-family: var(--sc-font-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--eco-deep); background: var(--eco-tint); padding: 0.2em 0.5em; border-radius: var(--r-1); }
.tans__body { min-height: 15rem; display: grid; align-content: center; }
.tans__foot { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: space-between; }

/* shared widget atoms */
.wtext { font-size: 1.05rem; line-height: 1.55; color: var(--sc-ink); max-width: 60ch; }
.wnote { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.95rem; line-height: 1.5; color: var(--sc-ink); padding: 0.85rem 1rem; border-radius: var(--r-2); background: var(--eco-wash); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--eco) 18%, transparent); }
.wnote .i { color: var(--eco); margin-top: 0.15em; }
.wbadge { justify-self: start; display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--sc-font-mono); font-size: 0.8rem; color: var(--eco-deep); background: var(--eco-tint); padding: 0.35em 0.65em; border-radius: var(--r-1); }
.wbar { position: relative; display: block; height: 8px; border-radius: 8px; background: #E9ECEE; overflow: hidden; }
.wbar i { position: absolute; inset: 0; background: var(--eco); border-radius: 8px; transform-origin: left; transform: scaleX(var(--v)); }
[dir="rtl"] .wbar i { transform-origin: right; }

/* analogy */
.wa { display: grid; gap: 1.1rem; }
.wa__pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.75rem; align-items: stretch; }
.wa__cell { display: grid; gap: 0.35rem; padding: 1rem 1.1rem; border-radius: var(--r-2); background: #F5F6F7; }
.wa__cell b { font-family: var(--sc-font-display); font-size: 1.15rem; font-weight: 640; letter-spacing: -0.01em; }
.wa__cell--alt { background: var(--eco-tint); }
.wa__eq { display: grid; place-items: center; color: var(--eco); }
[dir="rtl"] .wa__eq .i { transform: scaleX(-1); }

/* three acts */
.wacts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.7rem; }
.wacts__card { display: grid; align-content: start; gap: 0.4rem; padding: 1.1rem; border-radius: var(--r-2); background: #F5F6F7; }
.wacts__card:nth-child(3) { background: var(--eco-tint); }
.wacts__card b { font-family: var(--sc-font-display); font-size: 1.2rem; font-weight: 650; letter-spacing: -0.012em; }
.wacts__card p { color: var(--sc-ink-soft); font-size: 0.95rem; line-height: 1.5; }

/* step ladder */
.wsteps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.wsteps__s { display: flex; gap: 0.85rem; align-items: center; padding: 0.85rem 1rem; border-radius: var(--r-2); background: var(--eco-tint); color: var(--sc-ink); font-size: 1rem; }
.wsteps__n { flex: none; width: 1.9rem; height: 1.9rem; display: grid; place-items: center; border-radius: 50%; background: var(--eco); color: #fff; font-family: var(--sc-font-mono); font-size: 0.85rem; font-weight: 600; }
.wsteps__s.is-locked { background: #F5F6F7; color: var(--sc-ink-soft); }
.wsteps__s.is-locked .wsteps__n { background: #E3E6EA; color: var(--sc-ink-soft); }
.wsteps__n .i { width: 0.95rem; height: 0.95rem; }
.wsteps__s.is-final { background: transparent; border: 1px dashed var(--line-strong); color: var(--sc-ink-soft); font-size: 0.92rem; }
.wsteps__s.is-final > .i { margin-inline: 0.45rem; }

/* clues */
.wclues { display: grid; gap: 0.6rem; }
.wclues__c { display: grid; gap: 0.3rem; padding: 1rem 1.1rem; border-radius: var(--r-2); background: #F5F6F7; font-size: 1.02rem; line-height: 1.5; }
.wclues__c:nth-child(2) { background: var(--eco-tint); margin-inline-start: 1.5rem; }
.wclues__c.is-locked { display: flex; gap: 0.7rem; align-items: center; margin-inline-start: 3rem; background: transparent; border: 1px dashed var(--line-strong); color: var(--sc-ink-soft); font-size: 0.92rem; }

/* quiz, drill, decision tree */
.wq { display: grid; gap: 0.9rem; }
.wq__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; align-items: baseline; }
.wq__q { font-family: var(--sc-font-display); font-size: 1.2rem; font-weight: 630; letter-spacing: -0.012em; line-height: 1.3; }
.wq__stage { font-family: var(--sc-font-mono); font-size: 0.8rem; color: #fff; background: var(--sc-ink); padding: 0.2em 0.5em; border-radius: var(--r-1); vertical-align: 0.15em; }
.wq__meta { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--sc-font-mono); font-size: 0.78rem; color: var(--eco-deep); }
.wq__opts { display: grid; gap: 0.5rem; }
.wq__opt {
  display: flex; gap: 0.75rem; align-items: center; text-align: start; padding: 0.8rem 0.95rem;
  border-radius: var(--r-2); border: 1px solid var(--line-strong); background: var(--sc-surface); cursor: pointer; font-size: 0.98rem;
  transition: border-color 140ms var(--sc-ease-out), background-color 140ms var(--sc-ease-out), transform 120ms var(--sc-ease-out);
}
.wq__opt:hover { border-color: var(--eco); }
.wq__opt:active { transform: scale(0.99); }
.wq__opt:disabled { opacity: 0.45; cursor: default; }
.wq__opt.is-right { border-color: var(--eco); background: var(--eco-wash); }
.wq__opt.is-right .opt__key { background: var(--eco); color: #fff; }
.wq__opt.is-wrong { border-color: #D9A7A7; background: #FDF6F5; }
.wq__fb { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.75rem 0.95rem; border-radius: var(--r-2); background: #F5F6F7; color: var(--sc-ink-soft); font-size: 0.93rem; min-height: 2.9rem; }
.wq__fb .i { margin-top: 0.15em; }
.wq__fb.is-right { background: var(--eco-tint); color: var(--eco-deep); }
.wq__fb.is-wrong { background: #FBEFEC; color: #8A2A1A; }

/* buckets */
.wbk { display: grid; gap: 1rem; }
.wbk__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.wbk__col { display: grid; gap: 0.6rem; align-content: start; padding: 1rem; border-radius: var(--r-2); background: #F5F6F7; }
.wbk__chip { font-weight: 560; font-size: 0.98rem; }
.wbk__meter { display: block; height: 6px; border-radius: 6px; background: #E3E6EA; overflow: hidden; }
.wbk__meter i { display: block; height: 100%; background: var(--eco); transform-origin: left; transform: scaleX(var(--lvl)); }

/* premise (HE socratic) */
.wpm { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.25rem; align-items: center; }
.wpm__rows { display: grid; gap: 1rem; }
.wpm__rows > div { display: grid; gap: 0.35rem; }
.wpm__premise { font-family: var(--sc-font-display); font-size: 1.2rem; font-weight: 620; text-decoration: line-through; text-decoration-color: color-mix(in oklab, var(--eco) 70%, transparent); text-decoration-thickness: 2px; }
.wpm__chart { width: 100%; height: auto; background: #FAFBFA; border-radius: var(--r-2); box-shadow: inset 0 0 0 1px var(--line); }

/* clarity, scorecard */
.wcl, .wsc { display: grid; gap: 1rem; }
.wcl__said { margin: 0; padding: 0.9rem 1.1rem; border-radius: var(--r-2); background: #F5F6F7; font-size: 1.02rem; line-height: 1.5; font-style: italic; color: var(--sc-ink); }
.wcl__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1.25rem; }
.wcl__score { display: grid; gap: 0.4rem; }
.wcl__score b { font-family: var(--sc-font-display); font-size: 2rem; font-weight: 650; line-height: 1; letter-spacing: -0.02em; }
.wcl__score small { font-size: 0.9rem; color: var(--sc-ink-soft); font-weight: 500; }
.wcl__chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.wcl__chips s { font-family: var(--sc-font-mono); font-size: 0.82rem; padding: 0.3em 0.6em; border-radius: var(--r-1); background: #FBEFEC; color: #8A2A1A; text-decoration-thickness: 1.5px; }
.wsc__bars { display: grid; gap: 0.7rem; }
.wsc__b { display: grid; grid-template-columns: 9.5rem 1fr 2.5rem; gap: 1rem; align-items: center; font-size: 0.95rem; }
.wsc__b b { font-family: var(--sc-font-mono); font-weight: 500; text-align: end; }

/* IRAC */
.wirac { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.wirac > div { display: grid; gap: 0.35rem; align-content: start; padding: 1rem 1.1rem; border-radius: var(--r-2); background: #F5F6F7; }
.wirac > div:last-child { background: var(--eco-tint); }
.wirac dd { margin: 0; font-size: 0.98rem; line-height: 1.5; }

/* sparring */
.wsp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.wsp__side { display: grid; gap: 0.4rem; align-content: start; padding: 1rem 1.1rem; border-radius: var(--r-2); background: #F5F6F7; font-size: 1rem; line-height: 1.5; }
.wsp__side--them { background: var(--sc-ink); color: #fff; }
.wsp__side--them .wlabel { color: rgb(255 255 255 / 0.65); }
.wsp__rigor { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; padding-top: 0.4rem; }
.wsp__rigor b { font-family: var(--sc-font-mono); font-weight: 500; }

/* study table */
.wtab { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.wtab__col { display: grid; align-content: start; gap: 0.5rem; padding: 1rem 1.1rem; border-radius: var(--r-2); background: #F5F6F7; font-size: 0.98rem; line-height: 1.5; }
.wtab__col.is-you { background: var(--eco-tint); }
.wtab__who { display: flex; align-items: baseline; gap: 0.5rem; font-family: var(--sc-font-display); font-weight: 650; font-size: 1.1rem; }
.wtab__who small { font-family: var(--sc-font-mono); font-size: 0.72rem; font-weight: 500; color: var(--sc-ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }

/* five whys */
.wwhy { display: grid; gap: 1rem; }
.wwhy ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.wwhy li { display: grid; gap: 0.25rem; padding: 0.85rem 1rem; border-radius: var(--r-2); background: #F5F6F7; margin-inline-start: calc(var(--k) * 1.5rem); font-size: 1rem; }

/* matrix */
.wmx { display: grid; gap: 1rem; }
.wmx table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.wmx th, .wmx td { padding: 0.8rem 0.6rem; text-align: start; border-bottom: 1px solid var(--line); }
.wmx thead th { font-family: var(--sc-font-mono); font-size: 0.72rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--sc-ink-soft); }
.wmx tbody th { font-weight: 620; }
.wmx tr.is-rec { background: var(--eco-wash); }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--eco); }
.dots i.off { background: #E3E6EA; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* gates, JIT stepper */
.wgates, .wjit { display: grid; gap: 0.8rem; }
.wgates ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.wgates li { display: grid; align-content: start; gap: 0.5rem; padding: 1.1rem; border-radius: var(--r-2); background: #F5F6F7; }
.wgates li p { font-family: var(--sc-font-display); font-weight: 620; font-size: 1.12rem; line-height: 1.25; letter-spacing: -0.01em; }
.wgates .mnote__cite { justify-self: start; font-size: 0.78rem; }
.wjit ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.wjit li { display: flex; gap: 0.8rem; align-items: center; padding: 0.75rem 0.95rem; border-radius: var(--r-2); background: #F5F6F7; color: var(--sc-ink-soft); }
.wjit li.is-done { color: var(--sc-ink); }
.wjit li.is-current { background: var(--sc-ink); color: #fff; }
.wjit__n { flex: none; width: 1.8rem; height: 1.8rem; display: grid; place-items: center; border-radius: 50%; background: #E3E6EA; font-family: var(--sc-font-mono); font-size: 0.82rem; color: var(--sc-ink); }
.wjit li.is-done .wjit__n, .wjit li.is-current .wjit__n { background: var(--eco); color: #fff; }
.wjit__n .i { width: 0.95rem; height: 0.95rem; }

/* tutor, tablet and phone */
@media (max-width: 1100px) {
  .tutor-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 1.5rem; }
  .tutor-intro .sc-body { display: none; }
}
@media (max-width: 860px) {
  .tutor-stage {
    grid-template-columns: minmax(0, 1fr); align-content: start; align-items: start; gap: 0.8rem;
    padding: calc(var(--chrome-h) + 0.9rem) 1rem 0.75rem;
  }
  .tutor-side { gap: 0.7rem; min-width: 0; }
  .tmodes-wrap, .tmodes { min-width: 0; }
  .tmodes li:has(.tmode[aria-current="true"]) .tmode { width: 100%; overflow: hidden; }
  .tutor-intro .section-title { font-size: 1.55rem; }
  .tq { padding: 0.75rem 0.95rem; gap: 0.25rem; }
  .tq__q { font-size: 1.05rem; }
  .tmodes-wrap > .wlabel { display: none; }
  .tmodes { display: flex; gap: 0.3rem; }
  .tmodes li { flex: none; }
  .tmode { padding: 0.5rem; gap: 0.4rem; font-size: 0.85rem; }
  .tmode .tmode__name { display: none; }
  .tmode[aria-current="true"]::after { display: none; }
  .tmodes { gap: 0.15rem; }
  .tmodes li:has(.tmode[aria-current="true"]) { flex: 1; min-width: 0; }
  .tmode { min-width: 0; padding: 0.5rem 0.45rem; }
  .tans { align-self: start; }
  .tmode[aria-current="true"] .tmode__name { display: inline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tans { gap: 0.7rem; padding: 0.95rem; }
  .tans__mode { font-size: 1.15rem; }
  .tans__mode .i { width: 1.2rem; height: 1.2rem; padding: 0.25rem; }
  .tans__widget { display: none; }
  .tans__rule { font-size: 0.85rem; padding-bottom: 0.65rem; }
  .tans__body { min-height: 0; }
  .tans__foot .tag--sample { display: none; }
  .wtext, .wcl__said, .wclues__c { font-size: 0.92rem; }
  .wa__pair { grid-template-columns: 1fr; gap: 0.4rem; }
  .wa__eq { display: none; }
  .wa__cell { padding: 0.65rem 0.8rem; }
  .wa__cell b { font-size: 1rem; }
  .wacts, .wbk__cols, .wtab, .wgates ol { grid-template-columns: 1fr; gap: 0.4rem; }
  .wacts__card, .wtab__col, .wgates li, .wbk__col { padding: 0.65rem 0.8rem; gap: 0.2rem; }
  .wacts__card b, .wgates li p { font-size: 1rem; }
  .wacts__card p, .wtab__col { font-size: 0.86rem; }
  .wbk__col { grid-template-columns: 1fr auto; align-items: center; }
  .wbk__col .wbk__meter { grid-column: 1 / -1; }
  .wsteps__s, .wjit li, .wq__opt, .wwhy li { padding: 0.6rem 0.75rem; font-size: 0.9rem; }
  .wclues__c { padding: 0.65rem 0.8rem; }
  .wclues__c:nth-child(2) { margin-inline-start: 0.75rem; }
  .wclues__c.is-locked { margin-inline-start: 1.5rem; }
  .wq__q { font-size: 1.02rem; }
  .wq__fb { min-height: 0; font-size: 0.85rem; padding: 0.55rem 0.75rem; }
  .wnote { font-size: 0.85rem; padding: 0.6rem 0.75rem; }
  .wpm, .wcl__row, .wsp, .wirac { grid-template-columns: 1fr; gap: 0.5rem; }
  .wpm__chart { display: none; }
  .wirac > div, .wsp__side { padding: 0.6rem 0.8rem; font-size: 0.86rem; }
  .wirac dd { font-size: 0.86rem; }
  .wsc__b { grid-template-columns: 7rem 1fr 2rem; font-size: 0.85rem; }
  .wwhy li { margin-inline-start: calc(var(--k) * 0.75rem); }
  .wmx th, .wmx td { padding: 0.55rem 0.35rem; font-size: 0.82rem; }
  .wmx .tag { display: none; }
}
/* ======================================================= 4 · ECOSYSTEMS */
.eco-stage { display: flex; align-items: center; padding-top: var(--chrome-h); }
.eco-rail {
  display: flex; align-items: stretch; gap: clamp(1rem, 2vw, 1.75rem); width: max-content;
  padding-inline: clamp(1.25rem, 5vw, 5rem);
}
.eco-lead, .eco-end { width: min(24rem, 78vw); flex: none; display: grid; gap: 1rem; align-content: center; }
.eco-end { width: min(18rem, 70vw); }
.eco-end p { font-family: var(--sc-font-display); font-size: 1.25rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.012em; }
.space {
  --eco: var(--space-c); --eco-deep: var(--space-d);
  width: min(30rem, 84vw); flex: none; display: grid; gap: 1rem; align-content: start;
  padding: clamp(1.25rem, 2.4vw, 2rem); border-radius: var(--r-3); background: var(--sc-surface);
  box-shadow: var(--sc-e2), 0 0 0 1px var(--line);
  transition: box-shadow 240ms var(--sc-ease-out);
}
.space[data-space="k12"]        { --space-c: #15803D; --space-d: #0E5A2B; }
.space[data-space="higher_ed"]  { --space-c: #4338CA; --space-d: #2F2799; }
.space[data-space="enterprise"] { --space-c: #C2410C; --space-d: #8F2F08; }
.space.is-current { box-shadow: var(--sc-e3), 0 0 0 2px var(--eco); }
.space__head { display: flex; gap: 0.9rem; align-items: center; }
.space__icon { width: 3rem; height: 3rem; display: grid; place-items: center; border-radius: var(--r-2); background: var(--eco-tint); color: var(--eco); }
.space__icon .i { width: 1.5rem; height: 1.5rem; }
.space__name { font-size: 1.5rem; letter-spacing: -0.02em; font-weight: 650; }
.space__aud { font-size: 0.88rem; color: var(--sc-ink-soft); }
.space__line { font-family: var(--sc-font-display); font-size: 1.2rem; font-weight: 620; line-height: 1.25; color: var(--eco-deep); letter-spacing: -0.012em; }
.space__desc { font-size: 0.95rem; color: var(--sc-ink-soft); line-height: 1.55; }
.space__list { list-style: none; margin: 0; padding: 0.9rem 0 0; border-top: 1px solid var(--line); display: grid; gap: 0.55rem; font-size: 0.93rem; }
.space__list li { display: flex; gap: 0.55rem; align-items: flex-start; }
.space__list .i { color: var(--eco); margin-top: 0.2em; }
.space__modes { display: flex; align-items: center; gap: 0.3rem; }
.space__modes > span:not(.space__modes-label) { width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%; background: var(--eco-wash); color: var(--eco); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--eco) 20%, transparent); }
.space__modes .i { width: 1rem; height: 1rem; }
.space__modes-label { margin-inline-start: 0.4rem; font-size: 0.85rem; color: var(--sc-ink-soft); }
.space__rules { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.space__rules span { font-family: var(--sc-font-mono); font-size: 0.74rem; padding: 0.25em 0.55em; border-radius: var(--r-1); background: #F3F4F6; color: var(--sc-ink); }
.space__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.25rem; }
.space__actions .btn--primary { background: var(--eco-deep); }
.space__actions .btn--primary:hover { background: var(--sc-ink); }
.space__actions [aria-pressed="true"] { color: var(--eco-deep); border-color: var(--eco); }
/* items settle in sequence as the rail travels */
@media (prefers-reduced-motion: no-preference) {
  .space { opacity: clamp(0.55, calc(var(--sc-p, 0) * 5 - (var(--n) - 1) * 1.5 + 1), 1); }
  .space[data-space="k12"] { --n: 1; } .space[data-space="higher_ed"] { --n: 2; } .space[data-space="enterprise"] { --n: 3; }
}
@media (max-width: 860px) {
  .eco-stage { align-items: flex-start; padding-top: calc(var(--chrome-h) + 1rem); }
  .space { gap: 0.7rem; padding: 1.1rem; }
  .space__desc { display: none; }
  .space__list { font-size: 0.86rem; gap: 0.4rem; padding-top: 0.7rem; }
  .space__line { font-size: 1.05rem; }
  .eco-lead .sc-body { font-size: 0.95rem; }
}
@media (max-width: 860px) and (max-height: 760px) {
  .space__list li:nth-child(n+3) { display: none; }
  .space__modes { display: none; }
}

/* ========================================================= 5 · PLATFORM */
.plat-head, .trust-head { display: grid; gap: 0.9rem; max-width: 44rem; margin-bottom: 1.75rem; }
.filter { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.25rem; }
.filter__btn {
  display: inline-flex; align-items: center; gap: 0.5rem; height: 38px; padding-inline: 0.85rem;
  border-radius: var(--r-2); border: 1px solid var(--line-strong); background: var(--sc-surface); cursor: pointer;
  font-size: 0.9rem; font-weight: 540; color: var(--sc-ink-soft);
  transition: border-color 140ms var(--sc-ease-out), color 140ms var(--sc-ease-out), background-color 140ms var(--sc-ease-out);
}
.filter__btn span { font-family: var(--sc-font-mono); font-size: 0.75rem; color: var(--sc-ink-soft); }
.filter__btn:hover { border-color: var(--eco); color: var(--sc-ink); }
.filter__btn[aria-pressed="true"] { background: var(--sc-ink); border-color: var(--sc-ink); color: #fff; }
.filter__btn[aria-pressed="true"] span { color: rgb(255 255 255 / 0.7); }
.caps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 3rem; }
.cap { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1rem; align-items: start; padding: 1.15rem 0; border-top: 1px solid var(--line); animation: pnl-in 240ms var(--sc-ease-out); }
.cap__icon { width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: var(--r-2); background: var(--eco-tint); color: var(--eco); }
.cap__icon .i { width: 1.2rem; height: 1.2rem; }
.cap__body { display: grid; gap: 0.25rem; }
.cap__name { font-size: 1.08rem; font-weight: 640; letter-spacing: -0.01em; }
.cap__desc { font-size: 0.93rem; color: var(--sc-ink-soft); line-height: 1.5; }
.cap__tag { font-family: var(--sc-font-mono); font-size: 0.7rem; color: var(--sc-ink-soft); white-space: nowrap; padding-top: 0.3rem; }
@media (max-width: 860px) {
  .caps { grid-template-columns: 1fr; }
  .cap { grid-template-columns: auto minmax(0, 1fr); }
  .cap__tag { display: none; }
}

/* ============================================================ 6 · TRUST */
.guard { margin: 0 0 clamp(2.5rem, 5vw, 4rem); display: grid; gap: 0.9rem; }
.guard__ask { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: baseline; padding: 1rem 1.25rem; border-radius: var(--r-3); background: var(--sc-ink); color: #fff; }
.guard__ask .wlabel { color: rgb(255 255 255 / 0.6); }
.guard__q { font-family: var(--sc-font-display); font-size: clamp(1.1rem, 0.9rem + 0.7vw, 1.45rem); font-weight: 600; letter-spacing: -0.012em; }
.guard__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
.guard__side { display: grid; gap: 0.75rem; align-content: start; padding: clamp(1.1rem, 2vw, 1.75rem); border-radius: var(--r-3); }
.guard__side--raw { background: #EDEFED; color: var(--sc-ink-soft); }
.guard__side--safe { background: var(--sc-surface); box-shadow: inset 0 0 0 2px var(--eco); }
.guard__who { display: inline-flex; gap: 0.5rem; align-items: center; font-weight: 600; font-size: 0.92rem; }
.guard__side--raw .guard__who .i { color: #A2483A; }
.guard__side--safe .guard__who { color: var(--eco-deep); }
.guard__text { font-size: clamp(1.02rem, 0.95rem + 0.3vw, 1.18rem); line-height: 1.5; color: var(--sc-ink); }
.guard__side--raw .guard__text { color: #4A5568; }
.guard__note { font-family: var(--sc-font-mono); font-size: 0.78rem; color: var(--sc-ink-soft); }
.guard__side--raw .guard__note { color: #A2483A; }
.guard__side--safe .guard__note { color: var(--eco-deep); }
.rails { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 2.5rem; }
.rails li { display: grid; grid-template-columns: auto 1fr; gap: 0.9rem; padding: 1.25rem 0; border-top: 1px solid var(--line); }
.rails__icon { color: var(--eco); padding-top: 0.15rem; }
.rails__icon .i { width: 1.3rem; height: 1.3rem; }
.rails h3 { font-size: 1.05rem; font-weight: 640; letter-spacing: -0.01em; margin-bottom: 0.3rem; }
.rails p { font-size: 0.93rem; color: var(--sc-ink-soft); line-height: 1.5; }
.stack { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: baseline; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 0.95rem; color: var(--sc-ink); }
@media (max-width: 960px) { .rails { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .guard__cols, .rails { grid-template-columns: 1fr; } }

/* ============================================================ 7 · START */
.start { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.start__copy { display: grid; gap: 1rem; }
.drop { display: grid; gap: 1rem; }
.drop__zone {
  position: relative; display: grid; justify-items: center; gap: 0.5rem; text-align: center;
  padding: clamp(2rem, 5vw, 3.5rem) 1.5rem; border-radius: var(--r-3); cursor: pointer;
  background: var(--sc-surface); border: 2px dashed color-mix(in oklab, var(--eco) 45%, var(--line-strong));
  transition: border-color 160ms var(--sc-ease-out), background-color 160ms var(--sc-ease-out), transform 160ms var(--sc-ease-out);
}
.drop__zone:hover, .drop__zone.is-over { border-color: var(--eco); background: var(--eco-wash); }
.drop__zone.is-over { transform: scale(1.01); }
.drop__zone.has-file { border-style: solid; border-color: var(--eco); background: var(--eco-wash); }
.drop__zone:focus-within { outline: 2px solid var(--eco); outline-offset: 3px; }
.drop__input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop__icon { width: 2.4rem; height: 2.4rem; color: var(--eco); }
.drop__title { font-family: var(--sc-font-display); font-size: 1.3rem; font-weight: 640; letter-spacing: -0.012em; overflow-wrap: anywhere; }
.drop__hint { font-family: var(--sc-font-mono); font-size: 0.8rem; color: var(--sc-ink-soft); }
.drop__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
@media (max-width: 860px) { .start { grid-template-columns: 1fr; } }

/* ========================================================== DIALOGS */
.dlg {
  width: min(40rem, calc(100vw - 2rem)); max-height: calc(100svh - 2rem); padding: 0; border: 0;
  border-radius: var(--r-3); background: var(--sc-surface); color: var(--sc-ink); box-shadow: var(--sc-e3);
}
.dlg::backdrop { background: rgb(11 33 68 / 0.42); }
.dlg[open] { animation: dlg-in 220ms var(--sc-ease-out); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.dlg__bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--sc-surface); z-index: 1; }
.dlg__body { padding: 1.5rem 1.25rem 1.75rem; display: grid; gap: 1.1rem; }
.dlg__title { font-size: 1.45rem; letter-spacing: -0.02em; font-weight: 650; }
.dlg__lede { font-size: 1.05rem; line-height: 1.55; }
.dlg__fine { font-size: 0.88rem; color: var(--sc-ink-soft); }
.dlg__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.dlg__list li { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.97rem; line-height: 1.5; }
.dlg__list .i { color: var(--eco); margin-top: 0.2em; }
.dlg__row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.dlg__file { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; padding: 0.65rem 0.85rem; border-radius: var(--r-2); background: var(--eco-wash); font-family: var(--sc-font-mono); font-size: 0.85rem; }
.dlg__file .i { color: var(--eco); }
.dlg__file small { font-family: var(--sc-font-text); color: var(--sc-ink-soft); }
.dlg__status:empty { display: none; }
.dlg__status { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.8rem 1rem; border-radius: var(--r-2); background: #FFF6DA; color: #5C4200; font-size: 0.92rem; line-height: 1.5; }
.dlg__status .i { margin-top: 0.15em; }
.dlg__status[data-tone="ok"] { background: #E3F5EC; color: #0B5A3C; }
.dlg__status[data-tone="error"] { background: #FDE8E8; color: #8A1C1C; }
/* upload progress and result under the file name */
.drop__zone[data-state="busy"] .drop__hint { color: var(--sc-ink); }
.drop__zone[data-state="ok"] .drop__hint { color: #0B5A3C; font-weight: 600; }
.drop__zone[data-state="error"] .drop__hint { color: #A12020; font-weight: 600; }
.drop__actions [hidden] { display: none; }
.dlg__hint { font-size: 0.85rem; color: var(--eco-deep); margin-top: -0.4rem; }
.dlg__form { display: grid; gap: 0.9rem; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-2); background: color-mix(in oklab, var(--sc-ink) 6%, transparent); }
.seg button { height: 34px; padding-inline: 0.9rem; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-weight: 560; font-size: 0.9rem; color: var(--sc-ink-soft); }
.seg button[aria-selected="true"] { background: var(--sc-surface); color: var(--sc-ink); box-shadow: var(--sc-e1); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.4rem; }
.steps button { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.3rem 0.6rem 0.3rem 0.3rem; border: 0; border-radius: var(--r-2); background: transparent; cursor: pointer; font-size: 0.86rem; color: var(--sc-ink-soft); }
.steps button span { width: 1.5rem; height: 1.5rem; display: grid; place-items: center; border-radius: 50%; background: #E9ECEE; font-family: var(--sc-font-mono); font-size: 0.75rem; }
.steps button[aria-current="step"] { color: var(--sc-ink); font-weight: 600; }
.steps button[aria-current="step"] span, .steps button:not(:disabled):not([aria-current="step"]) span { background: var(--eco); color: #fff; }
.steps button:disabled { cursor: default; opacity: 0.6; }
.choices { display: grid; gap: 0.6rem; }
.choices--2 { grid-template-columns: 1fr 1fr; }
.choice {
  display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.85rem; align-items: center; text-align: start;
  padding: 1rem 1.1rem; border-radius: var(--r-2); border: 1px solid var(--line-strong); background: var(--sc-surface); cursor: pointer;
  transition: border-color 140ms var(--sc-ease-out), background-color 140ms var(--sc-ease-out), transform 120ms var(--sc-ease-out);
}
.choice:hover { border-color: var(--eco); background: var(--eco-wash); }
.choice:active { transform: scale(0.99); }
.choice.is-on { border-color: var(--eco); }
.choice__icon { grid-row: span 2; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: var(--r-2); background: var(--eco-tint); color: var(--eco); }
.choice__name { font-weight: 640; font-size: 1.02rem; }
.choice__desc { font-size: 0.88rem; color: var(--sc-ink-soft); line-height: 1.45; }
.choices--2 .choice { grid-template-columns: 1fr; align-content: start; gap: 0.5rem; }
.choices--2 .choice__icon { grid-row: auto; }
.methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.5rem; }
.method {
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; height: 46px; padding-inline: 1rem;
  border-radius: var(--r-2); border: 1px solid var(--line-strong); background: var(--sc-surface); cursor: pointer; font-weight: 560; font-size: 0.93rem;
  transition: border-color 140ms var(--sc-ease-out);
}
.method:hover { border-color: var(--eco); }
.method .i { color: var(--sc-ink-soft); }
.or { display: flex; align-items: center; gap: 0.75rem; font-size: 0.82rem; color: var(--sc-ink-soft); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.field { display: grid; gap: 0.35rem; font-size: 0.9rem; font-weight: 560; }
.field input {
  height: 46px; padding-inline: 0.9rem; border-radius: var(--r-2); border: 1px solid var(--line-strong); background: var(--sc-surface);
  font-size: 1rem; font-weight: 400; transition: border-color 140ms var(--sc-ease-out);
}
.field input:focus { outline: none; border-color: var(--eco); box-shadow: 0 0 0 3px var(--eco-tint); }
@media (max-width: 600px) {
  .choices--2 { grid-template-columns: 1fr; }
  .dlg { width: 100vw; max-width: 100vw; max-height: 92svh; margin: auto 0 0; border-radius: var(--r-3) var(--r-3) 0 0; }
}

/* ========================================================= MOBILE MENU */
.chrome__menu { display: none; }
.menu {
  display: grid; padding: 0.5rem clamp(1rem, 3vw, 2rem) 1rem; background: var(--sc-canvas); border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 24px -12px hsl(var(--sc-shadow-color) / 0.2);
}
.menu[hidden] { display: none; }
.menu a { padding: 0.8rem 0.25rem; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 560; color: var(--sc-ink); }
.menu a:last-child { border-bottom: 0; }
@media (max-width: 1360px) { .chrome__menu { display: inline-grid; } }

@media (max-width: 860px) and (max-height: 760px) {
  .tutor-intro, .tans__rule, .tans__foot { display: none; }
  .wnote { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tans { transform: none !important; transition: opacity 160ms linear; }
}

/* ================================================================ ARABIC / RTL
   The document flips with dir="rtl"; positions above are logical where they
   matter. This block handles what logical properties cannot. */

/* language button: full name on wide screens, one glyph on phones */
.lang-btn [data-lang-short] { display: none; }
.lang-btn[lang="ar"] { font-family: "IBM Plex Sans Arabic", var(--sc-font-text); }
@media (max-width: 960px) {
  .chrome__actions .lang-btn { display: inline-flex; padding-inline: 0.6rem; }
  .lang-btn .i, .lang-btn [data-lang-long] { display: none; }
  .lang-btn [data-lang-short] { display: inline; font-weight: 650; font-size: 1rem; }
}

/* Arabic type: one family, no tracking (it breaks joined letterforms),
   more leading for the taller script. */
:root[lang="ar"] {
  --sc-font-display: "IBM Plex Sans Arabic", "Bricolage Grotesque", system-ui, sans-serif;
  --sc-font-text: "IBM Plex Sans Arabic", "Geist", system-ui, sans-serif;
}
:root[lang="ar"] body :not([translate="no"], [translate="no"] *) { letter-spacing: 0 !important; }
:root[lang="ar"] .hero-title { line-height: 1.22; font-weight: 700; }
:root[lang="ar"] .section-title { line-height: 1.25; font-weight: 700; }
:root[lang="ar"] .sc-body, :root[lang="ar"] .hero-sub { line-height: 1.7; }

/* arrows and chevrons point the reading way */
[dir="rtl"] svg.i:has(use[href$="#arrow-right"]),
[dir="rtl"] svg.i:has(use[href$="#arrow-left"]),
[dir="rtl"] svg.i:has(use[href$="#chevron-right"]),
[dir="rtl"] svg.i:has(use[href$="#chevron-left"]) { transform: scaleX(-1); }

/* bars grow from the start edge */
[dir="rtl"] .skill__fill, [dir="rtl"] .wbk__meter i { transform-origin: right; }

/* The pan. The engine always travels the rail leftwards, which is the wrong
   way for Arabic. Mirror the stage, lay the rail out left-to-right inside the
   mirror, then mirror each panel back: the panels read correctly and the
   rail travels rightwards, K-12 first on the right. */
@media (prefers-reduced-motion: no-preference) {
  [dir="rtl"] .eco-stage { transform: scaleX(-1); direction: ltr; }
  [dir="rtl"] .eco-rail { direction: ltr; }
  [dir="rtl"] .eco-rail > * { direction: rtl; transform: scaleX(-1); }
}
/* the wordmark is a logo, not text: never mirror it */
.brand { direction: ltr; unicode-bidi: isolate; }
/* mono labels: Geist Mono's wide word spaces split Arabic phrases apart */
:root[lang="ar"] { --sc-font-mono: "IBM Plex Sans Arabic", "Geist Mono", ui-monospace, monospace; }

/* ------------------------------------------------------------------ toast */
.toast {
  position: fixed; z-index: 1000; inset-inline: 0; top: calc(var(--chrome-h) + 12px); margin-inline: auto; width: max-content; max-width: calc(100vw - 32px);
  padding: 0.7rem 1.1rem; border-radius: var(--r-2); background: var(--sc-ink); color: #fff; font-size: 0.92rem; box-shadow: var(--sc-e2, 0 8px 24px rgb(0 0 0 / 0.18));
  opacity: 0; transform: translateY(-6px); transition: opacity 220ms var(--sc-ease-out), transform 220ms var(--sc-ease-out);
}
.toast.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; transform: none; } }
