/*
 * Helix Reports — visual language (plan §417).
 *
 * Derived from the legacy tier's modernized Logi stylesheets — home.css (app shell) and
 * _Themes/HelixTheme/Theme.css (controls/reports), both built on an Adobe Color Wheel
 * split-complementary palette: a teal family (hue ≈ 170°) against a yellow-green accent.
 * This file keeps that palette idea but re-tunes the ramp on the same wheel:
 *
 *   - The ACTION teal is deepened one step (#3a8476 → #337467) so white text passes WCAG AA
 *     (4.43:1 → 5.5:1), with a darker hover (#2a6156) — hover now darkens instead of lightening,
 *     which read as "disabled" and dropped white-text contrast to 2.6:1.
 *   - #3a8476 stays as the IDENTITY teal (--color-brand): the logo match, icon accents, the
 *     footer © mark. Same hue, two duties.
 *   - The lime accent (#c9dc44) is decorative only (hero underline, header signature edge,
 *     dark-surface focus rings) — it has ~1.4:1 contrast on white and must never carry text.
 *     Text-grade olive steps (#889c2e icons, #5f6e20 text) cover the semantic "success" role.
 *
 * Raw ramp tokens (--teal-*, --lime-*) are the palette; components consume the semantic
 * aliases below them. Future components pick from the ramp — don't invent new hex values.
 */

:root {
    /* Palette ramp — teal family (hue ≈ 170°, shared with Logi) */
    --teal-700: #2a6156;
    --teal-600: #337467;
    --teal-500: #3a8476;   /* Logi --color-dark-t; the brand mark teal */
    --teal-300: #82c2b6;   /* Logi --color-light-t */
    --teal-150: #c9dcd6;   /* line/border (near Theme.css --color-border #c2d6d3) */
    --teal-100: #e8f2f0;   /* Logi --color-surface-alt */
    --teal-50:  #f4f8f7;   /* Logi --color-surface */

    /* Palette ramp — split-complement yellow-green */
    --lime-500: #c9dc44;   /* Logi --color-bright-green: decoration only, never text */
    --lime-700: #889c2e;   /* Logi --color-dark-green: icon-grade */
    --lime-900: #5f6e20;   /* text-grade (5.1:1 on the success wash) */

    /* Semantic aliases — components use these, not the ramp directly */
    --color-primary: var(--teal-600);         /* actions, links, header */
    --color-primary-hover: var(--teal-700);   /* darker on hover (was lighter — read as disabled) */
    --color-primary-soft: var(--teal-300);
    --color-brand: var(--teal-500);           /* identity teal: logo-adjacent icons, © mark */
    --color-accent: var(--lime-500);
    --color-accent-dark: var(--lime-700);

    /* Neutrals (teal-undertone, from Theme.css) */
    --color-bg: #ffffff;
    --color-surface: var(--teal-50);
    --color-surface-alt: var(--teal-100);
    --color-ink: #1e3330;
    --color-ink-muted: #454d59;
    --color-line: var(--teal-150);
    --color-on-primary: #ffffff;

    /* Table column header — Logi's TableColumnHeaderBackgroundColor verbatim: Theme.css paints
       .rdThemeDataTableHeader #82c2b6 under #1e3330 ink over white cells, so our grid reads as the
       same product as the Logi reports it sits beside. Its own alias rather than --color-surface,
       which is #f4f8f7 against a #ffffff page — 1.05:1, so the header simply was not there. */
    --color-table-header: var(--teal-300);

    /* Status */
    --color-danger: #b3423a;
    --color-danger-hover: #97362f;   /* the darker press state for a solid danger button */
    --color-danger-bg: #fbeceb;
    --color-success: var(--lime-900);         /* text-grade */
    --color-success-icon: var(--lime-700);
    --color-success-bg: #f1f6e2;
    /* Warning (board 462): an import that looks stuck but may yet finish. Amber, not danger: nothing has
       failed, and the file is still safe. #8a5a00 is text- and icon-grade on the wash (5.4:1), and the
       muted ink on it still reads at 7.7:1. There is no dark theme to pair it with; none of the status
       tokens has one. */
    --color-warning: #8a5a00;
    --color-warning-bg: #fdf3dc;

    /* Focus — deep teal on light surfaces; header overrides to lime (pops on dark teal) */
    --color-focus: var(--teal-700);
    /* A report picker's part-checked box, its "–" (the owner, 2026-12-04): a slightly lighter teal than a checked box's, not a disabled
       grey. Every "–" in a picker has it, Select all's and a group heading's, whatever made it part-checked. */
    --color-check-partial: var(--teal-300);

    /* A drop-down's rows (the owner, 2026-11-16: "a lighter shade rather than the strong blue", "the padding from the side with
       the rounded corners"). The row under the pointer or the keyboard is tinted, its text keeps its colour, and the tint stands
       in from the list's sides as a rounded pill rather than a bar across it: the list is padded by --option-pad and each row
       rounded by --option-radius. Every list that drops down uses these three: the selects (the stylable-select block below the
       fields), the combobox, the menus (.grid-menu-content, .user-menu-content, the row menu), the grid's filter panels, the report
       pickers' drop-downs and the date picker's ranges. A row the keyboard is on also carries the focus ring, inside its pill:
       the tint alone is 1.1:1 on white, and the ring is what the keyboard reads (7.3:1). */
    --color-option-hover: var(--teal-100);
    --option-pad: var(--space-1);
    --option-radius: var(--radius-md);

    /* Elevation (Theme.css's softer scale) */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .12);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, .14);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, .16);

    /* Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-pill: 999px;

    /* Spacing scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;

    /* Typography — system stack (Theme.css modernized): "Open Sans" was declared previously
       but never vendored, so rendering silently varied by machine; the system stack is the
       consistent choice and what the Logi theme itself moved to. */
    --font-sans: system-ui, "Segoe UI", "Avenir Next", "Avenir", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;   /* code in Help articles (board 513) */
    --text-xs: 0.8125rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.375rem;
    --text-2xl: 1.625rem;
    --text-3xl: 2rem;

    /* Back-compat aliases (older rules/partials reference these) */
    --font-size-sm: var(--text-sm);
    --font-size-xs: var(--text-xs);

    /* Transitions */
    --transition-fast: color .15s ease, background-color .15s ease, border-color .15s ease;
    --transition-base: color .2s ease, background-color .2s ease, box-shadow .2s ease, transform .15s ease;

    --topbar-height: 64px;

    /* Charts (L5-Q7, board 571: the pie, Helix's first chart part): the categorical palette's eight slots, given to a chart's
       series in this order and never reused (the dataviz method's validated light palette, checked on a near-white surface: adjacent
       slots part for colour-blind readers, and three of them under 3:1 on white, so every series is named by a label beside it as
       well). The app has no dark theme to step them for. */
    --chart-1: #2a78d6;
    --chart-2: #eb6834;
    --chart-3: #1baf7a;
    --chart-4: #eda100;
    --chart-5: #e87ba4;
    --chart-6: #008300;
    --chart-7: #6250d6;
    --chart-8: #e34948;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* THE hidden ATTRIBUTE MUST WIN, and without this it loses.

   Browsers implement `hidden` as a USER-AGENT rule, `[hidden] { display: none }`, and any author
   `display` declaration beats a UA one whatever its specificity. So every component here that sets a
   display — which is most of them — silently un-hides itself the moment someone marks it hidden, and
   what you get is an element that is visible and inert rather than absent.

   This cost us the same bug three times. `.modal[hidden]` and `.combobox-options[hidden]` were both
   one-off patches for it; the third was board 466's "View investor" link, where `.field-add`'s
   inline-flex left a link on screen with no href — visible, unclickable, doing nothing (user,
   2026-09-23). Both patches are gone, replaced by this: one rule, and no component has to remember.

   !important is load-bearing and not a shortcut. Without it this is just another author rule losing
   to a more specific one, which is the whole defect. It is also what normalize.css and every CSS
   framework ship for exactly this reason. */
[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    color: var(--color-ink);
    background-color: var(--color-surface);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Type scale — h1 is the page title, h2 a card/section heading. */
h1, h2, h3 {
    line-height: 1.25;
    letter-spacing: -0.01em;
}

h1 {
    font-size: var(--text-2xl);
    font-weight: 700;
}

h2 {
    font-size: var(--text-lg);
    font-weight: 700;
}

a {
    color: var(--color-primary);
}

a:hover {
    color: var(--color-primary-hover);
}

::selection {
    background-color: var(--teal-300);
    color: var(--color-ink);
}

:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

/* ───────────────────────────────────────────────────────────── */
/*  TOP BAR                                                       */
/* ───────────────────────────────────────────────────────────── */
/* Full-width app bar (Logi top-bar pattern: edge-to-edge teal, breathing room at the sides). */
header {
    background-color: var(--color-primary);
    color: var(--color-on-primary);
    box-shadow: var(--shadow-sm);
}

/* Lime pops on the dark teal bar; the deep-teal default ring would vanish here. */
header :focus-visible {
    outline-color: var(--color-accent);
}

header nav {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    height: var(--topbar-height);
    padding: 0 var(--space-6);
}

header .brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-weight: 700;
    font-size: var(--text-lg);
    letter-spacing: 0.01em;
    text-decoration: none;
    color: var(--color-on-primary);
    margin-right: auto;
}

header .brand img {
    height: 28px;
    width: auto;
    display: block;
}

header .brand:hover {
    color: var(--color-on-primary);
    opacity: 0.9;
}

header nav > a {
    color: var(--color-on-primary);
    font-size: var(--text-sm);
    text-decoration: none;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

header nav > a:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: var(--color-on-primary);
}

/* The help link (board 513): a bare link in the bar, so `header nav > a` gives it its colour, padding, radius, hover
   and the lime focus ring; this sizes it like the account menu's 40px summary and keeps the row from squeezing it. */
header nav > .help-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 40px;
    flex-shrink: 0;
}

/* Top-bar tag — quiet pill so it reads as a badge, not a nav item. */
header nav .env {
    color: var(--color-on-primary);
    opacity: 0.75;
    font-size: var(--text-xs);
    background-color: rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-pill);
    padding: 2px var(--space-3);
}

/* Signed-in user menu — a native <details> disclosure styled as a dropdown (no JS needed). */
.user-menu {
    position: relative;
}

.user-menu > summary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 40px;
    padding: 0 var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--color-on-primary);
    font-size: var(--text-sm);
    white-space: nowrap;
    cursor: pointer;
    list-style: none;   /* hide the default disclosure triangle */
    transition: var(--transition-fast);
}

.user-menu > summary::-webkit-details-marker {
    display: none;
}

.user-menu > summary:hover,
.user-menu[open] > summary {
    background-color: rgba(255, 255, 255, 0.12);
}

.user-menu > summary .fa-caret-down {
    font-size: 0.85em;
    opacity: 0.85;
    transition: transform 0.15s ease;
}

.user-menu[open] > summary .fa-caret-down {
    transform: rotate(180deg);
}

.user-menu-content {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    min-width: 210px;
    padding: var(--option-pad);
    background-color: var(--color-bg);
    color: var(--color-ink);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* The words start where they did before the list was padded (--option-pad): 16px from the menu's edge. */
.user-menu-content a,
.user-menu-content button {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    height: auto;
    padding: var(--space-3) calc(var(--space-4) - var(--option-pad));
    background: none;
    border: 0;
    border-radius: var(--option-radius);
    color: var(--color-ink);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 400;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.user-menu-content a:hover,
.user-menu-content button:hover,
.user-menu-content a:focus-visible,
.user-menu-content button:focus-visible {
    background-color: var(--color-option-hover);
    color: var(--color-ink);
    box-shadow: none;
    transform: none;
}

.user-menu-content a:focus-visible,
.user-menu-content button:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

.user-menu-content .fa-fw {
    color: var(--color-brand);
}

/* The dev-tools badge keeps its pill look as the summary's inner span. It was the environment
   disclosure (board 435) until #457 emptied it of diagnostics; only the dev pages remain. */
.env-menu > summary .env {
    padding: 2px var(--space-2);
}

/* The account name is the one box in the bar that gives, at every width (board 513). Above 700px
   nothing else could once the help link joined the bar: the link and the burger do not shrink, and
   the <details> sat at its full "name · client" width, so a long name (an email, for anyone who
   skipped the name prompt) first wrapped the wordmark onto two lines and then pushed the bar past
   the window, scrolling the whole page sideways below 901px. So the wordmark keeps its line, and
   the name truncates with an ellipsis instead.

   The name takes three rules, and they are not the same rule three times. min-width: 0 lifts the
   automatic minimum that pinned the <details> at its full width, which is why the row could not
   absorb the deficit despite flex-shrink already being 1 — flexing may go below min-content, but
   only once that floor is gone.

   max-width is then what makes the <summary> come with it. The summary is an inline-flex box: it
   sizes shrink-to-fit, and its min-content is the sum of its parts. Left to itself, at 320px, it
   stayed at its 183px INSIDE a 148px <details> and painted the name and caret straight over the
   environment icon: the document measured clean and the bar was visibly broken. Capped at its
   parent, it follows, and the ellipsis does the visible work — a span with overflow: hidden has an
   automatic minimum of zero, so it is the one box in the summary that flexing can take the
   difference out of.

   Scoped off .env-menu, which shares this class: it is a fixed target with nothing to give. */
header nav > .brand {
    flex-shrink: 0;
}

.user-menu:not(.env-menu) {
    min-width: 0;
}

.user-menu:not(.env-menu) > summary {
    max-width: 100%;
}

.user-menu:not(.env-menu) > summary > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Narrow viewports: the bar's three clusters (brand, user, environment) together outrun the width and
   were pushing the whole PAGE sideways. Drop to the icons and cap the user's name — nothing becomes
   unreachable, and horizontal scrolling stays inside components that opt into it. */
@media (max-width: 700px) {
    header nav {
        gap: var(--space-2);
        padding: 0 var(--space-3);
    }

    .env-menu > summary .env,
    .env-menu > summary .fa-caret-down {
        display: none;
    }

    /* 38vw is a CAP, not a fit: it knows the viewport but not what else is in the bar, so it stops
       the name eating a 600px screen and does nothing about a 320px one. Measured there: toggle 36
       + brand 52 + user 183 + env 36 + gaps ran to 331px inside a 296px row, and the environment
       menu — last in line — hung 23px off the edge and took the DOCUMENT's scrollbar with it.
       (Present on every page, which is how it stayed distinct from the bulk-verb toolbar's own
       overflow, board 477.) What makes it fit is the truncation the bar has at every width, above:
       min-width: 0 on the menu, max-width: 100% on its summary, and the ellipsis on the name. */
    .user-menu > summary > span {
        max-width: 38vw;
    }

    /* A fixed-size target — the icon-only environment menu. Shrink is proportional to base size, so
       without this the row would shave a few pixels off it on the way past, squashing a tap target to
       spare the one box that can truncate cleanly. (.rail-toggle declares its own flex-shrink: 0 with
       the rest of the burger, .help-link with the rest of its rule, and the brand at every width,
       above, so none is repeated here.) */
    .env-menu {
        flex-shrink: 0;
    }

    /* The wordmark goes, the mark stays; the help link's word goes, its icon stays (board 513). Visually
       hidden rather than display:none so both links keep their accessible names — the brand image is
       decorative (alt="") and would otherwise leave the home link unnamed for a screen reader, and the
       help link's icon is aria-hidden, so its word is what its name starts with at every width. */
    .brand .brand-text,
    .help-link .help-link-text {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        border: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

/* ───────────────────────────────────────────────────────────── */
/*  APP SHELL (board 435)                                         */
/* ───────────────────────────────────────────────────────────── */
/* Full-height column: top bar → lime signature edge → body row (rail + content). The rail lives in
   the layout so every screen inherits it; pages know nothing about it. */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Decorative only — the brand's signature edge. Never carries text (contrast). */
.app-edge {
    height: 2px;
    background-color: var(--color-accent);
    flex-shrink: 0;
}

.app-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* Acting-as banner (board 440): a persistent amber bar for a HelixStaff act-as session. Deliberately
   NOT the brand lime (which reads as success/normal); its own local amber values, since the palette
   has no caution token. Spans the full width above the rail. */
.acting-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
    padding: var(--space-2) var(--space-5);
    background-color: #fff4d6;
    color: #5a4200;
    border-bottom: 1px solid #e0a63c;
    font-size: var(--text-sm);
    flex-shrink: 0;
}

.acting-banner-msg {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.acting-banner-action {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
    color: #5a4200;
    white-space: nowrap;
}

.acting-banner-action:hover {
    text-decoration: underline;
}

/* The burger, first in the bar. Sized like the other top-bar controls. */
.rail-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--color-on-primary);
    font-size: var(--text-base);
    cursor: pointer;
    transition: var(--transition-fast);
}

.rail-toggle:hover {
    background-color: rgba(255, 255, 255, 0.14);
    color: var(--color-on-primary);
}

/* The arrow beside the bars (owner, 2026-11-15) points the way a press moves the rail: left while it is open,
   right once it is closed. Its box is the glyph's ink (the viewBox in _Layout), so the turn keeps it in place and
   the 1px gap to the bars, closer than the owner's sample's 2px, holds pointing either way. A turn is a transform,
   so the button, and everything after it in the bar, keeps its size and place. */
.rail-toggle-arrow {
    flex-shrink: 0;
    width: 0.4em;
    height: 0.7em;
    fill: currentColor;
}

.rail-toggle[aria-expanded="false"] .rail-toggle-arrow {
    transform: rotate(180deg);
}

/* Only a press animates the turn (shell.js adds the class on a press and drops it when the window crosses the
   breakpoint). On load shell.js sets the state after the button may already be styled, and a page that opens
   collapsed shows the arrow already turned, rather than swinging it round as the page appears. */
.rail-toggle.is-turning .rail-toggle-arrow {
    transition: transform 0.2s ease;
}

/* Narrow, the rail is a strip under the bar, not a column beside the page, so the arrow points up while it is open
   and down once it is closed. Its box widens to a square so that, turned on its side, it still clears the bars by
   the same 1px. */
@media (max-width: 900px) {
    .rail-toggle-arrow {
        width: 0.7em;
        transform: rotate(90deg);
    }

    .rail-toggle[aria-expanded="false"] .rail-toggle-arrow {
        transform: rotate(-90deg);
    }
}

/* Collapsed: the rail is removed from the layout rather than narrowed to icons — with a burger
   always in reach, "gone" is less ambiguous than a strip of unlabelled glyphs. */
.app-shell.rail-collapsed .app-rail {
    display: none;
}

.app-main {
    flex: 1;
    min-width: 0;   /* lets a wide grid scroll inside instead of stretching the row */
    display: flex;
    flex-direction: column;
    background-color: var(--color-surface);
}

/* ── Navigation rail ── */
.app-rail {
    width: 252px;
    flex-shrink: 0;
    background-color: var(--color-bg);
    border-right: 1px solid var(--color-surface-alt);
    padding: var(--space-3) var(--space-3);
}

/* min-height, not height (board 443): the rail is a scroll container on desktop, and with a fixed
   height a nav taller than the viewport would overflow a box whose height never grew — leaving
   .rail-footer's `margin-top: auto` resolving against the wrong height. min-height keeps the footer
   pinned to the bottom while the nav is short, and lets the box grow (and the rail scroll) once it
   is not. */
.rail-nav {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.rail-section-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9aa6a3;
    padding: var(--space-2) 11px var(--space-2);
}

/* The Advanced label is separated from Core by a hairline. :not(:first-child) so the rule follows the
   sections rather than being hardcoded to the second one — sections are data (HelixNavigation). */
.rail-section-label:not(:first-child) {
    margin-top: var(--space-2);
    border-top: 1px solid var(--color-surface-alt);
    padding-top: var(--space-4);
}

/* One row shape for links, group headers and unbuilt buttons alike, so they line up exactly. */
.rail-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-radius: 7px;
    background: none;
    color: var(--color-ink);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    list-style: none;   /* group headers are <summary> */
    transition: var(--transition-fast);
}

.rail-item::-webkit-details-marker {
    display: none;
}

.rail-item:hover {
    background-color: var(--color-surface-alt);
    color: var(--color-ink);
}

.rail-icon {
    width: 17px;
    text-align: center;
    color: var(--color-brand);
    flex-shrink: 0;
}

/* Screens a later milestone will fill in: present, but visibly quieter than what works today. */
.rail-item.is-unbuilt,
.rail-item.is-unbuilt .rail-icon {
    color: #9aa6a3;
}

.rail-item.is-unbuilt:hover {
    color: var(--color-ink-muted);
}

.rail-chevron {
    margin-left: auto;
    font-size: 11px;
    color: #9aa6a3;
    transition: transform 0.18s ease;
}

.rail-group[open] > .rail-item .rail-chevron {
    transform: rotate(180deg);
}

/* Settings' Staff only disclosure (board 585; the owner, 2026-11-25: "like the more on reports"): its summary in the Reports side's More's
   small muted voice, its pages under one hairline as a More's are. The Error Checks group's More (board 591; the owner, 2026-11-26),
   the checks with nothing found, is drawn the same way. */
.rail-staff-only > summary,
.rail-more > summary {
    cursor: pointer;
    padding: 7px 10px;
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
}

.rail-staff-only-list,
.rail-more-list {
    margin: 0 0 0 11px;
    border-left: 1.5px solid #e0ebe8;
    padding-left: var(--space-2);
}

.rail-sublist {
    display: flex;
    flex-direction: column;
    margin: 2px 0 var(--space-1) 22px;
    border-left: 1.5px solid #e0ebe8;
    padding-left: var(--space-2);
}

/* Sub-items read one step down from their parent: smaller, muted, and without the leading icon's
   colour weight (the icon is hidden — the indent already says where they belong). */
.rail-sublist .rail-item {
    padding: 7px 10px;
    font-size: var(--text-xs);
    font-weight: 400;
    color: var(--color-ink-muted);
}

.rail-sublist .rail-icon {
    display: none;
}

.rail-sublist .rail-item:hover {
    color: var(--teal-700);
}

/* An error check's count in the rail's Error Checks group (user, 2026-10-16): small and raised after the label,
   in the home card's tiers. Red is the card's data-integrity red. An ordinary open check is the app's warning
   amber, not the card's teal, which reads as green ("fine") at this size; on the colour wheel amber sits near
   the brand teal's triad and the red near its split complement, so both belong to the palette. An untracked
   check's number is muted ink with no wash: the wash is what marks a number as open. Raised by position rather
   than vertical-align, so a counted entry is no taller than its neighbours. */
.rail-count {
    position: relative;
    top: -0.45em;
    margin-left: 3px;
    padding: 2px 5px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    vertical-align: baseline;
    white-space: nowrap;
}

.rail-count.is-danger {
    color: var(--color-danger);
    background-color: var(--color-danger-bg);
}

.rail-count.is-attention {
    color: var(--color-warning);
    background-color: var(--color-warning-bg);
}

.rail-count.is-quiet {
    padding-inline: 0;
    font-weight: 600;
    color: var(--color-ink-muted);
}

/* Settings pins to the bottom of the rail above a hairline, with the copyright beneath it. */
.rail-footer {
    margin-top: auto;
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-surface-alt);
}

.rail-copyright {
    display: block;
    padding: var(--space-2) 11px var(--space-1);
    color: var(--color-ink-muted);
    font-size: 11px;
    line-height: 1.4;
}

.rail-copyright .fa-copyright {
    color: var(--color-brand);
}

/* On a page that requires sign-in the copyright is a link to the Terms of Service (_CopyrightNotice).
   It keeps the mark's own muted ink in both places it appears, the rail's foot and the fallback footer,
   and shows it is a link only when pointed at or focused. */
.copyright-link {
    color: inherit;
    text-decoration: none;
}

.copyright-link:hover,
.copyright-link:focus-visible {
    /* Stated again, or the page-wide a:hover colour wins here and the mark turns link-blue. */
    color: inherit;
    text-decoration: underline;
}

/* Desktop only (board 443): pin the shell to the viewport so the rail is always fully visible and
   the CONTENT scrolls instead of the page — the dev.azure.com shell, and the reason its left nav
   never slides away under a long list.
 *
 * The base rule above is `min-height: 100vh`, which makes the shell grow past the viewport and hands
 * scrolling to the document, taking the rail with it. Here the shell is exactly the viewport and
 * clips; .app-body already carries `flex: 1; min-height: 0`, so the rail and the content column
 * inherit that bounded height and each takes its own scrollbar.
 *
 * `min-height: 0` on .app-main is load-bearing and easy to lose: a flex item's default `min-height:
 * auto` refuses to shrink below its content, so without it the column would size to the page and
 * overflow the shell instead of scrolling inside it.
 *
 * Deliberately NOT applied below 900px, where the rail becomes a horizontal strip: locking a phone
 * to 100vh fights mobile browser chrome (the URL bar resizes the viewport) and would trap the strip
 * and the content in two tiny scrollers. Small screens keep the ordinary document scroll.
 *
 * The two overlays are unaffected — .modal and .toast-region are `position: fixed`, and no ancestor
 * here sets transform/filter/contain, so neither becomes a containing block and neither is clipped
 * by the shell's overflow. */
@media (min-width: 901px) {
    .app-shell {
        /* min-height:0 first: the base rule sets min-height:100vh, and min-height WINS over height,
           so without this the shell can never be shorter than 100vh no matter what `height` says.
           Harmless while 100vh == 100dvh, but it silently defeats the line below on any viewport
           where they differ — and it makes the shell impossible to constrain for testing. */
        min-height: 0;
        height: 100vh;
        height: 100dvh;   /* dvh where supported; the 100vh above stays as the fallback */
        overflow: hidden;
    }

    .app-rail,
    .app-main {
        min-height: 0;
        overflow-y: auto;
    }

}

/* Below the rail's breakpoint it becomes a horizontal strip above the content rather than eating a
   quarter of a phone screen. Sub-lists still disclose; the shell just stops being two columns. */
@media (max-width: 900px) {
    .app-body {
        flex-direction: column;
    }

    .app-rail {
        width: auto;
        border-right: 0;
        border-bottom: 1px solid var(--color-surface-alt);
    }
}

/* ───────────────────────────────────────────────────────────── */
/*  LAYOUT                                                        */
/* ───────────────────────────────────────────────────────────── */
main {
    /* width:100% is load-bearing inside the shell's column flex container: `margin: 0 auto` on a flex
       item's cross axis suppresses the default stretch, so without it main shrink-wraps its content
       and a max-width:none page (the dashboard) never fills the column. With it, max-width does the
       constraining and the auto margins only centre what is left. */
    width: 100%;
    max-width: 42rem;   /* a readable measure for forms and prose */
    margin: 0 auto;
    padding: var(--space-6) var(--space-5);
}

/* The dashboard is a set of full-width panels, not prose — it gets the content column's real width
   (same escape as a grid page takes). */
main:has(.home) {
    max-width: none;
    padding: var(--space-5) 28px;
}

/* A page carrying a grid gets the room a table actually needs, instead of squeezing 6+ columns into
   the prose measure and forcing a horizontal scrollbar while the viewport sits half empty. Scoped with
   :has() so it is automatic — no per-page opt-in for the 16+ grids to forget — and so it touches only
   grid pages; every card/prose page keeps its measure. Capped rather than unbounded so an ultra-wide
   monitor doesn't stretch rows to an unreadable span. Browsers without :has() simply keep today's
   behaviour (narrow + .grid-scroll), which is a graceful floor rather than a break. */
main:has(.grid) {
    max-width: 96rem;
}

/* The Excel/OData access page carries a 64-character token that reads best on ONE line — a wrapped
   secret is harder to scan and verify. The prose measure (42rem) is ~50px too narrow for it, so this
   page gets a little more room. Same :has() escape as the dashboard and grids; touches only this page. */
main:has(.token-access) {
    max-width: 50rem;
}

/* What's New uses the width of the screen (user, 2026-10-19): at the prose measure it sat in a dialog-wide
   column with most of a 1080p screen empty beside it. Capped as a grid page is, so an ultra-wide monitor
   does not stretch a line past reading. */
main:has(.whats-new) {
    max-width: 96rem;
}

/* Client settings is wider too (user, 2026-10-29: "make the box that shows the settings wider"): COA Category's 96rem, as
   a grid page gets, so a section's fields sit several to a row. Touches only that page. */
main:has(#settings-editor) {
    max-width: 96rem;
}

/* A journal entry's page too (user, 2026-11-03, board 504: "way too squished"): at the prose measure its four fields sat
   two to a row and the lines' Memo was cut off. Touches only that page. */
main:has(#journal-entry-editor) {
    max-width: 96rem;
}

/* The client's Importers page, and its own Importer status page, take COA Categories' width (owner, 2026-11-09: "too narrow…
   consistent with other such screens, e.g. COA Categories"): their record sections' grids would otherwise load into the
   prose measure and leave the screen empty beside them. Touches only those two pages. */
main:has(.importers-page) {
    max-width: 96rem;
}

/* A record page (a holding company's, an investor's, an investment's, a CFS category's, a person's) takes a grid page's width
   from the moment it opens (owner, 2026-11-19: the company page opened "dialog size narrow" and widened when a section was
   opened). Its sections load their grids only as they open, so main:has(.grid) matched only once one had: the company's page,
   which opens with every section closed, sat at the prose measure until then, and the others for the moment their open
   section took to load. The sections are drawn with the page and kept by every save, so this holds throughout. */
main:has(.record-sections) {
    max-width: 96rem;
}

footer {
    max-width: 64rem;
    margin: var(--space-7) auto 0;
    padding: var(--space-5);
    color: var(--color-ink-muted);
    font-size: var(--text-sm);
    text-align: center;
}

/* Brand-green copyright mark (Font Awesome), matching the Helix identity teal. */
footer .fa-copyright {
    color: var(--color-brand);
}

/* ───────────────────────────────────────────────────────────── */
/*  HERO                                                          */
/* ───────────────────────────────────────────────────────────── */
.hero h1 {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-4);
    color: var(--color-ink);
}

.lede {
    color: var(--color-ink-muted);
}

/* Milestone/status chip. */
.status-note {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background-color: var(--color-surface-alt);
    color: var(--teal-700);
    border-radius: var(--radius-pill);
    padding: var(--space-1) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 600;
}

/* What's New (user, 2026-10-15): one card per release, newest first, linked from the home page. Never underlined (owner,
   2026-11-17): an underline under the words and not the icon beside them reads as broken. */
.whats-new-link,
.whats-new-link:hover,
.whats-new-link:focus-visible {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
}

.whats-new h2 {
    margin-top: 0;
}

/* A release's heading, with the date its branch was cut beside it, quieter than the heading. */
.release-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-1) var(--space-4);
}

.release-head h2 {
    margin-bottom: 0;
}

.release-date {
    color: var(--color-ink-muted);
    font-size: var(--text-sm);
    font-variant-numeric: tabular-nums;
}

/* The two parts of a release, quieter than its heading: they sort its lines, they are not news. */
.release h3 {
    margin: var(--space-4) 0 var(--space-2);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-ink-muted);
}

.release-list {
    margin: 0;
    padding-left: var(--space-5);
}

.release-list li + li {
    margin-top: var(--space-2);
}

.status-note .fas {
    color: var(--color-brand);
}

/* ───────────────────────────────────────────────────────────── */
/*  CARDS                                                         */
/* ───────────────────────────────────────────────────────────── */
.card {
    background-color: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5) var(--space-6);
    margin: var(--space-5) 0;
}

.card h1,
.card h2 {
    margin-top: 0;
}

.card h2 {
    color: var(--color-primary);
}

.card h2 .fas {
    color: var(--color-brand);
}

/* ───────────────────────────────────────────────────────────── */
/*  HOME DASHBOARD (board 435)                                    */
/* ───────────────────────────────────────────────────────────── */
.home {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    /* The breakpoints below read the page's own width, which the rail's width decides as much as the window's. */
    container-type: inline-size;
}

/* THE CUSTOM HOME PAGE's banner (board 570): across the top of Home, above the strip, for a client whose setting names one of
   its custom reports. Logi's card was a dark band with the glyph, the title, the line and a chevron (WB2); this is the app's
   teal, the panels' radius, and the whole band one link. The glyph sits in a lime-ringed disc, the accent the top bar's edge
   and its focus ring use on the same teal, and the chevron moves right on hover, so the band reads as a way somewhere rather
   than a notice. */
.home-banner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-5) var(--space-3) var(--space-4);
    border-radius: 12px;
    background: linear-gradient(100deg, var(--teal-700) 0%, var(--teal-600) 60%, var(--teal-500) 100%);
    box-shadow: var(--shadow-sm);
    color: var(--color-on-primary);
    text-decoration: none;
}

.home-banner:hover,
.home-banner:focus-visible {
    color: var(--color-on-primary);
    text-decoration: none;
    box-shadow: var(--shadow-md);
}

.home-banner:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

.home-banner-icon {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 2px solid var(--color-accent);
    border-radius: 50%;
    background-color: rgba(255, 255, 255, .12);
    font-size: 1.25rem;
}

.home-banner-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.home-banner-title {
    font-size: var(--text-lg);
    font-weight: 700;
    line-height: 1.3;
}

.home-banner-line {
    font-size: var(--text-sm);
    line-height: 1.4;
    opacity: .9;
}

.home-banner-go {
    flex: none;
    font-size: var(--text-lg);
    transition: transform .15s ease-out;
}

.home-banner:hover .home-banner-go {
    transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
    .home-banner-go {
        transition: none;
    }
}

/* Client settings' Custom home page (board 570): the note that the report named is one the client cannot open. */
.settings-home-unavailable .fas {
    color: var(--color-warning);
}

/* THE ONE HOME (the unified home; owner, 2026-11-17, design 3): the import status column on the left, the tabs on the
   right. The strip, the grid's first row, holds the column's heading and the tabs on one line over one rule, so the two
   columns start level: a heading where the owner's sketch had a fixed tab, so nothing on the line looks clickable that is
   not. What's new ends the line. Switching tabs swaps only what is under the strip. One column on a narrow screen, the
   status first. */
.home-grid {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: var(--space-4);
    align-items: start;
}

.home-strip {
    display: flex;
    align-items: flex-end;
    align-self: stretch;
    min-height: 2.75rem;
    border-bottom: 1px solid var(--color-line);
}

/* The rule runs on across the gap between the columns, so the strip reads as one line. */
.home-strip-status {
    margin-right: calc(-1 * var(--space-4));
    padding-right: var(--space-4);
}

.home-strip-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    padding: 0 2px 10px;
    font-size: var(--text-base);
    font-weight: 700;
    line-height: 1.5;
    color: var(--color-ink);
}

.home-strip-title .fas {
    color: var(--color-brand);
}

.home-tabs {
    display: flex;
    align-items: flex-end;
    align-self: stretch;
    gap: var(--space-1);
}

/* Not a button's look: the label, with a bar under the open tab that sits on the strip's rule. No lift on hover (the
   global button rule's), so nothing on the line moves. */
.home-tab,
.home-tab:hover,
.home-tab:active {
    background: none;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    margin-bottom: -1px;
    padding: 0 10px 7px;
    flex: none;
    white-space: nowrap;
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--color-ink-muted);
}

.home-tab:hover {
    color: var(--color-primary);
}

.home-tab[aria-selected="true"] {
    color: var(--color-primary);
    border-bottom-color: var(--color-brand);
}

.home-tab .fas {
    color: var(--color-brand);
}

.home-strip-tabs .whats-new-link {
    flex: none;
    margin-left: auto;
    padding: 0 0 10px var(--space-3);
    white-space: nowrap;
    line-height: 1.5;
}

.home-panels,
.home-tabpanel {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-width: 0;
}

.home .panel-title .fas {
    color: var(--color-brand);
}

/* A narrower status column on a mid-sized page, and What's new without its icon, so the tabs and What's new keep one
   line beside it. */
@container (max-width: 979px) {
    .home-grid {
        grid-template-columns: 300px minmax(0, 1fr);
    }

    .home-strip-tabs .whats-new-link .fas {
        display: none;
    }

    .home-tab,
    .home-tab:hover,
    .home-tab:active {
        font-size: var(--text-sm);
    }
}

@container (max-width: 739px) {
    .home-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-strip-status {
        order: 1;
        margin-right: 0;
        padding-right: 0;
    }

    .home-status {
        order: 2;
    }

    .home-strip-tabs {
        order: 3;
    }

    .home-panels {
        order: 4;
    }
}

/* A dashboard panel — the card treatment with a slightly larger radius, per the comp.
   Deliberately NOT `overflow: hidden`: a menu opened inside a panel is absolutely positioned and was
   being clipped away by the card's own bounds. Only the panel that actually needs its rows trimmed
   to the rounded corners opts in (.attention, below). */
.panel {
    background-color: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

/* Its divided rows run edge to edge, so they need clipping to the radius; it holds no menus. */
.panel.attention {
    overflow: hidden;
}

.panel-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #7c8a87;
}

/* ── Import status ── */
.home-status {
    padding: var(--space-4);
}

.home-status-line {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.home-status .status-medallion {
    width: 44px;
    height: 44px;
    font-size: 20px;
}

.home-status .status-value {
    font-size: var(--text-xl);
}

.home-status hr {
    border: 0;
    border-top: 1px solid var(--color-surface-alt);
    margin: var(--space-3) 0;
}

.home-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.home-summary-items {
    list-style: none;
    margin: var(--space-2) 0;
    padding: 0;
    font-size: var(--text-xs);
}

.home-summary-items li {
    display: flex;
    gap: var(--space-2);
    padding: 4px 0;
    border-bottom: 1px solid var(--color-surface-alt);
}

.home-summary-n {
    min-width: 1.5em;
    text-align: right;
    font-weight: 700;
    color: var(--color-danger);
}

.home-summary-review {
    display: inline-block;
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
}

.home-summary-clear {
    margin: 0;
}

.home-summary-clear .fas {
    color: var(--color-success);
}

.home-status-refresh {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}


.status-medallion {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.status-medallion.is-success {
    background-color: var(--color-success-bg);
    color: var(--color-success);
}

.status-medallion.is-danger {
    background-color: var(--color-danger-bg);
    color: var(--color-danger);
}

.status-medallion.is-neutral {
    background-color: var(--color-surface-alt);
    color: var(--color-brand);
}

.status-block {
    min-width: 170px;
}

.status-value {
    font-size: var(--text-2xl);
    font-weight: 700;
    line-height: 1.1;
}

.status-sub {
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
    margin-top: 3px;
}

.status-meta-value {
    font-size: var(--text-sm);
    color: var(--color-ink);
    margin-top: 2px;
}

/* A LABELLED disclosure button (icon + text + caret), as opposed to .grid-menu's 40px square icon
   button — reusing that one here forced the label out of a fixed 40px box and over its neighbour.
   Shares only .grid-menu-content for the popup itself. */
.menu-disclosure {
    position: relative;
}

.menu-disclosure > summary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 9px 13px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    background-color: var(--color-bg);
    color: var(--color-primary);
    font-size: var(--text-xs);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    list-style: none;
    transition: var(--transition-fast);
}

.menu-disclosure > summary::-webkit-details-marker {
    display: none;
}

.menu-disclosure > summary:hover,
.menu-disclosure[open] > summary {
    background-color: var(--color-surface-alt);
    border-color: var(--color-primary-soft);
}

.menu-disclosure > summary .menu-caret {
    font-size: 10px;
    opacity: 0.7;
    transition: transform 0.15s ease;
}

.menu-disclosure[open] > summary .menu-caret {
    transform: rotate(180deg);
}

/* A split button (owner, 2026-11-17): the main part does the usual thing at once, and the arrow joined to its right opens
   the rest, a .menu-disclosure. Both parts wear the labelled disclosure's look and share one border between them. No lift
   on hover (the global button rule's), so the two parts stay joined. */
.split-button {
    display: inline-flex;
    flex: none;
}

.split-button > form {
    display: flex;
    margin: 0;
}

/* One height for both parts: the arrow's only content is a 10px glyph, so its padding alone would leave it short. */
.split-button-main,
.split-button-main:hover,
.split-button-main:active,
.split-button-menu > summary {
    box-sizing: border-box;
    height: 38px;
}

.split-button-main,
.split-button-main:hover,
.split-button-main:active {
    padding: 0 13px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    background-color: var(--color-bg);
    color: var(--color-primary);
    font-size: var(--text-xs);
    line-height: 1.5;
    white-space: nowrap;
    box-shadow: none;
    transform: none;
}

.split-button-main:hover,
.split-button-menu > summary:hover,
.split-button-menu[open] > summary {
    position: relative;
    z-index: 1;
    background-color: var(--color-surface-alt);
    border-color: var(--color-primary-soft);
}

.split-button-menu > summary {
    margin-left: -1px;
    padding: 0 10px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Refresh's drop-down is as wide as the whole split button, wider only when an entry's words need it, such as AppFolio files (the
   owner, 2026-11-19, #564), rather than the usual menu's 230px. It opens under the split button, so the button, not the arrow, is
   where it is placed from: on Home its right edges meet the button's and it grows to the left; on the rail (below) it grows to the
   right. */
.refresh-split {
    position: relative;
}

.refresh-split > .split-button-menu {
    position: static;
}

.refresh-split .grid-menu-content {
    min-width: 100%;
}

/* Refresh's circle turns while a refresh asked for on this page runs (the owner, 2026-12-04; shell.js sets .is-refreshing), as a
   toast's icon does, and keeps still for anyone who has asked their OS to reduce motion, the toast still saying what runs. */
.refresh-split.is-refreshing .split-button-main .fa-sync-alt {
    animation: job-status-spin 1.6s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .refresh-split.is-refreshing .split-button-main .fa-sync-alt {
        animation: none;
    }
}

/* ── Needs attention ── */
/* Wraps rather than crushes. The badge grew a second clause in board 443 ("5 items · 2 data
   integrity") and at 375px the three items stopped fitting on one line: with the flex default they
   all shrank instead, splitting the title across two lines and breaking the badge across two lines
   INSIDE its 999px pill. Now the caption drops to a line of its own and the first two stay whole. */
.panel-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: 15px var(--space-4);
    border-bottom: 1px solid var(--color-surface-alt);
}

.panel-title {
    font-weight: 700;
    font-size: var(--text-base);
}

.panel-caption {
    margin-left: auto;
    font-size: var(--text-xs);
    color: #7c8a87;
}

/* A count of things that need doing, so it is NOT painted in the success wash it used to wear —
   green on "5 items" said the opposite of what the number meant. Neutral by default; danger only
   when the count includes data-integrity findings, which is the one case worth raising a voice for. */
.count-badge {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-ink-muted);
    background-color: var(--color-surface-alt);
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    /* A pill is a single-line shape: let it wrap and the 999px radius bows around two lines of text. */
    white-space: nowrap;
}

.count-badge.is-danger {
    color: var(--color-danger);
    background-color: var(--color-danger-bg);
}

.attention-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px var(--space-4);
}

.attention-row + .attention-row {
    border-top: 1px solid var(--color-surface);
}

.row-medallion {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-base);
    flex-shrink: 0;
}

/* Three washes, three meanings — and the first two used to be the wrong way round: the all-clear row
   wore the neutral teal while a live error wore the SUCCESS green, so the card's only green thing
   was its bad news. Green now means clear, teal means open-but-ordinary, red means the ledger itself
   is suspect. None of them carries the meaning alone; every row also says its state in words. */
.row-medallion.is-success {
    background-color: var(--color-success-bg);
    color: var(--color-success-icon);
}

.row-medallion.is-attention {
    background-color: var(--color-surface-alt);
    color: var(--color-brand);
}

.row-medallion.is-danger {
    background-color: var(--color-danger-bg);
    color: var(--color-danger);
}

.row-text {
    flex: 1;
    min-width: 0;
}

.row-title {
    font-weight: 600;
    font-size: var(--text-sm);
}

.row-sub {
    font-size: var(--text-xs);
    color: #7c8a87;
}

/* Names the tier in the sub-line, so the wash behind the icon is reinforcement rather than the only
   carrier of "this one is different". */
.row-tag {
    color: var(--color-danger);
    font-weight: 600;
}

/* The same tag inside the collapsed band, where there is no medallion to reinforce it. Outlined
   rather than filled: it marks an unusual case without shouting from a section the client has
   deliberately quietened. */
.row-tag.is-outline {
    display: inline-block;
    margin-left: var(--space-2);
    padding: 0 7px;
    border: 1px solid var(--color-danger);
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Not tracked (passive checks) ──
   Checks the client switched off, collapsed under the open items. They keep a Review control because
   the counts are real and the client may be reconsidering the feature — what they lose is the weight
   of a medallion and a full row, not the ability to look. */
.not-tracked {
    border-top: 1px solid var(--color-surface-alt);
    background-color: var(--color-surface);
}

.not-tracked > summary {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 11px var(--space-4);
    cursor: pointer;
    list-style: none;
    color: var(--color-ink-muted);
    font-size: var(--text-xs);
    font-weight: 600;
}

.not-tracked > summary::-webkit-details-marker {
    display: none;
}

.not-tracked > summary:hover {
    background-color: var(--color-surface-alt);
}

.not-tracked > summary .menu-caret {
    font-size: 10px;
    opacity: 0.7;
    transition: transform 0.15s ease;
}

.not-tracked[open] > summary .menu-caret {
    transform: rotate(180deg);
}

.not-tracked-count {
    font-weight: 400;
    color: #7c8a87;
}

.not-tracked-list {
    padding: 0 var(--space-4) var(--space-3);
}

/* The band's way to the settings page's Error checks section (board 495), above the checks it lists. */
.not-tracked-settings {
    margin: 0 0 var(--space-2);
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
}

.not-tracked-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 5px 0;
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
}

/* Right-aligned in a fixed column so the counts read as a column of numbers rather than as ragged
   prefixes to the subjects. Inks darker than the band's other muted text (#7c8a87, ~3.4:1 here): this
   one is DATA, not a label, and it is the smallest type on the card. */
.not-tracked-value {
    min-width: 2.5em;
    text-align: right;
    color: var(--color-ink-muted);
    font-variant-numeric: tabular-nums;
}

.not-tracked-subject {
    flex: 1;
    min-width: 0;
}

/* The notice dialog is the confirm dialog in an informational key, not a destructive one. */
.notice-head .fa-circle-info {
    color: var(--color-brand);
}

/* ───────────────────────────────────────────────────────────── */
/*  FORMS                                                         */
/* ───────────────────────────────────────────────────────────── */
.field {
    margin-bottom: var(--space-4);
}

.field label {
    display: block;
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--color-ink);
    margin-bottom: var(--space-1);
}

/* Selects share the input treatment so a dropdown never falls back to the raw browser control. */
.field input,
.field select,
input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font: inherit;
    color: var(--color-ink);
    background-color: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.field select {
    cursor: pointer;
}

.field input:focus,
.field select:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(51, 116, 103, 0.18);
}

/* ── A select's list (the owner, 2026-11-16) ──
   A <select> drops the browser's own list, and on Windows that list marks its row in the system's strong blue, edge to edge, its
   words turned white. Chromium (Chrome, Edge) lets the page draw the list instead, the select staying a select: the same keys, the
   same value posted and the same change event htmx listens for. So where the browser can, a select's list is drawn as the app's
   other drop-downs are (--color-option-hover, --option-pad, --option-radius): a panel under the box, the row under the pointer or
   the keyboard tinted and rounded inside it, the words keeping their colour, and the chosen row ticked at its end. A browser that
   cannot (Firefox, Safari) shows its own list under the same box.

   The box keeps its look. Each kind of select sets its own padding, border, size and ground (.field select, .report-option select,
   .grid-size select and the rest); :where() gives the rest no weight, so it fills in only what a select of no kind would lack. Its
   arrow is the app's chevron, turned while the list is open. And it keeps one width whatever is chosen: the browser sizes a drawn
   select to the words chosen, so a shorter choice would move what is beside it. Most kinds fill their field (width: 100%); the two
   that do not are given the width the browser's own box had, measured: the grid's rows per page and the favorites' sort. A new
   select that sits beside other things needs the same. */
@supports (appearance: base-select) {
    select,
    ::picker(select) {
        appearance: base-select;
    }

    /* One line, cut at the box, as the browser's own select is: a drawn one would wrap words too long for it onto a second line, and
       the box would grow. */
    :where(select) {
        position: relative;
        overflow: hidden;
        white-space: nowrap;
        border: 1px solid var(--color-line);
        border-radius: var(--radius-sm);
        background-color: var(--color-bg);
        color: var(--color-ink);
        font: inherit;
        cursor: pointer;
    }

    /* The arrow, drawn as the browser drew its own (the owner, 2026-11-16: the first drawn one sat high and read small). Measured on
       the browser's own: 8px by about 4.5, in the words' colour, centred in the box, its right end 4.5px in from the box's outer
       edge, the same in every kind of select whatever its font or padding, and there whatever the words' length. So the arrow is
       that chevron, placed there: out of the line of the words, which would otherwise set it on their baseline, above the middle,
       and push it out of a box too narrow for them. The end padding keeps the words clear of it: the arrow's 3.5px, its 8px and a
       gap. !important because each kind of select sets its padding with a weightier rule further down, and the end padding is the
       arrow's in all of them. */
    select {
        padding-inline-end: calc(4.5px + 8px + var(--space-2)) !important;
    }

    select::picker-icon {
        content: "";
        position: absolute;
        inset-inline-end: 4.5px;
        top: calc(50% - 2.5px);
        width: 8px;
        height: 5px;
        background-color: currentColor;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 5'%3E%3Cpath d='M1.25 1.25 4 3.9l2.75-2.65' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
        transition: rotate 0.15s ease;
    }

    select:open::picker-icon {
        rotate: 180deg;
    }

    /* Under the box when it fits there, over it when it does not, as the browser's own list opens: the browser would otherwise open
       a drawn list on whichever side has more room, over the box for a field low on the screen. Its height is capped so that one
       side or the other has room for it; a longer list scrolls. */
    ::picker(select) {
        position-try-order: normal;
        max-block-size: min(20rem, 45vh);
        margin-block: var(--space-1);
        padding: var(--option-pad);
        border: 1px solid var(--color-line);
        border-radius: var(--radius-md);
        background-color: var(--color-bg);
        color: var(--color-ink);
        box-shadow: var(--shadow-lg);
    }

    /* The words start level with the box's (its 12px less the list's --option-pad). */
    select option {
        gap: var(--space-2);
        padding: var(--space-2) calc(var(--space-3) - var(--option-pad));
        border-radius: var(--option-radius);
        color: var(--color-ink);
        font-size: inherit;
        white-space: nowrap;
    }

    select option:enabled:hover,
    select option:focus-visible {
        background-color: var(--color-option-hover);
    }

    select option:focus-visible {
        outline: 2px solid var(--color-focus);
        outline-offset: -2px;
    }

    select option:enabled:active {
        background-color: var(--color-surface-alt);
    }

    /* An entry that does not apply now (ReportOption.EntryConditions; the Balance Sheet's Intercompany Activity "Column" by period, the
       owner, 2026-11-16): in its place, so nothing moves, greyed and not to be picked. */
    select option:disabled {
        color: var(--color-ink-muted);
        opacity: 0.6;
        cursor: default;
    }

    /* The tick on the chosen row (the owner, 2026-11-16: "Keep the ✓"): after the words, at the row's end, as the grid's filter
       panel marks its sort. */
    select option::checkmark {
        order: 1;
        margin-inline-start: auto;
        color: var(--color-primary);
        font-weight: 700;
    }

    /* A group's name over its choices, as the report pickers' headings read, its choices indented under it as the browser's own
       list indents them. */
    select optgroup {
        padding-block-start: var(--space-1);
        font-weight: 600;
        color: var(--color-ink-muted);
    }

    select optgroup option {
        padding-inline-start: calc(var(--space-3) - var(--option-pad) + var(--space-3));
        font-weight: 400;
    }

    /* 10 to 100 rows, and Last run, Name and Newest: each as wide as the browser drew it. */
    .grid-size select {
        min-width: 61px;
    }

    .fav-tools select {
        min-width: 103px;
    }
}

/* A quiet note under a report option that names where its grouping is chosen (the owner's design A, 2026-11-16: under the Balance
   Sheet's Intercompany Activity, "Grouping is from the Companies picker · Change"): the hint's size and colour, its Change a link kept
   on one line with its dot. Its words are the same whatever the grouping, so changing it never moves what is under it. */
.report-option-note {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
}

.report-option-note-change {
    white-space: nowrap;
}

.report-option-note button.report-months-link {
    padding: 0;
    font-size: inherit;
}

/* A flag beside a field with a note (Unrealized Gains beside Intercompany Activity) sits on the line of that field's box, as a flag
   beside any field does (.report-option-flag), not at the foot of the note, however many lines the note takes in a narrow panel: it
   starts at the cell's top under a line as tall as the field's label, and its box is as tall as the field's (padding, border and a
   line), its words in the middle. */
.report-option:has(> .report-option-note) + .report-option-flag {
    align-self: start;
    padding-bottom: 0;
}

.report-option:has(> .report-option-note) + .report-option-flag::before {
    content: "\a0";
    font-weight: 600;
}

.report-option:has(> .report-option-note) + .report-option-flag > .report-option-check {
    min-height: calc(2 * var(--space-2) + 2px + 1lh);
}

/* Helper text under a field — its own line, never trailing the control. */
.field-hint {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
}

.field input.input-validation-error {
    border-color: var(--color-danger);
}

.field span.field-validation-error {
    display: block;
    color: var(--color-danger);
    font-size: var(--text-xs);
    margin-top: var(--space-1);
}

/* ───────────────────────────────────────────────────────────── */
/*  BUTTONS                                                       */
/* ───────────────────────────────────────────────────────────── */
button,
.button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background-color: var(--color-primary);
    color: var(--color-on-primary);
    border: 0;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-4);
    cursor: pointer;
    /* .button is worn by <a> as well as <button>, and an anchor is underlined by the user agent. A
       button is already a button-shaped target; the underline just makes it look like a link wearing a
       costume. */
    text-decoration: none;
    transition: var(--transition-base);
}

/* Hover darkens and lifts (the Logi refresh-button gesture, toned down).
   The colour here is not redundant with .button's, it is load-bearing: `a:hover` (0,1,1) outspecifies
   `.button` (0,1,0), so on an <a class="button"> the generic link hover repainted the LABEL
   --color-primary-hover — the exact colour this rule paints the BACKGROUND, so the label vanished into
   it at 1:1. <button> could never hit it, which is why only link-buttons broke. Restating the
   foreground here (0,2,0) beats `a:hover` and keeps the two kinds of button identical on hover.
   button.secondary:hover is (0,2,1) and still overrides this, as it should.

   The colour line cuts the other way too: on a button that owns its palette via a single class
   (0,1,0), THIS rule (0,1,1) wins the label colour during hover — it turned "Sign in with Google"
   white-on-white. Any such button must restate its colour in its own :hover (0,2,0), as
   .btn-google:hover and button.secondary:hover do. */
button:hover,
.button:hover {
    background-color: var(--color-primary-hover);
    color: var(--color-on-primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

button:active,
.button:active {
    transform: translateY(0);
    box-shadow: none;
}

button:focus-visible,
.button:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

button.htmx-request {
    opacity: 0.6;
    cursor: progress;
}

button.secondary {
    background-color: var(--color-bg);
    color: var(--color-primary);
    border: 1px solid var(--color-line);
}

/* Solid destructive button (the confirm dialog's OK — board 422). Owns its colour AND its :hover:
   the generic button:hover (0,1,1) would otherwise repaint the label with --color-on-primary and the
   background --color-primary-hover, turning a red button teal. button.danger:hover (0,2,1) wins. */
button.danger {
    background-color: var(--color-danger);
    color: #fff;
}

button.danger:hover {
    background-color: var(--color-danger-hover);
    color: #fff;
}

button.secondary:hover {
    background-color: var(--color-surface-alt);
    color: var(--color-primary-hover);
}

/* A quieter size for a control belonging to a de-emphasised row — the Review action on a check the
   client has switched off. Size only: pair it with .secondary for the outline treatment, so the
   variant and the scale stay independent of each other. */
.button-sm {
    padding: 3px 10px;
    font-size: var(--text-xs);
}

/* ───────────────────────────────────────────────────────────── */
/*  VENDOR SIGN-IN BUTTONS                                        */
/* ───────────────────────────────────────────────────────────── */
/*
 * Each provider mandates its own brand for its sign-in button, so these
 * deliberately differ from the app's own buttons and from each other. Do not
 * "harmonise" them into the app palette — that breaks brand compliance.
 *   Google: https://developers.google.com/identity/branding-guidelines
 *   Intuit: https://developer.intuit.com/app/developer/qbo/docs/go-live/list-on-the-app-store/naming-and-logo-guidelines
 */
/* Side by side, Google first (board 446). Wraps rather than overflowing: both buttons are pinned to
   Intuit's native 201px — its button is a brand graphic that may not be resized — so on a narrow card
   they stack instead of being squeezed. */
.provider-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    /* Centred, not left-aligned: the pair is an alternative to the full-width button above it, so it
       reads as one centred group rather than as a ragged left column (board 446). */
    justify-content: center;
    gap: var(--space-5);
}

/* "Forgot your password?" belongs under the password it is about, not beside the Sign in button
   (board 446) — next to Sign in it read as a second action of equal weight. */
.forgot-password {
    display: block;
    margin: calc(-1 * var(--space-2)) 0 var(--space-4);
    font-size: var(--text-xs);
}

/* The primary action owns the full width of the card: it is the one thing almost everyone is here to
   do, and the vendor buttons below it are the alternative, not its equals. */
.signin-button {
    width: 100%;
    height: 48px;
    justify-content: center;
    flex-shrink: 0;
}

/* "or" between the password form and the vendor buttons, with a rule either side. It is a separator,
   not a heading — the alternatives below are equal in kind, just not in expected use. */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-4) 0;
    color: #7c8a87;
    font-size: var(--text-xs);
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--color-line);
}

.provider-form {
    margin-top: var(--space-3);   /* even spacing between the three stacked buttons */
}

/* "Using LastPass?" — a footnote at the foot of the sign-in card, opening the help dialog. It is a
   <button> because it opens a dialog rather than navigating, so this undoes the filled-button look
   the base `button` rule gives it and dresses it as the small quiet link it should read as. Centred
   by margin:auto rather than text-align, since `button` is an inline-FLEX box and centres its own
   label either way — the box itself has to be moved. */
.lastpass-help {
    display: block;
    margin: var(--space-5) auto 0;
    padding: var(--space-1) var(--space-2);
    background: none;
    color: var(--color-ink-muted);
    font-weight: 400;
    font-size: var(--text-xs);
    text-decoration: underline;
}

/* Restated, not redundant: `button:hover` (0,1,1) outspecifies `.lastpass-help` (0,1,0) and would
   repaint this as the filled primary button mid-hover — the trap documented on that rule. */
.lastpass-help:hover {
    background: none;
    color: var(--color-primary-hover);
    box-shadow: none;
    transform: none;
}

/* Google — custom button, light theme (developers.google.com/identity/branding-guidelines):
   fill #FFFFFF, 1px #747775 stroke, text #1F1F1F, the official 4-colour "G" on white
   (unmodified in size/colour — hence the inline SVG, not a Font Awesome glyph). */
.btn-provider {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;                      /* 10px between logo and label (per spec) */
    width: 201px;                   /* match Intuit's native button width so the pair is uniform */
    height: 48px;
    padding: 0 12px;                /* 12px before logo / after label (per spec) */
    border-radius: var(--radius-sm);
    /* Google specifies Google Sans Medium (not distributable); Roboto — Google's own
       open font (Apache 2.0), self-hosted below — is the standard stand-in. */
    font-family: "Roboto", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    cursor: pointer;
    transition: box-shadow .15s ease, background-color .15s ease;
}

/* Vendor buttons keep their own hover language — no lift/darken from the app buttons. */
.btn-provider:hover,
.btn-intuit:hover {
    transform: none;
}

.btn-google {
    background-color: #ffffff;
    color: #1f1f1f;
    border: 1px solid #747775;
}

.btn-google:hover {
    background-color: #ffffff;
    /* Restated, not redundant: the generic `button:hover` (0,1,1) outranks `.btn-google` (0,1,0)
       while hovered, and its --color-on-primary painted this label white on the white Google fill —
       the same label-vanishes trap that rule itself exists to fix for link-buttons. Any button that
       owns its colours must re-own them in its :hover (see button.secondary:hover). */
    color: #1f1f1f;
    box-shadow: 0 1px 2px rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15);
}

.btn-google .g-logo {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
}

/* Intuit — the OFFICIAL "Sign in with Intuit" button graphic
   (developer.intuit.com …/naming-and-logo-guidelines), used at its native size with the
   supplied base/hover artwork. Intuit forbids altering or resizing it, so this is an
   empty button showing the vendor SVG; the accessible name comes from aria-label. */
.btn-intuit {
    width: 201px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent url("/img/intuit/sign-in-with-intuit-blue.svg") center / 201px 48px no-repeat;
    cursor: pointer;
}

.btn-intuit:hover {
    background-color: transparent;
    background-image: url("/img/intuit/sign-in-with-intuit-blue-hover.svg");
    box-shadow: none;
}

.btn-provider:focus-visible,
.btn-intuit:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

/* Self-hosted Roboto Medium (Apache 2.0), latin subset — used by the Google button. */
@font-face {
    font-family: "Roboto";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("/lib/fonts/roboto-medium-latin.woff2") format("woff2");
}

/* ───────────────────────────────────────────────────────────── */
/*  STATUS / ERROR MESSAGES                                       */
/* ───────────────────────────────────────────────────────────── */
.error,
.validation-summary-errors {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    color: var(--color-danger);
    background-color: var(--color-danger-bg);
    border-radius: var(--radius-sm);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    font-size: var(--text-sm);
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: var(--space-4);
}

.status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-success);
    background-color: var(--color-success-bg);
    border-radius: var(--radius-sm);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    font-size: var(--text-sm);
}

.status .fas {
    color: var(--color-success-icon);
}

/* ───────────────────────────────────────────────────────────── */
/*  LISTS (client picker, linked-login list)                      */
/* ───────────────────────────────────────────────────────────── */
.client-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* A picker row is a <button> when choosing it POSTs (choose/act-as) and an <a> when it GETs the next
   step (the attach picker's candidates, links so they still work without JS). They must be visually
   identical, so the anchor also takes the base-button traits it does not inherit from `button`. */
.client-list button,
.client-list a {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    background-color: var(--color-surface);
    color: var(--color-ink);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    font-size: var(--text-sm);
    padding: var(--space-3) var(--space-4);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-base);
}

.client-list button:hover,
.client-list a:hover {
    background-color: var(--color-primary);
    color: var(--color-on-primary);
    border-color: var(--color-primary);
}

/* Act-as-a-client picker (board 440): the HelixStaff search + results list. */
.actas-lead {
    color: var(--color-ink-muted);
}

.actas-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3) var(--space-5);
    margin-bottom: var(--space-2);
}

.actas-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-ink-muted);
    white-space: nowrap;
}

.actas-hint {
    margin-top: 0;
    font-size: var(--text-sm);
    color: var(--color-ink-muted);
}

.actas-empty {
    color: var(--color-ink-muted);
    padding: var(--space-2) 0;
}

/* The attach picker's modal body is a lead paragraph + a search + a result list, NOT the usual stack of
   .field blocks — and `.modal-form-body` has no gap of its own (every other dialog gets its rhythm from
   `.modal-form .field { margin-bottom }`). So the picker has to declare that rhythm itself, or the three
   elements sit flush against each other. */
.attach-picker {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* Own margins would double up inside a gap-driven stack: .field-help assumes it sits tight under an
   input, and .actas-empty is a <p> carrying user-agent margins. */
.attach-picker > .field-help,
.attach-picker .actas-empty {
    margin: 0;
}

/* In a dialog the search spans the width, rather than the fixed 260px it takes in a grid toolbar. */
.attach-picker .grid-search-field {
    display: flex;
    width: 100%;
}

.actas-name {
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-2);
    min-width: 0;
}

/* Canonical client name shown after the friendly name — secondary weight so the friendly label leads. */
.actas-canonical {
    font-weight: 400;
    color: var(--color-ink-muted);
}

/* Keep the parenthesised name readable when the row flips to the primary colour on hover. */
.client-list button:hover .actas-canonical,
.client-list a:hover .actas-canonical {
    color: var(--color-on-primary);
}

.actas-inactive-badge {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.1em 0.5em;
    border-radius: var(--radius-pill);
    background: var(--color-surface-alt);
    color: var(--color-ink-muted);
    border: 1px solid var(--color-line);
}

/* On hover the button flips to the primary colour; keep the badge readable against it. */
.client-list button:hover .actas-inactive-badge,
.client-list a:hover .actas-inactive-badge {
    background: transparent;
    color: var(--color-on-primary);
    border-color: var(--color-on-primary);
}

/* Client user-management (board 440): invite heading, pending invitations, accept page. */
.page-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
}

/* The heading can carry more than one action (Attach + Invite on the Users page). */
.page-heading-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

/* Secondary variant on an <a class="button"> — button.secondary above is element-scoped, but the attach
   action opens a modal and so must be an anchor (data-modal), not a <button>. Mirrors button.secondary. */
a.button.secondary {
    background-color: var(--color-bg);
    color: var(--color-primary);
    border: 1px solid var(--color-line);
}

a.button.secondary:hover {
    background-color: var(--color-surface-alt);
    color: var(--color-primary-hover);
}

.pending-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.pending-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-line);
}

.pending-item:last-child {
    border-bottom: 0;
}

.pending-who {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.pending-meta {
    font-size: var(--text-sm);
    color: var(--color-ink-muted);
}

.pending-expired {
    color: var(--color-danger);
}

.pending-actions {
    display: inline-flex;
    gap: var(--space-4);
    flex-shrink: 0;
}

/* A new invitation link (HelixStaff's Copy link) takes a line of its own under its row. */
.pending-item > .pending-link {
    flex-basis: 100%;
    min-width: 0;   /* the one-line link scrolls inside the box (.token-secret code), not past the card */
    margin: 0;
}

.pending-link .token-secret code {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
}

.pending-link p {
    margin: 0;
}

.pending-empty {
    color: var(--color-ink-muted);
}

.accept-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

/* The name prompt's Not now is a <button>, since going on can sign the invitee in to their only client,
   dressed as the link it was. The class and element together outrank the global button:hover, which
   would otherwise paint it as a filled button mid-hover. */
.accept-actions button.link-button {
    padding: 0;
    background: none;
    font: inherit;
    color: var(--color-primary);
    text-decoration: underline;
    box-shadow: none;
    transform: none;
}

.accept-actions button.link-button:hover {
    color: var(--color-primary-hover);
}

.accept-failed {
    color: var(--color-danger);
}

/* Email and password on the profile: two facts of the same shape, so they sit as a tight pair rather
   than as two paragraphs with a full blank line between them (board 443). */
.identity-line {
    margin: 0 0 var(--space-2);
}

.identity-line + .identity-line {
    margin-top: calc(-1 * var(--space-1));
}

/* Dots, not a real password — nothing is ever rendered from the hash. Letter-spacing because a run of
   bullets at the body font is otherwise a smudge. */
.password-mask {
    letter-spacing: 0.15em;
}

/* Says the account has none, so it reads as a state rather than as a value. Muted rather than red:
   signing in only with Google is a legitimate way to hold an account, not an error. */
.password-unset {
    font-weight: 400;
    color: var(--color-ink-muted);
}

/* Sits above the provider buttons and tells them what they do here — see the note in the profile
   markup: the buttons' own labels belong to Google and Intuit. */
.link-provider-heading {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-ink);
    margin: var(--space-4) 0 var(--space-2);
}

.login-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.login-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-line);
}

.login-list li:last-child {
    border-bottom: 0;
}

.login-list .provider-name {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
}

.login-list button {
    background-color: var(--color-bg);
    color: var(--color-danger);
    border: 1px solid var(--color-line);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
}

.login-list button:hover {
    background-color: var(--color-danger-bg);
    border-color: var(--color-danger);
    box-shadow: none;
    transform: none;
}

/* ───────────────────────────────────────────────────────────── */
/*  TABLES (baseline for the M1 grid framework)                   */
/* ───────────────────────────────────────────────────────────── */
/* Foundation defaults only: the generic grid framework builds on these, it doesn't
   replace them. Light-teal header band + row hover wash mirror the Logi report look. */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

thead th {
    background-color: var(--color-surface-alt);
    color: var(--color-ink);
    font-weight: 600;
    text-align: left;
    padding: var(--space-2) var(--space-3);
    border-bottom: 2px solid var(--teal-300);
}

tbody td {
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--color-line);
}

tbody tr:hover {
    background-color: var(--color-surface);
}

/* ───────────────────────────────────────────────────────────── */
/*  MISC                                                          */
/* ───────────────────────────────────────────────────────────── */
hr {
    border: none;
    border-top: 1px solid var(--color-line);
    margin: var(--space-5) 0;
}

/* Reduced motion — quiet all transitions/animations (home.css convention). */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

    button:hover,
    .button:hover {
        transform: none;
    }
}

/* ============================================================================
   Generic data grid (plan §5) — the single _Grid.cshtml partial's styling.
   Consumes the semantic design tokens above so every grid matches the system.
   ============================================================================ */
.grid {
    display: block;
    margin: var(--space-5) 0;
}

/* Header: the entity title pinned left; search, Apply (only while a disclosure panel is open) and the
   actions menu pinned right — the title's auto right-margin is what splits the row. */
.grid-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

/* What the rows ARE ("Normalized Name Mapping"), from GridDefinition.EntityName. An <h2> for the
   document outline, but sized as a row title rather than a page heading. */
.grid-title {
    margin: 0 auto 0 0;
    font-size: var(--text-lg);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* On a phone the row cannot hold a title AND a search box AND three 40px buttons, and the ellipsis
   above meant the title was what paid: measured at 375px, "Normalized Name Mapping" wanted 223px,
   got 81, and read "Normalized…" — on Rename Names, whose entity name is the single word "Name", it
   was down to "N…". A heading eroded to one letter names nothing. The search box was no better off
   at 94px. So below the breakpoint the row becomes two: the title takes the first, and the controls
   share the second.

   flex-basis, not "let it wrap naturally". Wrapping breaks lines by BASE size, and the search field's
   base is a definite 260px, so the natural break puts the title and search on lines of their own and
   pushes two of the three buttons onto a third — a taller, more scattered header than the one it
   replaced. Pinning the title to a full line and dropping search's base to 0 makes the split exact:
   the buttons cannot help but fit beside it, and the box then grows into what is left (183px at
   375px) instead of dictating the break. */
@media (max-width: 700px) {
    .grid-header {
        flex-wrap: wrap;
    }

    .grid-title {
        flex-basis: 100%;
        /* It owns the line now, so a long name is better read on two lines than cut on one. The
           ellipsis rule above stays for the wide layout, where the title still shares its row. */
        white-space: normal;
    }

    .grid-search {
        flex: 1 1 0;
    }
}

/* The apply checkmark (board 434) — icon-only, always visible, and deliberately the PRIMARY-coloured
   control in the row: it is the action, everything beside it is posture. Sized square to sit flush
   with the filter toggle and the gear. */
.grid-apply {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    flex-shrink: 0;
}

/* A SLOW GRID WAITS FOR ENTER (grid.js): what is typed into its search and its filters is held until Enter, the Apply
   check, or the filter panel closing. Until then the check is ringed in the accent, and the search box says "Press Enter"
   while it holds text the rows were not searched for. */
.grid.grid-waiting .grid-apply {
    box-shadow: 0 0 0 3px var(--color-accent);
}

.grid-search-enter {
    display: none;
    flex-shrink: 0;
    padding: 0 var(--space-2);
    border-radius: var(--radius-pill);
    background: var(--color-surface-alt);
    color: var(--color-ink-muted);
    font-size: var(--text-xs);
    white-space: nowrap;
}

.grid-search-field.is-waiting .grid-search-enter {
    display: inline-block;
}

/* An input's automatic minimum is its own default width, which left no room for the tag: it ran 34px out of the pill. */
.grid-search-field.is-waiting input {
    min-width: 0;
}

/* Neutral square icon buttons (filter toggle; shaped like the gear summary). This is a <button>, so
   the colours AND their :hover must be self-owned — the generic button:hover (0,1,1) otherwise paints
   the icon white on a primary background (the .btn-google lesson, documented at button:hover). */
.grid-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    flex-shrink: 0;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-ink-muted);
    transition: var(--transition-fast);
}

.grid-icon-button:hover {
    background: var(--color-surface-alt);
    border-color: var(--color-primary-soft);
    color: var(--color-primary);
    box-shadow: none;
    transform: none;
}

/* Actions menu — a <details> disclosure (works with JS off), same shape as the header user menu but
   on a light surface. Holds Search / Filters / Export / Add. */
.grid-menu {
    position: relative;
}

.grid-menu > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-ink-muted);
    cursor: pointer;
    list-style: none;   /* hide the default disclosure triangle */
    transition: var(--transition-fast);
}

.grid-menu > summary::-webkit-details-marker {
    display: none;
}

.grid-menu > summary:hover,
.grid-menu[open] > summary {
    background: var(--color-surface-alt);
    border-color: var(--color-primary-soft);
    color: var(--color-primary);
}

.grid-menu-content {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    min-width: 230px;
    padding: var(--option-pad);
    background: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* The words start where they did before the list was padded (--option-pad): 16px from the menu's edge. */
.grid-menu-content a,
.grid-menu-content button,
.grid-menu-content label.grid-import {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-3) calc(var(--space-4) - var(--option-pad));
    background: none;
    border: 0;
    border-radius: var(--option-radius);
    color: var(--color-ink);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 400;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.grid-menu-content a:hover,
.grid-menu-content button:hover,
.grid-menu-content label.grid-import:hover,
.grid-menu-content a:focus-visible,
.grid-menu-content button:focus-visible,
.grid-menu-content label.grid-import:focus-within {
    background: var(--color-option-hover);
    color: var(--color-ink);
    box-shadow: none;
    transform: none;
}

.grid-menu-content a:focus-visible,
.grid-menu-content button:focus-visible,
.grid-menu-content label.grid-import:has(:focus-visible) {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

.grid-menu-content .fa-fw {
    color: var(--color-brand);
}

.grid-menu-content .fa-file-excel {
    color: var(--color-success-icon);
}

/* Column chooser (board 434) — the section under the actions, split off by the divider. Checkbox rows
   are shaped like menu items but they are a place you stay (grid.js keeps the menu open for them). */
.grid-menu-columns {
    margin: 0 calc(-1 * var(--option-pad));
    padding: var(--space-1) var(--option-pad) 0;
    border-top: 1px solid var(--color-line);
}

.grid-menu-heading {
    display: block;
    padding: var(--space-2) calc(var(--space-4) - var(--option-pad)) var(--space-1);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-ink-muted);
}

.grid-col-option {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) calc(var(--space-4) - var(--option-pad));
    border-radius: var(--option-radius);
    font-size: var(--text-sm);
    color: var(--color-ink);
    white-space: nowrap;
    cursor: pointer;
}

.grid-col-option:hover,
.grid-col-option:has(input:focus-visible) {
    background: var(--color-option-hover);
}

.grid-col-option:has(input:focus-visible) {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

.grid-col-option input {
    accent-color: var(--color-primary);
}

/* The row's ring stands for the box's own. */
.grid-col-option input:focus-visible {
    outline: 0;
}

/* Search disclosure panel — inline in the header, beside the menu (collapsed until chosen from it). */
.grid-search {
    display: flex;
    min-width: 0;
}

.grid-search-field {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    width: 260px;
    max-width: 100%;
    padding: 0 var(--space-3);
    background: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-pill);
    color: var(--color-ink-muted);
}

.grid-search-field:focus-within {
    border-color: var(--color-focus);
    box-shadow: 0 0 0 3px var(--color-surface-alt);
}

.grid-search-field input {
    flex: 1;
    border: 0;
    outline: 0;
    padding: var(--space-2) 0;
    background: transparent;
    font-size: var(--text-sm);
    color: var(--color-ink);
}

/* Scope toggles (board 424) — binary filters sitting above the table.

   NOT to be confused with .grid-filter-menu, despite the adjacent name: that one lists the per-column
   filters and changes only what is on screen until one is set, while these change which rows the
   query returns. (Board 434's .grid-filter-toggle, the old row disclosure this note used to warn
   about, retired with the row itself on board 455.) */
.grid-toggles {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
}

.grid-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    /* The 24px floor is on the LABEL, not the 16px box: the text is part of the tap target, so the
       whole control clears the minimum rather than just the square a finger is least likely to hit. */
    min-height: 24px;
    font-size: var(--text-sm);
    color: var(--color-ink-muted);
    cursor: pointer;
}

.grid-toggle:hover {
    color: var(--color-ink);
}

.grid-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--color-focus);
    cursor: pointer;
}

.grid-scroll {
    overflow-x: auto;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    background: var(--color-bg);
}

/* On desktop the grid does NOT get its own scrollbar — the content column scrolls the whole table
   and the header sticks as it goes (board 443, revised after QA).
 *
 * An earlier pass bounded this box so it scrolled its own rows. That did make the sticky header
 * work, but it defeated the pager: an inner scroller shows one viewport of table however many rows
 * you ask for, so picking 100 bought nothing and the row count stopped meaning anything.
 *
 * Getting the OUTER scrollbar and a sticky header together comes down to one rule: `position:
 * sticky` resolves against the nearest SCROLLPORT ancestor. This box is one, because `overflow-x:
 * auto` coerces `overflow-y` from `visible` to `auto` — CSS has no "scroll one axis only". While it
 * stays a scrollport the header can only stick INSIDE it, and bounding its height is the only way
 * to make that visible at all. `overflow: visible` removes the scrollport, so the header sticks
 * against .app-main instead: the content column, which is the scrollbar we want.
 *
 * MUST sit after the rule above, not in the shell block with the rest of board 443 — same
 * specificity, so the later declaration wins. Placed earlier it was silently overridden, which
 * measured as "overflow-y: auto" and a header that scrolled away.
 *
 * The horizontal safety net survives where it is needed: below 901px the base rule still applies, so
 * a narrow screen scrolls the table sideways rather than the page. Above it, a table wider than the
 * column — only reachable by drag-resizing columns past it, where grid.js switches to absolute
 * widths — overflows into .app-main, which is already a scroll container on both axes by the same
 * coercion. That case gets a horizontal scrollbar on the column, not on the page, and the rail
 * still holds still. */
@media (min-width: 901px) {
    .grid-scroll {
        overflow: visible;
    }

    /* The white card tracks the TABLE's width once columns have been drag-resized (board 446).
       Without it the box stays at the content column's width while the widened table overflows past
       it, so the extra columns sit on the grey page background with the card's border cutting
       through them — and it shrinks back as columns are narrowed again.
       .is-sized is set by grid.js and ONLY in the dragged state, which is load-bearing rather than
       tidiness: dragged widths are absolute pixels, and the table carries an explicit px width to
       match. In the default state the <col> widths are PERCENTAGES, and a percentage inside a
       shrink-to-fit parent has nothing to resolve against — the cycle degenerates, and the browser
       resolves it at 1,000,000px. (Measured, not theorised: that is exactly what an unconditional
       `width: max-content` here produced.) */
    .grid-scroll.is-sized {
        width: max-content;
    }
}

.grid-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

/* Constrained columns (weights or a drag-resize — board 434): fixed layout honours the <colgroup>
   widths, and the nowrap cells ellipsize instead of forcing the column wide. Auto layout (no weights,
   no drag) keeps the browser's content-driven sizing. */
.grid-table.is-fixed {
    table-layout: fixed;
}

/* Cells only. The header's ellipsis moved onto .grid-th-label when the funnel joined the cell (board
   455) — clipping the cell itself would now cut the funnel's focus ring, and the label truncates the
   column NAME rather than letting a narrow column lose its filter affordance. */
.grid-table.is-fixed td {
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-table th,
.grid-table td {
    padding: var(--space-2) var(--space-3);
    text-align: left;
    border-bottom: 1px solid var(--color-line);
    white-space: nowrap;
}

/* A column that opted out of the single-line default (GridColumnBuilder.Wrap(), board 448). Two rules,
   because the value and the container want different things: the CELL must simply be allowed to grow,
   and the TEXT inside it must keep the line breaks it already carries.

   pre-line rather than normal, because the breaks are in the data — error check 5's account-types
   column arrives from SQL already joined with CHAR(13)+CHAR(10) — and `normal` would collapse them to
   spaces, wrapping the entries but never where they were meant to break. pre-line rather than pre-wrap,
   because it also collapses the indentation of the surrounding markup, which pre-wrap would render.

   vertical-align keeps a tall cell's first line level with its single-line neighbours; the default
   middle alignment makes the whole row read as misaligned against a three-line cell. */
.grid-table td.is-wrap {
    white-space: normal;
    vertical-align: top;
}

.grid-table td.is-wrap .grid-cell-lines,
.grid-table td.is-wrap a {
    white-space: pre-line;
}

/* Len beside a name in an editor (board 481): the name's length, quiet until it is over QuickBooks Desktop's
   31-character limit, then flagged in the grid cell's amber with the warning beside it. form.js keeps it up to
   date as the user types. */
.name-length {
    margin: var(--space-1) 0 0;
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
}

.name-length.is-flagged {
    display: inline-block;
    padding: 2px var(--space-2);
    border-radius: var(--radius-sm);
    color: var(--color-warning);
    background-color: var(--color-warning-bg);
    font-weight: 600;
}

/* The owners' total on a company's Ownership view (board 482): quiet at 100%, and in the flagged amber, with the
   reason beside it, when it is anything else. The same amber as Len and a flagged grid cell. */
.ownership-total {
    margin: var(--space-3) 0 0;
    color: var(--color-ink-muted);
}

.ownership-total.is-flagged {
    display: inline-block;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    color: var(--color-warning);
    background-color: var(--color-warning-bg);
    font-weight: 600;
}

/* A region of an editor the server draws again, whole (the investment's identity, board 483). It is one item of its
   section, so the row rhythm a lone field gets from its own margin is its to carry: the last field inside it has none
   (.field-group .field:last-of-type), and the region is not a .field. */
.modal-form .field-region {
    margin-bottom: var(--space-4);
}

/* A cell carrying a note (GridColumnBuilder.EmphasizeWhen, board 493): bold, its title saying why — the Used in
   list's Helix Date where a GL header substitution moved it. Nothing is wrong with it, so no warning colour. */
.grid-table td.is-emphasized {
    font-weight: 600;
}

/* A cell carrying a warning (GridColumnBuilder.FlagWhen, board 481): legacy's yellow Len, in the app's amber.
   The cell's title says why, and the Excel export writes the plain value. On the cell rather than the row, so
   a hovered row's tint does not hide it: a td background paints over the tr's. */
.grid-table td.is-flagged {
    color: var(--color-warning);
    background-color: var(--color-warning-bg);
    font-weight: 600;
}

/* A flag for something wrong (GridCellFlagTone.Danger): the home card's data integrity red, as the client monitor's Err colours a
   client's data integrity findings (the owner, 2026-11-26). */
.grid-table td.is-flagged.is-danger {
    color: var(--color-danger);
    background-color: var(--color-danger-bg);
}

/* The header stays put while the rows scroll under it. `position: sticky` was already here and was
   INERT until board 443: sticky resolves against the nearest scrollport, which is .grid-scroll, and
   that box had no bounded height — so there was never anything to stick against and the header
   simply scrolled away with the page. The rule that bounds it is in the shell block above.
 *
 * z-index because the cells below would otherwise paint over the header as they pass under it —
 * they come later in document order, and sticky only lifts the header out of flow, not above it.
 *
 * box-shadow, not border-bottom, for the separator: the table is `border-collapse: collapse`, and a
 * collapsed border belongs to the TABLE rather than the cell, so it stays behind with the rows and
 * the header's bottom edge vanishes the moment you scroll. An inset shadow is painted by the cell
 * itself and travels with it. */
.grid-table thead th {
    background: var(--color-table-header);
    color: var(--color-ink);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
    box-shadow: inset 0 -1px 0 var(--color-line);
}

/* The drag-to-resize handle grid.js injects into each header (board 434): a real <button> so it takes
   keyboard focus (arrows nudge the width), sitting as a hit-strip on the column's right edge. The
   affordance is DRAWN — the ::before grip bar is always visible, because an invisible strip that only
   tints on hover read as nothing at all (board-434 review feedback). Black alphas, not theme inks: the
   teal header band is a fixed color, and 50% black measures ~3.3:1 against it (the WCAG 3:1 line for
   UI affordances) where the old hover tint managed under 2:1. Every generic button property is
   re-owned here — background, padding, and ESPECIALLY :hover, which would otherwise repaint it as a
   primary pill (the rule documented at button:hover). The sticky th is the positioning context. */
/* Keep the label out from under the grip (board 446). The handle is absolutely positioned over the
   cell's right edge, so without this the header text runs beneath it and the grip is painted straight
   through a letter ("Renamed T|o").
   Scoped with :has() so only resizable headers pay the padding; grid.js adds the handle at runtime,
   so a non-resizable column keeps its normal spacing. */
.grid-table thead th:has(.grid-resize) {
    padding-right: 20px;
}

.grid-resize {
    position: absolute;
    top: 0;
    /* Inset on both edges the header has a RULE on, because the strip is opaque and — as a positioned
       descendant — paints over the cell's own background decoration. Flush against them it covered the
       header's bottom line and hung ~2px into the first row as a teal tab, and on the last column it
       covered the card's right border. Both read as the grip overhanging the header; the filtered
       header made it obvious, since its tab is teal-600 against a white row rather than teal-300.
       bottom: 2px clears the two stacked 1px lines (the collapsed border-bottom plus the sticky
       header's inset box-shadow); right: 0 keeps the strip inside its own cell. The 11px hit target
       loses 2px of height, which no pointer notices. */
    right: 0;
    bottom: 2px;
    width: 11px;
    padding: 0;
    border: 0;
    border-radius: 0;
    /* OPAQUE in the header's own colour, not transparent (board 446). The padding above buys room in
       the ordinary case, but it cannot be relied on: `overflow: hidden` clips at the PADDING box, so a
       squeezed column's label renders into that padding and back under the grip. Painting the handle
       in the band colour means the label is occluded around the grip rather than having the grip drawn
       on top of it — the text is cut off cleanly and the grip stays readable.
       Invisible against the header, so this changes nothing about how the control looks. */
    background: var(--color-table-header);
    cursor: col-resize;
    touch-action: none;   /* pointer events drive the drag; don't fight the pan gesture */
}

.grid-resize::before {
    content: "";
    position: absolute;
    top: 22%;
    bottom: 22%;
    left: 50%;
    width: 3px;
    margin-left: -2px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.5);
}

.grid-resize:hover,
.grid-resize:focus-visible {
    /* The grip is the highlight, not the strip — but the strip stays OPAQUE so it keeps masking the
       label underneath (see the base rule); transparent here would let the text reappear on hover. */
    background: var(--color-table-header);
    box-shadow: none;
    transform: none;
}

/* Two-stage prominence: anywhere in the header cell brightens the grip a step; on the handle itself
   (or keyboard focus) it darkens further and grows to near full height — "grab me, I stretch". Both
   handle-hover selectors are prefixed through `.grid-table thead th` on purpose: the mouse-hover
   variant otherwise reads (0,2,1), which the (0,3,3) th:hover rule below outranks even though the
   handle is what the cursor is really on. Matching specificity (0,3,3) then lets source order — this
   rule last — decide the collision, so hovering the handle really does darken to 0.8. */
.grid-table thead th:hover .grid-resize::before {
    background: rgba(0, 0, 0, 0.65);
}

.grid-table thead th .grid-resize:hover::before,
.grid-table thead th .grid-resize:focus-visible::before {
    top: 8%;
    bottom: 8%;
    background: rgba(0, 0, 0, 0.8);
}

.grid-resize:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

/* The sort link is the name and its arrow in a row, and in a column too narrow for both the NAME gives way: it
   truncates with an ellipsis, and the arrow keeps its space (board 488, owner's review). max-width keeps the link
   inside its caption box, whose overflow clips; without it the link was wider than the box in any column narrower than
   its name, and the box clipped the arrow along with the name's last letters. The 8px between them is a flex item of
   its own (::after), not a `gap`, because a gap cannot shrink: a name squeezed to nothing would still hold 8px of dead
   space. It has a width of its own, which is what lets the link's natural width count it, and shrinks first, so a name
   that misses by a few pixels keeps every letter and loses only the space before the arrow. */
.grid-sort {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.grid-sort > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-sort::after {
    content: "";
    order: 1;
    width: var(--space-2);
    flex: 0 1000000 auto;
    min-width: 0;
}

.grid-sort > i {
    order: 2;
    flex: none;
}

/* Underline rather than recolour: --color-primary read well on the old near-white header, but against
   the teal band it lands ~3:1 — hover would make the label HARDER to read than its ink resting state.
   An underline keeps the ink contrast and signals the affordance without relying on colour alone. */
.grid-sort:hover {
    text-decoration: underline;
}

/* The idle (unsorted) sort chevron is muted until the column is the active sort. */
/* Numeric columns (money, percent) — right-aligned so decimal points stack down the column. Applies to
   the header and the cells, never to a filter input. Tabular figures keep the digits in step. */
.grid-table th.is-numeric,
.grid-table td.is-numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* The sort header is a flex row; pull its content to the right edge for numeric columns. */
.grid-table th.is-numeric .grid-sort {
    justify-content: flex-end;
}

.grid-sort-idle {
    opacity: 0.35;
}

/* ---- filter editors (board 455) -------------------------------------------------------------
   The reserved filter row is gone. Each filterable column gets a funnel in its header opening a
   [popover] editor from the bay below the table, and the active filters are stated as chips above it.
   The filter INPUT styling below is shared by every editor, which is why it kept its class name. */

/* The header cell's content is now a row — caption, then the funnel — so the two can sit together
   without the funnel landing on top of the label or under the resize grip. */
.grid-th {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    min-width: 0;
}

/* The caption owns the ellipsis, so a narrow column truncates its NAME rather than losing its funnel.
   It is also the th's accessible name (aria-labelledby) and the source of the resize handle's label, and its title
   carries the full name for a heading cut short.

   It is the one item of the row that gives way (a shrink factor that dwarfs the funnel's: flex-shrink divides the
   shortfall in proportion to factor times size, so the funnel yields only when the caption has nothing left to give),
   and it stops at the width of a sort arrow, which is inside it (.grid-sort; 0.75em is the arrow's glyph). A column too
   narrow for the arrow, the funnel and the grip's padding shows the name as an ellipsis, or not at all. */
.grid-th-label {
    min-width: 0;
    flex: 1 10000 auto;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-th-label:has(> .grid-sort) {
    min-width: 0.75em;
}

/* Numeric headers pull right (matching their cells), and the funnel follows its caption at the right edge, as it does
   on a text header. */
.grid-table th.is-numeric .grid-th {
    justify-content: flex-end;
}

/* The caption does not grow, so it and its funnel stay together at the right edge instead of the caption taking the free
   space and leaving the funnel at the far end of the cell. */
.grid-table th.is-numeric .grid-th-label {
    flex: 0 10000 auto;
}

/* Quiet until wanted — but never invisible: on touch there is no hover to reveal it, so the resting
   state has to be legible on its own. 0.55 on the teal band clears the 3:1 UI line the resize grip was
   re-contrasted for on board 434. */
.grid-col-filter {
    /* 20px, and down to 16px only when the caption has already given all it can: in the narrowest columns the
       funnel would otherwise sit under the resize grip. */
    flex: 0 1 auto;
    min-width: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-ink);
    opacity: 0.55;
    font-size: var(--text-xs);
    transition: var(--transition-fast);
}

.grid-table th:hover .grid-col-filter,
.grid-col-filter:focus-visible {
    opacity: 1;
    background: rgba(255, 255, 255, 0.55);
}

/* A filtered column says so on the server, so it reads as filtered on a deep link with no script.
   Never the ONLY signal — a tint cannot be seen on a hidden or scrolled-away column, which is what
   the chip strip is for.

   The foreground is restated with the background, and the tint is --teal-600 rather than --teal-500,
   because a tint alone fails contrast: the inherited --color-ink measures 3.02:1 on --teal-500 where
   the header runs at 14px/600 and therefore needs 4.5:1 (WCAG 1.4.3 — not "large text", which starts
   at 18.66px bold). White on --teal-500 is only 4.43:1, so recolouring the text without darkening the
   band does not fix it either; white on --teal-600 measures 5.48:1. The sort link inherits this,
   which is the point — it is the same text. */
.grid-table th.is-filtered {
    background: var(--teal-600);
    color: var(--color-on-primary);
}

.grid-table th.is-filtered .grid-col-filter {
    opacity: 1;
    color: var(--color-on-primary);
}

/* The funnel's hover wash is a white veil, which is invisible under a white icon on the darker band. */
.grid-table th.is-filtered:hover .grid-col-filter,
.grid-table th.is-filtered .grid-col-filter:focus-visible {
    background: rgba(0, 0, 0, 0.22);
}

/* The resize grip paints itself in the header colour to occlude clipped labels; on a filtered header
   that constant is the WRONG colour and leaves a pale stripe down the cell's right edge. */
.grid-table th.is-filtered .grid-resize {
    background: var(--teal-600);
}

/* The panel bay itself is a layout no-op: the panels inside it are in the top layer when open, and
   display:none when closed. It exists so they have a home outside the table. */
.grid-filter-bay {
    display: contents;
}

.grid-col-pop {
    width: min(260px, calc(100vw - 16px));
    padding: var(--space-3);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    box-shadow: var(--shadow-lg);
    /* The header cell sets nowrap and the panel would inherit it through the popover's normal
       inheritance chain, driving every label and hint onto one very wide line. */
    white-space: normal;
    overflow: visible;
}

.grid-col-pop:focus-visible,
.grid-col-pop:focus {
    outline: 0;
}

.grid-col-pop-head {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-ink-muted);
}

.grid-col-pop-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

/* Clear leads with a link's affordance rather than a button's: it is a real href to the grid minus
   this filter, and it behaves like one with or without script. */
.grid-col-pop-clear {
    font-size: var(--text-xs);
    color: var(--color-primary);
    text-decoration: underline;
}

.grid-col-pop-done {
    margin-left: auto;
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-ink);
    font-size: var(--text-xs);
}

.grid-col-pop-done:hover {
    background: var(--color-surface-alt);
    border-color: var(--color-primary-soft);
    color: var(--color-primary);
    box-shadow: none;
    transform: none;
}

/* ---- a filter panel's sort lines and value checklist (board 500) ---------------------------------
   Excel's filter menu, its first two lines and its list of values. A panel with a checklist is wider:
   a holding company's name wants room a date range does not. */
.grid-col-pop.has-values {
    width: min(300px, calc(100vw - 16px));
}

/* Rows over a rule across the panel, as Excel's menu lines are, so they read as actions and not as fields; each row a menu's
   (--option-pad), its words where the panel's are. */
.grid-col-pop-sorts {
    display: flex;
    flex-direction: column;
    margin: 0 calc(-1 * var(--space-3)) var(--space-2);
    padding: 0 var(--option-pad) var(--space-1);
    border-bottom: 1px solid var(--color-line);
}

.grid-col-pop-sort {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) calc(var(--space-3) - var(--option-pad));
    border-radius: var(--option-radius);
    font-size: var(--text-sm);
    color: var(--color-ink);
    text-decoration: none;
}

.grid-col-pop-sort:hover,
.grid-col-pop-sort:focus-visible {
    background: var(--color-option-hover);
    color: var(--color-ink);
}

.grid-col-pop-sort:focus-visible {
    outline-offset: -2px;
}

/* The order in force, marked as the header's arrow marks it. */
.grid-col-pop-sort.is-active {
    font-weight: 600;
}

.grid-col-pop-sort-mark {
    margin-left: auto;
    color: var(--color-primary);
}

/* Only blanks (the owner, 2026-11-20): a line of its own under the editor, in the panel's words' size, as a checklist's box is. */
.grid-col-pop-blanks {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    color: var(--color-ink);
    cursor: pointer;
}

.grid-col-pop-blanks input {
    flex: 0 0 auto;
    margin: 0;
}

/* A fixed height from the first frame, before the values arrive: grid.js places the panel once, when it opens, from its
   measured height, so a list that grew afterwards would push the panel's foot off a laptop screen. */
.grid-values {
    height: 14rem;
    margin-top: var(--space-2);
    padding: var(--option-pad);
    overflow-y: auto;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
}

/* The list's labels carry no class of their own: the list is every value the client has, so a box is kept to its name
   (_GridValues). */
.grid-values-list > label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: 1px calc(var(--space-2) - var(--option-pad));
    border-radius: var(--option-radius);
    font-size: var(--text-xs);
    color: var(--color-ink);
    cursor: pointer;
}

.grid-values-list > label:hover,
.grid-values-list > label:has(input:focus-visible) {
    background: var(--color-option-hover);
}

.grid-values-list > label:has(input:focus-visible) {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

.grid-values-list > label input:focus-visible {
    outline: 0;
}

.grid-values-list > label input {
    flex: 0 0 auto;
    margin: 2px 0 0;
}

/* A long name wraps rather than being cut, so it is read whole without a tooltip. */
.grid-values-list > label span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.grid-values-note {
    display: block;
    margin: 0;
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
}

/* The status line says nothing most of the time (_GridValues): it is a live region, so it stays in the page, empty. */
.grid-values-note:empty {
    display: none;
}

/* "Loading values…", alone in the list's box until the values come, shows only once they have kept the user waiting, after
   the half second the progress bar waits too: a list that answers quickly appears in the box with nothing before it, where
   the line flashed for an instant (the owner, 2026-11-19). */
.grid-values > .grid-values-note:only-child {
    animation: grid-values-wait 0.2s linear 0.5s both;
}

@keyframes grid-values-wait {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* The paired From/To controls grid.js builds over a range column's canonical low..high input. */
.grid-range {
    display: flex;
    gap: var(--space-2);
}

.grid-range-part {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
}

.grid-range-part input {
    width: 100%;
    min-width: 0;
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    color: var(--color-ink);
    background: var(--color-bg);
}

.grid-range-part input:focus {
    outline: 0;
    border-color: var(--color-focus);
    box-shadow: 0 0 0 2px var(--color-surface-alt);
}

/* The canonical syntax input, once the typed pair has taken over from it. Hidden rather than removed:
   it is still the one named control, and hx-preserve still needs the node. */
.grid-filter.is-enhanced {
    display: none;
}

.grid-filter {
    width: 100%;
    min-width: 8ch;
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    color: var(--color-ink);
    background: var(--color-bg);
}

.grid-filter:focus {
    outline: 0;
    border-color: var(--color-focus);
    box-shadow: 0 0 0 2px var(--color-surface-alt);
}

/* ---- the filters menu (header) ---------------------------------------------------------------
   Sits where board 434's latching filter-row toggle was, reusing .grid-menu's disclosure entirely;
   only the count badge and the entry rows are its own. */
.grid-filter-menu > summary {
    position: relative;
}

.grid-filter-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.grid-filter-pick {
    display: flex;
    width: 100%;
    align-items: baseline;
    gap: var(--space-2);
    padding: var(--space-2) calc(var(--space-4) - var(--option-pad));
    border: 0;
    border-radius: var(--option-radius);
    background: transparent;
    color: var(--color-ink);
    font-size: var(--text-sm);
    text-align: left;
}

.grid-filter-pick:hover {
    background: var(--color-option-hover);
    color: var(--color-ink);
    box-shadow: none;
    transform: none;
}

.grid-filter-pick.is-active {
    font-weight: 600;
}

.grid-filter-pick-name {
    flex: 0 0 auto;
}

/* The current value, trailing its column name — so the menu doubles as the aggregate list of what is
   filtered, including columns hidden by the chooser or scrolled out of view. */
.grid-filter-pick-value {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
    font-size: var(--text-xs);
    font-weight: 400;
    color: var(--color-ink-muted);
}

.grid-filter-clear {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--color-line);
    font-size: var(--text-sm);
    color: var(--color-ink);
}

.grid-filter-clear:hover {
    background: var(--color-surface-alt);
    color: var(--teal-700);
}

/* ---- the chip strip --------------------------------------------------------------------------
   Exists only while something narrows the grid, on the title line between the title and the search box (the owner,
   2026-11-20): it takes the line's free space, so the search box stays where it was and filtering adds no line. */
.grid-chips {
    display: flex;
    flex: 1 1 0;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    margin-left: var(--space-2);
}

/* One line, once grid.js has laid it out: the chips that do not fit are in the ⋮ panel, so none wraps or shrinks. Without
   script they wrap, as above. */
.grid-chips.is-one-line {
    flex-wrap: nowrap;
}

.grid-chips.is-one-line > * {
    flex: none;
}

/* The ⋮ at the line's end, a chip's size, as a report's breadcrumbs' is. The global button rule would dress it as the primary
   action, so it takes all of that back. */
.grid-chips button.grid-chips-more-button {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border: 1px solid var(--color-primary-soft);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-ink);
    font-size: var(--text-xs);
    font-weight: 700;
    line-height: inherit;
    box-shadow: none;
    transform: none;
}

.grid-chips button.grid-chips-more-button:hover {
    background: var(--color-surface-alt);
    color: var(--color-ink);
    box-shadow: none;
    transform: none;
}

/* The ⋮ panel: the chips past the line's end, one to a line, under its button (grid.js places it). */
.grid-chips-panel {
    inset: auto;
    margin: 0;
    max-width: min(28rem, calc(100vw - 16px));
    max-height: min(24rem, calc(100vh - 16px));
    overflow-y: auto;
    padding: var(--space-2);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    background-color: var(--color-bg);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
}

.grid-chips-panel:popover-open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
}

/* On a phone the title has the header's first line to itself (above), and the strip the next, over the search box. */
@media (max-width: 700px) {
    .grid-chips {
        flex-basis: 100%;
        margin-left: 0;
    }
}

.grid-chip {
    display: inline-flex;
    align-items: stretch;
    max-width: 100%;
    border: 1px solid var(--color-primary-soft);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    overflow: hidden;
}

.grid-chip-body {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
    padding: 3px var(--space-1) 3px var(--space-3);
    border: 0;
    background: transparent;
    color: var(--color-ink);
    font-size: var(--text-xs);
    text-align: left;
}

button.grid-chip-body:hover {
    background: var(--color-surface-alt);
    color: var(--color-ink);
    box-shadow: none;
    transform: none;
}

.grid-chip-label {
    flex: 0 0 auto;
    color: var(--color-ink-muted);
}

/* A pasted 60-character value must not turn one chip into a paragraph; the full text stays reachable
   through the control's aria-label and title. */
.grid-chip-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 22ch;
    font-weight: 600;
}

.grid-chip-remove {
    display: inline-flex;
    align-items: center;
    padding: 0 var(--space-2);
    color: var(--color-ink-muted);
    font-size: var(--text-xs);
}

.grid-chip-remove:hover {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.grid-chips-clear {
    font-size: var(--text-xs);
    color: var(--color-primary);
    text-decoration: underline;
}

/* Engines without the Popover API get the panels inline, in the bay under the table: a labelled
   column-by-column filter band, which is functionally the row this replaced. */
@supports not selector(:popover-open) {
    .grid-filter-bay {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-3);
        margin-top: var(--space-3);
    }

    .grid-col-pop {
        display: block;
        position: static;
        /* The UA gives [popover] `margin: auto`, which under static positioning CENTRES each panel in
           the bay instead of letting them pack — measured as a single centred column rather than a
           wrapping band. Laid out, not merely un-hidden. */
        margin: 0;
        inset: auto;
        width: 220px;
        box-shadow: none;
        background: var(--color-surface);
    }

    .grid-col-pop-done {
        display: none;
    }
}

.grid-table tbody tr:hover {
    background: var(--color-surface-alt);
}

/* A row that can be edited is clickable anywhere (grid.js forwards the click), so the ROW carries the
   affordance — the hover wash above plus this pointer. :has() scopes it to rows that actually have an
   edit target, so a read-only grid still reads as read-only. data-row-link is the same target when the
   editor is a page rather than the modal (ADR-011; COA Categories), and data-modal-stack when the row's
   first verb opens a layer over the modal the grid sits in (board 477, Completing M3 gaps) — a row
   ACTION's, not a cell's layer link (board 493), which grid.js does not follow on a row click. */
.grid-table tbody tr:has(a[data-modal], a[data-row-link], a.grid-row-action[data-modal-stack]) {
    cursor: pointer;
}

/* The same for a row whose layer action sits in its row-action menu (RowActionMenu): grid.js follows it on a row click
   as it follows the inline one. A rule of its own so the one above keeps the text GridRowLinkTests pins. */
.grid-table tbody tr:has(a.grid-row-menu-item[data-modal-stack]) {
    cursor: pointer;
}

.grid-table td a {
    color: var(--color-primary);
}

/* The edit link is deliberately NOT dressed as a link: it exists so the row's action has a real,
   focusable, no-JS control behind it — a <tr> can be none of those — but the user is meant to click the
   row, not hunt for a coloured word in one column. It must stay visible to KEYBOARD users though, which
   is what the focus ring below is for: it is now the only thing that reveals the control. */
.grid-table td a[data-modal],
.grid-table td a[data-row-link] {
    color: inherit;
    text-decoration: none;
}

.grid-table td a[data-modal]:focus-visible,
.grid-table td a[data-row-link]:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.grid-empty td {
    padding: var(--space-6);
    text-align: center;
    color: var(--color-ink-muted);
    white-space: normal;
}

/* ── The totals row (GridColumnNumberExtensions.Total()) ──────────────────────────
   A <tfoot> under the rows: the sum of each totalled column over the whole filtered set.
   Set off from the rows by a rule above it and the header's own band, so it reads as
   the table's summary rather than one more line of data, and bold, as a statement's
   totals are.

   NOT clipped. The fixed table ellipsizes its cells (.grid-table.is-fixed td), and a
   total cut to "1,234,5…" is a wrong number, not a short one; a sum is also wider than
   any one of the amounts above it, so it is the cell most likely to overflow. It wraps
   instead, anywhere, so a column too narrow for its total shows the whole figure on two
   lines rather than a part of it on one, and never runs over into its neighbour.

   The label is a row header (<th scope="row">), so the generic th rules would centre or
   ellipsize it nowhere: only thead's th is sticky and tinted. In a totalled first column it
   shares the cell with the sum, floated to the start so the figure keeps its right edge
   under the amounts above it. */
/* A grid in the drill dialog (board 548) sticks its column header inside .statement-drill-body, which is the scroller and has padding
   above the table: sticky `top: 0` stops at the padding's inner edge, a gap above the header through which the rows show as the list
   scrolls. The header sticks at the scroller's own edge instead, by the padding's size, or under a views drill's row of choices, which stays
   at that edge (--drill-choices-height, below). Only from 901px, where .grid-scroll stops being a scroller of its own (above) and the header
   sticks against this body; below it the table scrolls sideways in .grid-scroll. */
@media (min-width: 901px) {
    .statement-drill-body .grid-table thead th {
        top: calc(var(--drill-choices-height, 0px) - var(--space-4));
    }
}

/* A grouped grid's heading rows (GroupRowsBy, board 548): the group's name, once, over the lines of it, on a soft tint, lighter than the
   column header's teal, which they would otherwise read as one with. */
.grid-table tbody tr.grid-group-row > th {
    padding: var(--space-2) var(--space-3);
    background-color: var(--color-surface-alt);
    border-top: 1px solid var(--color-line);
    color: var(--color-ink);
    font-size: var(--text-sm);
    font-weight: 700;
    text-align: left;
}

/* A heading row with its group's total (TotalEachGroup; Intercompany Imbalances' Lines by date, the owner, 2026-11-29): the name at the left,
   "Total:" and the amount at the right, in figures that line up from heading to heading. */
.grid-table tbody tr.grid-group-row .grid-group-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-4);
}

.grid-table tbody tr.grid-group-row .grid-group-total {
    white-space: nowrap;
}

.grid-table tbody tr.grid-group-row .grid-group-total-value {
    font-variant-numeric: tabular-nums;
}

/* A muted row (MuteRowsWhen; the Account Register's line dated after today, 2026-11-12): italics and a greyer ink, the owner's choice
   over Logi's yellow date. The row's tooltip says why. */
.grid-table tbody tr.grid-row-muted > td {
    font-style: italic;
    color: var(--color-ink-muted);
}

/* An emphasized row (EmphasizeRowsWhen; Global Search's line a search was opened from, 2026-11-12): bold, as Logi drew it. The row's
   tooltip says why. */
.grid-table tbody tr.grid-row-emphasized > td {
    font-weight: 700;
}

.grid-table tfoot tr.grid-total-row > th,
.grid-table tfoot tr.grid-total-row > td {
    background: var(--color-table-header);
    color: var(--color-ink);
    font-weight: 600;
    border-top: 2px solid var(--color-line);
    border-bottom: 0;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
}

.grid-table tfoot .grid-total-label {
    float: inline-start;
    margin-inline-end: var(--space-2);
}

/* ── Row actions (task 9) ─────────────────────────────────────────────────────
   A trailing column of per-row verbs. Right-aligned so the actions line up in a
   column of their own against the ragged-right text beside them, and so they sit
   nearest the scrollbar edge where the eye ends up.

   NOT display:flex on the cell: that would drop its display:table-cell and take the
   cell out of the row's layout, breaking the colgroup widths it is meant to honour.
   text-align + inline-flex children gets the same result inside table layout.

   Selectors are qualified with .grid-table td throughout, matching the specificity
   of the generic cell rules above (.grid-table td sets white-space; .grid-table td a
   sets colour). A bare .grid-actions-cell loses to those and the rules silently do
   nothing.

   The action selector is `.grid-table td .grid-row-action`, NOT `... td a.grid-row-action`:
   a not-built action is a <button> rather than an <a> (board 448), and both have to get
   the same pill. Two classes still outrank `.grid-table td a` (one class, two elements),
   so the colour below wins on the anchor as before — but a button inherits none of the
   anchor UA styling, which is why background/font/cursor are set explicitly. */
.grid-table td.grid-actions-cell {
    text-align: right;
    /* Overrides .grid-table td's nowrap. The column's width is a PROPORTION of the
       table, so on a grid with many columns two labelled buttons can want more room
       than their share; wrapping makes them stack inside the cell instead of spilling
       out past the table's right edge. */
    white-space: normal;
    /* Overrides the fixed table's ellipsis (.grid-table.is-fixed td): this cell holds buttons, not text,
       and a button wider than the cell drew an "…" beside it (owner's review of board 493, Find amount
       on the Used in list). Clipped, if anything, never ellipsized. */
    text-overflow: clip;
}

.grid-table td .grid-row-action {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 2px var(--space-2);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    color: var(--color-ink-muted);
    text-decoration: none;
    white-space: nowrap;
    /* Button resets: a <button> takes none of these from the cell or the anchor rules. */
    background: none;
    font-family: inherit;
    line-height: inherit;
    cursor: pointer;
}

/* Spacing BETWEEN actions only. A margin on every one (including the first) wasted a
   whole gap's width at the start of the cell, which was enough on its own to push two
   buttons onto a second line in a cell that otherwise fit them. */
.grid-table td .grid-row-action + .grid-row-action {
    margin-left: var(--space-2);
}

/* --color-bg, not a surface tint: hovering the pill also hovers its row, which is washed
   --color-surface-alt, so white is what lifts the pill out of the wash. */
.grid-table td .grid-row-action:hover {
    border-color: var(--color-accent);
    color: var(--color-ink);
    background: var(--color-bg);
}

.grid-table td .grid-row-action:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

/* Below the phone breakpoint the verbs alone would push the table wide, so only the
   icons show; the accessible name is on the anchor's aria-label, so nothing is lost.
   display:none rather than the visually-hidden pattern on purpose — that pattern is
   position:absolute, and with no positioned ancestor here the label escaped the cell
   and stretched the DOCUMENT, giving the whole page a horizontal scrollbar at 375px.
   (The cell already wraps at every width — see the rule above.) */
@media (max-width: 700px) {
    .grid-row-action-label {
        display: none;
    }

    .grid-table td .grid-row-action {
        /* Tighter than the desktop pill: with the label gone the box is all padding,
           and the actions column's share of a phone-width table is narrow. The floor is
           24px square — the minimum target size — which is exactly the case the label
           was hidden to make room for; where two of them no longer fit side by side the
           cell wraps and they stack, which is the right trade against an icon too small
           to hit on the device it was shrunk for. */
        padding: 2px var(--space-1);
        gap: 0;
        min-width: 24px;
        min-height: 24px;
        justify-content: center;
    }

    .grid-table td .grid-row-action + .grid-row-action {
        margin-left: var(--space-1);
    }
}

/* ── Row-action menu (GridDefinitionBuilder.RowActionMenu) ─────────────────────────
   One icon button per row (it IS a .grid-row-action, so it is the same pill as an icon-only
   action) opening a [popover] menu of the row's actions as worded items. The column is one
   icon wide (GridViewModel.RowActionsWidthPx), so the button is centred in it.

   The menu is drawn in the top layer, so the cell's overflow: hidden and the grid's scrollport
   never clip it. It sets NO position here: grid.js pins it under its button. Without script
   it keeps the UA's own popover placement, centred on screen, which is the no-JS fallback and
   must stay usable, hence the explicit width and the wrapping items. It re-states what it
   inherits from the cell it sits in (nowrap, right alignment, the cell's font size), because a
   popover still inherits from its DOM parent wherever it is drawn. Its look is .grid-menu-content's,
   the gear menu's, so the two menus of a grid read as one family. */
.grid-table td.grid-actions-cell.is-menu {
    text-align: center;
}

.grid-table .grid-row-menu {
    min-width: 200px;
    max-width: min(320px, calc(100vw - 16px));
    max-height: min(60vh, 420px);
    overflow-y: auto;
    padding: var(--option-pad);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    box-shadow: var(--shadow-lg);
    color: var(--color-ink);
    font-size: var(--text-sm);
    text-align: left;
    white-space: normal;
}

.grid-table .grid-row-menu .grid-row-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-2) calc(var(--space-4) - var(--option-pad));
    border: 0;
    border-radius: var(--option-radius);
    background: none;
    color: var(--color-ink);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.grid-table .grid-row-menu .grid-row-menu-item:hover,
.grid-table .grid-row-menu .grid-row-menu-item:focus-visible {
    background: var(--color-option-hover);
    color: var(--color-ink);
    box-shadow: none;
    transform: none;
}

.grid-table .grid-row-menu .grid-row-menu-item:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

.grid-table .grid-row-menu .grid-row-menu-item .fa-fw {
    color: var(--color-brand);
}

/* An engine without the Popover API shows a [popover] as an ordinary element, inside a cell one
   icon wide and clipped. There the button does nothing, so it goes, and the items are laid out in
   the cell, wrapping, as the inline actions column would show them. */
@supports not selector(:popover-open) {
    .grid-table td.grid-actions-cell.is-menu {
        overflow: visible;
        white-space: normal;
    }

    .grid-table .grid-row-menu-trigger {
        display: none;
    }

    .grid-table .grid-row-menu {
        min-width: 0;
        border: 0;
        box-shadow: none;
        background: none;
    }
}

/* A page-level action bar above a grid — the Auto-map button and its caveat. It sits
   outside the grid's <form> because forms cannot nest (the grid is a GET form). */
.page-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.page-actions-hint {
    font-size: var(--text-sm);
    color: var(--color-ink-muted);
}

/* ── The bulk bar (board 587; the owner, 2026-11-26, L3-Q21) ──
   A bulk screen's form drawn as a bar at the foot of the window that comes up with the first tick and goes with the last, as
   QuickBooks' bank feed raises its batch bar: the reader looks at the rows, ticks what to act on, then acts. Its left end is the
   selection as Gmail words it (_BulkBarSelection; grid.js writes it and sets data-open), then the screen's fields, then its verb.
   It replaced Bulk COA Mapping's template card over the grid ("users do not like the template section being on top").

   Fixed to the window's foot from the rail's edge, so it stays put however long the list is and however short; the rail is 252px,
   or gone when collapsed or stacked on a narrow screen. While it is up the page leaves its height free under the list
   (--bulk-bar-height, which grid.js measures as the category's fields come and go), so the last rows and the pager scroll clear of
   it, and the toasts sit above it. Under the modal (1000), the toasts (1100) and a picker's open list (1200, which combobox.js opens
   upward here, where there is more room). With no script _Layout's noscript puts it in the page's flow, always shown. */
.bulk-bar {
    position: fixed;
    left: 252px;
    right: 0;
    bottom: 0;
    z-index: 900;
    display: flex;
    align-items: flex-end;
    gap: var(--space-3) var(--space-5);
    padding: var(--space-3) var(--space-5);
    background: var(--color-bg);
    border-top: 3px solid var(--color-primary);
    box-shadow: 0 -6px 18px rgb(0 0 0 / 12%);
    animation: bulk-bar-up 160ms ease-out;
}

.bulk-bar:not([data-open]) {
    display: none;
}

.app-shell.rail-collapsed .bulk-bar {
    left: 0;
}

@keyframes bulk-bar-up {
    from { transform: translateY(100%); }
}

@media (prefers-reduced-motion: reduce) {
    .bulk-bar {
        animation: none;
    }
}

/* Wherever the bar is in the page (board 594): a COA category's accounts draw theirs inside a section of the record page. Folding that
   section with rows ticked hides the bar with it, so the room and the raised toasts go too, and come back as it opens. */
main:has(.bulk-bar[data-open]):not(:has(details:not([open]) .bulk-bar[data-open])) {
    padding-bottom: calc(var(--bulk-bar-height, 7rem) + var(--space-6));
}

body:has(.bulk-bar[data-open]):not(:has(details:not([open]) .bulk-bar[data-open])) .toast-region {
    bottom: calc(var(--bulk-bar-height, 7rem) + var(--space-4));
}

/* The count over its two links, so the fields keep the bar's width. At the top, level with the fields' labels, however many lines the
   fields wrap to (the owner, 2026-11-26); the verb stays at the foot, level with the pickers. */
.bulk-bar-selection {
    flex: 0 0 10rem;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: var(--text-sm);
}

.bulk-bar-count {
    font-weight: 600;
    color: var(--color-ink);
}

.bulk-bar-selection-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--space-3);
}

/* Plain text buttons, as the banner's were: they change what the verb is aimed at, and the verb is the one solid button. The hover
   takes back the global button:hover's fill and lift. */
.bulk-bar-link {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--color-primary);
    text-decoration: underline;
    cursor: pointer;
}

.bulk-bar-link:hover {
    background: none;
    color: var(--color-ink);
    box-shadow: none;
    transform: none;
}

.bulk-bar-link:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.bulk-bar-capped {
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
}

/* The fields in columns of at least 10rem that share the line, wrapping when a category takes more than fit: at a 1280-pixel window
   four to a line, so the category, Rename to and up to two more fields are one line (95% of mappings on QA, 587-qa-m08), and all
   five, before a category is chosen or for one that takes all three, two. A field's "New …" is a small + beside its picker, its
   words its name and its tooltip, so the label keeps its line. */
.bulk-bar-fields {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: var(--space-2) var(--space-3);
}

/* A bar with one field (board 594: the assign, rename and move screens' one picker) gives it one column of up to 20rem, a picker's
   width before the bar, so a Master COA path or a name reads in it; 10rem cut the placeholder short. It shrinks with the window. */
.bulk-bar-fields:has(> .field:only-child) {
    grid-template-columns: minmax(0, 20rem);
}

.bulk-bar-fields > .field {
    min-width: 0;
    margin-bottom: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-content: start;
    column-gap: 4px;
}

.bulk-bar-fields > .field > * {
    grid-column: 1 / -1;
}

.bulk-bar-fields > .field > .combobox {
    grid-column: 1;
}

.bulk-bar-fields > .field > .field-links {
    grid-row: 2;
    grid-column: 2;
}

.bulk-bar-fields .field-add {
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 0;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
}

.bulk-bar-fields .field-add:hover {
    border-color: var(--color-primary);
    text-decoration: none;
}

.bulk-bar-fields .field-add-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Smaller than a form's fields (the owner, 2026-11-26): the bar is chrome over the list, not a form page. */
.bulk-bar .field label {
    margin-bottom: 2px;
    font-size: var(--text-xs);
}

.bulk-bar .field input {
    padding: 3px var(--space-2);
    font-size: var(--text-sm);
}

/* A compact picker's list is wider than the picker, so a category's name reads on one line; combobox.js keeps it in the window. */
.bulk-bar .combobox-options {
    min-width: 18rem;
}

.bulk-bar-verbs {
    display: flex;
    gap: var(--space-2);
    margin-left: auto;
}

@media (max-width: 900px) {
    .bulk-bar {
        left: 0;
        flex-wrap: wrap;
        padding: var(--space-3);
    }

    .bulk-bar-selection {
        flex-basis: 100%;
    }
}

/* The required marker. A bare <abbr> wears the browser's dotted underline, which on a single
   asterisk reads as a rendering fault. */
.required-mark {
    color: var(--color-danger);
    text-decoration: none;
    font-weight: 700;
}

/* A labelled control inside the action bar — the rename screens' "Rename to" picker (board 424).
   Label and control on one line, because the bar is a row of peers rather than a form.

   flex-wrap, so that line becomes two when it has to. .page-actions above already wraps, but its
   wrap only ever moved this field WHOLE onto a row of its own; the field itself stayed nowrap, and
   at 375px its nowrap label plus the 20rem picker measured 387px inside a 327px column — 36px of
   horizontal scroll on the DOCUMENT, on the screens carrying a bulk verb (board 477) and no other.

   min-width: 0 is the half that does the work, and it is needed on BOTH boxes (see the picker
   below for the other). Wrapping alone only re-floors the field at the widest thing on any one
   line — the 20rem picker — which still overflowed anything narrower than a 320px column: fixed at
   375px purely because the column there is 327px, and still broken at 320px. As a flex item of
   .page-actions this field's automatic minimum is that min-content width, so it has to be lifted
   here for the field to reach its column at all. */
.page-action-field {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    min-width: 0;
}

.page-action-field > label {
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
}

/* The combobox's input is width:100%, so its wrapper needs a width of its own or the flex item
   collapses to nothing (the input has no intrinsic width to shrink-to-fit around).

   min-width: 0 for the same reason as on the field: a flex item's automatic minimum is its own
   specified width, so this box carried a 20rem FLOOR and refused to shrink onto a narrower line.
   `max-width: 100%` was no substitute — a percentage resolves against the parent, and the parent
   was the box this picker had itself pushed too wide. With the floor lifted the field reaches its
   column and the max-width finally has a settled parent to resolve against.

   `width` rather than `flex-basis` (measured, not theorised): as a flex BASE size the 20rem stops
   being the item's max-content contribution, and Chrome falls back to the bare input's intrinsic
   ~207px. The field then measured 274px on a 1440px viewport with the picker wrapped below its
   label — the phone layout, on desktop. A used width keeps the contribution at 20rem, so a line
   with room for it stays one line. */
.page-action-field .combobox {
    width: 20rem;
    max-width: 100%;
    min-width: 0;
}

/* The no-JS counterpart of a toast: what an action did, stated on the page it
   redirected back to. Named page-notice, not notice, because .notice-* already
   belongs to the modal notice dialog. */
.page-notice {
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    border: 1px solid var(--color-line);
    border-left: 3px solid var(--color-brand);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    font-size: var(--text-sm);
}

/* Footer, all right-aligned in reading order: row count, then the pager, then rows-per-page. The count
   always shows (useful on a single page too); the arrow pager only appears when there is more than one. */
.grid-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-4);
    margin-top: var(--space-3);
    font-size: var(--text-sm);
}

.grid-count {
    color: var(--color-ink-muted);
}

.grid-pager {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Rows per page — sits to the right of the pager. */
.grid-size select {
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-ink);
    font: inherit;
    font-size: var(--text-sm);
    cursor: pointer;
}

.grid-size select:focus {
    outline: 0;
    border-color: var(--color-focus);
    box-shadow: 0 0 0 3px var(--color-surface-alt);
}

/* Arrow-only prev/next — square tap target, the label lives on aria-label. */
.grid-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.grid-page:hover {
    background: var(--color-surface-alt);
    border-color: var(--color-primary-soft);
}

.grid-page.is-disabled {
    color: var(--color-ink-muted);
    opacity: 0.5;
    pointer-events: none;
}

.grid-page-status {
    color: var(--color-ink-muted);
}

/* Loading affordance (plan §5): while a redraw is out, htmx marks the grid form .htmx-request, whichever control sent it
   (hx-indicator="this" on the form, _Grid.cshtml). The rows and the pager dim from half a second on, as the app's loading
   bar appears (navprogress.js), so a redraw that lands sooner shows nothing; they come back at once. The header is left
   alone: it holds the search box someone may be typing into. */
.grid .grid-scroll,
.grid .grid-footer {
    transition: opacity 0.15s ease;
}

.grid.htmx-request .grid-scroll,
.grid.htmx-request .grid-footer {
    opacity: 0.6;
    transition-delay: 0.5s;
    cursor: progress;
}

/* ============================================================================
   Modal AddEdit forms + toasts (plan §5 form framework).
   ============================================================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: var(--space-6) var(--space-4);
    background: rgba(30, 51, 48, .45);
    overflow-y: auto;
}

.modal-dialog {
    width: 100%;
    max-width: 520px;
    margin-top: var(--space-6);
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* ── The three-region form shell ──────────────────────────────────────────────
   Every AddEdit form is header / body / footer: <h2>, .modal-form-body, and
   .modal-form-actions. Only the BODY scrolls, so Save and Cancel are on screen the
   moment the dialog opens no matter how many fields the form grows to — on the
   ten-field ClassNames form they used to sit a full scroll below the fold.

   Flex rather than sticky-inside-a-scrollport: padding on a scrollport sits INSIDE it,
   so sticky bands would have content scrolling through the gutters above and below them,
   and negative-margin bleed to fix that overflows to the start edge where it cannot be
   scrolled back. Three flex children each own their padding and nothing leaks.

   The cap leaves room for .modal's own padding (space-6) plus the dialog's top margin
   (space-6), so the dialog never runs off the bottom of the viewport. */
.modal-form {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 8rem);
}

.modal-form-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-5);
}

/* ── Long forms (board 424, widened board 440) ────────────────────────────────
   Every form before ClassNames had four fields at most, so the dialog could be one
   uninterrupted stack. Ten needs three things: more room, grouping — an unbroken
   run of ten identical comboboxes gives a reader nothing to navigate by — and the
   two-column layout below, which roughly halves the form's height.

   .modal-form-wide widens the dialog it sits in rather than introducing a second
   dialog size: the width belongs to the FORM's needs, so the form declares it, and
   a page that does not opt in is unaffected. Add it to any form as it grows past
   four or five fields — the two-column rules come with it. */
.modal-dialog:has(.modal-form-wide) {
    max-width: 880px;
}

/* Two columns once there is width for them. A pair of side-by-side comboboxes at 400px
   each is still comfortably wider than the ~260px these fields need, and halving the
   height is what takes the long forms off the "needs scrolling to reach Save" list.

   Applied to the section, not to the form: the fields inside a <fieldset class="field-group">
   are siblings that pair up naturally, while the form's top-level fields (a record's
   identity — the class name, what it renames to) read better full width, which is also
   how the design handoff lays them out. Anything in a section that is not a field —
   the legend, its help text, a conflict notice — spans both columns. */
@media (min-width: 60rem) {
    .modal-form-wide .field-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: var(--space-5);
    }

    .modal-form-wide .field-group > legend,
    .modal-form-wide .field-group > .field-group-help,
    .modal-form-wide .field-group > .page-notice,
    .modal-form-wide .field-group > .field-wide {
        grid-column: 1 / -1;
    }

    /* Row rhythm comes from the fields' own bottom margin; a row-gap would double it. */
    .modal-form-wide .field-group > .field {
        margin-bottom: var(--space-4);
    }
}

/* A titled section within a form. <fieldset>/<legend> rather than a div and a
   heading, so the grouping is in the accessibility tree and not merely visual —
   screen readers announce the legend with each field inside it. */
.field-group {
    margin: 0 0 var(--space-5);
    padding: var(--space-4);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
}

.field-group legend {
    padding: 0 var(--space-2);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-ink);
}

.field-group-help,
.field-help {
    margin: 0 0 var(--space-3);
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
}

/* Client settings' Names in reports (board 525): the companies' fields, then the investments', each under a small heading. */
.settings-names-heading {
    margin: var(--space-3) 0 var(--space-2);
    font-size: var(--text-sm);
    font-weight: 600;
}

/* Client settings' Default Fields (board 578): the report's Include Fields drop-down (_ReportMultiPick) in the
   settings' grid. Not a .field, whose label and input rules would restyle the drop-down's boxes; its label reads as the fields' do. */
.settings-picker {
    min-width: 0;
}

.settings-picker .report-single-pick-label {
    font-size: var(--text-sm);
    color: var(--color-ink);
}

/* Sits under its own field rather than above a group, so no bottom margin fighting
   the field's. */
.field-help {
    display: block;
    margin: var(--space-1) 0 0;
}

/* ── The Field help switch (owner, 2026-11-25; design 2 of docs/design-discussion/field-help-mockups.html) ──
   A field's fixed hint (a .field-help or .field-hint that is a direct child of its .field) and a group's note
   (.field-group-help) are hidden until the user presses Field help (_FieldHelpToggle), which shows them all. The choice
   is the root's data-field-help, "on" or "off": the layout's head writes it from localStorage before the first paint,
   and form.js flips it and remembers it in this browser. With no script there is no attribute, so nothing hides and no
   button shows.

   Never hidden: a live note (.field-note: a line built from the record, from another field's pick, or about the
   screen's configuration), a checkbox's description (a .field whose label.checkbox-field is its child, as in
   .category-check), and the hint of a field whose save failed. The journal entry's two checkboxes are a level deeper,
   under the box row that lines them up with the inputs beside them, so their descriptions fold as any field's hint does
   (owner, 2026-11-30). Hints outside a .field (page notices, delete blockers, empty states) are not
   touched. */
:root[data-field-help="off"] .field:not(:has(.field-validation-error, > .checkbox-field)) > :is(.field-help, .field-hint):not(.field-note),
:root[data-field-help="off"] .settings-picker:not(:has(.field-validation-error)) > .field-help:not(.field-note),
:root[data-field-help="off"] .field-group-help:not(.field-note) {
    display: none;
}

/* A shown hint wears the pressed button's tint, padded so its words start under the box's own text (the inputs' side
   padding). A group's note wears the same tint; it sits above its fields, not under one. */
.field:not(:has(> .checkbox-field)) > :is(.field-help, .field-hint):not(.field-note),
.settings-picker > .field-help:not(.field-note),
.field-group-help:not(.field-note) {
    padding: var(--space-1) var(--space-3);
    background: var(--color-surface-alt);
    border-radius: var(--radius-sm);
}

/* The button: the circle-info icon and the words. Hidden unless its dialog or page holds a hint that can fold, so a
   Used in layer, the fix chooser and a screen with only live notes never show it. :has() cannot nest, so the checkbox
   exemption is spelled as a sibling test (a checkbox's description follows its label.checkbox-field). */
.field-help-toggle {
    display: none;
    flex-shrink: 0;
    gap: 6px;
    min-height: 32px;
    padding: var(--space-1) 10px;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    color: var(--color-ink-muted);
}

:root[data-field-help] :is(#helix-modal .modal-dialog, main):has(.field > :is(.field-help, .field-hint):not(.field-note, .checkbox-field ~ *), .field-group-help:not(.field-note)) .field-help-toggle {
    display: inline-flex;
}

.field-help-toggle:hover {
    background: var(--color-surface);
    color: var(--color-primary);
    box-shadow: none;
    transform: none;
}

/* Pressed: the tint every shown hint wears. Drawn from the root attribute, which is there before the first paint, so a
   remembered "on" is never drawn unpressed; form.js keeps aria-pressed in step. */
:root[data-field-help="on"] .field-help-toggle {
    background: var(--color-surface-alt);
    border-color: var(--color-line);
    color: var(--teal-700);
}

/* In the shared dialog: on the title line at the top right, as dialog chrome, with room kept for it in the title. */
#helix-modal .modal-dialog > .field-help-toggle {
    position: absolute;
    top: 22px;
    right: 20px;
    z-index: 1;
}

:root[data-field-help] #helix-modal .modal-dialog:has(.field > :is(.field-help, .field-hint):not(.field-note, .checkbox-field ~ *), .field-group-help:not(.field-note)) .modal-form > h2 {
    padding-right: 9.5rem;
}

/* On a page: at the right end of the heading's row (_FormPage, Your profile, BI Connector, Bulk COA Mapping, the
   importer issue form), or of a record editor's title line, before its actions. */
/* Baseline, not centre: a card's h1 has margin below it and none above, so centring would set the button low. */
.page-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: var(--space-3);
}

.page-title-row > .field-help-toggle,
.category-head > .field-help-toggle {
    margin-left: auto;
}

.category-head > .field-help-toggle + .category-actions {
    margin-left: 0;
}

/* A page's verb that takes no selection, at the title row's right end before Field help (Bulk COA Mapping's Auto Categorize, board
   587). */
.page-title-row > .page-title-action {
    margin-left: auto;
}

.page-title-row > .page-title-action + .field-help-toggle {
    margin-left: 0;
}

/* Narrow: the icon alone; the words stay its accessible name. */
@media (max-width: 34rem) {
    .field-help-word {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    :root[data-field-help] #helix-modal .modal-dialog:has(.field > :is(.field-help, .field-hint):not(.field-note, .checkbox-field ~ *), .field-group-help:not(.field-note)) .modal-form > h2 {
        padding-right: 4rem;
    }
}

/* The last field in a group should not add margin inside the group's padding. */
.field-group .field:last-of-type {
    margin-bottom: 0;
}

/* "New …" beside a picker: subordinate to the field it belongs to, so it reads as an escape hatch
   rather than a second control competing with the combobox. */
.field-add {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-1);
    font-size: var(--text-xs);
    color: var(--color-primary);
    text-decoration: none;
}

.field-add:hover {
    text-decoration: underline;
}

/* The row of small links under one picker — "New investor" beside "View investor", and the account's
   Investigate beside its Used in. Each .field-add is inline-flex, so without this they touch; the gap
   is what makes them read as two controls. Wraps rather than overflowing a narrow field. */
.field-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

/* A picker with its New and its View or Edit nested beside it (the owner, 2026-11-29: "buttons that nest next to the input bar to create
   the new item, instead of links underneath", after the selection bar's +): the box takes what is left of the line and the buttons are
   as tall as it. A View that has nothing to open is hidden, and with every button hidden the group draws nothing, so the box is the
   whole line again. Links that research or list (Investigate, Used in) stay under the field. */
.field-control {
    display: flex;
    align-items: stretch;
    gap: var(--space-2);
}

.field-control > :not(.field-buttons) {
    flex: 1 1 auto;
    min-width: 0;
}

.field-buttons {
    flex: none;
    display: flex;
    gap: var(--space-2);
}

.field-buttons:not(:has(> :not([hidden]))) {
    display: none;
}

.field-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-3);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    color: var(--color-primary);
    text-decoration: none;
}

.field-button:hover {
    border-color: var(--color-primary);
    text-decoration: none;
}

/* The word only where the window has room for it; the tooltip and the accessible name always say what the button does. */
@media (max-width: 40rem) {
    .field-button {
        padding: 0 var(--space-2);
    }

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

/* A read-only value still looks like a field, but must not look editable. surface-alt, not
   surface: editable inputs here are --color-bg on a --color-bg dialog, and surface is 1.05:1
   against white — the tint has to be surface-alt to register at all. */
.modal-form .field input[readonly] {
    background: var(--color-surface-alt);
    color: var(--color-ink-muted);
    cursor: default;
}

/* Pinned header: names the record being edited and never scrolls away with it. */
.modal-form > h2 {
    flex-shrink: 0;
    margin: 0;
    padding: var(--space-5) var(--space-5) var(--space-4);
    border-bottom: 1px solid var(--color-line);
    font-size: var(--text-xl);
}

.modal-form .field {
    margin-bottom: var(--space-4);
}

.modal-form .field label {
    display: block;
    margin-bottom: var(--space-1);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-ink);
}

.modal-form .field input,
.modal-form .field select {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    color: var(--color-ink);
    background: var(--color-bg);
}

/* A date box as tall as the text boxes beside it (board 504's review, measured): Chromium pads a date's fields 1px above and
   below, which made it 41px to their 39px and set its help 2px lower than theirs. */
.modal-form .field input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}

.modal-form .field input:focus,
.modal-form .field select:focus {
    outline: 0;
    border-color: var(--color-focus);
    box-shadow: 0 0 0 3px var(--color-surface-alt);
}

/* A file box you can also drop a file on (owner, 2026-11-12): "Choose a file or drop it here", the chosen file's name in
   bold above it (form.js). The file input is the control: see-through and stretched over the whole box, so a click anywhere
   opens the picker, a file dropped on it is taken, and the keyboard reaches the same control the mouse uses. These rules come
   after the dialog's input rules above, which they override for this one input. */
.file-drop {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    padding: var(--space-5) var(--space-4);
    border: 2px dashed var(--color-primary-soft);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-ink-muted);
    text-align: center;
    transition: background-color .15s ease, border-color .15s ease;
}

.file-drop:hover,
.file-drop.file-drop-over {
    border-color: var(--color-primary);
    background: var(--color-surface-alt);
}

.file-drop:focus-within {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

.file-drop:has(input[aria-invalid="true"]) {
    border-color: var(--color-danger);
}

.file-drop input.file-drop-input {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    opacity: 0;
    cursor: pointer;
}

.file-drop input.file-drop-input::file-selector-button {
    cursor: pointer;
}

/* What the box says, stacked: the icon, the chosen file's name, then the prompt. */
.file-drop-face {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    max-width: 100%;
}

.file-drop-icon {
    font-size: 1.75rem;
    color: var(--color-brand);
}

.file-drop-name {
    max-width: 100%;
    font-weight: 600;
    color: var(--color-ink);
    overflow-wrap: anywhere;
}

.file-drop-name:empty {
    display: none;
}

.file-drop-choose {
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: underline;
}

/* A multi-line field in a dialog (board 471: the Account Substitutions note, which legacy edits in a text
   area and a single-line box flattened on every save). It is the two rules above over again — the same box
   and the same focus ring as the inputs it sits among — plus the two things a textarea does not get from
   them: the dialog's font, which it does not inherit, and a grip that only grows it downwards, so it cannot
   be dragged wider than the dialog.

   :not(.category-form): the COA category form is a .modal-form too, and has a textarea of its own
   (Comments) that `.category-form textarea` styles further down. This rule is the more specific of the two
   and would restyle it — a smaller font and another focus ring — so that form is left to its own. */
.modal-form:not(.category-form) .field textarea {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: var(--text-sm);
    color: var(--color-ink);
    background: var(--color-bg);
    resize: vertical;
}

.modal-form:not(.category-form) .field textarea:focus {
    outline: 0;
    border-color: var(--color-focus);
    box-shadow: 0 0 0 3px var(--color-surface-alt);
}

/* A checkbox inside a .field (the Holding Company "Virtual" flag, board 439). The generic
   `.modal-form .field input` rule stretches inputs to 100% width with a text-input border, and
   `.modal-form .field label` forces the label to a full-width block — both mangle a native checkbox.
   Reset the box to a real 16px square and lay the label out as an inline row, matching the grid
   toggle's checkbox treatment. Selectors are scoped under `.modal-form .field` so they outrank the
   generic input/label rules above. */
.modal-form .field label.checkbox-field {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: 0;
    cursor: pointer;
}

.modal-form .field .checkbox-field input[type="checkbox"] {
    width: 16px;
    height: 16px;
    padding: 0;
    margin: 0;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.modal-form .field .field-validation-error,
.modal-form [asp-validation-for],
.modal-form .validation-message {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--text-xs);
    color: var(--color-danger);
}

.modal-form .validation-summary-errors {
    margin-bottom: var(--space-4);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    background: var(--color-danger-bg);
    color: var(--color-danger);
    font-size: var(--text-sm);
}

/* Pinned footer: a tinted band under the scrolling fields, its bottom corners matching
   the dialog's so it reads as the floor of the card rather than a stripe inside it. */
.modal-form-actions {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--color-surface);
    border-top: 1px solid var(--color-line);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal-form-actions .link-button {
    background: none;
    border: 0;
    color: var(--color-ink-muted);
    cursor: pointer;
}

/* The modal's Delete (board 422): an icon-only trash button, unmistakably destructive, pushed to the
   far side of the action row so a slip aimed at Save cannot land on it. Sized square around the icon. */
.modal-form-actions .link-button.danger {
    color: var(--color-danger);
    margin-right: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2);
    font-size: var(--text-lg);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.modal-form-actions .link-button.danger:hover {
    background: var(--color-danger-bg);
}

/* ── "Used in" usage popup (board 439) ────────────────────────────────────────
   A read-only grid layered over the edit form through the modal stack (form.js
   data-modal-stack). It reuses the ONE modal host: the edit form's live nodes are
   parked in #helix-modal-stack while this shows and restored when it closes, so
   this is a replace-and-return, not a second overlapping dialog — which is exactly
   what keeps the half-typed edit form intact behind it. Wider than a form dialog
   because a grid needs room; the grid's own .grid-scroll scrolls the table inside
   itself on a narrow screen, so the page never scrolls sideways. */
.modal-dialog:has(.modal-usage) {
    max-width: 62rem;
}

/* The read-only layer is the grid-bearing case of the same three-region shell: pinned head,
   scrolling .modal-form-body, no footer (there is nothing to save). It needs the width of a
   grid rather than the width of a form, so it opts into its own size. */
.modal-usage {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 8rem);
}

.modal-dialog:has(.modal-usage) {
    max-width: 880px;
}

/* A Used in list whose columns want more than 880px declares it, as a wide form does with .modal-form-wide: the
   name dialogs' general ledger lines (board 493, owner's review: "show the grid as wider by default"). Still a
   maximum, so a smaller window gets a dialog as wide as it is, and the corner grip still resizes it. */
.modal-dialog:has(.modal-usage-wide) {
    max-width: 75rem;
}

.modal-usage-head {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-5) var(--space-4);
    border-bottom: 1px solid var(--color-line);
}

.modal-usage-head h2 {
    margin: 0;
}

.usage-name {
    font-weight: 600;
}

/* Square icon-only close, mirroring the confirm/notice dismiss affordances. */
.modal-usage-close {
    flex: none;
    background: none;
    border: 0;
    color: var(--color-ink-muted);
    cursor: pointer;
    padding: var(--space-2);
    font-size: var(--text-lg);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}
.modal-usage-close:hover {
    background: var(--color-line);
    color: var(--color-ink);
}

/* The transaction drill-down chooser (board 448) — legacy's ShowDrillDown popup, ported. It borrows
   .modal-usage's three-region shell (pinned head, scrolling body, no footer) because it has the same
   shape: nothing to save, so a Save/Cancel footer would be a lie. It does NOT want that shell's
   grid-sized width, hence the narrower override — four stacked choices read badly at 880px, where the
   explanation line ends up a single long ribbon far from the label it belongs to. */
.modal-dialog:has(.modal-fix) {
    max-width: 34rem;
}

/* The row being fixed, under the title. Muted and small: it is there to confirm which row was tapped,
   not to be read. */
.modal-fix-row {
    margin: var(--space-1) 0 0;
    font-size: var(--text-sm);
    color: var(--color-ink-muted);
}

.modal-fix-sep {
    margin: 0 var(--space-1);
    opacity: 0.6;
}

/* "No name on this line" is not neutral information here — it is the reason two of the choices below
   changed into something else, so it is styled as the finding it is rather than as absent data. */
.modal-fix-none {
    font-style: italic;
    color: var(--color-ink);
}

.fix-choices {
    list-style: none;
    margin: var(--space-3) 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* One rule for both flavours — the <a> that goes somewhere and the <button> that raises the not-built
   notice — because they are the same object to the reader and must not look like different classes of
   thing. width:100% and text-align:left are the button half's, which otherwise shrink-wraps and
   centres; the rest is shared. */
.fix-choice {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    width: 100%;
    text-align: left;
    padding: var(--space-3);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-ink);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.fix-choice:hover {
    border-color: var(--color-accent);
    background: var(--color-surface-alt);
}

.fix-choice:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

.fix-choice-icon {
    flex: none;
    margin-top: 2px;
    color: var(--color-ink-muted);
}

.fix-choice-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    /* min-width:0 lets the explanation wrap instead of forcing the flex row wider than the dialog. */
    min-width: 0;
}

.fix-choice-label {
    font-weight: 600;
}

.fix-choice-why {
    font-size: var(--text-sm);
    color: var(--color-ink-muted);
}

/* The "not built yet" tag, and the arrow on a choice that goes somewhere, occupy the same slot at the
   end of the row — so the two flavours line up and the difference between them is legible at a glance
   rather than only on click. */
.fix-choice-tag {
    flex: none;
    align-self: center;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-ink-muted);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    padding: 2px var(--space-2);
}

.fix-choice-go {
    flex: none;
    align-self: center;
    color: var(--color-ink-muted);
}

/* ── Resizing the dialog (owner's request, 2026-10-21: "make dialogs expandable") ─────────────────────
   A grip in the bottom-right corner of the shared dialog (#helix-modal only: the confirm and notice
   dialogs are small and fixed by design). form.js drags it with pointer events — so a mouse, a finger and
   a pen all work — and writes an inline width and height on the dialog. It is not CSS `resize: both`,
   which does not fit this dialog: it is centred, so a native handle would trail the pointer at half
   speed (the width grows on both sides), and the browser's own resizing stops at each dialog's max-width
   cap, which would have to be lifted for every dialog whether anyone resized it or not.

   Nothing below changes a dialog until its first drag adds .is-resized. A dialog nobody resized keeps
   every default above — the forms, .modal-form-wide and the stacked "Used in" layer look as they did.
   Once resized, the dialog is a flex column of the size the user chose, held between a usable minimum
   and the viewport, and the form shell inside it fills it: the body scrolls, the heading and the
   actions stay put, exactly as at the default size. form.js carries a size with its own layer — the form
   keeps its size while a layer shows at its default, and gets it back when the layer closes — and
   forgets it when the dialog closes. */
#helix-modal .modal-dialog {
    --modal-grip: 20px;
    position: relative;
}

.modal-resize {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 1;
    width: var(--modal-grip);
    height: var(--modal-grip);
    padding: 3px;
    color: var(--color-ink-muted);
    opacity: 0.75;
    cursor: nwse-resize;
    /* The drag is ours, not the browser's: a finger on the grip must not scroll the page, and a mouse
       drag across it must not select text. */
    touch-action: none;
    user-select: none;
}

.modal-resize:hover {
    color: var(--color-ink);
    opacity: 1;
}

.modal-resize svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
}

/* A phone's dialog is already as wide as the screen, and a corner grip there only fights the scroll. */
@media (max-width: 34rem) {
    .modal-resize {
        display: none;
    }
}

/* A shell with no footer (the "Used in" layers, the fix chooser) ends in its scrolling body, whose
   scrollbar would run under the grip. The margin lifts the body clear, and the padding gives back what
   the margin took, so the blank below the content is what it always was. */
#helix-modal .modal-form-body:last-child {
    margin-bottom: var(--modal-grip);
    padding-bottom: calc(var(--space-5) - var(--modal-grip));
}

#helix-modal .modal-dialog.is-resized {
    display: flex;
    flex-direction: column;
    /* Never wider than the overlay's content box or taller than the form shell's own cap, whatever the
       window does after the drag. The width lower bound gives way on a screen narrower than itself. */
    max-width: 100%;
    max-height: calc(100vh - 8rem);
    min-width: min(22rem, 100%);
    min-height: min(12rem, calc(100vh - 8rem));
}

#helix-modal .is-resized > #helix-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* The shell fills the dialog rather than being capped to the viewport on its own: the dialog's
   height is the cap now. min-height: 0 is what lets its body shrink below its content and scroll. */
#helix-modal .is-resized .modal-form,
#helix-modal .is-resized .modal-usage {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

/* A wide form is two columns from 60rem of viewport (above). Narrowed under 40rem those columns would
   squeeze the pickers until the body scrolled sideways, so a wide dialog stops there. */
@media (min-width: 60rem) {
    #helix-modal .modal-dialog.is-resized:has(.modal-form-wide) {
        min-width: min(40rem, 100%);
    }
}

/* Confirmation dialog (board 422) — the styled replacement for the browser's native confirm(),
   layered above the AddEdit modal it is launched from (higher z-index; centred rather than
   top-aligned). role="alertdialog"; form.js drives it. */
.modal-confirm {
    z-index: 1100;
    align-items: center;
}

.confirm-dialog {
    max-width: 420px;
    margin-top: 0;
    padding: var(--space-5);
}

.confirm-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.confirm-head i {
    color: var(--color-danger);
    font-size: var(--text-2xl);
}

.confirm-head h2 {
    margin: 0;
    font-size: var(--text-lg);
}

.confirm-message {
    margin: 0 0 var(--space-5);
    color: var(--color-ink-muted);
    font-size: var(--text-sm);
    line-height: 1.5;
}

/* The notice dialog's body holds a cloned template, so it can contain real paragraphs. The element
   already carries the block's outer margin; the user agent's 1em on the first and last child would
   add to it and leave the passage floating away from the heading and the OK row. */
.confirm-message > :first-child { margin-top: 0; }
.confirm-message > :last-child { margin-bottom: 0; }

/* A menu path inside a dialog — "Account › Extension settings › Advanced". An <ol> because it is an
   ordered set of steps; the chevrons are generated, so they are drawn but never read aloud. */
.info-path {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2);
    margin: 0 0 var(--space-4);
    padding: var(--space-2) var(--space-3);
    list-style: none;
    background: var(--color-surface-alt);
    border-radius: var(--radius-sm);
    color: var(--color-ink);
    font-weight: 600;
}

.info-path li + li::before {
    content: "\203A";   /* › — a separator, not part of the step's name */
    margin-right: var(--space-2);
    color: var(--color-primary-soft);
    font-weight: 700;
}

/* The setting to turn on, quoted as it reads in the extension, behind the checkmark that says what to
   do with it. Flex, not an inline icon: the label becomes its own column, so a second line wraps
   under the first word rather than back under the checkmark. */
.info-option {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    margin: 0;
    padding: var(--space-2) var(--space-3);
    background: var(--color-success-bg);
    border-radius: var(--radius-sm);
    color: var(--color-ink);
}

.info-option i {
    color: var(--color-success-icon);
    flex-shrink: 0;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* Off-screen but still clickable-by-the-browser: the modal form's default-submit shim (board 422)
   must remain a rendered submit button for HTML implicit submission to target it — display:none
   would take it out of the game entirely and hand Enter back to the Delete button. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    border: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Toasts */
.toast-region {
    position: fixed;
    right: var(--space-4);
    bottom: var(--space-4);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    max-width: 360px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-size: var(--text-sm);
    color: var(--color-on-primary);
    background: var(--color-primary);
    opacity: 1;
    transition: opacity .3s ease, transform .3s ease;
}

/* An error toast carries a message worth reading, so it wraps instead of running off the region. */
.toast-text {
    flex: 1;
}

/* The dismiss control on an error toast, which does not auto-expire. It is a <button>, so it inherits
   the app's filled-button treatment — every one of these resets is undoing that, not decorating. */
.toast-close {
    flex: none;
    padding: 0;
    background: none;
    border: 0;
    color: inherit;
    font-size: var(--text-sm);
    line-height: 1.4;
    opacity: 0.8;
    cursor: pointer;
}

.toast-close:hover {
    background: none;
    box-shadow: none;
    transform: none;
    opacity: 1;
}

.toast-success {
    background: var(--color-success);
}

.toast-error {
    background: var(--color-danger);
}

.toast.is-leaving {
    opacity: 0;
    transform: translateY(8px);
}

/* ============================================================================
   Navigation progress (navprogress.js).

   A page that is slow to arrive leaves the old one on screen, unchanged, which reads as a click that
   missed. navprogress.js sets .nav-pending on <html> when the browser reports that this window has
   started going somewhere else; everything a person sees is decided here.

   BOTH DELAYS ARE animation-delays, not script timers: the bar after half a second, the note after
   two. A page that arrives sooner shows nothing, and nearly all of them do. Only opacity and
   transform animate: the two properties a browser can animate off its main thread, which is the
   best chance of the bar still moving while a navigation is under way (not verified in Safari).

   ABOVE EVERYTHING: the modal (1000), the confirm dialog and the toasts (1100) and the combobox list
   (1200), because a navigation can be pending under any of them. Neither element takes a click until
   the note is actually on screen.
   ============================================================================ */
.nav-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1300;
    height: 3px;
    overflow: hidden;
    /* One step under the header's teal: the track reads against the white page a phone shows once the
       header has scrolled away, and sinks into the header on a desktop, leaving the lime to move. */
    background-color: var(--teal-700);
    pointer-events: none;
    visibility: hidden;
}

.nav-progress::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 40%;
    background-color: var(--color-accent);
    transform: translateX(-100%);
}

.nav-pending .nav-progress {
    visibility: visible;
    animation: nav-progress-reveal 0.2s linear 0.5s both;
}

.nav-pending .nav-progress::before {
    animation: nav-progress-slide 1.6s ease-in-out 0.5s infinite;
}

@keyframes nav-progress-reveal {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* The sliver is 40% of the window, so 250% of its own width is the far edge. */
@keyframes nav-progress-slide {
    from { transform: translateX(-100%); }
    to { transform: translateX(250%); }
}

.nav-status {
    position: fixed;
    top: calc(var(--topbar-height) + var(--space-3));
    left: 50%;
    z-index: 1300;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-md);
    font-size: var(--text-sm);
    white-space: nowrap;
    color: var(--color-on-primary);
    background: var(--color-primary);
    transform: translateX(-50%);
    pointer-events: none;
    visibility: hidden;
}

.nav-pending .nav-status {
    visibility: visible;
    animation: nav-progress-reveal 0.2s linear 2s both;
}

.nav-pending .nav-status-icon {
    animation: nav-status-spin 1.6s linear infinite;
}

@keyframes nav-status-spin {
    to { transform: rotate(360deg); }
}

/* Dismiss is for the endings no browser reports (see navprogress.js), so it is rarely needed — and it
   must not be a control someone can click or tab to while the note around it is still transparent.
   navprogress.js adds .nav-pending-long at the moment the note's own delay runs out. */
.nav-status .toast-close {
    visibility: hidden;
    /* A toast's close is 11px wide, which is no target for a thumb. The padding is the target; the
       negative margin gives the space back so the note does not grow around it. */
    padding: var(--space-2);
    margin: calc(var(--space-2) * -1) calc(var(--space-2) * -1) calc(var(--space-2) * -1) 0;
}

/* The same swap the header makes: the default deep-teal ring would vanish on this teal. */
.nav-status :focus-visible {
    outline-color: var(--color-accent);
}

.nav-pending-long .nav-status {
    pointer-events: auto;
}

.nav-pending-long .nav-status .toast-close {
    visibility: visible;
}

/* The global reduced-motion rule shortens every animation to nothing, which would turn an endless
   slide into a strobe. Here the sliver holds still in the middle of the track and the icon stops
   turning. Still a SLIVER, not a filled bar: lime alone is 1.4:1 against a white page, so it is the
   teal track either side of it that makes the bar visible once a phone has scrolled the header
   away. The two delays are left alone: waiting before appearing is not motion. */
@media (prefers-reduced-motion: reduce) {
    .nav-pending .nav-progress::before {
        left: 30%;
        transform: none;
        animation: none;
    }

    .nav-pending .nav-status-icon {
        animation: none;
    }
}

/* ============================================================================
   Combobox — picklist + free-text (plan §5, legacy applyPicklistToDetailsPicker).
   ============================================================================ */
.combobox {
    position: relative;
}

.combobox-hint {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
}

/* Absolute under the input is the layout with scripting off (where the list never opens anyway).
   combobox.js switches an OPEN list to position: fixed, measured from the input, so no scrolling
   ancestor can clip it — the dialog's body is one (board 469). Its GAP and MAX_HEIGHT mirror the
   margin and max-height here. */
.combobox-options {
    position: absolute;
    z-index: 1200;
    left: 0;
    right: 0;
    margin-top: var(--space-1);
    max-height: 15rem;
    overflow-y: auto;
    padding: var(--option-pad);
    background: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

/* An option's words start where they did before the list was padded (--option-pad). The global button:hover would fill it dark
   teal and lift it, so the hover is taken back here. */
.combobox-option {
    display: block;
    width: 100%;
    padding: var(--space-2) calc(var(--space-3) - var(--option-pad));
    border: 0;
    border-radius: var(--option-radius);
    background: none;
    text-align: left;
    cursor: pointer;
}

.combobox-option:hover,
.combobox-option.is-active {
    background: var(--color-option-hover);
    color: var(--color-ink);
    box-shadow: none;
    transform: none;
}

/* The arrow keys' row (combobox.js): the focus stays in the box being typed in, so the ring the keyboard follows is drawn here. */
.combobox-option.is-active {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

.combobox-option-primary {
    display: block;
    font-size: var(--text-sm);
    color: var(--color-ink);
}

.combobox-option-secondary {
    display: block;
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
}

/* An option's trailing text (board 500): a COA Category's base account type at the right end of the name's
   line, in the secondary line's muted ink, in italics and at regular weight (the button rule's 600 would make
   it barely lighter than the name), as QuickBooks Online lays out its account list. It never wraps beneath the
   name. WHAT GIVES WAY, IN ORDER, as the line narrows:
   1. The name wraps between words. Its shrink weight (1000 to the type's 1) puts all the shortfall on it, but
      its automatic minimum is its longest word, so it stops there. Bulk COA Mapping's 13rem tiles are where this
      matters: with the name free to shrink to nothing, "Entertainment" broke into "Entertainm" / "ent".
   2. Then the type ends in an ellipsis, down to 2rem. It never takes more than half the line in any case.
   3. Only a word wider than everything left then breaks: the name's max-width leaves the type its 2rem and the
      gap, and a flex item's automatic minimum is clamped by its max-width, so break-word can act there. Without
      that clamp the word would push the option wider than the list.
   space-between keeps the type at the right edge when the name stops at its max-width. Baseline-aligned, so
   beside a name that wraps the type sits on the name's first line. */
.combobox-option-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
}

.combobox-option-line .combobox-option-primary {
    flex: 1 1000 auto;
    max-width: calc(100% - 2rem - var(--space-3));
    overflow-wrap: break-word;
}

.combobox-option-trailing {
    flex: 0 1 auto;
    min-width: 2rem;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
    font-size: var(--text-xs);
    font-style: italic;
    font-weight: 400;
    color: var(--color-ink-muted);
}

.combobox-option-add .combobox-option-primary {
    color: var(--color-primary);
}

.combobox-empty,
.combobox-notice {
    margin: 0;
    padding: var(--space-2) calc(var(--space-3) - var(--option-pad));
    font-size: var(--text-sm);
    color: var(--color-ink-muted);
}

/* A line the handler says ABOVE the options (board 471: "this file already has a substitution for this
   account", over the accounts that do not). It reads as the empty message does, because it is the same kind
   of thing — the list speaking, not an option — and a rule parts it from the options it stands over. Only
   then: by itself it is the whole list, and the box's own border is enough. */
.combobox-notice:not(:last-child) {
    border-bottom: 1px solid var(--color-line);
}

/* ───────────────────────────────────────────────────────────── */
/*  EXCEL / ODATA ACCESS (ADR-007)                                */
/* ───────────────────────────────────────────────────────────── */

/* The one-time token reveal. Loud on purpose: this value cannot be recovered, so the moment must not
   read like an ordinary success message the user scrolls past. */
.token-reveal {
    margin: var(--space-4) 0;
    padding: var(--space-4);
    border: 1px solid var(--color-primary);
    border-left-width: 4px;
    border-radius: var(--radius-md);
    background: var(--color-surface-alt);
}

.token-reveal h2 {
    margin-top: 0;
}

/* Stacked: the token on its own line filling the box, the Copy button beneath it on the right. The
   flat row wrapped the 64-char token across two lines and left Copy floating beside the wrap. */
.token-secret {
    display: flex;
    flex-direction: column;
    align-items: flex-end;   /* the button sits at the right; the code overrides to full width below */
    gap: var(--space-3);
    margin-top: var(--space-3);
}

/* One line, filling the box — the .token-access page is widened so a 64-char token fits without
   wrapping. overflow-x:auto is the graceful floor on a genuinely narrow viewport: it SCROLLS rather
   than wraps, and the whole value stays selectable (user-select:all), so hand-copying still gets all
   64 characters — the property break-all preserved and ellipsis would have broken (see copy.js). */
.token-secret code {
    align-self: stretch;
    padding: var(--space-2) var(--space-3);
    background: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    white-space: nowrap;
    overflow-x: auto;
    user-select: all;
}

/* Feed addresses and sign-in details. Definition list rather than a table: these are labelled values,
   not rows, and they need to wrap on a phone without a horizontal scrollbar. */
.feed-urls {
    margin: var(--space-3) 0 var(--space-5);
}

.feed-urls dt {
    font-weight: 600;
    margin-top: var(--space-3);
}

.feed-urls dd {
    margin: var(--space-1) 0 0;
}

.feed-urls code {
    display: inline-block;
    max-width: 100%;
    padding: var(--space-1) var(--space-2);
    background: var(--color-surface-alt);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    word-break: break-all;
    user-select: all;
}

/* Destructive action (revoke). The first .button variant that needed one — hover darkens rather than
   lightens, matching the primary button's correction in the palette notes at the top of this file. */
.button.is-danger {
    background-color: var(--color-danger);
    border-color: var(--color-danger);
    color: var(--color-on-primary);
}

.button.is-danger:hover {
    background-color: var(--color-danger-hover);
    border-color: var(--color-danger-hover);
    color: var(--color-on-primary);
}

/* ───────────────────────────────────────────────────────────── */
/* Email preview harness (board 430, Development only).           */

/* The frame is sized to a phone-ish width because that is the narrowest real reading pane, and it is
   where a long link block first misbehaves. Its content is an isolated document (srcdoc), so nothing
   here can style the email itself — deliberately: a preview that inherits the app's CSS would lie. */
.email-preview-frame {
    display: block;
    width: 100%;
    max-width: 640px;
    height: 560px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    background: #ffffff;
}

.email-preview-text {
    margin-top: var(--space-3);
}

.email-preview-text summary {
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-primary);
}

.email-preview-text pre {
    margin: var(--space-2) 0 0;
    padding: var(--space-3);
    background: var(--color-surface-alt);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Background job status (board 445) ──────────────────────────────────────
   Where a refresh reports itself, on the import-status line rather than under it.

   The OUTER .job-status is a flex slot that absorbs the free space between .status-block and
   .status-actions and centres the chip in it. That placement is the whole point: .status-actions
   keeps `margin-left: auto`, so the buttons sit at the right edge in every state, and a message
   appearing does not move the control the user just pressed. flex-basis 0 + min-width 0 means the
   slot never demands more than the gap already offered, so a long message truncates instead of
   wrapping the actions onto a second line.

   It stays in the markup with no job because htmx swaps it BY ID and cannot target an element that
   is not there yet -- hence .is-empty rather than omitting it. */
.job-status {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* No job: no chip, and the line reads exactly as it did before the feature existed. */
.job-status.is-empty {
    display: none;
}

/* The chip sizes to its own text — a full-width tinted bar across the card would read as an alert
   rather than as a status. */
.job-status-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    max-width: 100%;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-pill);
    background-color: var(--color-surface-alt);
    border: 1px solid var(--color-line);
    font-size: 13px;
}

.job-status-chip.is-success {
    background-color: var(--color-success-bg);
    border-color: var(--color-success);
}

.job-status-chip.is-danger {
    background-color: var(--color-danger-bg);
    border-color: var(--color-danger);
}

.job-status-icon {
    color: var(--color-brand);
    flex-shrink: 0;
}

.job-status-chip.is-success .job-status-icon {
    color: var(--color-success-icon);
}

.job-status-chip.is-danger .job-status-icon {
    color: var(--color-danger);
}

/* An import that looks stuck (board 462): not starting, or no longer answering. Its icon stops turning too —
   a spinner says "working", which is the one thing this state cannot promise. */
.job-status-chip.is-warning {
    background-color: var(--color-warning-bg);
    border-color: var(--color-warning);
}

.job-status-chip.is-warning .job-status-icon {
    color: var(--color-warning);
}

.job-status-title {
    font-weight: 600;
    white-space: nowrap;
}

/* The half that gives if the gap is narrow. The title alone still says what is happening. */
.job-status-message {
    color: var(--color-ink-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Turns while the job is unfinished. Paused for anyone who has asked their OS to reduce motion --
   this spins for minutes at a time, which is exactly the duration that setting exists for. */
.job-status-icon.is-spinning {
    animation: job-status-spin 1.6s linear infinite;
}

@keyframes job-status-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .job-status-icon.is-spinning {
        animation: none;
    }
}

/* ── Error-row Review (board 447; one control since #592) ─────────────────────
   Every row's Review carries a glyph naming its destination: a screen in this app, or the notice for a
   check with none. No row has a second control any more: the icon-only Investigate in Reports beside
   it, and the column reserved for it on every row, went with the app's links into Logi's error-check
   reports. flex-shrink: 0 is load-bearing rather than tidy: .attention-row is a flex row whose text
   column will otherwise take the space back and squash the button into two lines. */
.row-review {
    flex-shrink: 0;
}

/* Narrow viewports drop the word and keep the glyph — the destination is still named, and a
   labelled button beside a long title is what would actually wrap. display: none rather than
   .visually-hidden, which is position: absolute and would leave the button sized for text that is
   no longer in flow. */
@media (max-width: 700px) {
    .row-action-label {
        display: none;
    }
}

/* Multi-select (plan §6.2, board 477) — the leading checkbox column and the selection banner.

   The column is the mirror of .grid-actions-cell at the other end of the row: a real column for
   layout, carrying one fixed-size control and nothing that grows. Its width is set on the <col> from
   GridViewModel.SelectionWidthPx — an absolute 40px rather than a share of the table, because the
   thing in it is 16px wide whether the grid has two columns or ten — so these rules only handle what
   goes INSIDE the cell. */
.grid-table th.grid-select-head,
.grid-table td.grid-select-cell {
    /* Centred, because a checkbox has no reading direction and a left-aligned one drifts away from
       the header box above it once the column is wider than the control. */
    text-align: center;
    /* The cells either side already carry the row's padding; doubling it here pushes the box off
       centre in a column this narrow. */
    padding-inline: 0;
}

.grid-table th.grid-select-head input[type="checkbox"],
.grid-table td.grid-select-cell input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--color-focus);
    cursor: pointer;
    /* vertical-align rather than flex: the cell is a table cell whose baseline would otherwise put
       the box a pixel or two below the row's text. */
    vertical-align: middle;
}


/* The banner states what a bulk verb will act on, from "0 rows selected" up: the server renders it at
   zero, so the first tick does not push the table down (board 476). Without scripting the layout's
   noscript style hides it. It sits between the toggles and the table so it reads as a property OF THE
   TABLE below it rather than as a page-level notice — the row set it describes is right underneath. */
.grid-selection {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-primary-soft);
    border-radius: var(--radius-sm);
    /* Tinted rather than plain: the banner states what a bulk verb will act on, and it has to be
       distinguishable from the ordinary chrome around it at a glance. */
    background: var(--color-surface);
    font-size: var(--text-sm);
}

.grid-selection-count {
    font-weight: 600;
    color: var(--color-ink);
}

/* Both verbs are plain text buttons, deliberately not styled as primary actions: the destructive
   thing on this screen is the bulk verb in the page's own form, and these two only change what it
   will be aimed at. Making them look like the commit button is how someone clicks the wrong one. */
.grid-selection-all,
.grid-selection-clear {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--color-primary);
    text-decoration: underline;
    cursor: pointer;
}

/* The background, shadow and lift undo the global button:hover, which outranks the class above and
   painted these two as solid buttons on hover (board 476). */
.grid-selection-all:hover,
.grid-selection-clear:hover {
    background: none;
    color: var(--color-ink);
    box-shadow: none;
    transform: none;
}

.grid-selection-all:focus-visible,
.grid-selection-clear:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Clear with nothing to clear: muted, and no longer dressed as a link. */
.grid-selection-clear[aria-disabled="true"] {
    color: var(--color-ink-muted);
    text-decoration: none;
    cursor: default;
}

/* The escalation, or the refusal in its place, while grid.js does not offer it: invisible, and so
   neither focusable nor clickable, but keeping its room, so the banner is the same height before and
   after the first tick, on a phone where the banner wraps as well (board 476). */
.grid-selection-all:not([data-offered]),
.grid-selection-capped:not([data-offered]) {
    visibility: hidden;
}

/* The refusal that stands in for the "select all N matching" escalation when the filtered set is
   bigger than the verb will accept. Muted rather than alarming: nothing has gone wrong, the user
   simply has to narrow first, and a red warning for a routine limit trains people to ignore red. */
.grid-selection-capped {
    color: var(--color-ink-muted);
}

/* A modal form hosted as a full page (board 458, ADR-011) — _FormPage and _ConfirmAction.

   The form partial inside is byte-identical to the one the modal shows; only the container differs.
   That is the point: one form, two containers, no second copy to drift. The overrides below undo the
   three things .modal-form does that only make sense inside a dialog.

   max-width tracks .modal-dialog's 520px default rather than the viewport, so a nine-field form does
   not become a nine-field form stretched across a 27-inch monitor. A partial that opted into
   .modal-form-wide keeps its wider ceiling here too. */
.form-page {
    max-width: 560px;
}

.form-page:has(.modal-form-wide) {
    max-width: 920px;
}

/* .modal-form is a flex column capped at the dialog's height so its body scrolls inside the dialog.
   On a page the document scrolls instead, and a cap would strand the actions below the fold. */
.form-page .modal-form {
    max-height: none;
}

.form-page .modal-form-body {
    overflow: visible;
}

/* The partial renders its own <h2>; the page renders an <h1> above it. Showing both is a stutter
   ("Class Name Mappings" / "Edit Class Name Mapping") only when they differ, and they usually do —
   so the h2 stays, and only its top margin is removed to close the gap the card already provides. */
.form-page-body .modal-form > h2 {
    margin-top: 0;
}

/* ---- A COA category's page (board 469) ------------------------------------
   The one editor ADR-011 puts on a PAGE. Two fields that are always in view — the name and the base
   account type — and seven sections that open one at a time (<details> sharing a name: the browser's
   own exclusive accordion, no script), under a toolbar that holds Save and Delete and stays put while
   the form scrolls (user, 2026-09-24: six sections laid out at once, with the buttons below them and
   the accounts grid below that, was "too large and unwieldy"). The form borrows the dialog's
   .modal-form classes for its fields and checkboxes, and undoes the two things that only make sense
   in a dialog — the height cap and the inner scroll. An open section is a tile grid, like the bulk
   mapping template, so its fields align whatever their labels say and re-flow to one column on a
   phone with nothing fixed-width to overflow. */
.category-crumb {
    margin: 0 0 var(--space-2);
    font-size: var(--text-sm);
}

/* A record page opened from another screen leads back to it first, then to its list (owner, 2026-11-17): two links
   side by side, not a trail, so a middle dot between them rather than Help's ›. */
.category-crumb .crumb-sep {
    margin: 0 var(--space-2);
    color: var(--color-ink-muted);
}

.category-form.modal-form {
    max-height: none;
    background: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
}

/* The toolbar: the name on the left, Delete and Save on the right. Sticky to the top of the shell's
   scroller while any of the form is on screen — a sticky box is confined to its parent, so it leaves
   with the form and never hovers over the accounts grid below. It is INSIDE the form, so Save is a plain
   submit and the Delete area keeps its own hx-target. */
.category-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    padding: var(--space-3) var(--space-5);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-line);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.category-head h1 {
    margin: 0;
    font-size: var(--text-xl);
    overflow-wrap: anywhere;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 2px var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-ink-muted);
    border: 1px solid var(--color-line);
    border-radius: 999px;
}

.category-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-left: auto;
}

/* The Delete area re-asks for itself after a Move or Delete of the accounts; its children stay the
   toolbar's own flex items. Delete is a text button in the danger colour, kept apart from Save by the gap. */
.category-delete {
    display: contents;
}

.category-actions .link-button.danger {
    background: none;
    border: 0;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    color: var(--color-danger);
    cursor: pointer;
    transition: var(--transition-fast);
}

.category-actions .link-button.danger:hover {
    background: var(--color-danger-bg);
}

.category-note {
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
}

.category-form .modal-form-body {
    overflow: visible;
}

.category-basic {
    margin-bottom: var(--space-4);
}

/* A section: a <details> whose <summary> is its header. One open at a time through the shared name,
   which the form omits on a 422 so every section with an error can be open together — ADR-011 §4's
   objection to tabs, answered on the form: the section opens itself, and its header says how many to
   fix. The marker is drawn here because the native one cannot sit inside a flex summary. */
.category-section,
.record-section {
    margin-bottom: var(--space-3);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
}

.category-section > summary,
.record-section > summary {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-ink);
    list-style: none;
    cursor: pointer;
    border-radius: var(--radius-md);
}

.category-section > summary::-webkit-details-marker,
.record-section > summary::-webkit-details-marker {
    display: none;
}

.category-section > summary::before,
.record-section > summary::before {
    content: '';
    flex-shrink: 0;
    width: .45em;
    height: .45em;
    margin: 0 var(--space-1) 0 2px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform .15s ease;
}

.category-section[open] > summary::before,
.record-section[open] > summary::before {
    transform: rotate(45deg);
}

.category-section[open] > summary,
.record-section[open] > summary {
    border-bottom: 1px solid var(--color-line);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.category-section > summary:hover,
.record-section > summary:hover {
    background: var(--color-surface);
}

.category-section > summary:focus-visible,
.record-section > summary:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

/* A <fieldset> so the grouping is in the accessibility tree (the legend is visually hidden; the summary
   already says it); the fieldset's own chrome is reset because the <details> draws the box. */
.category-section-body {
    margin: 0;
    padding: var(--space-4);
    border: 0;
    min-width: 0;
}

.category-flag {
    margin-left: auto;
    padding: 2px var(--space-2);
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: 600;
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

/* A line of fields keeps its inputs level whatever their labels say (owner, 2026-11-29). A client names its own groupings, so
   "2 - Managed Investments/Charity Obligations" wraps where "3 - LOC" beside it does not; its label grows upward from its
   input rather than pushing the input down.

   Each field is a subgrid of the grid's rows: its label, its input and each line under them (a hint, a note, a message)
   take rows shared with the fields beside it, and the label sits at the foot of the labels' row. Every item spans
   --field-tracks rows, more than a field holds, so the next line of fields starts below the tallest field; the rows a
   line does not use are empty and take no room. They are sized to their content (min-content): an item that is not a
   subgrid would span them all, and auto rows would share its height out with some to spare. Client settings' Include Fields
   picker is a subgrid too (.settings-picker, below). The rows have no gap, so each item's top margin is the space above its
   line of fields, and the grid's own negative margin takes it back above the first. */
.category-fields {
    --field-tracks: 8;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr));
    grid-auto-rows: min-content;
    gap: 0 var(--space-5);
    margin-top: calc(-1 * var(--space-3));
}

.category-fields > * {
    grid-row: span var(--field-tracks);
    margin-top: var(--space-3);
}

.category-fields > .field {
    margin-bottom: 0;
    min-width: 0;
}

/* Not a subgrid: a full-width field, alone on its line; a checkbox tile, whose box and text share a line (.category-check);
   and a fieldset, whose legend is not one of its grid items. */
.category-fields > .field:not(.category-wide, .category-check, fieldset) {
    display: grid;
    grid-template-rows: subgrid;
    align-items: start;
}

.category-fields > .field:not(.category-wide, .category-check, fieldset) > label:first-of-type {
    align-self: end;
}

/* Client settings' picker (.settings-picker: the report's Include Fields drop-down, drawn by _ReportMultiPick) takes part in the
   same rows (owner, 2026-12-03). It is not a .field, whose rules would restyle the drop-down's boxes, so it is a row subgrid of
   its own: the drop-down (.report-multi-pick, the partial's root) is a nested subgrid of the first two rows, its label at the
   foot of the labels' row and its button on the inputs' row, and the picker's hint and message take the rows under them, as a
   .field's do. The root's flex gap becomes the label's bottom margin, the .field label's, so the rows size alike. Hidden inputs
   draw no box, and the open panel is a popover in the top layer, so neither takes a cell. Scoped to the grid's own item: the
   same drop-down in a report's panel or filter bar is unchanged. */
.category-fields > .settings-picker {
    display: grid;
    grid-template-rows: subgrid;
    align-items: start;
    margin-bottom: 0;
}

.category-fields > .settings-picker > .report-multi-pick {
    display: grid;
    grid-row: span 2;
    grid-template-rows: subgrid;
    align-items: start;
    gap: 0;
}

.category-fields > .settings-picker > .report-multi-pick > .report-single-pick-label {
    align-self: end;
    margin-bottom: var(--space-1);
}

/* Its button is as tall as the selects beside it: a .field's input padding, where a report's panel has 6px. */
.category-fields > .settings-picker .report-single-pick-button {
    padding-block: var(--space-2);
}

.category-fields > .category-wide {
    grid-column: 1 / -1;
}

/* The fields' grid has no margin of its own (its first line's top margin is all the room above it), so give it room below,
   from the Issue code button; the two wide selects stop at a readable measure, not the width of the page. */
.importer-issue .category-fields {
    margin: 0 0 var(--space-4);
}

.importer-issue .category-wide select {
    max-width: 40rem;
}

/* The issue-an-enrolment-code form's "Installed" choice (owner, 2026-11-09): each radio to the LEFT of its text on one line,
   the two stacked. `.field input` would stretch a radio to 100% and centre it above its text, so this mirrors the checkbox
   fix (.modal-form .field label.checkbox-field): an inline row, a real 16px square. The fieldset loses its border and its
   legend reads as the other fields' labels. Its top margin is the grid's space above a line of fields (.category-fields > *). */
.importer-issue fieldset.choice-group {
    margin: var(--space-3) 0 0;
    border: 0;
    padding: 0;
    min-width: 0;
}

.importer-issue .choice-group legend {
    padding: 0;
    margin-bottom: var(--space-1);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-ink);
}

.importer-issue .field label.choice-field {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: var(--space-2);
    margin-bottom: var(--space-1);
    font-weight: 400;
    cursor: pointer;
}

.importer-issue .field .choice-field input[type="radio"] {
    flex: none;
    width: 16px;
    height: 16px;
    padding: 0;
    margin: calc((1.5em - 16px) / 2) 0 0; /* level with the first line of a wrapped choice: line-height 1.5, the input in the label's font */
    accent-color: var(--color-primary);
    cursor: pointer;
}

/* A region the server draws again, whole (the investment's identity, board 483), as a full-width item of the editor's
   grid: the grid's gap is its spacing, so neither the region nor its last field carries a margin of its own
   (.modal-form .field-region, above, is for the dialog it also sits in). A grid item is its own formatting context, so
   the last field's margin would not collapse into the region's, and would add itself to the gap. */
.category-fields > .field-region,
.category-fields > .field-region > .field:last-of-type {
    margin-bottom: 0;
}

/* A checkbox tile sits level with the inputs beside it rather than floating at the top of its row. */
.category-fields > .category-check {
    align-self: end;
}

/* A checkbox's explanation runs on AFTER its label rather than under it — the muted small text is what
   tells them apart (user, 2026-09-24: a long one under the box was wrapping into a column of lines). The
   .field is a flex row with the label and the help as its items, and the two TEXTS share one BASELINE,
   the rule for runs of text of different sizes: centring their boxes instead put the 14px label and the
   12px description on baselines a pixel apart, which read as floating (user, same day, twice). The
   label is itself an inline-flex box whose first item is the checkbox, and a flex box's baseline comes
   from its first item unless one of its items is baseline-aligned — so the label aligns its own items
   by baseline, its text carrying the baseline out to the row, while the checkbox opts out of that to
   sit centred on the text. The help takes the rest of the row and wraps inside it, so it always starts
   beside the label; a validation message drops to its own line. */
.category-check {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 var(--space-2);
}

.modal-form .field.category-check label.checkbox-field {
    align-items: baseline;
}

.category-check .checkbox-field input[type="checkbox"] {
    align-self: center;
}

.category-check .field-help {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
}

.category-check .validation-message {
    flex-basis: 100%;
}

/* The eleven report-treatment flags in three groups (user, 2026-12-03), each a fieldset under a bold header, its
   legend. The fieldset's chrome is reset as the section body's is, and a group after the first has space above it. */
.category-treatment-group {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.category-treatment-group + .category-treatment-group {
    margin-top: var(--space-4);
}

.category-treatment-group > legend {
    padding: 0;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-ink);
}

/* One to a line with what each does beside it. */
.category-treatments {
    display: grid;
    gap: var(--space-2);
}

.category-treatments > .field {
    margin-bottom: 0;
}

.category-form textarea {
    width: 100%;
    font: inherit;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    resize: vertical;
}

.category-form .field-label {
    display: block;
    font-weight: 600;
    font-size: var(--text-sm);
    margin-bottom: var(--space-1);
}

.category-readonly {
    margin: 0;
    padding: var(--space-2) var(--space-3);
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: var(--text-sm);
    overflow-wrap: anywhere;
    background: var(--color-surface);
    border-radius: var(--radius-sm);
}

/* A record page's related lists (board 488, _RecordSection): each a <details> below the editor that loads its grid
   the first time it is opened. The box, the summary and the marker are the editor's own sections' (.category-section,
   above, which shares those rules), so the page reads as one thing; any number can be open at once. A #section-{view}
   address lands the section clear of the top edge. COA Category's accounts are the same box, with the grid rendered
   inline instead of loaded. */
.record-sections {
    margin-top: var(--space-6);
}

.record-section {
    scroll-margin-top: var(--space-4);
}

.record-section-count {
    font-weight: 400;
    color: var(--color-ink-muted);
}

.record-section-body {
    padding: var(--space-4);
    min-width: 0;
}

/* "Loading…" only while the section's own request is out: htmx puts .htmx-request on the <details> that sent it. The
   display rules hold the line's space back the rest of the time, which htmx's own opacity rule would not. */
.record-section .record-section-loading {
    display: none;
    margin: 0 0 var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-ink-muted);
}

.record-section.htmx-request .record-section-loading {
    display: block;
}

.record-section-own {
    margin: var(--space-3) 0 0;
    font-size: var(--text-sm);
}

/* A list not built yet: a muted row with no control in it, in the place its section will take. */
.record-section-unbuilt {
    margin: 0 0 var(--space-3);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--color-ink-muted);
    border: 1px dashed var(--color-line);
    border-radius: var(--radius-md);
}

/* ---- The user directory (board 498) ------------------------------------------------------------ */

/* A person's facts under the user page's toolbar: a label over each value, in tiles that re-flow to one column on a
   phone, with nothing fixed-width to overflow. */
.staff-facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: var(--space-3) var(--space-5);
    margin: 0;
}

.staff-facts dt {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-ink-muted);
}

.staff-facts dd {
    margin: var(--space-1) 0 0;
    overflow-wrap: anywhere;
}


/* ---- Importer status (importer plan S6) ---------------------------------------------------------- */

/* A run's log tail, text the installation sent: wrapped, scrolling past a screenful, in the page's own box style. */
.importer-log-tail {
    max-height: 32rem;
    margin: var(--space-2) 0 0;
    padding: var(--space-3);
    overflow: auto;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    white-space: pre-wrap;
    word-break: break-word;
}

/* The home card's importer line sits under "Last processed" in the status block's muted voice. */
.status-sub.importer-line a {
    color: inherit;
}

/* ---- The client monitor (board 585, L3-B2) ----------------------------------------------------- */

/* A grid page's width from the start: its grids load into the panels after the page draws. */
main:has(.client-monitor) {
    max-width: 120rem;
}

/* The page's options, as a report's filter bar draws its fields (the owner, 2026-11-25): Leave out (the reports' multi-pick), the
   hours (a report's number box, its label beside it as the bar's labels are), Apply and Revert, in a box of their own. Import Errors'
   Old files has its days over its grid the same way (board 591). */
.client-monitor-options,
.import-errors-days {
    margin: 0 0 var(--space-4);
    padding: var(--space-2) var(--space-4);
    background: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
}

.client-monitor-options .report-option-spinner,
.import-errors-days .report-option-spinner {
    flex-direction: row;
    align-items: center;
    gap: var(--space-2);
}

.client-monitor-options .report-option-spinner > label,
.import-errors-days .report-option-spinner > label {
    color: var(--color-ink-muted);
    font-weight: 400;
    white-space: nowrap;
}

.client-monitor-options .report-option-spinner input[type="number"],
.import-errors-days .report-option-spinner input[type="number"] {
    padding: 4px var(--space-2);
}

/* Import Errors' grids (board 591; the owner, 2026-11-26). Their cells are cut short with an ellipsis where they do not fit, not wrapped, but a date
   can still wrap and a badge can stand beside a value, so every cell sits at the top, Failures with the rest, rather than a one-line
   cell in the middle of a taller row.
   And a table widened past its section's box by dragging a column scrolls sideways inside the box, rather than running out over
   its border: the grid's own scroller keeps its overflow from 901px too, where it otherwise gives it to the page (.grid-scroll). */
.import-errors-list .grid-table td {
    vertical-align: top;
}

@media (min-width: 901px) {
    .import-errors-list .grid-scroll {
        overflow-x: auto;
    }

    .import-errors-list .grid-scroll.is-sized {
        width: auto;
    }
}

/* The four tiles are the tabs: the tab's name, its count, what the count is. */
.client-monitor-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-3);
    margin: 0 0 var(--space-4);
}

.client-monitor-tile {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-4);
    color: var(--color-ink);
    text-decoration: none;
    background: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.client-monitor-tile:hover {
    background: var(--color-surface);
}

.client-monitor-tile[aria-selected="true"] {
    background: var(--color-surface-alt);
    outline: 2px solid var(--color-primary);
    outline-offset: -1px;
}

.client-monitor-tile-name {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--teal-700);
}

.client-monitor-tile-count {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
}

.client-monitor-tile-number {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.client-monitor-tile-text {
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
}

.client-monitor-tile-count.is-danger .client-monitor-tile-number {
    color: var(--color-danger);
}

.client-monitor-tile-count.is-warning .client-monitor-tile-number {
    color: var(--color-warning);
}

.client-monitor-tile-count.is-good .client-monitor-tile-number {
    color: var(--color-success);
}

.client-monitor-tile-count.is-counting .client-monitor-tile-number {
    color: var(--color-ink-muted);
}

.client-monitor-reading {
    color: var(--color-ink-muted);
    font-size: var(--text-sm);
}

/* Error counts' Tracked / Not tracked switch, two links drawn as one control. */
.client-monitor-kind {
    display: inline-flex;
    margin: 0 0 var(--space-3);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.client-monitor-kind a {
    padding: var(--space-1) var(--space-4);
    color: var(--color-ink-muted);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    background: var(--color-bg);
}

.client-monitor-kind a[aria-pressed="true"] {
    color: var(--color-on-primary);
    background: var(--color-primary);
}

@media (max-width: 700px) {
    .client-monitor-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---- The Client settings page (board 495) ------------------------------------------------------ */

/* General's fields, at the top in no box (user, 2026-10-29): the fieldset's chrome is reset, its legend for screen readers. */
.settings-general {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

/* The other groups are COA Category's sections (.record-section), open on arrival. An address that names one
   (#section-names, where the auto-map messages land), or General, is scrolled clear of the sticky toolbar rather than
   under it. */
.settings-general,
.settings-section {
    scroll-margin-top: 5rem;
}

/* A section's body is a fieldset, as COA Category's is (.category-section-body): the details draws the box. */
.settings-section-body {
    margin: 0;
    border: 0;
}

.settings-notice p {
    margin: 0;
}

.settings-notice p + p {
    margin-top: var(--space-2);
}

/* The Error checks section, inside the form after the groups: landed on (#section-checks, the home card's link) clear of
   the sticky toolbar, as the groups are. */
.settings-checks-section {
    scroll-margin-top: 5rem;
}

/* Its list: a check a line, in the catalogue's order down each column, two columns where the page is wide. The fieldset's
   own chrome is reset: the section's box draws it. */
.settings-checks {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
    columns: 2 24rem;
    column-gap: var(--space-6);
}

.settings-check {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 var(--space-2);
    padding: 3px 0;
    break-inside: avoid;
    font-size: var(--text-sm);
}

.settings-check label {
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-2);
    cursor: pointer;
}

.settings-check input[type="checkbox"] {
    align-self: center;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.settings-check .row-tag.is-outline {
    margin-left: 0;
}

/* ---- Bulk-edit import (plan §5, task 25) --------------------------------- */

/* The import section of the actions menu, under its own heading like the column chooser: its rule across the menu, its rows
   padded back in. */
.grid-menu-import {
    margin: var(--space-2) calc(-1 * var(--option-pad)) 0;
    padding: var(--space-2) var(--option-pad) 0;
    border-top: 1px solid var(--color-line);
}

/* The file input is the control; the label is what it looks like — and the label is styled by the
   same rule as the menu's links (see .grid-menu-content a) so it cannot drift from them. Hiding the
   input with position/opacity rather than display:none keeps it focusable, so the keyboard path is
   the same control the mouse uses. */
.grid-import input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.grid-import:focus-within {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

/* Dragging a file over the grid. An inset outline, not a border or padding: it must not change the
   grid's size, or the page shifts under a cursor that is mid-drag. */
.grid-drop-target {
    outline: 2px dashed var(--color-accent);
    outline-offset: -4px;
    background-color: var(--color-surface-alt);
}

.grid-import-report:empty {
    display: none;
}

/* An upload status while its job runs (board 462): the job chip of the home page, in the report region
   ABOVE the grid, in view from the gear menu that started the upload however long the table is. */
.grid-import-status {
    margin-top: var(--space-3);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

/* What grid.js says when polls stop getting through, or once it has stopped asking. */
.grid-import-status-note {
    color: var(--color-ink-muted);
}

/* How long the import has waited or run (board 462). Tabular figures, so the number ticking every two
   seconds does not jiggle the chip; never wrapped away from the message it qualifies. */
.job-status-elapsed {
    color: var(--color-ink-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

/* What to make of a long wait (board 462). A line of its own under the chip, small and muted, because this
   region sits ABOVE the grid: every line it grows pushes the table down, so the sentences are kept short. */
.grid-import-status-advice {
    flex-basis: 100%;
    margin: 0;
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
}

/* Which upload a report is about (board 462): an outcome can arrive after the user has come back. */
.import-report-source {
    margin-top: 0;
}

.import-report {
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    margin-top: var(--space-3);
}

.import-report h2 {
    margin-top: 0;
}

.import-report-rows {
    width: 100%;
    border-collapse: collapse;
}

.import-report-rows caption {
    text-align: left;
    padding-bottom: var(--space-2);
}

.import-report-rows th,
.import-report-rows td {
    text-align: left;
    padding: var(--space-1) var(--space-2);
    border-bottom: 1px solid var(--color-line);
    vertical-align: top;
}

/* The row number is what the user scrolls to in Excel, so it reads as a number rather than prose. */
.import-report-rows td:first-child {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ── Indented hierarchy column (board 464) ───────────────────────────────────────────────────────
   The Master COA browse draws its tree by indentation alone: no glyphs, no expand/collapse. The
   depth arrives as data-indent on the one column that declared Indented(), and these rules turn it
   into left padding on top of the cell's own.

   Written as one rule per level rather than an inline style because a level is a small closed set —
   the deepest chart measured across 141 clients is six — and because the indent then belongs to the
   stylesheet like every other spacing decision in this file. A row deeper than the last rule simply
   stops indenting further; it does not fall back to zero, which would read as a root. */
.grid-table td.is-indented[data-indent="1"] { padding-left: calc(var(--space-3) + 20px); }
.grid-table td.is-indented[data-indent="2"] { padding-left: calc(var(--space-3) + 40px); }
.grid-table td.is-indented[data-indent="3"] { padding-left: calc(var(--space-3) + 60px); }
.grid-table td.is-indented[data-indent="4"] { padding-left: calc(var(--space-3) + 80px); }
.grid-table td.is-indented[data-indent="5"] { padding-left: calc(var(--space-3) + 100px); }
.grid-table td.is-indented[data-indent="6"] { padding-left: calc(var(--space-3) + 120px); }
.grid-table td.is-indented[data-indent="7"] { padding-left: calc(var(--space-3) + 140px); }
.grid-table td.is-indented[data-indent="8"] { padding-left: calc(var(--space-3) + 160px); }

/* ── Tree grids (board 492, the Ownership Graph) ─────────────────────────────────────────────────
   A grid that declares a tree draws it in its one Indented() column: each line a chevron (or a leaf dot), the
   cell's icon and its name, padded 20px a level by --grid-depth, which _Grid.cshtml writes as a style because a
   tree's depth is not a small closed set (unlike data-indent's eight rules above). The connector lines are the cell's
   own background, so a deep line costs no extra elements. Mockup A's treatment (artifacts/mockups/ownership-graph),
   scoped under .grid-table throughout: is-root and is-leaf alone are generic names.

   THE DRAWN INDENT STOPS AT 12 LEVELS (second review): min(--grid-depth, 12) here and in the guides and the elbow
   below. Uncapped, a line 27 levels down started past a 590px column at 1280px wide and showed only guides, and the
   Ownership Graph's line 50 down, which says it is too deep to open there, was never visible at all. A line deeper
   than 12 draws at the twelfth's indent, and its level words still give its depth to a screen reader; QA's deepest
   tree is 8 levels. */
.grid-table td.grid-tree-cell {
    padding-left: calc(var(--space-3) + min(var(--grid-depth, 0), 12) * 20px);
}

/* The table holds the words only a screen reader reads, a line's level and an icon's meaning (grid review M2). They are
   absolutely positioned, as .visually-hidden is everywhere, and with nothing positioned nearer than the page each one
   deep in a long tree pushed the page's own scroll extent past the shell, which grew a second scrollbar beside the
   content column's (measured at 1280x800 after Expand all: 705px became 2,497). Not a stacking context: no z-index. */
.grid-table.is-tree {
    position: relative;
}

/* So is a list's table whose icons say in words what they stand for (IconBy with a label; second review): a column
   feature any grid can declare, whose words would otherwise escape the table and stretch the page, as the row-action
   labels once did (see .grid-row-action-label). _Grid.cshtml writes has-icon-labels when a column declares them; no
   list does today. */
.grid-table.has-icon-labels {
    position: relative;
}

/* The guides and the elbow, below the top level:
   - the guides: a 1px line under each ancestor's chevron, as many as the line is deep, the full row height, so
     consecutive rows join into one line per level;
   - the elbow: from the parent's guide into this line's chevron, level with the first line of text (8px of
     padding plus half the 21px line). */
.grid-table tr.grid-tree-row:not(.is-root) > td.grid-tree-cell {
    background-image: linear-gradient(var(--color-line), var(--color-line)),
        repeating-linear-gradient(to right, transparent 0 9px, var(--color-line) 9px 10px, transparent 10px 20px);
    background-position: calc(var(--space-3) + (min(var(--grid-depth, 1), 12) - 1) * 20px + 10px) 18px, var(--space-3) 0;
    background-size: 10px 1px, calc(min(var(--grid-depth, 0), 12) * 20px) 100%;
    background-repeat: no-repeat;
}

/* The chevron: a real submit button, quiet, so every property the generic button and its :hover set (a primary
   fill, white text, a shadow and a lift) is restated here for both states. The subset declares only
   fa-chevron-down, so a closed line is that glyph turned to point right, as the rail turns its own.
   The negative block margin keeps the 20px target out of the line box's height: centred on the text, it reached 1.5px
   below the 21px line and made every tree row taller than every other grid's (measured 39.5px against 38). */
.grid-table .grid-tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 20px;
    height: 20px;
    margin-block: -3px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-ink-muted);
    font-size: 11px;
    line-height: 1;
    vertical-align: middle;
    box-shadow: none;
    transform: none;
}

.grid-table .grid-tree-toggle:hover {
    border: 0;
    background: var(--color-line);
    color: var(--color-primary-hover);
    box-shadow: none;
    transform: none;
}

.grid-table .grid-tree-toggle .fas {
    transform: rotate(-90deg);
}

.grid-table .grid-tree-toggle[aria-expanded="true"] .fas {
    transform: none;
}

/* A line that cannot open has a dot where the chevron would be, in the chevron's 20px, so every name in the column
   starts at the same indent whether or not its line opens. */
.grid-table .grid-tree-leaf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-block: -3px;
    vertical-align: middle;
}

.grid-table .grid-tree-leaf::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--color-primary-soft);
}

/* The name reads as a name: in the cell's ink rather than link teal, the hover underline saying it is a link (the
   mockup's choice). inherit, not a colour of its own, so a flagged loop line's name keeps the flag's amber. */
.grid-table td.grid-tree-cell a {
    color: inherit;
    text-decoration: none;
}

.grid-table td.grid-tree-cell a:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

.grid-table tr.grid-tree-row.is-leaf > td.grid-tree-cell:not(.is-flagged) {
    color: var(--color-ink-muted);
}

/* A search match: semibold as well as the <mark>, whose tint alone is too faint to find among the lines shown above
   the matches. */
.grid-table tr.grid-tree-row.is-hit > td.grid-tree-cell {
    font-weight: 600;
}

/* Help's search snippets mark a match the same way (.help-snippet mark): one look for a search match. */
.grid-table mark {
    padding: 0 1px;
    border-radius: 2px;
    background: var(--color-warning-bg);
    color: inherit;
}

/* The top level: a light band across the row, the name bold. */
.grid-table tr.grid-tree-row.is-root > td {
    background-color: var(--color-surface);
}

.grid-table tr.grid-tree-row.is-root:hover > td {
    background-color: var(--color-surface-alt);
}

.grid-table tr.grid-tree-row.is-root > td.grid-tree-cell {
    font-weight: 700;
}

/* ...and sticky under the header, as one band per top line, where the two lines of every top line fit: at 1200px and
   wider (second review). The header sticks from 901px, where .grid-scroll stops being a scroller and both stick
   against the content column, so a line deep in a long tree still says whose share its numbers are. Narrower, the
   header scrolls away with the page, and so does the band.

   WHY 1200: a band is two lines cut with an ellipsis, so a top line's badges have to fit its second line, or they go:
   the loop pill and the limit pill, which is the only thing that says why that tree's Effective shows "—". The tree
   column is the table less its 384px of fixed columns, and the seed's widest second lines (the three members of its
   Ivy Lane loop) all fit from 1,191px of viewport, rounded up to 1200 (measured in headless Chrome, 2026-10-29: Kestrel
   Partners' loop pill ends at its cell's edge at 1,191px, 9px inside it at 1200). Below it, from 901 to 1199px (a
   1366px laptop at 125%, a 1920px screen at 200%), a top line wraps instead, as every tree cell does, and only the
   header sticks: see the wrap block below.

   EVERY BAND IS ONE HEIGHT, two lines (grid review M3), because a sticky cell is held by the table, not by its own
   subtree: each band stays stuck to the table's end, and the next one paints over it. Bands of different heights left
   the bottom of a taller one showing under a shorter one, where it read as the wrong investor's loop. So the name is
   line one and the detail and badges line two, each cut with an ellipsis at the column's edge rather than wrapping,
   and a top line with no detail is as high as one with: a cell's height is its least. The two lines and the padding,
   and the cell's halves of the two collapsed 1px rules; measured 59px in Chrome, every band alike.

   A top line's badge is inline here, not inline-block, so a pill that does not fit is cut by the ellipsis inside
   itself instead of vanishing whole (an atomic inline that overflows is hidden, not cut). It keeps its border, padding
   and fill; padding-block gives the inline box the height the inline-block had, and an inline's padding never makes
   the line taller, so the band stays 59px.

   The band is tucked 1px under the header, and the header is the layer above it (z-index 2). The header row is 37.5px
   (measured): the line (14px at 1.5), 8px of padding either side, and its half of the collapsed 1px rule; `top` is that
   from the same parts, less 1px. At the header's own height the band left a 1px row between the header's rule and its
   own top, through which the lines scrolling under showed (measured at 1280x800, scrolled 900); tucked under, the
   header's rule is the band's top edge at any scale. The header being the layer above also keeps a header taller than
   its rem-based height, under a browser's minimum font size, from being painted over by the band below it.

   And focus that moves onto a line under the header and a band scrolls clear of both (grid review M4, WCAG 2.4.11):
   the content column is the scroller here, and its scroll padding is the band's `top` plus one band, so the browser
   counts that strip as out of view. Only on a page with a tree: a list's header case is older, and separate. */
@media (min-width: 1200px) {
    .grid-table tr.grid-tree-row.is-root > td {
        position: sticky;
        top: calc(1.5 * var(--text-sm) + 2 * var(--space-2) - 0.5px);
        z-index: 1;
        box-shadow: inset 0 -1px 0 var(--color-line);
    }

    .grid-table tr.grid-tree-row.is-root > td.grid-tree-cell {
        height: calc(3 * var(--text-sm) + 2 * var(--space-2) + 1px);
        white-space: nowrap;
    }

    .grid-table tr.grid-tree-row.is-root > td.grid-tree-cell > .grid-cell-detail::before {
        content: "\A";
        white-space: pre;
    }

    .grid-table tr.grid-tree-row.is-root > td.grid-tree-cell > .grid-cell-badge {
        display: inline;
        padding-block: 1px;
    }

    .grid-table.is-tree thead th {
        z-index: 2;
    }

    .app-main:has(.grid-table.is-tree) {
        scroll-padding-top: calc(4.5 * var(--text-sm) + 4 * var(--space-2) + 0.5px);
    }
}

/* Below the band's width a tree's cells wrap rather than being cut (second review), top lines included, so a pill that
   does not fit goes onto another line instead of behind an ellipsis: names, details and badges, a pill wrapping inside
   itself when a loop's names outgrow the column, and every cell top-aligned so the figures stay level with a name's
   first line (mockup A's narrow treatment). Nothing sticks here but the header, so a top line can be as tall as it
   needs. Generic, so any tree page gets it.

   1199.98px, not 1199px (third review): a media query matches the viewport's fractional width, which a zoom makes
   (1,499 device pixels at 125% is 1,199.2px), and between 1199 and 1200 neither this block nor the band's applied: top
   lines on one cut line, their pills hidden whole, and no scroll padding. So every block below the band's width stops
   at 1199.98px. */
@media (max-width: 1199.98px) {
    .grid-table.is-tree td {
        vertical-align: top;
    }

    .grid-table.is-tree td.grid-tree-cell {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .grid-table.is-tree .grid-cell-badge {
        white-space: normal;
    }
}

/* From 901 to 1199px the header still sticks, with no band under it, so focus scrolls clear of the header alone: the
   header row's height, from the same parts as the band's `top`. */
@media (min-width: 901px) and (max-width: 1199.98px) {
    .app-main:has(.grid-table.is-tree) {
        scroll-padding-top: calc(1.5 * var(--text-sm) + 2 * var(--space-2) + 0.5px);
    }
}

/* Expand all and Collapse all: .grid-icon-button (shaped like the gear, and quiet on hover: it restates the
   background, border, colour, shadow and transform the generic button:hover sets), widened for a word, in the teal
   of the app's text actions. */
.grid-header .grid-icon-button.grid-tree-tool {
    width: auto;
    padding: 0 var(--space-3);
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    color: var(--color-primary);
}

/* A tree's footer notes: where the walk or the search stopped short. */
.grid-tree-note {
    color: var(--color-ink-muted);
    font-size: var(--text-xs);
}

/* ── Cell icons, details and badges (board 492) ──────────────────────────────────────────────────
   Generic: any grid's column can declare them (GridColumnBuilder.IconBy, DetailBy, BadgesBy). Each sits inline in
   the cell, separated from the name by a real space in the markup and a little margin here, so a fixed-layout cell
   still ellipsizes them at its edge rather than wrapping. */
.grid-table .grid-cell-icon {
    display: inline-block;
    width: 18px;
    margin-right: var(--space-1);
    text-align: center;
    font-size: 13px;
    color: var(--color-brand);
}

/* A flagged cell's icon takes the flag's amber: a loop line's fa-repeat says the line is the warning. */
.grid-table td.is-flagged .grid-cell-icon {
    color: inherit;
}

.grid-table .grid-cell-detail {
    margin-left: var(--space-1);
    color: var(--color-ink-muted);
    font-size: var(--text-xs);
    font-weight: 400;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* A detail beneath the value (board 589, the owner's L3-Q24): what the value becomes once a GL detail mapping applies, marked → in the
   warning's amber, as Logi's report drew it in yellow under the cell; or a note about the row, in italics. Its own line, which ends in an
   ellipsis where the column is too narrow, as the value above it does: columns do not wrap (the owner, 2026-11-26). A screen reader
   hears "becomes" for the arrow. */
.grid-table .grid-cell-detail.is-becomes,
.grid-table .grid-cell-detail.is-note {
    display: block;
    margin-left: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A page whose grid's rows may run to two lines (board 589: Old Detail Mappings' detail beneath a value) sets every cell at the top of
   its row, rather than a one-line cell in the middle of a tall row (the owner, 2026-11-26), as Import Errors' grids do. */
.grid-cells-top .grid-table td {
    vertical-align: top;
}

.grid-table .grid-cell-detail.is-becomes {
    color: var(--color-warning);
}

.grid-table .grid-cell-detail.is-becomes::before {
    content: "\2192\00a0" / "becomes ";
}

.grid-table .grid-cell-detail.is-note {
    font-style: italic;
}

/* A detail that is a link (GridColumnBuilder.DetailBy with an href, docs review W1) reads as one: the link teal,
   underlined, wherever it sits, a tree cell's ink-coloured names included, so where it leads is never a hover away. */
.grid-table td a.grid-cell-detail[href] {
    color: var(--color-primary);
    text-decoration: underline;
}

.grid-table td a.grid-cell-detail[href]:hover {
    color: var(--color-primary-hover);
}

/* No taller than the text line and top-aligned, so a badge never makes its row taller. */
.grid-table .grid-cell-badge {
    display: inline-block;
    margin-left: var(--space-1);
    padding: 0 var(--space-2);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-pill);
    color: var(--color-ink-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    white-space: nowrap;
    vertical-align: top;
}

.grid-table .grid-cell-badge.is-warning {
    border-color: transparent;
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

/* ── The Ownership Graph (board 492) ─────────────────────────────────────────────────────────────
   The eye's focus, under the lead: the tree now starts from one node and every figure on it is that node's share, so
   the line that says so is set off as a page notice is, where it is not read past. */
.og-focus {
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-line);
    border-left: 3px solid var(--color-brand);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    font-size: var(--text-sm);
}

/* Below the rail's breakpoint .grid-scroll scrolls sideways, so the table keeps a width the tree can be read at: the
   three figure columns and the eye are 384px of fixed width, and without a floor the names got what was left of a
   phone, which was nothing. The names wrap there, as every tree's do below the band's width (the tree block above).
   Only there (third review): from 901px the grid's card does not widen with a table wider than the column unless its
   columns were resized (.grid-scroll.is-sized, board 446), so a floor would push the table past the card's edge and
   scroll the whole column sideways. From 901 to about 980px the names' column is narrow instead, a known limitation
   (the M5 inventory). */
@media (max-width: 900px) {
    .og-graph .grid-table {
        min-width: 680px;
    }
}

/* On a phone the tree's two header buttons leave the search box a sliver beside them (measured at 400px), so the box
   takes a line of its own and the buttons go under it, as mockup A lays them out. */
@media (max-width: 520px) {
    .og-graph .grid-search {
        flex: 1 1 100%;
    }

    .og-graph .grid-search-field {
        width: 100%;
    }
}

/* ============================================================================
   Journal entries (board 504, M6's D29): the lines editor, QuickBooks' ruled table inside the entry's one form. Every cell
   is a borderless input that fills its cell, the focus a ring inside it; the totals bar stays at the bottom of the window
   while the lines run past it. On a phone the rows stack, each cell under its own label.
   ============================================================================ */
/* A track of 18rem, not the fields' usual 16rem, so the cell of the two boxes always has room for both side by side. */
.journal-entry-fields {
    grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr));
    margin-bottom: var(--space-5);
}

/* Allow out of balance and Ignore errors share one cell, side by side (owner, 2026-11-30: "next to the allow out of
   balance"), each a field of its own, so its help and its note stay under its box. They share the cell's width, each never
   narrower than its label, and its help wraps within its half. */
.journal-entry-checks {
    display: flex;
    flex-wrap: wrap;
    column-gap: var(--space-5);
    min-width: 0;
}

.journal-entry-checks > .field {
    flex: 1 1 0;
    margin-bottom: 0;
}

.journal-entry-checks .checkbox-field > span {
    white-space: nowrap;
}

/* Each box laid out as the fields beside it are (user, 2026-11-03: "the checkbox is center aligned and the help text is
   top aligned"): an empty line the height of their labels, then a row as tall as their inputs (the same padding, border
   and line) with the box centred in it, then the help, which starts level with theirs. */
.journal-entry-check-spacer {
    display: block;
    margin-bottom: var(--space-1);
    font-size: var(--text-sm);
    font-weight: 600;
}

.journal-entry-check-control {
    display: flex;
    align-items: center;
    padding: var(--space-2) 0;
    border: 1px solid transparent;
    font-size: var(--text-sm);
    line-height: 1.5;
}

.lines-note {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-warning);
}

.lines-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: var(--text-sm);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
}

/* The map and trash icons, a gap between them so a click meant for one does not land on the other (owner, 2026-12-04). */
.lines-col-remove {
    width: 5.75rem;
}

.lines-col-account {
    width: 36%;
}

.lines-col-amount {
    width: 9.5rem;
}

.lines-table th {
    padding: var(--space-2) var(--space-3);
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    background: var(--color-table-header);
    border-right: 1px solid rgba(255, 255, 255, .5);
}

.lines-table thead th:first-child {
    border-radius: var(--radius-md) 0 0 0;
}

.lines-table thead th:last-child {
    border-right: 0;
    border-radius: 0 var(--radius-md) 0 0;
}

.lines-table .is-numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.lines-table tbody td {
    padding: 0;
    vertical-align: top;
    border-right: 1px solid var(--color-line);
    border-bottom: 1px solid var(--color-line);
}

.lines-table tbody td:last-child {
    border-right: 0;
}

.lines-table tbody tr:hover td {
    background: var(--color-surface);
}

.modal-form .lines-table .field.lines-cell {
    margin: 0;
}

/* The cells' inputs, the account's picker among them: borderless, filling the cell, a ring inside it on focus. More specific
   than `.modal-form .field input`, which boxes every other field. */
.modal-form .lines-table .field input[type="text"] {
    min-height: 40px;
    padding: 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.modal-form .lines-table .field input[type="text"]:focus {
    box-shadow: inset 0 0 0 2px var(--color-focus);
    background: var(--color-bg);
}

.modal-form .lines-table .field input[aria-invalid="true"] {
    box-shadow: inset 0 0 0 2px var(--color-danger);
}

.lines-table input.lines-amount {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.modal-form .lines-table .validation-message,
.lines-table .lines-note,
.lines-account-notice {
    margin: 0 var(--space-2) var(--space-2);
}

.lines-account-notice {
    display: flex;
    gap: var(--space-1);
    align-items: baseline;
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
}

/* The trash icon is a checkbox (Remove), so a browser without script can tick it too: the box is visually hidden, its label
   is the button, and a ticked box shows as ticked. */
.lines-remove-cell {
    text-align: center;
}

.lines-row-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-4);
    padding: 0 var(--space-2);
}

/* The map icon, drawn as the trash icon is: an icon alone, its name for a screen reader only. */
.lines-map {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin-top: 4px;
    border-radius: var(--radius-sm);
    color: var(--color-ink-muted);
}

.lines-map:hover {
    color: var(--color-primary);
    background: var(--color-surface);
}

.lines-map:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

.lines-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin-top: 4px;
    border-radius: var(--radius-sm);
    color: var(--color-ink-muted);
    cursor: pointer;
}

.lines-remove:hover {
    color: var(--color-danger);
    background: var(--color-danger-bg);
}

.lines-remove:focus-within {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

.lines-remove:has(input:checked) {
    color: var(--color-bg);
    background: var(--color-danger);
}

/* The totals bar, kept at the bottom of the window while the lines run past it. */
.lines-table tfoot td,
.lines-table tfoot th {
    position: sticky;
    z-index: 2;
    padding: var(--space-2) var(--space-3);
    background: var(--color-bg);
    border-right: 0;
    font-variant-numeric: tabular-nums;
}

.lines-totals td,
.lines-totals th {
    bottom: 2.75rem;
    border-top: 2px solid var(--color-primary);
    font-weight: 700;
}

.lines-totals .lines-totals-label {
    text-align: right;
}

.lines-balance-row td {
    bottom: 0;
    height: 2.75rem;
}

.lines-table tfoot tr:last-child td:first-child {
    border-radius: 0 0 0 var(--radius-md);
}

.lines-balance {
    margin-right: var(--space-3);
    color: var(--color-ink-muted);
}

.lines-balance.is-flagged {
    font-weight: 600;
    color: var(--color-warning);
}

.lines-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.journal-entry-save-new {
    margin-top: var(--space-1);
}

/* A phone: each line a card of labelled cells, the map and trash icons beside its first. */
@media (max-width: 720px) {
    .lines-table,
    .lines-table tbody,
    .lines-table tfoot,
    .lines-table tr,
    .lines-table td,
    .lines-table th {
        display: block;
        width: 100%;
    }

    .lines-table thead,
    .lines-table colgroup {
        display: none;
    }

    .lines-table tbody tr[data-lines-row] {
        display: grid;
        grid-template-columns: 1fr auto;
        border-bottom: 1px solid var(--color-line);
    }

    .lines-table tbody tr[data-lines-row][hidden] {
        display: none;
    }

    .lines-table tbody td {
        border: 0;
        grid-column: 1;
    }

    .lines-table tbody td.lines-remove-cell {
        grid-column: 2;
        grid-row: 1;
    }

    .lines-table .lines-cell > label.visually-hidden {
        position: static;
        width: auto;
        height: auto;
        margin: var(--space-2) var(--space-2) 0;
        overflow: visible;
        clip-path: none;
        white-space: normal;
        font-size: var(--text-xs);
        color: var(--color-ink-muted);
    }

    .lines-table .lines-cell > label [data-lines-label] {
        display: none;
    }

    .lines-totals td:empty,
    .lines-balance-row td:empty {
        display: none;
    }

    .lines-table tfoot td,
    .lines-table tfoot th {
        position: static;
        text-align: left;
    }

    .lines-table tfoot td[data-label]::before {
        content: attr(data-label) " ";
        font-weight: 400;
        color: var(--color-ink-muted);
    }
}

/* ───────────────────────────────────────────────────────────── */
/*  REPORTS: FILTERS PANEL AND STATEMENTS (boards 524, 525)       */
/* ───────────────────────────────────────────────────────────── */
/* A report page (board 525, the owner's design of 2026-11-10): a Filters button and the breadcrumbs of the options in
   force over the report, the filters in a panel floating over it (_ReportOptions.cshtml, a popover), and the report on
   paper with its own toolbar (_Statement.cshtml). Apply Filters redraws the statement region in place. */
.report {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* A report takes the content column's whole width, however wide the window (the owner, 2026-11-13): only the paper
   grows, and the space beside it stays the page's padding, as narrow as it is on the smallest screen. Not capped as a
   grid page is (main:has(.grid), 96rem), which left the space beside the paper growing past it; a report with a grid
   (Global Search, the Account Register) takes this rule too. */
main:has(.report) {
    max-width: none;
}

/* ── The filters panel ───────────────────────────────────────────────────────────────────────────────────────────────
   A drawer that slides out over the report from its left edge, where the Filters button is (the owner, 2026-11-11):
   from under the top bar to the foot of the window, its head and its Cancel and Apply Filters fixed and its sections
   scrolling between them, one under another, each under a heading, its fields in two columns at most. It is a popover,
   so it opens and closes without script; report.js lines its left edge up with the report's. Without script it opens
   at the window's left edge. */
.report-filters {
    position: fixed;
    inset: var(--topbar-height) auto 0 0;
    width: min(38rem, calc(100vw - 2 * var(--space-4)));
    height: auto;
    max-height: none;
    margin: 0;
    padding: 0;
    /* Clipped, not hidden: a hidden overflow can still be scrolled, by a focus or a script, which once carried the
       head and the jump buttons off the top. Nothing scrolls the drawer itself; its body scrolls. */
    overflow: clip;
    color: var(--color-ink);
    background-color: var(--color-bg);
    border: 0;
    border-right: 1px solid var(--color-line);
    box-shadow: var(--shadow-lg);
    transition: transform 0.18s ease-out, opacity 0.18s ease-out;
}

.report-filters:popover-open {
    display: flex;
}

@starting-style {
    .report-filters:popover-open {
        opacity: 0;
        transform: translateX(-1.5rem);
    }
}

.report-filters::backdrop {
    background-color: rgba(30, 51, 48, 0.2);
}

/* The dimmed page behind the open drawer ignores clicks (the owner, 2026-11-15): a popover's ::backdrop lets them through
   (the browser's own pointer-events: none), so the drawer holds this empty layer over the whole window, under its own
   content, which takes them. A click on it lands inside the drawer, so nothing closes; a drop-down open in the drawer
   still closes on it, as on any click outside the drop-down. */
.report-filters-shield {
    position: fixed;
    inset: 0;
    z-index: -1;
}

.report-filters .report-options {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
}

.report-filters-head {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-line);
    background-color: var(--color-surface);
}

.report-filters-title {
    margin: 0;
    font-size: var(--text-lg);
}

.report-filters-title:focus {
    outline: none;
}

.report-filters .report-filters-close {
    flex: none;
    padding: var(--space-2);
    background: none;
    border: 0;
    color: var(--color-ink-muted);
    font-size: var(--text-lg);
    box-shadow: none;
}

.report-filters .report-filters-close:hover {
    background-color: var(--color-line);
    color: var(--color-ink);
    transform: none;
    box-shadow: none;
}

.report-filters-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 var(--space-5);
}

/* A section under its heading, a rule between sections, as the owner's chosen mockup drew them. */
.report-filters-section {
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--color-line);
}

.report-filters-section:last-of-type {
    border-bottom: 0;
}

.report-filters-section h3 {
    margin: 0 0 var(--space-3);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--teal-700);
}

.report-filters-foot {
    flex: none;
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--color-line);
    background-color: var(--color-bg);
}

/* A section's fields in two columns, in the order the report declares them, each from the top of its cell: Display
   columns by beside the Columns boxes, Accounts view beside Page Per Company (the owner, 2026-11-11). A list the client
   supplies, boxed or a picker, takes the whole row. */
.report-options-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: var(--space-3) var(--space-4);
}

.report-options-fields > .report-option-choices.is-long,
.report-options-fields > .report-picker,
.report-options-fields > .report-option-titled > .report-option-choices.is-long,
.report-options-fields > .report-option-titled > .report-picker {
    grid-column: 1 / -1;
}

/* An option that applies only while another holds certain values (the Balance Sheet's Number of periods, 2026-11-16) sits in
   a fieldset that draws no box, so its field is the grid's cell as any other's; hidden while it does not apply. */
.report-option-when {
    display: contents;
}

/* A field whose title is its section's heading word for word (Companies under COMPANIES; the owner, 2026-11-29) sits in a box that
   draws nothing, and its title, the field's first child, is kept for screen readers only, as .visually-hidden is: the heading says it. */
.report-option-titled {
    display: contents;
}

.report-option-titled > .report-option > :is(legend, label, .report-single-pick-label, .report-single-date-label, .report-date-range-label, .report-months-label):first-child {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    border: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* A spinner (the Balance Sheet's Number of periods, 2026-11-16): a small number box drawn as the app's fields, its arrows always
   showing rather than only on hover. */
.report-option-spinner input[type="number"] {
    width: 5.5rem;
    padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: var(--text-sm);
    font-variant-numeric: tabular-nums;
    color: var(--color-ink);
    background-color: var(--color-bg);
}

.report-option-spinner input[type="number"]::-webkit-inner-spin-button,
.report-option-spinner input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}

/* The buttons over the sections (the owner, 2026-11-11): rounded, as the breadcrumbs are, one per section, staying put
   while the sections scroll under them; the one whose section is in view is filled. */
.report-filters-jump {
    flex: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--color-line);
    background-color: var(--color-bg);
}

.report-filters-jump-link {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border: 1px solid var(--color-line);
    border-radius: 999px;
    font-size: var(--text-sm);
    color: var(--color-ink);
    text-decoration: none;
    background-color: var(--color-surface);
}

.report-filters-jump-link:hover {
    color: var(--color-ink);
    text-decoration: none;
    background-color: var(--color-surface-alt);
}

.report-filters-jump-link[aria-current="true"] {
    color: #fff;
    background-color: var(--teal-600);
    border-color: var(--teal-600);
}

.report-filters-jump-link:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

.report-option {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
    font-size: var(--text-sm);
}

.report-option > label,
.report-option > legend {
    font-weight: 600;
}

/* The app's own fields (.modal-form .field): the same box, the same focus ring. */
.report-option select,
.report-option input[type="date"] {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: var(--text-sm);
    color: var(--color-ink);
    background-color: var(--color-bg);
}

.report-option select:focus,
.report-option input[type="date"]:focus {
    outline: 0;
    border-color: var(--color-focus);
    box-shadow: 0 0 0 3px var(--color-surface-alt);
}

/* A larger calendar under a report's date box (the owner, 2026-11-15: "make the contents of the picker bigger", as wide as the box
   it drops from). The browser draws the calendar and no style reaches it, but Chromium (Chrome, Edge) draws it at the box's zoom:
   218px wide at none, measured, under a box 264px wide, so 1.21 makes it the box's width with its days and words a fifth larger.
   Everything of the box's own is divided by the zoom, so the box looks as it did. A browser that draws its calendar its own way
   (Firefox) shows its usual one under the same box. */
.report-option input[type="date"] {
    --date-zoom: 1.21;
    zoom: var(--date-zoom);
    padding: calc(var(--space-2) / var(--date-zoom)) calc(var(--space-3) / var(--date-zoom));
    border-width: calc(1px / var(--date-zoom));
    border-radius: calc(var(--radius-sm) / var(--date-zoom));
    font-size: calc(var(--text-sm) / var(--date-zoom));
}

/* Chromium's own 1px above and below the date's fields, divided too. */
.report-option input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    padding: calc(1px / var(--date-zoom)) 0;
}

.report-option input[type="date"]:focus {
    box-shadow: 0 0 0 calc(3px / var(--date-zoom)) var(--color-surface-alt);
}

/* A fieldset's own border, padding and min-width (min-content) would box the list in and stop it shrinking. */
.report-option-choices {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.report-option-choices:focus {
    outline: none;
}

/* A legend's own inline padding would set its words off the line of the other fields' labels. */
.report-option-choices > legend {
    padding: 0;
}

/* ── A grouped list: the company picker (board 525; the owner's choice, 2026-11-11) ──────────────────────────────────
   _ReportGroupedList.cshtml. One box: on its left a rail of the groupings, headed Group, the one in force marked as the
   side menu marks its page; on its right Find over the list, and the list under its group headings, each heading with
   the box that picks the group as a group ("group" while it is: the owner, 2026-11-15, for room), the companies under it
   indented. A company a picked group holds is in italics, its note naming the group. The box keeps its height while Find
   narrows the list, so the fields under it do not move. */
.report-picker-box {
    display: grid;
    grid-template-columns: minmax(8rem, 37%) minmax(0, 1fr);
    height: 20rem;
    overflow: clip;
    background-color: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
}

/* The rail folded (the owner, 2026-11-15): a strip one character wide holding the arrow that opens it again, the list
   taking the rest. The box keeps its height, so nothing under it moves. */
.report-picker-box.is-rail-folded {
    grid-template-columns: 1.5rem minmax(0, 1fr);
}

.report-picker-rail {
    /* Its own containing block: the radio buttons, hidden in place below, are laid out in it and scroll with it. Placed
       against the drawer instead, a radio far down the drawer sat past its foot, and focusing it scrolled the drawer. */
    position: relative;
    min-width: 0;
    overflow-y: auto;
    padding: var(--space-2) 0;
    background-color: var(--color-surface);
    border-right: 1px solid var(--color-line);
}

/* The rail's title, and at its end the arrow that folds the rail. */
.report-picker-rail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-1);
    margin: 0 0 var(--space-1);
    padding: 0 var(--space-1) 0 var(--space-3);
}

.report-picker-rail-title {
    min-width: 0;
    margin: 0;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-ink-muted);
    overflow-wrap: anywhere;
}

/* The arrows that fold (the rail's, a heading's): quiet buttons, as a grid tree's chevron is, so every property the generic
   button and its :hover set is restated here. The subset declares only fa-chevron-down: the rail's turns to point left while
   the rail is open and right while it is folded; a heading's points down while its group is open and right while it is folded. */
.report-picker-rail-fold,
.report-picker-fold {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-ink-muted);
    font-size: 10px;
    line-height: 1;
    box-shadow: none;
    transform: none;
}

.report-picker-rail-fold:hover,
.report-picker-fold:hover {
    border: 0;
    background: var(--color-line);
    color: var(--color-primary-hover);
    box-shadow: none;
    transform: none;
}

/* While Find has words every group shows what it finds, so the arrows wait. */
.report-picker-fold:disabled,
.report-picker-fold:disabled:hover {
    background: transparent;
    color: var(--color-ink-muted);
    opacity: 0.35;
    cursor: default;
}

.report-picker-rail-fold .fas {
    transform: rotate(90deg);
}

.report-picker-rail-fold[aria-expanded="false"] .fas,
.report-picker-fold[aria-expanded="false"] .fas {
    transform: rotate(-90deg);
}

/* Folded, the rail is its arrow alone, at the top of a strip the height of the box: the whole strip opens it. */
.report-picker-box.is-rail-folded .report-picker-rail {
    padding: 0;
    overflow: clip;
}

.report-picker-box.is-rail-folded .report-picker-rail-head {
    height: 100%;
    margin: 0;
    padding: 0;
}

.report-picker-box.is-rail-folded .report-picker-rail-title,
.report-picker-box.is-rail-folded .report-picker-rail-list {
    display: none;
}

/* The focus ring hugs the arrow, inside the rail and the list, which clip what is past their edges. */
.report-picker-rail-fold:focus-visible,
.report-picker-fold:focus-visible {
    outline-offset: 0;
}

.report-picker-box.is-rail-folded .report-picker-rail-fold:focus-visible {
    outline-offset: -2px;
}

.report-picker-box.is-rail-folded .report-picker-rail-fold {
    align-items: flex-start;
    width: 100%;
    height: 100%;
    padding-top: var(--space-2);
    border-radius: 0;
}

/* The radio button is the rail entry's state; its label is what shows. Kept in the page (not display: none) so the
   keyboard reaches it and the arrows move along the rail. */
.report-picker-rail input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.report-picker-rail label {
    display: block;
    padding: 6px var(--space-3);
    border-left: 3px solid transparent;
    font-size: var(--text-sm);
    line-height: 1.3;
    color: var(--color-ink);
    cursor: pointer;
    overflow-wrap: anywhere;
}

.report-picker-rail label:hover {
    background-color: var(--color-surface-alt);
}

.report-picker-rail input:checked + label {
    border-left-color: var(--teal-600);
    background-color: var(--color-bg);
    font-weight: 600;
    color: var(--teal-700);
}

.report-picker-rail input:focus-visible + label {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

.report-picker-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

/* The search box over the names: the app's search field (.grid-search-field), across the column. */
.report-picker-find {
    flex: none;
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--color-line);
    background-color: var(--color-surface);
}

.report-picker-find .grid-search-field {
    display: flex;
    width: 100%;
}

.report-picker-find .grid-search-field input {
    min-width: 0;
    font: inherit;
    font-size: var(--text-sm);
}

.report-picker-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: var(--space-2) var(--space-3);
}

.report-picker-group + .report-picker-group {
    margin-top: var(--space-2);
}

/* A heading: the arrow that folds its group, then the box that picks it, its name, how many it holds, and "group" while it is
   picked as a group. */
.report-picker-heading {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: 2px 0;
}

.report-picker-heading-pick {
    display: flex;
    flex: 1;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    font-weight: 600;
    cursor: pointer;
}

/* Select all (the owner, 2026-11-11) heads the list, over the rail's groups: a heading's own look, set off from the groups under it.
   At its end, Collapse all or Expand all (the owner, 2026-11-15). */
.report-picker-all {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--color-line);
}

.report-picker-all-pick {
    display: flex;
    flex: 1;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    font-weight: 600;
    cursor: pointer;
}

.report-picker-all .report-picker-fold-all {
    flex: none;
    white-space: nowrap;
}

.report-picker-all .report-picker-fold-all:disabled {
    color: var(--color-ink-muted);
    text-decoration: none;
    cursor: default;
}

.report-picker-all input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--color-focus);
}

.report-picker-heading input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--color-focus);
}

/* Part-checked, its "–" (the owner, 2026-12-04): a slightly lighter teal, on Select all (the company picker's and a list's in a drop-down)
   and on a group's heading alike. */
.report-picker-all input[type="checkbox"]:indeterminate,
.report-picker-heading input[type="checkbox"]:indeterminate {
    accent-color: var(--color-check-partial);
}

.report-picker-count {
    font-size: var(--text-xs);
    font-weight: 400;
    color: var(--color-ink-muted);
}

.report-picker-whole {
    display: none;
    padding: 0 var(--space-2);
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--teal-700);
    background-color: var(--color-surface-alt);
}

.report-picker-heading:has(input:checked) .report-picker-whole {
    display: inline-block;
}

/* A company under a heading is indented under it; in a list grouped no way (A to Z) it is not. */
.report-option-check.report-picker-entry {
    display: flex;
    align-items: flex-start;
    padding: 1px 0 1px 1.5rem;
    white-space: normal;
}

/* Under a heading that folds, past the heading's arrow too, so the name sits under the heading's name. */
.report-picker-heading + .report-picker-entries .report-option-check.report-picker-entry {
    padding-left: calc(18px + var(--space-1) + 1.5rem);
}

/* The name and its note are one run of text beside the box, so a long one wraps under the name, not into a column. */
.report-picker-entry input[type="checkbox"] {
    flex: none;
    margin-top: 2px;
}

.report-picker-text {
    min-width: 0;
}

.report-picker-group:not(:has(.report-picker-heading)) .report-picker-entry {
    padding-left: 0;
}

/* An entry a picked group or Select all holds shows ticked like any other, with nothing beside it saying why: users found the
   italic name and its "in East" note distracting (the owner, 2026-11-13). */

/* ── A single pick: a drop-down over a grouped list (the Account Register, 2026-11-12) ───────────────────────────────────
   _ReportSinglePick.cshtml. The owner's rule: a single pick is a drop-down, a multi-select sits on the rail. The field is its label
   over a button showing the choice; the button opens the company picker's box (the rail, Find and the headed list) in a panel of
   its own under it, each entry a radio button. report.js places the panel; without script it opens where the browser puts it. */
.report-single-pick {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}

.report-single-pick-label {
    font-weight: 600;
}

.report-single-pick-button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    width: 100%;
    min-width: 0;
    padding: 6px var(--space-3);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    background-color: var(--color-bg);
    color: var(--color-ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.report-single-pick-button[aria-expanded="true"] {
    border-color: var(--color-focus);
}

/* The global button:hover (0,1,1) would fill the field dark teal under the pointer: a drop-down's button stays a field. */
button.report-single-pick-button:hover {
    background-color: var(--color-bg);
    color: var(--color-ink);
    border-color: var(--color-focus);
    box-shadow: none;
    transform: none;
}

.report-single-pick-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-single-pick-panel {
    width: min(34rem, calc(100vw - 16px));
    padding: var(--space-2);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    background-color: var(--color-bg);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
}

.report-single-pick-heading {
    margin: 0;
    padding: 2px 0;
    font-weight: 600;
}

/* Folding (the owner, 2026-11-15, as the company picker folds): a heading is its arrow and its words, the row its padding; the
   entries under it start under its words, past the arrow. A single pick's heading has no box, so its entries' buttons sit under its
   words. Not the grouped list's drop-down on the filter bar (_ReportGroupedPick.cshtml), whose heading has a box that picks the group:
   its entries are indented under the heading's name exactly as the panel's are (the owner, 2026-11-17), by the rule above. */
.report-picker-heading > .report-single-pick-heading {
    padding: 0;
}

.report-single-pick-panel:not(.report-grouped-pick-panel) .report-picker-heading + .report-picker-entries .report-option-check.report-picker-entry {
    padding-left: calc(18px + var(--space-1));
}

/* Find, and at the end of its row Collapse all: a drop-down has no Select all row for it to end. */
.report-picker-find-row {
    flex: none;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    border-bottom: 1px solid var(--color-line);
    background-color: var(--color-surface);
}

.report-picker-find-row .report-picker-find {
    flex: 1;
    min-width: 0;
    border-bottom: 0;
}

.report-picker-find-row .report-picker-fold-all {
    flex: none;
    margin-right: var(--space-3);
    white-space: nowrap;
}

.report-picker-find-row .report-picker-fold-all:disabled {
    color: var(--color-ink-muted);
    text-decoration: none;
    cursor: default;
}

.report-picker-entry input[type="radio"] {
    flex: none;
    margin-top: 2px;
    accent-color: var(--color-focus);
}

.report-option-check.report-picker-entry.is-flat {
    padding-left: 0;
}

/* In a multi-pick drop-down the Select all row sits in the same padded list as the entries, so its own 12px side padding put its box
   12px right of theirs (the owner, 2026-11-29): none here, and the divider and the count stay as they are. The grouped list's Select all
   keeps its padding, which lines its box up with the headings' arrows. */
.report-multi-pick-panel .report-picker-all {
    padding-inline: 0;
}

/* A drop-down's entry (the single pick's panel and the multi-pick's) under the pointer or the keyboard: tinted, as every drop-down's
   row is (--color-option-hover). The tint is drawn behind the row and stands past it on both sides by --option-pad, into the list's
   padding, so the row keeps its place and its words theirs: a pill across the list, a few pixels in from the panel's sides. */
.report-single-pick-panel .report-picker-entry {
    position: relative;
    isolation: isolate;
}

.report-single-pick-panel .report-picker-entry::before {
    content: "";
    position: absolute;
    inset: 0 calc(-1 * var(--option-pad));
    z-index: -1;
    border-radius: var(--option-radius);
    pointer-events: none;
}

.report-single-pick-panel .report-picker-entry:hover::before,
.report-single-pick-panel .report-picker-entry:has(input:focus-visible)::before {
    background-color: var(--color-option-hover);
}

.report-single-pick-panel .report-picker-entry:has(input:focus-visible)::before {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

.report-single-pick-panel .report-picker-entry input:focus-visible {
    outline: 0;
}

.report-single-pick-empty {
    margin: 0;
    color: var(--color-ink-muted);
}

/* ── A grouping with a second level: the rail and the list (Investment Performance's Group By and Then By, the owner's design A,
   2026-11-22; _ReportThenByPick.cshtml) ──────────────────────────────────────────────────────────────────────────────────────────
   The closed field says both levels, "1 - Fund Type › 3 - Sector", each name cut at its own end so the second always shows, and the ›
   never cut. The drop-down is two columns of one width: the first level on the investment picker's rail, the second a list of the app's
   drop-down rows, the ✓ on the one picked, an entry that cannot be picked greyed where it is, so no row moves. */
.report-then-by-text {
    position: relative;
    display: flex;
    align-items: baseline;
    white-space: nowrap;
}

.report-then-by-first,
.report-then-by-then {
    flex: 0 1 auto;
    min-width: 2.5em;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-then-by-sep {
    flex: none;
    padding: 0 0.4em;
    color: var(--color-ink-muted);
}

.report-single-pick-panel.report-then-by-panel {
    width: min(27rem, calc(100vw - 16px));
}

.report-picker-box.report-then-by-box {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    height: auto;
}

/* With the companies' groupings beside the investments' (the owner, 2026-11-30) a column holds up to sixteen entries: each scrolls inside the
   drop-down past what a short window has room for, rather than running the drop-down off the window. */
.report-then-by-box > .report-picker-rail,
.report-then-by-box > .report-then-by-list {
    max-height: min(30rem, calc(100vh - 12rem));
    overflow-y: auto;
}

.report-then-by-list {
    min-width: 0;
    padding: var(--space-2) var(--option-pad);
}

/* A section's heading among the entries, Investments then Companies (the owner, 2026-11-30), as the rail's title reads but smaller, over the
   entries' words in either column. */
.report-then-by-section {
    margin: var(--space-2) 0 2px;
    padding: 0 var(--space-3);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-ink-muted);
}

.report-then-by-rows > .report-then-by-section {
    padding-left: calc(var(--space-3) - var(--option-pad));
}

/* The two titles on one line, the list's past its rows' padding so it stands over their words as the rail's does. */
.report-then-by-head {
    min-height: 18px;
}

.report-then-by-list > .report-then-by-head {
    padding-left: calc(var(--space-3) - var(--option-pad));
}

.report-then-by-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px calc(var(--space-3) - var(--option-pad));
    border-radius: var(--option-radius);
    font-size: var(--text-sm);
    line-height: 1.3;
    color: var(--color-ink);
    cursor: pointer;
    user-select: none;
}

.report-then-by-row:hover,
.report-then-by-row:has(input:focus-visible) {
    background-color: var(--color-option-hover);
}

.report-then-by-row:has(input:focus-visible) {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

/* The radio button is the row's state, kept in the page (not display: none) so the keyboard reaches it and the arrows move along the list;
   the row is its own containing block, so focusing it never scrolls the page. */
.report-then-by-radio {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.report-then-by-row-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-then-by-tick {
    flex: none;
    width: 1em;
    text-align: center;
    color: var(--color-primary);
    font-weight: 700;
    visibility: hidden;
}

.report-then-by-row:has(input:checked) .report-then-by-tick {
    visibility: visible;
}

.report-then-by-row:has(input:disabled) {
    color: var(--color-ink-muted);
    opacity: 0.6;
    cursor: default;
}

.report-then-by-row:has(input:disabled):hover {
    background-color: transparent;
}

.report-picker-status {
    margin: var(--space-1) 0 0;
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
}

.report-picker-status:empty {
    display: none;
}

/* ── What is picked, at a picker's foot (the owner, 2026-11-16) ───────────────────────────────────────────────────────────
   _ReportPickerSelections.cshtml, at the foot of the grouped picker's box (under the rail and the list) and of a list's drop-down.
   A strip exactly two chips' lines tall, there while nothing is picked too, so nothing under it moves as picks change: "Selected:",
   Clear all, then a chip per pick, each with its ×, wrapping onto the second line; report.js hides those past the second line and
   ends it with the ⋮, which opens every pick in a panel of its own. The chips' list is laid out as part of the strip's own row, so
   the first chips sit beside Clear all. A group picked as a group is in bold, as the owner's screenshot had it. */
.report-picker-box,
.report-picker-selections,
.report-multi-pick-panel {
    --picker-chip-height: 22px;
    --picker-strip-height: calc(2 * var(--picker-chip-height) + var(--space-1) + 2 * var(--space-2) + 1px);
}

.report-picker-selections {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: center;
    gap: var(--space-1);
    box-sizing: border-box;
    height: var(--picker-strip-height);
    padding: var(--space-2) var(--space-3);
    overflow: clip;
    border-top: 1px solid var(--color-line);
    background-color: var(--color-surface);
    font-size: var(--text-xs);
}

/* Under the rail and the list, across the box, which grows by the strip so the list keeps its height. */
.report-picker-box:has(> .report-picker-selections) {
    grid-template-rows: minmax(0, 1fr) auto;
    height: calc(20rem + var(--picker-strip-height));
}

.report-picker-box > .report-picker-selections {
    grid-column: 1 / -1;
}

.report-multi-pick-panel > .report-picker-selections {
    flex: none;
}

/* The drop-down grows by the strip too, so its list keeps its room. */
.report-multi-pick-panel:popover-open:has(> .report-picker-selections) {
    max-height: min(calc(26rem + var(--picker-strip-height)), calc(100vh - 2rem));
}

.report-picker-selections-label {
    display: inline-flex;
    align-items: center;
    height: var(--picker-chip-height);
    font-weight: 600;
    color: var(--color-ink-muted);
}

.report-picker-selections button.report-picker-clear-all {
    height: var(--picker-chip-height);
    margin-right: var(--space-1);
    padding: 0 var(--space-1);
    font-size: var(--text-xs);
}

.report-picker-selections button.report-picker-clear-all:disabled,
.report-picker-selections button.report-picker-clear-all:disabled:hover {
    color: var(--color-ink-muted);
    text-decoration: none;
    cursor: default;
}

.report-picker-chips {
    margin: 0;
    padding: 0;
    list-style: none;
}

.report-picker-selections > .report-picker-chips {
    display: contents;
}

.report-picker-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    height: var(--picker-chip-height);
    padding: 0 1px 0 var(--space-2);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    background-color: var(--color-bg);
    color: var(--color-ink);
}

.report-picker-chip[data-picker-chip="pick"] {
    font-weight: 600;
}

.report-picker-chip-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

/* The pointer over a chip turns its words red: a click on them removes the pick, as its x does (the owner, 2026-11-19, #564). Only the
   colour changes, so nothing moves. */
.report-picker-chip:hover .report-picker-chip-text {
    color: var(--color-danger);
}

/* The ×, and the panel's close: a small quiet button, not the global primary one. */
button.report-picker-chip-remove,
button.report-picker-selections-close {
    flex: none;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--color-ink-muted);
    font-size: 11px;
    box-shadow: none;
    transform: none;
}

button.report-picker-chip-remove:hover,
button.report-picker-selections-close:hover {
    background-color: var(--color-surface-alt);
    color: var(--color-ink);
    box-shadow: none;
    transform: none;
}

button.report-picker-chip-remove:focus-visible,
button.report-picker-selections-close:focus-visible {
    outline-offset: 0;
}

button.report-picker-selections-more {
    justify-content: center;
    height: var(--picker-chip-height);
    padding: 0 var(--space-2);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    background-color: var(--color-bg);
    color: var(--color-ink);
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: 1;
    box-shadow: none;
    transform: none;
}

button.report-picker-selections-more:hover,
button.report-picker-selections-more[aria-expanded="true"] {
    background-color: var(--color-surface-alt);
    color: var(--color-ink);
    box-shadow: none;
    transform: none;
}

button.report-picker-selections-more:focus-visible {
    outline-offset: 0;
}

/* The ⋮ panel: every pick, wrapping, under the ⋮ (report.js places it, above it when there is no room under it), scrolling past its
   height. */
.report-picker-selections-panel {
    inset: auto;
    margin: 0;
    box-sizing: border-box;
    width: min(26rem, calc(100vw - 16px));
    max-height: min(24rem, calc(100vh - 16px));
    overflow-y: auto;
    padding: var(--space-2) var(--space-3) var(--space-3);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    background-color: var(--color-bg);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
    font-size: var(--text-xs);
}

.report-picker-selections-panel:focus {
    outline: none;
}

.report-picker-selections-panel:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

.report-picker-selections-head {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.report-picker-selections-title {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 600;
}

.report-picker-selections-count {
    flex: 1;
    color: var(--color-ink-muted);
}

.report-picker-selections-panel .report-picker-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.report-option-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

/* A list the client's data supplies (its companies, its investors) can be long: it scrolls in a box of its own rather
   than pushing the rest of the drawer down. A fixed list of a few boxes (the columns) stands plain. */
.report-option-choices.is-long .report-option-list {
    max-height: 18rem;
    overflow-y: auto;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
}

.report-option-group {
    margin: var(--space-2) 0 0;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-ink-muted);
}

.report-option-group:first-child {
    margin-top: 0;
}

/* The label is the target, so a click on the words ticks the box. Weight 400: .report-option > label is the
   heading style, and this label is a choice, not a heading. */
.report-option > label.report-option-check,
.report-option-check {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 400;
    white-space: nowrap;
    cursor: pointer;
}

.report-option-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--color-focus);
}

/* A flag in a grid cell sits on the line of the boxes beside it. */
.report-option-flag {
    align-self: end;
    padding-bottom: var(--space-2);
}

/* A box declared to share its cell shares it with the next (ReportOption.SharesCellWithNext, ReportOptionFlags: the agings' Total Only
   over Last Payment, beside Aging; the owner, 2026-11-29), one under another as a field's label is over its box: the first on the line of
   the field's label, the last as tall as the field's box, its words in the middle, so it sits on that box's line. Beside a select; beside
   a drop-down's button, whose padding is less. Every other box takes a cell of its own. */
.report-option-flags {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    align-self: start;
    min-width: 0;
    font-size: var(--text-sm);
}

.report-option-flags > .report-option-flag {
    align-self: auto;
    padding-bottom: 0;
}

.report-option-flags > .report-option-flag:last-child > .report-option-check {
    min-height: calc(2 * var(--space-2) + 2px + 1lh);
}

.report-multi-pick + .report-option-flags > .report-option-flag:last-child > .report-option-check {
    min-height: calc(2 * 6px + 2px + 1lh);
}

/* ── Over the report: the Filters button, the breadcrumbs, the exports ───────────────────────────────────────────── */
.statement-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    margin-bottom: var(--space-3);
}

.statement-filters-button {
    flex: none;
}

.statement-crumbs {
    flex: 1 1 20rem;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* One line, once report.js has laid it out (the owner, 2026-11-13): it moves the breadcrumbs that do not fit into the ⋮
   panel, so none wraps or shrinks. Without script they wrap, as above. */
.statement-crumbs.is-one-line {
    flex-wrap: nowrap;
    min-width: 0;
}

.statement-crumbs.is-one-line > li {
    flex: none;
}

.statement-crumbs.is-one-line > li > button {
    white-space: nowrap;
}

/* The ⋮ panel: the breadcrumbs past the line's end, one to a line, under its button (report.js places it). */
.statement-crumbs-panel {
    inset: auto;
    margin: 0;
    max-width: min(28rem, calc(100vw - 16px));
    max-height: min(24rem, calc(100vh - 16px));
    overflow-y: auto;
    padding: var(--space-2);
    list-style: none;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    background-color: var(--color-bg);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
}

.statement-crumbs-panel:popover-open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
}

.statement-crumbs-panel > li {
    max-width: 100%;
}

.statement-crumbs-panel button.statement-crumb {
    text-align: left;
}

/* A breadcrumb is a button that opens the panel at its option, and so is the ⋮ at the line's end. The global button
   rule would dress them as the primary action, so they take all of that back. */
.statement-crumbs button.statement-crumb,
.statement-crumbs button.statement-crumbs-more-button {
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-1);
    padding: 3px 10px;
    border: 1px solid var(--color-line);
    border-radius: 999px;
    background-color: var(--color-surface);
    color: var(--color-ink);
    font-size: var(--text-xs);
    font-weight: 400;
    box-shadow: none;
    transform: none;
}

.statement-crumbs button.statement-crumb:hover,
.statement-crumbs button.statement-crumbs-more-button:hover {
    background-color: var(--color-surface-alt);
    color: var(--color-ink);
    box-shadow: none;
    transform: none;
}

.statement-crumbs button.statement-crumbs-more-button {
    padding: 3px 8px;
    font-weight: 700;
}

.statement-crumb-label {
    color: var(--color-ink-muted);
}

.statement-crumb-value {
    font-weight: 600;
}

.statement-exports {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-left: auto;
}

/* The PDF request (board 530), inside the Export menu: its two entries are the menu's own items, so the form that holds
   them draws no box of its own. */
.statement-pdf {
    display: contents;
}

/* The PDF's status, under the bar: empty until a PDF is asked for. */
.statement-pdf-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.statement-pdf-status:empty {
    display: none;
}

.statement-pdf-advice {
    margin: 0;
    color: var(--color-ink-muted);
    font-size: var(--text-sm);
}

/* The PDF's status as a toast (report.js; the owner, 2026-11-15): floating in the app's toast region, so nothing on the page
   moves as the PDF is made. Light rather than the app's filled toast, with the status as an icon and its words, and once the
   PDF is ready a link to download it again; the x takes it down. */
/* A refresh's status (shell.js; the owner, 2026-11-26), the PDF's toast in the same corner: shown once it holds a status. */
.toast.job-status-toast {
    align-items: center;
    border: 1px solid var(--color-line);
    background: var(--color-bg);
    color: var(--color-ink);
}

.toast.job-status-toast:not(:has(.job-status-chip)) {
    display: none;
}

.job-status-toast .job-status {
    justify-content: flex-start;
}

.toast.statement-pdf-toast {
    align-items: center;
    border: 1px solid var(--color-line);
    background: var(--color-bg);
    color: var(--color-ink);
}

.statement-pdf-toast .statement-pdf-status {
    flex: 1;
    min-width: 0;
    gap: var(--space-1) var(--space-3);
    margin: 0;
}

.statement-pdf-toast .statement-pdf-poll {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

/* The status itself is the toast's icon and words, with no pill of its own: the PDF's, and a refresh's (the owner, 2026-11-26:
   "should not have the green background (just like the print PDF doesn't have one)"). */
.statement-pdf-toast .job-status-chip,
.job-status-toast .job-status-chip {
    padding: 0;
    border: 0;
    background: none;
    font-size: var(--text-sm);
}

.job-status-toast .job-status-message,
.statement-pdf-toast .job-status-message {
    color: var(--color-ink);
    white-space: normal;
}

.statement-pdf-toast .statement-pdf-download {
    font-weight: 600;
}

/* ── The paper ───────────────────────────────────────────────────────────────────────────────────────────────────────
   The report on a sheet. No overflow on the sheet or anything around the table: the header row sticks against the
   content column, the scroller, and an overflow here would make a scroller of its own for it to stick inside. Only a
   statement wider than the sheet scrolls, inside its own box (.statement-scroll, below). */
.statement-paper {
    padding: var(--space-4) var(--space-5) var(--space-6);
    background-color: #ffffff;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* The paper's toolbar: the levels on the left, the style on the right. */
.statement-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
    margin: calc(-1 * var(--space-2)) 0 var(--space-3);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-line);
}

.statement-toolbar-label {
    margin-right: var(--space-1);
    color: var(--color-ink-muted);
    font-size: var(--text-sm);
}

/* The levels (board 525): shown only once report.js has wired the statement, so it is never a dead control. */
.statement-outline {
    display: none;
    align-items: center;
    gap: var(--space-1);
}

.statement.is-enhanced .statement-outline {
    display: inline-flex;
}

.statement-outline .statement-outline-level {
    min-width: 1.75rem;
    justify-content: center;
    padding: 3px 6px;
}

.statement-outline .statement-outline-level[aria-pressed="true"] {
    background-color: var(--color-table-header);
    color: var(--color-ink);
}

/* The style picker: one control of joined buttons, Logi's three styles, with room for a fourth. */
.statement-style-picker {
    display: inline-flex;
    align-items: center;
    margin: 0 0 0 auto;
}

.statement-segmented {
    display: inline-flex;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.statement-segmented button {
    padding: 4px 12px;
    border: 0;
    border-radius: 0;
    background-color: var(--color-bg);
    color: var(--color-ink);
    font-size: var(--text-xs);
    font-weight: 600;
    box-shadow: none;
    transform: none;
}

.statement-segmented button + button {
    border-left: 1px solid var(--color-line);
}

.statement-segmented button:hover {
    background-color: var(--color-surface);
    color: var(--color-ink);
    box-shadow: none;
    transform: none;
}

.statement-segmented button[aria-pressed="true"] {
    background-color: var(--color-primary);
    color: var(--color-on-primary);
}

/* The report's heading on the paper, centred as a statement's is. What the printed header carries is the owner's
   decision still open (2026-11-10). */
.statement-heading {
    margin-bottom: var(--space-4);
    text-align: center;
}

/* A statement's paper head (_Statement.cshtml; the owner, 2026-11-15): its toolbar and heading, which stay put while the
   statement scrolls (the frozen top, below). The paper's room over the toolbar is the head's own, so a head that has stuck
   keeps it, and the room under the heading is the head's too. The other reports' papers have no head and keep theirs. */
.statement > .statement-paper {
    padding-top: 0;
}

.statement-paper-head {
    padding: var(--space-4) 0;
    background-color: #ffffff;
}

.statement-paper-head .statement-heading {
    margin-bottom: 0;
}

.statement-title {
    margin: 0;
    font-size: var(--text-xl);
}

.statement-empty {
    color: var(--color-ink-muted);
    text-align: center;
}

/* A line of the report's own under its title and over the table (board 574: Intercompany Loans' "Total discrepancy"), centred as the
   heading is, in the ink the report reads in. It prints with the statement, which has no heading of its own on the printed page. */
.statement-note {
    margin: 0 0 var(--space-4);
    font-weight: 600;
    text-align: center;
}

.statement-page + .statement-page {
    margin-top: var(--space-6);
}

.statement-page-caption {
    margin: 0 0 var(--space-2);
    font-size: var(--text-lg);
}

/* A named slot's part under the statement (board 569; WRM's Other Investment Assets under Investment Performance): a paper of its own
   below the statement's and above the list, headed by its caption, which is a statement's title in the region's style at a caption's
   size, and kept with the table under it in print. */
.statement-part {
    margin-top: var(--space-5);
}

.statement-part .statement-heading {
    margin-bottom: var(--space-3);
    break-after: avoid;
}

.statement .statement-part .statement-title {
    font-size: var(--text-lg);
}

/* A list under the statement (Investment Performance's Transactions, board 558): a paper of its own below the statement's, under
   the grid's own title. */
.statement-list {
    margin-top: var(--space-5);
    padding: var(--space-4) var(--space-5);
    background-color: #ffffff;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* A statement wider than its paper (a column per company, say) scrolls sideways inside the paper rather than spilling
   past its edge, and the paper still grows with the statement: never a scrollbar up and down (the owner, 2026-11-13).
   On a desktop only a wide statement's box scrolls (report.js marks it is-wide): a box that scrolls either way is the
   scroller a sticky header sticks inside, so a statement that fits keeps its header sticking against the content column
   in CSS alone, and report.js moves a scrolling box's header down to the same place as the column scrolls. A phone's
   box always scrolls, as the grid's does (.grid-scroll, board 443). Without script a wide statement spills past the
   paper on a desktop, as it did before. */
.statement-scroll {
    overflow-x: auto;
    overflow-y: hidden;
}

@media (min-width: 901px) {
    .statement-scroll:not(.is-wide) {
        overflow: visible;
    }
}

/* The frozen top (the owner, 2026-11-15): while a statement scrolls, everything from the bar over the paper (Filters, the
   breadcrumbs, Favorites and Export) down to its column header row stays put, so the filters and the exports are always in
   reach. The bar sticks to the top of the content column, the paper's head under it, and the header row under the head
   (.statement-table thead th, below; report.js moves down the header of a statement that scrolls sideways instead). report.js
   measures the bar and the head into --statement-bar-height and --statement-frozen-height on the region, so the top is
   frozen only once it has (is-enhanced). The bar's room under it is padding, not margin, so a bar that has stuck covers what
   scrolls under it, and the layout before anything scrolls is as it was. On a desktop only: a phone's screen is too short to
   give up its top, and its header row sticks alone, as before. Never in print. */
@media screen and (min-width: 901px) {
    .statement.is-enhanced > .statement-bar {
        position: sticky;
        top: 0;
        z-index: 3;
        margin-top: calc(-1 * var(--space-3));
        margin-bottom: 0;
        padding: var(--space-3) 0;
        background-color: var(--color-surface);
    }

    .statement.is-enhanced .statement-paper-head {
        position: sticky;
        top: var(--statement-bar-height, 0px);
        z-index: 2;
    }

    /* A statement collapsed short enough to need no scrollbar would widen the content column by the scrollbar's width, and
       the paper and the centred statement on it would move sideways: the column keeps the scrollbar's room. */
    .app-main:has(.statement) {
        scrollbar-gutter: stable;
    }
}

/* ── The statement table: the structure every style shares ───────────────────────────────────────────────────────
   The look is the style's (below). A statement rules only its totals, as Logi's do, so no rule under every row: the
   global `tbody td` draws one under the amounts but not under the labels (they are row headers, th). */
.statement-table {
    width: 100%;
    border-collapse: separate;
}

.statement-table th,
.statement-table td {
    padding: 4px 10px;
    text-align: left;
    font-weight: 400;
    white-space: nowrap;
    border-bottom: 0;
}

/* Printed, the label column takes the slack, so the amounts sit together on the right as Logi's do. */
.statement-table .statement-label {
    width: 100%;
}

/* On the screen (the owner, 2026-11-15) a statement is as wide as its columns, centred on its paper with room either side,
   so its labels and its amounts sit together however wide the window; a statement wider than its paper scrolls inside it
   (.statement-scroll). report.js holds each column at its width with every row showing, so collapsing a part never narrows
   a column and moves the statement. The PDF prints as before, across the page (PrintFit). */
@media screen {
    .statement-table {
        width: auto;
        margin-inline: auto;
    }

    .statement-table .statement-label {
        width: auto;
    }
}

/* The header row sticks under the frozen top (above), or to the top of the content column where nothing over it is frozen. */
.statement-table thead th {
    font-weight: 700;
    position: sticky;
    top: var(--statement-frozen-height, 0px);
    z-index: 1;
}

/* A named slot's part (a box under the main statement) is past the main paper, whose head has scrolled away by the time the part is on
   the screen, so only the bar still holds the top: its header sticks under the bar alone (the owner, 2026-12-03: the box's header floated
   in the middle of the box). The sideways rule below still sets top: 0 on a part's box that scrolls sideways: it has one class more. */
.statement-part .statement-table thead th {
    top: var(--statement-bar-height, 0px);
}

/* A box that scrolls sideways is the scroller its header would stick inside, and it never scrolls up and down: an offset there
   would only push the header down into the rows. report.js moves that header under the frozen top instead. */
.statement-scroll.is-wide .statement-table thead th {
    top: 0;
}

@media (max-width: 900px) {
    .statement-scroll .statement-table thead th {
        top: 0;
    }
}

.statement-table .is-numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* A text column (board 558: Investment Performance's Company and types), read as the label is. */
.statement-table .is-text {
    text-align: left;
}

/* Column headings (the owner, 2026-11-30: Liquidity's liquidity over its Today and Future, the mockup's two-tier heading): a heading over
   a run of columns, a row above their own headers. The two rows stick as one, the head and not its cells, so the second never slides under
   the first; report.js moves the cells of a head that scrolls sideways as it moves any. The first column of each run is ruled down its left,
   in the header and the body, drawn as a background so it takes no width (PrintFit) and leaves each style's own borders and shadows alone. */
.statement-table.has-column-groups thead {
    position: sticky;
    top: var(--statement-frozen-height, 0px);
    z-index: 1;
}

/* A part's two heading rows stick under the bar alone, as its one header row does (the owner, 2026-12-03). */
.statement-part .statement-table.has-column-groups thead {
    top: var(--statement-bar-height, 0px);
}

.statement-table.has-column-groups thead th {
    position: static;
}

.statement-scroll.is-wide .statement-table.has-column-groups thead {
    top: 0;
}

@media (max-width: 900px) {
    .statement-scroll .statement-table.has-column-groups thead {
        top: 0;
    }
}

.statement-table thead th.statement-colgroup {
    text-align: center;
}

.statement-table .is-group-start {
    background-image: linear-gradient(to right, rgba(30, 51, 48, 0.3) 2px, transparent 2px);
}

/* A note before an amount (the owner, 2026-11-30: Liquidity's days to a company's furthest future line, the mockup's option B): smaller,
   in the row's own ink made lighter, so it reads on every style's bands, the navy ones too, and the amount still reads first. Its least width
   keeps the amounts beside notes of one figure or two in line. PrintFit measures it by these numbers (StatementPrintMetrics.Note). */
.statement-table .statement-cell-note {
    display: inline-block;
    min-width: 2.4em;
    margin-right: 0.5em;
    font-size: 0.8em;
    font-weight: 400;
    text-align: left;
    opacity: 0.7;
}

/* A header that sorts the lines as a grid's does (board 558, the owner, 2026-11-19): its words in the header's own ink, wrapping as the
   header does, and the grid's arrow after them, muted until the column is the sort. Not underlined on hover, as no link in a statement
   is (the owner, 2026-11-21): the pointer, and the words a little lighter, whatever band the header is on. */
.statement-table a.statement-sort,
.statement-table a.statement-sort:link,
.statement-table a.statement-sort:visited {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.statement-table a.statement-sort:hover {
    text-decoration: none;
}

.statement-table a.statement-sort:hover > span {
    opacity: 0.7;
}

.statement-table a.statement-sort:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 1px;
    border-radius: 2px;
}

.statement-table a.statement-sort > i {
    margin-left: 0.35em;
    font-size: 0.85em;
}

.statement-table a.statement-sort > i.statement-sort-idle {
    opacity: 0.35;
}

/* Rows under a line that are no part of any total (board 558: Investment Performance's Cash on Cash years): they read lighter under
   their line, in every style. The line itself is not shaded (the owner, 2026-11-19), where Logi shaded it. */
.statement-table tr.is-detail > * {
    color: #4a5c59;
}

.statement-table tbody tr.is-detail:hover > * {
    box-shadow: inset 0 0 0 100vmax rgba(30, 51, 48, 0.06);
}

/* A row of percentages under a total (board 572: LTC's Gross Profit Margin under its Gross Profit, Profit Margin under its Net Income), in
   every style: in italics, its label where its total's starts, so it reads as the total's companion, not as a line. */
.statement-table tr.is-ratio > * {
    font-style: italic;
}

.statement.is-enhanced:not(.statement-style-accountant) .statement-table tr.is-ratio th.statement-label {
    text-indent: -1rem;
}

/* Indentation by depth: a class rather than an inline style, seven steps at most (three groups, the line and three
   levels below it), after a gutter the collapse caret sits in. */
.statement-table .statement-label { padding-left: calc(10px + 1rem); }
.statement-table th.statement-depth-1 { padding-left: calc(10px + 1rem + 1.25rem); }
.statement-table th.statement-depth-2 { padding-left: calc(10px + 1rem + 2.5rem); }
.statement-table th.statement-depth-3 { padding-left: calc(10px + 1rem + 3.75rem); }
.statement-table th.statement-depth-4 { padding-left: calc(10px + 1rem + 5rem); }
.statement-table th.statement-depth-5 { padding-left: calc(10px + 1rem + 6.25rem); }
.statement-table th.statement-depth-6 { padding-left: calc(10px + 1rem + 7.5rem); }
/* Board 595: the Statement of Cash Flows' Net Income reads the Profit & Loss's levels below its line, eight steps in at most. */
.statement-table th.statement-depth-7 { padding-left: calc(10px + 1rem + 8.75rem); }
.statement-table th.statement-depth-8 { padding-left: calc(10px + 1rem + 10rem); }

/* A total starts where the heading it totals starts, its caret and all, and the closing Total, which has no heading, at the label
   column's left edge with the outermost carets (the owner, 2026-11-21: "The totals should be aligned under the heading they total. The
   grand Total on the leftmost alignment"). Only while the carets show (script, on screen): on paper there is no caret, and a total already
   starts where its heading does. Accountant keeps its own rule, a total one level in, as QuickBooks Online draws it (below). */
.statement.is-enhanced:not(.statement-style-accountant) .statement-table tr:is(.is-group-summary, .is-parent-total, .is-grand-total) th.statement-label {
    text-indent: -1rem;
}

.statement-table tr.is-group-header th,
.statement-table tr.is-group-summary > *,
.statement-table tr.is-parent-total > *,
.statement-table tr.is-group-header.is-collapsed > * {
    font-weight: 600;
}

.statement-table tr.is-grand-total > * {
    font-weight: 700;
}

/* Reading across: the row under the pointer darkens a little, whatever the style's ground. The app's own row hover
   (tbody tr:hover) would paint the row's ground, which only some styles' cells cover. */
.statement-table tbody tr:hover {
    background-color: transparent;
}

.statement-table tbody tr:is(.is-line, .is-parent-header, .is-parent-total):hover > * {
    box-shadow: inset 0 0 0 100vmax rgba(30, 51, 48, 0.06);
}

/* A list's cell links (board 560, the owner, 2026-11-19): a count that opens a drill (BRT System Status's Count), and a name that opens its
   own page in a new tab (Account Register's Company): the cell's own text with no underline, shown on hover and to the keyboard, as a statement's drill is. A grouped
   grid's heading that links its company, and a list drill's title that names its company (board 562), are the same kind of link. */
a.grid-drill-link,
a.grid-drill-link:link,
a.grid-drill-link:visited,
a.grid-newtab-link,
a.grid-newtab-link:link,
a.grid-newtab-link:visited,
a.report-drill-title-link,
a.report-drill-title-link:link,
a.report-drill-title-link:visited {
    color: inherit;
    text-decoration: none;
}

a.grid-drill-link:hover,
a.grid-newtab-link:hover,
a.report-drill-title-link:hover {
    color: var(--teal-500);
    text-decoration: underline;
    text-underline-offset: 2px;
}

a.grid-drill-link:focus-visible,
a.grid-newtab-link:focus-visible,
a.report-drill-title-link:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 1px;
    border-radius: 2px;
}

/* A link in a statement (board 525): the statement's own text, not a hyperlink, as Logi's drills were ink with no underline. Every one
   is a.statement-drill (_Statement.cshtml's DrillLink): an amount, a line's label, a group heading's, Net Income's. None is ever
   underlined, at rest or on hover (the owner, 2026-11-21: "the hyperlinks should not underline. The mouse turning to a pointing hand
   and the slight change in appearance of the text is sufficient"): it shows itself by the pointer and a slight change of colour on
   hover, and to the keyboard by a ring. A header that sorts (a.statement-sort, above) and a heading that expands
   (button.statement-toggle, below) follow the same rule. */
.statement-table a.statement-drill,
.statement-table a.statement-drill:link,
.statement-table a.statement-drill:visited {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.statement-table a.statement-drill:hover {
    color: var(--teal-500);
    text-decoration: none;
}

.statement-table a.statement-drill:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 1px;
    border-radius: 2px;
}

/* A header that collapses (board 525). The global button rule dresses every <button> as the primary action, so the
   toggle takes all of it back: it is the row's label, with a caret in the gutter before it. Without script it is that
   label and nothing more. */
.statement-table button.statement-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: inherit;
    font: inherit;
    text-align: left;
    text-transform: inherit;
    cursor: default;
}

.statement-table button.statement-toggle:hover,
.statement-table button.statement-toggle:active {
    background: none;
    box-shadow: none;
    color: inherit;
    transform: none;
}

.statement.is-enhanced .statement-table button.statement-toggle {
    cursor: pointer;
}

/* A heading that expands shows itself as a statement's links do, by the pointer and their colour on hover, never an underline
   (the owner, 2026-11-22: "make the mouse over the expandable account not an underline, just like the other hyperlinks"). */
.statement.is-enhanced .statement-table button.statement-toggle:hover .statement-toggle-label {
    color: var(--teal-500);
}

.statement.statement-style-executive.is-enhanced .statement-table button.statement-toggle:hover .statement-toggle-label {
    color: #1f4e85;
}

.statement-table button.statement-toggle:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

.statement-caret {
    display: none;
    flex: none;
    width: 1rem;
    margin-left: -1rem;
}

.statement.is-enhanced .statement-caret {
    display: inline-block;
}

.statement-caret::before {
    content: "";
    display: block;
    width: 0.4rem;
    height: 0.4rem;
    margin: 0 auto 0.2rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform var(--transition-fast);
}

.statement-table tr.is-collapsed .statement-caret::before {
    margin-bottom: 0;
    transform: rotate(-45deg);
}

/* A header shows its part's totals only while it is collapsed. */
.statement-table tr:not(.is-collapsed) .statement-when-collapsed {
    display: none;
}

/* ── The three styles (board 525; S12) ───────────────────────────────────────────────────────────────────────────────
   Logi's Classic, Accountant and Executive, from Logi's own values (Theme.css and
   zReportParts.SharedElements.CustomStyleSharedElements), so a statement reads as its readers know it; Accountant since
   dressed as QuickBooks Online's balance sheet and Executive redesigned in banker's blue (the owner, 2026-11-16, below).
   Logi's group
   levels are First (the outermost), Second and Third (the innermost): .is-tier-first and its kin. Literal colours, as
   Logi's were: the statement is a document, dressed the same whatever the app's own theme does. */

/* Classic: the Helix theme. The table's ground shows between the cells as a grid. */
.statement-style-classic .statement-table {
    border-spacing: 2px;
    background-color: #b0c0bc;
    color: #1e3330;
    font-size: 14px;
}

.statement-style-classic .statement-table th,
.statement-style-classic .statement-table td {
    background-color: #ffffff;
}

.statement-style-classic .statement-table thead th {
    background-color: #82c2b6;
    color: #1e3330;
}

.statement-style-classic .statement-table tr.is-banded > * {
    background-color: #f4f8f7;
}

.statement-style-classic .statement-table tr.is-group-header > *,
.statement-style-classic .statement-table tr.is-group-summary > *,
.statement-style-classic .statement-table tr.is-grand-total > * {
    background-color: #c2d6d3;
}

/* Accountant: QuickBooks Online's balance sheet, measured there (the owner, 2026-11-16): Arial at 13px, which is what QBO
   draws its reports in on Windows (it asks for Avenir, which Windows lacks), rows 24px high, 8px in from each column's
   edges, 10px of indent a level with a total one level in from its heading, and the outermost groups' heading rows on a pale
   grey band. White, no grid, columns set apart; a rule over every total and a double rule under the outermost groups' totals
   and the grand total, each under its own column. */
.statement-style-accountant .statement-table {
    border-spacing: 16px 0;
    background-color: #ffffff;
    color: #21262a;
    font-family: Arial, "Liberation Sans", Helvetica, sans-serif;
    font-size: 13px;
    line-height: 16px;
}

.statement-style-accountant .statement-table th,
.statement-style-accountant .statement-table td {
    padding-inline: 8px;
}

/* A heading that collapses is as tall as any other row: its toggle sits on the line's top, not on its caret's baseline. */
.statement-style-accountant .statement-table button.statement-toggle {
    vertical-align: top;
}

/* 10px a level after the caret's gutter, and a total one level in from its heading, in line with the rows it adds up. */
.statement-style-accountant .statement-table .statement-label { padding-left: calc(28px + var(--accountant-level, 0) * 10px); }
.statement-style-accountant .statement-table .statement-depth-1 { --accountant-level: 1; }
.statement-style-accountant .statement-table .statement-depth-2 { --accountant-level: 2; }
.statement-style-accountant .statement-table .statement-depth-3 { --accountant-level: 3; }
.statement-style-accountant .statement-table .statement-depth-4 { --accountant-level: 4; }
.statement-style-accountant .statement-table .statement-depth-5 { --accountant-level: 5; }
.statement-style-accountant .statement-table .statement-depth-6 { --accountant-level: 6; }
.statement-style-accountant .statement-table .statement-depth-7 { --accountant-level: 7; }
.statement-style-accountant .statement-table .statement-depth-8 { --accountant-level: 8; }

.statement-style-accountant .statement-table tr:is(.is-group-summary, .is-parent-total, .is-grand-total) .statement-label {
    padding-left: calc(38px + var(--accountant-level, 0) * 10px);
}

/* A ratio row (board 572) starts where the total it follows does. */
.statement-style-accountant .statement-table tr.is-ratio .statement-label {
    padding-left: calc(38px + var(--accountant-level, 0) * 10px);
}

.statement-style-accountant .statement-title {
    font-family: Arial, "Liberation Sans", Helvetica, sans-serif;
    font-size: 20px;
    color: #21262a;
}

/* The header sticks as the page scrolls: its cells' shadows fill the column gaps either side, so the rows passing
   under it do not show between them. */
.statement-style-accountant .statement-table thead th {
    padding-block: 10px;
    background-color: #ffffff;
    color: #393a3d;
    border-bottom: 1px solid #000000;
    box-shadow: -8px 0 0 0 #ffffff, 8px 0 0 0 #ffffff;
}

.statement-style-accountant .statement-table thead th.is-numeric {
    text-align: right;
}

/* Headings in the ink's own weight, as QBO's are; the totals are bold. */
.statement-style-accountant .statement-table tr.is-group-header > * {
    font-weight: 400;
}

.statement-style-accountant .statement-table tr.is-group-summary > *,
.statement-style-accountant .statement-table tr.is-parent-total > *,
.statement-style-accountant .statement-table tr.is-grand-total > * {
    font-weight: 700;
}

/* The outermost groups' headings (Assets, Liabilities & Equity) on a grey band with a hairline over and under it, across
   the whole row: the cells' shadows carry the band and its hairlines over the column gaps, the outer cells' to the table's
   edges. */
.statement-style-accountant .statement-table tr.is-group-header.is-tier-first > * {
    background-color: #f4f5f8;
    border-top: 1px solid #eceef1;
    border-bottom: 1px solid #eceef1;
    box-shadow: -9px 0 0 -1px #f4f5f8, 9px 0 0 -1px #f4f5f8, -8px 0 0 0 #eceef1, 8px 0 0 0 #eceef1;
}

.statement-style-accountant .statement-table tr.is-group-header.is-tier-first > :first-child {
    box-shadow: -17px 0 0 -1px #f4f5f8, 9px 0 0 -1px #f4f5f8, -16px 0 0 0 #eceef1, 8px 0 0 0 #eceef1;
}

.statement-style-accountant .statement-table tr.is-group-header.is-tier-first > :last-child {
    box-shadow: -9px 0 0 -1px #f4f5f8, 17px 0 0 -1px #f4f5f8, -8px 0 0 0 #eceef1, 16px 0 0 0 #eceef1;
}

.statement-style-accountant .statement-table tr.is-group-summary td,
.statement-style-accountant .statement-table tr.is-parent-total td {
    border-top: 1px solid #000000;
}

.statement-style-accountant .statement-table tr.is-group-summary.is-tier-first td {
    border-bottom: 4px double #000000;
}

.statement-style-accountant .statement-table tr.is-grand-total td {
    border-top: 1px solid #000000;
    border-bottom: 4px double #000000;
}

/* The row under the pointer is tinted in one piece across the line (the owner, 2026-11-22), not cell by cell with white
   between. The 16-pixel column gaps are the table's, not the row's: a pointer in one hovers no row. So each cell reaches
   over half the gap either side of it, and the outer cells to the table's edges, with an empty box the pointer takes as the
   cell's and that takes the row's tint. The cells' own tint is the shared rule's (above). */
.statement-style-accountant .statement-table tbody tr > * {
    position: relative;
}

.statement-style-accountant .statement-table tbody tr > *::before,
.statement-style-accountant .statement-table tbody tr > *::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
}

.statement-style-accountant .statement-table tbody tr > *::before {
    left: -8px;
}

.statement-style-accountant .statement-table tbody tr > *::after {
    right: -8px;
}

.statement-style-accountant .statement-table tbody tr > :first-child::before {
    left: -16px;
    width: 16px;
}

.statement-style-accountant .statement-table tbody tr > :last-child::after {
    right: -16px;
    width: 16px;
}

/* A total's rule is drawn on its figures' cells, over their reach's top: the reach starts at the row's top, as the label's does. */
.statement-style-accountant .statement-table tbody tr.is-parent-total > td::before,
.statement-style-accountant .statement-table tbody tr.is-parent-total > td::after {
    top: -1px;
}

.statement-style-accountant .statement-table tbody tr:is(.is-line, .is-parent-header, .is-parent-total, .is-detail):hover > *::before,
.statement-style-accountant .statement-table tbody tr:is(.is-line, .is-parent-header, .is-parent-total, .is-detail):hover > *::after {
    background-color: rgba(30, 51, 48, 0.06);
}

/* Executive (the owner's redesign, 2026-11-16, in place of Logi's slate): a board pack's balance sheet in banker's blue,
   the colour kept for emphasis. The column header row and the outermost totals (Total Assets, Total Liabilities & Equity)
   and the grand total are solid navy bands with white figures; the inner totals sit on a pale blue; the lines are white
   between hairlines, with no banding; the outermost groups' headings are navy capitals over a navy rule, and the title
   carries a short navy rule under it. Headings stand over their figures, right-aligned, and keep their own case (a
   company's name as written). Every text colour passes WCAG AA by a wide margin (white on the navy and the navy on white
   12.5:1, the navy on the pale blue 10.7:1), and the bands print as dark grey with white figures in greyscale. Roomier
   on the screen; printed, the rows are as dense as the other styles' (the print rules, below), so a company still takes
   a page. */
.statement-style-executive {
    --executive-navy: #12355b;
    --executive-ink: #1a2230;
    --executive-pale: #e8eef6;
    --executive-hairline: #e1e7ef;
    --executive-rule: #9fb3cc;
}

.statement-style-executive .statement-title,
.statement-style-executive .statement-page-caption {
    color: var(--executive-navy);
}

/* The title's short rule, in the head's room under the heading, so the head is as tall as in the other styles and
   restyling moves nothing. */
.statement-style-executive .statement-heading {
    position: relative;
}

.statement-style-executive .statement-heading::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -9px;
    width: 48px;
    height: 3px;
    margin-left: -24px;
    border-radius: 2px;
    background-color: var(--executive-navy);
}

/* The bands print however the browser is set to print backgrounds: white figures on no band would vanish. */
.statement-style-executive .statement-table {
    border-spacing: 0;
    background-color: #ffffff;
    color: var(--executive-ink);
    font-size: 14px;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}

@media screen {
    .statement-style-executive .statement-table th,
    .statement-style-executive .statement-table td {
        padding: 5px 14px;
    }

    .statement-style-executive .statement-table .statement-label { padding-left: calc(14px + 1rem); }
    .statement-style-executive .statement-table th.statement-depth-1 { padding-left: calc(14px + 1rem + 1.25rem); }
    .statement-style-executive .statement-table th.statement-depth-2 { padding-left: calc(14px + 1rem + 2.5rem); }
    .statement-style-executive .statement-table th.statement-depth-3 { padding-left: calc(14px + 1rem + 3.75rem); }
    .statement-style-executive .statement-table th.statement-depth-4 { padding-left: calc(14px + 1rem + 5rem); }
    .statement-style-executive .statement-table th.statement-depth-5 { padding-left: calc(14px + 1rem + 6.25rem); }
    .statement-style-executive .statement-table th.statement-depth-6 { padding-left: calc(14px + 1rem + 7.5rem); }
    .statement-style-executive .statement-table th.statement-depth-7 { padding-left: calc(14px + 1rem + 8.75rem); }
    .statement-style-executive .statement-table th.statement-depth-8 { padding-left: calc(14px + 1rem + 10rem); }
}

/* The header row's white edge keeps it apart from a navy total scrolling under it while it sticks. */
.statement-style-executive .statement-table thead th {
    padding-top: 9px;
    padding-bottom: 9px;
    background-color: var(--executive-navy);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 0 #ffffff;
}

.statement-style-executive .statement-table thead th.is-numeric {
    text-align: right;
}

.statement-style-executive .statement-table tr.is-group-header.is-tier-first > * {
    padding-top: 24px;
    padding-bottom: 6px;
    color: var(--executive-navy);
    border-bottom: 2px solid var(--executive-navy);
}

.statement-style-executive .statement-table tr.is-group-header.is-tier-first th {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.statement-style-executive .statement-table tr.is-group-header:not(.is-tier-first) > * {
    padding-top: 12px;
    color: var(--executive-navy);
}

.statement-style-executive .statement-table tr:is(.is-line, .is-parent-header) > * {
    border-bottom: 1px solid var(--executive-hairline);
}

.statement-style-executive .statement-table tr.is-parent-total td {
    border-top: 1px solid var(--executive-rule);
}

.statement-style-executive .statement-table tr.is-group-summary:not(.is-tier-first) > * {
    padding-top: 7px;
    padding-bottom: 7px;
    background-color: var(--executive-pale);
    color: var(--executive-navy);
}

.statement-style-executive .statement-table tr:is(.is-group-summary.is-tier-first, .is-grand-total) > * {
    padding-top: 9px;
    padding-bottom: 9px;
    background-color: var(--executive-navy);
    color: #ffffff;
    font-weight: 700;
}

/* White room over an outermost total, so its band stands clear of the pale inner total over it. */
.statement-style-executive .statement-table tr.is-group-summary.is-tier-first > * {
    border-top: 10px solid #ffffff;
}

.statement-style-executive .statement-table tbody tr:is(.is-line, .is-parent-header, .is-parent-total):hover > * {
    box-shadow: inset 0 0 0 100vmax rgba(18, 53, 91, 0.06);
}

.statement-style-executive .statement-table a.statement-drill:hover {
    color: #1f4e85;
}

/* On a navy band the ink is white and the blue above would vanish into it: a link there takes a pale blue instead, the only sign of
   the hover now that no link underlines. */
.statement-style-executive .statement-table tr:is(.is-group-summary.is-tier-first, .is-grand-total) a.statement-drill:hover {
    color: #c3d7ee;
}

/* A line's Total is bold on every row while "Display columns by" shows columns, in all three styles, as Logi's was, so the Total reads
   apart from the columns (the owner, 2026-11-18, #532; StatementColumn.EmphasizedBeside). After the styles' own weights, and as
   specific as the strongest of them, so a style's regular-weight headings leave it bold. The PDF prints it, from the same sheet. */
.statement .statement-table td.is-emphasized {
    font-weight: 700;
}

/* ── The drill panel (board 525) ─────────────────────────────────────────────────────────────────────────────────────
   A drill opens in a dialog over the statement, as the owner chose (2026-11-11, option 4's): clear of the window's edges,
   from under the top bar to near the foot of the window, wide to start with since a drill's list of transactions is
   long, its body scrolling, the statement dimmed behind it and not moved. It resizes: report.js drags its left edge, its
   foot and the corner between them (data-statement-drill-resize) and writes an inline width, and a height with
   .is-sized-height; the limits here hold it between a usable minimum and the window, whatever the window does later.
   The amount it opened is marked.

   A frame round it (the owner, 2026-11-17: "a frame/space around it to give it some definition around the edges"): the panel is a
   tinted band, --drill-frame wide, with a darker edge and a deeper shadow, and the drill sits inside it on white, a card of its own
   with its own border and rounded corners. The band is where the edges that resize it are, so they read as the dialog's edge. */
.statement-drill-scrim {
    position: fixed;
    inset: var(--topbar-height) 0 0 0;
    z-index: 899;
    background-color: rgba(30, 51, 48, 0.25);
}

.statement-drill-scrim[hidden] {
    display: none;
}

.statement-drill-panel {
    --drill-gap: var(--space-4);
    --drill-grip: 20px;
    --drill-frame: 10px;
    position: fixed;
    top: calc(var(--topbar-height) + var(--drill-gap));
    right: var(--drill-gap);
    bottom: var(--drill-gap);
    z-index: 900;
    display: flex;
    flex-direction: column;
    width: min(80rem, calc(100vw - 2 * var(--drill-gap)));
    min-width: min(24rem, calc(100vw - 2 * var(--drill-gap)));
    max-width: calc(100vw - 2 * var(--drill-gap));
    min-height: min(12rem, calc(100vh - var(--topbar-height) - 2 * var(--drill-gap)));
    max-height: calc(100vh - var(--topbar-height) - 2 * var(--drill-gap));
    overflow: clip;
    padding: var(--drill-frame);
    background-color: var(--teal-150);
    border: 1px solid var(--teal-500);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.24), 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* A height the user dragged to: the foot is where the height puts it, no longer pinned near the window's. */
.statement-drill-panel.is-sized-height {
    bottom: auto;
}

/* A grid of two rows, the head and the body under it, so the loading circle below can take the body's place, centred in
   what shows of it however far it has scrolled. */
.statement-drill-content {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    overflow: clip;
    background-color: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
}

.statement-drill-content > .statement-drill-head {
    grid-row: 1;
    grid-column: 1;
}

.statement-drill-content > .statement-drill-body {
    grid-row: 2;
    grid-column: 1;
}

/* The edges that drag it: thin strips along the left edge and the foot, shown teal under the pointer, and a grip in
   the corner between them, drawn as the app's dialogs draw theirs. The drag is ours, not the browser's: a finger on an
   edge must not scroll the page, and a drag across one must not select text. */
.statement-drill-edge,
.statement-drill-grip {
    position: absolute;
    z-index: 1;
    touch-action: none;
    user-select: none;
}

.statement-drill-edge.is-left {
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--drill-frame);
    cursor: ew-resize;
}

.statement-drill-edge.is-foot {
    right: 0;
    bottom: 0;
    left: 0;
    height: var(--drill-frame);
    cursor: ns-resize;
}

.statement-drill-edge:hover,
.statement-drill-panel.is-resizing .statement-drill-edge {
    background-color: color-mix(in srgb, var(--teal-500) 45%, transparent);
}

.statement-drill-grip {
    bottom: 0;
    left: 0;
    z-index: 2;
    width: var(--drill-grip);
    height: var(--drill-grip);
    padding: 3px;
    color: var(--color-ink-muted);
    opacity: 0.75;
    cursor: nesw-resize;
}

.statement-drill-grip:hover {
    color: var(--color-ink);
    opacity: 1;
}

.statement-drill-grip svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
}

/* While it is dragged, the page under the pointer neither selects nor reacts. */
.statement-drill-panel.is-resizing .statement-drill-content {
    pointer-events: none;
    user-select: none;
}

/* A phone's panel is already as wide as the screen, and edges there only fight the scroll. */
@media (max-width: 34rem) {
    .statement-drill-edge,
    .statement-drill-grip {
        display: none;
    }
}

.statement-drill-panel[hidden] {
    display: none;
}

.statement-drill-panel:focus {
    outline: none;
}

/* The body's foot clears the grip, so its last line and its scrollbar are not under it: the grip stands in the frame and past it. */
.statement-drill-panel .statement-drill-body {
    margin-bottom: calc(var(--drill-grip) - var(--drill-frame));
}

.statement-drill-head {
    flex: none;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-line);
    background-color: var(--color-surface);
}

.statement-drill-head h2 {
    margin: 0;
    font-size: var(--text-lg);
}

.statement-drill-crumbs {
    margin: 0 0 var(--space-1);
    color: var(--color-ink-muted);
    font-size: var(--text-xs);
}

.statement-drill-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: var(--space-4) var(--space-5);
}

/* While the panel's content is on its way (report.js sets aria-busy; the owner, 2026-11-13): a loading circle in the
   middle of the body, over a drill opening's outline or, for a drill's own link, over the drill it replaces, dimmed. Both
   wait 0.3 s before showing (the owner, 2026-11-18, #532: a drill whose plan is compiled answers in 0.15 to 0.2 s on a developer's
   copy, and the 0.15 s wait flashed the circle), so a quick answer shows neither. The panel is busy (aria-busy) at once, for a
   screen reader. Without motion the circle holds still: the global rule would turn an endless turn into a flicker. */
.statement-drill-panel[aria-busy="true"] .statement-drill-content::after {
    content: "";
    grid-row: 2;
    grid-column: 1;
    place-self: center;
    z-index: 1;
    width: 2.75rem;
    height: 2.75rem;
    border: 4px solid color-mix(in srgb, var(--teal-500) 18%, transparent);
    border-top-color: var(--teal-500);
    border-radius: 50%;
    /* A white ring round it, so it reads over the dimmed drill as well as over the empty body. */
    box-shadow: 0 0 0 0.75rem var(--color-bg);
    background-color: var(--color-bg);
    pointer-events: none;
    animation: statement-drill-spin 0.9s linear infinite, statement-drill-reveal 0.2s linear 0.3s both;
}

.statement-drill-panel[aria-busy="true"] .statement-drill-body {
    opacity: 0.4;
    transition: opacity 0.2s linear 0.3s;
}

@keyframes statement-drill-spin {
    to { transform: rotate(360deg); }
}

@keyframes statement-drill-reveal {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .statement-drill-panel[aria-busy="true"] .statement-drill-content::after {
        animation: statement-drill-reveal 0.2s linear 0.3s both;
    }
}

/* The drill's head in outline, where its crumbs and title will be. */
.statement-drill-outline {
    display: grid;
    gap: var(--space-2);
    padding-top: 2px;
}

.statement-drill-outline span {
    display: block;
    width: min(10rem, 40vw);
    height: 0.75rem;
    border-radius: var(--radius-pill);
    background-color: var(--color-line);
}

.statement-drill-outline span + span {
    width: min(18rem, 60vw);
    height: 1.25rem;
}

/* A statement's transactions drill (board 548), inside the panel: the choices of grouping, joined as the statement's style
   picker is but links, which replace the panel's content; then one group's heading, its count and total, and the way back
   to the totals; the grids below are the grid framework's own. */
/* The grouping and the period (2026-11-15) on one row, the period at its right end (the owner), wrapping under the grouping where the
   panel is narrow. */
.drill-choices {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-6);
    margin-bottom: var(--space-4);
}

.drill-groupings {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.drill-period {
    margin-left: auto;
}

/* A views drill's row (board 586's dialogs, _ReportViewsDrill.cshtml): the view buttons and every choice beside them stay at the top of the
   body as a long view scrolls under them (the owner, 2026-12-01). The row reaches the body's edges, its padding standing for the body's, so
   nothing shows round it, and it is over the view's own frozen header, which sticks just under it: report.js measures the row's height into
   the body's --drill-choices-height as it wraps or the dialog is resized. At rest it sits where the plain row does. A view wider than a
   narrow dialog scrolls the body sideways, and the row with it: its colour reaches past its ends (the shadow), kept to the row's height (the
   clip), so no line shows beside it. A shadow, unlike a box, adds nothing to the sideways scroll. */
.statement-drill-body > .drill-choices.is-sticky {
    position: sticky;
    top: calc(-1 * var(--space-4));
    z-index: 3;
    margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-5)) 0;
    padding: var(--space-4) var(--space-5);
    background-color: var(--color-bg);
    box-shadow: 0 0 0 100vw var(--color-bg);
    clip-path: inset(0 -100vw);
}

.drill-groupings-label {
    color: var(--color-ink-muted);
    font-size: var(--text-sm);
}

.statement-segmented a {
    padding: 4px 12px;
    background-color: var(--color-bg);
    color: var(--color-ink);
    font-size: var(--text-xs);
    font-weight: 600;
    text-decoration: none;
}

.statement-segmented a + a {
    border-left: 1px solid var(--color-line);
}

.statement-segmented a:hover {
    background-color: var(--color-surface);
}

.statement-segmented a[aria-current="true"] {
    background-color: var(--color-primary);
    color: var(--color-on-primary);
}

.drill-group-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-1) var(--space-4);
    margin-bottom: var(--space-3);
}

.drill-group-name {
    margin: 0;
    font-size: var(--text-lg);
}

.drill-group-facts {
    display: flex;
    gap: var(--space-4);
    margin: 0;
    color: var(--color-ink-muted);
    font-size: var(--text-sm);
}

.drill-group-total b {
    color: var(--color-ink);
}

.drill-back {
    flex-basis: 100%;
    font-size: var(--text-sm);
}

/* A statement inside a drill dialog (board 586, ReportViewsDrillModel: a pair's By month). It is drawn as on its report page, in the report's
   style, left-aligned in the dialog, its heads frozen at the top of the dialog's scrolling body. */
.drill-statement .statement-page {
    margin: 0;
}

.drill-statement .statement-scroll {
    overflow: visible;
}

.drill-statement .statement-table {
    margin: 0;
}

.drill-statement .statement-table thead th {
    position: sticky;
    top: calc(var(--drill-choices-height, 0px) - var(--space-4));
    z-index: 1;
}

/* A view's summary over it (board 586: the Lines view's box of each company's total, Logi's Transaction Details'), a small table that
   scrolls away with the dialog, so the grid under it keeps the dialog's top. */
.drill-summary {
    margin-bottom: var(--space-4);
}

.drill-summary .statement-table thead th {
    position: static;
}

/* A short list of links in a drill dialog (board 586: an Inter-Company Type's COA categories), a line each, a note after an inactive one. */
.drill-link-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.drill-link-list li {
    padding: var(--space-2) var(--space-1);
    border-bottom: 1px solid var(--color-line);
}

.drill-link-note {
    margin-left: var(--space-2);
    color: var(--color-ink-muted);
    font-size: var(--text-xs);
}

/* The paragraph over an error-check screen that is a report page (board 586: Intercompany Imbalances): the error-check screens' heading
   paragraph (ErrorCheckHeading), the statement carrying the title. */
.error-check-intro {
    max-width: 64rem;
    margin: 0 0 var(--space-4);
}

/* A report's favorites in the drill panel (the owner, 2026-11-15): one line over the grid saying what a click does. */
.report-favorites-dialog-help {
    margin: 0 0 var(--space-3);
    color: var(--color-ink-muted);
    font-size: var(--text-sm);
}

/* Its close button belongs to the panel: on the drill's own page, without script, there is nothing to close. */
.statement-drill-close {
    display: none;
}

.statement-drill-panel button.statement-drill-close {
    flex: none;
    display: inline-flex;
    padding: var(--space-2);
    background: none;
    border: 0;
    color: var(--color-ink-muted);
    font-size: var(--text-lg);
    box-shadow: none;
}

.statement-drill-panel button.statement-drill-close:hover {
    background-color: var(--color-line);
    color: var(--color-ink);
    transform: none;
    box-shadow: none;
}

.statement-table .is-drilled {
    outline: 2px solid var(--teal-500);
    outline-offset: -2px;
}

/* THE PIE (L5-Q7, board 571; _PieChart.cshtml): an SVG scaled to its box, its slices in the chart slots with a 2px white gap
   between them, each named beside it in the ink's colours (never the slice's), on a thin line in the muted ink. A slice and its label
   lift together under the pointer, where the tip shows. */
.chart-pie {
    margin: 0;
}

.chart-pie-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    font-family: var(--font-sans);
    font-size: 15px;
}

.chart-pie-fill {
    stroke: var(--color-bg);
    stroke-width: 2;
    stroke-linejoin: round;
    transition: opacity .15s ease;
}

.chart-pie-svg:hover .chart-pie-slice:not(:hover) .chart-pie-fill {
    opacity: .55;
}

.chart-pie-connector {
    fill: none;
    stroke: var(--color-ink-muted);
    stroke-width: 1;
}

.chart-pie-label {
    fill: var(--color-ink);
    font-weight: 700;
}

.chart-pie-share {
    fill: var(--color-ink-muted);
}

.chart-pie-empty {
    margin: var(--space-6) 0;
    color: var(--color-ink-muted);
    font-size: var(--text-lg);
    text-align: center;
}

.chart-pie-omitted {
    margin-top: var(--space-2);
    color: var(--color-ink-muted);
    font-size: var(--text-sm);
}

.chart-colour-1 { fill: var(--chart-1); }
.chart-colour-2 { fill: var(--chart-2); }
.chart-colour-3 { fill: var(--chart-3); }
.chart-colour-4 { fill: var(--chart-4); }
.chart-colour-5 { fill: var(--chart-5); }
.chart-colour-6 { fill: var(--chart-6); }
.chart-colour-7 { fill: var(--chart-7); }
.chart-colour-8 { fill: var(--chart-8); }

@media (prefers-reduced-motion: reduce) {
    .chart-pie-fill {
        transition: none;
    }
}

/* A DASHBOARD PAGE (board 571, a custom report's launcher: WRM's Dashboard): its title and Favorites menu over two papers side by
   side, the options on the left and the figure on the right, the figure wrapping under the options on a narrower screen, as Logi's
   dashboard did. The options are the report filter bar's controls, each its label over it; groups of them sit in columns, each a
   fieldset with its heading, and a column of buttons is buttons the column's width. */
.report-dashboard-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
}

.report-dashboard-title {
    margin: 0;
}

.report-dashboard-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: var(--space-4);
    margin-top: var(--space-4);
}

@media (max-width: 1100px) {
    .report-dashboard-body {
        grid-template-columns: minmax(0, 1fr);
    }
}

.report-dashboard-options,
.report-dashboard-figure {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-width: 0;
    padding: var(--space-4) var(--space-5) var(--space-5);
    background-color: #ffffff;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.report-dashboard-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: end;
    gap: var(--space-3) var(--space-4);
}

.report-dashboard-top .report-option-flag {
    padding-bottom: 7px;
}

.report-dashboard-groups {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: var(--space-4);
}

@media (max-width: 760px) {
    .report-dashboard-top,
    .report-dashboard-groups {
        grid-template-columns: minmax(0, 1fr);
    }
}

.report-dashboard-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.report-dashboard-group > legend {
    width: 100%;
    margin-bottom: var(--space-3);
    padding: 0 0 var(--space-1);
    border-bottom: 1px solid var(--color-line);
    color: var(--color-ink);
    font-size: var(--text-base);
    font-weight: 700;
}

.report-dashboard-button,
.report-dashboard-launch {
    width: 100%;
}

.report-dashboard-launch {
    margin-top: var(--space-1);
}

.report-dashboard-advanced .report-years {
    max-width: 24rem;
}

.report-dashboard-figure-head {
    max-width: 24rem;
}

/* Printed, each page of a page-per-company statement starts a sheet, as Logi's export did, and the controls stay off
   the paper. */
@media print {
    .report-filters,
    .statement-bar,
    .statement-toolbar,
    .statement-caret,
    .statement-pdf-status,
    .statement-drill-panel {
        display: none;
    }

    .statement-paper {
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .statement-page + .statement-page {
        break-before: page;
        margin-top: 0;
    }

    /* Printed, the statement is whole (board 530). A page is about 624 pixels wide in portrait, under the 901 where a
       statement that fits stops scrolling, a wide one scrolls at any width, and a scroll box prints cut off at its edge:
       the PDF fits the width instead (PrintFit). The header row repeats on every page rather than sticking, or being
       moved down by report.js, and a row is never split across two. */
    .statement-scroll {
        overflow: visible;
    }

    .statement-table thead th {
        position: static;
        transform: none !important;
        /* A width report.js held its column at on the screen: printed, the labels take the slack again. */
        width: auto !important;
    }

    /* Column headings' two rows (the owner, 2026-11-30) repeat on every page, as the one row does, rather than sticking. */
    .statement-table.has-column-groups thead {
        position: static;
    }

    .statement-table tr {
        break-inside: avoid;
    }

    /* Paper is denser than a screen, as Logi's PDFs were: a company's balance sheet on a page, not two. Every style prints at 12
       pixels: each style's screen size outranks this rule, so each restates it here, Classic's 14 included (the owner, 2026-11-24:
       Classic had printed at 14 since #525 gave it that size on the screen). PrintFit measures each style by these rules
       (StatementPrintMetrics), and PrintFitLayoutTests checks it against what the browser draws. */
    .statement-table,
    .statement-style-classic .statement-table {
        font-size: 12px;
    }

    /* Accountant's 13 pixels are QBO's screen type: printed, it keeps the 12 the other styles print at. */
    .statement-style-accountant .statement-table {
        font-size: 12px;
    }

    .statement-table th,
    .statement-table td {
        padding-top: 2px;
        padding-bottom: 2px;
    }

    .statement-page-caption {
        margin-bottom: var(--space-1);
    }

    /* Executive printed (the owner's redesign, 2026-11-16): at the 12-pixel type PrintFit measures the columns in, which
       its screen type outranks, and as dense as the other styles, so a company still takes a page. */
    .statement-style-executive .statement-table,
    .statement-style-executive .statement-table thead th,
    .statement-style-executive .statement-table tr.is-group-header.is-tier-first th {
        font-size: 12px;
    }

    .statement-style-executive .statement-table thead th {
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .statement-style-executive .statement-table tr.is-group-header.is-tier-first > * {
        padding-top: 12px;
        padding-bottom: 3px;
    }

    .statement-style-executive .statement-table tr.is-group-header:not(.is-tier-first) > * {
        padding-top: 5px;
    }

    .statement-style-executive .statement-table tr.is-group-summary:not(.is-tier-first) > * {
        padding-top: 3px;
        padding-bottom: 3px;
    }

    .statement-style-executive .statement-table tr:is(.is-group-summary.is-tier-first, .is-grand-total) > * {
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .statement-style-executive .statement-table tr.is-group-summary.is-tier-first > * {
        border-top-width: 5px;
    }
}

/* A report's printed document (board 530): white, edge to edge inside the PDF's margins, and in Logi's PDF typeface, Arial,
   or Liberation Sans, its metric twin, where Gotenberg prints. */
.report-print {
    margin: 0;
    padding: 0;
    background-color: #fff;
    font-family: Arial, "Liberation Sans", Helvetica, sans-serif;
}

/* ───────────────────────────────────────────────────────────── */
/*  HELP (board 513)                                              */
/* ───────────────────────────────────────────────────────────── */
/* In-app Help (docs/user-help-plan.md): the contents and search on /Help, an article on /Help/{slug}, and its not-found
   page. Every rule here is scoped to a .help-* class and uses only the tokens above. The pages never use <header> or
   <footer>, which this file styles as the top bar and the page footer.

   Width (owner, 2026-11-05): 64rem, with prose held near 75 characters a line so screenshots of wide screens can use
   the card's full width. 42rem (the default content width) and 96rem (What's New's) were the alternatives.
   Named .help-page, which collides with none of the other :has() hooks above. */
main:has(.help-page) {
    max-width: 64rem;
}

/* A run with no break opportunity, such as an email address echoed in "Results for …", breaks rather than running out of
   the card: below 901px neither the card nor the shell scrolls, so it would scroll the whole page sideways. */
.help-page {
    overflow-wrap: break-word;
}

/* The search form: the act-as picker's pill field, wider here, with Search beside it or, on a phone, under it. */
.help-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin: var(--space-4) 0;
}

.help-search .grid-search-field {
    width: 100%;
    max-width: 32rem;
}

/* The contents: a card per part. A group's heading is a quiet muted label, written as the side menu writes it ("Name
   Mappings"), never upper-cased (owner, 2026-11-05); its entries tile, each with its side-menu icon in the identity teal. */
.help-part h3 {
    margin: var(--space-4) 0 var(--space-2);
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-ink-muted);
}

.help-entries {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: var(--space-2) var(--space-4);
    margin: 0;
    padding: 0;
    list-style: none;
}

.help-entries .fa-fw {
    color: var(--color-brand);
}

/* Search results: the matching titles in order, each over a muted snippet. */
.help-results {
    margin: 0 0 var(--space-4);
    padding-left: var(--space-5);
}

.help-results li + li {
    margin-top: var(--space-3);
}

.help-snippet {
    margin: var(--space-1) 0 0;
    color: var(--color-ink-muted);
    font-size: var(--text-sm);
}

/* A matched word looks as the grid's tree search marks one (.grid-table mark), so a search match has one look across
   the app and never reads as selected text (owner, 2026-11-05). */
.help-snippet mark {
    padding: 0 1px;
    border-radius: 2px;
    background: var(--color-warning-bg);
    color: inherit;
}

/* An article's head: the title, the Helix staff badge on a staff article, and Open {screen} pushed to the right. Under
   it, On this page lists the article's ## sections as one wrapping row. */
.help-article-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
}

.help-article-head h1 {
    margin: 0;
}

.help-open-screen {
    margin-left: auto;
    font-size: var(--text-sm);
}

.help-crumb-trail {
    color: var(--color-ink-muted);
}

/* The label leads the row, muted, so the links read as this page's sections rather than a second crumb (owner,
   2026-11-05); on a phone the links wrap under it. */
.help-toc {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-1) var(--space-4);
    margin: var(--space-4) 0 0;
    font-size: var(--text-sm);
}

.help-toc-label {
    font-weight: 600;
    color: var(--color-ink-muted);
}

.help-toc ul {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-4);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Article prose: the only place rendered Markdown lands. The global h3 has no size and renders larger than h2 (the type
   scale at the top of this file), and .card h2 drops its top margin (CARDS), so all three heading levels are set here.
   Text is held near 75 characters a line; pictures and tables may use the card's full width. */
.help-prose > :first-child { margin-top: 0; }
.help-prose > :last-child { margin-bottom: 0; }

.help-prose :is(p, ul, ol, blockquote, h2, h3, h4) {
    max-width: 75ch;
}

.help-prose h2 {
    margin: var(--space-6) 0 var(--space-2);
    font-size: var(--text-xl);
}

.help-prose h3 {
    margin: var(--space-5) 0 var(--space-2);
    font-size: var(--text-base);
    font-weight: 700;
}

.help-prose h4 {
    margin: var(--space-4) 0 var(--space-1);
    font-size: var(--text-sm);
    font-weight: 700;
}

/* No img: a picture stands alone in its paragraph, which carries the margin, so an article ending on one ends flush. */
.help-prose :is(p, ul, ol, blockquote, table) {
    margin: 0 0 var(--space-4);
}

.help-prose :is(ul, ol) {
    padding-left: var(--space-5);
}

/* The .release-list rhythm: a step between items, and above a list nested in one. */
.help-prose li + li,
.help-prose li > :is(ul, ol) {
    margin-top: var(--space-2);
}

/* An item's last block (a nested list, or a loose item's paragraph) gives no margin of its own: it would collapse
   through the item and step the next one by --space-4 instead of --space-2, as blockquote > :last-child does below. */
.help-prose li > :last-child { margin-bottom: 0; }

/* A screenshot: on a line of its own, never wider than the card, and framed so a white screen reads against the white
   card. Its width and height attributes hold its space while it loads. */
.help-prose img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.help-prose code {
    padding: 1px var(--space-1);
    font-family: var(--font-mono);
    font-size: 0.875em;
    background-color: var(--color-surface-alt);
    border-radius: var(--radius-sm);
}

/* A block quote is the article's callout, with the .page-notice look. */
.help-prose blockquote {
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-line);
    border-left: 3px solid var(--color-brand);
    border-radius: var(--radius-sm);
}

.help-prose blockquote > :last-child { margin-bottom: 0; }

/* Tables here are prose, not data: as wide as their words, and none of the grid baseline's row hover (TABLES), which
   says "click me". Cells keep whole words, and W12 keeps them short so they fit a phone: break-word sizes each column at
   least its longest word, where anywhere counted a break after every letter and squeezed a column of short words beside
   one of long text until "Normalized" split mid-word at every phone width. */
.help-prose table {
    width: auto;
}

.help-prose :is(th, td) {
    vertical-align: top;
    overflow-wrap: break-word;
}

.help-prose tbody tr:hover {
    background-color: transparent;
}

/* What withholds an article, on /Help and the not-found page in Development only: one line per problem, its file and
   line first. The resets keep the panel's own padding from doubling with its paragraph's and list's margins. */
.help-problems {
    margin: var(--space-4) 0;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-danger);
    border-left-width: 3px;
    border-radius: var(--radius-sm);
    background-color: var(--color-danger-bg);
    font-size: var(--text-sm);
}

.help-problems > :first-child { margin-top: 0; }
.help-problems > :last-child { margin-bottom: 0; }

/* A phone: a Help card's padding drops to 16px, so a 375px screen keeps about 300px of text rather than about 260px. */
@media (max-width: 700px) {
    .help-page .card {
        padding: var(--space-4);
    }
}

/* ---- The transaction view (board 527) ------------------------------------------------------------ */

/* The transaction's own facts, Logi's label-and-value rows laid across the card. */
.transaction-facts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-5);
    margin: 0 0 var(--space-3);
}

.transaction-facts dt {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-ink-muted);
}

.transaction-facts dd {
    margin: var(--space-1) 0 0;
    overflow-wrap: anywhere;
}

/* Beside the date: a quiet link, since it opens an editor in another tab rather than changing the page. */
.transaction-facts-action {
    margin-left: var(--space-2);
    font-size: var(--text-xs);
}

/* The Account Register's summary by company (board 561, the account read in every company): Logi's table of Company, Transactions and
   Total above the lines, a row a company, drawn as the grid's own table is, in the header band and the ruled rows. */
.account-register-companies-scroll {
    max-width: 100%;
    overflow-x: auto;
    margin: 0 0 var(--space-5);
}

.account-register-companies {
    border-collapse: collapse;
    font-size: var(--text-sm);
    width: auto;
    min-width: min(32rem, 100%);
}

.account-register-companies th,
.account-register-companies td {
    padding: var(--space-2) var(--space-3);
    text-align: left;
    border-bottom: 1px solid var(--color-line);
    white-space: nowrap;
}

.account-register-companies thead th {
    background: var(--color-table-header);
    color: var(--color-ink);
    font-weight: 600;
}

.account-register-companies .account-register-companies-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.account-register-companies tfoot th,
.account-register-companies tfoot td {
    font-weight: 600;
    border-top: 1px solid var(--color-ink-muted);
}

/* The switch for the source (QB) values, above the lines. Logi's summary row is the grid's own totals row, under them. */
.transaction-tools {
    margin: 0 0 var(--space-3);
    font-size: var(--text-sm);
}

/* The source (QB) value under a cell is on a line of its own, cut with an ellipsis where the column is too narrow, as the cell's
   own text is (a block of its own, because text-overflow does not reach into a child block of the table cell). */
.transaction-view .grid-table .grid-cell-detail {
    display: block;
    margin-left: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The card around the grid tracks the table's width once columns have been drag-resized, as the grid's own box does
   (.grid-scroll.is-sized, board 446): without it the table, now wider than the card, overflows its edge onto the page. */
@media (min-width: 901px) {
    .transaction-view:has(.grid-scroll.is-sized) {
        width: max-content;
        min-width: 100%;
    }
}

/* ───────────────────────────────────────────────────────────── */
/*  REPORTS PAGES (board 529; Logi plan D17; owner, 2026-11-10)   */
/* ───────────────────────────────────────────────────────────── */
/* Panels, not prose: every reports page that is not a report (Favorites) gets the content column's room, capped as a
   grid page's is. A report itself is not capped (main:has(.report), with the report's own rules): its paper takes the
   column's whole width (the owner, 2026-11-13). The rail collapses on these pages for the same reason. */
body[data-report-page="true"] main:not(:has(.report)) {
    max-width: 96rem;
}

/* ── The report list (the rail's Reports side) ── */
.report-library-filter {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    background-color: var(--color-bg);
    color: #7c8a87;
    font-size: var(--text-sm);
}

.report-library-filter input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 0;
    background: transparent;
    color: var(--color-ink);
    font: inherit;
}

.report-library-filter:focus-within {
    border-color: var(--color-primary);
}

/* The box around it shows the focus, so the box you type in draws none of its own, as a grid's search box draws none (the owner,
   2026-11-29): the app's ring for a focused text box (input[type="text"]:focus) would draw a second box inside this one. */
.report-library-filter input:focus,
.report-library-filter input:focus-visible {
    border: 0;
    outline: 0;
    box-shadow: none;
}

/* The report list reads as the rail's Configure side does (owner, 2026-11-10), on the home page and in the rail alike: a
   group is a row like Holding Companies, its icon in the brand colour and its name in ink, and its reports are the
   sub-items under it, smaller, muted and indented on the same hairline. */
.report-library-filter + .report-group {
    margin-top: var(--space-1);
}

/* A group's row folds it (the owner, 2026-11-26), as a Configure group's does: its chevron at the end turns when it is open. */
.report-group-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: 0 -11px;
    padding: 9px 11px;
    border-radius: 7px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-ink);
    cursor: pointer;
    list-style: none;
}

.report-group-title::-webkit-details-marker {
    display: none;
}

.report-group-title:hover {
    background-color: var(--color-surface-alt);
}

.report-group[open] > .report-group-title .rail-chevron {
    transform: rotate(180deg);
}

.report-group-title i {
    width: 17px;
    text-align: center;
    color: var(--color-brand);
    flex-shrink: 0;
}

/* The listed reports and the More beneath them share one hairline, as a Configure group's sub-items do. */
.report-group > .report-group-list,
.report-group-more {
    margin: 0 0 0 11px;
    border-left: 1.5px solid #e0ebe8;
    padding-left: var(--space-2);
}

.report-group > :last-child {
    margin-bottom: var(--space-1);
}

.report-group-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.report-group-list a {
    display: block;
    padding: 7px 10px;
    border-radius: 7px;
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
    text-decoration: none;
}

.report-group-list a:hover {
    background-color: var(--color-surface-alt);
    color: var(--teal-700);
}

.report-group-list a.is-current {
    background-color: var(--color-surface-alt);
    color: var(--color-ink);
    font-weight: 500;
}

.report-group-more > summary {
    cursor: pointer;
    padding: 7px 10px;
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
}

.report-library-none {
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
    margin: var(--space-2) 0 0;
}

/* ── Recent reports and favorites ── */
.report-rows {
    list-style: none;
    margin: 0;
    padding: 0;
}

.report-rows li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 9px var(--space-4);
    border-bottom: 1px solid var(--color-surface-alt);
}

.report-rows li:last-child {
    border-bottom: 0;
}

.report-row-icon {
    color: var(--color-brand);
}

.report-row-icon.is-pinned {
    color: #b8901f;
}

.report-row-text {
    min-width: 0;
    flex: 1;
}

.report-row-name {
    font-weight: 600;
    color: var(--color-ink);
    text-decoration: none;
}

.report-row-name:hover {
    text-decoration: underline;
}

.report-row-sub {
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-row-when {
    font-size: var(--text-xs);
    color: #7c8a87;
    white-space: nowrap;
}

/* The pin and the pen: quiet until the row is hovered or a control in it has focus. */
.report-row-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    opacity: 0.45;
}

.report-rows li:hover .report-row-actions,
.report-row-actions:focus-within {
    opacity: 1;
}

.report-row-actions form {
    margin: 0;
}

/* The pin, the pen and "Show all" are quiet text controls, not the app's filled buttons: a link-button is styled where it
   is used, and here it is unstyled to an icon or a link. */
.report-row-actions .link-button,
.fav-foot .link-button {
    background: none;
    border: 0;
    box-shadow: none;
    padding: 4px 6px;
    color: var(--color-ink-muted);
    font-size: var(--text-sm);
    cursor: pointer;
}

.report-row-actions .link-button:hover,
.fav-foot .link-button:hover {
    background-color: var(--color-surface-alt);
    color: var(--color-ink);
    box-shadow: none;
    transform: none;
}

.fav-foot .link-button {
    padding: 2px 0;
    color: var(--color-primary);
    font-size: var(--text-xs);
}

.fav-foot .link-button:hover {
    background: none;
    color: var(--color-primary);
    text-decoration: underline;
}

.report-row-actions .link-button[aria-pressed="true"],
.report-row-actions .link-button[aria-pressed="true"]:hover {
    color: #b8901f;
}

.reports-empty {
    margin: 0;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--color-ink-muted);
}

.fav-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: 10px var(--space-4);
    border-bottom: 1px solid var(--color-surface-alt);
}

.fav-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 15rem;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    color: #7c8a87;
    font-size: var(--text-sm);
}

.fav-filter input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 0;
    background: transparent;
    color: var(--color-ink);
    font: inherit;
}

.fav-filter:focus-within {
    border-color: var(--color-primary);
}

.fav-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fav-chips button {
    border: 1px solid var(--color-line);
    border-radius: var(--radius-pill);
    background-color: var(--color-surface);
    color: var(--color-ink-muted);
    font-size: var(--text-xs);
    padding: 2px 10px;
    cursor: pointer;
}

.fav-chips button[aria-pressed="true"] {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.fav-tools select {
    margin-left: auto;
    font-size: var(--text-xs);
    padding: 3px 6px;
}

/* "Show all": the rest in a scrolling list, not a longer page. */
.fav-list.is-scrolling {
    max-height: 30rem;
    overflow-y: auto;
}

.fav-foot {
    padding: 6px var(--space-4) 10px;
    font-size: var(--text-xs);
}

.fav-foot:has(> [hidden]:only-child) {
    display: none;
}

/* A share not yet run (owner, 2026-11-10): New beside its name, and how many in the panel's heading. */
.fav-new,
.fav-new-count {
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    background-color: var(--color-surface-alt);
    color: var(--teal-700);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.fav-new {
    margin-left: 6px;
    vertical-align: 1px;
}

/* ── Sharing a favorite (owner, 2026-11-10) ── */
.share-favorite {
    margin: 0 0 var(--space-1);
}

.share-filter {
    width: 100%;
    margin: var(--space-3) 0 0;
}

.share-recipients {
    margin: var(--space-3) 0 0;
    padding: 0;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    max-height: 18rem;
    overflow-y: auto;
}

.share-recipient {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: 8px 12px;
    border-top: 1px solid var(--color-line);
    cursor: pointer;
}

.share-recipient:first-of-type {
    border-top: 0;
}

.share-recipient:hover {
    background-color: var(--color-surface-alt);
}

.share-recipient input {
    margin-top: 3px;
}

.share-recipient-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.share-recipient-name {
    font-size: var(--text-sm);
}

.share-recipient.is-staff .share-recipient-name {
    font-weight: 600;
}

.share-recipient-detail {
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
    overflow-wrap: anywhere;
}

/* Share sits beside Delete at the far side of the favorite dialog's actions, away from Save. */
.modal-form-actions .link-button.favorite-share {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: auto;
}

.modal-form-actions .link-button.danger:has(+ .favorite-share) {
    margin-right: 0;
}

/* ── The rail's two sides (owner, 2026-11-10, option 2) ── */
/* The two buttons and the pin, held at the rail's top while it scrolls, as a grid's headers are (the owner, 2026-11-26). Wide only,
   where the rail is its own scroller; the narrow strip scrolls with the page. The rail's padding is taken in and given back, so
   the head sits flush with the rail's top edge and the list passes under its own background. */
.rail-head {
    margin-bottom: var(--space-2);
}

@media (min-width: 901px) {
    .rail-head {
        position: sticky;
        top: calc(-1 * var(--space-3));
        z-index: 2;
        margin: calc(-1 * var(--space-3)) calc(-1 * var(--space-3)) var(--space-2);
        padding: var(--space-3) var(--space-3) 0;
        background-color: var(--color-bg);
    }
}

.rail-sides {
    display: flex;
    margin: 0;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    overflow: hidden;
}

.rail-sides button {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 0;
    border: 0;
    background-color: var(--color-bg);
    color: var(--color-ink-muted);
    font-size: var(--text-xs);
    font-weight: 700;
    cursor: pointer;
}

.rail-sides button[aria-pressed="true"] {
    background-color: var(--color-primary);
    color: #fff;
}

/* The pin, a small square at the switch's end (the owner, 2026-11-26, design 1 of five): its thumbtack muted, then gold on a gold wash
   while pinned, as a pinned favorite's is gold. Not a side, so never the switch's filled teal. */
.rail-sides button.rail-pin {
    flex: 0 0 34px;
    border-left: 1px solid var(--color-line);
}

.rail-sides button.rail-pin:hover {
    background-color: var(--color-surface-alt);
    color: var(--color-ink);
}

.rail-sides button.rail-pin[aria-pressed="true"],
.rail-sides button.rail-pin[aria-pressed="true"]:hover {
    background-color: #fbf3dc;
    color: #b8901f;
}

.app-rail[data-rail-mode="configure"] [data-rail-pane="reports"],
.app-rail[data-rail-mode="reports"] [data-rail-pane="configure"] {
    display: none;
}

.rail-reports-library {
    padding: 0 11px var(--space-3);
}

/* When the report data was rebuilt, and Refresh, at the top of the Reports side on every page but Home (the owner, 2026-11-18,
   #532; 2026-11-19, #564; 2026-11-26): "As of 18 hours ago" on a line of its own across the rail, the Reports switch above it its
   title, then Home's split Refresh. The line is one line high whatever it says ("Refresh in progress" too). A refresh's chip is in
   the toast at the bottom right, so nothing is kept for it here. */
.rail-report-data {
    padding: var(--space-1) 11px var(--space-2);
    margin-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-surface-alt);
}

/* The owner's choice A of three (2026-11-19): semibold, in the ink, at the menu's size, with no capitals, so it reads with the switch
   and not as washed out as the eyebrow it replaced. */
.rail-report-data > .status-meta-value.is-as-of {
    margin: 0 0 var(--space-2);
    overflow: hidden;
    color: var(--color-ink);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* On the rail the button sits at the side's left, so Refresh's drop-down opens from the button's left edge and grows to the right. */
.rail-report-data .refresh-split .grid-menu-content {
    right: auto;
    left: 0;
}


.crumbs {
    margin: 0 0 4px;
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
}

/* ── Global Search (2026-11-12): the filter bar, the months dialog, the boxes, Group by and the list drop-downs ──────── */

/* The filter bar, the paper's toolbar as the Balance Sheet's is (the owner, 2026-11-12): the boxes and Search where the levels are,
   Group by where the style is, each label beside its control as Levels and Style are. .statement-toolbar draws the row and its rule. */
.report-filter-bar-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-4);
}

.report-filter-bar .report-option-text,
.report-filter-bar .report-months {
    flex-direction: row;
    align-items: center;
    gap: var(--space-2);
}

.report-filter-bar .report-option-text > label,
.report-filter-bar .report-months-label {
    color: var(--color-ink-muted);
    font-weight: 400;
    white-space: nowrap;
}

.report-filter-bar .report-option-text input {
    width: 9rem;
    padding: 4px var(--space-2);
}

.report-filter-bar button.report-months-button {
    width: 16rem;
    padding: 4px var(--space-2);
}

.report-filter-bar-choice {
    display: inline-flex;
    align-items: center;
}

/* A box an option is typed into: the app's own field. */
.report-option-text input[type="search"],
.report-option-text input[type="text"] {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: var(--text-sm);
    color: var(--color-ink);
    background-color: var(--color-bg);
}

.report-option-text input:focus {
    outline: 0;
    border-color: var(--color-focus);
    box-shadow: 0 0 0 3px var(--color-surface-alt);
}

.report-option-text.is-amount input {
    font-variant-numeric: tabular-nums;
}

.report-option-text input:user-invalid {
    border-color: var(--color-danger);
}

/* Group by, a choice drawn as joined buttons, as the transactions drill's Group by is. The radio is hidden and its label is the
   button; the label of the one picked is filled. */
.report-option-segmented {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.report-option-segmented > legend {
    margin-bottom: var(--space-1);
    padding: 0;
}

.report-option-segmented .statement-segmented {
    align-self: flex-start;
}

.statement-segmented input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.statement-segmented input[type="radio"] + label {
    padding: 6px 14px;
    background-color: var(--color-bg);
    color: var(--color-ink);
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
}

.statement-segmented input[type="radio"] + label:hover {
    background-color: var(--color-surface);
}

.statement-segmented label + input[type="radio"] + label {
    border-left: 1px solid var(--color-line);
}

.statement-segmented input[type="radio"]:checked + label {
    background-color: var(--color-primary);
    color: var(--color-on-primary);
}

.statement-segmented input[type="radio"]:focus-visible + label {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

/* A segmented choice that is a dialog's field (the favorite dialog's Style, owner 2026-12-02): a .field, so its hint folds with the
   Field help switch as the other fields' do. The dialog's label and input rules are for a text field, so the choice's radios and
   buttons are held as the report's own; the hidden radios need a positioned ancestor in the dialog's scroll area (focus scrolls to them). */
.modal-form .field.report-option-segmented {
    position: relative;
}

.modal-form .field.report-option-segmented > legend {
    margin-bottom: var(--space-1);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-ink);
}

.modal-form .field .statement-segmented input[type="radio"] {
    padding: 0;
    border: 0;
}

.modal-form .field .statement-segmented input[type="radio"] + label {
    display: inline-block;
    margin: 0;
}

/* A list in a drop-down (Class, Transaction Type): the single pick's button and panel, Find and Clear over the boxes. */
.report-multi-pick-panel:popover-open {
    display: flex;
    flex-direction: column;
    max-height: min(26rem, calc(100vh - 2rem));
    padding: 0;
    overflow: hidden;
}

.report-multi-pick-panel {
    width: min(26rem, calc(100vw - 16px));
}

.report-multi-pick-head {
    flex: none;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    border-bottom: 1px solid var(--color-line);
    background-color: var(--color-surface);
}

.report-multi-pick-head .report-picker-find {
    flex: 1;
    min-width: 0;
    border-bottom: 0;
}

.report-multi-pick-head .report-months-link {
    margin-right: var(--space-3);
}

/* A quiet text button: Clear, Select all. */
button.report-months-link {
    gap: 0.3em;
    padding: 2px 4px;
    background: none;
    border: 0;
    color: var(--color-primary);
    font-weight: 600;
    font-size: var(--text-sm);
    box-shadow: none;
}

button.report-months-link:hover {
    background: none;
    color: var(--color-primary-hover);
    text-decoration: underline;
    box-shadow: none;
    transform: none;
}

/* A list in a drop-down on the filter bar (Quick Report's Source Name Matches, 2026-11-13): its label beside its button, as the bar's boxes
   have theirs. On one line, and the button a width of its own: a wrapping row whose button is a percentage of it has no width to start
   from, and put the label above the button (COA Category Research, the owner, 2026-11-15). */
.report-filter-bar .report-multi-pick {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--space-2);
    max-width: 100%;
}

/* The bar's fields wrap inside the paper, never past its edge: a field wider than the paper (the list's button on a phone) shrinks to it. */
.report-filter-bar .report-filter-bar-fields {
    min-width: 0;
    max-width: 100%;
}

.report-filter-bar .report-multi-pick > .report-single-pick-label {
    color: var(--color-ink-muted);
    font-weight: 400;
    white-space: nowrap;
}

.report-filter-bar .report-multi-pick > .report-single-pick-button {
    width: 14rem;
    max-width: 100%;
    padding: 4px var(--space-2);
}

/* ── The date picker (Quick Report's Period, the owner's Design B, 2026-11-15; _ReportDateRange.cshtml, date-range.js) ────────────────── */

/* The field: its label beside it on the bar, as the bar's other fields have theirs; without script the select and the two date boxes. */
.report-date-range {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    max-width: 100%;
    font-size: var(--text-sm);
}

.report-date-range-label {
    color: var(--color-ink-muted);
    white-space: nowrap;
}

.report-date-range-native {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.report-date-range-native select,
.report-date-range-native input {
    padding: 4px var(--space-2);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    background-color: var(--color-bg);
    color: var(--color-ink);
    font: inherit;
    font-size: var(--text-sm);
}

.report-date-range-end {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--color-ink-muted);
}

/* The closed field: the drop-downs' button (.report-single-pick-button) with a calendar, the range's name and its dates. */
button.report-date-range-field {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    width: 21rem;
    max-width: 100%;
    min-width: 0;
    padding: 4px var(--space-2);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    background-color: var(--color-bg);
    color: var(--color-ink);
    font-weight: 400;
    font-size: var(--text-sm);
    text-align: left;
}

button.report-date-range-field:hover,
button.report-date-range-field[aria-expanded="true"] {
    background-color: var(--color-bg);
    color: var(--color-ink);
    border-color: var(--color-focus);
    box-shadow: none;
    transform: none;
}

.report-date-range-icon {
    flex: none;
    width: 14px;
    height: 14px;
    fill: none;
    stroke: var(--color-ink-muted);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.report-date-range-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-date-range-name {
    font-weight: 600;
}

.report-date-range-name.is-all {
    font-weight: 400;
}

.report-date-range-dates {
    margin-left: 6px;
    color: var(--color-ink-muted);
    font-variant-numeric: tabular-nums;
}

.report-date-range-name:empty + .report-date-range-dates {
    margin-left: 0;
    color: var(--color-ink);
}

/* In the filters panel (the Profit & Loss's Period, the owner, 2026-11-17: "the exact same picker with dropdown" as the bar's), as the as-of
   date picker is there: the label over the field, the field the bar's drop-down, as tall as the panel's selects. Its section holds it alone,
   so it is not squeezed into half the section; 24rem holds the longest range with its dates (This Year To Last Month, measured) inside the
   panel's taller padding, where the bar's 21rem cut the dates. */
.report-options-fields .report-date-range {
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
}

.report-options-fields .report-date-range > .report-date-range-label {
    color: var(--color-ink);
    font-weight: 600;
}

.report-options-fields .report-date-range > button.report-date-range-field {
    width: 24rem;
    padding: var(--space-2) var(--space-3);
}

/* The dialog: a popover in the top layer, so no paper clips it; the script places it under the field, or at the foot of a phone's screen. */
.dp-pop {
    position: fixed;
    inset: auto;
    margin: 0;
    padding: var(--space-3);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    background-color: var(--color-bg);
    color: var(--color-ink);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
    font-size: var(--text-sm);
    max-height: calc(100vh - 16px);
    overflow: auto;
}

.dp-pop.is-sheet {
    border-radius: 14px 14px 0 0;
    padding: var(--space-3) var(--space-3) var(--space-4);
    max-height: 88vh;
    box-shadow: 0 -8px 28px rgb(0 0 0 / 0.25);
}

.dp-sheet-head {
    display: none;
}

.dp-pop.is-sheet .dp-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
    font-weight: 600;
}

.dp-body {
    display: flex;
    gap: var(--space-3);
}

.dp-pop.is-sheet .dp-body {
    flex-direction: column;
}

/* The ranges down the left; on a phone a row of chips that scrolls sideways. */
.dp-rail {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 1px;
    width: 12rem;
    padding-right: var(--space-3);
    border-right: 1px solid var(--color-line);
}

.dp-opt {
    padding: 5px 8px;
    border-radius: var(--option-radius);
    cursor: pointer;
    white-space: nowrap;
}

.dp-opt:hover,
.dp-opt:focus-visible {
    background-color: var(--color-option-hover);
}

.dp-opt[aria-selected="true"] {
    background-color: var(--color-primary);
    color: var(--color-on-primary);
    font-weight: 600;
}

.dp-opt:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

.dp-rail-head {
    margin: 6px 0 2px;
    padding: 0 8px;
    color: var(--color-ink-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dp-pop.is-sheet .dp-rail {
    width: auto;
    flex-direction: row;
    gap: 6px;
    padding: 0 0 var(--space-2);
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--color-line);
}

.dp-pop.is-sheet .dp-opt {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-pill);
}

.dp-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* From and To. */
.dp-ends {
    display: flex;
    align-items: flex-end;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.dp-end {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: var(--color-ink-muted);
    font-size: var(--text-xs);
}

.dp-dash {
    padding-bottom: 5px;
    color: var(--color-ink-muted);
}

.dp-box {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    background-color: var(--color-bg);
}

.dp-box:focus-within {
    border-color: var(--color-focus);
    box-shadow: 0 0 0 3px var(--color-surface-alt);
}

.dp-box.is-invalid {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px var(--color-danger-bg);
}

.dp-box > input {
    flex: 1;
    width: 7.6rem;
    min-width: 0;
    padding: 4px var(--space-2);
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--color-ink);
    font: inherit;
    font-size: var(--text-sm);
    font-variant-numeric: tabular-nums;
}

.dp-pop.is-sheet .dp-ends {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
}

.dp-pop.is-sheet .dp-box > input {
    width: 100%;
    min-height: 42px;
}

.dp-err {
    margin: 4px 0 0;
    color: var(--color-danger);
    font-size: var(--text-xs);
}

.dp-msg {
    min-height: 1.3em;
    margin: 6px 0 0;
    color: var(--color-ink-muted);
    font-size: var(--text-xs);
    font-variant-numeric: tabular-nums;
}

/* The foot: Clear dates, then Cancel and Apply. */
.dp-foot {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-line);
}

.dp-space {
    flex: 1;
}

.dp-pop.is-sheet .dp-foot button {
    min-height: 44px;
}

/* A quiet text button: Clear dates, Swap them, Back to days, Close. */
button.dp-link {
    padding: 2px 4px;
    background: none;
    border: 0;
    color: var(--color-primary);
    font-weight: 600;
    font-size: var(--text-sm);
    box-shadow: none;
}

button.dp-link:hover {
    background: none;
    color: var(--color-primary-hover);
    text-decoration: underline;
    box-shadow: none;
    transform: none;
}

/* The months (the WAI-ARIA date-picker dialog's grid): six rows always, so the dialog never jumps. */
.dp-cal {
    --dp-cell: 32px;
}

.dp-pop.is-sheet .dp-cal {
    --dp-cell: 44px;
}

.dp-months {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
}

.dp-month,
.dp-zoom {
    width: calc(var(--dp-cell) * 7);
}

.dp-pop.is-sheet .dp-month,
.dp-pop.is-sheet .dp-zoom {
    width: 100%;
}

.dp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    height: 32px;
    margin-bottom: 2px;
}

button.dp-nav,
button.dp-title,
.dp-zoom-years button,
.dp-zoom-months button {
    background: none;
    color: var(--color-ink);
    box-shadow: none;
    font-weight: 600;
}

button.dp-nav {
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 15px;
}

.dp-pop.is-sheet button.dp-nav {
    width: 44px;
    height: 44px;
}

.dp-nav-space {
    width: 28px;
}

button.dp-title {
    flex: 1;
    justify-content: center;
    gap: 4px;
    padding: 3px 6px;
    white-space: nowrap;
}

button.dp-nav:hover,
button.dp-title:hover,
.dp-zoom-years button:hover,
.dp-zoom-months button:hover {
    background-color: var(--color-surface-alt);
    color: var(--color-ink);
    box-shadow: none;
    transform: none;
}

.dp-title-text {
    flex: 1;
    font-weight: 600;
    text-align: center;
}

.dp-cal table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.dp-cal th {
    height: 22px;
    padding: 0;
    background: none;
    color: var(--color-ink-muted);
    font-size: 11.5px;
    font-weight: 600;
    text-align: center;
}

.dp-cal td {
    position: relative;
    height: var(--dp-cell);
    padding: 0;
    border: 0;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.dp-cal td.dp-day {
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.dp-cal td.dp-day:hover {
    background-color: var(--color-surface-alt);
}

.dp-cal td.dp-day:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

.dp-cal td.is-today {
    font-weight: 700;
    box-shadow: inset 0 0 0 1.5px var(--teal-500);
}

.dp-cal td.in-range {
    background-color: var(--color-surface-alt);
    border-radius: 0;
}

.dp-cal td.is-preview {
    background-color: #eef4d6;
    border-radius: 0;
    box-shadow: inset 0 1px 0 #c3d27a, inset 0 -1px 0 #c3d27a;
}

.dp-cal td.is-preview.is-today {
    box-shadow: inset 0 0 0 1.5px var(--teal-500);
}

.dp-cal td.is-sel {
    background-color: var(--color-primary);
    color: var(--color-on-primary);
    font-weight: 700;
}

.dp-cal td.is-sel:hover {
    background-color: var(--color-primary-hover);
}

.dp-cal td.is-start {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.dp-cal td.is-end {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.dp-cal td.is-start.is-end {
    border-radius: var(--radius-sm);
}

/* Going to a month: a year, then a month, from the month's title. */
.dp-zoom-label {
    margin: 6px 0 0;
    color: var(--color-ink-muted);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dp-zoom-years,
.dp-zoom-months {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 6px;
}

.dp-zoom-years button,
.dp-zoom-months button {
    justify-content: center;
    min-height: 30px;
    padding: 6px 0;
    border: 1px solid var(--color-line);
    font-weight: 400;
}

.dp-pop.is-sheet .dp-zoom-years button,
.dp-pop.is-sheet .dp-zoom-months button {
    min-height: 44px;
}

.dp-zoom-years button[aria-pressed="true"],
.dp-zoom-months button[aria-pressed="true"] {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-on-primary);
    font-weight: 600;
}

.dp-zoom-years button.is-now,
.dp-zoom-months button.is-now {
    box-shadow: inset 0 0 0 1.5px var(--teal-500);
}

/* ── The as-of date picker (the Balance Sheet's As Of, the owner's design A, 2026-11-16; _ReportSingleDate.cshtml, date-range.js) ────────
   The date range picker with one date: its field, its dialog and its months, and what one date needs besides. */

/* In the filters panel, as the panel's other fields are: the label over the field, the field as wide as its cell and as tall as a select. */
.report-single-date-label {
    font-weight: 600;
}

.report-single-date button.report-date-range-field {
    width: 100%;
    padding: var(--space-2) var(--space-3);
}

/* Without script: the choice's select, and under it the date's box, with its label. */
.report-single-date-native {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.report-single-date-box {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    color: var(--color-ink-muted);
}

/* The sliding dates, each with its date today at the end of its line. */
.dp-rail.has-dates {
    width: 15rem;
}

.dp-rail.has-dates .dp-opt {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
}

.dp-opt-date {
    margin-left: auto;
    color: var(--color-ink-muted);
    font-size: var(--text-xs);
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.dp-opt[aria-selected="true"] .dp-opt-date {
    color: rgb(255 255 255 / 0.88);
}

.dp-pop.is-sheet .dp-rail.has-dates {
    width: auto;
}

.dp-pop.is-sheet .dp-rail.has-dates .dp-opt {
    gap: var(--space-2);
}

/* One month, larger than the range's two, its days and words a little larger too, as the report date's calendar was made (the owner,
   2026-11-15: "make the contents of the picker bigger"): seven days of 38px, which the box, the note and the foot are as wide as. A
   phone's sheet is its own width, its days the sheet's. */
.dp-pop.is-single:not(.is-sheet) .dp-cal {
    --dp-cell: 38px;
}

.dp-pop.is-single:not(.is-sheet) .dp-cal td {
    font-size: 15px;
}

.dp-pop.is-single:not(.is-sheet) .dp-main {
    width: 266px;
}

.dp-pop.is-single .dp-ends {
    display: block;
}

.dp-pop.is-single .dp-box {
    display: flex;
}

.dp-pop.is-single .dp-box > input {
    width: 100%;
}

/* A sliding date hovered marks its one day, a box around it rather than a band. */
.dp-pop.is-single .dp-cal td.is-preview {
    border-radius: var(--radius-sm);
    box-shadow: inset 0 0 0 1px #c3d27a;
}

.dp-pop.is-single .dp-cal td.is-preview.is-today {
    box-shadow: inset 0 0 0 1.5px var(--teal-500);
}

/* A phone without script: a bar with a date range has its fields one under another, full width, each label before its field. With
   script the bar is one line and its ⋮ panel lays its fields out so (below). */
@media (max-width: 700px) {
    .report-filter-bar:not(.is-one-line) .report-date-range,
    .report-filter-bar:not(.is-one-line):has(.report-date-range) .report-multi-pick {
        width: 100%;
    }

    .report-filter-bar:not(.is-one-line) .report-date-range > .report-date-range-label,
    .report-filter-bar:not(.is-one-line):has(.report-date-range) .report-multi-pick > .report-single-pick-label {
        flex: 0 0 6.5rem;
    }

    .report-filter-bar:not(.is-one-line) button.report-date-range-field,
    .report-filter-bar:not(.is-one-line):has(.report-date-range) .report-multi-pick > .report-single-pick-button {
        flex: 1 1 0;
        width: auto;
        min-height: 40px;
    }
}

/* ── The filter bar on one line (the owner, 2026-11-15; _ReportFilterBar.cshtml, report.js) ───────────────────────────────────────────
   Once report.js has laid it out, nothing on the bar wraps or shrinks: what does not fit is moved into the ⋮ panel, down to ⋮ and
   Search alone. Without script the bar wraps, as above. */
.report-filter-bar.is-one-line {
    flex-wrap: nowrap;
}

.report-filter-bar.is-one-line > .report-filter-bar-fields {
    flex: none;
    flex-wrap: nowrap;
    max-width: none;
}

.report-filter-bar.is-one-line > .report-filter-bar-fields > *,
.report-filter-bar.is-one-line > .report-filter-bar-choice {
    flex: none;
}

.report-filter-bar-more {
    display: flex;
    align-items: center;
}

/* The ⋮: an outlined button the height of Search beside it. */
.report-filter-bar button.report-filter-bar-more-button {
    justify-content: center;
    min-width: 28px;
    padding: 3px 8px;
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: 1.3;
}

.report-filter-bar button.report-filter-bar-more-button:hover {
    transform: none;
}

/* The ⋮ panel: the bar's fields past the line's end, one to a line, each label in a column before its field, under the button
   (report.js places it and sizes it to the window). The fields' own drop-downs, months and dates open over it. */
.report-filter-bar-panel {
    inset: auto;
    margin: 0;
    overflow-y: auto;
    padding: var(--space-3);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    background-color: var(--color-bg);
    color: var(--color-ink);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
}

.report-filter-bar-panel:popover-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
}

.report-filter-bar .report-filter-bar-panel > * {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    max-width: none;
}

.report-filter-bar .report-filter-bar-panel > * > :first-child {
    flex: 0 0 6.5rem;
    margin-right: 0;
    white-space: normal;
}

.report-filter-bar .report-filter-bar-panel > .report-option-text > input,
.report-filter-bar .report-filter-bar-panel > * > button.report-months-button,
.report-filter-bar .report-filter-bar-panel > * > button.report-single-pick-button,
.report-filter-bar .report-filter-bar-panel > * > button.report-date-range-field {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: none;
}

@media (max-width: 700px) {
    .report-filter-bar .report-filter-bar-panel > .report-option-text > input,
    .report-filter-bar .report-filter-bar-panel > * > button.report-months-button,
    .report-filter-bar .report-filter-bar-panel > * > button.report-single-pick-button,
    .report-filter-bar .report-filter-bar-panel > * > button.report-date-range-field {
        min-height: 40px;
    }
}

/* ── The Balance Sheet's filter bar (the owner, 2026-11-16: "Give Balance Sheet a filter bar (like Global search)") ──────────────────────
   _ReportFilterBar.cshtml in the statement's paper head, over the levels and the style: the companies in a drop-down (_ReportGroupedPick),
   the as-of date picker (_ReportSingleDate), Display columns by and Accounts view as selects, Compare To a drop-down of boxes. Each label
   beside its control, as the bar's other fields have theirs; the line keeps to one row, what does not fit under its ⋮ (above). */
.statement-paper-head > .report-filter-bar + .statement-toolbar {
    margin-top: 0;
}

.report-filter-bar .report-grouped-pick,
.report-filter-bar .report-single-pick,
.report-filter-bar .report-option-select,
.report-filter-bar .report-option-spinner,
.report-filter-bar .report-single-date {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--space-2);
    max-width: 100%;
}

.report-filter-bar .report-grouped-pick > .report-single-pick-label,
.report-filter-bar .report-single-pick > .report-single-pick-label,
.report-filter-bar .report-option-select > label,
.report-filter-bar .report-option-spinner > label,
.report-filter-bar .report-single-date > .report-single-date-label {
    color: var(--color-ink-muted);
    font-weight: 400;
    white-space: nowrap;
}

.report-filter-bar .report-grouped-pick > .report-single-pick-button,
.report-filter-bar .report-single-pick > .report-single-pick-button {
    width: 13rem;
    max-width: 100%;
    padding: 4px var(--space-2);
}

/* A fixed list's drop-down (Compare To) holds a few short names: "2 columns chosen" at most. */
.report-filter-bar .report-multi-pick.is-fixed > .report-single-pick-button {
    width: 10rem;
}

.report-filter-bar .report-option-select > select {
    width: auto;
    padding: 4px var(--space-2);
}

/* Number of periods: the panel's number box, as low as the bar's other fields. */
.report-filter-bar .report-option-spinner > input[type="number"] {
    width: 4.5rem;
    padding: 4px var(--space-2);
}

/* The as-of field: a sliding date's name and its date, "Last Month 10/31/2026", or the date alone. */
.report-filter-bar .report-single-date button.report-date-range-field {
    width: 15rem;
    padding: 4px var(--space-2);
}

.report-filter-bar .report-single-date-native {
    flex-direction: row;
    align-items: center;
}

.report-filter-bar .report-single-date-box {
    flex-direction: row;
    align-items: center;
}

/* A select whose words name a grouping (Display columns by's "Company group: 1 - Region"): one width, so the line does not move when the
   company picker's rail changes the words (the owner, 2026-11-17), nor when another entry is chosen. Measured: the longest words of the
   standard names, "Inter-Company group: Loc - Company Location", take 322px at the bar's 14px; a client's longer names are cut at the
   box, and the open list shows them whole. */
.report-filter-bar .report-option-select.is-naming > select {
    width: 20.5rem;
    max-width: 100%;
}

/* The company picker in its drop-down: wide enough for its rail and its names; the legend says again what the field's label says. */
.report-grouped-pick-panel {
    width: min(36rem, calc(100vw - 16px));
}

.report-grouped-pick-panel .report-picker > legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* In the bar's ⋮ panel, a select takes the room after its label, as the drop-downs' buttons do. */
.report-filter-bar .report-filter-bar-panel > .report-option-select > select,
.report-filter-bar .report-filter-bar-panel > .report-option-when > .report-option-select > select {
    flex: 1 1 0;
    min-width: 0;
}

/* A field that applies only while Display columns by holds certain values (Compare To, Number of periods) sits in a fieldset that draws no
   box, on the line and in the ⋮ panel alike: the field inside is laid out as the others are, fixed on the line, one to a row in the panel. */
.report-filter-bar.is-one-line > .report-filter-bar-fields > .report-option-when > * {
    flex: none;
}

.report-filter-bar .report-filter-bar-panel > .report-option-when {
    display: contents;
}

.report-filter-bar .report-filter-bar-panel > .report-option-when > * {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    max-width: none;
}

.report-filter-bar .report-filter-bar-panel > .report-option-when > * > :first-child {
    flex: 0 0 6.5rem;
    margin-right: 0;
    white-space: normal;
}

.report-filter-bar .report-filter-bar-panel > .report-option-when > * > button.report-single-pick-button {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: none;
}

/* A fixed list's drop-down (Compare To) is as wide as its few entries and the strip of what is ticked need. */
.report-multi-pick.is-fixed > .report-multi-pick-panel {
    width: min(22rem, calc(100vw - 16px));
}

/* The months field: its label over a button saying the months picked, which opens the dialog. */
.report-months {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
    font-size: var(--text-sm);
}

.report-months-label {
    font-weight: 600;
}

button.report-months-button {
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    padding: 6px var(--space-3);
    border: 1px solid var(--color-line);
    background-color: var(--color-bg);
    color: var(--color-ink);
    font-weight: 400;
    text-align: left;
}

button.report-months-button:hover {
    background-color: var(--color-bg);
    color: var(--color-ink);
    border-color: var(--color-focus);
    box-shadow: none;
    transform: none;
}

.report-months-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The drop-down (the owner's sketch, "Select reporting months"; under its button since 2026-11-23, the owner: "fit under it as a
   natural drop down"): a drop-down's box, as the bar's other drop-downs and the year picker have, which report.js places under the
   button and keeps on screen; no backdrop, so the page stays as it is around it. The year between previous and next arrows, the
   twelve months as tiles in a three-by-four grid, the picked ones filled with a tick, and Clear and Select all for the year in view at
   the foot. */
.report-months-dialog {
    position: fixed;
    inset: auto;
    width: min(22rem, calc(100vw - 16px));
    height: fit-content;
    max-height: calc(100vh - 16px);
    margin: 0;
    padding: 0;
    overflow: auto;
    color: var(--color-ink);
    background-color: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
    font-size: var(--text-sm);
}

.report-months-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-3) var(--space-2);
}

.report-months-year {
    font-size: var(--text-lg);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

button.report-months-step {
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--color-line);
    border-radius: 999px;
    background-color: var(--color-bg);
    color: var(--color-ink);
    box-shadow: none;
}

button.report-months-step:hover {
    background-color: var(--color-surface);
    color: var(--color-ink);
    box-shadow: none;
    transform: none;
}

button.report-months-step:disabled {
    opacity: 0.35;
    cursor: default;
}

/* The arrows, drawn: the app's icon set has no chevrons. */
.report-months-chevron {
    display: block;
    width: 0.55rem;
    height: 0.55rem;
    border-top: 2px solid currentColor;
    border-left: 2px solid currentColor;
}

.report-months-chevron.is-previous {
    transform: translateX(2px) rotate(-45deg);
}

.report-months-chevron.is-next {
    transform: translateX(-2px) rotate(135deg);
}

.report-months-panel {
    margin: 0;
    padding: 0 var(--space-3) var(--space-3);
    border: 0;
    min-width: 0;
}

/* One year at a time once report.js pages them; without script every year shows under its legend, and the arrows and the foot,
   which need script, are hidden. */
.report-months-dialog.is-paged .report-months-panel:not(.is-current) {
    display: none;
}

.report-months-dialog.is-paged .report-months-legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.report-months-legend {
    padding: 0;
    margin-bottom: var(--space-2);
    font-weight: 700;
}

.report-months-dialog:not(.is-paged) [data-months-nav],
.report-months-dialog:not(.is-paged) [data-months-foot] {
    display: none;
}

.report-months-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2) var(--space-3);
}

.report-months-tile {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 2.25rem;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    background-color: var(--color-bg);
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.report-months-tile:hover {
    border-color: var(--teal-300);
    background-color: var(--color-surface);
}

.report-months-tile input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.report-months-tile .fa-check {
    display: none;
    font-size: var(--text-xs);
    color: var(--teal-600);
}

.report-months-tile:has(input:checked) {
    border-color: var(--teal-300);
    background-color: var(--color-surface-alt);
    color: var(--teal-700);
}

.report-months-tile:has(input:checked) .fa-check {
    display: inline-block;
}

.report-months-tile:has(input:focus-visible) {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

.report-months-foot {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-1);
    padding: var(--space-2) var(--space-3) var(--space-1);
    border-top: 1px solid var(--color-line);
}

/* Clear and Apply, as the filters panel ends (Cancel and Apply Filters): at the right, Apply the primary. */
.report-months-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3) var(--space-3);
}

.report-months-dialog:not(.is-paged) [data-months-clear-all] {
    display: none;
}

/* The year picker (board 558: Cash on Cash Years): a drop-down under its button, as Include Fields' is, holding From and To over the
   months' tiles, one per year, six to a row (the owner's design C, 2026-12-03, when the years came to run from the client's first year),
   and Select all and Clear at its foot. Past six rows, 33 years, the tiles scroll under From and To. */
.report-single-pick-panel.report-years-panel {
    width: min(28rem, calc(100vw - 16px));
}

.report-years-range {
    display: flex;
    align-items: flex-end;
    gap: var(--space-2);
    margin-bottom: var(--space-1);
    padding: 0 4px;
}

.report-years-end {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-weight: 600;
}

.report-option .report-years-end select {
    width: 8rem;
}

.report-years-to {
    padding-bottom: var(--space-2);
    color: var(--color-ink-muted);
}

/* Room for a tile's focus ring (2px out, 2px wide), which the scroll would cut off at the edges. */
.report-years-tiles {
    margin: 0;
    padding: 4px;
    border: 0;
    min-width: 0;
    max-height: calc(17rem + 8px);
    overflow-y: auto;
}

.report-months-grid.report-years-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--space-2);
}

.report-years-grid .report-months-tile {
    min-height: 2.25rem;
}

/* A box beside the year picker (Include Transactions) sits in the middle of its button, whose padding is a pixel less than a select's. */
.report-years + .report-option-flag {
    padding-bottom: calc(var(--space-2) - 1px);
}

.report-years-foot {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-line);
}

/* ---- Account Research (board 554) ---------------------------------------------------------------- */

/* Logi's summary, one block for each way the mappings read the accounts picked: the transaction view's facts, a card each, laid out
   as many to a row as the paper holds. */
.account-research-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: var(--space-3);
    margin: 0 0 var(--space-4);
}

.account-research-block {
    margin: 0;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    background-color: var(--color-surface);
}

/* A searched list's note under the entries it found ("The first 50 are shown"), as the empty list's. */
[data-search-pick-note] {
    margin: 0;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
}

/* ── The report package (board 582; the owner's design, 2026-11-24) ─────────────────────────────────────────────────────────
   Report package, on Home's Favorites panel, left of Manage; and the drawer it opens, drawn as a report's Filters drawer is but
   from the right, wide enough for two lists side by side: the user's favorites, and the package in the order it prints. Over
   both, the name a package is saved under; at the foot, the Contents page tick, Make PDF and what is happening. Nothing in it
   moves as the package is made: a line's state takes its tools' place, and the foot's status line is kept for its words. */
.panel-head .report-package-open {
    margin-left: auto;
}

.panel-head .report-package-open + .panel-caption {
    margin-left: var(--space-2);
}

.report-filters.report-package {
    inset: var(--topbar-height) 0 0 auto;
    width: min(60rem, calc(100vw - 2 * var(--space-4)));
    border-right: 0;
    border-left: 1px solid var(--color-line);
}

@starting-style {
    .report-filters.report-package:popover-open {
        opacity: 0;
        transform: translateX(1.5rem);
    }
}

.report-package-content,
.report-package-form {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    height: 100%;
}

/* The name and Save, over both lists; the line under the name is kept for what Make PDF says about it. */
.report-package-name {
    flex: none;
    display: grid;
    grid-template-columns: auto 18rem auto minmax(0, 1fr);
    grid-template-rows: auto 18px;
    align-items: center;
    column-gap: var(--space-3);
    padding: var(--space-3) var(--space-5) 2px;
    border-bottom: 1px solid var(--color-line);
    background-color: var(--color-surface);
}

.report-package-name-label {
    font-weight: 600;
    font-size: var(--text-sm);
}

.report-package-name input[type="text"] {
    padding: 6px var(--space-3);
}

.report-package-name input.input-validation-error {
    border-color: var(--color-danger);
}

.report-package-name .report-package-check {
    margin-left: var(--space-3);
}

.report-package-name .report-package-hint {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-package-name-error {
    grid-column: 2 / 5;
    grid-row: 2;
    align-self: start;
    color: var(--color-danger);
    font-size: var(--text-xs);
}

.report-package-check {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    white-space: nowrap;
    cursor: pointer;
}

.report-package-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--color-focus);
}

.report-package-hint {
    color: var(--color-ink-muted);
    font-size: var(--text-xs);
}

.report-package-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
}

.report-package-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: var(--space-4) var(--space-5) 0;
}

.report-package-col.is-package {
    border-left: 1px solid var(--color-line);
    background-color: #fbfdfc;
}

.report-package-heading {
    margin: 0 0 var(--space-3);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--teal-700);
}

.report-package-search {
    margin-bottom: var(--space-3);
}

.report-package-list {
    margin: 0 calc(-1 * var(--space-2));
    padding: 0 var(--space-2) var(--space-3);
    list-style: none;
    overflow-y: auto;
    min-height: 0;
}

.report-package-col > .report-package-list {
    flex: 0 1 auto;
}

.report-package-empty {
    margin: 0 0 var(--space-3);
    padding: var(--space-4) var(--space-3);
    border: 1px dashed var(--color-line);
    border-radius: var(--radius-md);
    color: var(--color-ink-muted);
    font-size: var(--text-sm);
    text-align: center;
}

/* A favorite on the left: added by a click; one in the package keeps its place, marked with its number; one whose report has no
   PDF is greyed and says so (L4-Q6). */
.report-package-choice {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    align-items: center;
    column-gap: var(--space-2);
    padding: 7px var(--space-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.report-package-choice:hover,
.report-package-choice:focus-visible {
    background-color: var(--teal-50);
}

.report-package-choice-icon {
    grid-row: span 2;
    text-align: center;
    color: var(--color-primary);
}

.report-package-choice-name,
.report-package-choice-report {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-package-choice-report {
    grid-column: 2;
    color: var(--color-ink-muted);
    font-size: var(--text-xs);
}

.report-package-choice.is-added,
.report-package-choice.is-nopdf {
    cursor: default;
}

.report-package-choice.is-added .report-package-choice-name {
    color: var(--color-ink-muted);
}

.report-package-choice.is-nopdf .report-package-choice-name,
.report-package-choice.is-nopdf .report-package-choice-icon {
    color: var(--color-ink-muted);
    opacity: 0.75;
}

.report-package-choice.is-nopdf:hover {
    background: none;
}

.report-package-form.is-busy .report-package-col:first-child {
    opacity: 0.55;
    pointer-events: none;
}

/* A line of the package: its grip, its number, its favorite and report, and its arrows and x, which its state replaces while it prints. */
.report-package-item {
    display: grid;
    grid-template-columns: 16px 28px minmax(0, 1fr) 104px;
    align-items: center;
    column-gap: var(--space-2);
    margin-bottom: 4px;
    padding: 6px var(--space-2);
    background-color: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
}

.report-package-item.is-dragging {
    opacity: 0.5;
}

.report-package-item.is-failed {
    border-color: var(--color-danger);
    background-color: var(--color-danger-bg);
}

.report-package-grip {
    color: var(--teal-300);
    text-align: center;
    cursor: grab;
}

.report-package-form.is-busy .report-package-grip {
    visibility: hidden;
}

.report-package-num {
    display: inline-grid;
    place-items: center;
    box-sizing: border-box;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    border-radius: 4px;
    background-color: var(--color-focus);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.report-package-num.is-muted {
    background-color: var(--teal-150);
    color: var(--teal-700);
}

.report-package-item.is-failed .report-package-num {
    background-color: var(--color-danger);
}

.report-package-item-text {
    min-width: 0;
}

.report-package-item-name,
.report-package-item-sub {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-package-item-sub {
    color: var(--color-ink-muted);
    font-size: var(--text-xs);
}

.report-package-tools {
    display: flex;
    justify-content: flex-end;
    gap: 2px;
}

.report-package-tools[hidden] {
    display: none;
}

.report-package-icon,
.report-package-icon:hover,
.report-package-icon:active {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: none;
    box-shadow: none;
    transform: none;
    color: var(--color-ink-muted);
    font-size: 13px;
}

.report-package-icon:hover {
    background-color: var(--teal-100);
    color: var(--color-ink);
}

.report-package-icon:disabled {
    opacity: 0.3;
    cursor: default;
}

.report-package-state {
    text-align: right;
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
    white-space: nowrap;
}

.report-package-state.is-printing {
    color: var(--color-ink);
    font-weight: 600;
}

.report-package-state.is-printed {
    color: var(--color-success-icon);
}

.report-package-state.is-failed {
    color: var(--color-danger);
    font-weight: 600;
}

.report-package-state .is-spinning {
    animation: job-status-spin 1s linear infinite;
}

/* The line that puts the package together, under the package's lines while it is made. */
.report-package-merge {
    display: grid;
    grid-template-columns: 16px 28px minmax(0, 1fr) 104px;
    align-items: center;
    column-gap: var(--space-2);
    margin-top: 6px;
    padding: 6px var(--space-2);
    border-top: 1px dashed var(--color-line);
    color: var(--color-ink-muted);
    font-size: var(--text-sm);
}

.report-package-merge > .fas {
    grid-column: 2;
    text-align: center;
}

.report-package-merge[hidden] {
    display: none;
}

.report-package-foot {
    position: relative;
    flex: none;
    padding: var(--space-3) var(--space-5) var(--space-4);
    border-top: 1px solid var(--color-line);
    background-color: var(--color-surface);
}

/* The loading bar, along the foot's top edge while the package is made. */
.report-package-loading {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    overflow: hidden;
    background-color: var(--teal-150);
}

.report-package-loading::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 40%;
    background-color: var(--color-accent);
    animation: nav-progress-slide 1.6s ease-in-out infinite;
}

.report-package-loading[hidden] {
    display: none;
}

.report-package-status {
    display: flex;
    align-items: center;
    min-height: 46px;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
}

.report-package-note,
.report-package-progress {
    color: var(--color-ink);
}

.report-package-message {
    display: inline-flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: 4px 10px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    background-color: var(--color-surface-alt);
}

.report-package-message > .fas {
    margin-top: 3px;
}

.report-package-message.is-success {
    border-color: var(--color-success);
    background-color: var(--color-success-bg);
}

.report-package-message.is-success > .fas {
    color: var(--color-success-icon);
}

.report-package-message.is-danger {
    border-color: var(--color-danger);
    background-color: var(--color-danger-bg);
}

.report-package-message.is-danger > .fas {
    color: var(--color-danger);
}

.report-package-file {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--color-ink-muted);
}

.report-package-download {
    font-weight: 600;
    white-space: nowrap;
}

.report-package-foot-row {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.report-package-foot-end {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-left: auto;
}

.report-package-count {
    min-width: 6.5rem;
    color: var(--color-ink-muted);
    font-size: var(--text-sm);
    text-align: right;
}

/* A saved package's reports, in Edit Favorite. */
.field .field-label {
    display: block;
    margin-bottom: var(--space-1);
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--color-ink);
}

.favorite-package-reports {
    margin: 0;
    padding: var(--space-2) var(--space-3) var(--space-2) 2rem;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    background-color: var(--color-surface);
    font-size: var(--text-sm);
}

.favorite-package-reports li + li {
    margin-top: 2px;
}

/* Close as the dialogs' Cancel is, and Make PDF dimmed while it cannot run: nothing in the package, or one being made. */
.report-package-foot .link-button,
.report-package-foot .link-button:hover {
    padding: var(--space-2);
    background: none;
    border: 0;
    box-shadow: none;
    transform: none;
    color: var(--color-ink-muted);
    font-weight: 600;
}

.report-package-foot .link-button:hover {
    color: var(--color-ink);
}

.report-package-foot [data-report-package-make]:disabled,
.report-package-foot [data-report-package-make]:disabled:hover {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* The page for an address that is not there (the owner, 2026-12-01: design 2 of docs/design-discussion/not-found-page-mockups.html): a large
   404 in the light brand teal over the lime rule the header and the retired-reports page use, the headline, and Go to Home, centered in the
   main column. */
.not-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: var(--space-7);
    text-align: center;
}

.not-found .not-found-code {
    max-width: none;
    margin: 0;
    color: var(--teal-300);
    font-size: 112px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
}

.not-found-rule {
    width: 96px;
    height: 5px;
    margin: 14px 0 22px;
    border-radius: 3px;
    background: var(--color-accent);
}

.not-found h1 {
    margin: 0 0 10px;
    font-size: 1.6rem;
}

.not-found p {
    max-width: 34rem;
    margin: 0 0 22px;
    color: var(--color-ink-muted);
}

.not-found .button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
}

.not-found .not-found-help {
    margin-top: 22px;
    font-size: var(--text-sm);
}

/* QuickBooks Online (#540, D28; the mockup's view 1 and 3). The banner shows only when a file needs reconnecting or its connection
   ends soon, in the app's warning colours; the notice after a trip to QuickBooks is a status note, quieter when nothing changed. */
.qbo-attention {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin: 0 0 var(--space-4);
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--color-warning);
    border-radius: 10px;
    background-color: var(--color-warning-bg);
    color: var(--color-warning);
    font-size: var(--text-sm);
}

.qbo-attention .fas {
    margin-top: 3px;
}

.qbo-notice {
    margin-bottom: var(--space-4);
}

.qbo-notice.is-problem {
    color: var(--color-warning);
    background-color: var(--color-warning-bg);
}

/* Source GL Files' Import menu (D39): first on the page's left, so its list opens to the right, as the rail's Refresh menu's does. */
.source-files-import-menu .grid-menu-content {
    right: auto;
    left: 0;
}

/* A file's import in a refresh's toast (#541): a long company name wraps rather than running past the toast. */
.job-status-toast .qbo-import-chip .job-status-title {
    white-space: normal;
}

/* The panel's Delete followed in a toast (#541): the grid action region's status as the toast's words, with no space of its own
   around it; and the sentence grid.js leaves when it has lost track of the delete, which has no chip, still shows. */
.qbo-delete-toast .grid-import-report,
.qbo-delete-toast .grid-import-status {
    margin: 0;
}

.toast.qbo-delete-toast:has([data-import-stopped]) {
    display: flex;
}

/* A file's facts in its panel: a term and its value on a line. */
.qbo-facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: var(--space-1) var(--space-4);
    margin: var(--space-3) 0;
    font-size: var(--text-sm);
}

.qbo-facts dt {
    color: var(--color-ink-muted);
}

.qbo-facts dd {
    margin: 0;
}

.qbo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-3) 0;
}

/* The connect dialog's Basis: its hidden radios need a positioned ancestor in the dialog's scroll area (focus scrolls to them). */
.qbo-basis {
    position: relative;
}

/* Connect links (#603). The QuickBooks Online screen's two tabs, Files and Connect links, Home's tabs on a rule of their own (the
   owner's review, 2026-12-02); Connect a company's split button, whose main part is a link that opens the dialog, and whose list
   opens to the right, from the page's left edge; the dialog's choice of what the link lets them do, a radio a line; the link made,
   shown once in the BI Connector's token box. */
.qbo-tabs-strip {
    display: flex;
    align-items: flex-end;
    min-height: 2.75rem;
    margin-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-line);
}

.qbo-tabpanel {
    min-width: 0;
}

.qbo-split {
    position: relative;
}

a.split-button-main,
a.split-button-main:hover,
a.split-button-main:active {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-weight: 600;
    text-decoration: none;
}

.qbo-split > .split-button-menu {
    position: static;
}

/* The size of the screen's other buttons (the panel's Add cash basis and Import now, the bar's Import now), which Home's Refresh
   has no neighbours to match. */
.qbo-split .split-button-main,
.qbo-split .split-button-main:hover,
.qbo-split .split-button-main:active,
.qbo-split .split-button-menu > summary {
    height: 39px;
}

.qbo-split .split-button-main,
.qbo-split .split-button-main:hover,
.qbo-split .split-button-main:active {
    padding: 0 16px;
    font-size: var(--text-sm);
}

.qbo-split .grid-menu-content {
    left: 0;
    right: auto;
    min-width: 100%;
}

.qbo-link-purpose {
    border: 0;
    padding: 0;
    margin: var(--space-3) 0;
}

.qbo-link-purpose legend {
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.qbo-link-purpose .radio-field {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin: var(--space-1) 0;
    font-weight: normal;
}

/* A standard radio to the left of its words (the owner's review, 2026-12-02), not the form's full-width input above them: level
   with the first line, as the importer's choices are. */
.qbo-link-purpose .radio-field input[type="radio"] {
    flex: none;
    width: 16px;
    height: 16px;
    padding: 0;
    margin: calc((1.5em - 16px) / 2) 0 0;
    accent-color: var(--color-primary);
}

.qbo-link-purpose .qbo-basis {
    margin-top: var(--space-2);
}

/* The public QuickBooks Online pages (#603; the mockup's views 6 to 8): a page of its own, no app chrome. A white bar with the lime
   edge and the wordmark, one card in the middle, and QuickBooks' own "Connect to QuickBooks" button: Intuit's green, white text. */
body.qbo-public {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--color-surface);
    color: var(--color-ink);
}

.qbo-public-bar {
    display: flex;
    align-items: center;
    height: 52px;
    padding: 0 var(--space-5);
    background-color: var(--color-bg);
    border-bottom: 3px solid var(--color-accent);
}

.qbo-public-brand {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--teal-700);
}

.qbo-public-main {
    flex: 1;
    padding: var(--space-6) var(--space-4);
}

.qbo-public-card {
    max-width: 560px;
    margin: 0 auto;
    padding: var(--space-5) var(--space-6);
    background-color: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.qbo-public-card h1 {
    margin: 0 0 var(--space-3);
    font-size: 1.375rem;
}

.qbo-public-card ul {
    padding-left: 1.2rem;
}

.qbo-public-card li {
    margin-bottom: var(--space-1);
}

.qbo-public-done {
    margin: 0 0 var(--space-2);
    font-size: 2.25rem;
    line-height: 1;
    color: var(--color-success-icon);
}

.qbo-public-small {
    font-size: var(--text-sm);
    color: var(--color-ink-muted);
}

.qbo-public-footer {
    padding: var(--space-3) var(--space-5);
    text-align: center;
    color: var(--color-ink-muted);
}

.qbo-connect-button {
    display: inline-block;
    padding: 9px 18px;
    border: 1px solid #2ca01c;
    border-radius: 4px;
    background-color: #2ca01c;
    color: #ffffff;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
}

.qbo-connect-button:hover,
.qbo-connect-button:focus-visible {
    background-color: #108000;
    border-color: #108000;
}