/* Copyright (c) 2026 by Fly Compliant, LLC
 *
 * Page styles. Tokens live in tokens.css; a rebrand is that file, not this one.
 *
 * ALL sizing is in rem. One hard-coded px font-size silently opts that element
 * out of the A− / A / A+ control, which is an accessibility regression that
 * looks fine in every screenshot.
 */

html { font-size: 100%; }
body {
  margin: 0;
  font-family: var(--fc-font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--fc-ink);
  background: var(--fc-surface);
  /* Sticky footer. On a short page the footer sat directly beneath the content, so its
     top border read as a stray rule in the middle of the page rather than as the base
     of it. dvh, not vh, so mobile browser chrome does not push it below the fold. */
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; }
/* Since FEAT-0059 every page's <main> sits inside .page-layout (opened by the header
   partial), so the wrapper takes the flex-grow that keeps the footer at the bottom of a
   short page, and passes it on to <main>. The body > main rule above stays for any page
   that is ever rendered without the shared header. */
.page-layout { flex: 1 0 auto; display: flex; flex-direction: column; min-width: 0; }
.page-layout > main { flex: 1 0 auto; }

/* The container. 60rem is a READABILITY cap, not a layout accident: a line of prose
   2,000px wide is hard to track back to the start of, so prose pages keep it.

   A six-column table is not prose. It was scrolling inside its own .table-scroll box
   while the window had hundreds of pixels spare. .page-wide (set from PageData.Wide on
   the admin and log pages) lifts the cap and lets the container follow the viewport,
   which is a max-width change and therefore reflows on resize with no JavaScript. */
/* box-sizing: the 1rem side padding must count INSIDE max-width. Without it, a page-wide
   container resolves max-width to min(120rem, 100%) — the viewport — and then adds 32px
   of padding outside it, so every wide page scrolled horizontally by exactly 32px at any
   window narrower than 120rem. Measured at 1280: main.wrap was 1312px. It hid at 60rem
   because the cap is well inside the viewport there, and the two table pages that opt
   into .page-wide are the ones that showed it. */
/* Kent, 2026-08-09: every page follows the window. The 60rem cap left most of a
   normal screen empty on pages that are mostly controls and tables — account,
   manuals, history — and the reading-measure argument does not apply to those.

   The measure survives where it still earns its keep: the prose pages
   (/about, /privacy, /terms) keep .narrow, because 42rem of legal text is a
   deliberate readability choice and widening it to an ultrawide would be a
   regression, not a fix. Everything that is a UI follows the window.

   120rem outer bound so a table stops growing on an ultrawide, where a row
   3,000px wide makes the eye lose which record it is on between the first
   column and the last.

   box-sizing: the 1rem side padding must count INSIDE max-width, or a container
   resolving to 100% then adds 32px of padding outside it and the page scrolls
   sideways by exactly that much at any window narrower than the cap. */
.wrap {
  max-width: min(120rem, 100%);
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
  /* Lets the container shrink below the intrinsic width of its widest child.
     Without it a grid or flex item with a long unbreakable string sets a floor
     the container cannot go under, and the page stops shrinking — which is what
     /account did: it bottomed out and scrolled sideways instead of reflowing. */
  min-width: 0;
  /* width:100% so max-width does the capping. main.wrap is a FLEX item of body (the
     sticky footer), and an auto margin on the cross axis overrides
     align-items:stretch, so without this main shrank to its content: on /admin at
     2560px it was 509px wide while nine tables scrolled sideways inside it
     (measured 2026-11-09). In the header and footer .wrap is a block, where this
     changes nothing. */
  width: 100%;
}
/* The prose pages keep the reading measure. */
.narrow { max-width: 42rem; }
/* Retained so PageData.Wide stays meaningful at its call sites, and so an
   ultrawide cap lives in one place if .wrap's default ever narrows again. */
.page-wide .wrap { max-width: min(120rem, 100%); }

/* Anything wide scrolls inside its own box; the page body never scrolls
 * sideways. */
.table-scroll { overflow-x: auto; }

/* ---- Global responsive floor --------------------------------------------
   Target is a 31" 5K down to an iPhone, from ONE set of rules rather than a
   per-page fix each time a page is found to overflow (Kent, 2026-08-09).

   Expanding was never the hard part — .wrap follows the viewport. CONTRACTING
   is, and it fails for exactly three reasons, all of them below. Each is a
   floor some element sets that the viewport then cannot go under, so the page
   stops shrinking and the whole document scrolls sideways. On a phone that
   turns every page into a horizontal drag.

   1. Replaced elements at intrinsic size. An image, an SVG or a <pre> block
      keeps its natural width unless told otherwise.
   2. Grid and flex children default to min-width:auto, which is min-CONTENT,
      not zero — so one long unbreakable string (an email address, a UUID, a
      source id like "8900.1,Vol.2,Ch4,Sec8") props its whole column open.
   3. A rem floor in a track definition. `minmax(22rem, 1fr)` cannot go below
      352px even at one column, which is already wider than an iPhone's usable
      343px — so the component that reflows beautifully on a laptop is the one
      that overflows on a phone.

   Kept as a floor, not a reset: it makes shrinking POSSIBLE, and each
   component still decides how it reflows. */
img, svg, video, canvas, iframe { max-width: 100%; height: auto; }
pre { max-width: 100%; overflow-x: auto; }
/* Fixes (2). Definition lists, flex rows and grid items all shrink to fit;
   without this the min-content floor of the longest word wins. */
dd, li, p, td, th, .wrap > *, main > * { min-width: 0; }
/* A fourth floor, outside the three above: the user-agent stylesheet gives
   <fieldset> min-inline-size: min-content, so a long <option> holds it open. On
   /changes at 390px one held the fieldset at 454px and the page 82px wider than the
   phone (measured 2026-11-09). min-width, not min-inline-size: the latter loses the
   cascade to the UA rule. */
fieldset { min-width: 0; }
/* Long unbreakable identifiers break rather than push. Scoped to where they
   actually occur — an email, an id, a URL — because `anywhere` on body text
   breaks ordinary words mid-syllable and reads badly. */
.account-facts dd, .doc-facts dd, .log-fields dd,
.rev-list .rev-file, .breakable { overflow-wrap: anywhere; }

/* Headings take the DISPLAY stack and the heading indigo (§ 3, § 8.5).
 *
 * The split is by content type, not by element: a heading is chrome, so it sets
 * in the display face — but a citation string inside one is data and keeps the
 * system stack, which is why .cite-inline below opts back out rather than the
 * heading opting in per page. `14 CFR §135.267(b)(3)` in a narrow column is
 * exactly where a wide geometric face hurts.
 *
 * h2 was --fc-navy and is now --fc-heading. Navy is the SECONDARY ACTION colour
 * in this system; a heading wearing it made a non-interactive element look like
 * a control, and it is the colour row hover and sorted columns now use. */
h1, h2, h3, h4 {
  font-family: var(--fc-font-display); color: var(--fc-heading);
  /* A single long word ("Administration") at 150% text on a 320px screen is wider
     than its box and scrolled /admin sideways (WCAG 1.4.10, 2026-11-11). Hyphenate
     where the language allows, and break only a word that cannot otherwise fit;
     neither changes a heading that already fits. */
  hyphens: auto;
  overflow-wrap: break-word;
}
/* THE DISPLAY FACE, by content type rather than by element (Jill, 2026-08-12, § 8.2 of
   prompt-visual-identity-v1.md): headings, nav, buttons and the uppercase micro-labels.
   Table DATA and quoted regulation text stay in the system stack — `14 CFR §135.267(b)(3)`
   in a narrow column is exactly where a wide geometric face hurts, which is why a citation
   inside a heading opts back out below.

   Column headers are here and table cells are not, deliberately: a `<th>` is a label, a
   `<td>` is data. Same for a badge, which is a label about a row rather than the row. */
.site-nav, .eyebrow, .badge, .data-table thead th, .tool-tab { font-family: var(--fc-font-display); }
h1 { font-size: 1.75rem; line-height: 1.3; margin: 1.5rem 0 0.5rem; }
h2 { font-size: 1.3rem; margin: 1.75rem 0 0.5rem; }
h3 { font-size: 1.05rem; margin: 1rem 0 0.35rem; }
/* Data inside chrome. A citation, a source id or a quoted rule keeps the system
 * stack wherever it appears, including inside a heading. */
h1 .cite-inline, h2 .cite-inline, h3 .cite-inline, h4 .cite-inline,
.cite-inline { font-family: var(--fc-font-sans); }
a { color: var(--fc-link); }
a:hover { color: var(--fc-link-hover); }

/* Inline code. Added for the dev-mode sign-in panel, which names a shell command; the
   element had no rule, so it rendered at the browser's default monospace size — usually
   a size smaller than the surrounding text, and in px, which would opt it out of the
   A− / A / A+ control. 0.9em rather than a rem value so it tracks its container. */
code {
  font-family: var(--fc-font-mono);
  font-size: 0.9em;
  background: var(--fc-surface-2);
  border: 1px solid var(--fc-line);
  border-radius: 0.25rem;
  padding: 0.075em 0.3em;
  word-break: break-word;
}

.skip-link {
  position: absolute; left: -9999rem; top: 0; z-index: 100;
  background: var(--fc-surface); padding: 0.5rem 1rem;
}
.skip-link:focus { left: 0; }

/* A visible focus ring everywhere. Removing it is the single most common
 * accessibility regression in a redesign. */
:focus-visible {
  outline: 3px solid var(--fc-link);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Header ------------------------------------------------------------------ */
.site-header { border-bottom: 1px solid var(--fc-line); background: var(--fc-surface); }
.header-row {
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap; padding-top: 0.75rem; padding-bottom: 0.75rem;
}
/* Brand lockup: glyph + two lines of live text.
   The wordmark <img> it replaces was traced type, so the name could not be changed in it.
   .wordmark's rule is gone with it rather than left behind as dead CSS. */
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  text-decoration: none; color: var(--fc-ink);
}
.brand:hover { color: var(--fc-ink); }
.brand:hover .brand-name { color: var(--fc-red-deep); }
.brand-mark { height: 2.25rem; width: auto; display: block; }
/* Two lines, tight: the product name leads and the company is subordinate to it, which is
   the relationship "FC135.ai by Fly Compliant, LLC" states. */
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-size: 1.35rem; font-weight: 800; letter-spacing: -0.015em;
  color: var(--fc-ink);
}
/* The TLD in brand red so the name reads as a domain rather than a word. --fc-red is a
   gated text role, so it clears AA on this surface in both themes. */
.brand-tld { color: var(--fc-red); }
.brand-by { font-size: 0.7rem; font-weight: 600; color: var(--fc-muted); }
/* On a narrow screen the second line is the first thing worth dropping — the glyph and
   "FC135.ai" are enough to identify the site, and the footer carries the company name on
   every page anyway. */
@media (max-width: 26rem) {
  .brand-by { display: none; }
  .brand-name { font-size: 1.2rem; }
}
.dark-only { display: none; }
:root[data-theme="dark"] .light-only { display: none; }
:root[data-theme="dark"] .dark-only { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .light-only { display: none; }
  :root:not([data-theme="light"]) .dark-only { display: block; }
}

.site-nav { display: flex; gap: 1rem; align-items: center; margin-left: auto; flex-wrap: wrap; }
/* Sign out is a <button> inside a <form>, because signing out must be a POST. That form
   is a flex ITEM of the nav rather than a link like its neighbours, and a form carries a
   user-agent margin, which lifted its button clear of the line the links sit on. Zeroing
   the margin and making the form its own centred flex container puts the button on
   exactly the links' baseline. */
.site-nav .inline-form { display: flex; align-items: center; margin: 0; }
/* A divider before it, so a destructive-looking control is visibly separated from
   navigation rather than reading as a fifth place to go. */
.site-nav .inline-form::before {
  content: ""; align-self: stretch; width: 1px; margin-right: 1rem;
  background: var(--fc-line);
}
.controls { display: flex; gap: 0.5rem; align-items: center; }
.textsize { display: inline-flex; gap: 0.15rem; align-items: center; }

/* Every footer control button — A− A A+ and the theme icon — is one rule.
   They were two: this one set the style and a separate .icon-button rule gave the
   theme button its own size and no background, so it rendered taller than its
   neighbours and off their baseline. A button that is "nearly" the same as the ones
   beside it looks like a mistake, because it is one.
   inline-flex + center is what puts a glyph and an SVG on the same optical line;
   text-only buttons sit on the text baseline and an SVG does not.
   2.25rem square (36px) clears the 24x24 CSS-pixel WCAG 2.2 Target Size (Minimum)
   for all four, which the icon alone at 18px would not, and does it in rem so the
   text-size control scales its own buttons. */
.textsize button, #theme-toggle, #palette-toggle, #help-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--fc-control-h);
  min-height: var(--fc-control-h);
  padding: 0.3rem 0.55rem;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  border: 1px solid var(--fc-control-line); border-radius: var(--fc-radius);
  background: var(--fc-surface-2); color: var(--fc-ink);
}

