/* Continual Learning for Embodied AI: project page, shell and shared components.
   Light theme only. Palette identical to the paper figures (meta.palette in data/site-data.js).
   Modules (charts, explorer, library) add only assets/css/<module>.css and reuse the tokens and components below.
   Documentation of every token, component and container id: ../../DESIGN.md. */

/* ======================================================================= 1. tokens */
:root {
  color-scheme: light;

  /* paper palette: axis colors, light fills, and darker inks for text on the light fills (all >= 4.5:1) */
  --teal: #2AB7B7;   --teal-light: #DDF4F4;   --teal-dark: #138A8A;  --teal-ink: #0E6B6B;
  --amber: #F5B335;  --amber-light: #FDF1D8;  --amber-ink: #7A4D00;
  --coral: #F07C6C;  --coral-light: #FCE3DF;  --coral-ink: #A13A2C;
  --violet: #8C7AE6; --violet-light: #ECE8FB; --violet-ink: #4F3DB0;
  --sky: #4A9FE0;    --sky-light: #E3F0FB;    --sky-ink: #1D5F99;
  --slate: #3E4A59;  --gray: #EEF1F4;

  /* axes: T task, E environment, B embodiment, F feedback, FM foundation models */
  --ax-T: var(--teal);   --ax-T-light: var(--teal-light);   --ax-T-ink: var(--teal-ink);
  --ax-E: var(--amber);  --ax-E-light: var(--amber-light);  --ax-E-ink: var(--amber-ink);
  --ax-B: var(--coral);  --ax-B-light: var(--coral-light);  --ax-B-ink: var(--coral-ink);
  --ax-F: var(--violet); --ax-F-light: var(--violet-light); --ax-F-ink: var(--violet-ink);
  --ax-FM: var(--sky);   --ax-FM-light: var(--sky-light);   --ax-FM-ink: var(--sky-ink);

  /* evidence grades (Sec. 1.3): D direct, P partial, A adjacent, NG not graded (neutral outline).
     --ev-D (#138A8A, the paper's color) is for fills without text: bars, dots, swatches, borders (4.2:1, above the 3:1
     non-text minimum). Behind white text use --ev-D-strong (#117F7F, 4.8:1 with white). */
  --ev-D: #138A8A; --ev-D-strong: #117F7F; --ev-D-text: #FFFFFF;
  --ev-P: #F5B335; --ev-P-text: var(--slate);
  --ev-A: #EEF1F4; --ev-A-text: var(--slate); --ev-A-line: #9AA5B1;
  --ev-NG-line: #8C97A4; --ev-NG-text: var(--slate);

  /* neutrals */
  --ink: #1F2933;          /* headings, strong text, dark buttons (15.6:1 on white) */
  --text: #2B3541;         /* body text */
  --text-2: #3E4A59;       /* secondary text = slate (9.3:1) */
  --text-3: #596574;       /* captions, notes, labels (5.9:1) */
  --rule: #E3E8EE;         /* hairlines, card borders */
  --rule-2: #CDD5DE;       /* stronger borders */
  --rule-3: #8792A0;       /* form-control borders (3:1 non-text contrast) */
  --bg: #FFFFFF;
  --bg-soft: #F7F9FB;      /* panels, code */
  --bg-tint: #F4FAFA;      /* zebra rows and assessment boxes, as in the paper's tables */
  --focus: #138A8A;

  /* type */
  --font-sans: "Source Sans 3", "Source Sans Pro", -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --fs-2xs: .75rem;      /* 12 px: badges only */
  --fs-xs: .8125rem;     /* 13 px: chips, labels, readouts */
  --fs-sm: .9375rem;     /* 15 px: secondary text, captions, controls */
  --fs-base: 1.0625rem;  /* 17 px: body */
  --fs-md: 1.125rem;
  --fs-lg: 1.3rem;       /* h3 */
  --fs-xl: clamp(1.55rem, 1.2rem + 1.05vw, 2rem);         /* h2 */
  --fs-hero: clamp(2.1rem, 1.35rem + 2.5vw, 3.35rem);     /* h1 */
  --lh-tight: 1.18; --lh-snug: 1.4; --lh-body: 1.65;

  /* spacing (4 px base) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;

  /* radii */
  --r-xs: 4px; --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 22px; --r-pill: 999px;

  /* shadows: very light */
  --sh-1: 0 1px 2px rgba(31, 41, 51, .05);
  --sh-2: 0 1px 2px rgba(31, 41, 51, .04), 0 6px 18px rgba(31, 41, 51, .06);
  --sh-3: 0 2px 6px rgba(31, 41, 51, .06), 0 18px 44px rgba(31, 41, 51, .14);

  /* layout */
  --w-text: 44rem;        /* Distill-like reading width for prose */
  --w-content: 1000px;    /* figures, panels and module views */
  --w-toc: 208px;
  --gutter: 32px;

  /* layers */
  --z-toc: 20; --z-progress: 40; --z-drawer: 70; --z-lightbox: 80; --z-popover: 85; --z-tooltip: 90; --z-toast: 95;

  /* motion: short transitions in direct response to a user action only */
  --dur-1: 120ms; --dur-2: 180ms; --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ======================================================================= 2. base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 20px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--fs-base)/var(--lh-body) var(--font-sans);
  overflow-wrap: break-word; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--teal-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--teal-light); }
sup, sub { line-height: 0; }
i, em { font-style: italic; }
code, pre, kbd { font-family: var(--font-mono); }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -64px; z-index: 100; padding: 8px 14px; border-radius: var(--r-sm);
  background: var(--ink); color: #fff; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.nowrap { white-space: nowrap; }

