/* avoid-ai-design-ignore: SD2 (the scanner reports this rule at line 1 for the whole file; see "Why" below)
   ════════════════════════════════════════════════════════════════
   PRISM — shared design system ("Proofing desk")
   One stylesheet for every page (studio, Framework Compass, sub-pages). Contract: DESIGN.md.
   Tokens live only here; page stylesheets use them and never redefine them.
   Light and dark: the roles below are re-tuned for dark (not inverted). Dark applies when the
   OS asks for it and the person has not chosen Light, or when the person chose Dark
   (data-theme on <html>, set before first paint by the head snippet documented in theme-switch.js).

   Why SD2 is ignored: the scanner reads both themes as one palette. It pairs the dark desk (#121417)
   with the LIGHT-theme fail red (#B3261E), which never appears on the dark desk (dark fail is #F28B82,
   a low-saturation salmon, and dark pass is a muted mint). Both reds are DESIGN.md status
   roles, always paired with a word, never an accent.
   ════════════════════════════════════════════════════════════════ */

:root{
  color-scheme: light;

  /* ── Roles (DESIGN.md) ── */
  --desk:#D8DDE3;          /* page background: the same cool slate as dark mode's desk, so both themes read as one tool */
  --sheet:#FFFFFF;         /* panels, cards, the document paper, floating surfaces */
  --sheet-2:#EEF1F4;       /* quiet fills, headers inside a sheet, neutral tags, disabled fill */
  --rule:#C9CFD6;          /* hairlines, score-sheet rules (decorative: never the only cue for a control) */
  --ink:#16181D;           /* text; primary button fill */
  --select-chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%234A5059' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");   /* dropdown chevron, drawn in --ink-2 */
  --ink-2:#4A5059;         /* secondary text, item numbers, quiet-button text */
  --form-blue:#1D4F91;     /* links, focus ring, selected state */
  --highlighter:#FFE066;   /* flagged words in the document (::highlight, .flash-sel) */
  --brand:#FFE066;         /* theme yellow in chrome: the logo's I, current page, chosen option. A fill, never text */
  --on-brand:#16181D;      /* text and icons on the brand fill (both themes) */
  --pass:#1E6B3A; --warn:#8A5300; --fail:#B3261E;   /* status text, tags, pressed rating borders */

  /* ── Derived roles ── */
  --pass-bg:#E5F1E9; --warn-bg:#FAEFD9; --fail-bg:#FBE8E6;   /* status tag / note fills */
  --selected:#E6EDF7;      /* pressed/selected fill: always paired with a form-blue border or text */
  --hover:#E5E9EE;         /* hover fill for quiet buttons, rows, menu items */
  --form-blue-hover:#163D70;
  --on-ink:#FFFFFF;        /* text and icons on the ink fill (primary button) */
  --ink-hover:#2E333B;     /* primary button hover fill */
  --ink-disabled:#565D66;  /* disabled text, kept ≥ 4.5:1 */
  --focus-ring:#1D4F91;    /* = form-blue; separate name so it can be tuned alone */
  --control-border:#6E767F;/* borders that identify a control (inputs, selects, checkboxes): ≥ 3:1 */
  --meter-track:#DDE2E8;
  --meter-neutral:var(--ink-2);          /* meter fill when there is no verdict yet */
  --tooltip-bg:var(--sheet);             /* tooltips are floating sheets */
  --scrim:rgba(22,24,29,.40);            /* dialog ::backdrop */
  --shadow-float:0 1px 2px rgba(22,24,29,.06), 0 8px 24px rgba(22,24,29,.14);   /* floating things only */
  --scroll-thumb:#A9B1BA;
  --checker-a:#FFFFFF; --checker-b:#E3E7EC;   /* transparent-artwork backdrop */
  --checker:repeating-conic-gradient(var(--checker-a) 0 25%, var(--checker-b) 0 50%) 0 0 / 16px 16px;

  /* Artwork text overlay: deliberately the same in both themes. It sits on the person's
     artwork, which never changes with the theme. No fill (a tint lowered the contrast of the
     artwork's own text): a near-black 2px ring inside a 2px white halo, so one of the two
     rings stands out on any artwork, light or dark. */
  --overlay-outline:#16181D;
  --overlay-halo:#FFFFFF;

  /* ── Type: Public Sans (interface) + Source Serif 4 (the document) ──
     Seven treatments, nothing below 13px, weights 400 and 600 only,
     no italics, uppercase or letter-spacing.
     Display 24/600, Heading 17/600, Body 14/400, Body strong 14/600,
     Caption 13/400, Caption strong 13/600, and Reading 15/400 in the serif (the document only). */
  --sans:'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif:'Source Serif 4', Georgia, 'Times New Roman', serif;
  --fs-xs:13px; --fs-sm:14px; --fs-md:15px; --fs-lg:17px; --fs-2xl:24px;

  /* ── Space ── */
  --inset:16px;   /* the one left edge for text inside bars, panels and cards */
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:20px; --sp-6:24px; --sp-8:32px; --sp-12:48px;

  /* ── Shape ── */
  --radius-control:4px;   /* buttons, inputs, segmented controls, rating buttons, menus, tooltips */
  --radius-sheet:6px;     /* sheets: panels, cards, dialogs, Brief/Frameworks bars and panels */
  --radius-pill:999px;    /* status tags only */

  /* ── Legacy aliases (temporary). They point at roles, so they flip in dark.
     Declared once here: a custom property that references another resolves on :root after
     the dark block has overridden the role, so the aliases need no dark copy. ── */
  --page:var(--desk);
  --white:var(--sheet);          /* SURFACES ONLY. Text on ink uses --on-ink. */
  --dark:var(--ink);
  --n900:var(--ink);  --n800:var(--ink);
  --n700:var(--ink-2); --n600:var(--ink-2); --n500:var(--ink-2); --n400:var(--ink-2);
  --n300:var(--rule);            /* control borders should move to --control-border */
  --n200:var(--rule);
  --n100:var(--sheet-2);         /* hairlines using n100 should move to --rule */
  --n50:var(--sheet-2);
  --blue:var(--form-blue); --blue-hov:var(--form-blue-hover); --blue-lt:var(--selected);
  --teal:var(--pass); --teal-bg:var(--pass-bg);
  --orange:var(--warn); --orange-bg:var(--warn-bg);
  --red:var(--fail); --red-bg:var(--fail-bg);
  --zone-clarity:var(--ink-2); --zone-process:var(--ink-2); --zone-behavior:var(--ink-2); --zone-outcomes:var(--ink-2);
  --shadow-1:none; --shadow-2:none; --shadow-3:var(--shadow-float);
  --focus:0 0 0 1px var(--focus-ring);   /* only for inputs that use border + shadow as their focus ring */
  --radius-sm:var(--radius-control); --radius:var(--radius-sheet); --radius-lg:var(--radius-sheet);
}

