/* The app's stylesheets, copied for the landing page by scripts/gen_landing.py
   (docs/spec-landing-overhaul.md D2.1): static/ui/tokens.css, app.css, ask.css
   and sources.css, in that order, each as written. Do not edit this file:
   change the app's and run the generator (scripts/test_landing.py fails while
   the copy differs). */

/* ── static/ui/tokens.css ── */
/* Every colour of the app as a token, in the dark and light themes and for
   print; no colour is written anywhere else.

   Spec: docs/spec-ui-overhaul.md.

   Values: the prototype's tokens (docs/ui-overhaul/prototype/src/css/tokens.css)
   plus, under "legacy", the names today's page still uses, each with a dark
   and a light value, until its last user is rebuilt.

   Theme: dark-first (the brand look), following the device unless the user
   chose. An explicit choice is data-theme="light|dark" on <html> (absent =
   System), set before first paint by the head script in static/index.html
   from localStorage['aw.theme']. The light palette is written twice, between
   @light-begin/@light-end and @light-copy-begin/@light-copy-end; the two
   copies must stay identical (the token test checks).

   Referenced as /static/ui/tokens.css?v=<CACHE_VERSION number>: any change to
   this file bumps CACHE_VERSION in static/service-worker.js and the ?v= token
   in static/index.html (scripts/test_ui_assets.py checks). */

:root,
:root[data-theme="dark"] {
  color-scheme: dark;

  /* surfaces */
  --bg: #0a0c0f;
  --surface: #111418;
  --raised: #171c23;
  --field: #0a0c0f;
  --hover: rgba(255, 255, 255, 0.06);
  --selected: #1e2530;
  --scrim: rgba(0, 0, 0, 0.6);
  --viewer: #1b1f26;
  --seg-on: #1e2530;
  --avatar: #2a3545;
  /* the strip under the phone/tablet status bar (body::before on the app
     page and on the admin console; zero high where there is none): in the
     dark theme the page's dark, a shade darker than the top bar; in the
     light theme the light surface, as the top bar and the console's header
     (the founder's decision of 2026-11-15: the top of the app light in the
     light theme, docs/ui-overhaul/r3-notes/sitting-fx-topbar.md; dark in
     both themes until then). The installed iPad and iPhone apps run without
     viewport-fit=cover (the head script in static/index.html, spec §7.1)
     and, since 2026-11-15, with the system's default status bar: there the
     page starts below the bar and the strip is zero high */
  --statusbar: #0a0c0f;
  /* the theme-color metas: the top bar's colour (--surface) in each theme,
     so wherever a system colours its bar from them (the default status bar
     of the installed app since 2026-11-15, Android's) the light app gets a
     light bar and the dark app a dark one; AW.theme (core.js) writes the
     shown theme's value into both. The manifest's theme_color is this dark
     value (a manifest has one) */
  --theme-color: #111418;

  /* lines */
  --border: #1e2530;
  --border-hi: #2a3545;

  /* text */
  --text-hi: #f8fafc;
  --text: #e3e9f1;
  --text-dim: #c0cad5;
  --muted: #8f9bab;
  --disabled: #6b7686;
  --disabled-shade: #4a5462;

  /* amber - the brand */
  --amber: #e8a020;
  --amber-edge: #e8a020;
  --on-amber: #1a1206;
  --on-amber-shade: #553805;
  --amber-text: #e8a020;
  --amber-tint: rgba(232, 160, 32, 0.12);
  --amber-line: #7a5010;
  --logo-shade: #7a5010;
  --wordmark: #e8a020;
  --hero-light: rgba(232, 160, 32, 0.3);
  --dot: #e8a020;
  --focus: #e8a020;

  /* semantic */
  --warn-bg: rgba(232, 160, 32, 0.07);
  --warn-line: #7a5010;
  --warn-chip: transparent;
  --gk: #a884e8;
  --gk-bg: rgba(168, 132, 232, 0.08);
  --gk-line: #4b3a78;
  --interp: #3dc4b4;
  --interp-bg: rgba(61, 196, 180, 0.08);
  --interp-line: #1d5c55;
  --red: #f0685a;
  --red-bg: rgba(240, 104, 90, 0.1);
  --red-line: #7a2e27;
  --green: #2ecc71;
  --green-bg: rgba(46, 204, 113, 0.1);
  --green-line: #1a6640;
  --blue: #4aa3e0;
  --blue-bg: rgba(52, 152, 219, 0.1);
  --blue-line: #1f4e75;

  /* elevation */
  --shadow-pop: 0 12px 40px rgba(0, 0, 0, 0.55);
  --shadow-card: none;
  --shadow-seg: none;

  /* legacy - today's page (static/index.html); replaced as screens are rebuilt */
  --amber-wash: rgba(232, 160, 32, 0.07);
  --warn-bg-lo: rgba(232, 160, 32, 0.05);
  --warn-glow: rgba(232, 160, 32, 0.35);
  --weak-bg: rgba(255, 255, 255, 0.03);
  --fix-bg: rgba(46, 204, 113, 0.07);
  --fix-glow: rgba(46, 204, 113, 0.35);
  --stripe: rgba(255, 255, 255, 0.025);
  --code-bg: rgba(255, 255, 255, 0.05);
  --pre-bg: rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
/* @light-copy-begin */
  color-scheme: light;

  /* surfaces */
  --bg: #f4f6f8;
  --surface: #ffffff;
  --raised: #eceff3;
  --field: #f4f6f8;
  --hover: rgba(13, 17, 23, 0.05);
  --selected: #e3e8ee;
  --scrim: rgba(13, 17, 23, 0.45);
  --viewer: #d5dae1;
  --seg-on: #ffffff;
  --avatar: #dde2e8;
  --statusbar: #ffffff;
  --theme-color: #ffffff;

  /* lines */
  --border: #dde2e8;
  --border-hi: #c5ccd6;

  /* text */
  --text-hi: #0d1117;
  --text: #1c232c;
  --text-dim: #3d4753;
  --muted: #5b6675;
  --disabled: #8a94a1;
  --disabled-shade: #b3bcc7;

  /* amber - the brand: the same fill, darker where it is text */
  --amber: #e8a020;
  --amber-edge: #c9860f;
  --on-amber: #1a1206;
  --on-amber-shade: #553805;
  --amber-text: #7a4a00;
  --amber-tint: #fdf1dc;
  --amber-line: #e3b566;
  --logo-shade: #9a6508;
  --wordmark: #c47f08;
  --hero-light: #fcdba0;
  --dot: #b8760a;
  --focus: #8a5a00;

  /* semantic */
  --warn-bg: #fff7e6;
  --warn-line: #e3b566;
  --warn-chip: #ffffff;
  --gk: #5b34b0;
  --gk-bg: #f3eefc;
  --gk-line: #cdbdf0;
  --interp: #0b6b61;
  --interp-bg: #e4f5f2;
  --interp-line: #a5d8d0;
  --red: #b42318;
  --red-bg: #fdecea;
  --red-line: #f0b4ad;
  --green: #157347;
  --green-bg: #e7f5ec;
  --green-line: #a9d8bc;
  --blue: #1a5fb4;
  --blue-bg: #e8f0fb;
  --blue-line: #b3cdf0;

  /* elevation */
  --shadow-pop: 0 12px 40px rgba(13, 17, 23, 0.16);
  --shadow-card: 0 1px 3px rgba(13, 17, 23, 0.06);
  --shadow-seg: 0 1px 2px rgba(13, 17, 23, 0.08);

  /* legacy */
  --amber-wash: #fff7e6;
  --warn-bg-lo: #fffaf0;
  --warn-glow: rgba(201, 134, 15, 0.35);
  --weak-bg: rgba(13, 17, 23, 0.03);
  --fix-bg: #e7f5ec;
  --fix-glow: rgba(21, 115, 71, 0.3);
  --stripe: rgba(13, 17, 23, 0.03);
  --code-bg: rgba(13, 17, 23, 0.05);
  --pre-bg: #eceff3;
/* @light-copy-end */
  }
}

:root[data-theme="light"] {
/* @light-begin */
  color-scheme: light;

  /* surfaces */
  --bg: #f4f6f8;
  --surface: #ffffff;
  --raised: #eceff3;
  --field: #f4f6f8;
  --hover: rgba(13, 17, 23, 0.05);
  --selected: #e3e8ee;
  --scrim: rgba(13, 17, 23, 0.45);
  --viewer: #d5dae1;
  --seg-on: #ffffff;
  --avatar: #dde2e8;
  --statusbar: #ffffff;
  --theme-color: #ffffff;

  /* lines */
  --border: #dde2e8;
  --border-hi: #c5ccd6;

  /* text */
  --text-hi: #0d1117;
  --text: #1c232c;
  --text-dim: #3d4753;
  --muted: #5b6675;
  --disabled: #8a94a1;
  --disabled-shade: #b3bcc7;

  /* amber - the brand: the same fill, darker where it is text */
  --amber: #e8a020;
  --amber-edge: #c9860f;
  --on-amber: #1a1206;
  --on-amber-shade: #553805;
  --amber-text: #7a4a00;
  --amber-tint: #fdf1dc;
  --amber-line: #e3b566;
  --logo-shade: #9a6508;
  --wordmark: #c47f08;
  --hero-light: #fcdba0;
  --dot: #b8760a;
  --focus: #8a5a00;

  /* semantic */
  --warn-bg: #fff7e6;
  --warn-line: #e3b566;
  --warn-chip: #ffffff;
  --gk: #5b34b0;
  --gk-bg: #f3eefc;
  --gk-line: #cdbdf0;
  --interp: #0b6b61;
  --interp-bg: #e4f5f2;
  --interp-line: #a5d8d0;
  --red: #b42318;
  --red-bg: #fdecea;
  --red-line: #f0b4ad;
  --green: #157347;
  --green-bg: #e7f5ec;
  --green-line: #a9d8bc;
  --blue: #1a5fb4;
  --blue-bg: #e8f0fb;
  --blue-line: #b3cdf0;

  /* elevation */
  --shadow-pop: 0 12px 40px rgba(13, 17, 23, 0.16);
  --shadow-card: 0 1px 3px rgba(13, 17, 23, 0.06);
  --shadow-seg: 0 1px 2px rgba(13, 17, 23, 0.08);

  /* legacy */
  --amber-wash: #fff7e6;
  --warn-bg-lo: #fffaf0;
  --warn-glow: rgba(201, 134, 15, 0.35);
  --weak-bg: rgba(13, 17, 23, 0.03);
  --fix-bg: #e7f5ec;
  --fix-glow: rgba(21, 115, 71, 0.3);
  --stripe: rgba(13, 17, 23, 0.03);
  --code-bg: rgba(13, 17, 23, 0.05);
  --pre-bg: #eceff3;
/* @light-end */
}

/* Legacy names that equal a token above in both themes (aliases). */
:root {
  --cite: var(--amber-text);
  --cite-bg: var(--amber-tint);
  --cite-border: var(--amber-line);
  --weak: var(--text-dim);
  --weak-border: var(--border-hi);
  --fix: var(--green);
  --fix-border: var(--green-line);
}

/* The top bar re-declares no token: it follows the theme, in the admin
   console's header tokens (the founder's decision of 2026-11-15; until then a
   band here held it dark in both themes, founder decision 8, spec §4.3). */

/* Print: the answer sheet prints black on white whatever the theme
   (the @media print block in static/index.html uses these only). */
:root {
  --print-paper: #fff;
  --print-ink: #000;
  --print-wash: #fafafa;
  --print-band: #f4f4f4;
  --print-chip: #f0f0f0;
  --print-rule: #ccc;
  --print-edge: #999;
  --print-muted: #555;
  --print-dim: #444;
  --print-amber: #e8a020;
  --print-amber-text: #7a4a00;                  /* amber words on paper: the light theme's --amber-text, 6.9:1 (founder 2026-11-19); --print-amber stays for the printed logo */
  --print-fix-text: #157347;                    /* green words on paper: the light theme's --green, 5.4:1 (founder 2026-11-19) */
  --print-amber-shade: #7a5010;

  /* Today's printed colours for answer-card rules the print block pins
     (audit F1): without the pin they followed the theme in force, and
     Chromium prints System as light. The values are what v0.71.0 printed
     (its dark palette). */
  --print-table-rule: #1e2530;                  /* today's --border */
  --print-table-edge: #2a3545;                  /* --border-hi */
  --print-table-head-rule: #7a5010;             /* --amber-dim */
  --print-table-head: rgba(232, 160, 32, 0.07); /* --amber-wash */
  --print-stripe: #fafafa;                      /* light grey on paper (founder 2026-11-19, D12; was the dark screen's --stripe, invisible) */
  --print-code-bg: #f0f0f0;                     /* D12 (was --code-bg, invisible on paper) */
  --print-pre-bg: #f4f4f4;                      /* D12 (was --pre-bg, dark grey on paper) */
  --print-gk-rule: #999;                        /* D12 (was --text-hi, invisible on paper) */
  --print-note-bg: rgba(232, 160, 32, 0.1);     /* the storage-full note (0.1 in v0.71.0) */
  --print-jump-bg: rgba(232, 160, 32, 0.05);    /* --warn-bg-lo: the "See verification warning" chip */
  --print-fix-edge: #1a6640;                    /* --fix-border */
  --print-fix-bg: rgba(46, 204, 113, 0.07);     /* --fix-bg: that chip, a corrected table row's cells */
}

/* Not colours: type and safe areas. The type stacks are today's; the
   prototype's take over as screens are rebuilt. */