/* ======================================================================= 3. typography */
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; color: var(--ink); letter-spacing: 0; }
/* Source Serif 4 is loaded with its optical-size axis: pin the text cut so large headings are not narrowed */
h1, h2, h3, h4, .serif { font-variation-settings: 'opsz' 18; }
h2 { font-size: var(--fs-xl); line-height: 1.22; margin: 0; }
h3 { font-size: var(--fs-lg); line-height: 1.3; margin: var(--sp-7) 0 var(--sp-3); }
h4 { font-family: var(--font-sans); font-size: 1rem; line-height: 1.35; margin: var(--sp-5) 0 var(--sp-2); }
p { margin: 0 0 1em; }
.prose { max-width: var(--w-text); }
.lead { font-size: var(--fs-md); color: var(--text); }
.note, .small { font-size: var(--fs-sm); color: var(--text-3); }
.meta-line { font-size: var(--fs-xs); color: var(--text-3); margin: var(--sp-2) 0 0; }
.readout { font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ======================================================================= 4. scroll progress */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: var(--z-progress); pointer-events: none; }
.progress-bar {
  height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--teal) 0%, var(--sky) 45%, var(--amber) 100%);
}

/* ======================================================================= 5. hero */
.hero {
  position: relative;
  background:
    radial-gradient(1100px 520px at 8% -10%, rgba(221, 244, 244, .95), rgba(221, 244, 244, 0) 62%),
    radial-gradient(900px 520px at 100% 30%, rgba(253, 241, 216, .85), rgba(253, 241, 216, 0) 60%),
    linear-gradient(180deg, #F8FBFB 0%, #FFFFFF 100%);
  border-bottom: 1px solid var(--rule);
}
.hero-inner {
  max-width: 1320px; margin: 0 auto; padding: 56px var(--gutter) 56px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px 56px; align-items: center;
}
.hero-text { text-align: center; min-width: 0; }
.hero-title { font-size: var(--fs-hero); line-height: var(--lh-tight); margin: 0 auto; max-width: 15em; text-wrap: balance; }
.hero-subtitle {
  font-family: var(--font-serif); font-variation-settings: 'opsz' 18; font-weight: 400;
  font-size: clamp(1.15rem, .95rem + .75vw, 1.55rem); line-height: 1.3; color: var(--text-2); margin: .45em auto 0; text-wrap: balance;
}
.byline { max-width: 40rem; margin: 22px auto 0; }
.authors { font-size: 1.03rem; line-height: 1.75; color: var(--ink); margin: 0 0 .7rem; text-wrap: balance; }
.author { white-space: nowrap; }
.authors sup { font-size: .68em; margin-left: 1px; color: var(--text-3); }
.affils { list-style: none; margin: 0 0 .65rem; padding: 0; font-size: var(--fs-sm); line-height: 1.55; color: var(--text-2); }
.affils li { display: block; }
.affils sup { font-size: .72em; margin-right: 2px; color: var(--text-3); }
.hero-notes { font-size: var(--fs-xs); line-height: 1.55; color: var(--text-3); margin: 0; }
.hero-notes .note-item { display: inline-block; margin: 0 .5em; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 22px 0 0; }
.hero-meta { font-size: var(--fs-xs); color: var(--text-3); margin: 14px 0 0; }
.hero-visual { min-width: 0; }
.hero-card {
  margin: 0; padding: 14px; background: #fff; border-radius: var(--r-xl);
  border: 1px solid rgba(62, 74, 89, .09); box-shadow: 0 1px 2px rgba(31, 41, 51, .05), 0 14px 36px rgba(31, 41, 51, .09);
}
.hero-card img { width: 100%; height: auto; border-radius: 12px; }
.hero-composite { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: end; padding: 10px 6px 4px; }
.hero-composite img { width: 100%; height: 150px; object-fit: contain; }
/* institution logos under the byline: bare logos at one height (as on the world model survey page); institutions
   without a logo file are named in plain text */
.logos { list-style: none; margin: 18px auto 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 26px; }
.logo { display: flex; align-items: center; min-height: 46px; }
.logo img { height: 46px; width: auto; max-width: none; flex: none; }
.logo-name { font: 600 var(--fs-sm)/1.25 var(--font-sans); color: var(--text-2); text-align: center; }
.hero.no-visual .hero-inner { grid-template-columns: minmax(0, 1fr); max-width: 60rem; }

/* ======================================================================= 6. page layout, table of contents */
.layout {
  max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: var(--w-toc) minmax(0, 1fr); column-gap: 56px; align-items: start;
}
.content { min-width: 0; max-width: var(--w-content); padding-bottom: var(--sp-8); }
.content:focus { outline: none; }

.toc { position: sticky; top: 24px; margin-top: 66px; max-height: calc(100vh - 48px); overflow-y: auto; padding: 0 4px 16px 0; }
.toc-toggle { display: none; }
.toc-title { font: 600 var(--fs-xs)/1.3 var(--font-sans); color: var(--text-3); margin: 0 0 10px; }
.toc-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc-list a {
  display: block; margin-left: -1px; padding: 5px 0 5px 14px; border-left: 2px solid transparent;
  color: var(--text-3); text-decoration: none; font-size: var(--fs-sm); line-height: 1.35;
  transition: color var(--dur-1), border-color var(--dur-1);
}
.toc-list a:hover { color: var(--ink); border-left-color: var(--rule-2); }
.toc-list a[aria-current="location"] { color: var(--teal-ink); border-left-color: var(--teal-dark); font-weight: 600; }
.toc-foot { margin: 16px 0 0; font-size: var(--fs-xs); }
.toc-foot a { color: var(--text-3); }

/* ======================================================================= 7. sections */
.section { padding: 64px 0 8px; }
.section:focus, .section h2:focus, .section h3:focus { outline: none; }
.section-head {
  display: flex; align-items: center; gap: 14px; padding-bottom: 14px; margin-bottom: 24px; border-bottom: 1px solid var(--rule);
}
.section-titles { min-width: 0; flex: 1; }
.section-kicker { font: 600 var(--fs-xs)/1.3 var(--font-sans); color: var(--teal-ink); margin: 0 0 3px; }
.anchor {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; align-self: flex-end;
  color: var(--text-3); text-decoration: none; opacity: 0; border-radius: var(--r-sm); transition: opacity var(--dur-1);
}
.anchor .i { width: 16px; height: 16px; }
.section-head:hover .anchor, .anchor:focus-visible { opacity: 1; }
.anchor:hover { color: var(--teal-ink); background: var(--teal-light); }
.subhead { font-size: var(--fs-lg); margin: var(--sp-7) 0 var(--sp-3); }
.mount { position: relative; min-width: 0; margin: var(--sp-5) 0; }
.mount:empty { margin: 0; }
.block { margin: var(--sp-5) 0; }

/* ======================================================================= 8. buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 18px;
  border: 1px solid var(--rule-2); border-radius: var(--r-pill); background: #fff; color: var(--ink);
  font: 600 var(--fs-sm)/1.2 var(--font-sans); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur-1), border-color var(--dur-1), color var(--dur-1);
}
.btn:hover { background: var(--bg-soft); border-color: var(--rule-3); text-decoration: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #33404F; border-color: #33404F; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--gray); border-color: transparent; }
.btn-sm { min-height: 32px; padding: 5px 12px; gap: 6px; font-size: var(--fs-xs); }
.btn-icon { width: 38px; min-height: 38px; height: 38px; padding: 0; border-radius: 50%; }
.btn-icon.btn-sm { width: 32px; height: 32px; min-height: 32px; }
.btn[aria-pressed="true"] { background: var(--teal-light); border-color: var(--teal-dark); color: var(--teal-ink); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--gray); border-color: var(--rule); color: var(--text-3); cursor: not-allowed; }
.btn .i { width: 16px; height: 16px; }
.btn-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--teal-ink);
  font: 600 var(--fs-xs)/1.4 var(--font-sans); text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.btn-link:hover { text-decoration-thickness: 2px; }
.i { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ======================================================================= 9. chips, badges, propositions, citations */
.chip {
  --chip-c: var(--rule-2); --chip-l: #fff; --chip-i: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 11px;
  border: 1px solid var(--chip-c); border-radius: var(--r-pill); background: var(--chip-l); color: var(--chip-i);
  font: 600 var(--fs-xs)/1.2 var(--font-sans); text-decoration: none; white-space: nowrap; max-width: 100%;
  transition: background-color var(--dur-1), border-color var(--dur-1), color var(--dur-1);
}
button.chip, a.chip { cursor: pointer; }
button.chip:hover, a.chip:hover { border-color: var(--rule-3); }
.chip[class*="ax-"]:hover, .chip[class*="ev-"]:hover { border-color: var(--chip-i); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--chip-i); border-color: var(--chip-i); color: #fff; }
.chip[aria-pressed="true"] .chip-n, .chip.is-active .chip-n { color: inherit; opacity: .85; }
.chip:disabled, .chip[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--chip-c); flex: none; }
.chip-n { font-weight: 400; color: var(--text-3); font-variant-numeric: tabular-nums; }
.chip.ax-T  { --chip-c: var(--teal);   --chip-l: var(--teal-light);   --chip-i: var(--teal-ink); }
.chip.ax-E  { --chip-c: var(--amber);  --chip-l: var(--amber-light);  --chip-i: var(--amber-ink); }
.chip.ax-B  { --chip-c: var(--coral);  --chip-l: var(--coral-light);  --chip-i: var(--coral-ink); }
.chip.ax-F  { --chip-c: var(--violet); --chip-l: var(--violet-light); --chip-i: var(--violet-ink); }
.chip.ax-FM { --chip-c: var(--sky);    --chip-l: var(--sky-light);    --chip-i: var(--sky-ink); }
.chip.ev-D  { --chip-c: var(--ev-D);   --chip-l: var(--teal-light);   --chip-i: var(--teal-ink); }
.chip.ev-P  { --chip-c: var(--ev-P);   --chip-l: var(--amber-light);  --chip-i: var(--amber-ink); }
.chip.ev-A  { --chip-c: var(--ev-A-line); --chip-l: var(--ev-A);      --chip-i: var(--slate); }
.chip.ev-NG { --chip-c: var(--ev-NG-line); --chip-l: #fff;            --chip-i: var(--slate); border-style: dashed; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* letter badges: evidence (.badge-D or .badge.ev-D), axes (.badge.ax-T), platforms (.badge.pl-Sim), caveats (.badge.cav-OL).
   Inline boxes (not inline-block) so that punctuation after a badge in running text never wraps onto the next line. */
.badge, .badge-D, .badge-P, .badge-A, .badge-NG {
  display: inline; padding: .16em .42em; border: 1px solid transparent; border-radius: var(--r-xs);
  font: 700 var(--fs-2xs)/1 var(--font-sans); letter-spacing: 0; vertical-align: .08em; white-space: nowrap; font-style: normal;
}
.badge-D, .badge.ev-D { background: var(--ev-D-strong); color: var(--ev-D-text); }
.badge-P, .badge.ev-P { background: var(--ev-P); color: var(--ev-P-text); }
.badge-A, .badge.ev-A { background: var(--ev-A); color: var(--ev-A-text); border-color: var(--ev-A-line); }
.badge-NG, .badge.ev-NG { background: #fff; color: var(--ev-NG-text); border: 1px dashed var(--ev-NG-line); }
.badge.ax-T  { background: var(--teal-light);   color: var(--teal-ink);   border-color: var(--teal); }
.badge.ax-E  { background: var(--amber-light);  color: var(--amber-ink);  border-color: var(--amber); }
.badge.ax-B  { background: var(--coral-light);  color: var(--coral-ink);  border-color: var(--coral); }
.badge.ax-F  { background: var(--violet-light); color: var(--violet-ink); border-color: var(--violet); }
.badge.ax-FM { background: var(--sky-light);    color: var(--sky-ink);    border-color: var(--sky); }
.badge.pl-Sim  { background: var(--sky-light);   color: var(--slate); border-color: rgba(74, 159, 224, .7); }
.badge.pl-Real { background: var(--coral-light); color: var(--slate); border-color: rgba(240, 124, 108, .55); }
.badge.pl-Log  { background: var(--gray);        color: var(--slate); border-color: rgba(62, 74, 89, .55); }
.badge[class*="cav-"] { background: var(--gray); color: var(--slate); border-color: rgba(62, 74, 89, .4); font-weight: 600; }
.badge-lg { display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-xs); height: 1.75em; min-width: 1.95em; padding: 0 .45em; vertical-align: middle; }

/* proposition tags P1-P7 as in the paper (slate badge); interactive ones are upgraded by app.js (role=link, tabindex) */
.pos {
  display: inline; padding: .16em .42em; border-radius: var(--r-xs);
  background: var(--slate); color: #fff; font: 700 var(--fs-2xs)/1 var(--font-sans); vertical-align: .08em; white-space: nowrap;
}
.pos[tabindex] { cursor: pointer; }
.pos[tabindex]:hover { background: var(--ink); }

/* citations inside paper passages: <a class="cite" href="#ref-KEY" data-key="KEY"> */
a.cite {
  color: var(--teal-ink); text-decoration: underline dotted rgba(14, 107, 107, .6); text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a.cite:hover { text-decoration-style: solid; text-decoration-color: currentColor; }

/* ======================================================================= 10. cards, panels, callouts */
.card { background: #fff; border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 20px; min-width: 0; }
.card-interactive { transition: border-color var(--dur-1), box-shadow var(--dur-1); }
.card-interactive:hover { border-color: var(--rule-2); box-shadow: var(--sh-2); }
.card-head { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.card-icon { width: 36px; height: 36px; flex: none; }
.card-title { font: 600 1.08rem/1.3 var(--font-serif); font-variation-settings: 'opsz' 18; color: var(--ink); margin: 0; }
.card-kicker { font: 600 var(--fs-xs)/1.3 var(--font-sans); color: var(--text-3); margin: 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }

.panel {
  display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1px solid var(--rule);
  border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 20px 22px 16px;
}
.panel-head { margin: 0 0 8px; }
.panel-kicker { font: 600 var(--fs-xs)/1.3 var(--font-sans); color: var(--teal-ink); margin: 0 0 2px; }
.panel-title { font: 600 1.15rem/1.3 var(--font-serif); font-variation-settings: 'opsz' 18; color: var(--ink); margin: 0; }
.panel-intro { font-size: var(--fs-sm); color: var(--text-2); margin: 0 0 6px; }
.panel .mount { flex: 1 1 auto; margin: 12px 0; }
.panel .mount:empty { margin: 0; }
.panel-foot { margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--rule-2); font-size: var(--fs-xs); line-height: 1.5; color: var(--text-3); }
.panel-foot p { margin: 0 0 .4em; }
.panel-foot p:last-child { margin-bottom: 0; }
.panel-label { display: flex; align-items: flex-start; gap: 6px; font-weight: 600; color: var(--text-2); }
.panel-label .i { width: 15px; height: 15px; margin-top: 1px; color: var(--coral-ink); }

/* "Our assessment" boxes (framed as in the paper; heading, not a run-in label) */
.assessment {
  max-width: 48rem; margin: var(--sp-6) 0 var(--sp-5); padding: 16px 22px 14px;
  background: #F1F9F9; border: 1px solid rgba(19, 138, 138, .32); border-left: 4px solid var(--teal-dark); border-radius: var(--r-md);
}
.assessment-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 0 0 6px; }
.assessment-title { font: 600 1.05rem/1.3 var(--font-serif); font-variation-settings: 'opsz' 18; color: var(--teal-ink); margin: 0; }
.assessment-sec { font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); }
.assessment p { margin: 0; }

.callout { margin: var(--sp-4) 0; padding: 12px 16px; border-left: 4px solid var(--amber); background: #FFFBF2; border-radius: 0 var(--r-md) var(--r-md) 0; }
.callout-label { font: 600 var(--fs-xs)/1.3 var(--font-sans); color: var(--amber-ink); margin: 0 0 4px; }
.callout p:last-child { margin-bottom: 0; }

.definition { max-width: 48rem; margin: var(--sp-5) 0; padding: 18px 22px; border-radius: var(--r-md); background: var(--bg-tint); border-left: 4px solid var(--teal); }
.definition-label { font: 600 var(--fs-xs)/1.3 var(--font-sans); color: var(--teal-ink); margin: 0 0 6px; }
.definition-text { font: 400 1.14rem/1.55 var(--font-serif); font-variation-settings: 'opsz' 18; color: var(--ink); margin: 0; }

.empty { padding: 28px 16px; text-align: center; color: var(--text-3); border: 1px dashed var(--rule-2); border-radius: var(--r-md); font-size: var(--fs-sm); }

/* ======================================================================= 11. form controls, segmented control, facets */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-label { font: 600 var(--fs-xs)/1.3 var(--font-sans); color: var(--text-3); }
.input, .select {
  width: 100%; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--rule-3); border-radius: var(--r-md);
  background: #fff; color: var(--ink); font: 400 var(--fs-sm)/1.2 var(--font-sans);
}
.select { padding-right: 30px; }
.input::placeholder { color: #6B7684; }
.input:focus-visible, .select:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--teal-dark); }
.search { position: relative; min-width: 0; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 36px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin: var(--sp-4) 0 var(--sp-3); }
.toolbar > .grow { flex: 1 1 260px; }

