/* Lexora — "subtitled conversation".
   Delft blue + ink on a cool canvas; highlighter yellow marks key Dutch school terms only.
   Bricolage Grotesque for display, Atkinson Hyperlegible Next for reading in a second language. */

:root {
  --delft: #2140a0;
  --delft-deep: #172e78;
  --delft-tint: #e3eaf8;
  --delft-soft: #c9d6f2;
  --ink: #121b33;
  --ink-2: #4a5470;
  --canvas: #f3f6fb;
  --white: #ffffff;
  --marker: #ffe45c;
  --alert: #d8463b;
  --good: #1f8a5b;

  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;

  --r-xl: 32px;
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
  --pill: 999px;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
  --section: clamp(72px, 9vw, 128px);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
/* <picture> only chooses WebP or JPEG; the <img> inside keeps its own layout styles */
picture { display: contents; }
mark { background: var(--marker); color: var(--ink); padding: 0 .18em; border-radius: 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

:focus-visible { outline: 3px solid var(--marker); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; inset-inline-start: -999px; top: 8px; z-index: 50; padding: 10px 14px; background: var(--ink); color: var(--white); border-radius: var(--r-sm); }
.skip:focus { inset-inline-start: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Type scale (≈1.25 ratio) ---------- */

.h2 { font: 700 clamp(2rem, 3.6vw, 3.1rem)/1.06 var(--f-display); letter-spacing: -.025em; max-width: 22ch; text-wrap: balance; }
.h3 { font: 700 clamp(1.35rem, 2vw, 1.65rem)/1.18 var(--f-display); letter-spacing: -.015em; }
.h4 { font: 700 1.08rem/1.3 var(--f-display); letter-spacing: -.005em; margin-bottom: 12px; color: var(--delft); }
.lede { font-size: clamp(1.1rem, 1.5vw, 1.28rem); line-height: 1.55; color: var(--ink-2); max-width: 60ch; }
.prose { font-size: 1.12rem; max-width: 58ch; }
.prose + .prose { margin-top: 14px; }
.h2 + .prose, .h2 + .lede { margin-top: 20px; }

/* ---------- Buttons, pills, lists ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 24px;
  font: 600 1rem/1 var(--f-display); letter-spacing: -.005em;
  background: var(--delft); color: var(--white);
  border: 2px solid var(--delft); border-radius: var(--pill);
  text-decoration: none; cursor: pointer;
  transition: background-color .18s, border-color .18s, color .18s;
}
.btn:hover { background: var(--delft-deep); border-color: var(--delft-deep); }
.btn--ghost { background: transparent; color: var(--delft); }
.btn--ghost:hover { background: var(--delft-tint); border-color: var(--delft); color: var(--delft-deep); }
.btn--small { min-height: 40px; padding: 0 18px; font-size: .92rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills li { padding: 7px 14px; background: var(--white); border: 1px solid var(--delft-soft); border-radius: var(--pill); font-size: .95rem; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chips li { padding: 4px 11px; border-radius: var(--pill); background: rgba(255, 255, 255, .1); font-size: .86rem; }

.list li, .dashes li { position: relative; padding-block: 6px 6px; padding-inline: 26px 0; }
.list li::before, .dashes li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .95em; width: 10px; height: 10px; border-radius: 50%; background: var(--delft-soft); box-shadow: inset 0 0 0 3px var(--delft); }
.list--warn li::before { background: transparent; box-shadow: inset 0 0 0 2px var(--alert); }
.list--small li { font-size: .94rem; padding-block: 4px; }
.list--light li::before, .report .dashes li::before { background: var(--marker); box-shadow: none; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { padding: 4px 11px; background: var(--delft-tint); color: var(--delft-deep); border-radius: var(--pill); font-size: .88rem; font-weight: 500; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Top bar ---------- */

.topbar { position: sticky; top: 0; z-index: 30; background: rgba(243, 246, 251, .86); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid rgba(33, 64, 160, .1); }
.topbar__inner { display: flex; align-items: center; gap: 28px; height: 68px; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font: 800 1.45rem/1 var(--f-display); letter-spacing: -.04em; color: var(--ink); }
.brand--light { color: var(--white); }
.topbar__nav { display: flex; gap: 4px; margin-inline-end: auto; }
.topbar__nav a { padding: 8px 12px; border-radius: var(--pill); text-decoration: none; font-weight: 500; color: var(--ink-2); }
.topbar__nav a:hover { background: var(--delft-tint); color: var(--delft-deep); }
.topbar__end { display: flex; align-items: center; gap: 12px; margin-inline-start: auto; }

.lang { display: flex; padding: 3px; background: var(--white); border: 1px solid var(--delft-soft); border-radius: var(--pill); }
.lang button { min-width: 40px; padding: 7px 10px; border: 0; border-radius: var(--pill); background: transparent; color: var(--ink-2); font: 700 .8rem/1 var(--f-body); cursor: pointer; }
.lang button[aria-current] { background: var(--ink); color: var(--white); }

/* ---------- Sections ---------- */

.section { padding-block: var(--section); }
.section--tint { background: var(--white); }
.band { padding-block: var(--section); color: var(--white); }
.band--delft { background: var(--delft); }
.band--ink { background: var(--ink); }
.band .h4 { color: var(--marker); }
.band .lede, .band .prose { color: rgba(255, 255, 255, .86); }

.intro { display: grid; gap: 18px; margin-bottom: clamp(36px, 5vw, 56px); }
.intro--row { grid-template-columns: 1fr auto; align-items: end; gap: 24px 48px; }
.intro--row > div { display: grid; gap: 18px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 6vw, 88px); align-items: center; }
.split--wide { grid-template-columns: 5fr 7fr; align-items: start; }
.split--top { align-items: start; }
/* Grid children may shrink below their content (wide tables then scroll inside .table-wrap). */
.split > *, .page-head__grid > *, .acct__grid > *, .contact > * { min-width: 0; }

.statement { margin-top: clamp(40px, 5vw, 64px); max-width: 34ch; font: 600 clamp(1.4rem, 2.4vw, 2rem)/1.22 var(--f-display); letter-spacing: -.02em; text-wrap: balance; }

.quote { margin-top: clamp(40px, 5vw, 64px); padding-inline-start: 22px; border-inline-start: 4px solid var(--delft); max-width: 46ch; font: 500 clamp(1.25rem, 2vw, 1.6rem)/1.35 var(--f-display); letter-spacing: -.01em; }
.quote--light { border-color: var(--marker); }

/* ---------- Hero ---------- */

.hero { padding-block: clamp(36px, 6vw, 80px) clamp(64px, 8vw, 112px); }
.hero__grid { display: grid; grid-template-columns: 1fr 1.08fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero__copy { display: grid; gap: 22px; justify-items: start; }
.hero__title { font: 800 clamp(2.6rem, 5.6vw, 4.9rem)/.98 var(--f-display); letter-spacing: -.04em; text-wrap: balance; }
.hero__lede { font-size: clamp(1.12rem, 1.5vw, 1.3rem); line-height: 1.55; color: var(--ink-2); max-width: 46ch; }
.hero__note { font-size: .95rem; color: var(--ink-2); margin-bottom: -10px; }
.hero .actions { margin-top: 6px; }

/* The signature: a meeting photo carrying Dutch subtitles with translations. */
.scene { position: relative; padding-block: 0 54px; padding-inline: 36px 0; }
.scene__photo { width: 100%; aspect-ratio: 4 / 4.4; object-fit: cover; object-position: 40% center; border-radius: var(--r-xl); }
.subtitle { position: absolute; max-width: min(400px, 84%); padding: 14px 18px 15px; border-radius: var(--r-lg); background: rgba(18, 27, 51, .9); color: var(--white); box-shadow: 0 18px 40px -18px rgba(18, 27, 51, .55); backdrop-filter: blur(6px); }
.subtitle__who { display: block; margin-bottom: 4px; font-size: .8rem; font-weight: 700; color: var(--marker); }
.subtitle__nl { font: 600 1.08rem/1.38 var(--f-display); letter-spacing: -.005em; }
.subtitle__gloss { margin-top: 6px; font-size: .88rem; line-height: 1.45; color: rgba(255, 255, 255, .72); }
/* The teacher's face sits in the upper-middle of the photo, so her line runs low like a film subtitle. */
.subtitle--teacher { inset-inline-start: 0; top: 51%; border-start-start-radius: 6px; }
.subtitle--parent { inset-inline-end: -12px; bottom: 0; background: var(--white); color: var(--ink); border-end-end-radius: 6px; }
.subtitle--parent .subtitle__gloss { color: var(--ink-2); }
.scene__meter { position: absolute; inset-inline-end: 18px; top: 18px; display: grid; grid-template-columns: 1fr auto; gap: 6px 18px; width: 250px; padding: 14px 18px; background: var(--white); border-radius: var(--r-md); box-shadow: 0 16px 36px -20px rgba(18, 27, 51, .45); font-size: .88rem; }
.scene__meter b { font-family: var(--f-display); color: var(--good); }
.scene__meter i { grid-column: 1 / -1; height: 8px; border-radius: var(--pill); background: linear-gradient(90deg, var(--good) var(--v), var(--delft-tint) var(--v)); }

@media (prefers-reduced-motion: no-preference) {
  .subtitle, .scene__meter { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
  .subtitle--teacher { animation-delay: .35s; }
  .subtitle--parent { animation-delay: 1.4s; }
  .scene__meter { animation-delay: 2.2s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Problem ---------- */

.figure-stat { padding: clamp(24px, 3vw, 40px); background: rgba(255, 255, 255, .1); border-radius: var(--r-xl); }
.figure-stat__num { font: 800 clamp(4rem, 9vw, 7.5rem)/.9 var(--f-display); letter-spacing: -.05em; color: var(--marker); }
.figure-stat__text { margin-top: 14px; font: 600 1.3rem/1.3 var(--f-display); max-width: 24ch; }
.figure-stat__small { margin-top: 14px; color: rgba(255, 255, 255, .78); }

.issues { margin-top: clamp(48px, 6vw, 72px); }
.issues__list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.issues__list li { padding: 20px 22px; border-radius: var(--r-lg); background: var(--delft-deep); font: 600 1.08rem/1.35 var(--f-display); }
.issues__result { margin-top: 16px; padding: 16px 22px; border-radius: var(--r-lg); background: var(--white); color: var(--ink); }

/* ---------- Persona ---------- */

.persona { display: grid; grid-template-columns: minmax(280px, 5fr) 7fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.persona__card { position: sticky; top: 100px; overflow: hidden; border-radius: var(--r-xl); background: var(--white); }
.persona__card img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; }
.persona__card figcaption { display: grid; gap: 12px; padding: 20px 22px 24px; }
.persona__card strong { font: 700 1.6rem/1.1 var(--f-display); letter-spacing: -.02em; }
.persona__body { display: grid; gap: 32px; }
.two-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.insight { padding: 24px 26px; border-radius: var(--r-lg); background: var(--marker); }
.insight .h4 { color: var(--ink); }
.insight p { font: 600 clamp(1.2rem, 1.8vw, 1.45rem)/1.32 var(--f-display); letter-spacing: -.01em; }

/* ---------- Solution: a 3-step track ---------- */

.track { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 8px; }
.track::before { content: ""; position: absolute; inset-inline-start: 22px; inset-inline-end: 22px; top: 22px; height: 2px; background: repeating-linear-gradient(90deg, var(--delft-soft) 0 8px, transparent 8px 14px); }
.track__step { position: relative; display: grid; gap: 8px; align-content: start; }
.track__dot { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 10px; border-radius: 50%; background: var(--delft); color: var(--white); font: 700 1.1rem/1 var(--f-display); box-shadow: 0 0 0 6px var(--white); }
.track__step strong { font: 700 1.3rem/1.2 var(--f-display); }
.track__step p { color: var(--ink-2); max-width: 32ch; }
.value { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-top: clamp(40px, 5vw, 60px); padding: 26px 30px; border-radius: var(--r-lg); background: var(--delft-tint); }
.value p { font: 600 1.2rem/1.35 var(--f-display); max-width: 46ch; }

/* ---------- Before / after toggle ---------- */

.ba { display: grid; gap: 24px; }
.ba__switch { display: none; justify-self: start; padding: 4px; background: var(--white); border: 1px solid var(--delft-soft); border-radius: var(--pill); }
.ba__switch button { padding: 10px 26px; border: 0; border-radius: var(--pill); background: transparent; color: var(--ink-2); font: 600 1rem/1 var(--f-display); cursor: pointer; transition: background-color .2s, color .2s; }
.ba__switch button[aria-selected="true"] { background: var(--delft); color: var(--white); }
.ba__panel { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.ba__panel img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-xl); }
.ba__panel[data-ba-panel="before"] img { filter: grayscale(1) contrast(.95); }
.ba__text { display: grid; gap: 14px; font-size: 1.14rem; }
.ba__panel[data-ba-panel="after"] .h3 { color: var(--good); }
.js .ba__switch { display: inline-flex; }
.js .ba__panel[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .js .ba__panel { animation: rise .45s ease both; }
}

/* ---------- Impact ---------- */

.impact { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.impact__group { padding: 24px; border-radius: var(--r-lg); background: var(--canvas); }

/* ---------- Engine (dark) ---------- */

.engine__intro { display: grid; gap: 22px; position: sticky; top: 110px; }
.shift { display: grid; gap: 8px; margin-top: 8px; }
.shift span { padding: 12px 16px; border-radius: var(--r-md); font-weight: 600; }
.shift span:first-child { background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .7); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .4); }
.shift span:last-child { background: var(--marker); color: var(--ink); }
.flow { display: grid; gap: 14px; }
.flow__node { position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 16px; padding: 22px; border-radius: var(--r-lg); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.flow__node:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 47px; bottom: -15px; width: 2px; height: 16px; background: var(--delft-soft); }
.flow__node:last-child { background: var(--delft); border-color: var(--delft); }
.flow__no { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--white); color: var(--ink); font: 700 1.2rem/1 var(--f-display); }
.flow__node strong { display: block; font: 700 1.2rem/1.25 var(--f-display); margin-bottom: 4px; }
.flow__node p { color: rgba(255, 255, 255, .78); }

/* ---------- Features accordion ---------- */

.features__side { display: grid; gap: 28px; position: sticky; top: 110px; }
.core { padding: 26px; border-radius: var(--r-lg); background: var(--ink); color: var(--white); display: grid; gap: 10px; }
.core p { color: rgba(255, 255, 255, .8); }
.accordion { display: grid; gap: 10px; }
.accordion__item { border-radius: var(--r-lg); background: var(--white); border: 1px solid transparent; transition: border-color .2s; }
.accordion__item[open] { border-color: var(--delft-soft); }
.accordion__item summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; cursor: pointer; list-style: none; font: 700 1.2rem/1.25 var(--f-display); letter-spacing: -.01em; }
.accordion__item summary::-webkit-details-marker { display: none; }
.accordion__item summary::after { content: ""; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--delft-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%232140a0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 14px no-repeat; transition: transform .25s; }
.accordion__item[open] summary::after { transform: rotate(180deg); }
.accordion__body { padding: 0 24px 22px; display: grid; gap: 14px; }
.accordion__note { padding: 12px 16px; border-radius: var(--r-md); background: var(--delft-tint); color: var(--delft-deep); font-weight: 600; }

/* ---------- How it works: 5-step loop ---------- */

.loop { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.loop__step { display: grid; gap: 10px; align-content: start; padding: 22px 20px 24px; border-radius: var(--r-lg); background: var(--canvas); }
.loop__step:last-child { background: var(--delft); color: var(--white); }
.loop__step:last-child p { color: rgba(255, 255, 255, .82); }
.loop__no { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--white); color: var(--delft); font: 700 1rem/1 var(--f-display); box-shadow: inset 0 0 0 2px var(--delft-soft); }
.loop__step strong { font: 700 1.1rem/1.25 var(--f-display); }
.loop__step p { font-size: .95rem; color: var(--ink-2); }

/* ---------- Netherlands ---------- */

.nl { position: relative; min-height: 460px; display: grid; align-items: end; overflow: hidden; border-radius: var(--r-xl); }
.nl__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nl__panel { position: relative; margin: 20px; max-width: 560px; padding: clamp(22px, 3vw, 34px); border-radius: var(--r-lg); background: rgba(255, 255, 255, .94); display: grid; gap: 10px; }
.nl__kicker { font-weight: 700; color: var(--delft); }
.nl__title { font: 800 clamp(2.4rem, 5vw, 4rem)/1 var(--f-display); letter-spacing: -.04em; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-block: 28px; }
.stats div { padding: 20px 22px; border-radius: var(--r-lg); background: var(--white); }
.stats dt { font: 800 clamp(1.9rem, 3vw, 2.6rem)/1 var(--f-display); letter-spacing: -.03em; color: var(--delft); }
.stats dd { margin-top: 8px; color: var(--ink-2); font-size: .95rem; }
.reasons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }

.source { margin-top: 8px; font-size: .84rem; color: var(--ink-2); }

/* ---------- Timeline (school year) ---------- */

.timeline { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 0; inset-inline-end: 0; top: 23px; height: 2px; background: var(--delft-soft); }
.timeline__item { position: relative; display: grid; gap: 10px; align-content: start; }
.timeline__year { justify-self: start; padding: 12px 18px; border-radius: var(--pill); background: var(--white); border: 2px solid var(--delft-soft); font: 800 1.15rem/1 var(--f-display); color: var(--delft); }
.timeline__item:first-child .timeline__year { background: var(--delft); border-color: var(--delft); color: var(--white); }
.timeline__item strong { margin-top: 6px; font: 700 1.08rem/1.25 var(--f-display); }
.timeline__goal { justify-self: start; margin-top: 4px; padding: 5px 12px; border-radius: var(--pill); background: var(--marker); font: 700 .88rem/1.2 var(--f-display); }

#financials .h4 { margin-top: 32px; }

/* ---------- Useful Dutch phrases ---------- */
.phrase-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: clamp(28px, 4vw, 44px); }
.phrase-card { display: grid; gap: 8px; align-content: start; padding: 22px; border-radius: var(--r-lg); background: var(--white); }
.phrase-card::before { content: ""; width: 32px; height: 5px; margin-bottom: 4px; border-radius: var(--pill); background: var(--marker); }
.phrase-card__nl { font: 700 1.15rem/1.3 var(--f-display); }
.phrase-card__gloss { color: var(--ink-2); font-size: .95rem; }
.phrase-card__link { justify-self: start; margin-top: 6px; font-size: .88rem; font-weight: 700; color: var(--delft); text-decoration: none; }
.phrase-card__link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Who it is for ---------- */
.audiences { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: clamp(28px, 4vw, 44px); }
.audience { display: grid; gap: 12px; align-content: start; padding: clamp(22px, 3vw, 30px); border-radius: var(--r-xl); background: var(--white); }
.audience .list { margin-bottom: 6px; }
.audience .btn { justify-self: start; margin-top: auto; }
.audience__text { color: var(--ink-2); }
.audience--parents { background: var(--delft); color: var(--white); }
.audience--parents .audience__text { color: rgba(255, 255, 255, .82); }
.audience--parents .list li::before { background: var(--marker); box-shadow: none; }
.audience--parents .btn { background: var(--marker); border-color: var(--marker); color: var(--ink); }
.audience--parents .btn:hover { background: var(--white); border-color: var(--white); }

