/* The theme, in one place for all four pages.
 *
 * Every page carried an identical `:root` block, so a colour change meant four
 * edits and a theme was impossible. They now link this instead, and switching
 * is setting `data-theme` on <html> - which ui/theme.mjs and theme-boot.js do,
 * and persists.
 *
 * The variable NAMES are the contract. A theme may only re-point them; any
 * page rule that hardcodes a colour instead of using one of these will not
 * follow the theme, which is the single rule to keep when editing the pages.
 *
 * Typography is shared rather than themed: the scale below is what gives the
 * pages a consistent voice, and a theme that changed it would look like a
 * different product rather than the same one in different clothes.
 *
 * The values are Nordic's Blueprint Design System (Figma, "Blueprint Design
 * System UI Library"), read from its variables.
 */

/* GT Eesti Display, Nordic's typeface, under Nordic's web licence: the
   foundry's WOFF2 web files, served unmodified, as the licence requires.
   Blueprint sets everything in two cuts, Light and Regular, and no italics, so
   these are the only two files. A weight above 400 is not asked for anywhere
   in the chat page; the browser would synthesise it from Regular. `swap`
   shows the fallback sans until the file has loaded. */
@font-face { font-family: "GT Eesti Display"; font-weight: 300; font-style: normal;
             font-display: swap; src: url("assets/gt-eesti-display-light.woff2") format("woff2"); }
@font-face { font-family: "GT Eesti Display"; font-weight: 400; font-style: normal;
             font-display: swap; src: url("assets/gt-eesti-display-regular.woff2") format("woff2"); }
/* PragmataPro Regular, the code face Blueprint uses, from Nordic's design
   resources: the web file unmodified, as its licence requires, and only
   through @font-face. Not preloaded: at 1.9 MB it is fetched only when a page
   shows code. */
@font-face { font-family: "PragmataPro"; font-weight: 400; font-style: normal;
             font-display: swap; src: url("assets/pragmatapro-regular.woff2") format("woff2"); }

/* Version 1.010's contextual alternates rewrote technical text: "sht4x" became
   "sht4×", "MITM" "MI™" and "(1)" a circled digit. 2.000 does not, but keeps the
   feature, so it stays off: a later file must not bring the rewriting back.
   Important, because every `font:` shorthand in the pages would otherwise
   reset it to normal. */
*, *::before, *::after { font-variant-ligatures: no-contextual !important; }
/* Code and identifiers, in --mono: every ligature off as well, so "->", "!="
   and "//" read as typed. PragmataPro has no standard ligatures and its
   contextual alternates (which rewrite "MITM") are off above, so a --mono rule
   missing from this list still reads as typed. */
code, pre, kbd, samp, .pp-name, .pp-table thead th, .pcard[data-section="Pins"] .phint,
.pcount, .gs-meta, .gc-meta, .pin-bus, .pin-pad, .srow .sm,
.srow .bus, header .engine, .issue { font-variant-ligatures: none !important; }

