/* Books' own surfaces on Centauri Console: the shell, the data tables, the
   meta lists, the dashboard and the editors groundwork does not ship. Every
   color, size and duration is a Centauri token (src/groundwork/theme/tokens,
   the console profile) or a groundwork contract variable; nothing here is a
   literal. The declarations Centauri asks of a product are in
   docs/DESIGN.md. Dense by intent - these are books, read daily - and never
   under the 24px target floor; on a coarse pointer the base layer pads every
   control to 44px without changing what is drawn. */

/* ---------------------------------------------------------------------------
   THE FIVE DECLARATIONS Centauri asks of a product, read as prose.

   1. THE GROUND
      Cool paper: Centauri's `surface`, a near-white with a trace of navy
      (light) and a near-black (dark). The metaphor is a ledger page - ruled,
      never boxed - so a table sits on the page itself and a hairline does
      the separating. Cards are for the few things that are a thing: a
      receipt's file, a K-1.

   2. THE HUE BUDGET
      Centauri's shipped `ink` preset, unchanged, because a reader attributes
      Books to Computing America:
        264  navy    every ground, rule and text step.
        269  blue    the one interactive color: a link, the selected view's
                     tick, a primary button. Focus is not blue; it is
                     Centauri's achromatic ring.
        29   red     what is late, refused or below zero, and nothing else.
      The solver's success and warning steps say "paid" and "due soon" in
      words; they are statuses, not a fourth and fifth hue.

   3. THE WORST SURFACE
      `surface-alt` in light (oklch 96%), the table header and the
      highlighted row's ground; `card` in dark (oklch 22%). Every text step is
      solved against these by palette.py: body and datum at 4.5:1, strong at
      7:1, strokes and marks at 3:1 - 60 of 60 pairs, `palette.py --check`.
      The accent link measures 5.97:1 on light `surface-alt` and 9.78:1 on
      dark; the critical ink 5.76:1 and 9.18:1.

   4. HOW ABSENCE IS RENDERED
      In words, in the muted ink, because the books' absences are different
      facts: "Not set yet" (a figure nobody has entered), "Upcoming" and
      "Due soon" (a date still ahead), "Nothing to do" (a status with no
      action owed). The one dash (the table layer's data-absent="null") is
      a customer statement's Charges or Payments cell on a line that has
      none, where there is only one kind of nothing. Zero is not absence: $0.00 is drawn in the same ink and
      weight as any other figure, because a balance of nothing is a reading.

   5. THE SIGNATURE OBJECT
      The runway on the dashboard: cash through every dated commitment, drawn
      against its own stated domain of dates and dollars, with the thinnest
      day marked on the line and named in the table. The one region on the
      first screen that leaves the measure.
   --------------------------------------------------------------------------- */

* { box-sizing: border-box; }

/* The room a focus ring needs outside its control: its width plus its
   offset. Every box that scrolls clips at its padding edge, so each one that
   holds focusable things pads by this and pulls back by the same margin. */
:root { --ring-room: calc(var(--centauri-static-focus-width) + var(--centauri-static-focus-offset)); }

/* ---------------------------------------------------------------- type

   The product's four type jobs, on Centauri's ladder. A page has one title;
   a section, a heading; a heading inside a section, a subheading; and the
   small print beside a value - helper text, a caption, a label - is a note.
   Body text is the document default and has no class. */

.type-title {
  margin: 0;
  font-size: var(--text-title-md);
  line-height: var(--text-title-md--line-height);
  letter-spacing: var(--text-title-md--letter-spacing);
  font-weight: var(--text-title-md--font-weight);
  color: var(--color-strong);
}
.type-heading {
  font-size: var(--text-title-sm);
  line-height: var(--text-title-sm--line-height);
  letter-spacing: var(--text-title-sm--letter-spacing);
  font-weight: var(--text-title-sm--font-weight);
  color: var(--color-strong);
}
.type-subheading {
  font-size: var(--text-body);
  line-height: var(--text-body--line-height);
  font-weight: 600;
  color: var(--color-strong);
}
.type-note {
  font-size: var(--text-small);
  line-height: var(--text-small--line-height);
  color: var(--color-muted);
}
/* A sentence keeps a reading measure inside a full-width console page. */
.shell-main p { max-inline-size: 72ch; }

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

   Centauri's shell (centauri.nav.css): one <nav>, a rail at and above 600px
   and a tab bar below it, five destinations, the current one's screens as one
   nested group. What this file adds is what Books carries beside the
   destinations - the brand that goes home, the search box, and the account
   block's books switcher and theme control - and the phone's top row, which
   holds the brand and the same account controls in one disclosure, because
   the tab bar has no seat for them. */

.shell-brand {
  display: flex;
  align-items: center;
  gap: var(--centauri-static-gap-icon);
  min-block-size: var(--centauri-scaled-control-height);
  padding-inline: var(--centauri-scaled-3);
  color: var(--color-strong);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.shell-brand span { font-weight: 400; color: var(--color-muted); }
.shell-brand .shell-brand__firm { font-weight: inherit; color: inherit; }
/* At 320px the full name beside "Account and search" pushed the panel's
   label to three lines; the product's own name is enough to go home by, and
   the link is still called "Computing America Books, the dashboard". */
@media (max-width: 22.5rem) {
  .shell-top .shell-brand__firm { display: none; }
  .shell-top .shell-brand__firm + span { font-weight: 600; color: var(--color-strong); }
}
/* The nav layer truncates a link's text, but the brand is a flex box, where
   text-overflow draws nothing; the words truncate, and the box clips. */
.shell-brand { text-overflow: clip; }
.shell-brand__words { min-inline-size: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.shell-brand { transition: color var(--centauri-static-enter-fast) var(--ease-standard); }
.shell-brand:hover, .shell-brand:active { color: var(--color-strong); text-decoration: none; }

/* The rail's head: the brand, then the collapse control on the same row. */
.shell-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--centauri-scaled-2);
  min-inline-size: 0;
}
.shell-rail-head .shell-brand { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Search is a box in the expanded rail. The collapsed rail is 56px and has
   no room for a field, so search waits for the reader to expand it again. */
.shell-search { position: relative; display: flex; gap: var(--centauri-scaled-2); padding-inline: var(--centauri-scaled-1); }
.shell-search .gw-input { flex: 1; min-inline-size: 0; }
/* The rail's field is the whole control: Enter searches, and the shortcut
   that reaches it from anywhere is printed in it, True Texan Pools' way. */
.centauri-nav .shell-search .gw-input { padding-inline-end: 3.75rem; }
.shell-search__key {
  position: absolute;
  inset-block: 0;
  inset-inline-end: calc(var(--centauri-scaled-1) + var(--centauri-scaled-2));
  margin-block: auto;
  block-size: max-content;
  padding: 0 var(--centauri-scaled-1);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  line-height: var(--text-micro--line-height);
  color: var(--color-muted);
  border: var(--centauri-static-stroke-hairline) solid var(--color-edge);
  border-radius: var(--radius-control);
  pointer-events: none;
}
.shell-search .gw-input:not(:placeholder-shown) ~ .shell-search__key { display: none; }
.centauri-shell[data-rail="collapsed"] .shell-search { display: none; }
.centauri-shell[data-rail="collapsed"] .shell-rail-head { flex-direction: column; }
.centauri-shell[data-rail="collapsed"] .shell-brand span,
.centauri-shell[data-rail="collapsed"] .shell-brand__words { display: none; }

/* The destination list takes the rail's spare height, so the primary action
   and the account block sit at its foot. */
/* It scrolls when a destination's screens outrun a short window, and a
   scroll box clips at its padding edge - which cut off the focus ring drawn
   2px outside each link. The padding is the ring's room (width plus offset),
   and the matching negative margin keeps the list where it was. */
/* A destination is one word and keeps the layer's single truncated line. A
   screen inside it is a phrase - "Owner contributions and draws" - and was
   cut to "Owner contributions and dr…" at the default size, and further
   under a reader's text spacing (WCAG 2.2 SC 1.4.12): it wraps instead. */
.centauri-nav ul ul .centauri-nav__label { white-space: normal; overflow: visible; }

@media (min-width: 600px) {
  .centauri-nav > ul {
    flex: 1 1 auto;
    overflow-y: auto;
    scrollbar-gutter: stable;
    min-block-size: 0;
    padding: var(--ring-room);
    margin: calc(-1 * var(--ring-room));
    /* Not at its foot: there the pull let a scrolled list run under the New
       action below it, half of the last destination drawn beneath it. */
    margin-block-end: 0;
    scroll-padding: var(--ring-room);
  }
}

/* Which books, and the switch to the others, inside the account block. */
.shell-books { display: grid; gap: var(--centauri-scaled-2); padding-inline: var(--centauri-scaled-3); }
.shell-books__name {
  margin: 0;
  font-size: var(--text-small);
  line-height: var(--text-small--line-height);
  color: var(--color-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shell-books form { display: flex; gap: var(--centauri-scaled-2); }
.shell-books select { flex: 1; min-inline-size: 0; }
.centauri-shell[data-rail="collapsed"] .shell-books { display: none; }

.shell-main {
  /* The page's gutter, read by anything that bleeds to the window's edge
     (the dashboard's runway), so the two cannot drift apart. */
  --shell-gutter: var(--centauri-scaled-section);
  padding: var(--shell-gutter);
  /* A grid item defaults to min-width: auto, which lets a wide table push the
     whole document sideways rather than scrolling inside its own wrapper. */
  min-inline-size: 0;
}

/* The phone's top row: the brand, and one disclosure holding search, the
   books switcher and the ways out. Not drawn at and above 600px, where the
   rail carries all of it. */
.shell-top { display: none; }

@media (max-width: 599.98px) {
  /* The tab bar is fixed over the foot of the screen, so a control the
     browser scrolls into view on focus must stop above it, not under it
     (WCAG 2.2 SC 2.4.11). */
  html { scroll-padding-block-end: calc(var(--centauri-static-tabbar-height) + env(safe-area-inset-bottom, 0px) + var(--ring-room)); }
  .centauri-nav .shell-rail-head,
  .centauri-nav .shell-search,
  .centauri-nav .centauri-nav__account { display: none; }
  .shell-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--centauri-scaled-3);
    padding: var(--centauri-scaled-2) var(--centauri-scaled-4);
    border-block-end: var(--centauri-static-stroke-hairline) solid var(--color-hairline);
  }
  .shell-account > summary {
    display: flex;
    align-items: center;
    gap: var(--centauri-static-gap-icon);
    min-block-size: var(--centauri-static-target-coarse);
    padding-inline: var(--centauri-scaled-3);
    color: var(--color-strong);
    cursor: pointer;
    list-style: none;
  }
  .shell-account > summary::-webkit-details-marker { display: none; }
  .shell-account[open] > .shell-account__sheet {
    position: absolute;
    inset-inline: 0;
    z-index: 11;
    display: grid;
    /* A bare track floors at its widest child's min-content, which at 320px
       pushed the open panel, and the page, a pixel past the window. */
    grid-template-columns: minmax(0, 1fr);
    gap: var(--centauri-scaled-4);
    padding: var(--centauri-scaled-4);
    background: var(--color-sheet);
    border-block-end: var(--centauri-static-stroke-hairline) solid var(--color-hairline);
  }
  .shell-account__sheet .shell-books { padding-inline: 0; }
  .shell-account__sheet a,
  .shell-account__sheet button.shell-exit {
    display: flex;
    align-items: center;
    gap: var(--centauri-static-gap-icon);
    min-block-size: var(--centauri-static-target-coarse);
    color: var(--color-muted);
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    text-decoration: none;
  }
  .shell-main { --shell-gutter: var(--centauri-scaled-4); padding: var(--centauri-scaled-5) var(--shell-gutter); }
}

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

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--centauri-scaled-5);
  margin-block-end: var(--centauri-scaled-7);
  flex-wrap: wrap;
}
.page-header h1 { margin: 0; }
/* Eyebrow, title, lede, one over the other: the line under a title is read
   after it, not beside it, which at 1280px put a sentence in a 600px column
   to the right of a one-word title. */