:root {
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Barlow', sans-serif;
  /* the wordmark "AskWingman" only (the logo's text), design reference D8 */
  --font-wordmark: 'Orbitron', sans-serif;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

/* ── static/ui/app.css ── */
/* The component layer and the frame: buttons, switches, rows, chips, fields,
   notes, sheets, menus and toasts, and the layout of the menu, the top bar,
   Settings and the Documents page by window size.

   Spec: docs/spec-ui-overhaul-r2-build.md.

   Shared components go here; a screen's own styles go into its own
   stylesheet (ask.css, sources.css, upload.css, auth.css, legal.css), never
   into the page's <style>.

   Ported from the prototype's base.css (docs/ui-overhaul/prototype/src/css)
   with the aw- prefix on every class, so nothing here collides with the
   page's legacy sheet; nothing here styles a bare element. Colours are
   tokens only (static/ui/tokens.css; scripts/test_ui_tokens.py checks).
   Referenced as /static/ui/app.css?v=<CACHE_VERSION number>. */

/* not colours: radii, motion, stacking (tokens.css holds colours only) */
:root {
  --r-chip: 6px;
  --r-ctl: 12px;
  --r-block: 14px;
  --r-box: 20px;
  --r-round: 22px;
  /* cards and row groups (Settings cards, the danger zone, plan cards, the
     admin cards) and rows inside a block (segments, small tiles, list rows):
     the two radii the app used as literals until 2026-11-19 (design
     reference D7, the founder's approval) */
  --r-card: 16px;
  --r-row: 10px;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-fast: 160ms;
  --t-slow: 220ms;

  /* stacking, lowest first: top bar; the source pane docked or beside the
     answer (R3); the top fill of the installed iPad app (above the bar, the
     band and the pane beside the answer, under every dimming layer); menu
     and scrim; the source pane covering the window (R3); Settings; overlays
     (sheets, dialogs and menus, AW.ui); the status strip (body::before of
     the app page and the confirm page); toasts */
  --z-topbar: 100;
  --z-source: 900;
  --z-topfill: 1000;
  --z-menu: 1100;
  --z-source-full: 1200;
  --z-settings: 2300;
  --z-overlays: 2500;
  --z-statusbar: 2600;
  --z-toasts: 9999;

  /* the side margin of a screen's content (the prototype's tokens.css):
     16 px, 24 px from 700 px (below) */
  --gutter: 16px;

  /* the bottom allowance for the home indicator of the installed iPhone app,
     which reports every safe-area inset as 0 (it runs without
     viewport-fit=cover, design §7.1): 34 px under html.aw-iphone-standalone,
     set at start-up by the page beside html.aw-ipad-standalone. Used as
     max(var(--safe-b), var(--home-ind)) on the bottom edge of the sheets and
     of Settings on phones. */
  --home-ind: 0px;
}
html.aw-iphone-standalone { --home-ind: 34px; }
@media (min-width: 700px) {
  :root { --gutter: 24px; }
}

/* the page behind an open layer does not scroll; the gutter stays, so the
   lock never shifts the text (lifted for print in the page's print block) */
html { scrollbar-gutter: stable; }
html.aw-lock { overflow: hidden; }

/* [hidden] wins over the display of any aw- class */
:where([class^="aw-"], [class*=" aw-"])[hidden] { display: none !important; }

.aw-sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.aw-ic { display: block; flex: none; }
.aw-danger { color: var(--red); }
/* the dart of AW.dart (R3-0): the logo's colours unless the caller's class
   gives its own */
.aw-dart { display: block; flex: none; }
.aw-dart-f1 { fill: var(--amber); }
.aw-dart-f2 { fill: var(--logo-shade); }

/* ---------- buttons ---------- */

.aw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; margin: 0; padding: 0 18px;
  border: 1px solid var(--border-hi); border-radius: var(--r-ctl);
  background: transparent; color: var(--text-hi);
  font-family: var(--sans); font-size: 15px; line-height: 20px; font-weight: 500;
  text-decoration: none; white-space: nowrap;
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
/* the main action: soft amber (the founder's pick, 2026-11-17: a faint amber
   wash, amber text, a thin amber edge; solid amber is left to the Ask arrow) */
.aw-btn-primary { border-color: var(--amber-line); background: var(--amber-tint); color: var(--amber-text); font-weight: 600; }
.aw-btn-raised { background: var(--raised); }
.aw-btn-danger { border-color: var(--red-line); color: var(--red); }
.aw-btn-lg { min-height: 48px; border-radius: var(--r-block); }
/* the small button, the size of a row chip (docs/spec-play-store-app.md D2.11,
   approved 2026-11-23): its press area reaches 44 px through an unseen margin */
.aw-btn-sm { position: relative; min-height: 30px; padding: 0 10px 0 9px; border-radius: 8px; font-size: 13px; line-height: 18px; }
.aw-btn-sm::after { content: ""; position: absolute; inset: -7px 0; }
.aw-btn-sm:active:not(:disabled) { background: var(--hover); }
.aw-btn-block { width: 100%; }
.aw-btn:disabled, .aw-btn[aria-disabled="true"] {
  border-color: var(--border); background: var(--raised); color: var(--disabled); cursor: default;
}

.aw-icon-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: none; margin: 0; padding: 0;
  border: 0; border-radius: var(--r-ctl);
  background: transparent; color: var(--text-dim);
  font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.aw-icon-btn:disabled { color: var(--disabled); cursor: default; }

.aw-link { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

@media (hover: hover) {
  .aw-btn:hover:not(:disabled):not(.aw-btn-primary) { background: var(--hover); }
  .aw-btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
  .aw-icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--text-hi); }
  .aw-link:hover { color: var(--text-hi); }
}

/* ---------- fields ---------- */

.aw-field { display: flex; flex-direction: column; gap: 6px; }
.aw-field-label { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text-hi); }
.aw-field-help { font-size: 13px; line-height: 18px; color: var(--muted); }

.aw-input, .aw-textarea, .aw-select {
  display: block; width: 100%; min-height: 44px; margin: 0; padding: 10px 14px;
  border: 1px solid var(--border-hi); border-radius: var(--r-ctl);
  background: var(--field); color: var(--text-hi);
  font-family: var(--sans); font-size: 16px; line-height: 24px; font-weight: 400;
  outline: none;
}
.aw-input::placeholder, .aw-textarea::placeholder { color: var(--muted); opacity: 1; }
.aw-input:focus, .aw-textarea:focus, .aw-select:focus { border-color: var(--focus); }
/* the focus border fades in (R3 core, from track A: the page's element rule
   for every textarea, which gave the Settings editor this, went with the
   question panel in R3 A2) */
.aw-textarea { resize: none; transition: border-color var(--t-fast); }
/* a dropdown: the system control's own look off (WebKit, so Safari on the
   iPhone and iPad, otherwise draws its unstyled control: R2 C13, the
   Safari-engine walk) and the icon set's chevron over its right end, as the
   Documents page's type select has it; the field's height, border, colours
   and focus border stay, and so does its 44 px height (without the system
   look it is sized like the text fields, 46 px, hence 9 px padding instead
   of 10). Markup: span.aw-select-wrap holding the select.aw-select and
   span.aw-select-arrow (the chevron) */
.aw-select { padding: 9px 42px 9px 14px; cursor: pointer; appearance: none; -webkit-appearance: none; }
.aw-select option, .aw-hist-scope select option { background: var(--surface); color: var(--text-hi); }
.aw-select-wrap { position: relative; display: block; min-width: 0; }
.aw-select-arrow { position: absolute; top: 50%; right: 14px; margin-top: -8px; color: var(--text-dim); pointer-events: none; }

/* a real checkbox drawn as a switch; the 44px-high label is the target */
.aw-switch { position: relative; display: inline-flex; align-items: center; flex: none; width: 52px; height: 44px; }
.aw-switch input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.aw-switch input:disabled { cursor: default; }
.aw-switch-track {
  position: relative; width: 52px; height: 32px;
  border: 1px solid var(--border-hi); border-radius: 16px; background: var(--raised); /* half its height: fully round, not a card */
  transition: background var(--t-fast), border-color var(--t-fast);
}
.aw-switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: var(--muted);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast);
}
.aw-switch input:checked + .aw-switch-track { border-color: var(--amber-edge); background: var(--amber); }
.aw-switch input:checked + .aw-switch-track::after { transform: translateX(20px); background: var(--on-amber); }
.aw-switch input:disabled + .aw-switch-track { opacity: 0.5; }
.aw-switch input:focus-visible + .aw-switch-track { outline: 2px solid var(--focus); outline-offset: 2px; }

/* a radio group drawn as a segmented control */
.aw-segmented {
  display: inline-flex; flex-wrap: wrap; gap: 4px; max-width: 100%; padding: 4px;
  border: 1px solid var(--border); border-radius: var(--r-block); background: var(--field);
}
.aw-segmented button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; margin: 0; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--r-row);
  background: transparent; color: var(--text-dim);
  font-family: var(--sans); font-size: 15px; cursor: pointer;
}
.aw-segmented button[aria-checked="true"] {
  border-color: var(--border-hi); background: var(--seg-on); box-shadow: var(--shadow-seg);
  color: var(--text-hi); font-weight: 600;
}

/* ---------- rows ---------- */

.aw-label { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--muted); }

.aw-row-group { border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); overflow: hidden; }
.aw-row {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 56px; margin: 0; padding: 8px 12px 8px 14px;
  border: 0; background: transparent; color: inherit; text-align: left; text-decoration: none;
  font-family: var(--sans); font-size: 15px;
}
button.aw-row, a.aw-row { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.aw-row + .aw-row { border-top: 1px solid var(--border); }
.aw-row-icon {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: none; border-radius: var(--r-row);
  background: var(--raised); color: var(--text-dim);
}
.aw-row-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.aw-row-title { font-size: 15px; line-height: 21px; font-weight: 500; color: var(--text-hi); }
.aw-row-sub { font-size: 13px; line-height: 18px; color: var(--muted); }
.aw-row-trail { display: inline-flex; align-items: center; gap: 8px; flex: none; font-size: 13px; color: var(--muted); }

@media (hover: hover) {
  button.aw-row:hover, a.aw-row:hover { background: var(--hover); }
}

/* ---------- chips, badges, dots ---------- */

.aw-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border: 1px solid var(--border-hi); border-radius: 15px;
  background: var(--raised); color: var(--text);
  font-size: 13px; line-height: 18px; font-weight: 500; white-space: nowrap;
}
.aw-chip-amber { border-color: var(--amber-line); background: var(--amber-tint); color: var(--amber-text); }

.aw-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px;
  border: 1px solid var(--border-hi); border-radius: var(--r-row);
  font-size: 13px; line-height: 20px; font-weight: 600; color: var(--text-dim); white-space: nowrap;
}
.aw-badge-amber { border-color: var(--amber-line); background: var(--amber-tint); color: var(--amber-text); }
.aw-badge-green { border-color: var(--green-line); background: var(--green-bg); color: var(--green); }
.aw-badge-red { border-color: var(--red-line); background: var(--red-bg); color: var(--red); }

.aw-dot { position: relative; display: inline-block; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--dot); }
.aw-dot-red { background: var(--red); }
.aw-dot-pulse::after {
  content: ""; position: absolute; inset: -4px; border: 2px solid var(--dot); border-radius: 50%;
  opacity: 0; animation: aw-pulse 1.6s ease-out infinite;
}
@keyframes aw-pulse {
  0% { transform: scale(0.5); opacity: 0.9; }
  100% { transform: scale(1.4); opacity: 0; }
}

.aw-spin {
  display: inline-block; width: 14px; height: 14px; flex: none;
  border: 2px solid var(--border-hi); border-top-color: var(--amber-text); border-radius: 50%;
  animation: aw-spin 0.8s linear infinite;
}
@keyframes aw-spin { to { transform: rotate(360deg); } }

/* ---------- notes: a boxed notice, and a one-line note ---------- */

.aw-note {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-hi); border-radius: var(--r-block); background: var(--raised);
}
.aw-note > .aw-ic { margin-top: 1px; color: var(--muted); }
.aw-note-warn { border-color: var(--warn-line); background: var(--warn-bg); }
.aw-note-warn > .aw-ic { color: var(--amber-text); }
.aw-note-error { border-color: var(--red-line); background: var(--red-bg); }
.aw-note-error > .aw-ic { color: var(--red); }
.aw-note-main { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; flex: 1; min-width: 0; }
.aw-note-title { font-size: 15px; line-height: 22px; font-weight: 600; color: var(--text-hi); }
.aw-note-text { font-size: 14px; line-height: 20px; color: var(--text-dim); overflow-wrap: anywhere; }

.aw-line {
  display: flex; align-items: flex-start; gap: 8px; max-width: 64ch;
  font-size: 13px; line-height: 18px; color: var(--muted);
}
.aw-line > .aw-ic { margin-top: 1px; }
.aw-line-error { font-size: 14px; line-height: 20px; color: var(--red); }

/* ---------- overlays (AW.ui, mounted in #aw-overlays) ---------- */

.aw-ov { position: fixed; inset: 0; z-index: var(--z-overlays); display: flex; font-family: var(--sans); }
.aw-ov-scrim { position: absolute; inset: 0; background: var(--scrim); animation: aw-fade var(--t-slow) ease-out; }
.aw-ov-panel { position: relative; outline: none; color: var(--text); }

/* sheet: from the bottom on compact windows, a centred dialog from 700px */
.aw-ov-sheet { align-items: flex-end; justify-content: center; }
.aw-ov-sheet .aw-ov-panel {
  display: flex; flex-direction: column;
  width: 100%; max-height: calc(100vh - 24px - var(--top-t)); max-height: calc(100dvh - 24px - var(--top-t));
  padding-bottom: max(var(--safe-b), var(--home-ind));
  border-top: 1px solid var(--border-hi); border-radius: var(--r-round) var(--r-round) 0 0;
  background: var(--surface); box-shadow: var(--shadow-pop);
  animation: aw-up var(--t-slow) var(--ease);
}
.aw-ov-grab { align-self: center; width: 40px; height: 4px; flex: none; margin-top: 8px; border-radius: 2px; background: var(--border-hi); }
.aw-ov-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; min-height: 52px; padding: 4px 8px 0 20px; }
.aw-ov-title { margin: 0; font-size: 19px; line-height: 26px; font-weight: 600; color: var(--text-hi); }
.aw-ov-title.aw-danger { color: var(--red); }
.aw-ov-body { flex: 1; min-height: 0; padding: 4px max(20px, var(--safe-r)) 20px max(20px, var(--safe-l)); overflow-y: auto; overscroll-behavior: contain; }
.aw-ov-foot { display: flex; gap: 10px; flex: none; padding: 0 max(20px, var(--safe-r)) 20px max(20px, var(--safe-l)); }
.aw-ov-foot .aw-btn { flex: 1; }
.aw-ov-foot .aw-btn-primary { flex: 2; }
.aw-ov-text { margin: 0; font-size: 15px; line-height: 22px; color: var(--text-dim); white-space: pre-wrap; overflow-wrap: anywhere; }

.aw-ov-s { --ov-w: 420px; }
.aw-ov-m { --ov-w: 560px; }
.aw-ov-l { --ov-w: 720px; }

/* the What's new sheet (docs/spec-app-opening.md C2.6; the founder's B2 with the
   logo centred, 2026-11-27): the sign-in card's logo centred in the title bar,
   the close button at its end; the note's parts 16 px apart; on a phone it
   fills the screen like Settings (its background, title bar and top inset) */
.aw-wn .aw-ov-head { display: grid; grid-template-columns: 1fr auto 1fr; column-gap: 0; padding-left: 8px; }
.aw-wn .aw-ov-head > .aw-auth-brand { grid-column: 2; padding: 0; }
.aw-wn .aw-ov-head > .aw-icon-btn { grid-column: 3; justify-self: end; }
.aw-wn .aw-ov-body { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 699px) {
  .aw-wn.aw-ov-sheet .aw-ov-panel { height: 100%; max-height: none; padding-top: var(--top-t); border-top: 0; border-radius: 0; background: var(--bg); }
  .aw-wn .aw-ov-grab { display: none; }
  .aw-wn .aw-ov-head { min-height: 56px; padding: 0 6px; border-bottom: 1px solid var(--border); }
  .aw-wn .aw-ov-body { padding-top: 16px; }
}

@media (min-width: 700px) {
  .aw-ov-sheet { align-items: center; padding: calc(24px + var(--win-top)) 24px 24px; }
  .aw-ov-sheet .aw-ov-panel {
    width: min(100%, var(--ov-w, 560px)); max-height: min(720px, 100vh - 48px - var(--win-top)); max-height: min(720px, 100dvh - 48px - var(--win-top));
    padding-bottom: 0;
    border: 1px solid var(--border-hi); border-radius: var(--r-box);
  }
  .aw-ov-grab { display: none; }
  .aw-ov-head { padding-top: 10px; }
}

