* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* Accent — active/selected state, primary actions, focused inputs.
       One indigo, used sparingly, so it always means "this one". */
    --accent:        #4f46e5;
    --accent-hover:  #4338ca;
    /* Solid fills under white text (primary buttons): AA in both themes. */
    --accent-fill:       #4f46e5;
    --accent-fill-hover: #4338ca;
    --accent-soft:   #eef0fe;
    --accent-soft-2: #e0e4fd;
    --accent-strong: #3730a3;
    --accent-ring:   rgba(79, 70, 229, 0.20);

    /* Sidebar chrome. A light rail in light mode, a deep one in dark. */
    --nav-bg:                #fbfbfc;
    --nav-fg:                #3f4451;
    --nav-fg-strong:         #111318;
    --nav-icon:              #8b91a0;
    --nav-group-fg:          #7c8291;
    --nav-hover-bg:          #f0f1f4;
    --nav-active-bg:         #ffffff;
    --nav-active-fg:         #111318;
    --nav-active-shadow:     0 0 0 1px rgba(17, 19, 24, 0.07), 0 1px 2px rgba(17, 19, 24, 0.06);
    --nav-chip-bg:           #eceef2;
    --nav-chip-bg-active:    #eef0fe;
    --nav-chip-fg:           #4b5160;
    --nav-hot-bg:            #e5484d;
    --nav-search-bg:         #ffffff;
    --nav-search-border:     #e3e5ea;
    --nav-search-border-hover: #c9cdd5;
    --nav-search-fg:         #8b91a0;
    --nav-search-fg-hover:   #3f4451;
    --backdrop:              rgba(17, 19, 24, 0.32);

    /* Neutrals. Low-contrast hairlines, near-black ink, a cool grey canvas
       so white surfaces lift off it without heavy borders. */
    --border:        #e1e3e8;
    --border-strong: #c4c8d0;
    --control-border:#d5d8df;
    --muted:         #6b7180;
    --muted-fg:      #4b5160;
    --fg:            #14161b;
    --bg-soft:       #f5f6f8;
    --bg-card:       #ffffff;
    --bg-hover:      #f3f4f6;
    --bg-subtle:     #fafafb;
    --text:          #2a2e37;
    --dim:           #8b91a0;
    --dim-strong:    #6b7180;
    --dim-deep:      #4b5160;
    --line:          #e6e8ec;
    --line-soft:     #eff0f3;
    --accent-fg:     #4338ca;
    --link:          #4338ca;
    --link-hover:    #312e81;

    /* Status pairs — soft fill + deep ink. */
    --bad-bg:        #fdecec;
    --bad-fg:        #b42318;
    --warn-bg:       #fef4e2;
    --warn-fg:       #93470d;
    --ok-bg:         #e6f6ec;
    --ok-fg:         #106b3a;
    --info-bg:       #e8f0fd;
    --info-bg-soft:  #f3f7fe;
    --info-fg:       #1d4ed8;
    --bad-fg-bright: #dc2626;
    --warn-bg-soft:  #fffaf0;
    --warn-bg-strong:#fde4b0;
    --warn-fg-bright:#b45309;
    --ok-fg-bright:  #16a34a;
    --info-bg-strong:#cddffb;
    --orange-bg:     #fdeedf;
    --orange-bg-soft:#fff7ef;
    --orange-fg:     #9a3412;
    --teal-bg:       #dff5f1;
    --teal-fg:       #115e56;
    --purple-bg:     #f1ecfe;
    --purple-fg:     #5b21b6;
    --gray-bg-strong:#e6e8ec;

    /* Dark mode is automatic (prefers-color-scheme) — see the block at the
       end of this file. */
    color-scheme: light dark;

    /* Motion, radii, elevation */
    --t-fast:        120ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-med:         180ms cubic-bezier(0.4, 0, 0.2, 1);
    --r-pill:        999px;
    --r-card:        12px;
    --r-input:       8px;
    --r-badge:       6px;
    --shadow-xs:     0 1px 2px rgba(17, 19, 24, 0.05);
    --shadow-card:   0 1px 2px rgba(17, 19, 24, 0.04), 0 1px 3px rgba(17, 19, 24, 0.03);
    --shadow-pop:    0 12px 32px rgba(17, 19, 24, 0.12), 0 2px 6px rgba(17, 19, 24, 0.06);

    --font-sans: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

/* Inter, self-hosted (web/fonts, OFL): one variable file per script range,
   so every platform renders the same face at every weight. */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/fonts/inter-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/fonts/inter-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-feature-settings: "cv11", "ss03";
    background: var(--bg-soft);
    /* Pattern stays pinned to the viewport; content scrolls over it. The
       per-page rules below use longhand, so they inherit this — except the
       ones whose `background` shorthand resets it (re-set there). */
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.5;
}

/* ─────────── Per-section backgrounds ───────────
   Every page in the sidebar wears its own pattern, chosen for what the page
   is for; detail pages wear their section's. The shapes come from Temani
   Afif's CSS Pattern collection (css-pattern.com) and MagicPattern's CSS
   backgrounds (magicpattern.design/tools/css-backgrounds), re-coloured into
   a pastel pair of the section's hue. Colours live in --p1..--p4 so dark
   mode swaps only the palette; --canvas is the tone loose text sits on (the
   halo below). Pinned to the viewport: content scrolls over the pattern. */

/* Dashboard — 3D squares (the board of panels) (css-pattern.com/3d-squares) */
body.page-dashboard {
    --p1: #d9dee6; --p2: #f2f4f7; --p3: #e5e9ef;
    --canvas: #f2f4f7;
    --_g: var(--p1) 10%, var(--p2) 10.5% 19%, #0000 19.5% 80.5%, var(--p2) 81% 89.5%, var(--p3) 90%;
    --_c: from -90deg at 37.5% 50%, #0000 75%;
    --_l1: linear-gradient(145deg, var(--_g));
    --_l2: linear-gradient( 35deg, var(--_g));
    background:
        var(--_l1), var(--_l1) calc(150px/2) 150px,
        var(--_l2), var(--_l2) calc(150px/2) 150px,
        conic-gradient(var(--_c), var(--p1) 0) calc(150px/8) 0,
        conic-gradient(var(--_c), var(--p3) 0) calc(150px/2) 0,
        linear-gradient(90deg, var(--p3) 38%, var(--p1) 0 50%, var(--p3) 0 62%, var(--p1) 0);
    background-size: 150px calc(2*150px/3);
    background-attachment: fixed;
}