/* Selects, globally. ONE rule, so a dropdown looks the same wherever it appears.

   It used to be `.effort select` only, which meant the Depth-of-reasoning
   dropdown on the ask page was styled and every other select in the product —
   manual type, schedule, the log filters — fell through to the browser default
   and rendered at a visibly smaller size (Kent, 2026-08-09). A control that
   changes size depending on which page it is on reads as two different controls.

   font: inherit is the load-bearing part: a <select> does NOT inherit the page
   font by default, and a browser-default select is sized in px — which would
   silently opt it out of the A− / A / A+ text-size control, the same trap the
   file header warns about for font-size.

   Scoped away from .cap-input and .table-filter, which are deliberately compact
   because they sit inside table cells. */
select {
  font: inherit;
  font-size: 1rem;
  padding: 0.45rem 0.6rem;
  /* --fc-control-line, not --fc-line: a select is a CONTROL, and its boundary
     needs 3:1 (SC 1.4.11), where a divider does not. It used the divider token,
     so the one input on a row could meet the ratio while the select beside it
     did not. */
  border: 1px solid var(--fc-control-line);
  border-radius: var(--fc-radius);
  background: var(--fc-surface);
  color: var(--fc-ink);
  box-sizing: border-box;
  min-height: var(--fc-control-h);
  max-width: 100%;
}
/* No font-size override for the compact variants. A select that is 0.95rem beside
   a 1rem button is the "buttons are not the same size" complaint in another
   costume; the padding may tighten, the type may not. */
select.cap-input, .table-filter select { padding: 0.3rem 0.45rem; }

/* Banners ----------------------------------------------------------------- */
.banner {
  border-radius: var(--fc-radius); padding: 0.75rem 1rem; margin: 1rem auto;
  border-left: 0.25rem solid var(--fc-warn); background: var(--fc-surface-alt);
}
.banner-warn { border-left-color: var(--fc-warn); }
.banner-ok { border-left-color: var(--fc-ok); }
/* An answer that stopped at the output limit. Heavier than .banner-warn on
 * purpose: this one sits directly above an answer that reads as finished, and
 * until 2026-08-15 the product refused to show it at all. The full-weight border
 * and the tinted ground are what stop it being skimmed past like a footnote.
 *
 * Colour is not the signal — the copy says INCOMPLETE in words (AGENTS.md), and
 * the element carries role="alert" so it reaches a screen reader immediately.
 * The border goes all the way round rather than only down the left edge, so the
 * boundary between "warning" and "answer" is visible without relying on hue. */
.banner-incomplete {
  border: 0.125rem solid var(--fc-red);
  border-left-width: 0.25rem;
  background: var(--fc-surface-alt);
  font-weight: 500;
}
/* A retryable failure is our fault, not the user's. Distinct from a refusal so
 * "try again" and "we won't answer that" never look the same. */
.banner-retry { border-left-color: var(--fc-navy); }
.banner p { margin: 0 0 0.35rem; }
.banner p:last-child { margin-bottom: 0; }

.effort { margin-top: 1rem; }

/* The AI disclaimer is not dismissible. There is deliberately no close button
 * and no JS that can hide it. */
.ai-disclaimer {
  border: 1px solid var(--fc-warn);
  border-left-width: 0.25rem;
  border-radius: var(--fc-radius);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  color: var(--fc-warn);
  background: var(--fc-surface-alt);
  font-size: 0.95rem;
}

/* Forms ------------------------------------------------------------------- */
/* EVERY text-ish control, not a subset.
 *
 * This listed four types. `search` and `number` were missing, so the history
 * filter and the ask-lab panel each re-declared the whole recipe locally — nine
 * duplicated declarations that then had to be kept in step by hand, and were not:
 * one used --fc-line for its border where this uses --fc-control-line, which is
 * the 3:1 boundary WCAG 2.2 SC 1.4.11 asks for.
 *
 * Adding a type here is now the way to style it. A page-local copy is the bug
 * (Kent, 2026-08-09: "use global css ... page css only as needed").
 */
textarea,
input[type="email"], input[type="text"], input[type="file"],
input[type="search"], input[type="number"], input[type="password"],
input[type="url"], input[type="tel"], input[type="date"] {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 1rem;
  /* Control boundary, not a divider — WCAG 2.2 SC 1.4.11 wants 3:1 here. */
  padding: 0.6rem; border: 1px solid var(--fc-control-line);
  border-radius: var(--fc-radius);
  background: var(--fc-surface); color: var(--fc-ink);
}
label { display: block; font-weight: 600; margin-top: 1rem; }
label.checkbox, label.consent-check {
  font-weight: 400; display: flex; gap: 0.5rem; align-items: flex-start;
}
label.checkbox input, label.consent-check input { width: auto; margin-top: 0.3rem; }
.help { color: var(--fc-muted); font-size: 0.9rem; margin: 0.35rem 0 0; }

/* Lede — the one-line statement of what a page is for.
   Used on the ask page and the login page, and until now had no rule at all, so it
   rendered at body weight and the h1 had nothing following it that read as a subtitle. */
/* NO max-width here. It was 34rem, which on a 5K display wrapped the intro
   paragraph about a quarter of the way across while the form under it ran the
   full width — so the page looked broken rather than typeset (Kent, 2026-08-09).

   The rule this restores is the global one: WIDTH IS THE CONTAINER'S JOB. .wrap
   sets the measure, .narrow tightens it for prose pages, and an element that caps
   itself opts out of both and cannot be fixed from the page that owns the layout.
   Every page using .lede is a wide one, so the cap only ever fought the container.

   Worth knowing what this trades: a very long line of prose is harder to track
   back to the start of, which is what the cap was for. If that bites on a large
   monitor the fix is a `ch`-based measure on the PAGE container, applied
   consistently — not a second private cap on one element. */
.lede { color: var(--fc-muted); font-size: 1.05rem; margin: 0.25rem 0 1.5rem; }

/* Login page --------------------------------------------------------------
   Two columns on a wide screen: what the product is on the left, the sign-in card on
   the right. One column below 52rem with the hero first — on a phone the visitor
   should reach the email field by scrolling, not read a pitch twice the length of the
   form.

   Ordered product first, legal second. The data-capture disclosure sits inside the
   card above the checkbox that acknowledges it, so it cannot be skipped. */
.login-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
  margin: 1.5rem 0 3rem;
}
@media (min-width: 52rem) {
  .login-grid { grid-template-columns: 1.05fr 1fr; gap: 3.5rem; }
  /* The hero holds less vertical content than the card, so nudging it down puts the
     h1 and the card heading on roughly the same optical line. */
  .login-hero { padding-top: 1.25rem; }
}

.login-hero h1 {
  font-size: 2.1rem;
  line-height: 1.15;
  /* Slightly negative tracking at display size only. At body size this would cost
     legibility; at 2.1rem the default spacing looks loose. */
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}
.login-hero .lede { font-size: 1.075rem; margin-bottom: 2rem; }

/* Eyebrow above the h1. States the jurisdiction before the claim — AGENTS.md requires
   that never be left implicit — and gives the heading something to sit under. */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fc-navy);
  margin: 0 0 0.75rem;
}
.eyebrow::before {
  content: ""; width: 1.5rem; height: 0.125rem;
  background: var(--fc-red); border-radius: 1rem;
}

.login-hero h2 {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--fc-muted);
  margin: 0 0 0.75rem;
}

/* Example questions. Quoted sample input, so each gets its own surface — set as list
   bullets they read as a policy list, which is the opposite of what they are. */
.examples { list-style: none; padding-left: 0; margin: 0 0 1rem; display: grid; gap: 0.625rem; }
.examples li {
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius-lg);
  background: var(--fc-surface-2);
  padding: 0.75rem 0.9rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.examples li:hover { border-color: var(--fc-navy); transform: translateY(-0.0625rem); }
.example-q { display: block; margin-top: 0.25rem; font-size: 0.975rem; }
/* Which of the two allowed kinds this is. A pill, so it reads as a label rather than
   as the first words of the question. Uses --fc-badge-fg because the fill is a
   mid-tone in light mode and a light tint in dark mode, so white text is correct in
   one theme and unreadable in the other. */
.example-kind {
  display: inline-block;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.125rem 0.5rem; border-radius: 1rem;
  background: var(--fc-navy); color: var(--fc-badge-fg);
}
.example-kind.kind-manual { background: var(--fc-guidance); }

/* The sign-in card. */
.login-card {
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius-lg);
  background: var(--fc-surface);
  box-shadow: var(--fc-shadow-lg);
  padding: 1.75rem;
}
.login-card h2 {
  font-size: 1.3rem; color: var(--fc-ink); margin: 0 0 0.25rem;
  letter-spacing: -0.01em;
}
.card-sub { color: var(--fc-muted); font-size: 0.925rem; margin: 0 0 1.25rem; }
.login-card label[for="email"] { margin-top: 0; }
.login-card .btn-primary {
  width: 100%; margin-top: 1.25rem;
  font-weight: 600; box-shadow: var(--fc-shadow);
}

/* The data-capture disclosure. Required reading, and it sits between the email field
   and the button, so it needs a visible boundary or it reads as the form's help text.
   Deliberately not a <details>: a disclosure someone has to open first is not one we
   stated plainly. */
.consent {
  border: 1px solid var(--fc-line);
  border-left: 0.1875rem solid var(--fc-slate);
  border-radius: var(--fc-radius);
  background: var(--fc-surface-2);
  padding: 0.875rem 1rem; margin: 1.5rem 0 1.25rem;
  font-size: 0.9rem;
}
.consent h3 { font-size: 0.9375rem; margin: 0 0 0.5rem; }
.consent ul { margin: 0 0 0.75rem; padding-left: 1.1rem; }
.consent li { margin-bottom: 0.125rem; }
.consent p { margin: 0 0 0.625rem; }
.consent p:last-child { margin-bottom: 0; }

.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }
/* A form in a row of actions (Retry check beside Upload update) is a flex box too. As
   .inline-form it was an inline box, so its button sat on a line of text and could
   drop below the links beside it (Kent, 2026-11-10). Measured in Chrome. */
.actions > form { display: flex; }

/* EVERY button, everywhere — the ELEMENT selector as well as the class.
 *
 * This is the fix for a family of complaints (Kent, 2026-08-09: "why is the add
 * and check button using such a small font? ... all buttons should share the same
 * font name and size ... buttons need to be consistent across the app").
 *
 * The cause was that `.btn` was the only button rule in the stylesheet. A plain
 * <button type="submit"> with no class — which is most of the forms in this app —
 * inherited the browser default: a different font FAMILY and about 13px, next to
 * .btn's 1rem in the page font. Two buttons a few pixels apart look like a bug,
 * because they are one.
 *
 * `font: inherit` and THEN font-size: the shorthand is what drops the UA's own
 * font stack. Setting a size alone leaves the wrong typeface at the right size,
 * which is the version of this that looks almost fixed.
 *
 * inline-flex + centre rather than inline-block: it puts the label in the middle
 * of the box instead of on the text baseline, which is what made buttons sit a
 * shade low beside an input.
 */