/* menu: a popover from 700px (placed by script), a sheet on compact windows */
.aw-ov-menu .aw-ov-scrim { background: transparent; }
.aw-ov-menu .aw-ov-panel {
  position: absolute; min-width: 240px; max-width: min(360px, 100vw - 32px); padding: 6px;
  border: 1px solid var(--border-hi); border-radius: var(--r-block);
  background: var(--surface); box-shadow: var(--shadow-pop);
  animation: aw-fade var(--t-fast) ease-out;
}
.aw-menu-list { display: flex; flex-direction: column; gap: 2px; }
.aw-ov-sheet .aw-menu-list { margin: 0 -8px; padding: 0 0 4px; }
.aw-menu-item {
  display: flex; align-items: flex-start; gap: 12px;
  width: 100%; min-height: 44px; margin: 0; padding: 10px 12px;
  border: 0; border-radius: var(--r-row); background: transparent; text-align: left;
  font-family: var(--sans); color: var(--text-hi); cursor: pointer;
}
.aw-menu-item > .aw-ic { margin-top: 1px; color: var(--text-dim); }
.aw-menu-item-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.aw-menu-item-label { font-size: 15px; line-height: 22px; font-weight: 500; color: var(--text-hi); }
.aw-menu-item-sub { font-size: 13px; line-height: 19px; color: var(--muted); }
.aw-menu-item-check { width: 20px; flex: none; margin-top: 1px; color: var(--amber-text); }
.aw-menu-item.aw-danger .aw-menu-item-label, .aw-menu-item.aw-danger > .aw-ic { color: var(--red); }
.aw-menu-item:disabled { cursor: default; }
.aw-menu-item:disabled .aw-menu-item-label { color: var(--disabled); }

/* alert, confirm, prompt: a small centred dialog at every width */
.aw-ov-center {
  align-items: center; justify-content: center;
  padding: calc(24px + var(--top-t)) max(16px, var(--safe-r)) calc(24px + var(--safe-b)) max(16px, var(--safe-l));
}
.aw-ov-center .aw-ov-panel {
  display: flex; flex-direction: column; gap: 8px;
  width: min(100%, 440px); max-height: 100%; padding: 22px 22px 18px;
  overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--border-hi); border-radius: var(--r-box);
  background: var(--surface); box-shadow: var(--shadow-pop);
  animation: aw-up var(--t-slow) var(--ease);
}
.aw-ov-center .aw-ov-input { margin-top: 6px; }
.aw-ov-center .aw-ov-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 14px; }

@media (hover: hover) {
  .aw-menu-item:hover:not(:disabled) { background: var(--hover); }
}

@keyframes aw-fade { from { opacity: 0; } }
@keyframes aw-up { from { transform: translateY(18px); opacity: 0; } }

/* ---------- toasts (AW.ui.toast, in #aw-toasts) ---------- */

.aw-toasts {
  position: fixed; left: 0; right: 0; bottom: calc(24px + var(--safe-b)); z-index: var(--z-toasts);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0 16px; pointer-events: none;
}
.aw-toast {
  display: flex; align-items: center; gap: 4px;
  max-width: 480px; padding: 10px 16px;
  border: 1px solid var(--border-hi); border-radius: var(--r-ctl);
  background: var(--raised); box-shadow: var(--shadow-pop);
  color: var(--text-hi); font-family: var(--sans); font-size: 14px; line-height: 20px;
  animation: aw-up var(--t-slow) var(--ease);
}
.aw-toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.aw-toast-error { border-color: var(--red-line); color: var(--red); }
.aw-toast-error > .aw-ic { flex: none; margin-right: 6px; }  /* the error icon (D14, 2026-11-19) */
/* a tap on the toast's text reaches what is under it; only its dismiss
   button and its action (R3-0: "View" on the answer-ready toast) take taps */
.aw-toast-x { margin: -12px -12px -12px 0; color: inherit; pointer-events: auto; }
.aw-toast-action {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-height: 44px; margin: -12px 0 -12px 8px; padding: 0 12px;
  border: 0; border-radius: var(--r-ctl); background: transparent;
  color: var(--amber-text); font-family: var(--sans); font-size: 14px; line-height: 20px; font-weight: 600;
  cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.aw-toast-action:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
@media (hover: hover) {
  .aw-toast-action:hover { background: var(--hover); }
}
/* under 700 px the toasts sit under the top bar, clear of the drawer's foot
   (at 390 px the sign-in toast's close mark covered the menu's theme switch
   for five seconds; R2 review) and of a bottom sheet's buttons */
@media (max-width: 699px) {
  .aw-toasts { top: calc(var(--topbar-h) + var(--top-t) + 8px); bottom: auto; }
}

/* ---------- the frame (C2): menu, scrim, column, top bar ----------
   Ported from the prototype's shell.css. The document scrolls; the menu is
   fixed at the left: a drawer under 1024 px, and from 1024 px a permanent
   menu while localStorage['aw.sidebar'] is not 'closed' (class
   .aw-menu-hidden on #app, set by shell.js). #app, #aw-col and #aw-main
   carry no transform, filter, contain or non-visible overflow in any state:
   the reading-position code measures the document's scroll, and on paper
   the answer card prints in the normal flow with each of its ancestors a
   plain block (the page's print block; the sitting's print fix). Only #aw-menu
   animates; the scroll lock of an open layer sits on <html>. */

/* --topbar-h: the top bar and the menu's logo row, under the status strip,
   their content centred: 60 px, as the admin console's header (admin.css
   .aw-adm-head), so the logo and the controls sit as many pixels from the top
   of the window on both pages (R2 C15, the founder's device check: iPadOS can
   draw a blurred band over about the top 56 px of the installed app's window;
   56 px until then) */
:root {
  --sidebar-w: 280px;
  --topbar-h: 60px;
  --content-max: 1000px;
  /* the empty strip at the top of the installed iPad app (html.aw-ipad-
     standalone): 12 px, full screen and in a window (the founder's
     decision of 2026-11-17, docs/ui-overhaul/r3-notes/recheck-fx-final.md:
     the logo higher). It is one flat colour, the top fill's (below), so the
     system's zone behind the clock and its window buttons sit over nothing
     but that colour; in a window the buttons reach into the top row. The
     admin console keeps its own values (admin.css: 40 px in a window, none
     full screen). Everywhere else 0. --top-t is the top edge everything
     starts under: the safe area plus the strip. The status strip
     (body::before) keeps --safe-t alone. */
  --win-top: 0px;
  --top-t: calc(var(--safe-t) + var(--win-top));
}
html.aw-ipad-standalone { --win-top: 12px; }
/* in the installed iPad app the page is not pulled down past its top (his
   request, 2026-11-17; WebKit turns the main scroll view's vertical bounce
   off for it) */
html.aw-ipad-standalone { overscroll-behavior-y: none; }

/* the top fill (run fx-fable, 2026-11-17;
   docs/ui-overhaul/r3-notes/recheck-fx-fable.md): why the system's zone
   behind the clock was solid on the admin console and translucent in the
   app. Read from WebKit's source (LocalFrameView::fixedContainerEdges,
   Page::updateFixedContainerEdges, WKWebView _updateFixedColorExtensionViews):
   on iPadOS 26 and later the zone above the page is filled with a solid
   colour only when a hit test at the middle of the page's top edge (4 px
   down) finds a fixed or sticky element at least 90 % of the window wide
   with a background; without one the system's scroll edge effect shows
   there, a blur over the scrolled page. On an iPad (not an iPhone) that
   element is looked for only until the first tap or scroll after the page
   loads; from then on the result stands, and it is dropped for the rest of
   the page's life once that element has no box (display: none) or is
   hidden. The console's header is always there. The app's top bar and band
   came and went with the menu, also when it stepped aside for a source, so
   the zone was lost at the first such change.
   So in the installed iPad app one element (#aw-topfill, the first child of
   <body>) is always there, from the page's first paint: fixed across the
   window's top edge, as high as the empty strip (--top-t: 12 px), above the bar, the band and the source pane
   beside the answer and under the menu, its scrim and every dialog. Its
   colour is the colour that was there already, so nothing on screen
   changes: the page's own (--bg) before the app shows and on the sign-in
   screen, the top bar's (--surface) once the app shows (#app without its
   "hidden" class; the same style pass, so iPadOS reads the app's colour
   when it looks again as the app's fixed parts arrive). It must keep its
   box: no display: none, no hidden, no visibility. iPadOS keeps the colour
   it read at the first tap: after a sign-in on the page itself the zone
   stays in the page's colour over the bar's until the app is opened again
   (solid, a shade apart). The one exception to "always there" is the
   theme: the zone would keep the other theme's colour, so when the theme
   changes the element is taken out on purpose (static/ui/shell.js,
   data-aw-topfill="dropped") and the zone is the translucent one of before
   until the app is opened again.
   Never printed (the print block hides every child of <body> but
   #app). */
.aw-topfill { display: none; }
@media screen {
  html.aw-ipad-standalone .aw-topfill {
    display: block;
    position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-topfill);
    height: var(--top-t);
    background: var(--bg);
  }
  html.aw-ipad-standalone:has(#app:not(.hidden)) .aw-topfill { background: var(--surface); }
  html.aw-ipad-standalone[data-aw-topfill="dropped"] .aw-topfill { display: none; }
}

.aw-menu {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: calc(var(--z-menu) + 1);
  display: flex; flex-direction: column;
  width: min(322px, 86vw);
  padding: var(--top-t) 0 var(--safe-b) var(--safe-l);
  border-right: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-family: var(--sans);
  transform: translateX(-102%);
  visibility: hidden;
  transition: transform var(--t-slow) var(--ease), visibility 0s linear var(--t-slow);
}
.aw-menu:focus { outline: none; }
#app.aw-drawer-open .aw-menu {
  transform: none; visibility: visible; box-shadow: var(--shadow-pop);
  transition: transform var(--t-slow) var(--ease), visibility 0s;
}
/* the drawer's scrim is drawn only while the drawer is open (it fades in
   and out; visibility follows the fade, as the menu's does): otherwise no
   layer lies over the whole window, the top bar included, as on the admin
   console, whose top iPadOS leaves sharp (the founder's sitting, 2026-11-15;
   until then the closed scrim stayed over the bar, transparent) */
.aw-scrim {
  position: fixed; inset: 0; z-index: var(--z-menu);
  background: var(--scrim); opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity var(--t-slow), visibility 0s linear var(--t-slow);
}
#app.aw-drawer-open .aw-scrim {
  opacity: 1; pointer-events: auto; visibility: visible;
  transition: opacity var(--t-slow), visibility 0s;
}

.aw-menu-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: var(--topbar-h); flex: none;
  padding: 0 6px 0 18px;
}
.aw-menu-head .logo-name { font-size: 17px; }

.aw-menu-primary { display: flex; flex-direction: column; gap: 4px; flex: none; padding: 6px 12px 0; }
.aw-menu-history { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.aw-menu-foot { display: flex; flex-direction: column; gap: 2px; flex: none; padding: 8px 12px 12px; border-top: 1px solid var(--border); }
.aw-menu-foot-rows { display: flex; flex-direction: column; gap: 2px; }

.aw-menu-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 44px; margin: 0; padding: 0 14px;
  border: 1px solid transparent; border-radius: var(--r-ctl);
  background: transparent; color: var(--text);
  font-family: var(--sans); font-size: 15px; line-height: 20px; text-align: left; text-decoration: none;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.aw-menu-row > .aw-ic { color: var(--text-dim); }
/* New question: a plain row, its icon in amber, hovered as every row is
   (the founder, 2026-11-23: landing overhaul D1.3); disabled, the rule
   below greys the icon */
.aw-menu-row-new { color: var(--text-hi); font-weight: 500; }
.aw-menu-row-new > .aw-ic { color: var(--amber-text); }
.aw-menu-row:disabled { color: var(--disabled); cursor: default; }
.aw-menu-row:disabled > .aw-ic { color: var(--disabled); }
/* the current row: a fill, an edge and semi-bold, never the fill alone
   (founder 2026-11-19, D14) */
.aw-menu-row[aria-current="page"] { border-color: var(--border-hi); background: var(--selected); color: var(--text-hi); font-weight: 600; }
.aw-menu-row-label { flex: 1; min-width: 0; }

.aw-account { display: flex; align-items: center; gap: 2px; }
.aw-account-btn {
  display: flex; align-items: center; gap: 12px;
  flex: 1; min-width: 0; min-height: 56px; margin: 0; padding: 0 10px;
  border: 0; border-radius: var(--r-ctl); background: transparent; color: inherit;
  font-family: var(--sans); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.aw-avatar {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  background: var(--avatar); color: var(--text-hi); font-size: 15px; font-weight: 600;
}
.aw-account-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.aw-account-name { overflow: hidden; font-size: 15px; line-height: 20px; font-weight: 500; color: var(--text-hi); text-overflow: ellipsis; white-space: nowrap; }
.aw-account-plan { font-size: 13px; line-height: 18px; color: var(--muted); }

@media (hover: hover) {
  .aw-menu-row:hover:not(:disabled), .aw-account-btn:hover { background: var(--hover); }
  .aw-menu-row[aria-current="page"]:hover { background: var(--selected); }
}

.aw-col { min-width: 0; }

/* the top bar, shown while the menu is not permanent: the theme's surface
   with a hairline under it, the admin console's header in the same tokens
   (admin.css .aw-adm-head), so the top of the app is light in the light
   theme and dark in the dark theme (the founder's decision of 2026-11-15;
   dark in both themes until then); the status strip above it is
   --statusbar (tokens.css) */
.aw-topbar {
  position: sticky; top: 0; z-index: var(--z-topbar);
  display: flex; align-items: center; justify-content: space-between;
  height: calc(var(--topbar-h) + var(--top-t));
  padding: var(--top-t) max(6px, var(--safe-r)) 0 max(6px, var(--safe-l));
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.aw-topbar .logo-name { font-size: 17px; }
.aw-icon-slot { display: contents; }
/* the menu button's dot is the indexing mark of every place: a dot with the
   pulse's ring while indexing, a red dot with no ring when one failed, so
   the two differ in shape with or without motion (the founder, 2026-11-23:
   "all 3 dots need to match"; D14 amended) */
.aw-menu-dot { position: absolute; top: 9px; right: 8px; box-shadow: 0 0 0 2px var(--surface); }

/* the main column keeps today's 1000 px column and padding */
#aw-main {
  display: flex; flex-direction: column; gap: 1.5rem;
  width: 100%; max-width: var(--content-max); margin: 0 auto;
  padding: 2rem max(2rem, var(--safe-r)) calc(2rem + var(--safe-b)) max(2rem, var(--safe-l));
}
#aw-main:focus { outline: none; }
@media (max-width: 600px) {
  #aw-main { gap: 1rem; padding: 1rem max(1rem, var(--safe-r)) calc(1rem + var(--safe-b)) max(1rem, var(--safe-l)); }
}

/* the permanent menu */
@media (min-width: 1024px) {
  #app:not(.aw-menu-hidden) .aw-menu {
    width: var(--sidebar-w);
    transform: none; visibility: visible; box-shadow: none; transition: none;
  }
  #app:not(.aw-menu-hidden) .aw-scrim { display: none; }
  #app:not(.aw-menu-hidden) .aw-col { margin-left: var(--sidebar-w); }
  #app:not(.aw-menu-hidden) .aw-topbar { display: none; }
}
/* beside the permanent menu the column keeps the top bar's row free (the
   founder's sitting, 2026-11-15: the question box must not move when the
   menu opens or closes): the bar's height under the strip, the space the
   sticky bar takes when it shows. So the question box, an answer, the
   Documents view and the banners start at the same height whether the menu
   shows, is hidden or steps aside for a source (sources.js; under 1800 px),
   and the pane's header beside the answer sits in the same row as the bar.
   Screen only: the printout is as before. */
@media screen and (min-width: 1024px) {
  #app:not(.aw-menu-hidden) .aw-col { padding-top: calc(var(--topbar-h) + var(--top-t)); }
}

/* the band (the founder's re-check, 2026-11-16, run fx-band): beside the
   permanent menu the column's free row above is a solid, fixed band across
   the window, the theme's surface with the top bar's hairline, under the
   menu (whose head is the same surface) and above the scrolling content. So
   an answer scrolled up goes under a solid edge with a hairline, as under
   the top bar. Where the menu is not permanent the top bar is that element,
   so the band is drawn only here, and only in the installed iPad app (the
   head class html.aw-ipad-standalone): Safari, the desktop and the iPhone
   keep the page as it was (the founder: "Browser is fine"). Its height is
   the column's free row (the line above), so nothing moves; it takes no
   room (fixed) and is never printed.
   It was built to give iPadOS an opaque element at the window's top edge
   for the zone behind the clock; that zone needs an element that never
   leaves the page, which this band is not (it goes with the menu): the top
   fill above (.aw-topfill, run fx-fable) is that element now, and the band
   only draws the row. */
.aw-band { display: none; }
@media screen and (min-width: 1024px) {
  html.aw-ipad-standalone #app:not(.aw-menu-hidden) > .aw-band {
    display: block;
    position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-topbar);
    height: calc(var(--topbar-h) + var(--top-t));
    border-bottom: 1px solid var(--border);
    background: var(--surface);
  }
}

