/* Penny: the Report card world grown into a working app. Navy bar on white, Source Sans 3 with tabular figures, flat fills,
   reef teal for section labels and for Penny's own voice, the five-step scale only for standing and aging, and one status
   vocabulary for every proposal. Tokens first, then the shell, then components; page-specific rules live at the end. */

@font-face {
  font-family: "Source Sans 3"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("fonts/source-sans-3-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("fonts/source-sans-3-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* the world: navy on white */
  --navy: #0F144C; --navy-2: #191F5E; --navy-3: #262D70;
  --ink: #0F144C; --ink-2: #4A4F7A; --muted: #5E648C;
  --on-navy: #FFFFFF; --on-navy-2: #B8BDE3;
  --rule: #E3E6F2; --rule-2: #C9CEE3;
  --ground: #FFFFFF; --tint: #F5F6FB; --tint-blue: #EEF4FC; --panel: #FBFBFE;
  /* reef teal: section labels, and Penny's own voice */
  --teal: #1F8A9E; --teal-text: #157386; --teal-tint: #E4F2F5;
  --teal-field: #F4FAFB; --teal-field-line: #A9D3DB;   /* a value Penny suggested in a field (provenance tint only) */
  /* the five steps: standing and aging only, never status */
  --critical: #C8102E; --poor: #F07D19; --fair: #F2C230; --good: #7DBB42; --very-good: #1E7B4A;
  --poor-tint: #FDEEDF; --fair-tint: #FDF6DC;
  /* attention, and favourable / unfavourable differences */
  --warn: #A84E0A; --warn-tint: #FDF1E6;
  --fav: #1E7B4A; --unfav: #C8102E; --unfav-tint: #FBEAEC;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  /* Type (Trey, 20 Oct: the first build read as cramped and small). Body 16, tables 15, nothing readable under 13. */
  --t-xs: 13px; --t-sm: 14px; --t-table: 15px; --t-md: 16px; --t-lg: 18px; --t-h: 20px; --t-xl: 22px; --t-2xl: 32px; --t-3xl: 44px;
  --gutter: 32px;
  --r: 4px;
  --hit: 24px;          /* smallest tap box outside a sentence: 24px at desk, 44px at tablet and phone */
  --ctl: 40px;          /* buttons and fields at desk */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --shadow-pop: 0 10px 28px rgba(15, 20, 76, .18), 0 2px 6px rgba(15, 20, 76, .10);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-color: var(--rule-2) transparent; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--t-md); line-height: 1.5; font-variant-numeric: tabular-nums lining-nums;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset { margin: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--teal); }