/* ---------- The school year ---------- */
.timeline--year { margin-top: clamp(28px, 4vw, 44px); }
.timeline--year .timeline__year { font-size: .92rem; padding: 10px 14px; }
.timeline__nl { font: 600 .92rem/1.3 var(--f-display); }
.timeline__text { font-size: .95rem; color: var(--ink-2); }
.timeline--year .timeline__goal { text-decoration: none; color: var(--ink); }
.timeline--year .timeline__goal:hover { background: var(--ink); color: var(--white); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; }
.faq__item { border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--delft-tint); }
.faq__item[open] { border-color: var(--delft-soft); }
.faq__item summary { display: flex; justify-content: space-between; gap: 16px; padding: 18px 22px; cursor: pointer; list-style: none; font: 700 1.08rem/1.35 var(--f-display); }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--delft-tint); color: var(--delft); font-size: 1.2rem; line-height: 1; }
.faq__item[open] summary::after { content: "–"; background: var(--delft); color: var(--white); }
.faq__item p { padding: 0 22px 20px; color: var(--ink-2); max-width: 68ch; }
#faq .intro { display: grid; gap: 16px; justify-items: start; }

/* ---------- Team ---------- */

.team { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.person { display: grid; gap: 8px; align-content: start; padding: 26px 24px; border-radius: var(--r-xl); background: var(--canvas); }
.person .h4 { margin: 8px 0 0; color: var(--ink); font-size: 1.2rem; }
.person__avatar { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: var(--delft); color: var(--white); font: 700 1.4rem/1 var(--f-display); }
.person:nth-child(2) .person__avatar { background: var(--marker); color: var(--ink); }
.person:nth-child(3) .person__avatar { background: var(--ink); }
.person:nth-child(4) .person__avatar { background: var(--delft-tint); color: var(--delft); }
.person__role { font-weight: 700; color: var(--delft); font-size: .95rem; }
.person p:last-child { font-size: .95rem; color: var(--ink-2); }

/* ---------- Vision + join ---------- */

.vision__copy { display: grid; gap: 26px; }
.vision__quote { font: 600 clamp(1.4rem, 2.4vw, 2rem)/1.25 var(--f-display); letter-spacing: -.02em; }
.join { display: grid; gap: 14px; padding: clamp(24px, 3vw, 36px); border-radius: var(--r-xl); background: var(--white); color: var(--ink); }
.join > p { color: var(--ink-2); }
.notice { padding: 12px 16px; border-radius: var(--r-md); background: #dff3e9; color: #135c3c; font-weight: 700; }
.notice--warn { background: #fbe3e1; color: #8c2219; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 6px; }
.form .btn { grid-column: 1 / -1; margin-top: 6px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .92rem; font-weight: 700; }
.field input, .field select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  font: 400 1rem/1.4 var(--f-body); color: var(--ink);
  background: var(--canvas); border: 2px solid transparent; border-radius: var(--r-sm);
  transition: border-color .15s, background-color .15s;
}
.field input:focus, .field select:focus, textarea:focus { outline: none; border-color: var(--delft); background: var(--white); }
.field--error input, .field--error select { border-color: var(--alert); }
.field__error { font-size: .86rem; color: var(--alert); }

.field__help { font-size: .84rem; color: var(--ink-2); }

/* ---------- Accounts ---------- */

.topbar__login { padding: 8px 12px; border-radius: var(--pill); text-decoration: none; font-weight: 600; color: var(--delft); white-space: nowrap; }
.topbar__login:hover { background: var(--delft-tint); }
.account-chip { display: inline-flex; align-items: center; gap: 8px; padding-block: 4px 4px; padding-inline: 4px 14px; border-radius: var(--pill); background: var(--white); border: 1px solid var(--delft-soft); text-decoration: none; font-weight: 600; color: var(--ink); }
.account-chip:hover { border-color: var(--delft); }
.account-chip__avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--marker); color: var(--ink); font: 800 .95rem/1 var(--f-display); }
.account-chip__name { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.auth { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; padding-block: clamp(32px, 5vw, 72px) clamp(64px, 8vw, 112px); }
.auth__card { display: grid; gap: 14px; width: 100%; max-width: 460px; justify-self: center; padding: clamp(24px, 3vw, 40px); background: var(--white); border-radius: var(--r-xl); box-shadow: 0 30px 60px -40px rgba(18, 27, 51, .35); }
.auth__title { font: 800 clamp(2rem, 3.4vw, 2.7rem)/1.02 var(--f-display); letter-spacing: -.035em; }
.auth__lede { color: var(--ink-2); }
.auth__form { display: grid; gap: 14px; margin-top: 6px; }
.auth__form .btn { margin-top: 4px; }
.auth__fine { margin-top: -4px; font-size: .86rem; color: var(--ink-2); }
.auth__switch { padding-top: 14px; border-top: 1px solid var(--delft-tint); font-size: .95rem; color: var(--ink-2); }
.auth__switch a { font-weight: 700; color: var(--delft); }
.auth__scene { position: relative; padding-bottom: 40px; }
.auth__scene img { width: 100%; aspect-ratio: 4 / 4.2; object-fit: cover; border-radius: var(--r-xl); }
.auth__scene--register img { object-position: 50% 62%; }
.auth__scene--login img { object-position: 58% 40%; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; padding: 0 20px; border: 2px solid var(--delft-soft); border-radius: var(--pill); background: var(--white); color: var(--ink); text-decoration: none; font: 600 1rem/1 var(--f-display); transition: border-color .15s, background-color .15s; }
.btn-google:hover { border-color: var(--delft); background: var(--canvas); }
/* Sign-up has more to fill in: a wider card with paired fields, a narrower photo. */
.auth--wide { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 4vw, 64px); }
.auth--wide .auth__card { max-width: 680px; }
.auth--wide .auth__scene img { aspect-ratio: 4 / 4.6; }
.auth__or {display: flex; align-items: center; gap: 12px; font-size: .86rem; color: var(--ink-2); }
.auth__or::before, .auth__or::after { content: ""; flex: 1; height: 1px; background: var(--delft-tint); }
/* Anchored under the faces, hanging off the bottom edge like a caption. */
.subtitle--auth { inset-inline-start: -28px; bottom: 0; border-start-start-radius: 6px; }