/* ---------- Settings (C3): #aw-settings, static markup adopted by AW.ui ----------
   Ported from the prototype's settings.css and screens/settings-*.css with the
   aw- prefix. Under 700 px full screen (the list, then a section); from
   700 px a centred dialog with the rail. Stacking: above the menu, under the
   legacy upload and filter dialogs and the overlays (--z-settings). */

.aw-settings {
  position: fixed; inset: 0; z-index: var(--z-settings);
  display: flex; align-items: stretch; justify-content: stretch;
  font-family: var(--sans); color: var(--text);
}
.aw-set-scrim { position: absolute; inset: 0; display: none; background: var(--scrim); animation: aw-fade var(--t-slow) ease-out; }
.aw-set-panel {
  position: relative; display: flex; width: 100%; height: 100%; min-width: 0;
  padding: var(--top-t) var(--safe-r) max(var(--safe-b), var(--home-ind)) var(--safe-l);
  background: var(--bg);
}
.aw-settings:focus { outline: none; }

/* the rail (from 700 px) */
.aw-set-rail {
  display: none; flex-direction: column; gap: 2px;
  width: 248px; flex: none; padding: 18px 12px 14px;
  border-right: 1px solid var(--border); background: var(--bg);
  overflow-y: auto; overscroll-behavior: contain;
}
.aw-set-rail-title { padding: 4px 12px 12px; font-size: 18px; line-height: 24px; font-weight: 600; color: var(--text-hi); }
.aw-set-nav {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 44px; flex: none; margin: 0; padding: 0 12px;
  border: 1px solid transparent; border-radius: var(--r-ctl);
  background: transparent; color: var(--text);
  font-family: var(--sans); font-size: 15px; line-height: 20px; text-align: left; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.aw-set-nav > .aw-ic { color: var(--text-dim); }
.aw-set-nav[aria-current="true"] { border-color: var(--border); background: var(--surface); color: var(--text-hi); font-weight: 600; }
.aw-set-nav-quiet { color: var(--text-dim); }
.aw-set-spacer { flex: 1; min-height: 12px; }

/* the pane: head and scrolling body */
.aw-set-pane { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; background: var(--bg); }
.aw-set-head {
  display: flex; align-items: center; gap: 4px;
  min-height: 56px; flex: none; padding: 0 6px 0 20px;
  border-bottom: 1px solid var(--border);
}
.aw-set-head.aw-set-has-back { padding-left: 6px; }
.aw-set-title { flex: 1; min-width: 0; margin: 0; font-size: 20px; line-height: 26px; font-weight: 600; color: var(--text-hi); outline: none; }
.aw-set-body { flex: 1; min-height: 0; padding: 16px max(16px, var(--safe-r)) 28px max(16px, var(--safe-l)); overflow-y: auto; overscroll-behavior: contain; }

/* the phone list */
.aw-set-list { display: flex; flex-direction: column; gap: 16px; }
.aw-set-me {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface);
}
.aw-set-me:empty { display: none; }
.aw-set-me-avatar { width: 44px; height: 44px; font-size: 18px; }
.aw-set-me-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.aw-set-me-name { font-size: 16px; line-height: 22px; font-weight: 600; color: var(--text-hi); overflow-wrap: anywhere; }
.aw-set-me-mail { overflow: hidden; font-size: 13px; line-height: 18px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.aw-set-legal { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 10px; font-size: 13px; color: var(--muted); }
.aw-set-legal a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--text-dim); text-decoration: none; }

/* section building blocks */
.aw-set-sec { display: flex; flex-direction: column; }
.aw-set-item { display: flex; align-items: center; gap: 24px; }
.aw-set-item-main { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.aw-set-item-title { margin: 0; font-size: 16px; line-height: 22px; font-weight: 600; color: var(--text-hi); }
.aw-set-item-text { margin: 0; max-width: 64ch; font-size: 14px; line-height: 20px; color: var(--muted); }
.aw-set-stack { display: flex; flex-direction: column; gap: 12px; }
.aw-set-rule { height: 1px; margin: 24px 0; border: 0; background: var(--border); }
.aw-set-text { margin: 0; max-width: 64ch; font-size: 15px; line-height: 22px; color: var(--text-dim); }
.aw-set-under { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.aw-set-empty {
  margin: 0; padding: 16px;
  border: 1px dashed var(--border-hi); border-radius: var(--r-card);
  font-size: 15px; line-height: 22px; color: var(--text-dim);
}
/* Edit / Delete / Remove in a row: the 44 px floor of every new control
   (R2 post-implementation audit F7), with a narrower pad than .aw-btn */
.aw-set-rowbtn { min-height: 44px; padding: 0 14px; }
.aw-set-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; font-size: 15px; color: var(--muted); }
.aw-set-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* Account: who is signed in, biometric logins, the danger zone */
.aw-set-kv { min-height: 48px; gap: 16px; padding-right: 14px; }
.aw-set-k { width: 104px; flex: none; font-size: 14px; line-height: 20px; color: var(--muted); }
.aw-set-v { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; flex: 1; min-width: 0; font-size: 15px; line-height: 21px; font-weight: 500; color: var(--text-hi); overflow-wrap: anywhere; }
/* a biometric login's row (renderAccountInfo writes it as .aw-row.aw-set-key):
   the name and the dates take the room beside Remove and wrap; Remove keeps
   its size. R2 C17 (the founder's iPhone): the storage legend's .aw-set-key
   rule below, written for a legend item, reached these rows too (one class
   name, two uses), and its white-space: nowrap ran the dates, on a phone the
   name as well, under the button. */
.aw-row.aw-set-key { gap: 8px; padding-right: 10px; }
.aw-row.aw-set-key .aw-row-title, .aw-row.aw-set-key .aw-row-sub { overflow-wrap: anywhere; }
.aw-set-danger {
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px;
  border: 1px solid var(--red-line); border-radius: var(--r-card);
}
.aw-set-danger-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; line-height: 22px; font-weight: 600; color: var(--red); }
.aw-set-danger .aw-btn { align-self: flex-start; }
.aw-set-seg { align-self: flex-start; }
.aw-set-form { display: flex; flex-direction: column; gap: 14px; }
.aw-set-field-label { font-weight: 400; color: var(--text-dim); overflow-wrap: anywhere; }
.aw-set-field-label strong { font-weight: 600; color: var(--text-hi); }

@media (max-width: 479px) {
  .aw-set-item { flex-wrap: wrap; gap: 12px; }
  .aw-set-k { width: 92px; }
}

@media (min-width: 700px) {
  .aw-settings { align-items: center; justify-content: center; padding: 24px; }
  .aw-settings { padding-top: calc(24px + var(--win-top)); }
  .aw-set-scrim { display: block; }
  .aw-set-panel {
    width: min(920px, 100%); height: min(640px, 100%); padding: 0;
    border: 1px solid var(--border-hi); border-radius: var(--r-box);
    background: var(--surface); box-shadow: var(--shadow-pop); overflow: hidden;
    animation: aw-up var(--t-slow) var(--ease);
  }
  .aw-set-rail { display: flex; }
  .aw-set-pane { background: var(--surface); }
  .aw-set-head { min-height: 64px; padding: 0 10px 0 32px; border-bottom: 0; }
  .aw-set-body { padding: 4px 32px 28px; }
}

@media (hover: hover) {
  .aw-set-nav:hover:not([aria-current="true"]) { background: var(--hover); }
  .aw-set-legal a:hover, .aw-set-links a:hover { color: var(--text-hi); }
}

/* Settings (C4): a switch with its title on one line and the explanation
   under it at full width; both meanings of a switch; notes; status lines;
   the custom-instructions editor. From the prototype's settings-a.css. */
.aw-set-opt { display: flex; flex-direction: column; gap: 4px; }
.aw-set-opt + .aw-set-opt { margin-top: 22px; }
.aw-set-opt-head { display: flex; align-items: center; gap: 24px; min-height: 32px; }
.aw-set-opt-head .aw-switch { margin: -6px 0; }
.aw-set-opt-title { display: flex; align-items: center; flex: 1; min-width: 0; min-height: 32px; cursor: pointer; }
.aw-set-opt-text { display: flex; flex-direction: column; gap: 6px; }
.aw-set-opt-text p { margin: 0; }
.aw-set-opt-off .aw-set-opt-title { color: var(--muted); cursor: default; }
/* the meaning that applies sits in a shaded box (his request, 2026-11-17:
   weight alone was hard to tell apart); weight and text colour stay too */
.aw-set-onoff { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 0; margin: 0; }
.aw-set-onoff dt { padding: 8px 12px 8px 10px; border-radius: var(--r-chip) 0 0 var(--r-chip); font-weight: 500; color: var(--muted); }
.aw-set-onoff dd { margin: 0; padding: 8px 10px 8px 0; border-radius: 0 var(--r-chip) var(--r-chip) 0; }
.aw-set-onoff dt.aw-set-now, .aw-set-onoff dd.aw-set-now { background: var(--selected); }
.aw-set-onoff .aw-set-now { color: var(--text); }
.aw-set-onoff dt.aw-set-now { font-weight: 600; color: var(--text-hi); }
.aw-set-gk-name { color: var(--gk); font-weight: 500; }
.aw-set-note { margin-bottom: 22px; }
.aw-set-note .aw-btn { margin-top: 8px; }
.aw-set-note-after { margin: 16px 0 0; }
.aw-set-act { align-items: flex-start; }
.aw-set-act .aw-btn { margin-top: 2px; }
.aw-set-error { margin-top: 16px; }
.aw-set-install-signin { margin-top: 6px; }
/* fx-notify (the founder's device sitting, 2026-11-15): an admin's
   "Notification diagnostics" in Settings → Notifications, its lines as plain
   text that wraps (no sideways scroll on a phone); cut with the block */
.aw-set-diag {
  margin: 0; padding: 12px; max-height: 420px; overflow: auto;
  border: 1px solid var(--border-hi); border-radius: 12px;
  font-family: var(--mono); font-size: 12px; line-height: 18px; color: var(--text-dim);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.aw-set-text a, .aw-set-item-text a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.aw-set-link { display: inline-flex; align-items: center; align-self: flex-start; min-height: 44px; font-size: 15px; }
.aw-set-block { display: flex; flex-direction: column; gap: 4px; }
.aw-set-status { display: inline-flex; align-items: flex-start; gap: 6px; min-height: 20px; font-size: 14px; line-height: 20px; color: var(--muted); }
.aw-set-status > .aw-ic { margin-top: 1px; }
.aw-set-status-ok { color: var(--green); }
.aw-set-status-bad { color: var(--red); }
.aw-set-ci { height: 168px; margin-top: 4px; }
.aw-set-ci-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 4px; }
.aw-set-ci-actions .aw-btn { min-width: 96px; }

@media (max-width: 479px) {
  .aw-set-act { flex-wrap: wrap; }
  .aw-set-act .aw-set-item-main { flex-basis: 100%; }
}
.aw-line .aw-icon-slot > .aw-ic { margin-top: 1px; }

/* Settings (C5): the storage bar, filter groups and their editor sheet, plan
   and billing. From the prototype's settings-b.css. */
.aw-set-bar {
  display: flex; height: 14px;
  border: 1px solid var(--border-hi); border-radius: 7px;
  background: var(--field); overflow: hidden;
}
.aw-set-bar-seg { flex: none; height: 100%; min-width: 3px; }
.aw-set-bar-seg + .aw-set-bar-seg { border-left: 1px solid var(--surface); }
.aw-set-bar-docs { background: var(--amber); }
.aw-set-bar-saved { background: var(--muted); }  /* grey, not blue (founder 2026-11-19, D6) */
.aw-set-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; font-size: 14px; line-height: 20px; color: var(--text-dim); }
/* a legend item of the storage bar: on one line (scoped to the legend since
   R2 C17: a biometric login's row shares the class name) */
.aw-set-legend .aw-set-key { display: inline-flex; align-items: center; gap: 8px; padding-right: 10px; white-space: nowrap; }
.aw-set-legend .aw-set-key b { font-weight: 500; color: var(--text-hi); }
.aw-set-swatch { width: 10px; height: 10px; flex: none; border-radius: 3px; }
.aw-set-total { margin-left: auto; font-weight: 500; color: var(--text-hi); white-space: nowrap; }

.aw-set-fg-row { gap: 8px; padding-right: 10px; }
.aw-set-fg-row .aw-row-main { margin-right: 6px; }
.aw-set-fg-row .aw-row-title { overflow-wrap: anywhere; }
.aw-set-why { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; line-height: 20px; color: var(--text-dim); }
.aw-set-why > .aw-ic { color: var(--muted); }
.aw-set-sheet-error { flex: 0 0 100%; }