/* ── Dark: the default; light only when the person picks Light (see theme-switch.js) ── */
/* ── Dark: chosen explicitly (same values; keep the two blocks identical) ── */
:root[data-theme="dark"]{
  color-scheme: dark;
  --desk:#121417; --sheet:#1B1E22; --sheet-2:#22262B; --rule:#343A41;
  --ink:#E9EBEE; --ink-2:#B4BAC2; --form-blue:#8DB4EC;
  --select-chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23B4BAC2' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --highlighter:rgba(255,214,0,.28);
  --brand:#F5CF4A; --on-brand:#16181D;
  --pass:#7FD19B; --warn:#F0B357; --fail:#F28B82;
  --pass-bg:#1B3325; --warn-bg:#3A2C12; --fail-bg:#3F2220;
  --selected:#1F2C3F; --hover:#2A2F35; --form-blue-hover:#AECBF3;
  --on-ink:#16181D; --ink-hover:#FFFFFF; --ink-disabled:#9EA5AE;
  --focus-ring:#8DB4EC; --control-border:#717A85;
  --meter-track:#2E3339;
  --scrim:rgba(0,0,0,.60);
  --shadow-float:0 1px 2px rgba(0,0,0,.40), 0 8px 24px rgba(0,0,0,.55);
  --scroll-thumb:#474E57;
  --checker-a:#2B3036; --checker-b:#22262B;
}