/* Orders — circles & pills (css-pattern.com/circles-pills) */
body.page-orders {
    --p1: #f3f7fd; --p2: #dde8f7;
    --canvas: #dde8f7;
    --_g: /calc(3*64px) calc(2*64px) conic-gradient(at 33% 25%, #0000 75%, var(--p1) 0);
    background:
        calc(64px/-2) calc(64px/4) var(--_g),
        calc(64px/2) calc(5*64px/4) var(--_g),
        radial-gradient(var(--p1) 34%, var(--p2) 36%) 0 0/64px 64px;
    background-attachment: fixed;
}

/* Returns — concentric arrows (coming back) (css-pattern.com/concentric-arrows) */
body.page-returns {
    --p1: #efd9df; --p2: #faf1f3;
    --canvas: #faf1f3;
    --g: var(--p1) 0 25%, var(--p2) 0 50%, #0000 0;
    background:
        conic-gradient(from 135deg at 25% 75%, var(--g)) calc(100px/4) calc(100px/-4),
        conic-gradient(from -45deg at 75% 25%, var(--g)) calc(100px/-4) calc(100px/4),
        repeating-conic-gradient(var(--g));
    background-size: 100px 100px;
    background-attachment: fixed;
}

/* Shipping — diagonal arrows (going out) (css-pattern.com/diagonal-arrows) */
body.page-shipping {
    --p1: #f3e2c4; --p2: #faf2e3;
    --canvas: #faf2e3;
    background:
        conic-gradient(from  45deg at 75% 75%, var(--p1) 25%, var(--p2) 0 50%, #0000 0) 0 0/56px 56px,
        conic-gradient(from 225deg at 25% 25%, var(--p2) 25%, var(--p1) 0 50%, #0000 0) 0 0/56px 56px,
        repeating-conic-gradient(var(--p2) 0 25%, var(--p1) 0 50%) 0 0/calc(2*56px) calc(2*56px);
    background-attachment: fixed;
}

/* Incoming — chevrons (css-pattern.com/chevrons) */
body.page-incoming {
    --p1: #d5e9e6; --p2: #eff7f6;
    --canvas: #eff7f6;
    --l: var(--p1) 20%, #0000 0;
    --g: 35%, var(--p2) 0 45%, var(--p1) 0;
    background:
        linear-gradient(45deg, var(--l) 45%, var(--p1) 0 70%, #0000 0),
        linear-gradient(-45deg, var(--l) var(--g) 70%, #0000 0),
        linear-gradient(45deg, var(--p1) var(--g));
    background-size: 120px 120px;
    background-attachment: fixed;
}

/* Moves — stairs (between the floors) (css-pattern.com/stairs) */
body.page-moves {
    --p1: #ecd8c8; --p2: #f4ebe3; --p3: #fbf7f3;
    --canvas: #fbf7f3;
    --_g: conic-gradient(at 50% 25%, #0000 75%, var(--p1) 0);
    background:
        var(--_g), var(--_g) 40px 40px,
        var(--_g) calc(2*40px) calc(2*40px),
        var(--_g) calc(3*40px) calc(3*40px),
        repeating-linear-gradient(135deg, var(--p2) 0 12.5%, var(--p3) 0 25%);
    background-size: calc(4*40px) calc(4*40px);
    background-attachment: fixed;
}

/* WTB — hearts (the wishlist) (css-pattern.com/hearts) */
body.page-wtb {
    --p1: #f4e2cf; --p2: #faf4ea;
    --canvas: #faf4ea;
    --_g: 80%, var(--p1) 25.4%, #0000 26%;
    background:
        radial-gradient(at 80% var(--_g)),
        radial-gradient(at 20% var(--_g)),
        conic-gradient(from -45deg at 50% 41%, var(--p1) 90deg, var(--p2) 0) calc(44px/2) 0;
    background-size: 44px 44px;
    background-attachment: fixed;
}

/* POS — circles & squares (coins and keys) (css-pattern.com/circles-squares) */
body.page-pos {
    --p1: #f5f0fb; --p2: #e6ddf4;
    --canvas: #e6ddf4;
    --_g: var(--p1) 0 100%, #0000 102%;
    background:
        conic-gradient(#0000 75%, var(--_g)) calc(80px/4) calc(80px/4),
        radial-gradient(65% 65% at 50% -50%, var(--_g)),
        radial-gradient(65% 65% at -50% 50%, var(--_g)),
        radial-gradient(65% 65% at 50% 150%, var(--_g)),
        radial-gradient(65% 65% at 150% 50%, var(--_g))
        var(--p2);
    background-size: 80px 80px;
    background-attachment: fixed;
}

/* Match Sells — linked squares (css-pattern.com/linked-squares) */
body.page-matching {
    --p1: #f3effb; --p2: #ddd4f1;
    --canvas: #f3effb;
    --_s: calc(2*80px) calc(2*80px);
    --_g: var(--_s) conic-gradient(at 40% 40%, #0000 75%, var(--p1) 0);
    --_p: var(--_s) conic-gradient(at 20% 20%, #0000 75%, var(--p2) 0);
    background:
        calc( .9*80px) calc( .9*80px)/var(--_p),
        calc(-.1*80px) calc(-.1*80px)/var(--_p),
        calc( .7*80px) calc( .7*80px)/var(--_g),
        calc(-.3*80px) calc(-.3*80px)/var(--_g),
        conic-gradient(from 90deg at 20% 20%, var(--p2) 25%, var(--p1) 0) 0 0/80px 80px;
    background-attachment: fixed;
}

/* Products — 3D zig-zag (a sole's tread) (css-pattern.com/3d-zig-zag) */
body.page-products {
    --p1: #dce9dc; --p2: #cadfca; --p3: #e6efe6; --p4: #f3f8f3;
    --canvas: #e6efe6;
    --g1: conic-gradient(at calc(250%/3) calc(50%/3), var(--p1) 60deg, #0000 0 300deg, var(--p2) 0);
    --g2: conic-gradient(at calc(50%/3) 50%, #0000 75%, var(--p2) 0);
    --g3: conic-gradient(at calc(100%/3) 50%, #0000 75%, var(--p1) 0);
    --g4: conic-gradient(from 59deg at calc(200%/3) calc(249%/9), var(--p3) 61deg, #0000 62deg);
    --g5: conic-gradient(from 60deg at 50% calc(250%/3), var(--p4) 60deg, var(--p2) 0 120deg, #0000 0);
    --_p: calc(9*tan(30deg)*24px);
    background:
        var(--g1) calc(-1*24px) 0, var(--g1) calc(2*24px) var(--_p),
        var(--g2), var(--g2) calc(3*24px) var(--_p),
        var(--g3), var(--g3) calc(3*24px) var(--_p),
        var(--g4), var(--g4) calc(3*24px) var(--_p),
        var(--g5) calc(3*24px) 0, var(--g5) 0 var(--_p) var(--p3);
    background-size: calc(6*24px) calc(2*var(--_p));
    background-attachment: fixed;
}

/* Stock Sync — waves (css-pattern.com/waves) */
body.page-stock-sync {
    --p1: #eff8f3; --p2: #d8ece2;
    --canvas: #eff8f3;
    --_s: 37.5% 12.5% at 62.5%;
    --_g: 34% 99%, #0000 101%;
    --g1: radial-gradient(var(--_s) 100%, #0000 32%, var(--p1) var(--_g));
    --g2: radial-gradient(var(--_s) 0   , #0000 32%, var(--p1) var(--_g));
    --g3: radial-gradient(var(--_s) 100%, #0000 32%, var(--p2) var(--_g));
    --g4: radial-gradient(var(--_s) 0   , #0000 32%, var(--p2) var(--_g));
    background:
        var(--g1),
        var(--g2) 0 calc(3*22px),
        var(--g3) 22px calc(3*22px),
        var(--g4) 22px calc(6*22px),
        var(--g1) calc(2*22px) calc(6*22px),
        var(--g2) calc(2*22px) calc(9*22px),
        var(--g3) calc(3*22px) calc(9*22px),
        var(--g4) calc(3*22px) 0,
        repeating-linear-gradient(var(--p1) 0 25%, var(--p2) 0 50%);
    background-size: calc(4*22px) calc(12*22px);
    background-attachment: fixed;
}

/* PINGER — ripples (a ping going out) (magicpattern.design/tools/css-backgrounds#ripple) */
body.page-pinger {
    --p1: #f2f6ea; --p2: #e0ead0;
    --canvas: #f2f6ea;
    background-color: var(--p1);
    background-image: repeating-radial-gradient(circle at 50% 50%, transparent 0, transparent 16px, var(--p2) 16px, var(--p2) 20px, transparent 20px, transparent 40px);
    background-size: 40px 40px;
    background-attachment: fixed;
}

/* Inventory — overlapping cubes (stacked stock) (css-pattern.com/overlapping-cubes) */
body.page-inventory {
    --p1: #ced4ee; --p2: #e3e7f5; --p3: #f3f5fb;
    --canvas: #f3f5fb;
    --_g: 0 120deg, #0000 0;
    background:
        conic-gradient(             at calc(250%/3) calc(100%/3), var(--p1) var(--_g)),
        conic-gradient(from -120deg at calc( 50%/3) calc(100%/3), var(--p2) var(--_g)),
        conic-gradient(from  120deg at calc(100%/3) calc(250%/3), var(--p3) var(--_g)),
        conic-gradient(from  120deg at calc(200%/3) calc(250%/3), var(--p3) var(--_g)),
        conic-gradient(from -180deg at calc(100%/3) 50%, var(--p2) 60deg, var(--p3) var(--_g)),
        conic-gradient(from   60deg at calc(200%/3) 50%, var(--p3) 60deg, var(--p1) var(--_g)),
        conic-gradient(from  -60deg at 50% calc(100%/3), var(--p3) 120deg, var(--p2) 0 240deg, var(--p1) 0);
    background-size: calc(84px*sqrt(3)) 84px;
    background-attachment: fixed;
}

/* Inventory check — graph paper (counting off the grid) (css-pattern.com/graph-paper) */
body.page-inventory-check {
    --p1: #eef5f0; --p2: #bcd8c3;
    --canvas: #eef5f0;
    --_g: #0000 90deg, var(--p2) 0;
    background:
        conic-gradient(from 90deg at 2px 2px, var(--_g)),
        conic-gradient(from 90deg at 1px 1px, var(--_g)),
        var(--p1);
    background-size: 100px 100px, calc(100px/5) calc(100px/5);
    background-attachment: fixed;
}

/* Inventory recount — squares (shelf by shelf) (css-pattern.com/squares) */
body.page-inventory-recount {
    --p1: #eef5f0; --p2: #d5e7da;
    --canvas: #eef5f0;
    background:
        conic-gradient(at 25% 25%, #0000 75%, var(--p2) 0) 36px 36px,
        repeating-conic-gradient(at 25% 25%, var(--p2) 0 25%, var(--p1) 0 50%);
    background-size: calc(2*36px) calc(2*36px);
    background-attachment: fixed;
}

/* Transactions — double arrows (money in and out) (css-pattern.com/double-arrows) */
body.page-transactions {
    --p1: #ecdca6; --p2: #e0b8c6;
    --canvas: #ecdca6;
    --_l: #0000 43.75%, var(--p1) 0 56.25%, #0000 0;
    --_s: calc(100px/4) calc(100px/-4)/calc(100px*2) calc(100px*2);
    background:
        linear-gradient(-45deg, var(--_l)) var(--_s),
        linear-gradient( 45deg, var(--_l)) var(--_s),
        conic-gradient(var(--p2) 75%, var(--p1) 0) 0 0/100px 100px;
    background-attachment: fixed;
}

/* Invoices — intersecting diagonals (argyle) (css-pattern.com/intersecting-diagonals) */
body.page-invoices {
    --p1: #cfe2dc; --p2: #eef3da;
    --canvas: #eef3da;
    background:
        linear-gradient(45deg, var(--p1) 12.5%, var(--p2) 0 25%, #0000 0 75%, var(--p2) 0 87.5%, var(--p1) 0) calc(150px/2) calc(150px/2),
        linear-gradient(45deg, var(--p2) 12.5%, var(--p1) 0 25%, #0000 0 75%, var(--p1) 0 87.5%, var(--p2) 0),
        repeating-linear-gradient(-45deg, var(--p1) 0 12.5%, var(--p2) 0 25%, var(--p1) 0 37.5%, var(--p2) 0 62.5%);
    background-size: 150px 150px;
    background-attachment: fixed;
}

/* Bons — zig-zag (a receipt's torn edge) (css-pattern.com/zig-zag) */
body.page-bons {
    --p1: #fbf4ed; --p2: #f1dfd0;
    --canvas: #fbf4ed;
    --_g: var(--p1) 90deg, #0000 90.5deg;
    background:
        conic-gradient(from -45deg, var(--_g)),
        conic-gradient(from 135deg, var(--_g)) calc(60px/2) 0,
        var(--p2);
    background-size: 60px 60px;
    background-attachment: fixed;
}

/* Cash — rectangles & lines (banknote stacks) (css-pattern.com/rectangles-lines) */
body.page-cash {
    --p1: #d4e9d6; --p2: #eff7ef;
    --canvas: #eff7ef;
    --_c: 5%, #0000 75%, var(--p1) 0;
    --_g: /120px 120px conic-gradient(at var(--_c));
    --_l: /120px 120px conic-gradient(at 50% var(--_c));
    background:
        0 calc(7*120px/10) var(--_l),
        calc(120px/2) calc(120px/5) var(--_l),
        calc(120px/5) 0 var(--_g),
        calc(7*120px/10) calc(120px/2) var(--_g),
        conic-gradient(at 90% 90%, var(--p1) 75%, var(--p2) 0) 0 0/calc(120px/2) calc(120px/2);
    background-attachment: fixed;
}

/* Z Reports — ledger paper (magicpattern.design/tools/css-backgrounds#paper) */
body.page-zreports {
    --p1: #f1f2fa; --p2: #dcdff2;
    --canvas: #f1f2fa;
    background-color: var(--p1);
    background-image:
        linear-gradient(var(--p2) 2px, transparent 2px),
        linear-gradient(90deg, var(--p2) 2px, transparent 2px),
        linear-gradient(var(--p2) 1px, transparent 1px),
        linear-gradient(90deg, var(--p2) 1px, var(--p1) 1px);
    background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
    background-position: -2px -2px, -2px -2px, -1px -1px, -1px -1px;
    background-attachment: fixed;
}

/* Buy Invoices — diagonal rectangles (a stack of papers) (css-pattern.com/diagonal-rectangles) */
body.page-buy-invoices {
    --p1: #dae1eb; --p2: #f2f5f9;
    --canvas: #f2f5f9;
    background:
        linear-gradient(135deg, #0000 18.75%, var(--p1) 0 31.25%, #0000 0),
        repeating-linear-gradient(45deg, var(--p1) -6.25% 6.25%, var(--p2) 0 18.75%);
    background-size: 110px 110px;
    background-attachment: fixed;
}

/* Providers — brick (the businesses we buy from) (css-pattern.com/brick) */
body.page-providers {
    --p1: #eed3de; --p2: #faf1f5;
    --canvas: #faf1f5;
    --g: conic-gradient(at 90% 40%, #0000 75%, var(--p1) 0);
    background: var(--g), var(--g) 34px 34px var(--p2);
    background-size: calc(2*34px) calc(2*34px);
    background-attachment: fixed;
}

/* Expenses — tartan (magicpattern.design/tools/css-backgrounds#tartan) */
body.page-expenses {
    --p1: #edf5f7; --p2: rgba(8, 145, 178, 0.07);
    --canvas: #edf5f7;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 24px, var(--p2) 24px, var(--p2) 40px),
        repeating-linear-gradient(90deg, transparent, transparent 24px, var(--p2) 24px, var(--p2) 40px);
    background-color: var(--p1);
    background-attachment: fixed;
}

/* GOAT — 3D triangles (peaks) (css-pattern.com/3d-triangles) */
body.page-goat {
    --p1: #dfe6c9; --p2: #ebefdb; --p3: #f6f8ee;
    --canvas: #f6f8ee;
    background:
        conic-gradient(from 75deg, var(--p1) 15deg, var(--p2) 0 30deg, #0000 0 180deg,
                                   var(--p2) 0 195deg, var(--p1) 0 210deg, #0000 0)
            calc(80px/2) calc(.5*80px/tan(30deg)),
        conic-gradient(var(--p1) 30deg, var(--p3) 0 75deg, var(--p1) 0 90deg, var(--p2) 0 105deg,
                       var(--p3) 0 150deg, var(--p2) 0 180deg, var(--p3) 0 210deg, var(--p1) 0 256deg,
                       var(--p2) 0 270deg, var(--p1) 0 286deg, var(--p2) 0 331deg, var(--p3) 0);
    background-size: 80px calc(80px/tan(30deg));
    background-attachment: fixed;
}

/* Suppliers — cube columns (stacked boxes) (css-pattern.com/cube-columns) */
body.page-suppliers {
    --p1: #e4e7f4; --p2: #f5f6fb; --p3: #d4d9ee;
    --canvas: #f5f6fb;
    --_g: var(--p1) 0 120deg, #0000 0;
    background:
        conic-gradient(from -60deg at 50% calc(100%/3), var(--_g)),
        conic-gradient(from 120deg at 50% calc(200%/3), var(--_g)),
        conic-gradient(from  60deg at calc(200%/3), var(--p1) 60deg, var(--p2) 0 120deg, #0000 0),
        conic-gradient(from 180deg at calc(100%/3), var(--p3) 60deg, var(--_g)),
        linear-gradient(90deg, var(--p3) calc(100%/6), var(--p2) 0 50%, var(--p3) 0 calc(500%/6), var(--p2) 0);
    background-size: calc(1.732*64px) 64px;
    background-attachment: fixed;
}

/* Users — overlapping circles (css-pattern.com/overlapping-circles) */
body.page-users {
    --p1: #f8eeed; --p2: #eedad8;
    --canvas: #f8eeed;
    --_g:
        var(--p1) 0% 5%, var(--p2) 6% 15%, var(--p1) 16% 25%, var(--p2) 26% 35%, var(--p1) 36% 45%,
        var(--p2) 46% 55%, var(--p1) 56% 65%, var(--p2) 66% 75%, var(--p1) 76% 85%, var(--p2) 86% 95%,
        #0000 96%;
    background:
        radial-gradient(50% 50% at 100% 0, var(--_g)),
        radial-gradient(50% 50% at 0 100%, var(--_g)),
        radial-gradient(50% 50%, var(--_g)),
        radial-gradient(50% 50%, var(--_g)) calc(120px/2) calc(120px/2)
        var(--p1);
    background-size: 120px 120px;
    background-attachment: fixed;
}

/* Jobs — maze (work finding its way) (css-pattern.com/maze) */
body.page-jobs {
    --p1: #f3f4f6; --p2: #e1e5eb;
    --canvas: #f3f4f6;
    --c: #0000 75%, var(--p1) 0;
    --g: /calc(2*56px) 56px conic-gradient(at 62.5% 25%, var(--c));
    background:
        calc(56px/4) calc(56px/4) var(--g),
        calc(5*56px/4) calc(56px/-4) var(--g),
        linear-gradient(90deg, var(--c)) 0/56px 56px
        var(--p2);
    background-attachment: fixed;
}

/* Secret admin — plus signs (settings) (css-pattern.com/plus-sign) */
body.page-admin {
    --p1: #f2f3f5; --p2: #e0e3e8;
    --canvas: #f2f3f5;
    --_c: #0000 75%, var(--p1) 0;
    --_g1: conic-gradient(at 10% 50%, var(--_c));
    --_g2: conic-gradient(at 50% 10%, var(--_c));
    background:
        var(--_g1),
        var(--_g1) calc(1*28px) calc(3*28px),
        var(--_g1) calc(2*28px) calc(1*28px),
        var(--_g1) calc(3*28px) calc(4*28px),
        var(--_g1) calc(4*28px) calc(2*28px),
        var(--_g2) 0 calc(4*28px),
        var(--_g2) calc(1*28px) calc(2*28px),
        var(--_g2) calc(2*28px) 0,
        var(--_g2) calc(3*28px) calc(3*28px),
        var(--_g2) calc(4*28px) calc(1*28px),
        var(--p2);
    background-size: calc(5*28px) calc(5*28px);
    background-attachment: fixed;
}

/* Keyboard-focus ring — only via :focus-visible so mouse/touch
   interactions don't get a halo, but Tab navigation does. */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 3px;
}

/* Global anchor style: accent ink, no underline until hover. A link in a
   table (an order number, a document) reads as the row's handle without
   a dashed rule under every cell. Specific contexts (nav, .btn,
   .menu-item) keep their own colors. */
a {
    color: var(--link);
    text-decoration: none;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color var(--t-fast),
                text-decoration-color var(--t-fast);
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
}

/* Layout: sticky left sidebar + flexing content. */
body {
    display: flex;
    align-items: flex-start;
}

nav {
    background: var(--nav-bg);
    color: var(--nav-fg);
    border-right: 1px solid var(--line);
    width: 236px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    display: flex;
    flex-direction: column;
    padding: 0.9rem 0.7rem 0.75rem;
}

nav .nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 650;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    color: var(--nav-fg-strong);
    text-decoration: none;
    padding: 0.2rem 0.5rem 0.65rem;
}
nav .nav-brand:hover { color: var(--nav-fg-strong); text-decoration: none; }
.nav-mark {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: linear-gradient(180deg, #2a2f3a, #111318);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 750;
    letter-spacing: 0.02em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 1px 2px rgba(17, 19, 24, 0.2);
}

nav .nav-links {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
}

nav .nav-group {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--nav-group-fg);
    padding: 1rem 0.6rem 0.3rem;
}

nav .nav-links a.nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--nav-fg);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    padding: 0.32rem 0.6rem;
    border-radius: var(--r-input);
    transition: background var(--t-fast), color var(--t-fast);
}
nav .nav-links a.nav-item > span:not(.nav-count) { flex: 1; min-width: 0; }

.nav-icon {
    flex: none;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--nav-icon);
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke var(--t-fast);
}

/* Work waiting behind a nav item; filled in by /nav-counts after load. */
.nav-count {
    min-width: 1.3rem;
    padding: 0 0.38rem;
    border-radius: var(--r-pill);
    background: var(--nav-chip-bg);
    color: var(--nav-chip-fg);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.2rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.nav-count:empty { display: none; }
.nav-count.hot { background: var(--nav-hot-bg); color: #fff; }
nav .nav-links a.nav-item.active .nav-count { background: var(--nav-chip-bg-active); color: var(--accent-strong); }
nav .nav-links a.nav-item.active .nav-count.hot { background: var(--nav-hot-bg); color: #fff; }

nav .nav-search {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 0.35rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--nav-search-border);
    border-radius: var(--r-input);
    background: var(--nav-search-bg);
    box-shadow: var(--shadow-xs);
    color: var(--nav-search-fg);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    transition: border-color var(--t-fast), color var(--t-fast);
}
nav .nav-search:hover { color: var(--nav-search-fg-hover); border-color: var(--nav-search-border-hover); }
nav .nav-search .nav-search-label { margin: 0 auto 0 0.5rem; }
nav .nav-search::before {
    content: "";
    flex: none;
    width: 15px;
    height: 15px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") center / contain no-repeat;
}
nav .nav-search .kbd {
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0 0.3rem;
    border: 1px solid var(--nav-search-border);
    border-radius: 4px;
    line-height: 1.1rem;
}

nav .nav-links a.nav-item:hover {
    color: var(--nav-fg-strong);
    background: var(--nav-hover-bg);
    text-decoration: none;
}
nav .nav-links a.nav-item:hover .nav-icon { stroke: var(--nav-fg); }

nav .nav-links a.nav-item.active {
    color: var(--nav-active-fg);
    background: var(--nav-active-bg);
    box-shadow: var(--nav-active-shadow);
    font-weight: 600;
}
nav .nav-links a.nav-item.active .nav-icon { stroke: var(--accent); }
nav .nav-links a.nav-item { position: relative; }
nav .nav-links a.nav-item.active::before {
    content: "";
    position: absolute;
    left: -0.7rem;
    top: 0.4rem;
    bottom: 0.4rem;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
}

nav .nav-links form {
    margin-top: auto;
    padding: 1rem 0.6rem 0.25rem;
}
nav .nav-links form .btn { width: 100%; justify-content: center; }

/* Login / access-denied screens opt out of the sidebar: simple top bar,
   normal block flow underneath. */
body.auth {
    display: block;
}
body.auth nav {
    width: auto;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
}
body.auth nav .nav-brand { padding: 0; }
body.auth main { max-width: 480px; margin-top: 4rem; }

main {
    flex: 1;
    min-width: 0;
    max-width: 1320px;
    margin: 1.75rem auto 3rem;
    padding: 0 2rem;
}

/* On a patterned section the whole content column is one panel of its
   section's canvas colour (--canvas, set with each pattern): a single shape
   with a hairline edge and the same 20px of pattern around it on every
   side, holding everything from the title to the last table. The pattern
   frames it and runs at full strength below it. */
body { --canvas: var(--bg-soft); }
body[class*="page-"] main {
    --panel-max: 1320px;
    max-width: none;
    margin: 20px max(20px, calc((100vw - 236px - var(--panel-max)) / 2)) 28px;
    padding: 1.6rem 1.9rem 1.9rem;
    background-color: var(--canvas);
    border: 1px solid color-mix(in srgb, var(--fg) 9%, transparent);
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(17, 19, 24, 0.05), 0 8px 24px -12px rgba(17, 19, 24, 0.12);
}
body.page-dashboard main { --panel-max: 1600px; }
@media (max-width: 640px) {
    body[class*="page-"] main {
        margin: 12px 12px 20px;
        padding: 1.1rem 0.95rem 1.2rem;
        border-radius: 14px;
    }
}

.info-icon {
    display: inline-block;
    width: 13px;
    height: 13px;
    vertical-align: -2px;
    cursor: help;
    opacity: 0.6;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}
.date-filter-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 0.35rem;
    vertical-align: -2px;
    opacity: 0.7;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E") center / contain no-repeat;
}

main ul:not([class]) { padding-left: 1.2rem; }
.ss-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 0.9rem 0; }

/* ─────────── Tabs, toggles, chips: choosing, not acting ───────────
   A button does something; these choose what is shown, so they never look
   like buttons. The chosen one is the link with aria-current. */

/* Tabs: sibling views of one page (Buy Invoices' sources, the new-item
   picker's lists). An underlined row along a hairline. */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.4rem;
    margin: 0 0 1.1rem;
    border-bottom: 1px solid var(--line);
}
.tabs > .tab {
    position: relative;
    padding: 0.5rem 0.1rem 0.6rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    transition: color var(--t-fast);
}
.tabs > .tab:hover { color: var(--fg); text-decoration: none; }
.tabs > .tab[aria-current="page"] { color: var(--fg); font-weight: 600; }
.tabs > .tab[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--accent);
}

/* Segmented toggle: one setting of the view in front of you (List / Grid,
   which stock to match against, which location to count). A recessed
   track with the chosen option raised. */
.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 3px;
    background: color-mix(in srgb, var(--fg) 6%, transparent);
    border-radius: 10px;
}
.segmented > .seg {
    padding: 0.3rem 0.8rem;
    border-radius: 7px;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.25rem;
    color: var(--muted-fg);
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.segmented > .seg:hover { color: var(--fg); text-decoration: none; }
.segmented > .seg[aria-current="page"] {
    background: var(--bg-card);
    color: var(--fg);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(17, 19, 24, 0.10), 0 0 0 1px color-mix(in srgb, var(--fg) 6%, transparent);
}

/* Chips: one of many preset choices (the date filter's ranges). */
.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.65rem;
    border: 1px solid var(--control-border);
    border-radius: var(--r-pill);
    font-size: 0.8rem;
    line-height: 1.25rem;
    color: var(--fg);
    background: var(--bg-card);
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--t-fast), border-color var(--t-fast);
}
.chip:hover { border-color: var(--border-strong); background: var(--bg-hover); text-decoration: none; color: var(--fg); }
.chip[aria-current="page"] {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-weight: 600;
}
.scan-row { margin-bottom: 0.9rem; }
/* WTB's buy list: one card of rows (the markup stays a list: Copy reads it). */
#wtb-list {
    list-style: none;
    padding: 0.25rem 0 !important;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
}
#wtb-list > li { padding: 0.6rem 1rem; font-size: 0.875rem; color: var(--fg); }
#wtb-list > li + li { margin-top: 0; border-top: 1px solid var(--line-soft); }
#wtb-list > li.ink-dim { text-align: center; padding: 1.4rem 1rem; color: var(--muted) !important; }
.wtb-sku { font-variant-numeric: slashed-zero; color: var(--muted-fg); font-weight: 500; }
.product-status { margin-top: 2rem; }
.product-status > h2 { margin: 0 0 0.25rem; }
main ul:not([class]) > li + li { margin-top: 0.25rem; }

/* A folding section (Recount's scanned / not scanned lists): a card whose
   header is the toggle, with a chevron instead of the browser's triangle. */
details.fold {
    margin-top: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
}
details.fold > summary,
details.explain > summary {
    display: block;
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--fg);
}
details.fold > summary { padding: 0.8rem 1.1rem; }
details.fold > summary::-webkit-details-marker,
details.explain > summary::-webkit-details-marker { display: none; }
details.fold > summary::before,
details.explain > summary::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 0.5rem;
    vertical-align: -2px;
    background: currentColor;
    opacity: 0.55;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform var(--t-fast);
}
details.fold[open] > summary::before,
details.explain[open] > summary::before { transform: rotate(90deg); }
details.fold[open] > summary { border-bottom: 1px solid var(--line-soft); }
details.fold > :not(summary) { padding: 0.75rem 1.1rem; }
details.explain { margin: 0 0 1rem; font-size: 0.875rem; }
details.explain > summary { font-weight: 500; font-size: 0.875rem; color: var(--link); }
details.explain > p { margin-top: 0.4rem; }
#recount-scanned-grid { padding: 0.75rem 1.1rem !important; }
.fill-card:empty { display: none !important; }
#recount-scanned-grid:empty { display: block; text-align: center; padding: 1.4rem 1rem !important; }
#recount-scanned-grid:empty::before { content: "Nothing scanned yet."; color: var(--muted); font-size: 0.875rem; }

/* The dashboard is a board of panels, not a column of text: let it use
   the full width so a wide screen shows three or four panels per row. */
body.page-dashboard main {
    max-width: 1600px;
}

h1 {
    font-size: 1.375rem;
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--fg);
    margin-bottom: 1.1rem;
}

h2 {
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--fg);
    margin: 2rem 0 0.7rem;
}

h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--fg);
}

p { text-wrap: pretty; }

/* Base form controls. Zero specificity (:where) so every component rule
   that styles its own control (filter pills, POS scan box, popups) still
   wins; this only gives bare inputs a consistent, calm shape. */
:where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"], [type="submit"], [type="button"], [type="image"], [type="hidden"]), select, textarea) {
    font: inherit;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: var(--fg);
    background-color: var(--bg-card);
    border: 1px solid var(--control-border);
    border-radius: var(--r-input);
    padding: 0.36rem 0.6rem;
    box-shadow: var(--shadow-xs);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
:where(select:not([multiple])) {
    appearance: none;
    padding-right: 1.9rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b91a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.45rem center;
    background-size: 16px 16px;
    cursor: pointer;
}
:where(textarea) { line-height: 1.45; }
:where(input, select, textarea):hover { border-color: var(--border-strong); }
:where(input:not([type="checkbox"], [type="radio"]), select, textarea):focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}
:where(input, select, textarea)::placeholder { color: var(--dim); }
/* Controls drawn borderless inside another surface (a pill, the search
   dialog) take that surface's focus treatment, not their own ring. */
.filter-select-multi, .filter-select-multi:focus,
.choice-pill-select, .choice-pill-select:focus,
.search-pill input, .search-pill input:focus,
.search-dialog input[type="search"], .search-dialog input[type="search"]:focus { box-shadow: none !important; background-image: none; }
.filter-pill:has(input:focus-visible, select:focus-visible) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
:where(input, select, textarea):disabled { opacity: 0.6; cursor: not-allowed; }
:where(input[type="checkbox"], input[type="radio"]) {
    accent-color: var(--accent);
    width: 15px;
    height: 15px;
    vertical-align: middle;
    cursor: pointer;
}
:where(label) { color: var(--text); }
:where(hr) { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
:where(code, kbd, samp) { font-family: var(--font-mono); font-size: 0.85em; }
::selection { background: var(--accent-soft-2); }

/* Sync bar */
.sync-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-radius: 6px;
    border: 1px solid var(--line);
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--r-card);
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
}

.stat-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--fg);
    margin-top: 0.25rem;
}

/* ─────────── Dashboard: health strip + section panels ───────────
   Every count on the page is a queue; the whole row is the link to the
   page that clears it. Severity lives on the dot and the number
   (critical = blocks money or a customer, attn = needs a decision,
   wait = waiting on someone else). Empty queues stay in place, dimmed,
   so the layout never shifts between visits. */
.health {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.health > a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem 0.35rem 0.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    font-size: 0.8rem;
    color: var(--muted-fg);
    text-decoration: none;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.health > a:hover { border-color: var(--border-strong); box-shadow: var(--shadow-pop); }
.health .dot { width: 8px; height: 8px; border-radius: 50%; background: #059669; flex-shrink: 0; }
.health .dot.attn { background: #d97706; }
.health .dot.critical { background: #dc2626; }
.health .st { color: var(--fg); font-weight: 600; }
.health .v { font-variant-numeric: tabular-nums; }

/* Columns, not a grid: each panel is as tall as its queue and the next one
   packs up under it, so a quiet panel leaves no hole beside a busy one. */
.board {
    columns: 340px;
    column-gap: 1.25rem;
}
.board > .panel {
    break-inside: avoid;
    margin-bottom: 1.25rem;
}

.panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem 0.75rem;
    border-bottom: 1px solid var(--line-soft);
}
.panel-head h2 { font-size: 0.9375rem; font-weight: 600; margin: 0; }
.panel-head h2 a { color: inherit; text-decoration: none; }
.panel-head h2 a:hover { color: var(--accent-fg); }
.panel-head .sum { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.panel-head .sum.hot { color: var(--bad-fg); font-weight: 600; }

.panel .rows { list-style: none; display: flex; flex-direction: column; }
.panel .rows > li { border-bottom: 1px solid var(--bg-hover); }
.panel .rows > li:last-child { border-bottom: 0; }
.panel .row {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    column-gap: 0.75rem;
    padding: 0.6rem 1.1rem;
    color: inherit;
    text-decoration: none;
    transition: background var(--t-fast);
}
.panel a.row:hover { text-decoration: none; color: inherit; }
.panel .row:hover, .panel .row:focus-visible { background: var(--bg-hover); outline: none; }
/* A row that performs an action instead of navigating (BNR refresh). */
.panel button.row { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.panel button.row.htmx-request { opacity: 0.5; cursor: progress; }
.panel .row:focus-visible { box-shadow: inset 3px 0 0 var(--accent); }
.panel .row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.panel .row.critical .dot { background: #dc2626; }
.panel .row.attn .dot { background: #d97706; }
.panel .row.wait .dot { background: #2563eb; }
.panel .row .lbl { font-size: 0.9rem; line-height: 1.25; min-width: 0; }
.panel .row .det {
    display: block;
    font-size: 0.76rem;
    color: var(--muted);
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.panel .row .num {
    font-size: 1.0625rem;
    font-weight: 650;
    color: var(--fg);
    font-variant-numeric: tabular-nums;
    min-width: 2.5ch;
    text-align: right;
    white-space: nowrap;
}
.panel .row .num small { font-size: 0.74rem; font-weight: 500; color: var(--muted); margin-left: 0.2rem; }
.panel .row.critical .num { color: var(--bad-fg); }
.panel .row.attn .num { color: var(--warn-fg); }
.panel .row .status { font-size: 0.85rem; font-weight: 600; text-align: right; white-space: nowrap; }
.panel .row.critical .status { color: var(--bad-fg); }
.panel .row.attn .status { color: var(--warn-fg); }
.panel .row.zero .lbl, .panel .row.zero .num { color: var(--border-strong); }
.panel .row.zero .det { color: var(--border-strong); }
.panel .row.zero .dot { background: transparent; border: 1px solid var(--border); }

/* The actual items behind a queue, indented under its row. */
.panel .rows > li.items { padding: 0 1.1rem 0.55rem 2.2rem; }
.panel .items table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; margin: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.panel .items tbody tr:hover { background: transparent; }
.panel .items td { padding: 0.12rem 0; border: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 0; }
.panel .items td:first-child { color: var(--muted-fg); font-weight: 500; width: 6em; }
.panel .items td { color: var(--muted); padding-block: 0.15rem; }
/* A status row with nothing wrong is healthy, not idle: green dot. */
.panel .row:has(> .status):not(.critical, .attn, .wait) .dot { background: var(--ok-fg-bright); }
.panel .row:has(> .status):not(.critical, .attn, .wait) .status { color: var(--ok-fg); }
.panel .items td:last-child { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; width: 7em; }
.panel .items td a { color: inherit; text-decoration: none; }
.panel .items td a:hover { color: var(--accent-fg); }
.panel .items td.more { color: var(--muted); font-weight: 400; width: auto; text-align: left; }

.panel-foot { margin-top: auto; padding: 0.6rem 1.1rem; border-top: 1px solid var(--line-soft); background: var(--bg-subtle); font-size: 0.8125rem; display: flex; align-items: center; gap: 1rem; }

/* Empty queues fold away so the ones with work stand out; the footer
   toggle brings them back. */
.panel:not(:has(.show-empty:checked)) .rows > li:has(> .row.zero) { display: none; }
.panel:not(:has(.show-empty:checked)) .rows:has(> li):not(:has(> li > .row:not(.zero)))::after {
    content: "Nothing waiting";
    padding: 1.5rem 1rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
}
.panel:not(:has(.row.zero)) .show-empty-toggle { display: none; }
.show-empty-toggle { margin-left: auto; color: var(--muted); cursor: pointer; user-select: none; transition: opacity var(--t-fast); }
/* Where hovering exists, the toggle waits for the pointer. */
@media (hover: hover) {
    .show-empty-toggle:not(:has(:checked)) { opacity: 0; }
    .panel:hover .show-empty-toggle, .show-empty-toggle:focus-within { opacity: 1; }
}
.show-empty-toggle input { margin-right: 0.3rem; vertical-align: middle; }
.panel-foot a { color: var(--accent-fg); text-decoration: none; font-weight: 500; }
.panel-foot a:hover { text-decoration: underline; }

/* Sales panel: value rows with a third RON column. */
.panel .rows.kpi .row { grid-template-columns: 1fr auto auto; }
.panel .rows.kpi .row .num { min-width: 3.5ch; }
.panel .rows.kpi .row .ron small { font-size: 0.72rem; color: var(--muted); margin-left: 0.2rem; }
.panel .rows.kpi .row .ron { font-size: 0.9rem; font-variant-numeric: tabular-nums; color: var(--muted-fg); min-width: 8ch; text-align: right; }
.panel .rows.kpi .row .ron.up { color: var(--ok-fg); }
.panel .rows.kpi .row .ron.down { color: var(--bad-fg); }

/* Button group */
.btn-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Auth */
.auth-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Buttons — a white secondary by default, one indigo primary per screen. */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.36rem 0.75rem;
    margin: 0;
    border: 1px solid var(--control-border);
    border-radius: var(--r-input);
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.25rem;
    cursor: pointer;
    box-sizing: border-box;
    text-decoration: none;
    white-space: nowrap;
    color: var(--fg);
    background: var(--bg-card);
    box-shadow: var(--shadow-xs);
    vertical-align: middle;
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}

.btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    color: var(--fg);
    text-decoration: none;
}
.btn:active { transform: translateY(0.5px); }

/* A worklist's bulk button ("Mark selected as …") is only the page's
   primary action once something is ticked; until then, or under an empty
   list, it stands back as a secondary button. */
form:has(table):has(table input[type="checkbox"], tbody td[colspan]):not(:has(tbody input[type="checkbox"]:checked)) .btn-primary:not(td *) {
    background: var(--bg-card);
    color: var(--fg);
    border-color: var(--control-border);
    box-shadow: var(--shadow-xs);
}
form:has(table):has(table input[type="checkbox"], tbody td[colspan]):not(:has(tbody input[type="checkbox"]:checked)) .btn-primary:not(td *):hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}
.table-scroll + .btn, .table-scroll + div > .btn:first-child, table + .btn { margin-top: 0.75rem; }

/* Compact button for an action inside a table row. */
.btn-sm {
    padding: 0.18rem 0.55rem;
    font-size: 0.75rem;
    line-height: 1.15rem;
    border-radius: 6px;
}

/* Destructive secondary: quiet until hovered, then plainly red. */
.btn-danger {
    color: var(--bad-fg);
    border-color: color-mix(in srgb, var(--bad-fg) 28%, var(--control-border));
}
.btn-danger:hover {
    color: var(--bad-fg);
    background: var(--bad-bg);
    border-color: color-mix(in srgb, var(--bad-fg) 45%, transparent);
}

.barcode-x {
    background: none;
    border: none;
    cursor: pointer;
    color: #dc2626;
    padding: 0 0.1rem;
    line-height: 1;
    border-radius: 3px;
}

.barcode-x:hover {
    background: var(--bad-bg);
}

.btn-primary {
    background: var(--accent-fill);
    color: #fff;
    border-color: var(--accent-fill);
    box-shadow: 0 1px 2px rgba(49, 46, 129, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-primary:hover {
    background: var(--accent-fill-hover);
    border-color: var(--accent-fill-hover);
    color: #fff;
}

/* Why a disabled button is disabled, readable without hovering. */
/* The select-all box of a worklist names itself only where the column
   headers are hidden (phone cards). */
.select-all-text { display: none; }

.why {
    font-size: 0.75rem;
    line-height: 1.3;
    color: var(--muted);
    margin-left: 0.1rem;
    max-width: 22ch;
}

/* Clickable card in the inventory-check stock grid. Subtle hover:
   the border darkens and a faint shadow lifts the card. */
.stock-card {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    color: inherit;
    text-decoration: none;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.stock-card:hover {
    border-color: var(--border-strong);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.btn-dropdown::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: 0.55;
    margin-left: 0.1rem;
    vertical-align: middle;
    transition: transform 0.15s ease;
}

details[open] > .btn-dropdown::after {
    transform: rotate(180deg);
}

/* Menu item — row-style button for dropdown popups. Transparent, full
   width, left-aligned; highlights on hover. */
.menu-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.4rem 0.6rem;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--fg);
    font: inherit;
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast);
}

.menu-item:hover {
    background: var(--bg-hover);
}

.menu-item.is-active {
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-weight: 500;
}

.menu-item.is-active:hover {
    background: var(--accent-soft-2);
}

/* Anchor-based menu items (used for chip links) */
a.menu-item {
    text-decoration: none;
}

/* Tables — a rounded white surface on the canvas; separate borders so the
   corners can round without clipping row popovers. */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-card);
    border-radius: var(--r-card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
}

.td-truncate {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.td-truncate:hover {
    overflow: visible;
    white-space: normal;
    word-break: break-word;
}

thead {
    background: transparent;
}

th {
    text-align: left;
    padding: 0.6rem 0.8rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--line);
}
thead tr:first-child th:first-child { border-top-left-radius: calc(var(--r-card) - 1px); }
thead tr:first-child th:last-child  { border-top-right-radius: calc(var(--r-card) - 1px); }

td {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid var(--line-soft);
    font-size: 0.875rem;
    vertical-align: middle;
}

/* A link in a cell is the row's handle: ink, a touch heavier, accent on
   hover. Indigo stays for prose links, actions and selection, so it keeps
   meaning "this one". */
td a:not(.btn, .badge, .menu-item) { color: var(--fg); font-weight: 500; }
td a:not(.btn, .badge, .menu-item):hover { color: var(--link); }

/* Money columns the list renderer cannot tag: invoices' Total. */
#invoices-table th:nth-child(6),
#invoices-table td:nth-child(6) { text-align: right; white-space: nowrap; }
/* Orders: the customer's email gives way first when the row is tight. */
#orders-table td:nth-child(3) .cell-sub { max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The date may take two lines: the table only wraps it when the row is
   tight, so a wide screen keeps it on one. */
#orders-table td:nth-child(2) { white-space: normal !important; min-width: 6.5rem; }
/* A list table that needs more width than the panel has (a laptop
   screen) scrolls inside the panel instead of running past its edge.
   Only the filterable lists: their row menus are popovers, so nothing in
   a row is clipped by the scroll box. */
@media (min-width: 641px) {
    :is(#orders-table, #invoices-table, #transactions-table, #inventory-table, #products-table,
        #bons-table, #expenses-table, #pick-sell-table) > .table-scroll {
        overflow-x: auto;
        border-radius: var(--r-card);
    }
}
tbody:last-child tr:last-child > td { border-bottom: 0; }

tbody tr { transition: background var(--t-fast); }
tbody tr:hover {
    background: var(--bg-subtle);
}

/* When the URL has #<row-id>, the matching row is the `:target`.
   Flash a soft amber background that fades back to normal over a
   few seconds so the user can spot where they landed. */
tbody tr:target {
    animation: row-flash 2.4s ease-out;
}

@keyframes row-flash {
    0%, 20% { background: var(--warn-bg); box-shadow: inset 4px 0 0 #f59e0b; }
    100%    { background: transparent; box-shadow: inset 4px 0 0 transparent; }
}

/* ─────────── Rows you tick ───────────
   On a worklist the checkbox is a small target in a wide row, so the
   informational cells of such a row are a <label> for it (root.pickCellOpen):
   clicking the product, the size or the status ticks the row, with no script.
   The label takes over the cell's padding and stretches over the cell, so a
   tall neighbour (a wrapped note, a stacked badge) leaves no dead space
   beside it. Cells with a link, an input or a popover stay plain <td>. */
td.pick-cell {
    padding: 0;
}

/* A grid, not a block: the label fills the cell, and `align-content`
   keeps its contents vertically centred the way a table cell does. Cells
   stacking several lines (an item per line, a badge over a note) keep
   stacking, one grid row each. */
td.pick-cell > label {
    display: grid;
    align-content: center;
    justify-items: start;
    height: 100%;
    padding: 0.6rem 0.75rem;
}

/* The cell's text-align still applies inside each line, but which edge a
   shrink-wrapped badge sits against is the grid's call. */
td.pick-cell.ta-center > label,
td.pick-cell.shipping-check > label { justify-items: center; }
td.pick-cell.ta-right > label       { justify-items: end; }

/* Honest cursor: a row whose box is missing or disabled cannot be ticked. */
tbody tr:has(input[type="checkbox"]:enabled) td.pick-cell > label {
    cursor: pointer;
}

/* Self-scoping to rows that opt into the pattern, so a checked box
   elsewhere (POS sells from stock, a filter popover) tints nothing. */
table:not(.pick-prechecked) tbody tr:has(td.pick-cell):has(input[type="checkbox"]:checked) {
    background: var(--accent-soft);
}

/* A table whose boxes all start ticked (approving a supplier's pairs,
   checking a parcel in) reads the other way round: tinting every row says
   nothing, so the mark goes on the row the operator unticked — the pair
   that is dropped or did not arrive. */
table.pick-prechecked tbody tr:has(td.pick-cell):has(input[type="checkbox"]:not(:checked)) {
    background: var(--bad-bg);
}

/* td a — uses the global anchor style above; no override needed. */

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    padding: 0.0625rem 0.5rem;
    border-radius: var(--r-badge);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25rem;
    background: var(--bg-hover);
    color: var(--dim-deep);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 14%, transparent);
    vertical-align: middle;
}

/* Detail grid */
.detail-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.6rem 1.25rem;
    background: var(--bg-card);
    padding: 1.1rem 1.25rem;
    border-radius: var(--r-card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
}

.detail-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted);
    line-height: 1.4rem;
}

.detail-value {
    font-size: 0.875rem;
    line-height: 1.4rem;
    color: var(--fg);
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Transaction cards */
.txn-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
}

.txn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.txn-amount {
    font-size: 1.3rem;
    font-weight: 700;
}

.txn-badges {
    display: flex;
    gap: 0.5rem;
}

.txn-card .detail-grid {
    border: none;
    padding: 0;
    margin-bottom: 0.75rem;
}

.txn-legs-label {
    font-size: 0.8rem;
    color: var(--dim);
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.txn-card table {
    margin-bottom: 0;
}

/* Matching cards */
.txn-match-card {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.txn-match-card .txn-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line-soft);
}

.match-items table {
    font-size: 0.85rem;
}

.match-items th {
    font-size: 0.75rem;
}

.match-items .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #ccc;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Sits inside an Add button; htmx reveals it (.htmx-request .htmx-indicator)
   for the seconds the Shopify order-edit round-trip takes. */
.add-line-spinner {
    width: 0.7rem;
    height: 0.7rem;
    margin-left: 0.35rem;
    border-color: rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    background: transparent;
    box-shadow: none;
    transform: none;
}
/* A disabled primary loses its fill, so its label takes the ink colour. */
.btn-primary:disabled,
.btn-primary[aria-disabled="true"] {
    color: var(--fg);
    border-color: var(--control-border);
}

/* zigweb renders First/Prev/Next/Last even when everything fits on one
   page; with no page to go to there are no links. */
.pagination:not(:has(a)) {
    display: none !important;
}

/* Dismiss dropdown */
.dismiss-dropdown {
    position: relative;
    display: inline-block;
}

.dismiss-dropdown summary {
    cursor: pointer;
    list-style: none;
}

.dismiss-dropdown summary::-webkit-details-marker {
    display: none;
}

.dismiss-menu {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 100;
    margin-top: 0.25rem;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 150px;
    display: flex;
    flex-direction: column;
}

.dismiss-option {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    text-align: left;
    font: inherit;
    cursor: pointer;
    color: var(--text);
}

.dismiss-option:hover {
    background: var(--bg-hover);
}

.dismiss-option:first-child {
    border-radius: 6px 6px 0 0;
}

.dismiss-option:last-child {
    border-radius: 0 0 6px 6px;
}

/* Filter details */
.filter-details {
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.filter-details summary {
    cursor: pointer;
    list-style: none;
}

.filter-details summary::-webkit-details-marker {
    display: none;
}

.filter-details .filter-form,
.filter-details .dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 100;
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    background: var(--bg-card);
    box-shadow: var(--shadow-pop);
    /* Subtle entrance: fade + slight rise. <details> snaps open in
       browsers without `interpolate-size`, so we animate via the
       open-state selector below. */
    animation: filter-pop-in 140ms cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top left;
}

@keyframes filter-pop-in {
    from { opacity: 0; transform: translateY(-3px) scale(0.99); }
    to   { opacity: 1; transform: none; }
}

.filter-details .filter-form {
    padding: 0.85rem 0.9rem;
    min-width: 280px;
}

.filter-details .dropdown-menu {
    padding: 0.3rem;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-label-text {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--dim-strong);
    letter-spacing: 0.03em;
}

/* Filter dropdown button — used by src/app/table.zig's <summary> elements.
   Distinct from .btn so dropdowns are visually recognizable as dropdowns:
   white background, slightly thicker border, CSS-drawn caret that rotates
   when the <details> is [open]. */
.filter-dropdown {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--r-input);
    background: var(--bg-card);
    color: var(--fg);
    font-size: 0.85rem;
    font-family: inherit;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: background var(--t-fast), border-color var(--t-fast);
}

.filter-dropdown:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.filter-dropdown::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    margin-left: 0.25rem;
    opacity: 0.6;
    transition: transform var(--t-fast), opacity var(--t-fast);
}

.filter-details[open] > .filter-dropdown::after {
    transform: rotate(180deg);
    opacity: 1;
}

.filter-dropdown.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.filter-form input[type="date"],
.filter-form input[type="search"],
.filter-form input[type="text"] {
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--r-input);
    font: inherit;
    font-size: 0.9rem;
    background: var(--bg-card);
    color: var(--fg);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.filter-form input[type="search"] {
    flex: 1;
    min-width: 0;
}

.filter-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

/* Multi-choice <select multiple> listbox in the popover, styled to match
   the .filter-form text inputs. (Single-choice renders as a bare bar
   select — see .choice-pill below.) */
.filter-select {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--r-input);
    font: inherit;
    font-size: 0.9rem;
    background: var(--bg-card);
    color: var(--fg);
    cursor: pointer;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.filter-select:hover {
    border-color: var(--border-strong);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

/* Multi-choice listbox: borderless so it sits flush in its popover card
   (rather than a bordered box-in-a-box), like the old .dropdown-menu. */
.filter-details .filter-form.filter-form-choice {
    padding: 0.3rem;
    min-width: 180px;
}

.filter-select-multi {
    border: 0;
    padding: 0;
    background: transparent;
    cursor: default;
}

.filter-select-multi option {
    margin: 3px 0;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
}

.filter-select-multi option:checked {
    /* Native multi-selects force white text on the selected row and ignore
       author `color`, so the fill must be dark enough to read white on.
       The matched-color gradient forces the fill (some engines drop plain
       background-color on <option>). */
    background: var(--accent) linear-gradient(var(--accent), var(--accent));
    color: #fff;
    font-weight: 500;
}

/* Touch devices collapse a <select multiple> to one row and open their own
   picker for it, so there the popover is only an extra tap. The pill carries
   a second, invisible select laid over it: tapping the pill opens the native
   picker directly. opacity rather than visibility — a hidden select takes no
   taps. The ✕ stays above it. */
.pill-native-multi {
    display: none;
}

@media (pointer: coarse) {
    .filter-pill:has(> .pill-native-multi) {
        position: relative;
    }
    .pill-native-multi {
        display: block;
        position: absolute;
        inset: 0;
        margin: 0;
    }
    .pill-native-select {
        width: 100%;
        height: 100%;
        opacity: 0;
        font-size: 16px; /* below this iOS zooms the page on focus */
    }
    .filter-pill:has(> .pill-native-multi) .pill-clear {
        position: relative;
        z-index: 1;
    }
}

.filter-apply {
    align-self: flex-start;
    margin-top: 0.15rem;
}

/* Single-choice filter: a bare native <select> sitting directly in the bar
   (the <form> is the pill). The select is borderless so the pill's own
   border/background show through, mirroring .search-pill. It is drawn to
   match the popover pills beside it exactly: same padding, same solid
   caret, as wide as its value. */
.filter-pill.choice-pill {
    position: relative;
    align-items: center;
    padding-left: 0.55rem;
    gap: 0.15rem;
    --pill-caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 4'%3E%3Cpath d='M0 0h8L4 4z' fill='%2374777f'/%3E%3C/svg%3E");
}

/* Selected single-choice shows a "Label:" prefix overlaid on the select's
   left padding. It's absolute so it never pushes the <select> (and its
   native dropdown) to the right; the select carries a matching padding-left
   that seats the value just past it. */
.filter-pill.choice-pill.is-selected .pill-label {
    position: absolute;
    /* line up with the <select>'s text (its own 0.15rem padding past the
       0.7rem pill padding) so the label doesn't shift when a value is set */
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    /* Match the <select>'s own text so the label reads identically to the
       placeholder shown in the unselected state. */
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.4;
    color: var(--fg);
    pointer-events: none;
}

.filter-pill.choice-pill .pill-label::after {
    content: ":";
}

.filter-pill.choice-pill .choice-pill-select {
    border: 0;
    appearance: none;
    background: transparent var(--pill-caret) no-repeat right 0.7rem center / 8px 4px;
    padding: 0.3rem calc(0.7rem + 8px + 0.5rem) 0.3rem 0.15rem;
    field-sizing: content;
    font-family: inherit;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--fg);
    outline: none;
    cursor: pointer;
    max-width: 18ch;
}

.filter-pill.choice-pill.is-selected .choice-pill-select {
    color: var(--accent-strong);
    max-width: none;
}
/* Selected pills end in their ✕, like the popover pills: tighter caret gap. */
.filter-pill.choice-pill.is-selected:has(.pill-clear) .choice-pill-select {
    padding-right: calc(0.35rem + 8px + 0.4rem);
    background-position: right 0.35rem center;
}

/* Polaris-style filter bar — each filter is a pill that combines the
   popover trigger and (when selected) a clear ✕. Pinned/applied pills
   are visible by default; non-pinned hidden filters appear behind a
   single "+ Add filter" pill at the end. */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.filter-pill {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--control-border);
    border-radius: var(--r-pill);
    background: var(--bg-card);
    box-shadow: var(--shadow-xs);
    transition: border-color var(--t-fast), border-style var(--t-fast),
                background var(--t-fast), box-shadow var(--t-fast);
    /* No overflow:hidden — would clip the popover; rounded corners
       come from the pill's own border-radius and the children's
       own padding/positioning. */
}

.filter-pill:hover {
    border-color: var(--border-strong);
    background: var(--bg-hover);
}

/* Open pill gets a subtle shadow and an accent border so it's
   visually anchored while the popover is showing. */
.filter-pill:has(> .filter-details[open]) {
    border-color: var(--accent);
    border-style: solid;
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

.filter-pill.is-selected {
    border-style: solid;
    border-color: var(--accent);
    background: var(--accent-soft);
}

.filter-pill.is-selected:hover {
    background: var(--accent-soft-2);
}

/* Position the popover (.dropdown-menu / .filter-form) relative to
   the pill body. */
.filter-pill > .filter-details {
    position: relative;
    margin: 0;
    display: inline-flex;
}

.filter-pill > .filter-details > summary.pill-body {
    cursor: pointer;
    list-style: none;
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--fg);
    user-select: none;
    background: transparent;
    border: 0;
    font-family: inherit;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.filter-pill > .filter-details > summary.pill-body::-webkit-details-marker {
    display: none;
}

/* Label vs value typography hierarchy. The "Status" portion is
   muted; the value (after `:`) inherits the pill body color. */
.filter-pill .pill-label {
    color: var(--muted);
    font-weight: 500;
}

.filter-pill.is-selected .pill-label {
    color: var(--accent-strong);
}

/* Chevron — always visible so "click to re-edit" is discoverable
   on both unselected (initial pick) and selected (change selection)
   states. */
.filter-pill > .filter-details > summary.pill-body::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    margin-left: 0.15rem;
    opacity: 0.6;
    transition: transform var(--t-fast), opacity var(--t-fast);
}

.filter-pill > .filter-details[open] > summary.pill-body::after {
    transform: rotate(180deg);
    opacity: 1;
}

.filter-pill .pill-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    margin: 0.15rem 0.3rem 0.15rem 0;
    border-radius: 50%;
    color: var(--muted-fg);
    text-decoration: none;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast);
}

.filter-pill .pill-clear:hover {
    background: var(--accent);
    color: #fff;
}

/* "+ Add filter" pill: keeps dashed border on hover to read as
   additive rather than active. */
.filter-pill.add-filter {
    border-style: dashed;
    border-color: var(--border-strong);
    /* Filled like its neighbours: on a patterned page a see-through pill
       lets the tiles cut through its label. */
    background: var(--bg-card);
    box-shadow: none;
}

.filter-pill.add-filter:hover {
    border-style: dashed;
    border-color: var(--accent);
    background: var(--accent-soft);
}

.filter-pill.add-filter > .filter-details > summary.pill-body {
    color: var(--muted-fg);
}

.filter-pill.add-filter:hover > .filter-details > summary.pill-body {
    color: var(--accent-fg);
}

.filter-pill.export-pill {
    margin-left: auto;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    padding: 0;
    align-items: center;
    justify-content: center;
    color: var(--muted-fg);
    text-decoration: none;
}
.filter-pill.export-pill:hover {
    border-color: var(--accent);
    background: var(--accent-soft, var(--bg));
    color: var(--accent-fg);
}

.filter-pill.add-filter > .filter-details > summary.pill-body::after {
    display: none;
}

/* Search pill: an inline <input> instead of a <details>/popover. The
   raw <input> would render with its own border, looking square inside
   the rounded pill. Strip browser chrome and let the wrapping .filter-pill
   provide the visual frame so it matches the choice/tribool pills. */
.filter-pill.search-pill {
    padding: 0;
}
.filter-pill.search-pill input[type="search"] {
    border: 0;
    background: transparent;
    padding: 0.3rem 0.7rem;
    /* Match `summary.pill-body` typography exactly (see above). */
    font-family: inherit;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--fg);
    outline: none;
    height: auto;
    min-height: 0;
    width: 30ch;
    box-sizing: border-box;
}
.filter-pill.search-pill input[type="search"]::placeholder {
    color: var(--muted-fg, #888);
}
/* Strip the WebKit-only search clear button so the pill stays clean;
   the user can re-empty the input with backspace. */
.filter-pill.search-pill input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

/* Inventory popups */
.popup-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--fg);
    cursor: pointer;
    text-align: left;
    text-decoration: underline dotted;
    text-decoration-color: var(--border-strong);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color var(--t-fast),
                text-decoration-color var(--t-fast);
}