::selection { background: #BFE3EA; color: var(--navy); }
input, textarea { caret-color: var(--teal-text); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--navy); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 2px; }
.bar :focus-visible, .dock :focus-visible { outline-color: #FFFFFF; }
button, input, select, textarea { font: inherit; color: inherit; }
b, strong { font-weight: 700; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }
.soft { color: var(--ink-2); }
.ic { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.nowrap { white-space: nowrap; }
.skip { position: absolute; left: var(--s4); top: -100px; z-index: 60; background: #fff; color: var(--navy); padding: var(--s2) var(--s3); font-weight: 700; }
.skip:focus { top: var(--s2); }
.wrap { max-width: var(--frame); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
/* Big screens (Trey, 21 October: "we have more room, we should use it"). The frame stops at 1440px on a laptop and grows with a
   big monitor. A screen fills the room with what it would otherwise make you click away to see (a preview pane, a column of where
   things stand), never by stretching a sentence or a table row: page-width tiers are written as @container page queries at
   1760px (a big monitor, or a 2560px screen with Ask Penny docked) and 2600px (an ultrawide). */
:root { --frame: 1440px; }
@media (min-width: 1600px) { :root { --frame: 3200px; --gutter: 40px; } }
@media (min-width: 2400px) { :root { --gutter: 56px; } }

/* The preview pane (ui.pane, static/pane.js). */
.with-pane > .pane { display: none; }
@container page (min-width: 1760px) {
  .with-pane { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--pane-w, 46%)); gap: var(--s6); align-items: start; }
  .with-pane > .pane { display: block; position: sticky; top: var(--s4); max-height: calc(100vh - 2 * var(--s4)); overflow: auto;
    overscroll-behavior: contain; border: 1px solid var(--rule-2); border-radius: var(--r); background: #fff; }
  /* Shut and open (pane.js). A list you browse starts shut, the list across the whole page and the pane at no width; choosing a
     row opens it and the list narrows over 320ms; Close shuts it the same way. A list that opens its first item (data-pane-auto)
     starts open. data-pane-keep is a layout of its own that never shuts. */
  .with-pane:not([data-pane-keep]) { transition: grid-template-columns .32s var(--ease), column-gap .32s var(--ease); }
  .with-pane.is-shut:not([data-pane-keep]), .with-pane:not([data-pane-auto]):not([data-pane-keep]):not(.is-open) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0%); column-gap: 0; }
  .with-pane.is-shut:not([data-pane-keep]) > .pane, .with-pane:not([data-pane-auto]):not([data-pane-keep]):not(.is-open) > .pane {
    visibility: hidden; border-color: transparent; transition: visibility 0s linear .32s, border-color 0s linear .32s; }
  .with-pane.pane-still { transition: none !important; }
  .with-pane.pane-still > .pane { transition: none !important; }
  /* while it slides, the page in the pane keeps the width it has open, pinned to the right edge, so it moves in rather than reflowing */
  .with-pane > .pane.is-sliding { display: flex; flex-direction: column; align-items: flex-end; overflow: hidden; }
  .with-pane > .pane.is-sliding > * { flex: none; width: calc(var(--pane-slide-w) - 2px); }
}
@media (prefers-reduced-motion: reduce) { .with-pane { transition: none !important; } }
@container page (min-width: 2600px) { .with-pane { --pane-w: 52%; } }
.pane-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: var(--s2); padding: var(--s2) var(--s3);
  background: #fff; border-bottom: 1px solid var(--rule); }
.pane-bar[hidden] { display: none; }
/* The pane is a size container, so a page shown in it lays out for the pane: a screen's CSS that writes an unnamed
   @container (max-width: …) query answers to the pane there and to the page (.shell-page) on its own. */
/* It is also named `page`, so a page shown in the pane answers its own @container page rules (and a .with-pane inside it)
   to the pane's width, as it would to the page's on its own. */
.pane-body { container: page / inline-size; }
.pane-body:focus { outline: none; }
/* A page shown in the pane gets the pane's inner room; pages that pad their own card (the item page, an admin record) keep theirs. */
.pane-body > .pane-frag { padding: var(--s5) var(--s5) var(--s6); }
.pane-body > .pane-frag:has(> .ip), .pane-body > .pane-frag:has(> .ar), .pane-body > .pane-frag:has(> .cl-page), .pane-body > .pane-frag:has(> .rc) { padding: 0; }
.pane-empty { display: grid; place-items: center; min-height: 320px; padding: var(--s6); text-align: center; color: var(--ink-2); }
.pane-empty p { max-width: 36ch; }
.pane-body.is-busy { opacity: .55; transition: opacity .15s var(--ease); }
[data-pane-row].is-in-pane, [data-pane].is-in-pane { background: var(--tint-blue); box-shadow: inset 0 0 0 1.5px var(--navy); }
/* a table row draws no box-shadow: ring it with an outline and tint its cells */
tr[data-pane-row].is-in-pane { box-shadow: none; outline: 1.5px solid var(--navy); outline-offset: -1.5px; }
tr[data-pane-row].is-in-pane > * { background: var(--tint-blue); }

/* ---------------------------------------------------------------------------------------------------------- the bar */
/* The bar, Penny's live status, the tab row, the phone dock and the Ask Penny panel live in shell.css. What stays here is shared
   with other screens: menus and pop-overs, and the count pill. */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--s2); }
.menu > summary::-webkit-details-marker { display: none; }
.menu .caret { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.menu[open] .caret { transform: rotate(180deg); }
.pick > summary { height: 36px; padding: 0 var(--s3); border: 1px solid rgba(255,255,255,.32); border-radius: var(--r); white-space: nowrap; }
.pick > summary:hover { border-color: rgba(255,255,255,.6); background: var(--navy-2); }
.pick-k { color: var(--on-navy-2); }
.pop {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 260px; max-height: 70vh; overflow: auto;
  background: #fff; color: var(--ink); border: 1px solid var(--rule-2); border-radius: 6px; padding: var(--s2) 0; box-shadow: var(--shadow-pop);
}
.pop-right { left: auto; right: 0; }
.pop a, .pop button { display: block; width: 100%; padding: 7px var(--s4); text-decoration: none; white-space: nowrap; text-align: left; background: none; border: 0; cursor: pointer; }
.pop a:hover, .pop button:hover { background: var(--tint); }
.pop a[aria-current] { font-weight: 700; background: var(--teal-tint); box-shadow: inset 3px 0 0 var(--teal); }
.pop-h { padding: var(--s2) var(--s4) var(--s1); font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--teal-text); }
.pop-h:not(:first-child) { margin-top: var(--s2); border-top: 1px solid var(--rule); padding-top: var(--s3); }