/* ── Base ── */
*, *::before, *::after{box-sizing:border-box;margin:0;padding:0}
html{background:var(--desk);scrollbar-color:var(--scroll-thumb) transparent}
body{font-family:var(--sans);font-size:var(--fs-sm);font-weight:400;line-height:1.5;color:var(--ink);background:var(--desk);-webkit-font-smoothing:antialiased}
b, strong{font-weight:600}
em, i, cite, address, dfn{font-style:normal}
small{font-size:inherit}
a{color:var(--form-blue);text-decoration:underline;text-underline-offset:2px}
a:hover{color:var(--form-blue-hover)}
button, input, select, textarea{font:inherit;color:inherit}
/* Dropdowns: the same stroke chevron as every disclosure, in place of the browser's arrow */
select:not([multiple]):not([size]){appearance:none;-webkit-appearance:none;padding-right:24px !important;background-image:var(--select-chev) !important;background-repeat:no-repeat !important;background-position:right 4px center !important;background-size:16px 16px !important}
:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}
::selection{background:var(--selected);color:var(--ink)}
::-webkit-scrollbar{width:8px;height:8px}
::-webkit-scrollbar-thumb{background:var(--scroll-thumb);border-radius:var(--radius-pill);border:2px solid transparent;background-clip:padding-box}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.num{font-variant-numeric:tabular-nums}

/* ── Type treatments (exactly seven) ── */
.t-display       {font-size:var(--fs-2xl);font-weight:600;line-height:1.25}
.t-heading       {font-size:var(--fs-lg);font-weight:600;line-height:1.35}
.t-body          {font-size:var(--fs-sm);font-weight:400}
.t-body-strong   {font-size:var(--fs-sm);font-weight:600}
.t-caption       {font-size:var(--fs-xs);font-weight:400;color:var(--ink-2)}
.t-caption-strong{font-size:var(--fs-xs);font-weight:600}
.t-reading       {font-family:var(--serif);font-size:var(--fs-md);font-weight:400;line-height:1.7}
h1{font-size:var(--fs-2xl);font-weight:600;line-height:1.25}
/* no orphan words: headings balance their lines; running text avoids a lone last word */
h1, h2, h3, h4, .intro-display, figcaption{text-wrap:balance}
p, li, dd, blockquote{text-wrap:pretty}
h2, h3{font-size:var(--fs-lg);font-weight:600;line-height:1.35}
h4, h5, h6{font-size:var(--fs-sm);font-weight:600}

/* ── Surfaces: hairlines, not shadows. Only floating things get --shadow-float. ── */
.sheet, .surface{background:var(--sheet);border:1px solid var(--rule);border-radius:var(--radius-sheet)}
.floating{background:var(--sheet);border:1px solid var(--rule);border-radius:var(--radius-sheet);box-shadow:var(--shadow-float)}

/* ── Button: one component, three variants, one size (32px), Caption strong ──
   Primary   ink fill; the single most important action in a region (at most one per region)
   Secondary sheet + hairline border; normal actions
   Quiet     no border or fill until hover; utility and reversible actions
   .btn-icon is the square glyph-only size (always with an aria-label).
   Labels are verbs, no trailing arrows. */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--sp-2);
  min-height:32px;min-width:32px;padding:0 var(--sp-3);
  border:1px solid transparent;border-radius:var(--radius-control);background:transparent;
  font-family:var(--sans);font-size:var(--fs-xs);font-weight:600;line-height:1.2;color:var(--ink);
  white-space:nowrap;text-decoration:none;cursor:pointer;user-select:none;flex-shrink:0;
  transition:background-color .12s,border-color .12s,color .12s}
