/* Cabinhub News — API account console.
   Owner: console-ui lane. This page's only stylesheet.

   Rules of the house (docs/DESIGN.md, css/tokens.css, frontend/MOTION.md), reused
   rather than restated:
     - colour, type, spacing, radius and timing come from the tokens only; no hex
       and no literal font-size lives in this file;
     - no shadows — a hairline does the work;
     - no `text-transform: uppercase` and nothing below --fs-micro (the type law,
       tests/type_law.test.mjs, reads every file in css/);
     - only transform and opacity animate, on the motion ramp;
     - light is the default; dark arrives through tokens.css, never here.

   Shape of the page: a rail and a ledger. Sections are separated by one hairline,
   not by a grid of cards. A quota is a level indicator with its number beside it,
   never a traffic light. */

/* ------------------------------------------------------------------ page -- */

.con {
  /* One local measure: the ledger column. The rail is fixed, the content takes
     the rest of --page, and the whole thing is centred on the newsroom's own
     1120px page so the console sits inside the site rather than on top of it. */
  --rail: 208px;
  --gap-rail: clamp(1.5rem, 4vw, 3.25rem);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
}

.con__main {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) var(--pad-r) clamp(2rem, 5vw, 4rem) var(--pad-l);
  flex: 1 0 auto;
}

/* `hidden` is the page's ONE visibility switch: console.js sets the attribute and
   nothing else, so no element can be half-shown. It needs a law here because
   several components below set `display: grid`/`flex` on their own class, and an
   author rule beats the user-agent `[hidden] {display:none}` whatever its
   specificity — which is why the first proof run painted the code form on the
   email step and the error panel at the foot of a healthy account. `.con
   [hidden]` is one class plus one attribute, so it outranks every single-class
   component rule in this file; the only rules with the same weight are the two
   `[hidden]` overrides further down, which agree. It does not reach `.con`
   itself (the page root holds the console) and it uses no !important
   (css/landing.css §19). */
.con [hidden] { display: none; }

.con .dot-sep { color: var(--ink-faint); padding: 0 0.35em; }
.con .eyebrow {
  margin: 0;
  color: var(--ink-faint);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* --------------------------------------------------------------- masthead -- */

.con .mast { border-bottom: 1px solid var(--rule); }
.con .mast__inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(0.7rem, 1.4vw, 1rem) var(--pad-r) clamp(0.7rem, 1.4vw, 1rem) var(--pad-l);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(0.8rem, 2vw, 1.6rem);
}
/* Below ~365px the wordmark plus the three controls cannot share one row: the
   row needs 336px in a 288px content box, so it scrolled 320px pages sideways
   (measured: scrollWidth 352 at a 320 viewport). Wrapping the controls onto
   their own right-aligned line is the phone shape; above that width nothing
   moves. */
.con .mast__mark { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; color: inherit; }
.con .mast__icon { display: block; }
.con .mast__word {
  display: inline-flex;
  gap: 0.34em;
  align-items: baseline;
  font-family: var(--font-brand);
  font-size: var(--fs-mark);
  letter-spacing: -0.01em;
}
.con .mast__word-2 { color: var(--accent); }
.con .mast__kicker {
  margin: 0;
  padding-left: 1rem;
  border-left: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: var(--fs-label);
  line-height: 1.35;
}
/* The switch row reserves its footprint before either script runs, so the
   wordmark cannot move when the two controls mount. */