.page-header__title { display: grid; justify-items: start; gap: var(--centauri-scaled-1); min-inline-size: 0; }
/* A record's title with its status beside it, on the title's baseline. */
.page-header__name { display: flex; align-items: center; flex-wrap: wrap; gap: var(--centauri-scaled-2) var(--centauri-scaled-3); }

/* MORE: the record's lesser actions in a menu off its header
   (layout.ts recordActions). A disclosure, so it works without a script; the
   script adds Escape and a click elsewhere to close it. Each action is a row
   of the menu, a destructive one in the critical ink, as groundwork draws it. */
.more-actions { position: relative; }
.more-actions > summary { list-style: none; cursor: pointer; gap: var(--centauri-scaled-1); }
.more-actions > summary::-webkit-details-marker { display: none; }
.more-actions > summary > svg { inline-size: 16px; block-size: 16px; transition: rotate var(--centauri-static-exit-fast) var(--ease-in); }
.more-actions[open] > summary > svg { rotate: 180deg; transition-duration: var(--centauri-static-enter-fast); transition-timing-function: var(--ease-out); }
.more-actions__menu {
  position: absolute;
  inset-block-start: calc(100% + var(--centauri-scaled-1));
  inset-inline-end: 0;
  z-index: 20;
  display: grid;
  min-inline-size: 14rem;
  padding: var(--centauri-scaled-1);
  background: var(--color-sheet);
  border: var(--centauri-static-stroke-hairline) solid var(--color-edge-strong);
  border-radius: var(--radius-panel);
}
.more-actions__menu > form { display: grid; margin: 0; }
.more-actions__menu .gw-button {
  justify-content: flex-start;
  inline-size: 100%;
  border-color: transparent;
  background: none;
  white-space: nowrap;
}
.more-actions__menu .gw-button[data-emphasis="danger"] { color: var(--color-status-critical); }
.more-actions[open] > .more-actions__menu { animation: more-enter var(--centauri-static-enter-fast) var(--ease-out); }
@keyframes more-enter { from { opacity: 0; translate: 0 -4px; } }
@media (prefers-reduced-motion: reduce) {
  .more-actions[open] > .more-actions__menu { animation-duration: 1ms; }
  .more-actions > summary > svg { transition-duration: 1ms; }
}
/* On a phone the actions wrap to the start of the line, where a menu hung off
   the end of its button would run past the screen: it opens in the flow. */
@media (max-width: 599.98px) {
  .more-actions { flex-basis: 100%; }
  .more-actions__menu { position: static; margin-block-start: var(--centauri-scaled-1); }
}

/* What the page is as of - the dashboard's date - above its title. */
.page-header__eyebrow {
  margin: 0;
  font-size: var(--text-small);
  line-height: var(--text-small--line-height);
  font-weight: 600;
  color: var(--color-muted);
}
.page-header__actions { display: flex; gap: var(--centauri-scaled-3); flex-wrap: wrap; }

/* The sentence under a title that says what the page holds: muted, and
   held to a reading measure inside a full-width page. */
.page-header__lede {
  margin: var(--centauri-scaled-2) 0 0;
  max-inline-size: 64ch;
  color: var(--color-muted);
}

/* A destination's screens (layout.ts catalogTiles): True Texan Pools'
   catalog on Centauri's terms. A tile per screen - icon, name, the line
   saying what it is for - on the card ground with a hairline edge and the
   panel corner, and the whole tile is the link, so a reader aims at the tile
   rather than at a word in it. Hover is Centauri's state layer over the
   tile; the edge steps up to the strong edge so the change is not paint
   alone. Two to four across as the page allows, one on a phone. */
.catalog {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.5rem), 1fr));
  gap: var(--centauri-scaled-3);
  max-inline-size: 72rem;
}
.catalog > li { display: flex; min-inline-size: 0; }
.catalog__tile {
  position: relative;
  isolation: isolate;
  flex: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: start;
  column-gap: var(--centauri-scaled-3);
  row-gap: var(--centauri-scaled-1);
  padding: var(--centauri-scaled-4);
  background: var(--color-card);
  border: var(--centauri-static-stroke-hairline) solid var(--color-edge);
  border-radius: var(--radius-panel);
  color: var(--color-prose);
  text-decoration: none;
  transition: border-color var(--centauri-static-exit-fast) var(--ease-in);
}
.catalog__tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: currentColor;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--centauri-static-exit-fast) var(--ease-in);
}
.catalog__tile:hover { border-color: var(--color-edge-strong); transition-duration: var(--centauri-static-enter-fast); transition-timing-function: var(--ease-standard); }
.catalog__tile:hover::after { opacity: var(--centauri-static-state-hover); transition-duration: var(--centauri-static-enter-fast); transition-timing-function: var(--ease-standard); }
.catalog__tile:active::after { opacity: var(--centauri-static-state-pressed); transition-duration: var(--centauri-static-duration-instant); }
.catalog__icon { grid-area: 1 / 1 / 3 / 2; display: flex; padding-block-start: 1px; color: var(--color-accent); }
.catalog__name { grid-area: 1 / 2; font-weight: 600; color: var(--color-strong); }
.catalog__about {
  grid-area: 2 / 2;
  font-size: var(--text-small);
  line-height: var(--text-small--line-height);
  color: var(--color-muted);
}
/* A destination with sections names each with a heading over its own grid;
   the first sits under the page header, the rest leave a section's room. */
.catalog-heading { margin-block: var(--centauri-scaled-7) var(--centauri-scaled-3); }
.page-header + .catalog-heading { margin-block-start: 0; }

/* A guide topic (routes/guide.ts): prose at the reading measure, numbered
   steps with room between them, and a quoted button or field in the weight
   the screen gives its own labels. */
.guide-topic { max-inline-size: 48rem; }
.guide-topic > :first-child { margin-block-start: 0; }
.guide-heading { margin-block: var(--centauri-scaled-7) var(--centauri-scaled-3); }
.guide-steps, .guide-list {
  display: grid;
  gap: var(--centauri-scaled-2);
  margin-block: 0 var(--centauri-scaled-4);
  padding-inline-start: var(--centauri-scaled-6);
  max-inline-size: 72ch;
}
.guide-label { font-weight: 600; }
/* A reference row's name is a phrase, not an id: it wraps like the rest. */
.guide-table tbody th { white-space: normal; }
.guide-back { margin-block-start: var(--centauri-scaled-7); }

/* The New page (routes/hubs.ts): a group per part of the books, side by side
   where there is room and stacked on a phone, each a plain list of what can
   be started. A list of links, not prose, so each carries the 24px target. */
.create-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: var(--centauri-scaled-7) var(--centauri-scaled-section);
  max-inline-size: 64rem;
}
.create-group h2 { margin-block: 0 var(--centauri-scaled-3); }
/* Each a row with its icon, the whole row the link, on Centauri's state
   layer: what can be started reads as a menu to pick from, not as prose. */
.create-list { list-style: none; margin: 0 calc(-1 * var(--centauri-scaled-3)); padding: 0; display: grid; }
.create-list__link {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: var(--centauri-scaled-3);
  min-block-size: var(--centauri-scaled-row-height);
  padding-inline: var(--centauri-scaled-3);
  border-radius: var(--radius-control);
  color: var(--color-strong);
  text-decoration: none;
}
.create-list__link > svg { flex: none; color: var(--color-accent); }
.create-list__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: currentColor;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--centauri-static-exit-fast) var(--ease-in);
}
.create-list__link:hover::after { opacity: var(--centauri-static-state-hover); transition-duration: var(--centauri-static-enter-fast); transition-timing-function: var(--ease-standard); }
.create-list__link:active::after { opacity: var(--centauri-static-state-pressed); transition-duration: var(--centauri-static-duration-instant); }