.aw-set-plan, .aw-set-plan-card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px;
  border: 1px solid var(--border-hi); border-radius: var(--r-card);
  background: var(--surface); box-shadow: var(--shadow-card);
}
.aw-set-plan-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.aw-set-plan-name { font-size: 17px; line-height: 24px; font-weight: 600; color: var(--text-hi); }
.aw-set-plan-lines { display: flex; flex-direction: column; gap: 4px; font-size: 15px; line-height: 22px; color: var(--text); }
.aw-set-plan-lines p { margin: 0; }
.aw-set-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.aw-set-plan-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; }
.aw-set-cur { flex: 1 1 250px; min-width: 0; }
.aw-set-plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.aw-set-price { display: flex; flex-direction: column; gap: 2px; }
.aw-set-amount { font-size: 22px; line-height: 28px; font-weight: 600; color: var(--text-hi); }
.aw-set-amount span { font-size: 15px; font-weight: 400; color: var(--text-dim); }
.aw-set-tax { font-size: 13px; line-height: 18px; color: var(--muted); }
.aw-set-feats { display: flex; flex-direction: column; gap: 8px; flex: 1; margin: 0; padding: 0; list-style: none; font-size: 14px; line-height: 20px; color: var(--text-dim); }
.aw-set-feats li { display: flex; align-items: flex-start; gap: 8px; }
.aw-set-feats .aw-ic { margin-top: 2px; color: var(--amber-text); }
.aw-set-notes { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 13px; line-height: 19px; color: var(--muted); }
.aw-set-notice { margin-bottom: 20px; }
.aw-set-notice-x { margin: -10px -10px -10px 0; }

@media (max-width: 479px) {
  .aw-set-plan-controls .aw-segmented { display: flex; width: 100%; }
  .aw-set-plan-controls .aw-segmented button { flex: 1; }
}
/* usage, the first block of "Usage and billing" (plan allowances part 2, D23;
   frames U1, U2; drawn by static/ui/ask.js): a label, the week's two bars
   (a line and its bar for each kind of answer, the Free day's parts: the
   landing overhaul's D1.5) or a Free account's day, the reset, two short
   boxes; then the plan part, under a rule */
.aw-usage-wrap[hidden] { display: none; }
.aw-usage-wrap:not([hidden]) ~ .aw-set-billing-body:not(:empty) { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.aw-usage { display: flex; flex-direction: column; gap: 12px; font-family: var(--sans); }
.aw-usage-label { margin: 0; font-size: 13px; line-height: 18px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.aw-usage-grade { display: flex; flex-direction: column; gap: 8px; }
.aw-usage-grade + .aw-usage-grade { margin-top: 6px; }
.aw-usage-reset { margin: 0; font-size: 14px; line-height: 20px; color: var(--text-dim); }
.aw-usage-box { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 6px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-block); }
.aw-usage-box-title { margin: 0; font-size: 15px; line-height: 21px; font-weight: 600; color: var(--text-hi); }
.aw-usage-box-text { margin: 0; font-size: 14px; line-height: 20px; color: var(--text-dim); }
.aw-usage-link {
  display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; padding: 0; border: 0; background: transparent;
  color: var(--amber-text); font-family: var(--sans); font-size: 14px; line-height: 20px; font-weight: 600; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.aw-usage-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-chip); }
@media (hover: hover) { .aw-usage-link:hover { text-decoration: underline; } }
.aw-usage-day { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; }
.aw-usage-day-left { font-size: 17px; line-height: 24px; font-weight: 600; color: var(--text-hi); }
.aw-usage-day-trial { font-size: 14px; line-height: 20px; color: var(--text-dim); }
.aw-usage-bar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.aw-usage-bar-fill { height: 8px; border-radius: 4px; background: var(--dot); }
.aw-usage-bar-fill[data-grade="standard"] { background: var(--blue); }
.aw-note-ok { border-color: var(--green-line); background: var(--green-bg); }
.aw-note-ok > .aw-ic { color: var(--green); }
.aw-ov-foot { flex-wrap: wrap; }
.aw-set-plan-change { display: flex; align-items: flex-start; gap: 8px; color: var(--text-dim); }
.aw-set-plan-change > .aw-ic { margin-top: 2px; color: var(--muted); }

/* ---------- the Documents page (C6): #page-documents, static/ui/documents.js ----------
   From the prototype's screens/documents.css with the aw- prefix. The row
   follows the width of the page column (a container query on the page). */

#page-documents { gap: 0; container: docs / inline-size; font-family: var(--sans); }
.aw-docs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding-left: 6px; }
.aw-docs-title { margin: 0; font-size: 26px; line-height: 32px; font-weight: 600; color: var(--text-hi); outline: none; }
/* the Documents page's Upload: the button's shape in a neutral colour
   (aw-btn-raised; the founder, 2026-11-17: not the main one of a choice) */
.aw-docs-upload { padding: 0 18px 0 14px; }
.aw-docs-sub {
  display: flex; flex-wrap: wrap; align-items: center; column-gap: 14px;
  padding-left: 6px; font-size: 13px; line-height: 18px; color: var(--muted);
}
.aw-docs-summary { padding: 4px 0; }
.aw-docs-link {
  display: inline-flex; align-items: center; min-height: 44px; margin: 0; padding: 0;
  border: 0; border-radius: var(--r-chip); background: transparent;
  color: var(--text-dim); font-family: var(--sans); font-size: 13px; line-height: 18px;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.aw-docs-note { margin-top: 8px; padding: 10px 12px 10px 14px; }
.aw-docs-note .aw-note-main { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.aw-docs-note .aw-note-text { flex: 1; min-width: 200px; }
.aw-docs-help { padding: 10px 6px 0; }
/* plan allowances part 3 (C17, D29): the library rule's note at the top of
   Documents, the rows' "Searchable" / "Locked" (a word and an icon; the
   chips' own colours, so no new pair), and the chooser sheet */
#docs-library[hidden] { display: none; }
.aw-docs-lib { margin-top: 10px; }
.aw-docs-lib > .aw-ic { color: var(--amber-text); }
.aw-docs-lib-now strong { font-weight: 600; color: var(--text-hi); overflow-wrap: anywhere; }
.aw-docs-lib-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.aw-docs-lib-tag[data-lib="locked"] { color: var(--muted); }
.aw-lib-intro { margin-bottom: 12px; }
.aw-lib-none { margin-bottom: 12px; }
.aw-lib-none .aw-btn { margin-top: 8px; }
.aw-lib-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.aw-lib-item { border-bottom: 1px solid var(--border); }
.aw-lib-pick {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 56px; margin: 0; padding: 8px 8px 8px 6px;
  border: 0; border-radius: var(--r-ctl); background: transparent;
  color: inherit; font-family: var(--sans); text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.aw-lib-pick:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.aw-lib-pick:disabled { cursor: default; }
.aw-lib-pick[data-current] { background: var(--amber-tint); }
.aw-lib-mark {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 24px; height: 24px; border: 1.5px solid var(--muted); border-radius: 50%; color: var(--muted);
}
.aw-lib-pick[data-current] .aw-lib-mark { border-color: var(--amber-edge); background: var(--amber); color: var(--on-amber); }
.aw-lib-pick:disabled .aw-lib-mark { border-style: dashed; }
.aw-lib-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.aw-lib-name { font-size: 15px; line-height: 21px; font-weight: 500; color: var(--text-hi); overflow-wrap: anywhere; }
.aw-lib-pick:disabled .aw-lib-name { color: var(--text-dim); }
.aw-lib-file { font-family: var(--mono); font-size: 12px; line-height: 17px; color: var(--muted); overflow-wrap: anywhere; }
.aw-lib-meta { font-size: 13px; line-height: 18px; color: var(--muted); }
.aw-lib-pick[data-current] .aw-lib-meta { color: var(--amber-text); font-weight: 600; }
.aw-lib-msg { margin-top: 12px; }
.aw-lib-msg[hidden] { display: none; }

.aw-docs-search {
  display: flex; align-items: center; gap: 10px;
  height: 44px; margin-top: 10px; padding: 0 0 0 14px;
  border: 1px solid var(--border-hi); border-radius: var(--r-ctl);
  background: var(--field); color: var(--muted);
}
.aw-docs-search:focus-within { border-color: var(--focus); }
.aw-docs-search input {
  flex: 1; min-width: 0; height: 100%; margin: 0; padding: 0;
  border: 0; outline: 0; background: transparent;
  color: var(--text-hi); font-family: var(--sans); font-size: 16px;
  appearance: none; -webkit-appearance: none;
}
.aw-docs-search input::placeholder { color: var(--muted); opacity: 1; }
.aw-docs-search input::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
.aw-docs-found { flex: none; padding-right: 12px; font-size: 13px; line-height: 18px; color: var(--muted); white-space: nowrap; }
.aw-docs-found:empty { display: none; }
.aw-docs-clear { height: 42px; margin-left: -10px; }

.aw-docs-list { margin: 12px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.aw-docs-list:empty { display: none; }
.aw-docs-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  grid-template-areas: "from from" "main more" "meta meta" "type type" "acts acts" "state state";
  column-gap: 4px;
  padding: 0 0 4px 6px;
  border-bottom: 1px solid var(--border);
}
.aw-docs-marked { margin: 4px 0; border-radius: var(--r-ctl); outline: 2px solid var(--focus); outline-offset: -2px; padding-left: 10px; }
.aw-docs-from {
  grid-area: from; display: flex; align-items: center; gap: 6px; margin: 10px 0 0;
  font-size: 13px; line-height: 18px; font-weight: 600; color: var(--amber-text);
}
.aw-docs-open {
  grid-area: main;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 12px 0 2px;
  border: 0; border-radius: var(--r-chip); background: transparent;
  color: inherit; font-family: var(--sans); text-align: left; cursor: pointer;
}
.aw-docs-name { font-size: 16px; line-height: 22px; font-weight: 500; color: var(--text-hi); overflow-wrap: anywhere; }
.aw-docs-file { font-family: var(--mono); font-size: 12.5px; line-height: 18px; color: var(--muted); overflow-wrap: anywhere; }
.aw-docs-meta { grid-area: meta; margin: 0; padding: 0 0 2px; font-size: 13px; line-height: 18px; color: var(--muted); }

.aw-docs-type {
  grid-area: type; justify-self: start;
  position: relative; display: inline-flex; align-items: center;
  max-width: 100%; height: 44px; color: var(--text-dim);
}
.aw-docs-type::before {
  content: ""; position: absolute; inset: 4px 0;
  border: 1px solid var(--border-hi); border-radius: var(--r-row); pointer-events: none;
}
.aw-docs-type select {
  position: relative; max-width: 100%; height: 44px; margin: 0; padding: 0 34px 0 12px;
  border: 0; border-radius: var(--r-row); outline: 0; background: transparent;
  color: var(--text-dim); font-family: var(--sans); font-size: 16px; line-height: 24px;
  text-overflow: ellipsis; cursor: pointer;
  appearance: none; -webkit-appearance: none;
}
.aw-docs-type select:disabled { color: var(--disabled); cursor: default; }
.aw-docs-type select option { background: var(--surface); color: var(--text-hi); }
.aw-docs-type:has(select:focus-visible)::before { outline: 2px solid var(--focus); outline-offset: 2px; }
.aw-docs-type-arrow { position: absolute; top: 50%; right: 10px; margin-top: -8px; pointer-events: none; }
.aw-docs-type-ro { grid-area: type; align-self: center; padding: 10px 0; font-size: 14px; color: var(--text-dim); }

.aw-docs-more { grid-area: more; align-self: start; margin-top: 2px; color: var(--muted); }

/* the row's chips and its button (D2.11): a wrapping line under the type
   chooser, from 600 px a column beside the size line; the explaining lines
   stay in .aw-docs-state */
.aw-docs-acts { grid-area: acts; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; min-width: 0; padding: 4px 8px 10px 0; }
.aw-docs-state {
  grid-area: state;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 2px 8px 10px 0;
}
.aw-docs-acts + .aw-docs-state { padding-top: 0; }
.aw-docs-chip {
  display: inline-flex; align-items: flex-start; gap: 8px;
  max-width: 100%; padding: 5px 10px 5px 9px;
  border: 1px solid var(--border-hi); border-radius: 8px;
  background: var(--raised); color: var(--text-dim);
  font-size: 13px; line-height: 18px; font-weight: 500;
}
.aw-docs-chip > .aw-ic { margin-top: 1px; }
.aw-docs-chip > .aw-spin { margin-top: 2px; }
.aw-docs-chip-red { border-color: var(--red-line); background: var(--red-bg); color: var(--red); }
.aw-docs-chip-amber { border-color: var(--amber-line); background: var(--amber-tint); color: var(--amber-text); }
.aw-docs-reason { max-width: 64ch; margin: 0; font-size: 14px; line-height: 20px; color: var(--text-dim); outline: none; }
.aw-docs-reason:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-chip); }

@container docs (min-width: 600px) {
  .aw-docs-row {
    grid-template-columns: minmax(0, 1fr) 218px 44px;
    grid-template-areas: "from from from" "main type more" "meta acts acts" "state acts acts";
    align-items: start; column-gap: 12px;
    padding: 6px 0 6px 6px;
  }
  .aw-docs-marked { padding-left: 10px; }
  .aw-docs-open { min-height: 48px; padding: 3px 0; }
  .aw-docs-open, .aw-docs-type, .aw-docs-type-ro { align-self: center; }
  .aw-docs-type { justify-self: stretch; }
  .aw-docs-type select { width: 100%; }
  .aw-docs-more { align-self: center; margin-top: 0; }
  .aw-docs-acts { flex-direction: column; flex-wrap: nowrap; gap: 6px; padding: 0 0 10px; }
  .aw-docs-meta { padding-bottom: 6px; }
  .aw-docs-state { padding: 0 8px 8px 0; }
}

.aw-docs-nomatch { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 20px 6px; font-size: 15px; line-height: 22px; color: var(--text-dim); }
.aw-docs-nomatch p { margin: 0; }
.aw-docs-wait {
  display: flex; align-items: center; gap: 10px;
  margin-top: 16px; padding: 20px 6px; border-top: 1px solid var(--border);
  font-size: 15px; line-height: 22px; color: var(--text-dim);
}
.aw-docs-box { margin-top: 16px; }
.aw-docs-box .aw-btn { margin-top: 8px; }
.aw-docs-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 40px 6px 0; }
.aw-docs-empty-title { margin: 0; font-size: 20px; line-height: 26px; font-weight: 600; color: var(--text-hi); }
.aw-docs-empty-text { margin: 0; font-size: 15px; line-height: 22px; color: var(--text-dim); }
.aw-docs-empty .aw-qtool-first { margin-top: 8px; }

/* the indicator: the menu's Documents row, the line under the question box */
.aw-menu-trail { flex: none; font-size: 13px; line-height: 18px; color: var(--muted); }
.aw-menu-trail-status { display: inline-flex; align-items: center; gap: 8px; color: var(--text-dim); white-space: nowrap; }
.aw-index-line { margin-top: 4px; }
.aw-index-link {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; margin: 0; padding: 0 2px;
  border: 0; border-radius: var(--r-chip); background: transparent;
  color: var(--text-dim); font-family: var(--sans); font-size: 14px; line-height: 20px;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.aw-set-manage { margin-top: 16px; }
/* R2 C8: the admin console row's chevron (same window, design §4.19 item 8) */
.aw-menu-chev { display: inline-flex; margin-left: auto; color: var(--muted); }
/* R2 C8: "Fallback test on" under the question box while an admin's answer
   service is the fallback test; the choice is in the admin console */
.aw-llm-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 6px; }
.aw-llm-line[hidden] { display: none; }
.aw-llm-link { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--sans); font-size: 14px; line-height: 20px; }
.aw-docs-note .aw-icon-slot > .aw-ic { margin-top: 1px; color: var(--muted); }