.con .mast__controls {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--tap);
  min-width: calc(var(--tap) * 3 + 0.5rem);
  justify-content: flex-end;
}
.con .theme-switch { display: inline-flex; }
.con .theme-switch__btn,
.con .locale-switch__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  min-width: var(--tap);
  /* Two CJK glyphs at --fs-label are 26px; 0.7rem padding left 19.6px inside
     the 44px token, so 中文 set on two lines at every width under ~410px.
     0.5rem fits them in the token and nowrap forbids the split if a glyph
     rounds wider. Latin labels were already inside the token. */
  padding: 0 0.5rem;
  white-space: nowrap;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: var(--fs-label);
  cursor: pointer;
  transition: color var(--m-dur-1) var(--ease), border-color var(--m-dur-1) var(--ease),
    background var(--m-dur-1) var(--ease);
}
.con .theme-switch__btn:hover,
.con .locale-switch__btn:hover { color: var(--ink); border-color: var(--ink-faint); }
.con .theme-switch__btn svg { display: block; }
.con .locale-switch { display: inline-flex; }
.con .locale-switch__btn:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.con .locale-switch__btn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; border-left: 0; }
.con .locale-switch__btn[aria-pressed="true"] {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

/* ---------------------------------------------------------------- motion -- */
/* The motion ramp is mirrored here from motion.css because this page does not
   load motion.js (`html[data-motion="on"]` is never set on /console). Values are
   identical: 160 ms one-element change, 240 ms block entrance, 8 px rise,
   Expo-out. */
.con {
  --m-dur-1: 90ms;
  --m-dur-2: 160ms;
  --m-dur-3: 240ms;
  --m-dist-2: 8px;
  --m-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ------------------------------------------------------------------- gate -- */

.gate { display: grid; place-items: start center; padding: clamp(1.75rem, 7vh, 4rem) 0 0; }
.gate__inner { width: 100%; max-width: 26rem; }
.gate__title {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: var(--fs-lead);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.gate__title:focus { outline: none; }
.gate__intro { margin: 0 0 1.5rem; color: var(--ink-soft); font-size: var(--fs-small); line-height: 1.55; }
.gate__note {
  margin: 0 0 1rem;
  padding: 0.6rem 0.75rem;
  border-left: 2px solid var(--rule-strong);
  color: var(--ink-soft);
  font-size: var(--fs-meta);
  line-height: 1.45;
}
.gate__note[data-tone="warn"] { border-left-color: var(--warning); }
.gate__note[data-tone="stop"] { border-left-color: var(--danger); }
.gate__sent { margin: 0 0 1.1rem; color: var(--ink-soft); font-size: var(--fs-meta); }
.gate__addr { color: var(--ink); font-weight: 560; }
.gate__legal {
  margin: 2.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--rule-soft);
  color: var(--ink-faint);
  font-size: var(--fs-micro);
  line-height: 1.5;
}

.form { display: grid; gap: 1rem; }
.form__aux {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-top: 0.25rem;
}

.field { display: grid; gap: 0.4rem; }
.field__label { color: var(--ink-soft); font-size: var(--fs-label); font-weight: 500; }
.field__input,
.field__code {
  width: 100%;
  min-height: var(--tap);
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: 1.3;
  transition: border-color var(--m-dur-1) var(--ease), background var(--m-dur-1) var(--ease);
}
.field__input::placeholder { color: var(--ink-faint); }
.field__input:hover,
.field__code:hover { border-color: var(--rule-strong); }
.field__input:focus-visible,
.field__code:focus-visible { border-color: var(--accent); outline-offset: 1px; }
.field__input[aria-invalid="true"],
.field__code[aria-invalid="true"] { border-color: var(--danger); }
/* The code is digits read one at a time: tabular figures, wide tracking, and a
   size a step up so six characters do not look like a form field left empty.
   It stays ONE field (see console.html), so tracking is the only thing that
   suggests the six positions. */
.field__code {
  font-family: var(--font-mono);
  font-size: var(--fs-sub);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.34em;
  padding-left: calc(0.75rem + 0.1em);
}
.field__error {
  margin: 0;
  color: var(--danger);
  font-size: var(--fs-label);
  line-height: 1.4;
}
.field__error::before {
  /* A hairline diamond, not an emoji and not a colour-only signal: the text
     itself says what went wrong. */
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 0.45em;
  vertical-align: 0.12em;
  background: currentColor;
  transform: rotate(45deg);
}

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

.con .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--tap);
  padding: 0 1.15rem;
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-ui);
  font-size: var(--fs-meta);
  font-weight: 560;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--m-dur-1) var(--ease), border-color var(--m-dur-1) var(--ease),
    transform var(--m-dur-1) var(--ease);
}
.con .btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.con .btn:active { background: var(--accent-press); border-color: var(--accent-press); transform: translateY(1px); }
.con .btn[aria-busy="true"] { cursor: progress; }
.con .btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.con .btn--block { width: 100%; }
.con .btn--quiet {
  background: transparent;
  border-color: var(--rule-strong);
  color: var(--ink);
}
.con .btn--quiet:hover { background: var(--paper-3); border-color: var(--ink-faint); }
.con .btn--small { min-height: var(--tap); padding: 0 0.85rem; font-size: var(--fs-label); }
/* One focus treatment for every control the page draws itself, so a keyboard
   reader meets the same ring on the Send button, the rail links, the Sign out
   text button and the table disclosure. The ring sits clear of the element's
   own 1px border (`outline-offset`) instead of merging into it: without the
   offset the filled primary button's ring and its accent border landed on the
   same pixel and read as a border that had thickened, which is not a focus
   state a reader can distinguish from hover. The two inputs below keep their
   own border-colour rule (they are fields, not buttons) and pair it with this
   same ring. */
.con .btn:focus-visible,
.con .btn--text:focus-visible,
.con .rail__nav a:focus-visible,
.con .data > summary:focus-visible,
.con .picker:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* A text button keeps the 44px hit area (a tap target is not a font size) and
   paints no chrome until it is used. */
.btn--text {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: var(--fs-meta);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-underline-offset: 0.22em;
  cursor: pointer;
}
.btn--text:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
.btn--text[disabled] { color: var(--ink-faint); text-decoration: none; cursor: default; }

/* ---------------------------------------------------------------- shell -- */