button,
input[type="submit"],
input[type="reset"],
.btn {
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: var(--fc-control-h);
  padding: 0.45rem 1.1rem;
  border-radius: var(--fc-radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
/* A class-less button needs a surface, or the rule above leaves it transparent
   with an invisible border. They get the secondary look, which is what nearly all
   of them were already approximating. */
button:not([class]) {
  background: var(--fc-surface-2);
  color: var(--fc-navy);
  border-color: var(--fc-control-line);
}
button:not([class]):hover { border-color: var(--fc-link); }
/* THE CRIMSON→BLUE SWAP. Two-thirds of the brand's buttons are crimson going
 * blue and the rest are blue going crimson — it is the one gesture this identity
 * has, and a conventional "darken 10% on hover" is the correct-looking change
 * that quietly deletes it (§ 2.1).
 *
 * It carries NO MEANING on its own (§ 6.1). Under deuteranopia the crimson and
 * the blue render at near-identical lightness — 1.25:1 against each other — so
 * hover is signalled by the cursor and the focus ring, and this is decoration on
 * top. Do not extend the same swap to encode state (selected, active, error),
 * where it would become the only signal.
 *
 * And primary differs from secondary by MORE THAN FILL HUE — weight and border,
 * below. Two same-sized buttons separated only by crimson vs blue are one colour
 * deficiency away from a coin flip on a destructive action. */
/* RED MEANS DESTRUCTIVE ON A BUTTON (Kent, 2026-11-10: "why is save settings red? then i
 * hover over it it turns blue?" … "red means destructive on buttons" … "for buttons use
 * the primary color of the blue that is in the logo"). The main action is the logo's
 * aircraft blue, a darker blue on hover; only .btn-danger and .action.danger are red.
 * The crimson→blue swap described above is retired with it, provisionally: Jill has not
 * ruled on button colours, and this is hers to confirm. */
.btn-primary {
  background: var(--fc-btn-primary); color: #fff;
  border-color: var(--fc-btn-primary);
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--fc-btn-primary-hover); border-color: var(--fc-btn-primary-hover); color: #fff;
}
.btn-secondary {
  background: var(--fc-surface-2); color: var(--fc-navy);
  border-color: var(--fc-control-line);
  font-weight: 400;
}
/* No red on hover either: a secondary button turning red read as "this is dangerous". */
.btn-secondary:hover { border-color: var(--fc-link); color: var(--fc-link); }
/* Buttons are chrome: display face, and the micro-label tracking the site uses. */
.btn { font-family: var(--fc-font-display); }
.btn-danger { background: var(--fc-danger); color: #fff; }
/* A disabled action has to LOOK unavailable, not merely be unavailable — a
 * button that ignores clicks while looking normal reads as a broken site. */
.btn:disabled,
.btn[aria-disabled="true"] {
  background: var(--fc-line);
  color: var(--fc-muted);
  cursor: not-allowed;
}
/* A <button> that must READ as a link, so it deliberately opts out of the global
   button rule — including its size.
 *
 * `font: inherit` here is intentional and is the one place it is right: this sits
 * inside running text or a table cell, and a link one size larger than the words
 * around it looks like a mistake. It measures 15.2px inside a 0.95rem table and
 * that is correct — the rule is that BUTTONS share a size, and this is a link
 * wearing a button's element for behaviour it needs (a POST, a CSRF token).
 *
 * If you want something that looks like a button, do not reach for .linkish. */
.linkish {
  background: none; border: none; padding: 0; font: inherit;
  color: var(--fc-link); text-decoration: underline; cursor: pointer;
  min-height: 0;
}
.linkish.danger { color: var(--fc-danger); }
/* Sign out is NOT red any more. It was, at Kent's request (2026-08-09), and this note
   warned what it cost: account erasure, which is irreversible, was the same colour as a
   click that is undone by signing in again. Kent's rule of 2026-11-10 settles it: "the
   only red buttons, links are destructive". Signing out destroys nothing, so it is a
   link like the others beside it. The weight stays, so it still stands apart from the
   tabs, and the divider before it in the nav does the rest. */
.linkish.signout { color: var(--fc-link); font-weight: 600; }
.linkish.signout:hover { color: var(--fc-link-hover); text-decoration-thickness: 0.125rem; }
.inline-form { display: inline; }

/* Panel — the shared inset box.
 *
 * .answer, .ask-lab and .keep-manual each carried an identical copy of this
 * recipe. Three copies of a surface is three things to change when the surface
 * changes, and the kind of drift that ends with two panels that are nearly the
 * same. Anything needing an inset block uses .panel and adds only what differs.
 */
.panel {
  background: var(--fc-surface-alt);
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius);
}

/* Answer ------------------------------------------------------------------ */
.answer {
  background: var(--fc-surface-alt); border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius); padding: 1rem 1.25rem; margin: 1.5rem 0;
}
.direct-answer { font-size: 1.1rem; font-weight: 600; }
.answer-para { margin: 0.75rem 0; }
.cite-ref a { text-decoration: none; font-size: 0.75rem; }

.citations { padding-left: 1.25rem; }
.citation { margin: 0.85rem 0; }
.citation-label { display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; }
.quote {
  margin: 0.35rem 0; padding: 0.5rem 0.75rem;
  border-left: 0.2rem solid var(--fc-navy);
  background: var(--fc-surface); font-family: var(--fc-font-mono);
  font-size: 0.9rem; overflow-x: auto;
}
/* A manual quotation is visually distinct from a regulation, because
 * conflating "what my manual says" with "what the law requires" is the whole
 * risk of the feature. */
.quote-manual, .citation-manual .quote { border-left-color: var(--fc-slate); }
.badge {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.1rem 0.4rem; border-radius: 0.2rem; font-weight: 700;
}
/* Badge text comes from a token, not a literal #fff.
 *
 * Badge backgrounds are mid-tone brand colours in light mode and LIGHT tints in
 * dark mode, so a hard-coded white foreground is correct in one theme and
 * illegible in the other. All three original badges measured 2.06-2.26:1 in dark
 * mode against WCAG AA's 4.5 floor. check-contrast.py now tests these pairs. */
.badge-corpus   { background: var(--fc-navy);     color: var(--fc-badge-fg); }
.badge-manual   { background: var(--fc-slate);    color: var(--fc-badge-fg); }
.badge-high     { background: var(--fc-danger);   color: var(--fc-badge-fg); }
.badge-medium   { background: var(--fc-warn);     color: var(--fc-badge-fg); }
.badge-low      { background: var(--fc-slate);    color: var(--fc-badge-fg); }
/* Guidance: how a rule may be met, not the rule. */
.badge-guidance { background: var(--fc-guidance); color: var(--fc-badge-fg); }
/* Caution on a source row — "changed since this check", "no longer in the corpus",
 * "N unconfirmed". Reuses --fc-warn rather than introducing a colour: that token is
 * already in check-contrast.py's pair list against --fc-badge-fg in both themes, and
 * a seventh unmeasured colour is exactly how a contrast regression ships. */
.badge-warn     { background: var(--fc-warn);     color: var(--fc-badge-fg); }
/* A status or role marker with no severity and no tier — "enabled", "open", "Admin".
   Added 2026-08-11 because four such markers had been written as a bare `class="badge"`,
   and EVERY variant above is what supplies the background: bare .badge sets only size,
   weight and casing, so it rendered as shouty uppercase text rather than as the pill
   every other badge in the app is. Slate is deliberate reuse — the same pair
   badge-manual and badge-low already clear AA, so this needs no new colour. */
.badge-neutral  { background: var(--fc-slate);    color: var(--fc-badge-fg); }
/* Enabled, on the sign-in domains table. --fc-ok is redefined per theme (including
 * the colour-vision-safe scale, where it is a blue), so this follows the token
 * rather than naming a green — and the badge carries the WORD "Enabled", because
 * colour is never the only signal. */
.badge-ok       { background: var(--fc-ok);       color: var(--fc-badge-fg); }

/* A non-binding source says so in words as well as colour — colour alone is not
 * an accessible signal, and this distinction is the point of the badge. */
.authority-note {
  color: var(--fc-muted); font-size: 0.85rem;
  margin: 0.25rem 0 0.5rem; font-style: italic;
}
.citation-meta {
  display: flex; gap: 1rem; flex-wrap: wrap; align-items: baseline;
  margin-top: 0.4rem;
}
.collected-at { color: var(--fc-muted); font-size: 0.85rem; }
.locator { color: var(--fc-muted); font-size: 0.9rem; }
.answer-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }

/* Lists and tables --------------------------------------------------------- */
.corpus-list { columns: 1; }
@media (min-width: 44rem) { .corpus-list { columns: 2; } }
.corpus-list li { break-inside: avoid; }

.history { list-style: none; padding: 0; }
.history-item { border-bottom: 1px solid var(--fc-line); padding: 0.9rem 0; }
.history-q { font-weight: 600; }
.history-a { color: var(--fc-muted); margin: 0.25rem 0; }
.meta { color: var(--fc-muted); font-size: 0.875rem; }

/* An inline warning that has to be noticed, in a line of otherwise quiet text.
   .meta was doing the opposite: the stale-corpus note beside a saved manual was
   MUTED, so the one sentence saying "these findings predate an amendment" was
   rendered fainter than everything around it. Kent, 2026-08-11: it should be seen.
   --fc-warn is already a contrast-checked text role in every theme (it carries the
   AI disclaimer), so this needs no new colour. Colour is not the only signal — the
   sentence says what is wrong and a visually-hidden "Warning:" precedes it, because
   SC 1.4.1 means a warning may not be conveyed by colour alone. */
.warn-inline {
  color: var(--fc-warn);
  font-size: 0.875rem;
  font-weight: 600;
}

/* Tables ------------------------------------------------------------------
   ONE style for every table in the app. There were two near-identical rule sets keyed on
   table.usage and table.corpus-table, which is how two tables on the same page end up
   half a rule apart — and the log-links table was borrowing class="usage" to get styled
   at all, which is a class name lying about what the table holds.

   .data-table is the base. Behaviour that only some tables want (zebra, sortable
   headers, a wrapping prose column) is a modifier, so a new table gets the house style by
   default and opts in to the rest. */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--fc-line);
  white-space: nowrap;
}
/* THE TABLE TREATMENT IS DERIVED, NOT SAMPLED (§ 5). The marketing site has no
 * tables at all — Jill confirmed that is the WordPress theme rather than house
 * style — and FC135 is mostly tables, so this is the one component with no
 * source to copy.
 *
 * The header row is the site's one typographic mannerism applied where it
 * belongs: uppercase, 600, 0.3px tracking, on the section tint. Body rows keep
 * the data stack; only the header is chrome.
 *
 * COLUMN HEADERS STAY IN THE SYSTEM FACE deliberately, even though they are
 * chrome: at 0.75rem uppercase with tracking, a geometric display face costs
 * width in exactly the columns that have none. */
.data-table thead th {
  background: var(--fc-surface-3);
  color: var(--fc-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.019rem;
  text-transform: uppercase;
}
/* Row hover is a BLUE tint, never crimson (§ 5, § 6.1). Crimson means action in
 * this system and must not also mean selected — and under deuteranopia the two
 * are indistinguishable anyway, so the left rule is the co-signal that survives
 * having no colour vision at all. */
.data-table tbody tr:hover > * { background: var(--fc-surface-alt); }
.data-table tbody tr:hover > :first-child { box-shadow: inset 0.1875rem 0 0 var(--fc-navy); }
/* Columns 1-2 wrap; every other column stays on one line.
   A tier badge and a date are short and read better unbroken, but a citation and a
   description are the two that get long — and Name being nowrap was forcing the column
   wide enough to push the date columns out of view. overflow-wrap: anywhere because a
   source id like "8900.1,Vol.2,Ch4,Sec8" contains no spaces to break at. */
/* th as well as td: a row header can be prose too. The finding diff's first
   column is a citation in a <th scope="row">, and with the td-only selector it
   kept the whole table nowrap and pushed the slot columns off the edge. */
.data-table td.wrap-col,
.data-table th.wrap-col { white-space: normal; overflow-wrap: anywhere; }
/* .prose-col also takes the slack when the container is wider than the other columns
   need, so a wide window grows the description rather than the gaps. */
.data-table td.prose-col { width: 40%; min-width: 14rem; }

/* Revision history, in the full-width row under a manual.
   Each entry is three parts of very different lengths — a short rev number, a
   filename that runs long, and a date — so they get their own line rather than
   one nowrap run that pushes the row off the right edge. The filename wraps
   anywhere because an operator's name ("Global Air Charters GMM Rev 6
   08-21-25.pdf") has spaces but its extension-tail does not. */
/* The Rescan-every cell. Given a width to wrap INTO — `wrap-col` alone lets the
   text break, but with nothing bounding the column the browser still prefers the
   widest line it can get, and a recurring-charge consent sentence is long. This
   is the column Kent identified as the reason the table ran off the right. */
.data-table td.sched-col { min-width: 12rem; max-width: 18rem; }
/* The Manuals table never scrolls sideways (Jill, 2026-11-09: no horizontal
   scrolling). Measured that day, its seven nowrap columns needed 1,492px, so it
   scrolled inside its box at every width from the 60rem card breakpoint to 1,440px.
   Three of them were 63% of that, and all three are text that reads fine wrapped:
   the manual's label, the filename and the status note under the last recheck.
   They wrap now, each with a floor so a short word never stands alone in a sliver
   of a column; the dates, counts and costs stay on one line. */
.manuals-table td.wrap-col { min-width: 8rem; overflow-wrap: break-word; }

/* align-top — for a table whose cells are stacked lines rather than single values.
   Cells default to vertical-align: middle, which is right when every cell is one
   line. Put a three-line cell (a run history, a delivery breakdown) beside a
   one-line cell and the short one floats to the middle of the tall one, so nothing
   in the row shares a baseline and the whole table reads as misaligned. That is
   what the change-watches table looked like.
   A modifier rather than a change to `.data-table td`, because the other seven
   tables in the app are single-line and correct as they are. */
.data-table.align-top td { vertical-align: top; }
.data-table td.sched-col .checkbox { white-space: normal; }

.rev-list { list-style: none; margin: 0.3rem 0 0; padding: 0; }
.rev-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.5rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--fc-line);
}
.rev-list li:last-child { border-bottom: 0; }
.rev-list .rev-n { font-weight: 600; white-space: nowrap; }
.rev-list .rev-file { overflow-wrap: anywhere; min-width: 0; }

/* Right-align a numeric column, header AND cell. Aligning only the cells leaves each
   header floating over the left edge of its own column. */
.num, td.num, th.num { text-align: right; }
td.num { font-variant-numeric: tabular-nums; }
th.num .sort-link { justify-content: flex-end; }

/* Zebra striping. On the row, not the cell, so the stripe survives a colspan. */
.zebra tbody tr:nth-child(even) { background: var(--fc-surface-2); }
.zebra tbody tr:hover { background: var(--fc-surface-alt); }

/* .zebra-groups stripes by ROW GROUP, for a table where one record is more than one
   <tr> — the Users table, where each account is a summary row plus a disclosure row
   holding its editor. Striping those by <tr> would shade an account's editor a
   different colour from the account it belongs to, which reads as two records.
   Hover is on the group for the same reason: pointing at a row should light up the
   record, not half of it. */
.zebra-groups tbody:nth-of-type(even) tr { background: var(--fc-surface-2); }
.zebra-groups tbody:hover tr { background: var(--fc-surface-alt); }
/* A row group is the record, so it gets the rule between records that the border on
   each <td> otherwise draws inside one. */