@media (hover: hover) {
  .aw-docs-open:hover .aw-docs-name { text-decoration: underline; text-underline-offset: 3px; }
  .aw-docs-link:hover, .aw-index-link:hover { color: var(--text-hi); }
  .aw-docs-type:hover::before { border-color: var(--muted); }
  .aw-docs-type:hover select { color: var(--text-hi); }
  .aw-docs-more:hover { color: var(--text-hi); }
  .aw-lib-pick:hover:not(:disabled):not([data-current]) { background: var(--hover); }
}

/* ---------- the menu's history (C7): search, the list by day, its states ---------- */

.aw-hist-search { display: flex; flex-direction: column; gap: 6px; flex: none; padding: 10px 12px 0; }
.aw-hist-field {
  display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--r-ctl);
  background: var(--field); color: var(--muted);
}
.aw-hist-field:focus-within { border-color: var(--focus); }
.aw-hist-field input {
  flex: 1; min-width: 0; height: 100%; margin: 0; padding: 0;
  border: 0; outline: 0; background: transparent;
  color: var(--text-hi); font-family: var(--sans); font-size: 16px;
  appearance: none; -webkit-appearance: none;
}
.aw-hist-field input::placeholder { color: var(--muted); opacity: 1; }
.aw-hist-field input::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
.aw-hist-scope { display: flex; align-items: center; gap: 8px; padding: 0 4px; font-size: 13px; line-height: 18px; color: var(--muted); }
.aw-hist-scope .aw-select-wrap { flex: 1; }
.aw-hist-scope select {
  width: 100%; min-width: 0; height: 44px; margin: 0; padding: 0 38px 0 10px;
  border: 1px solid var(--border); border-radius: var(--r-row); background: var(--field);
  color: var(--text); font-family: var(--sans); font-size: 16px;
  cursor: pointer; appearance: none; -webkit-appearance: none;   /* R2 C13, as .aw-select */
}
.aw-hist-scope .aw-select-arrow { right: 12px; }
.aw-hist-list { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 2px 12px 8px; overflow-y: auto; overscroll-behavior: contain; }
.aw-hist-group { display: flex; flex-direction: column; }
.aw-hist-group-title { padding: 14px 14px 4px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--muted); }
.aw-hist-item {
  display: flex; align-items: center;
  width: 100%; min-height: 44px; flex: none; margin: 0; padding: 0 14px;
  border: 0; border-radius: var(--r-ctl);
  background: transparent; color: var(--text);
  font-family: var(--sans); font-size: 15px; line-height: 20px; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.aw-hist-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Expanded (R2 C16; Settings → History and privacy → History list, per device:
   data-rows on #aw-menu-history, AW.histRows in core.js): up to two lines of
   each question, then the ellipsis; the row grows with them and never goes
   under 44 px. Compact, the default, is the one line above. The button's text
   is the whole question either way. max-height holds two lines where
   line-clamp is not supported. */
.aw-menu-history[data-rows="expanded"] .aw-hist-item { padding-top: 8px; padding-bottom: 8px; }
.aw-menu-history[data-rows="expanded"] .aw-hist-item span {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  max-height: 40px; white-space: normal; overflow-wrap: anywhere;
}
.aw-hist-item[aria-current="true"] { box-shadow: inset 0 0 0 1px var(--border-hi); background: var(--selected); color: var(--text-hi); font-weight: 600; }
.aw-hist-none { margin: 0; padding: 14px; font-size: 14px; line-height: 20px; color: var(--muted); }
.aw-hist-none p { margin: 0 0 8px; }
.aw-hist-note { margin: 10px 14px 0; font-size: 13px; line-height: 18px; color: var(--text-dim); }
.aw-hist-off {
  display: flex; flex-direction: column; gap: 6px;
  margin: 14px 0 0; padding: 14px 16px 16px;
  border: 1px solid var(--border); border-radius: var(--r-block); background: var(--bg);
}
.aw-hist-off-title { font-size: 15px; line-height: 21px; font-weight: 600; color: var(--text-hi); }
.aw-hist-off-text { font-size: 14px; line-height: 20px; color: var(--text-dim); }
.aw-hist-btn { align-self: flex-start; }
.aw-hist-off .aw-hist-btn { margin-top: 6px; }
.aw-hist-more { margin: 10px 0 0 4px; }
.aw-hist-err { margin: 8px 14px 0; }

@media (hover: hover) {
  .aw-hist-item:hover { background: var(--hover); }
  .aw-hist-item[aria-current="true"]:hover { background: var(--selected); }
}

/* ---------- focus rings ---------- */

:where(.aw-btn, .aw-icon-btn, .aw-row, .aw-menu-item, .aw-link, .aw-segmented button, .aw-menu-row, .aw-account-btn, .aw-set-nav, .aw-set-links a, .aw-set-legal a,
  .aw-docs-open, .aw-docs-link, .aw-index-link, .aw-hist-item):focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}
.aw-ov-panel:focus, .aw-ov-panel:focus-visible { outline: none; }

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  :where([class^="aw-"], [class*=" aw-"]),
  :where([class^="aw-"], [class*=" aw-"])::before,
  :where([class^="aw-"], [class*=" aw-"])::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important;
  }
  /* indexing: the pulse's ring held still round the dot, at full strength
     (the founder, 2026-11-23); it rests at 0 and only the animation draws
     it, so its opacity is set here */
  .aw-dot-pulse::after { animation: none; opacity: 1; transform: none; }
}

/* ── static/ui/ask.css ── */
/* The question screen's styles: the question box and its tools, the line under
   it, home and the recent questions, the answer card with all its blocks, the
   usage ring and the Standard label.

   Spec: docs/spec-ui-overhaul-r3-build.md.

   Colours are tokens only (static/ui/tokens.css; scripts/test_ui_tokens.py
   checks). Referenced as /static/ui/ask.css?v=<CACHE_VERSION number>. It is
   linked before the page's <style>, so a legacy rule of the page that is
   still there wins at equal specificity; a commit that rebuilds a block
   deletes that block's legacy rules (plan G5). */

/* ---------- the question box (A2; the prototype's query.css 10-64) ----------
   The box is a size container: its tool labels show when the box is wide
   enough (a container query on the box only, never on the column that holds
   the answer, so the printed card keeps the page as its containing block:
   plan A2 item 2, fact digest Q§13 item 22). */

.aw-qbox {
  container-type: inline-size; container-name: aw-qbox;
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 12px 10px;
  border: 1px solid var(--border-hi); border-radius: var(--r-box);
  background: var(--surface); box-shadow: var(--shadow-card);
}
.aw-qbox:focus-within { border-color: var(--amber-line); }
.aw-qbox-input {
  display: block; width: 100%; min-height: 26px; max-height: 208px; margin: 0; padding: 0 4px;
  border: 0; outline: 0; resize: none; overflow-y: hidden; background: transparent;
  color: var(--text-hi); font-family: var(--sans); font-size: 16px; line-height: 26px; font-weight: 400;
}
.aw-qbox-input::placeholder { color: var(--muted); opacity: 1; }
.aw-qbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.aw-qbar-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.aw-qtool {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; height: 44px; flex: none; margin: 0; padding: 0;
  border: 0; border-radius: var(--r-ctl);
  background: transparent; color: var(--text-dim);
  font-family: var(--sans); font-size: 14px; line-height: 20px; font-weight: 500;
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.aw-qtool-label { display: none; }
/* the funnel while a filter is applied (amber tint; the pressed state and
   the button's name say it too, never the colour alone) */
.aw-qtool[aria-pressed="true"] { background: var(--amber-tint); color: var(--amber-text); }
.aw-qtool-dot { position: absolute; top: 8px; right: 7px; box-shadow: 0 0 0 2px var(--surface); }
/* Upload while the account has no documents (static/ui/ask.js, data-emph;
   founder 2026-11-16): a steady ring drawn inside the button (nothing moves)
   and, once, three soft pulses of a ring outside it a second after it
   appears; under reduced motion only the steady ring. The ring and the
   no-documents prompt's words are the cue, never the colour alone. */
.aw-qtool[data-emph="on"] { box-shadow: inset 0 0 0 2px var(--amber-text); color: var(--amber-text); }
.aw-qtool[data-emph="on"]::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  opacity: 0; animation: aw-qtool-ring 1.6s ease-out 1s 3;
}
@keyframes aw-qtool-ring {
  0% { opacity: 0.7; box-shadow: 0 0 0 0 var(--amber-text); }
  100% { opacity: 0; box-shadow: 0 0 0 10px var(--amber-text); }
}
@media (prefers-reduced-motion: reduce) {
  .aw-qtool[data-emph="on"]::after { animation: none; }
}

@container aw-qbox (min-width: 560px) {
  .aw-qbar { gap: 4px; }
  .aw-qtool { padding: 0 12px 0 8px; }
  .aw-qtool-label { display: inline; }
  .aw-qtool-dot { position: static; box-shadow: none; }
}