.count { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 10px; background: var(--teal-text); color: #fff; font-size: var(--t-xs); font-weight: 700; line-height: 20px; text-align: center; }

/* -------------------------------------------------------------------------------------------------- page furniture */
main { padding-top: var(--s6); padding-bottom: var(--s8); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s2) var(--s5); margin-bottom: var(--s6); }
.page-head h1 { font-size: var(--t-2xl); font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; }
.page-head .sub { color: var(--ink-2); }
.page-head .end { margin-left: auto; display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.crumbs { width: 100%; font-size: var(--t-sm); color: var(--muted); display: flex; flex-wrap: wrap; gap: 0 var(--s1); }
.crumbs .ic { width: 12px; height: 12px; color: var(--rule-2); }
.crumbs a { color: var(--ink-2); display: inline-flex; align-items: center; min-height: var(--hit); }
/* .label: the small teal capitals, now only for side-column headings and terms; a page's sections get real headings. */
.label { font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--teal-text); }
.section-head h2 { font-size: var(--t-h); font-weight: 700; line-height: 1.3; color: var(--navy); }
.section { margin-top: var(--s7); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s4); margin-bottom: var(--s4); }
.section-head .sub { color: var(--ink-2); }
.section-head .end { margin-left: auto; }
.ruled { border-top: 2px solid var(--navy); padding-top: var(--s2); }
.big { font-size: 34px; font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; }
.lede { color: var(--ink-2); margin-top: var(--s1); }
.more { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--hit); font-weight: 600; color: var(--navy); text-decoration: none; }
.more:hover { text-decoration: underline; }
.more .ic { transition: transform .2s var(--ease); }
.more:hover .ic { transform: translateX(2px); }
.kv { display: flex; justify-content: space-between; gap: var(--s3); padding: 10px 0; border-bottom: 1px solid var(--rule); }
.kv > :first-child { color: var(--ink-2); }
.kv > :last-child { text-align: right; font-weight: 600; }

.notice { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--tint-blue); }
.notice .ic { margin-top: 2px; }
.notice-warning { background: var(--warn-tint); }
.notice-warning .ic { color: var(--warn); }

/* ---------------------------------------------------------------------------------------------------- the statuses */
/* One vocabulary for every proposal, report and document. Ordinary states are words with a small icon, no box: a list where
   every row wears a badge reads as noise (Trey, 20 Oct). Only states that ask for attention (sent back, blocked, an exception,
   rejected) and the not-final provisional state get a tinted chip. The five standing steps never appear here. */
.st {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border-radius: 4px;
  font-size: var(--t-sm); font-weight: 600; line-height: 22px; letter-spacing: 0; color: var(--ink-2);
}
.st .ic { width: 14px; height: 14px; vertical-align: 0; }
.st-draft { color: var(--muted); font-style: italic; }
.st-awaiting { color: var(--ink-2); }
.st-you { color: var(--navy); font-weight: 700; }
.st-approved { color: var(--fav); }
.st-posted { color: var(--navy); }
.st-issued { color: var(--navy); }
.st-done, .st-superseded { color: var(--muted); }
.st-superseded { text-decoration: line-through; }
.st-rejected { color: var(--unfav); }
.st-sent-back, .st-attention, .st-stopped { background: var(--warn-tint); color: var(--warn); padding: 1px 10px; font-weight: 700; }
.st-provisional { background: var(--fair-tint); color: #6B4E00; border: 1px dashed #D6A915; padding: 0 10px; font-weight: 700; }

/* A group heading inside a list (Approvals' groups, a report's sections, the close's company groups): a real heading, never
   a row look-alike. More space above than below, a navy rule under it, the count beside it and one plain sentence about what
   the group holds. Add .is-sticky to keep it in view while its group scrolls. */
.group-h { margin-top: var(--s7); padding-bottom: var(--s3); border-bottom: 2px solid var(--navy); background: var(--ground);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--s3); }
.group-h:first-child { margin-top: 0; }
.group-h h2, .group-h h3 { font-size: var(--t-h); font-weight: 700; line-height: 1.3; color: var(--navy); }
.group-h .group-n { font-size: var(--t-md); font-weight: 700; color: var(--ink-2); }
.group-h .group-sub { flex-basis: 100%; color: var(--ink-2); font-size: var(--t-md); }
.group-h .end { margin-left: auto; }
.group-h.is-sticky { position: sticky; top: 0; z-index: 5; padding-top: var(--s3); }

/* The boxed group: a group in a box of its own (Trey, 21 October, third look: "header, line, row, header, line, row ... it all kind
   of runs together"). The box is a 1px rule-2 frame with 4px corners; its group heading becomes a header strip on `tint` (the name,
   the count, an optional link at the right, the sentence under them at 14px); the rows sit inside on white with 16px sides; boxes
   stand 32px apart. A box at rest has no shadow. A group that opens in place is a <details> inside the box whose <summary> is the
   strip; folded, the box is the strip alone. Screens put .gbox on the section that holds a group's heading and its rows. */