.popup-btn:hover {
    color: var(--link-hover);
    text-decoration-color: var(--link-hover);
}

.inv-popup::backdrop {
    backdrop-filter: blur(3px);
}

.inv-popup {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    min-width: 260px;
    max-width: 360px;
    margin: auto;
    /* Never taller than the screen, and scroll inside the popup instead
       of chaining to the page when its content hits a scroll boundary. */
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.inv-popup * {
    overscroll-behavior: contain;
}

/* Variant-search popups (POS search, order add-line). */
.inv-popup.inv-popup-wide {
    min-width: 480px;
    max-width: 640px;
}

/* Freeze the page behind an open popup: on iOS a drag that starts on a
   non-scrollable part of the popup (title, input) — or on a results list
   already at its scroll boundary — otherwise scrolls the background. */
@media (pointer: coarse) {
    html:has(.inv-popup:popover-open),
    html:has(.inv-popup:popover-open) body {
        overflow: hidden;
    }
}

.inv-popup-title {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dim);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--line-soft);
}

.inv-popup-row {
    display: flex;
    gap: 0.75rem;
    padding: 0.3rem 0;
    font-size: 0.9rem;
    align-items: baseline;
}

.order-items-trigger {
    min-width: 1.75rem;
    padding: 0.05rem 0.4rem;
    border-radius: var(--r-badge);
    text-align: center;
    text-decoration: none;
    font-weight: 500;
    transition: background var(--t-fast), color var(--t-fast);
}
.order-items-trigger:hover,
.order-items-trigger:focus-visible { background: var(--bg-hover); text-decoration: none; }