.acct { padding-block: clamp(28px, 4vw, 56px) clamp(64px, 8vw, 112px); }
.acct__notice { margin-bottom: 24px; }
.acct__head { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; }
.acct__head .page-title { margin-top: 4px; }
.acct__avatar { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 28px; background: var(--delft); color: var(--white); font: 800 2.2rem/1 var(--f-display); box-shadow: inset 0 -6px 0 var(--marker); }
.acct__meta { margin-top: 8px; color: var(--ink-2); }
.acct__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-block: clamp(28px, 4vw, 44px); }
.acct__stats li { display: grid; gap: 4px; padding: 20px 22px; background: var(--white); border-radius: var(--r-lg); }
.acct__stats li:first-child { background: var(--ink); color: var(--white); }
.acct__stats span { font-size: .92rem; color: inherit; opacity: .78; }
.acct__stats b { font: 800 clamp(2rem, 3.4vw, 2.8rem)/1 var(--f-display); letter-spacing: -.03em; }
.acct__grid { display: grid; grid-template-columns: 7fr 4fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.acct__main { display: grid; gap: 18px; }
.acct__h { margin-top: 18px; }
.acct__next { display: grid; gap: 10px; justify-items: start; padding: clamp(22px, 3vw, 32px); border-radius: var(--r-xl); background: var(--delft); color: var(--white); }
.acct__next .label { color: var(--marker); }
.acct__next p:not(.label) { color: rgba(255, 255, 255, .86); max-width: 52ch; }
.acct__next .btn { margin-top: 6px; background: var(--marker); border-color: var(--marker); color: var(--ink); }
.acct__next .btn:hover { background: var(--white); border-color: var(--white); }
.acct__side { position: sticky; top: 92px; display: grid; gap: 12px; padding: clamp(22px, 3vw, 30px); background: var(--white); border-radius: var(--r-xl); }
.acct__hint { font-size: .94rem; color: var(--ink-2); }
.acct__form { display: grid; gap: 12px; margin-top: 4px; }
.acct__email { font-size: .86rem; color: var(--ink-2); overflow-wrap: anywhere; }

.history { display: grid; gap: 10px; }
.history__item { display: grid; grid-template-columns: 1fr 120px; gap: 20px; align-items: center; padding: 18px 22px; background: var(--white); border-radius: var(--r-lg); }
.history__text { display: grid; gap: 2px; }
.history__text strong { font: 700 1.08rem/1.3 var(--f-display); }
.history__text span { font-size: .88rem; color: var(--ink-2); }
.history__text p { margin-top: 6px; font-size: .95rem; }
.history__score { display: grid; gap: 6px; justify-items: end; }
.history__score b { font: 800 1.9rem/1 var(--f-display); color: var(--delft); }
.history__score i { width: 100%; height: 8px; border-radius: var(--pill); background: linear-gradient(90deg, var(--good) var(--v), var(--delft-tint) var(--v)); }
.history__empty { display: grid; gap: 14px; justify-items: start; padding: 26px; border: 2px dashed var(--delft-soft); border-radius: var(--r-lg); color: var(--ink-2); }

.picker__save { margin-top: 18px; color: var(--ink-2); }
.picker__save a { font-weight: 700; color: var(--delft); }
.report__saved { margin-top: 4px; font-size: .95rem; color: rgba(255, 255, 255, .8); }
.report__saved a { font-weight: 700; color: var(--marker); }

/* ---------- Footer ---------- */

.footer { padding-block: clamp(48px, 6vw, 72px) 28px; background: var(--ink); color: rgba(255, 255, 255, .74); }
.footer__inner { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.footer__top { display: grid; grid-template-columns: 4fr 8fr; gap: clamp(32px, 6vw, 96px); padding-bottom: 40px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.footer__brand { display: grid; gap: 14px; align-content: start; justify-items: start; max-width: 32ch; }
.footer__cta { margin-top: 6px; background: var(--marker); border-color: var(--marker); color: var(--ink); }
.footer__cta:hover { background: var(--white); border-color: var(--white); color: var(--ink); }
.footer__cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.footer__h { margin-bottom: 14px; font: 700 .95rem/1.2 var(--f-display); color: var(--white); }
.footer__cols ul { display: grid; gap: 10px; }
.footer__cols a { text-decoration: none; font-size: .95rem; color: rgba(255, 255, 255, .74); }
.footer__cols a:hover { color: var(--marker); text-decoration: underline; text-underline-offset: 3px; }
.footer__bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-top: 24px; font-size: .86rem; }
.footer__bottom .lang { margin-inline-start: auto; }
.lang--dark { background: transparent; border-color: rgba(255, 255, 255, .2); }
.lang--dark button { color: rgba(255, 255, 255, .7); }
.lang--dark button[aria-current] { background: var(--white); color: var(--ink); }

/* ---------- Content pages: about, contact, legal, errors ---------- */

.flash { display: grid; gap: 8px; padding-top: 20px; }
.narrow { max-width: calc(760px + 2 * var(--gutter)); display: grid; gap: 18px; justify-items: start; padding-block: clamp(32px, 5vw, 64px) clamp(64px, 8vw, 112px); }
.btn--danger { background: var(--alert); border-color: var(--alert); }
.btn--danger:hover { background: #a8301f; border-color: #a8301f; }
.btn--light { background: var(--marker); border-color: var(--marker); color: var(--ink); }
.btn--light:hover { background: var(--white); border-color: var(--white); color: var(--ink); }
.btn--outline-light { background: transparent; border-color: rgba(255, 255, 255, .6); color: var(--white); }
.btn--outline-light:hover { background: rgba(255, 255, 255, .1); border-color: var(--white); }
.danger-box { display: grid; gap: 18px; width: 100%; margin-top: 8px; padding: 24px; border: 2px solid #f1c4bf; border-radius: var(--r-lg); background: var(--white); }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--alert); flex: none; }
.check--error span { color: var(--alert); }
.form__privacy { grid-column: 1 / -1; font-size: .84rem; color: var(--ink-2); }
.form__privacy a, .auth__fine a, .acct__hint a { color: var(--delft); font-weight: 600; }
.sim__ai { margin-top: 10px; font-size: .86rem; color: var(--ink-2); }
.acct__data { grid-column: 1 / -1; display: grid; gap: 12px; justify-items: start; margin-top: 12px; padding: clamp(22px, 3vw, 30px); border-radius: var(--r-xl); border: 2px dashed var(--delft-soft); }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

.values { display: grid; gap: 14px; margin-top: 22px; }
.values li { display: grid; gap: 2px; padding: 16px 20px; border-inline-start: 4px solid var(--marker); background: var(--canvas); border-start-start-radius: 0; border-start-end-radius: var(--r-md); border-end-end-radius: var(--r-md); border-end-start-radius: 0; }
.values strong { font: 700 1.08rem/1.3 var(--f-display); }
.values span { color: var(--ink-2); }
.person--card { background: var(--white); }
.about-cta { display: grid; grid-template-columns: 1fr auto; gap: 32px 64px; align-items: end; }
.about-cta .vision__quote { margin-top: 18px; max-width: 40ch; }

.contact { display: grid; grid-template-columns: 6fr 5fr; gap: clamp(32px, 6vw, 88px); align-items: start; padding-block: clamp(32px, 5vw, 72px) clamp(64px, 8vw, 112px); }
.contact__intro { display: grid; gap: 18px; }
.contact__ways { display: grid; gap: 12px; margin-top: 10px; }
.contact__ways li { display: grid; gap: 2px; padding: 16px 20px; background: var(--white); border-radius: var(--r-lg); }
.contact__ways strong { font: 700 1.05rem/1.3 var(--f-display); color: var(--delft); }
.contact__ways span { color: var(--ink-2); font-size: .96rem; }
.contact__direct { display: grid; gap: 10px; }
.contact__direct div { display: flex; gap: 12px; }
.contact__direct dt { min-width: 80px; font-weight: 700; }
.contact__direct a { color: var(--delft); }
.contact__form { position: relative; display: grid; gap: 14px; padding: clamp(24px, 3vw, 36px); background: var(--white); border-radius: var(--r-xl); box-shadow: 0 30px 60px -40px rgba(18, 27, 51, .35); }

.legal { display: grid; grid-template-columns: 240px 1fr; gap: clamp(32px, 5vw, 80px); align-items: start; padding-block: clamp(32px, 5vw, 64px) clamp(64px, 8vw, 112px); }
.legal__nav { position: sticky; top: 92px; display: grid; gap: 12px; }
.legal__nav ul { display: grid; gap: 4px; }
.legal__nav a { display: block; padding: 9px 14px; border-radius: var(--r-sm); text-decoration: none; font-weight: 600; color: var(--ink-2); }
.legal__nav a:hover { background: var(--delft-tint); color: var(--delft-deep); }
.legal__nav a[aria-current] { background: var(--white); color: var(--delft); box-shadow: inset 3px 0 0 var(--delft); }
.doc { max-width: 76ch; min-width: 0; font-size: 1.04rem; }
.doc__updated { margin-top: 12px; color: var(--ink-2); font-size: .95rem; }
.doc__lede { margin-top: 24px; padding: 18px 22px; border-radius: var(--r-lg); background: var(--white); font-size: 1.1rem; }
.doc h2 { margin: 40px 0 12px; font: 700 1.35rem/1.25 var(--f-display); letter-spacing: -.01em; }
.doc p + p, .doc p + ul, .doc ul + p, .doc table + p { margin-top: 12px; }
.doc ul { display: grid; gap: 6px; padding-inline-start: 0; }
.doc ul li { position: relative; padding-inline-start: 22px; }
.doc ul li::before { content: ""; position: absolute; inset-inline-start: 4px; top: .7em; width: 7px; height: 7px; border-radius: 50%; background: var(--delft); }
.doc a { color: var(--delft); font-weight: 600; }
.doc code { padding: 1px 6px; border-radius: 6px; background: var(--delft-tint); font-size: .9em; }
.doc__card { display: grid; gap: 4px; margin-top: 8px; padding: 18px 22px; border-radius: var(--r-lg); background: var(--white); font-style: normal; }
.doc__table { width: 100%; margin-top: 8px; border-collapse: separate; border-spacing: 0; background: var(--white); border-radius: var(--r-lg); overflow: hidden; font-size: .94rem; }
.doc__table th, .doc__table td { padding: 12px 14px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--delft-tint); }
.doc__table th { background: var(--ink); color: var(--white); font: 700 .88rem/1.3 var(--f-display); }
.doc__table tr:last-child td { border-bottom: 0; }
.doc__note { margin-top: 32px !important; font-size: .9rem; color: var(--ink-2); font-style: italic; }

.error-page { display: grid; gap: 18px; justify-items: start; padding-block: clamp(48px, 8vw, 120px); }
.error-page__code { font: 800 clamp(5rem, 14vw, 10rem)/.9 var(--f-display); letter-spacing: -.05em; color: var(--delft-soft); }
.subtitle--static { position: static; }

/* ---------- Simulation pages ---------- */

.page-head { padding-block: clamp(32px, 5vw, 64px) clamp(28px, 4vw, 48px); }
.page-head__grid { display: grid; grid-template-columns: 7fr 4fr; gap: clamp(24px, 4vw, 64px); align-items: center; }
.page-head__copy { display: grid; gap: 16px; justify-items: start; }
.page-head__photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-xl); }
.back { display: inline-flex; align-items: center; gap: 6px; padding-block: 6px 6px; padding-inline: 10px 14px; border-radius: var(--pill); background: var(--white); text-decoration: none; font-weight: 600; font-size: .92rem; color: var(--delft); }
.back::before { content: ""; width: 16px; height: 16px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M10 3L5 8l5 5' fill='none' stroke='%232140a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.page-title { font: 800 clamp(2.2rem, 4.4vw, 3.6rem)/1.02 var(--f-display); letter-spacing: -.035em; max-width: 22ch; text-wrap: balance; }

/* Scenario picker */
.picker { display: grid; gap: 40px; padding-bottom: var(--section); }
.picker__step { border: 0; padding: 0; margin: 0; min-width: 0; }
.picker__step legend { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font: 700 1.25rem/1.2 var(--f-display); }
.picker__step legend span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--delft); color: var(--white); font-size: .95rem; }
.picker__row { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.picker__go { display: flex; flex-wrap: wrap; gap: 12px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.card { position: relative; display: grid; gap: 10px; align-content: start; padding: 22px; border-radius: var(--r-lg); background: var(--white); border: 2px solid transparent; cursor: pointer; transition: border-color .15s, background-color .15s; }
.card:hover { border-color: var(--delft-soft); }
.card input { position: absolute; opacity: 0; pointer-events: none; }
.card:has(input:checked) { border-color: var(--delft); background: var(--delft-tint); }
.card:has(input:focus-visible) { outline: 3px solid var(--marker); outline-offset: 2px; }
.card__tag { justify-self: start; padding: 3px 10px; border-radius: var(--pill); background: var(--canvas); font-size: .82rem; font-weight: 700; color: var(--delft); }
.card:has(input:checked) .card__tag { background: var(--white); }
.card strong { font: 700 1.2rem/1.22 var(--f-display); }
.card__text { font-size: .95rem; color: var(--ink-2); }
.card__teacher { margin-top: 4px; font-size: .88rem; font-weight: 700; }
.segmented { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--r-lg); background: var(--white); }
.segmented label { flex: 1 1 auto; position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; padding: 12px 14px; border-radius: var(--r-md); text-align: center; font-weight: 600; font-size: .95rem; transition: background-color .15s, color .15s; }
.segmented input:checked + span { background: var(--delft); color: var(--white); }
.segmented input:focus-visible + span { outline: 3px solid var(--marker); }

/* Meeting room */
.sim { display: grid; grid-template-columns: 1fr 340px; gap: clamp(24px, 4vw, 48px); align-items: start; padding-bottom: var(--section); }
.sim__meeting { display: grid; gap: 22px; align-content: start; min-width: 0; }
.sim__panel { position: sticky; top: 92px; display: grid; gap: 16px; padding: 24px; border-radius: var(--r-xl); background: var(--white); }
.sim__progress { font: 800 1.7rem/1 var(--f-display); letter-spacing: -.02em; }
.sim__progress small { font: 500 .9rem/1 var(--f-body); color: var(--ink-2); letter-spacing: 0; }
.sim__hint { padding: 12px 14px; border-radius: var(--r-md); background: var(--delft-tint); color: var(--delft-deep); font-weight: 600; font-size: .92rem; }
.label { font: 700 1rem/1.3 var(--f-display); color: var(--delft); }

.facts { display: grid; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--delft-tint); font-size: .94rem; }
.facts dt { color: var(--ink-2); }
.facts dd { font-weight: 700; text-align: end; }