:root {
  /* ── Type ── */
  /* Nordic's typefaces, served from ui/assets (the @font-face rules above). */
  --mono: "PragmataPro", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: "GT Eesti Display", "Segoe UI Variable Text", system-ui, -apple-system,
          "Segoe UI", Roboto, sans-serif;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  /* The wordmark, separately themeable from body text, so a theme built on
     another face can say so without naming a face in `.brand h1`. */
  --display: var(--sans);
  --display-weight: var(--fw-regular);
  --display-track: 0;
  /* The type scale the owner approved on 12 Nov, on Blueprint's two weights
     and with letter-spacing 0 and no uppercase: one size and leading pair per
     role, in rem (1rem = 16px) so browser zoom and the user's font size apply.
     Phones (below 600px) step up, in the media rule after :root. On 16 Nov
     (T74) the owner changed three of its steps to Blueprint's: Medium and
     Large button labels are 16/21 (--font-btn; Small stay 14/19), the
     dialog title is 26/32 (24/30 on a phone), and a hint is 14/19 Light
     (--font-help, Blueprint's help text) in place of 12/16 Regular, so Light
     is no longer only for 15px and up. */
  --fs-prose: .9375rem;  --lh-prose: 1.375rem;    /* 15/22: chat text, fields, dialog text */
  --fs-label: .875rem;   --lh-label: 1.1875rem;   /* 14/19: Small buttons, chips, rows */
  --fs-hint: .75rem;     --lh-hint: 1rem;         /* 12/16: badges and tags, the dashboard */
  --fs-help: .875rem;    --lh-help: 1.1875rem;    /* 14/19 Light: hints and notes */
  --fs-title: 1.625rem;  --lh-title: 2rem;        /* 26/32: dialog titles */
  --fs-heading: 1rem;    --lh-heading: 1.3125rem; /* 16/21: headings in dialogs, the app name */
  --fs-code: .8125rem;   --lh-code: 1.1875rem;    /* 13/19: code and identifiers */
  --fw-light: 300; --fw-regular: 400;
  /* The roles as `font` values. */
  --font-h3: var(--fw-light) var(--fs-title)/var(--lh-title) var(--sans);
  --font-h5: var(--fw-regular) var(--fs-heading)/var(--lh-heading) var(--sans);
  --font-prose: var(--fw-light) var(--fs-prose)/var(--lh-prose) var(--sans);
  --font-body-lg: var(--fw-light) var(--fs-prose)/var(--lh-prose) var(--sans);
  --font-label-lg: var(--fw-regular) var(--fs-label)/var(--lh-label) var(--sans);
  /* A chip's label, Label/Regular/Large 16/21 (node 13264:61995), the same on a phone. */
  --font-chip: var(--fw-regular) 1rem/1.3125rem var(--sans);
  --font-hint: var(--fw-regular) var(--fs-hint)/var(--lh-hint) var(--sans);
  --font-help: var(--fw-light) var(--fs-help)/var(--lh-help) var(--sans);
  /* The label of a Medium or Large button, Label/Regular 16/21 (node 40002102:31963),
     the same on a phone. */
  --font-btn: var(--fw-regular) 1rem/1.3125rem var(--sans);
  /* The header (T78; Secondary navigation, node 40002266:1761): the product name
     in black for products at 24/31 Regular, 22/29 on a phone (base.css), and its
     text items in Body/Large/Light 16/21; the subtitle stays at 12/16. */
  --fs-name: 1.5rem; --lh-name: 1.9375rem; --header-name: #1c2227;
  --font-nav: var(--fw-light) 1rem/1.3125rem var(--sans);
  /* How far a 16px header icon is lifted so its centre is on the centre of the
     label's capital letters (T92). GT Eesti has its baseline 0.25em under the
     middle of the line box and its capitals 0.70em tall (OS/2: typo ascender
     750, descender -250, cap height 700, 1000 units per em), so the capitals'
     centre is 0.10em = 1.6px above the box centre at 16px. The browser then
     snaps the label's baseline and the icon to whole pixels, half a pixel apart
     in the bar and in the phone menu; 2.5px is the lift that leaves the icon
     level with the letters in both (measured 1x to 4x, T92 notes). */
  --icon-lift: 2.5px;
  --font-note: var(--fw-regular) .75rem/1rem var(--sans);
  --font-code: var(--fw-regular) var(--fs-code)/var(--lh-code) var(--mono);
  /* Blueprint's spacing scale (Semantic/Small-0,5 to Medium-2, then the larger
     Foundation steps). */
  --space-s05: 2px;
  --space-s1: 4px; --space-s2: 8px; --space-s3: 12px; --space-s4: 16px;
  --space-s5: 20px; --space-s6: 24px; --space-s7: 28px; --space-m1: 32px; --space-m2: 40px;
  --space-m3: 40px; --space-m4: 48px; --space-m5: 48px; --space-l1: 64px;
  --space-l2: 80px; --space-l3: 96px; --space-l4: 128px;
  /* Blueprint's corners (Corner Radius): controls and cards are square, an
     in-line notification is 4, a modal 8, a badge fully round. A chat bubble
     has no Blueprint component; it takes 4, a local exception. `--radius` is a
     card or control and `--radius-sm` something inline. */
  --radius: 0; --radius-sm: 0; --radius-pill: 999px; --radius-bubble: 4px;
  --radius-notice: 4px; --radius-modal: 8px;
  /* Border as one value, so a theme can change its WEIGHT and not just its
     colour. The reference design that prompted this is all hairlines. */
  --border: 1px solid var(--line);

  /* ── Nordic (the default, and for now the only theme) ──
     Blueprint's colour variables: white surfaces on Light Grey hairlines,
     Nordic Blue for primary actions and selection, Nordic Lake for links and
     secondary actions, Nordic Dark Grey for text, flat and square.
     Fill/Base and Background/Primary #ffffff (the page is white too),
     Fill/Neutral #f0f3f3, Border/Secondary #d9e1e2, Content/Primary #333f48,
     Content/Secondary #6f787e, Button/Fill/Primary-Default #00a2c6,
     Content/Supportive #0077c8, Button/Fill/Flat-Default-Hover #e5f1fa.
     --ok, --warn and --err are darker than Blueprint's status colours, which
     are badge fills and icons, so that they pass as text on white and on
     their own pale grounds. */
  --bg: #ffffff; --surface: #ffffff; --surface2: #f0f3f3; --line: #d9e1e2;
  --fg: #333f48; --muted: #6f787e; --faint: #999ea4;
  --accent: #00a2c6; --accent-strong: #0077c8; --accent-soft: #e5f1fa;
  --ok: #3c8a2e; --ok-soft: #eef6e7; --warn: #b8620f; --warn-soft: #fff4dc;
  --err: #c22b4a; --err-soft: #fbe8ec;
  /* Blueprint's error red and its in-line notification ground (node 40002739:7759):
     the red is the icon's and, on white only, 4.79:1, a line's text; on the
     pink ground it is 3.69:1, enough for an icon and not for text, so the
     message there is in the normal ink. The Major notification ground is the
     offline notice's. */
  --err-strong: #e40046; --err-fill: #fcd9e4; --warn-fill: #feecde;
  /* Buttons: the focus border (Button/Border/Focus) and the disabled fill and
     text (Button/Fill/Disabled, Content/Disabled). Primary buttons are solid:
     the product owner dropped Blueprint's diagonal slice on 16 Nov (T77). */
  --focus: #0032a0; --on-accent: #ffffff;
  --disabled-bg: #d9e1e2; --disabled-fg: #9eaab2;
  /* A text field's focus: Input's 2px Nordic Blue border, drawn inside the
     1px border so the field does not move. */
  --focus-field: inset 0 0 0 1px var(--accent);
  /* A neutral icon button under the pointer (Button/Fill/Flat-Subtle-Hover). */
  --hover-neutral: #eaebec;
  /* A text area's resting border (Color/Border/Secondary-Inverse), where a
     hairline is 1.33:1 on white and this is 4.5:1; the Information fill that
     an answer chip rests on (Color/Fill/Information); and the shadow of a bar
     that sticks to the foot of a dialog (Shadow/Sticky CTAs). */
  --field-line: #6f787e;
  --info-fill: #f0fbfc;
  --shadow-sticky: 0 -4px 16px #00000014;
  /* Button heights (Core: Buttons): Small, Medium and Large. */
  --btn-h-sm: 32px; --btn-h: 40px; --btn-h-lg: 48px;
  /* Behind a modal (Overlay/Dark). */
  --overlay: #0000002b;
  /* Borders for status boxes, derived so every theme gets its own. */
  --ok-line: color-mix(in srgb, var(--ok) 25%, var(--surface));
  --warn-line: color-mix(in srgb, var(--warn) 30%, var(--surface));
  --err-line: color-mix(in srgb, var(--err) 25%, var(--surface));
  /* Flat: Blueprint separates surfaces by hairlines, not depth, and its cards
     and modals carry no shadow; the overlay sets a modal apart. Kept as a
     transparent shadow rather than `none` so a rule that adds to it still
     parses. */
  --shadow: 0 0 0 transparent;
  --shadow-modal: var(--shadow);
  /* The dark code panel and scrollbars, which base.css painted in the old
     warm browns. The panel is the reference's dark chip colour. */
  --code-bg: #333f48; --code-line: #47515a; --code-fg: #eaebed;
  --scroll-thumb: #c9ced4;
  /* The ground behind the header, which every page draws identically. A
     variable of its own so a theme can give the header a different tone from
     the working area below it; by default it is the page ground. */
  --header-bg: var(--bg);
  /* Header chrome can diverge from the page below it, for example a dark band.
     These alias the page tokens by default so existing header rules keep
     working until a theme re-points them. */
  --header-fg: var(--fg);
  --header-muted: var(--muted);
  --header-faint: var(--faint);
  --header-warn: var(--warn);
  --header-chrome-line: var(--line);
  --header-chrome-surface: var(--surface);
  --header-chrome-surface2: var(--surface2);
  /* The project column on the chat page; a variable so a theme can tint the
     panel without a literal in a page rule. */
  --panel-bg: var(--bg);
  /* The AI mark is a dark chip with the glyph knocked out of it; the source
     asset is black-on-white and inverted, so this wants to be near-black. */
  --ai-chip: #333f48;
}