.order-items-popup {
    position: fixed;
    inset: auto;
    margin: 0;
    width: max-content;
    min-width: 260px;
    max-width: min(420px, calc(100vw - 16px));
    max-height: min(70vh, 520px);
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    color: var(--fg);
    box-shadow: 0 6px 24px rgba(0,0,0,0.16);
}

.order-items-popup::backdrop {
    background: transparent;
}

.order-items-popup-title {
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.order-items-popup-row {
    display: flex;
    gap: 0.65rem;
    padding: 0.4rem 0;
}

.order-items-popup-row + .order-items-popup-row {
    border-top: 1px solid var(--line-soft);
}

.order-items-quantity {
    flex: 0 0 auto;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.order-items-description {
    min-width: 0;
}

.order-items-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.order-items-meta,
.order-items-empty,
.order-items-loading {
    color: var(--muted);
    font-size: 0.8rem;
}

.inv-popup-row-linked {
    background: var(--info-bg-soft);
    border-radius: 4px;
    font-weight: 600;
}

.inv-popup-goat-header {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--dim-deep);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--line-soft);
}

.inv-popup-label {
    min-width: 70px;
    font-size: 0.78rem;
    color: var(--dim);
    text-transform: uppercase;
    flex-shrink: 0;
}

.badge-c {
    background: var(--info-bg);
    color: var(--info-fg);
    margin-left: 0.4rem;
}