.btn[hidden]{display:none}
.btn:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}
.btn-primary{background:var(--ink);border-color:var(--ink);color:var(--on-ink)}
.btn-primary:hover{background:var(--ink-hover);border-color:var(--ink-hover);color:var(--on-ink)}
.btn-secondary{background:var(--sheet);border-color:var(--rule);color:var(--ink)}
.btn-secondary:hover{background:var(--hover);border-color:var(--control-border);color:var(--ink)}
.btn-quiet{color:var(--ink-2)}
.btn-quiet:hover{background:var(--hover);color:var(--ink)}
.btn-icon{width:32px;padding:0}
/* toggle buttons (Track changes, Fit, B/I): pressed = selected */
.btn.on, .btn[aria-pressed="true"]{background:var(--selected);border-color:var(--form-blue);color:var(--form-blue)}
.btn:active:not(:disabled){background:var(--selected)}
.btn-primary:active:not(:disabled){background:var(--ink-hover)}
.btn:disabled, .btn[aria-disabled="true"]{cursor:not-allowed;background:var(--sheet-2);border-color:var(--rule);color:var(--ink-disabled)}
.btn-quiet:disabled, .btn-quiet[aria-disabled="true"]{background:transparent;border-color:transparent}
.btn b{font-weight:600;color:inherit}

/* ── Form controls: the border identifies the control → --control-border (≥ 3:1).
   :where() keeps specificity at zero so page rules for a specific control always win. ── */
:where(.input, input[type=text], input[type=search], input[type=email], input[type=url], input[type=number], select, textarea){
  min-height:32px;padding:0 var(--sp-2);border:1px solid var(--control-border);border-radius:var(--radius-control);
  background:var(--sheet);color:var(--ink);font-family:inherit;font-size:var(--fs-sm)}
:where(textarea){padding:var(--sp-2)}
::placeholder{color:var(--ink-2);opacity:1}
/* native dropdown lists: theme colours, so options never look greyed out (dark mode especially) */
option, optgroup{background:var(--sheet);color:var(--ink)}
option:disabled{color:var(--ink-disabled)}
input[type=checkbox], input[type=radio], input[type=range], progress{accent-color:var(--form-blue)}

/* ── Rating button (rateCtl): the one checklist control, same height/radius as .btn ──
   pressed = 2px inset border in the status colour + its tint + the label word; never colour alone */
.rate{display:flex;flex-wrap:wrap;align-items:flex-start;gap:var(--sp-1)}   /* buttons keep one size, however tall the row */
.rate-b{min-height:32px;padding:0 var(--sp-3);border:1px solid var(--rule);border-radius:var(--radius-control);
  background:var(--sheet);color:var(--ink);font-family:var(--sans);font-size:var(--fs-xs);font-weight:600;line-height:1;
  white-space:nowrap;cursor:pointer;transition:background-color .12s,border-color .12s,color .12s}
.rate-b:hover:not(:disabled){background:var(--hover);border-color:var(--control-border)}
.rate-b:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}
.rate-b.on.pos{background:var(--pass-bg);border-color:var(--pass);box-shadow:inset 0 0 0 1px var(--pass);color:var(--pass)}
.rate-b.on.neg{background:var(--fail-bg);border-color:var(--fail);box-shadow:inset 0 0 0 1px var(--fail);color:var(--fail)}
.rate-b.on.neu{background:var(--sheet-2);border-color:var(--ink-2);box-shadow:inset 0 0 0 1px var(--ink-2);color:var(--ink)}
/* suggested by the tool, not yet confirmed: 1px dashed status border, no fill */
.rate-b.sug{border-style:dashed}
.rate-b.sug.pos{border-color:var(--pass);color:var(--pass)}
.rate-b.sug.neg{border-color:var(--fail);color:var(--fail)}
.rate-b.sug.neu{border-color:var(--ink-2)}
.rate-b:disabled{cursor:default;background:var(--sheet-2);color:var(--ink-disabled)}
.rate-b.on:disabled{opacity:1}
.rate-b.on.pos:disabled{background:var(--pass-bg);color:var(--pass)}
.rate-b.on.neg:disabled{background:var(--fail-bg);color:var(--fail)}
.rate-b.on.neu:disabled{background:var(--sheet-2);color:var(--ink)}

/* ── Segmented control: one exclusive choice (mode toggle, CVD, Brief chips, theme switch) ──
   Markup: <div class="seg" role="group" aria-label="…"><button type="button" aria-pressed="true|false">…</button>…</div>
   .seg-wrap lets options wrap (Brief audience/format); .seg-grid is the 2-column picker. */