.zebra-groups tbody + tbody { border-top: 1px solid var(--fc-line); }
.zebra-groups tbody td { border-bottom: none; }

/* Sortable headers are links, so a sort is a URL: bookmarkable, shareable, and working
   with JavaScript off. */
.sortable thead th {
  background: var(--fc-surface);
  border-bottom: 2px solid var(--fc-line);
  padding: 0;
}
.sort-link {
  display: flex; align-items: center; gap: 0.35rem;
  padding: 0.5rem 0.6rem;
  color: var(--fc-ink); font-weight: 600; text-decoration: none;
}
.sort-link:hover { color: var(--fc-link); background: var(--fc-surface-2); }
.sort-link.active { color: var(--fc-link); }
/* The inactive marker is dimmed rather than hidden: a column that only reveals it is
   sortable on hover is a column most people never discover is sortable. */
.sort-arrow { font-size: 0.7rem; opacity: 0.35; }
.sort-link.active .sort-arrow { opacity: 1; }

/* Filter row: an input, a button, sometimes a Clear link, and a count.
   Everything on the row is given the SAME box height explicitly. Left to themselves an
   <input> and a <button> compute their heights from different things — the input from its
   font's normal line-height, the button from the inherited 1.6 — so they came out a few
   pixels apart and nothing on the row shared a baseline. Exactly the footer-button
   problem again: a control that is "nearly" aligned with the one beside it reads as a
   mistake, because it is one. */
.table-filter {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  margin: 0.75rem 0;
}
/* The global `label { margin-top: 1rem }` stacks a vertical form and is wrong in a
   single-row control bar: inside a centred flex line it makes the label's box
   taller on one side, so its text sits below the baseline of the input and button
   beside it. Visible on the admin "Sign-in domains" row, where the label, the
   field, the button and the "In force:" note all read as four different heights
   (Kent, 2026-08-09). The row's own gap supplies the spacing the margin was for. */
.table-filter label { margin-top: 0; }
.table-filter input[type="text"],
.table-filter .btn,
.logview-bar > .btn {
  box-sizing: border-box;
  min-height: var(--fc-control-h);
  padding: 0.45rem 0.75rem;
  font-size: 1rem;
  line-height: 1.4;
}
.table-filter input[type="text"] { width: auto; flex: 1 1 16rem; max-width: 24rem; }
/* inline-flex so the label is centred in the box rather than sitting on the text
   baseline, which is what put the button a shade low next to the input. */
.table-filter .btn,
.logview-bar > .btn {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  padding-left: 1.1rem; padding-right: 1.1rem;
}
/* The Clear link and the count are text, not boxes — centred on the row rather than given
   the control height, which would grow the row for nothing. */
.clear-filter, .table-filter .meta { align-self: center; line-height: 1.4; }
.clear-filter { font-size: 0.9rem; white-space: nowrap; }
.empty { color: var(--fc-muted); font-style: italic; text-align: center; padding: 1.5rem; }

.tier {
  display: inline-block; font-size: 0.75rem; white-space: nowrap;
  padding: 0.1rem 0.45rem; border-radius: 1rem;
  background: var(--fc-surface-2); border: 1px solid var(--fc-line);
  color: var(--fc-muted);
}
.doc-name { font-weight: 600; }

.pager {
  display: flex; align-items: center; justify-content: center; gap: 1.5rem;
  margin-top: 1rem; font-size: 0.95rem;
}
.pager .disabled { color: var(--fc-muted); }
.pager-where { font-variant-numeric: tabular-nums; }


/* minmax(0,auto) so a long value cannot prop the key column open — `auto` is
   min-content, which an email address or a UUID sets very wide. */
.account-facts { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 0.35rem 1rem; }
.account-facts dt { font-weight: 600; color: var(--fc-muted); }
.account-facts dd { margin: 0; }

.danger-zone {
  border: 1px solid var(--fc-danger); border-radius: var(--fc-radius);
  padding: 1rem 1.25rem; margin-top: 2rem;
}
.warning-box {
  border: 1px solid var(--fc-warn); border-radius: var(--fc-radius);
  padding: 0.75rem 1rem; margin: 1rem 0; background: var(--fc-surface-alt);
}
/* The attached-manual row: file name, the use-it checkbox, and Remove.
   align-items: center on the row was not enough, because .checkbox is itself a flex
   container with align-items: flex-start and a 0.3rem nudge on its input — so the label
   sat high while the name and the button sat centred, and three things on one line each
   found a different baseline. The row overrides that nudge for its own children. */
.manual-attached > .checkbox { align-items: center; margin-top: 0; }
.manual-attached > .checkbox input { margin-top: 0; }
.manual-attached > .linkish { align-self: center; }
.manual-attached {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  background: var(--fc-surface-2); border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius); padding: 0.6rem 0.9rem; margin: 1rem 0;
}
.findings { padding-left: 1.25rem; }
.finding { margin: 1.25rem 0; }

/* Footer ------------------------------------------------------------------ */
/* A SOLID COLOURED BLOCK, not a hairline rule (Jill, 2026-08-12, § 8.3 of
   prompt-visual-identity-v1.md). Chosen from a three-variant mockup — hairline, solid
   block, tinted panel — over a real answer page, and chosen AGAINST that document's own
   recommendation, on brand consistency. Do not re-argue it here.

   No border-top: the block's own edge is the boundary, and a rule on top of a filled
   block draws a line inside the colour change rather than at it.

   It spans the viewport while its contents sit in .wrap, which is why the padding is on
   the block and the measure is not. */
.site-footer {
  background: var(--fc-footer-bg);
  color: var(--fc-footer-fg);
  margin-top: 3rem;
  padding: 2rem 0 2.5rem; font-size: 0.9rem;
}
/* Every colour inside the block comes from a footer token. --fc-link and --fc-warn are
   tuned for a white page; used here they are the classic "text the designer never
   looked at in the other theme" failure, on a surface that does not change with the
   theme. */
.site-footer a { color: var(--fc-footer-link); }
.site-footer .meta, .site-footer .version { color: var(--fc-footer-fg); opacity: 0.85; }
.disclaimer-permanent { color: var(--fc-footer-warn); }
/* The footer's own controls take the footer's boundary, for the reason the token
   records: --fc-control-line is tuned for a white page and disappears into the block. */
.site-footer .textsize button,
.site-footer #theme-toggle,
.site-footer #palette-toggle { border-color: var(--fc-footer-control-line); }
.version { font-family: var(--fc-font-mono); font-size: 0.8rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* "What's loaded" — grouped disclosure.
   <details>/<summary> rather than a JS accordion, so keyboard and screen-reader
   behaviour is native. Only the marker rotation and spacing are ours. */
.loaded-group {
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius);
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
}
.loaded-group > summary {
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* No focus rule here on purpose: app.css already has a global
     :focus-visible { outline: 3px solid var(--fc-link) }, and a second weaker ring
     would quietly override the accessible one on exactly the element a keyboard
     user tabs to. */
}
.loaded-group[open] > summary {
  margin-bottom: 0.5rem;
}
.corpus-groups {
  list-style: none;
  padding-left: 0;
}
.corpus-groups li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.125rem 0;
}
.corpus-groups .count {
  font-variant-numeric: tabular-nums;
  color: var(--fc-muted);
}

/* Footer controls: text size and theme.
   Moved out of the header because on the top line they competed with the question
   box for first attention, and the question box is the page. */
/* One footer row: copyright left, controls right.
   Stacked on their own lines these read as content, with the same weight as the
   legal text above them. space-between makes the row a utility bar instead. */
.footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  /* No border-top. .site-footer's rule spans the viewport while this one sat inside
     .wrap, so the two rendered as a long line, the disclaimer, then a short line —
     reading as two footers rather than one. Spacing separates the row instead. */
}
.footer-ident p { margin: 0; }
.footer-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* Wraps, so at 320px and 150% text (the A+ maximum) the row breaks instead of
     pushing A- off the left edge where it cannot be scrolled to (WCAG 1.4.10).
     The Show help switch made the row about 65px wider; found 2026-11-11. */
  flex-wrap: wrap;
  justify-content: center;
}
/* On a narrow screen the row wraps, and the copyright should not then be stranded
   against one edge with the controls against the other. */
@media (max-width: 30rem) {
  .footer-bar {
    justify-content: center;
    text-align: center;
  }
}
/* No .icon-button rule: the theme button is styled by the shared footer-button rule
   above, with the text-size buttons, so the four cannot drift apart. */
#palette-toggle[aria-pressed="true"],
#help-switch[aria-pressed="true"] {
  /* An active toggle must LOOK active, or a user cannot tell whether the click landed. */
  background: var(--fc-navy);
  color: var(--fc-badge-fg);
  border-color: var(--fc-navy);
}
/* pointer-events: none so a hover anywhere on the button resolves to the BUTTON, not to
   whichever path happens to be under the cursor. Without it the tooltip flickers between
   the button's title and the SVG's as the pointer crosses the artwork.
   
   NO display here. `#theme-toggle svg` is specificity 101 and
   `:root[data-theme="dark"] .light-only` is 30, so `display: block` beat the icon-swap
   rules and the theme button rendered the sun AND the moon at once, in both themes. The
   display:block was there to kill an inline descender gap that no longer exists — the
   button is an inline-flex container, so the icon is a flex item and never sat on a text
   baseline in the first place. Caught by screenshotting every page, which is exactly the
   kind of thing that is invisible when you only ever look at one theme. */
#theme-toggle svg, #palette-toggle svg { pointer-events: none; }
/* No `#theme-toggle svg { display: block }` here any more, and it must not come back.
   At specificity 101 it beat `.dark-only { display: none }` (10) and
   `:root[data-theme="dark"] .light-only` (30), so the theme button rendered the sun AND
   the moon simultaneously, in both themes. It was added to kill an inline descender gap
   that the button no longer has: #theme-toggle is an inline-flex container, so the icon is
   a flex item and never sits on a text baseline. */
.copyright {
  /* Inside .footer-bar, so the row owns the spacing. */
  margin: 0;
}

/* Theme button icons, driven by data-next rather than by the current theme.
   The control has THREE states (auto / light / dark), so "show the opposite of
   what we're rendering" no longer identifies an icon — there is no opposite of
   auto. app.js writes data-next with the state a click moves to, and the button
   shows that state's icon, which keeps the picture, the tooltip and the
   accessible name all saying the same thing.

   The old .light-only/.dark-only pairing cannot express this: those classes key
   off what the PAGE is rendering, and auto renders as light or dark without
   being either. Selector specificity here is 21 (#id + attr + class), safely
   above the generic rules and below the `#theme-toggle svg` rule the comment
   above warns about. */
#theme-toggle .icon-light,
#theme-toggle .icon-dark,
#theme-toggle .icon-auto { display: none; }
#theme-toggle[data-next="light"] .icon-light { display: inline-block; }
#theme-toggle[data-next="dark"] .icon-dark { display: inline-block; }
#theme-toggle[data-next="auto"] .icon-auto { display: inline-block; }

/* ANSWER_FORMATTER=both — the two formatters side by side.
   A testing view, so it is plain: the job is comparing prose, and anything
   decorative here competes with the thing being judged. */
.formatter-compare {
  margin-top: 1.5rem;
  border-top: 1px solid var(--fc-line);
  padding-top: 1rem;
}
.compare-grid {
  display: grid;
  /* Side by side where there is room, stacked where there is not. minmax with a
     22rem floor rather than a media query, so it reflows with the text-size
     control too — at A+ two columns of 22rem stop fitting and it stacks. */
  /* min(22rem, 100%) not 22rem: a bare rem floor cannot go below 352px even at
     one column, which already overflows an iPhone's ~343px of usable width.
     Wrapping it in min() keeps the two-column behaviour on a laptop and lets
     the single column shrink to whatever the phone actually has. */
  grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr));
  gap: 1rem;
}
.compare-panel {
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius);
  padding: 0.75rem 1rem;
}
.compare-panel h4 {
  margin: 0 0 0.25rem;
  text-transform: none;
}
.compare-rejected {
  /* Dimmed, not hidden: a discarded result is the most interesting one to read,
     because it shows what the formatter tried to do. */
  opacity: 0.75;
}
.compare-reason {
  font-weight: 600;
}
.answer-heading {
  margin: 1rem 0 0.25rem;
}

/* Log viewer ---------------------------------------------------------------
   Records as cards rather than table rows: a qa.jsonl entry holds a question and an
   answer, and prose in a table cell either stretches the row off the page or wraps into
   a column two words wide. */
.logview-bar {
  display: flex;
  /* TOP aligned, and the controls kept TOGETHER (Kent, 2026-08-09). Two separate
     faults, both visible on /admin/logs/users.jsonl:

       align-items: center centred Download against the filter form's box —
       including the form's own vertical margin — so it sat visibly lower than the
       Filter button it belongs beside.

       justify-content: space-between pushed Download to the far right edge of the
       page, a screen away from the other controls. Nothing about it is a different
       KIND of action; it was pinned there by the layout, not by intent. */
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
  margin: 0.75rem 0;
}
/* The margin lives on the bar now, not on the form inside it — a margin on a flex
   item is what made "top aligned" and "same top" different things here. */
.logview-bar .table-filter { margin: 0; }
.crumb { margin: 1rem 0 0; font-size: 0.9rem; }