.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: var(--gap-rail);
  align-items: start;
}
.shell[hidden] { display: none; }
.gate[hidden] { display: none; }

.rail { position: sticky; top: 1.5rem; display: grid; gap: 0.2rem; }
.rail__name { margin: 0; font-size: var(--fs-title); font-weight: 560; line-height: 1.3; }
.rail__mail { margin: 0.1rem 0 1.4rem; color: var(--ink-soft); font-size: var(--fs-meta); overflow-wrap: anywhere; }
/* Desk: the rail is identity only; the head 200px right states the plan, and a
   third copy here would be the repetition this page is written against. The
   phone block below reverses that (the rail strip IS the identity block). */
.rail__plan { display: none; }
.rail__nav { display: grid; gap: 0.1rem; }
.rail__nav a {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 0.7rem 0 0.75rem;
  border-left: 2px solid transparent;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--ink-soft);
  font-size: var(--fs-meta);
  text-decoration: none;
  transition: color var(--m-dur-1) var(--ease), border-color var(--m-dur-1) var(--ease),
    background var(--m-dur-1) var(--ease);
}
.rail__nav a:hover { color: var(--ink); background: var(--paper-2); }
.rail__nav a[aria-current="true"] { color: var(--ink); border-left-color: var(--accent); font-weight: 560; }
.rail__foot { margin-top: 1.6rem; padding-top: 0.75rem; border-top: 1px solid var(--rule-soft); }

.content { min-width: 0; }
.head { padding-bottom: clamp(1.25rem, 3vw, 1.75rem); }
.head__title {
  margin: 0.3rem 0 0.4rem;
  font-family: var(--font-display);
  font-size: var(--fs-lead);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
}
.head__title:focus { outline: none; }
.head__sub { margin: 0; color: var(--ink-soft); font-size: var(--fs-meta); }


/* ------------------------------------------------------------- sections -- */
/* One hairline between sections, generous air above each heading. No box, no
   shadow, no card: this is a ledger with rules. */
.sec { padding: clamp(1.5rem, 3.5vw, 2.25rem) 0; border-top: 1px solid var(--rule); }
.sec__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.sec__title { margin: 0; font-size: var(--fs-sub); font-weight: 560; letter-spacing: -0.01em; line-height: 1.25; }
.sec__meta { margin: 0; color: var(--ink-faint); font-size: var(--fs-label); }
.sec__tools { display: inline-flex; align-items: center; gap: 0.5rem; }

/* ------------------------------------------------------------- the quota -- */
/* A determinate level indicator, read as: this month's delivered items against
   the plan's quota. The number leads; the track seconds it. The fill is the
   accent at 100% and never turns red — the plan is a fact, and a reader cannot
   act on alarm colour from a page that only reports. */