.aw-qmode {
  display: inline-flex; align-items: center; gap: 4px;
  height: 44px; flex: none; margin: 0; padding: 0 10px 0 14px;
  border: 1px solid var(--border-hi); border-radius: var(--r-round);
  background: var(--raised); color: var(--text);
  font-family: var(--sans); font-size: 14px; line-height: 20px; font-weight: 500; white-space: nowrap;
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.aw-qmode .aw-ic { color: var(--text-dim); }
/* Ask: the amber circle with the logo's dart; grey while the box is blank or
   an answer is being produced */
.aw-qask {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: none; margin: 0; padding: 0;
  border: 1px solid var(--amber-edge); border-radius: 50%; background: var(--amber);
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.aw-qask .aw-dart-f1 { fill: var(--on-amber); }
.aw-qask .aw-dart-f2 { fill: var(--on-amber-shade); }
.aw-qask:disabled { border-color: var(--border-hi); background: var(--raised); cursor: default; }
.aw-qask:disabled .aw-dart-f1 { fill: var(--disabled); }
.aw-qask:disabled .aw-dart-f2 { fill: var(--disabled-shade); }

/* ---------- the line under the box (A2; the prototype's query.css 68-80) ---------- */

.aw-scope {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px;
  padding: 10px 6px 0;
  font-family: var(--sans); font-size: 13px; line-height: 18px; color: var(--muted);
}
.aw-scope:has(.aw-scope-chip) { padding-top: 3px; }
.aw-scope-main { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; max-width: 100%; }
.aw-scope-chip {
  display: inline-flex; align-items: center; max-width: 100%; min-width: 0; min-height: 44px;
  margin: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit;
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.aw-scope-chip .aw-chip { gap: 6px; max-width: 100%; min-width: 0; padding: 0 8px 0 12px; }
.aw-scope-chip-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.aw-scope-chip-n { flex: none; }
/* R2's indexing link sits in the line; the allowance and the fallback-test
   chip take lines of their own */
.aw-scope .aw-index-line { margin-top: 0; }
.aw-scope-quota { flex-basis: 100%; color: var(--amber-text); }
.aw-scope .aw-llm-line { flex-basis: 100%; margin-top: 0; }

/* The allowance in the line (plan allowances part 2, D20, D21; the founder's
   frames R2, R4, R6 and W1 to W4): the tip on a row of its own, and at the
   right end the ring or "See plans", its centre under the Ask button's
   (the box's border and padding and half the button: 1 + 12 + 22 px from the
   box's right edge) and level with the line's first row. The end is out of
   the flow, so the line keeps its height; the line keeps room for it. */
.aw-scope { position: relative; }
.aw-scope[data-end] { padding-right: 62px; }
.aw-scope[data-end="plans"] { padding-right: 96px; }
.aw-scope-tip { flex-basis: 100%; }
.aw-scope-tip-text[data-tone="amber"] { color: var(--amber-text); font-weight: 500; }
.aw-scope-tip-text[data-tone="blue"] { color: var(--blue); font-weight: 500; }
.aw-scope-end { position: absolute; top: -3px; right: 13px; display: flex; align-items: center; justify-content: flex-end; height: 44px; }
.aw-scope-end[hidden] { display: none; }
.aw-scope:has(.aw-scope-chip) .aw-scope-end { top: 3px; }
.aw-scope-ring {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 50%;
  background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.aw-scope-plans {
  display: inline-flex; align-items: center; min-height: 44px; margin: 0; padding: 0; border: 0;
  background: transparent; color: var(--amber-text); font-family: var(--sans); font-size: 14px; line-height: 20px;
  font-weight: 600; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
@media (hover: hover) { .aw-scope-plans:hover, .aw-used-plans:hover { text-decoration: underline; } }
/* plan allowances part 3 (C17, D29): "Change" / "Choose one" beside what the
   library rule lets a question search; a 44 px target, underlined (not a
   colour alone) */
.aw-scope:has(.aw-scope-lib) { padding-top: 3px; }
.aw-scope:has(.aw-scope-lib) .aw-scope-end { top: 3px; }
.aw-scope-lib {
  display: inline-flex; align-items: center; min-height: 44px; margin: 0; padding: 0 4px; border: 0;
  border-radius: var(--r-chip); background: transparent; color: var(--amber-text);
  font-family: var(--sans); font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.aw-scope-lib:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* the ring at the line's end, under the Ask button: the track, the arc,
   the centre dot of Standard, the bar of a used week. Express takes the
   indexing dot's amber (3:1 on the light background, where the brand amber
   is not); the dot, the bar and the words beside a ring carry the state, the
   colour only repeats it. */
.aw-ring { display: block; flex: none; }
.aw-ring-track { stroke: var(--border-hi); }
.aw-ring-arc { stroke: var(--dot); }
.aw-ring-standard .aw-ring-arc { stroke: var(--blue); }
.aw-ring-dot { fill: var(--blue); }
.aw-ring-used .aw-ring-track, .aw-ring-bar { stroke: var(--muted); }
/* the block of a week or a day that is used (frame W4), at home and for a
   refused question */
.aw-used {
  display: flex; flex-direction: column; gap: 6px; padding: 16px;
  border: 1px solid var(--border); border-radius: var(--r-block); background: var(--surface);
  font-family: var(--sans);
}
.aw-used-title { font-size: 17px; line-height: 24px; font-weight: 600; color: var(--text-hi); }
.aw-used-text { font-size: 15px; line-height: 22px; color: var(--text-dim); }
.aw-used-plans {
  display: inline; margin: 0; padding: 0; border: 0; background: transparent; color: var(--amber-text);
  font: inherit; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent;
}

/* ---------- home (A5, design C8; the prototype's query.css 84-94 and
   base.css 301-306): the allowance block, the no-documents prompt, the
   recent questions. #aw-home is shown only at home (static/ui/ask.js). No
   element here takes the class answer-card (print takes the first one). ---------- */

.aw-home { display: flex; flex-direction: column; gap: 22px; padding-top: 22px; }
.aw-home-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px 6px 0; }
.aw-home-empty-title { margin: 0; font-size: 20px; line-height: 26px; font-weight: 600; color: var(--text-hi); }
/* no width limit, and balanced lines where it must wrap: one word never sits alone on the second line (his look, 2026-11-17) */
.aw-home-empty-text { margin: 0; text-wrap: balance; font-size: 15px; line-height: 22px; color: var(--text-dim); }
.aw-home-empty .aw-qtool-first { margin-top: 8px; }
/* "Upload your first PDF" at home and on the Documents page: the question
   box's Upload tool again, in amber with its emphasis ring and its label at
   every width, so the user knows the button next time (his request,
   2026-11-17) */
.aw-qtool-first { padding: 0 12px 0 8px; color: var(--amber-text); box-shadow: inset 0 0 0 2px var(--amber-text); }
.aw-qtool-first .aw-qtool-label { display: inline; }
.aw-recent { display: flex; flex-direction: column; }
.aw-recent-label { padding: 0 6px 8px; }
.aw-recent-item {
  display: flex; align-items: flex-start; gap: 12px;
  width: 100%; min-height: 48px; margin: 0; padding: 13px 6px;
  border: 0; border-top: 1px solid var(--border); background: transparent; color: inherit;
  font-family: var(--sans); text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.aw-recent-item:last-child { border-bottom: 1px solid var(--border); }
.aw-recent-q { flex: 1; min-width: 0; font-size: 15px; line-height: 21px; color: var(--text); overflow-wrap: anywhere; }
.aw-recent-when { flex: none; padding-top: 2px; font-size: 12px; line-height: 18px; color: var(--muted); white-space: nowrap; }
.aw-recent-item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
@media (hover: hover) { .aw-recent-item:hover { background: var(--hover); } }

/* Settings → History and privacy: the line A5 adds (the page's
   renderQueryHistorySection; the prototype's settings-a.css 41-42) */
#query-history-section .aw-set-line { margin-top: 14px; font-size: 14px; line-height: 20px; color: var(--text-dim); }
#query-history-section .aw-set-line .aw-ic { color: var(--muted); }

/* ---------- the stage chip (A2 item 11): while an answer is produced or opened ---------- */

.aw-stage {
  display: none; align-items: center; gap: 10px; min-height: 44px; padding: 0 6px;
  font-family: var(--sans); font-size: 14px; line-height: 20px; color: var(--text-dim);
}
.aw-stage.show { display: flex; }

/* ---------- the custom-instructions pop-up (A2 item 6; the prototype's query.css 233-237) ---------- */

.aw-ci { display: flex; flex-direction: column; margin-top: 14px; }
.aw-ci-text { height: 168px; }
/* the device sitting (2026-11-15): the empty box's grey examples (ask.js
   CI_EXAMPLES) take six lines on a phone and seven at 320 px; a placeholder
   that does not fit is cut, not scrolled, so the phone's sheet gives the box
   room for seven (from 700 px they take five lines of the 168 px) */
@media (max-width: 699px) {
  .aw-ci-text { height: 192px; }
}
.aw-ci-note, .aw-ci-error { margin-top: 10px; }

/* ---------- focus and hover ---------- */

:where(.aw-qtool, .aw-qmode, .aw-qask, .aw-scope-chip):focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}
@media (hover: hover) {
  .aw-qtool:hover:not([aria-pressed="true"]) { background: var(--hover); color: var(--text-hi); }
  .aw-qmode:hover { background: var(--selected); }
  .aw-qask:hover:not(:disabled) { filter: brightness(1.06); }
  .aw-scope-chip:hover .aw-chip { border-color: var(--amber-text); }
}

/* ======================================================================
   The answer card (A3, design C2; the prototype's query.css 96-193 for the
   card, the check, General knowledge, the sources and the disclaimer; the
   rarer states from the same block patterns, design §4.19 item 11). The
   rules are written onto the class names the page's renderers emit
   (renderAnswer, the streamed card and the pinned helpers), new chrome on
   aw- names. Nothing here gives the card's column a transform, filter,
   contain or overflow: the reading-position code measures the document's
   scroll, and the print block (static/index.html) lays out the card's chain
   as plain blocks on paper.
   ====================================================================== */

.answer-area { display: flex; flex-direction: column; gap: 1rem; }

.answer-card { display: flex; flex-direction: column; padding: 0 4px; color: var(--text); animation: aw-ans-in 0.3s ease; }
@keyframes aw-ans-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* A card replacing a streamed preview must not fade in: that is the blank flash and a 6 px drift at the final swap. */
.answer-card.no-enter { animation: none; }
.answer-print-logo { display: none; }

/* the icons of the glyphs (static/ui/answer.js): the glyph stays in the
   text, hidden; the icon follows the size of its text */
.aw-gl { display: none; }
.answer-card .aw-ans-ic { display: inline-block; width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.28em; margin-right: 0.4em; }

/* ---------- chrome: the question line, the meta row, the notes over the body ---------- */

/* the question in quotes, no label (A3 item 1) */
.answer-card .aw-ans-q {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  margin: 0; font-size: 15px; line-height: 22px; color: var(--text-dim);
}
.answer-card .aw-ans-q .answer-question-text::before { content: "\201C"; }
.answer-card .aw-ans-q .answer-question-text::after { content: "\201D"; }
/* the streamed card has no meta row: its question line keeps a little air */
.streaming-preview .aw-ans-q { margin-bottom: 8px; }

/* date · time · mode, and the four actions */
.answer-card .answer-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; margin-right: -12px; }
.answer-card .answer-meta { font-size: 13px; line-height: 18px; color: var(--muted); }
/* the mode wraps as one piece on a narrow card */
.answer-card .aw-ans-mode { white-space: nowrap; }
.answer-card .answer-actions { display: flex; flex: none; }

/* a fallback, the storage-full note, the Sources row, the weak-match cue */
/* the line that says the second AI service wrote or checked the answer: a
   plain note with no colour of its own (the founder, 2026-11-23: landing
   overhaul D1.9); it says which service wrote the answer, not what kind of
   content it is */
.answer-card .answer-fallback-banner {
  display: flex; align-items: flex-start; gap: 2px; margin: 0 0 12px; padding: 10px 14px;
  border: 1px solid var(--border-hi); border-radius: var(--r-block); background: var(--raised);
  font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text);
}
.answer-card .answer-fallback-banner .aw-ans-ic { color: var(--text-dim); }
/* a Standard answer's label, above the answer (plan allowances part 2, D22):
   an icon, "Standard answer." in blue with words beside it, never colour
   alone; its paper line shows only in print (the page's print block) */
.answer-card .answer-grade {
  display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 14px; padding: 10px 14px;
  border: 1px solid var(--blue-line); border-radius: var(--r-block); background: var(--blue-bg);
  font-size: 14px; line-height: 20px; color: var(--text);
}
.answer-card .answer-grade > .aw-ic { flex: none; margin-top: 1px; color: var(--blue); }
.answer-card .answer-grade-main { min-width: 0; }
.answer-card .answer-grade-name { font-weight: 600; color: var(--blue); }
.answer-card .answer-grade-print { display: none; }
.answer-card .answer-grade-link {
  display: inline; margin: 0; padding: 0; border: 0; background: transparent; color: var(--amber-text);
  font: inherit; font-weight: 500; text-decoration: underline; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.answer-card .answer-grade-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-chip); }
.answer-card .answer-history-full {
  margin: 4px 0 8px; padding: 10px 14px;
  border: 1px solid var(--warn-line); border-radius: var(--r-block); background: var(--warn-bg);
  font-size: 14px; line-height: 20px; color: var(--text);
}
.answer-card .aw-ans-scope { display: flex; flex-wrap: wrap; gap: 2px 8px; margin: 0 0 8px; font-size: 13px; line-height: 18px; color: var(--muted); }
.answer-card .aw-ans-scope .answer-question-label { font-weight: 600; color: var(--text-dim); }
.answer-card .aw-ans-scope .answer-question-text { color: var(--text-dim); }
.answer-card .weak-match {
  display: flex; align-items: flex-start; margin: 0 0 10px; padding: 10px 14px;
  border: 1px solid var(--weak-border); border-radius: var(--r-block); background: var(--weak-bg);
  font-size: 14px; line-height: 20px; color: var(--weak);
}

/* ---------- the body (the model's markdown, sanitised) ---------- */

.answer-body { padding-top: 4px; border-top: 1px solid var(--border); font-size: 16px; line-height: 25px; color: var(--text); overflow-wrap: break-word; }
.answer-body > :first-child { margin-top: 12px; }
.answer-body p { margin: 8px 0 0; }
.answer-body h1, .answer-body h2, .answer-body h3, .answer-body h4 { margin: 22px 0 0; font-weight: 600; color: var(--text-hi); }
.answer-body h1 { font-size: 18px; line-height: 25px; }
.answer-body h2 { font-size: 15px; line-height: 22px; color: var(--amber-text); }
.answer-body h3 { margin-top: 16px; font-size: 16px; line-height: 25px; }
.answer-body h4 { margin-top: 14px; font-size: 15px; line-height: 22px; }
.answer-body h3 + p { margin-top: 6px; }
.answer-body ul, .answer-body ol { margin: 6px 0 0; padding-left: 22px; }
.answer-body li { margin-top: 6px; }
.answer-body li > ul, .answer-body li > ol { margin-top: 4px; }
.answer-body strong { font-weight: 600; color: var(--text-hi); }
.answer-body em { font-style: italic; }
.answer-body blockquote { margin: 10px 0 0; padding: 2px 0 2px 14px; border-left: 3px solid var(--border-hi); color: var(--text-dim); }
.answer-body hr { margin: 18px 0 4px; border: 0; border-top: 1px solid var(--border); }
/* a link of the model's; one to the app itself lost its address when it was
   sanitised (security review R3-1) and reads as the text around it */
.answer-body a[href]:not(.answer-cite) { color: var(--text-hi); text-decoration: underline; text-underline-offset: 3px; }
.answer-body code { font-family: var(--mono); font-size: 0.85em; padding: 1px 5px; border: 1px solid var(--border); border-radius: 4px; background: var(--code-bg); }
.answer-body pre { margin: 10px 0 0; padding: 12px 14px; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--pre-bg); }
.answer-body pre code { padding: 0; border: 0; background: none; font-size: 13px; }
.answer-body .table-wrap { margin: 10px 0 0; overflow-x: auto; border: 1px solid var(--border-hi); border-radius: var(--r-ctl); }
.answer-body table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.answer-body thead { background: var(--amber-wash); }
.answer-body th {
  padding: 9px 12px; text-align: left; white-space: nowrap;
  font-size: 13px; line-height: 18px; font-weight: 600; color: var(--amber-text);
  border-bottom: 1px solid var(--amber-line); border-right: 1px solid var(--border);
}
.answer-body td { padding: 9px 12px; vertical-align: top; color: var(--text); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
.answer-body th:last-child, .answer-body td:last-child { border-right: 0; }
.answer-body tbody tr:last-child td { border-bottom: 0; }
.answer-body tbody tr:nth-child(even) { background: var(--stripe); }

/* a citation chip (built by the pinned _linkifyCitations): at least 24 px
   high with a taller hit area (design §6, V6); it declares its own size,
   weight and case so it stays a chip inside an amber heading, bold text or a
   table header (3-ii §4.1); aria-current marks the page open beside it (A4) */
.answer-body a.answer-cite {
  position: relative; display: inline-block; padding: 0 6px;
  border: 1px solid var(--cite-border); border-radius: var(--r-chip); background: var(--cite-bg); color: var(--cite);
  font-family: var(--mono); font-size: 12.5px; font-style: normal; font-weight: 400; line-height: 22px;
  letter-spacing: 0; text-transform: none; text-decoration: none; white-space: nowrap; vertical-align: 1px;
}
.answer-body a.answer-cite::after { content: ""; position: absolute; inset: -9px -5px; }
.answer-body a.answer-cite[aria-current="true"] { border-color: var(--amber-edge); background: var(--amber); color: var(--on-amber); font-weight: 500; }
.answer-body a.answer-cite:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* the WARNING / CAUTION / NOTE marks (answer.js, on the text nodes) */
.answer-body .aw-dec { font-weight: 600; }
.answer-body .aw-dec-warning { color: var(--red); }
.answer-body .aw-dec-caution { color: var(--amber-text); }
.answer-body .aw-dec-note { color: var(--blue); font-weight: inherit; }
/* the line above the part of a Best judgment answer that is general knowledge */
.answer-body .gk-marker {
  display: block; margin: 1.4em 0 0.4em; padding-top: 0.8em; border-top: 2px solid var(--border-hi);
  color: var(--gk); font-size: 14px; line-height: 20px; font-weight: 600;
}
/* the blocks a correction changed, marked in place (A1 decision 15) */
.answer-body .fix-changed { box-shadow: inset 3px 0 0 var(--fix); background: var(--fix-bg); padding-left: 8px; border-radius: 2px; }
.answer-body tr.fix-changed td { background: var(--fix-bg); }
/* a screen reader hears "Changed" before a corrected block; nothing is drawn
   and the copied text is unchanged (founder 2026-11-19, D14) */
.answer-body .fix-changed:not(tr)::before { content: "" / "Changed"; }
.answer-body .fix-landing { animation: fixland 1.4s ease-out; }
@keyframes fixland { from { background-color: var(--fix-glow); } }

/* the streamed card's parts */
/* the typing caret: drawn here, the page writes no glyph for it (R3 E1) */
.stream-caret { display: inline-block; width: 0.55em; color: var(--text-dim); animation: streamblink 1s steps(2, start) infinite; }
.stream-caret::before { content: ''; display: inline-block; width: 0.375em; height: 1em; vertical-align: -0.19em; background: currentColor; }
@keyframes streamblink { 0% { opacity: 1; } 50% { opacity: 0; } }
.stream-retry-note { margin: 12px 0 10px; font-size: 14px; line-height: 20px; color: var(--text-dim); }
.verify-pending { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 12px; font-size: 14px; line-height: 20px; color: var(--text-dim); }
.verify-secs { margin-left: auto; font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.pace-hidden { visibility: hidden; }

/* ---------- the notes under the body, the checks, the jump chips ---------- */

/* cut short or declined (amber: a half procedure is a safety matter) */
.answer-card .answer-note {
  display: flex; align-items: flex-start; margin-top: 16px; padding: 12px 14px;
  border: 1px solid var(--warn-line); border-radius: var(--r-block); background: var(--warn-bg);
  font-size: 14px; line-height: 20px; color: var(--text);
}
.answer-card .answer-note .aw-ans-ic { color: var(--amber-text); }

/* the automatic check: the typed block, the untyped one, the quiet one */
.answer-card .verification-warning, .answer-card .verify-quiet, .answer-card .answer-corrected, .answer-card .answer-checked {
  margin-top: 16px; padding: 14px 16px; border: 1px solid var(--warn-line); border-radius: var(--r-block); background: var(--warn-bg);
  font-size: 15px; line-height: 23px; color: var(--text);
}
.answer-card .verification-warning:not(.typed) { display: flex; align-items: flex-start; }
.answer-card .verification-warning .aw-ans-ic, .answer-card .verify-title .aw-ans-ic { color: var(--amber-text); }
.answer-card .verify-title { font-weight: 600; color: var(--text-hi); }
.answer-card .verify-lead { margin-top: 8px; }
.answer-card .verification-warning ul, .answer-card .verify-quiet ul, .answer-card .answer-corrected ul { margin: 8px 0 0; padding: 0; list-style: none; }
.answer-card .verification-warning li, .answer-card .verify-quiet li, .answer-card .answer-corrected li { margin-top: 8px; }
.answer-card .verify-type {
  display: inline-block; margin-right: 8px; padding: 0 8px;
  border: 1px solid var(--warn-line); border-radius: var(--r-chip); background: var(--warn-chip);
  font-size: 12.5px; line-height: 20px; font-weight: 600; color: var(--amber-text);
}
.answer-card .verify-minor-item { color: var(--text-dim); }
.answer-card .verify-minor-tag {
  display: inline-block; margin-right: 8px; padding: 0 6px; border: 1px solid var(--border-hi); border-radius: var(--r-chip);
  font-size: 11.5px; line-height: 18px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
}
.answer-card .verify-pointer { display: block; margin-top: 2px; font-size: 13px; line-height: 19px; color: var(--text-dim); }
/* minor or unverified points only: neutral, not a warning (A10) */
.answer-card .verify-quiet { border-color: var(--weak-border); background: var(--weak-bg); color: var(--weak); }
.answer-card .verify-quiet .verify-title, .answer-card .verify-quiet .verify-title .aw-ans-ic { color: var(--weak); }
/* the fold of the quiet points (corrections decision 14): a button whose
   chevron turns when it opens */
.answer-card .verify-fold-toggle {
  display: flex; align-items: center; gap: 4px; width: 100%; min-height: 44px; margin: -10px 0; padding: 0;
  border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.answer-card .verify-fold-toggle .verify-title { flex: 1; min-width: 0; }
.answer-card .verification-warning .verify-fold, .answer-card .verify-quiet.verify-fold { margin-top: 10px; }
.answer-card .verify-fold.collapsed > ul { display: none; }
.verify-fold-caret .aw-ans-ic, .sources-tri .aw-ans-ic { margin: 0; transition: transform var(--t-fast); }
.verify-fold-toggle[aria-expanded="true"] .verify-fold-caret .aw-ans-ic,
.sources-toggle[aria-expanded="true"] .sources-tri .aw-ans-ic { transform: rotate(90deg); }
/* corrected after the check, or checked and kept as written (green) */
.answer-card .answer-corrected, .answer-card .answer-checked { border-color: var(--fix-border); background: var(--fix-bg); }
.answer-card .answer-checked { display: flex; align-items: flex-start; color: var(--text); }
.answer-card .answer-corrected .verify-title .aw-ans-ic, .answer-card .answer-checked .aw-ans-ic { color: var(--fix); }
.answer-card .answer-corrected .verify-type { border-color: var(--fix-border); color: var(--fix); background: none; }
/* "Jump to first change": a button inside the title's line, 44 px high
   without growing the line */
.answer-card .fix-jump {
  display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin: -11px 0; padding: 0 2px;
  border: 0; background: none; color: var(--fix); font: inherit; font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px; vertical-align: middle; cursor: pointer;
}
.answer-card .fix-jump .aw-ic { width: 16px; height: 16px; }
.answer-card .answer-corrected.pulse { animation: fixpulse 0.9s ease-in-out 2; }
@keyframes fixpulse { 0%, 100% { box-shadow: none; } 50% { box-shadow: 0 0 0 3px var(--fix-glow); } }
.answer-card .verification-warning.pulse { animation: verifypulse 0.9s ease-in-out 2; }
@keyframes verifypulse { 0%, 100% { box-shadow: none; } 50% { box-shadow: 0 0 0 3px var(--warn-glow); } }
/* the chip at the top of a card whose warning (or correction) arrived after
   the text was read (D2): a button to it */
.answer-card .verify-jump {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; min-height: 44px; margin: 0 0 12px; padding: 0 14px;
  border: 1px solid var(--warn-line); border-radius: var(--r-ctl); background: var(--warn-bg-lo); color: var(--amber-text);
  font-family: var(--sans); font-size: 14px; line-height: 20px; font-weight: 500; cursor: pointer;
}
.answer-card .verify-jump.fix { border-color: var(--fix-border); background: var(--fix-bg); color: var(--fix); }

/* ---------- General knowledge (purple) and the Interpretation (teal): not from the documents ---------- */

.answer-card .gk-section, .answer-card .interp-section {
  display: flex; flex-direction: column; gap: 10px; margin-top: 16px; padding: 14px 16px;
  border: 1px solid var(--gk-line); border-radius: var(--r-block); background: var(--gk-bg);
}
.answer-card .gk-section-title { font-size: 15px; line-height: 22px; font-weight: 600; color: var(--gk); }
.answer-card .gk-section-title .aw-ans-ic { color: var(--gk); }
.answer-card .gk-section-body { font-size: 16px; line-height: 25px; color: var(--text); }
.answer-card .gk-section-body > :first-child { margin-top: 0; }
.answer-card .gk-section-body p { margin: 8px 0 0; }
.answer-card .gk-section-body ul, .answer-card .gk-section-body ol { margin: 6px 0 0; padding-left: 22px; }
/* the model's headings inside General knowledge and the Interpretation: the
   answer's sizes and spacing (the founder, 2026-11-23: landing overhaul
   D1.10); they had no rule and were the browser's (24 and 18.7 px). Not the
   answer's amber h2, which marks its own sections */
.answer-card .gk-section-body h1, .answer-card .gk-section-body h2,
.answer-card .gk-section-body h3, .answer-card .gk-section-body h4 { margin: 22px 0 0; font-weight: 600; color: var(--text-hi); }
.answer-card .gk-section-body h1 { font-size: 18px; line-height: 25px; }
.answer-card .gk-section-body h2 { font-size: 15px; line-height: 22px; }
.answer-card .gk-section-body h3 { margin-top: 16px; font-size: 16px; line-height: 25px; }
.answer-card .gk-section-body h4 { margin-top: 14px; font-size: 15px; line-height: 22px; }
.answer-card .gk-conflict { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--amber-text); }
.answer-card .gk-warning { display: flex; align-items: flex-start; font-size: 13px; line-height: 19px; color: var(--text-dim); }
.answer-card .gk-warning .aw-ans-ic { color: var(--gk); }
.answer-card .interp-checking { font-size: 13px; line-height: 19px; color: var(--text-dim); }
/* the Interpretation in teal (the founder, 2026-11-23: landing overhaul D1.1):
   it reuses the General knowledge classes for its parts, so its own colours
   come after theirs, scoped to the block; its words keep theirs */
.answer-card .interp-section { border-color: var(--interp-line); background: var(--interp-bg); }
.answer-card .interp-section .gk-section-title,
.answer-card .interp-section .gk-section-title .aw-ans-ic,
.answer-card .interp-section .gk-warning .aw-ans-ic { color: var(--interp); }
/* the offer of an Interpretation under a Best judgment answer */
.answer-card .interp-ask { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 16px; }
.answer-card .interp-ask .aw-btn { white-space: normal; text-align: left; }
.answer-card .interp-ask-note { font-size: 13px; line-height: 19px; color: var(--text-dim); }
.answer-card .interp-ask-status { font-size: 14px; line-height: 20px; color: var(--amber-text); }

/* ---------- the sources (the pinned _sourcesPanelHtml's markup) ---------- */

.answer-card .sources { margin-top: 20px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.answer-card .sources-toggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 52px; margin: 0; padding: 0 2px;
  border: 0; background: transparent; color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 20px; font-weight: 500;
  text-align: left; cursor: pointer;
}
.answer-card .sources-tri { display: inline-flex; color: var(--muted); }
.answer-card .sources-list { display: flex; flex-direction: column; padding-bottom: 6px; }
.answer-card .sources.collapsed .source-item { display: none; }
.answer-card .source-item { display: flex; align-items: flex-start; gap: 12px; min-height: 52px; padding: 8px 2px; border-top: 1px solid var(--border); }
.answer-card .source-num { flex: none; width: 20px; padding-top: 2px; font-family: var(--mono); font-size: 12.5px; line-height: 20px; color: var(--muted); }
.answer-card .source-link { display: flex; flex-direction: column; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.answer-card .source-section { font-size: 15px; line-height: 21px; color: var(--text); }
.answer-card .source-meta { display: flex; flex-wrap: wrap; gap: 0 8px; font-size: 13px; line-height: 18px; color: var(--muted); }
.answer-card .source-file { min-width: 0; overflow-wrap: anywhere; }
.answer-card .source-page { color: var(--amber-text); }
/* the file name under the shown name when the two differ (A4 item 7,
   answer.js), as the Documents page writes it */
.answer-card .aw-src-file { display: block; font-family: var(--mono); font-size: 12.5px; line-height: 18px; color: var(--muted); overflow-wrap: anywhere; }
/* the row of the page open beside the answer (A4 item 3, founder decision 9) */
.answer-card .source-item[aria-current="true"] .source-section { color: var(--amber-text); font-weight: 500; }

/* the disclaimer: on every answer, never dismissable */
.answer-card .answer-disclaimer { display: flex; align-items: flex-start; padding: 16px 0 8px; font-size: 13px; line-height: 19px; color: var(--text-dim); }
.answer-card .answer-disclaimer .aw-ans-ic { color: var(--muted); }

/* ---------- the error and limit blocks of the answer area (A3 item 6): R2's note ---------- */

.aw-block .aw-note-main .aw-btn { margin-top: 8px; }

/* ---------- focus, hover, motion ---------- */

:where(.answer-card .verify-jump, .answer-card .fix-jump, .answer-card .sources-toggle, .answer-card .verify-fold-toggle,
  .answer-card .source-link):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (hover: hover) {
  .answer-body a.answer-cite:hover { border-color: var(--amber-text); }
  .answer-card .sources-toggle:hover, .answer-card .source-item:hover { background: var(--hover); }
  .answer-card .source-link:hover .source-section { text-decoration: underline; text-underline-offset: 3px; }
  .answer-card .verify-jump:hover { filter: brightness(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .answer-card, .stream-caret, .answer-card .verification-warning.pulse, .answer-card .answer-corrected.pulse,
  .answer-body .fix-landing { animation: none; }
}
.aw-scope-ring:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; }
.aw-scope-plans:focus-visible, .aw-used-plans:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-chip); }

/* ── static/ui/sources.css ── */
/* The source pane's styles: its header, the viewer's frame, the print
   progress, and where the pane sits by window size (covering, docked, beside
   or expanded).

   Spec: docs/spec-ui-overhaul-r3-build.md.

   From the prototype's query.css (.src-*) and shell.css (.aw-source) with
   the aw-src- prefix. Colours are tokens only (static/ui/tokens.css;
   scripts/test_ui_tokens.py checks). Referenced as
   /static/ui/sources.css?v=<CACHE_VERSION number>. */

/* the sizes (R3 plan B2 item 1): the docked height (sources.js sets it on
   #app on each first open in a 700-1079 px window), the width beside the
   answer (60 % of the space the menu leaves, 600-1100 px) and the menu's
   share of that space: its width from 1800 px while it is shown, else 0 */
#app {
  --aw-sb-shown: 0px;
  --aw-source-h: 55vh;
  --aw-source-w: clamp(600px, calc((100vw - var(--aw-sb-shown)) * 0.6), 1100px);
}
@supports (height: 1dvh) {
  #app { --aw-source-h: 55dvh; }
}
@media (min-width: 1800px) {
  #app:not(.aw-menu-hidden) { --aw-sb-shown: var(--sidebar-w); }
}

/* the open pane covers the window under 700 px, and at any width while
   expanded (#app.aw-src-full): above the menu, padded by the four safe areas.
   #app[data-source="open"] is set by sources.js; [hidden] keeps it out of the
   page while closed. No transform, filter, contain or overflow lands on #app,
   #aw-col or #aw-main (the printed card and the reading position need them
   plain; app.css). */
.aw-source {
  position: fixed; inset: 0; z-index: var(--z-source-full);
  display: flex; flex-direction: column;
  padding: var(--top-t) var(--safe-r) var(--safe-b) var(--safe-l);
  background: var(--surface); color: var(--text);
  font-family: var(--sans);
}
/* its scroll lock while it covers the window (the overlay stack owns aw-lock) */
html.aw-src-lock { overflow: hidden; }

/* the header: the document's title over its page; Expand and Close. (The
   left gap once kept for the installed iPad app's window buttons, --win-inset,
   was 0 from 2026-11-16 and went on 2026-11-19, design reference D11.) */
.aw-src-head {
  display: flex; align-items: center; gap: 12px;
  height: 60px; flex: none; padding: 0 8px 0 18px;
  border-bottom: 1px solid var(--border); color: var(--text-dim);
}
.aw-src-title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.aw-src-name {
  overflow: hidden; font-size: 15px; line-height: 20px; font-weight: 600;
  color: var(--text-hi); text-overflow: ellipsis; white-space: nowrap;
}
.aw-src-page { font-size: 13px; line-height: 18px; color: var(--muted); }
.aw-src-expand { display: none; }

@media (min-width: 700px) {
  /* 700-1079 px: docked at the bottom, full width; the column makes room */
  #app:not(.aw-src-full) > .aw-source {
    inset: auto 0 0 0; z-index: var(--z-source);
    height: var(--aw-source-h);
    padding-top: 0;
    border-top: 1px solid var(--border-hi);
    box-shadow: var(--shadow-pop);
  }
  #app:not(.aw-src-full) > .aw-source .aw-src-head { padding-left: 18px; }
  #app[data-source="open"] > .aw-col { padding-bottom: var(--aw-source-h); }
  .aw-src-expand { display: inline-flex; }
}
@media (min-width: 1080px) {
  /* from 1080 px: beside the answer, the column keeps the rest */
  #app:not(.aw-src-full) > .aw-source {
    inset: 0 0 0 auto; width: var(--aw-source-w); height: auto;
    padding-top: var(--top-t); padding-left: 0;
    border-top: 0; border-left: 1px solid var(--border);
    box-shadow: none;
  }
  #app[data-source="open"] > .aw-col { margin-right: var(--aw-source-w); padding-bottom: 0; }
}