/* An index of links with a note after each (the reports page): ruled rows,
   no bullets, the thing's name first and strong, any second link and the
   note after it in the running text. */
.link-index { list-style: none; margin: 0 0 var(--centauri-scaled-7); padding: 0; max-inline-size: 52rem; }
.link-index > li {
  padding-block: var(--centauri-scaled-2);
  border-block-end: var(--centauri-static-stroke-hairline) solid var(--color-hairline);
  color: var(--color-muted);
}
.link-index > li:first-child { border-block-start: var(--centauri-static-stroke-hairline) solid var(--color-hairline); }
.link-index > li > a { display: inline-flex; align-items: center; min-block-size: var(--centauri-static-target-min); }
.link-index > li > a:first-child { font-weight: 600; text-decoration: none; }
.link-index > li > a:first-child { transition: color var(--centauri-static-exit-fast) var(--ease-in); }
.link-index > li > a:first-child:hover { text-decoration: underline; transition-duration: var(--centauri-static-enter-fast); transition-timing-function: var(--ease-standard); }
.link-index > li > a:first-child:active { color: var(--color-strong); transition-duration: var(--centauri-static-duration-instant); }
.type-heading + .link-index { margin-block-start: var(--centauri-scaled-3); }

/* Search's places (routes/search.ts): one line each, the name as the link
   and where it lives after it, above the records. */
.search-places { list-style: none; margin: 0 0 var(--centauri-scaled-7); padding: 0; display: grid; gap: var(--centauri-scaled-1); }
.search-places a { display: inline-flex; align-items: center; min-block-size: var(--centauri-static-target-min); font-weight: 600; }

.toolbar {
  display: flex;
  gap: var(--centauri-scaled-3);
  align-items: end;
  flex-wrap: wrap;
  margin-block-end: var(--centauri-scaled-5);
}

/* Views within one screen (layout.ts viewLinks): status filters, settings
   tabs, the pages of payroll. Words in a row, the current one in the strong
   ink with Centauri's tick of selection under it - the same device the rail
   uses for "you are here" - so it reads without color. */
.view-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--centauri-scaled-1) var(--centauri-scaled-5);
  margin: 0 0 var(--centauri-scaled-5);
  padding: 0;
  list-style: none;
  border-block-end: var(--centauri-static-stroke-hairline) solid var(--color-hairline);
}
.view-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: var(--centauri-scaled-row-height);
  /* "All" is 18px of text; a view is a target of its own (WCAG 2.2 SC 2.5.8). */
  min-inline-size: var(--centauri-static-target-min);
  color: var(--color-muted);
  text-decoration: none;
}
.view-links a { transition: color var(--centauri-static-enter-fast) var(--ease-standard); }
.view-links a:hover, .view-links a:active { color: var(--color-strong); }
.view-links a[aria-current="page"] { color: var(--color-strong); font-weight: 600; }
.view-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: calc(-1 * var(--centauri-static-stroke-hairline));
  block-size: 2px;
  background: var(--color-accent);
}

/* A link that is a list item's only element is a list of links, not inline
   text, so each one gets the 24px target of WCAG 2.2 SC 2.5.8 rather than its
   line box. inline-flex keeps it on the text's baseline when words follow it. */
/* A link with a class of its own (a catalog tile, a dashboard row) lays
   itself out and is a target many times that size; this is for a bare one. */
.shell-main li > a:only-child:not([class]) { display: inline-flex; align-items: center; min-block-size: var(--centauri-static-target-min); }

/* "Back to invoices" and its kind: a link that is its paragraph's whole
   content, so it is a control rather than inline text, and gets the 24px
   target of WCAG 2.2 SC 2.5.8. */
/* A link that is a paragraph's whole content - "See the journal entry", "Write
   Bluebonnet Dental an estimate" - is a control standing on its own, not a
   word in a sentence, so it gets the 24px target of WCAG 2.2 SC 2.5.8. */
:is(.back-link, .link-control) { display: inline-flex; align-items: center; min-block-size: var(--centauri-static-target-min); }

/* The one-click report windows: a wrapped row of links above the date fields,
   the window the report is showing marked in the text weight rather than a
   color, so it still reads in greyscale. */
.period-presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--centauri-scaled-2) var(--centauri-scaled-5);
  margin: 0 0 var(--centauri-scaled-4);
  padding: 0;
  list-style: none;
}
/* A list of links is not inline text, so each one gets the 24px target of
   WCAG 2.2 SC 2.5.8 rather than the 18px line box. */
.period-presets a { display: inline-flex; align-items: center; min-block-size: var(--centauri-static-target-min); }
.period-presets a[aria-current="true"] {
  color: var(--color-strong);
  font-weight: 600;
  text-decoration: none;
}

/* A section of a page, and each record in a list of them (a role, a saved
   report, a workflow, a vendor's ACH details): a heading with a hairline
   under it, and nothing boxing it in - Centauri's invariant 5, rules rather
   than boxes. One section after another reads as a divided list. */
.page-section {
  margin: 0 0 var(--centauri-scaled-section);
  padding: 0;
  border: 0;
  min-inline-size: 0;
}
.page-section > :is(h2, h3, legend):first-child {
  inline-size: 100%;
  margin: 0 0 var(--centauri-scaled-4);
  padding: 0 0 var(--centauri-scaled-2);
  border-block-end: var(--centauri-static-stroke-hairline) solid var(--color-hairline);
}

/* ---------------------------------------------------------------- data table

   Centauri's table layer (centauri.table.css) draws every table: the column
   heads as micro labels, the cells, the hairline rules, the hover state and,
   in a container of 600px or less, each row as a labeled record. Every table
   is on it - src/web/table-records.ts writes the attributes on the way out -
   so what follows is only what Books' tables carry beyond the layer: figures,
   dates, totals, tick boxes, and the record of a table with no header. */

/* A report run against a second period is several tables read as one, so
   their money columns share fixed widths and line up down the page. On a
   phone the tables keep that width and scroll inside .table-wrap. */
.data-table--compared { table-layout: fixed; min-width: 40rem; }
.data-table--compared th:first-child { width: 36%; }

/* position: relative makes the wrapper the containing block for anything
   absolutely positioned inside it - the screen-reader-only text in a header
   cell, above all. Without it that text is placed against the page, not the
   wrapper, escapes the horizontal scroll, and widens a phone's page. */
/* A control the browser scrolls into view when it takes focus is aligned by
   its box, not its ring; scroll-padding keeps the ring's room on that edge. */
.table-wrap { overflow-x: auto; position: relative; padding: var(--ring-room); margin: calc(-1 * var(--ring-room)); scroll-padding: var(--ring-room); }

/* The bank review lays itself out on a phone (its own block, further down),
   so its wrapper takes the layer's wide table and is a container of its own
   name, which the layer's record queries do not answer to. */
.centauri-table[data-records="own"] { container-name: own-records; }

.centauri-table caption { padding-block: var(--centauri-scaled-4); color: var(--color-muted); }
/* In a record the table is a block, and a caption left as a table caption
   shrinks to the width of its longest word. */
@container centauri-table (max-width: 600px) {
  .centauri-table:not([data-scroll-x="declared"]) caption { display: block; }
}

/* A total closes its table: the strong rule above it, the heavier weight. The
   layer draws nothing for a footer, which is where a ledger keeps its sums. */
.centauri-table tfoot :is(td, th) {
  padding: var(--centauri-scaled-cell-y) var(--centauri-scaled-cell-x);
  font-weight: 600;
  text-align: start;
  border-block-start: var(--centauri-static-stroke-edge) solid var(--color-edge-strong);
}

/* Row hover is frequent, so it sits in the fastest tier; Centauri's motion
   tokens shorten it under prefers-reduced-motion rather than removing it. A
   row gets hover and deliberately no pressed state: the row is not a
   control, the link inside it is. */
.centauri-table tbody tr > * { transition: background-color var(--centauri-static-enter-fast) var(--ease-standard); }

/* A row's tick box is the whole 24px target of WCAG 2.2 SC 2.5.8, because a
   phone squeezes the row until no spacing exception can hold. */
.data-table td > input[type="checkbox"] {
  inline-size: var(--centauri-static-target-min);
  block-size: var(--centauri-static-target-min);
  margin: 0;
  accent-color: var(--color-accent);
  /* On the text baseline the box sat 3px above its row's middle, the line's
     descent left under it; the table layer's own selection box had the same
     defect and takes the same answer. */
  vertical-align: middle;
}

/* A link that is a cell's whole content - a document number, "Missing: add
   it in Settings" - is a control, not inline text, at any width. */
.data-table td > a:only-child { display: inline-flex; align-items: center; min-block-size: var(--centauri-static-target-min); }

/* A figure (the layer's data-type="number") is set in the mono face and never
   breaks: in a ledger every column of money must hold its decimal, and the
   mono face makes that structural rather than a font feature a later
   stylesheet can drop. Below zero it takes the critical ink, and the
   parentheses say so without the color. */
.data-table [data-type="number"] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: end;
  white-space: nowrap;
}
.data-table [data-type="number"][data-negative="true"] { color: var(--color-status-critical); }

/* "Sep 13, 2026" is one value, and a column narrow enough to break it after the
   comma costs a line on every row while making the date harder to read than the
   two words it takes to hold it. The layer sets a time in the mono face too. */
.data-table [data-type="time"] { white-space: nowrap; }