.badge-success {
    background: var(--ok-bg);
    color: var(--ok-fg);
}

/* Wrapper inserted around every <table>. No-op on desktop; the mobile
   breakpoint flips it into a horizontal scroll strip. */
.table-scroll {
    /* desktop: no styling needed */
}

/* Desktop: hide the hamburger checkbox + label; nav-links inherit the
   horizontal flex layout defined earlier. */
nav .nav-toggle-cb,
nav .nav-toggle {
    display: none;
}

/* ─────────── Mobile (≤ 640px) ─────────── */
@media (max-width: 640px) {
    .board > .panel { margin-bottom: 0.75rem; }
    .panel { min-height: 0; }

    main {
        padding: 0 0.9rem;
        margin-top: 1.1rem;
    }

    /* Drop the sidebar layout: stack a top bar over block-flow content. */
    body {
        display: block;
    }

    /* Nav: top bar again, links collapse behind a hamburger label
       (checkbox-driven). */
    nav {
        width: auto;
        height: auto;
        position: sticky;
        top: 0;
        z-index: 50;
        overflow: visible;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
        padding: 0.6rem 0.9rem;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        background: color-mix(in srgb, var(--nav-bg) 88%, transparent);
        -webkit-backdrop-filter: saturate(1.4) blur(12px);
        backdrop-filter: saturate(1.4) blur(12px);
    }
    nav:has(.nav-toggle-cb:checked) { max-height: 100vh; overflow-y: auto; background: var(--nav-bg); }
    nav .nav-brand {
        padding: 0;
    }
    nav .nav-links {
        flex: none;
    }
    nav .nav-links form {
        padding: 0.75rem 0.25rem 0.25rem;
    }
    nav .nav-search {
        order: 1;
        margin: 0 0 0 auto;
        height: 2.5rem;
        padding: 0 0.7rem;
    }
    nav .nav-search .nav-search-label,
    nav .nav-search .kbd { display: none; }
    nav .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
        color: var(--nav-fg);
        background: var(--bg-card);
        border: 1px solid var(--control-border);
        border-radius: var(--r-input);
        box-shadow: var(--shadow-xs);
        cursor: pointer;
        order: 2;
    }
    nav .nav-links {
        display: none;
        order: 3;
        width: 100%;
    }
    nav .nav-toggle-cb:checked ~ .nav-links {
        display: flex;
        flex-direction: column;
        gap: 0;
        margin-top: 0.5rem;
        border-top: 1px solid var(--line);
    }
    nav .nav-toggle-cb:checked ~ .nav-links a {
        padding: 0.6rem 0.5rem;
    }

    /* Tables: horizontal scroll, intrinsic-width content. */
    .table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-scroll > table {
        min-width: max-content;
    }
    .td-truncate {
        max-width: none;
    }

    /* Filter / action popups: edge-to-edge strips under their trigger so
       they never clip. Fixed, because the row-level ones live inside
       .table-scroll, which would clip an absolute box. A fixed box with no
       vertical anchor stays put while the page scrolls under it, so the
       script in renderHead closes it on scroll. */
    .filter-details .filter-form,
    .filter-details .dropdown-menu {
        position: fixed;
        left: 0.5rem;
        right: 0.5rem;
        top: auto;
        min-width: 0;
        max-width: none;
        max-height: 60dvh;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    /* Filter-bar pills sit outside any scroll container, so they anchor to
       the bar instead and simply scroll with the page. */
    .filter-bar {
        position: relative;
    }
    /* display:block — the popup's static position in a flex container is
       the container's top, over the pill; in a block it is below the summary. */
    .filter-bar .filter-details {
        position: static;
        display: block;
    }
    .filter-bar .filter-details .filter-form,
    .filter-bar .filter-details .dropdown-menu {
        position: absolute;
        left: 0;
        right: 0;
        margin-top: 6px;
        max-height: none;
    }

    /* Popups never wider than the screen; the search ones fill it. */
    .inv-popup {
        min-width: 0;
        max-width: calc(100vw - 1rem);
        box-sizing: border-box;
    }
    .inv-popup.inv-popup-wide {
        min-width: 0;
        width: calc(100vw - 1rem);
        max-width: calc(100vw - 1rem);
    }

    /* Mark Sold Externally inline form: stack input + button. */
    .filter-details .filter-form[hx-post*="mark-sold"] {
        flex-direction: column !important;
    }

    /* Detail-page action button rows wrap instead of overflowing. */
    .btn-group {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* Buy-invoice PDF drag & drop (transaction detail page). */
.dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
    color: var(--dim);
    cursor: pointer;
    margin-top: 0.75rem;
}
.dropzone.dragover {
    border-color: #2563eb;
    background: var(--info-bg-soft);
    color: #2563eb;
}
.buy-invoice-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}
.buy-invoice-list li {
    padding: 0.25rem 0;
}
.shipping-section {
  margin: 0 0 2.25rem;
}