/* Phones: text a step larger, the dialog title a step smaller. Fields stay at
   16px or more here, as iOS Safari zooms into a field set smaller. */
@media (max-width: 599px) {
  :root { --fs-prose: 1rem; --lh-prose: 1.5rem; --fs-label: .9375rem; --lh-label: 1.25rem;
          --fs-hint: .8125rem; --lh-hint: 1.125rem; --fs-title: 1.5rem; --lh-title: 1.875rem;
          --fs-code: .875rem; --lh-code: 1.25rem; }
}

/* The product subtitle, beside the wordmark. Shared rather than copied into
   each page's <style>, where `.brand` itself still lives in four copies - a
   rule maintained in four places is a rule that will differ in four places.

   Secondary to the wordmark: body text in Light, header foreground ink.
   It sits inside `.brand` after the wordmark, not in the nav row where the old
   pipeline tagline competed for width — and the header has room for it now that
   the tagline and Nordic plate are gone. */
.brand .sub { font: var(--font-note); color: var(--header-fg); white-space: nowrap;
              margin-left: var(--space-s3); padding-left: var(--space-s3);
              border-left: 1px solid var(--header-chrome-line); }

header { color: var(--header-fg); }

/* The header's development controls, behind the cog (see ui/headtools.mjs for
   which ones and why the offline badge is not among them). Here rather than in
   a page's own <style> because the header is copied into all four, and a rule
   maintained in four places is a rule that will differ in four places.

   `display: none` rather than visibility or a zero width: the row is a flex
   container, so anything that leaves a box behind leaves its gap behind too,
   and the point is a header with nothing in it. */