/* On a phone (Centauri's table layer, a container of 600px or less) a row is
   a record. The layer draws a <th scope="row"> as the record's heading; Books'
   identity cell is a <td data-priority="identity"> (src/web/table-records.ts
   says why), so it is drawn the same way here: across the record, in the
   strong ink, with no label beside it. Totals in a footer are a record too. */
@container centauri-table (max-width: 600px) {
  .centauri-table:not([data-scroll-x="declared"]) td[data-priority="identity"] {
    display: block;
    font-size: var(--text-body);
    line-height: var(--text-body--line-height);
    font-weight: 500;
    color: var(--color-strong);
    white-space: normal;
    overflow-wrap: anywhere;
    margin-block-end: var(--centauri-scaled-1);
  }
  .centauri-table:not([data-scroll-x="declared"]) td[data-priority="identity"]::before { content: none; }
  .centauri-table:not([data-scroll-x="declared"]) tfoot { display: block; }
  .centauri-table:not([data-scroll-x="declared"]) tfoot tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--centauri-scaled-1);
    padding-block: var(--centauri-scaled-3);
    border-block-start: var(--centauri-static-stroke-edge) solid var(--color-edge-strong);
  }
  .centauri-table:not([data-scroll-x="declared"]) tfoot :is(td, th) { border: 0; padding: 0; }
  /* A link in a record is a control on its own line, not inline text in a
     row, so it gets the 24px target (WCAG 2.2 SC 2.5.8). */
  .centauri-table:not([data-scroll-x="declared"]) td a { display: inline-flex; align-items: center; min-block-size: var(--centauri-static-target-min); }
  /* A figure in a record reads after its label, not at the far edge. */
  .centauri-table:not([data-scroll-x="declared"]) td[data-type="number"] { text-align: start; }
  /* The tick box sits beside the heading it chooses. The layer floats it, but
     a record row is a grid and a grid item does not float, so the box took a
     line of its own above its subject; it takes a grid column instead. */
  .centauri-table:not([data-scroll-x="declared"]) tbody tr:has(> td.gw-table__select) {
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: var(--centauri-scaled-3);
  }
  .centauri-table:not([data-scroll-x="declared"]) tbody tr:has(> td.gw-table__select) > * { grid-column: 1 / -1; }
  .centauri-table:not([data-scroll-x="declared"]) tbody tr:has(> td.gw-table__select) > td.gw-table__select { grid-column: 1; float: none; margin: 0; }
  .centauri-table:not([data-scroll-x="declared"]) tbody tr:has(> td.gw-table__select) > td[data-priority="identity"] { grid-column: 2; align-self: center; margin: 0; }
  /* A record that is a name and one unlabeled figure - a statement's line, a
     worksheet's line - reads as one line, the figure at the far edge where a
     ledger keeps it. Stacked, a twenty-line statement became forty. */
  .centauri-table:not([data-scroll-x="declared"]) tr:has(> :first-child[data-priority="identity"] + td[data-type="number"]:not([data-label]):last-child),
  .centauri-table:not([data-scroll-x="declared"]) tfoot tr:has(> td:first-child + td[data-type="number"]:not([data-label]):last-child) {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: var(--centauri-scaled-4);
    align-items: baseline;
  }
  .centauri-table:not([data-scroll-x="declared"]) tr > td[data-type="number"]:not([data-label]):last-child:nth-child(2) { display: block; text-align: end; }
  .centauri-table:not([data-scroll-x="declared"]) tr > td[data-priority="identity"]:first-child:has(+ td[data-type="number"]:not([data-label]):last-child) { margin-block-end: 0; }
}

.row-indent-1 td:first-child { padding-inline-start: var(--centauri-scaled-section); }
.row-indent-2 td:first-child { padding-inline-start: calc(var(--centauri-scaled-section) * 2); }

/* Sub-accounts, on the chart and on the statements. The name cell steps in one
   spacing unit per level by padding alone, so the row stays one row to a screen
   reader (the parent is named in visually hidden text beside the name). Levels
   run to five, the depth the chart allows; a Total line closing a parent is set
   in the heavier weight tfoot uses. */
.data-table td.account-depth-2 { padding-inline-start: calc(var(--centauri-scaled-5) * 2); }
.data-table td.account-depth-3 { padding-inline-start: calc(var(--centauri-scaled-5) * 3); }
.data-table td.account-depth-4 { padding-inline-start: calc(var(--centauri-scaled-5) * 4); }
.data-table td.account-depth-5 { padding-inline-start: calc(var(--centauri-scaled-5) * 5); }
.data-table tr.row--subtotal td { font-weight: 600; border-block-start: var(--centauri-static-stroke-hairline) solid var(--color-edge-strong); }

/* ---------------------------------------------------------------- meta list

   The header facts under a record title - agency, period, due date; statement,
   starting balance, ending balance. These were a single sentence of values run
   together on middots, which made the reader work out which fragment was the
   date and which the money, every time. A definition list says which is which
   once, and gives each value a label a screen reader can announce with it. */

.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--centauri-scaled-3) var(--centauri-scaled-section);
  margin: 0 0 var(--centauri-scaled-7);
}
.meta-list > div { display: flex; flex-direction: column; gap: var(--centauri-scaled-1); }
.meta-list dt {
  font-size: var(--text-small);
  line-height: var(--text-small--line-height);
  color: var(--color-muted);
}
.meta-list dd {
  margin: 0;
  color: var(--color-strong);
  font-variant-numeric: tabular-nums;
}
.meta-list dd.meta-list__figure { font-family: var(--font-mono); }

/* ---------------------------------------------------------------- stats

   Centauri's stat (centauri.chart.css): a label, a figure in mono at the
   title step, one line of context, separated from its neighbor by a rule
   rather than boxed. A figure that has to reach zero takes the critical ink
   until it does, and its context line says so in words. */
.centauri-stats { margin-block-end: var(--centauri-scaled-7); }
.centauri-stat > p { margin: 0; }
.centauri-stat__value[data-negative="true"] { color: var(--color-status-critical); }
/* ---------------------------------------------------------------- forms */

/* Two columns at a reading width, True Texan Pools' form shape: a short
   field beside its partner (city and state, issue and due date), a long one
   across both. Four 14rem tracks across 60rem scattered a form's fields over
   the page, stretched a lone Address field to 960px, and let one long help
   text open a gap under a whole row. Measured over all 32 create and setup
   forms on 2026-10-04: none holds a table, so none needs more. */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: var(--centauri-scaled-5);
  max-width: 40rem;
  /* Without this every field stretches to the tallest in its row, and because
     .gw-field is itself a grid the input absorbs the slack - which put inputs
     of 40, 53, 63 and 71px in a single row of the entity form. Start-aligned,
     each control keeps the control height groundwork gives it. */
  align-items: start;
}

/* A field is label / control / help / problem. Without subgrid each field
   stacks those independently, so a label that wraps to two lines drops its own
   control a line below its neighbours'. Borrowing the parent's rows lines the
   controls up across the whole row; the tighter row-gap is the field's own,
   which a subgrid is allowed to override. */
@supports (grid-template-rows: subgrid) {
  .form-grid { grid-template-rows: auto auto auto auto; }
  .form-grid > .gw-field {
    grid-row: span 4;
    grid-template-rows: subgrid;
    row-gap: var(--centauri-scaled-2);
  }
  .form-grid > .form-actions { grid-row: span 4; align-self: start; }
  /* A row is as tall as its tallest field's part - a checkbox's help text sits
     in the control row - and a control left to stretch drew a 75px select. */
  .form-grid > .gw-field > :is(.gw-input, .gw-select, .gw-textarea) { align-self: start; }
}
.form-grid .gw-field--wide { grid-column: 1 / -1; }
/* In a grid the gap already separates the actions from the fields above them;
   the margin a form's own actions row carries would double it. */
.form-grid > .form-actions { margin-block-start: 0; }

/* A heading and the sentence that introduces its fields, kept together: as two
   separate grid items each took a subgrid row and the gap between them. */
.form-grid > .form-section { grid-column: 1 / -1; margin-block-start: var(--centauri-scaled-5); }
.form-section > * { margin-block: 0 var(--centauri-scaled-3); }

/* A group of fields that does not apply to this business (settings.ts
   entityGroup): folded under its heading, still part of the form, so its
   values submit and are kept. */
.form-grid > .form-fold { grid-column: 1 / -1; margin-block-start: var(--centauri-scaled-3); }
.form-fold > summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--centauri-scaled-2);
  min-block-size: var(--centauri-static-target-min);
  font-weight: 600;
  color: var(--color-strong);
  cursor: pointer;
}
.form-fold > summary > .type-note { font-weight: 400; }
.form-fold > summary { list-style: none; align-items: center; }
.form-fold > summary::-webkit-details-marker { display: none; }
.form-fold > summary > svg { inline-size: 16px; block-size: 16px; rotate: -90deg; transition: rotate var(--centauri-static-exit-fast) var(--ease-in); }
.form-fold[open] > summary > svg { rotate: 0deg; transition-duration: var(--centauri-static-enter-fast); transition-timing-function: var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .form-fold > summary > svg { transition-duration: 1ms; } }
.form-fold > .form-grid { margin-block-start: var(--centauri-scaled-4); }

/* Options that only mean something while the switch above them is on: set in
   and ruled, so they read as that switch's, not as its peers. */
.form-grid > .form-subgroup {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: var(--centauri-scaled-5);
  align-items: start;
  padding-inline-start: var(--centauri-scaled-5);
  border-inline-start: 2px solid var(--color-hairline);
}
.form-subgroup > * { min-width: 0; }

/* A grid item's automatic minimum is its content, and a <select> reports the
   width of its longest option - so one account type named "Accounts receivable
   (A/R)" made its column 391px wide inside a 224px track and pushed the whole
   page 135px sideways. The field is told it may be narrower than its contents,
   and the control is told to stay inside it. */