.quota { display: grid; gap: 0.9rem; }
.quota__line { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.quota__number {
  margin: 0;
  font-size: var(--fs-detail);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
}
.quota__of { margin: 0; color: var(--ink-soft); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; }
.meter {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: var(--paper-3);
  overflow: hidden;
}
.meter__fill {
  position: absolute;
  inset: 0;
  width: 100%;
  border-radius: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  /* Transform only: a width transition would re-lay the section on every
     month change, which the motion law (MOTION.md §3) excludes. */
  transition: transform var(--m-dur-3) var(--m-ease-out);
}
/* The quota line itself, at 100%: a hairline tick so a reader can see what
   "full" means even when the fill is short. */
.meter__rule { position: absolute; top: -2px; bottom: -2px; right: 0; width: 1px; background: var(--rule-strong); }
.quota__meta { margin: 0; color: var(--ink-soft); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- select -- */

/* The box carries the chevron because a native <select> cannot take a pseudo-
   element. The two 5px diagonal gradients it used before met on fractional
   pixels and painted a notched, asymmetric mark — measured at 10x, the two
   halves did not join. A rotated 1.5px border is a drawn line: crisp at every
   DPR and in both palettes, because it takes currentColor from `--ink-soft`
   rather than a baked-in gradient stop. */
.con .picker__box { position: relative; display: inline-flex; }
.con .picker__box::after {
  content: "";
  position: absolute;
  right: 0.95rem;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -5px;
  border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
  transform: rotate(45deg);
  pointer-events: none;
}
.con .picker {
  appearance: none;
  min-height: var(--tap);
  padding: 0 2.2rem 0 0.75rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-meta);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.con .picker:hover { border-color: var(--rule-strong); }
/* While the months are still loading the select is hidden and the box holds a
   bar of exactly the select's own 44px height, so the section head does not
   grow a row when the answer lands. */
.con .skel--picker { width: 9.5rem; height: var(--tap); border-radius: var(--r-sm); }
.con .picker__box:has(.picker[hidden])::after { display: none; }
/* The section head aligns its two children on the text baseline, and a <select>
   contributes the baseline of its own text. A bar contributes none, so the
   browser fell back to the bar's bottom edge and pushed the heading 22 px down:
   the head measured 50.8 px on the loading frame against 44 px loaded. Centring
   the head's children while the picker is a bar keeps the head at the control's
   own 44 px, so nothing below the quota section moves. (The heading itself sits
   ~2 px lower for the length of one request; the sections do not move at all,
   which is what a reader sees as the page jumping.) */
/* Only while the head is a ROW (≥600 px). At 599 and below the head is a
   column, and `align-items: center` would centre the heading and the bar
   horizontally — a loading frame that visibly re-aligns the page. */
@media (min-width: 600px) {
  .sec__head:has([data-month][hidden]) { align-items: center; }
}
/* The literal fractional size for the chart's own micro-label is not used
   anywhere: the cap line and the axis labels take --fs-micro, the floor. */

/* ---------------------------------------------------------------- chart -- */
/* Drawn by js/console.js as inline SVG: one series, one colour. The plot is
   focusable because it scrolls nowhere but its points ARE reachable: each bar
   is a <g> with tabindex, an aria-label carrying its values, and the table in
   <details> is the same data in text. Hover and focus both raise the tip. */
.chart { margin: 0; position: relative; }
.chart__plot { position: relative; width: 100%; }
.chart__plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart__grid { stroke: var(--rule-soft); stroke-width: 1; }
.chart__base { stroke: var(--rule); stroke-width: 1; }
.chart__bar { fill: var(--accent); }
.chart__bar--zero { fill: var(--rule); }
.chart__hit { fill: transparent; cursor: default; }
.chart__band { fill: var(--paper-3); opacity: 0; transition: opacity var(--m-dur-1) var(--ease); }
.chart__col:hover .chart__band,
.chart__col:focus-visible .chart__band { opacity: 0.7; }
.chart__col:focus-visible { outline: none; }
.chart__col:focus-visible .chart__bar { stroke: var(--focus); stroke-width: 2; }
.chart__tick { fill: var(--ink-faint); font-family: var(--font-ui); font-size: var(--fs-micro); }
.chart__cap { margin: 0.5rem 0 0; color: var(--ink-faint); font-size: var(--fs-micro); line-height: 1.5; }
.chart__cap b { color: var(--ink-soft); font-weight: 560; font-variant-numeric: tabular-nums; }
.chart__tip {
  position: absolute;
  z-index: 3;
  min-width: 8rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-xs);
  background: var(--canvas);
  color: var(--ink);
  font-size: var(--fs-label);
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
  pointer-events: none;
  transform: translate(-50%, -100%);
}
.chart__tip[hidden] { display: none; }
/* The above-the-bar placement, flipped: a bar tall enough that the tip would
   leave the plot gets its tip underneath, still anchored to the same point. */
.chart__tip--below { transform: translate(-50%, 0); }
.chart__tip b { display: block; font-weight: 560; }
.chart__tip span { color: var(--ink-soft); }

/* ----------------------------------------------------------- data table -- */
.data { margin-top: 1rem; }
/* --accent is 5.0:1 on --paper but 4.14:1 as 14px text on the section's own
   ground here (measured by axe in the first proof run). --accent-press is the
   same hue one step down and clears AA for body-size text; the hover step goes
   to --ink so the affordance is still visible without borrowing the accent. */
.data > summary {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--accent-press);
  font-size: var(--fs-meta);
  cursor: pointer;
  list-style: none;
}
.data > summary::-webkit-details-marker { display: none; }
.data > summary::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 0.55em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--m-dur-1) var(--ease);
}
.data[open] > summary::before { transform: rotate(45deg); }
.data > summary:hover { color: var(--ink); }

.table-wrap { overflow-x: auto; }
/* The daily table renders nine day rows (js/console.js DAY_ROWS_SHOWN) and the
   count line below it says how many more the month holds. It does NOT scroll.

   This replaced a 26rem scroll cap. Two measurements killed that design:
   (1) 26rem is 416 px and head + 9.56 rows, so the tenth row was sliced through
   its digits at both 1440 and 390; (2) with the cap corrected to exactly nine
   whole rows it became a box that silently held 22 of October's 31 days —
   Chromium's overlay scrollbar reserved its 10 px gutter and painted no thumb
   at all, so the reader had no cue that the box continued. Overflow that shows
   no sign of itself is worse than a longer page.

   `min-height` keeps the box the same height whether the month holds nine days
   or thirty-one, so the sections below do not jump as the reader changes month:
   nine rows is the floor, the button reaches the rest. */
.table-wrap[data-days-wrap] {
  --row-h: 2.475rem;
  --head-h: 2.35rem;
  min-height: calc(var(--head-h) + 9 * var(--row-h));
}
.data__more {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 1rem;
  margin: 0.35rem 0 0;
  padding-top: 0.35rem;
  border-top: 1px solid var(--rule-soft);
}
/* Both halves are 14px, so the count takes --ink-soft (10.4:1 on paper) while
   the control keeps --accent-press: the same split as the chart caption. */