.headtools { display: none; align-items: center; gap: 10px; }
/* `flex` and not `inline-flex`: the group is itself a flex item of
   `.head-right`, and a flex item's display is blockified - `inline-flex` would
   compute to `flex` anyway and only make the declaration read as a lie. */
.head-right[data-tools="on"] .headtools { display: flex; }
/* Last in the row and after the collapsible group, so the cog is the
   rightmost thing in the header on every page regardless of what that page
   put in the row. */
.headcog { display: inline-flex; align-items: center; justify-content: center;
           margin-left: 4px; width: var(--btn-h-sm); height: var(--btn-h-sm); padding: 0;
           border: 1px solid transparent; border-radius: var(--radius);
           background: none; color: var(--header-muted); cursor: pointer; }
/* Hidden until the user is known to be an admin (ui/headtools.mjs); the rule
   above sets a display, which would otherwise win over the attribute. */
.headcog[hidden] { display: none; }
.headcog:hover { color: var(--accent-strong); background: var(--hover-neutral); }
.headcog[aria-expanded="true"] { color: var(--accent-strong);
                                 border-color: var(--header-chrome-line);
                                 background: var(--header-chrome-surface2); }
/* Focus has to be visible on its own: the hover and expanded states both
   change colour, so colour alone cannot say "focused". */
.headcog:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
/* Who is signed in (ui/headtools.mjs): inside the cog's group, and quiet. */
.whoami { font: var(--font-hint); color: var(--header-muted); white-space: nowrap; }
/* Sign out, beside the name: a link to Easy Auth's route, drawn as a button. */
.sign-out { display: inline-flex; align-items: center; padding: 4px 11px;
            border: 1px solid var(--header-chrome-line); border-radius: var(--radius);
            background: var(--header-chrome-surface); color: var(--header-fg);
            font: var(--font-label-lg); white-space: nowrap; text-decoration: none; cursor: pointer; }
.sign-out:hover { border-color: var(--accent); color: var(--accent-strong); }
.sign-out:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (forced-colors: active) {
  .sign-out { border-color: ButtonText; }
}
/* Read by a screen reader, not drawn. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden;
           clip-path: inset(50%); white-space: nowrap; }

/* ── Sensor picker ──
 *
 * Offered on demand in chat. Every colour is a theme token: the picker is large enough to
 * be its own surface, and a warm-page literal becomes glare in Nordic dark.
 */