.gbox { --gbox-pad: var(--s4); border: 1px solid var(--rule-2); border-radius: var(--r); background: #fff; min-width: 0; }
.gbox + .gbox, .gbox + .brief-clear { margin-top: var(--s6); }
.gbox .group-h { margin: 0; padding: var(--s3) var(--gbox-pad); border-bottom: 1px solid var(--rule-2); background: var(--tint);
  border-radius: var(--r) var(--r) 0 0; align-items: center; gap: 2px var(--s3); min-height: 52px; }
.gbox .group-h h2, .gbox .group-h h3 { font-size: var(--t-lg); line-height: 1.3; }
.gbox .group-h .group-n { font-size: var(--t-table); font-weight: 600; }
.gbox .group-h .group-sub { font-size: var(--t-sm); line-height: 1.45; margin-top: -2px; }
.gbox .group-h .end.more { font-size: var(--t-sm); }
.gbox .group-h.is-sticky { top: 0; padding-top: var(--s3); }
.gbox details:not([open]) > summary.group-h { border-bottom-color: transparent; border-radius: var(--r); }
.gbox details > summary.group-h { cursor: pointer; list-style: none; }
.gbox details > summary.group-h::-webkit-details-marker { display: none; }
.gbox details > summary.group-h:hover h2, .gbox details > summary.group-h:hover h3 { text-decoration: underline; text-decoration-color: var(--teal); text-underline-offset: 3px; }
/* a table inside a box: its first and last cells keep the box's side room, its column names sit on a hairline under the strip, and its
   last row needs no rule of its own */
.gbox > .t .first, .gbox > .co-list > .t .first { padding-left: var(--gbox-pad); }
.gbox > .t .last, .gbox > .co-list > .t .last { padding-right: var(--gbox-pad); }
.gbox > .t thead th, .gbox > .co-list > .t thead th { border-bottom: 1px solid var(--rule-2); }
.gbox > .t tbody tr:last-child > *, .gbox > .co-list > .t tbody tr:last-child > * { border-bottom: 0; }
@container page (max-width: 759.98px) { .gbox { --gbox-pad: var(--s3); } }

/* --------------------------------------------------------------------------------------------- Penny's own voice */
/* Everything Penny says sits in this block: a teal rule, her mark, her name and what kind of words these are. Facts from
   the books never do. */
.penny {
  display: flex; gap: var(--s3); align-items: flex-start; background: var(--teal-tint); border: 1px solid #BFDDE3;
  padding: var(--s3) var(--s4); border-radius: 6px;
}
.penny-mark {   /* teal-text, not teal: white on #1F8A9E is 4.0:1, on #157386 it is 5.5:1 */
  flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--teal-text); color: #fff; font-weight: 800; font-size: 12px;
  display: inline-grid; place-items: center; box-shadow: inset 0 0 0 2px var(--teal-tint), 0 0 0 1px var(--teal-text);
}
.penny-mark.sm { width: 18px; height: 18px; font-size: 10px; box-shadow: none; }
.penny-who { font-size: var(--t-xs); font-weight: 700; color: var(--teal-text); margin-bottom: 2px; }
.penny-who .sure { font-weight: 600; color: var(--ink-2); }
.penny p + p { margin-top: var(--s2); }

/* ------------------------------------------------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--ctl); padding: 0 var(--s4);
  border-radius: var(--r); border: 1px solid var(--rule-2); background: #fff; color: var(--navy); font-weight: 700;
  text-decoration: none; white-space: nowrap; cursor: pointer; transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--navy); }
.btn:active { background: var(--tint); }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
/* A list row's decision button: one word (Approve, Confirm) at one width, so every row's button lines up (Trey, 21 October). */
.btn-primary:hover { background: var(--navy-3); border-color: var(--navy-3); }
.btn-primary:active { background: var(--navy-2); }
.btn-danger { color: var(--unfav); border-color: #EBB3BC; }
.btn-danger:hover { border-color: var(--unfav); }
.btn-quiet { border-color: transparent; background: none; padding: 0 var(--s2); }
.btn-quiet:hover { border-color: transparent; text-decoration: underline; text-decoration-color: var(--teal); }
.btn-sm { min-height: 36px; padding: 0 var(--s3); font-size: var(--t-sm); }
.btn-lg { min-height: 48px; padding: 0 var(--s5); font-size: var(--t-lg); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn .key { font-size: 11px; font-weight: 600; border: 1px solid currentColor; opacity: .55; border-radius: 3px; padding: 0 4px; line-height: 15px; }
.btn.is-busy { pointer-events: none; }
.btn.is-busy::after { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btns { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }

/* -------------------------------------------------------------------------------------------------------- fields */
.field { display: grid; gap: 4px; min-width: 0; }
.field > label, .field .flabel { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.field .req { color: var(--unfav); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; min-height: var(--ctl); padding: 0 var(--s3); border: 1px solid var(--rule-2); border-radius: var(--r);
  background: #fff; color: var(--ink);
}
.textarea { padding: var(--s2) var(--s3); min-height: 72px; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; padding-right: 32px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='none' stroke='%230F144C' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-2); }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); }
.input.n { text-align: right; font-variant-numeric: tabular-nums; }
.field.has-error .input, .field.has-error .select { border-color: var(--unfav); }
.field .help { font-size: var(--t-xs); color: var(--muted); }
.field .err { font-size: var(--t-xs); color: var(--unfav); font-weight: 600; display: flex; gap: 4px; align-items: center; }
/* identifiers only (the Identifier Rule in DESIGN.md): fingerprints, cost-centre codes, commands, reply codes */
code { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace; font-size: .92em; letter-spacing: 0; }
.check { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--hit); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--navy); }