.seg{display:inline-flex;gap:2px;padding:2px;background:var(--sheet-2);border:1px solid var(--rule);border-radius:var(--radius-control)}
.seg button{min-height:28px;padding:0 var(--sp-3);border:1px solid transparent;border-radius:3px;background:transparent;
  font-family:var(--sans);font-size:var(--fs-xs);font-weight:400;color:var(--ink-2);cursor:pointer;white-space:nowrap}
.seg button:hover{background:var(--hover);color:var(--ink)}
.seg button.on, .seg button[aria-pressed="true"]{background:var(--brand);border-color:var(--ink);color:var(--on-brand);font-weight:600}
.seg button:focus-visible{outline:2px solid var(--focus-ring);outline-offset:1px}
.seg.seg-wrap{display:flex;flex-wrap:wrap}
.seg.seg-grid{display:grid;grid-template-columns:1fr 1fr}
.seg.seg-grid button{white-space:normal;min-height:26px;padding:2px var(--sp-2);line-height:1.25}

/* ── Dark toggle: one button in the site bar; wiring in theme-switch.js ── */
.theme-toggle[hidden]{display:none}
.theme-toggle{gap:var(--sp-1)}
.theme-toggle[aria-pressed="true"]{background:var(--selected);color:var(--ink);border-color:var(--rule)}
.bar-divider{flex:none;width:1px;height:24px;margin:0 var(--sp-2);background:var(--rule)}

/* ── Status tags (pills allowed). Every tag carries its word or a glyph with sr-only text. ── */
.tag{display:inline-flex;align-items:center;gap:var(--sp-1);padding:2px 10px;border-radius:var(--radius-pill);
  font-size:var(--fs-xs);font-weight:600;line-height:1.4;white-space:nowrap;font-variant-numeric:tabular-nums;
  background:var(--sheet-2);color:var(--ink-2);box-shadow:inset 0 0 0 1px var(--rule)}
.tag-pass{background:var(--pass-bg);color:var(--pass);box-shadow:none}
.tag-warn{background:var(--warn-bg);color:var(--warn);box-shadow:none}
.tag-fail{background:var(--fail-bg);color:var(--fail);box-shadow:none}
.tag-info{background:var(--selected);color:var(--form-blue);box-shadow:none}

/* ── Status note (warn banner, "what this needs"): flat, ink text, status rule on the left ── */
.note{padding:var(--sp-2) var(--sp-3);border-left:3px solid var(--rule);font-size:var(--fs-xs);line-height:1.5;color:var(--ink)}
.note-warn{background:var(--warn-bg);border-left-color:var(--warn)}
.note-fail{background:var(--fail-bg);border-left-color:var(--fail)}
.note-pass{background:var(--pass-bg);border-left-color:var(--pass)}

/* ── Meter: the verdict is always also in text (score + target, pill word) ── */
.meter-track{height:8px;background:var(--meter-track);border-radius:2px;overflow:hidden}
.meter-fill{height:100%;background:var(--meter-neutral);border-radius:2px}
.meter-fill.is-pass{background:var(--pass)}
.meter-fill.is-warn{background:var(--warn)}
.meter-fill.is-fail{background:var(--fail)}

/* ── Tooltip (a small floating sheet) ── */
#tip{background:var(--tooltip-bg);color:var(--ink);border:1px solid var(--rule);border-radius:var(--radius-control);box-shadow:var(--shadow-float)}
#tip b{color:var(--ink)}

/* ── Dialog ── */
dialog{background:var(--sheet);color:var(--ink);border:1px solid var(--rule);border-radius:var(--radius-sheet);box-shadow:var(--shadow-float)}
dialog::backdrop{background:var(--scrim)}

/* ── Site top bar (shared by every page): one component, the same items on every page ──
   Markup: <header class="site-bar"> .site-name, <div class="site-page"> (this page's own controls, optional),
   <nav class="site-nav">
   Studio / Framework Compass / About (current page: aria-current="page"), .bar-divider, .theme-toggle.
   At 600px and below: row 1 = name + compact theme switch, row 2 = nav; page controls go last. */