.searchbar { margin-bottom: var(--space-s2); }
.sensorbox {
  max-height: 240px; overflow-y: auto; overflow-x: hidden;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.srow {
  display: flex; align-items: center; gap: var(--space-s3); padding: var(--space-s2) var(--space-s3);
  border-bottom: 1px solid var(--surface2); cursor: pointer; font: var(--font-label-lg);
}
.srow:last-child { border-bottom: 0; }
.srow:hover { background: var(--surface2); }
.srow input { margin: 0; accent-color: var(--accent); }
.srow input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.srow .sm {
  color: var(--fg); font: var(--font-code);
}
.srow .sd {
  color: var(--muted); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.srow .star { color: var(--accent); font-size: var(--fs-hint); }
.srow .bus {
  font-family: var(--mono); font-size: var(--fs-hint); color: var(--muted);
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 1px 5px;
}
.srow mark {
  background: var(--accent-soft); color: var(--accent-strong);
  padding: 0 1px; border-radius: var(--radius-sm);
}
.shead {
  padding: var(--space-s2) var(--space-s3); font: var(--font-label-lg);
  color: var(--muted); background: var(--surface2);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1;
}
.selcount { font: var(--font-hint); color: var(--muted); margin-top: var(--space-s2); }
.sensor-empty { padding: var(--space-s3); color: var(--faint); font: var(--font-hint); }

/* ── Nordic shapes, where the pages hardcoded a radius ──
 *
 * About fifty `border-radius: <n>px` rules in the page stylesheets do not read
 * --radius, so a square theme would not reach them. Until they are
 * variabilised, these reach the containers and buttons that carry the look.
 * `:root` in front of each selector outranks the page's own rule, which is
 * loaded after this file. Badges keep their round ends, as in Blueprint.
 */
:root .card,
:root .pcard,
:root .pnote,
:root .result,
:root .valbar,
:root pre,
:root .section,
:root .flash,
:root .composer input,
:root input[type=text],
:root input[type=number],
:root select { border-radius: var(--radius); }
/* Primary and secondary actions are square on myNordic ("Invite a colleague"). */
:root .composer button,
:root .btn,
:root .head-button,
:root .survey-send,
:root .survey-skip,
:root .survey-reopen,
:root .feedback-send,
:root .feedback-skip { border-radius: var(--radius); }
/* A selected tab is outlined in the primary colour on white, not filled. */
:root .tabbar button[aria-selected="true"] {
  background: var(--surface); color: var(--fg);
  border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent);
}

/* ── Buttons, as in the design system (Figma, Core: Buttons) ──
 *
 * Primary: solid Nordic Blue with white text, without Blueprint's diagonal
 * slice (dropped by the product owner, 16 Nov, T77); hover keeps the colour; focus adds a dark blue border; disabled is Light
 * Grey with grey text.
 * Secondary: white with a Nordic Lake border and text, filled Lake on hover.
 *
 * Sizes: Medium is 40px high with 16px of padding (Button/Primary-Medium,
 * node 40002102:31963; Secondary 40002102:31992); Small is 32px with 12px
 * (Primary 40002102:32147, Tertiary 40002102:32209). A Medium or Large label
 * is Blueprint's 16/21 (--font-btn): the owner's 16 Nov choice (T74), which
 * supersedes the 14/19 of the 12 Nov scale for them; a Small label stays 14/19.
 * Secondary draws its border 2px (Component/Button/Secondary-default); a
 * primary has none. `.btn.sm` is the
 * dashboard's own size and keeps it.
 */
:where(:root) .btn:not(.sm),
:where(:root) .report-send,
:where(:root) .report-cancel,
:where(:root) .survey-send,
:where(:root) .sensor-confirm {
  box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--btn-h); padding: 0 var(--space-s4); text-align: center;
}
:where(:root) .head-button,
:where(:root) .feedback-send,
:where(:root) .feedback-skip,
:where(:root) .survey-skip,
:where(:root) .survey-reopen,
:where(:root) .pp-choose,
:where(:root) .row-change,
:where(:root) .review-change {
  box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--btn-h-sm); padding: 0 var(--space-s3); gap: var(--space-s1);
}
:root .btn.primary,
:root .composer button,
:root .survey-send,
:root .feedback-send,
:root .report-send,
:root .pp-choose,
:root .sensor-confirm {
  background-color: var(--accent); color: var(--on-accent); border: 0;
}
:root .btn.primary:hover:not(:disabled),
:root .composer button:hover:not(:disabled),
:root .survey-send:hover:not(:disabled),
:root .feedback-send:hover:not(:disabled),
:root .report-send:hover:not(:disabled),
:root .pp-choose:hover:not(:disabled),
:root .sensor-confirm:hover:not(:disabled) { background-color: var(--accent); filter: none; }
:root .btn.primary:disabled,
:root .composer button:disabled,
:root .survey-send:disabled,
:root .feedback-send:disabled,
:root .report-send:disabled,
:root .pp-choose:disabled,
:root .sensor-confirm:disabled {
  background: var(--disabled-bg); color: var(--disabled-fg); opacity: 1; cursor: not-allowed;
}
:root .btn.ghost,
:root .report-cancel,
:root .survey-reopen {
  background: var(--surface); color: var(--accent-strong);
  border: 2px solid var(--accent-strong); box-shadow: none;
}
:root .btn.ghost:hover:not(:disabled),
:root .report-cancel:hover:not(:disabled),
:root .survey-reopen:hover:not(:disabled) {
  background: var(--accent-strong); color: var(--on-accent); border-color: var(--accent-strong);
}
/* Secondary, disabled (40002102:31996): the Light Grey border, grey text. */
:root .btn.ghost:disabled,
:root .report-cancel:disabled,
:root .survey-reopen:disabled {
  background: var(--surface); color: var(--disabled-fg); border-color: var(--disabled-bg);
  opacity: 1; cursor: not-allowed;
}
:root .btn:focus-visible,
:root .composer button:focus-visible,
:root .report-send:focus-visible,
:root .report-cancel:focus-visible,
:root .survey-send:focus-visible,
:root .survey-reopen:focus-visible,
:root .feedback-send:focus-visible,
:root .pp-choose:focus-visible,
:root .sensor-confirm:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }

/* Tertiary Small (Figma node 40002102:32209; hover :32213, focus :32217): no
   border, text in Nordic Lake (Color/Content/Supportive), the pale blue
   Flat-Default-Hover ground on hover, and on focus that ground with the 2px
   #0032a0 border drawn inside the box, as Blueprint draws it. New chat in the
   header is the one action there, so it is one; so are Skip in the survey and
   in a reply's rating, and a Change. */
:root .head-button,
:root .survey-skip,
:root .feedback-skip,
:root .row-change,
:root .review-change {
  color: var(--accent-strong); border: 0; background: none; border-radius: var(--radius);
}
:root .head-button:hover:not(:disabled),
:root .survey-skip:hover,
:root .feedback-skip:hover,
:root .row-change:hover:not(:disabled),
:root .review-change:hover:not(:disabled) { color: var(--accent-strong); background: var(--accent-soft); }
:root .head-button:focus-visible,
:root .survey-skip:focus-visible,
:root .feedback-skip:focus-visible,
:root .row-change:focus-visible,
:root .review-change:focus-visible {
  color: var(--accent-strong); background: var(--accent-soft);
  outline: 2px solid var(--focus); outline-offset: -2px;
}
/* Tertiary, disabled: the text goes grey and nothing is under the pointer. */
:root .head-button:disabled { color: var(--disabled-fg); background: none; cursor: not-allowed; }
/* Its leading icon (Blueprint's Tertiary Small has one, `add_circle_outline`). */
.head-button svg { flex-shrink: 0; }

/* The header's text items (Blueprint's Secondary navigation, node
   40002266:1761): Dashboard, About and Report a problem in Body/Large/Light
   16/21, Content/Secondary at rest and Content/Primary when hovered or
   current, the current page with a 3px Border/Brand line under it. The item
   is as tall as the bar, so the line sits on the bar's own hairline. */