/* --------------------------------------------------------------------------------------------------------- tables */
.t { width: 100%; border-collapse: collapse; font-size: var(--t-table); }
.t th, .t td { padding: 11px var(--s3); text-align: left; vertical-align: baseline; }
.t thead th { font-weight: 600; color: var(--ink-2); border-bottom: 2px solid var(--navy); padding-top: var(--s1); white-space: nowrap; }
.t tbody td, .t tbody th { border-bottom: 1px solid var(--rule); }
.t tbody th { font-weight: 400; }
/* a heading that sorts its table (ui.sort_th): looks like any heading until hovered or chosen, then an arrow says which way */
.t thead th > a.sort { color: inherit; font: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; min-height: var(--hit); }
.t thead th.n > a.sort { justify-content: flex-end; }
.t thead th > a.sort::after { content: "⇅"; font-size: 11px; color: var(--muted); opacity: 0; transition: opacity .15s; }
.t thead th > a.sort:hover::after, .t thead th > a.sort:focus-visible::after { opacity: 1; }
.t thead th[aria-sort] > a.sort { color: var(--navy); }
.t thead th[aria-sort="ascending"] > a.sort::after { content: "▲"; opacity: 1; color: var(--teal-text); font-size: 10px; }
.t thead th[aria-sort="descending"] > a.sort::after { content: "▼"; opacity: 1; color: var(--teal-text); font-size: 10px; }
.t .n { text-align: right; white-space: nowrap; }
.t tfoot td, .t tfoot th { border-top: 2px solid var(--navy); font-weight: 700; padding-top: var(--s2); }
.t .first { padding-left: 0; }
.t .last { padding-right: 0; }
.t tr.is-attention > * { background: var(--warn-tint); }
.t a.row-link { text-decoration: none; font-weight: 700; }
.t a.row-link:hover { text-decoration: underline; }
/* the kind of an item (Bill, Card charges, Import…): plain words in sentence case, never teal capitals */
.kind { font-size: inherit; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-2); white-space: nowrap; }
.dc { font-weight: 700; white-space: nowrap; }
.dc .side { font-weight: 600; color: var(--muted); margin-right: 4px; font-size: var(--t-xs); }
.hnl { display: block; font-size: var(--t-xs); color: var(--muted); font-weight: 400; }

/* the five steps (reports only) */
.band { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; align-items: end; height: 22px; padding-top: 8px; }