.form-grid > * { min-width: 0; }
.toolbar > * { min-width: 0; }

/* .gw-field is a grid with an implicit `auto` column, so its track takes the
   select's min-content width and the control overflows whatever box the
   field was given. An explicit minmax(0, 1fr) lets the track be narrower
   than its contents; max-width then has something honest to resolve against. */
.gw-field { grid-template-columns: minmax(0, 1fr); }
.gw-input,
.gw-select { max-width: 100%; }

/* A native checkbox is 13px and exempt from WCAG 2.2 2.5.8 as a user-agent
   control, but the label is what a pointer actually aims at. Making the label
   the target gives the pair the 24px the exception was covering for. */
label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
  display: flex;
  align-items: center;
  gap: var(--centauri-scaled-3);
  min-block-size: var(--centauri-static-target-min);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--centauri-scaled-3);
  margin-block-start: var(--centauri-scaled-7);
}

/* Row editors (invoice/bill lines): a table of inputs. */
.line-editor td { vertical-align: middle; }
.line-editor :is(.gw-input, .gw-select) { min-inline-size: 6rem; }
/* A select is otherwise as wide as its longest option, which pushed the
   amount columns off the right edge of the page. */
.line-editor .gw-select { inline-size: 100%; min-inline-size: 8rem; }
/* The floors add up to what fits a 600px container, where the table layer
   takes over and each line becomes a record. Above that the columns share the
   room; floors that summed to 744px made every editor between 600 and 744px
   scroll, with the rightmost input starting outside the box. */
.line-editor td:first-child .gw-select { min-inline-size: 11rem; }
.line-editor input[inputmode="decimal"] { inline-size: 100%; min-inline-size: 6rem; }
.line-editor .line-editor__desc { min-inline-size: 8rem; inline-size: 100%; }

/* A line editor six or more columns wide (table-records.ts FIELD_ROWS_FROM)
   needs about 66rem as a table. Below that each line is its fields, each
   under its column's micro label, wrapping two to four to a row - every field
   in sight, none scrolled past the box - and a hairline between lines. Its
   wrapper is its own container, not the layer's, so the layer's records never
   apply to it. */
.centauri-table[data-records="fields"] { container-name: line-fields; }
@container line-fields (max-width: 66rem) {
  .line-editor thead { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .line-editor, .line-editor tbody { display: block; }
  .line-editor tbody tr {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(10rem, 100%), 1fr));
    gap: var(--centauri-scaled-3) var(--centauri-scaled-4);
    padding-block: var(--centauri-scaled-4);
    border-block-end: var(--centauri-static-stroke-hairline) solid var(--color-hairline);
  }
  /* Each field is two rows of its line - label, control - shared with its
     neighbors, so a label that wraps does not drop its own control. */
  .line-editor tbody td {
    display: grid;
    grid-row: span 2;
    grid-template-rows: subgrid;
    align-content: start;
    gap: var(--centauri-scaled-1);
    block-size: auto;
    padding: 0;
    border: 0;
  }
  .line-editor tbody td::before {
    content: attr(data-label);
    align-self: end;
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    line-height: var(--text-micro--line-height);
    letter-spacing: var(--centauri-static-label-tracking);
    text-transform: uppercase;
    color: var(--color-muted);
  }
  .line-editor tbody td:not([data-label])::before, .line-editor tbody td[data-label=""]::before { content: none; }
  /* The account (always the first field) and the description carry the longest
     values, so each takes two tracks: a line reads as those two, then the rest. */
  .line-editor tbody td:is(:first-child, :has(.line-editor__desc)) { grid-column: span 2; }
  .line-editor :is(.gw-input, .gw-select), .line-editor td:first-child .gw-select { inline-size: 100%; min-inline-size: 0; }
}


/* ---------------------------------------------------------------- worksheets */

/* The caveat every tax worksheet carries: a note between two rules, read
   before the figures. No colored edge - the words carry it. */
.worksheet-banner {
  padding-block: var(--centauri-scaled-3);
  margin-block-end: var(--centauri-scaled-5);
  border-block: var(--centauri-static-stroke-hairline) solid var(--color-edge);
  color: var(--color-prose);
  max-inline-size: 72ch;
}

/* Every disclosure is at least a 24px target (WCAG 2.5.8): a bare one-line
   summary drew 20px. Zero specificity, so a class that sizes one still wins. */
:where(.shell-main) summary { inline-size: fit-content; min-block-size: var(--centauri-static-target-min); cursor: pointer; }

details.drilldown summary {
  color: var(--color-accent);
}

/* A one-button form inside a table cell. */
form.inline-form { display: inline; }

/* One K-1 or worksheet section, visually separated so each member's copy
   prints as its own block. */
.worksheet-card {
  background: var(--color-card);
  border: var(--centauri-static-stroke-hairline) solid var(--color-hairline);
  padding: var(--centauri-scaled-5);
  margin-block-end: var(--centauri-scaled-5);
  break-inside: avoid;
}

/* ---------------------------------------------------------------- misc */

a {
  color: var(--color-accent);
  text-underline-offset: 2px;
  transition: color var(--centauri-static-enter-fast) var(--ease-standard);
}
a:hover { color: var(--color-strong); text-decoration: underline; }
a:active { color: var(--color-strong); }
hr {
  border: none;
  border-block-start: var(--centauri-static-stroke-hairline) solid var(--color-hairline);
  margin-block: var(--centauri-scaled-7);
}

@media print {
  /* app.css loads last, so these win at equal specificity without !important. */
  .centauri-nav, .shell-top, .page-header__actions, .toolbar, .form-actions { display: none; }
  .centauri-shell { grid-template-columns: minmax(0, 1fr); }
  .shell-main { max-width: none; padding: 0; }
  body { background: var(--color-card); }
}

/* ---------------------------------------------------------------- dashboard

   Direction, held here and stated in dashboard-view.ts: True Texan Pools'
   office on Centauri Console. The page opens on what needs the reader, then
   the four figures as Centauri stats, the runway (the ONE bold region), two
   short lists in panels, and every part of the books as tiles. Corners are
   Centauri's near-square steps, and no pill appears: a pill is for a person,
   and this screen shows money and dates.                                   */


/* The runway: the one region on the page that leaves the measure, and the
   only bordered surface on it. Everything else sits on the page, which is
   what makes this one read as the one that matters. */

.runway {
  margin-block-end: var(--centauri-scaled-section);
  margin-inline: calc(var(--shell-gutter) * -1);
  padding: var(--centauri-scaled-7) var(--shell-gutter) var(--centauri-scaled-5);
  border-radius: 0;
  border-block: var(--centauri-static-stroke-hairline) solid var(--color-hairline);
  background: var(--color-card);
}

.runway__finding {
  margin: 0;
  max-width: 44rem;
  font-family: var(--font-serif);
  font-size: var(--text-title-lg);
  line-height: var(--text-title-lg--line-height);
  font-weight: 400;
  color: var(--color-strong);
  text-wrap: balance;
}

.runway__caveat {
  margin: var(--centauri-scaled-3) 0 0;
  max-width: 44rem;
  color: var(--color-muted);
}

/* The strip is Centauri's chart layer (centauri.chart.css) on a grid of four
   parts: the thinnest day's note above the plot, the stated domain to its
   left, the balance at the horizon to its right, the months under it. The
   marks stretch to the plot; every word is HTML at the ladder's own sizes,
   placed by the percentage the server computed (runway-chart.ts says why). */
.runway__figure {
  --runway-plot: 13rem;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  grid-template-areas: ". notes ." "y plot end" ". x .";
  column-gap: var(--centauri-scaled-3);
  margin-block-start: var(--centauri-scaled-5);
}
.runway__notes { grid-area: notes; padding-block-end: var(--centauri-scaled-2); }
.runway__y {
  grid-area: y;
  position: relative;
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  inline-size: calc(var(--chars) * (1ch + var(--centauri-static-label-tracking)));
}
.runway__plot { grid-area: plot; position: relative; block-size: var(--runway-plot); }
.runway__end { grid-area: end; position: relative; }
.runway__x { grid-area: x; position: relative; font-size: var(--text-micro); line-height: var(--text-micro--line-height); block-size: calc(1lh + var(--centauri-scaled-3)); }

.runway__plot svg { display: block; inline-size: 100%; block-size: 100%; overflow: visible; }
/* One device pixel of rule however far the plot is stretched. */
.runway__plot svg * { vector-effect: non-scaling-stroke; }
.runway__plot .line { stroke-width: 2; }

/* The domain's labels sit level with their gridlines; the end balance with
   the line's last step. */
.runway__y > span {
  position: absolute;
  inset-inline-end: 0;
  inset-block-start: calc(var(--y) * 1%);
  translate: 0 -50%;
  white-space: nowrap;
  max-inline-size: 100%;
}
.runway__end > * { display: block; white-space: nowrap; }
.runway__end > :first-child { margin-block-start: calc(var(--y) * var(--runway-plot) / 100 - 0.5lh); }
/* A month's name starts at its own gridline, as Today starts at the axis, so
   the two never run together however narrow the plot. */
.runway__x > span {
  position: absolute;
  inset-block-start: var(--centauri-scaled-3);
  inset-inline-start: calc(var(--x) * 1%);
  padding-inline-start: var(--centauri-scaled-1);
}
.runway__x > .runway__today { inset-inline-start: 0; }

/* The thinnest day: its figure and date, read away from the nearer edge, and
   a dashed rule down to its point, so the note is joined to the line without
   ever sitting on it. */