/* Title over its one-line instruction, always stacked, so every worklist
   starts the same way; the section owns the spacing between lists. */
.shipping-section-heading {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.75rem;
}

.shipping-section-heading h2 {
  margin: 0;
}

.shipping-section-heading p {
  margin: 0;
  max-width: 90ch;
  font-size: 0.875rem;
  color: var(--muted);
}

.shipping-check {
  width: 2rem;
  text-align: center;
}

.pos-product-preview {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted #999;
}

.pos-product-thumbnail {
  display: none;
  position: fixed;
  z-index: 30;
  width: 160px;
  height: 160px;
  padding: 0.25rem;
  object-fit: contain;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 18%);
}

.pos-product-preview:hover .pos-product-thumbnail {
  display: block;
}

@media print {
  body[class*="page-"] * { box-shadow: none !important; }
  body.page-shipping nav,
  body.page-shipping .shipping-no-print,
  body.page-shipping h1 {
    display: none !important;
  }

  body.page-shipping main {
    margin: 0 !important;
    padding: 0 !important;
  }

  body.page-shipping .shipping-preparation {
    display: block !important;
  }

  body.page-shipping .table-scroll {
    overflow: visible;
  }

  body.page-shipping table {
    font-size: 10pt;
  }

  body.page-shipping tr {
    break-inside: avoid;
  }

  body.page-shipping input[type="checkbox"] {
    appearance: none;
    width: 12px;
    height: 12px;
    border: 1px solid #000;
  }
}

/* ─────────── Return flow ───────────
   Shared building blocks for /orders/N/returns/new, the return detail
   page, and the imported-request reconciliation. White cards on the
   soft page background, one card per concern, actions grouped in a
   single row at the card's foot. */
.ret-page {
    max-width: 1040px;
}

/* Inline flow on purpose: tests and copy-paste read this line as plain
   text ("Status: needs_attention"), which flex layout would split. */
.ret-meta {
    margin: -0.5rem 0 1.25rem;
    color: var(--muted-fg);
    font-size: 0.9rem;
    line-height: 1.9;
}

.ret-meta .badge {
    margin-right: 0.25rem;
}

.ret-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    padding: 1rem 1.25rem 1.25rem;
    margin-bottom: 1.25rem;
}

.ret-card > h2 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.ret-hint {
    margin: 0 0 0.85rem;
    color: var(--muted);
    font-size: 0.85rem;
}

/* Card tables sit flush inside the card frame; the global table border
   would double up. */
.ret-card .table-scroll {
    overflow-x: auto;
}

.ret-card table {
    border: 1px solid var(--line);
}

.ret-totals {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.35rem 1.5rem;
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
}

.ret-totals strong {
    font-variant-numeric: tabular-nums;
}

.ret-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem 1.5rem;
    margin-top: 0.5rem;
}

.ret-field {
    display: block;
    font-size: 0.8rem;
    color: var(--muted-fg);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ret-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    align-self: end;
    padding-bottom: 0.45rem;
}

.ret-check input[type="checkbox"] {
    margin: 0;
}

/* Bank details matter only for a bank-transfer payout. */
#return-new:not(:has(input[name="payout"][value="bank_transfer"]:checked)) .ret-bank-field {
  display: none;
}

/* Nothing is refunded when the replacements cover the returned value: the
   form's script sets `ret-no-payout` and the payout choice goes with it. */
#return-new.ret-no-payout .ret-payout,
#return-new.ret-no-payout .ret-bank-field {
  display: none;
}

.ret-field input[type="text"],
.ret-field input[type="number"],
.ret-field select,
.ret-field textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.35rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: var(--r-input);
    font: inherit;
    font-size: 0.9rem;
    text-transform: none;
    letter-spacing: normal;
    color: var(--fg);
    background: var(--bg-card);
}

.ret-field input:focus,
.ret-field select:focus,
.ret-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

.ret-field textarea {
    min-height: 3.4rem;
    resize: vertical;
}

.ret-radio {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    margin: 0.45rem 0 0;
    font-size: 0.9rem;
    color: var(--fg);
    text-transform: none;
    letter-spacing: normal;
}

.ret-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.ret-actions form {
    margin: 0;
    display: inline-flex;
}

.ret-awb-summary {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.35rem 1rem;
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
}

.ret-delivery {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
}

.ret-delivery:first-of-type {
  border-top: 0;
}

.ret-status-history {
  margin: .75rem 0;
}

.ret-delivery-earlier {
  border-top: 1px solid var(--border);
  padding: .5rem 0;
  color: var(--muted);
}

.ret-delivery-earlier[open] {
  color: inherit;
}

.ret-status-history ul {
  margin: .5rem 0;
}

.ret-awb-summary dt {
    color: var(--muted);
    font-weight: 600;
}

.ret-awb-summary dd {
    margin: 0;
}

.ret-alert {
    padding: 0.6rem 0.8rem;
    background: var(--warn-bg);
    border: 1px solid #fcd34d;
    color: var(--warn-fg);
    border-radius: 6px;
    margin: 0 0 1rem;
}

.ret-info {
    padding: 0.6rem 0.8rem;
    background: var(--accent-soft);
    border: 1px solid #c7d2fe;
    color: var(--accent-strong);
    border-radius: 6px;
    margin: 0 0 1rem;
}

/* Amber action panel: money changes hands here. */
.ret-panel {
    background: var(--warn-bg-soft);
    border: 1px solid #f59e0b;
    border-radius: var(--r-card);
    padding: 0.9rem 1.1rem 1.1rem;
    margin-bottom: 1.25rem;
}

.ret-panel > strong {
    display: block;
    margin-bottom: 0.25rem;
}

.ret-panel .ret-actions {
    margin-top: 0.75rem;
}

/* State badges on the detail header and order history. */
.badge.ret-state-draft { background: #e5e7eb; color: #374151; }
.badge.ret-state-error { background: var(--bad-bg); color: var(--bad-fg); }
.badge.ret-state-attention { background: var(--warn-bg); color: var(--warn-fg); }
.badge.ret-state-waiting { background: var(--info-bg); color: var(--info-fg); }
.badge.ret-state-progress { background: var(--accent-soft); color: var(--accent-strong); }
.badge.ret-state-completed { background: var(--ok-bg); color: var(--ok-fg); }
.badge.ret-state-cancelled { background: #f3f4f6; color: #6b7280; }

/* Title row: the dossier button sits opposite the heading. */
.ret-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}

.ret-head .ret-actions {
    margin-top: 0;
}

/* The return's stamps in order, oldest first. */
.ret-timeline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0;
    margin: -0.5rem 0 1.25rem;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
    color: var(--muted);
}

.ret-timeline li {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.ret-timeline li + li::before {
    content: "\2192";
    margin: 0 0.6rem;
    color: var(--dim);
}

.ret-timeline-label {
    color: var(--fg);
    font-weight: 600;
}

.ret-timeline time {
    font-variant-numeric: tabular-nums;
}

/* Returned and replacement rows share one table; a group row names each. */
.ret-items tr.ret-group th {
    text-align: left;
    padding-top: 0.6rem;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--bg-hover);
}

/* The receive action inside the shipment card. */
.ret-receive {
    border-top: 1px solid var(--line);
    margin-top: 1rem;
    padding-top: 0.75rem;
}

.ret-receive .ret-hint {
    margin-bottom: 0.5rem;
}

.ret-receive form {
    margin: 0;
}

/* ─────────── Utilities ───────────
   Use these from the Zig templates instead of `.style = "…"`, above all for
   colour: they resolve through the tokens, so they follow dark mode, which
   an inline hex cannot. `ink-*` sets the text colour, `fill-*` the
   background; pair them for a status badge ("badge fill-bad ink-bad").
   !important because they stand in for inline styles, which always won. */
.ink-fg          { color: var(--fg) !important; }
.ink-muted       { color: var(--muted) !important; }
.ink-dim         { color: var(--dim) !important; }
.ink-mid         { color: var(--dim-strong) !important; }
.ink-deep        { color: var(--dim-deep) !important; }
.ink-bad         { color: var(--bad-fg) !important; }
.ink-bad-bright  { color: var(--bad-fg-bright) !important; }
.ink-warn        { color: var(--warn-fg) !important; }
.ink-warn-bright { color: var(--warn-fg-bright) !important; }
.ink-orange      { color: var(--orange-fg) !important; }
.ink-ok          { color: var(--ok-fg) !important; }
.ink-ok-bright   { color: var(--ok-fg-bright) !important; }
.ink-teal        { color: var(--teal-fg) !important; }
.ink-info        { color: var(--info-fg) !important; }
.ink-accent      { color: var(--accent-strong) !important; }
.ink-purple      { color: var(--purple-fg) !important; }

.fill-card        { background-color: var(--bg-card) !important; }
.fill-gray        { background-color: var(--bg-hover) !important; }
.fill-gray-strong { background-color: var(--gray-bg-strong) !important; }
.fill-bad         { background-color: var(--bad-bg) !important; }
.fill-warn        { background-color: var(--warn-bg) !important; }
.fill-warn-soft   { background-color: var(--warn-bg-soft) !important; }
.fill-warn-strong { background-color: var(--warn-bg-strong) !important; }
.fill-orange      { background-color: var(--orange-bg) !important; }
.fill-orange-soft { background-color: var(--orange-bg-soft) !important; }
.fill-ok          { background-color: var(--ok-bg) !important; }
.fill-teal        { background-color: var(--teal-bg) !important; }
.fill-info        { background-color: var(--info-bg) !important; }
.fill-info-soft   { background-color: var(--info-bg-soft) !important; }
.fill-info-strong { background-color: var(--info-bg-strong) !important; }
.fill-accent      { background-color: var(--accent-soft-2) !important; }
.fill-purple      { background-color: var(--purple-bg) !important; }

.ta-right  { text-align: right !important; }
.ta-center { text-align: center !important; }
.d-inline  { display: inline !important; }
.d-block   { display: block !important; }
.w-full    { width: 100% !important; }
.nowrap    { white-space: nowrap !important; }
/* Codes (SKUs, barcodes, AWBs): Inter's tabular figures and slashed zero
   keep them aligned and unambiguous without a wide fallback monospace. */
.mono      { font-variant-numeric: slashed-zero !important; }

/* Muted explanatory paragraph under a heading or control. */
.hint {
    color: var(--muted);
    max-width: 70ch;
    margin: 0.25rem 0;
}

/* Boxed page-level message. */
.alert {
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.alert-bad  { background: var(--bad-bg); border-color: #f5a3a3; }
.alert-info { background: var(--info-bg-soft); border-color: #9ab8e0; }

/* A refused htmx request's plain-text reason (layout script in root.zig),
   floated over the page it was refused on instead of replacing it. */
.request-error {
    position: fixed;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: max-content;
    max-width: min(640px, calc(100vw - 1rem));
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0;
    white-space: pre-line;
    box-shadow: var(--shadow-pop);
}
.request-error button {
    flex: none;
    border: 0;
    background: none;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
}

/* ─────────── Page header ───────────
   Title, what state the record is in, and what can be done to it, on one
   band above the details. */
/* One band height for every page title, with or without actions, so the
   filter row below starts at the same place on every tab. */
.page-head,
main > h1:first-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    min-height: 2.25rem;
    margin-bottom: 0.875rem;
}
.page-actions .scan-input {
    width: 16rem;
    padding: 0.36rem 0.7rem 0.36rem 2rem !important;
    background-position: 0.6rem center !important;
    background-size: 14px 14px !important;
    font-size: 0.875rem !important;
}
.page-head h1 { margin: 0; }
.page-head .page-sub { font-size: 0.85rem; }
.page-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.page-badges .badge { font-size: 0.8rem; }
.page-badges a.badge { text-decoration: none; }
.page-badges a.badge:hover { filter: brightness(0.96); }
.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}
.page-actions form { display: inline; }
.page-head + .filter-bar, .page-head + div > .filter-bar { margin-top: 0; }

/* The one-paragraph intro under a page title: its own block, clear of the
   filters and sections below it. */
main > h1:first-child + .hint,
main > h1:first-child + div > .hint:first-child,
.page-head + .hint {
    margin: -0.35rem 0 1.5rem;
    max-width: 72ch;
}
/* The Returns page's cancellation-request line when there are none: a
   quiet note, not a lede for the list under it. */
.edit-requests > .hint:only-child { font-size: 0.8125rem; margin: -0.25rem 0 1rem; }

/* A list with nothing in it: no column headers over the void, just a
   quiet dashed well (the same as the POS cart's). */
table:has(> tbody > tr:only-child > td[colspan]:only-child) {
    background: var(--bg-card);
}
table:not(:has(thead .select-all)):has(> tbody > tr:only-child > td[colspan]:only-child) > thead { display: none; }
table:has(> tbody > tr:only-child > td[colspan]:only-child) td { border: 0; padding: 1.6rem 1rem !important; text-align: center; color: var(--muted) !important; }
table:has(> tbody > tr:only-child > td[colspan]:only-child) tbody tr:hover { background: transparent; }

.payment-summary { font-size: 0.9375rem; font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }

/* ─────────── Order status (top of an order) ───────────
   The current status in words, then the milestones reached, oldest first.
   Each step says its state in text and a mark, never by colour alone. */
.order-status {
    display: flex;
    flex-wrap: wrap;
    /* The status pill and the steps read as one line of text. */
    align-items: baseline;
    gap: 0.6rem 1.5rem;
    padding: 0.8rem 1.25rem;
    margin-bottom: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
}
.order-status-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; }
.order-status-caption { font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.order-status-value {
    font-size: 1.05rem;
    font-weight: 650;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
}
.order-status-detail { font-size: 0.8rem; color: var(--muted); }
.order-timeline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
}
.order-step { display: inline-flex; align-items: baseline; gap: 0.35rem; }
.order-step + .order-step::before { content: "\2192"; margin: 0 0.6rem; color: var(--dim); }
.order-step-mark { font-size: 0.8rem; }
.order-step.is-done .order-step-mark { color: var(--ok-fg); }
.order-step.is-partial .order-step-mark { color: var(--warn-fg); }
.order-step.is-pending { color: var(--muted); }
.order-step-label { font-weight: 600; color: var(--fg); }
.order-step.is-pending .order-step-label { font-weight: 500; color: var(--muted); }
/* `.hint` ("Not yet", "Date unavailable") carries a block margin that would
   drop its step below the others. */