/* Moving between pages (Studio, Compass): the bar holds still, the page under it cross-fades */
@view-transition{navigation:auto}
.site-bar{view-transition-name:site-bar}
::view-transition-old(root),::view-transition-new(root){animation-duration:.2s}
@media (prefers-reduced-motion:reduce){@view-transition{navigation:none}}
.site-bar{display:flex;flex-wrap:wrap;align-items:center;gap:var(--sp-2) var(--sp-3);min-height:56px;padding:var(--sp-2) var(--sp-5);background:var(--sheet);border-bottom:1px solid var(--rule)}
.site-bar .site-name{display:inline-flex;align-items:center;min-height:32px;margin:0;font-size:var(--fs-lg);font-weight:600;line-height:1.35;color:var(--ink);text-decoration:none}
.site-bar a.site-name:hover{color:var(--ink);text-decoration:underline}
/* the logo links to the front door (intro.js); no underline under the highlighted I */
.site-bar .site-name a{color:inherit;text-decoration:none;border-radius:var(--radius-control)}
.site-bar a.site-name:hover, .site-bar .site-name a:hover{text-decoration:none;opacity:.8}
.site-nav{display:flex;flex-wrap:wrap;align-items:center;gap:var(--sp-1);margin-left:auto}
.site-nav a, .site-nav button{display:inline-flex;align-items:center;min-height:32px;padding:0 var(--sp-3);border:none;border-radius:var(--radius-control);background:none;
  font-family:var(--sans);font-size:var(--fs-sm);font-weight:600;line-height:1.2;color:var(--ink-2);text-decoration:none;white-space:nowrap;cursor:pointer}
.site-nav a:hover, .site-nav button:hover{background:var(--hover);color:var(--ink)}
.site-nav a[aria-current="page"]{background:var(--brand);color:var(--on-brand)}
.site-nav a[aria-current="page"]:hover{background:var(--brand);color:var(--on-brand);text-decoration:underline}
/* Wordmark: PRISM with the I marked by the highlighter swipe (logo "Flagged I").
   The slanted chisel shape is the logo's own; flags in the document are plain rectangles. */
.site-name .hl-i{position:relative;display:inline-block;padding:0 .14em;margin:0 .02em;color:var(--on-brand);isolation:isolate}
.site-name .hl-i::before{content:"";position:absolute;inset:.06em -.08em -.02em;background:var(--brand);clip-path:polygon(18% 0,100% 0,82% 100%,0 100%);z-index:-1}
/* Logo animation, "Scan": a thin yellow reading line sweeps across the word, and the I is
   highlighted as the line passes it (the swipe draws left to right while the letter turns dark).
   Plays when a page loads and again on hover. CSS only: the line is the word's ::after.
   Reduced motion shows the finished logo (MOTION section switches it off). */
.site-name{--logo-ink:var(--ink)}
.site-name [aria-hidden="true"]:has(> .hl-i){position:relative;display:inline-block}
.site-name [aria-hidden="true"]:has(> .hl-i)::after{content:"";position:absolute;top:-10%;bottom:-10%;left:0;width:2px;border-radius:1px;
  background:var(--brand);pointer-events:none;animation:logo-scan 1100ms cubic-bezier(.4,0,.2,1) 150ms both}
.site-name .hl-i::before{animation:logo-swipe 260ms cubic-bezier(.6,0,.2,1) 480ms both}
.site-name .hl-i{animation:logo-ink 260ms cubic-bezier(.6,0,.2,1) 480ms both}
.site-name:hover [aria-hidden="true"]:has(> .hl-i)::after{animation-name:logo-scan-again}
.site-name:hover .hl-i::before{animation-name:logo-swipe-again}
.site-name:hover .hl-i{animation-name:logo-ink-again}
@keyframes logo-scan{0%{left:-4%;opacity:0}8%{opacity:1}85%{opacity:1}100%{left:102%;opacity:0}}
@keyframes logo-scan-again{0%{left:-4%;opacity:0}8%{opacity:1}85%{opacity:1}100%{left:102%;opacity:0}}
@keyframes logo-swipe{from{clip-path:polygon(18% 0,18% 0,0 100%,0 100%)}to{clip-path:polygon(18% 0,100% 0,82% 100%,0 100%)}}
@keyframes logo-swipe-again{from{clip-path:polygon(18% 0,18% 0,0 100%,0 100%)}to{clip-path:polygon(18% 0,100% 0,82% 100%,0 100%)}}
@keyframes logo-ink{0%,35%{color:var(--logo-ink)}70%,100%{color:var(--on-brand)}}
@keyframes logo-ink-again{0%,35%{color:var(--logo-ink)}70%,100%{color:var(--on-brand)}}
.site-nav a:focus-visible, .site-nav button:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}
/* theme switch: words on wide screens, icons (with the words kept as accessible names) on narrow ones */
.theme-toggle .ts-ico{display:none;flex:none}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center}
/* Mid widths: a page's own controls (e.g. the studio's mode toggle) move to a row of their own,
   so the site items (name, nav, theme switch) stay together on the first row */