.log-records { list-style: none; padding-left: 0; margin: 0.5rem 0 0; }
.log-record {
  border: 1px solid var(--fc-line);
  border-left: 0.1875rem solid var(--fc-navy);
  border-radius: var(--fc-radius);
  background: var(--fc-surface-2);
  padding: 0.7rem 0.9rem; margin-bottom: 0.625rem;
}
.log-head {
  display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.log-time { font-family: var(--fc-font-mono); font-size: 0.8rem; color: var(--fc-muted); }
.log-email { font-weight: 600; }
.log-headline { flex: 1 1 12rem; }
.log-line { font-size: 0.75rem; color: var(--fc-muted); margin-left: auto; }

/* Short fields. auto/1fr rather than a fixed key column, so a long key name is not
   truncated and a short one does not leave a gutter. */
.log-fields {
  display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 0.15rem 0.75rem;
  margin: 0; font-size: 0.9rem;
}
.log-fields dt { color: var(--fc-muted); font-family: var(--fc-font-mono); font-size: 0.8rem; }
.log-fields dd { margin: 0; overflow-wrap: anywhere; }

.log-long { margin-top: 0.5rem; }
.log-long-key {
  color: var(--fc-muted); font-family: var(--fc-font-mono); font-size: 0.8rem;
  margin-bottom: 0.15rem;
}
/* pre must scroll inside its own box; the page body never scrolls sideways. */
.log-long pre, .log-raw {
  margin: 0; padding: 0.5rem 0.65rem;
  background: var(--fc-surface); border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius);
  font-family: var(--fc-font-mono); font-size: 0.825rem; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: auto;
  max-height: 22rem; overflow-y: auto;
}
/* An unparseable line is a defect, not data — coloured as one. */
.log-raw { border-color: var(--fc-danger); }

.log-links-table .log-actions { display: flex; gap: 0.9rem; }

/* Narrow screens: rows become cards, and nothing scrolls sideways ---------
   A six-column table (eight on usage) cannot fit a 320px phone, so the choice is a
   horizontal scroll or a different layout. Scrolling a data table sideways on a phone
   means losing the column you were comparing against, so each row becomes a card and
   each cell carries its own label — the data-label attribute the markup sets.

   The header row is hidden rather than restyled: with one cell per line, the labels ARE
   the header, and keeping both would print every column name twice per card.

   60rem, not 30rem. The breakpoint has to be high enough that the table always fits
   above it — between "fits as a table" and "becomes cards" there must be no gap where it
   overflows, because the gap is where the horizontal scrollbar lives. */
@media (max-width: 60rem) {
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: auto; }
  .data-table tr {
    border: 1px solid var(--fc-line);
    border-radius: var(--fc-radius);
    margin-bottom: 0.625rem;
    padding: 0.25rem 0.5rem;
  }
  /* The stripe is what distinguished adjacent rows in a dense table; as cards, the border
     does that job and the fill only muddies the contrast of the text inside. */
  .zebra tbody tr:nth-child(even) { background: none; }
  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.3rem 0.1rem;
    border-bottom: 1px solid var(--fc-line);
    /* No nowrap on a phone: a long value must wrap rather than widen the card. */
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: right;
  }
  .data-table tr td:last-child { border-bottom: none; }
  .data-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-weight: 600;
    color: var(--fc-muted);
    text-align: left;
    /* Not italic, not smaller: this is the column header, and shrinking it would make the
       card harder to scan than the table it replaced. */
  }
  /* A cell with no label would render an empty ::before box and an odd gap. */
  .data-table td:not([data-label])::before { content: none; }
  .data-table td.prose-col { width: auto; min-width: 0; }
  .data-table .log-actions { justify-content: flex-end; }

  /* The filter row on a 320px screen: the input must be allowed to shrink below its
     16rem basis, or it and the button together overflow the container. */
  .table-filter input[type="text"] { flex: 1 1 8rem; min-width: 0; max-width: none; }
  .table-filter { gap: 0.4rem; }
  /* Download stops sitting opposite the filter and goes under it, full width, rather
     than being squeezed to a few characters. */
  .logview-bar { display: block; }
  .logview-bar > .btn { width: 100%; margin-bottom: 0.5rem; }
  .pager { gap: 0.75rem; }
}

/* Very small phones (iPhone SE is 320px = 20rem). */
@media (max-width: 26rem) {
  .login-hero h1 { font-size: 1.75rem; }
  .login-card { padding: 1.1rem; }
  /* Card labels and values stack, because "Chief Counsel legal interpretations" opposite
     its label leaves each about eight characters wide. */
  .data-table td { display: block; text-align: left; }
  .data-table td::before { display: block; margin-bottom: 0.1rem; }
  .pager { flex-wrap: wrap; }
}

/* Corpus document review -------------------------------------------------- */
.doc-facts {
  display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 0.2rem 1rem;
  margin: 1rem 0 1.5rem; font-size: 0.925rem;
}
.doc-facts dt { color: var(--fc-muted); font-weight: 600; }
.doc-facts dd { margin: 0; overflow-wrap: anywhere; }
.doc-facts .unknown { color: var(--fc-warn); }

/* One rule: its text, the verdicts on it, and the form. Bordered because a reviewer works
   one rule at a time and needs to see where each one ends. */
.rule {
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  background: var(--fc-surface);
}
.rule h2, .rule h3 { margin-top: 0; }
.rule-number { font-family: var(--fc-font-mono); color: var(--fc-navy); margin-right: 0.4rem; }
/* Regulation text at a comfortable measure even inside a wide container: the container is
   wide for the TABLES, and a 1,600px line of statutory prose is unreadable. */
.rule-body { max-width: 46rem; }
.rule-body p { margin: 0 0 0.75rem; }

.verdicts { list-style: none; padding-left: 0; margin: 1rem 0; }
.verdict {
  border-left: 0.1875rem solid var(--fc-line);
  padding: 0.4rem 0 0.4rem 0.75rem; margin-bottom: 0.5rem;
  font-size: 0.925rem;
}
/* The three verdicts are colour-coded to the semantic tokens rather than the brand, so
   "an expert says this is wrong" cannot be mistaken for a primary action. */
.verdict-valid { border-left-color: var(--fc-ok); }
.verdict-invalid { border-left-color: var(--fc-danger); }
.verdict-unsure { border-left-color: var(--fc-warn); }
.verdict-kind {
  display: inline-block; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; margin-right: 0.5rem;
}
.verdict-valid .verdict-kind { color: var(--fc-ok); }
.verdict-invalid .verdict-kind { color: var(--fc-danger); }
.verdict-unsure .verdict-kind { color: var(--fc-warn); }
.verdict-who { font-weight: 600; }
.verdict-when, .verdict-basis { color: var(--fc-muted); font-size: 0.85rem; }
.verdict-note { margin: 0.25rem 0 0; overflow-wrap: anywhere; }
.verdict-basis { margin: 0.15rem 0 0; }

.verdict-form { margin-top: 1rem; }
.verdict-form fieldset {
  border: 1px solid var(--fc-line); border-radius: var(--fc-radius);
  padding: 0.75rem 1rem; margin: 0;
  background: var(--fc-surface-2);
}
.verdict-form legend { font-weight: 600; padding: 0 0.35rem; }
.verdict-choices { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.5rem; }
/* Radios inherit the checkbox layout so a click on the words selects the option, and the
   row does not depend on baseline luck. */
label.radio { font-weight: 400; display: flex; gap: 0.5rem; align-items: flex-start; margin-top: 0; }
label.radio input { width: auto; margin-top: 0.3rem; }
.verdict-form textarea { margin-top: 0.25rem; }
.verdict-form .btn { margin-top: 0.75rem; }

/* Processing panel -------------------------------------------------------
   Shown while a synchronous upload-and-check runs. */
.processing {
  border: 1px solid var(--fc-line);
  border-left: 0.1875rem solid var(--fc-navy);
  border-radius: var(--fc-radius-lg);
  background: var(--fc-surface-2);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.processing:focus-visible { outline: 3px solid var(--fc-link); outline-offset: 2px; }
.processing-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.processing-steps { margin: 0 0 0.75rem; padding-left: 1.25rem; color: var(--fc-muted); }
.processing-steps li { margin-bottom: 0.15rem; }
.processing-elapsed { margin: 0; }
.processing-elapsed [data-elapsed] { font-variant-numeric: tabular-nums; }

.spinner {
  flex: 0 0 auto;
  width: 1.1rem; height: 1.1rem;
  border: 0.1875rem solid var(--fc-line);
  border-top-color: var(--fc-navy);
  border-radius: 50%;
  animation: fc-spin 0.8s linear infinite;
}
@keyframes fc-spin { to { transform: rotate(360deg); } }
/* The global prefers-reduced-motion rule stops this animating, which is correct — and it
   is also why the elapsed counter matters: with the spinner frozen, the ticking number is
   the only thing telling the user the page is still alive. */

/* History entry kind. A pill, so a question and a manual check are distinguishable at a
   glance in a single timeline rather than by reading each row. */
.history-kind {
  display: inline-block; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.1rem 0.45rem; border-radius: 1rem; margin-bottom: 0.35rem;
  background: var(--fc-navy); color: var(--fc-badge-fg);
}
.history-kind.kind-check { background: var(--fc-guidance); }

/* Answer layout ----------------------------------------------------------
   One column by default. Above 72rem the answer and its Sources sit side by side, which
   is what makes a wide window useful here: stacked, the reader scrolls past the entire
   answer to reach the citation a superscript pointed at.

   The prose column is capped at 46rem regardless of how wide the window is. A wide screen
   is a reason to show MORE THINGS, not to set one line of statutory text across 2,000px —
   past about 75 characters the eye loses the line when it wraps. */
.answer-layout { display: block; }
.answer-main { max-width: 46rem; }
@media (min-width: 72rem) {
  .page-wide .answer-layout {
    display: grid;
    grid-template-columns: minmax(0, 46rem) minmax(18rem, 1fr);
    gap: 3rem;
    align-items: start;
  }
  /* Sticky, so the citation a superscript refers to is still on screen after scrolling
     into the middle of a long answer. */
  .page-wide .answer-sources {
    position: sticky;
    top: 1rem;
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
  }
}
.answer-sources h3 { margin-top: 0; }

/* User editor -------------------------------------------------------------
   A disclosure under each account's row, not controls spread across its cells.

   The old shape put one form control in each of five columns and bound them together
   with form="u-ID", because a <form> cannot wrap <td>s. It worked, and it pinned the
   table at 1,468px: eleven <th> labels cost roughly 1,050px before a single box, so
   the table could not fit any window between the 60rem card breakpoint and 1,468px —
   and that band is where the horizontal scrollbar the card mode exists to prevent
   lived. Moving the editing into one full-width cell removes five columns, gives
   every field a visible <label> instead of an aria-label pointing at a distant
   header, and makes the form an ordinary <form> again. */
.data-table td { vertical-align: top; }
/* The editor row carries no cell padding of its own: the disclosure inside it draws
   whatever separation it needs, and doubling them indents the closed summary away
   from the account it belongs to. */
/* And it opts out of the table's nowrap. Every .data-table cell is nowrap so a data
   column does not wrap mid-value, but this cell holds prose — the erase confirmation
   paragraph most of all — and nowrap made it 2,984px wide with the editors expanded:
   the same sideways scroll the column merge was undoing, reached from the other
   direction and only visible once something was open. .status-check re-declares its
   own nowrap, so the one label that must not break still does not. */
.user-edit-row > td { padding: 0 0 0.35rem; white-space: normal; }
.user-editor {
  background: var(--fc-surface);
  border: 1px solid var(--fc-line); border-radius: var(--fc-radius);
  padding: 0.75rem;
}

/* The address in the Email cell IS the disclosure. A real <button>, so it is in the
   tab order and works from the keyboard with nothing added — but it must not LOOK
   like a button, because it is the row's name and a table of forty buttons reads as
   a toolbar. So: control semantics, text presentation. */
.row-toggle {
  font: inherit; font-size: 1rem; line-height: inherit;
  background: none; border: 0; padding: 0; margin: 0;
  color: var(--fc-link); cursor: pointer; text-align: left;
  display: inline-flex; align-items: baseline; gap: 0.4rem;
  /* The address is the one column deliberately kept nowrap — breaking it across two
     lines is what makes a column of addresses unscannable. */
  white-space: nowrap;
}
.row-toggle:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.row-toggle:focus-visible { outline: 2px solid var(--fc-link); outline-offset: 2px; }
/* The caret is drawn in CSS and marked aria-hidden in the markup: aria-expanded is
   what carries the state to a screen reader, and a glyph that also announced it
   would say it twice. Rotation, not two different characters, so the open and closed
   states are the same shape at the same width and the column does not shift. */
.row-caret {
  flex: 0 0 auto; width: 0.6rem; color: var(--fc-muted);
  transition: transform 0.12s ease;
}
.row-caret::before { content: "\25B8"; }
.row-toggle[aria-expanded="true"] .row-caret { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .row-caret { transition: none; } }
/* The form wraps rather than scrolls: it is inside the same .table-scroll box the
   table is, so a fixed-width form would put back the sideways scroll the column
   merge just removed. */
.user-form { display: flex; flex-direction: column; gap: 0.75rem; }
.user-roles {
  display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem;
  border: none; padding: 0; margin: 0;
}
.user-roles legend { font-size: 0.8rem; color: var(--fc-muted); padding: 0; }
.user-roles .checkbox { margin-top: 0; font-size: 0.9rem; }
.user-fields { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; }
.user-field { display: flex; flex-direction: column; gap: 0.15rem; margin: 0; }
.user-field > label { font-size: 0.8rem; font-weight: 600; }
.user-field .cap-input { text-align: left; }
.user-actions { display: flex; gap: 0.75rem; align-items: center; }
/* The Disabled checkbox is a CONTROL, at control size and colour. It was briefly styled
   as the hint line under its reason box, which lined the columns up and demoted the only
   way to suspend an account to muted 12px text — alignment is not worth losing a control
   over, and the alignment it bought no longer exists to buy. */
.status-check {
  margin-top: 0; align-items: center;
  font-size: 0.9rem; color: var(--fc-ink); white-space: nowrap;
}
.status-check input { margin-top: 0; }
/* Spend meters ---------------------------------------------------------------
   Two horizontal bars at the top of /admin (Kent, 2026-08-15), replacing two bare
   numbers.

   THE COLOUR IS REDUNDANT, NOT THE SIGNAL. Each meter states the money, the percentage
   and a word; the fill repeats what the text already says. ADA conformance is a
   requirement on this product and the visual-identity spec § 10 records that this
   palette does not separate for colour-blind readers — so a green-to-red bar can only
   ever be decoration on top of a sentence.

   The severity tokens are the ones the rest of the product uses, which means the
   colour-vision-safe palette re-colours these meters for free: [data-palette="cb"]
   already redefines --fc-ok, --fc-warn and --fc-danger onto a blue and orange scale,
   and the gate checks them there too. */
.spend-meters {
  list-style: none; margin: 0.75rem 0 0; padding: 0;
  display: grid; gap: 1rem;
}
@media (min-width: 44rem) { .spend-meters { grid-template-columns: 1fr 1fr; } }
.spend-meter { display: flex; flex-direction: column; gap: 0.3rem; }
.spend-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; flex-wrap: wrap;
}
.spend-label { font-weight: 600; }
.spend-figure { font-variant-numeric: tabular-nums; }
/* The track is a CONTROL-adjacent graphic, so its boundary is bound by SC 1.4.11 at 3:1
   against the page — --fc-control-line, not the decorative --fc-line. */