:root .head-nav,
:root .head-about,
:root .report-problem {
  box-sizing: border-box; display: inline-flex; align-items: center; align-self: stretch; gap: var(--space-s2);
  padding: 0 var(--space-s4); border: 0; border-radius: var(--radius); background: none;
  color: var(--header-muted); font: var(--font-nav); white-space: nowrap; text-decoration: none; cursor: pointer;
}
:root .head-nav:hover,
:root .head-about:hover,
:root .report-problem:hover,
:root .head-nav[aria-current="page"] { color: var(--header-fg); background: none; }
:root .head-nav[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--accent); }
:root .head-nav:focus-visible,
:root .head-about:focus-visible,
:root .report-problem:focus-visible {
  color: var(--header-fg); outline: 2px solid var(--focus); outline-offset: -2px;
}
/* The "…" that opens the menu on a phone; base.css shows it only there. */
:root .head-more {
  align-items: center; justify-content: center; box-sizing: border-box;
  width: var(--btn-h-sm); height: var(--btn-h-sm); padding: 0; border: 0; border-radius: var(--radius);
  background: none; color: var(--accent-strong); cursor: pointer;
}
:root .head-more:hover, :root .head-more[aria-expanded="true"] { background: var(--accent-soft); }
:root .head-more:focus-visible { background: var(--accent-soft); outline: 2px solid var(--focus); outline-offset: -2px; }
/* New chat's label is the text items' size, Body/Large/Light 16/21 (--font-nav), and the gap
   to its icon theirs (owner, 17 Nov, T81). Every header icon, the three in front of a label,
   the cog and the "…", is 16px and a block in a centring flex row, so each icon sits on its
   text's vertical centre and on the others', in the bar and in the phone menu. The
   centre of the line box is not the centre of the letters (the font's space above
   and below them is uneven), so each icon is lifted by --icon-lift onto the capitals'
   centre; the cog and the "…" have no label but are lifted the same, so every icon in
   the row is on one line. A relative offset moves only the paint: the buttons, their
   hover ground, focus ring and the current page's underline stay where they were. */
:root .head-button { font: var(--font-nav); gap: var(--space-s2); }
:root .head-button svg,
:root .head-about svg,
:root .report-problem svg,
:root .headcog svg,
:root .head-more svg {
  display: block; flex-shrink: 0; width: 16px; height: 16px;
  position: relative; top: calc(-1 * var(--icon-lift));
}

/* The close icon of a dialog and of a picker: Blueprint's Neutral icon button,
   Tertiary Small, 32px, the icon in Content/Primary (nodes 40002640:27585,
   8474:47394), Flat-Subtle-Hover under the pointer (:47424), the 2px border
   inside on focus (:47428). */
:root .dialog-x {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-sizing: border-box;
  width: var(--btn-h-sm); height: var(--btn-h-sm); padding: 0; border: 0; border-radius: var(--radius);
  background: none; color: var(--fg); cursor: pointer;
}
:root .dialog-x:hover { background: var(--hover-neutral); }
:root .dialog-x:focus-visible { background: var(--hover-neutral); outline: 2px solid var(--focus); outline-offset: -2px; }

/* A checkbox and a radio at Blueprint's sizes, not the browser's: the checkbox
   16px with a 1px Content/Primary border, filled Supportive with a white check
   when on (nodes 8418:32171, :32173); the radio 20px, its ring Supportive and
   a Supportive dot when on (nodes 9363:5424, :5423). */
:root .report-check input[type="checkbox"],
:root .srow input[type="checkbox"],
:root .pp-cmp input[type="checkbox"],
:root .survey-option input[type="radio"] {
  appearance: none; -webkit-appearance: none; flex-shrink: 0; box-sizing: border-box; margin: 0;
  display: inline-grid; place-content: center; border: 1px solid var(--fg); background: var(--surface);
  cursor: pointer; accent-color: var(--accent-strong);
}
:root .report-check input[type="checkbox"],
:root .srow input[type="checkbox"],
:root .pp-cmp input[type="checkbox"] { width: 16px; height: 16px; border-radius: 0; }
:root .survey-option input[type="radio"] { width: 20px; height: 20px; border-radius: 50%; }
:root .report-check input[type="checkbox"]::before,
:root .srow input[type="checkbox"]::before,
:root .pp-cmp input[type="checkbox"]::before {
  content: ""; width: 10px; height: 10px; background: var(--on-accent); transform: scale(0);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%);
}
:root .survey-option input[type="radio"]::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-strong); transform: scale(0);
}
:root .report-check input[type="checkbox"]:checked,
:root .srow input[type="checkbox"]:checked,
:root .pp-cmp input[type="checkbox"]:checked { background: var(--accent-strong); border-color: var(--accent-strong); }
:root .survey-option input[type="radio"]:checked { border-color: var(--accent-strong); }
:root .report-check input:checked::before,
:root .srow input:checked::before,
:root .pp-cmp input:checked::before,
:root .survey-option input:checked::before { transform: scale(1); }
:root .report-check input:disabled,
:root .srow input:disabled,
:root .pp-cmp input:disabled,
:root .survey-option input:disabled { border-color: var(--disabled-bg); cursor: not-allowed; }
@media (forced-colors: active) {
  :root .report-check input[type="checkbox"]:checked::before,
  :root .srow input[type="checkbox"]:checked::before,
  :root .pp-cmp input[type="checkbox"]:checked::before { background: HighlightText; }
  :root .report-check input[type="checkbox"]:checked,
  :root .srow input[type="checkbox"]:checked,
  :root .pp-cmp input[type="checkbox"]:checked { background: Highlight; }
}

