/* ── Design tokens ────────────────────────────────────────────────────────────
   Neubrutalist chassis: flat colour, hard ink borders, hard offset shadows with
   no blur, no corner radius. Every colour in this file resolves from here in both
   themes, so a restyle is a token edit rather than a hunt through 1,700 lines.
   Before this, ~130 hardcoded hexes sat against ~44 var() references and four
   declared tokens were never consumed at all.

   Two rules keep the palette accessible without a per-component argument:

   1. Text on a COLOUR FILL is always --on-accent, which never flips. --ink flips
      to near-white in dark mode, but the accent fills stay light in both themes,
      so --ink on a mint badge would be unreadable at night.
   2. Coloured text on a SURFACE uses the --*-ink pair, never the fill colour.
      #ff7a6b is a fine background and a 2.4:1 failure as text on white.

   --brand-primary / --brand-secondary / --bs-primary / --bs-primary-rgb keep
   their names on purpose: _BuylistLayout.cshtml overrides exactly those four to
   paint a store's own accent (see Services/Buylist/BuylistAccentTheme.cs).
   Renaming them silently stops every custom buylist accent from applying. */
:root {
    color-scheme: light;

    /* Surfaces */
    --paper: #f5f0e6;
    --surface: #ffffff;
    --surface-sunken: #faf7ef;

    /* Ink is body text AND every border. One value doing both is what makes the
       style cohere: the border is not a divider, it is the same mark as the text. */
    --ink: #111111;
    --ink-muted: #57504a;
    --ink-rgb: 17, 17, 17;

    /* The offset block behind panels. Not a shadow in the optical sense: it is a
       solid rectangle with no blur, which is why it inverts to a LIGHTER colour in
       dark mode. A black offset against a near-black page is invisible. */
    --shadow: #111111;

    /* Accent fills. Four roles only. NN/g's guidance is 2-3 bold colours, and more
       than that on a screen carrying 22 panels reads as noise rather than meaning. */
    --brand-primary: #ffc107;
    --brand-secondary: #e0ac00;
    --brand-emphasis: #7a5b00;
    --ok: #5fd68b;
    --bad: #ff7a6b;
    --warn: #ffa23a;
    /* --notice is a surface, not an accent: it takes --ink, not --on-accent. */
    --notice: #e7e2d6;

    /* Text on any accent fill. Deliberately NOT redefined in the dark block. */
    --on-accent: #111111;
    /* The same, for Bootstrap properties that take r, g, b (the links in a coloured alert). */
    --on-accent-rgb: 17, 17, 17;

    /* Text on --brand-primary specifically. Identical to --on-accent everywhere except
       the public buylist, where a store picks its own accent and it may be dark enough
       that near-black on it is unreadable. BuylistAccentTheme already computes the
       right one by luminance; this is the seam it writes into. Anything that paints on
       --brand-primary AND can appear on the buylist must use this, not --on-accent. */
    --on-brand: var(--on-accent);

    /* Coloured text on a surface. The fills above are far too light for this. */
    --ok-ink: #14663a;
    --bad-ink: #9e2617;

    /* Trend chart series. Data ink, not UI accent, which is why a blue survives here in
       an app that deliberately removed blue everywhere else: the two lines are
       PriceCharting and JustTCG on one axis and they have to be told apart at a glance.
       The area fills are flat colours rather than alpha over the surface, so a chart
       reads the same whatever it is sitting on. */
    /* NOT var(--brand-secondary). The gold the buttons hover to is #e0ac00, which
       measures 2.09:1 against a white panel: under the 3:1 that WCAG 1.4.11 asks of a
       graphic carrying meaning, and this line IS the meaning. It was already that faint
       before the restyle; the audit is what caught it. This is the same hue taken dark
       enough to be seen. */
    --series-1: #a87f00;
    --series-2: #2f6df6;
    --series-1-area: #ffeab3;
    --series-2-area: #d7e3ff;

    /* Geometry */
    --edge-w: 2px;
    --edge-w-strong: 3px;
    --edge-w-hair: 1px;
    --shadow-off: 4px;
    --shadow-off-sm: 2px;
    --shadow-off-lg: 6px;
    --radius: 0;

    /* Spacing */
    --sp-1: .25rem;
    --sp-2: .5rem;
    --sp-3: .75rem;
    --sp-4: 1rem;
    --sp-5: 1.25rem;
    --sp-6: 2rem;

    /* Typefaces. The app declared none before this and inherited Bootstrap's system
       stack, which has no weight heavy enough to carry a blocky headline.
       Archivo is loaded as a variable font and used at 900 rather than as the separate
       Archivo Black family: at display sizes they are near-identical, and a weight axis
       means the system fallback still renders bold if the font never arrives, instead of
       dropping every heading to regular. */
    --font-display: Archivo, "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-body: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;

    /* Type scale. --fs-1 (12px) is the floor and is for uppercase labels, badges and counts
       only; a sentence is --fs-3 (14px) or larger (audit AY9). The root grows from 1920px
       (below), so every step grows with it on a large screen. */
    --fs-1: .75rem;
    --fs-2: .8125rem;
    --fs-3: .875rem;
    --fs-4: .95rem;
    --fs-5: 1.15rem;
    --fs-6: 1.5rem;
    --fs-7: 1.85rem;

    /* In rem, so the shell grows with the root: 1440px up to 1920, 1800px at 3840 (LS-SH6). */
    --app-max-width: 90rem;

    /* A panel's offset block, named for the one rule that reads it. */
    --app-panel-shadow: var(--shadow-off) var(--shadow-off) 0 var(--shadow);

    /* ── Component tokens (UI plan section 2, design-tokens) ─────────────────
       Added for the components and migrations that follow; no rule reads them
       yet, so adding them changed no pixel. docs/ui/tokens.md lists each with
       both themes. Colours are set again in the dark block below. The rest are
       the same in both themes: the theme attribute sits on <html>, which is
       this :root, so a token built from var(--ink) or var(--shadow) resolves
       to the dark value there too. */

    /* Coloured text on a surface, for the orange --warn fill (4.5:1 or more
       on paper, surface, sunken, notice and --row-flag). */
    --warn-ink: #8a4500;
    /* An informational fill, which takes --on-accent like the other accent
       fills, and its text-on-surface pair. */
    --info: #9ec3ff;
    --info-ink: #1f4fbf;
    /* A light rule between rows or items inside a panel. */
    --rule-soft: rgba(var(--ink-rgb), .15);
    /* A control that does not apply. Its text still clears 4.5:1. */
    --disabled-bg: #ebe6dc;
    --disabled-ink: #5f5851;
    /* The tint of a flagged table row (a drifted buylist line). The flag is
       also a bar and a badge, never the tint alone. Ink, muted ink and every
       --*-ink pair clear 4.5:1 on it. */
    --row-flag: #ffe8c7;

    /* Spacing: the half steps and the large steps the scale lacked. */
    --sp-0: .125rem;
    --sp-1h: .375rem;
    --sp-2h: .625rem;
    --sp-7: 2.5rem;
    --sp-8: 3rem;
    --sp-9: 4rem;
    /* The shell's side padding (today's literal 1.5rem in .app-shell). */
    --page-gutter: 1.5rem;

    /* Type: headings and display sizes named from today's clamp() literals. */
    --fs-h1: clamp(1.4rem, 2.3vw, 2rem);
    --fs-h2: 1.25rem;
    --fs-h3: 1.05rem;
    --fs-display-1: clamp(1.9rem, 4.5vw, 3.25rem);
    --fs-display-2: clamp(1.6rem, 4vw, 2.4rem);
    --lh-tight: 1.15;
    --lh-body: 1.5;
    /* Letter spacing of an uppercase label. */
    --tracking-caps: .04em;

    /* Measure and widths. 58ch is about 75 characters of Inter: ch is the width of "0", about
       .62em, while an average letter is about .47em, so 70ch held about 90 (css-fixes). */
    --measure: 58ch;
    --measure-form: 40rem;
    --narrow: 35rem;
    --shell-wide: 120rem;
    --toc-w: 15rem;
    --side-w: 20rem;

    /* Grid minimum track widths: a card tile, a card, a list row, a panel. */
    --tile-min: 10.625rem;
    --card-min: 16rem;
    --row-min: 24rem;
    --panel-min: 34rem;

    /* Controls. --control-h is today's literal form-control height. */
    --control-h: calc(1.5em + .75rem + 4px);
    --touch-min: 44px;
    --input-w-qty: 4.5rem;
    --input-w-num: 7rem;
    --field-w-xs: 8rem;
    --field-w-sm: 10rem;
    --field-w-md: 20rem;
    --field-w-lg: 32rem;

    /* Shadows as whole values. --shadow-md is the same block as --app-panel-shadow. */
    --shadow-sm: var(--shadow-off-sm) var(--shadow-off-sm) 0 var(--shadow);
    --shadow-md: var(--shadow-off) var(--shadow-off) 0 var(--shadow);
    --shadow-lg: var(--shadow-off-lg) var(--shadow-off-lg) 0 var(--shadow);
    --hover-lift: translate(-1px, -1px);

    /* Focus: a 3px ink outline 2px out, or 5px in when the control is flush to an edge. */
    --focus-ring: var(--edge-w-strong) solid var(--ink);
    --focus-offset: 2px;
    --focus-inset: -5px;

    /* Layers, lowest first. The first three are Bootstrap's dropdown, sticky
       and fixed levels. */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-sheet: 1030;
    --z-toast: 1080;
    /* Where a sticky side column stops below the top of the screen. */
    --sticky-top: var(--sp-4);
    /* The tallest a sticky action bar may be. */
    --sticky-bar-max: 4rem;
}

[data-bs-theme="dark"] {
    color-scheme: dark;

    --paper: #141210;
    --surface: #201c1a;
    --surface-sunken: #191614;

    --ink: #f2ede3;
    --ink-muted: #b9b1a6;
    --ink-rgb: 242, 237, 227;

    /* Lighter than the page, so the offset block reads as an embossed edge rather than
       a drop shadow. Raised from #3e3833, which measured 1.62:1 against the page and
       left the one mark this whole style is built on almost invisible at night. This is
       a legibility fix rather than a WCAG obligation: the block is decoration, and the
       2px border is what actually bounds the control (14.5:1). 3:1 is just a convenient
       bar that guarantees the block is seen.
       It has to clear that bar against BOTH grounds, not only the page: a stat tile
       inside a panel body throws its block onto --surface, not --paper. */
    --shadow: #756b62;

    /* Deepened just enough that --on-accent still clears 6:1 on every fill. */
    --brand-primary: #ffc107;
    --brand-secondary: #ffd24a;
    --brand-emphasis: #ffd24a;
    --ok: #4fc97e;
    --bad: #f06a5b;
    --warn: #ffa23a;
    --notice: #2c2724;

    --ok-ink: #7fdca6;
    --bad-ink: #f0a99f;

    /* On ink the problem inverts: the line has to be lighter, not darker. */
    --series-1: #ffd24a;
    --series-2: #7aa5ff;
    --series-1-area: #3a3016;
    --series-2-area: #1e2a45;

    /* The component colours (design-tokens). Text pairs are lighter here, as
       --ok-ink and --bad-ink are; --info stays light so --on-accent reads on it. */
    --warn-ink: #ffb870;
    --info: #7aa5ff;
    --info-ink: #a9c6ff;
    --rule-soft: rgba(var(--ink-rgb), .15);
    --disabled-bg: #2a2522;
    --disabled-ink: #a39a8f;
    --row-flag: #3a2a14;
}

/* ── Bootstrap mapped onto the tokens ─────────────────────────────────────────
   Bootstrap 5.3 is variable-driven, and this block is what carries the restyle to
   the 232 `btn btn-*`, 108 `form-control`, 71 `badge` and 24 raw `.card` call
   sites without editing a single view.

   Both selectors on purpose: Bootstrap ships its own [data-bs-theme="dark"] block
   at the same specificity as :root, so a :root-only rule here would lose to it on
   source order for anything Bootstrap also sets. */
:root,
[data-bs-theme="dark"] {
    --bs-font-sans-serif: var(--font-body);
    --bs-body-font-family: var(--font-body);
    --bs-body-bg: var(--paper);
    --bs-body-color: var(--ink);
    --bs-body-color-rgb: var(--ink-rgb);
    --bs-emphasis-color: var(--ink);
    --bs-secondary-color: var(--ink-muted);
    --bs-secondary-bg: var(--surface-sunken);
    --bs-tertiary-bg: var(--surface-sunken);

    --bs-border-width: var(--edge-w);
    --bs-border-color: var(--ink);
    --bs-border-color-translucent: var(--ink);

    /* One radius, everywhere, including pills. A rounded corner anywhere in this
       style reads as a rendering bug rather than a choice. */
    --bs-border-radius: 0;
    --bs-border-radius-sm: 0;
    --bs-border-radius-lg: 0;
    --bs-border-radius-xl: 0;
    --bs-border-radius-xxl: 0;
    --bs-border-radius-2xl: 0;
    --bs-border-radius-pill: 0;

    --bs-box-shadow: var(--shadow-off) var(--shadow-off) 0 var(--shadow);
    --bs-box-shadow-sm: var(--shadow-off-sm) var(--shadow-off-sm) 0 var(--shadow);
    --bs-box-shadow-lg: var(--shadow-off-lg) var(--shadow-off-lg) 0 var(--shadow);
    --bs-box-shadow-inset: none;

    --bs-primary: var(--brand-primary);
    --bs-primary-rgb: 255, 193, 7;
    --bs-success: var(--ok);
    --bs-danger: var(--bad);
    --bs-warning: var(--warn);
    --bs-info: var(--notice);

    --bs-link-color: var(--ink);
    --bs-link-hover-color: var(--ink);
    --bs-link-color-rgb: var(--ink-rgb);
    --bs-link-hover-color-rgb: var(--ink-rgb);

    --bs-focus-ring-color: rgba(255, 193, 7, .55);

    /* <code> in ink, not Bootstrap's pink, which is off the palette (audit SH18). */
    --bs-code-color: var(--ink);
}

/* The hidden attribute always hides. A display utility on the same element (d-block, d-grid,
   d-flex) used to win over the browser's own [hidden] rule, so Scan showed a broken image and
   the new-collection fields before anything was scanned (audit PT1, LS-PR2). One of the two
   !important rules the UI plan allows. */
[hidden] {
    display: none !important;
}

/* Every body: the auth screens (_AuthLayout) draw on the same paper and ink. It was
   body:not(.login-body) while the sign-in page drew its own ground; no body has that class now. */
body {
    background: var(--paper);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

/* Large screens. From 1920px the root grows with the viewport, 16px at 1920 to 20px at 3840,
   so text, controls, spacing and the rem shell scale together and a 4K screen at 100% reads
   like 1080p. Line lengths are set in ch, so lines do not get longer (audit LS-SH6, LS-AD3,
   LS-ME1, LS-PR5, LS-PR22, LS-SW8). The floor is 100%, so a reader's own larger default
   still wins; the rem term keeps the size following it. Below 1920 nothing changes. */
@media (min-width: 1920px) {
    html {
        font-size: clamp(100%, .75rem + .208333vw, 125%);
    }
}

/* Headings break into even lines instead of leaving one word on the last; running text avoids
   a lone last word. Browsers without text-wrap ignore both. */
h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
}

p, li, dd, figcaption, blockquote {
    text-wrap: pretty;
}

/* ── Skip link (keyboard / screen-reader accessibility) ─────────────────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--sp-4);
    z-index: 9999;
    padding: var(--sp-2) var(--sp-4);
    background: var(--brand-primary);
    color: var(--on-brand);
    border: var(--edge-w) solid var(--ink);
    border-top: 0;
    font-weight: 600;
    text-decoration: none;
    transition: top .1s;
}

.skip-link:focus {
    top: 0;
}

/* ── App shell ───────────────────────────────────────────────────────────── */
.app-shell {
    padding: var(--page-gutter);
    display: grid;
    /* minmax(0,…) stops any child's min-content from widening the page (mobile overflow) */
    grid-template-columns: minmax(0, 1fr);
    /* Wider than the old 1rem: every panel now throws a 4px solid block down and to
       the right, and at a 1rem gap the shadow of one panel touched the next. */
    gap: var(--sp-5);
}

/* The page is a grid of panels, and panels a page groups in one element (a live region around a
   job's panels, .app-page-group) keep the page's rhythm inside it. Pages used to set it themselves: 44 put Bootstrap's gap-3 (1rem, which
   undid the wider token) on .app-page, and others put mb-3 on panels, 2.25rem apart beside
   1.25rem; the page is a grid already (audit 2026-11-14, UA10). */
.app-page,
.app-page-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-5);
}

/* An alert in the page grid takes the gap like a panel; Bootstrap's 1rem margin under it
   made the space after it 2.25rem (UA10). */
.app-page > .alert,
.app-page-group > .alert {
    margin-bottom: 0;
}

/* ── Panels ──────────────────────────────────────────────────────────────── */
.app-panel {
    background: var(--surface);
    border: var(--edge-w) solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

/* A panel in a Bootstrap d-grid column (Buylist Details' side-by-side columns) sits in an
   implicit auto track, which grew to the min-content of a wide table inside the panel's own
   scroll region and pushed the page past the screen: 1132px at 1024, and at 768 once tables
   stopped stacking there (css-fixes). At min-width 0 the table scrolls inside its region. */
.d-grid > .app-panel {
    min-width: 0;
}

/* A table scroller contains its absolutely positioned descendants. A header's visually-hidden
   label (Bootstrap places it absolutely) otherwise takes its containing block from outside
   the scroller, so it is not clipped and still counts toward the page width: Buylist Details
   scrolled the page to 1068px at 1024 after its table already scrolled in its region. */
.table-responsive {
    position: relative;
}

/* Bootstrap's own card gets the identical chassis rather than being ported. 21 of
   the 24 raw `.card` uses live in Pages/Buylist/, the customer-facing surface that
   opted out of the tag helpers; restyling the class is how that folder joins the
   restyle without rewriting its markup. */
.card {
    --bs-card-bg: var(--surface);
    --bs-card-color: var(--ink);
    --bs-card-border-width: var(--edge-w);
    --bs-card-border-color: var(--ink);
    --bs-card-border-radius: 0;
    --bs-card-inner-border-radius: 0;
    --bs-card-cap-bg: var(--surface-sunken);
    --bs-card-cap-color: var(--ink);
    box-shadow: var(--shadow-md);
}

/* ── Nav icons ─────────────────────────────────────────────────────────────
   The icon before a word in the header's menus and sheet (_NavMenu, _NavSheet) and in a few
   admin buttons. The top bar itself is _AppHeader's, in components/nav.css. */
.nav-icon {
    margin-right: .4rem;
    font-size: .95em;
    vertical-align: -0.08em;
}

/* ── Dropdown menus ──────────────────────────────────────────────────────── */
.dropdown-menu {
    --bs-dropdown-bg: var(--surface);
    --bs-dropdown-color: var(--ink);
    --bs-dropdown-border-width: var(--edge-w);
    --bs-dropdown-border-color: var(--ink);
    --bs-dropdown-border-radius: 0;
    --bs-dropdown-link-color: var(--ink);
    --bs-dropdown-link-hover-color: var(--ink);
    --bs-dropdown-link-hover-bg: var(--surface-sunken);
    --bs-dropdown-link-active-color: var(--on-accent);
    --bs-dropdown-link-active-bg: var(--brand-primary);
    --bs-dropdown-header-color: var(--ink-muted);
    --bs-dropdown-divider-bg: var(--ink);
    box-shadow: var(--shadow-md);
    padding: .4rem;
    min-width: 12rem;
}

.dropdown-item {
    border-radius: var(--radius);
    padding: .45rem .65rem;
    font-weight: 500;
}

.dropdown-item .nav-icon {
    color: var(--ink-muted);
}

.dropdown-item.active .nav-icon,
.dropdown-item:hover .nav-icon {
    color: inherit;
}

/* ── Panel sections ──────────────────────────────────────────────────────── */
.panel-heading {
    padding: var(--sp-4) var(--sp-5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-4);
    flex-wrap: wrap;
    background: var(--surface);
}

/* Variant: top-align content blocks (e.g. heading + longer copy next to actions) */
.panel-heading--stacked {
    align-items: flex-start;
}

.panel-title,
.panel-copy {
    margin: 0;
}

.panel-title {
    letter-spacing: .01em;
    font-weight: 700;
    color: var(--ink);
}

h1.panel-title {
    font-size: var(--fs-h1);
}

h2.panel-title {
    font-size: clamp(1.15rem, 1.8vw, 1.45rem);
}

.panel-copy,
.stat-hint {
    color: var(--ink-muted);
}

/* A lede is often a span or div, which the paragraph rule in 01 does not reach. */
.panel-copy {
    text-wrap: pretty;
}

/* Running text stops at a readable measure; the panel stays full width. At 1920px a panel's copy
   ran about 170 characters a line (audit PT16, SA8, LS-SH3, LS-AD4, LS-SW10, LS-ME7). */
.panel-copy,
.panel-body > p,
.border-top-box > p {
    max-inline-size: var(--measure);
}

.panel-body {
    padding: var(--sp-4) var(--sp-5);
}

/* Separator section — adds a ruled line above its content */
.border-top-box {
    border-top: var(--edge-w-hair) solid var(--ink);
    padding: var(--sp-4) var(--sp-5);
}

/* No visual border when it is the first child (nothing above to separate from) */
.app-panel > .border-top-box:first-child {
    border-top: none;
}

/* Tables span edge-to-edge inside the panel, matching the Bootstrap card pattern */
.border-top-box.table-responsive {
    padding-inline: 0;
}

/* Safety net: direct panel children that aren't a known section still get breathing
   room, so bare-body panels never render text flush against the panel edge.
   Panels that lay themselves out (footer, stat/feature cards, the value hero) and
   full-bleed elements (tables, list groups) are excluded on purpose.
   Written with the Selectors 4 :not(a, b, c) list form; the same three rules used
   to be single-line chains of a dozen stacked :not() calls each. */
.app-panel:not(.app-footer, .stat-card, .landing-feature-card, .value-hero)
    > :not(.panel-heading, .panel-body, .border-top-box, .table-responsive, .list-group, .table, .row, nav, img) {
    padding-inline: var(--sp-5);
}

.app-panel:not(.app-footer, .stat-card, .landing-feature-card, .value-hero)
    > :not(.panel-heading, .panel-body, .border-top-box, .table-responsive, .list-group, .table, nav, img):first-child {
    padding-top: var(--sp-4);
}

.app-panel:not(.app-footer, .stat-card, .landing-feature-card, .value-hero)
    > :not(.panel-heading, .panel-body, .border-top-box, .table-responsive, .list-group, .table, nav, img):last-child {
    padding-bottom: var(--sp-4);
}

/* Bootstrap rows dropped straight into a panel: their negative gutter margins would
   overflow an unpadded panel, so inset them by the panel padding minus the gutter —
   the columns' own gutter padding then lands content exactly at 1.25rem. */
.app-panel > .row {
    margin-inline: calc(var(--sp-5) + var(--bs-gutter-x, 1.5rem) * -.5);
}

/* ── Panel width ─────────────────────────────────────────────────────────── */
/* A full panel spans every column of a grid it sits in (<app-panel full>). */
.panel-full {
    grid-column: 1 / -1;
}

/* ── Stats ───────────────────────────────────────────────────────────────── */
.stat-card {
    padding: var(--sp-4) var(--sp-5);
    display: grid;
    gap: .35rem;
}

.stat-label {
    font-size: var(--fs-3);
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--ink-muted);
}

.stat-value {
    font-size: var(--fs-6);
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.01em;
}

/* Stat tiles (Stats page) — same visual language as stat-card, inside a panel body */
.stat-tile {
    background: var(--surface);
    border: var(--edge-w) solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: var(--sp-4) 1.15rem;
    display: grid;
    gap: .3rem;
    align-content: start;
}

/* Was a gold gradient fade. Gradients are the one thing this style rejects outright,
   so the hero tile states itself with a flat gold fill and a deeper offset instead. */
.stat-tile--hero {
    background: var(--brand-primary);
    color: var(--on-accent);
    box-shadow: var(--shadow-md);
}

.stat-tile--hero .stat-label,
.stat-tile--hero .stat-value,
.stat-tile--hero .stat-hint,
.stat-tile--hero .stat-line,
.stat-tile--hero .stat-line strong {
    color: var(--on-accent);
}

.stat-delta--up {
    color: var(--ok-ink);
}

.stat-delta--down {
    color: var(--bad-ink);
}

.stat-line {
    display: flex;
    justify-content: space-between;
    gap: var(--sp-3);
    font-size: .92rem;
    color: var(--ink-muted);
}

.stat-line strong {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

/* Trend sparkline — server-rendered SVG; trend-chart.js adds the hover/tap dot */
.trend-chart {
    position: relative;
    border: var(--edge-w) solid var(--ink);
    border-radius: var(--radius);
    padding: var(--sp-3) .9rem var(--sp-2);
    background: var(--surface);
    /* Vertical swipes still scroll the page; horizontal drags scrub the chart */
    touch-action: pan-y;
}

/* Series palette: primary = PriceCharting (brand gold), alt = JustTCG (blue) */
.trend-line--primary {
    stroke: var(--series-1);
}

.trend-line--alt {
    stroke: var(--series-2);
}

.trend-line--hidden {
    display: none;
}

.trend-area--primary {
    fill: var(--series-1-area);
}

.trend-area--alt {
    fill: var(--series-2-area);
}

.trend-chart-legend {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
    padding-bottom: var(--sp-2);
}

.trend-toggle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: var(--fs-2);
    font-weight: 600;
    color: var(--ink);
    border: var(--edge-w-hair) solid var(--ink);
    border-radius: var(--radius);
    padding: .15rem .65rem;
    cursor: pointer;
    user-select: none;
}

.trend-toggle input {
    appearance: none;
    width: .65rem;
    height: .65rem;
    border-radius: 0;
    margin: 0;
    cursor: pointer;
    opacity: .25;
}

.trend-toggle input:checked {
    opacity: 1;
}

.trend-toggle--primary input {
    background: var(--series-1);
}

.trend-toggle--alt input {
    background: var(--series-2);
}

.trend-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 0;
    background: var(--series-1);
    border: var(--edge-w) solid var(--ink);
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .1s ease;
}

.trend-dot--alt {
    background: var(--series-2);
}

.trend-tooltip {
    position: absolute;
    transform: translate(-50%, -100%);
    display: grid;
    justify-items: center;
    background: var(--ink);
    color: var(--surface);
    border-radius: var(--radius);
    padding: .3rem .6rem;
    font-size: var(--fs-2);
    line-height: 1.3;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .1s ease;
    z-index: 5;
}

.trend-dot.is-visible,
.trend-tooltip.is-visible {
    opacity: 1;
}

.trend-tooltip-series {
    color: var(--surface);
    opacity: .78;
    font-size: var(--fs-1);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-caps);
}

.trend-tooltip-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.trend-tooltip-date {
    color: var(--surface);
    opacity: .78;
    font-size: var(--fs-1);
}

.trend-chart svg {
    display: block;
    width: 100%;
    height: 120px;
}

.trend-chart-range {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-1);
    color: var(--ink-muted);
    padding-top: .35rem;
}

/* Store Home's small charts (_StatChart): the SVG carries its own colours, so it reads the same
   in the Shopify admin, which loads none of this file. */
.stat-chart svg {
    display: block;
    width: 100%;
}

.stat-chart-range {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-1);
    color: var(--ink-muted);
    padding-top: .25rem;
}

/* Segmented window picker (1M / 3M / 6M / 1Y / Max). No view draws it now (the charts use
   <app-segmented>); these three rules stay only because FocusRingTests reads them, and go with
   those checks (css-sweep-2, docs/ui/dead-css/css-sweep-1.md). */
.window-picker {
    display: inline-flex;
    gap: 0;
    padding: 0;
    background: var(--surface);
    border: var(--edge-w) solid var(--ink);
    border-radius: var(--radius);
}

/* The options sit flush against each other and the strip's edge, so the ring goes inside. The
   strip used to clip with overflow:hidden, which cut an outside ring off (css-fixes). */
.window-picker-option:focus-visible {
    outline-offset: var(--focus-inset);
}

/* An inset ring on the selected option sits on the yellow fill, where the dark theme's paper ink
   reads at about 1.4:1. The fill's own text colour clears 3:1 there in both themes (css-fixes). */
.window-picker-option.active:focus-visible {
    outline-color: var(--on-accent);
}

/* ── Portfolio grid ──────────────────────────────────────────────────────── */
.portfolio-grid {
    display: grid;
    /* One extra pixel of gap over the old .9rem so the tiles' offset blocks do not
       land on the neighbouring tile's border. */
    gap: var(--sp-4);
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.portfolio-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: var(--edge-w) solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .12s ease, transform .12s ease;
    /* Keeps offscreen cards cheap to render on slow devices */
    content-visibility: auto;
    contain-intrinsic-size: auto 320px;
}

/* The tile lifts toward the pointer and its block deepens, which is the same motion
   as the button press run backwards. Border-colour was the old cue; with every tile
   already carrying a 2px ink edge there is no colour left to shift. */
.portfolio-card:hover,
.portfolio-card:focus-visible {
    color: inherit;
    transform: var(--hover-lift);
    box-shadow: var(--shadow-md);
}

/* A tile is a link, so it presses like one. */
.portfolio-card:active {
    transform: translate(var(--shadow-off-sm), var(--shadow-off-sm));
    box-shadow: none;
}

.portfolio-card-media {
    position: relative;
    display: block;
    aspect-ratio: 5 / 7;
    background: var(--surface-sunken);
    border-bottom: var(--edge-w-hair) solid var(--ink);
}

.portfolio-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: .4rem;
}

.portfolio-card-qty {
    position: absolute;
    top: .45rem;
    right: .45rem;
    background: var(--brand-primary);
    color: var(--on-accent);
    border: var(--edge-w-hair) solid var(--ink);
    font-size: var(--fs-1);
    font-weight: 700;
    padding: .1rem .45rem;
    border-radius: var(--radius);
}

/* Grade runs along the BOTTOM of the art, clear of the quantity in its corner (the rarity
   is text under the name). Accent-filled because on a graded card the grade is the number
   that decides the value. */
.portfolio-card-grade-badge {
    position: absolute;
    left: .45rem;
    right: .45rem;
    bottom: .45rem;
    text-align: center;
    background: var(--ink);
    color: var(--surface);
    border: var(--edge-w-hair) solid var(--ink);
    font-size: var(--fs-1);
    font-weight: 800;
    letter-spacing: .02em;
    line-height: 1.3;
    padding: .1rem .4rem;
    border-radius: var(--radius);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portfolio-card-body {
    /* Column flex, not grid: the price needs margin-top:auto to pin itself to the
       bottom, and auto margins do not absorb free space in a grid track the way they
       do in a flex line. */
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .6rem var(--sp-3) .7rem;
    /* Takes the tile's leftover height so there IS free space for the price to be
       pushed into; without this the body is only as tall as its content. */
    flex: 1 1 auto;
    min-height: 0;
}

.portfolio-card-name {
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    /* Two lines are RESERVED, not just the maximum. Clamping alone lets a one-line
       title make a shorter box, which moved everything under it up and left the price
       sitting at a different height on every tile in the row. */
    min-height: calc(2 * 1.3em);
}

a.portfolio-card-name:hover {
    color: inherit;
    text-decoration: underline;
}

.portfolio-card-grade {
    justify-self: start;
    font-size: var(--fs-1);
    font-weight: 700;
    color: var(--on-accent);
    background: var(--brand-primary);
    border: var(--edge-w-hair) solid var(--ink);
    border-radius: var(--radius);
    padding: .05rem .4rem;
    margin-top: .1rem;
}

.portfolio-card-price {
    /* Pinned to the bottom of the tile, so an optional grade line or a second meta
       row cannot shift it. Every price in a row lands on the same baseline. */
    margin-top: auto;
    padding-top: .2rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.portfolio-card-price small {
    font-size: var(--fs-1);
    font-weight: 600;
    color: var(--ink-muted);
}

.portfolio-card-price--none {
    color: var(--ink-muted);
    font-weight: 500;
    font-size: var(--fs-3);
}

/* Login styles are isolated in wwwroot/css/login.css */
/* ── Footer ──────────────────────────────────────────────────────────────── */
.app-footer {
    padding: var(--sp-4) var(--sp-5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-4);
    flex-wrap: wrap;
    background: var(--surface);
}

/* ── Inputs and actions ──────────────────────────────────────────────────────
   Every button is a bordered block with a hard offset. The variants differ only in
   fill, and the fill always takes --on-accent, so no button needs its own contrast
   argument in either theme. Overriding the --bs-btn-* custom properties rather than
   `background` keeps Bootstrap's hover/active/disabled states working. */
.btn {
    --bs-btn-border-width: var(--edge-w);
    --bs-btn-border-radius: var(--radius);
    /* Bootstrap paints this over box-shadow on :focus-visible. Left at its default
       glow it erased the offset block the moment a button took keyboard focus, so it
       is set to the offset itself; the focus ring is the outline, not a shadow. */
    --bs-btn-focus-box-shadow: var(--shadow-sm);
    border-radius: var(--radius);
    font-weight: 600;
    letter-spacing: .01em;
    box-shadow: var(--shadow-sm);
    transition: transform .06s ease, box-shadow .06s ease;
}

/* The press. The button moves by exactly its own offset and the block collapses, so
   the element lands where its shadow was. This is the style's main affordance cue:
   with no gradient, no rounding and no elevation, the offset block is the only thing
   saying a control is pressable, and the press is the only thing confirming it moved.
   The global prefers-reduced-motion block already flattens the transition to ~0s, so
   a reduced-motion user still gets the pressed STATE, just not the travel. */
.btn:active,
.btn:active:focus-visible {
    transform: translate(var(--shadow-off-sm), var(--shadow-off-sm));
    box-shadow: none;
}

/* Bootstrap re-applies --bs-btn-focus-box-shadow at higher specificity on
   :active:focus-visible, which would put the block back mid-press. */
.btn:active:focus-visible {
    --bs-btn-focus-box-shadow: none;
}

.btn i,
.btn span {
    position: relative;
}

.btn.btn-sm {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
}

.btn-primary {
    --bs-btn-color: var(--on-brand);
    --bs-btn-bg: var(--brand-primary);
    --bs-btn-border-color: var(--ink);
    --bs-btn-hover-color: var(--on-brand);
    --bs-btn-hover-bg: var(--brand-secondary);
    --bs-btn-hover-border-color: var(--ink);
    --bs-btn-active-color: var(--on-brand);
    --bs-btn-active-bg: var(--brand-secondary);
    --bs-btn-active-border-color: var(--ink);
}

/* Neutral buttons: the surface fill IS the variant. Outline and solid secondary
   collapse to the same treatment on purpose — with a 2px ink edge on everything,
   an "outline" button and a "light" button were rendering identically anyway. */
.btn-secondary,
.btn-light,
.btn-outline-secondary,
.btn-outline-dark,
.btn-outline-light {
    --bs-btn-color: var(--ink);
    --bs-btn-bg: var(--surface);
    --bs-btn-border-color: var(--ink);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-bg: var(--surface-sunken);
    --bs-btn-hover-border-color: var(--ink);
    --bs-btn-active-color: var(--ink);
    --bs-btn-active-bg: var(--surface-sunken);
    --bs-btn-active-border-color: var(--ink);
}

.btn-outline-primary {
    --bs-btn-color: var(--ink);
    --bs-btn-bg: var(--surface);
    --bs-btn-border-color: var(--ink);
    --bs-btn-hover-color: var(--on-accent);
    --bs-btn-hover-bg: var(--brand-primary);
    --bs-btn-hover-border-color: var(--ink);
    --bs-btn-active-color: var(--on-accent);
    --bs-btn-active-bg: var(--brand-primary);
    --bs-btn-active-border-color: var(--ink);
}

.btn-danger {
    --bs-btn-color: var(--on-accent);
    --bs-btn-bg: var(--bad);
    --bs-btn-border-color: var(--ink);
    --bs-btn-hover-color: var(--on-accent);
    --bs-btn-hover-bg: var(--bad);
    --bs-btn-hover-border-color: var(--ink);
    --bs-btn-active-color: var(--on-accent);
    --bs-btn-active-bg: var(--bad);
    --bs-btn-active-border-color: var(--ink);
}

.btn-outline-danger {
    --bs-btn-color: var(--bad-ink);
    --bs-btn-bg: var(--surface);
    --bs-btn-border-color: var(--ink);
    --bs-btn-hover-color: var(--on-accent);
    --bs-btn-hover-bg: var(--bad);
    --bs-btn-hover-border-color: var(--ink);
    --bs-btn-active-color: var(--on-accent);
    --bs-btn-active-bg: var(--bad);
    --bs-btn-active-border-color: var(--ink);
}

/* Success and warning, solid or outline: ink on the surface with an ink edge, filled with their
   colour under the pointer. Bootstrap's outline-warning was its yellow text on white (1.6:1) and
   its outline-success its green on the dark surface (3.7:1), the only yellow and green outline buttons
   in the app (audit AY4). The fill alone said nothing a word does not, so the four look alike at
   rest. */
.btn-success,
.btn-outline-success {
    --bs-btn-color: var(--ink);
    --bs-btn-bg: var(--surface);
    --bs-btn-border-color: var(--ink);
    --bs-btn-hover-color: var(--on-accent);
    --bs-btn-hover-bg: var(--ok);
    --bs-btn-hover-border-color: var(--ink);
    --bs-btn-active-color: var(--on-accent);
    --bs-btn-active-bg: var(--ok);
    --bs-btn-active-border-color: var(--ink);
}

.btn-warning,
.btn-outline-warning {
    --bs-btn-color: var(--ink);
    --bs-btn-bg: var(--surface);
    --bs-btn-border-color: var(--ink);
    --bs-btn-hover-color: var(--on-accent);
    --bs-btn-hover-bg: var(--warn);
    --bs-btn-hover-border-color: var(--ink);
    --bs-btn-active-color: var(--on-accent);
    --bs-btn-active-bg: var(--warn);
    --bs-btn-active-border-color: var(--ink);
}

.btn-dark {
    --bs-btn-color: var(--surface);
    --bs-btn-bg: var(--ink);
    --bs-btn-border-color: var(--ink);
    --bs-btn-hover-color: var(--surface);
    --bs-btn-hover-bg: var(--ink);
    --bs-btn-hover-border-color: var(--ink);
    --bs-btn-active-color: var(--surface);
    --bs-btn-active-bg: var(--ink);
    --bs-btn-active-border-color: var(--ink);
}

/* A link styled as a button has no block to offset. */
.btn-link {
    --bs-btn-color: var(--ink);
    --bs-btn-hover-color: var(--ink);
    box-shadow: none;
}

/* A control that does not apply, whatever its variant: the disabled surface and ink (4.5:1 or
   more), no offset block, since the block says "press me", and full opacity, since Bootstrap's
   .65 took the text under 4.5:1. A primary disabled button used to keep its yellow fill and read
   as live in the dark theme, and Scan's disabled Capture was Bootstrap's green (audit PT14). The
   aria-disabled form (07, the stepper at its bound) reads the same properties. A link button
   has no fill to grey out, so it keeps Bootstrap's. The variants above set no disabled values of
   their own: this rule outranks every one of them. */
.btn:not(.btn-link):disabled,
.btn.disabled:not(.btn-link),
fieldset:disabled .btn:not(.btn-link),
.btn[aria-disabled="true"]:not(.btn-link) {
    --bs-btn-disabled-color: var(--disabled-ink);
    --bs-btn-disabled-bg: var(--disabled-bg);
    --bs-btn-disabled-border-color: var(--disabled-ink);
    --bs-btn-disabled-opacity: 1;
    box-shadow: none;
    cursor: not-allowed;
}

.form-control:disabled,
.form-select:disabled {
    background-color: var(--disabled-bg);
    border-color: var(--disabled-ink);
    color: var(--disabled-ink);
    box-shadow: none;
    cursor: not-allowed;
}

/* A text link set on its own, not inside a sentence (a "View all", a footer link): its touch
   floor is in the touch layer (10). In a sentence a link stays a plain link, as WCAG exempts it. */
.link-action {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
}

/* Inputs take the ink edge but no resting offset: on a hundred-row table or the
   holding variant editor, a block behind every field is noise rather than emphasis.
   The offset appears on focus instead, where it means something. */
.form-control,
.form-select,
.form-check-input,
.input-group-text {
    border-width: var(--edge-w);
    border-color: var(--ink);
    border-radius: var(--radius);
    background-color: var(--surface);
    color: var(--ink);
}

.form-check-input:checked {
    background-color: var(--brand-primary);
    border-color: var(--ink);
}

/* The ring is the focus token, as on every other control (Focus styles, below). The yellow
   offset block that used to be the only sign measured 1.6:1 on white, under the 3:1 a focus
   indicator needs, so it stays in the dark theme only, where it clears that (audit AY3). */
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--ink);
    box-shadow: none;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] .form-check-input:focus {
    box-shadow: var(--shadow-off-sm) var(--shadow-off-sm) 0 var(--brand-primary);
}

.form-control::placeholder {
    color: var(--ink-muted);
}

.form-label,
.form-text,
.col-form-label {
    color: var(--ink);
}

.form-text {
    color: var(--ink-muted);
    max-inline-size: var(--measure);
    text-wrap: pretty;
}

/* A centred help line keeps its centre inside the measure. */
.form-text.text-center {
    margin-inline: auto;
}

/* Two Bootstrap components the variable mapping does not cover: a dialog (Report Incorrect
   Data on a card page) and a progress bar (no view draws one now; it keeps the palette, as the
   utilities below do). Both shipped with Bootstrap's own radius and a soft elevation, which is
   exactly the pair this style replaces. */
.modal-content {
    --bs-modal-bg: var(--surface);
    --bs-modal-color: var(--ink);
    --bs-modal-border-color: var(--ink);
    --bs-modal-border-width: var(--edge-w-strong);
    --bs-modal-border-radius: 0;
    --bs-modal-inner-border-radius: 0;
    --bs-modal-header-border-color: var(--ink);
    --bs-modal-footer-border-color: var(--ink);
    box-shadow: var(--shadow-lg);
}

.progress {
    --bs-progress-bg: var(--surface-sunken);
    --bs-progress-border-radius: 0;
    --bs-progress-box-shadow: none;
    border: var(--edge-w-hair) solid var(--ink);
}

.list-group {
    --bs-list-group-bg: var(--surface);
    --bs-list-group-color: var(--ink);
    --bs-list-group-border-color: var(--ink);
    --bs-list-group-border-width: var(--edge-w-hair);
    --bs-list-group-border-radius: 0;
    --bs-list-group-action-hover-bg: var(--surface-sunken);
    --bs-list-group-action-hover-color: var(--ink);
    --bs-list-group-active-bg: var(--brand-primary);
    --bs-list-group-active-color: var(--on-accent);
    --bs-list-group-active-border-color: var(--ink);
}

/* ── Tables ──────────────────────────────────────────────────────────────────
   The tempered end of the style. Everything else here carries a 2px edge and an
   offset block; a table does not, because /Store/Inventory renders 100 rows at a
   time and /Admin/Ingestion stacks 22 panels of them. A 2px rule on every cell of
   that turns a working screen into a grid of boxes with data trapped inside.

   So the weight goes where it separates rather than where it decorates: one solid
   ink header band, hairline rules between rows, no vertical rules at all, and no
   per-row shadow. The panel's own 2px border is the table's outer edge. */
.table {
    margin-bottom: 0;
    --bs-table-bg: transparent;
    --bs-table-color: inherit;
    --bs-table-border-color: var(--ink);
    /* Scoped down from the global 2px: this is what every cell's border-bottom
       inherits, and it is the difference between a rule and a wall. */
    --bs-border-width: var(--edge-w-hair);
    border-color: var(--ink);
}

/* The header band. Set through --bs-table-bg rather than background, because
   Bootstrap paints cells with an inset box-shadow that would cover it. */
.table > thead {
    --bs-table-bg: var(--ink);
    --bs-table-color: var(--paper);
}

.table > thead th {
    color: var(--paper);
    border-bottom: var(--edge-w) solid var(--ink);
    text-transform: uppercase;
    font-size: var(--fs-2);
    letter-spacing: var(--tracking-caps);
}

.table > thead a {
    color: var(--paper);
}

/* Zebra through Bootstrap's own striping variable, so .table-striped and this
   cannot end up fighting over the same cell. A row with a contextual class
   (tr.table-warning) keeps its own fill: the zebra painted the dark sunken surface under
   Bootstrap's black warning text, so a drifted buylist line was black on near-black in the
   dark theme (audit LS-SW2). In :where(), so the specificity stays what the stacked
   table's "no zebra" rule (05) was written against. */
.table > tbody > tr:where(:not([class*="table-"])):nth-of-type(odd) > * {
    --bs-table-bg-type: var(--surface-sunken);
}

/* A flagged row (a drifted buylist line, an import row that will be skipped): the --row-flag
   tint, which ink, muted ink and every --*-ink pair clear 4.5:1 on in both themes, and a bar
   down its first cell, so the flag is not the tint alone. Bootstrap's cream fill and black text
   did not follow the theme. An interim fix; mig-store-buylist-submissions moves the drift to a
   badge in its cell. */
.table > tbody > tr.table-warning {
    --bs-table-bg: var(--row-flag);
    --bs-table-color: var(--ink);
    --bs-table-border-color: var(--ink);
    --bs-table-striped-bg: var(--row-flag);
    --bs-table-striped-color: var(--ink);
    --bs-table-active-bg: var(--row-flag);
    --bs-table-active-color: var(--ink);
    --bs-table-hover-bg: var(--notice);
    --bs-table-hover-color: var(--ink);
    color: var(--ink);
}

.table > tbody > tr.table-warning > :first-child {
    box-shadow: inset var(--edge-w-strong) 0 0 var(--warn-ink),
        inset 0 0 0 9999px var(--bs-table-bg-state, var(--bs-table-bg-type, var(--bs-table-accent-bg)));
}

/* Hover is --notice rather than the brand: a row is full of badges and buttons that
   are themselves gold, mint or coral, and painting the row behind them in gold makes
   the controls disappear into it. */
.table > tbody > tr:hover > * {
    --bs-table-bg-state: var(--notice);
    --bs-table-color-state: var(--ink);
}

/* Group headings inside the body (the per-game bands on /Store/Inventory). These are
   the one row where the brand fill IS right: the row holds no controls to swallow,
   and it has to read as a section break rather than as another record. Listed after
   the zebra rule and matched down to the cell so it wins the tie on source order. The fill is
   also the cell's own background colour: painted only through Bootstrap's inset shadow, it was
   invisible to contrast checkers, which measured the ink text on the dark page, and to forced
   colours (audit SB12; its forced-colours rule is at the end of this file). */
.table > tbody > tr.table-group-heading > th,
.table > tbody > tr.table-group-heading > td {
    background-color: var(--brand-primary);
    --bs-table-bg-type: var(--brand-primary);
    color: var(--on-accent);
    border-top: var(--edge-w) solid var(--ink);
    border-bottom: var(--edge-w) solid var(--ink);
    font-weight: 700;
}

/* A heading is not a row you act on, so it does not answer the pointer. */
.table > tbody > tr.table-group-heading:hover > th,
.table > tbody > tr.table-group-heading:hover > td {
    --bs-table-bg-state: var(--brand-primary);
    --bs-table-color-state: var(--on-accent);
}

.table tbody td,
.table tbody th {
    border-color: var(--ink);
}

.table a {
    color: var(--ink);
}

.table a:hover {
    color: var(--ink);
}

.enriched-text {
    white-space: normal;
    line-height: 1.4;
}

.card-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 .35rem;
    margin: 0 .1rem;
    border-radius: var(--radius);
    border: var(--edge-w-hair) solid var(--ink);
    font-size: var(--fs-2);
    font-weight: 700;
    line-height: 1;
    vertical-align: text-bottom;
}

.card-symbol--mtg {
    background: var(--ink);
    color: var(--surface);
}

.card-symbol--pokemon {
    background: var(--brand-primary);
    color: var(--on-accent);
}

.card-symbol--generic {
    background: var(--surface-sunken);
    color: var(--ink);
}

.text-muted,
.small.text-muted,
.text-secondary {
    color: var(--ink-muted) !important;
}

/* The fill colours are far too light to be text. These are their readable pairs. */
.text-success { color: var(--ok-ink) !important; }
.text-danger  { color: var(--bad-ink) !important; }
.text-warning { color: var(--brand-emphasis) !important; }
.text-primary,
.link-primary { color: var(--ink) !important; }

/* Solid fills. Every one takes --on-accent, which does not flip with the theme. */
.bg-primary,
.text-bg-primary {
    background-color: var(--brand-primary) !important;
    color: var(--on-accent) !important;
}

.bg-success,
.text-bg-success {
    background-color: var(--ok) !important;
    color: var(--on-accent) !important;
}

.bg-danger,
.text-bg-danger {
    background-color: var(--bad) !important;
    color: var(--on-accent) !important;
}

.bg-warning,
.text-bg-warning {
    background-color: var(--warn) !important;
    color: var(--on-accent) !important;
}

.bg-info,
.text-bg-info {
    background-color: var(--notice) !important;
    color: var(--ink) !important;
}

.bg-secondary,
.text-bg-secondary,
.bg-light,
.text-bg-light {
    background-color: var(--surface-sunken) !important;
    color: var(--ink) !important;
}

.bg-dark,
.text-bg-dark {
    background-color: var(--ink) !important;
    color: var(--surface) !important;
}

/* .bg-body is Bootstrap's name for the page ground, so it stays paper. Only the
   tertiary/secondary steps become the sunken surface. */
.bg-body {
    background-color: var(--paper) !important;
}

.bg-body-tertiary,
.bg-body-secondary {
    background-color: var(--surface-sunken) !important;
}

.badge {
    letter-spacing: .02em;
    border: var(--edge-w-hair) solid var(--ink);
    border-radius: var(--radius);
}

.alert {
    --bs-alert-border-radius: var(--radius);
    border-width: var(--edge-w);
    border-color: var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    color: var(--on-accent);
}

.alert-success { background-color: var(--ok); }
.alert-danger  { background-color: var(--bad); }
.alert-warning { background-color: var(--warn); }
.alert-primary { background-color: var(--brand-primary); }

/* These fills keep their light colour in the dark theme, so everything on them takes
   --on-accent as the text does, not only the text: a link (Bootstrap colours it from
   --bs-link-color-rgb, which is --ink and flips), muted text, the dismiss X (Bootstrap inverts
   it under the dark theme) and the focus ring. In the dark theme each came out near-white on the
   light fill, about 1.6:1 (audit 2026-11-14, UA9). */
.alert-success,
.alert-danger,
.alert-warning,
.alert-primary {
    --bs-link-color: var(--on-accent);
    --bs-link-hover-color: var(--on-accent);
    --bs-link-color-rgb: var(--on-accent-rgb);
    --bs-link-hover-color-rgb: var(--on-accent-rgb);
    --bs-alert-link-color: var(--on-accent);
}

:is(.alert-success, .alert-danger, .alert-warning, .alert-primary) :is(.text-muted, .text-body-secondary) {
    color: inherit !important;
    opacity: .8;
}

:is(.alert-success, .alert-danger, .alert-warning, .alert-primary) .btn-close {
    filter: none;
}

/* The button forms are listed so this outranks the button ring further down. */
:is(.alert-success, .alert-danger, .alert-warning, .alert-primary) :is(:focus-visible, .btn:focus-visible, .btn-close:focus-visible) {
    outline-color: var(--on-accent);
}

/* --notice is a surface rather than an accent, so these two take --ink. */
.alert-info,
.alert-secondary,
.alert-light,
.alert-dark {
    background-color: var(--notice);
    color: var(--ink);
}

/* asp-validation-summary renders its container even when the model state is valid;
   without this the Review form shows a padded, empty danger alert on first load. */
.validation-summary-valid {
    display: none;
}

/* Red ink on a surface. A summary drawn as an alert (asp-validation-summary with
   alert alert-danger) sits on the --bad fill and takes the fill's text colour instead: red ink
   on the red fill failed contrast on the buylist Review form (audit BP4). */
.text-danger.field-validation-error,
.validation-summary-errors:not(.alert) {
    color: var(--bad-ink) !important;
}

/* ── Focus styles (keyboard navigation) ─────────────────────────────────── */
:focus-visible {
    /* Was gold, which vanished on the gold buttons. Ink clears 3:1 on every surface
       in the light theme and flips to paper in the dark one, so the ring is always
       the opposite of whatever it sits on.
       No box-shadow halo any more: box-shadow is now load-bearing geometry on
       buttons and panels, and a focus halo would erase the offset block. The 2px
       outline-offset does the separating instead. */
    outline: var(--edge-w-strong) solid var(--ink);
    outline-offset: 2px;
    border-radius: var(--radius);
}

/* The scanner's Photos and Folder buttons are labels around a visually hidden file input: the
   input takes the focus, the label shows it (audit 2026-11-14, UI-SCAN1). */
.scan-file-label:has(> input:focus-visible) {
    outline: var(--edge-w-strong) solid var(--ink);
    outline-offset: 2px;
}

/* Bootstrap takes the outline off a button that has focus (.btn:focus-visible and
   .btn-close:focus { outline: 0 }), and the rule above is less specific, so a button focused
   from the keyboard showed only its hover fill: on a button already in that fill, nothing at
   all (found 2026-11-14, plan "What the audit missed" 11). Equal specificity and later, so this
   wins; before the flip below, so a dark block still flips it. The dismiss X loses Bootstrap's
   glow as well, as a button lost its focus shadow: the ring is the outline, not a halo. */
.btn:focus-visible,
.btn-close:focus-visible {
    outline: var(--edge-w-strong) solid var(--ink);
    outline-offset: 2px;
}

.btn-close {
    --bs-btn-close-focus-shadow: none;
}

/* Fields the same way: Bootstrap sets outline 0 on a focused field at this specificity, so a
   keyboard user tabbing from a button into a form lost the ring there (audit AY3). */
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

/* Ink-on-ink is invisible, so anything sitting on a dark block flips the ring. */
.landing-hero :focus-visible,
.btn-dark:focus-visible,
.card-symbol--mtg:focus-visible {
    outline-color: var(--paper);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (forced-colors: active) {
    .app-panel,
    .app-footer,
    .card,
    .btn,
    .form-control,
    .form-select {
        forced-color-adjust: auto;
        border: 1px solid CanvasText;
    }

    /* The offset blocks carry no meaning the forced palette can express, and in a
       high-contrast palette they render as solid bars beside every control. */
    .app-panel,
    .card,
    .btn,
    .stat-tile,
    .portfolio-card,
    .alert,
    .dropdown-menu {
        box-shadow: none;
    }

    /* The heading band's fill is dropped by the forced palette, so a rule above and below and
       the system text colour keep it a section break. */
    .table > tbody > tr.table-group-heading > th,
    .table > tbody > tr.table-group-heading > td {
        forced-color-adjust: auto;
        color: CanvasText;
        border-block: var(--edge-w) solid CanvasText;
    }
}

/* ── Interim table floors (css-fixes) ──────────────────────────────────────
   No view draws the classes of the rules down to the end of the 768px fields block:
   Quick Import draws _CardAddRow and <app-split> (mig-quick-import), and the tables named
   below are <app-table>s now. They stay only because CssCorrectnessTests reads them, and go
   with those checks (docs/ui/dead-css/css-sweep-1.md). */
@media (max-width: 1199.98px) {
    .quick-import-layout {
        /* minmax(0, ...): a bare 1fr let the results table's 60rem (below) widen the page. */
        grid-template-columns: minmax(0, 1fr);
    }
}

/* From 768px the results are a table, not stacked cards. Below about 60rem of table it crushed
   its selects (Variant read "No", Language "Englisl", Condition "Near M" at 768, and Variant
   "Non" at 1024). On the one-column layout (768-1199px) the table keeps 60rem and scrolls
   inside its panel's .table-responsive until the panel is that wide. Each option select keeps
   room for "Non-Foil" and "Near Mint" (master read "No" and "Near Min" at 1280): in the add
   form's wrapping row a select that cannot keep it moves to its own line instead, and the
   quantity keeps room for two digits beside its spin buttons (at 1200 it had 2px of text).
   Seen at 320, 375, 768x1024, 1024x768, 1200x900, 1280x720, 1366x1024, 1920x1080 and
   3440x1440, light and dark: no page overflow, axe clean, every select showing its whole
   value. At 1200-1366 (results beside the side cart) the add form wraps to three lines in
   the cell; that is room, not clipping, and the results' layout is mig-quick-import's
   (css-fixes). */
@media (min-width: 768px) {
    .quick-import-results td.qi-option .form-select {
        min-inline-size: 8rem;
    }

    /* The add form's columns are percentages of the cell; the floor goes on the column (8rem
       of select plus the g-2 gutter) so the flex row wraps it rather than overlapping it. */
    .quick-import-results form > .qi-option:has(> .form-select) {
        min-inline-size: 8.5rem;
    }

    .quick-import-results form > .qi-option:has(> input[type="number"]) {
        min-inline-size: 5rem;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .quick-import-results .table-mobile-cards {
        min-inline-size: 60rem;
    }
}

/* The other stacked tables that are tables from 768 (they stacked at exactly 768 before) and
   whose fields the columns crushed there. Each field keeps room for its value, and the table
   scrolls inside its .table-responsive instead. A sweep of every .table-mobile-cards view at
   768x1024 found these (css-fixes):
   - Buylist Details' Cards: Condition read "Nea" and printing "Non" (the select pair in the
     Condition cell; the line's own form posts them). 11rem holds "Moderately Played".
   - PricingData's game rules: a number field 55px wide showed 0.25 as "0" and 0.85 as "0.8"
     (its spin buttons take about 24px of the field, so 6rem leaves about 44px of text).
   - Shopify Stores: the nickname field was 37px of text (at 1024 on master too).
   - Users' store domains and User Reports' resolution note shrank below the width their own
     rules give them (06), so their placeholders were cut; they get that width back.
   Seen at 768x1024 and 1024x768, light and dark. */
@media (min-width: 768px) {
    .table-mobile-cards td[data-label="Condition"] > .form-select {
        min-inline-size: 11rem;
    }

    .pricing-rules-table td > .form-control {
        min-inline-size: 6rem;
    }

    .table-mobile-cards td[data-label="Nickname"] .form-control {
        min-inline-size: 12rem;
    }

    .table-mobile-cards .store-domains-input {
        min-inline-size: 17.5rem;
    }

    .table-mobile-cards form > .app-select-narrow {
        min-inline-size: 200px;
    }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
/* The shell's phone padding is set once, in "Less padding on a phone" (08); this block's own
   padding was beaten by that one at every width but exactly 576px. The footer keeps its version
   and its 44px links centred on one line at every width (css-fixes). The phone top bar is
   _AppHeader's (components/nav.css). */
@media (max-width: 575.98px) {
    .panel-heading {
        align-items: flex-start;
    }

    /* Gap only. The track minimum stays at the base 160px on purpose: pairing a
       SMALLER minimum here with the narrower .app-shell padding below 576px made the
       column count go DOWN as the viewport got wider (3 columns at 576px, 2 at 577px),
       because the wider shell padding at 577px outweighed the larger track minimum. One
       track rule across all widths cannot invert like that. */
    .portfolio-grid {
        gap: var(--sp-3);
    }
}

/* Below Bootstrap's md, as the views' d-md-* cells and the PricingData game picker (d-md-none)
   are: at max-width 768px both layouts applied at exactly 768, so a tablet in portrait got
   stacked rows with desktop cells forced back into them, and PricingData hid every game but
   one with no picker to reach them (css-fixes). No view draws .pricing-rule-row now
   (PricingData's game rules are an <app-table>); its rule stays only because CssCorrectnessTests
   reads it (docs/ui/dead-css/css-sweep-1.md). */
@media (max-width: 767.98px) {
    .pricing-rules-table tbody tr.pricing-rule-row {
        display: none;
    }

    .table-mobile-cards thead {
        display: none;
    }

    .table-mobile-cards tbody,
    .table-mobile-cards tfoot,
    .table-mobile-cards tr,
    .table-mobile-cards td,
    .table-mobile-cards tfoot th {
        display: block;
        width: 100%;
    }

    /* Stacked rows get the full 2px rule where the desktop table gets a hairline.
       The reason inverts with the layout: on desktop the columns tell you where one
       record ends, and on a phone the separator is the ONLY thing that does. Still no
       offset block; a hundred stacked cards each throwing one is noise, not structure. */
    .table-mobile-cards tbody tr,
    .table-mobile-cards tfoot tr {
        padding: .8rem 0;
        border-top: var(--edge-w) solid var(--ink);
    }

    /* The desktop zebra reads as a rendering glitch once rows become blocks. */
    .table-mobile-cards > tbody > tr:nth-of-type(odd) > * {
        --bs-table-bg-type: transparent;
    }

    .table-mobile-cards tbody tr:first-child {
        border-top: 0;
    }

    .table-mobile-cards tbody td,
    .table-mobile-cards tfoot td,
    .table-mobile-cards tfoot th {
        border: 0;
        padding: .3rem 0;
    }

    .table-mobile-cards tbody td[data-label]::before,
    .table-mobile-cards tfoot td[data-label]::before,
    .table-mobile-cards tfoot th[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: .2rem;
        color: var(--ink-muted);
        font-size: var(--fs-1);
        font-weight: 700;
        letter-spacing: var(--tracking-caps);
        text-transform: uppercase;
    }

    /* d-none d-md-table-cell on a td hides it here (Bootstrap's !important wins over the
       stacked display:block) and keeps it in the desktop table.
       A cell with no content has nothing to say when rows stack (e.g. a null
       timestamp); hiding it also drops its data-label line. Mirrors the tfoot rule. */
    .table-mobile-cards tbody td:empty {
        display: none;
    }

    .table-mobile-cards tbody td.text-end,
    .table-mobile-cards tfoot td.text-end,
    .table-mobile-cards tfoot th.text-end {
        text-align: left !important;
    }

    /* Layout spacer cells (e.g. <th colspan="3"></th> aligning a totals row) have
       nothing to say when rows stack; without this they render as blank lines. */
    .table-mobile-cards tfoot td:empty,
    .table-mobile-cards tfoot th:empty {
        display: none;
    }

    /* Store pages put these tables inside padded panel sections; the public buylist
       puts them straight into a Bootstrap card, whose horizontal cell padding the
       stacked layout zeroes out. Restore the card's own 1rem inset there. */
    .card > .table-responsive > .table-mobile-cards tbody tr,
    .card > .table-responsive > .table-mobile-cards tfoot tr {
        padding-inline: var(--sp-4);
    }

    /* A panel whose body IS the table (body-class="border-top-box table-responsive") drops
       its inline padding so the desktop table runs edge to edge, and on desktop the cells'
       own padding insets the text. Stacked, the cells have no inline padding either, so the
       cards sat flush against the panel's edge with their labels out of line with the
       heading above. Give the rows the panel's inset; the phone size below narrows it with
       the panel's. */
    .border-top-box.table-responsive > .table-mobile-cards tbody tr,
    .border-top-box.table-responsive > .table-mobile-cards tfoot tr {
        padding-inline: var(--sp-5);
    }

    .table-mobile-cards tbody td .btn {
        width: 100%;
    }

    .table-mobile-cards .table-mobile-empty {
        text-align: left !important;
        padding: var(--sp-4) 0;
    }

    /* The public buylist's results are list rows now (mig-buylist-builder) and no view draws
       .table-mobile-buylist. This rule stays only because CssCorrectnessTests reads it
       (docs/ui/dead-css/css-sweep-1.md). */
    .table-mobile-buylist tbody td.buylist-sell-cell[data-label]::before {
        display: none;
    }
}

/* Sticky sell-list summary: below lg the cart renders below every search result, so this bar
   keeps the running totals and the jump-to-list link in reach after each Add. Its own block,
   matching the view's d-lg-none: inside the stacked-table block it was drawn unstyled from 768
   to 991px (css-fixes). */
@media (max-width: 991.98px) {
    .buylist-mobile-bar {
        position: sticky;
        bottom: 0;
        z-index: 10;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--sp-3);
        padding: .6rem .9rem;
        background: var(--surface);
        border-top: var(--edge-w) solid var(--ink);
        box-shadow: none;
    }
}

/* ── Marketing / Landing page ────────────────────────────────────────────── */
.landing-page {
    gap: 1.5rem;
}

.landing-hero {
    background: var(--ink);
    border-radius: var(--radius);
    padding: var(--sp-9) var(--sp-6);
    text-align: center;
    border: var(--edge-w-strong) solid var(--ink);
    box-shadow: var(--shadow-off-lg) var(--shadow-off-lg) 0 var(--brand-primary);
}

.landing-hero-inner {
    max-width: 680px;
    margin: 0 auto;
    display: grid;
    gap: var(--sp-5);
    justify-items: center;
}

.landing-hero-title {
    font-size: var(--fs-display-1);
    font-weight: 800;
    letter-spacing: -.025em;
    line-height: var(--lh-tight);
    color: var(--surface);
    margin: 0;
}

.landing-hero-accent {
    color: var(--brand-primary);
}

.landing-hero-copy {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: var(--surface);
    opacity: .82;
    line-height: 1.6;
    max-width: 520px;
    margin: 0;
}

.landing-hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    justify-content: center;
    margin-top: var(--sp-2);
}

.landing-feature-card {
    padding: var(--sp-6) 1.5rem;
    display: grid;
    gap: .85rem;
    transition: transform .15s ease, box-shadow .15s ease;
}

.landing-feature-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-lg);
}

.landing-feature-icon {
    font-size: 1.75rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    color: var(--on-accent);
    background: var(--brand-primary);
    border: var(--edge-w) solid var(--ink);
    border-radius: var(--radius);
}

.landing-feature-title {
    font-size: var(--fs-5);
    font-weight: 700;
    margin: 0;
    letter-spacing: .01em;
}

.landing-feature-copy {
    color: var(--ink-muted);
    line-height: 1.6;
    margin: 0;
    font-size: var(--fs-4);
}

.landing-game-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
}

@media (max-width: 575.98px) {
    .landing-hero {
        padding: 2.75rem var(--sp-5);
    }

    .landing-hero-cta .btn {
        width: 100%;
    }
}

/* Admin hub: each destination reads as a titled row with a plain-English line of
   what it is for, so the section can be scanned without opening anything. One shape
   for both hubs: the store hub used to hand-roll d-block/fw-semibold/text-muted
   utilities against the same class, so the two drifted apart. */
.admin-hub-link {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: var(--sp-3);
    align-items: start;
    padding: .6rem var(--sp-3);
    border: var(--edge-w) solid var(--ink);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: background-color .12s ease, transform .06s ease, box-shadow .06s ease;
}

.admin-hub-link:hover,
.admin-hub-link:focus-visible {
    background-color: var(--brand-primary);
    color: var(--on-accent);
}

.admin-hub-link:active {
    transform: translate(var(--shadow-off-sm), var(--shadow-off-sm));
    box-shadow: none;
}

.admin-hub-link:hover .admin-hub-link-copy,
.admin-hub-link:focus-visible .admin-hub-link-copy {
    color: var(--on-accent);
}

.admin-hub-link-icon {
    grid-row: 1 / span 2;
    align-self: center;
    font-size: 1.35rem;
    line-height: 1;
    color: var(--ink-muted);
}

.admin-hub-link-title {
    display: block;
    font-weight: 600;
}

.admin-hub-link-copy {
    display: block;
    font-size: var(--fs-3);
    color: var(--ink-muted);
}

/* The whole tile flips to the brand fill on hover and focus, so the icon has to
   come with it or it vanishes into the gold. */
.admin-hub-link:hover .admin-hub-link-icon,
.admin-hub-link:focus-visible .admin-hub-link-icon {
    color: var(--on-accent);
}

/* ── Collapsible nav sheet (below xl) ────────────────────────────────────────
   Above 1200px the bar shows every destination and this does not exist. Below it,
   Catalogue and Portfolio stay in the bar and everything else moves in here, which
   takes an admin's bar from eight controls and four nested dropdowns down to four.

   It is a full-width row inside the header rather than an overlay: the header
   grows downward and pushes the page, so nothing is covered and there is no scroll
   lock, no backdrop and no focus trap to get wrong. */
.nav-sheet {
    flex: 1 0 100%;
    order: 99;
}

/* One column, deliberately. Sections are closed on load, so each is a single row
   until opened; in a multi-column grid, opening one would stretch its whole grid
   row and leave a hole beside it. Eight closed rows also fit a phone without
   scrolling, which columns were only ever there to buy. */
.nav-sheet-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding-top: var(--sp-3);
    margin-top: var(--sp-3);
    border-top: var(--edge-w) solid var(--ink);
}

/* Sections are <details>, closed by default: the sheet opens to a scannable list
   of eight headings rather than forty links. Native disclosure rather than another
   collapse, so keyboard operation, aria-expanded and find-in-page work with no
   script and no ids to keep unique. */
.nav-sheet-section {
    border-bottom: var(--edge-w-hair) solid var(--ink);
}

.nav-sheet-section:last-child {
    border-bottom: 0;
}

.nav-sheet-section > summary {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2);
    cursor: pointer;
    /* Both are needed to drop the default triangle: the standard property and
       WebKit's pseudo-element. Without them the marker sits beside our chevron. */
    list-style: none;
}

.nav-sheet-section > summary::-webkit-details-marker {
    display: none;
}

/* Chevron, drawn rather than iconified so it can rotate with the open state. */
.nav-sheet-section > summary::after {
    content: "";
    margin-left: auto;
    width: .45rem;
    height: .45rem;
    border-right: var(--edge-w) solid currentColor;
    border-bottom: var(--edge-w) solid currentColor;
    transform: translateY(-.1rem) rotate(45deg);
    transition: transform .12s ease;
}

.nav-sheet-section[open] > summary::after {
    transform: translateY(.1rem) rotate(225deg);
}

.nav-sheet-section > summary:hover,
.nav-sheet-section > summary:focus-visible {
    background: var(--surface-sunken);
}

/* Indent the contents so an open section reads as belonging to its heading. */
.nav-sheet-section > :not(summary) {
    margin-left: var(--sp-3);
}

.nav-sheet-section[open] {
    padding-bottom: var(--sp-2);
}

.nav-sheet-heading {
    font-size: var(--fs-1);
    text-transform: uppercase;
    letter-spacing: var(--tracking-caps);
    font-weight: 700;
    color: var(--ink-muted);
    margin: 0;
}

/* Group labels inside the Admin section. Quieter and smaller than the section
   headings above them, so they read as divisions of Admin rather than as
   sections in their own right. --fs-1 is the floor, so they are quieter by their
   opacity and margin, not by a size under it (audit AY9). */
.nav-sheet-subheading {
    font-size: var(--fs-1);
    text-transform: uppercase;
    letter-spacing: var(--tracking-caps);
    font-weight: 700;
    color: var(--ink-muted);
    margin: var(--sp-3) 0 var(--sp-1);
    opacity: .85;
}

.nav-sheet-subheading:first-of-type {
    margin-top: var(--sp-2);
}

.nav-sheet-item {
    color: var(--ink);
    text-decoration: none;
    padding: .4rem .5rem;
    border: var(--edge-w-hair) solid transparent;
}

.nav-sheet-item:hover,
.nav-sheet-item:focus-visible,
.nav-sheet-item.active {
    color: var(--on-accent);
    background: var(--brand-primary);
    border-color: var(--ink);
}

/* The theme control is a button rather than a link, but it is a row like its
   neighbours. The hover rules above out-specify this, so it still highlights. */
button.nav-sheet-item {
    width: 100%;
    text-align: left;
    background: none;
    font: inherit;
}

.nav-sheet-who {
    margin: 0 0 var(--sp-1);
    font-size: var(--fs-2);
    color: var(--ink-muted);
    overflow-wrap: anywhere;
}

/* ── Mega menu rows ──────────────────────────────────────────────────────────
   A row in a header menu or the sheet: an icon beside a title and a one-line
   description. The dropdown panels are .nav-menu (components/nav.css). */
.nav-mega-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: var(--sp-2);
    row-gap: 0;
    align-items: start;
    white-space: normal;
    padding-block: .4rem;
}

.nav-mega-icon {
    grid-row: 1 / span 2;
    align-self: center;
    font-size: 1rem;
    line-height: 1;
    color: var(--ink-muted);
}

.nav-mega-title {
    font-weight: 600;
    line-height: 1.25;
}

/* A sentence, so --fs-3, not the label size (audit AY9). */
.nav-mega-copy {
    font-size: var(--fs-3);
    line-height: 1.35;
    text-wrap: pretty;
    color: var(--ink-muted);
}

/* Hover and keyboard focus flip the item to the brand fill, so the muted second
   line and the icon have to come with it or they disappear into it. Keyboard focus only: an
   item a mouse had clicked kept the flipped colours after the pointer left (css-fixes). */
.nav-mega-item:hover .nav-mega-copy,
.nav-mega-item:focus-visible .nav-mega-copy,
.nav-mega-item.active .nav-mega-copy,
.nav-mega-item:hover .nav-mega-icon,
.nav-mega-item:focus-visible .nav-mega-icon,
.nav-mega-item.active .nav-mega-icon {
    color: inherit;
}

/* ── Empty states ────────────────────────────────────────────────────────────
   One treatment for "nothing here yet", so an empty list reads as a state
   rather than a rendering failure. */
.app-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .35rem;
    padding: var(--sp-7) var(--sp-5);
    color: var(--ink-muted);
}

.app-empty-icon {
    font-size: 1.75rem;
    line-height: 1;
    color: var(--ink);
    margin-bottom: var(--sp-1);
}

.app-empty-title {
    margin: 0;
    font-weight: 600;
    color: var(--ink);
}

.app-empty-copy {
    margin: 0;
    font-size: .9rem;
    max-width: 42ch;
}

.app-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    justify-content: center;
    margin-top: var(--sp-3);
}

/* A compact empty state runs along the panel, so its copy stops at the measure rather than at
   the panel's edge (audit PT16). <app-empty compact> draws .app-empty-grid now
   (components/empty.css) and no view has this class; the rule stays only because
   CssCorrectnessTests reads it (docs/ui/dead-css/css-sweep-1.md). */
.app-empty--compact .app-empty-copy {
    max-width: var(--measure);
}

/* ── Timestamps ──────────────────────────────────────────────────────────────
   Relative by default with the exact UTC value on hover. */
.app-time {
    white-space: nowrap;
    border-bottom: 1px dotted var(--ink-muted);
    cursor: help;
}

/* Set filter combobox listbox. Replaces the inline z-index/max-height style. */
.set-filter-dropdown {
    z-index: 1050;
    max-height: 240px;
    overflow-y: auto;
}

/* The arrow-key active option needs to be visible without relying on focus, since
   focus stays on the input (aria-activedescendant pattern). */
.set-filter-dropdown [role="option"].active {
    background-color: var(--brand-primary);
    border-color: var(--ink);
    color: var(--on-accent);
}

/* Store-authored text (buylist messages, composed addresses): honour the line
   breaks the author typed without allowing arbitrary markup. */
.text-preline {
    white-space: pre-line;
}

/* Text kept exactly as written, every space and indent: what a member pasted into feedback or
   a report (a decklist, a stack trace). pre-line would fold its columns into single spaces
   (review of UA24). */
.text-prewrap {
    white-space: pre-wrap;
}

/* A table cell of free text someone typed (a report, a bio, feedback), kept to a readable
   measure so one long entry does not stretch the table. Pair with .text-preline to keep the
   writer's line breaks. Replaces three inline max-width styles on User Reports
   (audit 2026-11-14, UA24). */
.cell-prose {
    max-width: 20rem;
}

/* ── Card grid cell ──────────────────────────────────────────────────────────
   The catalogue reuses .portfolio-grid and .portfolio-card verbatim so the two
   pages cannot drift in shape or size. It adds one thing the portfolio does not
   have: a per-card action. The tile is a single anchor, so the button has to be
   a SIBLING of it inside the grid cell, never a child. */
.card-grid-cell {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    min-width: 0;
}

.card-grid-cell > .portfolio-card {
    /* The tile keeps its own height; the action sits under it. */
    flex: 1 1 auto;
}

.portfolio-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1);
    margin-top: .2rem;
}

.portfolio-card-price-label {
    color: var(--ink-muted);
    font-weight: 600;
    margin-right: .15rem;
}

/* ── Typography layer ────────────────────────────────────────────────────────
   Last in the file on purpose. Every rule here competes at the same specificity
   with the component rule that declares the element's own font-weight, so source
   order is what settles it; hoisting this block would leave .panel-title at 700.

   The display face stops at headings, numbers and controls. Body copy, table cells
   and form fields stay on Inter: a display weight in a paragraph is the single
   change that turns this style from bold into unreadable, and this app has screens
   that are almost entirely table. */
.panel-title,
.stat-value,
.landing-hero-title,
.landing-feature-title,
.app-empty-title {
    font-family: var(--font-display);
    font-weight: 900;
    letter-spacing: -.01em;
}

/* Controls and column headers: heavy, but a step back from the headings. At 900 a
   .btn-sm in the nav reads as a headline competing with the page title. */
.btn,
.table thead th,
.stat-label {
    font-family: var(--font-display);
    font-weight: 700;
}

/* ── Card scanner shell ──────────────────────────────────────────────────── */
/* Scanning is two-handed: card in one hand, phone in the other. If the page
   scrolls, the preview leaves the screen mid-capture and the tool is unusable.
   So on narrow screens the shell is pinned to the viewport and only the results
   below the camera scroll.

   The shell's height is set by card-scan.js rather than here, because it is
   "whatever is left below the navbar" and writing that in CSS means hard-coding
   a navbar height that changes with wrapping, banners and the browser's own
   collapsing chrome. 100dvh alone overflows by exactly that much. */
@media (max-width: 991.98px) {
    .scan-shell {
        display: flex;
        flex-direction: column;
        gap: var(--sp-3, .75rem);
        min-height: 0;
        overflow: hidden;
    }

    .scan-shell .scan-fixed {
        flex: 0 0 auto;
    }

    /* min-height:0 is load-bearing: without it a flex child refuses to shrink
       below its content and scrolls the PAGE instead of itself. */
    .scan-shell .scan-flex {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* The camera stage's size (a card's shape, bounded by the room card-scan.js
       measures) is areas/scan.css's #scan-stage.scan-stage. */

    /* NOT overflow:hidden. That clipped the main nav sheet when it expanded,
       which left no way off this page at all - the lock became a trap. It was
       never doing the work anyway: the shell is sized to exactly the space
       below the navbar, so the document already has nothing to scroll. What is
       wanted is only to stop the rubber-band overscroll that would drag the
       preview around, and to let the nav grow the page when it opens. */
    html.scan-locked,
    html.scan-locked body {
        overscroll-behavior-y: none;
    }

    /* The footer sits AFTER the shell, so the shell claiming every pixel below
       the header still left the page taller than the screen by exactly the
       footer's height - the last of the stubborn scroll. Version and Privacy
       are not worth a scrollbar on a viewport-locked scanner, and they are on
       every other page in the app. Only hidden while locked, so desktop and
       every other page keep it. */
    html.scan-locked .app-footer {
        display: none;
    }
}

/* Which pane shows below 992px is areas/scan.css's (.scan-panes > .scan-pane and its
   data-scan-off). */
@media (max-width: 991.98px) {
    /* The camera pane is the one that must not scroll: the whole point of the
       lock is that the preview holds still. The others are lists and are
       allowed to run long. */
    .scan-shell .scan-pane[data-pane="camera"] {
        overflow: hidden;
    }
}

/* Scanner results: vertical scrolling only. Inside an overflow-y:auto box anything
   wider than the box becomes real horizontal overflow and the list slides
   sideways, as long unbroken card names did. */
@media (max-width: 991.98px) {
    .scan-shell .scan-flex {
        overflow-x: hidden;
        overscroll-behavior-y: contain;
    }

    /* A flex child will not shrink below its content unless told to, which is
       what pushes a long name past the edge instead of wrapping it. Scoped to
       the text columns that actually need it: applying min-width:0 to EVERY
       descendant also hits the camera stage, whose size comes from an
       aspect-ratio and a max-width, and inviting that to collapse is how a
       viewfinder ends up the wrong shape. */
    .scan-shell .scan-pane .flex-grow-1,
    .scan-shell #scan-candidates .btn > span,
    .scan-shell #scan-basket .flex-grow-1 {
        min-width: 0;
    }

    .scan-shell #scan-candidates .btn {
        white-space: normal;
        overflow-wrap: anywhere;
        text-align: left;
    }
}

/* A button label longer than the screen must wrap, not push the whole page sideways.
   Bootstrap sets white-space: nowrap on .btn, which is right on a desktop toolbar and
   wrong on a phone: Admin > Ingestion carries a button reading "Force PriceCharting
   Price Refresh & Link IDs", and at 375px that one label made the entire document
   scroll horizontally. Measured at 99px of overflow before this rule.

   Scoped to the app shell so the buylist's own chrome is untouched, and paired with
   min-width:0 because a flex item will not shrink below its content without it. */
@media (max-width: 575.98px) {
    .app-shell .btn {
        white-space: normal;
        min-width: 0;
        max-width: 100%;
    }

    /* The button wrapping is only half of it. These buttons sit inside a <form>, and the
       FORM is the flex item: a flex item defaults to min-width:auto, so it refuses to
       shrink below its content and overflows the row no matter how the button behaves.
       Measured: the button reported white-space:normal and was still 372px wide in a
       343px column until the form was allowed to shrink. */
    .app-shell .d-flex > form,
    .app-shell .panel-actions > .app-action-bar-actions > form,
    .app-shell .d-flex > .btn {
        min-width: 0;
        max-width: 100%;
    }

    /* And one level further out. The row holding those forms is itself an item in a
       d-grid panel body, and a grid track sized `auto` takes its minimum from the item's
       min-content contribution - so the oversized row widened the track, the track widened
       the panel, and max-width:100% on the form resolved against a container that was
       already 428px inside a 375px viewport. Letting grid and flex children shrink is what
       actually stops the page scrolling sideways. */
    .app-shell .d-grid > *,
    .app-shell .d-flex > * {
        min-width: 0;
    }
}

/* ══ Collection management layer ══════════════════════════════════════════════
   The catalogue, portfolio and the two detail pages, restyled toward a collection
   app rather than an admin form: the value first, dense two-up grids on a phone,
   one-tap filters, and detail pages built around the card art instead of a small
   image beside a sparse table. New classes only; nothing above is renamed. */

/* ── Touch-friendly form controls ─────────────────────────────────────────────
   Checked boxes painted a white tick on the brand yellow, about 1.1:1: the state
   was carried by the fill alone. The tick is ink now. */
.form-check-input:checked[type="checkbox"] {
    --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23111111' stroke-linecap='square' stroke-width='3.5' d='m5 10 3.5 3.5L15 6.5'/%3e%3c/svg%3e");
}

.form-check-input[type="checkbox"] {
    width: 1.2em;
    height: 1.2em;
    margin-top: .15em;
    cursor: pointer;
}

/* A switch is a checkbox too, and the size above made it a 1.2em circle with no track to slide
   along (Settings, the scanner). It keeps Bootstrap's pill; phones size it in the touch rules
   at the end of the file. */
.form-switch .form-check-input[type="checkbox"] {
    width: 2em;
}

.form-check-label {
    cursor: pointer;
}

/* A <legend> carries Bootstrap's reboot: floated, full width and heading-sized. As a
   field label it has to look like every other label. */
legend.form-label {
    float: none;
    width: auto;
    font-size: 1rem;
    padding: 0;
}

/* Leading icon inside a text field (search boxes). */
.input-icon {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.input-icon > .bi {
    position: absolute;
    left: .8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-muted);
    pointer-events: none;
}

.input-icon > .form-control {
    padding-left: 2.3rem;
}

/* The shared card search box (_CardSearchBox): the field with its Search button attached. The bar
   is the positioning parent, so the suggestions open below the field AND the button, never over
   the button. Mobile first: one row at every width, the button keeping its label. */
.card-search-bar {
    position: relative;
    display: flex;
    min-width: 0;
}

.card-search-field {
    flex: 1 1 auto;
    min-width: 0;
}

.card-search-bar > .card-search-field > .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.card-search-submit {
    flex: none;
    margin-left: calc(-1 * var(--edge-w));
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    min-width: 5.5rem;
}

/* Card search suggestions: floats over whatever is below the box, one row per card with its
   thumbnail, name, where it is from, and price, so a price check needs no extra click. */
.search-suggest {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    /* Bootstrap's dropdown level: 1060 put an open list over a modal (1055) opened from
       the same page. The chassis's hard offset, not a blur, which nothing else in the file
       uses (audit 2026-11-14, UA23). */
    z-index: 1000;
    max-height: min(70vh, 32rem);
    overflow-y: auto;
    background: var(--surface);
    border: var(--edge-w) solid var(--ink);
    box-shadow: var(--shadow-off-sm) var(--shadow-off-sm) 0 var(--shadow);
}

.search-suggest-option {
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    padding: .45rem .75rem;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--ink-rgb), .12);
}

.search-suggest-option:last-child {
    border-bottom: 0;
}

.search-suggest-option:hover,
.search-suggest-option.active {
    background: var(--surface-sunken);
    color: var(--ink);
}

/* The arrow-key choice must be visible without focus, which stays in the input. */
.search-suggest-option.active {
    box-shadow: inset .25rem 0 0 var(--brand-primary);
}

.search-suggest-thumb {
    width: 2.5rem;
    aspect-ratio: 5 / 7;
    background: var(--surface-sunken);
    overflow: hidden;
}

.search-suggest-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.search-suggest-text {
    display: grid;
    min-width: 0;
}

.search-suggest-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-suggest-meta {
    font-size: var(--fs-2);
    color: var(--ink-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-suggest-price {
    display: grid;
    justify-items: end;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.search-suggest-price small {
    font-size: var(--fs-1);
    color: var(--ink-muted);
}

/* The words of an unpriced suggestion ("Not linked to TCGplayer yet") wrap onto two short lines
   rather than squeezing the card's name to a letter on a phone (pricing unit P3). The amount
   stays on one line. */
.search-suggest-price small {
    max-inline-size: 13ch;
    white-space: normal;
    text-align: end;
}

/* Segmented control: real radios, painted as one bordered strip of options. */

/* A checkbox as a tappable chip: the whole chip is the target, not a 16px square.
   The chip's face is the <span> after the input, so the checked state is a sibling
   selector rather than :has(), which older Safari lacks and which did not always
   repaint on a tick. */
.check-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.check-chip {
    position: relative;
    display: inline-flex;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.check-chip > .form-check-input {
    position: absolute;
    left: .8rem;
    top: 50%;
    z-index: 1;
    margin: 0;
    transform: translateY(-50%);
}

.check-chip > span {
    display: inline-flex;
    align-items: center;
    min-height: calc(1.5em + .75rem + 4px);
    padding: .35rem .8rem .35rem 2.35rem;
    border: var(--edge-w) solid var(--ink);
    background: var(--surface);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-3);
    white-space: nowrap;
}

.check-chip:hover > span {
    background: var(--surface-sunken);
}

.check-chip > .form-check-input:checked + span {
    background: var(--brand-primary);
    color: var(--on-accent);
}

/* The chip shows its focus with the ring every control has, not an offset block, which read as
   the chip's resting shadow (css-fixes). The ring goes round the whole chip, so the tick box
   inside does not draw a second one. */
.check-chip > .form-check-input:focus-visible + span {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

.check-chip > .form-check-input:focus-visible {
    outline: 0;
}

/* Inside a filled chip a yellow box would vanish into the chip; it goes light instead,
   and the ink tick above carries the state. */
.check-chip > .form-check-input:checked {
    background-color: #ffffff;
}

/* A button that says it is unavailable with aria-disabled rather than being disabled: a
   stepper's − or + at its bound (qty-stepper.js), which must keep a keyboard user's focus
   (audit 2026-11-14, P15). It looks as Bootstrap draws a disabled button, and does not press. */
.btn[aria-disabled="true"],
.btn[aria-disabled="true"]:hover,
.btn[aria-disabled="true"]:active {
    color: var(--bs-btn-disabled-color);
    background-color: var(--bs-btn-disabled-bg);
    border-color: var(--bs-btn-disabled-border-color);
    opacity: var(--bs-btn-disabled-opacity);
    cursor: default;
    transform: none;
}

/* Up / down movement next to a value. */
.value-delta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .35rem;
    margin: 0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ink-muted);
}

.value-delta--up {
    color: var(--ok-ink);
}

.value-delta--down {
    color: var(--bad-ink);
}

.value-delta-window {
    font-weight: 500;
    color: var(--ink-muted);
}

/* ── Tile grid density ────────────────────────────────────────────────────────
   A phone's tighter tiles. The grid's tracks at every width are components/card-tile.css's
   (two columns on a phone, rem tracks above). */
@media (max-width: 575.98px) {
    .portfolio-grid {
        gap: var(--sp-3) .6rem;
    }

    .portfolio-card-body {
        padding: .45rem .5rem .5rem;
    }

    .portfolio-card-name {
        font-size: var(--fs-2);
    }

    .portfolio-card-media img {
        padding: .25rem;
    }
}

/* The tile body is a flex column, where justify-self does nothing, so the detail chip (a
   slab's cert number) stretched the full tile width. It sizes to its text now. A line too long
   for the tile wraps, never cut: "1 of 1 here · Cert 89930383" lost its cert number to an
   ellipsis on a collection's slab tile at every width (final pass, leftovers). */
.portfolio-card-grade {
    align-self: flex-start;
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* Prices start at the same height on every tile rather than being pinned to the bottom. Pinned,
   a two-row price or a badge under it pushed the first row up, so "Nonfoil" sat at a different
   height on every tile in a row. With the name and meta both reserved at two lines, the first
   price row now lines up across the row, and any spare height falls below the badges. */
.portfolio-card-price {
    margin-top: .35rem;
}

/* Several labelled prices on one tile: one row each, label left, number right. */
.portfolio-card-price--rows {
    display: grid;
    gap: .05rem;
    font-size: .9rem;
}

.portfolio-card-price-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .35rem;
    min-width: 0;
}

.portfolio-card-price-row + .portfolio-card-price-row {
    font-size: var(--fs-2);
}

.portfolio-card-price-row > .portfolio-card-price-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portfolio-card-price-row > span {
    white-space: nowrap;
}

/* ── Portfolio headline ─────────────────────────────────────────────────── */
.value-hero {
    display: grid;
    gap: var(--sp-4);
    padding: var(--sp-4) var(--sp-5);
    grid-template-columns: minmax(0, 1fr);
}

.value-hero-main {
    display: grid;
    gap: .35rem;
    align-content: start;
}

.value-hero-title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: var(--fs-4);
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.value-hero-amount {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2.1rem, 6vw, 3.1rem);
    line-height: 1.05;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.value-hero-amount small {
    font-size: .4em;
    letter-spacing: 0;
    color: var(--ink-muted);
}

.value-hero-chart {
    min-width: 0;
}

.value-hero-chart .trend-chart svg {
    height: 110px;
}

.value-hero-foot {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2) var(--sp-4);
    padding-top: var(--sp-3);
    border-top: var(--edge-w-hair) solid var(--ink);
}

@media (min-width: 992px) {
    .value-hero {
        grid-template-columns: minmax(18rem, 1fr) minmax(0, 1.4fr);
        align-items: center;
    }

    /* A hero with nothing for its second column (the home's collection before it has a graph). */
    .value-hero.value-hero--solo {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ── Less padding on a phone ─────────────────────────────────────────────────
   Panel padding sized for a desktop was eating a fifth of a 375px screen: 16px of
   shell, 20px of panel, on both sides, before any content. */
@media (max-width: 575.98px) {
    .app-shell {
        padding: var(--sp-3);
    }

    .panel-heading,
    .panel-body,
    .border-top-box {
        padding: var(--sp-3) var(--sp-3);
    }

    .app-panel:not(.app-footer, .stat-card, .landing-feature-card, .auth-panel, .value-hero)
        > :not(.panel-heading, .panel-body, .border-top-box, .table-responsive, .list-group, .table, .row, nav, img) {
        padding-inline: var(--sp-3);
    }

    .border-top-box.table-responsive > .table-mobile-cards tbody tr,
    .border-top-box.table-responsive > .table-mobile-cards tfoot tr {
        padding-inline: var(--sp-3);
    }

    .app-panel > .row {
        margin-inline: calc(var(--sp-3) + var(--bs-gutter-x, 1.5rem) * -.5);
    }

    .value-hero {
        padding: var(--sp-3);
    }
}

.set-progress-head small {
    font-size: .5em;
    color: var(--ink-muted);
}

.set-progress {
    display: grid;
    gap: var(--sp-2);
    align-content: start;
}

.set-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--sp-2);
}

.set-progress .btn {
    justify-self: start;
}

.set-progress-bar {
    width: 100%;
    height: 1rem;
    appearance: none;
    border: var(--edge-w) solid var(--ink);
    background: var(--surface-sunken);
}

.set-progress-bar::-webkit-progress-bar {
    background: var(--surface-sunken);
}

.set-progress-bar::-webkit-progress-value {
    background: var(--brand-primary);
}

.set-progress-bar::-moz-progress-bar {
    background: var(--brand-primary);
}

/* Owned / Missing beside a set's progress, then Export Checklist: stacked on a phone, the
   button its own width. From 576px areas/portfolio.css makes it a flex row. */
.set-view-actions {
    display: grid;
    gap: var(--sp-2);
}

.set-view-actions .btn {
    justify-self: start;
}

/* A card of the set with no copy: the art greyed and faded, so it reads as a gap in the
   binder, with a Not Owned chip saying so in words. Full colour on hover or focus, since
   opening it is how it gets added. */
.portfolio-card--missing .portfolio-card-media img {
    filter: grayscale(1);
    opacity: .55;
    transition: filter .15s ease, opacity .15s ease;
}

.portfolio-card--missing:hover .portfolio-card-media img,
.portfolio-card--missing:focus-visible .portfolio-card-media img {
    filter: none;
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .portfolio-card--missing .portfolio-card-media img {
        transition: none;
    }
}

/* A card's movement over the last week, on its tile. */
.tile-change {
    padding: 0 .35rem;
    border: var(--edge-w-hair) solid var(--ink);
    font-size: var(--fs-1);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.tile-change--up {
    color: var(--ok-ink);
}

.tile-change--down {
    color: var(--bad-ink);
}

/* Holding tags: Up For Trade and a collector's own labels. The coloured chips take the
   accent tokens with --on-accent text, which never flips, so they read in both themes;
   the plain and gray chips follow the page's ink instead. */
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: 0 .4rem;
    border: var(--edge-w-hair) solid var(--ink);
    background: var(--surface);
    color: var(--ink);
    font-size: var(--fs-1);
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}

.tag-chip--yellow { background: var(--brand-primary); color: var(--on-accent); }
.tag-chip--green { background: var(--ok); color: var(--on-accent); }
.tag-chip--red { background: var(--bad); color: var(--on-accent); }
.tag-chip--orange { background: var(--warn); color: var(--on-accent); }
.tag-chip--gray { background: var(--notice); color: var(--ink); }

/* One row per tagged copy count on the holding page: the chip, the variant, the stepper. */
.tag-count-list {
    display: grid;
    gap: var(--sp-2);
    margin: 0 0 var(--sp-3);
    padding: 0;
    list-style: none;
}

.tag-count-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--sp-2) var(--sp-3);
}

.tag-count-row .tag-count-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    min-width: 0;
}

.is-selecting .portfolio-select-cell > .portfolio-card {
    cursor: pointer;
}

.portfolio-select-cell.is-selected > .portfolio-card {
    outline: var(--edge-w-strong) solid var(--brand-primary);
    outline-offset: 2px;
}

/* The cell portfolio-select.js looks for; the tile's own parts are placed inside it. */
.portfolio-select-cell {
    position: relative;
}

/* While selecting, a card's picture and link are not the browser's to drag: the selection is. */
.is-selecting .portfolio-select-cell img,
.is-selecting .portfolio-select-cell a {
    -webkit-user-drag: none;
}

.is-dragging,
.is-dragging * {
    cursor: grabbing;
    user-select: none;
}

/* Wishlist rows: the art, what is wanted, what it is worth; the editor folds open below. The
   row's columns are components/list-rows.css's. */
.wish-list {
    display: grid;
    gap: var(--sp-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.wish-row {
    display: grid;
    align-items: start;
    gap: var(--sp-2) var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    border: var(--edge-w) solid var(--ink);
    background: var(--surface);
}

.wish-row-main {
    display: grid;
    gap: .15rem;
    min-width: 0;
}

.wish-row-name {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.wish-row-value {
    display: grid;
    justify-items: end;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.wish-row-edit {
    grid-column: 1 / -1;
}

.wish-row-edit > summary {
    cursor: pointer;
    font-size: var(--fs-3);
    font-weight: 600;
}

@media (max-width: 575.98px) {
    .wish-row-value {
        grid-column: 2;
        justify-items: start;
        text-align: left;
    }
}

/* ── Trade offers ───────────────────────────────────────────────────────── */
/* How many offers wait on the member, beside Trade Offers and on the menu buttons. The
   brand fill of the x4 badge: a number someone is scanning for. */
.nav-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    margin-left: .35rem;
    padding: 0 .35rem;
    border: var(--edge-w-hair) solid var(--ink);
    border-radius: var(--radius);
    background: var(--brand-primary);
    color: var(--on-accent);
    font-size: var(--fs-1);
    font-weight: 800;
    line-height: 1.35;
}

/* An offer row: the count to put in sits where a wishlist row shows its value, and drops
   under the name on a phone, as the value does. */
.offer-pick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--sp-1) var(--sp-2);
}

@media (max-width: 575.98px) {
    .offer-pick {
        justify-content: flex-start;
    }
}

/* ── Section tabs and the trail ─────────────────────────────────────────────
   The tab bar itself (.section-tabs): components/section-nav.css (area-nav). Its grid of equal
   columns was removed there; the tab's own look stays here, and section-nav.css sets its
   width and wrapping. */
.section-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: calc(1.5em + .75rem + 4px);
    padding: .35rem .8rem;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-3);
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
}

.section-tab:hover {
    background: var(--surface-sunken);
    color: var(--ink);
}

.section-tab[aria-current] {
    background: var(--brand-primary);
    color: var(--on-brand);
}

/* A collector's Report fold. */
.profile-report > summary {
    cursor: pointer;
    font-size: var(--fs-3);
    color: var(--ink-muted);
}

/* The trail to a page: Portfolio › Collection › Card. Plain links, wrapping on a phone. */
.app-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 .35rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--fs-3);
}

.app-breadcrumb li {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-width: 0;
}

.app-breadcrumb li + li::before {
    content: "\203A";
    color: var(--ink-muted);
}

.app-breadcrumb [aria-current="page"] {
    font-weight: 700;
    overflow-wrap: anywhere;
}

/* The way around an area, above every page in a section: the trail to the area's home
   (Store Home, Admin Home), then the section's tabs. Spaced like the panels it sits over. */
.section-nav {
    display: grid;
    gap: .75rem;
    margin-bottom: 1.25rem;
}

.deck-issue-list,
.deck-source-list,
.deck-source-offers {
    display: grid;
    gap: var(--sp-1);
    margin: 0;
    padding: 0;
    list-style: none;
}

.deck-source-list {
    gap: var(--sp-2);
}

.deck-issue {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--sp-2);
    align-items: start;
}

.deck-issue--error i {
    color: var(--bad-ink);
}

.deck-issue--warning i {
    color: var(--brand-emphasis);
}

.deck-issue--notice i {
    color: var(--ink-muted);
}

/* Admin → Deck Formats: a pasted list reads best one card per line, in fixed width. */
.deck-list-form + .deck-list-form {
    padding-top: var(--sp-3);
    border-top: var(--edge-w) dashed var(--ink-muted);
}

.deck-list-entries {
    font-family: var(--bs-font-monospace, monospace);
    font-size: .9rem;
}

/* ── Touch targets: mobile first ─────────────────────────────────────────────
   Every control a finger can press is at least 44px tall (Apple's minimum, and WCAG
   2.5.5), with 16px text in fields so iOS does not zoom the page when one is focused.
   The one exception is a desktop with a mouse (at least 992px wide, hovering, a fine
   pointer), which aims to the pixel and keeps the compact sizes. So the rule reads "touch
   sizes unless it is certainly a mouse", not "touch sizes when it is certainly a phone":
   the old test (narrower than 576px, or a coarse pointer) missed large phones and left
   buttons at 32px and the menu's section toggles at 31px.

   The list holds the Bootstrap and legacy controls only. A component carries its own
   floor through --touch-min in its own file (UI plan section 3), so a new control goes
   there, not here. "Small" variants grow too: on a phone, small meant a target a thumb
   could not reliably hit. Last in the file on purpose: it
   overrides the base size of each control, and at equal specificity only a later rule
   can. Placed mid-file, the segmented control, the profile tabs and the Add options
   toggle each set their own min-height further down and quietly won. The 44px is also
   !important: it is a floor, and a component's own, more specific min-height (the
   catalogue's Load button had one at 40px) must not undercut it on a touch screen. */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .form-control,
    .form-select,
    .form-control-sm,
    .form-select-sm {
        min-height: 44px !important;
        font-size: 16px;
    }

    .form-check:not(.form-switch):not(.form-check-inline) {
        display: flex;
        align-items: center;
        gap: .6rem;
        min-height: 44px !important;
        padding-left: 0;
        margin-bottom: 0;
    }

    /* Help text inside a check row takes a line of its own under the label, lined up with the
       label's text (box plus gap). Without a wrap it became a third column, and at 320px the
       label was squeezed to a word or two a line (audit SA1). Only a row that holds help text
       wraps, so a check squeezed into an inline row (Buylist Details' Confirm drift) keeps its
       label beside the box as before. In a wrapping row the label starts from no width and
       grows into what is left, down to its longest word: the wrap moves the help text, never
       a long label off its box's line. */
    .form-check:has(> .form-text) {
        flex-wrap: wrap;
    }

    .form-check:has(> .form-text) > .form-check-label {
        flex: 1 1 0;
    }

    .form-check > .form-text {
        flex-basis: 100%;
        margin-top: 0;
        padding-left: calc(1.35rem + .6rem);
    }

    .form-check.form-switch > .form-text {
        padding-left: calc(2.6rem + .6rem);
    }

    .form-check:not(.form-switch):not(.form-check-inline) .form-check-input {
        float: none;
        margin: 0;
        width: 1.35rem;
        height: 1.35rem;
        flex: none;
    }

    /* A switch is a 2em pill by default; the whole row is the target here. */
    .form-check.form-switch {
        display: flex;
        align-items: center;
        gap: .6rem;
        min-height: 44px !important;
        padding-left: 0;
        margin-bottom: 0;
    }

    .form-check.form-switch .form-check-input {
        float: none;
        margin: 0;
        width: 2.6rem;
        height: 1.45rem;
        flex: none;
    }

    /* A section tab carries its own 44px (components/section-nav.css), as every component
       does through --touch-min. */
    .check-chip > span,
    .dropdown-item {
        min-height: 44px !important;
    }

    /* Buttons of every size, their label centred in the taller box. */
    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: .35rem;
        min-height: 44px !important;
    }

    .dropdown-item {
        display: flex;
        align-items: center;
    }

    /* Rows that open and close. The flex ones centre themselves; the rest (which keep the
       browser's own marker, so stay list items) get even padding to the same height. */
    .nav-sheet-section > summary {
        min-height: 44px !important;
    }

    .wish-row-edit > summary,
    .profile-report > summary {
        min-height: 44px !important;
        padding-block: .6rem;
    }

    /* Links set on their own, not inside a sentence. Inline links in prose are exempt, as
       WCAG exempts them. */
    .link-action {
        display: inline-flex;
        align-items: center;
        min-height: 44px !important;
    }

    /* Links set on their own in a deck's source lists, and the trail's links. */
    .deck-source-offers a,
    .app-breadcrumb a {
        display: inline-flex;
        align-items: center;
        min-height: 44px !important;
    }
}

/* ── Action bar (<app-action-bar>, TagHelpers/AppActionBarTagHelper.cs) ────────────
   One row of buttons for a task. docs/ui/components/action-bar.md has the API.

   Structure: .app-action-bar holds an optional status line (dirty-form), the actions
   (.app-action-bar-actions: the buttons and the More menu) and an optional danger slot.
   From 576px it is a row of buttons sized to their labels, placed by --align-*. Below
   576px --phone-row wraps, --phone-grid is two equal columns (one below 360px) and
   --phone-stack is one full-width column. */

.app-action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2) var(--sp-3);
    min-width: 0;
}

.app-action-bar--align-start { justify-content: flex-start; }
.app-action-bar--align-end { justify-content: flex-end; }
.app-action-bar--align-center { justify-content: center; }
.app-action-bar--align-between { justify-content: space-between; }

.app-action-bar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
    min-width: 0;
}

.app-action-bar--align-end .app-action-bar-actions { justify-content: flex-end; }
.app-action-bar--align-center .app-action-bar-actions { justify-content: center; }

/* Between: the first action on the start side (Back), the rest on the end side (Save). */
.app-action-bar--align-between .app-action-bar-actions {
    flex: 1 1 auto;
}

.app-action-bar--align-between .app-action-bar-actions > :first-child {
    margin-inline-end: auto;
}

/* A button: its icon and label are one unbreakable pair, the label wraps only when the
   button alone cannot fit its line, and a wrapped label stays centred and balanced. */
.app-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-1h);
    max-width: 100%;
    text-align: center;
}

.app-action > .bi {
    flex: none;
}

.app-action-label {
    min-width: 0;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

/* The More menu's toggle is a button like the others, and its caret sits with its label. */
.app-action-bar-more {
    display: inline-flex;
    max-width: 100%;
}

.app-action-bar-more > .dropdown-toggle::after {
    margin-inline-start: 0;
}

.app-action-menu-item {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    white-space: normal;
}

.app-action-menu-item > .bi {
    flex: none;
}

.app-action-menu-item--danger {
    color: var(--bad-ink);
}

.app-action-menu-item--danger:is(:hover, :focus) {
    color: var(--on-accent);
    background: var(--bad);
}

/* The destructive action, set apart on the far side: at the end, or at the start when
   the other buttons sit at the end. A rule beside it says it is a different kind. The tag
   helper writes it where it is drawn (first for align=end), so nothing here reorders it and
   Tab follows what is seen. */
.app-action-bar-danger {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-inline-start: auto;
    padding-inline-start: var(--sp-3);
    border-inline-start: var(--edge-w) solid var(--rule-soft);
}

.app-action-bar--align-end .app-action-bar-danger {
    margin-inline: 0 auto;
    padding-inline: 0 var(--sp-3);
    border-inline-start: 0;
    border-inline-end: var(--edge-w) solid var(--rule-soft);
}

/* Unsaved changes (dirty-form). Always in the page and empty until the form changes, so
   the one change is announced; nothing is drawn while it is empty. The square marks it
   beside the words, never instead of them. */
.app-action-bar-status {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    min-width: 0;
    margin: 0;
    font-size: var(--fs-3);
    font-weight: 700;
    line-height: var(--lh-tight);
}

/* Out of the flow while empty, so it takes no gap; still in the page, so still a live region. */
.app-action-bar-status:empty {
    position: absolute;
}

.app-action-bar-status:not(:empty)::before {
    content: "";
    flex: none;
    inline-size: var(--sp-3);
    block-size: var(--sp-3);
    background: var(--warn);
    border: var(--edge-w) solid var(--ink);
}

/* hide-when-visible: the script sets data-covered while the bar is stuck to the bottom of the
   screen and the thing it duplicates is on screen, and the bar hides only at the widths where it
   sticks (here for always and form; below-md and below-lg in their own queries further down). A
   bar at its own place, or an ordinary row at this width, stays shown, or it would leave a hole
   in the page beside that thing. Visibility, not display, so the page does not move when it
   comes back. */
.app-action-bar--sticky-always[data-covered],
.app-action-bar--sticky-form[data-covered] {
    visibility: hidden;
}

/* At rest: js/action-bar.js sets data-at-rest while a sticky bar sits at its own place in the
   page (at the end of its form) instead of stuck over it. It is then drawn plain, like any other
   row of buttons, and boxed only while stuck. Its buttons do not move between the two. In a panel
   the stuck box hangs out past the form's column into the panel's padding (see "In a panel"
   below), so its first button sits where the fields start, and at rest the margin, the inline
   padding and the side edges all go, so the box shrinks back to the column around buttons that
   stay put. Anywhere else the box keeps to its column and keeps its padding and edges at rest,
   unseen, so nothing moves there either. The top and bottom edges and padding always stay, so
   the bar keeps its height as it sticks and settles. Without the script it is boxed throughout.
   Keyed on the four modes, not the generic
   --sticky hook; a below-md or below-lg bar where it does not stick is drawn plain already, so
   the attribute changes nothing there. */
:is(.app-action-bar--sticky-always, .app-action-bar--sticky-form, .app-action-bar--sticky-below-md, .app-action-bar--sticky-below-lg, .app-action-bar--sticky-below-lg-or-short)[data-at-rest] {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.app-panel :is(.app-action-bar--sticky-always, .app-action-bar--sticky-form, .app-action-bar--sticky-below-md, .app-action-bar--sticky-below-lg, .app-action-bar--sticky-below-lg-or-short)[data-at-rest] {
    margin-inline: 0;
    padding-inline: 0;
    border-inline-width: 0;
}

/* ── Phones ──────────────────────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .app-action-bar--phone-grid,
    .app-action-bar--phone-stack {
        align-items: stretch;
    }

    .app-action-bar--phone-grid .app-action-bar-actions,
    .app-action-bar--phone-stack .app-action-bar-actions {
        display: grid;
        flex: 1 1 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }

    .app-action-bar--phone-stack .app-action-bar-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .app-action-bar--phone-grid .app-action-bar-actions > *,
    .app-action-bar--phone-stack .app-action-bar-actions > * {
        inline-size: 100%;
        margin-inline: 0;
    }

    .app-action-bar--phone-grid .app-action-bar-more > .btn,
    .app-action-bar--phone-stack .app-action-bar-more > .btn {
        flex: 1 1 auto;
    }

    /* The danger slot gets its own row under the others, with the rule above it; at the end
       it is written first, so its row is above them, with the rule under it. */
    .app-action-bar-danger,
    .app-action-bar--align-end .app-action-bar-danger {
        flex: 1 1 100%;
        margin-inline: 0;
        padding: var(--sp-2) 0 0;
        border-inline: 0;
        border-block-start: var(--edge-w) solid var(--rule-soft);
    }

    .app-action-bar--align-end .app-action-bar-danger {
        justify-content: flex-end;
        padding: 0 0 var(--sp-2);
        border-block-start: 0;
        border-block-end: var(--edge-w) solid var(--rule-soft);
    }

    .app-action-bar--phone-grid .app-action-bar-danger > *,
    .app-action-bar--phone-stack .app-action-bar-danger > * {
        flex: 1 1 100%;
    }
}

@media (max-width: 359.98px) {
    .app-action-bar--phone-grid .app-action-bar-actions {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ── Sticky ──────────────────────────────────────────────────────────────────────
   Stuck to the bottom of the screen inside its parent: a form bar is the last thing in its
   form, so it is on screen only while the form is and settles at the form's end. One row,
   at most --sticky-bar-max tall (a 44px button and the padding and edges), boxed like the
   other sticky bars. The page keeps room under focus for it, so a field you tab to is never
   behind it. The bar's own buttons and menu items cancel that room (a negative scroll margin
   of the same size), or focusing one would scroll the page by the room and unstick the bar.
   Both are set only where the bar sticks. */
.app-action-bar--sticky-always,
.app-action-bar--sticky-form {
    position: sticky;
    bottom: 0;
    z-index: var(--z-sticky);
    flex-wrap: nowrap;
    column-gap: var(--sp-2);
    max-block-size: var(--sticky-bar-max);
    padding: var(--sp-1h) var(--sp-3);
    background: var(--surface);
    border: var(--edge-w) solid var(--ink);
    box-shadow: var(--shadow-md);
}

html:has(.app-action-bar--sticky-always),
html:has(.app-action-bar--sticky-form) {
    scroll-padding-block-end: calc(var(--sticky-bar-max) + var(--sp-3));
}

:is(.app-action-bar--sticky-always, .app-action-bar--sticky-form) :is(.app-action, .app-action-menu-item) {
    scroll-margin-block-end: calc(-1 * (var(--sticky-bar-max) + var(--sp-3)));
}

/* A sticky bar is one row whatever the phone layout. The buttons keep their whole labels on
   one line and never shrink; the status takes what is left and wraps in its smaller type.
   So a sticky bar holds what fits a 320px screen beside "Unsaved Changes": one or two short
   labels, with the rest in the More menu. The status wraps at its spaces but never narrower
   than its longest word, so a bar that is too full shows as an overflow (which the screenshot
   checks catch), never as words drawn under a button.
   Like the covered state and the scroll margin, this is set only where the bar sticks: here
   for always and form, and for below-md and below-lg in their own queries. A below-md or
   below-lg bar on a wider screen is an ordinary row, which wraps and shrinks as any bar does,
   or in a narrow column its buttons would run off the side. The generic --sticky class is a
   hook for pages and sets nothing here. */
:is(.app-action-bar--sticky-always, .app-action-bar--sticky-form) .app-action-bar-actions {
    display: flex;
    flex: none;
    flex-wrap: nowrap;
}

:is(.app-action-bar--sticky-always, .app-action-bar--sticky-form).app-action-bar--align-between .app-action-bar-actions {
    flex: 1 1 auto;
}

:is(.app-action-bar--sticky-always, .app-action-bar--sticky-form) .app-action-bar-actions > * {
    flex: none;
    inline-size: auto;
}

:is(.app-action-bar--sticky-always, .app-action-bar--sticky-form) .app-action-label {
    white-space: nowrap;
}

:is(.app-action-bar--sticky-always, .app-action-bar--sticky-form) .app-action-bar-status {
    flex: 0 1 auto;
    min-width: min-content;
    gap: var(--sp-1h);
    font-size: var(--fs-2);
}

/* In a panel, and only there, a stuck bar hangs out past its form's column into the panel's
   padding, by its own inline padding and edge, so its first button sits where the fields start
   and stays there as the bar settles (the at-rest rule above, in a panel, drops the margin with the
   padding and the side edges; the hang-out for below-md, below-lg and phones is set in those
   media blocks below, after their own rules). A panel's padding is as wide as the hang-out, so the box and its
   offset shadow stay inside the panel and the page gutter. Anywhere else (a bar directly in the
   page column, as on the trade composer) the box keeps to its column: the page gutter is no wider
   than the hang-out plus the shadow, and the box would reach the screen's edge. There it keeps its
   padding and edges at rest too, unseen, so its buttons still stay put, inset by that padding. */
.app-panel :is(.app-action-bar--sticky-always, .app-action-bar--sticky-form) {
    margin-inline: calc(-1 * (var(--sp-3) + var(--edge-w)));
}

@media (max-width: 767.98px) {
    .app-action-bar--sticky-below-md {
        position: sticky;
        bottom: 0;
        z-index: var(--z-sticky);
        flex-wrap: nowrap;
        column-gap: var(--sp-2);
        max-block-size: var(--sticky-bar-max);
        padding: var(--sp-1h) var(--sp-3);
        background: var(--surface);
        border: var(--edge-w) solid var(--ink);
        box-shadow: var(--shadow-md);
    }

    html:has(.app-action-bar--sticky-below-md) {
        scroll-padding-block-end: calc(var(--sticky-bar-max) + var(--sp-3));
    }

    .app-action-bar--sticky-below-md :is(.app-action, .app-action-menu-item) {
        scroll-margin-block-end: calc(-1 * (var(--sticky-bar-max) + var(--sp-3)));
    }

    .app-action-bar--sticky-below-md[data-covered] {
        visibility: hidden;
    }

    .app-action-bar--sticky-below-md .app-action-bar-actions {
        display: flex;
        flex: none;
        flex-wrap: nowrap;
    }

    .app-action-bar--sticky-below-md.app-action-bar--align-between .app-action-bar-actions {
        flex: 1 1 auto;
    }

    .app-action-bar--sticky-below-md .app-action-bar-actions > * {
        flex: none;
        inline-size: auto;
    }

    .app-action-bar--sticky-below-md .app-action-label {
        white-space: nowrap;
    }

    .app-action-bar--sticky-below-md .app-action-bar-status {
        flex: 0 1 auto;
        min-width: min-content;
        gap: var(--sp-1h);
        font-size: var(--fs-2);
    }

    /* In a panel: see "In a panel" above. */
    .app-panel .app-action-bar--sticky-below-md {
        margin-inline: calc(-1 * (var(--sp-3) + var(--edge-w)));
    }
}

@media (max-width: 991.98px) {
    .app-action-bar--sticky-below-lg {
        position: sticky;
        bottom: 0;
        z-index: var(--z-sticky);
        flex-wrap: nowrap;
        column-gap: var(--sp-2);
        max-block-size: var(--sticky-bar-max);
        padding: var(--sp-1h) var(--sp-3);
        background: var(--surface);
        border: var(--edge-w) solid var(--ink);
        box-shadow: var(--shadow-md);
    }

    html:has(.app-action-bar--sticky-below-lg) {
        scroll-padding-block-end: calc(var(--sticky-bar-max) + var(--sp-3));
    }

    .app-action-bar--sticky-below-lg :is(.app-action, .app-action-menu-item) {
        scroll-margin-block-end: calc(-1 * (var(--sticky-bar-max) + var(--sp-3)));
    }

    .app-action-bar--sticky-below-lg[data-covered] {
        visibility: hidden;
    }

    .app-action-bar--sticky-below-lg .app-action-bar-actions {
        display: flex;
        flex: none;
        flex-wrap: nowrap;
    }

    .app-action-bar--sticky-below-lg.app-action-bar--align-between .app-action-bar-actions {
        flex: 1 1 auto;
    }

    .app-action-bar--sticky-below-lg .app-action-bar-actions > * {
        flex: none;
        inline-size: auto;
    }

    .app-action-bar--sticky-below-lg .app-action-label {
        white-space: nowrap;
    }

    .app-action-bar--sticky-below-lg .app-action-bar-status {
        flex: 0 1 auto;
        min-width: min-content;
        gap: var(--sp-1h);
        font-size: var(--fs-2);
    }

    /* In a panel: see "In a panel" above. */
    .app-panel .app-action-bar--sticky-below-lg {
        margin-inline: calc(-1 * (var(--sp-3) + var(--edge-w)));
    }
}

/* below-lg-or-short: below-lg, and also on a wide screen shorter than 600px, where a column that
   sticks (app-split's side needs 600px of height) scrolls away with the page and its commit row
   with it. The same sticky state as below-lg, under either query (the trade composer's Send bar,
   which carried its own copy of these rules in trade-composer.css until this option; final pass,
   leftovers). */
@media (max-width: 991.98px), (max-height: 599.98px) {
    .app-action-bar--sticky-below-lg-or-short {
        position: sticky;
        bottom: 0;
        z-index: var(--z-sticky);
        flex-wrap: nowrap;
        column-gap: var(--sp-2);
        max-block-size: var(--sticky-bar-max);
        padding: var(--sp-1h) var(--sp-3);
        background: var(--surface);
        border: var(--edge-w) solid var(--ink);
        box-shadow: var(--shadow-md);
    }

    html:has(.app-action-bar--sticky-below-lg-or-short) {
        scroll-padding-block-end: calc(var(--sticky-bar-max) + var(--sp-3));
    }

    .app-action-bar--sticky-below-lg-or-short :is(.app-action, .app-action-menu-item) {
        scroll-margin-block-end: calc(-1 * (var(--sticky-bar-max) + var(--sp-3)));
    }

    .app-action-bar--sticky-below-lg-or-short[data-covered] {
        visibility: hidden;
    }

    .app-action-bar--sticky-below-lg-or-short .app-action-bar-actions {
        display: flex;
        flex: none;
        flex-wrap: nowrap;
    }

    .app-action-bar--sticky-below-lg-or-short.app-action-bar--align-between .app-action-bar-actions {
        flex: 1 1 auto;
    }

    .app-action-bar--sticky-below-lg-or-short .app-action-bar-actions > * {
        flex: none;
        inline-size: auto;
    }

    .app-action-bar--sticky-below-lg-or-short .app-action-label {
        white-space: nowrap;
    }

    .app-action-bar--sticky-below-lg-or-short .app-action-bar-status {
        flex: 0 1 auto;
        min-width: min-content;
        gap: var(--sp-1h);
        font-size: var(--fs-2);
    }

    /* In a panel: see "In a panel" above. */
    .app-panel .app-action-bar--sticky-below-lg-or-short {
        margin-inline: calc(-1 * (var(--sp-3) + var(--edge-w)));
    }
}

@media (max-width: 575.98px) {
    .app-action-bar--sticky-always,
    .app-action-bar--sticky-form,
    .app-action-bar--sticky-below-md,
    .app-action-bar--sticky-below-lg,
    .app-action-bar--sticky-below-lg-or-short {
        padding-inline: var(--sp-2);
    }

    /* In a panel: see "In a panel" above. */
    .app-panel :is(.app-action-bar--sticky-always, .app-action-bar--sticky-form, .app-action-bar--sticky-below-md, .app-action-bar--sticky-below-lg, .app-action-bar--sticky-below-lg-or-short) {
        margin-inline: calc(-1 * (var(--sp-2) + var(--edge-w)));
    }
}

/* A danger slot alone: with no other buttons in the bar, the rule beside it (or above it on a
   phone) divides nothing, so it is not drawn. A member's lone Withdraw on an offer stood under an
   empty rule (final pass, leftovers). The empty actions group is written either side of the slot,
   after it or before it (align=end), so both orders are matched. */
.app-action-bar-actions:empty + .app-action-bar-danger,
.app-action-bar-danger:has(+ .app-action-bar-actions:empty) {
    padding: 0;
    border: 0;
}

/* ── Touch ───────────────────────────────────────────────────────────────────────
   44px wherever the pointer is not certainly a mouse, as the legacy touch layer reads it,
   carried here so the bar does not depend on that list. */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .app-action-bar .app-action,
    .app-action-bar .app-action-menu-item {
        min-block-size: var(--touch-min);
    }
}

/* ── Alert (app-alert and app-plan-lock) ─────────────────────────────────────
   docs/ui/components/alert.md. Every app-alert is drawn this way (AppAlertTagHelper; the
   legacy Bootstrap-only rendering was removed in the final pass). It keeps the legacy fill,
   border and offset block from legacy/04-controls-tables.css, which this file does not
   restyle: it lays out the parts.

   The type is never colour alone: each type has an icon of its own shape (circle-check,
   octagon, triangle, circle-i, and a lock for the plan notice) and a visually hidden word
   before the text. The icon takes the text colour, so it reads in grayscale and in forced
   colours, where every fill looks the same. */

.app-alert {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
}

/* One text line tall, so the glyph centres on the first line of the title or message. */
.app-alert__icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    block-size: calc(var(--lh-body) * 1em);
    font-size: var(--fs-5);
    line-height: 1;
}

.app-alert__icon::before {
    vertical-align: 0;
}

/* The text and the actions share a row while both fit, the actions at its end; on a narrow
   alert the actions wrap under the text. */
.app-alert__main {
    flex: 1 1 auto;
    min-inline-size: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2) var(--sp-4);
}

.app-alert__body {
    flex: 1 1 var(--card-min);
    min-inline-size: 0;
    line-height: var(--lh-body);
    /* A long token (a URL, a set code run) wraps rather than pushing the page sideways. */
    overflow-wrap: anywhere;
}

.app-alert__title,
.app-alert__message {
    max-inline-size: var(--measure);
}

.app-alert__title {
    margin: 0;
    font-weight: 700;
}

.app-alert__title + .app-alert__message {
    margin-block-start: var(--sp-1);
}

.app-alert__message > :last-child {
    margin-block-end: 0;
}

.app-alert__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

/* Bootstrap's dismiss is placed absolutely in the padding .alert-dismissible keeps for it. It
   is 48 by 56px there, over the 44px floor, with the alert's own ring colour (legacy file 04). */

/* The touch layer (legacy/10-admin-touch.css) already lifts every .btn to 44px below 992px and
   under a coarse pointer; components carry their own floor too. */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .app-alert__actions .btn {
        min-block-size: var(--touch-min);
    }
}

/* ── Plan lock, inline: one muted line under a page's header ──────────────── */
.app-plan-lock {
    display: flex;
    align-items: baseline;
    gap: var(--sp-2);
    margin: 0;
    max-inline-size: var(--measure);
    color: var(--ink-muted);
    font-size: var(--fs-3);
    line-height: var(--lh-body);
}

.app-plan-lock__icon {
    flex: none;
}

.app-plan-lock__text {
    min-inline-size: 0;
    overflow-wrap: anywhere;
}

/* The link sits in the sentence, so WCAG's inline-link exemption covers its size; it still
   gets an invisible hit area to 44px on touch screens, as Manage Tags does. */
.app-plan-lock__text a {
    color: var(--ink);
    font-weight: 600;
}

@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .app-plan-lock__text a {
        position: relative;
        display: inline-block;
    }

    .app-plan-lock__text a::after {
        content: "";
        position: absolute;
        inset: -12px -6px;
    }
}

/* ── app-badge (TagHelpers/AppBadgeTagHelper.cs) ──────────────────────────────
   One status badge or chip, drawn by tone. The tag helper writes
   span.app-badge.app-badge--<tone>[.app-badge--sm], an optional i.app-badge-icon and the
   words in span.app-badge-text. Every size is in rem through the type and spacing tokens, so a badge grows with the
   fluid root on large screens. Text on each fill clears 4.5:1 in both themes: the accent fills
   keep their light colour in the dark theme and take --on-accent, which never flips, as the
   alerts do. The status tones carry an icon of their own shape (the tag helper's default), so
   no state is told by colour alone. Not interactive, so no touch floor. */

.app-badge {
    --badge-bg: var(--surface);
    --badge-ink: var(--ink);
    /* The icon and the words are two flex items on one baseline, so in a narrow table cell
       the words wrap under themselves and the icon stays at the start of the first line,
       never alone on a line above them. */
    display: inline-flex;
    align-items: baseline;
    gap: var(--sp-1);
    max-inline-size: 100%;
    padding: var(--sp-1) var(--sp-2);
    border: var(--edge-w-hair) solid var(--ink);
    border-radius: var(--radius);
    background: var(--badge-bg);
    color: var(--badge-ink);
    font-family: var(--font-body);
    font-size: var(--fs-3);
    font-weight: 700;
    line-height: var(--lh-tight);
    text-align: start;
    vertical-align: middle;
    white-space: normal;
}

/* Dense rows and tiles. Still above the 11.5px the old chips used (audit DK24). */
.app-badge--sm {
    padding: var(--sp-0) var(--sp-1h);
    font-size: var(--fs-2);
}

.app-badge-icon {
    flex: none;
}

/* Words wrap inside the badge, and a word longer than the space breaks rather than push
   the badge past a phone's edge: a real element, unlike an anonymous flex item, can shrink
   below its longest word (min-inline-size: 0). break-word, not anywhere: anywhere would let
   a table cell squeeze a short badge down to one letter per line. */
.app-badge-text {
    min-inline-size: 0;
    overflow-wrap: break-word;
}

/* Tones. neutral is the default above: the surface with ink, like a plain chip. */
.app-badge--notice {
    --badge-bg: var(--notice);
}

.app-badge--brand {
    --badge-bg: var(--brand-primary);
    /* --on-brand, not --on-accent: a store's own buylist accent may be dark. */
    --badge-ink: var(--on-brand);
}

.app-badge--ok {
    --badge-bg: var(--ok);
    --badge-ink: var(--on-accent);
}

.app-badge--info {
    --badge-bg: var(--info);
    --badge-ink: var(--on-accent);
}

.app-badge--warn {
    --badge-bg: var(--warn);
    --badge-ink: var(--on-accent);
}

.app-badge--bad {
    --badge-bg: var(--bad);
    --badge-ink: var(--on-accent);
}

/* The strongest mark: paper on ink, inverted with the theme. */
.app-badge--ink {
    --badge-bg: var(--ink);
    --badge-ink: var(--paper);
}

/* ── Public buylist shell and shared buylist pieces (unit mig-buylist-shell) ─────────
   _BuylistLayout's shell, and the partials the buylist pages share: _BuylistSteps (drawn by
   _Stepper, styled in content-blocks.css), _OfferPair and _BuylistLineSummary.
   docs/ui/components/buylist.md has the API.

   The customer surface gets the full treatment rather than the tempered one: it is seen once,
   briefly, by someone deciding whether to trust the store with their cards. Only token colours,
   so a store's accent (--brand-primary, --on-brand, set by the layout) recolours it. */

/* ── Shell ──
   A grid with rows, never a flex column: header, steps, main, footer. Main takes the spare
   height, so the footer sits at the bottom of a short page (LS-SW22, BP23). The rows are placed
   by number, so a page with no steps leaves row 2 empty rather than moving main into it. */
.buylist-shell {
    --buylist-gutter: var(--page-gutter);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto;
    min-block-size: 100vh;
    min-block-size: 100dvh;
}

/* Every band is held to the app shell's width and side padding (.app-shell: --app-max-width
   with --page-gutter, --sp-3 on a phone), so the content edge matches the app's at every width
   (LS-SW14). The header's ground and rule and the footer's rule run full width outside it. */
.buylist-band {
    box-sizing: border-box;
    inline-size: 100%;
    max-inline-size: var(--app-max-width);
    margin-inline: auto;
    padding-inline: var(--buylist-gutter);
    min-inline-size: 0;
}

.buylist-bar {
    grid-row: 1;
    background: var(--surface);
    border-block-end: var(--edge-w-strong) solid var(--ink);
}

.buylist-shell__steps {
    grid-row: 2;
    padding-block-start: var(--sp-5);
}

/* The stepper's own space under it is the main row's top padding here. */
.buylist-shell__steps > .stepper {
    margin-block-end: 0;
}

.buylist-main {
    grid-row: 3;
    padding-block: var(--sp-5) var(--sp-8);
}

.buylist-foot {
    grid-row: 4;
    border-block-start: var(--edge-w) solid var(--ink);
}

/* ── Header ──
   One row at every width (BP12): the brand may shrink and its name clamps to two lines, and the
   theme button never wraps under it. */
.buylist-bar__row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--sp-3);
    padding-block: var(--sp-3);
}

/* The same gold block as the app's own brand, so a store's buylist reads as part of the same
   product. 44px tall at every width (BP13). */
.buylist-bar__brand {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    min-inline-size: 0;
    min-block-size: var(--touch-min);
    padding: var(--sp-1) var(--sp-3);
    font-family: var(--font-display);
    font-size: var(--fs-5);
    font-weight: 900;
    line-height: var(--lh-tight);
    letter-spacing: -.01em;
    color: var(--on-brand);
    background: var(--brand-primary);
    border: var(--edge-w) solid var(--ink);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.buylist-bar__brand:hover,
.buylist-bar__brand:focus-visible {
    color: var(--on-brand);
    background: var(--brand-secondary);
}

.buylist-bar__brand:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

.buylist-bar__brand > .bi {
    flex: none;
}

/* A long store name takes two lines and then an ellipsis; the whole name is still in the link's
   text for screen readers. */
.buylist-bar__name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    min-inline-size: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
}

/* Icon only, pinned right, 44 by 44 at every width (BP13). theme.js names it. It stays the
   inline-flex box .btn.btn-sm makes it, centred. */
.buylist-bar__theme {
    flex: none;
    justify-content: center;
    align-items: center;
    margin-inline-start: auto;
    min-inline-size: var(--touch-min);
    min-block-size: var(--touch-min);
    padding: 0;
}

@media (max-width: 575.98px) {
    .buylist-shell {
        --buylist-gutter: var(--sp-3);
    }

    .buylist-bar__brand {
        font-size: var(--fs-4);
    }
}

/* ── Footer ── */
.buylist-foot__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2) var(--sp-5);
    padding-block: var(--sp-4);
    font-size: var(--fs-3);
    color: var(--ink-muted);
}

.buylist-foot__note {
    margin: 0;
    max-inline-size: var(--measure);
}

/* Privacy and Terms: links set on their own, at least 44 by 44 at every width (BP25 lines them up with
   the note through align-items). */
.buylist-foot__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 var(--sp-4);
}

.buylist-foot__links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-inline-size: var(--touch-min);
    min-block-size: var(--touch-min);
    color: var(--ink);
}

/* ── _OfferPair ──
   Grid: a corner, the Cash and Credit heads, then a row each for NM and Foil (BP14). Column: one
   kind, the NM amount over the Foil one, for a table's own Cash and Credit columns. The drawn
   labels are hidden from screen readers; every amount carries its whole name. */
.offer-pair {
    font-variant-numeric: tabular-nums;
}

.offer-pair--grid {
    display: inline-grid;
    grid-template-columns: auto auto auto;
    align-items: baseline;
    gap: var(--sp-0) var(--sp-3);
    font-size: var(--fs-3);
}

.offer-pair__head,
.offer-pair__row {
    font-size: var(--fs-1);
    font-weight: 700;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    color: var(--ink-muted);
}

.offer-pair__head {
    text-align: end;
}

/* Positioned, so the hidden name stays inside a scrolling table region. */
.offer-pair__amount {
    position: relative;
    white-space: nowrap;
    text-align: end;
}

.offer-pair--grid .offer-pair__amount {
    font-weight: 600;
}

.offer-pair--column {
    display: grid;
    justify-items: end;
    gap: var(--sp-0);
}

.offer-pair__amount--foil {
    font-size: var(--fs-2);
    color: var(--ink-muted);
}

/* ── _BuylistLineSummary ──
   The thumbnail, the text, then the quantity and the action on the first row's end. Each fact is
   an inline block, so it moves to the next line whole and only breaks inside when it is longer
   than the line (BP18). */
.buylist-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: start;
    column-gap: var(--sp-3);
    min-inline-size: 0;
}

.buylist-line--thumb {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.buylist-line__thumb {
    display: block;
    line-height: 0;
}

.buylist-line__text {
    display: grid;
    gap: var(--sp-0);
    min-inline-size: 0;
}

.buylist-line__name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.buylist-line__meta,
.buylist-line__totals,
.buylist-line__note {
    font-size: var(--fs-3);
}

/* A fact row: the facts, a middot between them. Each fact moves to the next
   line whole; its middot is drawn before it, in the gap, and the row clips its
   own start edge, so the middot of a fact that starts a line falls outside it
   and no line ends or starts on a dot ("Pokémon TCG · Base Set ·" / "Near
   Mint" before). A fact wider than the row wraps inside itself: the clip is
   only there for the middots and never cuts a fact off.
   The one rule for every fact row on the buylist pages: .buylist-facts on a
   row whose children are the facts (the submission detail's cards and Add a
   Card candidates), the sell list's .buylist-line__meta, and the builder's
   results, whose markup (Pages/Buylist/Index.cshtml) names its own classes.
   An area sets only the row's type size and weight. */
.buylist-facts,
.buylist-line__meta,
.buylist-result__meta {
    --buylist-sep-w: calc(2 * var(--sp-1) + .3em);
    display: flex;
    flex-wrap: wrap;
    column-gap: var(--buylist-sep-w);
    overflow: hidden;
    color: var(--ink-muted);
}

.buylist-facts > *,
.buylist-line__part,
.buylist-result__part {
    max-inline-size: 100%;
    overflow-wrap: anywhere;
}

.buylist-facts > *::before,
.buylist-line__part::before,
.buylist-result__part::before {
    content: "\00b7";
    content: "\00b7" / "";
    display: inline-block;
    inline-size: var(--buylist-sep-w);
    margin-inline-start: calc(-1 * var(--buylist-sep-w));
    text-align: center;
}

.buylist-line__totals {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--sp-3);
}

/* The note has an icon as well as its colour: info for fewer copies, a warning for none. */
.buylist-line__note {
    display: flex;
    align-items: baseline;
    gap: var(--sp-1);
    color: var(--warn-ink);
}

.buylist-line--refused .buylist-line__note {
    color: var(--bad-ink);
}

/* Positioned, so the hidden "Quantity 2" stays in the line. */
.buylist-line__qty {
    position: relative;
    font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.buylist-line__action {
    min-inline-size: 0;
}

/* ── Card search box (_CardSearchBox, Pages/Shared/CardSearchBoxModel.cs) ─────────
   The website box only; the Shopify admin's Polaris box keeps its rules in embedded.css.
   The bar, the field and the suggestion list keep their legacy rules
   (legacy/07-form-widgets.css); this file adds what the component gained in unit
   card-search-box (docs/ui/components/card-search-box.md):
   - a width cap, in rem, so the field never runs to 1,300px on a wide screen and grows
     with the fluid root instead of getting longer in characters (MaxWidth);
   - help under the bar (Help), with Bootstrap's .form-text spacing like every field's help;
   - an icon-only Search button when the box is narrow (IconOnlyBelow), by container
     query, so it follows the box's own width in a side column as well as on a phone.
   The box is an inline-size container. It is always a block in its column (a grid item
   or a block in a form), so containment never collapses it to its content. */

.card-search {
    container: card-search / inline-size;
    min-inline-size: 0;
    max-inline-size: 48rem;
}

.card-search--max-lg {
    max-inline-size: var(--field-w-lg);
}

.card-search--max-none {
    max-inline-size: none;
}

/* The button's icon shows only in icon-only mode; its text is always its name. */
.card-search-submit-icon {
    display: none;
}

@container card-search (max-width: 399.98px) {
    .card-search--icon-below-400 .card-search-submit {
        min-width: 0;
        min-inline-size: var(--touch-min);
        padding-inline: var(--sp-3);
    }

    .card-search--icon-below-400 .card-search-submit-icon {
        display: inline-block;
    }

    .card-search--icon-below-400 .card-search-submit-text {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }
}

@container card-search (max-width: 559.98px) {
    .card-search--icon-below-560 .card-search-submit {
        min-width: 0;
        min-inline-size: var(--touch-min);
        padding-inline: var(--sp-3);
    }

    .card-search--icon-below-560 .card-search-submit-icon {
        display: inline-block;
    }

    .card-search--icon-below-560 .card-search-submit-text {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }
}

/* _CardThumb: one card's art in a fixed box (docs/ui/components/card-thumb.md).
   The box is a card's own shape, 63:88, at a width set in rem, so it scales with the root on
   large screens and a row keeps its line whether the art loads, fails or was never there. The
   art is contained, not cropped: the point of a thumbnail is telling printings apart, and a
   letterboxed card is better than one with its frame cut off. The sunken ground shows through
   while the art loads and around a placeholder. */
.card-thumb {
    --card-thumb-w: 3.5rem;
    display: inline-block;
    flex: none;
    width: var(--card-thumb-w);
    aspect-ratio: 63 / 88;
    overflow: hidden;
    vertical-align: middle;
    background: var(--surface-sunken);
    border: var(--edge-w-hair) solid var(--rule-soft);
    border-radius: var(--radius);
}

.card-thumb--sm {
    --card-thumb-w: 2.5rem;
}

.card-thumb--lg {
    --card-thumb-w: 5rem;
}

.card-thumb > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* The placeholder is a 48px mark, not art: drawn at its own size or less, centred, with room
   around it, rather than stretched edge to edge of a large box. */
.card-thumb > img[data-card-thumb="placeholder"] {
    object-fit: scale-down;
    padding: 18%;
}

/* ── Card tile (_CardTile, _CardTileAddAction, card-tile-add.js) ─────────────
   The grid of card tiles, the tile's structured meta, its select controls and
   the catalogue's quick add. docs/ui/components/card-tile.md is the guide and
   /Admin/StyleGuide/CardTile the samples. The tile's frame, art, name and
   prices are still the legacy .portfolio-card rules (03-charts-tiles.css,
   08-catalogue-portfolio.css); this file loads after them and overrides only
   what it names. The legacy rules this replaces are listed in
   docs/ui/dead-css/card-tile.md. */

/* ── Grid ────────────────────────────────────────────────────────────────────
   Tracks in rem (audit LS-ME1 c), so a tile grows with the root on a large
   screen and a wider shell gains columns rather than wider tiles. Two columns
   on a phone; a slightly smaller track on tablets, so 768 keeps four columns. */
.portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(var(--tile-min), 100%), 1fr));
}

@media (max-width: 575.98px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(9.375rem, 100%), 1fr));
    }
}

/* ── Type ────────────────────────────────────────────────────────────────────
   At least 14px for the name and 13px for the meta at every width (audit PF22);
   the phone rule that shrank the name to --fs-2 no longer applies. */
.portfolio-card .portfolio-card-name {
    font-size: max(var(--fs-3), .875rem);
}

/* A printing suffix's pieces (PrintingName): "Dragon -" and "LOB-001" each stay on
   one line, so a Yu-Gi-Oh name breaks after its separator and never inside the code.
   The tile's name and the card page's h1 both use it. */
.printing-name-keep {
    white-space: nowrap;
}

/* ── Meta ────────────────────────────────────────────────────────────────────
   Line one: game and set, clamped to two lines (decisions log 2026-11-17), so the
   set, which tells printings apart in a mixed search, is read rather than cut
   after the game's name. Line two: the number and the rarity badge, which wrap
   and are never cut (audit PC3). Line three: a copy's printing, condition and
   language, up to two lines. Two lines are reserved, three with a set line (its
   two and the number's one), so the prices of a row of tiles start at one height
   however long each set's name is (final pass). */
.card-tile-meta {
    display: flex;
    flex-direction: column;
    gap: var(--sp-0);
    min-width: 0;
    min-height: calc(2 * 1.35em);
    font-size: max(var(--fs-2), .8125rem);
    line-height: 1.35;
    color: var(--ink-muted);
}

.card-tile-meta:has(> .card-tile-set) {
    min-height: calc(3 * 1.35em);
}

.card-tile-set {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-width: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.card-tile-id {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-0) var(--sp-1);
    min-width: 0;
}

.card-tile-number {
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

/* The small badge is --fs-2 (about 12.5px); in the tile it keeps the meta's
   13px floor, since the rarity is what tells two printings apart (PC3, PF22). */
.card-tile-id > .card-tile-rarity {
    max-width: 100%;
    font-size: max(var(--fs-2), .8125rem);
}

.card-tile-variant {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Selectable ──────────────────────────────────────────────────────────────
   The select row under the tile and the copy counter over its art show only
   under .is-selecting (the page's script sets it). The row is the label, the
   tile's full width and 44px tall on touch screens (audit PF7). A selected tile
   has an ink outline, and its checkbox is ticked: shape and words, not colour. */
.card-grid-cell {
    position: relative;
}

.card-tile-select,
.card-tile-copies {
    display: none;
}

.is-selecting .card-tile-select {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-height: var(--control-h);
    padding: var(--sp-1) var(--sp-2);
    border: var(--edge-w) solid var(--ink);
    background: var(--surface);
    color: var(--ink);
    font-size: var(--fs-3);
    font-weight: 700;
    cursor: pointer;
}

.card-tile-select-input {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    accent-color: var(--ink);
    cursor: pointer;
}

.card-tile-select:focus-within {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

.card-tile-select-input:focus-visible {
    outline: none;
}

.is-selecting .is-selected > .card-tile-select {
    background: var(--brand-primary);
    color: var(--on-accent);
}

.is-selecting .is-selected > .portfolio-card {
    outline: var(--edge-w-strong) solid var(--ink);
    outline-offset: 2px;
}

/* Across the top of the art, the tile's inner width, over the ×N badge it
   stands in for. The count field is narrowed so the 44px buttons fit a 320px
   phone's tile; "of 4" wraps under them when it does not fit beside. */
.is-selecting .is-selected > .card-tile-copies {
    position: absolute;
    top: var(--edge-w);
    left: var(--edge-w);
    right: var(--edge-w);
    z-index: 2;
    display: flex;
    justify-content: center;
    padding: var(--sp-1) 0;
    background: var(--surface);
    border-bottom: var(--edge-w) solid var(--ink);
}

.card-tile-copies .app-qty-stepper {
    --qty-input-w: 2rem;
    justify-content: center;
}

.card-tile-copies .app-qty-stepper-of {
    margin-inline-start: var(--sp-1);
    font-size: var(--fs-2);
}

@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .is-selecting .card-tile-select {
        min-height: var(--touch-min);
    }
}

/* ── Quick add (_CardTileAddAction) ──────────────────────────────────────────
   [+ Add] [NM · NF ▾] under a catalogue tile. The form is the container, so
   under a tile narrower than 9.5rem (152px) Add and the summary stack, each
   the full width (audit LS-PR14). The choices open as a panel floating over the
   tiles below, the action's width, so opening it never makes the row taller. */
.card-tile-add {
    position: relative;
    container-type: inline-size;
}

/* The container is a layout boundary, so an open panel lifts its whole form
   over the tiles after it. */
.card-tile-add:has(.card-tile-add-options[open]) {
    z-index: var(--z-dropdown);
}

.card-tile-add-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--sp-1h);
    align-items: stretch;
}

.card-tile-add-row--single {
    grid-template-columns: minmax(0, 1fr);
}

@container (max-width: 9.5rem) {
    .card-tile-add-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

.card-tile-add-button {
    white-space: nowrap;
    min-height: var(--control-h);
}

.card-tile-add-options {
    min-width: 0;
}

.card-tile-add-options > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-1);
    height: 100%;
    min-height: var(--control-h);
    padding: var(--sp-1) var(--sp-2);
    border: var(--edge-w-hair) solid var(--ink);
    background: var(--surface-sunken);
    color: var(--ink);
    font-size: max(var(--fs-2), .8125rem);
    font-weight: 700;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.card-tile-add-options > summary::-webkit-details-marker {
    display: none;
}

.card-tile-add-options > summary:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

.card-tile-add-summary {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-tile-add-options > summary::after {
    content: "";
    flex: none;
    width: .45rem;
    height: .45rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
}

.card-tile-add-options[open] > summary::after {
    transform: translateY(2px) rotate(-135deg);
}

/* Positioned against the form, not the disclosure, so it spans the whole action. */
.card-tile-add-body {
    position: absolute;
    top: calc(100% + var(--sp-1));
    left: 0;
    right: 0;
    display: grid;
    gap: var(--sp-1);
    padding: var(--sp-2);
    background: var(--surface);
    border: var(--edge-w) solid var(--ink);
    box-shadow: var(--shadow-sm);
}

@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .card-tile-add-button,
    .card-tile-add-options > summary,
    .card-tile-add-body .form-select,
    .card-tile-add-body .form-control {
        min-height: var(--touch-min);
    }

    /* 16px or more in a field, or iOS zooms the page when it takes focus. */
    .card-tile-add-body .form-select,
    .card-tile-add-body .form-control {
        font-size: 1rem;
    }
}

/* ── Charts (_TrendChart, _StatChart; Pages/Shared/TrendChartModel.cs, StatChartModel.cs) ──
   The trend chart's frame, line colours, dot and tooltip are still the legacy rules in
   legacy/03-charts-tiles.css. This file adds what the charts unit changed, and wins over the
   legacy rules by coming after them at the same specificity (no legacy rule was edited).
   Docs: docs/ui/components/charts.md. Sample: /Admin/StyleGuide/Charts. */

/* The chart measures its own width, so its height can follow it (below). */
.trend-chart {
    container-type: inline-size;
}

/* Height. The SVG stretches its 600x120 canvas to the box, so a fixed 120px drew an 11:1 strip
   on a wide screen that flattened every move (audit LS-ME10, LS-PR13). A panel chart grows with
   the screen, 140px on a phone to 300px from about 2140px wide, and is never taller than a quarter of
   its own width, so a chart in a half-width column stays a chart and not a box. trend-chart.js
   places its dot from the drawn size, so the dot stays on the line at every height. */
.trend-chart--panel svg {
    height: clamp(140px, 14vw, 300px);
}

@supports (width: 1cqi) {
    .trend-chart--panel svg {
        height: max(140px, min(clamp(140px, 14vw, 300px), 25cqi));
    }
}

/* fill (TrendChartModel.Size): a panel chart in a stretched row grows to its panel's height, so
   it ends with the panel beside it. The chart's own height above is its least, so on its own row
   (one column, or a panel not stretched) it draws as a panel chart does. The holding page's Value
   Over Time left a gap of 115 to 190px under it beside Catalogue Prices from 992px (final pass). */
.app-panel:has(> .panel-body > .trend-chart--fill) {
    display: flex;
    flex-direction: column;
}

.app-panel:has(> .panel-body > .trend-chart--fill) > .panel-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.trend-chart--fill {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.trend-chart--fill.trend-chart--panel svg {
    flex: 1 1 auto;
    height: auto;
    min-block-size: clamp(140px, 14vw, 300px);
}

@supports (width: 1cqi) {
    .trend-chart--fill.trend-chart--panel svg {
        height: auto;
        min-block-size: max(140px, min(clamp(140px, 14vw, 300px), 25cqi));
    }

    /* The framed chart never grows taller than three quarters of the panel body's width, so the
       line inside it stays wider than tall. From 992 to about 1199px the panel beside it stacks
       its price blocks and gets tall, and a chart filling it was taller than wide (385x494 at
       992), which stretched the line and steepened every slope; there the panel keeps a gap
       under the chart's note instead. The cap is on the frame, not the line, so the frame never
       draws an empty box under the dates (final pass, leftovers review). */
    .app-panel:has(> .panel-body > .trend-chart--fill) > .panel-body {
        container-type: inline-size;
    }

    .trend-chart--fill {
        max-block-size: 75cqi;
    }
}

/* The line beside a value hero stays a 110px sparkline (the hero's own rule in
   legacy/08-catalogue-portfolio.css does the same for heroes that do not pass the size). */
.trend-chart--spark svg {
    height: 110px;
}

/* ── Series toggles ──────────────────────────────────────────────────────────────
   Each toggle is its checkbox and the series name. The box is a hollow square when the line is
   hidden and a filled one with an ink edge when it shows, so the state is a shape as well as a
   colour (it was the series colour at 25% or 100% opacity). The label is the target: 44px
   tall on a touch screen, and it carries the focus ring of the checkbox inside it. */
.trend-chart-legend {
    gap: var(--sp-2);
}

.trend-toggle {
    min-block-size: calc(var(--fs-2) * 1.5 + .5rem);
    padding: .25rem .65rem;
    line-height: var(--lh-tight);
}

.trend-toggle input {
    flex: 0 0 auto;
    width: .8rem;
    height: .8rem;
    opacity: 1;
    background: transparent;
    border: var(--edge-w-hair) solid var(--ink);
}

.trend-toggle input:focus-visible {
    outline: 0;
}

.trend-toggle:has(input:focus-visible) {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

.trend-toggle--primary input:checked {
    background: var(--series-1);
}

.trend-toggle--alt input:checked {
    background: var(--series-2);
}

.trend-toggle:has(input:not(:checked)) > span {
    color: var(--ink-muted);
    text-decoration: line-through;
}

@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .trend-toggle {
        min-block-size: var(--touch-min);
        min-inline-size: var(--touch-min);
    }
}

/* ── The day-by-day table (<app-disclosure class="trend-history" flush>) ───────── */
.trend-history {
    margin-block-start: var(--sp-3);
}

.trend-history-scroll {
    max-block-size: 340px;
    overflow: auto;
}

.trend-history-scroll:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-inset);
}

.trend-history .table {
    margin: 0;
}

.trend-history .table th:first-child,
.trend-history .table td:first-child {
    padding-inline-start: var(--disclosure-pad-inline, .9rem);
}

.trend-history .table th:last-child,
.trend-history .table td:last-child {
    padding-inline-end: var(--disclosure-pad-inline, .9rem);
}

.trend-history-unit {
    display: block;
    font-weight: 400;
}

.trend-history-value {
    font-variant-numeric: tabular-nums;
}

/* ── _StatChart ───────────────────────────────────────────────────────────────────
   Its SVG carries its own colours and an 88px height, so it draws the same in the Shopify admin,
   which loads none of this file. The legacy .stat-chart rules stay as they are. */

/* ── Forced colours: the toggle's box keeps a visible fill when checked. */
@media (forced-colors: active) {
    .trend-toggle input:checked {
        forced-color-adjust: none;
        background: CanvasText;
    }
}

/* ── Check field and check group (<app-check-field>, <app-check-group>) ──────────
   TagHelpers/AppCheckFieldTagHelper.cs and AppCheckGroupTagHelper.cs; the guide is
   docs/ui/components/check-field.md and the sample /Admin/StyleGuide/CheckField.
   The old .form-check markup (a field with no new option) keeps its legacy rules;
   everything here styles the new classes only. Sizes are rem, so a box, its gap
   and the hint's indent stay in step whatever the text size of the hint. */

.app-check {
    --app-check-box: 1.25rem;
    --app-check-box-w: var(--app-check-box);
    --app-check-gap: var(--sp-2h);
    --app-check-indent: calc(var(--app-check-box-w) + var(--app-check-gap));
    min-inline-size: 0;
}

.app-check--switch {
    --app-check-box-w: 2.25rem;
    padding-inline-start: 0;
    margin-block-end: 0;
}

/* ── The row ─────────────────────────────────────────────────────────────────
   The label holds the box and the text, so a click anywhere on the row, the gap
   included, toggles the control. The box sits on the first line of the text, and
   a long label wraps under itself, never under the box. */
.app-check__row {
    display: flex;
    align-items: flex-start;
    gap: var(--app-check-gap);
    margin: 0;
    line-height: var(--lh-body);
    cursor: pointer;
}

.app-check .app-check__input {
    flex: none;
    float: none;
    inline-size: var(--app-check-box-w);
    block-size: var(--app-check-box);
    margin: calc((var(--lh-body) * 1em - var(--app-check-box)) / 2) 0 0;
    cursor: inherit;
}

/* Legacy gives a switch's box 2em at a higher specificity; the switch keeps its pill here. */
.app-check--switch .app-check__input[type="checkbox"] {
    inline-size: var(--app-check-box-w);
    margin-inline-start: 0;
}

/* ── The state marks ─────────────────────────────────────────────────────────
   A checked control fills with the brand yellow, which is about 1.6:1 against the
   white of a clear one, so the mark inside carries the state, as the checkbox's ink
   tick does (legacy/07-form-widgets.css). Bootstrap draws a white radio dot and a
   white, grey or blue switch knob, each under 3:1 against what it sits on (WCAG
   1.4.11). Here the dot and the knob are ink: #111 on the yellow in both themes and
   on the light off track, cream (the dark --ink) on the dark off track. A data URI
   cannot read a token, so the colours are written out. */
.app-check__input.form-check-input[type="radio"]:checked {
    --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23111111'/%3e%3c/svg%3e");
}

.app-check--switch .app-check__input.form-check-input[type="checkbox"] {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23111111'/%3e%3c/svg%3e");
}

[data-bs-theme="dark"] .app-check--switch .app-check__input.form-check-input[type="checkbox"]:not(:checked) {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23f2ede3'/%3e%3c/svg%3e");
}

.app-check__text {
    flex: 1 1 auto;
    min-inline-size: 0;
    overflow-wrap: anywhere;
}

.app-check__row:hover > .app-check__input:not(:checked):not(:disabled) {
    background-color: var(--surface-sunken);
}

/* ── Hint, error and slot ────────────────────────────────────────────────────
   Each takes a line of its own under the label, lined up with the label's text
   (box plus gap), so the hint is never a column beside the label (audit SA1). */
.app-check__hint,
.app-check__error {
    display: block;
    max-inline-size: calc(var(--measure) + var(--app-check-indent));
    margin-block-start: var(--sp-0);
    padding-inline-start: var(--app-check-indent);
}

.app-check__error {
    font-size: var(--fs-3);
    font-weight: 600;
}

/* The slot's fields belong to this choice: indented under the label, with a soft
   rule down from the box so the dependency shows without colour. */
.app-check__slot {
    display: grid;
    gap: var(--sp-3);
    min-inline-size: 0;
    margin-block-start: var(--sp-2);
    margin-inline-start: calc(var(--app-check-box) / 2 - var(--edge-w) / 2);
    padding-inline-start: calc(var(--app-check-indent) - var(--app-check-box) / 2 - var(--edge-w) / 2);
    border-inline-start: var(--edge-w) solid var(--rule-soft);
}

.app-check--reveal:has(> .app-check__row > .app-check__input:not(:checked)) > .app-check__slot {
    display: none;
}

/* ── Disabled ────────────────────────────────────────────────────────────────
   The words say why (the hint); the row stops looking pressable. */
.app-check--disabled .app-check__row {
    color: var(--disabled-ink);
    cursor: not-allowed;
}

.app-check-chip--disabled {
    cursor: not-allowed;
}

.app-check-chip--disabled > span {
    border-style: dashed;
    background: var(--disabled-bg);
    color: var(--disabled-ink);
}

/* ── Check group ─────────────────────────────────────────────────────────────
   A fieldset whose legend names the group. The items sit in as many columns as
   fit at --app-check-group-min, up to --app-check-group-cols, worked out from the
   group's own width, as app-form-grid does: one column on a phone, more as the
   screen widens. The column minimum and the page cap are both rem, so a larger
   root makes the columns wider, not more numerous: more columns past 1280px need
   a wider page shell. */
.app-check-group {
    --app-check-group-cols: 1;
    --app-check-group-min: var(--card-min);
    --app-check-group-col-gap: var(--sp-5);
    --app-check-group-auto-max: 7;
    min-inline-size: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.app-check-group__legend {
    margin-block-end: var(--sp-1);
}

.app-check-group__help {
    max-inline-size: var(--measure);
    margin-block: 0 var(--sp-2);
}

.app-check-group__error {
    display: block;
    margin-block: 0 var(--sp-2);
    font-size: var(--fs-3);
    font-weight: 600;
}

.app-check-group__items {
    display: grid;
    grid-template-columns: repeat(
        auto-fill,
        minmax(
            min(100%, max(var(--app-check-group-min), (100% - (var(--app-check-group-cols) - 1) * var(--app-check-group-col-gap)) / var(--app-check-group-cols))),
            1fr));
    align-items: start;
    gap: var(--sp-2) var(--app-check-group-col-gap);
    min-inline-size: 0;
}

/* A numbered group stops at 60rem, as app-form-grid does, so four short labels do
   not spread across a 1400px panel. An auto group has no width cap: it gains columns, up to seven (below). */
.app-check-group:not(.app-check-group--cols-auto) > .app-check-group__items {
    max-inline-size: calc(var(--measure-form) * 1.5);
}

/* An auto group gains columns as it widens, up to --app-check-group-auto-max (7). Past that the
   columns widen instead: at 3840 a full-width panel fitted eight, and the nine games went 8 and 1,
   one game alone under a row spread across the panel. Seven gives 7 and 2 there, and 6 and 3 at
   1920, which is ordinary wrapping. */
.app-check-group--cols-auto > .app-check-group__items {
    grid-template-columns: repeat(
        auto-fill,
        minmax(
            min(100%, max(var(--app-check-group-min), (100% - (var(--app-check-group-auto-max) - 1) * var(--app-check-group-col-gap)) / var(--app-check-group-auto-max))),
            1fr));
}

/* Balanced rows (final pass, shell-nav-0). An auto group of more than one item carries its count
   (--app-check-group-items, written by AppCheckGroupTagHelper with .app-check-group--balanced).
   The columns that fit are worked out from the group's own width, then the fewest rows those
   need, then as few columns as fill those rows: nine items where four fit are 3, 3 and 3, not
   4, 4 and 1, and where six fit, 5 and 4. Where two fit, nine are still 2, 2, 2, 2 and 1, as a
   two-column list is read. A browser that cannot divide one length by another keeps the
   auto-fill columns above. The group is an inline-size container for this, so it takes its width
   from where it sits (a block in a form or panel), never from its items. */
@supports (inline-size: calc(100cqi / 1px * 1px)) {
    /* The count's default; the helper's inline value on the element wins over it. */
    .app-check-group--balanced {
        --app-check-group-items: 1;
        container-type: inline-size;
    }

    .app-check-group--balanced > .app-check-group__items {
        --app-check-group-fit: clamp(1, round(down, (100cqi + var(--app-check-group-col-gap)) / (var(--app-check-group-min) + var(--app-check-group-col-gap)), 1), var(--app-check-group-auto-max));
        --app-check-group-rows: round(up, var(--app-check-group-items) / var(--app-check-group-fit), 1);
        grid-template-columns: repeat(round(up, var(--app-check-group-items) / var(--app-check-group-rows), 1), minmax(0, 1fr));
    }
}

.app-check-group--cols-2 { --app-check-group-cols: 2; }
.app-check-group--cols-3 { --app-check-group-cols: 3; }
.app-check-group--cols-4 { --app-check-group-cols: 4; }

.app-check-group--min-sm { --app-check-group-min: var(--field-w-sm); }
.app-check-group--min-md { --app-check-group-min: var(--field-w-md); }

/* Chips: one wrapping line, as .check-chip-row. */
.app-check-group--cols-inline > .app-check-group__items {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.app-check-group--invalid > .app-check-group__legend {
    color: var(--bad-ink);
}

/* ── Touch ───────────────────────────────────────────────────────────────────
   Below 992px, or anywhere that is not certainly a mouse: the box is 24px and
   the row at least 44px, with one line of text centred in it. Rows already carry
   their own room, so the group drops its row gap. */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .app-check {
        --app-check-box: 1.5rem;
    }

    .app-check--switch {
        --app-check-box-w: 2.6rem;
    }

    .app-check__row {
        min-block-size: var(--touch-min);
        padding-block: calc((var(--touch-min) - var(--lh-body) * 1em) / 2);
    }

    .app-check__hint,
    .app-check__error {
        margin-block-start: 0;
    }

    .app-check-group__items {
        row-gap: 0;
    }

    .app-check-group--cols-inline > .app-check-group__items {
        row-gap: var(--sp-2);
    }
}

/* From 1920 the root grows (16px at 1920, 20px at 3840), and so does --card-min, so an auto
   group held the same number of columns from 1920 to 3840 (five of the nine games on a default
   page). Here an auto group's column minimum stays at its 1920 size, so a larger screen adds
   columns (app-shell's integration gate: the nine games measured 3, 5 and 6 at 1024, 1920 and
   3840 on /Admin/StyleGuide/CheckField).
   - --app-check-group-floor is 256px, --card-min (16rem) at the 1920 root of 16px.
   - The rem term is --card-min scaled by 16/20, the 1920 root over the 3840 root, so at 3840 it
     is again 256px and only text zoom makes it larger.
   Numbered groups (cols-2/3/4) keep --card-min: they stop at a column count, not a width. Auto
   groups with their own minimum (min-sm, min-md) keep it. Both shell tiers get the rule: a
   check group has no px floor, so without it the wide tier would not gain columns either. */
@media (min-width: 1920px) {
    .app-check-group--cols-auto:not(.app-check-group--min-sm, .app-check-group--min-md) {
        --app-check-group-floor: 256px;
        --app-check-group-min: max(var(--app-check-group-floor), calc(var(--card-min) * 16 / 20));
    }
}

/* ── Choice list (_ChoiceList, mig-account) ──────────────────────────────────
   Pick one of a list: Pages/Shared/_ChoiceList.cshtml (ChoiceListModel.cs has
   the API, docs/ui/components/choice-list.md the guide). The rows are list rows
   (components/list-rows.css): the frame, the wrapping, the 44px floor and the
   action column come from there. This only marks the current row. Its badge
   says Active in words and its li has aria-current; the heavier ink edge at its
   start repeats that as a shape, so the mark never rests on a colour. Two
   classes, because this file is bundled before list-rows.css, whose .app-row
   sets the whole border and the padding. The start padding gives back what the
   heavier edge adds, so the current row's icon and title stay in line with the
   other rows'. */
.app-row.choice-list-item--current {
    border-inline-start-width: var(--sp-1h);
    padding-inline-start: calc(var(--sp-3) - (var(--sp-1h) - var(--edge-w)));
}

/* ── Content blocks: app-prose, _Stepper and app-steps (content-blocks) ─────
   Reading text, where a person is in a flow of pages, and numbered steps. The
   tag helpers are TagHelpers/AppProseTagHelper.cs and AppStepsTagHelper.cs,
   the partial is Pages/Shared/_Stepper.cshtml (StepperModel.cs), the guide is
   docs/ui/components/content-blocks.md, and the samples are
   /Admin/StyleGuide/ContentBlocks. Defaults are one class or sit in :where(),
   so a page class with one more class wins without !important. */

/* ── Prose ──────────────────────────────────────────────────────────────────
   Audits SH3, LS-SH1 and LS-SH2: the Docs articles' Markdown had no styles, so
   its h2s used the browser's 2rem (bigger than the page's h1), its tables had
   no padding or rules, and its lines ran about 170 characters. */

/* The line length. In Inter a ch (the width of a zero) holds about 1.3
   letters, so 58ch is about 75 characters a line (orchestrator decision,
   2026-11-16), and min() keeps that cap if --measure is ever narrower. A ch is
   the font of the element that uses the property, so a heading's cap is in
   its own size. Each child is capped, not the block, so the block's own rule
   and padding (the panel's .border-top-box) still run the panel's width. */
:where(.prose) {
    --prose-measure: min(var(--measure), 58ch);
    line-height: var(--lh-body);
    overflow-wrap: break-word;
}

:where(.prose) > * {
    max-inline-size: var(--prose-measure);
}

/* Headings stay below the page's h1 (--fs-h1, at least 1.4rem) at every
   width: h2 1.25rem, h3 1.05rem, both in the display face. Written with an
   element (0,0,1) so they follow Bootstrap's h2 and h3 rules, which load first. */
:where(.prose) :is(h2, h3, h4) {
    font-family: var(--font-display);
    line-height: var(--lh-tight);
    letter-spacing: .01em;
    color: var(--ink);
    margin-block: var(--sp-6) var(--sp-3);
    /* A heading the contents list links to stops clear of the top edge. */
    scroll-margin-block-start: var(--sp-4);
}

:where(.prose) h2 {
    font-size: var(--fs-h2);
    font-weight: 800;
}

:where(.prose) h3 {
    font-size: var(--fs-h3);
    font-weight: 700;
    margin-block-start: var(--sp-5);
}

:where(.prose) h4 {
    font-size: var(--fs-4);
    font-weight: 700;
    margin-block-start: var(--sp-4);
}

/* Paragraphs, lists, quotes and code: one space below each, none above. */
:where(.prose) :is(p, ul, ol, dl, blockquote, pre) {
    margin-block: 0 var(--sp-4);
}

:where(.prose) :is(ul, ol) {
    padding-inline-start: var(--sp-6);
}

:where(.prose) li + li,
:where(.prose) li > :is(ul, ol) {
    margin-block-start: var(--sp-2);
}

:where(.prose) li > :is(ul, ol) {
    margin-block-end: 0;
}

:where(.prose) blockquote {
    padding-inline-start: var(--sp-4);
    border-inline-start: var(--edge-w-strong) solid var(--ink);
}

/* The first block starts at the top of the text, and the last ends with it. */
:where(.prose) > :first-child {
    margin-block-start: 0;
}

:where(.prose) > :last-child {
    margin-block-end: 0;
}

/* Tables: ruled rows, a display-face header and room in every cell. In
   <app-prose> each table sits in a labelled region that scrolls sideways on
   its own (.prose-table, written by the Docs Markdown pipeline), so its words
   stay whole. */
:where(.prose) table {
    border-collapse: collapse;
    margin-block: 0 var(--sp-4);
}

:where(.prose) :is(th, td) {
    padding: var(--sp-2) var(--sp-3);
    border-block-end: var(--edge-w-hair) solid var(--ink);
    text-align: start;
    vertical-align: top;
}

:where(.prose) thead th {
    font-family: var(--font-display);
    font-weight: 800;
    border-block-end-width: var(--edge-w);
}


.prose-table {
    overflow-x: auto;
    margin-block: 0 var(--sp-4);
}

.prose-table > table {
    margin-block-end: 0;
}

.prose-table:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

/* ── Prose with a contents list ─────────────────────────────────────────────
   Audit LS-SH11. Below 1200px the list is a closed fold above the text (the
   disclosure component's inline box). From 1200px it is a 15rem column at the
   start, and the fold is not drawn; only one of the two is ever shown. */
.prose-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-5);
    align-items: start;
}

.prose-toc-fold {
    max-inline-size: min(var(--measure), 58ch);
}

.prose-toc {
    display: none;
}

.prose-toc-title {
    margin: 0 0 var(--sp-2);
    font-family: var(--font-display);
    font-size: var(--fs-3);
    font-weight: 800;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    color: var(--ink);
}

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

.prose-toc-list--sub {
    padding-inline-start: var(--sp-4);
}

/* Each entry is a full-width row with room above and below; on phones,
   tablets and under a coarse pointer it is at least 44px tall. */
.prose-toc-link {
    display: flex;
    align-items: center;
    padding-block: var(--sp-1h);
    line-height: var(--lh-tight);
    color: var(--ink);
    text-decoration: none;
}

.prose-toc-link:where(:hover) {
    text-decoration: underline;
}

.prose-toc-link:where(:focus-visible) {
    outline: var(--focus-ring);
    outline-offset: var(--focus-inset);
}

.prose-top {
    margin: 0;
}

.prose-top-link {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
}

@media (max-width: 1199.98px), (pointer: coarse) {
    .prose-toc-link,
    .prose-top-link {
        min-block-size: var(--touch-min);
    }
}

@media (min-width: 1200px) {
    .prose-layout--toc {
        grid-template-columns: var(--toc-w) minmax(0, 1fr);
        column-gap: var(--sp-6);
    }

    .prose-layout--toc > .prose-toc-fold {
        display: none;
    }

    .prose-layout--toc > .prose-toc {
        display: block;
        grid-column: 1;
        grid-row: 1 / span 2;
        align-self: start;
    }

    .prose-layout--toc > :is(.prose, .prose-top) {
        grid-column: 2;
    }
}

/* The list stays in view while the text scrolls, on a screen at least 600px
   tall (the same rule as app-split's sticky side). It scrolls inside itself,
   so its end can always be reached; the padding, taken back by the margin,
   keeps a focused link's ring inside the scrolling box. */
@media (min-width: 1200px) and (min-height: 600px) {
    .prose-layout--toc > .prose-toc {
        position: sticky;
        top: var(--sticky-top);
        max-block-size: calc(100vh - 2 * var(--sticky-top));
        max-block-size: calc(100dvh - 2 * var(--sticky-top));
        overflow-y: auto;
        padding: var(--sp-1);
        margin: calc(-1 * var(--sp-1));
    }
}

/* ── _Stepper ───────────────────────────────────────────────────────────────
   Audits DK4 and BP11. Every step is the same box: a 2rem badge and a label,
   with the chosen value under it once done. The states differ in shape as
   well as colour: a done step's badge is solid ink with a check mark, the
   current one is filled yellow with an offset block and a bold label, and a
   later one has a dashed outline and muted text. */
.stepper {
    margin-block: 0 var(--sp-4);
}

.stepper-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-5);
    margin: 0;
    padding: 0;
    list-style: none;
}

.stepper-step {
    display: flex;
    min-inline-size: 0;
}

/* The whole box is the link on a done step, so the badge, label and value
   are one 44px target and sit on the same line as every other step's. */
.stepper-item {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-block-size: var(--touch-min);
    min-inline-size: var(--touch-min);
    color: var(--ink);
    text-decoration: none;
}

.stepper-item:where(a:hover) .stepper-label {
    text-decoration: underline;
}

.stepper-item:where(a:focus-visible) {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

.stepper-badge {
    flex: none;
    display: inline-grid;
    place-items: center;
    inline-size: 2rem;
    block-size: 2rem;
    border: var(--edge-w) solid var(--ink);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-display);
    font-size: var(--fs-3);
    font-weight: 900;
    line-height: 1;
}

.stepper-text {
    display: flex;
    flex-direction: column;
    min-inline-size: 0;
    line-height: var(--lh-tight);
}

.stepper-label {
    font-weight: 600;
}

.stepper-value {
    font-size: var(--fs-3);
    color: var(--ink-muted);
    overflow-wrap: anywhere;
}

:where(.stepper-step--done) .stepper-badge {
    background: var(--ink);
    color: var(--surface);
}

:where(.stepper-step--current) .stepper-badge {
    background: var(--brand-primary);
    color: var(--on-brand);
    box-shadow: var(--shadow-sm);
}

:where(.stepper-step--current) .stepper-label {
    font-weight: 800;
}

:where(.stepper-step--upcoming) .stepper-badge {
    border-style: dashed;
    background: transparent;
    color: var(--ink-muted);
}

:where(.stepper-step--upcoming) .stepper-label {
    color: var(--ink-muted);
}

/* Phones: one row of badges, with only the current step's label beside its
   badge. The other labels are still read by screen readers. */
@media (max-width: 575.98px) {
    .stepper-list {
        flex-wrap: nowrap;
        gap: var(--sp-2);
    }

    :where(.stepper-step--current) {
        flex: 0 1 auto;
    }

    :where(.stepper-step--done, .stepper-step--upcoming) .stepper-text {
        position: absolute;
        inline-size: 1px;
        block-size: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .stepper-item {
        justify-content: center;
    }
}

/* A compact stepper (StepperModel.Compact), for four or more steps: at 320px
   a label beside even the current badge wrapped the last steps onto a row of
   their own, so below 576px the badges stand alone and the line above them
   says the current step. From 576px the line goes and the current label shows
   (below), and from 1200px every label shows, as on any stepper. A step that is not a link is not a target, so on a phone it
   shrinks to its 2rem badge: the buylist submission's six stages took 304px
   as 44px boxes, past the 268px a 320px panel holds, and take 232px as
   badges. A done step with a link keeps its 44px box. */
.stepper-now {
    display: none;
    margin: 0 0 var(--sp-2);
    font-weight: 700;
}

@media (max-width: 575.98px) {
    .stepper--compact .stepper-now {
        display: block;
    }

    .stepper--compact .stepper-text {
        position: absolute;
        inline-size: 1px;
        block-size: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .stepper--compact span.stepper-item {
        min-inline-size: 0;
    }
}

/* From 576px to 1199.98px a compact stepper keeps one row by naming only the
   current step beside its badge, as a plain stepper does on a phone; the
   other labels are still read by screen readers. Every label in a row did not
   fit there: the buylist submission's six labelled steps take 877px plus
   20px gaps, and its list is 484px wide at 576, 676px at 768 and 932px at
   1024 (two or three rows, "Archived" alone on the last), so all six show
   only from 1200px (the list is 1108px wide there). With one label the row
   takes at most about 453px. */
@media (min-width: 576px) and (max-width: 1199.98px) {
    .stepper--compact .stepper-list {
        flex-wrap: nowrap;
        gap: var(--sp-2);
    }

    .stepper--compact :where(.stepper-step--current) {
        flex: 0 1 auto;
    }

    .stepper--compact :where(.stepper-step--done, .stepper-step--upcoming) .stepper-text {
        position: absolute;
        inline-size: 1px;
        block-size: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

/* ── app-steps ──────────────────────────────────────────────────────────────
   Audits AC15 and PT17: numbered instructions, spaced apart, each number in a
   square yellow badge. The badge is drawn content with an empty alternative
   (the second content line), so a screen reader hears the list's own count
   and not the number twice; a browser without that syntax keeps the first. */
.app-steps {
    display: grid;
    gap: var(--sp-4);
    max-inline-size: min(var(--measure), 58ch);
    margin: 0 0 var(--sp-4);
    padding: 0;
    list-style: none;
    counter-reset: app-step;
}

.app-steps > li {
    counter-increment: app-step;
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    column-gap: var(--sp-3);
    align-items: start;
}

.app-steps > li::before {
    content: counter(app-step);
    content: counter(app-step) / "";
    grid-column: 1;
    grid-row: 1 / span 2;
    display: grid;
    place-items: center;
    inline-size: 2rem;
    block-size: 2rem;
    border: var(--edge-w) solid var(--ink);
    background: var(--brand-primary);
    color: var(--on-brand);
    font-family: var(--font-display);
    font-size: var(--fs-3);
    font-weight: 900;
    line-height: 1;
}

/* The title and the first line of the body sit level with the badge. */
.app-step-title {
    grid-column: 2;
    display: block;
    margin: 0;
    padding-block-start: var(--sp-1);
    font-family: var(--font-display);
    font-size: var(--fs-4);
    font-weight: 800;
    line-height: var(--lh-body);
    color: var(--ink);
}

.app-step-body {
    grid-column: 2;
    padding-block-start: var(--sp-1);
    line-height: var(--lh-body);
}

.app-step-body > :last-child {
    margin-block-end: 0;
}

/* ── Detail layout, price matrix and price list (mig-card-details) ──────────────
   _DetailLayout: one thing's page head, its picture beside its name and facts and
   the forms that act on it. _PriceMatrix and _PriceList: prices as small blocks
   sized to their content. The partials are Pages/Shared/_DetailLayout.cshtml,
   _PriceMatrix.cshtml and _PriceList.cshtml; the guide is
   docs/ui/components/detail.md. The card page (Products/Details) is the first
   user; its few page classes sit at the end of this file.

   Layout by screen:
   - below 768px: picture, head, body, stacked; the picture at most 12.5rem wide.
   - 768 to 991px (portrait tablets): the picture beside the head only, the body
     full width below it, so a form is never squeezed into a narrow column beside
     an empty picture column (audit PC13, LS-PR9).
   - from 992px: the picture in its own column beside the head and the body; it
     sticks while the page scrolls on a screen at least 600px tall, where it fits. */

.app-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "media" "head" "body";
    gap: var(--sp-4) var(--sp-6);
    padding: var(--sp-4) var(--sp-3);
    background: var(--surface);
    border: var(--edge-w) solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow-off) var(--shadow-off) 0 var(--shadow);
}

.app-detail-media {
    grid-area: media;
    display: grid;
    gap: var(--sp-3);
    align-content: start;
    justify-items: center;
    min-inline-size: 0;
}

.app-detail-art {
    inline-size: 100%;
    max-inline-size: 12.5rem;
    aspect-ratio: 5 / 7;
    background: var(--surface-sunken);
    border: var(--edge-w) solid var(--ink);
    box-shadow: var(--shadow-off) var(--shadow-off) 0 var(--shadow);
}

.app-detail-art img {
    display: block;
    inline-size: 100%;
    block-size: 100%;
    object-fit: contain;
    padding: var(--sp-1h);
}

/* The picture's links are the picture's width. Each grows to fill its line, so when the
   column is too narrow for both (768 to 991px) they stack as one left-aligned column of equal
   buttons, never two buttons centred on their own widths (final pass). */
.app-detail-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    inline-size: 100%;
    max-inline-size: 12.5rem;
}

.app-detail-links > * {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
}

.app-detail-head {
    grid-area: head;
    display: grid;
    gap: var(--sp-2);
    align-content: start;
    min-inline-size: 0;
}

.app-detail-eyebrow {
    margin: 0;
    font-size: var(--fs-3);
    font-weight: 600;
    color: var(--ink-muted);
}

.app-detail-title {
    margin: 0;
    max-inline-size: var(--measure);
    font-family: var(--font-display);
    font-weight: 900;
    font-size: var(--fs-display-2);
    line-height: var(--lh-tight);
    letter-spacing: -.01em;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

.app-detail-subtitle {
    margin: 0;
    font-size: var(--fs-3);
    color: var(--ink-muted);
}

/* The headline facts are held to the form grid's measure (one and a half form
   measures, 60rem), so on a wide screen the price and its owned line sit together
   instead of across the whole column (LS-PR15), and the owned line ends where the
   Add to Portfolio fields and the wishlist fold end: one right edge (final pass). */
.app-detail-lead {
    display: grid;
    gap: var(--sp-3);
    justify-items: start;
    margin-block-start: var(--sp-1);
    max-inline-size: calc(var(--measure-form) * 1.5);
    min-inline-size: 0;
}

.app-detail-body {
    grid-area: body;
    display: grid;
    gap: var(--sp-5);
    align-content: start;
    min-inline-size: 0;
}

@media (min-width: 576px) {
    .app-detail {
        padding: var(--sp-5);
    }
}

@media (min-width: 768px) {
    .app-detail {
        grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr);
        grid-template-areas: "media head" "body body";
    }

    .app-detail-art,
    .app-detail-links {
        max-inline-size: none;
    }
}

@media (min-width: 992px) {
    .app-detail {
        grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr);
        grid-template-rows: auto 1fr;
        grid-template-areas: "media head" "media body";
    }
}

@media (min-width: 992px) and (min-height: 600px) {
    .app-detail-media {
        position: sticky;
        inset-block-start: var(--sticky-top);
        align-self: start;
    }
}

@media (min-width: 1200px) {
    .app-detail {
        grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr);
    }
}

/* ── Price blocks: _PriceMatrix and _PriceList ─────────────────────────────────
   Each block is as wide as its figures, and the blocks of a panel sit side by
   side where there is room. A note under a block wraps to the block's width: it
   is held out of the block's sizing (contain: inline-size), so a long sentence
   never widens a two-column list (LS-PR15). */
.app-price-blocks {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--sp-5) var(--sp-6);
    min-inline-size: 0;
}

.app-price-block {
    display: grid;
    gap: var(--sp-2);
    flex: 0 1 auto;
    min-inline-size: 0;
    max-inline-size: 100%;
}

/* A list is as wide as its labels and figures, at least 14rem so its rows read as
   rows and at most 20rem, so two lists sit side by side in a half-width panel
   (the card page's Market Prices from 1280px) instead of stacking (final pass). */
.app-price-block--list {
    inline-size: fit-content;
    min-inline-size: min(100%, 14rem);
    max-inline-size: min(100%, 20rem);
}

.app-price-block-title {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--fs-2);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tracking-caps);
    color: var(--ink-muted);
}

.app-price-block-note {
    contain: inline-size;
    margin: 0;
    font-size: var(--fs-3);
    color: var(--ink-muted);
}

.app-price-list {
    display: grid;
    margin: 0;
}

.app-price-list > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--sp-3);
    padding: var(--sp-1h) 0;
    border-block-end: var(--edge-w-hair) solid var(--rule-soft);
}

.app-price-list > div:last-child {
    border-block-end: 0;
}

.app-price-list dt {
    min-inline-size: 0;
    font-weight: 500;
    color: var(--ink-muted);
}

.app-price-list dd {
    margin: 0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* The line a portfolio copy is valued from (PriceListItem.Yours): filled with the brand, and
   its label says Yours in a badge, so the mark is words as well as a fill. */
.app-price-list > .is-yours {
    margin-inline: calc(-1 * var(--sp-2));
    padding-inline: var(--sp-2);
    background: var(--brand-primary);
    color: var(--on-accent);
    border-block-end-color: transparent;
}

.app-price-list > .is-yours dt {
    color: var(--on-accent);
    font-weight: 700;
}

/* The column the others are read against (Near Mint, Market) is bold. */
.app-price-matrix .app-price-matrix-lead {
    font-weight: 700;
}

.app-price-matrix abbr[title] {
    text-decoration: none;
    cursor: help;
}

/* The card page's Market Prices panel (.app-detail-market) is half the row from 992px, wider
   than one matrix or two lists need from 1200px. There its blocks share the panel's width (a
   list up to 28rem), and a matrix fills it, so the figures do not keep to the left of an empty card (final pass,
   catalogue-3). Below 1200px the blocks keep their own widths, as everywhere else. */
@media (min-width: 1200px) {
    .app-detail-market .app-price-block {
        flex: 1 1 0;
    }

    /* 28rem, not the panel: a label stays near its figure (LS-PR15), and two lists still fill
       a half-width panel up to 3440. */
    .app-detail-market .app-price-block--list {
        max-inline-size: min(100%, 28rem);
    }

    .app-detail-market .app-price-block--matrix .data-table--fit {
        inline-size: 100%;
    }
}

/* ── The card page (Products/Details) ─────────────────────────────────────────── */
.app-detail-language {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
}

.app-detail-language .form-label {
    margin: 0;
    font-size: var(--fs-3);
    font-weight: 600;
}

.app-detail-language .form-select {
    inline-size: auto;
    max-inline-size: 100%;
}

.app-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1h);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* The headline price: as wide as the number and its label, never the whole column. */
.app-detail-price {
    display: grid;
    gap: var(--sp-0);
    inline-size: fit-content;
    min-inline-size: min(100%, 16rem);
    max-inline-size: 100%;
    padding: var(--sp-3) var(--sp-4);
    border: var(--edge-w) solid var(--ink);
    background: var(--surface-sunken);
}

.app-detail-price-label {
    font-size: var(--fs-2);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-caps);
    color: var(--ink-muted);
}

.app-detail-price-amount {
    font-family: var(--font-display);
    font-weight: 900;
    /* --fs-display-1 capped at 2.6rem: the token grows to 3.25rem, which would put the
       price well above the card's name (--fs-display-2, at most 2.4rem). */
    font-size: min(var(--fs-display-1), 2.6rem);
    line-height: var(--lh-tight);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.app-detail-price-amount small {
    font-size: .42em;
    color: var(--ink-muted);
}

.app-detail-price-amount--none {
    font-size: var(--fs-h2);
    color: var(--ink-muted);
}

.app-detail-owned {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    justify-self: stretch;
    min-block-size: var(--touch-min);
    padding: var(--sp-2) var(--sp-4);
    border: var(--edge-w) solid var(--ink);
    background: var(--ok);
    color: var(--on-accent);
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow-off-sm) var(--shadow-off-sm) 0 var(--shadow);
}

.app-detail-owned:hover {
    color: var(--on-accent);
    transform: translate(-1px, -1px);
    box-shadow: var(--shadow-off) var(--shadow-off) 0 var(--shadow);
}

.app-detail-owned-action {
    margin-inline-start: auto;
    font-family: var(--font-display);
    font-weight: 700;
}

/* The Add to Portfolio section's body is one stack: the fields, the Graded Slab
   chip, the grading fields when shown and the actions share the form grid's row
   gap, so the chip never sits on the Paid Each hint above it or draws its focus
   ring over that text. */
.app-detail-add .app-form-section-body {
    display: grid;
    gap: var(--sp-4);
}

.app-detail-graded {
    justify-self: start;
}

.app-detail-grading {
    min-inline-size: 0;
}

/* The wishlist entries and the fold under them are the width of the fold's form, not the
   whole column, so each Remove sits beside the entry it removes (LS-PR15). */
.app-detail-wishlist,
.app-detail-wish {
    max-inline-size: calc(var(--measure-form) * 1.5);
}

.app-detail-report {
    margin: 0;
}

.app-detail-report .link-action {
    padding-inline: 0;
    min-block-size: var(--touch-min);
}

.app-detail-note {
    margin: 0;
    max-inline-size: var(--measure);
    font-size: var(--fs-3);
    color: var(--ink-muted);
}

.app-detail-help {
    margin-block-start: var(--sp-4);
}

.app-detail-description {
    margin: 0;
    max-inline-size: var(--measure);
    overflow-wrap: anywhere;
}

.app-detail-history .trend-chart + .app-detail-note {
    margin-block-start: var(--sp-2);
}

.app-detail-admin h2 {
    margin-block: var(--sp-4) var(--sp-2);
}

.app-detail-unlink {
    margin-block-start: var(--sp-3);
}

/* A stepper's label and its control are two elements; the wrapper keeps them one grid cell. */
.app-detail-qty {
    display: grid;
    align-content: start;
    justify-items: start;
    min-inline-size: 0;
}

/* ── Disclosure (<app-disclosure>, TagHelpers/AppDisclosureTagHelper.cs) ──────
   One native <details> for every fold on the website: a 44px summary, one chevron
   that turns when it opens, and a meta line and count beside the label. Variants:
   panel (a whole panel that folds), inline (a bordered box inside a panel), row (a
   compact fold in a list row) and help (the "How This Works" fold after a lede).
   The sample page is /Admin/StyleGuide/Disclosure; docs/ui/components/disclosure.md.

   Specificity (UI plan §3, Cascade): every default here is one class, 0,1,0. The
   variant, the open state and :hover/:focus-visible go inside :where(), so they add
   nothing, and a page that adds its own class to the <details> can change any part
   with one more class (.my-fold > .app-disclosure-body). Because the rules tie, their
   ORDER decides: base, then open, then each variant, then the variant's open state.
   Keep new rules in that order. Two rules are wider on purpose, as their notes say. */

.app-disclosure {
    /* The summary's padding. Equal above and below, and the details itself has none,
       so a closed disclosure sits evenly in its box (audit LS-PR20). */
    --disclosure-pad-block: var(--sp-2);
    --disclosure-pad-inline: 0;
    min-inline-size: 0;
}

.app-disclosure-summary {
    display: flex;
    align-items: center;
    gap: var(--sp-2) var(--sp-3);
    /* Every summary, every width: a disclosure is opened by touch as often as by mouse. */
    min-block-size: var(--touch-min);
    padding-block: var(--disclosure-pad-block);
    padding-inline: var(--disclosure-pad-inline);
    color: var(--ink);
    font-weight: 600;
    line-height: var(--lh-tight);
    cursor: pointer;
    list-style: none;
}

/* display: flex already drops the marker; Safari draws its own unless told not to. */
.app-disclosure-summary::-webkit-details-marker {
    display: none;
}

/* The label and the meta wrap together as one block; the count and the chevron stay
   whole beside them. */
.app-disclosure-text {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--sp-0) var(--sp-2);
    min-inline-size: 0;
}

.app-disclosure-label {
    overflow-wrap: anywhere;
}

.app-disclosure-meta {
    color: var(--ink-muted);
    font-family: var(--font-body);
    font-size: var(--fs-3);
    font-weight: 400;
    letter-spacing: normal;
    overflow-wrap: anywhere;
}

.app-disclosure-count {
    flex-shrink: 0;
    padding: var(--sp-0) var(--sp-2);
    border: var(--edge-w-hair) solid var(--ink);
    border-radius: var(--radius);
    background: var(--surface-sunken);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--fs-2);
    font-weight: 600;
    letter-spacing: normal;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* The one chevron: two ink edges of a small square, turned. It points down when the
   fold is closed and up when it is open; on row and help, which lead with it, it points
   right and then down, like the marker it replaces. The shape carries the state, not a
   colour. The global reduced-motion rule flattens the turn. */
.app-disclosure-chevron {
    flex-shrink: 0;
    inline-size: var(--sp-2);
    block-size: var(--sp-2);
    margin-inline: var(--sp-1);
    border-right: var(--edge-w) solid currentColor;
    border-bottom: var(--edge-w) solid currentColor;
    transform: translateY(-25%) rotate(45deg);
    transition: transform .15s ease;
}

/* After the closed turn, at the same 0,1,0, so it wins by order. */
:where(.app-disclosure[open] > .app-disclosure-summary) > .app-disclosure-chevron {
    transform: translateY(25%) rotate(-135deg);
}

/* Wider on purpose (0,2,0): this takes the margin off children the component does not
   own, so it must outrank their own one-class margins (Bootstrap's .table, .form-text)
   wherever their files sit in the bundle. */
.app-disclosure-body > :last-child {
    margin-block-end: 0;
}

/* Before the variants: row and help keep their own body spacing, as they always have. */
.app-disclosure-body--flush {
    padding: 0;
}

/* ── Boxed variants: panel and inline ── the chevron at the far end. */
.app-disclosure--panel,
.app-disclosure--inline {
    border: var(--edge-w) solid var(--ink);
    border-radius: var(--radius);
    background: var(--surface);
}

:where(.app-disclosure--panel > .app-disclosure-summary, .app-disclosure--inline > .app-disclosure-summary) > .app-disclosure-text {
    flex: 1 1 auto;
}

/* Flush to the box's edge, so the ring is drawn inside it (UI plan, principle 2). The
   global :focus-visible ring is also 0,1,0 and sits earlier in the bundle. */
:where(.app-disclosure--panel, .app-disclosure--inline) > .app-disclosure-summary:where(:focus-visible) {
    outline-offset: var(--focus-inset);
}

:where(.app-disclosure--panel, .app-disclosure--inline) > .app-disclosure-summary:where(:hover) {
    background: var(--surface-sunken);
}

:where(.app-disclosure--panel, .app-disclosure--inline) > .app-disclosure-body {
    border-top: var(--edge-w-hair) solid var(--ink);
}

/* panel: the panel's chassis and padding, and the label drawn like a panel title. */
.app-disclosure--panel {
    --disclosure-pad-block: var(--sp-4);
    --disclosure-pad-inline: var(--sp-5);
    box-shadow: var(--shadow-md);
}

/* The size is h2.panel-title's own clamp (legacy/02-shell-panels.css), not --fs-h2,
   so a folded panel's label matches the panel titles beside it at every width. No
   token names that clamp yet; change the two together. */
:where(.app-disclosure--panel) > .app-disclosure-summary {
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 1.8vw, 1.45rem);
    font-weight: 900;
    letter-spacing: -.01em;
}

:where(.app-disclosure--panel) > .app-disclosure-body:where(:not(.app-disclosure-body--flush)) {
    padding: var(--sp-4) var(--sp-5);
}

/* A flush table's first and last columns line up with the summary's label and chevron.
   Wider on purpose: the cell is Bootstrap's, so the floor is Bootstrap's own selector
   (.table > :not(caption) > * > *, 0,1,1). The disclosure part adds nothing, and this
   ties with Bootstrap and wins by order, as Bootstrap loads before site.css. */
:where(.app-disclosure--panel > .app-disclosure-body--flush) .table > :not(caption) > * > :where(:first-child) {
    padding-inline-start: var(--sp-5);
}

:where(.app-disclosure--panel > .app-disclosure-body--flush) .table > :not(caption) > * > :where(:last-child) {
    padding-inline-end: var(--sp-5);
}

/* inline: a lighter box with no offset block, for a fold inside a panel. */
.app-disclosure--inline {
    --disclosure-pad-block: var(--sp-2h);
    --disclosure-pad-inline: var(--sp-4);
}

:where(.app-disclosure--inline) > .app-disclosure-summary {
    font-family: var(--font-display);
    font-weight: 700;
}

:where(.app-disclosure--inline) > .app-disclosure-body:where(:not(.app-disclosure-body--flush)) {
    padding: var(--sp-3) var(--sp-4);
}

:where(.app-disclosure--inline > .app-disclosure-body--flush) .table > :not(caption) > * > :where(:first-child) {
    padding-inline-start: var(--sp-4);
}

:where(.app-disclosure--inline > .app-disclosure-body--flush) .table > :not(caption) > * > :where(:last-child) {
    padding-inline-end: var(--sp-4);
}

/* ── Text variants: row and help ── the summary is as wide as its words, and the
   chevron leads. */
:where(.app-disclosure--row, .app-disclosure--help) > .app-disclosure-summary {
    display: inline-flex;
    max-inline-size: 100%;
}

/* A row's fold is a step smaller than the row's own text; help reads at body size. */
:where(.app-disclosure--row) > .app-disclosure-summary {
    font-size: var(--fs-3);
}

/* After the base open turn; the open turn below comes after this. */
:where(.app-disclosure--row > .app-disclosure-summary, .app-disclosure--help > .app-disclosure-summary) > .app-disclosure-chevron {
    order: -1;
    margin-inline: var(--sp-1) 0;
    transform: rotate(-45deg);
}

:where(.app-disclosure--row[open] > .app-disclosure-summary, .app-disclosure--help[open] > .app-disclosure-summary) > .app-disclosure-chevron {
    transform: translateY(-25%) rotate(45deg);
}

/* help's label is always underlined; the hover rule below, later, thickens it. */
:where(.app-disclosure--help > .app-disclosure-summary) .app-disclosure-label {
    text-decoration: underline;
    text-decoration-thickness: var(--edge-w-hair);
    text-underline-offset: .2em;
}

:where(.app-disclosure--row > .app-disclosure-summary:hover, .app-disclosure--help > .app-disclosure-summary:hover) .app-disclosure-label {
    text-decoration: underline;
    text-decoration-thickness: var(--edge-w);
    text-underline-offset: .2em;
}

:where(.app-disclosure--row) > .app-disclosure-body {
    padding-block-start: var(--sp-2);
}

/* help: a short note set off by an ink rule, capped at about 72 characters a line
   however wide the screen (UI plan, principles 5 and 11; the unit's acceptance asks for
   75 at most at 3440 and 3840). The cap is in ch, so it grows with the text: 70ch, the
   page measure, counts the width of a zero, and Inter's prose sets about 1.4 letters to
   each, so 70ch is about 100 characters and 50ch about 72. */
:where(.app-disclosure--help) > .app-disclosure-body {
    box-sizing: content-box;
    max-inline-size: calc(var(--measure) * 5 / 7);
    margin-block-start: var(--sp-1);
    padding: var(--sp-3) var(--sp-4);
    border-left: var(--edge-w-strong) solid var(--ink);
    background: var(--surface-sunken);
    color: var(--ink);
    line-height: var(--lh-body);
}

/* ── Empty state: compact grid and tone (empty-state unit) ───────────────────────
   <app-empty compact> renders .app-empty.app-empty-grid. The legacy .app-empty rule
   (legacy/05-work-nav.css) still draws the default, centred variant; this file loads
   after it, so .app-empty-grid replaces its flex column at equal specificity.

   The compact state was one flex row of icon, title and copy, so on a phone or in a
   narrow column the title was squeezed to a word per line ('No / New / Sets /
   Waiting') beside a column of copy. Now it is a grid: the icon beside the title, the
   copy and actions under the title. The element is its own inline-size container, so
   where it is narrower than 18rem (on a phone under about 336px wide, or in any
   column that narrow) the copy and actions take the full width under the icon and
   title, and the actions stack.

   Because it is a size container, its width never comes from its content: it must
   sit in a block that sets its width (a panel body, a block child, a full-width table
   cell). In a shrink-to-fit parent (a flex row item without flex-grow, an
   inline-block, a float, an auto grid track, an absolutely positioned box) it would
   collapse to its padding and break the title a letter per line, so give it
   flex: 1 1 auto in a flex row, or a set width. */
.app-empty-grid {
    container-type: inline-size;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    column-gap: var(--sp-2h);
    row-gap: 0;
    padding: var(--sp-3) 0;
    text-align: start;
}

.app-empty-grid > .app-empty-icon {
    grid-column: 1;
    grid-row: 1;
    font-size: var(--fs-5);
    margin-bottom: 0;
}

/* The title keeps whole words: it wraps between them, balanced, and never to a word
   per line, since it has the full column beside the icon. */
.app-empty-grid > .app-empty-title {
    grid-column: 2;
    grid-row: 1;
    min-inline-size: 0;
    overflow-wrap: break-word;
    text-wrap: balance;
}

/* Narrow first: copy and actions span both columns. */
.app-empty-grid > .app-empty-copy,
.app-empty-grid > .app-empty-actions {
    grid-column: 1 / -1;
}

.app-empty-grid > .app-empty-copy {
    max-width: var(--measure);
    margin-top: var(--sp-1);
    overflow-wrap: break-word;
    text-wrap: pretty;
}

.app-empty-grid > .app-empty-actions {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    justify-self: stretch;
    margin-top: var(--sp-3);
}

@container (min-width: 18rem) {
    .app-empty-grid > .app-empty-copy,
    .app-empty-grid > .app-empty-actions {
        grid-column: 2;
    }

    .app-empty-grid > .app-empty-actions {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-self: start;
    }
}

/* A text link in the action slot gets the touch floor a button already has
   (legacy/10-admin-touch.css gives every .btn 44px). */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .app-empty-actions > a:not(.btn) {
        display: inline-flex;
        align-items: center;
        min-block-size: var(--touch-min);
    }
}

/* tone="ok": an all-clear state. The check icon takes the ok ink; the title says
   the same in words, so colour is never the only signal. */
.app-empty--ok > .app-empty-icon {
    color: var(--ok-ink);
}

/* ── Filter bar (<app-filter-bar>, TagHelpers/AppFilterBarTagHelper.cs) ─────────
   One GET form that narrows a list: a search row, then chips, fields, an advanced
   sub-section and the actions. No layout here depends on which fields exist (audit
   PC1, LS-PR3): fields wrap, each between 11rem and its own width cap, so a hidden
   field leaves no hole and nothing is pushed past the panel's edge. From 576 to 991px
   the fields are two equal columns (a 2x2 block of four selects, LS-ME12); below
   576px one. Every label and legend is the one compact label, and every control is
   --control-h tall, so the bottoms of a row line up (PC8). Below the bar's collapse
   width everything but the search folds behind "Filters" (PF2, PC10).
   docs/ui/components/filter-bar.md; sample page /Admin/StyleGuide/FilterBar.

   Specificity (UI plan §3, Cascade): defaults are one class, or sit in :where(). The
   collapse-width rules are two classes on purpose: they undo the inline disclosure's
   box, whose own rules are one class. */

.app-filter-bar {
    display: grid;
    gap: var(--sp-3);
    min-inline-size: 0;
}

/* ── The compact label ─────────────────────────────────────────────────────────
   The one small field label (audit CC11): it was redefined five times
   (.catalogue-filter-form, .item-add-fields, .item-qty-row, .portfolio-filter-selects,
   .bulk-bar-field .form-label). Every label and legend in a filter bar has it, and
   any other dense form can use the class. A legend loses Bootstrap's float and heading
   size, so it sits exactly where a label beside it sits. The two legend.* selectors
   match the legacy legend.form-label rule (0,1,1, 07-form-widgets.css) and win on bundle
   order, so a page's <legend class="form-label"> is the compact label here too. */
.form-label--compact,
legend.form-label--compact,
:where(.app-filter-bar) .form-label,
:where(.app-filter-bar) legend.form-label,
:where(.app-filter-bar-body) legend {
    display: block;
    float: none;
    inline-size: auto;
    margin: 0 0 var(--sp-1h);
    padding: 0;
    font-family: var(--font-display);
    font-size: var(--fs-3);
    font-weight: 700;
    line-height: var(--lh-tight);
}

/* ── Search ── its own row, the full width up to 48rem at every size. */
.app-filter-bar-search {
    inline-size: 100%;
    max-inline-size: 48rem;
    min-inline-size: 0;
}

.app-filter-bar-search-row {
    display: flex;
    gap: var(--sp-2);
    min-inline-size: 0;
}

.app-filter-bar-search-input {
    flex: 1 1 auto;
    min-inline-size: 0;
}

.app-filter-bar-search-button {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    min-inline-size: var(--touch-min);
}

/* ── The body: chips, fields, advanced, actions ── one column on a phone. */
.app-filter-bar-body {
    display: grid;
    gap: var(--sp-3);
    min-inline-size: 0;
}

.app-filter-bar-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--sp-3);
    min-inline-size: 0;
}

.app-filter-bar-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
    gap: var(--sp-3);
    min-inline-size: 0;
}

/* Each field is capped by its own width (app-form-field width), never by a track. */
.app-filter-bar-fields > * {
    min-inline-size: 0;
    max-inline-size: var(--field-w-md);
}

.app-filter-bar-fields > :where(.app-field--w-xs) {
    max-inline-size: var(--field-w-xs);
}

.app-filter-bar-fields > :where(.app-field--w-sm) {
    max-inline-size: var(--field-w-sm);
}

.app-filter-bar-fields > :where(.app-field--w-lg) {
    max-inline-size: var(--field-w-lg);
}

.app-filter-bar-fields > :where(.app-field--w-full, fieldset) {
    max-inline-size: 100%;
}

/* A control that is not a form control still stands --control-h tall: the segmented
   strip and the check chip. --control-h is in em, which resolves where it is used, so
   it is set on the strip and the chip's label (body size), not on their smaller text,
   and the option or face inside stretches to it (audit PC8: the chip was 36px beside
   40px selects). */
:where(.app-filter-bar) .app-segmented-track,
:where(.app-filter-bar) .check-chip {
    min-block-size: var(--control-h);
}

.app-filter-bar-advanced {
    min-inline-size: 0;
    margin: 0;
    padding: var(--sp-3) 0 0;
    border: 0;
    border-block-start: var(--edge-w-hair) solid var(--rule-soft);
}

.app-filter-bar-advanced-count {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--ink-muted);
}

.app-filter-bar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2) var(--sp-4);
}

.app-filter-bar-apply {
    flex: none;
}

/* Reset is a link: it goes to the unfiltered list, it does not submit the form. */
.app-filter-bar-reset {
    display: inline-flex;
    align-items: center;
    min-block-size: var(--control-h);
    color: var(--ink);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: var(--edge-w-hair);
    text-underline-offset: .2em;
}

.app-filter-bar-reset:hover {
    color: var(--ink);
    text-decoration-thickness: var(--edge-w);
}

/* ── Active filters ── shown only where the fields are folded away. */
.app-filter-bar-active {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    min-inline-size: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.app-filter-bar-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    max-inline-size: 100%;
    min-block-size: var(--touch-min);
    padding: var(--sp-1) var(--sp-3);
    border: var(--edge-w) solid var(--ink);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font-size: var(--fs-3);
    font-weight: 600;
    line-height: var(--lh-tight);
    text-decoration: none;
}

.app-filter-bar-chip:hover {
    color: var(--ink);
    background: var(--surface-sunken);
}

.app-filter-bar-chip-text {
    min-inline-size: 0;
    overflow-wrap: anywhere;
}

.app-filter-bar-chip-x {
    flex: none;
    font-size: var(--fs-2);
}

/* ── Under 400px the search button keeps its name but shows only the magnifier. ── */
@media (max-width: 399.98px) {
    .app-filter-bar-search-text {
        position: absolute;
        inline-size: 1px;
        block-size: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }
}

/* ── 576 to 991px: two equal columns of fields. ── */
@media (min-width: 576px) {
    .app-filter-bar-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* The body's own fields share the body's two columns, so the actions (Reset Filters, a bar's
   links) take the free cell beside an odd last field instead of a line of their own: at 768 the
   portfolio's Sort sat alone in its row and Manage Tags alone on the next (final pass,
   portfolio-grid-6). Chips and the advanced sub-section still take the whole row. */
@media (min-width: 576px) and (max-width: 991.98px) {
    .app-filter-bar-body {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: end;
    }

    .app-filter-bar-body > :not(.app-filter-bar-fields, .app-filter-bar-actions) {
        grid-column: 1 / -1;
    }

    :where(.app-filter-bar-body) > .app-filter-bar-fields {
        display: contents;
    }
}

/* ── From 992px: one wrapping row, the actions after the last field. ── */
@media (min-width: 992px) {
    .app-filter-bar-body {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
    }

    .app-filter-bar-chips {
        flex: 0 1 auto;
        max-inline-size: 100%;
    }

    /* The fields join the body's row, so the actions can follow the last of them. */
    :where(.app-filter-bar-body) > .app-filter-bar-fields {
        display: contents;
    }

    .app-filter-bar-fields > * {
        flex: 1 1 11rem;
    }

    .app-filter-bar-fields > :where(fieldset) {
        flex: 0 1 auto;
    }

    :where(.app-filter-bar-advanced) > .app-filter-bar-fields {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
    }

    .app-filter-bar-advanced {
        flex: 1 1 100%;
    }

    /* The actions follow the last field, as the next item in the row. Pushed to the row's far end
       they stood apart from a bar's one or two capped fields, 800px away at 1280. */
    .app-filter-bar-actions {
        flex: 0 0 auto;
    }
}

/* ── The fold, opened for good from the collapse width up ─────────────────────
   The summary goes and the content shows whatever the open state, through the
   details' content box (::details-content). A browser without it keeps the summary,
   so the fields can still be opened. The box of the inline disclosure goes too: from
   here the bar is part of its panel. */
@media (min-width: 576px) {
    .app-filter-bar--collapse-sm > .app-filter-bar-active {
        display: none;
    }

    .app-filter-bar--collapse-sm > .app-filter-bar-fold {
        border: 0;
        background: none;
    }

    .app-filter-bar--collapse-sm > .app-filter-bar-fold > .app-disclosure-body {
        padding: 0;
        border: 0;
    }

    @supports selector(::details-content) {
        .app-filter-bar--collapse-sm > .app-filter-bar-fold > .app-disclosure-summary {
            display: none;
        }

        .app-filter-bar--collapse-sm > .app-filter-bar-fold::details-content {
            content-visibility: visible;
        }
    }
}

@media (min-width: 768px) {
    .app-filter-bar--collapse-md > .app-filter-bar-active {
        display: none;
    }

    .app-filter-bar--collapse-md > .app-filter-bar-fold {
        border: 0;
        background: none;
    }

    .app-filter-bar--collapse-md > .app-filter-bar-fold > .app-disclosure-body {
        padding: 0;
        border: 0;
    }

    @supports selector(::details-content) {
        .app-filter-bar--collapse-md > .app-filter-bar-fold > .app-disclosure-summary {
            display: none;
        }

        .app-filter-bar--collapse-md > .app-filter-bar-fold::details-content {
            content-visibility: visible;
        }
    }
}

@media (min-width: 992px) {
    .app-filter-bar--collapse-lg > .app-filter-bar-active {
        display: none;
    }

    .app-filter-bar--collapse-lg > .app-filter-bar-fold {
        border: 0;
        background: none;
    }

    .app-filter-bar--collapse-lg > .app-filter-bar-fold > .app-disclosure-body {
        padding: 0;
        border: 0;
    }

    @supports selector(::details-content) {
        .app-filter-bar--collapse-lg > .app-filter-bar-fold > .app-disclosure-summary {
            display: none;
        }

        .app-filter-bar--collapse-lg > .app-filter-bar-fold::details-content {
            content-visibility: visible;
        }
    }
}

/* ── Touch: 44px each way unless it is certainly a mouse (the touch layer's test). ── */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    :where(.app-filter-bar) .app-segmented-track,
    :where(.app-filter-bar) .check-chip,
    .app-filter-bar-reset {
        min-block-size: var(--touch-min);
    }
}

/* ── Form field (<app-form-field>, TagHelpers/AppFormFieldTagHelper.cs) ───────────
   The wrapper is .app-field whenever a field uses a width, a size, an adornment, a
   counter, a mark, a label option or an error; a plain field keeps the markup and the
   look it always had. docs/ui/components/form-field.md is the guide. */

.app-field {
    min-inline-size: 0;
}

/* ── Widths ───────────────────────────────────────────────────────────────────
   A cap, never a fixed size: the control fills its column up to the token, so a md
   field is 20rem on a desktop and the full column on a 320px phone. The group (an
   input with a prefix or suffix) is capped as a whole, so the adornment is inside
   the width, not added to it. The tokens are rem, so they grow with the fluid root
   from 1920px and no field gets longer in characters. */
.app-field--w-xs > .app-field__control,
.app-field--w-xs > .app-field__group {
    max-inline-size: var(--field-w-xs);
}

.app-field--w-sm > .app-field__control,
.app-field--w-sm > .app-field__group {
    max-inline-size: var(--field-w-sm);
}

.app-field--w-md > .app-field__control,
.app-field--w-md > .app-field__group {
    max-inline-size: var(--field-w-md);
}

.app-field--w-lg > .app-field__control,
.app-field--w-lg > .app-field__group {
    max-inline-size: var(--field-w-lg);
}

.app-field--w-full > .app-field__control,
.app-field--w-full > .app-field__group {
    max-inline-size: none;
}

/* ── Prefix and suffix ────────────────────────────────────────────────────────
   Bootstrap's input group wraps, so in a narrow column "%" fell onto a line of its
   own under its input (audit SB16). Here the group never wraps: the input shrinks
   (min-inline-size 0) and the adornment keeps its text on one line. */
.app-field__group {
    flex-wrap: nowrap;
}

.app-field__group > .app-field__control {
    min-inline-size: 0;
}

.app-field__prefix,
.app-field__suffix {
    flex: none;
    white-space: nowrap;
    background-color: var(--surface-sunken);
    color: var(--ink);
    font-weight: 600;
}

/* ── Sizes ────────────────────────────────────────────────────────────────────
   Bootstrap's -sm and -lg classes size the control; the label follows. The touch
   layer still lifts every control to 44px below 992px or on a touch screen. */
.app-field--sm > .form-label {
    margin-block-end: var(--sp-1);
    font-size: var(--fs-3);
}

.app-field--lg > .form-label {
    font-size: var(--fs-5);
}

/* ── Required and optional marks ──────────────────────────────────────────────
   Words, not a colour or a bare asterisk. "(Required)" is hidden from screen
   readers, which hear the control's own required state; "(Optional)" is read. */
.app-field__mark {
    font-weight: 400;
    color: var(--ink-muted);
}

/* ── Counter ──────────────────────────────────────────────────────────────────
   field-counter.js writes how many characters are left. Over the limit the words
   say so ("3 characters too many") and the text turns the error ink and bold. */
.app-field__counter {
    font-variant-numeric: tabular-nums;
}

.app-field__counter.is-over {
    color: var(--bad-ink);
    font-weight: 600;
}

/* ── Invalid ──────────────────────────────────────────────────────────────────
   An invalid control gets the error ink and a heavier edge (an inset ring, so the
   field does not move), and its message sits on its own line below it. The words
   of the message carry the meaning; the edge only points at the field. A control
   client validation marks (.input-validation-error) gets the same edge. */
.app-field--invalid .app-field__control,
.app-field .app-field__control.input-validation-error {
    border-color: var(--bad-ink);
    box-shadow: inset 0 0 0 var(--edge-w-hair) var(--bad-ink);
}

.app-field--invalid .app-field__control:focus,
.app-field .app-field__control.input-validation-error:focus {
    border-color: var(--bad-ink);
    box-shadow: inset 0 0 0 var(--edge-w-hair) var(--bad-ink), var(--shadow-off-sm) var(--shadow-off-sm) 0 var(--brand-primary);
}

.app-field--invalid .app-field__group > .app-field__prefix,
.app-field--invalid .app-field__group > .app-field__suffix {
    border-color: var(--bad-ink);
}

.app-field .field-validation-error {
    display: block;
    margin-block-start: var(--sp-1);
    font-size: var(--fs-3);
    font-weight: 600;
}

/* ── Form layout (form-layout) ───────────────────────────────────────────────
   How a form's fields sit: app-form-stack (one column), app-form-grid (fields
   side by side, top-aligned), app-form-section (a titled group, aside or
   stacked), app-form-actions (the commit row, an app-action-bar), app-inline-form
   (a field and its button on one line) and app-danger-zone. The tag helpers are
   TagHelpers/AppFormLayoutTagHelpers.cs, the guide is
   docs/ui/components/form-layout.md, and the samples are
   /Admin/StyleGuide/FormLayout. A form keeps its measure on every screen: the
   stack is at most --measure-form (40rem) and the grid one and a half of it
   (60rem), both rem, so they grow with the fluid root from 1920px and no line
   gets longer in characters. */

/* ── app-form-stack ─────────────────────────────────────────────────────── */
.app-form-stack {
    --app-form-gap: var(--sp-4);
    display: flex;
    flex-direction: column;
    gap: var(--app-form-gap);
    min-inline-size: 0;
    max-inline-size: var(--measure-form);
}

.app-form-stack--wide {
    max-inline-size: calc(var(--measure-form) * 1.5);
}

.app-form-stack--full {
    max-inline-size: none;
}

.app-form-stack--gap-sm {
    --app-form-gap: var(--sp-3);
}

.app-form-stack--gap-lg {
    --app-form-gap: var(--sp-6);
}

/* A field's own margins would add to the gap. */
.app-form-stack > *,
.app-form-grid > * {
    margin-block: 0;
}

/* ── app-form-grid ──────────────────────────────────────────────────────────
   As many columns as fit at --app-form-grid-min, up to --app-form-grid-cols,
   worked out from the grid's own width: a column is never narrower than the
   min, nor narrower than its share of the row at the most columns, and never
   wider than the grid (so one column on a 320px phone or in a side panel).
   auto-fill keeps a row's empty tracks, so two fields in a three-column grid
   keep the width of a column rather than stretching. Every field starts at the
   top of its row, so labels share a line and help text hangs below its own
   control (audit AA1, AB2, LS-AD5). */
.app-form-grid {
    --app-form-grid-cols: 2;
    --app-form-grid-min: var(--card-min);
    --app-form-grid-col-gap: var(--sp-5);
    display: grid;
    grid-template-columns: repeat(
        auto-fill,
        minmax(
            min(100%, max(var(--app-form-grid-min), (100% - (var(--app-form-grid-cols) - 1) * var(--app-form-grid-col-gap)) / var(--app-form-grid-cols))),
            1fr));
    align-items: start;
    gap: var(--sp-4) var(--app-form-grid-col-gap);
    min-inline-size: 0;
    max-inline-size: calc(var(--measure-form) * 1.5);
}

.app-form-grid--cols-1 { --app-form-grid-cols: 1; }
.app-form-grid--cols-2 { --app-form-grid-cols: 2; }
.app-form-grid--cols-3 { --app-form-grid-cols: 3; }
.app-form-grid--cols-4 { --app-form-grid-cols: 4; }

.app-form-grid--min-sm { --app-form-grid-min: var(--field-w-sm); }
.app-form-grid--min-md { --app-form-grid-min: var(--field-w-md); }

/* tracks: a three-column row of long fields and codes sized by its fields, not in equal thirds,
   which left a gap mid-row beside a 10rem code (the card editor, LS-PR8). From 768px the long
   fields share what is left and the short ones get 10rem columns at the row's end, the same
   columns on every such row, so the gaps that remain are at the right edge. One column below,
   as the phone layout is. */
:is(.app-form-grid--tracks-wide-narrow-narrow, .app-form-grid--tracks-wide-wide-narrow) {
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 768px) {
    .app-form-grid--tracks-wide-narrow-narrow {
        grid-template-columns: minmax(0, 1fr) var(--field-w-sm) var(--field-w-sm);
    }

    .app-form-grid--tracks-wide-wide-narrow {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) var(--field-w-sm);
    }
}

/* A field fills its cell (app-form-field's default col-12 is width 100%), and
   the actions, a fieldset or a marked item take the whole row. */
.app-form-grid > * {
    min-inline-size: 0;
}

.app-form-grid > :is(.app-form-actions, fieldset, .app-form-grid-full) {
    grid-column: 1 / -1;
}

/* ── app-form-actions ───────────────────────────────────────────────────────
   The commit row is an app-action-bar (components/action-bar.css draws it and
   its sticky form). Here it only keeps a little more room above it than the
   fields keep between them, so it reads as the end of the form. */
.app-form-actions {
    margin-block-start: var(--sp-2);
}

/* ── app-form-section ───────────────────────────────────────────────────────
   A titled group. Stacked: the heading and its sentence, then the fields.
   Aside: from a section 52rem wide (a container query, so it holds in any
   column) the heading sits in a column of its own, 15 to 20rem, beside fields
   capped at the form measure. Sections that follow one another are divided by
   a soft rule. */
.app-form-section {
    container: app-form-section / inline-size;
    min-inline-size: 0;
}

.app-form-section + .app-form-section {
    padding-block-start: var(--sp-5);
    border-block-start: var(--edge-w) solid var(--rule-soft);
}

.app-form-section-inner {
    display: grid;
    gap: var(--sp-3);
}

.app-form-section-head {
    min-inline-size: 0;
    max-inline-size: var(--measure);
}

.app-form-section-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--fs-h3);
    font-weight: 800;
    line-height: var(--lh-tight);
    text-wrap: balance;
}

.app-form-section-copy {
    margin: var(--sp-1) 0 0;
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

.app-form-section-body {
    min-inline-size: 0;
}

@container app-form-section (min-width: 52rem) {
    .app-form-section--aside > .app-form-section-inner {
        grid-template-columns: minmax(var(--toc-w), var(--side-w)) minmax(0, var(--measure-form));
        column-gap: var(--sp-6);
    }
}

/* ── app-inline-form ────────────────────────────────────────────────────────
   One or two fields and their buttons on a wrapping line. A field grows from
   --card-min to --field-w-lg (32rem), or to its own width when it has a smaller
   one; a button keeps its label's width. Items start at the top, and a button
   is pushed down by one label line and the label's margin, so it lines up with
   the input rather than with the label or the help under it (audit AB3). The
   label is inline, so its line is the field's own line (1rem at the body
   line height) even when its type is smaller; a small field only has the
   smaller margin under it. A field with a hidden label keeps no such room. Below 576px the line is one full-width column. */
.app-inline-form {
    --app-inline-form-offset: calc(1rem * var(--lh-body) + var(--sp-2));
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--sp-3);
    min-inline-size: 0;
}

.app-inline-form:has(> .app-field--sm) {
    --app-inline-form-offset: calc(1rem * var(--lh-body) + var(--sp-1));
}

.app-inline-form:not(:has(> * > .form-label:not(.visually-hidden))) {
    --app-inline-form-offset: 0px;
}

.app-inline-form > :not(.btn, .app-action, .dropdown) {
    flex: 1 1 var(--card-min);
    inline-size: auto;
    min-inline-size: 0;
    max-inline-size: var(--field-w-lg);
}

.app-inline-form > .app-field--w-xs { flex: 0 1 var(--field-w-xs); max-inline-size: var(--field-w-xs); }
.app-inline-form > .app-field--w-sm { flex: 0 1 var(--field-w-sm); max-inline-size: var(--field-w-sm); }
.app-inline-form > .app-field--w-md { flex-basis: var(--field-w-md); max-inline-size: var(--field-w-md); }

.app-inline-form > :is(.btn, .app-action, .dropdown) {
    flex: none;
    max-inline-size: 100%;
    margin-block-start: var(--app-inline-form-offset);
}

@media (max-width: 575.98px) {
    .app-inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .app-inline-form > :not(.btn, .app-action, .dropdown),
    .app-inline-form > .app-field--w-xs,
    .app-inline-form > .app-field--w-sm,
    .app-inline-form > .app-field--w-md {
        flex: none;
        max-inline-size: none;
    }

    .app-inline-form > :is(.btn, .app-action, .dropdown) {
        inline-size: 100%;
        margin-block-start: 0;
    }
}

/* ── app-danger-zone ────────────────────────────────────────────────────────
   Destructive actions, set apart in an error-ink frame. The heading's words and
   its warning sign say what it is; the colour only repeats them. Each item is
   its name and sentence beside its button, and the button drops below the words
   when the two do not fit one line. */
.app-danger-zone {
    min-inline-size: 0;
    max-inline-size: calc(var(--measure-form) * 1.5);
    padding: var(--sp-4) var(--sp-5);
    background: var(--surface);
    border: var(--edge-w) solid var(--bad-ink);
    border-inline-start-width: calc(var(--edge-w) * 3);
}

.app-danger-zone-title {
    display: flex;
    align-items: baseline;
    gap: var(--sp-2);
    margin: 0;
    color: var(--bad-ink);
    font-family: var(--font-display);
    font-size: var(--fs-h3);
    font-weight: 800;
    line-height: var(--lh-tight);
}

.app-danger-zone-title > .bi {
    flex: none;
}

.app-danger-zone-copy {
    margin: var(--sp-1) 0 0;
    max-inline-size: var(--measure);
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

.app-danger-zone-items {
    margin: var(--sp-3) 0 0;
    padding: 0;
    list-style: none;
}

.app-danger-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2) var(--sp-4);
    padding-block: var(--sp-3);
    border-block-start: var(--edge-w-hair) solid var(--rule-soft);
}

.app-danger-item:last-child {
    padding-block-end: 0;
}

.app-danger-item-text {
    flex: 1 1 18rem;
    min-inline-size: 0;
    max-inline-size: var(--measure);
}

.app-danger-item-title {
    margin: 0;
    font-size: var(--fs-4);
    font-weight: 700;
    line-height: var(--lh-tight);
}

.app-danger-item-copy {
    margin: var(--sp-1) 0 0;
    font-size: var(--fs-3);
    overflow-wrap: anywhere;
}

.app-danger-item-action {
    flex: none;
    max-inline-size: 100%;
}

.app-danger-item-action > form {
    margin: 0;
}

@media (max-width: 575.98px) {
    .app-danger-zone {
        padding: var(--sp-3);
    }

    .app-danger-item-action,
    .app-danger-item-action .btn {
        inline-size: 100%;
    }
}

/* ── Touch ─────────────────────────────────────────────────────────────────
   44px wherever the pointer is not certainly a mouse, as the action bar
   carries it, for the buttons drawn outside a bar. */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .app-inline-form > :is(.btn, .app-action),
    .app-danger-item-action .btn {
        min-block-size: var(--touch-min);
    }
}

/* ── Import: _CardAddRow, _ImportBatch, _ImportDestination (mig-quick-import) ──────────────────
   docs/ui/components/import.md. Quick Import uses all three; the card scanner uses _ImportBatch's
   client variant.
   Replaces .quick-import-layout, .quick-import-cart, .qi-card*, .qi-option, .qi-options-toggle,
   .qi-qty*, .qi-cart-items--scroll and .cart-total on Quick Import (docs/ui/dead-css/mig-quick-import.md). */

/* ── _CardAddRow ─────────────────────────────────────────────────────────── */

/* The results: one row each, ruled apart. */
.card-add-list {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.card-add-list > li + li {
    border-block-start: var(--edge-w-hair) solid var(--rule-soft);
}

.card-add-list > li {
    padding-block: var(--sp-3);
}

/* The card, then the form; side by side where the row has room for both, each wrapping as a
   whole. The two start from the same 24rem; the form takes two parts of the free room to the
   card's one until it stops at 48rem, and the card takes the rest. So from 992px the card's text
   is never a narrow column (it was 345px beside a 505px form at 1366, now about 410), on a wide
   screen it gets all the room past the form's cap (a Yu-Gi-Oh name and set each on one line),
   and Add stays beside the fields (final pass 2026-11-18, catalogue-tools-0). */
.card-add {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--sp-3) var(--sp-5);
    min-inline-size: 0;
}

.card-add__card {
    display: flex;
    flex: 1 1 24rem;
    align-items: flex-start;
    gap: var(--sp-3);
    min-inline-size: 0;
    align-self: flex-start;
}

.card-add__card > .card-thumb {
    flex: none;
}

.card-add__text {
    display: grid;
    gap: var(--sp-0);
    min-inline-size: 0;
}

.card-add__name {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.card-add__meta,
.card-add__value {
    font-size: var(--fs-3);
    overflow-wrap: anywhere;
}

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

/* The dot between two parts is held to the part before it by a no-break space, and the line can
   break only at the space after it, so a dot never starts a line ("· Non-Foil"). Hidden from
   screen readers. */
.card-add__part:not(:last-child)::after,
.import-batch__part:not(:last-child)::after {
    content: "\a0\b7\20";
    content: "\a0\b7\20" / "";
}

/* Every subtitle part but the set name keeps its text in .card-add__whole, an inline block: it
   moves to the next line as one piece ("#LOB-" and "124", or "Yu-" and "Gi-Oh!", never part),
   while the part's " · " sits outside it, so the line still breaks after each dot. Not nowrap:
   a nowrap part carried its separator's space with it, and at 320 "#LOB-007 · Yu-Gi-Oh! ·
   Non-Foil" became one 215px run that widened every row of the list past the panel. A part wider
   than the text column wraps inside itself rather than widen the row (final pass,
   catalogue-tools-0 and its second review). */
.card-add__whole {
    display: inline-block;
    max-inline-size: 100%;
}

.card-add__value {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--sp-2);
    font-variant-numeric: tabular-nums;
}

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

/* The form: the fields, then Add, along one line that wraps a whole field at a time; a wrapped Add
   keeps to the line's end, where it is on every other row. A select
   keeps room for its longest value ("Moderately Played", "Chinese (Traditional)", "Reverse
   Holofoil") rather than being cut to "No" or "Near Min" (PT4, LS-PR4). */
.card-add__form {
    display: flex;
    flex: 2 1 24rem;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--sp-2) var(--sp-3);
    margin: 0;
    min-inline-size: 0;
    max-inline-size: 48rem;
}

.card-add__fields {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--sp-2) var(--sp-3);
    min-inline-size: 0;
}

.card-add__field {
    display: grid;
    gap: var(--sp-1);
    min-inline-size: 0;
}

.card-add__field--select {
    flex: 1 1 13rem;
    max-inline-size: 17rem;
}

.card-add__field--select .form-select {
    min-inline-size: 13rem;
}

.card-add__field--qty {
    flex: none;
}

.card-add__label,
.import-batch__label,
.import-destination__label {
    margin: 0;
    color: var(--ink-muted);
    font-size: var(--fs-1);
    font-weight: 700;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
}

.card-add__submit {
    flex: none;
    margin-inline-start: auto;
    white-space: nowrap;
}

.card-add__toggle {
    white-space: nowrap;
}

.card-add__toggle .bi {
    display: inline-block;
    transition: transform .15s ease;
}

.card-add__toggle[aria-expanded="true"] .bi {
    transform: rotate(180deg);
}

.card-add__notice {
    flex-basis: 100%;
    margin: 0;
    font-size: var(--fs-3);
}

/* Phones: the Options button and Add share the first row and the fields open under it (PT10).
   Without card-add-row.js the button stays hidden and every field shows. */
@media (max-width: 575.98px) {
    .card-add__form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        flex-basis: 100%;
    }

    .card-add__fields,
    .card-add__submit,
    .card-add__notice {
        grid-column: 1 / -1;
    }

    /* In the grid Add fills its cell, so the line-end margin is not wanted. */
    .card-add__submit {
        margin-inline-start: 0;
    }

    .card-add__field--select {
        flex-basis: 100%;
        max-inline-size: none;
    }

    .card-add__field--select .form-select {
        min-inline-size: 0;
    }

    .card-add[data-card-add-collapsed] .card-add__toggle {
        grid-row: 1;
        grid-column: 1;
    }

    .card-add[data-card-add-collapsed] .card-add__submit {
        grid-row: 1;
        grid-column: 2;
    }

    .card-add[data-card-add-collapsed] .card-add__fields {
        grid-row: 2;
    }

    .card-add[data-card-add-collapsed="true"] .card-add__fields {
        display: none;
    }
}

@media (min-width: 576px) {
    .card-add__toggle {
        display: none;
    }
}

/* 44px targets wherever the pointer is not certainly a mouse (as the legacy touch layer reads it). */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .card-add .btn,
    .card-add .form-select,
    .import-batch .btn,
    .import-batch-summary .btn,
    .import-batch--client .form-select,
    .import-batch--client .form-control,
    .import-destination .form-select {
        min-block-size: var(--touch-min);
    }

    /* The count's minus (or bin) and plus are icon-only: square them to the target too. */
    .import-batch__count > .btn {
        min-inline-size: var(--touch-min);
    }
}

/* ── _ImportBatch ────────────────────────────────────────────────────────── */

.import-batch__lines {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* The thumbnail and the text side by side, then (Full variant) the quantity row under both. */
.import-batch__line {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--sp-2) var(--sp-3);
    padding-block: var(--sp-3);
    min-inline-size: 0;
}

.import-batch__line:first-child {
    padding-block-start: 0;
}

.import-batch__line + .import-batch__line {
    border-block-start: var(--edge-w-hair) solid var(--rule-soft);
}

.import-batch__line > .card-thumb {
    flex: none;
}

.import-batch__line-text {
    display: grid;
    gap: var(--sp-0);
    flex: 1 1 0;
    min-inline-size: 0;
}

.import-batch__line-name {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.import-batch__line-meta {
    color: var(--ink-muted);
    font-size: var(--fs-3);
    overflow-wrap: anywhere;
}

.import-batch__line-value {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--sp-2);
    font-size: var(--fs-3);
    font-variant-numeric: tabular-nums;
}

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

/* The full line's width, from the thumbnail's start: indented past the thumbnail, the stepper,
   Update and Remove at 44px did not fit on one line on a phone (271px at 375) or in the 24rem
   side under touch, and Remove wrapped alone. */
.import-batch__line > .import-batch__line-actions {
    flex-basis: 100%;
}

.import-batch__line-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--sp-2) var(--sp-3);
    min-inline-size: 0;
}

.import-batch__qty {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
    margin: 0;
}

/* The Quantity label heads the row; the stepper and Update, then Remove at the row's end. */
.import-batch__line-actions > .import-batch__label {
    flex-basis: 100%;
}

.import-batch__remove {
    margin: 0;
    margin-inline-start: auto;
}

/* ── _ImportBatch, client variant (the card scanner's batch, mig-scan) ───── */

/* The lines, then the total and the page's own controls (Footer) under them. A page lays the two
   side by side where it has the room (areas/scan.css from 992px). */
.import-batch__client {
    display: grid;
    gap: var(--sp-4);
    min-inline-size: 0;
}

.import-batch__client-lines,
.import-batch__aside {
    min-inline-size: 0;
}

.import-batch__aside {
    display: grid;
    gap: var(--sp-3);
    align-content: start;
}

.import-batch__aside > .import-batch__footer {
    margin-block-start: 0;
}

/* A line's count and Split 1 Off, then its selects with Remove at the row's end. The selects and
   Remove wrap as one group, which takes the rest of the row or a row of its own; inside it the
   selects wrap among themselves and Remove stays beside the last of them, so Remove is never on a
   line alone (it was, under Split 1 Off, in the scanner's side column at 1280). */
.import-batch__line-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
    min-inline-size: 0;
    margin-block-start: var(--sp-2);
}

.import-batch__line-choices {
    display: flex;
    flex: 1 1 auto;
    align-items: flex-end;
    gap: var(--sp-2);
    min-inline-size: 0;
}

.import-batch__line-selects {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
    min-inline-size: 0;
}

.import-batch__line-remove {
    flex: none;
    margin-inline-start: auto;
}

/* The count: a box a few digits wide between its two buttons. */
.import-batch__count > .import-batch__count-input {
    flex: 0 0 4rem;
    inline-size: 4rem;
}

.import-batch__line-select {
    inline-size: auto;
    max-inline-size: 100%;
}

/* Why a line will not go in (a language the store cannot list): said in words, in the bad ink. */
.import-batch__line-note {
    margin: var(--sp-2) 0 0;
    color: var(--bad-ink);
    font-size: var(--fs-3);
}

/* Below 1200px the batch follows the results; past ScrollAbove lines they scroll in a box of
   their own so the destination and Finalize stay near. From 1200px the whole side scrolls
   (app-split sticky), and a box inside it would be a scroll inside a scroll. */
@media (max-width: 1199.98px) {
    .import-batch__lines-box--scroll {
        max-block-size: 70vh;
        overflow-y: auto;
        padding-inline-end: var(--sp-2);
    }

    .import-batch__lines-box--scroll:focus-visible {
        outline: var(--focus-ring);
        outline-offset: var(--focus-inset);
    }
}

.import-batch__note {
    margin: var(--sp-2) 0 0;
}

.import-batch__finalize {
    display: grid;
    gap: var(--sp-3);
    margin: var(--sp-4) 0 0;
}

.import-batch__total {
    display: grid;
    gap: var(--sp-0);
    padding: var(--sp-3);
    background: var(--surface-sunken);
    border: var(--edge-w) solid var(--ink);
}

.import-batch__total-label {
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

.import-batch__total-value {
    font-size: var(--fs-6);
    font-weight: 700;
}

.import-batch__total-value .app-money-currency {
    color: var(--ink-muted);
    font-size: var(--fs-2);
    font-weight: 400;
}

.import-batch__footer {
    margin-block-start: var(--sp-4);
    padding-block-start: var(--sp-4);
    border-block-start: var(--edge-w-hair) solid var(--rule-soft);
}

.import-batch__footer > h3 {
    margin-block-end: var(--sp-1);
}

.import-batch__footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.import-batch__footer-actions > form {
    margin: 0;
}

/* The summary strip above the results: tablets only (768 to 1199.98px), where the batch itself
   is below the results (UI plan, section 5). */
.import-batch-summary {
    display: none;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .import-batch-summary {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: var(--sp-3);
        margin-block-end: var(--sp-5);
        padding: var(--sp-3) var(--sp-4);
        background: var(--surface-sunken);
        border: var(--edge-w) solid var(--ink);
        box-shadow: var(--shadow-off-sm);
    }
}

.import-batch-summary__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--sp-2);
    margin: 0;
    font-variant-numeric: tabular-nums;
}

.import-batch-summary__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

/* ── _ImportDestination ──────────────────────────────────────────────────── */

.import-destination {
    display: grid;
    gap: var(--sp-3);
}

.import-destination__field {
    display: grid;
    gap: var(--sp-1);
}

.import-destination__field > .form-label {
    margin: 0;
}

.import-destination__fixed {
    display: grid;
    gap: var(--sp-0);
    margin: 0;
}

/* ── Inline data (unit inline-data) ───────────────────────────────────────────
   The small pieces that carry a value inside a sentence, a cell or a panel:
   <app-money>, <app-dl>, <app-copy-field> and <a app-external>. The tag helpers in
   TagHelpers/ draw the markup; docs/ui/components/inline-data.md says when to use
   each. <app-time>'s own rule is still the legacy one (06-utilities-buylist-scan.css),
   which the Shopify admin's views share. */

/* Bootstrap's .visually-hidden is position: absolute. With no positioned ancestor it
   escapes a scrolling table region and widens the page by its static position, so each
   component that writes hidden words holds them in place. */
.app-money,
.app-dl-item > dd,
.app-copy-field,
.app-copy-field-button,
.app-external,
.app-time-empty {
    position: relative;
}

/* ── app-money ──
   One unit that never breaks: the amount, a non-breaking space and the code. Tabular
   figures, so a column of amounts lines up on the decimal point. */
.app-money {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.app-money-label {
    font-weight: 600;
}

/* The sign says gain or loss; the colour repeats it. */
.app-money--gain {
    color: var(--ok-ink);
}

.app-money--loss {
    color: var(--bad-ink);
}

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

/* ── app-dl ──
   The wrapper is the container, so the list lays itself out by its own width:
   under 22rem (a phone) each value under its label, from 22rem label left and value right,
   and from 40rem two facts a row when columns="2". */
.app-dl {
    container: app-dl / inline-size;
}

.app-dl-list {
    margin: 0;
    display: grid;
    column-gap: var(--sp-5);
}

.app-dl-item {
    display: flex;
    flex-direction: column;
    gap: var(--sp-0);
    padding: var(--sp-1h) 0;
    border-bottom: var(--edge-w-hair) solid var(--rule-soft);
    min-inline-size: 0;
}

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

.app-dl-item > dt {
    font-weight: 500;
    color: var(--ink-muted);
    min-inline-size: 0;
    overflow-wrap: anywhere;
}

.app-dl-item > dd {
    margin: 0;
    min-inline-size: 0;
    overflow-wrap: anywhere;
}

@container app-dl (min-width: 22rem) {
    .app-dl:not(.app-dl--stacked) .app-dl-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
        gap: var(--sp-3);
    }

    .app-dl:not(.app-dl--stacked) .app-dl-item > dt {
        flex: 0 1 auto;
        max-inline-size: 50%;
    }

    .app-dl:not(.app-dl--stacked) .app-dl-item > dd {
        flex: 1 1 0;
        text-align: end;
    }
}

@container app-dl (min-width: 40rem) {
    .app-dl--cols-2 > .app-dl-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Two facts a row: the last row has no rule under it, whether it holds one or two. */
    .app-dl--cols-2 .app-dl-item:nth-last-child(2):nth-child(odd) {
        border-bottom: 0;
    }
}

/* ── app-copy-field ──
   The value whole, in a sunken monospace box that wraps anywhere, and its Copy button.
   The wrapper is the container: under 22rem (a phone) the value takes the full width and
   the button sits on its own line under it; from 22rem the button sits beside the value.
   The button keeps its own height either way, so a long value never stretches it.
   The button is hidden until copy-field.js shows it. */
.app-copy-field {
    container: app-copy-field / inline-size;
    display: grid;
    gap: var(--sp-1);
    max-inline-size: var(--measure-form);
}

.app-copy-field-label {
    font-weight: 600;
}

.app-copy-field-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: var(--sp-2);
    min-inline-size: 0;
}

/* A zero basis: a long value never pushes the button to a new line from 22rem. */
.app-copy-field-value {
    flex: 1 1 0;
    min-inline-size: 0;
    display: flex;
    align-items: center;
    min-block-size: var(--control-h);
    padding: var(--sp-1h) var(--sp-3);
    background: var(--surface-sunken);
    border: var(--edge-w) solid var(--ink);
    color: var(--ink);
    font-size: var(--fs-4);
    overflow-wrap: anywhere;
    /* A token breaks at the end of each line, not first at its punctuation: a request id
       broke after "00-" and left it alone on a phone's first line. */
    word-break: break-all;
    user-select: all;
}

.app-copy-field-button {
    flex: 0 0 auto;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-1h);
    min-block-size: var(--control-h);
}

@container app-copy-field (width < 22rem) {
    .app-copy-field-value {
        flex-basis: 100%;
    }
}

@media (max-width: 991.98px), (pointer: coarse) {
    .app-copy-field-value,
    .app-copy-field-button {
        min-block-size: max(var(--touch-min), var(--control-h));
    }

    .app-copy-field-button {
        min-inline-size: var(--touch-min);
    }
}

/* ── a[app-external] ──
   The outward arrow after the text, joined to the last word so it never wraps alone. */
.app-external-icon {
    margin-inline-start: .3em;
    font-size: .8em;
}

/* ── app-job-status and app-progress (unit job-status) ─────────────────────────
   One readout of a background job (TagHelpers/AppJobStatusTagHelper.cs) and its
   progress bar (TagHelpers/AppProgressTagHelper.cs). The guide is
   docs/ui/components/job-status.md and the samples are /Admin/StyleGuide/JobStatus.
   The readout is a stack: the status line (badge, message, Refresh Status), then
   the body (a progress bar, an app-dl of figures), then the job's own actions.
   Every size is in rem through the tokens, so it grows with the fluid root. */

.app-job-status {
    display: grid;
    gap: var(--sp-3);
    min-inline-size: 0;
}

/* The badge, then the message beside it while there is room; the message wraps
   under itself and drops under the badge on a narrow panel. */
.app-job-status-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--sp-2) var(--sp-3);
    min-inline-size: 0;
}

/* Its own width, so Refresh Status follows the sentence rather than the far edge
   of a wide panel; a long message wraps to its own line under the badge. */
.app-job-status-message {
    flex: 0 1 auto;
    min-inline-size: 0;
    max-inline-size: var(--measure);
    margin: 0;
    font-size: var(--fs-3);
    line-height: var(--lh-body);
    overflow-wrap: anywhere;
}

.app-job-status-when {
    color: var(--ink-muted);
}

/* Refresh Status: a page that does not poll says how to see the result. A text
   link, not a second button beside the job's own actions (audit AA12). Hidden
   while live-regions.js polls the page, which refreshes it already. */
.app-job-status-refresh {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    /* 24px at the least on a fine pointer too (WCAG 2.2, 2.5.8). */
    min-block-size: calc(var(--sp-3) * 2);
    font-size: var(--fs-3);
    font-weight: 700;
    color: var(--ink);
}

.is-live-polling .app-job-status-refresh {
    display: none;
}

.app-job-status-body {
    display: grid;
    gap: var(--sp-3);
    min-inline-size: 0;
}

/* The figures keep the progress bar's width, so a label stays next to its value
   however wide the readout is placed (audit AA7: 520px apart at 1920 before). */
.app-job-status-body > .app-dl {
    max-inline-size: var(--measure-form);
}

.app-job-status-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.app-job-status-actions > form {
    margin: 0;
}

/* The touch floor a button already has (legacy/10-admin-touch.css). */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .app-job-status-refresh {
        min-block-size: var(--touch-min);
    }
}

/* ── app-progress ──
   The figure is written above the bar ("12 of 40 (30%)"), so the fill is never
   the only signal. The track is ink-edged like the brand's controls; the fill is
   the brand yellow, which has no text on it. */
.app-progress {
    /* How full the bar is. The tag helper sets it on the track for a bar with a total. */
    --app-progress: 0%;
    display: grid;
    gap: var(--sp-1);
    min-inline-size: 0;
    max-inline-size: var(--measure-form);
}

.app-progress-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--sp-1) var(--sp-3);
    font-size: var(--fs-3);
}

.app-progress-label {
    font-weight: 700;
}

.app-progress-value {
    font-variant-numeric: tabular-nums;
}

.app-progress-track {
    position: relative;
    block-size: var(--sp-3);
    border: var(--edge-w) solid var(--ink);
    background: var(--surface-sunken);
    overflow: hidden;
}

.app-progress-fill {
    position: absolute;
    inset: 0 auto 0 0;
    inline-size: var(--app-progress);
    background: var(--brand-primary);
    border-inline-end: var(--edge-w) solid var(--ink);
}

/* No total yet: an ink-striped yellow bar that moves, so it reads as "working"
   without claiming a fraction. */
.app-progress--indeterminate .app-progress-fill {
    inline-size: 100%;
    border-inline-end: 0;
    background-image: repeating-linear-gradient(-45deg,
        transparent 0 var(--sp-2),
        rgba(var(--on-accent-rgb), .35) var(--sp-2) var(--sp-4));
    background-size: calc(var(--sp-4) * 1.4142) 100%;
    animation: app-progress-stripes 1s linear infinite;
}

@keyframes app-progress-stripes {
    to { background-position-x: calc(var(--sp-4) * 1.4142); }
}

@media (prefers-reduced-motion: reduce) {
    .app-progress--indeterminate .app-progress-fill {
        animation: none;
    }
}

/* In forced colours the fill keeps a system colour. */
@media (forced-colors: active) {
    .app-progress-fill {
        background: Highlight;
    }
}

/* ── Layout primitives: app-grid and app-split (layout-primitives) ──────────
   The two page layouts every migration builds on. The tag helpers are
   TagHelpers/AppGridTagHelper.cs and AppSplitTagHelper.cs, the guide is
   docs/ui/components/layout.md, and the samples are /Admin/StyleGuide/Layout.
   Breakpoints are the plan's (sm 576, md 768, lg 992, xl 1200, xxl 1400), each
   max-width .02px below the next one. */

/* ── app-grid ───────────────────────────────────────────────────────────────
   Cards or panels in rows, with a column count for each breakpoint and no
   orphans. It is a wrapping flex row, not a CSS grid: each item's basis is one
   column, and an item grows to fill what its row leaves, so a short last row
   is filled, never left with empty slots. When the last row of a grid of three
   or more columns would hold one item alone, the last two items take half the
   row each and the row above gives one up (7 at three columns is 3, 2, 2).
   Items keep their own height (top-aligned) unless the grid stretches them.

   The tag helper writes a class for every breakpoint (app-grid--md-3), and each
   block below holds only its own range, so no range's rule reaches the next. */
.app-grid {
    --app-grid-gap: var(--sp-5);
    /* The basis of the two items that share the last row. Set here, so it is
       worked out once with this grid's gap and the items inherit the result. */
    --app-grid-half: calc((100% - var(--app-grid-gap)) / 2 - 1px);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--app-grid-gap);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Rows of small cards inside a panel. */
.app-grid--compact {
    --app-grid-gap: var(--sp-3);
}

/* Every item in a row as tall as the tallest, for cards read side by side
   (plans to compare). */
.app-grid--stretch {
    align-items: stretch;
}

/* min-inline-size 0 lets a long word or a wide table shrink inside its item
   instead of widening the row past the page. */
.app-grid > * {
    flex: 1 1 100%;
    min-inline-size: 0;
    margin: 0;
}

@media (max-width: 575.98px) {
    .app-grid--xs-1 > * { flex-basis: 100%; }
    .app-grid--xs-2 > * { flex-basis: calc((100% - 1 * var(--app-grid-gap)) / 2 - 1px); }
    .app-grid--xs-3 > * { flex-basis: calc((100% - 2 * var(--app-grid-gap)) / 3 - 1px); }
    .app-grid--xs-4 > * { flex-basis: calc((100% - 3 * var(--app-grid-gap)) / 4 - 1px); }
    .app-grid--xs-5 > * { flex-basis: calc((100% - 4 * var(--app-grid-gap)) / 5 - 1px); }
    .app-grid--xs-6 > * { flex-basis: calc((100% - 5 * var(--app-grid-gap)) / 6 - 1px); }

    .app-grid--xs-3:has(> :last-child:nth-child(3n+4)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
    .app-grid--xs-4:has(> :last-child:nth-child(4n+5)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
    .app-grid--xs-5:has(> :last-child:nth-child(5n+6)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
    .app-grid--xs-6:has(> :last-child:nth-child(6n+7)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .app-grid--sm-1 > * { flex-basis: 100%; }
    .app-grid--sm-2 > * { flex-basis: calc((100% - 1 * var(--app-grid-gap)) / 2 - 1px); }
    .app-grid--sm-3 > * { flex-basis: calc((100% - 2 * var(--app-grid-gap)) / 3 - 1px); }
    .app-grid--sm-4 > * { flex-basis: calc((100% - 3 * var(--app-grid-gap)) / 4 - 1px); }
    .app-grid--sm-5 > * { flex-basis: calc((100% - 4 * var(--app-grid-gap)) / 5 - 1px); }
    .app-grid--sm-6 > * { flex-basis: calc((100% - 5 * var(--app-grid-gap)) / 6 - 1px); }

    .app-grid--sm-3:has(> :last-child:nth-child(3n+4)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
    .app-grid--sm-4:has(> :last-child:nth-child(4n+5)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
    .app-grid--sm-5:has(> :last-child:nth-child(5n+6)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
    .app-grid--sm-6:has(> :last-child:nth-child(6n+7)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .app-grid--md-1 > * { flex-basis: 100%; }
    .app-grid--md-2 > * { flex-basis: calc((100% - 1 * var(--app-grid-gap)) / 2 - 1px); }
    .app-grid--md-3 > * { flex-basis: calc((100% - 2 * var(--app-grid-gap)) / 3 - 1px); }
    .app-grid--md-4 > * { flex-basis: calc((100% - 3 * var(--app-grid-gap)) / 4 - 1px); }
    .app-grid--md-5 > * { flex-basis: calc((100% - 4 * var(--app-grid-gap)) / 5 - 1px); }
    .app-grid--md-6 > * { flex-basis: calc((100% - 5 * var(--app-grid-gap)) / 6 - 1px); }

    .app-grid--md-3:has(> :last-child:nth-child(3n+4)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
    .app-grid--md-4:has(> :last-child:nth-child(4n+5)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
    .app-grid--md-5:has(> :last-child:nth-child(5n+6)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
    .app-grid--md-6:has(> :last-child:nth-child(6n+7)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .app-grid--lg-1 > * { flex-basis: 100%; }
    .app-grid--lg-2 > * { flex-basis: calc((100% - 1 * var(--app-grid-gap)) / 2 - 1px); }
    .app-grid--lg-3 > * { flex-basis: calc((100% - 2 * var(--app-grid-gap)) / 3 - 1px); }
    .app-grid--lg-4 > * { flex-basis: calc((100% - 3 * var(--app-grid-gap)) / 4 - 1px); }
    .app-grid--lg-5 > * { flex-basis: calc((100% - 4 * var(--app-grid-gap)) / 5 - 1px); }
    .app-grid--lg-6 > * { flex-basis: calc((100% - 5 * var(--app-grid-gap)) / 6 - 1px); }

    .app-grid--lg-3:has(> :last-child:nth-child(3n+4)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
    .app-grid--lg-4:has(> :last-child:nth-child(4n+5)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
    .app-grid--lg-5:has(> :last-child:nth-child(5n+6)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
    .app-grid--lg-6:has(> :last-child:nth-child(6n+7)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
    .app-grid--xl-1 > * { flex-basis: 100%; }
    .app-grid--xl-2 > * { flex-basis: calc((100% - 1 * var(--app-grid-gap)) / 2 - 1px); }
    .app-grid--xl-3 > * { flex-basis: calc((100% - 2 * var(--app-grid-gap)) / 3 - 1px); }
    .app-grid--xl-4 > * { flex-basis: calc((100% - 3 * var(--app-grid-gap)) / 4 - 1px); }
    .app-grid--xl-5 > * { flex-basis: calc((100% - 4 * var(--app-grid-gap)) / 5 - 1px); }
    .app-grid--xl-6 > * { flex-basis: calc((100% - 5 * var(--app-grid-gap)) / 6 - 1px); }

    .app-grid--xl-3:has(> :last-child:nth-child(3n+4)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
    .app-grid--xl-4:has(> :last-child:nth-child(4n+5)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
    .app-grid--xl-5:has(> :last-child:nth-child(5n+6)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
    .app-grid--xl-6:has(> :last-child:nth-child(6n+7)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
}

@media (min-width: 1400px) {
    .app-grid--xxl-1 > * { flex-basis: 100%; }
    .app-grid--xxl-2 > * { flex-basis: calc((100% - 1 * var(--app-grid-gap)) / 2 - 1px); }
    .app-grid--xxl-3 > * { flex-basis: calc((100% - 2 * var(--app-grid-gap)) / 3 - 1px); }
    .app-grid--xxl-4 > * { flex-basis: calc((100% - 3 * var(--app-grid-gap)) / 4 - 1px); }
    .app-grid--xxl-5 > * { flex-basis: calc((100% - 4 * var(--app-grid-gap)) / 5 - 1px); }
    .app-grid--xxl-6 > * { flex-basis: calc((100% - 5 * var(--app-grid-gap)) / 6 - 1px); }

    .app-grid--xxl-3:has(> :last-child:nth-child(3n+4)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
    .app-grid--xxl-4:has(> :last-child:nth-child(4n+5)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
    .app-grid--xxl-5:has(> :last-child:nth-child(5n+6)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
    .app-grid--xxl-6:has(> :last-child:nth-child(6n+7)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
}

/* ── app-grid by width (min="card|row|panel") ────────────────────────────────
   A grid that adds columns as it gets wider, up to 1920 to 3840 screens. Each
   item is at least the token's width (--card-min, --row-min, --panel-min) and
   the grid has as many equal columns as fit, from one to six. The grid is an
   inline-size container, so the count follows the grid's own width (inside a
   split's main column too), and the same no-orphans rules hold: each block
   below holds only the widths at which that many columns fit.

   The thresholds are k * min + (k - 1) * --sp-5 in rem: a container query
   cannot read a custom property, so the token values are written out here and
   AppLayoutTagHelpersTests checks them against the tokens. A compact gap is
   smaller, so its items are a little wider than the minimum, never narrower.
   Without container queries, each item's basis is the minimum and the row
   wraps as a plain flex row would. */
.app-grid--min-card { --app-grid-min: var(--card-min); }
.app-grid--min-row { --app-grid-min: var(--row-min); }
.app-grid--min-panel { --app-grid-min: var(--panel-min); }

.app-grid--min-card,
.app-grid--min-row,
.app-grid--min-panel {
    container: app-grid / inline-size;
}

.app-grid--min-card > *,
.app-grid--min-row > *,
.app-grid--min-panel > * {
    flex-basis: min(var(--app-grid-min), 100%);
}


@container app-grid (33.25rem <= width < 50.5rem) {
    .app-grid--min-card > * { flex-basis: calc((100% - 1 * var(--app-grid-gap)) / 2 - 1px); }
}

@container app-grid (50.5rem <= width < 67.75rem) {
    .app-grid--min-card > * { flex-basis: calc((100% - 2 * var(--app-grid-gap)) / 3 - 1px); }
    .app-grid--min-card:has(> :last-child:nth-child(3n+4)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
}

@container app-grid (67.75rem <= width < 85rem) {
    .app-grid--min-card > * { flex-basis: calc((100% - 3 * var(--app-grid-gap)) / 4 - 1px); }
    .app-grid--min-card:has(> :last-child:nth-child(4n+5)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
}

@container app-grid (85rem <= width < 102.25rem) {
    .app-grid--min-card > * { flex-basis: calc((100% - 4 * var(--app-grid-gap)) / 5 - 1px); }
    .app-grid--min-card:has(> :last-child:nth-child(5n+6)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
}

@container app-grid (width >= 102.25rem) {
    .app-grid--min-card > * { flex-basis: calc((100% - 5 * var(--app-grid-gap)) / 6 - 1px); }
    .app-grid--min-card:has(> :last-child:nth-child(6n+7)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
}

@container app-grid (49.25rem <= width < 74.5rem) {
    .app-grid--min-row > * { flex-basis: calc((100% - 1 * var(--app-grid-gap)) / 2 - 1px); }
}

@container app-grid (74.5rem <= width < 99.75rem) {
    .app-grid--min-row > * { flex-basis: calc((100% - 2 * var(--app-grid-gap)) / 3 - 1px); }
    .app-grid--min-row:has(> :last-child:nth-child(3n+4)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
}

@container app-grid (99.75rem <= width < 125rem) {
    .app-grid--min-row > * { flex-basis: calc((100% - 3 * var(--app-grid-gap)) / 4 - 1px); }
    .app-grid--min-row:has(> :last-child:nth-child(4n+5)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
}

@container app-grid (125rem <= width < 150.25rem) {
    .app-grid--min-row > * { flex-basis: calc((100% - 4 * var(--app-grid-gap)) / 5 - 1px); }
    .app-grid--min-row:has(> :last-child:nth-child(5n+6)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
}

@container app-grid (width >= 150.25rem) {
    .app-grid--min-row > * { flex-basis: calc((100% - 5 * var(--app-grid-gap)) / 6 - 1px); }
    .app-grid--min-row:has(> :last-child:nth-child(6n+7)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
}

/* At two columns a panel left alone on the last row (the ninth game) keeps one column's width
   instead of growing across the row: a panel's table or form spread over the whole width at
   1280, its figures 800px from their labels. It keeps its place at the start; a grid of one
   panel still takes the row. */
@container app-grid (69.25rem <= width < 104.5rem) {
    .app-grid--min-panel > * { flex-basis: calc((100% - 1 * var(--app-grid-gap)) / 2 - 1px); }
    .app-grid--min-panel > :last-child:nth-child(2n+3) { flex-grow: 0; }
}

@container app-grid (104.5rem <= width < 139.75rem) {
    .app-grid--min-panel > * { flex-basis: calc((100% - 2 * var(--app-grid-gap)) / 3 - 1px); }
    .app-grid--min-panel:has(> :last-child:nth-child(3n+4)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
}

@container app-grid (139.75rem <= width < 175rem) {
    .app-grid--min-panel > * { flex-basis: calc((100% - 3 * var(--app-grid-gap)) / 4 - 1px); }
    .app-grid--min-panel:has(> :last-child:nth-child(4n+5)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
}

@container app-grid (175rem <= width < 210.25rem) {
    .app-grid--min-panel > * { flex-basis: calc((100% - 4 * var(--app-grid-gap)) / 5 - 1px); }
    .app-grid--min-panel:has(> :last-child:nth-child(5n+6)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
}

@container app-grid (width >= 210.25rem) {
    .app-grid--min-panel > * { flex-basis: calc((100% - 5 * var(--app-grid-gap)) / 6 - 1px); }
    .app-grid--min-panel:has(> :last-child:nth-child(6n+7)) > :nth-last-child(-n+2) { flex-basis: var(--app-grid-half); }
}

/* ── app-split ──────────────────────────────────────────────────────────────
   A main column and a side column. Stacked below its break, one column with
   the main first (or the side, with stack="side-first"): the tag helper writes
   the two in that order, so the stacked order is the source and tab order.
   From the break, the side sits at its fixed width at the end (or the start)
   and the main takes the rest. The main track is minmax(0, ...) so a wide
   table scrolls inside it rather than pushing the side off the page. */
.app-split {
    --app-split-main: minmax(0, 1fr);
    --app-split-side: var(--side-w);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-5);
    align-items: start;
}

/* A contents list beside prose. */
.app-split--toc {
    --app-split-side: var(--toc-w);
}

/* A third of the row, never narrower than the side width (a batch beside
   search results). */
.app-split--third {
    --app-split-main: minmax(0, 2fr);
    --app-split-side: minmax(var(--side-w), 1fr);
}

.app-split > .app-split-main,
.app-split > .app-split-side {
    min-inline-size: 0;
}

@media (min-width: 768px) {
    .app-split--md {
        grid-template-columns: var(--app-split-main) var(--app-split-side);
        grid-template-areas: "main side";
    }

    .app-split--md.app-split--start {
        grid-template-columns: var(--app-split-side) var(--app-split-main);
        grid-template-areas: "side main";
    }

    .app-split--md > .app-split-main { grid-area: main; }
    .app-split--md > .app-split-side { grid-area: side; }
}

@media (min-width: 992px) {
    .app-split--lg {
        grid-template-columns: var(--app-split-main) var(--app-split-side);
        grid-template-areas: "main side";
    }

    .app-split--lg.app-split--start {
        grid-template-columns: var(--app-split-side) var(--app-split-main);
        grid-template-areas: "side main";
    }

    .app-split--lg > .app-split-main { grid-area: main; }
    .app-split--lg > .app-split-side { grid-area: side; }
}

@media (min-width: 1200px) {
    .app-split--xl {
        grid-template-columns: var(--app-split-main) var(--app-split-side);
        grid-template-areas: "main side";
    }

    .app-split--xl.app-split--start {
        grid-template-columns: var(--app-split-side) var(--app-split-main);
        grid-template-areas: "side main";
    }

    .app-split--xl > .app-split-main { grid-area: main; }
    .app-split--xl > .app-split-side { grid-area: side; }
}

@media (min-width: 1400px) {
    .app-split--xxl {
        grid-template-columns: var(--app-split-main) var(--app-split-side);
        grid-template-areas: "main side";
    }

    .app-split--xxl.app-split--start {
        grid-template-columns: var(--app-split-side) var(--app-split-main);
        grid-template-areas: "side main";
    }

    .app-split--xxl > .app-split-main { grid-area: main; }
    .app-split--xxl > .app-split-side { grid-area: side; }
}

/* ── Sticky side, only on a screen tall enough ──────────────────────────────
   A sticky side stays in view while the main scrolls, but only once the split
   is side by side and the screen is at least 600px tall: on a shorter screen a
   pinned column would leave too little room to read it. It is capped at the
   screen less the gap above and below, and scrolls inside itself, so the end
   of a long side list can always be reached, even at 1280x720 and 1024x768.
   Scrolling is not contained: once the side reaches its end, the wheel or
   trackpad goes on to scroll the page, so a pointer resting over the side
   never stops the page.
   The padding, taken back by the negative margin, keeps the panels' offset
   shadow and a focused control's ring inside the scrolling box, where they
   would otherwise be cut off. */
@media (min-width: 768px) and (min-height: 600px) {
    .app-split--md.app-split--sticky > .app-split-side {
        position: sticky;
        top: var(--sticky-top);
        max-block-size: calc(100vh - 2 * var(--sticky-top));
        max-block-size: calc(100dvh - 2 * var(--sticky-top));
        overflow-y: auto;
        padding: var(--sp-2);
        margin: calc(-1 * var(--sp-2));
    }
}

@media (min-width: 992px) and (min-height: 600px) {
    .app-split--lg.app-split--sticky > .app-split-side {
        position: sticky;
        top: var(--sticky-top);
        max-block-size: calc(100vh - 2 * var(--sticky-top));
        max-block-size: calc(100dvh - 2 * var(--sticky-top));
        overflow-y: auto;
        padding: var(--sp-2);
        margin: calc(-1 * var(--sp-2));
    }
}

@media (min-width: 1200px) and (min-height: 600px) {
    .app-split--xl.app-split--sticky > .app-split-side {
        position: sticky;
        top: var(--sticky-top);
        max-block-size: calc(100vh - 2 * var(--sticky-top));
        max-block-size: calc(100dvh - 2 * var(--sticky-top));
        overflow-y: auto;
        padding: var(--sp-2);
        margin: calc(-1 * var(--sp-2));
    }
}

@media (min-width: 1400px) and (min-height: 600px) {
    .app-split--xxl.app-split--sticky > .app-split-side {
        position: sticky;
        top: var(--sticky-top);
        max-block-size: calc(100vh - 2 * var(--sticky-top));
        max-block-size: calc(100dvh - 2 * var(--sticky-top));
        overflow-y: auto;
        padding: var(--sp-2);
        margin: calc(-1 * var(--sp-2));
    }
}

/* ── List rows (unit list-rows) ──────────────────────────────────────────────
   <app-link-list>, <app-link-row> and <app-list-row> (TagHelpers/AppLinkRowTagHelper.cs),
   _Checklist and the wish row (_WishRow). The guide is docs/ui/components/list-rows.md and
   the samples are /Admin/StyleGuide/ListRows. Breakpoints are the plan's, each max-width
   .02px below the next. The touch test is the legacy touch layer's: below 992px, or any
   screen without a fine pointer that hovers. */

/* ── The list ───────────────────────────────────────────────────────────────
   One row under another; from 1200px a grid layout adds columns as many as the list's own
   width holds (auto-fill), so a list in a narrow panel stays one column. A column is at least
   --row-min and at least --list-col-floor (below). cap holds simple rows to twice --row-min, so
   a name and its numbers are never a screen apart (audit LS-ME8).

   --list-col-floor is a px floor on purpose. A rem minimum scales with the fluid root (16px at
   1920, 20px at 3840), and so does the shell, so a rem minimum alone gives 1920 and 3840 the
   same column count. How the floor works depends on the shell's width tier (app-shell):
   - Wide tier (120rem): 640px gives 2 columns at 1920; at 3840 the rem minimum takes over and
     the shell holds 3.
   - Default tier (90rem): from 1920 the floor is 544px and the rem term is capped at its 1920
     size (the rule below the wish list), giving 2 columns at 1920 and 3 at 3840.
   Text zoom still widens columns through the rem term. */
.link-list--grid,
.wish-list {
    --list-col-floor: 640px;
}

.link-list {
    display: grid;
    gap: var(--sp-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.link-list--cap {
    max-inline-size: calc(2 * var(--row-min));
}

@media (min-width: 1200px) {
    .link-list--grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, max(var(--row-min), var(--list-col-floor))), 1fr));
        align-items: stretch;
    }

    /* The rows in a grid line are as tall as the tallest, so their contents start at the top:
       centred, a title over one line of copy sat 13px below its neighbour's over two. */
    .link-list--grid .app-row {
        align-items: start;
    }
}

.link-list-item {
    display: grid;
    min-inline-size: 0;
}

/* ── The row ────────────────────────────────────────────────────────────────
   icon | title, copy and chips | numbers [| action]. The title and the copy wrap to two
   lines each, then end in an ellipsis (audit CT20, DK20); the chips have their own line and
   wrap (CT1, CT2). On a phone the numbers and the action move under the title.
   There is no row gap and no column gap: the numbers and the action carry their own margin, so
   a row without numbers, or without an action, draws no empty track and no spare gap, and every
   row's padding is the same. */
.app-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "icon body stats";
    align-items: center;
    gap: 0;
    min-block-size: var(--touch-min);
    padding: var(--sp-2h) var(--sp-3);
    border: var(--edge-w) solid var(--ink);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--ink);
    text-decoration: none;
}

.app-row--no-icon {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "body stats";
}

.app-row--list {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "icon body stats action";
}

.app-row--list.app-row--no-icon {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "body stats action";
}

/* One hover for every row that is a link: the lift and the large offset block, as on a card
   tile. The ink ring sits outside the border, inside the list's gap. */
.app-row--link:hover,
.app-row--link:focus-visible {
    color: var(--ink);
    transform: var(--hover-lift);
    box-shadow: var(--shadow-lg);
}

.app-row--link:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

.app-row--link:active {
    transform: none;
    box-shadow: none;
}

.app-row-icon {
    grid-area: icon;
    margin-inline-end: var(--sp-3);
    font-size: var(--fs-6);
    line-height: 1;
    color: var(--ink-muted);
}

.app-row-body {
    grid-area: body;
    display: grid;
    gap: var(--sp-1);
    min-inline-size: 0;
}

.app-row-title,
.app-row-copy {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.app-row-title {
    font-weight: 700;
    line-height: var(--lh-tight);
}

.app-row--link .app-row-title {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .15em;
}

.app-row-copy {
    font-size: var(--fs-3);
    color: var(--ink-muted);
}

/* full-copy (<app-list-row> and <app-link-row>): the copy wraps in full, for a list whose copy
   is the only explanation of the row (Sales Channels; the Docs index). full-title: the title
   wraps in full, for a title read whole to tell rows apart (a linked login's email). Each lifts
   only its own clamp. */
.app-row--full-title .app-row-title,
.app-row--full-copy .app-row-copy {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: none;
    overflow: visible;
}

.app-row-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1);
    min-inline-size: 0;
}

/* The numbers, one line each, right-aligned and in tabular figures, set off from the text by
   a soft rule. */
.app-row-stats {
    grid-area: stats;
    display: grid;
    justify-items: end;
    gap: var(--sp-0);
    margin-inline-start: var(--sp-3);
    padding-inline-start: var(--sp-3);
    border-inline-start: var(--edge-w-hair) solid var(--rule-soft);
    font-size: var(--fs-3);
    font-variant-numeric: tabular-nums;
    text-align: end;
}

/* The row's own action area. Scoped to the row: <app-row-actions> names its buttons
   .app-row-action too (row-actions.css, which scopes its rules the same way), and this rule's
   margins and wrapping reached them in a table cell, which put a row's button 4px under its
   kebab on a phone. */
:where(.app-row) > .app-row-action {
    grid-area: action;
    margin-inline-start: var(--sp-3);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
}

@media (max-width: 575.98px) {
    .app-row,
    .app-row--list {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "icon body"
            ". stats"
            ". action";
        align-items: start;
    }

    .app-row--no-icon,
    .app-row--list.app-row--no-icon {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "body"
            "stats"
            "action";
    }

    .app-row-stats,
    :where(.app-row) > .app-row-action {
        margin-inline-start: 0;
        margin-block-start: var(--sp-2);
    }

    .app-row-stats {
        justify-items: start;
        padding-inline-start: 0;
        padding-block-start: var(--sp-1);
        border-inline-start: 0;
        border-block-start: var(--edge-w-hair) solid var(--rule-soft);
        text-align: start;
    }
}

@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    :where(.app-row) > .app-row-action :is(a, button) {
        min-block-size: var(--touch-min);
        display: inline-flex;
        align-items: center;
    }
}

/* ── _Checklist ─────────────────────────────────────────────────────────────
   mark | title and copy | action. The next step's button is the only primary one; a later
   step's is an outline with "After Step N" beside it; a done step keeps full ink, with a check
   and the word Done, never a fade (audit SA11, SA12). The copy is --fs-3 in --ink-muted, which
   clears 4.5:1 on the surface in both themes. The list is capped like link-list--cap, so on a
   wide screen a step's button stays beside its title. */
.app-checklist {
    display: grid;
    max-inline-size: calc(2 * var(--row-min));
    gap: var(--sp-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.app-checklist-step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: var(--sp-3);
}

.app-checklist-mark {
    display: inline-grid;
    place-items: center;
    inline-size: var(--sp-6);
    block-size: var(--sp-6);
    border: var(--edge-w) solid var(--ink);
    border-radius: var(--radius);
    background: var(--surface);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.app-checklist-step--next .app-checklist-mark {
    background: var(--brand-primary);
    color: var(--on-brand);
}

.app-checklist-step--done .app-checklist-mark {
    border-color: var(--ok-ink);
    color: var(--ok-ink);
    font-size: var(--fs-5);
}

.app-checklist-body {
    display: grid;
    gap: var(--sp-1);
    min-inline-size: 0;
    overflow-wrap: anywhere;
}

.app-checklist-title {
    font-weight: 700;
}

.app-checklist-copy {
    font-size: var(--fs-3);
    color: var(--ink-muted);
}

.app-checklist-action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: end;
    gap: var(--sp-1) var(--sp-2);
}

.app-checklist-after {
    font-size: var(--fs-3);
    color: var(--ink-muted);
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .app-checklist-step {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .app-checklist-action {
        grid-column: 2;
        justify-content: start;
    }
}

@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .app-checklist-action .btn {
        min-block-size: var(--touch-min);
        display: inline-flex;
        align-items: center;
    }
}

/* ── The wish row (_WishRow) ────────────────────────────────────────────────
   _WishRow keeps its own class names, which pages, scripts and tests key off, so these rules
   follow the legacy ones in 09-lists-trades-decks.css and supersede the parts listed in
   docs/ui/dead-css/list-rows.md. The art is the shared _CardThumb, whose box sets the first
   column (the legacy 3.5rem and 3rem tracks were the old image's). */
.wish-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

/* From 1200px a list of wish rows becomes a grid of columns of at least --panel-min, as many as
   fit: the wishlist and a collector's wishlist fill a wide screen instead of running down one
   edge, and a list in a half-width panel stays one column. A deck's lines are left to the
   deck builder (mig-deck-builder, LS-ME8). */
@media (min-width: 1200px) {
    .wish-list:not(:has(> .deck-line)) {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, max(var(--panel-min), var(--list-col-floor))), 1fr));
        align-items: stretch;
    }

    /* Rows side by side are one height, with the card at the top and an Edit fold at the
       bottom, so the bottoms of a grid line meet (a row with a longer set name was 15px taller
       than its neighbours). One column, as in a narrow panel, changes nothing. */
    .wish-list:not(:has(> .deck-line)) > .wish-row {
        align-content: space-between;
    }
}

/* A default-tier page from 1920 (app-shell). Its column is 90rem, which grows with the root just
   as --row-min and --panel-min do, so the rules above give it 2 columns at 1920 and still 2 at
   3840. Here a column stays at its 1920 size, so the larger screen adds a column: 2 at 1920, 3
   from about 3440 (measured 2 and 3 at 1920 and 3840 on /Admin/StyleGuide/ListRows and
   /Portfolio/Wishlist).
   - --list-col-floor becomes 544px, --panel-min (34rem) at the 1920 root of 16px.
   - Each list keeps its own rem term, scaled by 16/20, the 1920 root over the 3840 root, so it
     is no larger at 3840 than at 1920 and only text zoom makes it larger: --row-min (24rem, so
     384px at 3840, under the floor) for a link list, --panel-min (34rem, 544px at 3840) for a
     wish list.
   A wide-tier page keeps the rules above for a wish list, which give it 2 at 1920 and 3 at 3840.
   A wide-tier link list's floor is 576px from 1920 (final pass, leftovers): its 1872px column
   holds 3 rows of 576px, so Collections and Decks at 1920 are no longer two columns with the
   third row alone under them, and a row is still about 600px, never a screen apart. Below 1920
   the 640px floor stays, so a 1280 to 1919 screen keeps its columns. */
@media (min-width: 1920px) {
    .app-shell--wide .link-list--grid {
        --list-col-floor: 576px;
    }

    .app-shell:not(.app-shell--wide) :is(.link-list--grid, .wish-list) {
        --list-col-floor: 544px;
    }

    .app-shell:not(.app-shell--wide) .link-list--grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, max(var(--list-col-floor), calc(var(--row-min) * 16 / 20))), 1fr));
    }

    .app-shell:not(.app-shell--wide) .wish-list:not(:has(> .deck-line)) {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, max(var(--list-col-floor), calc(var(--panel-min) * 16 / 20))), 1fr));
    }
}

.wish-row-sep {
    display: none;
}

/* A collector number never breaks across lines, and a dot never starts one: the separator is
   a no-break space, the dot and a space (_WishRow), so a line breaks only after it. */
.wish-row-meta-number,
.wish-row-meta-sep {
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .wish-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    /* The meta wraps as plain text (audit CT13): game, set and number all stay readable, and
       the set takes a second line when it must. Nothing is cut, and the number keeps itself
       whole (.wish-row-meta-number, above), because a different number is a different card. */
    .wish-row-meta {
        overflow-wrap: anywhere;
    }

    /* The count, the value and the price of each, dots between (audit CT13). Each dot is a box
       of --sp-4 before its part. The line is pulled --sp-4 to the left and that strip is
       clipped, so a part that wraps to a new line hides its dot, and the count is pushed back
       to the edge. */
    .wish-row-value:not(.offer-pick) {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0;
        margin-inline-start: calc(-1 * var(--sp-4));
        clip-path: inset(0 0 0 var(--sp-4));
    }

    .wish-row-value:not(.offer-pick) > strong {
        margin-inline-start: var(--sp-4);
    }

    .wish-row-part {
        white-space: nowrap;
    }

    .wish-row-value:not(.offer-pick) .wish-row-sep {
        display: inline-block;
        inline-size: var(--sp-4);
        text-align: center;
        color: var(--ink-muted);
    }
}

/* A card's name is a link set on its own, about 24px tall. A 44px box would push the row's
   lines apart, so every wish row's name gets an invisible hit area, as a deck line's already
   did (the wish-row low, LS-ME11). */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .wish-row-name {
        position: relative;
    }

    .wish-row-name::after {
        content: "";
        position: absolute;
        inset: -10px -4px;
    }
}

/* ── Top bar (Pages/Shared/_AppHeader.cshtml) ─────────────────────────────────────
   One row from 992px through 4K (UI plan section 4; docs/ui/components/app-header.md):
     - from 1200: the brand, Catalogue, Portfolio, Scan, Quick Import and Trade, then Store,
       Admin and the account menu pushed right;
     - 992 to 1199.98: the brand's mark alone, Catalogue, Portfolio, Scan, then Store, Admin and
       Menu pushed right;
     - below 992: the owner's phone row, kept as it was: the brand, then Catalogue, Portfolio,
       Scan and Menu on one row (Menu its icon alone below 576).
   The bar is at most 4rem tall from 992, with 44px targets under a coarse pointer.
   The current page is its link's aria-current; a menu toggle whose section is open carries
   .app-header-link--current, and the Menu button .app-header-menu--current (or
   .app-header-menu--current-below-lg, for Store and Admin pages, lit only below 992). All are
   the brand fill with an ink bar along the bottom edge, as the segmented control does, so the state is a shape as well as a colour (audit SH1, CC1, AY1;
   WCAG 1.4.1). These rules replace the .app-navbar and .navbar-* rules of legacy/02 and /05,
   which no markup uses any more (docs/ui/dead-css/app-header.md). */

.app-header {
    background: var(--surface);
    border: var(--edge-w-strong) solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow-off) var(--shadow-off) 0 var(--shadow);
}

.app-header-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    padding: var(--sp-4) var(--sp-5);
}

/* The Menu sheet (below 1200, _NavSheet) opens under the bar, inside the same box, and pushes the
   page down. Its rules are at the end of this file, with the dropdowns'. */
.app-header-sheet {
    padding: 0 var(--sp-5) var(--sp-4);
}

/* ── Brand ── */
.app-header-brand {
    display: inline-flex;
    align-items: center;
    flex: none;
    color: var(--on-accent);
    text-decoration: none;
}

/* The brand is a block, not tinted text: a gold rectangle with its own ink edge. */
.app-header-wordmark {
    display: inline-block;
    padding: var(--sp-0) var(--sp-2);
    font-family: var(--font-display);
    font-size: var(--fs-5);
    font-weight: 900;
    letter-spacing: -.01em;
    color: var(--on-accent);
    background: var(--brand-primary);
    border: var(--edge-w) solid var(--ink);
    box-shadow: var(--shadow-off-sm) var(--shadow-off-sm) 0 var(--shadow);
}

/* The app icon, shown alone from 992 to 1199.98. */
.app-header-mark {
    display: none;
    inline-size: 2.25rem;
    block-size: 2.25rem;
    border: var(--edge-w) solid var(--ink);
    box-shadow: var(--shadow-off-sm) var(--shadow-off-sm) 0 var(--shadow);
}

.app-header-brand:hover .app-header-wordmark {
    background: var(--brand-secondary);
}

.app-header-brand:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

/* ── Links and menus ── */
.app-header-menus {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-inline-size: 0;
}

.app-header-links {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.app-header-links > li {
    display: flex;
}

.app-header-end {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.app-header-link {
    white-space: nowrap;
}

.app-header-icon {
    margin-right: var(--sp-1h);
    font-size: .95em;
    vertical-align: -.08em;
}

/* The current page, and the toggle of the menu whose section is open. The --bs-btn-* set is
   Bootstrap's, so hover and press keep working on the yellow. */
.app-header-link[aria-current],
.app-header-link--current,
.app-header-menu--current {
    --bs-btn-color: var(--on-brand);
    --bs-btn-bg: var(--brand-primary);
    --bs-btn-border-color: var(--ink);
    --bs-btn-hover-color: var(--on-brand);
    --bs-btn-hover-bg: var(--brand-secondary);
    --bs-btn-hover-border-color: var(--ink);
    --bs-btn-active-color: var(--on-brand);
    --bs-btn-active-bg: var(--brand-primary);
    --bs-btn-active-border-color: var(--ink);
    box-shadow: inset 0 calc(-1 * var(--edge-w-strong)) 0 var(--on-brand), var(--shadow-off-sm) var(--shadow-off-sm) 0 var(--shadow);
}

/* The focus ring is not recoloured here: it is drawn outside the button (--focus-offset), on the
   bar's surface, so it keeps the theme's --ink like every other item in the bar. The yellow's own
   ink (--on-brand) is dark in both themes and would vanish on the dark surface. */

/* Below 992 the Store and Admin menus are in the sheet, so a Store or Admin page lights Menu.
   From 992 their own toggles are in the bar and are lit instead. */
@media (max-width: 991.98px) {
    .app-header-menu--current-below-lg {
        --bs-btn-color: var(--on-brand);
        --bs-btn-bg: var(--brand-primary);
        --bs-btn-border-color: var(--ink);
        --bs-btn-hover-color: var(--on-brand);
        --bs-btn-hover-bg: var(--brand-secondary);
        --bs-btn-hover-border-color: var(--ink);
        --bs-btn-active-color: var(--on-brand);
        --bs-btn-active-bg: var(--brand-primary);
        --bs-btn-active-border-color: var(--ink);
        box-shadow: inset 0 calc(-1 * var(--edge-w-strong)) 0 var(--on-brand), var(--shadow-off-sm) var(--shadow-off-sm) 0 var(--shadow);
    }
}

.app-header-user {
    max-inline-size: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The Menu button's glyphs, drawn inline: the menu mark while the sheet is shut, a close mark
   while it is open (audit SH33). */
.app-header-glyph {
    flex: none;
    inline-size: 1em;
    block-size: 1em;
    margin-right: var(--sp-1h);
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: square;
}

.app-header-glyph--close,
.app-header-menu[aria-expanded="true"] .app-header-glyph--open {
    display: none;
}

.app-header-menu[aria-expanded="true"] .app-header-glyph--close {
    display: inline;
}

/* ── Which item shows at which width ── */
.app-header-links > .app-header-from-md,
.app-header-links > .app-header-from-xl,
.app-header-end > .app-header-from-lg,
.app-header-end > .app-header-from-xl {
    display: none;
}

/* Signed out, Sign In is the bar's one yellow button (btn-primary), so the current page's link is
   not yellow as well: it is the ink fill, with the brand bar along its bottom edge, so "you are
   here" and the main action never look alike (final pass, public). Ink on the surface and the
   surface on ink are the theme's own pair, so it holds in both themes. */
.app-header--public .app-header-link[aria-current] {
    --bs-btn-color: var(--surface);
    --bs-btn-bg: var(--ink);
    --bs-btn-border-color: var(--ink);
    --bs-btn-hover-color: var(--surface);
    --bs-btn-hover-bg: var(--ink);
    --bs-btn-hover-border-color: var(--ink);
    --bs-btn-active-color: var(--surface);
    --bs-btn-active-bg: var(--ink);
    --bs-btn-active-border-color: var(--ink);
    box-shadow: inset 0 calc(-1 * var(--edge-w-strong)) 0 var(--brand-primary), var(--shadow-off-sm) var(--shadow-off-sm) 0 var(--shadow);
}

/* ── Touch: 44px wherever the pointer is coarse or the screen is under 992 (the touch layer's
   own query). The brand is a bordered badge, so the badge keeps its size and the link around
   it grows to 44 by 44, the badge (or the mark alone, 992 to 1199.98) centred in it. ── */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .app-header-link {
        min-block-size: var(--touch-min);
    }

    .app-header-brand {
        justify-content: center;
        min-block-size: var(--touch-min);
        min-inline-size: var(--touch-min);
    }

    /* The signed-out theme button is its icon alone: as wide as it is tall. The element and two
       classes, to outrank `.app-shell .btn { min-width: 0 }` in legacy/06. */
    .app-header-end > .btn.app-header-theme {
        min-inline-size: var(--touch-min);
        justify-content: center;
    }
}

/* ── Phone (below 576): the owner's one row ──
   Catalogue, Portfolio, Scan and Menu share ONE row (owner, 2026-11-13). The Menu button is
   its glyph alone: the word is hidden from sight, not from screen readers, so it is still the
   button's name, and the count of trade offers waiting sits on the glyph's corner, out of the
   row. Below 420px the other icons go, since the words are what a reader looks for; below
   375px the padding tightens so the words still fit unsqueezed. Measured at 320 to 768px. */
@media (max-width: 575.98px) {
    /* The brand has a row of its own here, and its 44px link (the touch rule above) would add the
       badge's spare height to the bar. So the badge sits at the top of its link and the rows close
       up: the link's spare height under the badge is the gap above the links, which stays about the
       --sp-4 it was, and the bar is no taller. */
    .app-header-bar {
        align-items: flex-start;
        row-gap: 0;
    }

    .app-header-brand {
        align-items: flex-start;
    }

    .app-header-wordmark {
        font-size: var(--fs-4);
        line-height: 1.25;
    }

    .app-header-menus {
        inline-size: 100%;
        gap: var(--sp-1h);
        flex-wrap: nowrap;
    }

    .app-header-links,
    .app-header-end {
        gap: var(--sp-1h);
    }

    .app-header-link {
        padding: var(--sp-1) var(--sp-2);
        font-size: var(--fs-2);
    }

    .app-header-link:not(.app-header-menu) .app-header-icon {
        margin-right: var(--sp-0);
    }

    .app-header-menu-label {
        position: absolute;
        inline-size: 1px;
        block-size: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    /* Alone, the glyph is the whole target: as wide as it is tall. Two classes and the element,
       to outrank `.app-shell .btn { min-width: 0 }` in legacy/06. */
    .app-header-end > .btn.app-header-menu {
        position: relative;
        min-inline-size: var(--touch-min);
        justify-content: center;
    }

    .app-header-menu .app-header-glyph {
        margin-right: 0;
        font-size: 1.15em;
    }

    .app-header-menu .nav-count {
        position: absolute;
        top: calc(-1 * var(--sp-2));
        right: calc(-1 * var(--sp-2));
        margin-left: 0;
    }

    .app-header-user {
        max-inline-size: 6rem;
    }
}

@media (max-width: 419.98px) {
    .app-header-link:not(.app-header-menu) .app-header-icon {
        display: none;
    }
}

@media (max-width: 374.98px) {
    .app-header-bar,
    .app-header-sheet {
        padding-inline: var(--sp-3);
    }

    .app-header-menus,
    .app-header-links,
    .app-header-end {
        gap: var(--sp-1);
    }

    .app-header-link {
        padding-inline: var(--sp-1h);
    }
}

@media (min-width: 768px) {
    .app-header-links > .app-header-from-md {
        display: flex;
    }
}

/* ── From 992: one row, the nav filling it, Store and Admin pushed right ── */
@media (min-width: 992px) {
    .app-header-bar {
        flex-wrap: nowrap;
        gap: var(--sp-3);
        padding: var(--sp-1h) var(--sp-4);
    }

    /* A small button already spaces its icon from its word (.btn.btn-sm gap), so the icon's own
       margin is small here: from 1200 the eight controls need every pixel of the row. */
    .app-header-icon,
    .app-header-glyph {
        margin-right: var(--sp-0);
    }

    .app-header-menus {
        flex: 1 1 auto;
    }

    .app-header-end {
        margin-inline-start: auto;
    }

    .app-header-end > .app-header-from-lg {
        display: block;
    }

    /* Store and Admin are in the bar from here, so the sheet does not list them again. */
    .app-header-sheet .app-header-below-lg {
        display: none;
    }
}

/* ── From 1200: the full bar; the sheet and its button are gone ── */
@media (min-width: 1200px) {
    .app-header-end > .app-header-from-xl {
        display: block;
    }

    .app-header-links > .app-header-from-xl {
        display: flex;
    }

    .app-header-end > .app-header-below-xl,
    .app-header-sheet {
        display: none;
    }
}

/* ── 1200 to 1399.98: the tightest full bar. Measured at 1200 with the preview admin's name and an
   offer count: no room to spare at the base gaps, so the gaps close a little. The name's cap grows
   with the screen, as the room left in the bar does (about a pixel for each pixel of width: 47px
   spare at 1200, 127px at 1280, 213px at 1366, measured with a 6rem cap): 7.5rem at 1200, which
   uses 24px of the 47 and holds "Preview Admin" (102px) and "Storeless Admin" (112px) whole, and
   the full 10rem from 1240. Only a longer name is cut with an ellipsis, and it is all still the
   toggle's name (final pass, shell-nav: a fixed 6rem cut "Preview Ad..." at 1280 with 127px spare). ── */
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .app-header-links,
    .app-header-end {
        gap: var(--sp-1h);
    }

    .app-header-user {
        max-inline-size: min(10rem, calc(7.5rem + 100vw - 1200px));
    }
}

/* ── 992 to 1199.98: the mark alone, the word kept in the page as the link's name ── */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .app-header--member .app-header-mark {
        display: block;
    }

    .app-header--member .app-header-wordmark {
        position: absolute;
        inline-size: 1px;
        block-size: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}

/* ── Menus: the dropdowns (_NavMenu) and the sheet (_NavSheet) ──────────────────────────────────
   One row shape everywhere (_NavItem, the .nav-mega-item grid of legacy/05): icon, title, and the
   line under it. docs/ui/components/nav-menus.md.

   A dropdown is as tall as the screen below the bar allows, with no fixed cap (the old 34rem cap
   made the Admin menu scroll inside itself and cut off its last groups even on a 4K screen, audit
   LS-SH5); it scrolls only when even that is not enough. --nav-menu-top is the bar's height plus
   the gap above it and a margin below the panel, measured at 1280 and 3840 (the root grows there).
   The panel (.nav-menu) is the box that is height-limited and scrolls down; the list inside it
   (.nav-menu-body) is what takes the Admin menu's columns. Columns on the height-limited box would
   fill each column to its height and add more sideways, behind a horizontal scrollbar. Its width
   is capped at the screen less 2rem, and the panel's Popper config (preventOverflow, 16px padding,
   on the toggle in _NavMenu) moves it in from whichever edge it would touch, so a gutter stays on both sides. */
.nav-menu {
    --nav-menu-top: 5.5rem;
    min-inline-size: min(20rem, calc(100vw - 2rem));
    max-inline-size: calc(100vw - 2rem);
    max-block-size: calc(100dvh - var(--nav-menu-top));
    overflow-y: auto;
    overscroll-behavior: contain;
}

.nav-menu-body,
.nav-menu-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* --nav-row-inset: the inline space from a row's edge to its icon, shared by the rows, the group
   labels and the sheet's name line, so a label starts where its rows' icons do. A sheet row has a
   hair border inside that space, so its padding is the inset less the border. The sheet's is the
   section summary's own inline padding (legacy/05), so rows, labels and section names share an edge. */
.nav-menu {
    --nav-row-inset: var(--sp-3);
}

.app-header-sheet {
    --nav-row-inset: var(--sp-2);
}

.nav-menu .dropdown-item {
    padding-inline: var(--nav-row-inset);
}

.app-header-sheet .nav-sheet-item {
    padding-inline: calc(var(--nav-row-inset) - var(--edge-w-hair));
}

/* A group's label names its list (ul aria-labelledby); a span, never a heading (audit SH13). The
   same label style as the sheet's Help label below. */
.nav-menu-label,
.app-header-sheet .nav-sheet-subheading {
    display: block;
    /* Block only: the sheet's Help label keeps the section's inline indent (legacy/05), as its rows do. */
    margin-block: 0;
    padding: var(--sp-2) var(--nav-row-inset) var(--sp-1);
    font-size: var(--fs-2);
    font-weight: 700;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    color: var(--ink-muted);
    opacity: 1;
}

.nav-menu-group + .nav-menu-group,
.nav-menu-lead + .nav-menu-group {
    margin-top: var(--sp-1);
}

/* Sign Out, apart from the rows above it. */
.nav-menu-end {
    margin-top: var(--sp-1);
    padding-top: var(--sp-1);
    border-top: var(--edge-w-hair) solid var(--ink);
}

.nav-menu-sign-out {
    font-weight: 600;
}

/* The Admin menu in columns (LS-SH5), as multi-column layout rather than a grid, so groups pack
   into whichever column is shorter (break-inside works in columns, not in a grid). From 992 two,
   a group never split; from 1200 four, and every group shows with no inner scroll from 1280x720.
   The columns are on the list, not the panel, so a screen too short for them scrolls the panel
   down (measured at 1024x650 and 1280x540: no sideways scroll). */
@media (min-width: 992px) {
    .nav-menu--columns {
        inline-size: min(46rem, calc(100vw - 2rem));
    }

    .nav-menu--columns > .nav-menu-body {
        columns: 2;
        column-gap: var(--sp-3);
    }

    .nav-menu--columns > .nav-menu-body > li {
        break-inside: avoid;
    }

    .nav-menu--columns > .nav-menu-body > .nav-menu-lead {
        column-span: all;
    }

    .nav-menu--columns > .nav-menu-body > .nav-menu-group {
        margin-top: 0;
        padding-bottom: var(--sp-1);
    }
}

@media (min-width: 1200px) {
    .nav-menu--columns {
        inline-size: min(68rem, calc(100vw - 2rem));
    }

    .nav-menu--columns > .nav-menu-body {
        columns: 4;
    }

    /* Four balanced columns: a long group (more than four rows; Catalogue and Pricing has seven) runs on into the
       next column rather than leaving the other three short, so the menu is about a third as tall. A
       short group stays whole, a row is never split, and a label never ends a column without its first row. */
    .nav-menu--columns > .nav-menu-body > .nav-menu-group--long {
        break-inside: auto;
    }

    .nav-menu--columns .nav-menu-list > li {
        break-inside: avoid;
    }

    .nav-menu--columns .nav-menu-label {
        break-after: avoid;
    }
}

/* ── The sheet ── */

/* Section names are the sheet's top level: --fs-3 in ink, not the 11px muted capitals they were
   (audit SH11). Plain text in the summary, never a heading (audit SH13). */
.app-header-sheet .nav-sheet-heading {
    display: inline-flex;
    align-items: center;
    font-size: var(--fs-3);
    font-weight: 700;
    letter-spacing: normal;
    text-transform: none;
    color: var(--ink);
}

.app-header-sheet .nav-sheet-section > summary .nav-count {
    margin-left: var(--sp-2);
}

/* Quick Import: a destination of its own, not a section, so a row above them. */
.nav-sheet-top {
    padding-bottom: var(--sp-1);
    border-bottom: var(--edge-w-hair) solid var(--ink);
}

.nav-sheet-top > .nav-sheet-item {
    display: grid;
}

.app-header-sheet .nav-sheet-who {
    padding-inline: var(--nav-row-inset);
}

.nav-sheet-sign-out {
    margin-top: var(--sp-2);
}

/* The sheet's two columns (.nav-sheet-col in _NavSheet): below 768 they stack, so the first
   column's last section needs the rule between it and the next column's first (legacy/05 drops the
   last child's). */
.app-header-sheet .nav-sheet-col:not(:last-child) > .nav-sheet-section:last-child {
    border-bottom: var(--edge-w-hair) solid var(--ink);
}

/* 768 to 1199.98: two columns, so the sheet is not one long column of accordions with half the
   width empty (audit SH11). The grid places the two column wrappers, not the sections, so each
   column stacks on its own: a closed section sits right under the one above it, not beside an open
   one's empty space (legacy/05 kept one column for that reason), and opening a section never moves
   a section in the other column. */
@media (min-width: 768px) {
    .app-header-sheet .nav-sheet-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--sp-5);
        align-items: start;
    }

    .app-header-sheet .nav-sheet-top {
        grid-column: 1 / -1;
    }

    /* In two columns every section keeps its rule, the last one included. */
    .app-header-sheet .nav-sheet-section:last-child {
        border-bottom: var(--edge-w-hair) solid var(--ink);
    }
}

/* Touch: a sheet row is a tap target, the help rows without a second line included. A dropdown
   row keeps its icon / title / line-under grid: the touch layer (legacy/10) turns every
   .dropdown-item into a flex row, which on a 992px+ touch screen put the title beside its copy;
   two classes win that back, and its 44px min-height still applies. */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .nav-sheet-item {
        min-block-size: var(--touch-min);
        align-content: center;
    }

    .dropdown-item.nav-mega-item {
        display: grid;
        align-content: center;
    }
}

/* The auth screens draw no app chrome (login.css hides the old bar's class; auth-shell decides
   what they show next). */
.login-body .app-header {
    display: none;
}

@media (forced-colors: active) {
    .app-header {
        forced-color-adjust: auto;
        border: 1px solid CanvasText;
    }

    .app-header-wordmark,
    .app-header-mark {
        box-shadow: none;
    }

    /* The fill is dropped by the forced palette; the bar under the current item is kept. */
    .app-header-link[aria-current],
    .app-header-link--current,
    .app-header-menu--current {
        box-shadow: inset 0 -3px 0 CanvasText;
    }
}

@media (forced-colors: active) and (max-width: 991.98px) {
    .app-header-menu--current-below-lg {
        box-shadow: inset 0 -3px 0 CanvasText;
    }
}

/* ── Page header (<app-page-header>, TagHelpers/AppPageHeaderTagHelper.cs) ──────────
   The one title block a page starts with. docs/ui/components/page-header.md has the API.

   Structure: header.page-header holds .page-header__main (the hgroup with the eyebrow and
   the h1, the facts, the lede, the caption), then .page-header__actions (an app-action-bar),
   .page-header__hero and .page-header__related, in that order in the markup. Its alerts follow
   it in .page-header-alerts. Unboxed: it sits on the page and is ruled underneath in ink.

   One column on phones, in the order written. From 768px the actions sit top-right beside the
   heading, at most half the width, and never move with the copy (LS-ME5). The hero always has
   a full-width row, so no empty chart column (LS-ME2). On a short desktop screen, (min-width:
   992px) and (max-height: 800px), the header is compact (LS-ME3, LS-SW9). */

.page-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-3);
    min-width: 0;
    padding-block: var(--sp-1) var(--sp-4);
    border-block-end: var(--edge-w-strong) solid var(--ink);
}

.page-header__main {
    display: grid;
    align-content: start;
    gap: var(--sp-2);
    min-width: 0;
}

.page-header__heading {
    display: grid;
    justify-items: start;
    gap: var(--sp-1h);
    margin: 0;
    min-width: 0;
}

/* The eyebrow: a small ink-edged label in the brand fill, never the title. */
.page-header__eyebrow {
    max-inline-size: 100%;
    margin: 0;
    padding: var(--sp-0) var(--sp-1h);
    font-size: var(--fs-2);
    font-weight: 700;
    line-height: var(--lh-tight);
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    color: var(--on-brand);
    background: var(--brand-primary);
    border: var(--edge-w) solid var(--ink);
    overflow-wrap: anywhere;
}

.page-header__title {
    max-inline-size: 100%;
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--fs-h1);
    font-weight: 900;
    line-height: var(--lh-tight);
    letter-spacing: -.01em;
    color: var(--ink);
    overflow-wrap: anywhere;
    text-wrap: balance;
}

/* Facts, a middot between each. A fact moves to the next line whole when it does not fit.
   The middot hangs in the gap before each fact, outside the fact's own box. The fact that starts
   a line has its middot outside the row, where the row clips it, so a line neither starts nor
   ends on a separator however the facts wrap. Only the inline axis is clipped, so no browser cuts
   a link's focus ring above or below the row. On the inline axis the row reaches out by
   --sp-1h on each side and gives it back in padding, so the facts wrap at the same width while
   the clip edge sits beyond a ring's reach (3px and a 2px offset) and short of the clipped
   middot, which is centred in the full gap. Padding, not overflow-clip-margin, which Safari
   does not support. */
.page-header__meta {
    --page-meta-sep: calc(var(--sp-2) * 2 + .4em);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--sp-1) var(--page-meta-sep);
    margin: 0 calc(-1 * var(--sp-1h));
    padding-inline: var(--sp-1h);
    overflow-x: clip;
    overflow-y: visible;
    font-size: var(--fs-3);
    color: var(--ink-muted);
}

.page-header__meta > * {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Decoration: its alternative text is empty. */
.page-header__meta > ::before {
    content: "\00B7" / "";
    display: inline-block;
    inline-size: var(--page-meta-sep);
    margin-inline-start: calc(-1 * var(--page-meta-sep));
    font-weight: 700;
    text-align: center;
}

.page-header__lede {
    max-inline-size: var(--measure);
    margin: 0;
    color: var(--ink-muted);
    line-height: var(--lh-body);
    text-wrap: pretty;
}

/* The caption is in smaller type than the lede, so its own 58ch would be a narrower box and the
   header would have two right edges. It takes the lede's measure instead: --page-header-measure
   is a registered length, so it is worked out in .page-header__main's type (the lede's) and
   handed down in pixels. Where @property is not supported the caption falls back to its own
   measure. On a short desktop screen the lede is in the caption's type and both use --measure. */
@property --page-header-measure {
    syntax: "<length>";
    inherits: true;
    initial-value: 0px;
}

.page-header__main {
    --page-header-measure: var(--measure);
}

.page-header__caption {
    max-inline-size: var(--page-header-measure);
    min-width: 0;
    font-size: var(--fs-3);
    text-wrap: pretty;
}

.page-header__caption > :last-child {
    margin-block-end: 0;
}

.page-header__actions {
    min-width: 0;
}

.page-header__hero {
    display: grid;
    gap: var(--sp-1);
    min-width: 0;
}

.page-header__hero-label {
    margin: 0;
    font-size: var(--fs-2);
    font-weight: 700;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    color: var(--ink-muted);
}

.page-header__hero-value {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--fs-display-2);
    font-weight: 900;
    line-height: var(--lh-tight);
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.page-header__hero-value small {
    font-size: .45em;
    letter-spacing: 0;
    color: var(--ink-muted);
}

/* Related links: links set on their own, so each is a full target on touch and below 992px. */
.page-header__related {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-1) var(--sp-4);
    min-width: 0;
    font-size: var(--fs-3);
}

.page-header__related a {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    max-inline-size: 100%;
    overflow-wrap: anywhere;
}

@media (max-width: 991.98px), (pointer: coarse) {
    .page-header__related a {
        min-block-size: var(--touch-min);
    }
}

/* The alerts under the header, one after another. */
.page-header-alerts {
    display: grid;
    gap: var(--sp-3);
    min-width: 0;
}

.page-header-alerts > .alert {
    margin: 0;
}

/* ── From 768px: the actions top-right ──────────────────────────────────────────── */
@media (min-width: 768px) {
    .page-header--with-actions {
        grid-template-columns: minmax(0, 1fr) fit-content(50%);
        column-gap: var(--sp-5);
    }

    .page-header--with-actions > .page-header__main {
        grid-column: 1;
        grid-row: 1;
    }

    .page-header--with-actions > .page-header__actions {
        grid-column: 2;
        grid-row: 1;
        align-self: start;
        justify-self: end;
    }

    .page-header__actions .app-action-bar,
    .page-header__actions .app-action-bar-actions {
        justify-content: flex-end;
    }

    /* The column is at most half the header, so two long labels can wrap. The buttons then grow
       to fill their line, and a wrapped pair is one width instead of a ragged stack. On one row
       the column is only as wide as the buttons, so there is nothing to grow into. */
    .page-header__actions .app-action-bar-actions {
        flex: 1 1 auto;
    }

    .page-header__actions .app-action-bar-actions > *,
    .page-header__actions .app-action-bar-more > .btn {
        flex: 1 1 auto;
    }

    .page-header > .page-header__hero,
    .page-header > .page-header__related {
        grid-column: 1 / -1;
    }
}

/* ── Short desktop screens: compact ─────────────────────────────────────────────
   At 1280x720 the header, trail and tabs pushed the first content row below the fold
   (LS-ME3, LS-SW9). Tighter gaps, a smaller lede, the hero's label beside its figure and
   the related links beside the copy keep the busiest header under 200px there. The title
   stays a step above the panel titles under it (h2.panel-title is at most 1.45rem). */
@media (min-width: 992px) and (max-height: 800px) {
    .page-header {
        row-gap: var(--sp-2);
        padding-block: 0 var(--sp-3);
    }

    .page-header__main {
        gap: var(--sp-1h);
    }

    .page-header__heading {
        gap: var(--sp-1);
    }

    .page-header__title {
        font-size: var(--fs-7);
    }

    .page-header__lede {
        font-size: var(--fs-3);
    }

    .page-header__caption {
        max-inline-size: var(--measure);
    }

    .page-header__hero {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        column-gap: var(--sp-3);
    }

    .page-header__hero-value {
        font-size: var(--fs-7);
    }

    /* The related links move up beside the copy, into the actions column, instead of taking
       a full-width row. They have a row of their own under the actions, so the two never
       share a cell: the copy spans both rows, and when it is taller the links sit at its foot;
       when it is shorter the rows are the actions' height and the links' height. After the
       actions in the markup, as on screen. A hero is placed on the row after both. */
    .page-header--with-actions.page-header--with-related > .page-header__main {
        grid-row: 1 / span 2;
    }

    .page-header--with-actions > .page-header__related {
        grid-column: 2;
        grid-row: 2;
        align-self: end;
        justify-self: end;
        justify-content: flex-end;
    }
}

/* ── Panel (<app-panel>, TagHelpers/AppPanelTagHelper.cs) ─────────────────────
   The panel's options and the in-content heading scale. docs/ui/components/panel.md has the
   API; /Admin/StyleGuide/Panel the samples. The panel's frame, heading, title, copy and body
   are still the legacy rules (legacy/02-shell-panels.css, the phone padding in 08); this file
   only adds what the options draw, so a panel that uses none of them looks as it did. */

/* ── Heading slots ──
   heading-extra: a chip or toggle on the title's line, wrapping under it when there is no
   room. meta: a muted line of facts under the title, before the copy. */
.panel-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2) var(--sp-3);
    min-width: 0;
}

.panel-title-row > .panel-title {
    min-width: 0;
    overflow-wrap: anywhere;
}

.panel-heading-extra {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
    min-width: 0;
}

.panel-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-1) var(--sp-2);
    margin-block-start: var(--sp-1);
    color: var(--ink-muted);
    font-size: var(--fs-3);
    line-height: var(--lh-tight);
    max-inline-size: var(--measure);
}

.panel-meta + .panel-copy {
    margin-block-start: var(--sp-2);
}

/* ── Actions (<panel-actions>, an action bar) ──
   The bar is the heading's actions element itself (it carries .panel-actions). Beside the title it
   takes only the room its buttons need; below 992px it is its own full-width row, so a phone grid
   or stack spans the panel. (The inline rendering and its legacy .panel-actions rules in 02, 05
   and 06 were removed in the final pass.) */
.panel-heading > .app-action-bar.panel-actions {
    flex: 0 1 auto;
}

@media (max-width: 991.98px) {
    .panel-heading > .app-action-bar.panel-actions {
        flex-basis: 100%;
    }

    .panel-heading > .app-action-bar.panel-actions > .app-action-bar-actions {
        flex: 1 1 auto;
    }
}

/* ── divided ──
   One hairline between the heading and the body. A border-top-box body already draws one, so
   it is not drawn twice; a heading-only panel draws none (it would sit on the panel's border). */
.app-panel--divided > .panel-heading:not(:last-child) {
    border-block-end: var(--edge-w-hair) solid var(--ink);
}

.app-panel--divided > .panel-heading + .border-top-box {
    border-block-start: 0;
}

/* ── density="compact" ──
   Less room around the heading and the body, for a side panel or a dense admin column. Two
   classes, so it beats the legacy one-class padding; on a phone the legacy padding (--sp-3)
   is already this small. */
.app-panel--compact > :is(.panel-heading, .panel-body, .border-top-box) {
    padding: var(--sp-3) var(--sp-4);
}

.app-panel--compact > .panel-heading {
    gap: var(--sp-3);
}

@media (max-width: 575.98px) {
    .app-panel--compact > :is(.panel-heading, .panel-body, .border-top-box) {
        padding: var(--sp-3);
    }
}

/* ── variant="custom" ──
   A panel that lays itself out keeps its frame and heading and loses the legacy safety net that
   pads every unknown child (legacy 02 and 08). Those rules are (0,3,0) and (0,4,0); these match
   them and come later in the bundle. */
.app-panel.app-panel--custom > :not(.panel-heading, .panel-body, .border-top-box) {
    padding-inline: 0;
}

.app-panel.app-panel--custom > :not(.panel-heading, .panel-body, .border-top-box):first-child {
    padding-block-start: 0;
}

.app-panel.app-panel--custom > :not(.panel-heading, .panel-body, .border-top-box):last-child {
    padding-block-end: 0;
}

/* ── bleed ──
   A body that is a bare table (or a .table-responsive scroller holding one) runs edge to edge;
   its first and last cells take the panel's padding, so the text lines up with the heading, and
   the last row's rule does not sit on the panel's border. An app-table does this itself in a
   plain body (components/table.css). The same inset as the panel's padding, narrower on a phone. */
.panel-bleed {
    --panel-bleed-inset: var(--sp-5);
    min-width: 0;
}

/* The legacy safety net (legacy 02 and 08) pads every panel child it does not know, at up to
   (0,4,0) for its first-child and last-child rules. The repeated class reaches that weight, and
   the bundle order (components after legacy) settles the tie. */
.app-panel > .panel-bleed.panel-bleed.panel-bleed {
    padding: 0;
}

.app-panel--compact > .panel-bleed {
    --panel-bleed-inset: var(--sp-4);
}

:is(.panel-bleed > .table, .panel-bleed > .table-responsive > .table) {
    margin-block-end: 0;
}

:is(.panel-bleed > .table, .panel-bleed > .table-responsive > .table) > :is(thead, tbody, tfoot) > tr > :first-child {
    padding-inline-start: var(--panel-bleed-inset);
}

:is(.panel-bleed > .table, .panel-bleed > .table-responsive > .table) > :is(thead, tbody, tfoot) > tr > :last-child {
    padding-inline-end: var(--panel-bleed-inset);
}

:is(.panel-bleed > .table, .panel-bleed > .table-responsive > .table) > :last-child > tr:last-child > * {
    border-bottom-width: 0;
}

@media (max-width: 575.98px) {
    .panel-bleed,
    .app-panel--compact > .panel-bleed {
        --panel-bleed-inset: var(--sp-3);
    }
}

/* ── In-content heading scale (audit LS-SH8, SH5) ──
   A heading written by hand inside a panel follows its rank, in the display face, instead of
   Bootstrap's Inter 500. "By hand" means no class at all, or one that carries Bootstrap's .h4,
   .h5 or .h6 size class whatever else it carries (h2.h5.mb-0, h3.h6.mb-2, h2.h5.card-title).
   A heading with a tabindex is a focus jump target, not a section heading (the catalogue's
   h2.h6#results count line, which the filter form focuses), so it keeps its own size until its
   migration says what it is. An h2 in a panel's heading row reads as that panel's title
   (h2.panel-title's size and weight); an h2 in the body is --fs-h2 at 800, capped at the
   title's clamp so it is never bigger than a panel title (they are equal below about 1110px,
   where the title's 900 still outweighs it); an h3 is --fs-h3 at 700 and an h4 1rem (the body
   size) at 700. So title >= body h2 > h3 > h4 >= body at every width, all below the h1. This
   restyles every such heading in a website panel site-wide, before any migration. A heading
   whose classes do not include .h4-.h6 (a component title, a modal title) is left alone, and
   reading text (.prose, .doc-body) keeps its own scale (components/content-blocks.css). The :is()
   is one class and the :where()s add nothing, so the rule beats .h5 (0,1,0) and loses to any
   component rule with an element and a class or more. */
:where(.app-panel) :is(h2, h3, h4):is(:not([class]), .h4, .h5, .h6):where(:not([tabindex])):not(:where(.prose, .doc-body) *) {
    font-family: var(--font-display);
    line-height: var(--lh-tight);
    color: var(--ink);
}

:where(.app-panel) h2:is(:not([class]), .h4, .h5, .h6):where(:not([tabindex])):not(:where(.prose, .doc-body) *) {
    font-size: min(var(--fs-h2), clamp(1.15rem, 1.8vw, 1.45rem));
    font-weight: 800;
    letter-spacing: .01em;
}

:where(.app-panel) h3:is(:not([class]), .h4, .h5, .h6):where(:not([tabindex])):not(:where(.prose, .doc-body) *) {
    font-size: var(--fs-h3);
    font-weight: 700;
    letter-spacing: .01em;
}

:where(.app-panel) h4:is(:not([class]), .h4, .h5, .h6):where(:not([tabindex])):not(:where(.prose, .doc-body) *) {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .01em;
}

/* In the heading row it is the panel's title in all but name: the size is h2.panel-title's own
   clamp (legacy/02-shell-panels.css) and the face and weight the typography layer's (legacy 06). */
:where(.app-panel > .panel-heading) h2:is(:not([class]), .h4, .h5, .h6):where(:not([tabindex])) {
    font-size: clamp(1.15rem, 1.8vw, 1.45rem);
    font-weight: 900;
    letter-spacing: -.01em;
}

/* ── Plan card (_PlanCard, mig-home-public) ───────────────────────────────────
   One plan: name, price, who it is for, the facts, and a footer. The partial
   is Pages/Shared/_PlanCard.cshtml (PlanCardModel.cs has the API), the guide is
   docs/ui/components/plan-card.md, the samples are /Admin/StyleGuide/PlanCard.

   Full: a column, its footer pushed to the bottom, so the cards in a stretched
   app-grid row (align="stretch") end on one line whatever their facts. No
   height of its own: a percentage height in a wrapping flex row resolves
   against the whole grid and overlapped the next row. Compact: stacked below
   768px; from 768px head and foot share the top row and the facts take their
   own; from 1200px one row of three (head, facts, foot); the facts wrap into
   columns. */
.plan-card {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    padding: var(--sp-5);
    background: var(--surface);
    color: var(--ink);
    border: var(--edge-w) solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    min-inline-size: 0;
}

/* A full card is the container its footer's buttons measure (plan-card-actions,
   below), so the pair sits side by side or stacks by the card's own width. The
   action row height is one button: 44px wherever the pointer is not certainly
   a mouse, as the action bar's buttons are. */
.plan-card--full {
    container: plan-card / inline-size;
    --plan-card-action-h: var(--control-h);
}

@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .plan-card--full {
        --plan-card-action-h: max(var(--control-h), var(--touch-min));
    }
}

/* A list item holding one card, when the row of cards is a list (Pricing's
   <app-grid tag="ul" aria-label="Plans">). The item is what the grid stretches;
   the card fills it. */
.plan-card-slot {
    display: flex;
    flex-direction: column;
}

.plan-card-slot > .plan-card {
    flex: 1 1 auto;
}

.plan-card-head {
    display: grid;
    gap: var(--sp-1);
}

/* The name leads in the display face, a step above the price's weight, so the
   hierarchy reads name, then price (audit LS-SH15). */
.plan-card-name {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--fs-6);
    font-weight: 900;
    line-height: var(--lh-tight);
    letter-spacing: -.01em;
    color: var(--ink);
}

/* A card under a section's own heading (TitleTag h3 or h4, as Billing's plans sit in
   its Change Plan panel) steps down to the in-panel h3 size, so the panel's h2
   title outranks the plan names inside it. Its price steps down with it, so the
   name still leads the price (audit LS-SH15). */
.plan-card-name:is(h3, h4) {
    font-size: var(--fs-h3);
}

.plan-card:has(.plan-card-name:is(h3, h4)) .plan-card-amount {
    font-size: var(--fs-4);
}

.plan-card-price {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: var(--sp-2);
}

.plan-card-amount {
    font-family: var(--font-display);
    font-size: var(--fs-5);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.plan-card-unit,
.plan-card-for,
.plan-card-note {
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

.plan-card-unit {
    white-space: nowrap;
}

.plan-card-for,
.plan-card-note {
    margin: 0;
    max-inline-size: var(--measure);
    text-wrap: pretty;
}

/* Side by side (768px up), a full card's "best for" line always takes two
   lines, the most any plan's needs at any width from 768 to 3440, so every
   card's facts start on one line and "Up to N on your team" reads straight
   across the row. app-grid is a flex row, so subgrid cannot do this. */
@media (min-width: 768px) {
    .plan-card--full .plan-card-for {
        min-block-size: 2lh;
    }
}

.plan-card-facts {
    display: grid;
    gap: var(--sp-2);
    margin: 0;
    padding: var(--sp-4) 0 0;
    list-style: none;
    border-block-start: var(--edge-w-hair) solid var(--rule-soft);
    font-size: var(--fs-3);
}

.plan-card-fact {
    display: grid;
    grid-template-columns: 1.25em minmax(0, 1fr);
    align-items: baseline;
    gap: var(--sp-2);
    overflow-wrap: anywhere;
}

.plan-card-fact-icon {
    color: var(--ok-ink);
}

/* A missing thing: the dash and the words say it, the muted ink repeats it. */
.plan-card-fact--no {
    color: var(--ink-muted);
}

.plan-card-fact--no .plan-card-fact-icon {
    color: var(--ink-muted);
}

/* Pushed to the bottom of a full card; drawn even when empty, so a row of
   cards keeps one footer line. */
.plan-card-foot {
    display: grid;
    gap: var(--sp-3);
    margin-block-start: auto;
    padding-block-start: var(--sp-3);
    border-block-start: var(--edge-w-hair) solid var(--rule-soft);
    min-block-size: calc(var(--fs-3) * 1.5 + var(--sp-3));
}

.plan-card-action {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
}

/* Badges on the name's line, and the footer's own controls (Billing's forms):
   a wrapping row, each button its label's width, never squeezed; in a full
   card the controls are the equal grid below. mig-store-settings. */
.plan-card-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-1) var(--sp-2);
}

.plan-card-badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.plan-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.plan-card-actions > form {
    display: contents;
}

/* A full card's own controls (Billing's Choose Monthly and Choose Yearly) are a
   grid of equal buttons: two across, or one full-width column when the card is
   too narrow for the pair (20rem inside). A badge takes a row of its own, after
   the buttons. */
.plan-card--full .plan-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    align-items: center;
}

.plan-card--full .plan-card-actions > form > :is(.btn, .app-action) {
    justify-self: stretch;
    min-block-size: var(--plan-card-action-h);
}

.plan-card--full .plan-card-actions > .plan-card-badges {
    grid-column: 1 / -1;
}

@container plan-card (max-width: 20rem) {
    .plan-card--full .plan-card-actions {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Where cards share a row (768px up, where Billing's and Pricing's grids go 2-up),
   every card keeps the same rows, used or not, so a card with one button or only a
   badge ends its facts and draws its footer rule level with the cards beside it.
   Below 768px the cards stack one per row and a card's rows are only the ones it
   uses: a reserved row there was a blank band at the foot of the card. */
@media (min-width: 768px) {
    .plan-card--full .plan-card-actions {
        grid-template-rows: minmax(var(--plan-card-action-h), auto);
    }

    /* When a card in the row holds its badge and buttons together (a store on a plan
       it pays for), every card keeps one more row, so that card's badge does not push
       its footer above the others'. */
    :has(> .plan-card-slot .plan-card-actions > form ~ .plan-card-badges) > .plan-card-slot .plan-card--full .plan-card-actions {
        grid-template-rows: repeat(2, minmax(var(--plan-card-action-h), auto));
    }

    @container plan-card (max-width: 20rem) {
        .plan-card--full .plan-card-actions {
            grid-template-rows: repeat(2, minmax(var(--plan-card-action-h), auto));
        }

        :has(> .plan-card-slot .plan-card-actions > form ~ .plan-card-badges) > .plan-card-slot .plan-card--full .plan-card-actions {
            grid-template-rows: repeat(3, minmax(var(--plan-card-action-h), auto));
        }
    }
}

/* PhoneFactCount: below 768px a full card keeps its first facts and drops
   the rest and the "best for" line, with less padding (Billing, beside a link to Pricing;
   audit SA16, mig-store-settings). */
@media (max-width: 767.98px) {
    /* Tighter on a phone. */
    .plan-card--phone-brief {
        gap: var(--sp-3);
        padding: var(--sp-3);
    }

    .plan-card--phone-brief .plan-card-facts {
        padding-block-start: var(--sp-3);
    }

    .plan-card--phone-brief .plan-card-for,
    .plan-card--phone-brief .plan-card-fact--wider {
        display: none;
    }
}

/* ── Compact: two rows from 768px, one row of three from 1200px ── */
.plan-card--compact {
    block-size: auto;
}

@media (min-width: 768px) {
    .plan-card--compact {
        display: grid;
        grid-template-columns: minmax(12rem, 1fr) minmax(0, 2fr) minmax(12rem, 1fr);
        align-items: start;
        gap: var(--sp-5);
    }

    .plan-card--compact .plan-card-facts {
        /* Two columns, so a card's four facts read as two pairs: auto-fill made three
           columns from 1920 and left the fourth alone on a row. */
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--sp-5);
        padding: 0 0 0 var(--sp-5);
        border-block-start: 0;
        border-inline-start: var(--edge-w-hair) solid var(--rule-soft);
    }

    .plan-card--compact .plan-card-foot {
        margin: 0;
        padding: 0 0 0 var(--sp-5);
        border-block-start: 0;
        border-inline-start: var(--edge-w-hair) solid var(--rule-soft);
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    /* Head and foot share the first row; the facts take the row below. */
    .plan-card--compact {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .plan-card--compact .plan-card-facts {
        grid-column: 1 / -1;
        grid-row: 2;
        padding: var(--sp-4) 0 0;
        border-inline-start: 0;
        border-block-start: var(--edge-w-hair) solid var(--rule-soft);
    }
}

/* ── Quantity stepper (_QtyStepper, qty-stepper.js) ──────────────────────────
   − [ 3 ] +  and an optional "of 4". The buttons and the count are one joined block
   (.app-qty-stepper-joined, which never wraps); the of-label sits after it and is the
   only part that moves under it in a narrow row or tile. Two sizes with a mouse:
   medium is a form control's height, small fits a list row. Below 992px, and
   on any screen without a fine pointer that hovers, both are 44x44 (UI plan principle 3;
   audit CT10, LS-ME11), the same test as the legacy touch layer. The legacy .qty-stepper
   rules stay for the pages not yet moved to the partial; nothing here restyles them. */
/* --control-h is calc(1.5em + ...), and a custom property's em is resolved where it is
   used: on the buttons and the count, whose font-size is 1rem (.btn and .form-control), so
   medium is the same 40px as a form control beside it. So a medium button or count never
   sets its own font-size; the glyph's size is set on the svg. (Small and touch sizes are
   rem or px, so the small count's smaller text does not move them.) */
.app-qty-stepper {
    --qty-step: var(--control-h);
    --qty-input-w: var(--input-w-qty);
    display: inline-flex;
    flex-wrap: wrap;
    align-items: stretch;
    row-gap: var(--sp-1);
    max-inline-size: 100%;
    vertical-align: middle;
}

.app-qty-stepper--sm {
    --qty-step: var(--sp-6);
    --qty-input-w: var(--sp-8);
}

.app-qty-stepper-label {
    display: block;
}

.app-qty-stepper-joined {
    flex: none;
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: stretch;
}

.app-qty-stepper-step {
    flex: none;
    display: inline-grid;
    place-items: center;
    inline-size: var(--qty-step);
    min-block-size: var(--qty-step);
    padding: 0;
    line-height: 1;
    box-shadow: none;
}

.app-qty-stepper-glyph {
    font-size: var(--fs-5);
    inline-size: 1em;
    block-size: 1em;
}

.app-qty-stepper-input {
    flex: none;
    inline-size: var(--qty-input-w);
    min-block-size: var(--qty-step);
    padding-inline: var(--sp-1);
    border-inline-width: 0;
    text-align: center;
    font-variant-numeric: tabular-nums;
    appearance: textfield;
    -moz-appearance: textfield;
}

.app-qty-stepper-input::-webkit-outer-spin-button,
.app-qty-stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.app-qty-stepper--sm .app-qty-stepper-glyph {
    font-size: var(--fs-4);
}

.app-qty-stepper--sm .app-qty-stepper-input {
    padding-block: 0;
    font-size: var(--fs-3);
}

/* The focus token on both parts. Bootstrap's .form-control:focus takes the outline off a
   field, so without this the count showed focus only as its offset fill. The joined parts
   touch, so the one with focus is lifted over its neighbours and its ring is never painted
   under them. */
.app-qty-stepper-step:focus-visible,
.app-qty-stepper-input:focus-visible {
    position: relative;
    z-index: 1;
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

.app-qty-stepper-of {
    align-self: center;
    margin-inline-start: var(--sp-2);
    color: var(--ink-muted);
    font-size: var(--fs-3);
    white-space: nowrap;
}

/* At a bound (qty-stepper.js, and drawn so by the partial): aria-disabled, never disabled,
   so focus stays on it (audit 2026-11-14, P15). It takes the disabled tokens, whose text
   clears 4.5:1, rather than Bootstrap's faded opacity, keeps the ink frame of the block,
   and does not press. The hover and press states are listed so the legacy
   .btn[aria-disabled="true"]:hover rule, which is more specific than the bare one, does not
   fade it again. */
.app-qty-stepper-step[aria-disabled="true"],
.app-qty-stepper-step[aria-disabled="true"]:hover,
.app-qty-stepper-step[aria-disabled="true"]:active,
.app-qty-stepper-step:disabled {
    color: var(--disabled-ink);
    background-color: var(--disabled-bg);
    border-color: var(--ink);
    opacity: 1;
    cursor: default;
    transform: none;
}

/* Forced colours (Windows High Contrast) replace the disabled tokens with ButtonText on
   ButtonFace, so a button at its bound would look like one that presses. The browser gives a
   real :disabled button GrayText, but not an aria-disabled one, so the bound is drawn in
   GrayText here, text and frame both. The svg glyph is stroked in currentColor and follows. */
@media (forced-colors: active) {
    .app-qty-stepper-step[aria-disabled="true"],
    .app-qty-stepper-step[aria-disabled="true"]:hover,
    .app-qty-stepper-step[aria-disabled="true"]:active,
    .app-qty-stepper-step:disabled {
        color: GrayText;
        border-color: GrayText;
    }
}

/* A stepper that cannot change at all (Disabled): the count is the disabled field's. */
.app-qty-stepper-input:disabled {
    color: var(--disabled-ink);
    background-color: var(--disabled-bg);
}

@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .app-qty-stepper,
    .app-qty-stepper--sm {
        --qty-step: var(--touch-min);
    }

    /* 16px or more in a field, or iOS zooms the page when it takes focus. */
    .app-qty-stepper--sm .app-qty-stepper-input {
        font-size: 1rem;
    }
}

/* ── Quantity editor (Pages/Shared/_QuantityEditor.cshtml, QuantityEditorModel) ─────────
   A row's counts as small labelled number fields side by side, then one Save after them
   (audit SB9, SB10). The same at every width: the fields share one line, each label above its
   field, and Save follows the last field, wrapping under them only where the row is too narrow.
   docs/ui/components/quantity-editor.md has the API. */

.quantity-editor {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--sp-2);
    margin: 0;
}

/* A small flex basis, so in a narrow row the fields shrink (to their labels' width) before Save is
   wrapped onto a line of its own: a wrapping flex line breaks on the basis, not the minimum.
   It grows from that basis only as far as its fields reach (max-content: each field at its
   --input-w-qty cap), so in a wide container the space left over falls after Save, never
   between the last field and Save. */
.quantity-editor__fields {
    display: flex;
    flex: 1 1 10rem;
    gap: var(--sp-2);
    min-inline-size: 0;
    max-inline-size: max-content;
    margin: 0;
    padding: 0;
    border: 0;
}

.quantity-editor__field {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    gap: var(--sp-0);
    /* No min-inline-size: a flex item's automatic minimum is its min-content width, the wider of
       its label (which never wraps) and its input's minimum. So a field shrinks that far and no
       further, and "Available" cannot run into "Listed" on a screen whose font is wider.
       Otherwise at most --input-w-qty; the minimum wins over the cap. */
    max-inline-size: var(--input-w-qty);
}

/* A short label over its field, Title Case as written (no capitals transform, so "Available"
   stays narrower than its field). */
.quantity-editor__label {
    margin: 0;
    color: var(--ink-muted);
    font-size: var(--fs-2);
    font-weight: 700;
    line-height: var(--lh-tight);
    white-space: nowrap;
}

/* At least 3.25rem, room for four digits, which also counts in the field's minimum, so a field
   in a shrink-to-fit table cell is never narrower than that or its label. */
.quantity-editor__input {
    inline-size: 100%;
    min-inline-size: 3.25rem;
    font-variant-numeric: tabular-nums;
}

.quantity-editor__save {
    flex: 0 0 auto;
}

/* 44px wherever the pointer is not certainly a mouse, as the legacy touch layer reads it. */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .quantity-editor__input,
    .quantity-editor__save {
        min-block-size: var(--touch-min);
    }
}

/* ── Row actions (<app-row-actions>, TagHelpers/AppRowActionsTagHelper.cs) ──────────
   A table row's commands. docs/ui/components/row-actions.md has the API.

   Structure: .app-row-actions holds at most one visible button (.app-row-action, in a form of
   its own when it posts) and the kebab menu (.app-row-actions-menu: the toggle and a Bootstrap
   dropdown list). Both sit at the cell's end; in a cell too narrow for both the kebab wraps
   under the button, still at the end. Compact under a fine pointer from 992px; 44px targets
   with an 8px gap everywhere else (the touch block at the end). */

.app-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--sp-1);
    min-width: 0;
    max-width: 100%;
}

/* A post's own form adds no box of its own to the row or the menu. */
.app-row-actions-form {
    display: flex;
    min-width: 0;
    max-width: 100%;
    margin: 0;
}

/* The button's icon and label are one line, centred in the button however tall the touch
   rule makes it. Scoped to the component: a list row's action area is .app-row-action too
   (list-rows.css), and may hold a row's <app-row-actions>. */
:where(.app-row-actions) .app-row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-1h);
    max-width: 100%;
    text-align: center;
}

:where(.app-row-actions) .app-row-action > .bi {
    flex: none;
}

/* A label wraps between words when the cell is narrow, never inside one ("Retr y"), so the
   table gives the cell at least the longest word. */
.app-row-action-label {
    min-width: 0;
    overflow-wrap: break-word;
}

.app-row-actions-menu {
    display: inline-flex;
    flex: none;
}

/* The kebab: a square button holding only the icon, named for the row by aria-label. */
.app-row-actions-toggle {
    justify-content: center;
    min-inline-size: calc(var(--control-h) - var(--sp-2));
}

.app-row-actions-list {
    min-inline-size: 12rem;
    max-inline-size: min(20rem, calc(100vw - 2 * var(--sp-3)));
}

.app-row-actions-list > li > .app-row-actions-form {
    display: block;
}

.app-row-actions-item {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    white-space: normal;
    overflow-wrap: anywhere;
}

.app-row-actions-item > .bi {
    flex: none;
}

.app-row-actions-item--danger {
    color: var(--bad-ink);
}

.app-row-actions-item--danger:is(:hover, :focus) {
    color: var(--on-accent);
    background: var(--bad);
}

/* ── Touch ───────────────────────────────────────────────────────────────────────
   44px wherever the pointer is not certainly a mouse, as the legacy touch layer reads it, with
   8px between neighbouring targets (LS-AD11). */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .app-row-actions {
        gap: var(--sp-2);
    }

    .app-row-actions .app-row-action,
    .app-row-actions .app-row-actions-item {
        min-block-size: var(--touch-min);
    }

    .app-row-actions .app-row-actions-toggle {
        min-block-size: var(--touch-min);
        min-inline-size: var(--touch-min);
    }
}

/* Section navigation (area-nav): the trail and the tabs the layout draws above every page an area
   claims (_SectionNav, _Breadcrumbs, _SectionTabs). Docs: docs/ui/components/section-nav.md.

   The tab bar was a grid of equal columns in legacy/09 (removed; dead-css/area-nav.md): two to a
   row on a phone and two rows of half as many on a tablet, so long labels wrapped, a lone last tab
   spanned the row, and a two-tab section was two 600px slabs (audit SH7,
   SH8, AA5, PT13, SB20, LS-AD9, LS-PR16, LS-SW25). Now they are one row at every width, each tab as
   wide as its words; a row that does not fit scrolls sideways. A tab's own look (.section-tab)
   is still legacy/09's; these rules follow it in the bundle. */

/* The trail, then the tabs. The single column never grows past the page, so a long row of tabs
   scrolls inside it rather than widening the page. */
.section-nav {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
}

/* ---- Tabs ---- */

/* One row, never wrapping: the ink shows through the hairline gaps between tabs, and the box is
   only as wide as its tabs. Too many to fit scrolls sideways, snapping a tab to the middle; the edge
   that hides more tabs fades (data-overflow, set by section-tabs.js, which also scrolls the open
   tab into view), and the thin scrollbar says the same without the fade. */
.section-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--edge-w-hair);
    inline-size: fit-content;
    max-inline-size: 100%;
    min-inline-size: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: var(--sp-5);
    scrollbar-width: thin;
    scrollbar-color: var(--ink-muted) transparent;
    background: var(--ink);
    border: var(--edge-w) solid var(--ink);
}

.section-tabs[data-overflow="end"] {
    mask-image: linear-gradient(to right, #000 calc(100% - var(--sp-7)), rgba(0, 0, 0, .2));
}

.section-tabs[data-overflow="start"] {
    mask-image: linear-gradient(to left, #000 calc(100% - var(--sp-7)), rgba(0, 0, 0, .2));
}

.section-tabs[data-overflow="start end"] {
    mask-image: linear-gradient(to right, rgba(0, 0, 0, .2), #000 var(--sp-7), #000 calc(100% - var(--sp-7)), rgba(0, 0, 0, .2));
}

/* Each tab is as wide as its words, on one line, its icon beside them. */
.section-tab {
    flex: 0 0 auto;
    justify-content: center;
    min-width: auto;
    white-space: nowrap;
    scroll-snap-align: center;
}

.section-tab > span {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The site's 3px ring, drawn inside the tab: the row scrolls sideways, so a ring outside the tab
   would be clipped at the row's edges. It was legacy/09's 2px edge (final pass, leftovers). */
.section-tab:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-inset);
}

/* From 992 a tab is capped at 15rem (--toc-w), so no label makes a slab. */
@media (min-width: 992px) {
    .section-tab {
        max-inline-size: var(--toc-w);
    }
}

/* Below 360 a tab's sides narrow from legacy/09's .8rem to .5rem, so a short row such as Trading's
   three tabs (308px at .8rem) fits the 292px row at 320 instead of opening scrolled and faded. */
@media (max-width: 359.98px) {
    .section-tab {
        padding-inline: var(--sp-2);
    }
}

/* 44px targets on a phone, a tablet, or under a coarse pointer. */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .section-tab {
        min-block-size: var(--touch-min);
    }
}

/* ---- Trail ---- */

/* Below 576 the trail folds to one link to the page's parent, 44px tall: a four-step trail took
   three 44px rows of a phone before the title (audit CT15). Both rules name the trail too
   (0,2,0): legacy/10-admin-touch.css sets `.app-breadcrumb a` (0,1,1) to inline-flex under a
   coarse pointer and below 992, which would otherwise show the parent link beside the trail. */
.app-breadcrumb .app-breadcrumb-up {
    display: none;
}

/* Each step's link is 44px wide as well as tall (legacy/10 makes it 44px tall) on a tablet or
   under a coarse pointer: a one-word step such as "Decks" (41px) or "Trade" (38px) was short of
   it. The word is centred in the box, so a short step keeps an even space to the separators
   (final pass, shell-nav). legacy/10's `.app-breadcrumb a` makes it the inline-flex box this centres in. */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .app-breadcrumb ol a {
        justify-content: center;
        min-inline-size: var(--touch-min);
    }
}

@media (max-width: 575.98px) {
    .app-breadcrumb ol {
        display: none;
    }

    .app-breadcrumb .app-breadcrumb-up {
        display: inline-flex;
        align-items: center;
        gap: var(--sp-1);
        min-block-size: var(--touch-min);
        font-size: var(--fs-3);
        font-weight: 700;
        overflow-wrap: anywhere;
    }
}

/* ── Segmented control (<app-segmented>, TagHelpers/AppSegmentedTagHelper.cs) ─────
   One strip of options, the current one filled in the brand yellow. The fill alone is not
   enough: yellow on white is under 3:1, so the current option also carries an ink bar
   along its bottom edge (in --on-brand, which is ink on yellow in both themes). The bar
   is a shape, so the state is not told by colour alone (audit CC16, WCAG 1.4.1, 1.4.11).

   Options are as wide as their text. A strip too long for its column scrolls inside
   itself; .app-segmented--phone-full shares a phone's width between the options instead.
   The focus ring is the site's ring drawn inset (--focus-inset), so the strip's border and
   its scrolling never clip it (audit AY6). Docs: docs/ui/components/segmented.md. */

.app-segmented {
    min-inline-size: 0;
    max-inline-size: 100%;
    margin: 0;
    padding: 0;
    border: 0;
}

/* Bootstrap floats a legend and sets it at heading size; this one is a field label. */
.app-segmented-legend {
    float: none;
    inline-size: auto;
    margin: 0 0 var(--sp-1h);
    padding: 0;
    font-family: var(--font-display);
    font-size: var(--fs-3);
    font-weight: 700;
    line-height: var(--lh-tight);
}

.app-segmented-track {
    position: relative;
    display: inline-flex;
    max-inline-size: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    vertical-align: middle;
    background: var(--surface);
    border: var(--edge-w) solid var(--ink);
    border-radius: var(--radius);
}

/* A radio's option: the radio and its label, the radio hidden by the clip pattern inside
   it, so it keeps its place in the form and the tab order and takes no room. */
.app-segmented-item {
    position: relative;
    display: flex;
    flex: 0 0 auto;
}

.app-segmented-input {
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: 0;
    inline-size: 1px;
    block-size: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
    opacity: 0;
}

.app-segmented-option {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: var(--sp-1h);
    min-block-size: var(--control-h);
    margin: 0;
    padding: var(--sp-1h) var(--sp-3);
    font-family: var(--font-display);
    font-size: var(--fs-3);
    font-weight: 700;
    line-height: var(--lh-tight);
    color: var(--ink);
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    background: transparent;
    border: 0;
    border-inline-start: var(--edge-w-hair) solid var(--ink);
    border-radius: var(--radius);
    appearance: none;
}

.app-segmented-item:first-child > .app-segmented-option,
.app-segmented-track > .app-segmented-option:first-child {
    border-inline-start: 0;
}

.app-segmented-option:hover {
    color: var(--ink);
    background: var(--surface-sunken);
}

.app-segmented-input:checked + .app-segmented-option,
.app-segmented-option[aria-current="page"],
.app-segmented-option[aria-selected="true"] {
    color: var(--on-brand);
    background: var(--brand-primary);
    box-shadow: inset 0 calc(-1 * var(--edge-w-strong)) 0 var(--on-brand);
}

/* The ring inside the option. On the yellow it is the yellow's own ink, which is dark in
   both themes, where the theme's ink would be cream on yellow in the dark one. */
.app-segmented-option:focus-visible,
.app-segmented-input:focus-visible + .app-segmented-option {
    outline: var(--focus-ring);
    outline-offset: var(--focus-inset);
}

.app-segmented-input:checked:focus-visible + .app-segmented-option,
.app-segmented-option[aria-current="page"]:focus-visible,
.app-segmented-option[aria-selected="true"]:focus-visible {
    outline-color: var(--on-brand);
}

/* The current page in nav mode with no link to itself: nothing to click. */
.app-segmented-option[aria-current="page"]:not([href]) {
    cursor: default;
}

/* An option that does not apply: greyed, and announced so by its disabled state (a disabled
   radio or tab, or a nav option's role="link" aria-disabled="true"). */
.app-segmented-input:disabled + .app-segmented-option,
.app-segmented-option:disabled,
.app-segmented-option[aria-disabled="true"] {
    color: var(--disabled-ink);
    background: var(--disabled-bg);
    cursor: not-allowed;
}

/* The count beside an option's text: small, boxed, its digits all one width. */
.app-segmented-count {
    display: inline-block;
    min-inline-size: 1.6em;
    padding: 0 var(--sp-1);
    font-family: var(--font-body);
    font-size: var(--fs-1);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: var(--lh-body);
    text-align: center;
    border: var(--edge-w-hair) solid currentColor;
}

/* A tab panel that takes the focus shows the ring around itself; nothing else to draw. */
.app-segmented-panel:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

/* A strip that scrolls fades the edge that hides more options (data-overflow, set by
   segmented.js, which also scrolls the current option into view), as the section tabs do; the
   thin scrollbar says the same without the fade. Before, a profile's views ran off a phone's
   edge with no cue that Wishlist and Decks were there (unit mig-collectors). */
.app-segmented-track[data-overflow="end"] {
    mask-image: linear-gradient(to right, #000 calc(100% - var(--sp-7)), rgba(0, 0, 0, .2));
}

.app-segmented-track[data-overflow="start"] {
    mask-image: linear-gradient(to left, #000 calc(100% - var(--sp-7)), rgba(0, 0, 0, .2));
}

.app-segmented-track[data-overflow="start end"] {
    mask-image: linear-gradient(to right, rgba(0, 0, 0, .2), #000 var(--sp-7), #000 calc(100% - var(--sp-7)), rgba(0, 0, 0, .2));
}

/* ── The view variant: switching views, quieter than a choice ─────────────────────
   No box: a row of options over a hairline, the current one in ink text with a 3px ink
   underline (ink on paper clears 3:1 in both themes), the others muted. One row that
   scrolls on a phone, never wrapping. */
.app-segmented--view .app-segmented-track {
    display: flex;
    gap: var(--sp-1);
    background: transparent;
    border: 0;
    border-block-end: var(--edge-w-hair) solid var(--rule-soft);
}

.app-segmented--view .app-segmented-option {
    color: var(--ink-muted);
    border-inline-start: 0;
}

.app-segmented--view .app-segmented-option:hover {
    color: var(--ink);
    background: transparent;
    box-shadow: inset 0 calc(-1 * var(--edge-w-strong)) 0 var(--rule-soft);
}

.app-segmented--view .app-segmented-input:checked + .app-segmented-option,
.app-segmented--view .app-segmented-option[aria-current="page"],
.app-segmented--view .app-segmented-option[aria-selected="true"] {
    color: var(--ink);
    background: transparent;
    box-shadow: inset 0 calc(-1 * var(--edge-w-strong)) 0 var(--ink);
}

.app-segmented--view .app-segmented-input:checked:focus-visible + .app-segmented-option,
.app-segmented--view .app-segmented-option[aria-current="page"]:focus-visible,
.app-segmented--view .app-segmented-option[aria-selected="true"]:focus-visible {
    outline-color: var(--ink);
}

.app-segmented--view .app-segmented-input:disabled + .app-segmented-option,
.app-segmented--view .app-segmented-option:disabled,
.app-segmented--view .app-segmented-option[aria-disabled="true"] {
    color: var(--disabled-ink);
    background: var(--disabled-bg);
    box-shadow: none;
}

/* ── A phone's full width, shared ───────────────────────────────────────────────
   Shared equally, but never below a touch target: options that would be narrower than
   44px keep 44px and the strip scrolls inside itself instead. */
@media (max-width: 575.98px) {
    .app-segmented--phone-full .app-segmented-track {
        display: flex;
        inline-size: 100%;
    }

    .app-segmented--phone-full .app-segmented-item,
    .app-segmented--phone-full .app-segmented-option {
        flex: 1 1 0;
        min-inline-size: var(--touch-min);
    }

    .app-segmented--phone-full .app-segmented-option {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .app-segmented--phone-full .app-segmented-item > .app-segmented-option {
        inline-size: 100%;
    }
}

/* ── Touch: 44px each way unless it is certainly a mouse (the touch layer's test) ──
   This file comes after the legacy touch layer, so it needs no !important. */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .app-segmented-option {
        min-block-size: var(--touch-min);
        min-inline-size: var(--touch-min);
    }
}

/* ── Forced colours (Windows High Contrast) ─────────────────────────────────────
   The forced palette drops box-shadow and replaces the yellow, so the current option's bar
   and underline would vanish and it would look like the others. Draw it in the system's
   Highlight pair instead, its ring in HighlightText, and every disabled option in GrayText.
   The browser greys a disabled button (a tab) itself, but in radio mode what shows is the
   label, not the hidden input, and a nav option is a link: neither is greyed for us, and the
   forced palette replaces --disabled-ink and --disabled-bg, so without this rule a disabled
   option would be drawn like an enabled one. */
@media (forced-colors: active) {
    .app-segmented-input:checked + .app-segmented-option,
    .app-segmented-option[aria-current="page"],
    .app-segmented-option[aria-selected="true"],
    .app-segmented--view .app-segmented-input:checked + .app-segmented-option,
    .app-segmented--view .app-segmented-option[aria-current="page"],
    .app-segmented--view .app-segmented-option[aria-selected="true"] {
        forced-color-adjust: none;
        color: HighlightText;
        background: Highlight;
    }

    .app-segmented-input:checked:focus-visible + .app-segmented-option,
    .app-segmented-option[aria-current="page"]:focus-visible,
    .app-segmented-option[aria-selected="true"]:focus-visible,
    .app-segmented--view .app-segmented-input:checked:focus-visible + .app-segmented-option,
    .app-segmented--view .app-segmented-option[aria-current="page"]:focus-visible,
    .app-segmented--view .app-segmented-option[aria-selected="true"]:focus-visible {
        outline-color: HighlightText;
    }

    .app-segmented-input:disabled + .app-segmented-option,
    .app-segmented-option:disabled,
    .app-segmented-option[aria-disabled="true"],
    .app-segmented--view .app-segmented-input:disabled + .app-segmented-option,
    .app-segmented--view .app-segmented-option:disabled,
    .app-segmented--view .app-segmented-option[aria-disabled="true"] {
        color: GrayText;
    }
}

/* ── Selection bar (_SelectionBar, portfolio-select.js) ──────────────────────
   The Select Cards bar: one row at the foot of the screen (the count, Review,
   Apply), with the Do and target fields in that row from 992px, so a desktop
   bar is one line of at most --sticky-bar-max (audit PF1). Review opens the
   sheet above the row: every pick, Select All, Clear Selection, and below
   992px the fields. The bar is sticky in the page's flow, after the grid, so
   at the end of the page it settles there and never covers the last row; its
   width is the content column's at every size. The legacy .bulk-bar, .bulk-
   review and .bulk-drop rules are not used by it (docs/ui/dead-css/
   selection-bar.md). Targets are 44px below 992px and under any pointer that
   is not a fine mouse, the same test as the legacy touch layer. */
.selection-bar {
    position: sticky;
    bottom: var(--sp-3);
    z-index: var(--z-sticky);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    margin-block: var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    background: var(--surface);
    color: var(--ink);
    border: var(--edge-w) solid var(--ink);
    box-shadow: var(--shadow-md);
}

/* Open, the bar never grows past the screen: on a short phone with a long
   list it scrolls inside itself, the row included. */
.selection-bar.is-open {
    max-height: calc(100dvh - 2 * var(--sp-3));
    overflow-y: auto;
}

/* Room under the focus while the bar is on screen, so a tile or field reached
   with Tab is never behind it. */
html:has(.selection-bar:not([hidden])) {
    scroll-padding-block-end: calc(var(--sticky-bar-max) + var(--sp-6));
}

/* ── The row ── */
.selection-bar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2) var(--sp-3);
    min-width: 0;
}

.selection-bar-count {
    flex: 1 1 5rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0;
    line-height: var(--lh-tight);
}

.selection-bar-count-text {
    font-size: var(--fs-3);
    font-weight: 700;
}

/* What Apply will do, on the phone row, where the fields are in the sheet. */
.selection-bar-intent {
    overflow: hidden;
    margin-top: var(--sp-0);
    color: var(--ink-muted);
    font-size: var(--fs-2);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selection-bar-intent:empty {
    display: none;
}

/* ", 3 on this page": in sight from 576px; below, read but not shown, so the
   count stays one short line beside Review and Apply, which keep their labels
   whole on a 320px screen. */
@media (max-width: 575.98px) {
    .selection-bar {
        padding-inline: var(--sp-2);
    }

    .selection-bar-row {
        column-gap: var(--sp-2);
    }

    .selection-bar-button {
        padding-inline: var(--sp-2h);
    }

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

.selection-bar-actions {
    flex: none;
    display: flex;
    gap: var(--sp-2);
    margin-inline-start: auto;
}

.selection-bar-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-1);
    white-space: nowrap;
}

.selection-bar-review-icon {
    transition: transform .15s ease;
}

.selection-bar.is-open .selection-bar-review-icon {
    transform: rotate(180deg);
}

/* ── The fields: in the sheet below 992px, in the row from 992px ── */
.selection-bar-fields {
    display: none;
}

.selection-bar.is-open .selection-bar-fields {
    order: -1;
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
    gap: var(--sp-2) var(--sp-3);
    min-width: 0;
    padding-bottom: var(--sp-2);
    border-bottom: var(--edge-w-hair) solid var(--rule-soft);
}

.selection-bar-field {
    display: flex;
    flex-direction: column;
    gap: var(--sp-0);
    min-width: 0;
}

.selection-bar-label {
    font-size: var(--fs-3);
    font-weight: 600;
}

.selection-bar-select {
    min-width: 0;
}

@media (min-width: 992px) {
    .selection-bar-count {
        flex: 0 1 auto;
        max-width: 11rem;
    }

    .selection-bar-intent {
        display: none;
    }

    .selection-bar-fields,
    .selection-bar.is-open .selection-bar-fields {
        order: 0;
        flex: 1 1 0;
        display: flex;
        min-width: 0;
        flex-wrap: nowrap;
        align-items: center;
        gap: var(--sp-3);
        padding-bottom: 0;
        border-bottom: 0;
    }

    /* The label and select groups keep their own width and sit together after the count;
       only Review and Apply go to the far end. Grown to fill the row, each group had a wide
       hole after its select, and the bar read as scattered fields. */
    .selection-bar-field {
        flex: 0 1 auto;
        min-width: 0;
        flex-direction: row;
        align-items: center;
        gap: var(--sp-2);
    }

    .selection-bar-label {
        flex: none;
        white-space: nowrap;
    }

    /* As wide as its longest choice, up to --field-w-md, and giving way to --field-w-xs where
       the row is short, never wrapping it. */
    .selection-bar-select {
        flex: 0 1 auto;
        width: auto;
        min-width: var(--field-w-xs);
        max-width: var(--field-w-md);
    }
}

@media (min-width: 1200px) {
    .selection-bar-count {
        max-width: 16rem;
    }
}

/* ── The Review sheet ── */
.selection-bar-sheet {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    min-width: 0;
    padding-bottom: var(--sp-2);
    border-bottom: var(--edge-w-hair) solid var(--rule-soft);
}

.selection-bar-sheet-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
}

.selection-bar-sheet-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--fs-h3);
    font-weight: 800;
}

.selection-bar-sheet-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
}

.selection-bar-tool {
    font-size: var(--fs-3);
    font-weight: 600;
}

/* Clear Selection deselects; it removes nothing, so it is a quiet text button. */
.selection-bar-clear {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: .2em;
}

.selection-bar-clear[aria-disabled="true"] {
    color: var(--disabled-ink);
    text-decoration: none;
    cursor: default;
}

.selection-bar-empty {
    margin: 0;
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

.selection-bar-list {
    display: grid;
    gap: var(--sp-1);
    max-height: 40vh;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.selection-bar-list:empty {
    display: none;
}

/* One pick: art, name, counter, remove. On a phone the name has its own line
   beside the art and the controls sit under it, so a long name is not cut to a
   few letters; from 576px they share one line and only the name shrinks. */
.selection-bar-item {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr) auto;
    grid-template-areas:
        "art name name"
        "art copies remove";
    align-items: center;
    gap: var(--sp-1) var(--sp-2);
    padding: var(--sp-1) var(--sp-1h);
    border: var(--edge-w-hair) solid var(--ink);
    background: var(--surface);
}

@media (min-width: 576px) {
    .selection-bar-item {
        grid-template-columns: 2.25rem minmax(0, 1fr) auto auto;
        grid-template-areas: "art name copies remove";
    }
}

.selection-bar-art {
    grid-area: art;
    width: 2.25rem;
    height: 3.1rem;
    object-fit: contain;
    background: var(--surface-sunken);
}

.selection-bar-name {
    grid-area: name;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.selection-bar-copies {
    grid-area: copies;
    justify-self: start;
    display: inline-flex;
    align-items: stretch;
    border: var(--edge-w-hair) solid var(--ink);
    font-size: var(--fs-3);
}

.selection-bar-copies--one {
    padding: var(--sp-1) var(--sp-2);
    border: 0;
    color: var(--ink-muted);
    white-space: nowrap;
}

.selection-bar-step,
.selection-bar-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--sp-6);
    min-height: var(--sp-6);
    padding: 0;
    cursor: pointer;
}

.selection-bar-step {
    border: 0;
    background: var(--brand-primary);
    color: var(--on-accent);
}

/* At a bound. aria-disabled, not disabled, so a button pressed up to its bound keeps focus. */
.selection-bar-step[aria-disabled="true"] {
    background: var(--disabled-bg);
    color: var(--disabled-ink);
    cursor: default;
}

/* 16px, because a phone zooms the page into any field set smaller. */
.selection-bar-input {
    width: 2.6rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 800;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}

.selection-bar-input::-webkit-outer-spin-button,
.selection-bar-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.selection-bar-of {
    align-self: center;
    padding-right: var(--sp-1h);
    color: var(--ink-muted);
    font-size: var(--fs-1);
    font-weight: 700;
    white-space: nowrap;
}

.selection-bar-remove {
    grid-area: remove;
    border: var(--edge-w-hair) solid var(--ink);
    background: var(--surface);
    color: var(--ink);
}

.selection-bar-step:focus-visible,
.selection-bar-remove:focus-visible,
.selection-bar-input:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

/* ── Drop On (docs/CollectionMovePlan.md, Phase 5) ──
   Desktop sugar: only with a fine pointer from 992px, and only while Review is
   open or a drag is on, so the closed bar stays one line. Touch has the Do list. */
.selection-bar-drop {
    display: none;
}

@media (hover: hover) and (pointer: fine) and (min-width: 992px) {
    .selection-bar.is-open .selection-bar-drop,
    .is-dragging .selection-bar-drop {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--sp-2);
        min-width: 0;
    }
}

.selection-bar-drop-label {
    font-size: var(--fs-3);
    font-weight: 600;
}

.selection-bar-drop-chip {
    max-width: var(--card-min);
    overflow: hidden;
    padding: var(--sp-1) var(--sp-2);
    font-size: var(--fs-3);
    font-weight: 600;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
    background: var(--surface);
    border: var(--edge-w) dashed var(--ink);
    border-radius: var(--radius);
}

.selection-bar-drop-chip:disabled {
    color: var(--disabled-ink);
    background: var(--disabled-bg);
}

.selection-bar-drop-chip.is-over,
.selection-bar-drop-chip:not(:disabled):hover {
    color: var(--on-accent);
    background: var(--brand-primary);
    border-style: solid;
}

/* What follows the pointer while dragging: how many cards are being carried. */
.selection-bar-drag-ghost {
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-toast);
    padding: var(--sp-1) var(--sp-2);
    font-size: var(--fs-3);
    font-weight: 700;
    color: var(--on-accent);
    pointer-events: none;
    background: var(--brand-primary);
    border: var(--edge-w) solid var(--ink);
}

/* ── Touch: 44px targets below 992px and under any pointer that is not a fine mouse ── */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .selection-bar-button,
    .selection-bar-tool,
    .selection-bar-select {
        min-height: var(--touch-min);
    }

    .selection-bar-step,
    .selection-bar-remove {
        width: var(--touch-min);
        min-height: var(--touch-min);
    }

    .selection-bar-drop-chip {
        min-height: var(--touch-min);
    }
}

@media (prefers-reduced-motion: reduce) {
    .selection-bar-review-icon {
        transition: none;
    }
}

/* ── Store stock (_StoreSelectionBar, store-stock-select.js) ──────────────────
   Store Inventory's bulk bar: the portfolio bar's look, its row only (the
   count and Preview Changes, then Do and the number; one line from 992px). The
   tools (Select All on This Page, Select All Matching, Clear Selection) are a
   line of their own before it, in the page's flow, joined to the form through
   form=. The bar sits after the table and sticks to the foot of the screen only
   while something is selected (is-active, set by the script), so an idle bar
   never covers a row, and a phone's sticky bar is two short lines. */
.selection-bar--store:not(.is-active) {
    position: static;
    box-shadow: none;
}

.selection-bar--store {
    margin-block-start: var(--sp-2);
}

/* Room under the focus while the store bar sticks (WCAG 2.4.11). Below 992px
   its row wraps to two lines (Do and the number under the count), about 139px
   with 44px targets, so the shared --sticky-bar-max room would leave a row box
   reached with Tab behind it; --store-bar-max is that two-line height. From
   992px the bar is one line again and the shared room fits. */
html:has(.selection-bar--store.is-active) {
    --store-bar-max: 9rem;
    scroll-padding-block-end: calc(var(--store-bar-max) + var(--sp-6));
}

/* With Change Sales Channels' boxes shown (unit U18) the bar below 992px is a
   line taller again, about 219px: the room under the focus grows with it. */
@media (max-width: 991.98px) {
    html:has(.selection-bar--store.is-active .selection-bar-channels:not([hidden])) {
        --store-bar-max: 14rem;
    }
}

@media (min-width: 992px) {
    html:has(.selection-bar--store.is-active) {
        --store-bar-max: var(--sticky-bar-max);
    }
}

.selection-bar-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2) var(--sp-3);
    min-width: 0;
    margin-block-start: var(--sp-3);
}

.selection-bar-tools > .app-check {
    margin: 0;
}

.selection-bar--store .selection-bar-fields {
    order: 1;
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--sp-2) var(--sp-3);
    min-width: 0;
}

.selection-bar--store .selection-bar-field:first-child {
    flex: 1 1 8rem;
}

.selection-bar-number {
    inline-size: 6rem;
}

/* Change Sales Channels' choice (unit U18): the shared channel picker as one
   of the bar's fields, its boxes side by side under "Sell On". The group is an
   inline-size container (check.css), so it takes no width from its boxes: in
   the field's row (from 992px) it is grown to the field's width, and the field
   has a basis of its own, or the group shrank to nothing and its boxes stacked
   down the screen. Shown only while that action is chosen (shown-when.js). */
.selection-bar--store .selection-bar-channels {
    flex: 1 1 12rem;
}

.selection-bar-channels .app-check-group {
    flex: 1 1 auto;
    min-width: 0;
}

/* "Sell On" reads as the bar's other labels (Do, Number). */
.selection-bar-channels .app-check-group__legend {
    margin-block-end: 0;
    font-size: var(--fs-3);
    font-weight: 600;
}

/* Two or three short names: one wrapping line, as a chip row, never columns
   spread across a wide bar. */
.selection-bar-channels .app-check-group__items {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--sp-4);
}

@media (min-width: 992px) {
    .selection-bar--store .selection-bar-fields {
        order: 0;
        flex: 1 1 0;
        flex-wrap: nowrap;
        align-items: center;
        gap: var(--sp-3);
    }

    .selection-bar--store .selection-bar-field:first-child {
        flex: 0 1 auto;
    }
}

@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .selection-bar-number,
    .selection-bar-tools .app-check__row {
        min-height: var(--touch-min);
    }

    .selection-bar-tools .app-check__row {
        align-items: center;
    }
}

/* The bulk preview's Confirm once pressed (store-stock-select.js): aria-disabled, not disabled,
   so it keeps the focus while the change is applied. The legacy .btn[aria-disabled="true"] rule
   greys it; forced colours drop those tokens, so it is drawn in GrayText there as a real
   :disabled button would be. */
@media (forced-colors: active) {
    [data-bulk-confirm] .btn[aria-disabled="true"] {
        color: GrayText;
        border-color: GrayText;
    }
}

/* ── App shell and footer (unit app-shell) ───────────────────────────────────
   The shell of every _Layout page: _Layout.cshtml, the PageWidth resolver
   (Pages/Shared/PageWidth.cs) and the footer partial (Pages/Shared/_AppFooter.cshtml).
   The guide is docs/ui/layout.md and the sample is /Admin/StyleGuide/Shell.
   legacy/02-shell-panels.css keeps the shell's padding, columns and gap, and
   legacy/08-catalogue-portfolio.css its phone padding; this file sets its rows and widths.

   Three rows, header, main and footer, and at least the screen tall, so the footer
   sits at the bottom of a short page (audit LS-SH7, LS-AD13, LS-SW22). A grid with
   rows, never a flex column. Each row is placed by name of its element, so a row
   whose element is not drawn (the header inside the Shopify admin, the scanner's
   hidden footer) leaves the others where they are. */
.app-shell {
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-rows: auto 1fr auto;
}

/* Widths. The header and footer always span the wide tier, at most --shell-wide and
   never more than the screen less the gutters, so the brand and the links stay put
   from page to page. main (the trail, the tabs and the page) follows the page's tier:
   --app-max-width by default, the wide tier with .app-shell--wide (PageWidth). Below
   about 1500px both are the whole width less the gutters, as before. */
.app-shell > .app-header,
.app-shell > .app-footer,
.app-shell > main {
    inline-size: 100%;
    max-inline-size: var(--shell-wide);
    margin-inline: auto;
}

.app-shell > .app-header {
    grid-row: 1;
}

.app-shell > main {
    grid-row: 2;
    max-inline-size: var(--app-max-width);
}

.app-shell--wide > main {
    max-inline-size: var(--shell-wide);
}

.app-shell > .app-footer {
    grid-row: 3;
}

/* Inside the Shopify admin the header is not drawn, so the shell has two rows, main and
   the footer, and no empty first row puts a gap above the page. The admin's sidebar
   element (_EmbeddedAppNav's s-app-nav) is a child of the shell too, but App Bridge
   only reads its links and draws them in the admin's own navigation; it renders no box
   here. Until App Bridge has upgraded it, it is an unknown element whose links are
   plain text, and a grid would place it in an implicit row under the footer, so it
   is taken out of the layout outright. */
.app-shell:not(:has(> .app-header)) {
    grid-template-rows: 1fr auto;
}

.app-shell > s-app-nav {
    display: none;
}

.app-shell:not(:has(> .app-header)) > main {
    grid-row: 1;
}

.app-shell:not(:has(> .app-header)) > .app-footer {
    grid-row: 2;
}

/* The phone scanner hides the footer while it locks the page to the screen, so its
   row goes too, and with it the gap above it (card-scan.js sizes the scanner to the
   space left below its top edge). */
html.scan-locked .app-shell {
    grid-template-rows: auto 1fr;
}

/* The auth screens hide the header and footer and centre one panel in the screen
   (login.css); their empty rows take no gap. */
body.login-body .app-shell {
    row-gap: 0;
}

/* ── Footer ──────────────────────────────────────────────────────────────────
   The links on one line (wrapping when they must), then the version. The row itself
   is the legacy .app-footer rule (legacy/04-controls-tables.css): a panel, a wrapping
   flex row, centred, so the version sits at the right of the links from a tablet up
   and on its own line under them on a phone. */
.app-footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 var(--sp-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* A member's five links do not fit one row on a small phone, and left to wrap they left
   Terms alone on a second row at 375. Below 576 a list of five breaks after its third
   link, so it always reads Docs, Contact, Feedback over Privacy, Terms: an empty
   full-width item (::before) is ordered between them. It stays one flex row with one
   gap, not columns: a grid's first column was as wide as Privacy, so the gap after Docs
   was half as wide again as the others (final pass, shell-nav). The signed-out four
   still fit one row. */
@media not all and (min-width: 576px) {
    .app-footer-links:has(> li:nth-child(5))::before {
        content: "";
        flex-basis: 100%;
        order: 1;
    }

    .app-footer-links:has(> li:nth-child(5)) > li:nth-child(n + 4) {
        order: 2;
    }
}

.app-footer-link {
    display: inline-flex;
    align-items: center;
    padding-block: var(--sp-1);
    color: var(--ink);
    font-size: var(--fs-3);
    font-weight: 600;
    text-decoration: none;
}

.app-footer-link:hover {
    text-decoration: underline;
    text-underline-offset: .2em;
}

.app-footer-link:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

.app-footer-version {
    margin: 0;
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

/* On a phone the version always takes a line of its own, at the left under the links.
   Left to wrap by itself it stayed beside a member's two-row grid at 375 (centred
   between its rows) but dropped under it at 320, so the two phone widths disagreed. */
@media not all and (min-width: 576px) {
    .app-footer-version {
        flex-basis: 100%;
    }
}

/* The current page's link (aria-current, set by _AppFooter): a heavier word with a
   thick underline, so a page whose header has no link to it at this width (Contact
   below 768, signed out) still shows where the reader is, by shape, not colour. */
.app-footer-link[aria-current] {
    font-weight: 800;
    text-decoration: underline;
    text-decoration-thickness: var(--edge-w-strong);
    text-underline-offset: .25em;
}

/* 44px targets below 992px and on any screen without a fine pointer that hovers
   (the touch layer's test). Every word gets the same padding at each side, so the
   space between two words is the same everywhere: Docs (34px) is 46px with it, and
   no box is wider than its word plus that padding. The minimum stays as a floor
   for a font that draws narrower. Before, a 44px box with the word at its left put
   a wider gap after Docs than after the other words (final pass, shell-nav). The
   list is pulled out by that padding, so the first word still lines up with the
   panel's edge. */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .app-footer-links {
        column-gap: var(--sp-2);
        margin-inline: calc(-1 * var(--sp-1h));
    }

    .app-footer-link {
        justify-content: center;
        min-block-size: var(--touch-min);
        min-inline-size: var(--touch-min);
        padding-block: 0;
        padding-inline: var(--sp-1h);
    }

    /* The skip link, the first stop on every _Layout page, is a target too (42px from
       legacy/01's padding). */
    .skip-link {
        display: inline-flex;
        align-items: center;
        min-block-size: var(--touch-min);
    }
}

/* ── Skip link (final pass 2026-11-18) ─────────────────────────────────────────
   "Skip To Main Content", the first link of every website layout (_Layout,
   _AuthLayout, _BuylistLayout). Its box and colours are legacy/01-tokens-base.css
   (.skip-link); this adds two things on top. It is at least a touch target tall,
   at every size: it was 42px. Focused, it sits flush with the top of the screen,
   so its ring is drawn inside it (--focus-inset): outside, the top of the ring
   fell above the viewport and was cut off. The ring is the link's own text
   colour (--on-brand), so it shows on the yellow in both themes, where the
   site's ink ring turns pale in the dark one. Usage: <a class="skip-link"
   href="#main-content">Skip To Main Content</a> as the first child of body. */
.skip-link {
    display: inline-flex;
    align-items: center;
    min-block-size: var(--touch-min);
}

.skip-link:focus-visible {
    outline: var(--edge-w-strong) solid var(--on-brand);
    outline-offset: var(--focus-inset);
}

/* ── Stats: stat-card and app-stat-grid (unit stats) ─────────────────────────
   The tag helpers are TagHelpers/StatCardTagHelper.cs and AppStatGridTagHelper.cs,
   the guide is docs/ui/components/stats.md and the samples are
   /Admin/StyleGuide/Stats. The panel and tile chrome (.stat-card, .stat-tile,
   .stat-tile--hero) stays in legacy/03-charts-tiles.css; this file sets the one
   label style every variant shares, the fact and hero variants, the unit, the
   delta, the empty value, the whole-tile link and the grid. */

/* A panel tile stretched to its row's height keeps its parts at the top, as a
   tile does, rather than spreading them down the extra space. */
.stat-card {
    align-content: start;
}

/* ── The parts ──────────────────────────────────────────────────────────────
   One eyebrow label for every labelled number (audit CC14): small caps-tracked
   uppercase, wrapping in balanced lines rather than leaving one word alone. */
.stat-label {
    font-size: var(--fs-2);
    line-height: var(--lh-tight);
    letter-spacing: var(--tracking-caps);
    text-wrap: balance;
    overflow-wrap: anywhere;
}

/* A long figure breaks rather than widening its tile; the unit is joined to it
   by a no-break space, so the amount never splits from its unit. */
.stat-value {
    line-height: var(--lh-tight);
    overflow-wrap: anywhere;
}

/* The unit is drawn small after the value but never below --fs-1, the
   smallest label size: .55em of a tile figure is about 10px, of a fact about 8px. */
.stat-unit {
    font-size: max(.55em, var(--fs-1));
    font-weight: 700;
    letter-spacing: 0;
    color: var(--ink-muted);
}

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

/* ── Delta ──────────────────────────────────────────────────────────────────
   The arrow, the sign and the hidden "Up" or "Down" carry the direction; the
   colour only repeats it. */
.stat-delta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: var(--sp-1);
    font-size: var(--fs-3);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ink-muted);
}

.stat-delta--up { color: var(--ok-ink); }
.stat-delta--down { color: var(--bad-ink); }

.stat-delta-amount {
    white-space: nowrap;
}

.stat-delta-window {
    font-weight: 400;
    color: var(--ink-muted);
}

/* On the yellow fill the coloured inks are too light in the dark theme; the
   arrow and sign still tell the direction. */
.stat-tile--hero .stat-delta,
.stat-tile--hero .stat-delta-window,
.stat-tile--hero .stat-unit {
    color: var(--on-accent);
}

/* ── fact ───────────────────────────────────────────────────────────────────
   The compact figure under a headline (the old .value-hero-facts cell): a
   small label over a bold figure. Alone it has a hairline box; in a fact grid
   the grid draws the hairlines. */
.stat-fact {
    display: grid;
    gap: var(--sp-0);
    align-content: start;
    padding: var(--sp-1h) var(--sp-3);
    border: var(--edge-w-hair) solid var(--ink);
    background: var(--surface);
    color: var(--ink);
}

.stat-fact .stat-label {
    font-size: var(--fs-1);
}

.stat-fact .stat-value {
    font-family: var(--font-body);
    font-size: var(--fs-4);
    font-weight: 700;
    letter-spacing: 0;
}

.stat-fact .stat-delta,
.stat-fact .stat-hint {
    font-size: var(--fs-2);
}

/* ── hero ───────────────────────────────────────────────────────────────────
   The page's one big amount (the old .value-hero-amount): no box of its own,
   because it sits in the panel that carries the headline. */
.stat-hero {
    display: grid;
    gap: var(--sp-1h);
    align-content: start;
    color: var(--ink);
}

.stat-hero .stat-label {
    font-size: var(--fs-3);
}

.stat-hero .stat-value {
    font-size: var(--fs-display-2);
    letter-spacing: -.02em;
}

.stat-hero .stat-unit {
    font-size: max(.4em, var(--fs-1));
}

/* ── Whole-tile link ────────────────────────────────────────────────────────
   The tile is the link: label, figure and hint are its name. It lifts and
   fills yellow on hover and focus, as the hub links do, and the label is
   underlined so a link is not told by the fill alone. */
a.stat-link {
    color: var(--ink);
    text-decoration: none;
    min-block-size: var(--touch-min);
    transition: background-color .12s ease, transform .06s ease, box-shadow .06s ease;
}

a.stat-link .stat-label {
    text-decoration: underline;
    text-decoration-thickness: var(--edge-w-hair);
    text-underline-offset: .2em;
}

a.stat-link:hover,
a.stat-link:focus-visible {
    background-color: var(--brand-primary);
    color: var(--on-accent);
    transform: var(--hover-lift);
}

a.stat-link:hover :is(.stat-label, .stat-value, .stat-hint, .stat-unit, .stat-delta, .stat-delta-window, .stat-line, .stat-line strong),
a.stat-link:focus-visible :is(.stat-label, .stat-value, .stat-hint, .stat-unit, .stat-delta, .stat-delta-window, .stat-line, .stat-line strong) {
    color: var(--on-accent);
}

a.stat-link:active {
    transform: translate(var(--shadow-off-sm), var(--shadow-off-sm));
    box-shadow: none;
}

/* ── app-stat-grid ──────────────────────────────────────────────────────────
   Tiles in rows that fit the grid's own width: one across below 18rem, two
   from 18rem, three from 36rem and five from 60rem. A wrapping flex row, as
   app-grid is: each tile's basis is one column and a tile grows to fill what
   its row leaves, so a short last row is filled. At three and five across,
   when the last row would hold one tile alone, the last two take half the row
   each. Tiles in a row stretch to the tallest. */
.app-stat-grid {
    --stat-grid-gap: var(--sp-3);
    --stat-grid-half: calc((100% - var(--stat-grid-gap)) / 2 - 1px);
    container: app-stat-grid / inline-size;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: var(--stat-grid-gap);
    margin: 0;
    padding: 0;
}

.app-stat-grid > * {
    flex: 1 1 100%;
    min-inline-size: 0;
    margin: 0;
}

/* Tiles standing on the page take the page's gap between panels. */
.app-stat-grid--panel {
    --stat-grid-gap: var(--sp-5);
}

/* A fact strip: the hairline gaps show the ink behind them, so the facts read
   as one bordered row. Every row is filled, so no ink block is left over. */
.app-stat-grid--fact {
    --stat-grid-gap: var(--edge-w-hair);
    border: var(--edge-w-hair) solid var(--ink);
    background: var(--ink);
}

.app-stat-grid--fact > .stat-fact {
    border: 0;
}

/* Facts are small figures, so a fact strip is two across from 12rem. */
@container app-stat-grid (12rem <= width < 18rem) {
    .app-stat-grid--fact > * { flex-basis: calc((100% - var(--stat-grid-gap)) / 2 - 1px); }
}

@container app-stat-grid (18rem <= width < 36rem) {
    .app-stat-grid > * { flex-basis: calc((100% - var(--stat-grid-gap)) / 2 - 1px); }

    /* Two tiles in a phone's width: a step smaller, so an amount and its unit
       fit on one line (1,204.50 CAD in a 20rem grid). */
    .app-stat-grid > :is(.stat-tile, .stat-card) .stat-value { font-size: var(--fs-5); }
}

/* Three facts in the two-across range are one per row: two and one left the lone fact a full row
   and its two partners in half cells, where a label such as "Excluded by Rules" broke onto a
   second line and stretched its neighbour (final pass, store-home-listings-5, BulkList at 375). */
@container app-stat-grid (12rem <= width < 36rem) {
    .app-stat-grid--fact:has(> :last-child:nth-child(3)) > * { flex-basis: 100%; }
}

@container app-stat-grid (36rem <= width < 60rem) {
    .app-stat-grid > * { flex-basis: calc((100% - 2 * var(--stat-grid-gap)) / 3 - 1px); }
    .app-stat-grid:has(> :last-child:nth-child(3n+4)) > :nth-last-child(-n+2) { flex-basis: var(--stat-grid-half); }
}

@container app-stat-grid (width >= 60rem) {
    .app-stat-grid > * { flex-basis: calc((100% - 4 * var(--stat-grid-gap)) / 5 - 1px); }
    .app-stat-grid:has(> :last-child:nth-child(5n+6)) > :nth-last-child(-n+2) { flex-basis: var(--stat-grid-half); }
}

/* fit="true": the grid takes its width from its cards, not its container, for a
   short strip beside other content (the portfolio's facts, final pass). A size
   container cannot take its width from what it holds, so the grid is not one
   here and the width steps above do not apply: each card sits at its own width,
   at least 7rem, the row ends after its last card, and a card grows only to fill
   a row it wrapped into. */
.app-stat-grid--fit {
    container-type: normal;
    inline-size: fit-content;
    max-inline-size: 100%;
}

.app-stat-grid--fit > * {
    flex: 1 1 auto;
    min-inline-size: 7rem;
}

/* The style guide's sample frames (/Admin/StyleGuide/Stats): a box of a set
   width, never wider than the page, so the samples show the grid at 20, 40
   and 80rem. Only the sample page uses it. */
.stat-sample-frame {
    inline-size: min(100%, var(--sample-width, 100%));
    padding: var(--sp-2);
    border: var(--edge-w) dashed var(--ink-muted);
}

@media (forced-colors: active) {
    a.stat-link:hover,
    a.stat-link:focus-visible {
        transform: none;
    }

    .app-stat-grid--fact {
        background: CanvasText;
    }
}

/* ── Status page (_StatusPage, Pages/Shared/StatusPageModel.cs) ─────────────────
   The page for a 404, a 403 or a failure: the page header, then one panel with the
   ways on and the request id. docs/ui/components/status-page.md has the API.

   One short task, so the column is held to the form measure (--measure-form, 40rem)
   and centred in the shell: at 1920 to 3840 it grows with the fluid root only, and
   never runs across the screen (UI plan principle 5). */

.status-page {
    inline-size: 100%;
    max-inline-size: var(--measure-form);
    margin-inline: auto;
}

/* The request id sits under the actions, a step apart and ruled off from them. */
.status-page-report {
    display: grid;
    gap: var(--sp-2);
    margin-block-start: var(--sp-4);
    padding-block-start: var(--sp-4);
    border-block-start: var(--edge-w-hair) solid var(--rule-soft);
}

.status-page-report-copy {
    margin: 0;
    max-inline-size: var(--measure);
}

/* ── Data table (<app-table>, TagHelpers/AppTableTagHelper.cs) ─────────────────────
   One table shell. docs/ui/components/table.md has the API.

   Structure: div.app-table (a labelled, focusable scroll region, also .table-responsive) holds
   table.table.data-table. The legacy .table rules still draw the ink header band, the zebra, the
   hover and the group-heading rows; this file adds the column conventions, stacking below md,
   fit and compact, low-priority columns, the flagged row and the panel bleed. Modifiers:
   .data-table--stack, .data-table--fit, .data-table--compact. The pager (_Pager, .app-pager) is
   at the end. */

.app-table {
    /* How far the table reaches past a panel body's padding to the panel's edges, and how far
       it sits into the body's top and bottom padding. The panel's own padding, which narrows on
       a phone (legacy 08). */
    --table-bleed: var(--sp-5);
    --table-bleed-block: var(--sp-4);
    /* The scroll region holds what is absolutely positioned inside it. Bootstrap's
       .visually-hidden is position: absolute, and a hidden field label in a cell (Pricing Data's
       game rules) with no positioned ancestor sat at its static place past the page's right
       edge at 320, 375 and 1024, outside the region that scrolls it (final pass sweep). */
    position: relative;
}

/* The region is a tab stop so a keyboard can scroll a table wider than its column (axe
   scrollable-region-focusable; UI audit BP5). It is flush with the panel edges, so the ring is
   drawn inside it, where nothing clips it. */
.app-table:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-inset);
}

.data-table {
    margin-bottom: 0;
}

.data-table > :is(thead, tbody, tfoot) > tr > :is(th, td) {
    vertical-align: middle;
}

/* A caption the page shows: a small label above the table, not a heading. */
.data-table > .data-table-caption {
    caption-side: top;
    padding: 0 0 var(--sp-2);
    color: var(--ink);
    font-weight: 700;
}

/* ── Column conventions ── */

/* The row's title: the card, the account, the game. A row header (tbody th scope=row) is the same. */
:where(.data-table) .tmc-title,
:where(.data-table) > tbody > tr > th[scope="row"] {
    font-weight: 700;
    overflow-wrap: anywhere;
}

/* Figures line up: right-aligned, tabular, and never split from their currency. */
:where(.data-table) .num {
    text-align: end;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* A figure followed by a word column ("1,284" then "Apr 19") keeps a clear gap between them. */
:where(.data-table) > :is(thead, tbody, tfoot) > tr > .num + :not(.num) {
    padding-inline-start: var(--sp-4);
}

/* The row's commands take only the room they need, at the end of the row, on one line. */
:where(.data-table) .tmc-actions {
    width: 1%;
    text-align: end;
    white-space: nowrap;
}

:where(.data-table) .tmc-actions > .app-row-actions {
    flex-wrap: nowrap;
}

/* ── Fit and compact ── */

/* A table of few or numeric columns is as wide as its content, not the panel: at 1920 a game's
   totals sat a screen's width from its name (UI audit LS-AD7). It still never passes its column. */
.data-table--fit {
    width: auto;
    max-width: 100%;
}

/* On a phone a fit table that never stacks (stack="never": a short numeric table) fills its
   column. Its content width there was two thirds of the panel, with the rest of the panel empty
   beside it (Translations' languages, 224px in a 351px panel at 375; final pass, admin-b-6). */
@media (max-width: 575.98px) {
    .data-table--fit:not(.data-table--stack) {
        width: 100%;
    }
}

/* In a fit table the commands column takes its content's width. Its 1% (above) is a percentage
   column, which makes an auto-width table fill its column whatever its content: Store Stock's
   counts sat 1,500px from their card at 1920, and Team's Remove 97rem from its email (final
   pass, leftovers; Team carried its own patch in store-settings.css until this). */
:where(.data-table--fit) .tmc-actions {
    width: auto;
}

.data-table--compact > :is(thead, tbody, tfoot) > tr > :is(th, td) {
    padding-block: var(--sp-1);
    padding-inline: var(--sp-2);
}

/* A compact cell's 4px under a field in the last row is less than the focus ring's reach (3px
   and a 2px offset), and the scroll region clips what passes its edge. A little room under the
   table keeps the whole ring on screen. */
.app-table:has(> .data-table--compact) {
    padding-block-end: var(--sp-0);
}

/* ── A flagged row ──
   A row that needs a look (a drifted buylist line, an import row that will be skipped): the
   --row-flag tint, which every ink pair clears 4.5:1 on in both themes, and a bar down its first
   cell. The row also carries a badge saying why, so the flag is never colour alone. Matched to
   the cells so it wins over the zebra, which also sets --bs-table-bg-type on the cell. */
.data-table > tbody > tr.is-flagged > * {
    --bs-table-bg-type: var(--row-flag);
    --bs-table-color-type: var(--ink);
    color: var(--ink);
}

.data-table > tbody > tr.is-flagged > :first-child {
    box-shadow: inset var(--edge-w-strong) 0 0 var(--warn-ink),
        inset 0 0 0 9999px var(--bs-table-bg-state, var(--bs-table-bg-type, var(--bs-table-accent-bg)));
}

/* ── In a panel ──
   One framing everywhere (UI audit LS-AD16): the table runs edge to edge in the panel, its first
   and last cells inset by the panel's padding so the text lines up with the panel heading, and
   as the first or last thing in the body it meets the panel's rule or border with no empty band
   (LS-PR19). A panel body that is itself a scroller (body-class "table-responsive") is left
   alone; give a table panel a plain body.
   A fit table is as wide as its content, so it never bleeds: pulled to the panel's start edge
   it ended mid-panel, its header band flush on one side and short of the other, while the copy
   above it kept the panel's padding. It sits inside that padding instead, like the copy, with
   its cells' own padding and its last row's rule. */
:where(.app-panel) > :is(.panel-body, .border-top-box):not(.table-responsive) > .app-table:not(:has(> .data-table--fit)) {
    margin-inline: calc(-1 * var(--table-bleed));
}

:where(.app-panel) > :is(.panel-body, .border-top-box):not(.table-responsive) > .app-table:not(:has(> .data-table--fit)):first-child {
    margin-block-start: calc(-1 * var(--table-bleed-block));
}

:where(.app-panel) > :is(.panel-body, .border-top-box):not(.table-responsive) > .app-table:not(:has(> .data-table--fit)):last-child {
    margin-block-end: calc(-1 * var(--table-bleed-block));
}

:where(.app-panel > .app-table, .app-panel > :is(.panel-body, .border-top-box):not(.table-responsive) > .app-table)
    > .data-table:not(.data-table--fit) > :is(thead, tbody, tfoot) > tr > :first-child {
    padding-inline-start: var(--table-bleed);
}

:where(.app-panel > .app-table, .app-panel > :is(.panel-body, .border-top-box):not(.table-responsive) > .app-table)
    > .data-table:not(.data-table--fit) > :is(thead, tbody, tfoot) > tr > :last-child {
    padding-inline-end: var(--table-bleed);
}

/* A visible caption lines up with the panel heading too. */
:where(.app-panel > .app-table, .app-panel > :is(.panel-body, .border-top-box):not(.table-responsive) > .app-table)
    > .data-table:not(.data-table--fit) > .data-table-caption {
    padding-inline: var(--table-bleed);
}

/* The last row's rule would sit on the panel's own border. */
:where(.app-panel > .app-table:last-child, .app-panel > :is(.panel-body, .border-top-box):not(.table-responsive) > .app-table:last-child)
    > .data-table:not(.data-table--fit) > :last-child > tr:last-child > * {
    border-bottom-width: 0;
}

/* Something after the table in the same body keeps its distance. */
.app-table + * {
    margin-block-start: var(--sp-4);
}

@media (max-width: 575.98px) {
    .app-table {
        --table-bleed: var(--sp-3);
        --table-bleed-block: var(--sp-3);
    }
}

/* ── Stacked below md ──
   Each row becomes a card of labelled values (the label from data-label), ruled off from the
   next. A figure, or a cell marked data-stack="inline", keeps its label on the same line, so a
   short number is one line, not two (UI audit CC5). The title cell has no label. */
@media (max-width: 767.98px) {
    .data-table--stack > thead {
        display: none;
    }

    .data-table--stack,
    .data-table--stack > :is(tbody, tfoot),
    .data-table--stack > :is(tbody, tfoot) > tr,
    .data-table--stack > :is(tbody, tfoot) > tr > :is(th, td) {
        display: block;
        width: 100%;
    }

    .data-table--stack > :is(tbody, tfoot) > tr {
        padding-block: var(--sp-3);
        border-top: var(--edge-w) solid var(--ink);
    }

    .data-table--stack > tbody > tr:first-child {
        border-top: 0;
    }

    /* The zebra reads as a rendering glitch once rows are blocks. A flagged card is tinted as a
       whole, with the bar down its start edge and room for it. */
    .data-table--stack > tbody > tr:nth-of-type(n) > * {
        --bs-table-bg-type: transparent;
    }

    /* A visible caption is a line above the cards, not a shrink-wrapped table caption. */
    .data-table--stack > .data-table-caption {
        display: block;
    }

    .data-table--stack > tbody > tr.is-flagged {
        padding-inline-start: max(var(--sp-3), var(--table-bleed, 0px));
        background-color: var(--row-flag);
        box-shadow: inset var(--edge-w-strong) 0 0 var(--warn-ink);
    }

    .data-table--stack > tbody > tr.is-flagged:nth-of-type(n) > * {
        --bs-table-bg-type: transparent;
    }

    .data-table--stack > tbody > tr.is-flagged > :first-child {
        box-shadow: none;
    }

    .data-table--stack > :is(tbody, tfoot) > tr > :is(th, td) {
        border: 0;
        padding: var(--sp-1) 0;
        text-align: start;
    }

    /* Every value in a card starts and ends on the card's edges. The table's own inline padding
       (the panel inset on the first and last cells, the gap after a figure) outranks the rule
       above, so these three are zeroed at a weight that beats them, in a panel or out of one. */
    .data-table--stack > :is(tbody, tfoot) > tr > :is(th, td):is(:first-child, :last-child, .num + :not(.num)) {
        padding-inline: 0;
    }

    .data-table--stack > :is(tbody, tfoot) > tr > [data-label]::before {
        content: attr(data-label);
        display: block;
        margin-block-end: var(--sp-0);
        color: var(--ink-muted);
        font-size: var(--fs-2);
        font-weight: 700;
        letter-spacing: var(--tracking-caps);
        text-transform: uppercase;
    }

    /* One line: the label at the start, the value at the end. */
    .data-table--stack > :is(tbody, tfoot) > tr > :is(.num, .tmc-inline, [data-stack="inline"]) {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        justify-content: space-between;
        column-gap: var(--sp-3);
        text-align: end;
    }

    .data-table--stack > :is(tbody, tfoot) > tr > :is(.num, .tmc-inline, [data-stack="inline"])[data-label]::before {
        margin-block-end: 0;
        text-align: start;
    }

    .data-table--stack > :is(tbody, tfoot) > tr > [data-stack="hide"],
    .data-table--stack > :is(tbody, tfoot) > tr > :empty {
        display: none;
    }

    /* The title leads the card, in bold, with no label over it. */
    .data-table--stack > tbody > tr > :is(.tmc-title, th[scope="row"])::before {
        content: none;
    }

    /* The commands sit in a row of their own at the start, at their own width. */
    .data-table--stack > tbody > tr > .tmc-actions {
        width: 100%;
        padding-block-start: var(--sp-2);
        white-space: normal;
    }

    .data-table--stack > tbody > tr > .tmc-actions::before {
        content: none;
    }

    .data-table--stack > tbody > tr > .tmc-actions > .app-row-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    /* In a panel the cards take the panel's inset that the cells had. */
    :where(.app-panel > .app-table, .app-panel > :is(.panel-body, .border-top-box):not(.table-responsive) > .app-table)
        > .data-table--stack:not(.data-table--fit) > :is(tbody, tfoot) > tr {
        padding-inline: var(--table-bleed);
    }

    :where(.app-panel > .app-table, .app-panel > :is(.panel-body, .border-top-box):not(.table-responsive) > .app-table)
        > .data-table--stack > :is(tbody, tfoot) > tr > :is(th, td) {
        padding-inline: 0;
    }
}

/* ── Low-priority columns ──
   Wide tables mark the columns a narrower screen can do without; they show from 1200px. Put
   data-priority="low" on the column's th and on each of its cells. After the stacking rules, at
   the same weight as their inline cells, so a low-priority figure is hidden on a phone too. */
@media (max-width: 1199.98px) {
    .data-table > :is(thead, tbody, tfoot) > tr > [data-priority="low"] {
        display: none;
    }
}

/* ── Pager (Pages/Shared/_Pager.cshtml) ───────────────────────────────────────────
   Previous, the page count and Next for a list split into pages. An end with nowhere to go is
   plain muted text, not a disabled link. */
.app-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2) var(--sp-3);
}

.app-pager-end {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-1h);
}

/* The off end keeps a button's box, so the count stays centred and the row does not jump. */
.app-pager-end--off {
    padding: var(--bs-btn-padding-y, .25rem) var(--bs-btn-padding-x, .5rem);
    border: var(--edge-w) dashed var(--rule-soft);
    color: var(--ink-muted);
    font-size: var(--fs-3);
    font-weight: 600;
}

/* The count is body text, the thing the control says. */
.app-pager-count {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    text-align: center;
}

@media (max-width: 767.98px) {
    .app-pager-count {
        flex: 1 0 100%;
        order: -1;
    }

    .app-pager-end {
        flex: 1 1 0;
    }
}

/* ── Touch ───────────────────────────────────────────────────────────────────────
   44px wherever the pointer is not certainly a mouse, as the legacy touch layer reads it. */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .app-pager-end {
        min-block-size: var(--touch-min);
    }
}

/* ── Selectable rows (<table-row-select>, docs/ui/components/table.md) ─────────
   A row's tick box for a bulk change, written first in its title cell, so the
   table keeps its columns and its group headings their colspan. It floats at the
   start of the cell and the title wraps beside it. The label is the target: 24px
   with a fine mouse from 992px, 44px below 992px and under any other pointer,
   the selection bar's own test. */
.table-row-select {
    float: inline-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-inline-size: 1.5rem;
    min-block-size: 1.5rem;
    margin-inline-end: var(--sp-2);
    cursor: pointer;
}

/* A row with nothing to select keeps the box's room (placeholder), so every
   title in the column starts at one edge. Nothing to press there. */
.table-row-select--placeholder {
    cursor: auto;
}

.table-row-select > .form-check-input {
    flex: none;
    inline-size: 1.25rem;
    block-size: 1.25rem;
    margin: 0;
    cursor: inherit;
}

@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .table-row-select {
        min-inline-size: var(--touch-min);
        min-block-size: var(--touch-min);
        margin-block: calc((var(--touch-min) - 1.5rem) / -2);
        margin-inline-start: calc((var(--touch-min) - 1.25rem) / -2);
    }
}

/* ── Trade pieces (unit mig-trades) ─────────────────────────────────────────────
   The parts the trade pages share: the trade's totals (Pages/Shared/_TradeSummary.cshtml,
   TradeSummaryModel.cs), a chat message (_MessageBubble.cshtml) and the offer page's decision
   bar. docs/ui/components/trade.md has the Razor API. Website only.

   The totals replace the legacy .trade-summary strip on every trade page. */

/* ── Trade totals ──
   One framed strip with the panel's offset shadow, so it reads as a panel among panels
   (audit CT12). Three cells across from 576px; below it You Get and You Give share a row and
   the difference takes the row under them. The cells are ruled by the strip's ink showing
   through a hairline gap. */
.trade-totals {
    background: var(--surface);
    border: var(--edge-w) solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.trade-totals-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--edge-w-hair);
    margin: 0;
    background: var(--ink);
}

.trade-totals-cell {
    display: grid;
    align-content: start;
    gap: var(--sp-1);
    min-width: 0;
    padding: var(--sp-2) var(--sp-3);
    background: var(--surface);
}

.trade-totals-cell--difference {
    grid-column: 1 / -1;
}

@media (min-width: 576px) {
    .trade-totals-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .trade-totals-cell {
        padding: var(--sp-3) var(--sp-4);
    }

    .trade-totals-cell--difference {
        grid-column: auto;
    }
}

.trade-totals-cell > dt {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: var(--fs-3);
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    color: var(--ink-muted);
}

.trade-totals-cell > dd {
    margin: 0;
}

/* The figure (audit P25). The size ramp follows the narrowest cell: a 320px phone's half
   cell and, from 576px, a third of the strip. Measured in the preview with "-12,345.67 CAD":
   it stays on one line at 320, 576, 640 and 700px (at 4vw it spilled 17-25px into the next
   cell between 576 and about 660px). A longer figure still never spills: the amount itself
   never breaks, but its currency code may drop to the line under it. */
.trade-totals-figure {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(var(--fs-4), 3.3vw, var(--fs-6));
    line-height: var(--lh-tight);
}

.trade-totals-figure .app-money {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    max-width: 100%;
}

.trade-totals-figure .app-money-amount {
    white-space: nowrap;
}

.trade-totals-figure .app-money-currency {
    font-size: .6em;
    color: var(--ink-muted);
}

.trade-totals-figure .app-money--empty {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--fs-4);
}

.trade-totals-copies {
    font-size: var(--fs-3);
    color: var(--ink-muted);
}

.trade-totals-note {
    margin: 0;
    padding: var(--sp-2) var(--sp-3);
    border-block-start: var(--edge-w-hair) solid var(--ink);
    font-size: var(--fs-3);
    color: var(--ink-muted);
}

/* ── A message thread ──
   The other member's messages on the start side, yours on the end side in the sunken fill,
   as in any chat. The author and the time are two pieces on one line; the time never breaks. */
.message-thread {
    display: grid;
    gap: var(--sp-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.message-bubble {
    justify-self: start;
    display: grid;
    gap: var(--sp-1);
    max-width: min(var(--measure), 90%);
    min-width: 0;
    padding: var(--sp-2) var(--sp-3);
    border: var(--edge-w) solid var(--ink);
    background: var(--surface);
}

.message-bubble--mine {
    justify-self: end;
    background: var(--surface-sunken);
}

.message-bubble-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 var(--sp-2);
    margin: 0;
    font-size: var(--fs-3);
    color: var(--ink-muted);
}

.message-bubble-author {
    min-width: 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.message-bubble-time {
    white-space: nowrap;
}

/* Line breaks as typed; the text is encoded, never HTML. */
.message-bubble-body {
    margin: 0;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.message-reply {
    display: grid;
    gap: var(--sp-2);
    max-width: var(--measure-form);
}

/* ── Offer rows ──
   The time an offer last changed, beside its status badge. */
.trade-row-time {
    align-self: center;
    font-size: var(--fs-3);
    color: var(--ink-muted);
    white-space: nowrap;
}

/* ── Account pages (mig-account) ────────────────────────────────────────────
   The classes Pages/Account/Settings.cshtml and LinkLogin.cshtml own. The
   header, the aside sections, the fields, the switches, the alert, the copy
   field and the rows are components; these only set the page's few lines of
   its own. SelectStore draws only components (its list is _ChoiceList,
   components/choice-list.css) in an .account-panel. docs/ui/dead-css/mig-account.md lists what this
   unit left unused. Usage: written in those three views only. */

/* Plain sentences in a section, held to the measure. */
.account-note {
    max-inline-size: var(--measure);
    margin: 0;
    line-height: var(--lh-body);
    text-wrap: pretty;
}

/* An email or a path: it moves to the next line whole rather than breaking at
   its hyphen ("preview-" / "admin@localhost", audit AC low), and breaks inside
   itself only when it is longer than the line. */
.account-token {
    display: inline-block;
    max-inline-size: 100%;
    overflow-wrap: anywhere;
    vertical-align: bottom;
}

/* View Your Profile and the address it opens, on one wrapping line. */
.account-profile-link {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-1) var(--sp-3);
    margin: 0;
}

.account-profile-link code {
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

/* Linked Logins: the sentence, the request or the code, the button and the
   rows, one under another with the form's gap. */
.account-linked,
.account-link-code {
    display: grid;
    gap: var(--sp-4);
    min-inline-size: 0;
    max-inline-size: var(--measure-form);
}

.account-link-code {
    gap: var(--sp-3);
}

.account-linked > form {
    margin: 0;
}

/* Link a Shopify Login's steps and Select Store's list: a panel held to the form
   measure, not the page's whole width, so the frame fits what it holds and the
   panel's action (Connect Another Store) sits beside its list (final pass
   2026-11-18). It starts at the page's left edge, under the header. */
.account-panel {
    inline-size: 100%;
    max-inline-size: var(--measure-form);
}

/* Link a Shopify Login: the steps are the panel's whole body. */
.account-steps {
    margin-block-end: 0;
}


/* ── Admin hub, API Keys and Deck Formats (unit mig-admin-hub) ─────────────────────────────
   The pages are built from components (app-page-header, app-panel, app-grid, app-link-list,
   app-form-stack, app-check-group, app-copy-field, app-table, app-badge, app-filter-bar);
   these are the few classes the three pages own. */

/* A "How This Works" fold directly under a page header sits at the page's own gap. */
.admin-hub-help {
    max-width: var(--measure);
}

/* Order of Work: numbered steps held to the measure, so a step reads as one line of thought
   on a wide screen, not a 1,400px line (audit LS-AD4). */
.admin-hub-steps,
.admin-hub-running {
    display: grid;
    gap: var(--sp-2);
    max-width: var(--measure);
    margin: 0;
    padding-inline-start: var(--sp-5);
}

/* API Keys: the new key, its warning and how to send it, one under another. */
.admin-hub-new-key {
    display: grid;
    gap: var(--sp-3);
    max-width: var(--measure-form);
}

.admin-hub-new-key > .app-alert {
    margin: 0;
}

/* A key's prefix and the ellipsis that says it goes on stay together. */
.admin-hub-prefix {
    white-space: nowrap;
}

/* A key's scopes, one badge each, wrapping in their cell. */
.admin-hub-badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--sp-1);
}

/* An intake destination is an email or a shop domain: it wraps anywhere, never past the cell. */
.admin-hub-intake {
    overflow-wrap: anywhere;
    font-size: var(--fs-3);
}

/* "until Nov 3 2027" under the Active badge. */
.admin-hub-until {
    display: block;
    font-size: var(--fs-3);
    color: var(--ink-muted);
}

/* Deck Formats: a format panel's body is one column with one gap. */
.admin-hub-format {
    display: grid;
    gap: var(--sp-4);
}

.admin-hub-note {
    margin: 0;
    font-size: var(--fs-3);
    color: var(--ink-muted);
    max-width: var(--measure);
}

/* One list's form: its name and state badges on one wrapping line, then its notes and fields. */
.deck-list-form {
    display: grid;
    gap: var(--sp-3);
}

.deck-list-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
}

.deck-list-head > h3 {
    margin: 0;
}

/* "Released since this list was saved" and "Filled every day from": the icon stays on the first
   line of a note that wraps. */
.deck-list-flag {
    display: flex;
    gap: var(--sp-2);
    align-items: baseline;
    margin: 0;
    max-width: var(--measure);
}

/* ── Admin Ingestion page (mig-admin-ingestion) ──────────────────────────────
   The classes Pages/Admin/Ingestion.cshtml owns. The header, provider views,
   form grids, actions, folds, job readouts and the coverage table are
   components; these only space a panel's parts and set its few muted lines.
   docs/ui/dead-css/mig-admin-ingestion.md lists what the unit left unused.
   Usage: the classes are written in Ingestion.cshtml only. */

/* The provider views sit between the page header and the first panel. */
.ingestion-sources {
    margin-block-end: var(--sp-4);
}

/* A panel body is one column of parts (fold, form, readout) with one gap. The
   column is minmax(0, 1fr), so a field grid inside sizes from the panel's width
   and never from its own content (an auto track let it grow to 900px at 320). */
.ingestion-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-4);
    min-inline-size: 0;
}

.ingestion-body > * {
    margin-block: 0;
}

/* A polled region that may be empty takes no gap of its own when it is. */
.ingestion-region {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-3);
    min-inline-size: 0;
}

.ingestion-region:not(:has(*)) {
    display: none;
}

/* Muted sentences, held to the measure. */
.ingestion-note,
.ingestion-summary {
    max-inline-size: var(--measure);
    margin: 0;
    color: var(--ink-muted);
    font-size: var(--fs-3);
    line-height: var(--lh-body);
}

/* A badge, then its sentence beside it on one baseline, wrapping as a unit. */
.ingestion-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--sp-2);
}

/* An error a job reported: its words say so, the ink only points at it. */
.ingestion-error {
    max-inline-size: var(--measure);
    margin: 0;
    color: var(--bad-ink);
    font-size: var(--fs-3);
    overflow-wrap: anywhere;
}

/* The heading of one job readout inside Provider ID Linking (an h3 under the panel's h2). */
.ingestion-subhead {
    margin: 0 0 var(--sp-2);
    font-family: var(--font-display);
    font-size: var(--fs-h3);
    line-height: var(--lh-tight);
}

.ingestion-job {
    min-inline-size: 0;
}

/* The tcgcsv form's two image choices, one under the other, across the grid. */
.ingestion-checks {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-3);
}

/* A game's name stays whole in the coverage table; it never breaks mid-word (AA6). */
.ingestion-coverage td.tmc-title {
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}

/* The Magic sets missing a TCGplayer id, under the coverage table (pricing unit P2): heading,
   note, table and the "more sets" line, spaced as the panel body spaces its own children. */
.ingestion-unlinked-sets {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-2);
    min-inline-size: 0;
}

.ingestion-unlinked-sets > .ingestion-subhead {
    margin: 0;
}

/* ── Admin job pages (mig-admin-jobs) ─────────────────────────────────────────
   The classes Pages/Admin/SalesSync, SetWatch, Status and WebVitals own. The
   header, job status, stat grids, tables, badges and row actions are
   components; these only space them and set the pages' muted lines.
   docs/ui/dead-css/mig-admin-jobs.md lists what this unit left unused.
   Usage: the classes are written in those four views only. */

/* The Last Run panel: the job's status line, then the last run's counts. */
.admin-run .app-job-status + .app-stat-grid {
    margin-block-start: var(--sp-3);
}

/* A muted second line in a cell for a short token only: an order's time, a store, a set
   code. A sentence is --fs-3 or larger (the type scale, audit AY9), so it takes .admin-run-reason. */
.admin-run-sub {
    color: var(--ink-muted);
    font-size: var(--fs-2);
    line-height: var(--lh-body);
    overflow-wrap: anywhere;
}

/* A muted sentence in a cell that explains a badge (Set Watch's No Ingestion and Nothing Ingested). */
.admin-run-reason {
    color: var(--ink-muted);
    font-size: var(--fs-3);
    line-height: var(--lh-body);
}

/* A note or reason cell: muted sentences that wrap long tokens. A table cell ignores
   max-inline-size in auto table layout, so the text goes in an .admin-run-note-text span,
   which holds it to a readable line on a wide screen as well as in a phone's card.
   Usage: <td class="admin-run-note"><span class="admin-run-note-text">@note</span></td> */
.admin-run-note {
    color: var(--ink-muted);
    font-size: var(--fs-3);
    overflow-wrap: anywhere;
}

.admin-run-note-text {
    display: block;
    max-inline-size: var(--measure);
}

/* A badge with its reason on a visible line beside it (Set Watch's No Ingestion). */
.admin-run-flag {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--sp-1) var(--sp-2);
    margin-block-start: var(--sp-1);
    font-weight: 400;
}

/* Web Vitals: a tile's rating badge, on its own line under the hint. */
.admin-vitals-rating {
    display: block;
    margin-block-start: var(--sp-2);
}

/* Web Vitals: the key to the rating badges, one row above the By Page table. */
.admin-vitals-key {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin: 0 0 var(--sp-3);
    padding: 0;
    list-style: none;
}

/* Web Vitals: the three metric tiles go one across until three fit. Two across at a phone's
   width broke "Largest Contentful Paint" inside a word. */
@container app-stat-grid (width < 36rem) {
    .admin-vitals-stats > * {
        flex-basis: 100%;
    }
}

/* ── Admin people: Shopify Stores, Users, User Reports, Translations (mig-admin-people) ──
   The classes Pages/Admin/ShopifyStores.cshtml, Users.cshtml, UserReports.cshtml and
   Translations.cshtml own. The pages are built from components (app-page-header,
   app-table, app-row-actions, app-inline-form, app-form-grid, app-form-field,
   app-filter-bar, app-stat-grid, app-grid, app-disclosure, app-badge, app-empty,
   app-alert); these rules only hold their copy to the measure, keep long tokens
   inside their cells and space the few lines the pages write themselves.
   docs/ui/dead-css/mig-admin-people.md lists what this unit left unused. */

/* A second line under a cell's main value (a card's game, who reported it, where a
   plan came from): muted and a step smaller. */
.reports-sub,
.stores-sub {
    color: var(--ink-muted);
    font-size: var(--fs-2);
    line-height: var(--lh-tight);
    margin-block-start: var(--sp-1);
}

/* A row's title cell is bold (data-table's .tmc-title); what sits under the title in it
   (the game, the reporter, a bio, the shop's edit fold) is body weight. */
.tmc-title .reports-sub,
.tmc-title .reports-bio,
.tmc-title .stores-edit {
    font-weight: normal;
}

.stores-sub-inline {
    color: var(--ink-muted);
}

/* A note the page writes in a panel body: held to the measure, one gap below. */
.stores-note {
    max-inline-size: var(--measure);
    margin: 0 0 var(--sp-3);
    color: var(--ink-muted);
    font-size: var(--fs-3);
    text-wrap: pretty;
}

/* Emails, shop domains and scope lists are long tokens: they break anywhere rather
   than push a stacked card or a column past the panel (from 320px). */
.users-email,
.stores-domain,
.stores-scopes,
.reports-sub,
.reports-from {
    overflow-wrap: anywhere;
    word-break: normal;
}

/* Once the tables are tables (768px up), a token breaks only where it can (after a hyphen,
   at a space) and a word in it is never split. "anywhere" let the table shrink the column
   to a few letters, so an address read "preview-storeless@l / ocalhost" over three lines;
   break-word counts the longest word into the column's width, and still breaks a word that
   alone is wider than its cell (final pass 2026-11-18). */
@media (min-width: 768px) {
    .users-email,
    .stores-scopes,
    .reports-sub,
    .reports-from {
        overflow-wrap: break-word;
    }

    /* A shop domain is the row's title and is read whole: it keeps one line. */
    .stores-domain {
        white-space: nowrap;
    }
}

/* Users: the reason a row has no Remove ("Your account", "Last admin"), muted and
   at the cell's end beside the row's menu. */
.users-row-note {
    color: var(--ink-muted);
    font-size: var(--fs-2);
    white-space: nowrap;
}

.users-email .app-badge {
    margin-inline-start: var(--sp-1);
}

/* Once the table is a table, the access field is never narrower than 10rem, so its
   placeholder ("*.myshopify.com") shows whole: at 768 the column gave it 143px and cut
   the old, longer one (final pass, leftovers). */
@media (min-width: 768px) {
    .users-access-form > :not(.btn) {
        min-inline-size: var(--field-w-sm);
    }
}

/* From 1200px the access field and Save sit on one line inside the cell. Below that Save
   wraps under the field, so the Shopify Access column gives up width to the addresses
   (at 768 it took 264px and left Email 127px; final pass 2026-11-18). */
@media (min-width: 1200px) {
    .users-access-form {
        flex-wrap: nowrap;
    }

    .users-access-form > :not(.btn) {
        flex: 1 1 auto;
    }
}

/* User Reports: a ticket's type badge under the card it is about. */
.reports-type {
    margin-block-start: var(--sp-1);
}

@media (min-width: 768px) {
    .reports-resolve .app-field {
        min-inline-size: var(--field-w-sm);
    }
}

/* User Reports: the queues with nothing in them, said once on one line. */
.reports-clear {
    display: flex;
    align-items: baseline;
    gap: var(--sp-2);
    max-inline-size: var(--measure);
    margin: 0;
    color: var(--ink-muted);
}

.reports-clear > .bi {
    color: var(--ok-ink);
}

/* Shopify Stores: the last connection check under the Connected Stores heading. */
.stores-check {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--sp-2);
    max-inline-size: var(--measure);
    margin: 0 0 var(--sp-3);
    font-size: var(--fs-3);
}

/* Once the table is a table (768px up), the shop cell keeps room for a whole domain and a
   two-line edit summary, so the domain does not break mid-word at 1280 when the
   low-priority columns join. */
@media (min-width: 768px) {
    .stores-table .stores-shop {
        min-inline-size: 14rem;
    }
}

/* The shop cell holds the row's edit fold; its forms stack with a gap. */
.stores-edit form + form {
    margin-block-start: var(--sp-3);
}

.stores-edit .stores-note {
    margin-block: var(--sp-1) 0;
}

/* The status explanation folds under its badge, held to a readable line. */
.stores-status-more {
    margin-block-start: var(--sp-1);
}

.stores-status-more p {
    max-inline-size: var(--field-w-md);
    margin: 0;
    font-size: var(--fs-2);
}

/* The granted scopes are a reference list, a step smaller, so six of them take three
   lines rather than six and the row is not three times the height of its neighbours. */
.stores-scopes {
    font-size: var(--fs-2);
    line-height: var(--lh-tight);
}

/* The listings figure and its cap stay together. */
.stores-table td.num {
    white-space: nowrap;
}

/* Inactive connections: the domains, the consequences and the button, one gap apart. */
.stores-stale > p,
.stores-stale-list,
.stores-affected {
    max-inline-size: var(--measure);
    margin: 0 0 var(--sp-3);
}

.stores-stale-list code {
    overflow-wrap: anywhere;
}

.stores-stale > .app-disclosure {
    margin-block-end: var(--sp-3);
}

/* ── Admin Pricing Data (mig-admin-pricing-data) ────────────────────────────
   The classes Pages/Admin/PricingData.cshtml (.admin-pricing) owns. The header,
   panels, forms, check groups, table, job readouts and folds are components
   (app-page-header, app-panel, app-form-*, app-check-group, app-table,
   app-job-status, app-dl, app-disclosure); these lay out the Price Sources rows
   and size the game rules fields. docs/ui/dead-css/mig-admin-pricing-data.md
   lists what this unit left unused. */

/* A muted note above a table or under a readout, held to the measure. */
.admin-pricing-note {
    max-inline-size: var(--measure);
    margin: 0 0 var(--sp-3);
    color: var(--ink-muted);
    font-size: var(--fs-3);
    text-wrap: pretty;
}

/* Global Game Rules. Each number field holds a value like 0.85 or 120.00, so
   the columns take that width and no more, and the game's name is not
   crushed: at 1024 the seven 150px columns made it three lines (audit LS-AD6).
   On a phone card it never wraps; from 768px its column has a set width.
   The table is as wide as its content (app-table fit), so at 1920 and wider
   a game's figures sit beside its name, not 1,000px away. */
.admin-pricing-rules-table > tbody > tr > th[scope="row"] {
    white-space: nowrap;
}

.admin-pricing-rules-table .app-field__control {
    inline-size: 5.5rem;
}

/* The table scrolls in its own region, which clips: room under the last
   row, so a focused field's ring (3px, 2px out) is drawn whole. */
.admin-pricing-rules > .app-table {
    padding-block-end: var(--sp-1h);
}

/* Stacked as a card per game below 768px: every game is on the page, with
   its fields in a column of label and value pairs. Each pair is a two-column
   grid, the label then a field of one set width, so all seven fields line up
   at the card's end at every width from 320px; a long label ("Moderately
   Played") wraps within its column instead of pushing its field onto a line
   of its own (the stack's flex row did that at 320). The region keeps room on
   both sides, so a field at the card's edge has its ring drawn whole. */
@media (max-width: 767.98px) {
    .admin-pricing-rules-table > tbody > tr > td[data-stack="inline"] {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: var(--sp-3);
    }

    .admin-pricing-rules-table .app-field__control {
        inline-size: 6.5rem;
    }

    .admin-pricing-rules > .app-table {
        padding-inline: var(--sp-2);
    }
}

/* From 768px it is a table, and it scrolls sideways until about 1100px. The
   Game column stays put while it does, so the figures on screen always have
   their game's name beside them. The column has a set width (a name wraps
   between words rather than widening it), and the region's scroll padding
   is that width and a little more, so Tab never brings a field to rest under
   the column or against either edge of the region. */
@media (min-width: 768px) {
    /* The form is as wide as its table (a grid of one fit-content column), so
       the sticky Save bar under the table ends where the table ends: at 1920
       it ran 316px past it. Narrower than the table, the column is the form's
       width and the table scrolls inside it as before. */
    .admin-pricing-rules {
        --rules-game-w: 11rem;
        display: grid;
        justify-content: start;
    }

    .admin-pricing-rules > .app-table {
        scroll-padding-inline: calc(var(--rules-game-w) + var(--sp-2)) var(--sp-2);
    }

    .admin-pricing-rules-table > :is(thead, tbody) > tr > :first-child {
        position: sticky;
        inset-inline-start: 0;
        z-index: 1;
        inline-size: var(--rules-game-w);
        min-inline-size: var(--rules-game-w);
    }

    /* Bootstrap paints a cell with --bs-table-bg (transparent in a body row)
       under the zebra's inset shadow; the stuck column needs a solid one. */
    .admin-pricing-rules-table > tbody > tr > th[scope="row"] {
        --bs-table-bg: var(--surface);
        white-space: normal;
    }
}

/* From 1280px the table fits without scrolling, so the longest name
   ("Pokémon TCG (Japan)", about 12rem) is back on one line. */
@media (min-width: 1280px) {
    .admin-pricing-rules-table > tbody > tr > th[scope="row"] {
        white-space: nowrap;
    }

    /* Every figure column is one width, whatever its heading: "Moderately
       Played" was wider than its field and left a gap before the next one.
       A long heading wraps between its words instead. Only from 1280, where
       the table fits whole: below that the narrower columns scroll less. */
    .admin-pricing-rules-table > thead > tr > th:not(:first-child) {
        inline-size: 7.5rem;
        min-inline-size: 7.5rem;
        white-space: normal;
    }
}

/* Price Sources: a row per provider, divided by a rule. The text and the
   run sit side by side once the panel is wide enough for both (a container
   query, so it follows the panel, not the screen). */
.admin-pricing-sources {
    container-type: inline-size;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.admin-pricing-source {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-3);
    padding-block: var(--sp-4);
    border-block-start: var(--edge-w-hair) solid var(--rule-soft);
}

.admin-pricing-source:first-child {
    padding-block-start: 0;
    border-block-start: 0;
}

.admin-pricing-source:last-child {
    padding-block-end: 0;
}

@container (min-width: 52rem) {
    .admin-pricing-source {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: var(--sp-5);
        align-items: start;
    }
}

.admin-pricing-source-title {
    margin: 0 0 var(--sp-1);
    font-family: var(--font-display);
    font-size: var(--fs-h3);
    font-weight: 700;
}

.admin-pricing-source-copy {
    max-inline-size: var(--measure);
    margin: 0 0 var(--sp-2);
    text-wrap: pretty;
}

.admin-pricing-source-run {
    display: grid;
    gap: var(--sp-3);
    justify-items: start;
}

.admin-pricing-source-run > * {
    max-inline-size: 100%;
}

.admin-pricing-source-status,
.admin-pricing-sweep {
    inline-size: 100%;
}

.admin-pricing-source-run > .admin-pricing-note,
.admin-pricing-source-status > .admin-pricing-note {
    margin: 0;
}

/* ── Public buylist builder (mig-buylist-builder) ─────────────────────────────
   The classes Pages/Buylist/Index.cshtml and its _BuylistAddForm own. The page is
   an app-split (break md, a 22rem sticky sell list, main first); the shared
   buylist pieces (_OfferPair, _BuylistLineSummary) are components/buylist.css.
   The legacy .table-mobile-buylist, .buylist-mobile-offers, .buylist-mobile-bar
   and .buylist-sell-cell rules no longer match this page; they are listed in
   docs/ui/dead-css/mig-buylist-builder.md. */

/* The page header (header.page-header, ruled underneath) and its alerts (.page-header-alerts,
   drawn after an Add) each keep a gap before what follows, so the header's rule never sits on
   the panels' top edges. */
.buylist-builder > .page-header,
.buylist-builder > .page-header-alerts {
    margin-block-end: var(--sp-4);
}

.buylist-builder__main {
    display: grid;
    gap: var(--sp-4);
    min-inline-size: 0;
}

.buylist-builder__main > .app-panel {
    margin: 0;
}

/* ── Search ──
   Game and the card search share a row when the column has room, and stack when it has not:
   the game is as wide as its longest option (max-content: at 11rem it cut "Magic: The
   Gathering" to "Magic: The Gath"), the search box at least 16rem and the rest. Each field's
   label sits over its own control, so the bars line up at their bottoms. */
.buylist-search {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--sp-3);
}

.buylist-search__game {
    flex: 1 1 auto;
    inline-size: max-content;
    min-inline-size: 0;
    max-inline-size: 20rem;
}

.buylist-search__q {
    flex: 999 1 16rem;
    min-inline-size: 0;
}

/* ── Results ──
   Card, Offer, Sell. The results panel is an inline-size container: where it is narrower than
   44rem (a phone, or the column beside the sell list from 768 to about 1100px) each row is a
   card (the card's name and art, its offers, then the Add form); wider, it is a table. The
   table's own stacking is off (stack="never"), since it follows the screen, not the column.
   Follow-up: app-table has no container-based stack mode yet; once it has one (a stack mode
   that stacks under a container query), the @container block below should become it. */
.buylist-results {
    container: buylist-results / inline-size;
    /* The thumbnail's width, read again to indent the offers under the name in a card row. */
    --buylist-thumb-w: 2.5rem;
}

.buylist-result {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    min-inline-size: 0;
}

.buylist-result > .card-thumb {
    --card-thumb-w: var(--buylist-thumb-w);
    flex: none;
}

.buylist-result__text {
    display: grid;
    gap: var(--sp-0);
    min-inline-size: 0;
}

.buylist-result__name {
    overflow-wrap: anywhere;
}

/* The facts under the name: the fact row in components/buylist.css draws the
   middots; here only its type. */
.buylist-result__meta {
    font-size: var(--fs-3);
    font-weight: 400;
}

.buylist-results__table > tbody > tr > td {
    vertical-align: top;
}

/* The offer cell is a block of labelled figures (_OfferPair) that starts at the column's start,
   as does a refused card's message spanning Offer and Sell, so the Offer heading starts there too:
   right-aligned, it sat over nothing. */
.buylist-results__table > thead > tr > th.num {
    text-align: start;
}

.buylist-results__offer {
    white-space: nowrap;
}

.buylist-results__sell {
    inline-size: 19rem;
}

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

.buylist-results__refused > .bi {
    margin-inline-end: var(--sp-1);
}

@container buylist-results (max-width: 43.99rem) {
    .buylist-results__table > thead {
        display: none;
    }

    .buylist-results__table,
    .buylist-results__table > tbody,
    .buylist-results__table > tbody > tr,
    .buylist-results__table > tbody > tr > td {
        display: block;
        inline-size: 100%;
    }

    .buylist-results__table > tbody > tr {
        padding-block: var(--sp-3);
        padding-inline: var(--table-bleed);
        border-block-start: var(--edge-w) solid var(--ink);
    }

    .buylist-results__table > tbody > tr:first-child {
        border-block-start: 0;
    }

    /* The zebra reads as a glitch once rows are cards. */
    .buylist-results__table > tbody > tr:nth-of-type(n) > * {
        --bs-table-bg-type: transparent;
    }

    .buylist-results__table > tbody > tr > td,
    .app-table > .buylist-results__table > tbody > tr > td:is(:first-child, :last-child) {
        padding: var(--sp-1) 0;
        border: 0;
        text-align: start;
        white-space: normal;
    }

    /* The offers sit under the name, in line with it rather than the art. */
    .buylist-results__table > tbody > tr > td.buylist-results__offer {
        padding-inline-start: calc(var(--buylist-thumb-w) + var(--sp-3));
    }
}

/* ── _BuylistAddForm ──
   A fixed grid, so Add never moves (BP6): Condition across the top; then Printing (an empty
   slot when the card has one printing), Quantity and Add; the store's limit under them. Each
   field has a small label over it; Add lines up with the fields' bottoms. Where
   the column has room (a card row from 30rem, a table from 60rem), all four share one row. */
.buylist-add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--input-w-qty) auto;
    grid-template-areas:
        "cond cond cond"
        "print qty add"
        "hint hint hint";
    gap: var(--sp-2);
    align-items: end;
    margin: 0;
}

.buylist-add__label {
    display: block;
    margin-block-end: var(--sp-0);
    font-size: var(--fs-2);
    line-height: var(--lh-tight);
    color: var(--ink-muted);
}

.buylist-add__cond { grid-area: cond; min-inline-size: 0; }
.buylist-add__print { grid-area: print; min-inline-size: 0; }
.buylist-add__qty { grid-area: qty; min-inline-size: 0; }
.buylist-add__submit { grid-area: add; }

.buylist-add__hint {
    grid-area: hint;
    margin: 0;
}

.buylist-add .form-control,
.buylist-add .form-select {
    inline-size: 100%;
}

@container buylist-results (min-width: 30rem) and (max-width: 43.99rem) {
    .buylist-add {
        grid-template-columns: minmax(0, 1fr) minmax(0, 8rem) var(--input-w-qty) auto;
        grid-template-areas:
            "cond print qty add"
            "hint hint hint hint";
    }
}

/* A wide table (from 60rem, a 1920 screen) gives the form one row of its own. */
@container buylist-results (min-width: 60rem) {
    .buylist-results__sell {
        inline-size: 28rem;
    }

    .buylist-add {
        grid-template-columns: minmax(0, 1fr) minmax(0, 8rem) var(--input-w-qty) auto;
        grid-template-areas:
            "cond print qty add"
            "hint hint hint hint";
    }
}

/* ── Sell list ── */
.buylist-sell-list__lines {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.buylist-sell-list__lines > li {
    padding-block: var(--sp-3);
    border-block-start: var(--edge-w-hair) solid var(--rule-soft);
}

.buylist-sell-list__lines > li:first-child {
    padding-block-start: 0;
    border-block-start: 0;
}

.buylist-sell-list__totals {
    display: grid;
    gap: var(--sp-1);
    margin: 0 0 var(--sp-4);
    padding-block-start: var(--sp-3);
    border-block-start: var(--edge-w) solid var(--ink);
}

.buylist-sell-list__totals > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0 var(--sp-3);
}

.buylist-sell-list__totals dt {
    font-weight: 400;
}

.buylist-sell-list__totals dd {
    margin: 0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* The icon-only Remove is 44 by 44 at every width (BP13). */
.buylist-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-inline-size: var(--touch-min);
    min-block-size: var(--touch-min);
    padding: 0;
}

/* ── Phone summary bar ──
   The count and the totals beside View List, two short lines at most, so the bar stays within
   --sticky-bar-max at 320px. From md the sell list is beside the results and the bar is not
   drawn. */
.buylist-builder .app-action-bar-actions > .buylist-summary {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--sp-2);
    margin: 0;
    min-inline-size: 0;
    font-size: var(--fs-2);
    line-height: var(--lh-tight);
}

@media (min-width: 768px) {
    .buylist-builder > .app-action-bar {
        display: none;
    }
}

/* ── Public buylist Review and Done (mig-buylist-review) ──────────────────────
   The classes Pages/Buylist/Review.cshtml and Done.cshtml own. The layout, the
   form and the sell-list lines are components (app-split, app-form-*,
   _BuylistLineSummary); these only space them. Token colours only, so a
   store's accent recolours the page. docs/ui/dead-css/mig-buylist-review.md
   lists what this unit left unused. */

/* Review: the alert stack under the header has the same gap below it as above,
   so an alert's bottom rule never runs into the panels' top edges (BP10).
   Scoped to the buylist shell: .buylist-main is not a grid with a gap, while
   the .app-page grid on admin and website pages already spaces the stack, and
   this file is bundled into every page's site.css. */
.buylist-main .page-header-alerts + .app-split {
    margin-block-start: var(--sp-4);
}

/* Review: the sell list, one line per item, a hairline between. */
.buylist-review__lines {
    display: grid;
    gap: var(--sp-3);
    margin: 0 0 var(--sp-4);
    padding: 0;
    list-style: none;
}

.buylist-review__lines > li + li {
    padding-block-start: var(--sp-3);
    border-block-start: var(--edge-w) solid var(--rule-soft);
}

.buylist-review__totals {
    margin-block-end: var(--sp-3);
    padding-block-start: var(--sp-3);
    border-block-start: var(--edge-w-strong) solid var(--ink);
    font-weight: 700;
}

/* The collection notice and the note above Submit: muted copy at the measure. */
.buylist-review__notice {
    max-inline-size: var(--measure);
    margin: 0;
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

/* The error summary's list: one link per field, inside the danger alert. */
.buylist-review__errors {
    margin: var(--sp-1) 0 0;
    padding-inline-start: 1.25em;
}

.buylist-review__errors a {
    color: inherit;
    font-weight: 600;
}

/* Each link is a list item on its own, not a link in a sentence, so it gets
   the phone target. */
@media (max-width: 991.98px), (pointer: coarse) {
    .buylist-review__errors a {
        display: inline-flex;
        align-items: center;
        min-block-size: var(--touch-min);
    }
}

/* Review: the store's own note above the form. Its text is held to the
   measure inside an alert as wide as the page, and wrapped greedily it left
   one word alone on the last line ("differs."); pretty wrapping evens it. It
   is a block, since text-wrap applies to a block's lines. */
.buylist-review__message {
    display: block;
    text-wrap: pretty;
}

/* Done: one narrow column for a single-task page (--narrow, 35rem). It starts
   at the shell's start edge, under the step list, as the builder and Review
   do: centred, it sat 336px right of the steps at 1280 (LS-SW14 replaced the
   inline max-width: 640px with it). */
.buylist-narrow {
    max-inline-size: var(--narrow);
}

.buylist-done__keep {
    margin: var(--sp-2) 0 var(--sp-4);
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

.buylist-done__address {
    margin: var(--sp-1) 0 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.buylist-done__note {
    margin-block: var(--sp-3);
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

/* ── Catalogue tools (mig-catalogue-tools) ──────────────────────────────────
   Create Card, Edit Card and Import Card Catalogue, the Admin area's catalogue
   tools. The pages are built from components (app-page-header, app-form-stack,
   app-form-section, app-form-grid, app-form-actions, app-job-status,
   app-empty); this file holds only what is theirs.

   The card editor's panel is as wide as its form: the fields are an
   app-form-stack of at most 60rem (one and a half --measure-form), so a panel
   running the whole 90rem column left a third of a box empty beside them on
   1280 to 3840 screens (LS-PR6). The cap is rem, so it grows with the fluid
   root from 1920px as the form does. */
.catalogue-editor {
    max-inline-size: calc(var(--measure-form) * 1.5 + 2 * var(--sp-5) + 2 * var(--edge-w));
}

/* The editor's three-field rows size their columns by their fields with
   app-form-grid's tracks option (components/form-layout.css; LS-PR8). */

/* ── Catalogue (mig-catalogue) ────────────────────────────────────────────────
   The classes Pages/Products/Index.cshtml (.catalogue) owns. The page header,
   the filter bar, the tiles, the badges, the empty states and the pager are
   components (app-page-header, app-filter-bar, _CardTile, app-badge, app-empty,
   _Pager); these lay out the results panel's header and notes. The Set picker
   is a field of the filter bar and takes its width cap there. The grid is the card-tile component's,
   in rem tracks: it gains columns from 1280 up to ten at 2560 and holds at ten to
   3840, because the root font and the tiles grow there (type-scale); accepted for
   LS-PR3 (decisions log, 2026-11-18).
   docs/ui/dead-css/mig-catalogue.md lists what this unit left unused. */

/* The filter panel is as wide as its search row: the filter bar's 48rem search
   plus the panel's inline padding (--sp-5; the phone padding stops at 575.98px,
   far below this cap) and its two edges. It ends where the Search button ends
   instead of running on as an empty band, and the fields wrap under the search
   inside that width. That holds once a game or a search adds Sort, Per Page and
   Show too: a full-width panel left 680px empty beside them at 1920 (final pass,
   catalogue-5). */
.catalogue-filters {
    max-inline-size: calc(48rem + 2 * var(--sp-5) + 2 * var(--edge-w));
}

/* The results panel: its header, notes, grid and pager one gap apart. */
.catalogue-results {
    display: grid;
    gap: var(--sp-3);
}

/* The results header: the count (the filter form's jump target) at the
   start, the currency and the page at the end, wrapping under it on a phone. */
.catalogue-results-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-1) var(--sp-4);
    min-inline-size: 0;
}

/* A focus target, so the panel's in-content heading rule leaves it alone
   (it skips headings with a tabindex); sized here as a section heading. */
.catalogue-results-count {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--fs-h3);
    font-weight: 800;
    line-height: var(--lh-tight);
    color: var(--ink);
}

.catalogue-results-note,
.catalogue-results-cap {
    max-inline-size: var(--measure);
    margin: 0;
    color: var(--ink-muted);
    font-size: var(--fs-3);
    text-wrap: pretty;
}

/* The warning sits in the panel's padding like the notes; the alert keeps
   its own margin out of the panel's gap. */
.catalogue-results-alert > .app-alert {
    margin-block-end: 0;
}

/* From 992px the filter bar's fields share a wrapping row, each starting at the
   bar's 11rem. A chosen game whose name is longer than 14 characters (the view
   adds -long) needs 14rem: "Pokémon TCG (Japan)" is about 10.7rem of text, plus
   the select's 3rem of padding and arrow. That field may not shrink below it, so
   a row that cannot fit it wraps instead of cutting the name off. A shorter name
   fits the basis, so its field has no floor and shrinks with the row.
   The Set field starts at 10rem, not 11rem ("All Sets" and a short set name fit;
   it still grows into any room the row has). A row wraps on its fields' starting
   sizes, and at 1280 that 1rem is what lets Show stay on the first row when the
   game's name is short. */
@media (min-width: 992px) {
    /* One class more specific than filter-bar.css's .app-filter-bar-fields > * floor,
       so it wins on specificity, not on where the bundle puts this file. */
    .app-filter-bar-fields > .catalogue-game-field-long {
        min-inline-size: 14rem;
    }

    .app-filter-bar-fields > .catalogue-set-field {
        flex-basis: 10rem;
    }
}

/* ── Collectors: the directory, a profile and a shared binder (unit mig-collectors) ─────────
   The pages are built from components (app-page-header, app-filter-bar, app-link-list,
   app-segmented, app-empty, _CardTile); these are the few classes the pages own. */

/* A bio keeps the line breaks its owner typed, as the old .profile-bio did. */
.collector-header .page-header__lede {
    white-space: pre-line;
}

/* "Member since November 2026" is one fact: it moves to the next line whole (audit CT30). */
.collector-header-since {
    white-space: nowrap;
}

/* The handle on a directory row, on the chips line beside the You badge. */
.collector-handle {
    align-self: center;
    font-size: var(--fs-3);
    color: var(--ink-muted);
    overflow-wrap: anywhere;
}

/* A panel's facts ("8 cards · 15 copies · 54.51 CAD"), a middot after each but the last, so a
   wrapped line never starts with one; each fact moves whole. */
.collector-fact {
    white-space: nowrap;
}

.collector-fact:not(:last-child)::after {
    content: "\00B7" / "";
    margin-inline: var(--sp-2);
    font-weight: 700;
}

/* The filter bar sits in the panel above the list it narrows; the list starts a step below. */
.collector-filter,
.collectors-directory .app-filter-bar {
    margin-block-end: var(--sp-4);
}

/* Report This Profile is a short form: held to the form measure, never a screen-wide textarea
   (audit LS-ME4). */
.profile-report {
    max-inline-size: var(--measure-form);
}

/* Someone's cards are a list (ul.portfolio-grid, role=list): no bullets and no list indent, so
   the grid starts at the panel's edge like every other tile grid. */
.collector-tiles {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ── Deck builder and public deck (mig-deck-builder) ──────────────────────────
   Pages/Decks/Deck.cshtml, Pages/Collectors/Deck.cshtml and the shared
   _DeckHeader, _DeckView and _DeckExport. The pages are components
   (app-page-header, app-split, app-panel, _QtyStepper, app-row-actions,
   app-badge, app-disclosure, app-form-*); this file holds the deck's own rows
   and bars. New class names only, so no legacy deck rule applies to them;
   docs/ui/dead-css/mig-deck-builder.md lists what this unit left unused. */

/* The description keeps the owner's line breaks. */
.deck-header-description {
    white-space: pre-line;
}

/* ── Jump bar: Search, Deck, Check ────────────────────────────────────────────
   Below 1200px the builder is one column and this sticks to the top of the
   screen (the site header does not stick, so nothing else is up there). From
   1200px both columns are on screen and it is not drawn (LS-ME13). Each link
   is a short word and a count badge, never cut off at 320px (DK8). */
.deck-jumpbar {
    position: sticky;
    top: var(--sp-2);
    z-index: var(--z-sticky);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: var(--edge-w) solid var(--ink);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.deck-jumpbar a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-1) var(--sp-2);
    min-block-size: var(--touch-min);
    padding: var(--sp-1);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.deck-jumpbar a + a {
    border-inline-start: var(--edge-w) solid var(--ink);
}

.deck-jumpbar a:hover .deck-jumpbar-label {
    text-decoration: underline;
}

.deck-jumpbar a:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-inset);
}

@media (max-width: 399.98px) {
    .deck-jumpbar a {
        flex-wrap: wrap;
        row-gap: 0;
        font-size: var(--fs-3);
    }
}

@media (min-width: 1200px) {
    .deck-jumpbar {
        display: none;
    }
}

/* Room under the jump bar for whatever the page scrolls to: a jump's target, and
   any control reached with Shift+Tab, so focus is never behind the bar (WCAG
   2.4.11). The bar's top offset, its height (deck-builder.js publishes it as
   --deck-jump-h on <html>, which outranks the one-row default here) and a gap.
   Set on the scroller, so it covers every control, not just the jump targets. */
@media (max-width: 1199.98px) {
    html:has(.deck-jumpbar) {
        --deck-jump-h: var(--touch-min);
        scroll-padding-block-start: calc(var(--sp-2) + var(--deck-jump-h) + var(--sp-3));
    }
}

#deck-cards:focus {
    outline: none;
}

/* ── Add Cards ───────────────────────────────────────────────────────────── */
.deck-search-form,
.deck-results {
    display: grid;
    gap: var(--sp-3);
}

.deck-results {
    margin-block-start: var(--sp-4);
}

.deck-result-list,
.deck-entries {
    display: grid;
    gap: var(--sp-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* A result: the art and the card on the first row; the finish, the count and
   the first Add on the next, the other parts of the deck under them (DK9). */
.deck-result {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--sp-2) var(--sp-3);
    padding: var(--sp-2);
    border: var(--edge-w) solid var(--ink);
    background: var(--surface);
}

.deck-result-main {
    display: grid;
    align-content: start;
    gap: var(--sp-1);
    min-inline-size: 0;
}

.deck-add {
    grid-column: 1 / -1;
    display: grid;
    gap: var(--sp-2);
    margin: 0;
}

.deck-add-finish {
    max-inline-size: var(--field-w-sm, 10rem);
}

.deck-add-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.deck-add-qty {
    flex: 0 0 4.25rem;
    inline-size: 4.25rem;
    text-align: center;
}

.deck-add-button--first {
    flex: 1 1 auto;
}

/* The other parts of the deck take a row of their own, in equal widths. */
.deck-add-button:not(.deck-add-button--first) {
    flex: 1 1 calc(50% - var(--sp-2));
}

.deck-add-button:not(.deck-add-button--first):first-of-type {
    flex-basis: 100%;
}

.deck-results-pages {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
}

/* ── The deck's parts ─────────────────────────────────────────────────────── */
.deck-zones {
    display: grid;
    gap: var(--sp-5);
}

.deck-builder-deck-region {
    display: grid;
    gap: var(--sp-5);
}

.deck-zone-count {
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--sp-1);
}

/* Two columns of lines once the part is 56rem wide: from 1400px on the
   builder (beside the search), from 1024px on a public deck (LS-ME8). */
.deck-zone {
    container: deck-zone / inline-size;
}

@container deck-zone (min-width: 56rem) {
    .deck-entries {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--sp-3);
    }
}

/* ── A line ───────────────────────────────────────────────────────────────────
   One compact row (DK3): the art, the card (name, set and number, the price
   of each, the chips), then the count, Select and the line's menu. Narrower
   than 34rem the controls take a row of their own under the card, so a line
   is about 130px tall on a phone. */
.deck-entry {
    container: deck-entry / inline-size;
    border: var(--edge-w) solid var(--ink);
    background: var(--surface);
}

.deck-entry-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "thumb main"
        "controls controls";
    gap: var(--sp-1h) var(--sp-2);
    padding: var(--sp-1h) var(--sp-2);
}

.deck-entry-inner > .card-thumb {
    grid-area: thumb;
}

.deck-entry-main {
    grid-area: main;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    align-content: start;
    gap: var(--sp-1);
    min-inline-size: 0;
}

/* The name has a line of its own; the set, number, price and chips run on
   after it as one wrapping line, so a phone line is two short rows of text. */
.deck-entry-main > .deck-entry-title {
    flex-basis: 100%;
}

.deck-entry-main > .deck-entry-meta,
.deck-entry-main > .deck-entry-chips {
    display: contents;
}

.deck-entry-controls {
    grid-area: controls;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--sp-2);
}

/* A public line has no controls: the card takes the row. */
.deck-entry-inner:not(:has(> .deck-entry-controls)) {
    grid-template-areas: "thumb main";
}

@container deck-entry (min-width: 34rem) {
    .deck-entry-inner {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas: "thumb main controls";
        align-items: center;
    }

    .deck-entry-inner:not(:has(> .deck-entry-controls)) {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .deck-entry-controls {
        flex-wrap: nowrap;
    }
}

/* The set by its code on a narrow line, by its name on a wide one. */
.deck-entry-set {
    display: none;
}

@container deck-entry (min-width: 34rem) {
    .deck-entry-set {
        display: inline;
    }

    .deck-entry-set-code {
        display: none;
    }
}

.deck-entry-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 var(--sp-2);
    min-inline-size: 0;
}

/* A read-only line leads with its count, in a fixed-width column (DK14). */
.deck-entry-qty {
    min-inline-size: 3ch;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.deck-entry-name {
    position: relative;
    font-weight: 700;
    line-height: var(--lh-tight, 1.2);
    overflow-wrap: anywhere;
}

/* The name is a link set on its own: an invisible hit area reaches 44px on a
   touch screen without pushing the row's lines apart. */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .deck-entry-name::after {
        content: "";
        position: absolute;
        inset: -13px -4px;
    }
}

.deck-entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--sp-2);
}

/* Each part carries the dot after it, so a wrapped line never starts with one. */
.deck-entry-part {
    font-size: var(--fs-3);
    color: var(--ink-muted);
}

.deck-entry-part:not(:last-child)::after {
    content: "\00a0\00B7";
}

.deck-entry-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1);
}

.deck-entry-count {
    margin: 0;
}

/* Select: a box and its word, 44px tall on a touch screen (DK17). On a line
   narrower than 20rem (a 320px phone) the word is for screen readers only, so
   the count, the box and the menu stay on one row. */
.deck-entry-pick {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1h, .375rem);
    min-block-size: var(--touch-min);
    padding-inline: var(--sp-1);
    font-size: var(--fs-3);
    cursor: pointer;
}

@container deck-entry (max-width: 19.99rem) {
    .deck-entry-pick-word {
        position: absolute;
        inline-size: 1px;
        block-size: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .deck-entry-pick {
        justify-content: center;
        min-inline-size: var(--touch-min);
    }
}

@media (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .deck-entry-pick {
        min-block-size: 2rem;
    }
}

.deck-entry-pick .form-check-input {
    margin: 0;
    inline-size: 1.25rem;
    block-size: 1.25rem;
}

/* A change on its way: the line stays where it is and dims until the server
   has answered; aria-busy says the same to a screen reader (DK12). */
.deck-entry.deck-pending,
.deck-result.deck-pending {
    opacity: .65;
}

.deck-entry-error {
    margin: 0;
    padding: var(--sp-1) var(--sp-2) var(--sp-2);
    color: var(--bad-ink);
    font-size: var(--fs-3);
    font-weight: 600;
}

/* ── Deck Check and Cards You Need ────────────────────────────────────────── */
.deck-check-body,
.deck-sources-body,
.deck-source {
    display: grid;
    gap: var(--sp-2);
}

/* Text keeps the measure, but Deck Check's footer rule spans the panel body, so it
   reads as a divider rather than a stray half-width line (final pass). */
.deck-sources-body,
.deck-source,
.deck-check-body > :not(.deck-check-sources),
.deck-check-sources > * {
    max-inline-size: var(--measure);
}

.deck-check-ok {
    margin: 0;
}

.deck-check-ok .bi {
    color: var(--ok-ink, var(--ink));
}

.deck-check-body > h3,
.deck-source > h3 {
    margin: var(--sp-2) 0 0;
}

/* The rules' source and the lists' dates are a footer under the issues. */
.deck-check-sources {
    display: grid;
    gap: var(--sp-1);
    margin-block-start: var(--sp-2);
    padding-block-start: var(--sp-2);
    border-block-start: 1px solid var(--rule-soft);
}

/* ── Add to Portfolio bar (DK6) ───────────────────────────────────────────────
   After the deck, in the main column. One row at every width: how many are
   ticked, then Select All Cards while none are, or Options and Add once some
   are. While cards are ticked it sticks to the bottom of the screen as long
   as the deck is on it, and settles under the deck at its end; the choices
   fold open above the row. With none ticked (data-deck-pick-empty, which the
   server draws too) it is a plain row under the deck. It has the panels' offset
   shadow in both states, so it reads as one of the column's panels and does not
   change look when a card is ticked (final pass). Its buttons are action-items. */
.deck-pick-bar {
    position: sticky;
    bottom: 0;
    z-index: var(--z-sticky);
    display: grid;
    gap: var(--sp-2);
    margin-block-start: var(--sp-5);
    padding: var(--sp-2) var(--sp-3);
    border: var(--edge-w) solid var(--ink);
    background: var(--surface);
    box-shadow: var(--app-panel-shadow);
}

.deck-pick-bar[data-deck-pick-empty] {
    position: static;
}

/* Sticky, the bar never grows past the screen: with Options open on a short
   screen (a phone on its side) it scrolls inside itself, so Add stays reachable. */
.deck-pick-bar:not([data-deck-pick-empty]) {
    max-block-size: calc(100dvh - 2 * var(--sp-3));
    overflow-y: auto;
}

/* Room over the focus while the bar is sticky, so a control reached with Tab is
   never behind it (WCAG 2.4.11), as the shared selection bar does. The bar's
   height comes from deck-builder.js (--deck-pick-h on <html>, larger with
   Options open, which outranks the one-row default here). */
html:has(.deck-pick-bar:not([data-deck-pick-empty])) {
    --deck-pick-h: var(--sticky-bar-max);
    scroll-padding-block-end: calc(var(--deck-pick-h) + var(--sp-3));
}

.deck-pick-bar-row {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-block-size: var(--touch-min);
}

/* The count gives way (it may wrap inside itself) so the buttons stay on the row. */
.deck-pick-count {
    flex: 1 1 auto;
    min-inline-size: 0;
    font-weight: 700;
}

.deck-pick-bar-row .btn {
    flex: none;
}

/* The Options chevron points down while the options are open. A transform does
   nothing on an inline box, so the icon is given an inline-block one. */
.deck-pick-toggle .bi {
    display: inline-block;
}

.deck-pick-toggle[aria-expanded="true"] .bi {
    transform: rotate(180deg);
}

/* "Add" alone below 576px, and without its icon below 400px, so the row and the
   count stay one line on a phone beside the action-item buttons. Two classes,
   to outrank legacy `.btn span { position: relative }`. */
@media (max-width: 575.98px) {
    .deck-pick-add .deck-pick-add-more {
        position: absolute;
        inline-size: 1px;
        block-size: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

@media (max-width: 399.98px) {
    .deck-pick-add > .bi {
        display: none;
    }
}

.deck-pick-options {
    display: grid;
    gap: var(--sp-3);
    max-inline-size: var(--measure-form);
    padding-block-end: var(--sp-2);
    border-block-end: 1px solid var(--rule-soft);
}

.deck-pick-select {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

/* ── Import and Export, Deck Settings ─────────────────────────────────────── */
.deck-fold-export {
    margin-block-start: var(--sp-5);
    padding-block-start: var(--sp-4);
    border-block-start: 1px solid var(--rule-soft);
}

.deck-export {
    display: grid;
    gap: var(--sp-2);
    max-inline-size: 60rem;
}

/* Where the browser supports field-sizing (Chromium, Edge) the box is as tall as its
   text, so at 320px a list whose long names wrap still shows whole, between a floor of
   three lines (field-sizing ignores the rows attribute, so the floor is set here: three
   line heights plus Bootstrap's .375rem padding and the border, top and bottom) and the
   cap. Browsers without field-sizing keep the three to twelve rows the partial counts,
   under the same cap (final pass). Scoped under .deck-export so the floor outranks
   Bootstrap's textarea.form-control min-height; !important only because the legacy
   touch layer's 44px floor on .form-control is !important, and three lines (about
   80px) only ever raises that floor, never undercuts it. */
.deck-export .deck-export-list {
    min-block-size: calc(3lh + .75rem + 2 * var(--bs-border-width)) !important;
    max-block-size: 20rem;
    field-sizing: content;
}

.deck-export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.deck-fold .app-danger-zone {
    margin-block-start: var(--sp-5);
    max-inline-size: var(--measure-form);
}

/* ── Touch: 44px for this page's own controls ─────────────────────────────────
   Below 992px and under any pointer that is not a fine hovering mouse, as the
   site's touch layer does (DK17, LS-ME11). The stepper, the line menu and the
   disclosures carry their own. */
@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    .deck-add-qty,
    .deck-add-finish,
    .deck-add-button,
    .deck-results-pages .btn,
    .deck-pick-bar .btn,
    .deck-export-actions .btn,
    .deck-sources-body .btn {
        min-block-size: var(--touch-min);
    }
}

/* ── Decks list and New Deck (mig-decks-list) ───────────────────────────────
   Pages/Decks/Index.cshtml and New.cshtml are components (app-page-header,
   app-panel, app-link-list and app-link-row, app-empty, _Stepper, app-form-*,
   app-check-group). This file holds the choice grid New Deck's first two steps
   draw (Pages/Shared/_ChoiceGrid.cshtml) and the little spacing New Deck owns.
   docs/ui/dead-css/mig-decks-list.md lists what this unit left unused. */

/* New Deck: the stepper sits in the page's grid like any other block, so the
   page's gap is the only space around it (no margin of its own above or under;
   audit LS-ME17). */
.decks-new > .stepper {
    margin-block: 0;
}

/* Step 3: where the format's rules came from, then the form, one gap apart. */
.decks-new-rules {
    display: grid;
    gap: var(--sp-1);
    max-inline-size: var(--measure);
    margin-block-end: var(--sp-4);
}

/* ── _ChoiceGrid ─────────────────────────────────────────────────────────────
   Pick-one-of-many cards that are links (audits DK19, LS-ME9). As many columns
   of at least 20rem as the grid's own width holds: one on a phone, two on a
   tablet, three at 1280, five at 1920. min(100%, 20rem) keeps a column inside a
   panel narrower than 20rem (a 320px phone) without overflowing. Each card's
   text sits at the top, so in a row of uneven cards the titles and sentences
   line up; chips sit on the title's line and are drawn only when there are
   some. */
.choice-grid-groups {
    display: grid;
    gap: var(--sp-4);
}

/* A group title has a class, so the panel's in-content heading rule
   (components/panel.css) skips it; it takes the same h3 scale here so the
   group reads as a section heading under the h2, not as body text. */
.choice-grid-heading {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--fs-h3);
    font-weight: 700;
    line-height: var(--lh-tight);
    letter-spacing: .01em;
    color: var(--ink);
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
    gap: var(--sp-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* New Deck's first step: the nine games make three even rows of three from 768px,
   instead of a lone last tile on a tablet and a hole at 1920 (final pass). Keyed
   on the step's panel heading id, so the formats step keeps adding columns. */
@media (min-width: 768px) {
    .decks-new:has(#deck-choose-game) .choice-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.choice-grid-item {
    display: grid;
    min-inline-size: 0;
}

/* The card is the link: ink frame, the small offset block, and on hover or
   focus the lift and the large block every link row and card tile uses. The
   ink ring sits outside the border, in the grid's gap. */
.choice-card {
    display: grid;
    align-content: start;
    gap: var(--sp-1);
    min-block-size: var(--touch-min);
    padding: var(--sp-2h) var(--sp-3);
    border: var(--edge-w) solid var(--ink);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--ink);
    text-decoration: none;
}

.choice-card:hover,
.choice-card:focus-visible {
    color: var(--ink);
    transform: var(--hover-lift);
    box-shadow: var(--shadow-lg);
}

.choice-card:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

.choice-card:active {
    transform: none;
    box-shadow: none;
}

/* The title is underlined like every link row's, so the card reads as a link
   without relying on its frame. */
.choice-card-title {
    font-weight: 700;
    line-height: var(--lh-tight);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .15em;
    overflow-wrap: anywhere;
}

.choice-card-copy {
    font-size: var(--fs-3);
    color: var(--ink-muted);
    text-wrap: pretty;
}

/* The title and its chips share a line, and the chips wrap under the title
   when the card is too narrow for both. The head is at least one small badge
   tall and centres what is on its line, so a card with a chip (Rotates) starts
   its sentence where its neighbours without one do (final pass). */
.choice-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-1) var(--sp-2);
    min-inline-size: 0;
    min-block-size: calc(var(--fs-2) * var(--lh-tight) + 2 * var(--sp-0) + 2 * var(--edge-w-hair));
}

.choice-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1);
}

@media (prefers-reduced-motion: reduce) {
    .choice-card:hover,
    .choice-card:focus-visible {
        transform: none;
    }
}

/* ── Docs and the policies (unit mig-docs-policies) ───────────────────────────
   Pages/Docs/Index, Pages/Docs/Article, Pages/Privacy and Pages/Terms. The
   reading text is <app-prose> (components/content-blocks.css); this file only
   adds what these pages need beyond it: the policies' sections drawn as parts
   of one text, and the article pager. Website only; the admin's twins use
   Polaris and embedded.css. */

/* ── Policy sections ─────────────────────────────────────────────────────────
   Audits SH20 and LS-SH11. _PrivacyPolicy and _TermsOfService write each
   section as an <app-panel>, because the admin draws each one as a Polaris
   section. On the website they sit inside one panel's <app-prose>, so here a
   section loses the panel frame (border, offset shadow, padding) and is set
   off from the one before it by a soft rule. Each rule has one more class than
   the panel's own, so nothing needs !important. */
.policy-prose .app-panel {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: none;
}

.policy-prose .app-panel + .app-panel {
    margin-block-start: var(--sp-6);
    padding-block-start: var(--sp-5);
    border-block-start: var(--edge-w-hair) solid var(--rule-soft);
}

.policy-prose .panel-heading,
.policy-prose .border-top-box {
    display: block;
    padding: 0;
    border: 0;
    background: none;
}

/* The section's h2 and its h3s take the prose scale, below the page's h1 at
   every width: the panel title's own clamp (up to 1.45rem) and Bootstrap's
   .h6 (1rem at 500) would otherwise win over the prose rules, which sit in
   :where(). */
.policy-prose h2.panel-title {
    margin-block: 0 var(--sp-3);
    font-size: var(--fs-h2);
    font-weight: 800;
    line-height: var(--lh-tight);
    scroll-margin-block-start: var(--sp-4);
}

.policy-prose h3 {
    margin-block: var(--sp-5) var(--sp-2);
    font-family: var(--font-display);
    font-size: var(--fs-h3);
    font-weight: 700;
    line-height: var(--lh-tight);
}

.policy-prose .border-top-box :is(p, ul) {
    margin-block: 0 var(--sp-4);
}

.policy-prose .border-top-box > :last-child {
    margin-block-end: 0;
}

.policy-prose .border-top-box :is(ul) {
    padding-inline-start: var(--sp-6);
}

.policy-prose .border-top-box li + li {
    margin-block-start: var(--sp-2);
}

/* ── The reading column ──────────────────────────────────────────────────────
   The article's and the policies' one panel (extra-class="doc-reading") is as
   wide as what it holds: the text's measure, plus the "On This Page" column
   and its gap from 1200px, plus the panel's own padding and border. Without
   it the panel ran the page's width, and from 1920 a third of the framed box
   was empty, with the pager's Next at its far end (review of this unit). The
   page header above it takes the same cap, so its rule ends where the panel
   ends instead of running on over an empty band (final pass, docs-status).
   The width is held as tokens on the page and resolved on each box, so the ch
   is that box's own font; the header and the panel share the prose's, so the
   cap tracks the text's 58ch at every root size. Both keep the page's start
   edge, under the trail. */
.app-page:has(> .doc-reading) {
    --doc-reading-text: min(var(--measure), 58ch);
    --doc-reading-w: calc(var(--doc-reading-text) + 2 * var(--sp-5) + 2 * var(--edge-w));
}

@media (min-width: 1200px) {
    .app-page:has(> .doc-reading) {
        --doc-reading-w: calc(var(--toc-w) + var(--sp-6) + var(--doc-reading-text) + 2 * var(--sp-5) + 2 * var(--edge-w));
    }
}

.app-page:has(> .doc-reading) > :is(.page-header, .doc-reading) {
    max-inline-size: var(--doc-reading-w);
}

/* ── Article pager ───────────────────────────────────────────────────────────
   The Docs article's footer (audit: the Docs article footer low). Two cells,
   each a whole link with a small "Previous" or "Next" over the article's
   title: side by side from 576px, Next always at the end, and stacked full
   width on a phone. Every cell is at least 44px tall. */
.doc-pager {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-3);
}

.doc-pager-link {
    display: grid;
    align-content: center;
    gap: var(--sp-1);
    min-block-size: var(--touch-min);
    padding: var(--sp-2h) var(--sp-3);
    border: var(--edge-w) solid var(--ink);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--ink);
    text-decoration: none;
}

.doc-pager-link:hover {
    transform: var(--hover-lift);
    box-shadow: var(--shadow-lg);
}

.doc-pager-link:hover .doc-pager-title {
    text-decoration: underline;
}

.doc-pager-link:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

.doc-pager-label {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    font-size: var(--fs-3);
    font-weight: 600;
    color: var(--ink-muted);
}

/* A title that takes two lines splits them evenly, not with one word left
   alone on the second (final pass, docs-status). */
.doc-pager-title {
    font-family: var(--font-display);
    font-weight: 800;
    line-height: var(--lh-tight);
    overflow-wrap: break-word;
    text-wrap: balance;
}

.doc-pager-link--next {
    text-align: end;
}

.doc-pager-link--next .doc-pager-label {
    justify-content: end;
}

@media (min-width: 576px) {
    .doc-pager {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .doc-pager-link--next {
        grid-column: 2;
    }
}

@media (prefers-reduced-motion: reduce) {
    .doc-pager-link:hover {
        transform: none;
    }
}

/* ── Holding, Tags and Import (mig-portfolio-holding) ──────────────────────────
   The classes Pages/Portfolio/HoldingDetails.cshtml, Tags.cshtml and Import.cshtml own.
   The page heads, panels, forms, steppers, badges, tables and price blocks are
   components (_DetailLayout, app-page-header, app-panel, app-form-*, _QtyStepper,
   app-badge, app-table, the app-price-block classes of _PriceList); these lay out a
   holding's variant rows and tag counts, mark the price a copy is valued from, open a
   tag's Edit fold across its row, and cap the Import file field.
   docs/ui/dead-css/mig-portfolio-holding.md lists the legacy rules this unit left unused.
   Usage: the classes are written in those three views only. */

/* The facts under the value (Owned, Market Each, Paid, Gain, Notes). The lead lays its
   items out at their own width, and app-dl sizes itself by its container, so the list is
   given the lead's width (at most the form measure) to lay out in. */
.app-detail-lead > .holding-facts {
    justify-self: stretch;
}

/* ── Copies by Variant ─────────────────────────────────────────────────────────
   One row per condition and printing. The name has a line of its own; the price of
   each, the stepper and the row's value share the next line, centred on the stepper
   so the value sits beside the count it follows; what was paid comes last. A long
   name never squeezes the stepper (audit PF13). From 44rem of list (the body beside
   the art on a laptop) the three parts sit on one row. The list and its Total stop at
   the form grid's 60rem, so on a wide screen a row's name and its figures are not a
   screen apart (as LS-ME8 says of list rows). */
.holding-variants,
.holding-variant-total {
    max-inline-size: 60rem;
}

.holding-variants {
    container: holding-variants / inline-size;
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.holding-variant {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "name" "figures" "paid";
    gap: var(--sp-2) var(--sp-4);
    align-items: center;
    padding-block: var(--sp-3);
    border-block-end: var(--edge-w-hair) solid var(--rule-soft);
}

.holding-variant:first-child {
    padding-block-start: 0;
}

.holding-variant-name {
    grid-area: name;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--sp-1) var(--sp-2);
    margin: 0;
    min-inline-size: 0;
}

.holding-variant-name > span {
    color: var(--ink-muted);
}

/* A phone's row is narrow: the small gap keeps Each, the stepper and the value on one
   line from 320px. */
.holding-variant-figures {
    grid-area: figures;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
    min-inline-size: 0;
}

.holding-variant-each {
    white-space: nowrap;
    font-size: var(--fs-3);
}

.holding-variant-label {
    color: var(--ink-muted);
}

/* The row's value: the count times the price of each, kept in step by holding-variants.js. */
.holding-variant-value {
    margin-inline-start: auto;
    text-align: end;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Paid Each reads as one line: its label, then the field. */
.holding-variant-paid {
    grid-area: paid;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-1) var(--sp-2);
    min-inline-size: 0;
}

.holding-variant-paid > .form-label {
    margin: 0;
    font-size: var(--fs-3);
    color: var(--ink-muted);
}

@container holding-variants (min-width: 44rem) {
    .holding-variant {
        grid-template-columns: minmax(10rem, 1fr) auto auto;
        grid-template-areas: "name figures paid";
    }

    .holding-variant-figures {
        flex-wrap: nowrap;
        column-gap: var(--sp-4);
    }

    /* The values line up down the rows once the rows are one line each. */
    .holding-variant-value {
        min-inline-size: 5rem;
    }
}

.holding-variant-total {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: baseline;
    gap: var(--sp-2);
    margin: var(--sp-3) 0 0;
    font-variant-numeric: tabular-nums;
}

.holding-variant-total > span {
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

/* ── Tag counts ───────────────────────────────────────────────────────────────
   The tag and the copies it is on, then the stepper. Held to the form measure, so the
   stepper stays beside the tag it counts on a wide screen. */
.holding-tag-counts {
    display: grid;
    max-inline-size: var(--measure-form);
    margin: 0;
    padding: 0;
    list-style: none;
}

.holding-tag-count {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2) var(--sp-4);
    padding-block: var(--sp-2);
    border-block-end: var(--edge-w-hair) solid var(--rule-soft);
}

.holding-tag-count-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-1) var(--sp-2);
    margin: 0;
    min-inline-size: 0;
}

.holding-tag-count-name > span:last-child {
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

/* ── Catalogue Prices ─────────────────────────────────────────────────────────
   The Yours line is _PriceList's own (components/detail.css). */
.holding-prices-source {
    margin-block-start: var(--sp-4);
}

/* ── Tags: a custom tag's Edit fold ──────────────────────────────────────────
   The count, Show and the Edit summary keep their places whether the fold is open or
   closed; only the fold's body opens below them, across the whole row, so the Name,
   Colour, Save and Delete fields have the row's width rather than a button's (audit
   PF35). Edit has a column of its own, which the built-in Up For Trade row leaves empty,
   so Show lines up down the list.
   This needs ::details-content, the box a <details> holds its body in: the row's action
   cell and the fold are display: contents, so Show, the summary and the body are each
   placed in the row's own grid. A browser without it gets the fallback below: the open
   fold's action cell takes the whole row under the name. */
.tag-rows {
    --tag-edit-slot: 4.5rem;
}

.tag-rows .app-row-action {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-end;
    gap: var(--sp-2);
}

.tag-rows .app-row:has(.tag-edit[open]) .app-row-action {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-content: flex-start;
}

.tag-rows .tag-edit[open] {
    flex: 1 1 100%;
    text-align: start;
}

@supports selector(::details-content) {
    /* A phone's row: the name, the count, then Show and Edit on one line, and the fold's
       body under them. */
    .tag-rows .app-row--list.app-row--no-icon {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "body body"
            "stats stats"
            "show edit"
            "fold fold";
    }

    .tag-rows .app-row-action,
    .tag-rows .tag-edit {
        display: contents;
    }

    .tag-rows .app-row-action > a {
        grid-area: show;
        justify-self: start;
        margin-block-start: var(--sp-2);
    }

    .tag-rows .tag-edit > .app-disclosure-summary {
        grid-area: edit;
        justify-self: start;
        align-self: center;
        margin-block-start: var(--sp-2);
        margin-inline-start: var(--sp-2);
    }

    .tag-rows .tag-edit::details-content {
        grid-area: fold;
        min-inline-size: 0;
    }

    @media (min-width: 576px) {
        .tag-rows .app-row--list.app-row--no-icon {
            grid-template-columns: minmax(0, 1fr) auto auto var(--tag-edit-slot);
            grid-template-areas:
                "body stats show edit"
                "fold fold fold fold";
        }

        .tag-rows .app-row-action > a {
            margin-block-start: 0;
            margin-inline-start: var(--sp-3);
        }

        .tag-rows .tag-edit > .app-disclosure-summary {
            margin-block-start: 0;
        }
    }
}

/* A tag's colour chip wraps a long name inside the row instead of running past it. */
.tag-rows .tag-chip {
    max-inline-size: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.tag-edit-delete {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2) var(--sp-3);
    margin-block-start: var(--sp-4);
    padding-block-start: var(--sp-3);
    border-block-start: var(--edge-w-hair) solid var(--rule-soft);
}

/* ── Import ───────────────────────────────────────────────────────────────── */
.import-file {
    max-inline-size: var(--field-w-lg);
}

.import-row-name {
    display: block;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.import-row-marks {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-1) var(--sp-2);
    margin-block-start: var(--sp-1);
    font-size: var(--fs-3);
    font-weight: 400;
    color: var(--ink-muted);
}

.import-row-marks:empty {
    display: none;
}

.import-details {
    margin-block: var(--sp-4);
    max-inline-size: var(--measure-form);
}
.import-sources {
    max-inline-size: var(--measure);
}

/* The result's counts: one and a half form measures (60rem), so a count's term and its
   figure stay in reach of each other on a wide screen. */
.import-result .app-dl {
    max-inline-size: calc(var(--measure-form) * 1.5);
}

/* ── Portfolio lists (mig-portfolio-lists) ───────────────────────────────────
   The classes Collection Stats, the Wishlist, Collections and a collection's page
   own. Their headers, figures, rows, forms, filter and sort bars, chart, selection
   bar and danger zone are components; these only space the few page parts left.
   docs/ui/dead-css/mig-portfolio-lists.md lists the legacy rules this unit left
   unused. Usage: the classes are written in Pages/Portfolio/Stats.cshtml,
   Wishlist.cshtml, Binders.cshtml and Binder.cshtml only. */

/* A collection's note under its set progress: how many matching cards are not in it.
   Muted help, held to the measure. */
.portfolio-binder-note {
    max-width: var(--measure);
    margin: var(--sp-2) 0 0;
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

/* A wish's Edit fold: the fields start a step below the Edit summary. */
.wish-row-edit > form:first-of-type {
    margin-top: var(--sp-2);
}

/* A wish's Edit fold: Remove From Wishlist sits under the Save row, apart from it, so
   the destructive button is never next to Save. */
.wish-row-edit .wish-edit-remove {
    margin-top: var(--sp-3);
    padding-top: var(--sp-3);
    border-top: 1px solid var(--rule-soft);
}

/* ── Portfolio grid (mig-portfolio-grid) ──────────────────────────────────────
   The classes Pages/Portfolio/Index.cshtml and its partials own. The header, the
   figures, the filter bar, the panels, the tiles and the Select Cards bar are
   components; these only lay out the value summary, the set's figures, the set
   progress label, Add From Catalogue and the grid's group headings (U23). docs/ui/dead-css/mig-portfolio-grid.md
   lists the legacy rules this unit left unused. Usage: the classes are written in
   Pages/Portfolio/Index.cshtml, _SetProgress.cshtml and _SetViewToggle.cshtml only. */

/* The value summary under the header: the collection's value and its month's change,
   the facts, and the month's line. On a phone only the value and its change show, so
   the cards start near the top (audit PF2); Stats has the breakdown. Below 992px the
   summary is one column, where the line alone took the full width and about 160px, so
   on a tablet (768x1024) the first cards started below the fold; the line shows from
   992px, where it sits beside the value. */
.portfolio-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-3);
    min-width: 0;
}

.portfolio-summary > * {
    min-width: 0;
}

@media (max-width: 575.98px) {
    .portfolio-summary-facts {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .portfolio-summary-chart {
        display: none;
    }
}

/* From 992px one row: the value, the facts, the line (LS-ME3). */
@media (min-width: 992px) {
    .portfolio-summary {
        grid-template-columns: auto minmax(0, 1fr) minmax(14rem, 26rem);
        align-items: center;
        column-gap: var(--sp-5);
    }

    /* No month's line yet (fewer than two points): no third track left empty (final pass). */
    .portfolio-summary:not(:has(> .portfolio-summary-chart)) {
        grid-template-columns: auto minmax(0, 1fr);
    }
}

/* 992 to 1199px with a line: the middle track is too narrow for three facts in a row, so they
   wrapped two and one. The facts go under the value instead and the line takes the second
   column beside both (final pass). */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .portfolio-summary:has(> .portfolio-summary-chart) {
        grid-template-columns: auto minmax(14rem, 1fr);
    }

    .portfolio-summary > .portfolio-summary-chart {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}

/* 1200 to 1439px with four or five facts (Sealed, Graded or Unpriced held): the middle track
   (518px at 1280) is narrower than four facts (about 490px) or five (about 604px), which left
   the last fact alone across a second row. They go under the value as from 992px. Three facts
   fit the track, so the common summary keeps its one row (final pass, checked with all five). */
@media (min-width: 1200px) and (max-width: 1439.98px) {
    .portfolio-summary:has(> .portfolio-summary-chart):has(> .portfolio-summary-facts > :nth-child(4)) {
        grid-template-columns: auto minmax(14rem, 1fr);
    }

    .portfolio-summary:has(> .portfolio-summary-facts > :nth-child(4)) > .portfolio-summary-chart {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}

/* The figures of the chosen game or set beside the set's progress. */
.portfolio-segment-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-4);
    min-width: 0;
}

@media (min-width: 768px) {
    .portfolio-segment-body {
        grid-template-columns: minmax(10rem, max-content) minmax(0, 1fr);
        align-items: start;
        column-gap: var(--sp-6);
    }
}

/* The set progress label: a small caps label over its bar, on every page that draws
   _SetProgress (the portfolio, a collection, a collector's collection). */
.set-progress-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--fs-3);
    font-weight: 900;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    color: var(--ink-muted);
}

/* The figure beside Set Progress: its percentage in the small type, never under the 12px
   floor (it was half the count's size, 8px; final pass). */
.set-progress-head small {
    font-size: var(--fs-2);
    color: var(--ink-muted);
}

/* Owned and Missing, Export Checklist and Browse the Set: stacked on a phone, each its own
   width; from 576px one wrapping row, so Browse the Set follows Export Checklist when there
   is room (final pass: it sat alone on a second line). */
.set-progress-actions {
    display: grid;
    gap: var(--sp-2);
    justify-items: start;
}

@media (min-width: 576px) {
    .set-progress-actions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

    .set-progress-actions > .set-view-actions {
        display: contents;
    }
}

/* The filter bar's selects from 992px: the two whose chosen option is long start at its width,
   so it fits its field and the row wraps instead (final pass: the Set select read "MEW · Scarlet
   & Vic" at 200px). Set starts at 15.5rem ("MEW · Scarlet & Violet 151" measures 248px with the
   select's padding and arrow) and Sort at 12rem ("Recently Updated", 187px); Game and Tag keep the
   bar's 11rem. The four still share one row at 1280px (792px of the 834px the fields have); a
   basis on every field put Sort alone on a second row there. */
@media (min-width: 992px) {
    .portfolio-filters .app-filter-bar-fields > .app-field:has(#portfolio-set) {
        flex-basis: 15.5rem;
    }

    .portfolio-filters .app-filter-bar-fields > .app-field:has(#portfolio-sort) {
        flex-basis: 12rem;
    }
}

/* Add From Catalogue: the search, then the results as tiles, each with its add under it. */
.portfolio-add-search {
    max-inline-size: 48rem;
    margin-block-end: var(--sp-4);
}

.portfolio-add-form {
    margin-block-start: var(--sp-2);
}

/* A short desktop screen (1280x720): tighter page gaps, a smaller figure and a lower line, so
   the first row of cards starts on the first screen (LS-ME3), as the page header does. */
@media (min-width: 992px) and (max-height: 800px) {
    .portfolio-page {
        row-gap: var(--sp-3);
    }

    .portfolio-summary .stat-hero .stat-value {
        font-size: var(--fs-7);
    }

    .portfolio-summary-chart .trend-chart--spark svg {
        height: 4rem;
    }
}

/* The count beside a grid's title: muted, a step smaller than the title, never wrapped apart. */
.portfolio-count {
    font-size: var(--fs-3);
    color: var(--ink-muted);
    white-space: nowrap;
}

/* A group's heading on the grid (inventory manager unit U23, _PortfolioTiles under a Group):
   the band store inventory's group rows draw (.table-group-heading), so the two pages head a
   group alike. The brand fill is right here for the same reason as there: the heading holds no
   controls and has to read as a section break, not as another card. The count after the name is
   in the body weight, so the name stays the heading. */
.portfolio-group-heading {
    margin: 0 0 var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    background-color: var(--brand-primary);
    color: var(--on-accent);
    border-block: var(--edge-w) solid var(--ink);
    font-size: var(--fs-4);
    font-weight: 700;
    line-height: var(--lh-tight);
}

/* Each group after the first starts clear of the grid above it. */
.portfolio-grid + .portfolio-group-heading {
    margin-top: var(--sp-5);
}

.portfolio-group-heading__count {
    font-weight: 400;
}

/* The forced palette drops the fill, so the rules above and below and the system text colour keep
   it a section break, as the store band's forced-colours rule does. */
@media (forced-colors: active) {
    .portfolio-group-heading {
        forced-color-adjust: auto;
        color: CanvasText;
        border-block: var(--edge-w) solid CanvasText;
    }
}

/* ── Public pages (mig-home-public) ───────────────────────────────────────────
   The classes the home, the landing, Pricing, Contact and Feedback own. The
   plan card is a component (components/plan-card.css). Legacy landing rules
   stay in legacy/05-work-nav.css; these follow them in the bundle and adjust
   them with one class each. Dead and yielded selectors are listed in
   docs/ui/dead-css/mig-home-public.md. */

/* The headline sets by balance instead of a hard <br>, and the block is wider
   from 1200px, so it holds two lines on large screens rather than three
   (audit SH34, LS-SH16). The copy keeps the measure. */
.landing-hero-title {
    text-wrap: balance;
}

.landing-hero-copy {
    max-inline-size: min(var(--measure), 36rem);
    text-wrap: pretty;
}

@media (min-width: 1200px) {
    .landing-hero-inner {
        max-inline-size: 52rem;
    }
}

/* A feature tile sits in a list item (the grid is a ul, so its aria-label is
   allowed), and the item is stretched by its grid (align="stretch"); the tile
   fills it. The icon is a Bootstrap icon in the brand tile, set on a fixed line
   so every title starts at the same height (audit LS-SH16, LS-SW23). */
.landing-feature-slot {
    display: flex;
    flex-direction: column;
}

.landing-feature-slot > .landing-feature-card {
    flex: 1 1 auto;
    align-content: start;
}

.landing-feature-icon {
    align-self: start;
    font-size: var(--fs-6);
}

.landing-feature-icon > .bi {
    display: block;
    line-height: 1;
}

.landing-feature-copy {
    max-inline-size: var(--measure);
}

/* The games as a list of neutral app-badges, on the landing and on Pricing
   (audit SH19, LS-SH15): a hairline outline on the surface, no fill and no
   shadow, so nine labels never read as a row of yellow primary buttons.
   The badges are inline blocks in a balanced block, so the lines share them
   out evenly (5 and 4 at 1280, not 8 and one badge alone on the second line;
   final pass 2026-11-18). The legacy flex row could not be balanced. The space
   between two badges is the item's end margin, and its bottom margin is the
   row gap, taken back off the list's own end. */
.public-game-pills {
    display: block;
    margin: 0 0 calc(-1 * var(--sp-2));
    padding: 0;
    list-style: none;
    text-wrap: balance;
}

.public-game-pills > li {
    display: inline-block;
    margin: 0 var(--sp-2) var(--sp-2) 0;
}

/* Feedback: the member's own recent messages, newest first. The message stops
   at the measure; the status badge sits at the row's end from 768px, where the
   home's Recent Sales put their trailing value, rather than straight after the
   capped message in the middle of the row (final pass 2026-11-18). Below 768px
   it wraps under the message at the start. */
.public-feedback-list {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.public-feedback-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: var(--sp-2) var(--sp-4);
    padding-block: var(--sp-3);
    border-block-start: var(--edge-w-hair) solid var(--rule-soft);
}

.public-feedback-item:first-child {
    border-block-start: 0;
    padding-block-start: 0;
}

.public-feedback-body {
    flex: 1 1 16rem;
    min-inline-size: 0;
    max-inline-size: var(--measure);
    overflow-wrap: anywhere;
}

@media (min-width: 768px) {
    .public-feedback-item > .app-badge {
        margin-inline-start: auto;
    }
}

.public-feedback-when {
    color: var(--ink-muted);
    font-size: var(--fs-2);
}

/* The Start panel's buttons (_StoreWorkPanels) go two across as soon as two of
   the longest label fit: "Manage Inventory" is 167px with its padding, so two
   and the compact gap need 21.75rem. The grid's min="card" would wait for
   33.25rem, which a third of the Store at 1280 (353px) never reaches, and Work
   Waiting kept about 110px empty under it there. From 33.25rem the card rules
   take over (two, then three). Same pattern as admin-jobs.css on its stat grid. */
@container app-grid (21.75rem <= width < 33.25rem) {
    .store-work-start-grid > * {
        flex-basis: calc((100% - var(--app-grid-gap)) / 2 - 1px);
    }
}

/* The home's collection before it has cards: one sentence, held to the measure
   (it ran about 94 characters a line from 1920px). */
.public-home-copy {
    max-inline-size: var(--measure);
}

/* In the dark theme the hero's block is the light ink, where yellow text fell
   to about 1.3:1 (axe color-contrast). The accent there is ink on a yellow
   highlight, which keeps the brand pair and clears 4.5:1. */
[data-bs-theme="dark"] .landing-hero-accent {
    color: var(--on-accent);
    background: var(--brand-primary);
    padding-inline: .12em;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* The home's collection actions (.public-home-actions, set on the home's bar only, so
   Portfolio, Decks and the other value-hero pages do not inherit this when they move to
   app-action-bar) take the whole foot row: the foot is a flex row, and a bar sized to its
   buttons left half-width buttons pinned left at 320 and an empty strip at 375. Up to
   768px the four buttons stay two equal columns (one below 360px, from action-bar.css), as
   on a phone, instead of three and a straggler; from 768px they are one row at their own
   widths. The 576-767 grid extends phone="grid" by hand; a grid-up-to-md option on the
   component would replace it (noted for the action-bar owner in the PR). */
.value-hero-foot > .public-home-actions {
    flex: 1 1 100%;
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .value-hero-foot > .public-home-actions {
        align-items: stretch;
    }

    .value-hero-foot > .public-home-actions .app-action-bar-actions {
        display: grid;
        flex: 1 1 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .value-hero-foot > .public-home-actions .app-action-bar-actions > * {
        inline-size: 100%;
    }
}

/* ── Card scanner (Products/Scan, mig-scan) ──────────────────────────────────
   The classes Pages/Products/Scan.cshtml owns. The header, tabs, folds, figures and empty
   state are components (app-page-header, app-segmented tabs, app-disclosure, app-check-field,
   app-stat-grid, app-empty, app-panel); these lay out the title row and toolbar, the camera
   stage and the three panes.

   Below 992px the shell is locked to the screen and shows one pane at a time (the shell's
   lock is still the legacy "Card scanner shell" block in legacy/06-utilities-buylist-scan.css,
   which card-scan.js sizes). From 992px every pane shows, the tabs go, and the page scrolls,
   but the stage is still bounded: card-scan.js hands it the room above the Capture row as
   --scan-stage-room (audit LS-PR1, PT7).

   docs/ui/dead-css/mig-scan.md lists the legacy selectors this unit left unused. */

/* ── Read by a screen reader, not drawn ───────────────────────────────────── */

/* One rule for the three things this page keeps for a screen reader where there is no room to
   draw them: the h1 inside the locked scanner (below 992px), the game's label on a phone (below
   576px) and the live region (drawn over the preview instead). Each is drawn again where there is
   room, by the rules after it. The site's .visually-hidden is forced over every other rule, so it cannot be undone
   at a breakpoint. */
.scan-top > .scan-header,
.scan-toolbar__label,
.scan-status-line {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ── Title row: the page header and the toolbar ─────────────────────────── */

.scan-top {
    display: grid;
    gap: var(--sp-2);
    min-width: 0;
}

/* The locked scanner: every row is doing work, so the h1 is kept for the outline and read by
   a screen reader, but not drawn (the shared rule above; audit PT15: visible above the lock,
   hidden only inside it). */

/* From 992px a compact title row: the title on the left, the toolbar beside it, one ink rule
   under both (audit LS-PR11). */
@media (min-width: 992px) {
    .scan-top {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        column-gap: var(--sp-5);
        padding-block-end: var(--sp-3);
        border-block-end: var(--edge-w-strong) solid var(--ink);
    }

    .scan-top > .scan-header {
        position: static;
        width: auto;
        height: auto;
        padding: 0;
        margin: 0;
        overflow: visible;
        clip-path: none;
        white-space: normal;
        border: 0;
    }

    .scan-top > .scan-toolbar {
        justify-content: flex-end;
    }
}

/* The toolbar: the game, Start, Photos, Folder and Scan Settings. Every control is the same
   height and centred on one line, labels and buttons alike (audit LS-PR17: the Folder label
   sat 1-2px above Start), and every one is a 44px target. */
.scan-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
    min-width: 0;
}

/* The game select grows with the row, but no further than a game's name needs (it ran 900px
   wide at 1920, LS-PR17). */
.scan-toolbar__game {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex: 1 1 14rem;
    max-inline-size: 24rem;
    min-width: 0;
}

/* Drawn from 576px; below it the select shows the game and the label is read only (the shared
   rule above, audit PT6). */
@media (min-width: 576px) {
    .scan-toolbar__label {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        overflow: visible;
        clip-path: none;
    }
}

.scan-toolbar__label {
    font-weight: 600;
}

.scan-toolbar__select {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    min-block-size: var(--touch-min);
}

.scan-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-1h);
    min-block-size: var(--touch-min);
    margin: 0;
    padding-inline: var(--sp-3);
    line-height: var(--lh-tight);
    white-space: nowrap;
    vertical-align: middle;
}

/* Choosing a whole folder is a desktop thing. */
.scan-tool--folder {
    display: none;
}

@media (min-width: 992px) {
    .scan-tool--folder {
        display: inline-flex;
    }
}

/* Phones: the game and Start on one row, Photos and Scan Settings under it. The select keeps
   room for a whole game's name ("Magic: The Gathering" at 320px); it had shrunk to "Disne" beside
   Photos. The game's label is read by a screen reader only; the select shows the game (audit
   PT6). Photos wraps to the second row on its own once the first is full. */
@media (max-width: 575.98px) {
    .scan-toolbar__game {
        flex: 1 1 11rem;
        max-inline-size: none;
    }

    .scan-tool {
        padding-inline: var(--sp-2h);
    }

    /* Scan Settings share the second row with Photos; the open body is still the toolbar's
       width, so the body hangs from the toolbar, not from the summary. */
    .scan-toolbar {
        position: relative;
    }

    /* Never narrower than the name and the chevron: from 540 to 575px Photos left the fold too
       little and "Scan Settings" ran under the chevron. Without the room it takes a line. */
    .scan-settings {
        flex: 1 0 auto;
    }

    /* Two classes: the base rule further down makes the fold the body's containing block. */
    .scan-toolbar > .scan-settings {
        position: static;
    }
}

/* Under 360px Start's word is enough: its icon's 22px go to the select, so "Magic: The
   Gathering" is whole at 320px. */
@media (max-width: 359.98px) {
    .scan-toolbar > .scan-tool.btn-primary > .bi {
        display: none;
    }
}

/* Scan Settings. Its summary says what is set, on one line beside the name: a long finish and
   condition end in an ellipsis on screen, and are read whole (sharing a phone's row with Photos,
   the meta wrapped the summary to 60px). */
.scan-settings > .app-disclosure-summary,
.scan-settings .app-disclosure-text {
    flex-wrap: nowrap;
    min-width: 0;
}

.scan-settings .app-disclosure-label {
    flex: 0 0 auto;
    white-space: nowrap;
}

.scan-settings .app-disclosure-meta {
    display: inline-block;
    flex: 0 1 auto;
    min-width: 0;
    max-inline-size: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

/* 992 to 1199px: the title row has room for the controls or for the meta, not both, so the
   meta goes (the settings are one click away, and the fold's name still says what it is). */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .scan-settings .app-disclosure-meta {
        display: none;
    }
}

/* A phone: Scan Settings share their row with Photos, which leaves the meta a few letters
   ("Stan..." at 375px), so the summary is just its name; what is set is one tap away. */
@media (max-width: 575.98px) {
    .scan-settings .app-disclosure-meta {
        display: none;
    }
}

/* The body opens over the page under its summary, so opening it moves nothing: on a phone the
   preview keeps its size and Capture stays on screen. Under 576px it is the toolbar's width,
   from 576px at most 26rem at the toolbar's end. Where the toolbar wraps (576 to about 990px)
   the summary starts a line, and the end edge would put the panel's start off the screen:
   card-scan.js measures it when it opens and slides it back by --scan-settings-shift. It
   closes on Escape (focus back on the summary) and on a click elsewhere. */
.scan-settings {
    position: relative;
    min-width: 0;
}

.scan-settings > .app-disclosure-body {
    position: absolute;
    inset-block-start: calc(100% + var(--sp-1));
    inset-inline: calc(-1 * var(--edge-w));
    z-index: var(--z-dropdown);
    background: var(--surface);
    border: var(--edge-w) solid var(--ink);
    box-shadow: var(--shadow-md);
    /* Never past the bottom of the screen: the locked shell clips what crosses it, so on a short
       phone (320x568) the Condition select fell out of reach. card-scan.js measures the room under
       the summary when the fold opens; whatever does not fit scrolls inside the panel. */
    --scan-settings-room: none;
    max-block-size: var(--scan-settings-room);
    --scan-settings-shift: 0px;
    translate: var(--scan-settings-shift) 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

@media (min-width: 576px) {
    .scan-settings {
        flex: 0 0 auto;
    }

    .scan-settings > .app-disclosure-body {
        inset-inline-start: auto;
        inline-size: min(26rem, calc(100vw - 2 * var(--page-gutter)));
    }
}

.scan-as {
    min-width: 0;
    margin: var(--sp-3) 0 0;
    padding: 0;
    border: 0;
}

.scan-as__legend {
    float: none;
    margin: 0 0 var(--sp-1);
    font-size: inherit;
    font-weight: 700;
}

.scan-as__fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: var(--sp-2) var(--sp-3);
}

.scan-as__field {
    min-width: 0;
}

.scan-as__field > .form-label {
    margin-block-end: var(--sp-1);
}

.scan-as__field > .form-select {
    min-block-size: var(--touch-min);
}

.scan-as__help {
    margin: var(--sp-2) 0 0;
}

/* ── Tabs and the status line ─────────────────────────────────────────────── */

/* A tab's name stays on one line: the component lets a phone-width option wrap, which broke
   "Batch" in two beside its count when the strip was narrow (568x320). The three names fit. */
.scan-shell .scan-view-tabs .app-segmented-option {
    white-space: nowrap;
    overflow-wrap: normal;
}

/* Every pane is on screen from 992px, so there is nothing to switch. */
@media (min-width: 992px) {
    .scan-shell .scan-view-tabs {
        display: none;
    }
}

/* The finders' own strip (Search | Camera, U26) is the wide screen's: below 992px the strip above
   holds both, so this one is not drawn. From 992px it sits over the first column, as wide as its
   two options. */
@media (max-width: 991.98px) {
    .scan-shell .scan-finder-tabs {
        display: none;
    }
}

@media (min-width: 992px) {
    .scan-shell .scan-finder-tabs {
        justify-self: start;
        margin-block-start: var(--sp-4);
    }
}

/* The live region. Drawn over the preview (.scan-stage__status), so it is read here but not
   drawn (the shared rule above), except while another pane hides the preview on a phone or
   tablet. */
@media (max-width: 991.98px) {
    .scan-shell:has(#scan-pane-camera[data-scan-off]) .scan-status-line {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        overflow: visible;
        clip-path: none;
        white-space: normal;
        text-align: center;
    }
}

/* ── The locked shell's height ───────────────────────────────────────────── */

/* Under 992px card-scan.js (sizeShell) measures the room the screen leaves under the header and
   sets it as --scan-shell-h, so the scanner fills the screen and the page does not scroll. Unset,
   as it is from 992px, the shell is as tall as its content. A custom property, not an inline
   height: the server and the script write no inline style but custom properties (final pass). */
.scan-shell {
    --scan-shell-h: auto;
    block-size: var(--scan-shell-h);
}

/* ── The locked shell's edges ─────────────────────────────────────────────── */

/* The locked shell and its scrolling panes clip what crosses their edges, which cut the focus
   ring off Start and the tabs and the offset shadow off the panels (audit AY7). They are padded
   by the ring's reach and pulled back by as much, so nothing moves and nothing is cut. */
@media (max-width: 991.98px) {
    .scan-shell {
        padding: var(--sp-1h) var(--sp-1h) 0;
        margin-inline: calc(-1 * var(--sp-1h));
    }

    .scan-shell .scan-flex {
        padding: var(--sp-1h);
        margin-inline: calc(-1 * var(--sp-1h));
    }

    /* The scrolling panes take the focus (the browser makes a scroller a Tab stop), so their
       ring is drawn inside, where the shell cannot cut it. */
    .scan-shell .scan-flex:focus-visible {
        outline: var(--focus-ring);
        outline-offset: var(--focus-inset);
    }
}

/* ── A phone held sideways ─────────────────────────────────────────────── */

/* Under 992px and 480px or less tall (667x375, 844x390) the rows stacked under one another left
   a 90x120 preview with Capture under the fold. The scanner goes side by side instead: the
   toolbar, Scan Settings, the tabs and the status on the left, the pane on the right, so the
   preview and Capture get the whole height. card-scan.js makes the shell the screen's height
   here (the site header is a scroll away) and brings it into view when the camera starts. */
@media (max-width: 991.98px) and (max-height: 480px) and (orientation: landscape) {
    /* The left column keeps 20rem, room for the game's whole name beside Start (568x320
       squeezed the select to "D" and broke "Batch" across two lines); the stage is bounded by
       the height there and needs less than the rest. */
    .scan-shell {
        display: grid;
        grid-template-columns: minmax(min(20rem, 100%), 1fr) minmax(0, 1fr);
        grid-template-rows: auto auto auto minmax(0, 1fr);
        align-content: start;
        gap: var(--sp-2) var(--sp-4);
    }

    .scan-shell > .scan-fixed {
        grid-column: 1;
    }

    .scan-shell > .scan-flex {
        grid-column: 2;
        grid-row: 1 / -1;
        height: 100%;
    }
}

/* From 576px the settings open from the left column's start edge, over the pane, not off the
   screen's left edge as they would from the toolbar's end. */
@media (min-width: 576px) and (max-width: 991.98px) and (max-height: 480px) and (orientation: landscape) {
    .scan-settings > .app-disclosure-body {
        inset-inline-start: calc(-1 * var(--edge-w));
        inset-inline-end: auto;
    }
}

/* ── Panes ────────────────────────────────────────────────────────────────── */

.scan-panes {
    display: grid;
    gap: var(--sp-4);
    min-width: 0;
}

/* The pane shown is a block whatever the legacy rule (.scan-shell .scan-pane) says. */
.scan-shell .scan-panes > .scan-pane {
    display: block;
    min-width: 0;
}

/* Below 992px one pane at a time: the panes the tabs have not chosen carry data-scan-off (the
   server marks Match and Batch; card-scan.js moves the mark with the tabs, in place of the
   `hidden` segmented.js would set). From 992px nothing hides them, so every pane is on screen
   whether or not a script has run. */
@media (max-width: 991.98px) {
    .scan-shell .scan-panes > .scan-pane[data-scan-off] {
        display: none;
    }
}

/* From 992px the camera has the first column, and the match list with the batch under it the
   second, so the side column fills the stage's height instead of leaving it empty under What Is
   It? (final pass 2026-11-18). The second row takes the rest of the camera's height, so the batch
   follows the match list directly. */
@media (min-width: 992px) {
    .scan-panes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto 1fr;
        align-items: start;
        gap: var(--sp-5);
        margin-block-start: var(--sp-4);
    }

    .scan-panes > .scan-pane--camera {
        grid-row: 1 / span 2;
    }

    /* The first column holds one finder, Search or the camera (U26): the other carries
       data-finder-off, which card-scan.js moves with the finder strip. */
    .scan-panes > .scan-pane--search {
        grid-row: 1 / span 2;
    }

    .scan-shell .scan-panes > .scan-pane[data-finder-off] {
        display: none;
    }

    .scan-panes > .scan-pane--cart {
        grid-column: 2;
    }
}

/* ── The camera stage ─────────────────────────────────────────────────────── */

/* A card's shape, centred, bounded by the room card-scan.js measured (--scan-stage-room) and
   never taller than 48rem. The room declared here is the first paint before the script has
   measured; the script's value, set on the element, replaces it. The id is in the selector to
   outrank the legacy phone rule (#scan-stage). */
.scan-shell #scan-stage.scan-stage {
    --scan-stage-room: 70dvh;
    --scan-scrim: rgb(0 0 0 / .62);
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    width: auto;
    max-width: 100%;
    max-height: min(var(--scan-stage-room), 48rem);
    margin-inline: auto;
    background: var(--surface-sunken);
}

@media (max-width: 991.98px) {
    .scan-shell #scan-stage.scan-stage {
        --scan-stage-room: 40dvh;
        max-height: var(--scan-stage-room);
    }
}

.scan-stage__video,
.scan-stage__still {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-stage__still {
    object-fit: contain;
}

/* The guide box: a hint where the card should be, with the rest of the frame dimmed. A card's
   rounded corners, not the brand's square ones. card-scan.js sets its shape per game and turns
   its edge green on a sure lock. */
.scan-stage__guide {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 82%;
    /* The game's card shape, set by card-scan.js (applyGame) on the element, which wins over this
       default; a standard card until then. */
    --scan-guide-aspect: 63 / 88;
    aspect-ratio: var(--scan-guide-aspect);
    transform: translate(-50%, -50%);
    border: 3px solid rgb(255 255 255 / .9);
    border-radius: 10px;
    box-shadow: 0 0 0 100vmax rgb(0 0 0 / .35);
    pointer-events: none;
}

.scan-stage__overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* The status along the top edge and the placeholder along the bottom: light text on a dark
   band over whatever the camera shows, so each reads at every point of the picture. The
   placeholder is ONE line the stage's width (a narrow stage has a short sentence for it). The
   status wraps, so every message is on screen in full (camera errors, the glare advice, a
   refusal): only the hold instruction, said while the person aims, is drawn as one line, in its
   short form (.scan-stage__status--line, which card-scan.js sets only while that form fits).
   Wrapped, the hold instruction was nine lines over the whole preview at 320x568 (audit PT21). */
.scan-stage__status,
.scan-stage__placeholder {
    position: absolute;
    inset-inline: 0;
    z-index: 1;
    margin: 0;
    padding: var(--sp-1h) var(--sp-2h);
    overflow: hidden;
    font-size: var(--fs-2);
    line-height: var(--lh-tight);
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    background: var(--scan-scrim);
}

.scan-stage__status {
    inset-block-start: 0;
    max-block-size: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    text-wrap: balance;
}

.scan-stage__status--line {
    white-space: nowrap;
}

.scan-stage__placeholder {
    inset-block-end: 0;
}

.scan-stage__placeholder-short {
    display: none;
}

/* A narrow stage (under 15rem, which card-scan.js marks .scan-stage--narrow: 106px wide at
   320x568, 145px at 375x667) has room for the placeholder's short sentence only, and its
   guide box leaves about 13px above and below: the bands are thinner and smaller there. */
.scan-stage--narrow .scan-stage__status,
.scan-stage--narrow .scan-stage__placeholder {
    padding: var(--sp-0) var(--sp-1);
    font-size: var(--fs-1);
    line-height: 1;
}

/* Wrapped lines need their leading back to be read. */
.scan-stage--narrow .scan-stage__status:not(.scan-stage__status--line) {
    line-height: var(--lh-tight);
}

.scan-stage--narrow .scan-stage__placeholder-long {
    display: none;
}

.scan-stage--narrow .scan-stage__placeholder-short {
    display: inline;
}

/* On a narrow stage the guide's margin under the box is about 13px, less than the line: until
   the camera runs there is nothing to line up, so the guide is not drawn and the line crosses
   nothing. */
.scan-stage--narrow:has(> .scan-stage__placeholder:not([hidden])) > .scan-stage__guide {
    display: none;
}

.scan-stage__status:empty {
    display: none;
}

.scan-capture-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--sp-2);
    margin-block-start: var(--sp-2);
}

.scan-capture {
    padding-inline: var(--sp-6);
}

/* The locked camera pane clips at its edge (overflow: hidden, legacy), and where the note is
   hidden the Capture row is its last child: the row keeps room under it for the focus ring on
   Capture, Retake and Undo (audit AY7). */
@media (max-width: 991.98px) {
    .scan-capture-row {
        padding-block-end: var(--sp-1h);
    }
}

.scan-grammar-note {
    max-inline-size: var(--measure);
    margin: var(--sp-2) auto 0;
    text-align: center;
}

/* A short phone (320x568): the note is a fact about the game, the preview and Capture are the
   work, so the note gives up its two lines. */
@media (max-width: 991.98px) and (max-height: 640px) {
    .scan-grammar-note {
        display: none;
    }
}

/* ── Match and batch ──────────────────────────────────────────────────────── */

.scan-photos {
    margin-block-end: var(--sp-4);
}

.scan-photos__list {
    max-height: 18rem;
    overflow-y: auto;
}

/* The card as it was read: upright, small, framed. */
.scan-read-card {
    display: block;
    width: auto;
    max-height: 9rem;
    margin-block-end: var(--sp-3);
    border: var(--edge-w) solid var(--ink);
}

/* The batch (_ImportBatch, client variant): its lines, then the total, where they go and Import,
   one under the other at every width; from 992px the batch is in the side column, which has no
   room for the two side by side. */

.scan-accuracy {
    margin-block-start: var(--sp-4);
}

.scan-accuracy__note {
    max-inline-size: var(--measure);
    margin: var(--sp-3) 0 0;
}

/* Files dragged over the scanner: the stage is outlined while a drop would open them as Photos
   (card-scan.js toggles .scan-stage--drop on dragover, dragleave and drop). */
.scan-shell #scan-stage.scan-stage--drop {
    outline: var(--edge-w-strong) dashed var(--ink);
    outline-offset: calc(-1 * var(--edge-w-strong));
}

/* Rows card-scan.js builds: a Photos run's rows (thumbnail, then the name and what was found,
   cut short with an ellipsis), the candidates' art, and the raw OCR text under the readout. */
.scan-photos__thumb {
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: var(--radius);
}

.scan-photos__text {
    min-width: 0;
}

.scan-candidate__thumb {
    flex: 0 0 auto;
    border-radius: var(--radius);
}

.scan-readout__raw {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* ── Search (U26) ────────────────────────────────────────────────────────── */

/* The shared card search box, then Game and Set, then the results (_CardAddRow rows). The card
   field comes first so it is on the first screen of a 320x568 phone. The two pickers share a row
   from 576px; below it each takes the width. */
.scan-find__form {
    display: grid;
    gap: var(--sp-3);
    margin-block-end: var(--sp-4);
}

.scan-find__filters {
    display: grid;
    gap: var(--sp-3);
}

@media (min-width: 576px) {
    .scan-find__filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.scan-find__field > .form-label {
    margin-block-end: var(--sp-1);
}

.scan-find__field > .form-select {
    min-block-size: var(--touch-min);
}

/* On a phone or tablet with Search chosen, the camera's own controls (its game and Start) give
   their row to the search: they do nothing there, and the toolbar's Game sat over the search's
   Game to Search. Photos stays, as the third way to find cards, and so does Scan Settings, whose
   Scan As each search result starts on. The server marks the panes, so this holds before the
   script runs. */
@media (max-width: 991.98px) {
    .scan-shell:has(.scan-pane--search:not([data-scan-off])) .scan-toolbar__game,
    .scan-shell:has(.scan-pane--search:not([data-scan-off])) .scan-toolbar > .scan-tool.btn-primary {
        display: none;
    }
}

/* From 992px the same, with Search as the finder strip's choice (data-finder-off): the toolbar's
   Game and Start give way, so one game picker is on screen, Game to Search. What Is It? stays
   beside Search there, but its by-name search confirms a capture in the toolbar's Game, so it goes
   with them, and only one Search field is offered. Choosing Camera, or Photos, brings all three
   back. */
@media (min-width: 992px) {
    .scan-shell:has(.scan-pane--search:not([data-finder-off])) .scan-toolbar__game,
    .scan-shell:has(.scan-pane--search:not([data-finder-off])) .scan-toolbar > .scan-tool.btn-primary,
    .scan-shell:has(.scan-pane--search:not([data-finder-off])) .scan-match__by-name {
        display: none;
    }
}

/* Where the list goes (_ImportDestination) has its own room above Finalize Import: the shared
   block sets no outer margin, and the hand-built select it replaced kept mb-2 under its note. */
.scan-batch__finalize > .import-destination {
    margin-block-end: var(--sp-3);
}

/* The Quick Import offer over the list: its own row, with room under it. */
.scan-move-in {
    margin-block-end: var(--sp-3);
}

/* ── Store Buylist Settings (mig-store-buylist-settings) ──────────────────────
   The classes Pages/Store/Buylist.cshtml owns. The header, form, tables and
   folds are components (app-page-header, app-form-*, app-table,
   app-disclosure, app-grid); these only space them. Tokens only.
   docs/ui/dead-css/mig-store-buylist-settings.md lists what this unit left
   unused. */

/* The fieldset that turns the page read-only on a plan without the buylist.
   It is one item of the .app-page grid, so it carries the page's gap itself. */
.buylist-settings {
    display: grid;
    gap: var(--sp-5);
    min-inline-size: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

/* "Customers use ..." under the Public Address fields: a long hostname wraps. */
.buylist-settings-address {
    margin: var(--sp-3) 0 0;
    max-inline-size: var(--measure);
    color: var(--ink-muted);
    font-size: var(--fs-3);
    overflow-wrap: anywhere;
}

/* The accent colour's label and swatch, in the Custom Accent Colour slot. */
.buylist-settings-accent {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.buylist-settings-accent > .form-label {
    margin: 0;
}

/* Brackets and Rules by Game: an app-panel whose body (this class, beside
   panel-body) holds the help fold, then the per-game panels in an app-grid
   (LS-SW11). The panel draws the title and the sentence under it. */
.buylist-settings-games {
    display: grid;
    gap: var(--sp-4);
    min-inline-size: 0;
}

/* On a phone the per-game panels take a little more of the outer panel's width
   (--sp-2 a side, not the panel body's --sp-3): with the bracket table's row
   menu gap below, that is what keeps the table unscrolled at 320px inside two
   panels. */
@media (max-width: 575.98px) {
    .app-panel > .buylist-settings-games {
        padding-inline: var(--sp-2);
    }
}

/* Inside a game's panel: Value Brackets and Buying Rules, each with its table
   or note and its Add fold, spaced as one column. Their h4s carry no class, so
   the panel's in-content heading scale (components/panel.css) draws them. */
.buylist-settings-games .app-disclosure--panel > .app-disclosure-body {
    display: grid;
    gap: var(--sp-3);
    min-inline-size: 0;
}

.buylist-settings-games .app-disclosure--panel > .app-disclosure-body > * {
    margin-block: 0;
}

.buylist-settings-note {
    max-inline-size: var(--measure);
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

/* The Set, Card Attribute and Value fields come from _RuleTargetFields, which
   writes Bootstrap row columns (col-md-3, a 25% width). In this form they are
   grid cells, so each fills its cell instead. */
.buylist-settings-rule-form .app-form-grid > [class*="col-"] {
    inline-size: auto;
    max-inline-size: none;
}

/* Both tables in a game's panel (Value Brackets and Buying Rules) run edge to
   edge, their first and last cells inset by the panel body's padding, the one
   framing a table has in an app-panel (components/table.css, LS-AD16). The
   room it gains is what lets the bracket table's From (USD, on two lines),
   Cash, Credit and row menu fit a 320px screen without scrolling.
   table.css frames only an app-panel's .panel-body, not a panel disclosure's
   body, so this repeats its "In a panel" rules here, with the bleed set to the
   disclosure's own inline padding (--sp-5 at every width, where an app-panel's
   narrows on a phone). Reported to the data-table owner; delete these four
   rules once table.css covers .app-disclosure--panel > .app-disclosure-body
   (docs/ui/dead-css/mig-store-buylist-settings.md). */
.buylist-settings-games .app-disclosure--panel > .app-disclosure-body > .app-table {
    --table-bleed: var(--disclosure-pad-inline);
    margin-inline: calc(-1 * var(--table-bleed));
}

.buylist-settings-games .app-disclosure--panel > .app-disclosure-body > .app-table
    > .data-table > :is(thead, tbody, tfoot) > tr > :first-child {
    padding-inline-start: var(--table-bleed);
}

.buylist-settings-games .app-disclosure--panel > .app-disclosure-body > .app-table
    > .data-table > :is(thead, tbody, tfoot) > tr > :last-child {
    padding-inline-end: var(--table-bleed);
}

/* A stacked table's cards take the inset the cells had (as table.css does).
   The :first-child and :last-child in the cell list weigh this rule over the
   two above. */
@media (max-width: 767.98px) {
    .buylist-settings-games .app-disclosure--panel > .app-disclosure-body > .app-table
        > .data-table--stack > :is(tbody, tfoot) > tr {
        padding-inline: var(--table-bleed);
    }

    .buylist-settings-games .app-disclosure--panel > .app-disclosure-body > .app-table
        > .data-table--stack > :is(tbody, tfoot) > tr > :is(th, td, :first-child, :last-child) {
        padding-inline: 0;
    }
}

/* The row menu follows Credit, a figure, so table.css opens the --sp-4 gap it
   keeps between a figure and a word column. A button needs no reading gap. */
.buylist-settings-brackets > :is(thead, tbody) > tr > .tmc-actions {
    padding-inline-start: var(--sp-2);
}

/* A collapsed table's last border is half outside it, so every app-table
   region scrolls 1px down (the style guide's tables too). Here that made a
   read-only store's bracket table, whose row menus are disabled, a scroll
   region with nothing to focus, which axe flags. These tables only ever
   scroll sideways. Reported to the data-table owner; remove once table.css
   handles it. */
.buylist-settings-games .app-table {
    overflow-y: hidden;
}

/* General holds one form, capped at its wide measure (app-form-stack
   width="wide"), so the panel is capped with it: at 1920 the full-width panel
   left an empty area about 870px wide beside the form, and the sticky Save
   bar stopped short of the panel's edge. The cap is the form's plus the
   body's padding on both sides. */
.buylist-settings-general {
    max-inline-size: calc(var(--measure-form) * 1.5 + 2 * var(--sp-5));
}

/* "Games Bought" and "Games Not Bought": each group of game panels is a
   section headed by an h3 (the games' own Value Brackets and Buying Rules are
   h4s under it). The title outranks the game panels it heads: the panel
   title's size (the clamp disclosure.css gives a panel fold's summary; change
   them together) at 900, over a strong ink rule the width of the group, so it
   reads as the divider above the cards rather than one more card label. */
.buylist-settings-group {
    display: grid;
    gap: var(--sp-3);
    min-inline-size: 0;
}

/* The second group stands a little further off the first group's cards than
   the cards stand off each other, so its title reads as the start of a group. */
.buylist-settings-group + .buylist-settings-group {
    margin-block-start: var(--sp-3);
}

.buylist-settings-group__title {
    margin: 0;
    padding-block-end: var(--sp-2);
    border-block-end: var(--edge-w-strong) solid var(--ink);
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 1.8vw, 1.45rem);
    font-weight: 900;
    line-height: var(--lh-tight);
    letter-spacing: -.01em;
    color: var(--ink);
}

/* A rule badge ("Max 4 Total", "Not Buying") keeps one line: the column is
   as wide as its badge, and Applies To and Note wrap instead. */
.buylist-settings-rule,
.buylist-settings-rule .app-badge {
    white-space: nowrap;
}

/* Sending Domain (buylist unit D3, Pages/Shared/_BuylistSendingDomain.cshtml):
   the status sentence, the records tables, the notes and each action's own
   small form, spaced as one column. */
.buylist-sending-domain__body {
    display: grid;
    gap: var(--sp-3);
    min-inline-size: 0;
}

.buylist-sending-domain__body > * {
    margin-block: 0;
}

.buylist-sending-domain__status {
    max-inline-size: var(--measure);
}

.buylist-sending-domain__note {
    max-inline-size: var(--measure);
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

/* Which of a record's two names to type (buylist follow-up F3), above the records. */
.buylist-sending-domain__names-help {
    max-inline-size: var(--measure);
}

/* A record's Name cell (buylist follow-up F3): the Short Name's copy field over
   the Full Name's, each under a small caption saying which it is. */
.buylist-sending-domain__names {
    display: grid;
    gap: var(--sp-2);
    min-inline-size: 0;
}

.buylist-sending-domain__name {
    display: grid;
    gap: var(--sp-1);
    min-inline-size: 0;
}

.buylist-sending-domain__name-kind {
    color: var(--ink-muted);
    font-size: var(--fs-3);
    font-weight: 600;
}

/* The DNS records and the recommended DMARC record (buylist unit E3): each
   name and value is an app-copy-field, which wraps anywhere and carries its
   own Copy button. A copy field is an inline-size container and adds no width
   of its own to an auto-sized column, so from 768px (where the rows stop
   stacking) both tables lay out fixed with the same column positions: Name
   and Value share the width, Type keeps a narrow column between them. */
@media (min-width: 768px) {
    .buylist-sending-domain__records {
        table-layout: fixed;
    }

    .buylist-sending-domain__records > thead > tr > th:nth-child(2) {
        inline-size: 6.5rem;
    }
}

/* Top, not the data table's middle: a copy field's button wraps under its
   value in a narrow column, and Type lines up with the values, not between
   a value and its button. */
.data-table.buylist-sending-domain__records > tbody > tr > td {
    vertical-align: top;
}

/* The Type cell's text sits on the same line as the copy fields' values: a
   box as tall as theirs, centred the same way. */
.buylist-sending-domain__type {
    display: inline-flex;
    align-items: center;
    min-block-size: var(--control-h);
}

@media (max-width: 991.98px), (pointer: coarse) {
    .buylist-sending-domain__type {
        min-block-size: max(var(--touch-min), var(--control-h));
    }
}

/* The controls fieldset groups the forms; it draws nothing itself. */
.buylist-sending-domain__controls {
    display: grid;
    gap: var(--sp-3);
    min-inline-size: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

/* Check Now, Start Again and Remove: one form each, on one wrapping row. */
.buylist-sending-domain__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

/* Email Wording (buylist unit T3): each email's example of its saved
   wording, a sunken box with the subject over the text part. The text part
   is a pre that keeps the store's line breaks but wraps (text-preline), in
   the body font. The example is capped at the width of the fields above it
   (width="lg", --field-w-lg), so the two line up and the text keeps near the
   text measure. */
.buylist-email-example {
    display: grid;
    gap: var(--sp-2);
    min-inline-size: 0;
    max-inline-size: var(--field-w-lg);
}

.buylist-email-example > * {
    margin-block: 0;
}

.buylist-email-example__title {
    font-size: var(--fs-4);
}

.buylist-email-example__mail {
    display: grid;
    gap: var(--sp-3);
    padding: var(--sp-3);
    border: var(--edge-w-hair) solid var(--rule-soft);
    background: var(--surface-sunken);
}

.buylist-email-example__mail > * {
    margin-block: 0;
}

.buylist-email-example__label {
    font-weight: 700;
}

.buylist-email-example__subject,
.buylist-email-example__text {
    overflow-wrap: anywhere;
}

.buylist-email-example__text {
    font-family: var(--font-body);
    font-size: var(--fs-3);
}

/* ── Store buylist submissions (mig-store-buylist-submissions) ─────────────────
   The classes Pages/Store/Buylists.cshtml and BuylistDetails.cshtml own, all
   prefixed bls-. The layout, table, badges, amounts, stepper, action bar and
   danger zone are components; these only space them and set what a cell may
   wrap. Tokens only. docs/ui/dead-css/mig-store-buylist-submissions.md lists
   what this unit left unused. */

/* Shared: a muted line under a block. */
.bls-note {
    margin: 0;
    max-inline-size: var(--measure);
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

/* ── The list ── */

/* The filter bar is spaced off the table (or the empty state) under it; the
   component sets no outer margin, so the page does. */
.bls-filter {
    margin-block-end: var(--sp-4);
}

/* The reference never breaks at its hyphens (SA10). A long status badge wraps
   its words under themselves, so the column is never cut (LS-SW5). */
.bls-list .bls-ref {
    white-space: nowrap;
}

.bls-badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--sp-1);
}

/* Games: the list from 1400px, a count below it, where the table has the
   least room (LS-SW5: six lines of game names at 1024). Below 992 the column
   goes, and so does Cards: the reference opens both. */
.bls-games-count {
    display: none;
    white-space: nowrap;
}

@media (max-width: 1399.98px) {
    .bls-games-full {
        display: none;
    }

    .bls-games-count {
        display: inline;
    }
}

/* Market and Method are low priority (hidden below 1200 by the table) and go
   until 1400 too: at 1280 the ten columns wrapped Method to three lines, the
   customer's name to two and the long status badges inside themselves. In
   the table (from 768px) a customer's name keeps one line; on a phone the row
   is a stacked card and a long name wraps inside it. */
@media (max-width: 1399.98px) {
    .bls-list .bls-col-xxl {
        display: none;
    }
}

@media (min-width: 768px) {
    .bls-list .bls-customer {
        white-space: nowrap;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .bls-list .bls-col-games,
    .bls-list .bls-col-cards {
        display: none;
    }
}

/* ── The detail: progress and the record's actions ── */

.bls-progress {
    display: grid;
    gap: var(--sp-4);
    min-inline-size: 0;
}

/* The grid's gap spaces the stepper, alert, Next form and action bar; their own
   margins would double it. */
.bls-progress .stepper {
    margin: 0;
}

.bls-progress .app-alert {
    margin: 0;
    max-inline-size: var(--measure);
}

/* The import's form: where the stock goes (the Import To field or a sentence),
   then the channels sentence. Its own gap, smaller than the panel's. */
.bls-import {
    display: grid;
    gap: var(--sp-3);
}

.bls-set-stage {
    max-inline-size: var(--measure-form);
}

.bls-set-stage form {
    display: grid;
    gap: var(--sp-3);
}

/* ── The detail: cards ── */

.bls-help {
    margin-block-end: var(--sp-4);
}

/* The title cell: thumbnail, then name, facts and badges. The facts wrap
   whole, never a word per line (SA2). */
.bls-line {
    display: flex;
    gap: var(--sp-2);
    align-items: flex-start;
    min-inline-size: 8rem;
}

/* The thumbnail is hidden at 1200-1399px: there the table sits beside the
   side column and the thumbnail would push Line Payout out of view (LS-SW3).
   Phones keep it in the stacked card; 992-1199 has the full width; 768-991
   gives its room to the selects (below). */
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .bls-line > .card-thumb {
        display: none;
    }
}

.bls-line__text {
    display: grid;
    gap: var(--sp-1);
    min-inline-size: 0;
}

.bls-line__name {
    font-weight: 700;
    overflow-wrap: anywhere;
}

/* The facts under the name are a fact row (.buylist-facts in
   components/buylist.css, which draws the middots and wraps a long fact inside
   itself); here only its type. */
.bls-line__meta {
    font-size: var(--fs-2);
    font-weight: 400;
}

/* From 1400px the cards table has room, so a fact in it keeps one line; the
   cell grows to hold it rather than clipping it. Add a Card's candidate list
   is not a table, so its facts always wrap. Where the table is tight
   (768-1399px) a long fact, such as "Legend of Blue Eyes White Dragon", wraps
   inside itself, so the selects keep the width of their options and the table
   still fits. On a portrait tablet the thumbnail and some of the cell's
   minimum go to them too. */
@media (min-width: 1400px) {
    .bls-line .bls-line__meta > span {
        white-space: nowrap;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .bls-line {
        min-inline-size: 6rem;
    }

    .bls-line > .card-thumb {
        display: none;
    }
}

.bls-line__badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1);
}

/* Condition over printing, each as wide as its longest option. A select at
   width 100% gives the table no minimum, so auto layout squeezed it and cut
   "Near Mint" to "Near Mir" at 768 and "Lightly Played" at 1024: sized by its
   options (the grid stretches it to the column), it never goes narrower. */
.bls-condition {
    display: grid;
    gap: var(--sp-1);
    min-inline-size: 7rem;
}

.bls-condition > .form-select {
    inline-size: auto;
}

/* Quantity over Update, so the table fits beside the side column from 1200px
   (LS-SW3); stacked on a phone, they sit on one line. */
.bls-qty {
    display: grid;
    gap: var(--sp-1);
    justify-items: start;
}

.bls-qty__input {
    inline-size: var(--input-w-qty);
}

@media (max-width: 767.98px) {
    .bls-qty {
        display: flex;
        align-items: center;
    }
}

/* Today's offer, its drift under it. A drift past the store's warning is
   bold and its row carries a Price Drifted badge, never colour alone. */
.bls-current {
    display: inline-grid;
    justify-items: end;
    gap: var(--sp-0);
}

.bls-drift {
    color: var(--ink-muted);
    font-size: var(--fs-2);
    white-space: nowrap;
}

/* The not-linked reason is longer than a drift figure: it wraps at a short
   measure so the Current column does not widen the table (pricing unit P3). */
.bls-drift--reason {
    white-space: normal;
    max-inline-size: 14ch;
    text-align: end;
}

.bls-drift--over {
    color: var(--ink);
    font-weight: 700;
}

/* The totals sit at the end of the panel, under the table's figures, each
   pair capped, so a label is never a screen's width from its amount (at 1920
   the two pairs spread 730px apart). Below 992px the cap is under the list's
   40rem two-column width, so the facts take one column, where a label beside
   its amount wrapped ("Payout at Quoted / Prices") at 768. */
.bls-totals {
    inline-size: 100%;
    max-inline-size: calc(2 * 24rem + var(--sp-5));
    margin-block-start: var(--sp-4);
    margin-inline-start: auto;
}

@media (max-width: 991.98px) {
    .bls-totals {
        max-inline-size: 30rem;
    }
}

/* The original submission's lines, a hairline between. */
.bls-original {
    display: grid;
    gap: var(--sp-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.bls-original > li + li {
    padding-block-start: var(--sp-3);
    border-block-start: var(--edge-w) solid var(--rule-soft);
}

/* ── The detail: side column ── */

/* Each column stacks several panels (Cards, Add a Card and Original
   Submission; Customer, Store Note and Privacy), so they are spaced as the split's own
   columns are. A column is a flex column, so a wide table still scrolls inside
   its panel. The danger zone fills the column, lined up with the panels. */
.bls-split > .app-split-main,
.bls-split > .app-split-side {
    display: flex;
    flex-direction: column;
    gap: var(--sp-5);
}

.bls-split > .app-split-side > .app-danger-zone {
    max-inline-size: none;
}

/* Add a Card sits in the main column under the cards (staff work on the
   lines), so its search and results keep the form measure there. */
.bls-add-search {
    display: grid;
    gap: var(--sp-2);
    max-inline-size: var(--measure-form);
    margin-block-end: var(--sp-3);
}

.bls-add-results {
    display: grid;
    max-inline-size: var(--measure-form);
    margin: 0;
    padding: 0;
    list-style: none;
}

.bls-add-results > li {
    display: grid;
    gap: var(--sp-1);
    padding-block: var(--sp-2);
    border-block-start: var(--edge-w) solid var(--rule-soft);
}

/* Condition, quantity and Add on one row; with a printing select, the two
   selects share the first row (SA24: the inline widths left Add alone). */
.bls-add-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--input-w-qty) auto;
    gap: var(--sp-1);
    align-items: center;
}

.bls-add-row--printing {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.bls-add-row--printing > :nth-last-child(2),
.bls-add-row--printing > :last-child {
    inline-size: 100%;
}

/* A figure's heading may take two lines ("Line / Payout"); the figures under it
   never do. */
.bls-lines > thead > tr > th.num {
    white-space: normal;
}

/* On a portrait tablet the unit quote goes: Line Payout already carries it
   times the quantity, and the seven columns would not fit 716px. Phones keep it
   in the stacked card, and from 992px it has room. */
@media (min-width: 768px) and (max-width: 991.98px) {
    .bls-lines .bls-col-quoted {
        display: none;
    }
}

/* The Customer panel's two folds (buylist unit K1): Original Details, when the details were
   changed, then Edit Details. Apart, so they read as two folds and not one box. */
.bls-customer-original + .bls-customer-edit {
    margin-block-start: var(--sp-3);
}

.bls-customer-original .app-disclosure-body {
    display: grid;
    gap: var(--sp-2);
}

/* Store > Counter (Pages/Store/Counter.cshtml, wwwroot/js/counter.js). */

.counter__controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
}

.counter__field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 12rem;
}

.counter__field > span {
    font-weight: 600;
}

.counter__field--grow {
    flex: 1 1 18rem;
}

.counter__results {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.25rem;
}

.counter__result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border: var(--edge-w-hair, 1px) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
}

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

.counter__result-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.counter__result-text > span {
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

.counter__cart {
    margin-top: 1rem;
}

.counter__num {
    text-align: end;
    white-space: nowrap;
}

.counter__qty {
    width: 5rem;
    margin-inline-start: auto;
}

.counter__price {
    width: 7rem;
    margin-inline-start: auto;
    text-align: end;
}

.counter__total {
    font-weight: 700;
}

.counter__empty {
    margin: 1rem 0 0;
    color: var(--ink-muted);
}

.counter__charge {
    margin-top: 1rem;
}

.counter__status {
    font-size: 1.125rem;
}

.counter__payment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 575.98px) {
    .counter__qty,
    .counter__price {
        width: 4.5rem;
    }
}

/* ── Store eBay page (mig-store-ebay) ─────────────────────────────────────────
   The classes Pages/Store/Ebay.cshtml owns. The header, tiles, tables, form
   sections and danger zone are components; these only space them and set the
   page's few muted lines. docs/ui/dead-css/mig-store-ebay.md lists what this
   unit left unused. Usage: the classes are written in Ebay.cshtml only. */

/* The sandbox note under the header's lede: one muted line with its icon, the
   same shape as the plan lock it stands in for. */
.ebay-sandbox-note {
    display: flex;
    align-items: baseline;
    gap: var(--sp-2);
    margin: 0;
    max-inline-size: var(--measure);
    color: var(--ink-muted);
    font-size: var(--fs-3);
    line-height: var(--lh-body);
}

/* Muted sentences in a panel or a form section, held to the measure. */
.ebay-orders-read,
.ebay-account-note,
.ebay-section-note {
    max-inline-size: var(--measure);
    margin: 0 0 var(--sp-3);
    line-height: var(--lh-body);
}

.ebay-orders-read {
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

.ebay-section-note {
    margin-block-end: 0;
}

/* The Connect button sits under the empty state or the reconnect note. */
.ebay-connect {
    margin-block-start: var(--sp-3);
}

/* The tiles come first in their panel; a table or the empty state follows
   with the page's gap. */
.ebay-stats + .app-table,
.ebay-stats + .app-empty {
    margin-block-start: var(--sp-4);
}

/* eBay's own words and the reason a sale needs a look are sentences, so they
   wrap at the measure instead of stretching the column. The cell carries the
   muted text; the measure sits on a block inside it, because a table cell
   ignores max-inline-size in auto table layout. */
.ebay-table .ebay-table__note-cell {
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

.ebay-table .ebay-table__note {
    display: block;
    max-inline-size: var(--measure);
    overflow-wrap: anywhere;
}

/* A fieldset only disables its fields; it draws nothing and never widens its
   column. */
.ebay-fieldset {
    min-inline-size: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

/* The shared note under the three policy pickers, read with each of them. */
.ebay-policies-help {
    max-inline-size: var(--measure);
    margin: var(--sp-2) 0 0;
}

/* ── Store Home and its work panels (mig-store-home) ─────────────────────────
   The classes Pages/Store/Index.cshtml and its partials own: _StoreWorkPanels,
   _StorePerformancePanel and the Manage grid of _StoreSectionLinks (the site's
   home draws the first two as well). The layout is the components' (the page
   header, app-panel, app-grid, _Checklist, the charts and app-empty); these
   only set the rows inside the panels. Token colours only.
   docs/ui/dead-css/mig-store-home.md lists what this unit left unused. */

/* The plan line under the lede (the header's caption sets its size and
   measure): muted, its plan name a link. */
.store-home-plan {
    margin: 0;
    color: var(--ink-muted);
}

/* The setup guide's link under the checklist. */
.store-home-note {
    margin: var(--sp-3) 0 0;
    max-width: var(--measure);
    font-size: var(--fs-3);
    color: var(--ink-muted);
}

/* Needs Attention: badge, sentence, button. The badge says how bad in words;
   the sentence holds the measure; the button stays beside it from 576px and
   goes under the sentence on a phone. */
.store-attention {
    display: grid;
    gap: var(--sp-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.store-attention-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: var(--sp-2) var(--sp-3);
}

.store-attention-item + .store-attention-item {
    padding-block-start: var(--sp-3);
    border-block-start: var(--edge-w-hair) solid var(--rule-soft);
}

.store-attention-text {
    max-width: var(--measure);
    overflow-wrap: anywhere;
}

.store-attention-action {
    min-height: var(--touch-min);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 992px) and (pointer: fine) {
    .store-attention-action {
        min-height: 0;
    }
}

@media (max-width: 575.98px) {
    .store-attention-item {
        grid-template-columns: minmax(0, 1fr);
    }

    .store-attention-action {
        justify-self: start;
    }
}

/* Work Waiting: one row per area, its title a link, its counts on a line under it. */
.store-work-list {
    display: grid;
    gap: var(--sp-4);
    margin: 0;
    padding: 0;
    list-style: none;
}

.store-work-area {
    display: grid;
    gap: var(--sp-1);
    min-width: 0;
}

.store-work-title {
    font-weight: 600;
    justify-self: start;
}

.store-work-counts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1) var(--sp-4);
    font-size: var(--fs-3);
}

.store-work-number {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* A count of nothing is plain text; a count that wants doing keeps its words
   ("3 failed"), and the colour only repeats them. */
.store-work-count--none {
    color: var(--ink-muted);
}

.store-work-count--critical {
    color: var(--bad-ink);
}

.store-work-count--warning {
    color: var(--warn-ink);
}

/* The area titles and counts are links set on their own, not inside a
   sentence, so they take the 44px floor on phones and touch screens. */
@media (max-width: 991.98px), (pointer: coarse) {
    .store-work-area {
        gap: 0;
    }

    .store-work-counts {
        row-gap: 0;
    }

    .store-work-title {
        display: inline-flex;
        align-items: center;
        min-height: var(--touch-min);
    }

    /* A count stays one run of inline text: a flex box here would drop the
       space between the number and its words ("1to review"). The padding
       centres one line in the 44px floor instead. */
    a.store-work-count,
    .store-work-count--none {
        display: inline-block;
        min-height: var(--touch-min);
        padding-block: max(0px, calc((var(--touch-min) - 1lh) / 2));
    }
}

.store-work-note {
    font-size: var(--fs-3);
    color: var(--ink-muted);
    max-width: var(--measure);
}

.store-work-news {
    max-width: var(--measure);
    font-size: var(--fs-3);
}

.store-work-news p {
    margin: 0 0 var(--sp-2);
}

.store-work-news .store-work-news-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.store-work-news .store-work-news-date {
    margin-block-end: var(--sp-3);
    color: var(--ink-muted);
}

/* Store Performance: two figures side by side from 992px, each a label over a
   bold amount; the buylist return and recent sales under a hairline each. */
.store-perf-figure {
    display: grid;
    gap: var(--sp-1);
    align-content: start;
    min-width: 0;
}

.store-perf-label {
    margin: 0;
    font-size: var(--fs-3);
    color: var(--ink-muted);
}

.store-perf-value {
    margin: 0;
    font-size: var(--fs-6);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.store-perf-note {
    margin: 0;
    font-size: var(--fs-3);
    color: var(--ink-muted);
}

.store-perf-change {
    font-size: var(--fs-3);
    font-weight: 600;
}

p.store-perf-change {
    margin: 0;
}

.store-perf-change--up {
    color: var(--ok-ink);
}

.store-perf-change--down {
    color: var(--bad-ink);
}

.store-perf-part {
    margin-block-start: var(--sp-4);
    padding-block-start: var(--sp-4);
    border-block-start: var(--edge-w-hair) solid var(--rule-soft);
}

.store-perf-part > h3 {
    margin-block-end: var(--sp-2);
}

.store-perf-part > p {
    margin: 0;
    max-width: var(--measure);
}

/* The list keeps the reading measure plus room for an amount, so a sale's amount stays near its
   title on a wide screen (it was 1,548px away at 1920; final pass, 2026-11-18). */
.store-perf-sales {
    display: grid;
    gap: var(--sp-3);
    max-inline-size: calc(var(--measure) + 10rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.store-perf-sale {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: var(--sp-3);
}

.store-perf-sale-body {
    display: grid;
    min-width: 0;
}

.store-perf-sale-title {
    overflow-wrap: anywhere;
}

/* An amount never splits from its currency. */
.store-perf-sale-amount {
    font-weight: 600;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Manage: each section a tile filling its grid cell, the icon at the top beside
   the title, however many lines the copy runs to (LS-SW23). */
.store-manage-link {
    height: 100%;
    min-height: var(--touch-min);
    /* The stretched tile keeps its title and copy together at the top; the
       spare height of a short tile goes below them, not between. */
    align-content: start;
}

.store-manage-link .admin-hub-link-icon {
    align-self: start;
}

/* ── Store Inventory (mig-store-inventory) ─────────────────────────────────────
   The classes Pages/Store/Inventory.cshtml owns. The table, filter bar, row actions,
   badges and the counts (_QuantityEditor) are components; these only lay out the
   pool's cells. docs/ui/dead-css/mig-store-inventory.md lists what this unit left
   unused. */

/* The filter bar sits on the table's header band otherwise (the old form had mb-3). */
.store-pool-body > .app-filter-bar {
    margin-block-end: var(--sp-4);
}

/* From 992px the bar puts its actions at the far end of the row (components/filter-bar.css).
   With one field (Game) that left Apply up to 1778px from the select it applies at 3440, so
   here Apply follows the field. */
.store-pool-body .app-filter-bar-actions {
    margin-inline-start: 0;
}

/* The card cell: the title in bold (from .tmc-title), then the set and number, then any notes,
   all in the body weight. */
.store-pool__title {
    display: block;
}

.store-pool__meta,
.store-pool__note {
    display: block;
    font-weight: 400;
    font-size: var(--fs-2);
}

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

.store-pool__note {
    margin-block-start: var(--sp-1);
    color: var(--ink);
}

/* "Heavily Played", "1st Edition", "Modern Horizons 3" never break inside themselves; a line
   breaks only at the dots between them (SB10). */
.store-pool__part {
    white-space: nowrap;
}

/* A group heading's count (inventory manager unit U4): "· 3 rows · 12 copies" after the group's
   name, in the body weight so the name stays the heading. The heading's own ink is kept. */
.store-pool__group-count {
    font-weight: 400;
}

/* The variant and the market value (inventory manager unit U6) under the set line, below 1200px
   only; from 1200 each is its own column (data-priority low). */
@media (min-width: 1200px) {
    .store-pool__variant-inline,
    .store-pool__value-inline {
        display: none;
    }
}

.store-pool__variant-inline {
    color: var(--ink);
}

:is(.store-pool__variant, .store-pool__variant-inline) .app-badge {
    margin-inline-start: var(--sp-1);
}

/* The row's folds: Sales Channels, and Edit Variant (inventory manager unit U21), drawn open on
   the one row whose menu's Edit Variant link was followed. */
.store-pool__channels,
.store-pool__variant-edit {
    margin-block-start: var(--sp-1);
    font-weight: 400;
}

/* The Edit Variant fold's one line of help, at the note's size and the body's measure. */
.store-pool__variant-help {
    margin: 0;
    max-inline-size: 70ch;
    font-size: var(--fs-2);
    color: var(--ink-muted);
}

.store-pool__channels-save {
    justify-self: start;
}

/* The open Edit Variant form's Change Variant button and its Cancel link, on one line while they fit. */
.store-pool__variant-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-3);
}

/* From 768 the counts are one line: three fields and Save, the column only as wide as that. */
@media (min-width: 768px) {
    .store-pool > tbody > tr > .store-pool__qty {
        width: 1%;
    }

    .store-pool__qty .quantity-editor {
        flex-wrap: nowrap;
    }

    /* The cell is shrink-to-fit, so the fields would sit at their minimum: give each its full width. */
    .store-pool__qty .quantity-editor__input {
        min-inline-size: var(--input-w-qty);
    }
}

/* Below 768 each row is a card: the title and its notes, then the counts and Save with the
   row's menu at the end of the same line, so the tab order (counts, Save, menu) is the order on
   screen and a row stays under 200px at 375 (the brief's acceptance). The variant is the line
   under the set (.store-pool__variant-inline), since the Variant column is low priority. */
@media (max-width: 767.98px) {
    .store-pool.data-table--stack > tbody > tr:not(.table-group-heading) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: var(--sp-2);
    }

    /* The panel-bleed rule's :first-child inset (components/table.css) outweighs the stacked
       reset, so the title sat 12px in from the line under it; the card's inset is the row's. */
    .store-pool.data-table--stack > tbody > tr:not(.table-group-heading) > td {
        grid-column: 1 / -1;
        width: auto;
        padding-inline: 0;
    }

    .store-pool.data-table--stack > tbody > tr:not(.table-group-heading) > .store-pool__qty {
        grid-column: 1;
        padding-block: 0;
    }

    .store-pool.data-table--stack > tbody > tr:not(.table-group-heading) > .tmc-actions {
        grid-column: 2;
        align-self: end;
        padding-block: 0;
    }

    .store-adopt.data-table--stack > tbody > tr > td {
        padding-inline: 0;
    }

    /* The open Edit Variant form ended 4px above the same row's counts, so its Change Variant
       and the counts' Save read as one form: a gap marks where the variant form ends. */
    .store-pool__variant-edit[open] {
        margin-block-end: var(--sp-3);
    }
}

/* The Shopify check (final pass, 2026-11-18): the status line, with Check Now right after it in
   the action bar's row, and any failed check or sweep as a warning alert under it. */
.store-check-body {
    display: grid;
    gap: var(--sp-3);
}

.store-check-body > .app-alert {
    margin: 0;
}

.store-check-status,
.store-check-sweep {
    margin: 0;
    max-inline-size: var(--measure);
    color: var(--ink-muted);
    font-size: var(--fs-2);
}

/* The Store Stock table is a fit table (<app-table fit>), so a row's counts can stay beside its
   card rather than a screen's width from it (1,500px apart at 1920). From 1400px the counts drop
   their own 1% width (above), which made the table fill its column; the menu column's width is
   auto in a fit table (components/table.css). A note under a card keeps the reading measure, so
   one long sentence does not widen the Card column. */
.store-pool__note {
    max-inline-size: var(--measure);
}

@media (min-width: 1400px) {
    .store-pool > :is(thead, tbody) > tr > .store-pool__qty {
        width: auto;
    }

    .store-pool > tbody > tr > .tmc-title {
        min-inline-size: var(--field-w-md);
    }
}

/* At 320 the three counts fill the first line of a row card and Save wraps under them: it takes
   that line's free width, so Save and the row's menu read as one action row with no gap. */
@media (max-width: 359.98px) {
    .store-pool__qty .quantity-editor__save {
        flex: 1 1 auto;
    }
}

/* ── Store Listings: Queue, Runs, Run and Bulk List (mig-store-listings) ─────
   The classes Pages/Store/Queue.cshtml, Runs.cshtml, Run.cshtml (with its
   _QueueRunPanel, queue runs U7) and BulkList.cshtml own.
   The pages are components (app-page-header, app-table, app-row-actions,
   app-segmented, app-disclosure, app-progress, app-stat-grid, app-money,
   app-check-field, app-action-bar); these rules only size their columns and
   space the few rows between them. docs/ui/dead-css/mig-store-listings.md lists
   what this unit left unused. */

/* Queue: the status views and the refresh note share one row above the table,
   and wrap under each other on a narrow screen. */
.queue-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2) var(--sp-4);
    margin-block-end: var(--sp-3);
}

.queue-toolbar > .app-segmented {
    min-width: 0;
    max-width: 100%;
}

.queue-refresh {
    margin: 0;
    color: var(--ink-muted);
    font-size: var(--fs-2);
}

/* Queue narrowed to one run or day (?run=, ?day=): its chip sits beside the status views. */
.queue-toolbar > .app-filter-bar-active {
    margin: 0;
}

/* Queue: the card leads the row, its game, kind of work and attempts on a muted
   line under it (SB3: these were three columns of their own). */
.queue-card-title {
    display: block;
    font-weight: 600;
}

.queue-card-meta {
    display: block;
    color: var(--ink-muted);
    font-size: var(--fs-2);
    font-weight: 400;
}

/* Across stores, the store handle rides on the muted line while its low-priority column is hidden
   (below 1200px, components/table.css), so every row still says whose it is. The handle's
   hyphens do not break (StoreHandle), so a wrap falls after the separator, not inside the name. */
@media (min-width: 1200px) {
    .queue-card-store {
        display: none;
    }
}

.queue-store {
    color: var(--ink-muted);
    font-size: var(--fs-2);
    overflow-wrap: anywhere;
}

.queue-activity {
    display: block;
    margin-block-start: var(--sp-1);
    font-size: var(--fs-2);
}

.queue-activity time {
    white-space: nowrap;
}

.queue-outcome {
    color: var(--ink-muted);
    font-size: var(--fs-2);
}

/* A row with an outcome code: its plain sentence, then the links that put it right
   (QueueOutcome), each a .link-action with its touch floor, wrapping under each other
   in a narrow cell. */
.queue-outcome-sentence {
    display: block;
    max-width: var(--measure);
}

.queue-outcome-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--sp-3);
    margin-block-start: var(--sp-1);
}

.queue-outcome-full {
    margin-block-start: var(--sp-1);
}

.queue-outcome-full p {
    margin: 0;
    max-width: var(--measure);
}

/* As a table (from 768px) the card keeps room for a title on two lines at most,
   and the outcome takes what is left without crowding the actions (SB3, LS-SW4).
   On a tablet the columns give a little, so the actions stay in view at 768px. */
@media (min-width: 768px) {
    .queue-table .queue-card {
        min-width: 10rem;
    }

    .queue-table .queue-outcome {
        min-width: 9rem;
        max-width: 26rem;
    }
}

@media (min-width: 1200px) {
    .queue-table .queue-card {
        min-width: 14rem;
    }

    .queue-table .queue-outcome {
        min-width: 12rem;
    }
}

.queue-pager {
    margin-block-start: var(--sp-3);
}

/* Runs (queue runs U7): the Run Filter above the table, then each run's label (its way in),
   who started it and its Problems badge on a line under it, and its outcome badges, which
   wrap in their cell. Earlier Work is a link after the list. */
.runs-toolbar {
    margin-block-end: var(--sp-3);
}

.runs-toolbar > .app-segmented {
    min-width: 0;
    max-width: 100%;
}

.runs-starter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-1) var(--sp-2);
    margin-block-start: var(--sp-1);
    font-weight: 400;
}

.runs-starter-name {
    color: var(--ink-muted);
    font-size: var(--fs-2);
}

.runs-outcome {
    line-height: 1.9;
}

.runs-outcome > .app-badge {
    margin-inline-end: var(--sp-1);
}

.runs-earlier {
    margin: var(--sp-3) 0 0;
}

/* The run page: its readout, then a panel fold per outcome group, each a table of cards that
   reuses the queue's card and outcome cells above. */
.run-panel-joined {
    max-width: var(--measure);
    margin: var(--sp-2) 0 0;
}

.run-panel-joined > .link-action {
    margin-inline-start: var(--sp-2);
}

/* The last poll's note that the cards below are from when the page opened. */
.run-panel-reload {
    max-width: var(--measure);
    margin: var(--sp-2) 0 0;
}

.run-panel-reload > .link-action {
    margin-inline-start: var(--sp-2);
}

.run-section {
    margin-block-start: var(--sp-4);
}

/* The compact run panel a door page draws under its header (queue runs U8): the counts on one
   line that wraps, the problem list held to the measure, and View This Run after the polled
   region. Its alert keeps the alert component's own spacing. */
.run-panel-counts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1) var(--sp-2);
    margin: var(--sp-2) 0 0;
}

.run-panel--compact .app-alert {
    margin: var(--sp-3) 0 0;
}

.run-panel-problems {
    max-width: var(--measure);
    margin: 0;
    padding-inline-start: 0;
    list-style: none;
}

.run-panel-problems > li + li {
    margin-block-start: var(--sp-2);
}

.run-panel-problem-card {
    display: block;
}

.run-panel-more {
    margin: var(--sp-2) 0 0;
}

.run-panel-links {
    margin: var(--sp-2) 0 0;
}

/* The scanner shows its import's run under Import, in the Batch pane. */
.scan-run {
    margin-block-start: var(--sp-3);
}

/* The reminder strip (_RunStrip) under a page header: Dismiss is a form among the alert's
   buttons, so it takes no line of its own. */
.run-strip-dismiss {
    display: contents;
}

.run-strip-more {
    align-self: center;
}

.run-section-more,
.run-section-note {
    max-width: var(--measure);
    margin: var(--sp-3) 0 0;
}

/* Every section is its own table, so from 768px (where the rows stop stacking) they lay out
   fixed with the same column positions: Card a share of the width, Status and the actions a
   set width, Outcome the rest. Auto widths put Status at x=340 under Problems and x=450 under
   Done With a Warning at 1280 (review, 2026-11-24). A section with no Outcome column gives its
   room to Status, which still starts where it does in the others. */
@media (min-width: 768px) {
    .run-items {
        table-layout: fixed;
    }

    .run-items > thead > tr > .queue-card {
        width: 34%;
    }

    .run-items > thead > tr > .queue-status {
        width: 9.5rem;
    }

    .run-items > thead > tr > .tmc-actions {
        width: 7rem;
    }
}

/* Runs: the bar needs room to read as a bar beside the figures. */
@media (min-width: 768px) {
    .runs-table .runs-progress {
        min-width: 8rem;
    }
}

@media (min-width: 1200px) {
    .runs-table .runs-progress {
        min-width: 11rem;
    }
}

/* Bulk List: the set picker is app-inline-form (components/form-layout.css), so its selects keep
   the md field width and its buttons line up with the controls; the page adds nothing to it.
   The Preview counts are three small figures: from 768px the strip is 40rem at most, still three
   across (components/stats.css), not the panel (608px per digit at 1920; final pass, 2026-11-18). */
@media (min-width: 768px) {
    .bulk-list-page .app-stat-grid--fact {
        max-inline-size: calc(2 * var(--field-w-md));
    }
}

/* Bulk List: a card's tick and its name are one target. */
.bulk-list-pick {
    display: inline-flex;
    align-items: flex-start;
    gap: var(--sp-2);
    margin: 0;
    cursor: pointer;
}

.bulk-list-pick > .form-check-input {
    flex-shrink: 0;
    margin-block-start: .2em;
}

.bulk-list-options {
    margin-block: var(--sp-3);
}

/* Bulk List: a collector number (LOB-001) never splits at its hyphen (SA10). */
.bulk-number {
    white-space: nowrap;
}

/* Bulk List: the Will List heading and its line, in the Preview panel under its counts. The
   table after them is a direct child of the panel body, so the component's in-panel framing
   (components/table.css, "In a panel") frames it like the Excluded and Not Priced tables; the
   page adds none of its own. */
.bulk-will-list-head {
    margin-block-start: var(--sp-4);
}

/* The heading has no class, so the in-panel heading scale (components/panel.css) gives it the
   face, size, weight and tracking of every other h3 in a panel; this only spaces it. */
.bulk-will-list-head > h3 {
    margin: 0 0 var(--sp-1);
}

.bulk-will-list-copy {
    max-width: var(--measure);
    margin: 0 0 var(--sp-3);
    color: var(--ink-muted);
}

/* Excluded and Not Priced: a card name keeps one line (Blue-Eyes White Dragon) while the rule or
   reason, the sentence that says what to do next, wraps at the reading measure. */
@media (min-width: 768px) {
    .bulk-notes-table .tmc-title {
        min-width: 14rem;
    }
}

/* A table cell ignores max-width, so the measure is on the text inside it. */
.bulk-reason {
    display: block;
    max-width: var(--measure);
}

/* Touch: a card's tick (with its name) is a 44px target. */
@media (max-width: 991.98px), (pointer: coarse) {
    .bulk-list-pick {
        min-height: var(--touch-min);
        align-items: center;
    }

    .bulk-list-pick > .form-check-input {
        margin-block-start: 0;
    }
}

/* ── Store Merchandising and Storefront Pages (mig-store-merch) ─────────────────
   The classes Pages/Store/Merchandising.cshtml and Storefront.cshtml own. The
   page header, panels, folds, grids, form fields, list rows and action bars are
   components; these only space them. Token colours only.
   docs/ui/dead-css/mig-store-merch.md lists what this unit left unused. */

/* How a Price Is Decided: three numbered steps, a gap between. */
.store-merch-steps {
    display: grid;
    gap: var(--sp-2);
    max-width: var(--measure);
    margin: 0;
    padding-inline-start: var(--sp-5);
}

/* A short bold label over a sentence: Store Settings' two notes, a preview line. */
.store-merch-term {
    margin: 0 0 var(--sp-1);
    font-weight: 700;
}

.store-merch .form-text {
    max-width: var(--measure);
}

.store-merch-settings-form {
    margin-block-start: var(--sp-4);
    padding-block-start: var(--sp-4);
    border-block-start: var(--edge-w) solid var(--rule-soft);
}

/* Pricing by Sales Channel: one unframed group per channel, its name as a label. */
.store-merch-channel {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.store-merch-channel-name {
    float: none;
    width: auto;
    margin-block-end: var(--sp-2);
    font-weight: 700;
}

/* Condition Prices: the help fold, the table and the sticky Save, a gap between. */
.store-merch-conditions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-4);
}

.store-merch-condition-table td {
    min-width: 9rem;
}

/* Once the closed folds (the games with no rules) sit two or more to a row, a short last row
   keeps one column's width: stretched across it, two folds were 922px wide under four of 449
   at 1920 (final pass, store-pricing-settings regression 0). Below the two-column width
   (layout.css's 49.25rem, written out because a container query cannot read a token) each
   fold still grows to fill the row; there its basis is only --row-min, and at 768 the folds
   ended halfway across the panel. */
@container app-grid (width >= 49.25rem) {
    .store-merch-games--closed > * {
        flex-grow: 0;
    }
}

/* On a phone a game's name is a step smaller than a panel title, so "One Piece Card Game" and
   "Magic: The Gathering" fit one line beside their chip and the folds are one height (final
   pass, store-pricing-settings-4). */
@media (max-width: 575.98px) {
    .store-merch-games > .app-disclosure--panel > .app-disclosure-summary {
        font-size: var(--fs-h3);
    }
}

/* At 320 a long name still takes two lines; balanced, it is "One Piece / Card Game", never a
   last word alone. */
.store-merch-games > .app-disclosure--panel > .app-disclosure-summary > .app-disclosure-text {
    text-wrap: balance;
}

/* A per-game rules fold: the list, then the quick rules and Add a Rule. */
.store-merch-none {
    max-width: var(--measure);
    margin: 0 0 var(--sp-3);
    color: var(--ink-muted);
}

.store-merch-rules {
    margin-block-end: var(--sp-3);
}

.store-merch-presets {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-block-end: var(--sp-3);
}

.store-merch-presets > form {
    margin: 0;
}

/* Storefront: the form's panels a page gap apart, as the page's own are. The track
   is minmax(0, 1fr), so a panel grid's minimum width never widens the page on a phone. */
.store-merch-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-5);
}

.store-merch-why {
    margin: 0 0 var(--sp-3);
}

.store-merch-more {
    margin-block-start: var(--sp-3);
}

.store-merch-plan {
    display: grid;
    gap: var(--sp-4);
}

.store-merch-plan ul {
    margin: 0 0 var(--sp-1);
}

.store-merch-apply {
    margin: 0;
}

/* Apply, at the end of the Preview panel it applies (SB8), set apart from the plan. */
.store-merch-apply-bar {
    margin-block-start: var(--sp-4);
}

/* Store > Orders (Pages/Store/Orders.cshtml, _OrderLine.cshtml). */

.orders-summary {
    margin: 0.75rem 0;
}

.orders-channel {
    white-space: nowrap;
}

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

.orders-line__qty {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.orders-line__note {
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

.orders-more > summary {
    cursor: pointer;
    font-size: var(--fs-3);
}

.orders-ref a,
.orders-ref span {
    white-space: nowrap;
}

.orders-at-least {
    color: var(--ink-muted);
    font-size: var(--fs-3);
    margin-right: 0.25rem;
}

/* ── Store Prices and Connect a Store (mig-store-prices-auth) ────────────────
   The classes Pages/Products/PricingRules.cshtml (Store Prices, .store-prices)
   and Pages/Products/ShopifyAuth.cshtml (Connect a Store, .connect-store) own.
   The layout, panels, forms, steps and tables are components (app-page-header,
   app-grid, app-panel, app-form-*, app-check-group, app-steps, app-table);
   these only space their copy and give the card picks their touch target.
   docs/ui/dead-css/mig-store-prices-auth.md lists what this unit left unused. */

/* A muted note under a form or a table (a search notice, the result cap),
   held to the measure. */
.store-prices-note,
.connect-store-text {
    max-inline-size: var(--measure);
    margin: var(--sp-3) 0 0;
    color: var(--ink-muted);
    text-wrap: pretty;
}

/* Connect a Store: a panel whose body is one paragraph of instructions, read
   at full strength, with no margin left under it. */
.connect-store-instructions {
    max-inline-size: var(--measure);
    margin: 0;
    text-wrap: pretty;
}

/* Below 576px the inline form is a column. The card search box is an
   inline-size container, so the column measures its height as if it had no
   width (every word on its own line) and leaves a gap of about 100px under
   it; a set width gives it its real height. */
@media (max-width: 575.98px) {
    .store-prices .app-inline-form > .card-search {
        inline-size: 100%;
    }
}

.store-prices-picks {
    margin-block-start: var(--sp-4);
}

.store-prices-picks .app-form-actions {
    margin-block-start: var(--sp-3);
}

/* A card to refresh: the box and the card's name in one label, so the whole
   name is the target. The box sits on the name's first line when it wraps. */
.store-prices-pick {
    display: inline-flex;
    align-items: flex-start;
    gap: var(--sp-2);
    margin: 0;
    cursor: pointer;
}

.store-prices-pick .form-check-input {
    flex: none;
    margin: .2em 0 0;
}

/* A table cell wraps long tokens anywhere, which lets the table squeeze a
   card's name to a few letters a line ("Lightnin / g Bolt"). The name breaks
   between words, and inside a word only when the word alone is too long. */
.store-prices-pick > span {
    overflow-wrap: break-word;
}

@media (max-width: 991.98px), (pointer: coarse) {
    .store-prices-pick {
        align-items: center;
        min-block-size: var(--touch-min);
    }

    .store-prices-pick .form-check-input {
        inline-size: 1.5rem;
        block-size: 1.5rem;
        margin-block-start: 0;
    }
}

/* Connect a Store: the listing button under its step's sentence, and a long
   myshopify domain wraps anywhere rather than widening the table. */
.connect-store-step-action {
    margin-block-start: var(--sp-3);
}

.connect-store-steps + .connect-store-text {
    margin-block-start: var(--sp-4);
}

.connect-store-domain {
    overflow-wrap: anywhere;
}

/* ── Price Check (inventory manager unit U13) ──────────────────────────────
   The classes Pages/Store/PriceCheck.cshtml (.price-check) owns. The page is
   components (app-page-header, app-panel, app-segmented, app-filter-bar,
   app-action-bar, app-table, app-badge); these space its copy and give a
   card cell its name, its game and its sentences. */

/* What a refresh does, held to the measure above the list. */
.price-check-text {
    max-inline-size: var(--measure);
    margin: 0 0 var(--sp-3);
    text-wrap: pretty;
}

/* The Status choices, then the filter bar, then Refresh, each a step apart. */
.price-check-status,
.price-check-refresh {
    margin-block-end: var(--sp-3);
}

.price-check-title {
    display: block;
}

.price-check-meta,
.price-check-note {
    display: block;
    font-weight: 400;
    font-size: var(--fs-2);
}

.price-check-meta {
    color: var(--ink-muted);
}

/* A status or a listing said in words, beside its badge. */
.price-check-note {
    max-inline-size: var(--measure);
    margin-block-start: var(--sp-1);
    color: var(--ink);
    text-wrap: pretty;
}

/* ── Store settings: Billing, Sales Channels, Shopify Location, Team (mig-store-settings) ──
   The classes Pages/Store/Billing.cshtml, Channels.cshtml, Location.cshtml and
   Team.cshtml own. The pages are built from components (app-page-header,
   _PlanCard, app-grid, app-link-list, app-table, app-row-actions, app-inline-form,
   app-form-stack, app-check-group); these rules only hold their copy to the
   measure and space them. docs/ui/dead-css/mig-store-settings.md lists what this
   unit left unused. */

/* Copy under a panel's heading that is written in the body: held to the measure,
   one gap above what follows. */
.billing-copy,
.team-note {
    max-inline-size: var(--measure);
    margin: 0 0 var(--sp-3);
    text-wrap: pretty;
}

.team-note {
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

/* Billing: Shopify's word for the subscription beside its label, on one line
   with the badge (audit SA10), then the refresh button, in the plan card's foot. */
.billing-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
    margin: 0;
    color: var(--ink-muted);
    font-size: var(--fs-3);
}

.billing-plans {
    margin-block-end: var(--sp-3);
}

.billing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

/* Team: Members and Add a Member side by side from 1200px end level, each panel as tall as
   the row, as Channels' and Location's paired panels are (they ended 12px apart at 1280;
   final pass, store-pricing-settings regression 2). */
@media (min-width: 1200px) {
    .team-split {
        align-items: stretch;
    }

    .team-split > :is(.app-split-main, .app-split-side) {
        display: grid;
    }
}

/* Team: an email is one long token, so it breaks anywhere rather than push the
   card or the table past its column (audit SB2: "...staff@" clipped at 320). */
.team-email {
    overflow-wrap: anywhere;
    word-break: normal;
}

/* The owner's email in the Members copy is kept whole: a line never ends at its
   hyphen. It wraps inside only when the address alone is longer than a line. */
.team-note-email {
    display: inline-block;
    max-inline-size: 100%;
    overflow-wrap: anywhere;
}

/* On a phone the role select and Set Role share one row in the member's card, the
   select taking what Set Role leaves: app-inline-form makes a column of full-width
   controls there, and Set Role read as a stretched bar detached from its select. */
@media (max-width: 767.98px) {
    .team-table .team-role-form {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: flex-end;
    }

    .team-table .team-role-form > :not(.btn, .app-action),
    .team-table .team-role-form .form-select {
        flex: 1 1 auto;
        inline-size: 100%;
        max-inline-size: none;
    }

    .team-table .team-role-form > :is(.btn, .app-action) {
        inline-size: auto;
    }
}

/* The members table is as wide as its content (app-table fit), so Remove stays
   near the email it removes on a wide screen (LS-SW21): its near edge about 37rem
   from the email's start and 24rem from its end, from 1280 to 3840. The role select takes
   a length rather than Bootstrap's 100%, so its column is its own width. */
@media (min-width: 768px) {
    .team-table .team-role-form .form-select {
        inline-size: var(--field-w-xs);
    }

    /* The select and Set Role stay on one line in the fitted table: app-inline-form wraps,
       and a fit table gives the cell only the width it is asked for, so Set Role dropped
       under the select at every desktop width and doubled the row's height. The field
       takes its select's width; the form stacks only on a phone (the table's cards). */
    .team-table .team-role-form {
        flex-wrap: nowrap;
    }

    .team-table .team-role-form > :not(.btn, .app-action) {
        flex: none;
    }

    /* A long address wraps at 20rem rather than widen its column. */
    .team-table .team-email-text {
        display: inline-block;
        max-inline-size: var(--field-w-md);
    }
}

/* The add form's fieldset only groups the controls a full team disables; it
   draws nothing of its own. */
.team-add {
    min-inline-size: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

/* ── Style guide (/Admin/StyleGuide) ──────────────────────────────────────────
   The token samples on the style guide's front page, and the narrow box the component
   sample pages draw in. Nothing else draws a token as a sample. The markup sets only the custom property each sample shows: --swatch (a
   colour) or --sample-size (a type size or a space). */

/* The token's own colour in the theme being viewed, beside its written values. */
.style-guide-swatch {
    display: inline-block;
    inline-size: var(--sp-6);
    block-size: var(--sp-5);
    background: var(--swatch);
    border: var(--edge-w) solid var(--ink);
    vertical-align: middle;
}

.style-guide-type {
    font-size: var(--sample-size);
}

.style-guide-space {
    display: inline-block;
    inline-size: var(--sample-size);
    block-size: var(--sp-3);
    background: var(--ink);
    vertical-align: middle;
}

/* A token name stays whole, so it reads and copies as one word. A long value (a font
   stack, a shadow) wraps at its spaces. On the narrowest phones the table scrolls inside
   its labelled region. */
.style-guide-token-name {
    white-space: nowrap;
}

.style-guide-token-value {
    overflow-wrap: break-word;
}

/* A box as narrow as a small tile (9rem of content) on a component's sample page, so the
   page shows how the component behaves when it has little room. */
.style-guide-narrow {
    box-sizing: content-box;
    inline-size: 9rem;
    max-inline-size: 100%;
    padding: var(--sp-2);
    border: var(--edge-w) dashed var(--ink-muted);
}

/* A box as narrow as a small table cell (7rem) on the Row Actions sample page, so the page
   shows the kebab wrapping under the visible button at the cell's end. */
.style-guide-narrow-cell {
    inline-size: 7rem;
    max-inline-size: 100%;
}

/* ── Trade comparison and offer composer (mig-trade-composer) ─────────────────
   The classes Pages/Collectors/Trade.cshtml and MakeOffer.cshtml own. The header,
   totals, panels, fold, stepper, split and bar are components; these only lay
   the composer out around them. docs/ui/dead-css/mig-trade-composer.md lists
   what this unit left unused. Usage: the classes are written in those two views
   only. */

/* ── Trade: where your side's cards come from ──
   The Offer From switch at the top of its panel, over the list it chooses. */
.trade-source-switch {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: var(--sp-2);
    margin-block-end: var(--sp-3);
}

/* On a phone the switch takes the panel's width, so its two options share it
   (full-width-on-phone) and "My Whole Collection" keeps one line from 375px. As
   a flex item it was only as wide as its labels, and the second one wrapped. */
@media (max-width: 575.98px) {
    .trade-source-switch > .app-segmented {
        flex: 1 1 100%;
    }
}

/* ── MakeOffer: the lists, then the totals and Send ──
   From 992px the totals are a sticky side beside the lists (app-split break=lg
   sticky), with Send under them, so both stay in view while the counts change
   (audit CT8). Below 992px the side gives up its box (display: contents), so the
   summary and the Send bar become items of the split itself: the bar is then the
   last item of the whole composer and sticks to the bottom of the screen for as
   long as the composer is on it (app-action-bar sticky=below-lg), where inside
   the short side it would only have stuck while the side was in view. */
.offer-composer > .app-split-main,
.offer-composer > .app-split-side {
    display: grid;
    align-content: start;
    gap: var(--sp-5);
}

.offer-composer > .app-split-side {
    gap: var(--sp-3);
}

@media (max-width: 991.98px) {
    .offer-composer > .app-split-side {
        display: contents;
    }
}

/* The message box keeps the form measure on a wide main column. */
.offer-message-field {
    display: grid;
    gap: var(--sp-1);
    max-inline-size: var(--measure-form);
}

.offer-message-field > .form-label {
    margin: 0;
}

/* The totals in short, inside the Send bar: Get, Give and the signed Difference
   on three short lines beside the button, small enough that the bar stays one
   row inside --sticky-bar-max from 320px. The full summary, with the copies and
   the words for who it favours, is drawn above the bar. */
.offer-send-totals {
    display: grid;
    grid-template-columns: auto auto;
    align-content: center;
    column-gap: var(--sp-2);
    flex: 1 1 auto;
    min-inline-size: 0;
    margin: 0;
    font-size: var(--fs-1);
    line-height: 1.2;
}

.offer-send-totals > div {
    display: contents;
}

.offer-send-totals dt {
    font-weight: 600;
    color: var(--ink-muted);
}

.offer-send-totals dd {
    margin: 0;
    font-weight: 700;
    text-align: end;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Below 360px the button gives up its icon, so the totals and the whole label
   fit one row. */
@media (max-width: 359.98px) {
    .offer-send-bar .app-action > .bi {
        display: none;
    }
}

/* From 360px there is room for the figures a step up from the 12px floor:
   they are what a member watches while stepping counts. Three lines of 13px
   still fit the bar's one 44px row. */
@media (min-width: 360px) {
    .offer-send-totals {
        font-size: var(--fs-2);
    }
}

@media (min-width: 992px) and (min-height: 600px) {
    /* The full summary is in view beside the lists, so the short totals go. */
    .offer-send-totals {
        display: none;
    }

    /* Send fills the side under the totals. */
    .offer-send-bar .app-action-bar-actions,
    .offer-send-bar .app-action {
        inline-size: 100%;
    }
}

/* A wide screen shorter than 600px: the side does not stick there (app-split
   sticky needs 600px of height), so the summary and Send scrolled away
   together. The side runs the height of the lists instead, and the Send bar,
   with the totals in short, sits at its foot. The bar's sticky="below-lg-or-short"
   (components/action-bar.css) sticks it to the bottom of the screen there, boxed
   as the phone's bar is; this block only lays out the side around it. */
@media (min-width: 992px) and (max-height: 599.98px) {
    .offer-composer > .app-split-side {
        align-self: stretch;
        grid-template-rows: auto 1fr;
    }

    .offer-send-bar {
        align-self: end;
    }
}

@media (min-width: 992px) {

    /* The summary in the 20rem side: You Get and You Give share a row and the
       difference takes the next, as on a phone, with the figures a step smaller
       so "-12,345.67 CAD" fits half the side. */
    .offer-composer .trade-totals-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .offer-composer .trade-totals-cell {
        padding: var(--sp-2) var(--sp-3);
    }

    .offer-composer .trade-totals-cell--difference {
        grid-column: 1 / -1;
    }

    .offer-composer .trade-totals-figure {
        font-size: var(--fs-5);
    }
}