.data__count { color: var(--ink-soft); font-size: var(--fs-meta); }
/* The button's 44px min-height is the tap target; the row's baseline alignment
   would otherwise push the count off-centre against it. */
.data__more .btn--text { margin-block: -0.35rem; }
/* No sticky head any more: the box below no longer scrolls, so there is nothing
   to stick to — a sticky th in a static table only earns a z-index and a paint
   layer for no behaviour. */
.tbl--days thead th { border-bottom: 1px solid var(--rule); }
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-meta);
  font-variant-numeric: tabular-nums;
}
.tbl th,
.tbl td { padding: 0.55rem 0.75rem 0.55rem 0; text-align: left; border-bottom: 1px solid var(--rule-soft); }
.tbl th {
  color: var(--ink-faint);
  font-size: var(--fs-label);
  font-weight: 500;
  white-space: nowrap;
}
.tbl th:last-child,
.tbl td:last-child { padding-right: 0; }
.tbl .num { text-align: right; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--paper-2); }
.tbl td:first-child { color: var(--ink-soft); }
.tbl--endpoints td:first-child { color: var(--ink); font-family: var(--font-mono); font-size: var(--fs-label); }
.tbl__total td { border-top: 1px solid var(--rule); color: var(--ink); font-weight: 560; }

.empty { margin: 0.75rem 0 0; color: var(--ink-faint); font-size: var(--fs-meta); }

/* ----------------------------------------------------------------- keys -- */
/* A list, not a table: each key is two lines on the phone and one row on the
   desk, and the status is a word ("Active", "Expired", "Revoked") so it never
   depends on colour. */
.keys { list-style: none; margin: 0; padding: 0; }
.key {
  display: grid;
  grid-template-columns: minmax(11rem, 1.1fr) minmax(7rem, 0.7fr) minmax(9rem, 0.9fr) minmax(9rem, 0.9fr) auto;
  align-items: center;
  gap: 0.35rem 1.25rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.key:last-child { border-bottom: 0; }
.key__prefix {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--ink);
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}
.key__plan { color: var(--ink-soft); font-size: var(--fs-meta); }
.key__date { color: var(--ink-soft); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; }
.key__label { display: block; color: var(--ink-faint); font-size: var(--fs-micro); margin-bottom: 0.1rem; }
.key__status { display: inline-flex; align-items: center; gap: 0.4rem; font-size: var(--fs-meta); color: var(--ink); }
.key__status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  flex: none;
}
.key__status[data-state="expired"]::before { background: var(--ink-faint); }
.key__status[data-state="revoked"]::before { background: var(--danger); }
.key__status[data-state="revoked"] { color: var(--ink-soft); }

/* ---------------------------------------------------------------- brief -- */
/* The one section a reader composes. The field is the page's own `.field`, so a
   prompt is typed into exactly the control a sign-in code is typed into; only
   the height and the resize handle are new. */
.brief { display: grid; gap: 1.1rem; }
.field__area {
  min-height: calc(var(--tap) * 3);
  padding: 0.7rem 0.75rem;
  resize: vertical;
  line-height: 1.5;
}
.brief__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0;
  color: var(--ink-faint);
  font-size: var(--fs-micro);
  font-variant-numeric: tabular-nums;
}
.brief__meta [data-brief-count][data-over="true"] { color: var(--danger); }
.brief__topics { margin: 0; padding: 0; border: 0; }
.brief__topics > .field__label { padding: 0; margin-bottom: 0.5rem; }
.brief__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.brief__when { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.brief__when .field__input { width: auto; }
.brief__status { margin: 0; min-height: 1.2em; color: var(--ink-soft); font-size: var(--fs-meta); line-height: 1.5; }
.brief__status[data-tone="bad"] { color: var(--danger); }

/* Subject toggles: a real <button> per subject with aria-pressed, so the state
   is announced and the control is in the tab order. No colour alone carries
   "chosen" -- the pressed state changes the border weight and the fill, and the
   text is the subject's own name in the reader's language. */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  min-height: var(--tap);
  padding: 0 0.9rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: var(--fs-label);
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--m-dur-1) var(--ease), color var(--m-dur-1) var(--ease),
    background var(--m-dur-1) var(--ease);
}
.chip:hover { border-color: var(--rule-strong); color: var(--ink); }
.chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 560;
}
.chip[aria-pressed="true"]::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 0.5em;
  vertical-align: 0.08em;
  background: var(--accent);
  transform: rotate(45deg);
}
.chip:disabled { color: var(--ink-faint); cursor: default; }

/* --------------------------------------------------------------- states -- */