/* Sign out, square like every other control. */
:root .sign-out { border-radius: var(--radius); }
:root .sign-out:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }

/* A reply's rating, on its own line under the bubble: the gutter beside the
   bubble is too narrow for the question, and a faded control was the one
   people overlooked. The question gives way before it wraps. */
:root .feedback-controls {
  flex-basis: calc(100% - var(--ai-indent)); width: auto; min-width: 0;
  justify-content: flex-start; margin: -4px 0 0 var(--ai-indent); opacity: 1;
}
:root .feedback-ask {
  min-width: 0; margin-right: 6px; overflow: hidden; white-space: nowrap;
  text-overflow: ellipsis; color: var(--muted); font: var(--font-help);
}
:root .feedback-thumb { flex-shrink: 0; }
:root .airow .feedback-note {
  box-sizing: border-box; padding-left: var(--ai-indent); text-align: left;
}
@media (max-width: 359px) {
  :root .feedback-ask { display: none; }
}

/* Section labels in Nordic Dark Grey: Label/Regular/Medium in sentence case,
   as Blueprint has no uppercase or tracked style. Hints and empty states
   under them stay grey. */
:root .section > h3,
:root .ptitle,
:root .case-sec { color: var(--fg); }

/* The chat's answer chips, as Blueprint's Chip (node 13264:61995): square,
   Content/Primary text, no border, 40px high. The ground is NOT Blueprint's
   Information ground (#f0fbfc): the product owner chose, on 17 Nov (T81), the
   user bubbles' pale blue (--accent-soft, `.bubble.user` below), and under the
   pointer a slightly darker blue of it (--chip-hover), in place of the
   Flat-Default-Hover ground (node 13264:62003): a deviation from Blueprint,
   as T77's was. One that does not suit the project keeps a white ground and
   a hairline. */
:root { --chip-hover: color-mix(in srgb, var(--accent-soft) 90%, var(--accent-strong)); }
:root .pills .pill {
  border-radius: var(--radius); background: var(--accent-soft); color: var(--fg);
  border: 1px solid transparent; box-shadow: none;
}
:root .pills .pill:hover { background: var(--chip-hover); }
:root .pills .pill-unavailable { background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
:root .pills .pill-unavailable:hover { background: var(--chip-hover); }
:root .pills .pill:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
/* Continue under the starting-point question is that reply's one action
   (T64): the primary button, as above, hover keeping the colour. */
:root .pills .pill-primary,
:root .pills .pill-primary:hover {
  background: var(--accent);
  color: var(--on-accent);
}

/* The user's own messages on the same pale blue with dark text, so the one
   strong blue in the chat is Send, the primary action. */
:root .bubble.user { background: var(--accent-soft); color: var(--fg); }
:root .bubble.user a { color: var(--accent-strong); }
:root .bubble.user code { background: var(--surface); }

/* ── Alternative themes ──
 *
 * None for now: Nordic, in :root above, is the only theme. A later one (a dark
 * Nordic variant, from the Figma design system) goes here as a
 * `[data-theme="<id>"]` block that re-points every palette variable in :root,
 * plus its id in ui/theme.mjs and ui/theme-boot.js. The theme picker appears
 * on its own once there are two.
 */

/* ── The theme picker itself ── */
.themepick { display: inline-flex; align-items: center; gap: 6px;
             font: var(--font-hint); color: var(--header-muted); }
.themepick select {
  font: inherit; padding: 3px 7px;
  border: 1px solid var(--header-chrome-line); border-radius: var(--radius);
  background: var(--header-chrome-surface); color: var(--header-fg); cursor: pointer;
}