/* the body: the viewer's frame, or the spinner, or a message */
.aw-src-body { position: relative; flex: 1; min-height: 0; background: var(--viewer); }
/* the rule that keeps a pinch in the viewer from zooming the app page is set
   inside the frame, on the viewer's scroll containers (static/pdfjs-ios-pinch.js):
   WebKit does not apply an iframe element's touch-action to the frame's
   content, so the frame element carries none */
.aw-src-frame { display: block; width: 100%; height: 100%; border: 0; }
.aw-src-wait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.aw-src-msg {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; overflow-y: auto;
}
.aw-src-note { width: min(100%, 440px); }
.aw-src-note .aw-btn { margin-top: 8px; }
.aw-src-note .aw-note-text { margin: 0; color: var(--text); }

/* a print's progress in the header (run fx-print): a spinner beside Expand /
   Shrink (Close under 700 px), the words, Cancel; made by sources.js. The
   title gives way first; under reduced motion the spinner stands still
   (app.css) and the words carry the state. */
.aw-src-prog { display: flex; align-items: center; gap: 8px; flex: none; min-width: 0; }
.aw-src-prog[hidden] { display: none; }
.aw-src-prog-text {
  font-size: 13px; line-height: 18px; color: var(--text-dim);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.aw-src-prog-cancel { padding: 0 12px; }