.state {
  display: grid;
  justify-items: start;
  gap: 0.6rem;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
}
.state__title { margin: 0; font-size: var(--fs-sub); font-weight: 560; }
.state__body { margin: 0; max-width: 46ch; color: var(--ink-soft); font-size: var(--fs-meta); line-height: 1.5; }

/* Skeletons: the same boxes the finished sections occupy, so the page does not
   move when the answer lands. A slow opacity breath that a reduced-motion reader
   never sees (the media query below removes it).

   The fill is --paper-3, not --paper-2: in the dark palette --paper-2 IS
   --canvas (#1E1915), so a skeleton drawn in it sits invisibly on the ground and
   the loading frame reads as an empty page (seen in the first proof run's
   en-dark-1440-05). --paper-3 is one visible step above the ground in both
   palettes and is a token, so it follows the theme. */
.con { --skel: var(--paper-3); }
/* `display: inline-block` is load-bearing, not decoration: every skeleton is a
   <span> appended by script, and an inline span cannot take the width/height
   that carry the shimmering box. The one place this showed was the loading
   frame — the number, the chart and the table rows painted nothing (the table
   body looked like 5 empty rules) while the key rows did, because a grid item
   is blockified for free. `vertical-align: top` keeps a 2.6rem number block from
   sitting on the text baseline and pushing the line box down. */
.skel {
  display: inline-block;
  vertical-align: top;
  border-radius: var(--r-xs);
  background: var(--skel);
  animation: con-breathe 1.6s var(--ease) infinite;
}
.skel--line { height: 0.7rem; }
.skel--w40 { width: 40%; }
.skel--w60 { width: 60%; }
.skel--w25 { width: 25%; }
.skel--num { height: 2.6rem; width: 7rem; }
.skel--meter { height: 6px; width: 100%; border-radius: 3px; }
.skel--chart { height: 180px; width: 100%; }
/* A real table row is 39.6 px: 0.55rem of cell padding above and below plus a
   22 px line box. The first frame's bar carried its own 0.75rem margins on top
   of that padding and made a 58.6 px row — five of those against nine real
   rows moved By endpoint by 36 px. The bar now IS the line box. */
.skel--row { height: 1.3125rem; width: 100%; margin: 0; }
/* The chart's caption is one 18 px line under an 8 px margin. Sizing the bar to
   its line box keeps the figure at the 216 px the drawn chart occupies, so the
   sections under it do not rise by 26 px when the SVG lands. */
.skel--cap { height: 1.125rem; width: 19rem; max-width: 70%; }
/* A key's loading cells are sized like the cells they become (a mono prefix, a
   short plan name, two dates, a status word), because one 100%-wide bar in a
   five-column grid paints a stub in the prefix column with four empty columns
   beside it. The phone block below re-orders them into the two-column shape the
   finished key takes there. */
.skel--key-prefix { height: 0.9rem; width: 7rem; max-width: 100%; }
.skel--key-plan { height: 0.9rem; width: 3.5rem; max-width: 100%; }
.skel--key-date { height: 0.9rem; width: 5rem; max-width: 100%; }
.skel--key-label { height: 0.55rem; width: 2.75rem; max-width: 100%; }
.skel--key-status { height: 0.9rem; width: 3rem; max-width: 100%; }
/* The cells carry the line-box height so the skeleton row measures what the
   real row measures: 21 px per cell, and the date cell 40.6 px (an 18 px label
   line over a 16-21 px value line). A bar on its own was 14.4 px in a 21 px
   line box, which is why the frame's rows were 44.2 px against 70.4 px. */
.key--skel .skel-cell { display: flex; align-items: center; min-height: 1.3125rem; }
.key--skel .skel-cell--date {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.1rem;
  min-height: 2.5375rem;
}
/* The rail and the head hold real words once the answer lands, so their
   skeletons are sized like the words: a name bar, an address bar, and three
   short bars where the count, the days and the percentage go. Sizing them here
   rather than inline keeps the reduced-motion and dark-palette branches single. */
.skel--name { height: 1.05rem; width: 9rem; max-width: 14rem; }
.skel--mail { height: 0.7rem; width: 12rem; max-width: 16rem; }
.skel--meta { height: 0.7rem; width: 5rem; }
@keyframes con-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* --------------------------------------------------------------- footer -- */

.foot {
  border-top: 1px solid var(--rule);
  padding: 1.25rem var(--pad-r) calc(1.25rem + env(safe-area-inset-bottom, 0px)) var(--pad-l);
  color: var(--ink-faint);
  font-size: var(--fs-label);
}
.foot p {
  max-width: var(--page);
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.foot__link { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--accent-press); text-decoration: none; }
.foot__link:hover { color: var(--ink); }

/* ------------------------------------------------------------- responsive -- */
/* Below 900 px the rail becomes a horizontal strip above the content and the
   navigation sticks under the masthead, so a reader on a phone can move between
   the three sections without scrolling back up. */