.order-step-date { font-variant-numeric: tabular-nums; color: var(--muted); margin: 0; }
.order-step-note { font-size: 0.75rem; font-style: italic; }
@media (max-width: 640px) {
    .order-status { padding: 0.75rem 0.9rem; }
    .order-timeline { flex-direction: column; }
    .order-step + .order-step::before { content: none; }
}

/* ─────────── Facts strip (record header) ───────────
   Short facts about one record as columns, label over value, so a handful
   of fields reads at a glance instead of as a tall two-column list. */
.facts {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.6rem;
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
}
.fact { min-width: 0; max-width: 100%; }
.fact-lead { margin-right: 0.25rem; }
.fact-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 0.15rem;
}
.fact-value {
    font-size: 0.875rem;
    color: var(--fg);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.fact-lead .fact-value { font-size: 1.125rem; font-weight: 650; letter-spacing: -0.01em; }
@media (max-width: 640px) { .fact-value { white-space: normal; overflow-wrap: anywhere; } }
.fact-note { display: block; font-size: 0.75rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }

/* A record page is one column of sections, separated by space alone: the
   same rhythm as the list pages' sections. */
main:has(> .page-head) > h2,
#order-payments > h2:first-child {
    margin-top: 2.25rem;
}
/* The order page's sections below its line items are cards: heading and
   body on one surface, like the dashboard's panels. */
.record-section,
#order-payments {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem 1.1rem;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
}
.record-section > h2:first-child,
#order-payments > h2:first-child { margin: 0 0 0.6rem !important; font-size: 0.9375rem; }
.record-section table { box-shadow: none; }
main:has(> .page-head) > h2 + .table-scroll + .btn { margin-top: 0.75rem; }



/* The order page's lower sections pair up on a wide screen; a section
   with nothing in it folds into its heading row. */
.record-grid > .record-section,
.record-grid > #order-payments { margin-top: 0; }
/* A section that holds a real table takes the whole row; a narrow table
   scrolls inside its card rather than spilling out of it. */
.record-grid > :has(table tbody td:not([colspan])) { grid-column: 1 / -1; }
.record-section .table-scroll { overflow-x: auto; }
.record-grid {
    display: grid;
    gap: 1.25rem;
    margin-top: 1.25rem;
}
@media (min-width: 1200px) {
    .record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
}
.record-section:has(> h2:first-child + .section-empty:last-child),
.record-section:has(> h2:first-child + .table-scroll:last-child table.section-table > tbody > tr:only-child > td[colspan]:only-child) {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.record-section:has(> h2:first-child + .section-empty:last-child) > h2,
.record-section:has(> h2:first-child + .table-scroll:last-child table.section-table > tbody > tr:only-child > td[colspan]:only-child) > h2 { margin: 0 !important; }
.record-section > h2 + .section-empty:last-child { margin: 0 0 0 auto; }
.record-section > h2 + .table-scroll:last-child:has(table.section-table > tbody > tr:only-child > td[colspan]:only-child) { margin-left: auto; }
.record-lines { margin-top: 1.5rem; }
.record-lines > .table-scroll > table { box-shadow: none; }
.record-lines > .btn { margin-top: 0.75rem; }

/* A section with nothing in it says so quietly, right under its heading;
   an empty section table (Fulfillments) does the same, no well. */
table.section-table:has(> tbody > tr:only-child > td[colspan]:only-child) {
    border: 0;
    background: none;
}
table.section-table:has(> tbody > tr:only-child > td[colspan]:only-child) td {
    padding: 0 !important;
    margin-top: -0.2rem;
    text-align: left;
    font-size: 0.8125rem;
}
.hint.section-empty {
    font-size: 0.8125rem;
    margin: -0.2rem 0 0.25rem;
}

/* Inventory unit ids beside an order: neutral, monospaced references. */
.badge.unit-chip {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--dim-deep);
    background: var(--bg-hover);
    text-decoration: none;
}
.badge.unit-chip:hover { color: var(--fg); background: var(--gray-bg-strong); text-decoration: none; }

/* Scan boxes (POS, Products): the field the page is for. */
.scan-input {
    width: 26rem;
    max-width: 100%;
    padding: 0.55rem 0.8rem !important;
    font-size: 1rem !important;
}
.btn-lg { padding: 0.55rem 0.95rem; font-size: 0.875rem; }
/* A barcode glyph says this box is for the scanner, not another search. */
.scan-input {
    padding-left: 2.2rem !important;
    background: var(--bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b91a0' stroke-width='1.75' stroke-linecap='round'%3E%3Cpath d='M3 7V5a2 2 0 0 1 2-2h2M17 3h2a2 2 0 0 1 2 2v2M21 17v2a2 2 0 0 1-2 2h-2M7 21H5a2 2 0 0 1-2-2v-2M8 8v8M12 8v8M16 8v8'/%3E%3C/svg%3E") no-repeat 0.7rem center / 16px 16px;
}

/* One-line device / connection status with a coloured dot. */
.status-line {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.3rem 0.75rem 0.3rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--bg-card);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted-fg);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.status-line.is-ok .status-dot { background: var(--ok-fg-bright); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok-fg-bright) 20%, transparent); }
.status-line.is-warn .status-dot { background: var(--warn-fg-bright); }
.status-line.is-bad .status-dot { background: var(--bad-fg-bright); }
.status-line.is-bad { color: var(--bad-fg); }

/* An empty list or cart: a quiet dashed well instead of a loose sentence. */
.empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    background: var(--bg-card);
    box-shadow: var(--shadow-card);
}

/* Amounts: right-aligned, digits lined up. */
.num {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.amount-in { color: var(--ok-fg); }

.cell-sub {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
}

.empty-row td,
td[colspan].ta-center.ink-mid { color: var(--muted) !important; text-align: center; padding: 1.75rem 1rem; }
.empty-row .empty-clear { margin-left: 0.25rem; }
.pill-default { color: var(--muted); }

/* ─────────── Global search (Ctrl+K) ─────────── */
.search-dialog {
    inset: 0;
    margin: 10vh auto auto;
    height: fit-content;
    width: min(640px, calc(100vw - 1rem));
    max-height: 75vh;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    background: var(--bg-card);
    color: var(--text);
    box-shadow: var(--shadow-pop);
}
.search-dialog::backdrop { background: var(--backdrop); }
.search-dialog:popover-open { display: flex; flex-direction: column; }
.search-dialog input[type="search"] {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 1rem;
    outline: none;
}
.search-results { overflow-y: auto; max-height: calc(75vh - 3.5rem); }
.search-results:empty { display: none; }
.search-group {
    padding: 0.6rem 1rem 0.2rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}
.search-hit {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.45rem 1rem;
    color: inherit;
    text-decoration: none;
}
.search-hit:hover, .search-hit:focus-visible, .search-hit.is-active {
    background: var(--accent-soft);
    outline: none;
}
.search-hit .search-main { font-weight: 600; white-space: nowrap; }
.search-hit .search-detail {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 0.85rem;
}
.search-hit .search-side { margin-left: auto; white-space: nowrap; font-size: 0.85rem; }
.search-empty { padding: 0.9rem 1rem; color: var(--muted); }

/* ─────────── Not found ─────────── */
.not-found { max-width: 32rem; margin-top: 3rem; }
.not-found p { margin: 0.5rem 0 1rem; color: var(--muted); }

/* ─────────── Rows as cards on a phone ───────────
   A worklist wrapped in .m-cards drops its table grid at phone width:
   each row becomes a card, each cell a "label  value" line. The labels
   come from the column headers (data-label, set by the layout script). */
@media (max-width: 640px) {
    .m-cards .table-scroll, .table-scroll.m-cards { overflow: visible; }
    .m-cards table,
    .m-cards tbody,
    .m-cards tr,
    .m-cards td { display: block; }
    .m-cards .table-scroll > table, .table-scroll.m-cards > table { min-width: 0; }
    .m-cards table { border: 0; background: transparent; }
    .m-cards thead { display: none; }
    /* Bulk selection survives the cards: the header's select-all box
       stays, labelled, above them. */
    .m-cards thead:has(.select-all) { display: block; background: transparent; }
    .m-cards thead:has(.select-all) tr { display: block; }
    .m-cards thead:has(.select-all) th { display: none; }
    .m-cards thead th:has(.select-all) { display: block; padding: 0 0 0.5rem; border: 0; text-transform: none; letter-spacing: normal; }
    .select-all .select-all-text { display: inline; margin-left: 0.4rem; font-size: 0.9rem; color: var(--fg); }
    /* A card is a title row over a two-column grid of facts, label over
       value (like the order page's facts strip): half the height of one
       full-width line per field, and pairs read together. */
    .m-cards tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 1rem;
        row-gap: 0.55rem;
        margin-bottom: 0.6rem;
        padding: 0.65rem 0.85rem 0.7rem;
        box-shadow: var(--shadow-card);
        background: var(--bg-card);
        border: 1px solid var(--line);
        border-radius: var(--r-card);
    }
    .m-cards tbody td {
        display: block;
        min-width: 0;
        padding: 0;
        font-size: 0.875rem;
        line-height: 1.35;
        border: 0;
        text-align: left;
        overflow-wrap: anywhere;
    }
    .m-cards tbody td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.1rem;
        font-size: 0.75rem;
        font-weight: 400;
        line-height: 1.3;
        text-transform: none;
        letter-spacing: 0;
        color: var(--muted);
    }
    .m-cards tbody td.ta-center,
    .m-cards tbody td.ta-right,
    .m-cards tbody td.num { text-align: left !important; padding: 0 !important; }
    #invoices-table td:nth-child(6) { text-align: left !important; }
    .m-cards tbody td .cell-sub {
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        overflow-wrap: normal;
    }
    .m-cards tbody td[colspan] {
        grid-column: 1 / -1;
        text-align: center !important;
        padding: 0.9rem 0 !important;
        margin: 0 !important;
        border: 0 !important;
        font-size: 0.875rem !important;
        font-weight: 400 !important;
        color: var(--muted) !important;
    }
    /* An ID (order number, SKU, AWB) never breaks: it ends in an ellipsis
       if its column is too narrow. */
    .m-cards tbody td:is(.mono, :has(> a:only-child)) {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        overflow-wrap: normal;
    }

    /* Record cards lead with what a list is scanned for. The headline row
       pairs who/what with the amount; status follows; dates and references
       sit below. */
    #orders-table.m-cards tbody td:nth-child(1),
    #invoices-table.m-cards tbody td:nth-child(1) { grid-column: 1; order: -3; }
    #orders-table.m-cards tbody td:nth-child(4),
    #invoices-table.m-cards tbody td:nth-child(6),
    #transactions-table.m-cards tbody td:nth-child(6) {
        grid-column: 2;
        order: -3;
        text-align: right !important;
        font-size: 0.95rem;
        font-weight: 600;
        padding-bottom: 0.5rem !important;
        border-bottom: 1px solid var(--line-soft);
    }
    /* Money in a headline never wraps, clips or ellipsizes: the amount
       keeps its full width and the name beside it wraps instead. */
    #orders-table.m-cards tbody td:nth-child(4),
    #invoices-table.m-cards tbody td:nth-child(6),
    #transactions-table.m-cards tbody td:nth-child(6) {
        white-space: nowrap;
        overflow: visible !important;
        text-overflow: clip !important;
        min-width: max-content;
    }
    #orders-table.m-cards tbody tr,
    #invoices-table.m-cards tbody tr,
    #transactions-table.m-cards tbody tr { grid-template-columns: minmax(0, 1fr) minmax(9rem, 1fr); }
    #orders-table.m-cards tbody td:nth-child(4)::before,
    #invoices-table.m-cards tbody td:nth-child(6)::before,
    #transactions-table.m-cards tbody td:nth-child(6)::before { display: none; }
    #orders-table.m-cards tbody td:nth-child(3),
    #invoices-table.m-cards tbody td:nth-child(3) { grid-column: 1 / -1; order: -2; }
    #orders-table.m-cards tbody td:is(:nth-child(5), :nth-child(6)),
    #invoices-table.m-cards tbody td:nth-child(5) { order: -1; }
    /* Transactions: the merchant is the headline, the date drops below. */
    #transactions-table.m-cards tbody td:nth-child(4) {
        grid-column: 1;
        order: -3;
        font-size: 0.95rem;
        font-weight: 600;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--line-soft);
    }
    #transactions-table.m-cards tbody td:nth-child(4)::before { display: none; }
    #transactions-table.m-cards tbody td:nth-child(1) {
        grid-column: auto;
        order: 1;
        font-size: 0.875rem;
        font-weight: 400;
        padding-bottom: 0;
        border-bottom: 0;
    }
    #transactions-table.m-cards tbody td:nth-child(1)::before { display: block; }
    /* The date reads whole on its own row; references never break. */
    #transactions-table.m-cards tbody td:nth-child(1) { grid-column: 1 / -1; overflow: visible; white-space: normal; }
    #transactions-table.m-cards tbody td:nth-child(7) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    #transactions-table.m-cards tbody td:has(> .same-as-merchant) { display: none; }
    /* A date is footer material on every card: full width, never broken. */
    .m-cards tbody td:is([data-label="Date"], [data-label="Created"], [data-label="Uploaded"], [data-label="Last seen"]) {
        grid-column: 1 / -1;
        order: 6;
        white-space: nowrap;
        padding-top: 0.5rem !important;
        border-top: 1px solid var(--line-soft);
        font-size: 0.8125rem;
        color: var(--muted-fg);
    }
    /* Stock Sync: Shopify, Tracked and the difference are one fact. */
    #stock-sync-table.m-cards tbody tr,
    .m-cards #stock-sync-table tbody tr { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .m-cards #stock-sync-table tbody td { grid-column: span 3; }
    .m-cards #stock-sync-table tbody td:is(:nth-child(4), :nth-child(5), :nth-child(6)) { grid-column: span 2; }
    .m-cards #stock-sync-table tbody td:nth-child(6) { font-weight: 650; color: var(--warn-fg); }
    .m-cards #stock-sync-table tbody td:first-child { grid-column: 1 / -1; }
    .m-cards #stock-sync-table tbody td:not(:first-child):has(.btn) { grid-column: 1 / -1; }
    #transactions-table.m-cards tbody td:nth-child(7) { grid-column: 1 / -1; order: 2; }
    /* One anatomy for record cards: headline and amount, who, status, then
       a quiet footer (date, counts, references) under a hairline. */
    #orders-table.m-cards tbody td:nth-child(8) { display: block; grid-column: 1; order: 5; }
    #orders-table.m-cards tbody td:nth-child(8):empty::after { content: "—"; color: var(--dim); }
    #orders-table.m-cards tbody td:nth-child(7) { order: 5; }
    #orders-table.m-cards tbody td:nth-child(2) { grid-column: 1; order: 6; }
    #orders-table.m-cards tbody td:nth-child(9) { grid-column: 2; order: 6; }
    #invoices-table.m-cards tbody td:nth-child(7) { order: -1; }
    #invoices-table.m-cards tbody td:nth-child(2) { grid-column: 1 / -1; order: 6; }
    #orders-table.m-cards tbody td:is(:nth-child(2), :nth-child(9)),
    #invoices-table.m-cards tbody td:nth-child(2),
    #transactions-table.m-cards tbody td:nth-child(1) {
        padding-top: 0.5rem !important;
        border-top: 1px solid var(--line-soft);
        font-size: 0.8125rem;
        color: var(--muted-fg);
    }
    #orders-table.m-cards tbody td:nth-child(2) { margin-right: -1rem; padding-right: 1rem !important; }
    #transactions-table.m-cards tbody td:nth-child(1) { order: 6; }
    /* The headline row's rule runs unbroken across the column gap. */
    #orders-table.m-cards tbody td:nth-child(1),
    #invoices-table.m-cards tbody td:nth-child(1),
    #transactions-table.m-cards tbody td:nth-child(4) { margin-right: -1rem; padding-right: 1rem !important; }
    /* Row actions (buttons, menus) form the card's footer. */
    .m-cards tbody td:not(:first-child):has(.btn, .filter-details) {
        grid-column: 1 / -1;
        padding-top: 0.6rem;
        border-top: 1px solid var(--line-soft);
    }
    .m-cards tbody td:not(:first-child):has(.btn, .filter-details)::before { display: none; }
    .m-cards .order-items-trigger { min-width: 0; padding: 0; text-align: left; }
    .m-cards tbody td:empty,
    .m-cards tbody td:not([data-label])::before,
    .m-cards tbody td[data-label=""]::before { display: none; }
    /* The first cell is the card's title: full width, no label, ruled off. */
    .m-cards tbody tr { position: relative; }
    .m-cards tbody td:first-child:not(.shipping-check) {
        grid-column: 1 / -1;
        text-align: left;
        font-size: 0.95rem;
        font-weight: 600;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--line-soft);
    }
    .m-cards tbody td:first-child:not(.shipping-check)::before { display: none; }
    /* A pick box rides in the card's top-right corner; the next cell
       becomes the title instead. */
    .m-cards tbody td.shipping-check {
        position: absolute;
        top: 0.55rem;
        right: 0.75rem;
        padding: 0;
        width: auto;
    }
    .m-cards tbody td.shipping-check + td {
        grid-column: 1 / -1;
        text-align: left;
        font-size: 0.95rem;
        font-weight: 600;
        padding: 0.1rem 2rem 0.5rem 0;
        border-bottom: 1px solid var(--line-soft);
    }
    .m-cards tbody td.shipping-check + td::before { display: none; }
    .m-cards tbody td.shipping-check + td > label { padding: 0 !important; }
    .m-cards td.pick-cell > label { display: block; padding: 0; height: auto; }
    .m-cards tr.empty-row td { text-align: left; }
    .m-cards tr.empty-row td::before { display: none; }

    .page-actions { margin-left: 0; }
    .filter-pill.search-pill { flex: 1 1 100%; }
    .filter-pill.search-pill input[type="search"] { width: 100%; }
}