.runway__note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--centauri-scaled-3);
  margin: 0;
  margin-inline-start: calc(var(--x) * 1%);
  max-inline-size: none;
}
.runway__note[data-side="end"] { justify-content: end; margin-inline: 0 calc((100 - var(--x)) * 1%); }
.runway__note > .centauri-label { white-space: nowrap; }
.runway__note-value { font-size: var(--text-title-sm); line-height: var(--text-title-sm--line-height); font-weight: 600; color: var(--color-strong); }
.runway__low-rule { stroke: var(--color-strong); stroke-width: 1; stroke-dasharray: 4 4; }
.runway__point {
  position: absolute;
  inset-inline-start: calc(var(--x) * 1%);
  inset-block-start: calc(var(--y) * 1%);
  inline-size: var(--centauri-scaled-3);
  block-size: var(--centauri-scaled-3);
  translate: -50% -50%;
  border-radius: 50%;
  background: var(--color-strong);
  box-shadow: 0 0 0 var(--centauri-static-stroke-edge) var(--color-card);
}

/* Below zero is money the business does not have. */
.runway__zero { stroke: var(--color-status-critical); stroke-dasharray: 6 4; }

/* A filing is dated but has no figure yet, so it marks the top edge of the
   plot rather than a point on the line, which would imply an amount. */
.runway__filing-rule { stroke: var(--color-edge); stroke-dasharray: 2 5; }
.runway__filing {
  position: absolute;
  inset-inline-start: calc(var(--x) * 1%);
  inset-block-start: 0;
  inline-size: 0.625rem;
  block-size: 0.625rem;
  translate: -50% -50%;
  background: var(--color-muted);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.runway__legend {
  display: flex;
  align-items: center;
  gap: var(--centauri-scaled-3);
  margin: var(--centauri-scaled-3) 0 0;
  color: var(--color-muted);
}
/* The same diamond the chart draws, at text size, so the key and the mark are
   recognisably one thing rather than a description of one. */
.runway__legend-key {
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  background: var(--color-muted);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

@media (max-width: 42rem) {
  .runway__finding { font-size: var(--text-title-md); line-height: var(--text-title-md--line-height); }
  .runway__figure { --runway-plot: 10rem; }
}

/* ---------------------------------------------------------------- dashboard: layout */

/* Each part of the page is a block with a section's room under it. */
.dash-block { margin-block-end: var(--centauri-scaled-section); min-inline-size: 0; }
.dash-block > h2 { margin: 0 0 var(--centauri-scaled-4); }
.dash-block > h2 + .page-header__lede { margin-block: calc(-1 * var(--centauri-scaled-2)) var(--centauri-scaled-4); }

/* NEEDS YOU. One panel, a ruled row per thing waiting: its icon in the tone
   that says how pressing it is (critical red for late or wrong, the accent
   for a queue), what is the matter in a line, and the one place it is put
   right at the row's end. The words carry the tone; the color confirms it. */
.attention {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--color-card);
  border: var(--centauri-static-stroke-hairline) solid var(--color-edge);
  border-radius: var(--radius-panel);
  container-type: inline-size;
}
.attention__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--centauri-scaled-2) var(--centauri-scaled-4);
  padding: var(--centauri-scaled-4) var(--centauri-scaled-5);
}
.attention__item + .attention__item { border-block-start: var(--centauri-static-stroke-hairline) solid var(--color-hairline); }
.attention__icon { display: flex; align-self: start; padding-block-start: 1px; color: var(--color-accent); }
.attention__item[data-tone="critical"] .attention__icon { color: var(--color-status-critical); }
.attention__title { display: block; font-weight: 600; color: var(--color-strong); }
.attention__detail { display: block; font-size: var(--text-small); line-height: var(--text-small--line-height); color: var(--color-muted); }
.attention__action,
.panel__board {
  display: inline-flex;
  align-items: center;
  gap: var(--centauri-scaled-1);
  min-block-size: var(--centauri-static-target-min);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.attention__action > svg,
.panel__board > svg { inline-size: 16px; block-size: 16px; transition: translate var(--centauri-static-exit-fast) var(--ease-in); }
.attention__action:hover > svg,
.panel__board:hover > svg { translate: 2px 0; transition-duration: var(--centauri-static-enter-fast); transition-timing-function: var(--ease-out); }
.attention__action,
.panel__board { transition: color var(--centauri-static-exit-fast) var(--ease-in); }
.attention__action:hover,
.panel__board:hover { text-decoration: underline; transition-duration: var(--centauri-static-enter-fast); transition-timing-function: var(--ease-standard); }
.attention__action:active,
.panel__board:active { color: var(--color-strong); transition-duration: var(--centauri-static-duration-instant); }
/* Narrow, the action goes under the words it answers rather than squeezing them. */
@container (max-width: 34rem) {
  .attention__item { grid-template-columns: auto minmax(0, 1fr); }
  .attention__action { grid-column: 2; justify-self: start; }
}
.attention-clear { display: flex; align-items: center; gap: var(--centauri-scaled-3); margin: 0; color: var(--color-muted); }
.attention-clear > svg { color: var(--color-status-success); flex: none; }

/* WHERE YOU STAND: Centauri's stats, a rule between each. A definition list,
   so each figure is read with its label. */
.dash-stats { margin: 0; }
/* A stat is a grid; left to stretch, the tallest one's extra line was shared
   out among its neighbours' rows and their figures dropped below its own. */
.dash-stats > .centauri-stat { align-content: start; }
/* The figures read at the page title's step, one below the runway's
   finding: the page has one focal size, and it is the runway's. */
.dash-stats .centauri-stat__value {
  font-size: var(--text-title-md);
  line-height: var(--text-title-md--line-height);
  letter-spacing: var(--text-title-md--letter-spacing);
}
.dash-stats dd { margin: 0; }
.dash-stats .centauri-stat__value[data-negative="true"] { color: var(--color-status-critical); }

/* THE SHORT LISTS. Two panels side by side where there is room, each a
   heading with its board one link away and rows that are each wholly a
   link: the thing named first, the facts under it, a figure and a chevron
   at the end. */
.panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  gap: var(--centauri-scaled-5);
  align-items: start;
  margin-block-end: var(--centauri-scaled-section);
}
.panel {
  min-inline-size: 0;
  padding: var(--centauri-scaled-4) var(--centauri-scaled-5) var(--centauri-scaled-3);
  background: var(--color-card);
  border: var(--centauri-static-stroke-hairline) solid var(--color-edge);
  border-radius: var(--radius-panel);
}
.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--centauri-scaled-2) var(--centauri-scaled-4);
  margin-block-end: var(--centauri-scaled-3);
}
.panel__head > * { margin: 0; }
.panel__board { font-size: var(--text-small); line-height: var(--text-small--line-height); }
.panel__empty { margin: 0 0 var(--centauri-scaled-3); color: var(--color-muted); }
.panel__foot { margin: var(--centauri-scaled-2) 0 var(--centauri-scaled-1); }

.rows { list-style: none; margin: 0 calc(-1 * var(--centauri-scaled-3)); padding: 0; }
.rows > li + li { border-block-start: var(--centauri-static-stroke-hairline) solid var(--color-hairline); }
.rows__row {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  /* The figure and the chevron stand on the title's line, and come after it
     in the source too, so the order read is the order drawn. */
  grid-template-areas: "title figure go" "meta . .";
  column-gap: var(--centauri-scaled-3);
  row-gap: 2px;
  padding: var(--centauri-scaled-3);
  border-radius: var(--radius-control);
  color: var(--color-prose);
  text-decoration: none;
}
.rows__row::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: currentColor;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--centauri-static-exit-fast) var(--ease-in);
}
.rows__row:hover::after { opacity: var(--centauri-static-state-hover); transition-duration: var(--centauri-static-enter-fast); transition-timing-function: var(--ease-standard); }
.rows__row:active::after { opacity: var(--centauri-static-state-pressed); transition-duration: var(--centauri-static-duration-instant); }
.rows__title { grid-area: title; font-weight: 600; color: var(--color-strong); overflow-wrap: anywhere; }
.rows__title > .gw-badge { margin-inline-start: var(--centauri-scaled-2); vertical-align: 1px; }
.rows__meta { grid-area: meta; font-size: var(--text-small); line-height: var(--text-small--line-height); color: var(--color-muted); }
.rows__figure {
  grid-area: figure;
  align-self: baseline;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--color-strong);
  white-space: nowrap;
}
.rows__go { grid-area: go; align-self: center; display: flex; color: var(--color-subtle); }
.rows__title, .rows__figure { align-self: baseline; }
.rows__go > svg { inline-size: 16px; block-size: 16px; }
.rows__row:hover .rows__go { color: var(--color-strong); }

/* The thinnest day, marked in the table as well as on the line - its badge
   says so in words, so the tint is not the only signal. */
.data-table tr.row--lowest td { background: var(--color-surface-alt); }

/* The highlighted row fills with `surface-alt`, which is the worst ground
   Centauri's palette solver places every text role against - so the accent
   link and the critical ink below both clear 4.5:1 on it in both themes
   without a per-theme override. Carbon's tokens were specified against the
   plain layer and needed one; these do not. Hover moves to the strong ink so
   the state still changes. */
.data-table tr.row--lowest td a { color: var(--color-accent); }
.data-table tr.row--lowest td a:hover,
.data-table tr.row--lowest td a:active { color: var(--color-strong); }

/* "Not set yet" is a third state, distinct from zero and from empty. */
.table-cell--unset { color: var(--color-muted); }