@media (max-width: 899px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .rail {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 0.15rem 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--rule);
  }
  .rail__name { grid-column: 1; }
  .rail__mail { grid-column: 1; margin: 0; }
  .rail__plan { display: block; grid-column: 1; margin: 0; color: var(--ink-faint); font-size: var(--fs-label); }
  /* On the phone the head states the page name and nothing else. The rail block
     80px above carries the customer, the address and the plan, and the section
     heading names the month; a third restatement of any of those inside one
     screen is the generated-dashboard tell this page is written against. */
  .head__eyebrow,
  .head__sub { display: none; }
  /* Sign out belongs beside the identity, and the identity is rows 1-2 (name,
     then address) now that the rail carries no eyebrow. At `grid-row: 1 / 3`
     with `align-self: start` it aligns to the name's line box rather than to
     the centre of the two-line block, so the label sits level with the name
     instead of floating between the name and the address. */
  .rail__foot { grid-column: 2; grid-row: 1 / 3; margin: 0; padding: 0; border: 0; align-self: start; }
  /* The head keeps the plan and drops nothing: the rail carries the customer's
     identity (name, address), the head carries the page (eyebrow, h1, plan),
     and neither repeats the other. On the phone the plan moved up into the rail
     block below instead of sitting on its own line 40px lower. */
  .rail__nav {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    position: sticky;
    top: 0;
    z-index: 4;
    margin-top: 0.6rem;
    background: var(--paper);
    border-bottom: 1px solid var(--rule-soft);
  }
  .rail__nav a {
    justify-content: center;
    border-left: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0 0.4rem;
  }
  .rail__nav a[aria-current="true"] { border-bottom-color: var(--accent); }
  .sec { scroll-margin-top: 3.5rem; }
}

@media (max-width: 599px) {
  .con .mast__kicker { display: none; }
  .gate { padding-top: 1.5rem; }
  .key {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem 1rem;
    padding: 1rem 0;
  }
  .key__prefix { grid-column: 1; }
  .key__status { grid-column: 2; grid-row: 1; justify-self: end; }
  .key__plan { grid-column: 1; }
  .key__date { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.15rem 1.25rem; }
  /* The skeleton key follows the same two-column shape as the real one, so the
     phone's loading frame is not five bars stacked in a single column that the
     answer immediately re-flows into a ledger. The date wrappers span both
     columns like `.key__date`, and lay their two bars side by side the way the
     real cell's flex row does, so the phone row height agrees too. */
  .key--skel .skel-cell--prefix { grid-column: 1; }
  .key--skel .skel-cell--status { grid-column: 2; grid-row: 1; justify-self: end; }
  .key--skel .skel-cell--plan { grid-column: 1; grid-row: 2; }
  .key--skel .skel-cell--date {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 1.25rem;
    min-height: 1.3125rem;
  }
  .sec__head { flex-direction: column; align-items: flex-start; }
  .quota__number { font-size: var(--fs-lead); }
  /* The number bar takes the phone's own size. `--fs-lead` is 28 px here and
     `--fs-detail` is 44 px on the desk; a fixed 2.6 rem bar made the phone's
     line box 41.6 px against the answer's 28 px, which moved the whole page up
     13 px the moment the answer landed. */
  .skel--num { height: 1.75rem; }
}

/* Below 600px the command-palette trigger leaves the masthead and floats 44x44
   at the bottom-right (console_palette.css, the `.cmdk__trigger` phone block). It
   is `position: fixed`, so at every scroll position it is painted over whatever
   reaches that corner — measured: table cells, topic chips, the "Show all" toggle
   and the news-brief empty-state line all passed under it. Reserve the trigger's
   lane on the signed-in console so content stops short of the control's left edge
   (44px + its 1rem inset + a 0.5rem gap) at ANY scroll position, not only on the
   last line of the page. Scoped to `#account:not([hidden])` — the only state in
   which the floating control is shown — so the sign-in form keeps the full width. */
@media (max-width: 599px) {
  .con .con__main:has(#account:not([hidden])) {
    padding-right: calc(var(--pad-r) + var(--tap) + 0.5rem);
  }
  .con .con__main:has(#account:not([hidden])) ~ .foot {
    padding-right: calc(var(--pad-r) + var(--tap) + 0.5rem);
  }
}

/* A long endpoint path must break rather than push the table sideways. */
.tbl--endpoints td:first-child { overflow-wrap: anywhere; }

/* ------------------------------------------------------- image analysis -- */
/* The upload lane (js/upload.js). Shape, not decoration: one drop surface, one
   list of answers. Every row reserves its own height so a result landing does
   not push the page (CLS), and the progress bar is a width on a fixed track —
   transform/opacity only, per the motion law. */