/* ─────────── Dark mode ───────────
   Automatic: follows the OS/browser preference, no toggle and no JS.
   `screen` only, so printed sheets (shipping list, return forms) stay
   black-on-white whatever the system theme is.

   Three layers:
     1. the :root tokens re-toned — most of the sheet follows from these;
     2. rules whose colours are literals rather than tokens;
     3. inline `style="…"` colours baked into the server-rendered HTML,
        remapped by matching the hex inside the style attribute. Those need
        !important: nothing else outranks an inline declaration. When adding
        a new inline colour, prefer one already listed here. */
@media screen and (prefers-color-scheme: dark) {
    :root {
        --accent:        #6e6af0;
        --accent-hover:  #7f7cf4;
        --accent-fill:       #4f46e5;
        --accent-fill-hover: #4338ca;
        --accent-fg:     #a9b1fb;
        --accent-soft:   #22234a;
        --accent-soft-2: #2c2e5e;
        --accent-strong: #c9cffd;
        --accent-ring:   rgba(129, 140, 248, 0.32);
        --link:          #a9b1fb;
        --link-hover:    #d0d5fd;

        --nav-bg:                #111318;
        --nav-fg:                #b4b9c5;
        --nav-fg-strong:         #f1f2f5;
        --nav-icon:              #737a89;
        --nav-group-fg:          #858b99;
        --nav-hover-bg:          #1b1e25;
        --nav-active-bg:         #252935;
        --nav-active-fg:         #f5f6f8;
        --nav-active-shadow:     0 0 0 1px rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.4);
        --nav-chip-bg:           #262a33;
        --nav-chip-bg-active:    #2c2e5e;
        --nav-chip-fg:           #c3c8d2;
        --nav-hot-bg:            #d93d42;
        --nav-search-bg:         #171a20;
        --nav-search-border:     #2a2e37;
        --nav-search-border-hover: #3d424d;
        --nav-search-fg:         #7d8392;
        --nav-search-fg-hover:   #d4d7dd;
        --backdrop:              rgba(0, 0, 0, 0.6);

        --border:        #2c3039;
        --border-strong: #464b57;
        --control-border:#353a44;
        --muted:         #949aa7;
        --muted-fg:      #b4b9c5;
        --fg:            #eceef2;
        --text:          #d3d6dd;
        --dim:           #7d8392;
        --dim-strong:    #9ca2ae;
        --dim-deep:      #b4b9c5;
        --line:          #2a2e37;
        --line-soft:     #22262e;
        --bg-soft:       #0c0e12;
        --bg-card:       #171a20;
        --bg-hover:      #20242b;
        --bg-subtle:     #1b1e25;
        --shadow-xs:     0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-card:   0 1px 2px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.01);
        --shadow-pop:    0 12px 32px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.35);

        --bad-bg:        #3a1a1c;
        --bad-fg:        #fca5a5;
        --warn-bg:       #362a12;
        --warn-fg:       #e9c16a;
        --ok-bg:         #132f20;
        --ok-fg:         #7fd4a0;
        --info-bg:       #15284a;
        --info-bg-soft:  #121f36;
        --info-fg:       #9cc2fb;
        --bad-fg-bright: #f87171;
        --warn-bg-soft:  #251e0f;
        --warn-bg-strong:#4d3b10;
        --warn-fg-bright:#fbbf24;
        --ok-fg-bright:  #4ade80;
        --info-bg-strong:#1c3760;
        --orange-bg:     #43280f;
        --orange-bg-soft:#33200e;
        --orange-fg:     #fdba74;
        --teal-bg:       #102f2b;
        --teal-fg:       #6ee3cf;
        --purple-bg:     #2e2148;
        --purple-fg:     #d6b8fd;
        --gray-bg-strong:#2c3039;

        /* Only ever referenced from inline styles, with a light fallback. */
        --card:          var(--bg-hover);
        --surface:       var(--bg-hover);
        --danger:        #fca5a5;
    }

    /* Section palettes, dark: the same hue, lightness inverted into a
       narrow near-black band so the shapes keep their relative contrast. */
    body { --canvas: var(--bg-soft); }
    body.page-dashboard          { --p1: #23262b; --p2: #191b1e; --p3: #1e2125; --canvas: #191b1e; }
    body.page-orders             { --p1: #131820; --p2: #18202a; --canvas: #18202a; }
    body.page-returns            { --p1: #2b1e21; --p2: #211518; --canvas: #211518; }
    body.page-shipping           { --p1: #342c1e; --p2: #272116; --canvas: #272116; }
    body.page-incoming           { --p1: #222d2b; --p2: #18211f; --canvas: #18211f; }
    body.page-moves              { --p1: #332921; --p2: #27201a; --p3: #201a14; --canvas: #201a14; }
    body.page-wtb                { --p1: #3c3023; --p2: #2a2318; --canvas: #2a2318; }
    body.page-pos                { --p1: #1e1727; --p2: #292135; --canvas: #292135; }
    body.page-matching           { --p1: #1b1626; --p2: #292338; --canvas: #1b1626; }
    body.page-products           { --p1: #222922; --p2: #283228; --p3: #1e241e; --p4: #181e18; --canvas: #1e241e; }
    body.page-stock-sync         { --p1: #17211b; --p2: #202b26; --canvas: #17211b; }
    body.page-pinger             { --p1: #202319; --p2: #2a2f21; --canvas: #202319; }
    body.page-inventory          { --p1: #1f2231; --p2: #191c27; --p3: #141720; --canvas: #141720; }
    body.page-inventory-check    { --p1: #1e2621; --p2: #3f5043; --canvas: #1e2621; }
    body.page-inventory-recount  { --p1: #1a201c; --p2: #232d26; --canvas: #1a201c; }
    body.page-transactions       { --p1: #3a3223; --p2: #1c1a1f; --canvas: #1c1a1f; }
    body.page-invoices           { --p1: #26302d; --p2: #282b1b; --canvas: #282b1b; }
    body.page-bons               { --p1: #231c14; --p2: #30261d; --canvas: #231c14; }
    body.page-cash               { --p1: #222d23; --p2: #182118; --canvas: #182118; }
    body.page-zreports           { --p1: #181a26; --p2: #242737; --canvas: #181a26; }
    body.page-buy-invoices       { --p1: #20242a; --p2: #161a1f; --canvas: #161a1f; }
    body.page-providers          { --p1: #2e1f25; --p2: #21151a; --canvas: #21151a; }
    body.page-expenses           { --p1: #182022; --p2: rgba(34, 211, 238, 0.045); --canvas: #182022; }
    body.page-goat               { --p1: #2f3324; --p2: #282a1e; --p3: #1f2217; --canvas: #1f2217; }
    body.page-suppliers          { --p1: #1a1c26; --p2: #15161e; --p3: #1f222e; --canvas: #15161e; }
    body.page-users              { --p1: #221817; --p2: #2c201f; --canvas: #221817; }
    body.page-jobs               { --p1: #1a1b1d; --p2: #202327; --canvas: #1a1b1d; }
    body.page-admin              { --p1: #1a1b1e; --p2: #222427; --canvas: #1a1b1e; }

    .filter-pill.choice-pill {
        --pill-caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 4'%3E%3Cpath d='M0 0h8L4 4z' fill='%239a9da3'/%3E%3C/svg%3E");
    }
    /* Cards on a section's panel take a little of its hue, the way white
       cards belong to any light panel. */
    body[class*="page-"] {
        --bg-card: color-mix(in srgb, #1a1d23 52%, var(--canvas));
        --bg-subtle: color-mix(in srgb, #1e2128 52%, var(--canvas));
    }
    /* An info alert on a section panel leans toward the panel, so it reads
       as information without a vivid block of an unrelated hue. */
    body[class*="page-"] .alert-info {
        background: color-mix(in srgb, var(--info-bg-soft) 45%, var(--canvas));
        border-color: color-mix(in srgb, var(--info-fg) 25%, transparent);
    }
    .nav-mark {
        background: linear-gradient(180deg, #f3f4f6, #c9ccd3);
        color: #111318;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }

    .btn-primary { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
    .barcode-x { color: #f87171; }

    .spinner { border-color: #3d424d; border-top-color: #8fb8fb; }
    .add-line-spinner { border-color: rgba(255, 255, 255, 0.45); border-top-color: #fff; }
    :where(select:not([multiple])) {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23737a89' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
    }

    .dismiss-menu { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); }
    .inv-popup { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55); }
    .order-items-popup { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6); }
    .stock-card:hover { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }

    .dropzone { border-color: var(--border-strong); }
    .dropzone.dragover { border-color: #60a5fa; color: #93c5fd; }
    .pos-product-preview { border-bottom-color: var(--dim); }

    .ret-alert { border-color: #7c5a10; }
    .ret-info { border-color: #3f4480; }
    .ret-panel { border-color: #a16207; }
    .alert-bad { border-color: #7f2a2a; }
    .alert-info { border-color: #2f4f7a; }
    .badge.ret-state-draft { background: #343841; color: #d1d5db; }
    .badge.ret-state-cancelled { background: #2a2d34; color: #9ca3af; }

    /* ── Leftover inline colours: styles picked at runtime in the templates
       (banner/row tints, provider pills). Static ones use the ink-* / fill-*
       utilities instead. Matched on the hex alone where a hex only ever plays
       one role; on `color: hex` where it is also used for a border. ── */

    /* Fills */
    [style*="background: #fff;" i] { background-color: var(--bg-card) !important; }
    [style*="#f3f4f6" i], [style*="#f5f5f5" i] { background-color: var(--bg-hover) !important; }
    [style*="#e5e7eb" i] { background-color: var(--gray-bg-strong) !important; }
    [style*="#fef3c7" i], [style*="#fff3cd" i] { background-color: var(--warn-bg) !important; }
    [style*="#fde68a" i] { background-color: var(--warn-bg-strong) !important; }
    [style*="#fee2e2" i] { background-color: var(--bad-bg) !important; }
    [style*="#dcfce7" i] { background-color: var(--ok-bg) !important; }
    [style*="#dbeafe" i] { background-color: var(--info-bg) !important; }
    [style*="#bfdbfe" i] { background-color: var(--info-bg-strong) !important; }
    [style*="#e0e7ff" i] { background-color: var(--accent-soft-2) !important; }
    [style*="#ffedd5" i] { background-color: var(--orange-bg) !important; }

    /* Ink */
    [style*="#999" i] { color: var(--dim) !important; }
    /* zigweb's Table pagination label ("Showing n–m of total"). */
    [style*="color: #666" i] { color: var(--dim-strong) !important; }
    [style*="#6b7280" i] { color: var(--muted) !important; }
    [style*="#92400e" i] { color: var(--warn-fg) !important; }
    [style*="#9a3412" i] { color: var(--orange-fg) !important; }
    [style*="#991b1b" i], [style*="#c0392b" i] { color: var(--bad-fg) !important; }
    [style*="color: #dc2626" i] { color: var(--bad-fg-bright) !important; }
    [style*="#166534" i], [style*="#14532d" i] { color: var(--ok-fg) !important; }
    [style*="color: #16a34a" i] { color: var(--ok-fg-bright) !important; }
    [style*="#1e40af" i] { color: var(--info-fg) !important; }
    [style*="#3730a3" i] { color: var(--accent-strong) !important; }

    /* Borders */
    [style*="#ccc" i], [style*="#ddd" i], [style*="#d1d5db" i], [style*="#e0e0e0" i],
    [style*="solid #eee" i] { border-color: var(--border) !important; }
    [style*="#9ad29a" i] { border-color: #2c5a35 !important; }
}