.spend-track {
  height: 0.75rem; border-radius: 0.375rem; overflow: hidden;
  background: var(--fc-surface-2);
  border: 1px solid var(--fc-control-line);
}
.spend-fill { display: block; height: 100%; background: var(--fc-ok); }
/* Three states, and each changes the FILL only — the word beside it is what carries the
   meaning. Attribute selectors rather than three classes, so an unknown state renders as
   the neutral bar instead of inheriting the last rule that matched. */
.spend-meter[data-state="watch"] .spend-fill { background: var(--fc-warn); }
.spend-meter[data-state="over"] .spend-fill { background: var(--fc-danger); }
.spend-meter[data-state="watch"] .spend-state strong { color: var(--fc-warn); }
.spend-meter[data-state="over"] .spend-state strong { color: var(--fc-danger); }
.spend-state { margin: 0; }

/* Account tools -------------------------------------------------------------
   Three sections that app.js upgrades to a tab bar. The rules below are written so
   the NO-SCRIPT state is the plain one: without .tools-tabbed this is three headed
   blocks with a rule between them, which is what the markup already is.

   It replaced four stacked control bars of equal weight for four jobs of very
   unequal frequency (Kent, 2026-08-15: "this top part of the users section looks
   cluttered"). Filtering happens every visit and stays outside the tabs; the other
   three are one click apart and all three names stay legible in the strip. */
.tools { margin: 0.75rem 0 1.25rem; }
.tool-panel { padding-top: 0.25rem; }
.tools:not(.tools-tabbed) .tool-panel + .tool-panel {
  border-top: 1px solid var(--fc-line); margin-top: 0.75rem;
}
.tool-h { font-size: 1rem; margin: 0.75rem 0 0; color: var(--fc-heading); }

.tool-tablist {
  display: flex; flex-wrap: wrap; gap: 0.25rem;
  border-bottom: 1px solid var(--fc-line);
}
/* A tab is a real <button>, so it is in the tab order, announces as a button, and
   works from the keyboard without anything extra. */
.tool-tab {
  font: inherit; font-size: 0.95rem; line-height: 1.4;
  min-height: var(--fc-control-h);
  padding: 0.45rem 0.9rem;
  background: none; color: var(--fc-muted);
  border: 1px solid transparent; border-bottom: none;
  border-radius: var(--fc-radius) var(--fc-radius) 0 0;
  cursor: pointer;
}
.tool-tab:hover { color: var(--fc-ink); background: var(--fc-surface-2); }
/* The selected tab joins its panel: same fill, and it sits over the strip's rule.
   Colour is NOT the only difference — the fill, the border and the weight all
   change together, because a selected state carried by hue alone is invisible to
   the readers SC 1.4.1 is about. */
.tool-tab[aria-selected="true"] {
  background: var(--fc-surface-3);
  border-color: var(--fc-line);
  color: var(--fc-ink); font-weight: 600;
  margin-bottom: -1px;
}
.tools-tabbed .tool-panel {
  background: var(--fc-surface-3);
  border: 1px solid var(--fc-line); border-top: none;
  border-radius: 0 0 var(--fc-radius) var(--fc-radius);
  padding: 0.25rem 1rem 0.75rem;
}
/* The panel is focusable so a keyboard user can reach it, which means it needs a
   focus ring of its own — the default outline on a large block is easy to miss. */
.tools-tabbed .tool-panel:focus-visible {
  outline: 2px solid var(--fc-link); outline-offset: -2px;
}
.tools-tabbed .tool-panel .table-filter { margin: 0.6rem 0 0.2rem; }

/* The three inputs that were escaping the control-bar width rule ---------------
   .table-filter is a single-row flex bar and constrains its field to 16-24rem, but
   the rule named input[type="text"] only. Add a user is type="email", the import
   picker is type="file" and the account filter is type="search", so all three fell
   through to the global `input { width: 100% }`, took a whole line each, and pushed
   the button and the hint onto the next one. That is what made this block read as a
   stack of full-width boxes (Kent, 2026-08-15) — four bars, twelve lines. */
.table-filter input[type="email"],
.table-filter input[type="search"] { width: auto; flex: 1 1 16rem; max-width: 24rem; }
/* A file input is sized by its button plus its filename, and it cannot be trusted
   to be small — a long filename makes it as wide as the name. */
.table-filter input[type="file"] { width: auto; flex: 1 1 14rem; max-width: 22rem; }

/* The Apply block on the import preview: the button and the sentence that says what it
   will do, kept together and away from the table above them so the click is a separate
   act from the reading. */
.import-apply { margin-top: 1.5rem; }
.import-apply .help { max-width: 42rem; }

/* A .meta line that is allowed to wrap. The default hint is nowrap because it inherits
   from its cell, and in the Email and Lifetime columns the hint is the widest text in
   the column — "edited 2026-08-14 by kent.flycompliant@bci.com" is wider than any
   address it sits under, so it, not the data, set the column width. */
.wrap-meta { white-space: normal; }

/* Closing an account is destructive and irreversible, so it is folded away behind its own
   disclosure rather than sitting one stray click from Save. */
/* A destructive disclosure among ordinary ones, such as Revoke beside Callbacks on the
   API keys page: the same red as .danger-details, at the size of its neighbours. */
details.danger > summary { cursor: pointer; color: var(--fc-danger); }
.danger-details > summary {
  cursor: pointer; font-size: 0.8rem; color: var(--fc-danger);
  white-space: nowrap; margin-top: 0.25rem;
}
.erase-form {
  border: 1px solid var(--fc-danger); border-radius: var(--fc-radius);
  padding: 0.6rem 0.75rem; margin-top: 0.4rem;
  text-align: left;
  /* min() so the floor never exceeds the container: a bare 16rem is 384px at 150%
     text and pushed /account 157px past a 320px screen (WCAG 1.4.10, 2026-11-11). */
  min-width: min(16rem, 100%);
}
.erase-form .help { margin-bottom: 0.4rem; }
.erase-form .cap-input { max-width: none; text-align: left; }
.erase-form .btn { margin-top: 0.4rem; width: 100%; }

/* Compact in WIDTH and padding, never in type size.
 *
 * It set font-size: 0.9rem, which is the "buttons are not the same size"
 * complaint wearing a different hat: a 14.4px cap box beside a 16px button in the
 * same row reads as a rendering fault. A narrow column is a width problem, and the
 * fix for it is max-width — shrinking the text also shrinks the touch target and
 * opts the field out of what the A− / A / A+ control is for.
 */
.cap-input {
  width: 100%; max-width: 9rem; box-sizing: border-box;
  padding: 0.3rem 0.4rem; text-align: right;
}
/* An efforts field holds "low,medium,high", which does not read right-aligned. */
input[name="efforts"], input[name="disabled_reason"] { text-align: left; max-width: 11rem; }
.data-table td .meta { display: block; font-size: 0.75rem; }

/* Admin sections as native disclosures --------------------------------------
   <details>/<summary>, not a JS accordion — the same choice the "What's loaded" panel
   makes. Keyboard operation, the expanded/collapsed state in the accessibility tree, and
   find-in-page all come free, and the sections still work with JavaScript off.

   Only the marker and the spacing are ours. */
/* .fold is the shared page-section disclosure. It was .admin-section, which stopped
   being true the moment the ask page needed one (Kent, 2026-08-15: "add disclosure to
   What's loaded") — the old name is kept as an alias rather than chased through five
   templates in a change about something else. */
.fold, .admin-section {
  border-top: 1px solid var(--fc-line);
  padding-top: 0.5rem;
  margin-bottom: 1.5rem;
}
/* The h2 stays a real heading inside the summary, so the document outline and heading
   navigation are unchanged — a screen-reader user still jumps between sections by
   heading, collapsed or not. */
.fold > summary, .admin-section > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
/* EVERY SELECTOR HERE IS WRITTEN OUT TWICE, and that is deliberate after what happened
   on 2026-08-15: renaming .admin-section to .fold with a regex produced
   `.fold > summary, .admin-section > summary::-webkit-details-marker { display: none }`,
   whose FIRST selector is `.fold > summary` — so every folded section on the ask page
   rendered as an empty bordered strip with no heading and no way to open it.

   A pseudo-element binds to the last simple selector, not to the list, so
   "add the new class before the comma" is wrong in a way that still parses and that
   check-css-classes cannot see. Only rendering the page catches it. */
.fold > summary::-webkit-details-marker,
.admin-section > summary::-webkit-details-marker { display: none; }
.fold > summary h2,
.admin-section > summary h2 { margin: 0.5rem 0; }
/* Our own marker, so it can sit before the heading and rotate. aria-hidden is unnecessary
   because ::before content is not exposed to assistive tech, and <details> already
   announces its own expanded state. */