.an { display: grid; gap: var(--sp-4); }
.an__zone {
  display: grid;
  justify-items: center;
  gap: var(--sp-1);
  padding: var(--sp-5) var(--sp-4);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--r-md);
  background: var(--paper-2);
  color: var(--ink-soft);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
}
.an__zone:hover,
.an__zone[data-over="1"] { border-color: var(--accent); background: var(--accent-soft); }
.an__zone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.an__drop { font-size: var(--fs-sub); color: var(--ink); }
.an__hint { font-size: var(--fs-meta); }
.an__accept { font-size: var(--fs-micro); color: var(--ink-faint); }
/* The file input is the control the keyboard and the label reach; it is not
   painted, but it must not be `display:none` (a hidden input is not focusable
   and its label click does nothing in some engines). */
.an__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.an__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.an__row {
  position: relative;
  display: grid;
  gap: var(--sp-1);
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-md);
  background: var(--paper);
  /* The reserve is the row's own answer area: a result that lands changes the
     height of its grid area, never the position of the row above it. */
  min-height: 4.5rem;
}
.an__name {
  margin: 0;
  font-size: var(--fs-small);
  color: var(--ink);
  overflow-wrap: anywhere;
}
.an__state { margin: 0; font-size: var(--fs-micro); color: var(--ink-soft); }
.an__state[data-state="failed"] { color: var(--accent); }
/* Progress is a SCALE on a full-width track, never a width transition: the
   motion law lets only transform and opacity animate, and a width keyframe on a
   bar in a list is exactly the reflow that rule exists to stop. */
.an__bar {
  display: block;
  height: 2px;
  /* A grid item stretches to the column, so the track needs no width of its own
     -- and a width would be the mutable property the rule below forbids. */
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--accent);
  border-radius: var(--r-xs);
  transition: transform var(--dur-1) var(--ease), opacity var(--dur-1) var(--ease);
}
.an__bar[data-state="working"] { opacity: 1; }
.an__bar[data-state="done"] { background: var(--rule-strong); }
.an__bar[data-state="failed"] { background: var(--accent); }
.an__facts { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-1) var(--sp-4); margin: 0; }
.an__facts-title,
.an__note { margin: 0; font-size: var(--fs-micro); color: var(--ink-faint); }
.an__facts-title { margin-top: var(--sp-2); }
.an__facts dt { font-size: var(--fs-meta); color: var(--ink-soft); }
.an__facts dd { margin: 0; font-size: var(--fs-meta); color: var(--ink); text-align: end; }
.an__note { margin-top: var(--sp-1); }

/* ------------------------------------------------------- reduced motion -- */
/* One branch, no exceptions: no entrance, no breath, no width transition. The
   metre still shows its value (width is set inline by script, and the reduced
   rule only removes the transition — the value is never animated into place). */
@media (prefers-reduced-motion: reduce) {
  .con *,
  .con *::before,
  .con *::after {
    animation: none !important;
    transition: none !important;
  }
  .skel { opacity: 1 !important; }
  .con .btn:active { transform: none; }
}

/* --------------------------------------------------------- forced colours -- */
@media (forced-colors: active) {
  .meter { border: 1px solid CanvasText; }
  .meter__fill { background: Highlight; forced-color-adjust: none; }
  .key__status::before { background: CanvasText; }
  .chart__bar { fill: CanvasText; }
  .chart__bar--zero { fill: GrayText; }
}

/* The console masthead link is the way back to the reader, and it is the first thing a
   thumb reaches for. Measured on the shipped page with a coarse pointer (2026-11-13):
   204x36 at 390, 235x38 at 768, 257x42 at 1440 — under the 44px floor at every width.
   Scoped to `.con`, so this touches the console page and nothing else; the reader's own
   mast is a different rule in landing.css and is left alone. */
@media (pointer: coarse) {
  .con .mast__mark { min-height: 44px; }
}

.gate__desk {
  width: min(100%, 30rem);
  margin: 2.5rem 0 0;
  padding: 1.6rem;
  background: var(--paper-2);
  border-top: 3px solid var(--accent);
}
.gate__desk h2 { margin: .45rem 0 1rem; font: 600 var(--fs-title)/1.14 var(--font-brand); }
.gate__desk p { color: var(--ink-soft); font-size: var(--fs-small); }
.gate__desk ul { margin: 1.4rem 0 0; padding: 0; list-style: none; }
.gate__desk li + li { border-top: 1px solid var(--rule); }
.gate__desk a, .statement-link { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--accent); font-size: var(--fs-meta); }
@media (min-width: 800px) {
  .gate { grid-template-columns: minmax(0, 26rem) minmax(0, 21rem); justify-content: center; gap: clamp(3rem, 7vw, 6rem); align-items: start; }
  .gate__desk { margin-top: 0; padding: 1.8rem 2rem; }
}
.gate[data-return-desk] { grid-template-columns: minmax(0, 26rem); justify-content: center; }
.gate[data-return-desk] :is(.gate__desk, .gate__legal) { display: none; }
.con:has(.gate[data-return-desk]:not([hidden])) .mast__kicker { display: none; }