.seg {
  display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; max-width: 100%;
  background: var(--gray); border: 1px solid var(--rule); border-radius: 12px;
}
.seg > button {
  min-height: 32px; padding: 5px 14px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2);
  font: 600 var(--fs-xs)/1.2 var(--font-sans); cursor: pointer; transition: background-color var(--dur-1), color var(--dur-1);
}
.seg > button:hover { color: var(--ink); }
.seg > button[aria-pressed="true"], .seg > button[aria-checked="true"], .seg > button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }
.seg > button:disabled { opacity: .5; cursor: not-allowed; }

.facet { border: 0; margin: 0; padding: 0; min-width: 0; }
.facet-label { display: block; float: left; width: 100%; padding: 0; margin: 0 0 6px; font: 600 var(--fs-xs)/1.3 var(--font-sans); color: var(--text-3); }
.facet-label + * { clear: both; }
.facet-options { display: flex; flex-wrap: wrap; gap: 6px; }
.facets { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 20px; }

/* ======================================================================= 12. tables */
.table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--rule); border-radius: var(--r-md); background: #fff; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); line-height: 1.45; }
.table th, .table td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.table thead th { position: sticky; top: 0; z-index: 1; background: var(--teal-light); color: var(--ink); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.table tbody tr:nth-child(even) > * { background: var(--bg-tint); }
.table tbody tr:hover > * { background: #EAF6F6; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tr.group > * { background: var(--gray); font-weight: 700; color: var(--ink); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table caption { caption-side: top; text-align: left; padding: 0 0 8px; font-size: var(--fs-xs); color: var(--text-3); }

/* ======================================================================= 13. show more, legend, kv lists */
.show-more {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px auto 0; min-height: 38px; padding: 7px 20px;
  border: 1px solid var(--amber); border-radius: var(--r-pill); background: #fff; color: var(--amber-ink);
  font: 600 var(--fs-sm)/1.2 var(--font-sans); cursor: pointer; transition: background-color var(--dur-1);
}
.show-more:hover { background: var(--amber-light); }
.show-more .i { width: 16px; height: 16px; transition: transform var(--dur-1); }
.show-more[aria-expanded="true"] .i { transform: rotate(180deg); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-xs); color: var(--text-3); margin: 8px 0; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; background: var(--sw, var(--gray)); border: 1px solid rgba(31, 41, 51, .12); flex: none; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: var(--fs-sm); }
.kv dt { color: var(--text-3); font-weight: 600; font-size: var(--fs-xs); padding-top: 2px; }
.kv dd { margin: 0; min-width: 0; }

/* ======================================================================= 14. tooltip, popover, drawer, toast */
.tooltip {
  position: fixed; z-index: var(--z-tooltip); max-width: 320px; padding: 8px 11px; pointer-events: none;
  background: #fff; color: var(--text); border: 1px solid var(--rule-2); border-radius: 8px; box-shadow: var(--sh-2);
  font: 400 var(--fs-xs)/1.45 var(--font-sans);
}
.tooltip.is-hoverable { pointer-events: auto; }   /* readouts anchored to an element can be hovered (WCAG 1.4.13) */
.tooltip b, .tooltip strong { font-weight: 700; color: var(--ink); }
.tooltip .tt-sub { display: block; color: var(--text-3); }

.popover {
  position: absolute; z-index: var(--z-popover); width: min(420px, calc(100vw - 24px)); padding: 16px 18px 14px;
  background: #fff; border: 1px solid var(--rule-2); border-radius: var(--r-lg); box-shadow: var(--sh-3);
  font-size: var(--fs-sm); line-height: 1.5;
}
.popover:focus { outline: none; }
.popover.is-sheet { position: fixed; left: 8px; right: 8px; bottom: 8px; top: auto !important; width: auto; max-height: 75vh; overflow: auto; }
.popover-close { position: absolute; top: 8px; right: 8px; }
.pop-kicker { font: 600 var(--fs-xs)/1.3 var(--font-sans); color: var(--teal-ink); margin: 0 36px 4px 0; }
.pop-title { font: 600 1.02rem/1.35 var(--font-serif); font-variation-settings: 'opsz' 18; color: var(--ink); margin: 0 28px 6px 0; }
.pop-authors { color: var(--text-2); margin: 0 0 4px; }
.pop-venue { color: var(--text-3); font-size: var(--fs-xs); margin: 0 0 10px; }
.pop-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.drawer-backdrop { position: fixed; inset: 0; z-index: var(--z-drawer); background: rgba(31, 41, 51, .32); opacity: 0; transition: opacity var(--dur-2); }
.drawer-backdrop.is-open { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: calc(var(--z-drawer) + 1); width: min(520px, 100vw);
  display: flex; flex-direction: column; background: #fff; border-left: 1px solid var(--rule); box-shadow: var(--sh-3);
  transform: translateX(100%); visibility: hidden; transition: transform var(--dur-2) var(--ease), visibility 0s linear var(--dur-2);
}
.drawer.is-open { transform: none; visibility: visible; transition: transform var(--dur-2) var(--ease), visibility 0s; }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--rule); }
.drawer-head > :first-child { flex: 1; min-width: 0; }
.drawer-kicker { font: 600 var(--fs-xs)/1.3 var(--font-sans); color: var(--teal-ink); margin: 0 0 4px; }
.drawer-title { font: 600 1.2rem/1.3 var(--font-serif); font-variation-settings: 'opsz' 18; color: var(--ink); margin: 0; }
.drawer-body { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 16px 20px 24px; }
.drawer-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--rule); }