.fold > summary::before,
.admin-section > summary::before {
  content: "";
  flex: 0 0 auto;
  width: 0.5rem; height: 0.5rem;
  border-right: 0.125rem solid var(--fc-muted);
  border-bottom: 0.125rem solid var(--fc-muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}
.fold[open] > summary::before,
.admin-section[open] > summary::before { transform: rotate(45deg); }
.fold > summary:hover h2,
.admin-section > summary:hover h2 { color: var(--fc-link); }

/* --- Manual scan report: spelling and "checked against" -----------------------
 *
 * Both sections hang off the compliance report but are deliberately NOT styled to
 * look like findings. A misspelling is not a regulatory finding and a source row is
 * not a finding at all; borrowing the .finding severity styling would blur exactly
 * the line these sections exist to draw.
 *
 * All sizing in rem. One hard-coded px font-size silently opts the element out of
 * the site's text-size control. */

.spelling-report, .checked-against {
  margin-top: 2rem; padding-top: 1.25rem;
  border-top: 0.0625rem solid var(--fc-border);
}
.spelling-report h3, .checked-against h3 { margin: 0 0 0.35rem; }
.checked-against h4 { margin: 1.5rem 0 0.35rem; }

/* The misspelled word, monospaced so a doubled letter or a transposition is
 * visible. Underlined as well as coloured — colour alone is not an accessible
 * signal, and here it is carrying the entire meaning of the cell. */
.misspelled {
  font-family: var(--fc-font-mono);
  text-decoration: underline wavy var(--fc-danger);
  text-underline-offset: 0.2rem;
}

/* An excerpt inside a table cell. The block .quote is sized for prose in a report
 * column and is far too heavy here. */
.quote-inline {
  margin: 0.3rem 0 0; padding: 0.3rem 0.6rem;
  font-size: 0.85rem; white-space: normal;
}

/* The document's own title under its citation — supporting detail, not the label. */
.doc-title {
  display: block; color: var(--fc-muted);
  font-size: 0.85rem; margin-top: 0.15rem;
}

/* "—", "unknown", "not confirmed". Muted because an absent date is a real answer
 * and should read as one, rather than looking like a rendering failure. */
.muted { color: var(--fc-muted); }

/* A source that has left the corpus since the scan read it. Tinted, but the row
 * also carries a badge saying so in words: the tint is reinforcement, never the
 * signal. */
.row-missing > td { background: var(--fc-surface); }

/* Citations should not wrap mid-reference; the excerpt column carries the prose. */
.sources-table td:first-child { white-space: normal; min-width: 12rem; }
.spelling-table td:last-child { white-space: normal; min-width: 14rem; }

/* The full-corpus disclosure. Collapsed by default — it is context for the table
 * above it, not a peer of it. */
.corpus-inventory { margin-top: 1.5rem; }

/* History filter bar -------------------------------------------------------
   Wraps rather than scrolls: three controls on one line at desktop, stacked on
   a phone, with no media query — flex-wrap plus a min-width on the search field
   does it, and it stays correct under the A+ text-size control where a media
   query keyed on viewport width would not. */
.history-filter {
  display: flex;
  flex-wrap: wrap;
  /* TOP aligned, not bottom (Kent, 2026-08-09). It was flex-end, and the Search
     field is taller than the other two because it carries help text underneath —
     so the bottoms lined up and "Search", "When" and "Show" sat at three
     different heights, which reads as a layout fault rather than a design.

     Aligning at the top makes the three labels share a line and the three
     controls share a line, because each field is label-then-control with the same
     label metrics. The help text then hangs below its own field, where it belongs,
     instead of pushing its neighbours around. */
  align-items: flex-start;
  gap: 0.75rem 1rem;
  margin: 1rem 0 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius);
  background: var(--fc-surface-alt);
}
.history-filter .filter-field { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
/* The search box takes the slack; the two selects stay their natural width. */
.history-filter .filter-field:first-child { flex: 1 1 16rem; }
/* The label's own metrics, named — because the Filter button has no label and
   still has to sit on the control line rather than the label line. Deriving its
   offset from these means changing the label size moves the button with it,
   instead of leaving a hard-coded nudge that silently goes wrong. All in rem, so
   the text-size control scales it like everything else. */
.history-filter {
  --filter-label-size: 0.9rem;
  --filter-label-line: 1.4;
  --filter-label-block: calc(var(--filter-label-size) * var(--filter-label-line) + 0.2rem);
}
.history-filter label {
  font-weight: 600;
  font-size: var(--filter-label-size);
  line-height: var(--filter-label-line);
  /* The global `label { margin-top: 1rem }` stacks a vertical form, which is right
     there and wrong here: .filter-field already supplies the label-to-control gap,
     so the inherited margin pushed every label 1rem down inside its own box. That
     is what put the Filter button 16px above the control line even with the
     correct offset — measured, not guessed. */
  margin-top: 0;
}
/* No local input recipe here any more — the global rule covers input[type=search].
   It was a nine-declaration copy that had already drifted: it used --fc-line where
   the global rule uses --fc-control-line, so this box missed the 3:1 control
   boundary while every other field on the page met it. */
.history-filter .help { margin: 0; font-size: 0.8rem; }
/* Pushed down by exactly one label block, so Filter and Clear line up with the
   search box and the two selects rather than with the words above them. */
.history-filter .filter-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: var(--filter-label-block);
}

/* Admin answer-tuning panel ------------------------------------------------
   Reuses .filter-field from the history bar rather than defining a parallel set
   of label/control rules — two implementations of "a labelled control in a row"
   is how the two drift apart, which is the same complaint that made select a
   global rule. */
/* Composes .panel for the surface; only the spacing is its own. */
.ask-lab { margin-top: 1rem; padding: 0.5rem 1rem; }
.ask-lab > summary { cursor: pointer; font-weight: 600; }
.ask-lab > summary .meta { font-weight: 400; }
.ask-lab .lab-grid {
  display: grid;
  /* min() so the 16rem floor cannot exceed a phone's usable width — the same
     trap the global responsive block documents. */
  grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
  gap: 0.75rem 1rem;
  margin: 0.75rem 0;
}
/* No local input recipe — the global rule covers input[type=number]. Same
   nine-declaration copy as the history filter had, with the same drifted border
   token. */
.ask-lab .help { margin: 0; font-size: 0.8rem; }

/* The three slots. Same auto-fit recipe as .lab-grid — one setting per column
   on a wide screen, stacking on a narrow one. Width stays the container's job:
   nothing here caps its own max-width. */
.lab-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 0.75rem 1rem;
  margin: 0.75rem 0;
}
.lab-slot {
  border: 1px solid var(--fc-control-line);
  border-radius: var(--fc-radius);
  padding: 0.5rem 0.75rem 0.75rem;
  min-width: 0; /* or a long model name blows the grid track out */
}
.lab-slot > legend { font-weight: 600; padding: 0 0.25rem; }
.lab-slot > legend .meta { font-weight: 400; }
.lab-slot .filter-field + .filter-field { margin-top: 0.5rem; }

/* A disabled slot is DIMMED, never hidden: the settled setting is the most
   important thing on the page. Opacity alone would drag the text under 4.5:1,
   so the surface changes and the text colour does not — and the controls stay
   fully operable, because switching the slot back on is the point. */
.lab-slot-off { background: var(--fc-surface-2); border-style: dashed; }

.lab-enable, .lab-compare { display: grid; grid-template-columns: auto 1fr; gap: 0.375rem; align-items: center; }
.lab-enable > .help, .lab-compare > .help { grid-column: 1 / -1; }
.lab-compare { margin-top: 0.75rem; }

/* Comparison results ------------------------------------------------------ */
.lab-results { margin-top: 1.5rem; }
.lab-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.lab-column {
  background: var(--fc-surface-alt);
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius);
  padding: 0.75rem 1rem;
  min-width: 0;
}
.lab-column > h3 { margin-top: 0; }
.lab-column > h3 .meta { font-weight: 400; font-size: 0.85rem; }
/* The number the whole bench exists for, so it reads as data rather than as
   chrome. --fc-muted clears AA on the panel surface in both themes. */
.lab-cost { font-family: var(--fc-font-mono); font-size: 0.85rem; color: var(--fc-muted); }

/* A finding the settings disagree about. Colour is NOT the only signal — these
   rows are also sorted to the top, so the distinction survives a monochrome
   display and a reader who cannot see the tint (SC 1.4.1). */
.lab-row-differs > * { background: var(--fc-tint-red); }

/* The wrap-up email form. Its own block below the comparison, because it acts on
   the whole session rather than on the answer above it. */
.lab-mail { margin-top: 1.5rem; }

/* What the comparison shows. Set on the same surface as a panel so it reads as
   commentary on the table above rather than as more results. */
.lab-verdict {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--fc-surface-alt);
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius);
}
.lab-verdict > h3 { margin-top: 0; }
.lab-verdict ul { margin: 0 0 0.5rem; padding-left: 1.25rem; }
.lab-verdict li { margin-bottom: 0.35rem; }

/* Set and Reset. Composes .actions for the row; only the spacing inside the
   panel is its own, so the buttons match every other pair in the app. */
.lab-actions { margin-top: 0.75rem; }

/* Keep-this-manual, on the attach page ------------------------------------
   Collapsed by default: the page's job is attaching and asking, and keeping is
   a decision most people make once. Reuses the form control rules rather than
   restating them — the same reasoning that made select a global rule. */
/* Composes .panel for the surface. */
.keep-manual {
  margin: 0.75rem 0 1.25rem;
  padding: 0.5rem 1rem;
}
.keep-manual > summary { cursor: pointer; font-weight: 600; }
.keep-manual-form { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.5rem; }
.keep-manual-form label { font-weight: 600; font-size: 0.9rem; }
.keep-manual-form input[type="text"] {
  font: inherit; font-size: 1rem; padding: 0.45rem 0.6rem;
  border: 1px solid var(--fc-line); border-radius: var(--fc-radius);
  background: var(--fc-surface); color: var(--fc-ink);
  width: 100%; box-sizing: border-box; max-width: 32rem;
}
.keep-manual-form select { max-width: 32rem; }
.keep-manual-form button { align-self: flex-start; margin-top: 0.5rem; }
.keep-manual-form .help { margin: 0 0 0.5rem; }

/* The recurring-cost acknowledgement, above the manuals table. */
.cost-ack p { margin: 0 0 0.6rem; }
.cost-ack .inline-form { margin: 0; }

/* The stale-document list in the admin corpus panel. */
.stale-docs { margin: 0.75rem 0; }
.stale-docs > summary { cursor: pointer; font-weight: 600; }
.stale-docs .help { margin: 0.5rem 0; }

/* Row actions ------------------------------------------------------------- */
/* The manuals table's Actions column, and the pattern for any table like it.
 *
 * Three problems, one shape (Kent, 2026-08-09):
 *
 *  1. "Upload update" did not look like a control. It is a <details> summary,
 *     which browsers render as plain text with a marker — so the one action that
 *     opens a form looked like a caption sitting between two links.
 *  2. The actions had no explanation. What "Retry" retries, and that "Report"
 *     opens the last check rather than making a new one, were guessable at best.
 *  3. Government users are in scope and the site must be ADA-conformant, so an
 *     explanation that only appears on mouse hover is not an explanation.
 *
 * ICON PLUS VISIBLE TEXT, never icon alone. An icon-only control forces every
 * user to learn a private vocabulary, and it is the accessible name that then
 * carries the entire meaning — which is exactly the thing a screen-reader user
 * cannot see to check against. The icon is decoration (aria-hidden); the words
 * are the control's name.
 */
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: flex-start;
}
/* .action is a shared appearance for <a>, <button> and <summary> so the three
   are indistinguishable to a reader, who has no reason to care which one the
   markup needed. */
.action,
.row-actions > details > summary.action {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  /* border-box, as the global button rule has. Without it the min-height below was
     the CONTENT height on an <a class="action">, so a link-action was 40 + padding +
     border = 52px tall beside a 40px <button class="action"> — Upload update beside
     Retry check, measured in Chrome (Kent, 2026-11-10: "not aligned and same size"). */
  box-sizing: border-box;
  /* WCAG 2.2 SC 2.5.8 Target Size (Minimum) is 24x24 CSS px. This is 2.25rem tall
     at the default text size and grows with the text-size control, so it clears
     the floor at every size rather than only at 100%. */
  min-height: var(--fc-control-h);
  padding: 0.3125rem 0.75rem;
  border: 1px solid var(--fc-line);
  border-radius: 0.25rem;
  background: var(--fc-surface);
  color: var(--fc-link);
  /* font: inherit AND an explicit size. The shorthand alone re-inherits the size
     too, so inside .data-table (0.95rem) these rendered at 15.2px beside 16px
     buttons elsewhere — the global rule sets 1rem and this was quietly undoing it.
     Buttons are one size across the app; a table is not an exception. */
  font: inherit;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.action:hover {
  border-color: var(--fc-link);
  text-decoration: underline;
}
.action .action-icon {
  /* Sized in em so the icon tracks the label rather than staying put while the
     text grows — a 1rem icon beside 1.5rem text reads as a rendering fault. */
  width: 1em;
  height: 1em;
  flex: none;
  /* So a hover anywhere on the control resolves to the CONTROL, not to whichever
     path is under the cursor — the same flicker the theme button hit. */
  pointer-events: none;
}
.action.danger { color: var(--fc-danger); }
.action.danger:hover { border-color: var(--fc-danger); }

/* A disabled action stays a real, focusable button with aria-disabled rather
   than becoming a <span> or taking the `disabled` attribute. Both of those drop
   it out of the tab order, so a keyboard or screen-reader user cannot reach it
   to find out WHY it is unavailable — the greyed control is visible to everyone
   except the people who most need the explanation. */
.action[aria-disabled="true"] {
  color: var(--fc-muted);
  background: var(--fc-surface-alt);
  cursor: not-allowed;
  text-decoration: none;
}
.action[aria-disabled="true"]:hover { border-color: var(--fc-line); text-decoration: none; }

/* The disclosure marker is removed because .action supplies its own chevron,
   which rotates with [open]. Two markers on one control is worse than none. */
.row-actions > details { position: relative; }
.row-actions > details > summary.action { list-style: none; }
.row-actions > details > summary.action::-webkit-details-marker { display: none; }
.row-actions > details[open] > summary.action .action-chevron { transform: rotate(180deg); }
.action-chevron { transition: transform 0.15s ease; }
@media (prefers-reduced-motion: reduce) {
  .action-chevron { transition: none; }
}
/* The panel a row's disclosure opens. Out of the flex row so the form is not
   squeezed into a column's width. */
.row-actions > details[open] {
  flex-basis: 100%;
}
.action-panel {
  margin-top: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--fc-line);
  border-radius: 0.25rem;
  background: var(--fc-surface-alt);
  white-space: normal;
}