.band .mark { position: absolute; top: 0; width: 12px; height: 7px; margin-left: -6px; background: var(--navy); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.band[data-step="critical"] .mark { left: 10%; } .band[data-step="poor"] .mark { left: 30%; } .band[data-step="fair"] .mark { left: 50%; }
.band[data-step="good"] .mark { left: 70%; } .band[data-step="very_good"] .mark { left: 90%; }

/* the split bar: how much of a batch is settled and how much needs a person */
.split { display: flex; height: 8px; border-radius: 2px; overflow: hidden; background: var(--rule); }
.split > i { display: block; height: 100%; }
.split .ok { background: var(--navy); }
.split .need { background: var(--warn); }
.split .new { background: var(--poor); }
.split .other { background: var(--rule-2); }

/* ---------------------------------------------------------------------------------------------- panels and cards */
.panel { border: 1px solid var(--rule); border-radius: var(--r); background: #fff; padding: var(--s4); }
.panel + .panel { margin-top: var(--s4); }

/* -------------------------------------------------------------------------------------------- empty, loading, error */
.empty { border: 1px dashed var(--rule-2); border-radius: var(--r); padding: var(--s5); color: var(--ink-2); background: #fff; display: flex; gap: var(--s3); align-items: flex-start; }
.empty > div { min-width: 0; }
.empty .btns { flex-wrap: wrap; }
.empty h2 { font-size: var(--t-lg); color: var(--ink); font-weight: 700; margin-bottom: 4px; }
.empty .ic { color: var(--muted); margin-top: 3px; width: 20px; height: 20px; }
.empty p + p { margin-top: var(--s2); }
.empty .btns { margin-top: var(--s3); }
.empty.is-error { border-style: solid; border-color: #EBB3BC; background: var(--unfav-tint); }
.empty.is-error .ic { color: var(--unfav); }
.sk { display: block; height: 12px; border-radius: 2px; background: linear-gradient(90deg, var(--rule) 0, var(--tint) 40%, var(--rule) 80%); background-size: 300% 100%; animation: sk 1.4s ease-in-out infinite; }
.sk + .sk { margin-top: 10px; }
.sk.w40 { width: 40%; } .sk.w60 { width: 60%; } .sk.w80 { width: 80%; } .sk.h24 { height: 24px; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: 0 0; } }
.loading-note { font-size: var(--t-sm); color: var(--muted); display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); }

/* Ask Penny: the docked panel and the sheet are in shell.css. A native dialog (a document viewer) still locks the page behind it: */
body:has(dialog[open]) { overflow: hidden; }

/* ----------------------------------------------------------------------------------------------------------- foot */
.foot { padding-top: var(--s4); padding-bottom: var(--s6); border-top: 1px solid var(--rule); color: var(--muted); font-size: var(--t-sm); display: grid; gap: 2px; }

/* ---------------------------------------------------------------------------------------------------- responsive */
@media (max-width: 1024px) {
  :root { --hit: 44px; --ctl: 44px; --gutter: 24px; }
  .skip { min-height: 44px; }
  .crumbs a { min-width: 44px; }
  .t td a:not(.btn), .t th a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; }   /* a link in a table row is a whole tap box */
  .row-link, .more-list a { display: inline-flex; align-items: center; min-height: 44px; }
  .btn-sm { min-height: 44px; }
  .pop a, .pop button { padding-block: 12px; }
  .check { min-height: 44px; }
  .pick > summary { min-height: 44px; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  body { padding-bottom: 72px; }
  main { padding-top: var(--s4); }
  .page-head h1 { font-size: 26px; }
  .page-head .end { margin-left: 0; }
  .big { font-size: 30px; }
  .t th, .t td { padding: 8px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
  .sk { animation: none; }
}
@media print {
  .bar-nav, .pickers, .who, .skip, .dock, .ask-btn { display: none !important; }
  .bar { background: #fff; color: var(--navy); border-bottom: 2px solid var(--navy); }
}

/* ================================================================================================================ */
/* the review card (spec §11.4)                                                                                     */
.outcome { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r); margin: var(--s3) 0 var(--s4); background: var(--tint-blue); }
.outcome > .ic { width: 20px; height: 20px; flex: none; }
.outcome > div { flex: 1; }
.outcome-approve { background: #EAF4EE; } .outcome-approve > .ic { color: var(--fav); }
.outcome-send-back { background: var(--warn-tint); } .outcome-send-back > .ic { color: var(--warn); }

.rc { margin-top: var(--s3); border: 1px solid var(--rule-2); border-radius: var(--r); background: #fff; }
.rc-head { padding: var(--s5) var(--s5) var(--s4); border-bottom: 1px solid var(--rule); }
.rc-title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s3); margin-top: 4px; }
.rc-title-row h1 { font-size: var(--t-2xl); font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; }
.rc-amt { margin-left: auto; font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.rc-what { color: var(--ink-2); margin-top: var(--s1); }
.rc-body { display: grid; grid-template-columns: minmax(0, 1fr) 400px; }
.rc-main { padding: var(--s5); border-right: 1px solid var(--rule); min-width: 0; }
.rc-side { padding: var(--s5); background: var(--panel); min-width: 0; }
.rc-sec + .rc-sec { margin-top: var(--s6); }
.rc-sec > .label { display: block; margin-bottom: var(--s3); }
.books { display: grid; gap: var(--s5); }
.book h3 { font-size: var(--t-md); font-weight: 700; margin-bottom: 2px; }
.lines th[scope="row"] { font-weight: 400; }
.lines th[scope="row"] b { font-weight: 700; margin-right: 4px; }
.tags { display: block; font-size: var(--t-xs); color: var(--ink-2); margin-top: 2px; line-height: 1.4; }
.tags > span { display: inline; }
.tags > span + span::before { content: " · "; color: var(--rule-2); }
.tags i { font-style: normal; color: var(--muted); }
.lines .dc { width: 110px; }
.ev { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.steps { display: grid; gap: var(--s2); }
.step { display: flex; gap: var(--s3); align-items: center; }

/* the passkey step: one flat frame for every privileged act (ui.passkey_frame) */
.pkf-note { font-size: var(--t-sm); color: var(--ink-2); }
.pkf-acts { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: flex-end; }
.pkf-acts .btn { min-height: 44px; }
@media (max-width: 760px) {
  .pkf-acts { flex-direction: column-reverse; }
  .pkf-acts .btn { width: 100%; }
}

/* the sub-navigation strip (ui.subnav): page navigation inside a screen. 44px links, a 3px teal underline on the current one,
   sideways scrolling with a soft edge on whichever side has more. */
.subnav { position: relative; overflow-x: auto; scrollbar-width: none; margin-bottom: var(--s4); border-bottom: 1px solid var(--rule-2);
  background:
    linear-gradient(to right, #fff 30%, rgba(255,255,255,0)) left / 36px 100% no-repeat local,
    linear-gradient(to left, #fff 30%, rgba(255,255,255,0)) right / 36px 100% no-repeat local,
    linear-gradient(to right, rgba(15, 20, 76, .16), rgba(15, 20, 76, 0)) left / 12px 100% no-repeat scroll,
    linear-gradient(to left, rgba(15, 20, 76, .16), rgba(15, 20, 76, 0)) right / 12px 100% no-repeat scroll; }
.subnav::-webkit-scrollbar { display: none; }
.subnav ul { display: flex; gap: var(--s1); width: max-content; min-width: 100%; }
.subnav a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 var(--s3); text-decoration: none; font-weight: 600; color: var(--ink-2);
  border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subnav a:hover { color: var(--navy); background: var(--tint); }
.subnav a[aria-current] { color: var(--navy); font-weight: 700; border-bottom-color: var(--teal); }
.subnav a:focus-visible { outline-offset: -2px; }
.subnav-n { font-size: var(--t-xs); font-weight: 700; background: var(--tint); color: var(--ink-2); border-radius: 9px; padding: 0 6px; line-height: 18px; }
.subnav a[aria-current] .subnav-n { background: var(--tint-blue); color: var(--navy); }

/* a stored document, previewed (ui.doc_preview) and opened in a viewer dialog (ui.doc_viewer) */
.dp { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.paper { display: grid; gap: var(--s4); color: #222; }
@media (max-width: 760px) {
  .dp { grid-template-columns: 96px minmax(0, 1fr); }
}

@media (max-width: 1100px) {
  .rc-body { grid-template-columns: minmax(0, 1fr); }
  .rc-main { border-right: 0; border-bottom: 1px solid var(--rule); }
}
@media (max-width: 760px) {
  .rc { border-left: 0; border-right: 0; border-radius: 0; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); }
  .rc-head, .rc-main, .rc-side { padding: var(--s4) var(--gutter); }
  .rc-title-row h1 { font-size: 22px; }
  .rc-amt { margin-left: 0; width: 100%; font-size: 30px; order: -1; }
  .ev { grid-template-columns: 96px minmax(0, 1fr); }
  .lines .dc { width: auto; }
  body.pg-queue main { padding-bottom: 96px; }
}
.crumbs { align-items: center; }

/* batch and import cards */
.exc .sub { display: block; font-size: var(--t-xs); color: var(--muted); font-weight: 400; }
.exc th[scope="row"] { font-weight: 400; }
.issue { color: var(--warn); font-weight: 600; white-space: nowrap; }
.checks { display: grid; gap: var(--s3); }
.checks li { display: flex; gap: var(--s3); align-items: flex-start; padding-bottom: var(--s3); border-bottom: 1px solid var(--rule); }
.checks p { color: var(--ink-2); }
@media (max-width: 760px) {
  .exc thead { display: none; }
  .exc, .exc tbody, .exc tr, .exc td, .exc th { display: block; }
  .exc tr { padding: var(--s3) 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 1fr auto; gap: 4px var(--s3); }
  .exc td, .exc th { border: 0 !important; padding: 0 !important; }
  .exc td.n { text-align: right; }
  .exc td:nth-child(3), .exc td:nth-child(4) { grid-column: 1 / -1; }
  .exc td.last { grid-column: 1 / -1; }
}
/* a reference or people change, a run's preview: one plain table */
.gen caption { text-align: left; font-weight: 700; padding-bottom: 4px; }
.gen th[scope="row"] { font-weight: 600; }

/* ================================================================================================================ */
/* the review card, completed: books side by side, many entries, long lists, the reason and the outcome                */
.books { display: grid; gap: var(--s5); }
.books-2 { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); align-items: start; }
.book-n { font-size: var(--t-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.book .bal { display: inline-flex; align-items: center; gap: 4px; margin-left: var(--s2); font-weight: 600; font-size: var(--t-xs); color: var(--fav); }
.book .bal .ic { width: 12px; height: 12px; vertical-align: 0; }
.lines tfoot th { padding-top: var(--s2); }
.lines .dc { width: 100px; }
.dp + .kv { margin-top: var(--s3); }
.gen caption { text-align: left; font-weight: 700; padding-bottom: 4px; }
.tie tbody th small, .tie .muted { font-weight: 400; }

.ent { border: 1px solid var(--rule); border-radius: var(--r); background: #fff; }
.ent + .ent { margin-top: var(--s2); }
.ent > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px var(--s3); min-height: 44px; padding: 6px var(--s3); }
.ent > summary::-webkit-details-marker { display: none; }
.ent > summary::before { content: ""; width: 8px; height: 8px; flex: none; border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy); transform: rotate(-45deg); transition: transform .2s var(--ease); margin-right: var(--s1); }
.ent[open] > summary::before { transform: rotate(45deg); }
.ent[open] > summary { background: var(--tint); border-bottom: 1px solid var(--rule); }
.ent-t { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }

/* the 53 exceptions: each one a charge, Penny's suggestion in her block, and its own decision */

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s2) var(--s3); margin-bottom: var(--s3); }
.filters .field { min-width: 180px; }
.filters .btns { align-self: flex-end; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s3); }
.pager .btn { min-height: 44px; }
.pager .btn[aria-disabled="true"] { opacity: .45; }
.cl th[scope="row"] { font-weight: 400; }
.cl .tags { margin-top: 2px; }
.cl tfoot th, .cl tfoot td { font-size: var(--t-md); }
.comments li { padding: var(--s2) 0; border-bottom: 1px solid var(--rule); }
.more-list { border-top: 1px solid var(--rule); }
.more-list a { display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: 0 var(--s2); text-decoration: none; border-bottom: 1px solid var(--rule); font-weight: 600; }
.more-list a > span { flex: 1; }
.more-list a .go { color: var(--muted); }
.more-list a[aria-current] { background: var(--teal-tint); }

@media (max-width: 760px) {
  .outcome { flex-wrap: wrap; }
  .outcome > div { flex: 1 1 0; min-width: 0; }
  .outcome > .btn { flex: 1 0 100%; }
  .books-2 { grid-template-columns: minmax(0, 1fr); }
  .cl thead { display: none; }
  .cl, .cl tbody, .cl tr, .cl td, .cl th { display: block; }
  .cl tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
  .cl td, .cl th { border: 0 !important; padding: 0 !important; }
  .cl th[scope="row"] { grid-column: 1; }
  .cl td.last { grid-column: 2; grid-row: 1; }
  .cl td:nth-child(2) { grid-column: 1 / -1; color: var(--ink-2); font-size: var(--t-sm); }
  .cl td:nth-child(3) { grid-column: 1 / -1; font-size: var(--t-sm); }
  .cl tfoot tr { grid-template-columns: 1fr auto; }
  .cl tfoot th { grid-column: 1 !important; }
  body.pg-queue main { padding-bottom: 128px; }
}
@media (max-width: 1024px) {
  .btn-sm { min-height: 44px; }
}

@media (max-width: 760px) {
  /* a book's lines on a phone: the account across the width, its amount under it, labelled (table.lines only: a P&L's
     tbody.lines keeps its columns) */
  table.lines thead { display: none; }
  table.lines, table.lines tbody, table.lines tfoot, table.lines tr { display: block; }
  table.lines tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--s3); padding: 8px 0; border-bottom: 1px solid var(--rule); }
  table.lines tfoot tr { border-top: 2px solid var(--navy); border-bottom: 0; }
  table.lines th[scope="row"], table.lines td { padding: 0 !important; border: 0 !important; }
  table.lines th[scope="row"] { flex: 1 1 100%; }
  table.lines td { width: auto !important; }
  table.lines td:empty { display: none; }
  table.lines td.dc:first-of-type, table.lines th + td.dc { margin-left: auto; }
  table.lines td.dr::before, table.lines td.cr::before { font-size: var(--t-xs); font-weight: 400; color: var(--muted); margin-right: 6px; }
  table.lines td.dr::before { content: "Debit"; }
  table.lines td.cr::before { content: "Credit"; }
}

@media (max-width: 400px) { .t.tie { table-layout: fixed; width: 100%; } .t.tie th.first { overflow-wrap: anywhere; } .t.tie th.n, .t.tie td.n { width: 28%; } }
.empty .btns .btn { white-space: normal; height: auto; min-height: var(--ctl); text-align: left; }
.issue .muted { white-space: normal; }
@media (max-width: 400px) { .issue { white-space: normal; } }