.toast {
  position: fixed; left: 50%; bottom: 22px; z-index: var(--z-toast); transform: translateX(-50%); max-width: calc(100vw - 32px);
  padding: 9px 16px; border-radius: var(--r-pill); background: var(--ink); color: #fff; font-size: var(--fs-sm); box-shadow: var(--sh-2);
  opacity: 0; pointer-events: none; transition: opacity var(--dur-2);
}
.toast.is-on { opacity: 1; }

/* ======================================================================= 15. figures, gallery, lightbox */
.paper-fig { margin: var(--sp-6) 0; }
.fig-zoom {
  position: relative; display: block; width: 100%; padding: 12px; border: 1px solid var(--rule); border-radius: var(--r-lg);
  background: #fff; cursor: zoom-in; box-shadow: var(--sh-1); transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.fig-zoom:hover { border-color: var(--rule-2); box-shadow: var(--sh-2); }
.fig-zoom img { width: 100%; height: auto; border-radius: 6px; }
.fig-hint {
  position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border: 1px solid var(--rule-2); border-radius: var(--r-pill); background: rgba(255, 255, 255, .95); color: var(--text-2);
  font: 600 var(--fs-xs)/1.3 var(--font-sans); opacity: 0; transition: opacity var(--dur-1);
}
.fig-zoom:hover .fig-hint, .fig-zoom:focus-visible .fig-hint { opacity: 1; }
.paper-fig figcaption { max-width: var(--w-text); margin: 12px 2px 0; font-size: var(--fs-sm); line-height: 1.55; color: var(--text-2); }
.fig-meta { font: 600 var(--fs-xs)/1.3 var(--font-sans); color: var(--teal-ink); margin: 0 0 4px; }
.fig-cap { margin: 0; }

.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.gallery-btn {
  display: flex; flex-direction: column; width: 100%; height: 100%; padding: 0; text-align: left; overflow: hidden; cursor: zoom-in;
  background: #fff; border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--sh-1);
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.gallery-btn:hover { border-color: var(--rule-2); box-shadow: var(--sh-2); }
.gallery-thumb { display: block; aspect-ratio: 16 / 10; padding: 10px; background: #fff; border-bottom: 1px solid var(--rule); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: contain; }
.gallery-meta { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px 14px; }
.gallery-n { font: 700 var(--fs-xs)/1.3 var(--font-sans); color: var(--teal-ink); }
.gallery-t { font: 600 var(--fs-sm)/1.35 var(--font-sans); color: var(--ink); }
.gallery-sec { font-size: var(--fs-xs); color: var(--text-3); }

.lightbox { position: fixed; inset: 0; z-index: var(--z-lightbox); opacity: 0; transition: opacity var(--dur-2); }
.lightbox.is-open { opacity: 1; }
.lb-backdrop { position: absolute; inset: 0; background: rgba(24, 31, 39, .84); }
.lb-frame {
  position: absolute; inset: 20px; display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-3);
}
.lb-bar { display: flex; align-items: center; gap: 10px 16px; padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.lb-heading { flex: 1 1 220px; min-width: 0; }
.lb-title { font: 600 1.05rem/1.3 var(--font-serif); font-variation-settings: 'opsz' 18; color: var(--ink); margin: 0; }
.lb-sec { font-size: var(--fs-xs); color: var(--text-3); margin: 0; }
.lb-tools { display: flex; align-items: center; gap: 6px; }
.lb-count { font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 4.2em; text-align: center; }
.lb-stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; overflow: auto; background: var(--bg-soft); cursor: zoom-in; overscroll-behavior: contain; }
.lb-stage:focus { outline: none; }
.lb-stage:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.lb-stage.is-zoomed { cursor: grab; }
.lb-stage.is-dragging { cursor: grabbing; user-select: none; }
.lb-stage img { flex: none; margin: auto; padding: 0; background: #fff; box-shadow: 0 0 0 1px var(--rule); max-width: none; user-select: none; -webkit-user-drag: none; }
.lb-caption { flex: none; max-height: 26vh; overflow: auto; padding: 12px 20px 14px; border-top: 1px solid var(--rule); font-size: var(--fs-sm); line-height: 1.55; color: var(--text-2); }
.lb-caption p { margin: 0; max-width: 60rem; }
.lb-hint { font-size: var(--fs-xs); color: var(--text-3); margin: 6px 0 0 !important; }

/* ======================================================================= 16. shell sections */
/* overview: keywords as a plain line of text (chips on this page are filters) */
.abstract-text { font-size: var(--fs-base); }
.keywords { margin: var(--sp-4) 0 0; font-size: var(--fs-sm); line-height: 1.55; color: var(--text-2); }
.keywords-label { color: var(--text-3); }

/* at a glance: panels keep their own height (a pinned forgetting row must not stretch the growth panel) */
.glance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: var(--sp-5); align-items: start; }

/* evidence: the scope footnote of Sec. 1.3 under the cut-off line */
.scope-note { margin-top: var(--sp-2); }

/* taxonomy view toggle */
.view-toggle { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: var(--sp-5) 0 0; }

/* evidence grades */
.grade-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: var(--sp-4) 0 var(--sp-3); }
.grade-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 12px; background: #fff; border: 1px solid var(--rule); border-radius: var(--r-md); }
.grade-head { display: flex; align-items: center; gap: 8px; margin: 0; font: 600 var(--fs-sm)/1.3 var(--font-sans); color: var(--ink); }
.grade-card .grade-def { font-size: var(--fs-xs); line-height: 1.5; color: var(--text-2); margin: 0; }
.grade-card .btn-link { margin-top: auto; align-self: flex-start; }
.grade-card.is-builder .grade-def { color: var(--text-3); }

/* propositions: 3 columns with the matrix card spanning two (3 x 3); 2 columns with P7 and the matrix full width; 1 column.
   The wrapper is a size container so the grid follows the width of the content column, not of the window. */
.prop-wrap { container-type: inline-size; margin-top: var(--sp-5); }
.prop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.prop-grid > .prop-matrix-card { grid-column: span 2; }
@container (max-width: 860px) {
  .prop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prop-grid > .prop-card:nth-child(7) { grid-column: span 2; }
}
@container (max-width: 540px) {
  .prop-grid { grid-template-columns: minmax(0, 1fr); }
  .prop-grid > .prop-card:nth-child(7), .prop-grid > .prop-matrix-card { grid-column: auto; }
}
.prop-card {
  display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 14px; background: #fff;
  border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--sh-1); scroll-margin-top: 80px;
}
.prop-card:focus { outline: none; }
.prop-card.is-flash { box-shadow: 0 0 0 2px var(--teal-dark); }
.prop-head { display: flex; align-items: flex-start; gap: 10px; }
.prop-head .pos { display: inline-flex; align-items: center; font-size: var(--fs-xs); height: 1.75em; padding: 0 .55em; margin-top: 2px; flex: none; }
.prop-title { font: 600 1.08rem/1.35 var(--font-serif); font-variation-settings: 'opsz' 18; color: var(--ink); margin: 0; }
.prop-text { font-size: var(--fs-sm); line-height: 1.55; color: var(--text-2); margin: 0; }
.prop-foot { margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--rule-2); }
.prop-foot-label { font-size: var(--fs-xs); color: var(--text-3); margin: 0 0 6px; }
.sec-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.sec-chip {
  min-width: 32px; height: 28px; padding: 0 8px; border: 1px solid var(--rule-2); border-radius: 8px;
  background: #fff; color: var(--text-2); font: 600 var(--fs-xs)/1 var(--font-sans);
  transition: background-color var(--dur-1), border-color var(--dur-1);
}
.sec-chip:hover { background: var(--gray); border-color: var(--rule-3); }
.prop-matrix-card { padding-bottom: 16px; }
.prop-matrix { width: 100%; border-collapse: separate; border-spacing: 2px; table-layout: fixed; margin-top: 4px; }
.prop-matrix th { font: 600 var(--fs-2xs)/1.2 var(--font-sans); color: var(--text-3); text-align: center; padding: 2px 0; }
.prop-matrix tbody th { width: 34px; text-align: left; }
.prop-matrix td { height: 28px; padding: 0; text-align: center; }
.prop-matrix td button {
  display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 26px; padding: 0;
  border: 0; border-radius: 6px; background: transparent; cursor: pointer;
}
.prop-matrix td button:hover { background: var(--gray); }
.prop-matrix .dot { display: block; border-radius: 50%; background: var(--sc, var(--slate)); }
.prop-matrix td.empty-cell::after { content: ""; display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--rule-2); }