/* Tooltips ----------------------------------------------------------------
 *
 * NOT the title attribute, and this is the whole point of the component.
 * `title` is the obvious way to add a tooltip and it fails the requirement:
 * it does not appear on keyboard focus, is unreachable on touch, cannot be
 * dismissed, cannot be hovered into, and its timing and appearance are the
 * browser's to decide. For a site that must be ADA-conformant it is decoration.
 *
 * This satisfies WCAG 2.2 SC 1.4.13 Content on Hover or Focus, which has three
 * requirements that are easy to miss:
 *
 *   Dismissible — Escape closes it without moving focus. See app.js.
 *   Hoverable   — the pointer can move into the tooltip without it vanishing,
 *                 which is why the tooltip sits inside the hover target's
 *                 wrapper and has no gap to cross.
 *   Persistent  — it stays until dismissed, focus moves, or the pointer leaves.
 *                 Nothing here is on a timer.
 *
 * The tooltip is referenced with aria-describedby, never aria-label. The visible
 * words are the control's accessible NAME (SC 2.5.3 Label in Name — a voice-input
 * user who says "click Upload update" must actually match it); the tooltip is a
 * DESCRIPTION layered on top. An aria-label here would silently replace the name
 * with the longer text and break that.
 */
.tip-wrap { position: relative; display: inline-flex; }
.tip {
  position: absolute;
  bottom: calc(100% + 0.25rem);
  left: 0;
  z-index: 20;
  width: max-content;
  max-width: min(20rem, 70vw);
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--fc-line);
  border-radius: 0.25rem;
  background: var(--fc-surface);
  color: var(--fc-fg);
  /* Not var(--fc-muted): a tooltip is content, and muted text on a surface is the
     combination check-contrast has already had to fail twice. */
  font-size: 0.875rem;
  line-height: 1.4;
  white-space: normal;
  text-align: left;
  box-shadow: 0 0.125rem 0.5rem rgb(0 0 0 / 0.18);
  /* Hidden from everyone, sighted and not, until shown — the description still
     reaches assistive tech through aria-describedby, which does not require the
     element to be visible. */
  display: none;
}
/* :focus-within covers keyboard focus on the control inside the wrapper, so the
   tooltip appears for a Tab exactly as it does for a hover. */
.tip-wrap:hover .tip,
.tip-wrap:focus-within .tip { display: block; }
/* Escape sets this, and it is cleared when the pointer leaves or focus moves on.
   Without it Escape would close the tooltip and the very next mousemove inside
   the same control would reopen it, which reads as the key not working. */
.tip-wrap[data-tip-dismissed="true"] .tip { display: none; }
/* Once the help pane is open its tooltip has done its job. Focus stays on the button
   after a click, so without this the tip sat over the pane's own heading on a narrow
   screen (browser check, 2026-11-11). */
.tip-wrap .help-button[aria-expanded="true"] + .tip { display: none; }
/* Near the right edge the tooltip would otherwise run off the page; anchoring it
   to the right lets a long description stay on screen. */
.tip-wrap.tip-end .tip { left: auto; right: 0; }
/* Inside a .table-scroll box the tooltip is placed by app.js with position: fixed.
   That box scrolls horizontally, and CSS will not let one axis clip while the other
   stays visible: overflow-x: auto makes overflow-y compute to auto too. So an
   absolutely positioned tooltip opening upward from a row lost its top 35px of 77
   (measured 2026-11-16, message 039). A fixed box is positioned against the
   viewport and escapes that clip. app.js sets top and left on open and again on
   scroll or resize. Only the position changes; the look is the rule above.
   KEEP EVERY ANCESTOR OF A TABLE FREE OF transform, perspective, filter,
   backdrop-filter, contain (paint/layout/strict/content) and will-change naming
   any of them. Each of those makes the ancestor the containing block for fixed
   descendants. The tooltip is then clipped again with nothing here to explain it,
   and make check-a11y cannot catch it. A hover lift on a card or a blurred modal
   backdrop is enough. Checked clean on 2026-11-16: every transform in this file is
   on a leaf decoration. .tip-below is unaffected; it serves the header's help
   button, which is not in a table. */
.tip-wrap.tip-fixed .tip { position: fixed; bottom: auto; right: auto; }

/* Contact form ------------------------------------------------------------ */
/* The disclosure block showing exactly what travels with a message. Monospace and
   scrollable because it is a verbatim payload — diagnostics, or a whole answer
   with its citations — and reflowing it as prose would make it unreadable as the
   record it is. */
.contact-context { margin: 1rem 0; }
.contact-context > summary { cursor: pointer; font-weight: 600; }
.context-block {
  margin: 0.5rem 0 0;
  padding: 0.75rem;
  max-height: 22rem;
  overflow: auto;
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius);
  background: var(--fc-surface-alt);
  font-size: 0.85rem;
  line-height: 1.45;
  white-space: pre-wrap;
  /* Long citation URLs and file names must wrap rather than force the page to
     scroll sideways — the container-owns-the-width rule. */
  overflow-wrap: anywhere;
}
/* The hand-off sits in a form now, so the row needs the spacing the old div had. */
form.answer-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

/* One Save for the manuals table, with the cost consent beside it. */
.table-save {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 0.75rem 0 1.5rem;
}
/* Normal page size, not small print. It was set small and read as something we
   were hoping would go unread — which is the wrong signal on the one control that
   agrees to a recurring charge (Kent, 2026-08-09). */
.cost-ack {
  flex: 1 1 24rem;
  font-size: 1rem;
  line-height: 1.45;
  margin-top: 0;
}

/* Report index. A list, not a table: one link and one sentence of why it exists,
   which is what someone scanning for the right report actually needs. */
.report-list { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.report-list li { padding: 0.6rem 0; border-bottom: 1px solid var(--fc-line); }
.report-list .meta { display: block; margin-top: 0.15rem; }

/* Chart. Sized in rem so the A− / A / A+ control scales it; one hard-coded px
   here would opt the figure out of that. */
.chart { margin: 1rem 0 1.5rem; }
.chart-svg {
  display: block;
  width: 100%;
  height: 14rem;
  color: var(--fc-navy);
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius);
  background: var(--fc-surface-alt);
  padding: 0.5rem;
  box-sizing: border-box;
}
.chart figcaption { margin-top: 0.5rem; color: var(--fc-muted); font-size: 0.9rem; }

/* The Manuals tab, design A "group sidebar" (Kent, 2026-11-10; FEAT-0057).
   The groups down the left, the table on the right. The sidebar is a flex item with
   a basis rather than a fixed width, so at narrow widths (or large text) it wraps
   ABOVE the table instead of squeezing it: flex-wrap plus a large flex-grow on the
   main column is what does that, with no media query. */
.page-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem;
}
.page-head h1 { margin-bottom: 0; }
.manuals-layout {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1.5rem;
  margin-top: 1.25rem;
}
.group-sidebar {
  flex: 1 1 14rem; max-width: 17rem;
  border: 1px solid var(--fc-line); border-radius: var(--fc-radius); padding: 0.75rem;
}
.manuals-main { flex: 999 1 36rem; min-width: 0; }
.sidebar-h {
  margin: 0.25rem 0.4rem 0.6rem; font-size: 0.8rem; letter-spacing: 0.06em;
  text-transform: uppercase;
}
.group-links { list-style: none; margin: 0; padding: 0; }
.group-links a {
  display: flex; justify-content: space-between; gap: 0.5rem;
  /* 2rem tall at the default size and growing with the text-size control, so every
     link clears the 24px target floor (SC 2.5.8) at every size. */
  min-height: 2rem; align-items: center;
  padding: 0.25rem 0.6rem; border-radius: var(--fc-radius);
  color: var(--fc-ink); text-decoration: none;
}
.group-links a:hover { background: var(--fc-surface-2); text-decoration: underline; }
/* The selected view is marked by aria-current AND by weight and colour, never by
   colour alone (SC 1.4.1). */
.group-links a[aria-current="page"] {
  background: var(--fc-surface-alt); color: var(--fc-navy); font-weight: 600;
}
.group-links .count { color: var(--fc-muted); font-variant-numeric: tabular-nums; }
/* Depth as indent, for the eye only: the link's accessible name is the full path. */
.group-links a.indent-1 { padding-left: 1.6rem; }
.group-links a.indent-2 { padding-left: 2.6rem; }
.group-links a.indent-3 { padding-left: 3.6rem; }
.group-links a.indent-4 { padding-left: 4.6rem; }
.group-new {
  display: flex; flex-direction: column; gap: 0.35rem;
  margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--fc-line);
}
.group-new label { margin-top: 0.25rem; }
.group-new label:first-of-type { margin-top: 0; }
.group-new select, .group-new input { width: 100%; box-sizing: border-box; }
.group-new .action { align-self: flex-start; margin-top: 0.35rem; }
.view-head h2 { margin: 0; }
.view-head h2 .meta { font-family: var(--fc-font-sans); font-weight: 400; margin-left: 0.4rem; }
.view-head p { margin: 0.25rem 0 0; }
.group-edit { margin: 0.75rem 0; }
.group-edit-body { padding: 0.25rem 0 0.5rem; }
.group-select { max-width: 20rem; }
/* The rename and move forms sit on one line where there is room. The global `label`
   rule adds margin-top: 1rem, which in a centred flex row pushed the labels below
   the inputs beside them (Kent, 2026-11-10, "goes up and down"), so it is zeroed. */
.group-create {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem;
  margin: 0.75rem 0;
}
.group-create > label { margin-top: 0; }
.manuals-table .manual-link { font-weight: 600; }
.manuals-table .select-col { width: 2rem; }
/* The tick boxes are the only way to pick rows for the bulk bar, so they are drawn
   at 1.25rem — clear of the 24px target floor (SC 2.5.8) — not at the browser's
   13px default. */
.manuals-table .select-col input { width: 1.25rem; height: 1.25rem; margin: 0; }
.bulk-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem;
  margin: 0.75rem 0;
}
.bulk-bar > label { margin-top: 0; }
.bulk-label { font-weight: 600; }
.manuals-table .doc-name .meta { display: block; }
/* The row actions are text links, not bordered buttons (Kent, 2026-11-10: "the
   overly large 4 buttons"). Each is 1.5rem tall and spaced 0.75rem apart, so it
   meets the 24px target size (SC 2.5.8) on its own rather than by exception. */
.row-links { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; }
.row-links a, .row-links .linkish {
  display: inline-flex; align-items: center; min-height: 1.5rem;
}
.row-links .linkish[aria-disabled="true"] {
  color: var(--fc-muted); text-decoration: none; cursor: not-allowed;
}

/* A kept manual's own page, /manuals/{id}. */
.back-link { margin: 0 0 0.5rem; }
.facts {
  display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.25rem;
  margin: 1.25rem 0;
}
.facts dt { font-weight: 600; }
.facts dd { margin: 0; }
.settings-form select { max-width: 24rem; }
.settings-form .btn { margin-top: 1rem; }

/* Help pane (FEAT-0059) ----------------------------------------------------
 * Docs/Prompts/prompt-help-pane-v1.md. Every value here is PROVISIONAL: the pane's
 * width, border and background in both themes, the Help button's place and the Show
 * help switch's look are Jill's to decide (spec § 7). Only existing tokens are used,
 * and the surface is the shared .panel, so no colour here is new and check-contrast
 * already covers every pairing.
 *
 * Three states, all driven by app.js:
 *   - no script: .help-inline is a closed <details> under the page heading;
 *   - narrow (< 52rem): the pane sits where that <details> was, full width, and
 *     pushes the page down — nothing scrolls sideways at 320 CSS px (SC 1.4.10);
 *   - wide: .page-layout becomes two columns, page then pane. The page NARROWS; the
 *     pane is never laid over it, because an overlay can cover the focused element
 *     (SC 2.4.11 Focus Not Obscured). The pane is sticky with its own scroll, so long
 *     help can be read while the page stays put.
 * 52rem is where the login page already goes to two columns (spec § 1.2).
 */

/* [hidden] loses to any display rule of equal or higher specificity, and these carry
   one (.tip-wrap is inline-flex). Without this the "hidden until app.js reveals it"
   controls would show, dead, with JavaScript off. */
.help-button-wrap[hidden],
[data-help-switch-wrap][hidden],
.help-pane[hidden],
.help-inline[hidden] { display: none; }

/* The no-script fallback. A disclosure like the page's other <details>, kept quiet so
   it does not compete with the page's own first control. */
.help-inline { margin: 0.5rem 0 1rem; }
.help-inline > summary { cursor: pointer; font-weight: 600; color: var(--fc-link); }
.help-content > :first-child { margin-top: 0.5rem; }
.help-content p, .help-content ul { margin: 0 0 0.75rem; }
.help-content li { margin: 0.25rem 0; }

/* Icon plus word in the nav and in the footer. The icon is sized in em so it tracks
   the label at every text size, as .action .action-icon does. */
.help-button, #help-switch { display: inline-flex; align-items: center; gap: 0.375rem; }
.help-button .action-icon, #help-switch .action-icon {
  width: 1em; height: 1em; flex: none; pointer-events: none;
}
.help-button { font-weight: 600; }
/* The header is the top of the page, so this tooltip opens downwards. */
.tip-wrap.tip-below .tip { bottom: auto; top: calc(100% + 0.25rem); }

/* The pane. Composes .panel for its surface; only spacing is its own. */
.help-pane {
  box-sizing: border-box;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0 1rem;
  min-width: 0;
  overflow-wrap: anywhere;
}
.help-pane-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap;
}
.help-pane-head h2 { margin: 0; font-size: 1.15rem; }

@media (min-width: 52rem) {
  .page-layout.help-open {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 24rem);
    align-items: start;
  }
  .page-layout.help-open > .help-pane {
    position: sticky;
    top: 1rem;
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    margin: 1rem 1rem 1rem 0;
  }
}