@media print {
  .runway { margin-inline: 0; border: var(--centauri-static-stroke-hairline) solid var(--color-edge-strong); break-inside: avoid; }
  .panels { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- skip link

   The skip link is the first thing a keyboard reaches, and groundwork's
   .gw-sr-only has no focus reveal - so it stayed invisible even while
   focused, which is a Focus Visible failure (WCAG 2.4.7) on the one control
   that exists for keyboard users. Revealed here rather than in the vendored
   theme file, so a groundwork update does not overwrite it. */
a.gw-sr-only:focus {
  position: fixed;
  inset-block-start: var(--centauri-scaled-3);
  inset-inline-start: var(--centauri-scaled-3);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  inline-size: auto;
  block-size: auto;
  min-block-size: 2.5rem;
  margin: 0;
  padding: var(--centauri-scaled-3) var(--centauri-scaled-5);
  overflow: visible;
  clip-path: none;
  background: var(--color-card);
  color: var(--color-accent);
  outline: 2px solid var(--centauri-ring);
  outline-offset: 0;
}

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

   groundwork draws every emphasis and every state (src/groundwork/theme/
   components.css). The one thing this app adds: a form's submit with no
   emphasis of its own is the action the form exists for, so it is primary. */
.form-actions > .gw-button[type="submit"]:not([data-emphasis]) {
  border-color: transparent;
  background: var(--gw-action);
  color: var(--gw-action-ink);
}
.gw-button { text-decoration: none; }

/* ---------------------------------------------------------------- notices

   groundwork's notice is a flex ROW, so a notice carrying a second paragraph
   put its detail BESIDE the headline rather than under it - which is what the
   settings notices were doing. Every notice in this app is paragraphs only,
   so they stack; __more brings its own top margin. */
/* Stacked, not a row: the supporting line belongs under the headline, not
   beside it. The trailing space is the notice's own - groundwork sets none,
   so without it the first field label sits 9px off the bar. */
.gw-notice { flex-direction: column; gap: 0; margin-block-end: var(--centauri-scaled-7); }

/* ---------------------------------------------------- the date field's button

   `<input type="date">` carries a calendar button the browser draws itself.
   Left alone it is the one part of a styled field that still belongs to
   Chrome. This takes the icon (`::-webkit-calendar-picker-indicator` is
   non-standard and Chromium/WebKit only, so the field degrades to the native
   button elsewhere) and keeps the browser's own panel behind it - the panel
   is a better date picker than a hand-rolled one, and it is the one the
   phone already knows. `cursor: pointer` because it is the only clickable
   thing inside the field. */
input[type="date"].gw-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--centauri-static-enter-fast) var(--ease-standard);
}
input[type="date"].gw-input::-webkit-calendar-picker-indicator:hover { opacity: 1; }

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

   Left alone, a <select> is drawn by the operating system: a different
   control on macOS, Windows and Android, sitting in a designed form. This
   replaces the chrome and keeps the native element, so the keyboard and the
   phone's own picker still work. The alternative to the hex below is a
   wrapper element around every hand-written select. */
/* DEVIATION from tokens-only: `background-image` cannot read `currentColor`
   or a `var()` color, so the chevron's fill is written as the hex of
   `--color-strong` in each theme (tokens/centauri.css: #171a24 light,
   #e4f0fb dark), keyed to the same three states the tokens use: light by
   default, dark by preference unless light was chosen, dark when chosen. */
:root {
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 11 3 6l.7-.7L8 9.6l4.3-4.3L13 6Z' fill='%23171a24'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 11 3 6l.7-.7L8 9.6l4.3-4.3L13 6Z' fill='%23e4f0fb'/%3E%3C/svg%3E");
  }
}
:root[data-theme="dark"] {
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 11 3 6l.7-.7L8 9.6l4.3-4.3L13 6Z' fill='%23e4f0fb'/%3E%3C/svg%3E");
}

.gw-select {
  appearance: none;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right var(--centauri-scaled-5) center;
  background-size: 1rem 1rem;
  padding-inline-end: calc(var(--centauri-scaled-section) + var(--centauri-scaled-5));
  /* Console's control height, the one a text field and a button already
     draw at: groundwork's padding put a select at 34px beside 28px inputs,
     so no row of fields lined up. A coarse pointer still gets its 44px hit
     area from the base layer, without changing what is drawn. */
  block-size: var(--centauri-scaled-control-height);
  padding-block: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---------------------------------------------------------------- browser surfaces

   The three surfaces the browser draws itself, which belong to no design
   system until somebody claims them. */

.table-wrap { scrollbar-width: thin; }

/* Windows high-contrast mode replaces every colour above with the user's own,
   and drops backgrounds entirely. Anything this app said with a fill alone -
   the selected nav item, a status tag, the thinnest-day row - says nothing
   there, so each one is restored with a border, which forced-colors keeps. */
@media (forced-colors: active) {
  .gw-button {
    border: 1px solid ButtonText;
  }
  .gw-button:hover,
  .gw-button:focus-visible {
    border-color: Highlight;
    color: Highlight;
  }
  .runway__legend-key {
    background: CanvasText;
  }
}

/* ---------------------------------------------------------------- review queue */
/* One row per bank line: tick, date, description, amount, the choice, actions.
   The choice stacks account over brand and payee so a row stays one line of
   figures tall enough to read, rather than a card per line. */

.review__bulk { align-items: center; }
.review__remember {
  display: inline-flex;
  gap: var(--centauri-scaled-3);
  align-items: center;
  color: var(--color-muted);
}

.review__table td { vertical-align: middle; }
.review__pick { inline-size: 2rem; }
.review__pick input { inline-size: var(--centauri-static-target-min); block-size: var(--centauri-static-target-min); }
.review__desc { min-inline-size: 14rem; overflow-wrap: anywhere; }
.review__feed {
  display: block;
  margin-block-start: var(--centauri-scaled-1);
  color: var(--color-muted);
}
.review__desc .gw-badge { margin-inline-start: var(--centauri-scaled-2); }
/* Which rule filled the row in, so a wrong suggestion can be traced to it. */
.review__because {
  display: block;
  margin-block-start: var(--centauri-scaled-1);
  color: var(--color-muted);
}

.review__choice {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) minmax(7rem, 1fr) auto;
  grid-template-areas:
    "account account record"
    "brand   party   party";
  gap: var(--centauri-scaled-2) var(--centauri-scaled-3);
  align-items: end;
  min-inline-size: 22rem;
}
.review__account { grid-area: account; }
.review__record { grid-area: record; }
.review__brand { grid-area: brand; }
.review__party { grid-area: party; }
/* With no brands the payee takes the whole second row. */
.review__choice:not(:has(.review__brand)) .review__party { grid-column: 1 / -1; }
.review__more {
  display: flex;
  flex-wrap: wrap;
  gap: var(--centauri-scaled-1);
  margin-block-start: var(--centauri-scaled-3);
  margin-inline-start: calc(-1 * var(--gw-space-4));
}
.review__label {
  display: block;
  color: var(--color-muted);
  margin-block-end: var(--centauri-scaled-1);
}

.review__more .gw-button { white-space: nowrap; }

/* The match suggestion sits under its line, visibly attached to it. */
.review__has-match td { border-block-end: none; }
.review__match td {
  padding-block-start: 0;
  background: var(--color-card);
}
.review__match p { margin: 0; color: var(--color-muted); }

/* Split editor: the account takes the room, the amount and brand stay narrow. */
.split-editor td:nth-child(1) { inline-size: 40%; }
.split-editor td:nth-child(2) { inline-size: 9rem; }
.split-editor td:nth-child(3) { inline-size: 11rem; }
.split-editor :is(.gw-input, .gw-select) { inline-size: 100%; min-inline-size: 0; }
.split-editor__foot, .line-editor__foot { align-items: center; margin-block-start: var(--centauri-scaled-3); }
.opening-table td { vertical-align: middle; }
.opening-table td:nth-child(2) { inline-size: 11rem; }
.opening-date { max-inline-size: 20rem; }
.opening-table .gw-input { inline-size: 100%; min-inline-size: 0; text-align: end; }

/* In a narrow container each bank line stacks: tick, date and amount on one
   line, the description under them, then the choice - no sideways scrolling.
   Its own container, like every other table, rather than the window. */
@container own-records (max-width: 42rem) {
  .review__table thead { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
  .review__table, .review__table tbody, .review__table td { display: block; }
  .review__table tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    border-block-end: var(--centauri-static-stroke-hairline) solid var(--color-hairline);
    padding-block: var(--centauri-scaled-3);
  }
  /* The layer gives a cell the row height, which a table cell grows past and
     a block does not: as blocks, each line's parts overlapped the next. */
  .review__table td { border: none; padding: var(--centauri-scaled-2) var(--centauri-scaled-3); block-size: auto; }
  .review__table td.review__desc,
  .review__table tr > td:last-child { grid-column: 1 / -1; }
  .review__table td[data-type="number"] { grid-row: 1; grid-column: 3; }
  .review__desc { min-inline-size: 0; }
  .review__choice { min-inline-size: 0; }
  .review__more { margin-inline-start: 0; }
}

/* ---------------------------------------------------------------- receipts */

.receipts { margin-block: var(--centauri-scaled-section); }
/* In-page links land below the sticky header, not under it. */
h2[id], section[id] { scroll-margin-block-start: 4.5rem; }
/* A section heading sits with what it introduces, not halfway between that and
   the section before, which is where the browser's equal h2 margins put it.
   :where() keeps both rules at zero specificity, so any class rule that already
   spaces a heading, or the element after one, still wins. */
:where(.shell-main) h2 { margin-block: var(--centauri-scaled-section) var(--centauri-scaled-3); }
:where(.shell-main h2) + * { margin-block-start: 0; }
.receipts__list { list-style: none; margin: 0 0 var(--centauri-scaled-5); padding: 0; }
.receipts__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--centauri-scaled-3) var(--centauri-scaled-5);
  padding-block: var(--centauri-scaled-3);
  border-block-end: var(--centauri-static-stroke-hairline) solid var(--color-hairline);
}
.receipts__item a { overflow-wrap: anywhere; }
.receipts__meta { color: var(--color-muted); }
.receipts__item form { margin-inline-start: auto; }
.receipts__add { align-items: flex-end; }