.transcript { display: grid; gap: 14px; }
.line { display: grid; gap: 4px; max-width: 86%; padding: 16px 20px; border-radius: var(--r-lg); }
.line--teacher { justify-self: start; background: var(--ink); color: var(--white); border-end-start-radius: 6px; }
.line--parent { justify-self: end; background: var(--white); border: 2px solid var(--delft-soft); border-end-end-radius: 6px; }
.line--error { max-width: 100%; padding: 14px 18px; background: #fbe3e1; color: #8c2219; font-weight: 600; }
.line__who { font-size: .8rem; font-weight: 700; color: var(--marker); }
.line--parent .line__who { color: var(--delft); }
.line__nl { font: 600 1.12rem/1.4 var(--f-display); }
.line__gloss { font-size: .92rem; opacity: .72; }
.line__feedback { margin-top: 10px; padding: 10px 14px; border-radius: var(--r-md); background: #fff6c7; color: var(--ink); font-size: .94rem; }
.line__feedback--good { background: #dff3e9; }

.typing { display: flex; align-items: center; gap: 6px; font-size: .92rem; color: var(--ink-2); }
.typing[hidden] { display: none; }
.typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--delft); animation: blink 1s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; margin-inline-end: 6px; }
@keyframes blink { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }

.composer { display: grid; gap: 12px; }
.composer[hidden] { display: none; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.suggestion { display: grid; gap: 2px; text-align: start; padding: 10px 16px; border-radius: var(--r-md); background: var(--white); border: 1px dashed var(--delft-soft); color: var(--ink); cursor: pointer; font: inherit; }
.suggestion:hover { border-style: solid; border-color: var(--delft); }
.suggestion__nl { font: 600 1rem/1.35 var(--f-display); }
.suggestion__gloss { font-size: .86rem; color: var(--ink-2); }
.composer__form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; padding: 8px; border-radius: var(--r-lg); background: var(--white); }
.composer__form textarea { min-height: 54px; resize: vertical; background: transparent; }
.link-btn { justify-self: start; padding: 4px 2px; background: none; border: 0; color: var(--alert); font: 600 .95rem/1.3 var(--f-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn[disabled] { opacity: .4; }

.choices { display: grid; gap: 10px; }
.choice { display: grid; grid-template-columns: 40px 1fr; gap: 2px 14px; padding: 16px 18px; text-align: start; border-radius: var(--r-lg); background: var(--white); border: 2px solid transparent; color: var(--ink); cursor: pointer; font: inherit; transition: border-color .15s; }
.choice:hover, .choice:focus-visible { border-color: var(--delft); }
.choice__key { grid-row: span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--delft-tint); color: var(--delft); font: 700 1rem/1 var(--f-display); }
.choice__nl { font: 600 1.06rem/1.35 var(--f-display); }
.choice__gloss { font-size: .9rem; color: var(--ink-2); }

.meters { display: grid; gap: 14px; }
.meter__head { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: .9rem; font-weight: 600; }
.meter__track { height: 8px; border-radius: var(--pill); background: var(--delft-tint); overflow: hidden; }
.meter__fill { display: block; height: 100%; border-radius: var(--pill); background: var(--delft); transition: width .5s ease; }

.report[hidden] { display: none; }
.report { display: grid; gap: 24px; padding: clamp(24px, 3vw, 36px); border-radius: var(--r-xl); background: var(--delft); color: var(--white); }
.report .label { color: var(--marker); }
.report__score { font: 800 clamp(4.5rem, 10vw, 7.5rem)/.9 var(--f-display); letter-spacing: -.05em; }
.report__score::after { content: "/100"; margin-inline-start: 6px; font-size: .28em; letter-spacing: 0; opacity: .7; }
.report__level { font: 600 1.3rem/1.35 var(--f-display); max-width: 46ch; }
.report__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.report__cols--3 { grid-template-columns: repeat(3, 1fr); }
.report__cols > div { padding: 18px 20px; border-radius: var(--r-lg); background: rgba(255, 255, 255, .1); }
.report__gloss { display: block; font-size: .86rem; opacity: .75; }
.report .btn { justify-self: start; background: var(--marker); border-color: var(--marker); color: var(--ink); }
.report .btn:hover { background: var(--white); border-color: var(--white); }

/* ---------- Family hub: profile tabs, reports, teachers, meeting notes ---------- */

.hub-tabs { display: flex; gap: 6px; margin-top: clamp(24px, 3vw, 36px); padding: 6px; border-radius: var(--pill); background: var(--white); overflow-x: auto; scrollbar-width: none; }
.hub-tabs::-webkit-scrollbar { display: none; }
.hub-tabs a { display: inline-flex; align-items: center; gap: 8px; flex: 1 0 auto; justify-content: center; min-height: 46px; padding: 0 18px; border-radius: var(--pill); text-decoration: none; font: 600 .98rem/1 var(--f-display); color: var(--ink-2); white-space: nowrap; transition: background-color .15s, color .15s; }
.hub-tabs a:hover { background: var(--delft-tint); color: var(--delft-deep); }
.hub-tabs a[aria-current="page"] { background: var(--ink); color: var(--white); }
.hub-tabs svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hub-tabs a[aria-current="page"] svg { stroke: var(--marker); }
.hub-tabs__badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--pill); background: var(--alert); color: var(--white); font: 700 .78rem/1 var(--f-body); }
.profile-page .acct__stats { margin-top: clamp(20px, 3vw, 32px); }
.hub { margin-top: clamp(20px, 3vw, 32px); }
.hub__intro { display: grid; gap: 8px; }
.hub__intro .acct__hint { max-width: 62ch; font-size: 1rem; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.field { align-content: start; }
.field-row > * { min-width: 0; }
.field__label { font-size: .92rem; font-weight: 700; }
.field textarea { min-height: 0; }
.field input[type="date"] { min-width: 0; }

.drop { position: relative; display: grid; gap: 2px; justify-items: center; text-align: center; padding: 22px 16px; border: 2px dashed var(--delft-soft); border-radius: var(--r-md); background: var(--canvas); cursor: pointer; transition: border-color .15s, background-color .15s; }
.drop:hover, .drop--over { border-color: var(--delft); background: var(--delft-tint); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop:has(input:focus-visible) { outline: 3px solid var(--marker); outline-offset: 2px; }
.drop strong { font: 700 1rem/1.3 var(--f-display); color: var(--delft); overflow-wrap: anywhere; }
.drop span { font-size: .84rem; color: var(--ink-2); }
.drop::before { content: ""; width: 34px; height: 34px; margin-bottom: 6px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232140a0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M7 9l5-5 5 5M4 16v4h16v-4'/%3E%3C/svg%3E") center / contain no-repeat; }
.drop--filled { border-style: solid; border-color: var(--good); background: #eef8f3; }
.drop--filled::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f8a5b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E"); }

.more summary { cursor: pointer; font-weight: 700; font-size: .94rem; color: var(--delft); }
.more[open] summary { margin-bottom: 10px; }
.copy-field { width: 100%; margin-top: 4px; padding: 10px 12px; border: 0; border-radius: var(--r-sm); background: var(--canvas); font: 400 .84rem/1.4 var(--f-body); color: var(--ink-2); }

.history__item--link { text-decoration: none; color: inherit; border: 2px solid transparent; transition: border-color .15s; grid-template-columns: 1fr auto; }
.history__item--link:hover { border-color: var(--delft-soft); }
.status { justify-self: end; padding: 5px 12px; border-radius: var(--pill); font-size: .82rem; font-weight: 700; white-space: nowrap; background: var(--canvas); color: var(--ink-2); }
.status--done { background: #dff3e9; color: #135c3c; }
.status--failed { background: #fbe3e1; color: #8c2219; }
.btn.is-busy { opacity: .8; cursor: progress; }

/* Analysis pages */
.hub-detail { display: grid; gap: 22px; margin-top: clamp(24px, 3vw, 36px); max-width: 1000px; }
.hub-detail__head { display: grid; gap: 10px; justify-items: start; }
.hub-detail__head .h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); max-width: 30ch; }
.hub-detail__head .acct__meta a { color: var(--delft); font-weight: 600; }
.hub-detail__head .actions { gap: 8px; margin-top: 4px; }
.lang-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-block: 4px 4px; padding-inline: 16px 4px; border-radius: var(--pill); background: var(--white); }
.lang-pick__label { font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.lang-pick__select { min-height: 40px; padding: 0 12px; border: 1px solid var(--delft-soft); border-radius: var(--pill); background: var(--white); color: var(--ink); font: 600 .92rem/1 var(--f-body); cursor: pointer; }
.lang-pick__select:focus { outline: none; border-color: var(--delft); }
.insight { display: grid; gap: 10px; padding: clamp(22px, 3vw, 34px); border-radius: var(--r-xl); background: var(--delft); color: var(--white); }
.insight .label { color: var(--marker); }
.insight__lead { font: 500 clamp(1.12rem, 1.6vw, 1.32rem)/1.5 var(--f-display); max-width: 64ch; }
.hub-block { display: grid; gap: 4px; padding: clamp(20px, 3vw, 28px); border-radius: var(--r-xl); background: var(--white); }
.hub-block--advice { background: #fff8d6; }
.hub-block--advice .h4 { color: var(--ink); }

.subjects { display: grid; gap: 8px; }
.subjects__item { display: grid; grid-template-columns: 1fr auto 130px; gap: 16px; align-items: center; padding: 12px 16px; border-radius: var(--r-md); background: var(--canvas); border-inline-start: 5px solid var(--delft-soft); }
.subjects__item strong { font: 700 1.02rem/1.3 var(--f-display); }
.subjects__item p { font-size: .9rem; color: var(--ink-2); }
.subjects__result { font: 800 1.35rem/1 var(--f-display); color: var(--ink); }
.subjects__level { justify-self: end; padding: 4px 10px; border-radius: var(--pill); font-size: .8rem; font-weight: 700; background: var(--delft-tint); color: var(--delft-deep); }
.subjects__item--strong { border-inline-start-color: var(--good); }
.subjects__item--strong .subjects__level { background: #dff3e9; color: #135c3c; }
.subjects__item--attention { border-inline-start-color: var(--alert); }
.subjects__item--attention .subjects__level { background: #fbe3e1; color: #8c2219; }

.sw { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sw__col { display: grid; gap: 6px; align-content: start; padding: clamp(20px, 3vw, 26px); border-radius: var(--r-lg); background: var(--white); }
.sw__col .actions { margin-top: 10px; gap: 8px; }
.sw__col > .btn { justify-self: start; margin-top: 8px; }
.sw__col--good { box-shadow: inset 0 4px 0 var(--good); }
.sw__col--good .h4 { color: var(--good); }
.sw__col--grow { box-shadow: inset 0 4px 0 var(--alert); }
.sw__col--grow .h4 { color: #b5352b; }

.steps { counter-reset: step; display: grid; gap: 10px; }
.steps li { counter-increment: step; position: relative; padding-inline-start: 44px; min-height: 30px; }
.steps li::before { content: counter(step); position: absolute; inset-inline-start: 0; top: -2px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--marker); font: 800 .92rem/1 var(--f-display); }

.phrases { display: grid; gap: 8px; }
.phrases li { display: grid; gap: 2px; padding: 10px 14px; border-radius: var(--r-md); border: 1px dashed var(--delft-soft); }
.phrases__nl { font: 600 1.02rem/1.35 var(--f-display); }
.phrases__gloss { font-size: .88rem; color: var(--ink-2); }
.terms { display: grid; gap: 10px; }
.terms div { display: grid; gap: 2px; }
.terms dt { font: 700 1rem/1.3 var(--f-display); }
.terms dd { margin: 0; font-size: .92rem; color: var(--ink-2); }
.todo { display: grid; gap: 4px; }
.todo li { display: grid; grid-template-columns: minmax(70px, auto) 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--delft-tint); font-size: .96rem; }
.todo b { color: var(--delft); }
.transcript-text { max-height: 420px; overflow: auto; font-size: .96rem; color: var(--ink-2); }
.transcript-text p + p { margin-top: 10px; }

/* Teachers */
.threads { display: grid; gap: 10px; }
.thread-card { display: grid; grid-template-columns: 52px 1fr auto; gap: 16px; align-items: center; padding: 16px 20px; border-radius: var(--r-lg); background: var(--white); text-decoration: none; color: inherit; border: 2px solid transparent; transition: border-color .15s; }
.thread-card:hover { border-color: var(--delft-soft); }
.thread-card--new { border-color: var(--delft); }
.thread-card__avatar { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 18px; background: var(--delft-tint); color: var(--delft); font: 800 1.3rem/1 var(--f-display); }
.thread-card__body { display: grid; gap: 2px; min-width: 0; }
.thread-card__body strong { font: 700 1.08rem/1.3 var(--f-display); }
.thread-card__meta { font-size: .86rem; color: var(--ink-2); }
.thread-card__last { font-size: .94rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-card__date { font-size: .84rem; color: var(--ink-2); }
.chat { padding: 4px 0; }
.chat .history__empty { max-width: 100%; }
.chat .line__nl { font: 500 1.04rem/1.5 var(--f-body); }
.line__translate { justify-self: start; margin-top: 6px; padding: 4px 12px; border: 1px solid rgba(255, 255, 255, .4); border-radius: var(--pill); background: transparent; color: var(--marker); font: 600 .84rem/1.3 var(--f-body); cursor: pointer; }
.line__translate:hover { border-color: var(--marker); }
.chat .line__gloss { margin-top: 6px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .18); opacity: .85; }
.chat .line__gloss[hidden] { display: none; }
.composer__form--chat { grid-template-columns: 1fr; }
.composer__bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.composer__bar .btn:last-child { margin-inline-start: auto; }
.composer__status { font-size: .9rem; color: var(--ink-2); }

/* Meeting notes: how-to-add switch and recorder. Panels switch with :has(), so it also works without JS. */
.kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.kinds legend { margin-bottom: 6px; padding: 0; }
.kinds__opt { position: relative; display: grid; place-items: center; min-height: 46px; padding: 6px 8px; border-radius: var(--r-sm); background: var(--canvas); border: 2px solid transparent; font-weight: 700; font-size: .9rem; text-align: center; cursor: pointer; }
.kinds__opt input { position: absolute; opacity: 0; }
.kinds__opt:has(input:checked) { border-color: var(--delft); background: var(--delft-tint); color: var(--delft-deep); }
.kinds__opt:has(input:focus-visible) { outline: 3px solid var(--marker); outline-offset: 2px; }
.note-form [data-show] { display: none; }
.note-form:has(input[name$="kind"][value="voice"]:checked) [data-show~="voice"],
.note-form:has(input[name$="kind"][value="file"]:checked) [data-show~="file"],
.note-form:has(input[name$="kind"][value="text"]:checked) [data-show~="text"] { display: grid; }
.note-form [data-show][hidden] { display: none !important; }

.recorder { gap: 10px; justify-items: center; padding: 20px 16px; border-radius: var(--r-md); background: var(--ink); color: var(--white); text-align: center; }
.recorder__btn { display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 22px; border: 0; border-radius: var(--pill); background: var(--white); color: var(--ink); font: 700 1rem/1 var(--f-display); cursor: pointer; }
.recorder__btn[disabled] { opacity: .5; cursor: not-allowed; }
.recorder__dot { width: 14px; height: 14px; border-radius: 50%; background: var(--alert); }
.recorder--on .recorder__dot { border-radius: 3px; animation: blink 1s infinite ease-in-out; }
.recorder__time { font: 800 1.8rem/1 var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.recorder__status { color: rgba(255, 255, 255, .75); }
.recorder__audio { width: 100%; max-width: 420px; }
.recorder__audio[hidden] { display: none; }

.teacher-reply .transcript, .teacher-reply .composer { width: 100%; }
.teacher-reply .transcript { margin-top: 10px; }

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

@media (max-width: 560px) {
  .hub-tabs { border-radius: var(--r-lg); }
  .hub-tabs a { flex: 0 0 auto; padding: 0 14px; }
  .field-row { grid-template-columns: 1fr; }
  .subjects__item { grid-template-columns: 1fr auto; }
  .subjects__level { grid-column: 1 / -1; justify-self: start; }
  .thread-card { grid-template-columns: 44px 1fr; }
  .thread-card__avatar { width: 44px; height: 44px; border-radius: 14px; }
  .thread-card > :last-child:not(.thread-card__body) { display: none; }
  .history__item--link { grid-template-columns: 1fr; }
  .status { justify-self: start; }
}

/* ---------- Roles: educator dashboard, link codes, joining ---------- */

.acct__avatar--educator { background: var(--ink); box-shadow: inset 0 -6px 0 var(--delft); }
.acct__meta a { color: var(--delft); font-weight: 600; }
.acct__side--plain { padding: 0; background: transparent; }
.acct__side--static { position: static; }

.code-card { display: grid; gap: 12px; padding: clamp(22px, 3vw, 30px); border-radius: var(--r-xl); background: var(--ink); color: var(--white); }
.code-card .label { color: var(--marker); }
.code-card__code { font: 800 clamp(2.2rem, 4vw, 2.9rem)/1 var(--f-display); letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.code-card__hint { font-size: .92rem; color: rgba(255, 255, 255, .75); }
.code-card__link { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.code-card .copy-field { margin: 0; background: rgba(255, 255, 255, .1); color: var(--white); }
.code-card__reset { padding: 0; border: 0; background: none; color: rgba(255, 255, 255, .7); font: 600 .86rem/1.3 var(--f-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.code-card__reset:hover { color: var(--white); }

.share { gap: 14px; }
.share__panel { border-radius: var(--r-lg); background: var(--canvas); }
.share__panel > summary { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; cursor: pointer; list-style: none; font: 700 1.02rem/1.3 var(--f-display); color: var(--delft); }
.share__panel > summary::-webkit-details-marker { display: none; }
.share__panel > summary::after { content: "+"; font-size: 1.4rem; line-height: 1; }
.share__panel[open] > summary::after { content: "–"; }
.share__panel > form { padding: 0 18px 18px; }
.share__panel .field input, .share__panel .field select, .share__panel textarea, .share__panel .drop, .share__panel .kinds__opt { background: var(--white); }
.share__h { margin: 8px 0 0; }
.shared-list { display: grid; }
.shared-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--delft-tint); }
.shared-list span { display: grid; min-width: 0; }
.shared-list strong { font-size: .96rem; overflow-wrap: anywhere; }
.shared-list small { font-size: .82rem; color: var(--ink-2); }
.share__unlink { margin-top: 6px; }
/* Shared list inside the family panel scrolls instead of growing the panel */
.share .shared-list { max-height: 340px; overflow-y: auto; overscroll-behavior: contain; padding-inline-end: 8px; scrollbar-width: thin; }
.history__item--shared { grid-template-columns: 1fr auto; }
.history__item--shared a { color: var(--delft); font-weight: 600; }

.linked-chip, .shared-chip { display: inline-block; padding: 2px 9px; border-radius: var(--pill); font: 700 .74rem/1.5 var(--f-body); vertical-align: middle; }
.linked-chip { background: var(--marker); color: var(--ink); }
.new-chip { display: inline-block; padding: 2px 9px; border-radius: var(--pill); background: var(--alert); color: var(--white); font: 700 .74rem/1.5 var(--f-body); vertical-align: middle; }
.history__item--new { box-shadow: inset 4px 0 0 var(--alert); }
/* Lists that refresh themselves when a teacher shares something (badges.js) */
.live-list { display: grid; gap: 18px; }
.history__item.is-arrived { animation: arrived 2.4s ease-out; }
@keyframes arrived { from { background-color: #fff3c4; } to { background-color: var(--white); } }
@media (prefers-reduced-motion: reduce) { .history__item.is-arrived { animation: none; } }
.shared-chip { justify-self: start; margin-top: 4px; background: var(--delft-tint); color: var(--delft-deep); }

.join-box { display: grid; gap: 10px; padding: 18px; margin-bottom: 8px; border-radius: var(--r-lg); background: var(--delft-tint); }
.join-box__form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.join-box__form input { min-height: 46px; padding: 10px 14px; border: 2px solid transparent; border-radius: var(--r-sm); background: var(--white); font: 700 1.05rem/1 var(--f-display); letter-spacing: .05em; text-transform: uppercase; color: var(--ink); min-width: 0; }
.join-box__form input:focus { outline: none; border-color: var(--delft); }
.join-box__or { margin-top: 8px; font-size: 1.15rem; }

.join-card { display: flex; gap: 18px; align-items: center; padding: 22px; border-radius: var(--r-xl); background: var(--white); width: 100%; }
.join-card .thread-card__avatar { width: 64px; height: 64px; border-radius: 22px; background: var(--ink); color: var(--marker); font-size: 1.6rem; }

.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.roles legend { margin-bottom: 6px; padding: 0; }
/* The explanation language only matters for parents */
.auth__form:has(.roles input[value="educator"]:checked) .auth__parent-only { display: none; }
.roles__opt { position: relative; display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--r-md); background: var(--canvas); border: 2px solid transparent; cursor: pointer; }
.roles__opt input { position: absolute; opacity: 0; }
.roles__opt strong { font: 700 1rem/1.3 var(--f-display); }
.roles__opt span { font-size: .84rem; color: var(--ink-2); }
.roles__opt:has(input:checked) { border-color: var(--delft); background: var(--delft-tint); }
.roles__opt:has(input:focus-visible) { outline: 3px solid var(--marker); outline-offset: 2px; }

/* Account-type switch in the profile forms (Django RadioSelect markup) */
.field div:has(> div > label > input[type="radio"]) { display: flex; flex-wrap: wrap; gap: 8px; }
.field label:has(> input[type="radio"]) { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--pill); background: var(--canvas); font-weight: 600; cursor: pointer; }
.field label:has(> input[type="radio"]:checked) { background: var(--delft-tint); color: var(--delft-deep); }
.field input[type="radio"] { width: auto; min-height: 0; accent-color: var(--delft); }

@media (max-width: 560px) {
  .roles { grid-template-columns: 1fr; }
  .code-card__link { grid-template-columns: 1fr; }
  .history__item--shared { grid-template-columns: 1fr; }
}

/* ---------- Account menu (avatar chip in the top bar) ---------- */

.account-menu { position: relative; }
.account-menu > summary { list-style: none; cursor: pointer; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu[open] > .account-chip { border-color: var(--delft); background: var(--delft-tint); }
.account-chip__avatar { position: relative; }
.account-chip__dot { position: absolute; top: -2px; inset-inline-end: -2px; width: 11px; height: 11px; border-radius: 50%; background: var(--alert); border: 2px solid var(--white); }
.account-chip__caret { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.account-menu[open] .account-chip__caret { transform: rotate(180deg); }
.account-menu__panel { position: absolute; inset-inline-end: 0; top: calc(100% + 10px); z-index: 40; width: min(300px, calc(100vw - 32px)); padding: 8px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--delft-tint); box-shadow: 0 24px 48px -20px rgba(18, 27, 51, .35); }
.account-menu__who { display: grid; gap: 2px; padding: 10px 12px 12px; border-bottom: 1px solid var(--delft-tint); margin-bottom: 6px; }
.account-menu__who strong { font: 700 1.02rem/1.3 var(--f-display); }
.account-menu__who span { font-size: .82rem; color: var(--ink-2); overflow-wrap: anywhere; }
.account-menu__nav, .account-menu__foot { display: grid; gap: 2px; }
.account-menu__foot { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--delft-tint); }
.account-menu__panel a, .account-menu__foot button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-sm); background: none; text-decoration: none; color: var(--ink); font: 600 .96rem/1 var(--f-body); text-align: start; cursor: pointer; }
.account-menu__panel a:hover, .account-menu__foot button:hover { background: var(--canvas); }
.account-menu__panel a[aria-current="page"] { background: var(--delft-tint); color: var(--delft-deep); }
.account-menu__panel svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.account-menu__panel a span:first-of-type { flex: 1; }
.account-menu__foot button { color: var(--alert); }
.menu-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--pill); background: var(--alert); color: var(--white); font: 700 .76rem/1 var(--f-body); }

/* Section header (replaces the old tab bar) */
.acct__head--section { grid-template-columns: auto 1fr; }
.acct__head--section .acct__avatar { width: 72px; height: 72px; border-radius: 24px; font-size: 1.9rem; }
.acct__head--section + .acct__stats, .acct__head--section + .acct__grid, .acct__head--section + .hub-detail, .acct__head--section + .settings { margin-top: clamp(24px, 3vw, 36px); }
.hub-tabs + .acct__stats, .hub-tabs + .settings { margin-top: clamp(20px, 3vw, 32px); }
.acct__grid--single { grid-template-columns: minmax(0, 1fr); max-width: 900px; }

/* Parent settings page */
.settings { display: grid; gap: 20px; max-width: 980px; }
.settings__card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(20px, 4vw, 48px); padding: clamp(22px, 3vw, 34px); border-radius: var(--r-xl); background: var(--white); }
.settings__intro { display: grid; gap: 8px; align-content: start; }
.settings__form { display: grid; gap: 14px; }
.settings__form > .btn { justify-self: start; }
.settings .acct__data { margin-top: 0; }

/* ---------- Chat room ---------- */

.chat-page .acct__main { gap: 14px; }
/* Full-width chat with the link info + actions as a strip underneath */
.chat-page--wide { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.chat-page--wide .chat-info { position: static; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; padding: 18px clamp(18px, 2.5vw, 26px); }
.chat-info__text { display: grid; gap: 6px; flex: 1 1 420px; min-width: 0; }
.chat-info__text .h3 { font-size: 1.1rem; }
.chat-info__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.chat-page--wide .share--wide { position: static; padding: 20px clamp(18px, 2.5vw, 26px); }
.share__panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 14px; align-items: start; }
.share--wide .share__unlink { justify-self: start; }
.chat-room { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; height: clamp(380px, calc(100vh - 410px), 700px); border-radius: var(--r-xl); background: var(--white); border: 1px solid var(--delft-tint); overflow: hidden; box-shadow: 0 24px 50px -36px rgba(18, 27, 51, .45); }
.chat-room--headed { grid-template-rows: auto minmax(0, 1fr) auto; }
.chat-room { grid-template-columns: minmax(0, 1fr); }
.chat-room > * { min-width: 0; }
.chat-room__scroll { overflow-x: hidden; }
.bubble { min-width: 0; }
.chat-room__head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--delft-tint); background: var(--white); }
.chat-room__back { display: grid; place-items: center; width: 36px; height: 36px; margin-inline-start: -6px; border-radius: 50%; color: var(--delft); }
.chat-room__back:hover { background: var(--delft-tint); }
.chat-room__back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat-room__avatar { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 14px; background: var(--delft-tint); color: var(--delft); font: 800 1.1rem/1 var(--f-display); }
.chat-room__who { min-width: 0; }
.chat-room__who h2 { font: 700 1.12rem/1.25 var(--f-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-room__who p { font-size: .84rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.teacher-reply .chat-room { width: 100%; }
.chat-room__scroll { display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; padding: 20px clamp(14px, 2.5vw, 24px); background: var(--white); scrollbar-width: thin; }
.chat-room__list { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.chat-room__empty { margin: auto; max-width: 46ch; padding: 24px; text-align: center; color: var(--ink-2); }
.chat-room__empty[hidden] { display: none; }
.chat-room__new { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); padding: 8px 16px; border: 0; border-radius: var(--pill); background: var(--ink); color: var(--white); font: 600 .86rem/1 var(--f-body); box-shadow: 0 10px 24px -10px rgba(18, 27, 51, .6); cursor: pointer; }
.chat-room__new[hidden] { display: none; }

.bubble { display: grid; gap: 3px; max-width: min(78%, 560px); padding: 10px 14px 11px; border-radius: 18px; animation: bubble-in .18s ease-out; }
.bubble--theirs { align-self: flex-start; background: var(--canvas); border-end-start-radius: 6px; }
.bubble--mine { align-self: flex-end; background: var(--delft); color: var(--white); border-end-end-radius: 6px; }
.bubble__meta { font-size: .76rem; font-weight: 700; color: var(--ink-2); }
.bubble--mine .bubble__meta { color: rgba(255, 255, 255, .7); }
.bubble__text { font-size: 1rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble__gloss { margin-top: 4px; padding-top: 6px; border-top: 1px dashed var(--delft-soft); font-size: .92rem; color: var(--ink-2); white-space: pre-wrap; }
.bubble__translate { justify-self: start; margin-top: 4px; padding: 3px 10px; border: 1px solid var(--delft-soft); border-radius: var(--pill); background: var(--white); color: var(--delft); font: 600 .8rem/1.4 var(--f-body); cursor: pointer; }
.bubble__translate:hover { border-color: var(--delft); }
.bubble__receipt { justify-self: end; margin-top: 2px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; color: rgba(255, 255, 255, .6); }
.bubble__receipt.is-seen { color: var(--marker); }
.typing-bubble { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 14px; border-radius: 18px; border-end-start-radius: 6px; background: var(--canvas); color: var(--ink-2); font-size: .86rem; animation: bubble-in .18s ease-out; }
.typing-bubble[hidden] { display: none; }
.typing-bubble__dots { display: inline-flex; gap: 4px; }
.typing-bubble__dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--delft); animation: blink 1s infinite ease-in-out; }
.typing-bubble__dots i:nth-child(2) { animation-delay: .15s; }
.typing-bubble__dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.chat-room__composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; align-items: end; padding: 12px 14px 10px; border-top: 1px solid var(--delft-tint); background: var(--white); }
.chat-room__composer .notice { grid-column: 1 / -1; }
.chat-room__composer textarea { min-height: 48px; max-height: 180px; padding: 12px 16px; border-radius: 24px; resize: none; line-height: 1.45; }
.chat-room__send { display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--delft); color: var(--white); cursor: pointer; transition: background-color .15s; }
.chat-room__send:hover { background: var(--delft-deep); }
.chat-room__send[disabled] { opacity: .5; cursor: progress; }
.chat-room__send svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.chat-room__bar { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 0 6px; }
.chat-room__hint { font-size: .78rem; color: var(--ink-2); }
.chat-room__tool { padding: 4px 12px; border: 1px solid var(--delft-soft); border-radius: var(--pill); background: var(--white); color: var(--delft); font: 600 .84rem/1.4 var(--f-body); cursor: pointer; }
.chat-room__tool:hover { border-color: var(--delft); background: var(--delft-tint); }
.chat-room__tool[disabled] { opacity: .5; }
.chat-room__status { margin-inline-start: auto; font-size: .84rem; color: var(--alert); }

@media (max-width: 860px) {
  .settings__card { grid-template-columns: minmax(0, 1fr); }
  .chat-room { height: clamp(380px, calc(100vh - 200px), 640px); }
}

@media (max-width: 560px) {
  .acct__head--section { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .acct__head--section .acct__avatar { display: none; }
  .acct__head--section .page-title { font-size: clamp(2rem, 9vw, 2.5rem); }
  .acct__head--section .acct__meta { font-size: .92rem; }
  .hub-tabs { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .hub-tabs.is-end { -webkit-mask-image: none; mask-image: none; }
  .bubble { max-width: 88%; }
  .chat-room__hint { display: none; }
  .account-menu__panel { inset-inline-end: -8px; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .topbar__nav { display: none; }
  .footer__cols { grid-template-columns: repeat(2, 1fr); }
  .impact, .reasons, .team, .cards { grid-template-columns: 1fr 1fr; }
  .audiences { grid-template-columns: minmax(0, 1fr); }
  .phrase-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loop { grid-template-columns: repeat(3, 1fr); }
  .timeline { grid-template-columns: repeat(3, 1fr); row-gap: 36px; }
  .timeline::before { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .hero__grid, .split, .split--wide, .persona, .ba__panel, .page-head__grid, .sim, .picker__row, .two-lists, .report__cols, .report__cols--3 { grid-template-columns: 1fr; }
  .auth, .acct__grid, .contact, .legal, .about-cta, .footer__top { grid-template-columns: 1fr; }
  .legal__nav { position: static; }
  .legal__nav ul { display: flex; flex-wrap: wrap; }
  .auth__scene { display: none; }
  .acct__side { position: static; }
  .scene { padding-inline-start: 0; }
  .subtitle--teacher { inset-inline-start: 12px; }
  .scene__meter { inset-inline-end: 12px; top: 12px; }
  .subtitle--parent { inset-inline-end: 12px; }
  .persona__card, .engine__intro, .features__side, .sim__panel { position: static; }
  .issues__list { grid-template-columns: 1fr; }
  .track { grid-template-columns: 1fr; }
  .track::before { inset-inline-start: 22px; inset-inline-end: auto; top: 22px; bottom: 22px; width: 2px; height: auto; background: repeating-linear-gradient(180deg, var(--delft-soft) 0 8px, transparent 8px 14px); }
  .track__step { grid-template-columns: 46px 1fr; column-gap: 16px; }
  .track__dot { grid-row: span 2; margin: 0; }
  .loop { grid-template-columns: 1fr 1fr; }
  .intro--row { grid-template-columns: 1fr; justify-items: start; }
  .sim__panel { order: -1; }
  .line { max-width: 100%; }
}

@media (max-width: 560px) {
  .topbar__end .btn--small { display: none; }
  .topbar__end { gap: 8px; }
  .account-chip { padding-inline-end: 4px; }
  .account-chip__name { display: none; }
  .acct__head { grid-template-columns: auto 1fr; }
  .acct__logout { grid-column: 1 / -1; }
  .acct__avatar { width: 64px; height: 64px; border-radius: 22px; font-size: 1.7rem; }
  .acct__stats { grid-template-columns: 1fr; }
  .history__item { grid-template-columns: 1fr; gap: 10px; }
  .history__score { justify-items: start; }
  .impact, .reasons, .team, .cards, .loop, .stats, .timeline, .form, .phrase-cards { grid-template-columns: 1fr; }
  .scene__photo { aspect-ratio: 4 / 5; }
  .subtitle { max-width: calc(100% - 24px); }
  .subtitle__gloss { display: none; }
  .scene__meter { width: 200px; padding: 10px 14px; font-size: .8rem; }
  .subtitle--teacher { top: 54%; }
  .composer__form { grid-template-columns: 1fr; }
  .footer__cols { grid-template-columns: 1fr 1fr; }
  .doc__table, .doc__table tbody, .doc__table tr, .doc__table td { display: block; }
  .doc__table thead { display: none; }
  .doc__table td { border-bottom: 0; padding-block: 4px; }
  .doc__table td:first-child { padding-top: 14px; }
  .doc__table tr { border-bottom: 1px solid var(--delft-tint); padding-bottom: 10px; }
  .nl { min-height: 520px; }
  .nl__panel { margin: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ---------- Pager (long hub lists) ---------- */

.history[id], .threads[id] { scroll-margin-top: 110px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 4px; }
.pager__pages { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pager__step, .pager__num { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: var(--pill); background: var(--white); color: var(--delft); font: 600 .94rem/1 var(--f-body); text-decoration: none; transition: background-color .15s, color .15s; }
.pager__step svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
a.pager__step:hover, a.pager__num:hover { background: var(--delft-tint); color: var(--delft-deep); }
.pager__num.is-current { background: var(--ink); color: var(--white); }
.pager__step.is-off { opacity: .35; }
.pager__gap { padding: 0 4px; color: var(--ink-2); }
.pager__info { margin-inline-start: auto; font-size: .84rem; color: var(--ink-2); }

/* ---------- Home: reports and meeting notes (#understand) ---------- */

.understand { display: grid; gap: clamp(64px, 9vw, 112px); }
.showcase { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 6vw, 88px); align-items: center; }
.showcase > * { min-width: 0; }
.showcase--flip .sample { order: -1; }
.showcase__copy { display: grid; gap: 16px; justify-items: start; }
.showcase__copy > p:not(.label) { color: var(--ink-2); max-width: 52ch; }
.showcase__copy .btn { margin-top: 6px; }

/* A school document with Lexora's explanation laid over it, like a subtitle */
.sample { position: relative; padding: 0 0 clamp(110px, 12vw, 130px); }
.sample__paper { display: grid; gap: 14px; margin-inline-end: clamp(0px, 6vw, 56px); padding: clamp(22px, 3vw, 30px); border-radius: var(--r-xl); background: var(--white); border: 1px solid var(--delft-tint); box-shadow: 0 24px 50px -36px rgba(18, 27, 51, .45); }
.sample__head { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--delft-soft); font-size: .9rem; color: var(--ink-2); }
.sample__head strong { font: 700 1.05rem/1.3 var(--f-display); color: var(--ink); }
.sample__paper { padding-bottom: clamp(64px, 8vw, 84px); }
.sample__grades { display: grid; gap: 8px; }
.sample__grades div { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sample__grades dt { font-weight: 600; }
.sample__grades dd { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--canvas); font: 800 1rem/1 var(--f-display); }
.sample__grades dd.is-good { background: #dff3e9; color: var(--good); }
.sample__grades dd.is-low { background: #fbe3e1; color: var(--alert); }
.sample__remark { font-size: .98rem; line-height: 1.55; color: var(--ink-2); }
.sample__rec { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--ink-2); }
.sample__rec strong { color: var(--ink); }
.sample__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--alert); box-shadow: 0 0 0 4px #fbe3e1; flex: none; }
.sample__wave { display: flex; align-items: center; gap: 3px; flex: 1; height: 26px; }
.sample__wave i { flex: 1; max-width: 5px; border-radius: 3px; background: var(--delft-soft); }
.sample__wave i:nth-child(3n) { height: 90%; } .sample__wave i:nth-child(3n+1) { height: 45%; } .sample__wave i:nth-child(3n+2) { height: 70%; }

.sample__explain { inset-inline-start: auto; inset-inline-end: 0; bottom: 0; max-width: min(420px, 92%); border-end-end-radius: 6px; }
.subtitle__nl--plain { font-size: 1.02rem; }
.sample__ask { display: grid; gap: 2px; margin-top: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .1); font: 600 .95rem/1.4 var(--f-display); }
.sample__ask small { font: 400 .84rem/1.4 var(--f-body); color: rgba(255, 255, 255, .72); }
.sample__next { margin-top: 10px; font-size: .88rem; line-height: 1.45; color: rgba(255, 255, 255, .78); }
.sample__next strong { color: var(--marker); }

.understand__note { margin-top: clamp(48px, 6vw, 72px); max-width: 72ch; color: var(--ink-2); }
.understand__note span { display: block; margin-top: 6px; font-size: .9rem; }

@media (max-width: 860px) {
  .showcase { grid-template-columns: 1fr; }
  .showcase--flip .sample { order: 0; }
  .sample__paper { margin-inline-end: 0; }
  .sample__explain { inset-inline-end: 12px; }
}
@media (max-width: 560px) {
  .sample { padding-bottom: 0; }
  .sample__paper { padding-bottom: 52px; }
  .sample__explain { position: relative; inset-inline-end: auto; margin-block: -36px 0; margin-inline: auto 0; max-width: 94%; }
}

/* ---------- Blog ---------- */

.blog-head { max-width: 760px; }
.blog { padding-top: 0; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: clamp(20px, 3vw, 32px); }
.post-grid > li { display: flex; }
.post-card { display: flex; flex-direction: column; width: 100%; border-radius: var(--r-xl); background: var(--white); overflow: hidden; border: 1px solid var(--delft-tint); transition: box-shadow .2s, transform .2s; }
.section--tint .post-card { background: var(--canvas); border-color: transparent; }
.post-card:hover { box-shadow: 0 24px 50px -34px rgba(18, 27, 51, .5); transform: translateY(-2px); }
.post-card__media { display: block; aspect-ratio: 3 / 2; background: var(--delft-tint); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { display: grid; gap: 10px; align-content: start; padding: clamp(18px, 2.4vw, 26px); }
.post-card__meta { font-size: .86rem; color: var(--ink-2); }
.post-card__title { font: 700 1.28rem/1.25 var(--f-display); letter-spacing: -.01em; }
.post-card__title a { color: var(--ink); text-decoration: none; }
.post-card__title a:hover { color: var(--delft); text-decoration: underline; text-underline-offset: 3px; }
.post-card__excerpt { color: var(--ink-2); }
.post-card--featured { display: grid; grid-template-columns: 7fr 5fr; margin-bottom: clamp(32px, 5vw, 56px); }
.post-card--featured .post-card__media { aspect-ratio: auto; min-height: 340px; }
.post-card--featured .post-card__body { align-content: center; gap: 14px; padding: clamp(24px, 4vw, 48px); justify-items: start; }
.post-card--featured .post-card__title { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
.blog .pager { margin-top: clamp(24px, 3vw, 36px); }

.post__head { display: grid; gap: 16px; justify-items: start; max-width: calc(780px + 2 * var(--gutter)); padding-block: clamp(28px, 4vw, 56px) clamp(24px, 3vw, 36px); }
.post__title { max-width: 26ch; }
.post__lede { max-width: 62ch; }
.post__meta, .post__langs { font-size: .92rem; color: var(--ink-2); }
.post__langs a { color: var(--delft); font-weight: 600; }
.post__preview { justify-self: stretch; }
.post__cover { max-width: calc(1080px + 2 * var(--gutter)); }
.post__cover img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; border-radius: var(--r-xl); }
.post__body { max-width: 70ch; margin-inline: auto; padding-block: clamp(28px, 4vw, 48px); font-size: 1.1rem; line-height: 1.75; }
.post__body > * + * { margin-top: 1.1em; }
.post__body h2 { margin-top: 1.8em; font: 700 clamp(1.45rem, 2.2vw, 1.8rem)/1.25 var(--f-display); letter-spacing: -.015em; }
.post__body h3 { margin-top: 1.5em; font: 700 1.25rem/1.3 var(--f-display); color: var(--delft); }
.post__body ul, .post__body ol { display: grid; gap: 8px; padding-inline-start: 1.4em; }
.post__body ul { list-style: disc; }
.post__body ol { list-style: decimal; }
.post__body li::marker { color: var(--delft); font-weight: 700; }
.post__body a { color: var(--delft); font-weight: 600; text-underline-offset: 3px; }
.post__body blockquote { padding-block: 4px; padding-inline-start: 20px; border-inline-start: 4px solid var(--marker); font: 500 1.2rem/1.5 var(--f-display); }
.post__body mark { padding-inline: .2em; }
.post__figure img { width: 100%; border-radius: var(--r-lg); }
.post__figure figcaption { margin-top: 8px; font-size: .9rem; color: var(--ink-2); }
.post__missing { padding: 10px 14px; border-radius: var(--r-sm); background: #fbe3e1; color: #8c2219; font-family: ui-monospace, monospace; }
.post__cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; max-width: 900px; margin: 0 auto clamp(56px, 7vw, 96px); padding: clamp(22px, 3vw, 32px); border-radius: var(--r-xl); background: var(--delft); color: var(--white); }
.post__cta > div:first-child { flex: 1 1 360px; display: grid; gap: 6px; }
.post__cta .label { color: var(--marker); }
.post__cta .btn { background: var(--marker); border-color: var(--marker); color: var(--ink); }
.post__cta .btn:hover { background: var(--white); border-color: var(--white); }
.post__cta .btn--ghost { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, .55); }
.post__cta .btn--ghost:hover { background: rgba(255, 255, 255, .12); border-color: var(--white); color: var(--white); }
.related__title { margin-bottom: 24px; }

@media (max-width: 860px) {
  .post-card--featured { grid-template-columns: 1fr; }
  .post-card--featured .post-card__media { min-height: 0; aspect-ratio: 3 / 2; }
  .post__cover img { aspect-ratio: 3 / 2; }
}

/* Small phones (320–400 px): three language buttons, the logo and the account button must fit on one line */
@media (max-width: 400px) {
  .topbar__inner { gap: 12px; }
  .topbar__end { gap: 6px; }
  .brand { gap: 7px; font-size: 1.25rem; }
  .brand img { width: 26px; height: 26px; }
  .topbar .lang button { min-width: 32px; padding-inline: 8px; }
}

/* ---------- Right-to-left (Arabic) ----------
   Layout uses logical properties (inline-start/end), so it mirrors on its own under dir="rtl".
   These rules cover what logical properties cannot: gradients, inset edges and directional icons. */

[dir="rtl"] .scene__meter i,
[dir="rtl"] .history__score i { background: linear-gradient(270deg, var(--good) var(--v), var(--delft-tint) var(--v)); }
[dir="rtl"] .legal__nav a[aria-current] { box-shadow: inset -3px 0 0 var(--delft); }
[dir="rtl"] .history__item--new { box-shadow: inset -4px 0 0 var(--alert); }
@media (max-width: 560px) {
  [dir="rtl"] .hub-tabs { -webkit-mask-image: linear-gradient(270deg, #000 85%, transparent); mask-image: linear-gradient(270deg, #000 85%, transparent); }
}

/* Arrows point the way you read: back/previous/next and the → after links */
.dir-arrow { display: inline-block; }
[dir="rtl"] .back::before,
[dir="rtl"] .chat-room__back svg,
[dir="rtl"] .pager__step svg,
[dir="rtl"] .dir-arrow { transform: scaleX(-1); }

/* Dutch (and other untranslated) text stays left-to-right inside an Arabic page */
[dir="rtl"] [lang="nl"],
[dir="rtl"] [translate="no"] { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] p[lang="nl"], [dir="rtl"] p[translate="no"],
[dir="rtl"] blockquote[lang="nl"] { text-align: right; }
/* Email addresses, links and codes read left-to-right */
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="url"], [dir="rtl"] .copy-field,
[dir="rtl"] .join-box input, [dir="rtl"] code { direction: ltr; text-align: right; }

/* Arabic typography: the self-hosted fonts are Latin-only, so Arabic falls back to fonts that have it.
   Arabic is a joined script — no negative letter-spacing — and needs taller lines. */
html:lang(ar) {
  --f-display: "Bricolage Grotesque", "Segoe UI", "Noto Sans Arabic", "Geeza Pro", Tahoma, system-ui, sans-serif;
  --f-body: "Atkinson Hyperlegible Next", "Segoe UI", "Noto Sans Arabic", "Geeza Pro", Tahoma, system-ui, sans-serif;
}
html:lang(ar) body * { letter-spacing: 0 !important; }
html:lang(ar) .hero__title, html:lang(ar) .page-title, html:lang(ar) .h2, html:lang(ar) .nl__title { line-height: 1.3; }
/* Arabic letterforms are taller and wider at the same size: scale the largest headings down a step */
html:lang(ar) .hero__title { font-size: clamp(2.2rem, 4.4vw, 3.8rem); }
html:lang(ar) .page-title { font-size: clamp(2rem, 3.8vw, 3.1rem); }
html:lang(ar) .h3, html:lang(ar) .vision__quote, html:lang(ar) .insight p { line-height: 1.45; }
html:lang(ar) body { line-height: 1.8; }
/* Text people type (chat, practice answers, notes) takes the direction of its own content —
   a Dutch message stays left-to-right on an Arabic page, an Arabic one right-to-left on an English page. */
.bubble__text, .bubble__gloss, .typing-bubble__text, .line__nl, .line__gloss, .line__feedback,
.suggestion__nl, .suggestion__gloss, .thread-card__last, textarea, input[type="text"], input[type="search"],
/* AI explanations can be in another language than the site (per-report language switch) */
.history__text p, .hub-detail p, .hub-detail li, .hub-detail dd, .hub-detail .subjects__result {
  unicode-bidi: plaintext; text-align: start;
}