.site-bar .site-page{display:flex;flex-wrap:wrap;align-items:center;gap:var(--sp-2);min-width:0}
@media (max-width:1100px){
  .site-bar .site-page{order:3;flex:1 1 100%}
}
@media (max-width:600px){
  .site-bar{padding:var(--sp-2) var(--sp-4)}
  .site-bar .site-name{flex:1 1 0;min-width:0;order:0}
  .site-bar .theme-toggle{order:1;margin-left:0}
  .site-bar .site-nav{order:2;flex:1 1 100%;margin-left:calc(-1 * var(--sp-3))}
  .site-bar .bar-divider{display:none}
  .theme-toggle{min-width:32px;padding:0 var(--sp-1)}
  .theme-toggle .ts-ico{display:block}
  .theme-toggle .ts-lbl{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
}

/* ── Skip link: hidden until it has keyboard focus ── */
.skip-link{position:absolute;left:var(--sp-2);top:var(--sp-2);z-index:1000;padding:var(--sp-2) var(--sp-3);
  background:var(--sheet);color:var(--ink);border:1px solid var(--rule);border-radius:var(--radius-control);box-shadow:var(--shadow-float);
  font-size:var(--fs-sm);font-weight:600;text-decoration:none;transform:translateY(calc(-100% - var(--sp-4)))}
.skip-link:focus, .skip-link:focus-visible{transform:none;outline:2px solid var(--focus-ring);outline-offset:2px}

/* ── Theme change: no cross-fade. theme-switch.js sets this for two frames whenever the theme flips. ── */
.theme-switching, .theme-switching *, .theme-switching *::before, .theme-switching *::after{transition:none !important}

/* ── Disclosure (collapsed details): CSS chevron, no glyph ── */
details.disclose > summary{cursor:pointer;list-style:none;display:inline-flex;align-items:center;gap:var(--sp-2);min-height:32px;
  font-size:var(--fs-xs);font-weight:600;color:var(--ink-2);border-radius:var(--radius-control)}
details.disclose > summary::-webkit-details-marker{display:none}
details.disclose > summary::before{content:"";width:6px;height:6px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;
  transform:rotate(-45deg);transition:transform .12s}
details.disclose[open] > summary::before{transform:rotate(45deg)}
details.disclose > summary:hover{color:var(--ink)}

/* ── Highlighter: flagged words in the document (CSS Custom Highlight API; no DOM change).
   Text under the mark is forced to ink: in dark, ink-2 on the mark is only 4.0:1.
   Resting marks are a fill only, no underline: the line under the words is left free for
   spelling and grammar checkers (Grammarly, the browser) so their underlines aren't covered.
   The issue list stays the accessible record. The mark just clicked (focus) gets a thick ink
   underline for a moment. Offset: set on #editor (highlight pseudos inherit it). ── */
::highlight(pea-flag){background-color:var(--highlighter);color:var(--ink)}
/* a long sentence: a quiet blue dotted underline under the whole sentence, so it reads with the yellow word marks */
::highlight(pea-long){text-decoration-line:underline;text-decoration-style:dotted;text-decoration-thickness:2px;text-decoration-color:#2f6fa8;color:var(--ink)}
/* Just applied: the new words, in the pass colour, for a few seconds */
::highlight(pea-applied){background-color:color-mix(in srgb, var(--pass) 35%, transparent);color:var(--ink);text-decoration-line:underline;text-decoration-thickness:2px;text-decoration-color:var(--pass)}
::highlight(pea-flag-focus){background-color:var(--highlighter);color:var(--ink);text-decoration-line:underline;text-decoration-thickness:4px;text-decoration-color:var(--ink)}
@keyframes flashSel{0%,100%{background-color:transparent}35%{background-color:var(--highlighter)}}
.flash-sel{animation:flashSel 1.1s ease;color:var(--ink)}
/* reduced motion: a steady mark instead of the flash; the page removes the class on a timer */
@media (prefers-reduced-motion: reduce){ .flash-sel{animation:none;background-color:var(--highlighter)} }

/* ── Artwork overlay (OCR / text-to-artwork) and backdrop: theme-independent overlay roles ── */
.vm-hl{border:2px solid var(--overlay-outline);border-radius:2px;background:none;box-shadow:0 0 0 2px var(--overlay-halo), inset 0 0 0 1px var(--overlay-halo)}
#vm-canvas{background:var(--checker)}     /* the canvas itself is never filtered, blended or recoloured */

/* ── Document paper: author colours neutralised for display only.
   Scoring reads text, not colour, so overriding pasted inline colours is safe. ── */
#editor{background:var(--sheet);color:var(--ink);text-underline-offset:2px}
#editor [style], #editor font{color:inherit !important;background-color:transparent !important}
#editor a, #editor a[style], #editor a [style]{color:var(--form-blue) !important}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{transition-duration:.01ms !important;animation-duration:.01ms !important}
}

/* ════════════════════════════════════════════════════════════════
   MOTION — one system for every page (motion.js does the "smart animate" parts)
   Durations: quick 120ms (press, hover) · base 200ms (menus, tooltips, rows) ·
   slow 320ms (panels, dialogs, cards). One curve for things arriving (ease-out),
   one for things moving between two places (ease-in-out). Nothing loops or bounces.
   Reduced motion: everything below is switched off at the end of this section.
   ════════════════════════════════════════════════════════════════ */
:root{
  --dur-quick:120ms; --dur:200ms; --dur-slow:320ms;
  --ease-out:cubic-bezier(.2,.7,.2,1);
  --ease-move:cubic-bezier(.4,0,.2,1);
}
@keyframes m-fade{from{opacity:0}}
@keyframes m-rise{from{opacity:0;transform:translateY(6px)}}
@keyframes m-drop{from{opacity:0;transform:translateY(-4px) scale(.98)}}
@keyframes m-pop{from{opacity:0;transform:scale(.96)}}
@keyframes m-slide-left{from{opacity:.4;transform:translateX(24px)}}

/* Press: buttons give a little under the finger */
.btn, .rate-b, .seg button, .site-nav a, .site-nav button{transition:background-color var(--dur-quick),border-color var(--dur-quick),color var(--dur-quick),transform var(--dur-quick) var(--ease-out)}
.btn:active:not(:disabled), .rate-b:active:not(:disabled), .seg button:active, .site-nav a:active{transform:scale(.97)}

/* Things that appear: they replay each time they go from hidden to shown */
#tip.on{animation:m-fade var(--dur) var(--ease-out)}
[role="menu"]:not([hidden]){animation:m-drop var(--dur) var(--ease-out);transform-origin:top right}
dialog[open]{animation:m-pop var(--dur-slow) var(--ease-out)}
dialog[open]::backdrop{animation:m-fade var(--dur-slow) var(--ease-out)}
/* Disclosures (Compass "How it's scored", "All references"): the contents rise in as they open */
details[open] > :not(summary){animation:m-rise var(--dur) var(--ease-out)}
details > summary{transition:color var(--dur-quick)}

/* Theme switch: the new theme spreads from the button in a circle (theme-switch.js) */
::view-transition-old(root), ::view-transition-new(root){mix-blend-mode:normal}
.theme-reveal::view-transition-old(root){animation:none}
.theme-reveal::view-transition-new(root){animation:m-theme var(--dur-slow) var(--ease-move) both}
@keyframes m-theme{from{clip-path:circle(0 at var(--tx, 100%) var(--ty, 0))}to{clip-path:circle(var(--tr, 150vmax) at var(--tx, 100%) var(--ty, 0))}}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{animation-duration:.01ms !important;animation-delay:0s !important;transition-duration:.01ms !important}
  .btn:active, .rate-b:active, .seg button:active, .site-nav a:active{transform:none}
}