/* ---------------------------------------------------------------- public pages */

/* The invoice pay page: one column, nothing around it. */
.public-page {
  max-width: 36rem;
  margin: 0 auto;
  padding: calc(var(--centauri-scaled-section) * 2) var(--centauri-scaled-5);
  display: grid;
  gap: var(--centauri-scaled-5);
}
.public-page h1, .public-page h2, .public-page p { margin: 0; }
.public-page .meta-list { margin: 0; }
.public-page .gw-button { justify-self: start; }

/* Budget grid: twelve months and a year total per account. The account column
   stays put while the months scroll under it, so a row is never read without
   its name; the boxes are just wide enough for $99,999.99. */
.budget-grid th[scope="row"] {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  inline-size: var(--budget-grid-account);
  min-inline-size: var(--budget-grid-account);
  white-space: normal;
  font-weight: 400;
  background: var(--color-card);
}
.budget-grid td { padding-inline: var(--centauri-scaled-2); vertical-align: middle; }
/* The full month name each header carries for a screen reader is absolutely
   positioned; anchored here it scrolls inside the grid instead of widening the page. */
.budget-grid thead th { position: relative; }
.budget-grid {
  --budget-grid-account: 14rem;
}
/* A box Tab moves to stops beside the pinned account column, never under it
   (WCAG 2.2 SC 2.4.11): the margin is that column, padding included. */
.budget-grid .gw-input {
  inline-size: 6.5rem;
  min-inline-size: 0;
  text-align: end;
  scroll-margin-inline-start: calc(var(--budget-grid-account) + 2 * var(--centauri-scaled-5) + var(--centauri-scaled-2));
}
@media (max-width: 42rem) {
  .budget-grid { --budget-grid-account: 7rem; }
}
.budget-grid td.budget-grid__year .gw-input { inline-size: 7.5rem; font-weight: 600; }
/* "Worse than plan" is one verdict; wrapping it doubles every row of the report. */
.budget-standing { white-space: nowrap; }

/* ---------------------------------------------------------------- setup
   The business-type choice and the partner rows. Each fieldset spans the form
   and lays its own children out, because the form grid's four-row subgrid is
   for a single field. */
.form-grid > .setup-fieldset {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: var(--centauri-scaled-4);
  min-width: 0;
}
.setup-fieldset > legend { padding: 0; margin-block-end: var(--centauri-scaled-3); }
.setup-fieldset[data-invalid="true"] { border-inline-start: 2px solid var(--color-status-critical); padding-inline-start: var(--centauri-scaled-4); }
.setup-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: var(--centauri-scaled-3);
  align-items: center;
  overflow-wrap: anywhere;
}
.setup-choice__input { inline-size: var(--centauri-static-target-min); block-size: var(--centauri-static-target-min); margin: 0; accent-color: var(--color-accent); cursor: pointer; }
.setup-choice__label { cursor: pointer; }
.setup-choice .gw-field__help { grid-column: 2; margin: 0; }
.setup-partner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: var(--centauri-scaled-4);
  align-items: start;
}

/* ---------------------------------------------------------------- getting started */
/* True Texan Pools' "Today" card: one panel, its heading and the count on
   one line, each step a ruled row with a mark - a circle to do, a ticked
   circle done - and its link, the done steps quieter but still there. */
.getting-started {
  display: grid;
  gap: var(--centauri-scaled-2);
  margin-block-end: var(--centauri-scaled-section);
  padding: var(--centauri-scaled-4) var(--centauri-scaled-5);
  background: var(--color-card);
  border: var(--centauri-static-stroke-hairline) solid var(--color-edge);
  border-radius: var(--radius-panel);
}
.getting-started > :is(form, .panel__head) { margin: 0; }
/* A quiet button's label sits inside its own padding; pulled back by it, the
   label lines up with the steps above. */
.getting-started > form > .gw-button { margin-inline-start: calc(-1 * var(--centauri-scaled-control-x)); }
.getting-started__list { list-style: none; margin: 0; padding: 0; display: grid; }
.getting-started__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--centauri-scaled-3);
  padding-block: var(--centauri-scaled-3);
  overflow-wrap: anywhere;
}
.getting-started__item + .getting-started__item { border-block-start: var(--centauri-static-stroke-hairline) solid var(--color-hairline); }
.getting-started__mark { display: flex; padding-block-start: 1px; color: var(--color-subtle); }
.getting-started__item[data-done="true"] .getting-started__mark { color: var(--color-status-success); }
.getting-started__text > a { font-weight: 600; }
.getting-started__item[data-done="true"] .getting-started__text > a { font-weight: 400; color: var(--color-muted); }
.getting-started__detail { display: block; font-size: var(--text-small); line-height: var(--text-small--line-height); color: var(--color-muted); }

/* A list of notes read one after another - what an import found - ruled
   between rows, no box: plain sentences, not links. */
.note-list { list-style: none; margin: 0; padding: 0; }
.note-list li { padding-block: var(--centauri-scaled-3); border-block-end: var(--centauri-static-stroke-hairline) solid var(--color-hairline); }

/* ---------------------------------------------------------------- QuickBooks import */
.import-steps { list-style: decimal; padding-inline-start: var(--centauri-scaled-7); display: grid; gap: var(--centauri-scaled-7); max-width: 60rem; }
.import-step { display: grid; gap: var(--centauri-scaled-3); }
.import-step > * { margin: 0; }
.form-grid > .setup-partners { grid-column: 1 / -1; }
.setup-partners > summary { cursor: pointer; margin-block-end: var(--centauri-scaled-4); }

/* ---------------------------------------------------------------- report builder
   The column and account-type choices sit in a wrapped grid rather than one
   tall list; a multiple select shows several rows so the choice is visible. */
.builder-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: var(--centauri-scaled-4);
}
.gw-select[multiple] { block-size: auto; }
.data-table tr.row--group td { font-weight: 600; background: var(--color-surface-alt); }

/* ---------------------------------------------------------------- receipts for review */
.receipt-upload { margin-block-end: var(--centauri-scaled-7); }
.receipt-list { display: grid; gap: var(--centauri-scaled-7); list-style: none; padding: 0; margin: 0 0 var(--centauri-scaled-7); }
.receipt-card {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr);
  gap: var(--centauri-scaled-5);
  border: var(--centauri-static-stroke-hairline) solid var(--color-hairline);
  padding: var(--centauri-scaled-5);
}
.receipt-card__file { display: grid; gap: var(--centauri-scaled-3); align-content: start; }
.receipt-card__file > * { margin: 0; }
.receipt-card__body { display: grid; gap: var(--centauri-scaled-4); align-content: start; min-inline-size: 0; }
.receipt-card__body > * { margin: 0; }
.receipt-card__actions { display: flex; flex-wrap: wrap; gap: var(--centauri-scaled-3); margin-block-start: var(--centauri-scaled-4); }
.receipt-text {
  margin: 0;
  max-block-size: 18rem;
  overflow: auto;
  scrollbar-gutter: stable;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--color-card);
  border: var(--centauri-static-stroke-hairline) solid var(--color-hairline);
  padding: var(--centauri-scaled-3);
}
.receipt-email { margin-block-end: var(--centauri-scaled-7); display: grid; gap: var(--centauri-scaled-4); }
.receipt-email > * { margin: 0; }
.receipt-address { overflow-wrap: anywhere; }
.receipt-thumb {
  display: block;
  inline-size: 100%;
  max-block-size: 18rem;
  object-fit: contain;
  background: var(--color-card);
  border: var(--centauri-static-stroke-hairline) solid var(--color-hairline);
}
@media (max-width: 42rem) {
  .receipt-card { grid-template-columns: minmax(0, 1fr); }
  .receipt-thumb { max-block-size: 14rem; }
}

/* ---------------------------------------------------------------- printable documents

   An invoice, a sales receipt, an estimate or a statement, as the page a
   browser prints (layout.ts documentPage). Paper, so the card ground and the
   light theme whatever the reader's screen is set to; one reading measure;
   who it is from and to under micro labels; its facts as a definition list;
   its lines on the table layer like every other table. The controls sit in
   a bar above the document, and printing leaves them out. */
.document-page { background: var(--color-card); }
.document__controls,
.document {
  --shell-gutter: var(--centauri-scaled-section);
  max-inline-size: 46rem;
  margin-inline: auto;
  padding-inline: var(--shell-gutter);
}
.document__controls {
  display: grid;
  gap: var(--centauri-scaled-3);
  padding-block: var(--centauri-scaled-5);
  border-block-end: var(--centauri-static-stroke-hairline) solid var(--color-hairline);
}
.document__controls > p { display: flex; flex-wrap: wrap; align-items: center; gap: var(--centauri-scaled-2) var(--centauri-scaled-5); margin: 0; }
.document__controls > * { margin: 0; }
.document {
  display: grid;
  gap: var(--centauri-scaled-5);
  padding-block: var(--centauri-scaled-section);
}
.document > * { margin: 0; }
/* A heading sits with what it introduces: the gap below it, twice that above. */
.document > h2 { margin-block-start: var(--centauri-scaled-5); }
.document__parties { display: flex; flex-wrap: wrap; gap: var(--centauri-scaled-5) var(--centauri-scaled-section); }
.document__parties h2 { margin: 0 0 var(--centauri-scaled-2); }
.document__parties p { margin: 0; }
.document .meta-list { margin: 0; }
/* The layer fills a column head with the page's surface so a sticky head
   hides the rows under it; a document's page is the card, and nothing sticks. */
.document .centauri-table thead th { background: var(--color-card); }
@media (max-width: 599.98px) {
  .document__controls, .document { --shell-gutter: var(--centauri-scaled-4); }
}
@media print {
  .document__controls { display: none; }
  .document-page { background: none; }
  .document { max-inline-size: none; padding: 0; }
}