/* settings tabs */
.tablist { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tab {
  --tab-c: var(--slate); --tab-l: var(--gray);
  position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 12px 14px; text-align: left;
  background: #fff; border: 1px solid var(--rule); border-radius: var(--r-lg); cursor: pointer;
  transition: border-color var(--dur-1), background-color var(--dur-1);
}
.tab:hover { border-color: var(--rule-2); }
/* the selected tab: tinted, with a full-width top border in the axis color */
.tab[aria-selected="true"] { background: var(--tab-l); border-color: var(--tab-c); box-shadow: var(--sh-1), inset 0 3px 0 var(--tab-c); }
/* axis letter, as the axis badges of the paper's tables */
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; border-radius: 8px;
  border: 1.5px solid var(--tab-c); background: var(--tab-b); color: var(--tab-i); font: 700 var(--fs-sm)/1 var(--font-sans);
}
.tab-text { min-width: 0; }
.tab-name { display: block; font: 600 1rem/1.25 var(--font-sans); color: var(--ink); }
.tab-sec { display: block; font-size: var(--fs-xs); color: var(--text-3); }
.tab.ax-T { --tab-c: var(--teal); --tab-l: #F0FAFA; --tab-b: var(--teal-light); --tab-i: var(--teal-ink); }
.tab.ax-E { --tab-c: var(--amber); --tab-l: #FEF8EC; --tab-b: var(--amber-light); --tab-i: var(--amber-ink); }
.tab.ax-B { --tab-c: var(--coral); --tab-l: #FEF3F1; --tab-b: var(--coral-light); --tab-i: var(--coral-ink); }
.tab.ax-F { --tab-c: var(--violet); --tab-l: #F6F4FD; --tab-b: var(--violet-light); --tab-i: var(--violet-ink); }
.tabpanel { padding-top: var(--sp-5); }
.tabpanel:focus { outline: none; }
.tabpanel:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: var(--r-sm); }
.tabpanel h3 { margin-top: 0; }
.settings-kicker { margin: 0 0 2px; font-size: var(--fs-xs); line-height: 1.4; color: var(--text-3); }   /* the paper's heading */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-grid .assessment { margin: var(--sp-5) 0 0; }
.settings-side .panel .mount { margin: 8px 0; }

/* research programs (accordion) */
.programs { display: grid; gap: 10px; margin: var(--sp-5) 0 var(--sp-3); }
.acc-item { background: #fff; border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--sh-1); scroll-margin-top: 80px; }
.acc-item.is-open { border-color: var(--rule-2); }
.acc-h { margin: 0; font: inherit; }
.acc-btn {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; width: 100%;
  padding: 14px 16px; border: 0; background: transparent; text-align: left; border-radius: var(--r-lg); cursor: pointer;
}
.acc-btn:hover { background: var(--bg-soft); }
.prog-letter {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--slate); color: #fff; font: 700 var(--fs-sm)/1 var(--font-sans);
}
.prog-icon { width: 36px; height: 36px; }
.prog-titles { min-width: 0; }
.prog-title { display: block; font: 600 1.05rem/1.3 var(--font-serif); font-variation-settings: 'opsz' 18; color: var(--ink); }
.prog-q { display: block; font-size: var(--fs-sm); color: var(--text-3); margin-top: 2px; }
.prog-badges { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px; }
.acc-chev { width: 18px; height: 18px; color: var(--text-3); transition: transform var(--dur-2) var(--ease); }
.acc-item.is-open .acc-chev { transform: rotate(180deg); }
.acc-body { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows var(--dur-2) var(--ease), visibility 0s linear var(--dur-2); }
.acc-item.is-open .acc-body { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows var(--dur-2) var(--ease), visibility 0s; }
.acc-inner { overflow: hidden; min-height: 0; }
.acc-content { padding: 4px 20px 18px 56px; }
.acc-content > p { max-width: var(--w-text); }
.prog-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; margin: var(--sp-4) 0 0; }
.prog-facts > div { min-width: 0; }
.prog-facts dt { font: 600 var(--fs-xs)/1.3 var(--font-sans); color: var(--text-3); margin: 0 0 3px; }
.prog-facts dd { margin: 0; font-size: var(--fs-sm); }
.prog-facts ul { margin: 0; padding-left: 1.1em; }
.prog-facts li { margin: 0 0 2px; }
.horizon { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: var(--gray); color: var(--slate); font: 600 var(--fs-xs)/1 var(--font-sans); white-space: nowrap; }

/* citation */
.bib { margin-top: var(--sp-4); background: var(--bg-soft); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; }
.bib-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 8px 18px; border-bottom: 1px solid var(--rule); background: #fff; }
.bib-label { font: 600 var(--fs-xs)/1.3 var(--font-sans); color: var(--text-3); }
.bib pre { margin: 0; padding: 16px 18px 18px; overflow-x: auto; font-size: 13.5px; line-height: 1.65; color: var(--ink); white-space: pre; tab-size: 2; }

/* footer */
.site-footer { border-top: 1px solid var(--rule); background: var(--bg-soft); }
.site-footer-inner { max-width: 1320px; margin: 0 auto; padding: 28px var(--gutter) 40px; font-size: var(--fs-xs); color: var(--text-3); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 32px; }
.site-footer p { margin: 0 0 .35em; }
.site-footer a { color: var(--text-2); }
.footer-main { max-width: 46rem; }

.noscript { margin: 24px 0 0; padding: 12px 16px; border: 1px solid var(--amber); border-radius: var(--r-md); background: var(--amber-light); color: var(--amber-ink); font-size: var(--fs-sm); }
.flash { box-shadow: 0 0 0 2px var(--teal-dark) !important; border-radius: var(--r-xs); }

/* sideways scrolling inside a view (never the page): add tabindex="0", role="region" and an aria-label */
.scroll-x { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }

/* chart defaults for modules (SVG inside a .chart container) */
.chart { position: relative; width: 100%; min-width: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font-sans); font-size: 12px; fill: var(--text-3); }
.chart .axis path, .chart .axis line { stroke: var(--rule-3); }
.chart .axis text { fill: var(--text-3); }
.chart .grid line { stroke: var(--rule); }
.chart .label-strong { fill: var(--ink); font-weight: 600; }

/* ======================================================================= 17. responsive */
@media (max-width: 1099.98px) {
  :root { --gutter: 24px; }
  html { scroll-padding-top: 64px; }
  .layout { display: block; }
  .content { margin: 0 auto; }
  .toc {
    position: sticky; top: 0; z-index: var(--z-toc); margin: 0 calc(-1 * var(--gutter)); padding: 0; max-height: none; overflow: visible;
    background: #fff; border-bottom: 1px solid var(--rule); box-shadow: var(--sh-1);
  }
  .toc-toggle {
    display: flex; align-items: center; gap: 10px; width: 100%; height: 48px; padding: 0 var(--gutter); border: 0;
    background: transparent; color: var(--ink); font: 600 var(--fs-sm)/1.2 var(--font-sans); text-align: left; cursor: pointer;
  }
  .toc-toggle .i { width: 18px; height: 18px; color: var(--text-3); }
  .toc-toggle .i-chev { margin-left: auto; transition: transform var(--dur-1); }
  .toc.is-open .toc-toggle .i-chev { transform: rotate(180deg); }
  .toc-current { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-weight: 400; }
  .toc-current:not(:empty)::before { content: "\00B7"; margin-right: 8px; color: var(--rule-3); }
  .toc-panel {
    display: none; position: absolute; left: 0; right: 0; top: 100%; max-height: min(calc(100vh - 64px), 640px); overflow-y: auto; overscroll-behavior: contain;
    padding: 12px var(--gutter) 16px; background: #fff; border-bottom: 1px solid var(--rule); box-shadow: var(--sh-2);
  }
  .toc.is-open .toc-panel { display: block; }
  .toc-title { display: none; }
  .toc-list { border-left: 0; columns: 2; column-gap: 24px; }
  .toc-list li { break-inside: avoid; }
  .toc-list a { border-left: 0; margin: 0; padding: 7px 8px; border-radius: var(--r-sm); }
  .toc-list a:hover { background: var(--bg-soft); }
  .toc-list a[aria-current="location"] { background: var(--teal-light); }
  .section { padding-top: 52px; }
}
@media (max-width: 920px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); padding-top: 44px; padding-bottom: 44px; }
  .hero-visual { max-width: 520px; width: 100%; margin: 0 auto; }
  .glance-grid { grid-template-columns: minmax(0, 1fr); }
  .grade-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .tablist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prog-facts { grid-template-columns: minmax(0, 1fr); }
  .acc-btn { grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 8px 10px; }
  .acc-btn .prog-letter { margin-top: 1px; }
  .acc-btn .prog-icon { display: none; }
  .acc-btn .prog-badges { grid-column: 2; grid-row: 2; justify-content: flex-start; }
  .acc-btn .acc-chev { grid-column: 3; grid-row: 1; }
  .acc-content { padding: 4px 16px 16px; }
}
@media (max-width: 600px) {
  :root { --gutter: 16px; }
  body { font-size: 1rem; }
  .hero-inner { padding-top: 36px; padding-bottom: 36px; gap: 28px; }
  .authors { font-size: .97rem; }
  .affils { font-size: var(--fs-xs); gap: 2px 12px; }
  .hero-notes .note-item { display: block; margin: 0 0 2px; }
  .btn { padding: 8px 15px; }
  .btn-sm { padding: 5px 12px; }
  .btn-icon { padding: 0; }              /* after .btn: a padded 32 px icon button squeezes its icon to zero width */
  .hero-actions .btn { font-size: var(--fs-xs); }
  .logos { gap: 10px 20px; margin-top: 16px; }
  .logo { min-height: 34px; }
  .logo img { height: 34px; }
  .logo-name { font-size: var(--fs-xs); }
  .hero-composite { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-composite img { height: 120px; }
  .section { padding-top: 44px; }
  .section-head { gap: 12px; }
  .toc-list { columns: 1; }
  .grade-grid { grid-template-columns: minmax(0, 1fr); }
  .tab { padding: 10px 12px; gap: 8px; }
  .tab-badge { width: 26px; height: 26px; font-size: var(--fs-xs); }
  .tab-name { font-size: var(--fs-sm); }
  .fig-zoom { padding: 6px; border-radius: var(--r-md); }
  .assessment, .definition { padding: 14px 16px 12px; }
  .panel { padding: 16px 16px 14px; }
  .drawer {
    top: auto; left: 0; width: 100%; max-height: 88vh; border-left: 0; border-top: 1px solid var(--rule);
    border-radius: 16px 16px 0 0; transform: translateY(100%);
  }
  .drawer.is-open { transform: none; }
  .lb-frame { inset: 0; border-radius: 0; }
  .lb-bar { padding: 8px 8px 8px 14px; }
  .lb-caption { max-height: 30vh; padding: 10px 14px 12px; }
  .bib pre { padding: 14px; font-size: 12.5px; }
  .gallery { grid-template-columns: minmax(0, 1fr); }
}
/* touch screens: the "Enlarge" hint is always shown, so it sits in a strip under the image, not over it */
@media (hover: none) {
  .fig-zoom { padding-bottom: 36px; }
  .fig-hint { opacity: 1; top: auto; bottom: 6px; right: 8px; }
  .anchor { opacity: .7; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .progress, .toc, .hero-actions, .skip-link, .anchor, .fig-hint, .lightbox, .popover, .tooltip, .toast, .view-toggle { display: none !important; }
  .layout { display: block; }
  .hero { background: none; }
  .section { break-inside: auto; padding-top: 24px; }
  .acc-body { grid-template-rows: 1fr !important; visibility: visible !important; }
}
