/* ── Self-hosted webfonts ──────────────────────────────────────────────────
   Manrope + DM Sans were loaded from fonts.googleapis.com until now, and the
   app's own CSP (style-src 'self'; font-src 'self' data:) blocked both the
   stylesheet and the font files -- so every public page silently rendered in
   the generic sans-serif fallback. Self-hosting fixes that without widening
   the CSP, and stops a visitor's IP being handed to a third party on a site
   that sells EU compliance. latin + latin-ext subsets only. */
/* latin-ext */
@font-face {
  font-family: 'DM Sans';
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/dm-sans-300-italic-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;
}
/* latin */
@font-face {
  font-family: 'DM Sans';
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/dm-sans-300-italic-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;
}
/* latin-ext */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/dm-sans-300-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;
}
/* latin */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/dm-sans-300-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;
}
/* latin-ext */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dm-sans-400-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;
}
/* latin */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dm-sans-400-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;
}
/* latin-ext */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/dm-sans-500-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;
}
/* latin */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/dm-sans-500-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;
}
/* latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/manrope-300-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;
}
/* latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/manrope-300-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;
}
/* latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/manrope-400-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;
}
/* latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/manrope-400-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;
}
/* latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/manrope-600-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;
}
/* latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/manrope-600-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;
}
/* latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/manrope-700-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;
  }
/* latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/manrope-700-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;
  }
/* latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/manrope-800-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;
  }
/* latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/manrope-800-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;
  }
/* ========================================
   QR SYSTEM - UNIFIED RESPONSIVE CSS
   ======================================== */

/* === CSS DESIGN TOKENS === */
:root {
    /* Brand */
    --color-primary:        #667eea;
    --color-primary-dark:   #5568d3;
    /* Status */
    --color-success:        #48bb78;
    --color-success-dark:   #38a169;
    --color-danger:         #e53e3e;
    --color-danger-dark:    #c53030;
    --color-warning:        #ecc94b;
    --color-warning-dark:   #d69e2e;
    --color-warning-text:   #744210;
    /* Neutral */
    --color-secondary:      #e2e8f0;
    --color-secondary-dark: #cbd5e0;
    --color-text:           #2c3e50;
    --color-text-muted:     #718096;
    --color-border:         #e2e8f0;
    --color-bg:             #f5f5f5;
    --color-bg-card:        #ffffff;
    /* Radius */
    --radius-sm:            6px;
    --radius-md:            12px;
    --radius-lg:            16px;
    /* Shadows */
    --shadow-sm:            0 2px 8px rgba(0,0,0,0.1);
    --shadow-md:            0 4px 20px rgba(0,0,0,0.15);
    /* Transitions */
    --transition:           0.2s ease;
}

/* Screen-reader-only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* === RESET & BASE === */
/* Prevent full-page horizontal scrollbar on normal pages.
   wide-page bodies need horizontal scroll for tables/canvas. */
body:not(.wide-page) { overflow-x: clip; }
/* Backdrop hidden by default — only shown in media query when mobile menu opens */
#mob-backdrop { display: none; }

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

/* Pages with wide tables or complex layouts.
   On desktop the body holds at 1024px so the table never squishes.
   On mobile: the CONTAINER and all non-table content fits the viewport normally.
   Only the TABLE itself (inside .table-wrapper) gets a min-width so columns
   don't collapse — the wrapper provides the horizontal scroll. */
body.wide-page { min-width: 1024px; }
@media (max-width: 1080px) {
    /* Body and container reflow to viewport width */
    body.wide-page { min-width: 0; }
    body.wide-page .container,
    body.wide-page .container-medium { min-width: 0; }
    /* Canvas/designer pages keep a hard body min-width — the whole page scrolls */
    body.wide-page.canvas-page { min-width: 1024px; }
    /* The table (not the container) keeps its minimum so columns are usable.
       The .table-wrapper provides the horizontal scroll. */
    body.wide-page .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        width: 100%;
    }
    body.wide-page .table-wrapper table {
        /* At least 700px AND at least its box: a bare 700px replaced the
           min-width:100% below, so on a window of 700-1080px a table stopped
           short of its box (2026-10-17). */
        min-width: max(700px, 100%);
    }
}

/* === NAVIGATION === */
.nav { 
    background: #3b5bdb;
    color: white;
    padding: 0 24px;
    height: 44px;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 0;
    flex-wrap: nowrap;
}

/* Mobile menu — hidden everywhere by default */
.nav-mobile-menu { display: none !important; }
.nav-mobile-menu.open { display: flex !important; flex-direction: column; }
.nav-burger { display: none; }

/* Admin bar: the OPTRICAL navy, same as the client rail (--rail-bg). */
.nav-admin {
    background: var(--rail-bg, #023151);
}

/* Alternative: Add class to body */
body.admin-page .nav {
    background: var(--rail-bg, #023151);
}
/* The current item is marked in the OPTRICAL orange: an underline in the
   bar's own height rather than the old yellow text, which on navy read as a
   warning. White text keeps it legible (orange text on navy is 4.25:1). */
body.admin-page .nav:not(.nav-rail) .nav-links > a.active,
body.admin-page .nav:not(.nav-rail) .nav-links > .nav-dropdown > .nav-dropdown-btn.active {
    color: #fff; background: rgba(255,255,255,.08);
    box-shadow: inset 0 -3px 0 var(--brand-orange, #F26429);
}

body.client-page .nav {
    background: #3b5bdb;
}

.nav-left { 
    display: flex;
    gap: 0;
    align-items: stretch;
    flex-wrap: nowrap;
    flex: 1;
}

.nav-brand { 
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
    height: 44px;               /* never push nav taller */
    display: flex;
    align-items: center;
    padding: 0 16px 0 0;
    margin-right: 8px;
    border-right: 1px solid rgba(255,255,255,0.15);
    color: white;
    text-decoration: none;
    flex-shrink: 0;
}
.nav-brand:hover { opacity: 0.85; color: white; background: none !important; }

.nav-links { 
    display: flex;
    align-items: stretch;
    gap: 0;
    flex-wrap: nowrap;
}

.nav a, .nav-links a, .nav-links span { 
    color: rgba(255,255,255,0.78);
    text-decoration: none;
    padding: 0 14px;
    border-radius: 0;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    font-size: 14px;
    display: flex;
    align-items: center;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* Nav cart. The count sits ON the icon rather than after it, so the item never
   changes width as the count changes and the rest of the bar cannot shift.
   The [hidden] rule is not redundant: `.nav-links a` above sets display:flex,
   which outranks the HTML hidden attribute and would render the icon anyway. */
.nav-links a.nav-cart {
    position: relative;
    /* Full bar height and square, matching the text menu items rather than
       floating as a shorter chip. Width follows height via aspect-ratio, so the
       square holds if the bar height ever changes. */
    align-self: stretch;
    box-sizing: border-box;
    height: auto;
    aspect-ratio: 1;
    padding: 0;
    margin: 0 0 0 6px;
    border-radius: 0;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Transparent at rest like the other menu items, since it is now flush with
       them; the chip background is what made it read as a separate control. */
    background: transparent;
    /* Full white rather than the 0.78 the text links carry: now that the glyph
       follows currentColor, inheriting that alpha would have dimmed the icon
       against the labels it sits beside. */
    color: #fff;
}
.nav-links a.nav-cart:hover { background: rgba(255,255,255,0.1); }
/* On its own page the cart is the current menu item and says so the same way
   every other one does. It was the only item in the bar that stayed
   unchanged when you were standing on it — the comment below always claimed
   currentColor, but the stroke was hard-coded #fff, so no colour rule could
   ever reach the icon. */
.nav-links a.nav-cart.active {
    background: rgba(255,224,102,0.18);
    color: #ffe066;
}
.nav-links a.nav-cart svg {
    /* An SVG, not the emoji: a colour-glyph cart could never match the nav's
       white text and read as pasted on. currentColor keeps it in the palette. */
    width: 18px;
    height: 18px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.nav-links a.nav-cart svg circle { fill: currentColor; stroke: none; }
.nav-links a.nav-cart[hidden] { display: none; }
/* The icon is always shown — it is the way into the cart, so hiding it when
   empty removed the entrance at the moment a customer had nothing in there
   yet. The BADGE is what disappears: it is absolutely positioned with a red
   fill and a 16px min-width, so an empty one is a meaningless red dot. */
.nav-links a.nav-cart .nav-cart-n:empty { display: none; }
/* Selector must stay at least as specific as `.nav-links span` above (0,2,0),
   which otherwise wins on specificity regardless of order and flattens the pill:
   it forces border-radius:0 and padding:0 14px, turning a 16px round badge into
   a 38px square block. */
.nav-links a.nav-cart .nav-cart-n {
    position: absolute;
    /* Inside the square, not overhanging it. The button is now full bar height,
       so a negative offset would clip against the bar edge again — the bug that
       turned the pill into a bare rectangle the first time. */
    top: 4px;
    right: 4px;
    left: auto;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    box-sizing: border-box;
    background: #e53e3e;
    color: #fff;
    /* Ring in the nav's own colour (#3b5bdb) so the pill reads as sitting on
       the bar rather than punched through it. */
    border: 1.5px solid #3b5bdb;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 13px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.nav-links a.active { 
    background: transparent;
    color: #ffe066;
    font-weight: 600;
    border-bottom: 2px solid transparent;
}

/* === CONTAINERS === */
.container { 
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.container-small {
    padding: 30px;
    max-width: 600px;
    margin: 0 auto;  /* Container itself is centered */
}

/* Center all block elements within container-small */
.container-small > * {
    margin-left: auto;
    margin-right: auto;
}

/* Explicit centering for common block elements */
.container-small .card,
.container-small .section,
.container-small form,
.container-small .btn-block {
    margin-left: auto;
    margin-right: auto;
}

/* The form width, starting where a .container page starts rather than
   centred. Centred, its title and breadcrumb sat ~200px right of every other
   page's, and the narrow column floated in the middle of the screen. The left
   margin is .container's own centring offset (0 until the page is wider than
   1400px), so the two share a left edge at every width. */
.container-medium {
    padding: 30px;
    max-width: 900px;
    margin-left: max(0px, calc((100% - 1400px) / 2));
    margin-right: auto;
}

/* === CARDS === */
.card { 
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.section { 
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.section h2 { 
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
    font-size: 20px;
}

/* Compact pages (2026-10-01). Opt-in on <body>, for working pages where the
   default 30px cards, 15px cells and 20px field gaps put a screenful of
   chrome around a few rows. Inline styles still win where a page set its own. */
.compact-page .section { padding: 16px 18px; margin-bottom: 16px; }
.compact-page .section h2 { margin-bottom: 12px; padding-bottom: 6px; font-size: 17px; }
.compact-page table { margin-top: 8px; }
.compact-page th { padding: 8px 10px; font-size: 12px; }
.compact-page td { padding: 7px 10px; font-size: 13px; }
.compact-page .form-group { margin-bottom: 12px; }
.compact-page label { margin-bottom: 4px; }
.compact-page input:not([type=checkbox]):not([type=radio]):not([type=file]),
.compact-page textarea { padding-top: 8px; padding-bottom: 8px; }
.compact-page select { padding-top: 7px; padding-bottom: 7px; }

/* === STATS CARDS === */
.stats { 
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card { 
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
}

.stat-card h3 { 
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value { 
    font-size: 36px;
    font-weight: bold;
    color: #2c3e50;
}

/* Progress bars */
.progress-bar { 
    background: #e0e0e0;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill { 
    background: #667eea;
    height: 100%;
    transition: width 0.3s;
}

/* === FORMS === */
.form-group { 
    margin-bottom: 20px;
}

label { 
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
}

input, select, textarea { 
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}
input[type="checkbox"],
input[type="radio"]
{
    width: auto;
}
/* A select's content box is 2px taller than a text input's at the same font
   size, so with the same padding every select stood 46px beside 44px inputs.
   One pixel less padding top and bottom lines them up. White, too: with no
   background set, Chrome painted selects its own grey and inputs white. */
select {
    padding-top: 11px;
    padding-bottom: 11px;
    background-color: #fff;
}
select:disabled { background-color: #f7fafc; color: #5f6b7a; cursor: not-allowed; }

/* A field you are typing in: its edge turns into a thin blue line, and that is
   all. The 3px near-black ring below is for keyboard focus on buttons and
   links -- but browsers treat ANY focus in a text field as :focus-visible, a
   mouse click included, so every search box clicked into wore the heavy ring
   (2026-11-03). Drawn as an outline over the border, not a border colour, so it
   shows the same on fields whose own rules set their border. The :not()s make
   this outrank :focus-visible; checkboxes and radios have no edge to recolour
   and keep a ring, below. */
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):focus,
select:focus, select:focus-visible, textarea:focus, textarea:focus-visible {
    outline: 1px solid #3b5bdb;
    outline-offset: -1px;
    border-color: #3b5bdb;
    box-shadow: none;
}
input[type=checkbox]:focus, input[type=radio]:focus { outline: none; }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible,
input[type=range]:focus-visible, input[type=color]:focus-visible, input[type=file]:focus-visible {
    outline: 2px solid #3b5bdb;
    outline-offset: 2px;
    box-shadow: none;
}

.checkbox-group { 
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] { 
    width: auto;
}

.input-group { 
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.help, .help-text { 
    font-size: 13px;
    color: #7f8c8d;
    margin-top: 5px;
    line-height: 1.4;
}

/* === BUTTONS === */
.btn {
    /* A <button> does not inherit the page font (the browser gives it its own,
       Arial here), so a .btn button and a .btn link side by side were set in
       two different typefaces. */
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: fit-content;
    padding: 10px 20px;
    background: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    vertical-align: middle;
}

button.btn { padding: 10px 20px; }

/* Globally prevent buttons from stretching to parent width */
button { width: fit-content; min-width: fit-content; }
input[type="submit"], input[type="button"], input[type="reset"] { width: fit-content; min-width: fit-content; }

.btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ── Keyboard focus ─────────────────────────────────────────────────────────
   The ring was the same indigo as the primary buttons, so on the button you
   are most likely to be focusing it was indigo on indigo. And it applied to
   .btn alone: the quantity steppers, the ✕ removes, the sortable headers, the
   nav's dropdown buttons and every plain <a> had no focus style at all, so
   tabbing through a page lost the cursor entirely.

   A dark ring with a white gap, so it reads on white cards, on the indigo
   primary, on the red danger and on the blue navbar alike — one treatment
   rather than a colour per background.

   :focus-visible, not :focus — the browser shows this for keyboard and
   assistive navigation and withholds it from a mouse click, which is what
   makes a strong ring tolerable. */
:focus-visible,
.btn:focus-visible {
    outline: 3px solid #1a202c;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #fff;
}
/* On the navbar the page behind is dark, so invert: white ring, dark gap. */
.nav :focus-visible {
    outline-color: #fff;
    box-shadow: 0 0 0 2px rgba(26, 32, 44, .55);
}
/* An outline is drawn outside the element, so an ancestor that clips its
   overflow erases it. These three group their children deliberately and would
   have swallowed the ring on every control inside them. */
.row-pill:focus-within, .qty-step:focus-within,
.nav-dropdown-menu:focus-within { overflow: visible; }

.btn:active {
    transform: translateY(0);
}

/* Square icon-only button. Table action cells were mixing buttons whose height
   came from whatever glyph they held -- a ★ and a 🗑️ have different metrics, so
   two buttons with identical padding still came out different heights. Fixing
   the box instead of the padding makes a row of them line up regardless of what
   is inside. */
.icon-btn {
    width: 34px;
    height: 34px;
    padding: 0 !important;
    flex: 0 0 34px;
    font-size: 15px;
    line-height: 1;
}

/* "In use, but you may still proceed." Distinct from :disabled on purpose —
   a disabled control says the action is unavailable, and for a label picture it
   is not: the server names the designs that would lose their backdrop and lets
   the person decide. Amber rather than a pale red, because a washed-out red is
   exactly what :disabled looks like -- the one signal this state must not send.
   Solid fill, so it reads as a live button that wants a second thought. */
.btn.is-inuse {
    background: #dd6b20 !important;
    color: #fff !important;
    border: 1px solid #c05621 !important;
}
.btn.is-inuse:hover {
    background: #c05621 !important;
    color: #fff !important;
}

/* Disabled used to be opacity .45 on whatever colour the button already had,
   which turned a red Delete into a washed-out pink ghost -- it read as a
   rendering fault rather than as "you cannot do this yet". A disabled control
   states its own colour instead: flat, neutral, legible, obviously inert. */
.btn:disabled,
.btn[disabled],
button:disabled,
button[disabled] {
    background: #dfe3e8 !important;
    color: #7c8595 !important;
    border-color: #cfd6de !important;
    box-shadow: none !important;
    /* grayscale() rather than opacity: these buttons carry emoji, and an emoji
       keeps its own colours however pale you make the box behind it -- which is
       why a "disabled" 🗑️ still showed a bright red bin on a ghost background
       and read as a rendering fault. Desaturating the whole control greys the
       glyph too, so the button looks switched off instead of half-painted. */
    filter: grayscale(1);
    opacity: 0.95;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    pointer-events: none;
}

/* Button sizes */
.btn-sm,
button.btn-sm,
a.btn-sm { 
    padding: 6px 12px !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    height: auto !important;
    min-height: unset !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* Inline forms used alongside buttons — reset browser defaults */
form.inline-form,
form[style*="display:inline"],
form[style*="display: inline"] {
    display: inline !important;
    margin: 0;
    padding: 0;
    vertical-align: middle;
}

/* Reset type=submit button to look identical to type=button.
   No line-height here: .btn sets 1.4, and `normal` made every submit .btn
   (Archive beside Edit) a few pixels shorter than its neighbours. */
button[type="submit"].btn {
    margin: 0;
    vertical-align: middle;
    -webkit-appearance: none;
    appearance: none;
}

.btn-block {
    width: 100%;
    display: block;
}

/* CONTENT-FIT BUTTONS ARE CENTRED IN THEIR IMMEDIATE PARENT.
   Buttons are content-width, so a lone one left-aligned in a full-width container
   reads as stranded rather than as that container's action.

   :only-child is what keeps this safe. A button that shares its parent belongs to
   a group — a toolbar, a form row, a pair of confirm/cancel — and those carry
   their own alignment, which an action bar may deliberately set to right. Only a
   button that IS the whole content of its parent gets centred, so this cannot
   reorder anything that was arranged on purpose.

   Auto margins on the inline-flex button, not display:block, which would drop the
   flex centring .btn uses for its own label and icon.

   .btn-center is the opt-in for a lone button that sits beside text and so is not
   technically an only-child; .btn-left opts back out. */
/* :only-of-type, not :only-child — a lone button usually sits BELOW text (a card
   with a title, a price and one action), so :only-child almost never matched the
   real cases. :only-of-type still means "the only button here", which keeps
   toolbars and confirm/cancel pairs out of scope.
   Not an INLINE form: style="display:inline" is how a one-button form (Archive,
   Delete, Restore) sits in a row of actions, and centring it as a block pushed
   it onto a line of its own -- 20 such forms, table rows mostly. */
.card > .btn:only-of-type,
.panel > .btn:only-of-type,
.pack-card > .btn:only-of-type,
.stat-card > .btn:only-of-type,
.empty > .btn:only-of-type,
.empty-state > .btn:only-of-type,
form:not([style*="display:inline"]):not([style*="display: inline"]) > .btn:only-of-type,
fieldset > .btn:only-of-type,
.btn-center {
    display: flex;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.btn-left {
    margin-left: 0;
    margin-right: auto;
}

/* Button variants */
.btn-primary { background: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-dark); }

.btn-success { background: var(--color-success); }
.btn-success:hover { background: var(--color-success-dark); }

.btn-danger { background: var(--color-danger); }
.btn-danger:hover { background: var(--color-danger-dark); }

/* .btn-red is used by the Brand Assets delete buttons and had no rule at all,
   so a destructive action wore the same colour as every other button. Same red
   as .btn-danger, and the bin glyph is brightened out of the emoji font's
   muted grey — a delete control should be legible at a glance. */
.btn-red { background: var(--color-danger); color: #fff; }
.btn-red:hover { background: var(--color-danger-dark); }
.btn-red { font-size: 15px; line-height: 1; }
.btn-red, .btn-danger {
    /* The emoji renders in its own colours; this lifts it to full white so it
       reads against the red rather than sitting grey on it. */
    text-shadow: 0 0 1px rgba(255,255,255,.9);
    filter: saturate(1.35) brightness(1.15);
}

.btn-warning { background: var(--color-warning); color: var(--color-warning-text); }
.btn-warning:hover { background: var(--color-warning-dark); }

.btn-secondary { background: var(--color-secondary); color: #4a5568; }
.btn-secondary:hover { background: var(--color-secondary-dark); }

.btn-purple { 
    background: #805ad5;
}

.btn-purple:hover { 
    background: #6b46c1;
}

.btn-teal { 
    background: #38b2ac;
}

.btn-teal:hover { 
    background: #319795;
}

.btn-download {
    background: #48bb78;
}

.btn-download:hover {
    background: #38a169;
}

.btn-delete {
    background: #f56565;
}

.btn-delete:hover {
    background: #e53e3e;
}

/* === TABLES === */
table { 
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th { 
    background: #f7fafc;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

td { 
    padding: 15px;
    border-bottom: 1px solid #edf2f7;
    font-size: 14px;
    vertical-align: middle;
}

tr:hover { 
    background: #f8fafc;
}

/* Table responsive wrapper */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}
/* Table inside wrapper: natural width so it can overflow the wrapper.
   min-width:100% ensures it fills the wrapper when content is narrow. */
.table-wrapper table,
.at-wrap table,
.file-pane table,
.dash-panel table {
    width: max-content;
    min-width: 100%;
}

/* Any table with explicit width:100% inside a scrolling container
   must be able to grow beyond it. Override with min-width approach. */
@media (max-width: 900px) {
    .table-wrapper table,
    .at-wrap table,
    .file-pane table,
    .dash-panel table,
    .section table,
    .card table {
        width: max-content;
        min-width: 100%;
    }
}

/* === BADGES === */
.badge { 
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    display: inline-block;
}

.badge-admin { 
    background: #922;
    color: white;
}

.badge-client { 
    background: #286;
    color: white;
}

.b-green { 
    background: #c6f6d5;
    color: #22543d;
}

.b-red { 
    background: #fed7d7;
    color: #742a2a;
}

.b-yellow {
    background: #fef3c7;
    color: #92400e;
}

.b-blue {
    background: #dbeafe;
    color: #1e40af;
}

/* === TABS === */
.tabs { 
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 30px;
    gap: 10px;
}
/* NO overflow here, and the pairing is why.
   It was `overflow-x: auto` with `overflow-y: visible`. CSS does not allow one
   axis to be visible while the other scrolls -- the visible one computes to
   `auto` -- so the tablist got a VERTICAL scrollbar it never asked for, and a
   horizontal one whose own height then pushed the content over, producing the
   other. Two scrollbars on four buttons with room to spare.
   A tablist that wraps needs neither: on a narrow screen the tabs move to a
   second line instead of hiding behind a scroll nobody sees the affordance
   for. */

.tab-btn { 
    padding: 15px 25px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 16px;
    color: #5f6b7a;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.3s;
}

.tab-btn.active { 
    color: #667eea;
    border-bottom: 2px solid #667eea;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn:focus {
    outline: none;
    color: #667eea;
    box-shadow: inset 0 -2px 0 #667eea;
}

.tab-content { 
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active { 
    display: block;
}

@keyframes fadeIn { 
    from { 
        opacity: 0;
        transform: translateY(5px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* === ACTION BAR === */
.actions, .action-bar { 
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.action-bar {
    justify-content: flex-end;
}

.action-btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

/* === ALERTS & MESSAGES === */
.error {
    background: #fee;
    border: 1px solid #fcc;
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    color: #c33;
}

.success {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    color: #065f46;
}

.warning {
    background: #fef3c7;
    border: 1px solid #fde047;
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    color: #92400e;
}

.info {
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    color: #075985;
}

/* Live-region status messages */
[role="status"], [aria-live] {
    min-height: 1.4em;
}

/* === USER INFO === */
.user-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.user-info strong { 
    color: #2c3e50;
}

/* === TYPOGRAPHY === */
h1 { 
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 28px;
}

h2 {
    color: #2c3e50;
    font-size: 20px;
    margin-bottom: 15px;
}

h3 {
    color: #4a5568;
    font-size: 16px;
    margin-bottom: 10px;
}

/* ── Card and section titles on tenant pages: one style ─────────────────────
   Chosen 2026-10-10 (option "B"). Titles were 11px grey capitals on the
   dashboard and a different size and grey on nearly every page, so none of
   them drew the eye to where a card begins. Thin-ish, a size up, the rail's
   navy. Every <h3> on a client page is a card or section title, and so is
   nearly every <h2> (not Billing's plan names, the dashboard's welcome
   line or help content); the dashboard's card heads and the folded
   "Getting set up" line are spans.
   Not: headings inside help content (they are labels on tinted strips), the
   test-scan secret box (a warning panel), the label designer's dense panel
   labels. */
:root {
    --title-font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --title-weight: 600;            /* 600 since 2026-10-28: 400 let a section title be read past */
    --title-size: 16px;
    --title-color: #023151;
    --title-tracking: .01em;
    /* The buttons' blue (--color-primary) since 2026-10-28: a pale tint of it
       behind the title, the blue itself as the bar. Was light greenish yellow
       #f7fbe1 / #e0eab4 (2026-10-11), lemon #fffacd before that. */
    --title-ribbon-bg: #eef1fd;
    --title-ribbon-line: #d5dcfa;
    --title-ribbon-accent: var(--color-primary); /* the bar that starts a title */
}
body.client-page h3:not(:is(.help-section, .help-toc, .uhp-help-rendered, .wiz-answer,
                            .pane-placeholder, .secret-display, .dsn-card, .dsn-panel) h3),
body.client-page:not([data-page="help"]) h2:not(.your-plan-name):not(:is(.welcome-panel, .plan-card,
                                                .uhp-help-rendered, .help-section) h2),
body.client-page .dash-card-head > span,
body.client-page .setup-folded > span:first-child,
body.client-page .card-title {
    font-family: var(--title-font);
    font-weight: var(--title-weight);
    font-size: var(--title-size);
    letter-spacing: var(--title-tracking);
    color: var(--title-color);
    text-transform: none;
    /* A light ribbon, as long as the words: on dense pages the type alone
       still let a title be read past. */
    width: fit-content;
    max-width: 100%;
    box-sizing: border-box;
    padding: 4px 12px 4px 10px;
    background: var(--title-ribbon-bg);
    border-top: 1px solid var(--title-ribbon-line);
    border-bottom: 1px solid var(--title-ribbon-line);
    /* A bar where the title starts, so a section begins visibly on a long
       page of panels (user, 2026-10-28: "Print in tree order", "Packed"). */
    border-left: 4px solid var(--title-ribbon-accent);
    border-radius: 0 4px 4px 0;
}
/* .card-title: the same title and ribbon for a title that is not an h2/h3
   (a span or div heading a card). Spacing around titles is set by class too,
   never inline -- the steps the pages actually used: */
.title-flush     { margin: 0; }                 /* in a flex header row */
.title-tight     { margin: 0 0 6px; }
.title-spaced    { margin: 0 0 12px; }
.title-roomy     { margin: 0 0 16px; }
.title-top-flush { margin-top: 0; }             /* first thing in its card */
.title-section   { margin-top: 24px; }          /* a new section in a long card */
.title-mb-tight  { margin-bottom: 8px; }
.title-mb        { margin-bottom: 12px; }
/* New QR group opened from a chooser example (utils/group_examples). */
.grp-example { background:#f0f8f6; border:1px solid #b9ded4; border-radius:8px;
               padding:10px 14px; margin-bottom:14px; }
.grp-example-head { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap;
                    align-items:baseline; }
.grp-example-title { font-weight:600; color:#2d3748; }
.grp-example-head a { font-size:12.5px; }
.grp-example p { margin:4px 0 0; color:#3a7368; font-size:13px; line-height:1.5; }

/* A group's status strip (macros/group_header.html), on Manage and on its codes page. */
.grp-strip { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.use-case-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 10px;
                  border-radius: 10px; background: #ebf4ff; color: #2b6cb0; letter-spacing: .03em; }
.grp-chip { font-size: 11px; padding: 3px 9px; border-radius: 8px; font-weight: 700; }
.grp-chip-codes { font-weight: 400; padding: 2px 8px; background: #f0fff4; color: #276749; }
.grp-chip-draft { background: #ebf8ff; color: #2b6cb0; }
.grp-chip-live  { background: #c6f6d5; color: #22543d; }
.grp-chip-off   { background: #edf2f7; color: #4a5568; }
.grp-chip-trial  { background: #fefcbf; color: #975a16; font-weight: 700; letter-spacing: .04em; }
/* Actions that END something (take down, archive, delete): quiet outlines, so
   the bar's strongest colour is never the button you least want. The solid
   colour is kept for the confirm dialog, the moment it actually matters. */
/* The outline is an inset shadow, not a border, so these stay the height of
   the borderless buttons beside them. */
.btn-end-warn   { background: #fff; box-shadow: inset 0 0 0 1px #ecc94b; color: #975a16; }
.btn-end-warn:hover:not(:disabled)   { background: #fffff0; box-shadow: inset 0 0 0 1px #d69e2e; color: #744210; }
.btn-end-danger { background: #fff; box-shadow: inset 0 0 0 1px #feb2b2; color: #c53030; }
.btn-end-danger:hover:not(:disabled) { background: #fff5f5; box-shadow: inset 0 0 0 1px #fc8181; color: #9b2c2c; }
.grp-meta       { font-size: 12.5px; color: #5f6b7a; }
.grp-manage     { margin-left: auto; }
.grp-note       { font-size: 12px; color: #5f6b7a; margin-top: 3px; max-width: 360px; }
.col-status     { width: 96px; }
.btn-inline     { display: inline-flex; width: auto; }
.ok-text        { color: #48bb78; }
/* A group's Redirection tab (client/_qr_group_redirect.html). */
.redirect-intro { font-size: 13px; color: #3a7368; margin: 0 0 14px; max-width: 760px; }
.rd-target { margin: 0 0 6px; }
.rd-input { padding: 10px; border: 1px solid #e2e8f0; border-radius: 6px; }
.rd-hint { color: #3a7368; }
/* "Where a scan goes is set on the group" notes (Settings, create page, Scan experience tab). */
.redirect-link-note { font-size: 13px; color: #3a7368; background: #f1f7f5; border-left: 3px solid #3a7368;
    padding: 10px 12px; border-radius: 4px; margin: 0 0 12px; max-width: 760px; }
/* A destination link in the group Details box: long URLs wrap instead of widening the box. */
.val-url { overflow-wrap: anywhere; }
/* Schema select on the create page, matching that page's inputs. */
.uc-select-create { padding: 10px; border: 1px solid #e2e8f0; border-radius: 6px; }
/* Read-only facts shown as text, not as disabled inputs (Settings > Account overview). */
.ro-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 24px; margin: 0; }
.ro-item dt { font-size: 12px; font-weight: 600; color: #5f6b7a; margin-bottom: 3px; }
.ro-item dd { margin: 0; font-size: 14.5px; color: #1a202c; }
.ro-action { margin-left: 8px; font-size: 13px; }
/* A page the account does not have (traceability_off.html): what it is, and how to ask. */
.off-notice { max-width: 640px; }
.off-notice p { color: #4a5568; line-height: 1.6; }
.off-notice-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
/* Team: a person's access profile, and how many permissions they hold. */
.role-chip { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #bee3f8; color: #2a4365; }
.role-chip-admin { background: #e9d8fd; color: #553c9a; }
.perm-cell { font-size: 12px; color: #4a5568; max-width: 240px; }
/* The heading of an empty state ("No jobs to show", "No QR groups yet"). */
.empty-title { font-size: 16px; font-weight: 600; color: #4a5568; }
/* Help's pane headings (FAQ, Workflows, My requests) and its requests list. */
.help-pane-title { font-size: 20px; color: #1a202c; margin-bottom: 4px; }
.help-req-title  { margin: 26px 0 10px; }

.subtitle { 
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 16px;
}

small {
    display: block;
    margin-top: 6px;
    color: #5f6b7a;
    font-size: 13px;
    line-height: 1.4;
}

/* === PAGINATION === */
.pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    text-decoration: none;
    color: #4a5568;
}

.pagination a:hover {
    background: #f7fafc;
}

.pagination .active {
    background: #3b5bdb;
    color: white;
    border-color: #667eea;
}

/* === UTILITY CLASSES === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }

.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.p-10 { padding: 10px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-center { justify-content: center; align-items: center; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }

.hidden { display: none; }

/* === Extra (ranjan) === */

.alert { padding: 12px; border-radius: 6px; margin-bottom: 15px; }
.alert-error { background: #fed7d7; color: #742a2a; }
.alert-success { background: #c6f6d5; color: #22543d; }

.batch-logo { width: 40px; height: 40px; object-fit: contain; border: 1px solid #e2e8f0; border-radius: 4px; padding: 2px; background: white; }
.batch-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-top: 15px; }
.batch-logo-placeholder { font-size: 24px; color: #cbd5e0; display: inline-block; width: 40px; text-align: center; }

/* Logo Grid */
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 15px; }
.logo-option { border: 2px solid #ecf0f1; border-radius: 8px; padding: 10px; text-align: center; cursor: pointer; position: relative; transition: border 0.2s; }
.logo-option:hover { border-color: #bdc3c7; }
.logo-option.selected { border-color: #667eea; background: #f0f4ff; }
.logo-option img { width: 50px; height: 50px; object-fit: contain; }
.logo-option input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }


/* === RESPONSIVE DESIGN === */

/* Tablets and below (max-width: 1080px) */
@media (max-width: 1080px) {
    .container { padding: 20px; }
    .stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
    .stat-card .value { font-size: 28px; }
    .section { padding: 20px; }
}

/* The bar itself holds on longer than the rest of the tablet layout: it now
   compresses down to 950px (see "Keep the nav inside the window" below), so the
   burger only takes over below that. Page padding still relaxes at 1080. */
@media (max-width: 949px) {
    /* Tablet nav — burger menu */
    .nav {
        padding: 0 12px;
        flex-wrap: wrap;
        align-items: flex-start;  /* top-align: keeps brand row 44px, menu below */
        min-height: 44px;
        overflow: visible;
        height: auto;
        /* Pin nav to viewport so it doesn't stretch with the 1024px body on narrow screens */
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        box-sizing: border-box;
        z-index: 500;
    }
    /* Compensate for fixed nav height so content isn't hidden underneath */
    body { padding-top: 44px; }
    /* Brand row height — nav-left and burger both 44px, flex-aligned */
    .nav-left { flex: 1; height: 44px; display: flex; align-items: center; }
    .nav-burger { height: 44px; align-items: center; justify-content: center; }
    .nav-left .nav-links,
    .nav-right,
    .nav-dropdown { display: none !important; }
    .nav-burger {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 501;
        height: 44px;
        width: 44px;
        padding: 0;
        flex-direction: column;
        gap: 5px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        background: none;
        border: none;
    }
    /* Push brand right so it doesn't sit under the burger */
    .nav-left .nav-brand { margin-left: 48px; }
    .nav-burger span {
        display: block;
        width: 22px;
        height: 2px;
        background: white;
        border-radius: 2px;
    }
    .nav-mobile-menu {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh;       /* dynamic vh — excludes mobile browser chrome */
        width: 280px;
        max-width: calc(100vw - 40px);
        flex-direction: column;
        background: var(--rail-bg, #023151);   /* OPTRICAL navy, like the bars */
        padding: 0;
        overflow: hidden;            /* drawer itself does NOT scroll */
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        z-index: 600;
        box-shadow: 4px 0 24px rgba(0,0,0,0.3);
        display: flex !important;
    }
    /* Inner scroll container — this is what actually scrolls on Android */
    .mob-scroll-body {
        flex: 1 1 auto;
        min-height: 0;        /* CRITICAL: lets a flex child shrink so overflow works */
        height: 0;            /* forces the child to take remaining space, not content height */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding-bottom: 24px;
    }
    .nav-mobile-menu.open { transform: translateX(0); }
    /* Overlay backdrop */
    #mob-backdrop {
        display: none;
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.08);
        z-index: 599;
    }
    #mob-backdrop.open { display: block; }
    /* Close button inside drawer */
    .mob-menu-close {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 14px;
        height: 44px;
        flex-shrink: 0;
        border-bottom: 1px solid rgba(255,255,255,0.12);
        font-size: 13px;
        font-weight: 600;
        color: rgba(255,255,255,0.7);
    }
    .mob-menu-close button {
        background: none; border: none; color: rgba(255,255,255,0.7);
        font-size: 20px; cursor: pointer; padding: 4px 6px;
        line-height: 1; width: fit-content;
    }
    .mob-menu-close button:hover { color: white; }
    /* Section heading labels */
    .mob-section-label {
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1.2px;
        color: rgba(255,255,255,0.45);
        padding: 12px 16px 4px;
        margin-top: 4px;
    }
    .mob-section-label:first-child { margin-top: 0; padding-top: 8px; }
    .mob-subsection-label {
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.6px;
        color: rgba(255,255,255,0.6);
        padding: 6px 16px 2px 28px;
    }
    /* Menu items — consistent left indent under section label */
    .mob-item {
        color: white !important;
        text-decoration: none;
        padding: 9px 16px 9px 28px;
        font-size: 14px;
        display: block;
        border-radius: 6px;
        margin: 0 8px;
    }
    .mob-item:hover { background: rgba(255,255,255,0.1); }
    /* A heading inside an open menu section (Plan & billing: Buy / Records). */
    .mob-sublabel { padding: 10px 24px 2px; font-size: 11px; font-weight: 700;
                    letter-spacing: .06em; text-transform: uppercase;
                    color: rgba(255,255,255,.55); }
    .mob-item-warning {
        color: #ffcc80 !important;
        border-left: 3px solid #ed8936;
        padding-left: 25px;
        margin-bottom: 4px;
    }
    .mob-item-help {
        margin-top: 8px;
        border-top: 1px solid rgba(255,255,255,0.12);
        padding-top: 13px;
    }
    /* Top-level links — same indent as section labels, visually prominent */
    .mob-top-link {
        display: block;
        color: rgba(255,255,255,0.75) !important;
        text-decoration: none;
        padding: 10px 16px;
        font-size: 13px;
        font-weight: 600;
        letter-spacing: 0.3px;
        border-top: 1px solid rgba(255,255,255,0.1);
        margin-top: 4px;
    }
    .mob-top-link:hover { color: white !important; background: rgba(255,255,255,0.08); }
    /* Fallback for any plain <a> not classed mob-item */
    .nav-mobile-menu > a {
        color: white;
        text-decoration: none;
        padding: 9px 16px;
        font-size: 14px;
        display: block;
    }
    .nav-mobile-menu > a:hover { background: rgba(255,255,255,0.1); }
}

/* Mobile devices (max-width: 768px) */
@media (max-width: 768px) {
    /* Nav at 768px — inherits from 1024px block; just override padding */
    .nav { padding: 0 12px; }
    .nav-left .nav-links,
    .nav-right,
    .nav-dropdown { display: none !important; }
    .nav-left { flex: 1; height: 44px; overflow: hidden; }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
    }
    .nav-links a {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .container, .container-small, .container-medium {
        padding: 15px;
    }
    
    .stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-card .value {
        font-size: 32px;
    }
    
    .section {
        padding: 20px;
    }
    
    .card {
        padding: 20px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    /* Make tables scrollable on mobile — scroll attaches to the
       immediate wrapper, never to the page body.
       .table-wrapper is the explicit class; the selectors below
       catch bare tables inside cards/sections that lack a wrapper. */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    /* Bare <table> inside common containers — make the container scroll.
       We do NOT change table display (breaks layout); instead we let the
       container scroll while the table keeps its natural min-width. */
    .card > table,
    .section > table,
    .container > table,
    .container-medium > table,
    .tab-content > table,
    .card > div > table,
    .section > div > table,
    .tab-content > div > table {
        min-width: 600px;
    }

    .card,
    .section,
    .tab-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    table {
        min-width: 600px;
    }
    
    th, td {
        padding: 10px;
        font-size: 13px;
    }
    
    /* Stack form inputs */
    .input-group {
        grid-template-columns: 1fr;
    }
    
    /* Stack buttons */
    .actions, .action-bar {
        /* flex-direction: column; ranjan */
    }
    
    .btn {
        width: fit-content; /* ranjan */
        text-align: center;
    }
    
    /* Tabs wrap rather than scroll -- see the base rule. */
    
    .tab-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Small mobile devices (max-width: 480px) */
@media (max-width: 480px) {
    .container, .container-small {
        padding: 10px;
    }
    
    .nav {
        padding: 0 10px;  /* no vertical padding — keeps nav at 44px */
    }
    
    .nav-brand {
        font-size: 18px;
    }
    
    .nav-links a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-card h3 {
        font-size: 12px;
    }
    
    .stat-card .value {
        font-size: 28px;
    }
    
    .section, .card {
        padding: 15px;
    }
    
    .btn:not(.btn-sm) {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    input, select, textarea {
        padding: 10px;
        font-size: 14px;
    }
    select { padding-top: 9px; padding-bottom: 9px; }
}

/* Print styles */
@media print {
    .nav, .actions, .action-bar, .btn {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .card, .section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* nav-brand defined in base nav rules above */

/* ── Nav icon link ─────────────────────────────────────────────────────────── */
.nav-icon-link {
    color: white !important;
    padding: 0 14px !important;
    font-size: 14px !important;   /* match all other nav-links a items */
    opacity: 1;
    transition: opacity 0.2s;
}
.nav-icon-link:hover { opacity: 1; background: rgba(255,255,255,0.15) !important; }

/* ── Masquerade badge ──────────────────────────────────────────────────────── */
.masquerade-badge {
    background: rgba(237,137,54,0.18);
    color: #fbd38d;
    padding: 4px 6px 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(237,137,54,0.4);
}
/* ✕ Stop — stands out as a distinct button */
.masquerade-badge a {
    color: white !important;
    background: #ed8936 !important;
    padding: 3px 8px !important;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}
.masquerade-badge a:hover { background: #c05621 !important; }

/* ── Dropdown nav ──────────────────────────────────────────────────────────── */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

/* One-click sign out at the far right of the nav. Muted until hovered so it
   does not compete with the working links, then red — it ends the session, and
   a control with consequences should say so before it is clicked. Sized to a
   comfortable tap target rather than to the glyph. */
.nav .nav-signout,
a.nav-signout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Full bar height and square, so it sits flush with the text menu items
       instead of floating as a shorter chip. Width follows height via aspect-ratio
       rather than a hardcoded px, so it stays square if the bar height changes. */
    align-self: stretch;
    height: auto;
    aspect-ratio: 1;
    /* padding must be zeroed for aspect-ratio to produce a square: the inherited
       `.nav a` rule adds 0 14px, and a 24px glyph plus 28px of padding measured
       47px wide against a 44px bar. */
    padding: 0;
    min-width: 44px;
    box-sizing: border-box;
    margin: 0 0 0 6px;
    border-radius: 0;
    /* Red at rest, not only on hover: on a blue nav the icon has to read as
       "this signs you out" before it is touched, and a muted glyph did not. */
    color: #fff;
    background: #e53e3e;
    /* Bigger and brighter: the glyph is the whole label, so at 16px it read as a
       decoration on a red square rather than as the control itself. Pure white on
       a slightly lifted red, with a faint glow so the stroke stays crisp against
       the fill instead of muddying into it. */
    font-size: 24px;
    line-height: 1;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255,255,255,0.55);
    text-decoration: none;
    transition: background 0.18s, color 0.18s, text-shadow 0.18s;
}
.nav .nav-signout:hover,
.nav .nav-signout:focus-visible {
    background: #f04747;
    color: #fff;
    text-shadow: 0 0 14px rgba(255,255,255,0.85);
}
.nav .nav-signout:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 1px;
}

.nav-dropdown-btn {
    /* Same size, weight, colour and box as a plain `.nav-links a`: these sit
       side by side in one bar and are the same kind of thing, but one was a
       500-weight 0.9-alpha button with 12px of padding on the left and none on
       the right, and the other a normal-weight 0.78-alpha link padded evenly.
       Dashboard read as dimmer and slightly adrift from Manage QR beside it. */
    color: rgba(255,255,255,0.78);
    background: transparent;
    border: none;
    border-radius: 0px;
    margin: 0;
    align-self: stretch;
    padding: 0 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    font-family: inherit;
    line-height: 1;
    transition: background 0.2s, color 0.15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    height: 44px;
    border-bottom: 2px solid transparent;
}
.nav-dropdown-btn:hover {
    /* 0.25 was twice as strong as the 0.1 a link hover uses, so moving along
       the bar made the buttons flash and the links barely respond. */
    background: rgba(255,255,255,0.1);
    color: white;
}
.nav-dropdown-btn.active {
    background: rgba(255,224,102,0.18);
    color: #ffe066;
    font-weight: 600;
}
.nav-dropdown-arrow { font-size: 10px; opacity: 0.8; }

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
    padding: 4px 0;
}
.nav-dropdown-menu.open { display: block; }

.nav-dropdown-menu a {
    display: block;
    padding: 9px 16px;
    color: #2d3748 !important;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.15s;
    white-space: nowrap;
    border-radius: 0;
}
button.mob-item[data-pgsize-open] { display: block; width: 100%; text-align: left; background: none;
                                   border: none; font: inherit; cursor: pointer; }
.nav-dropdown-menu a:hover {
    background: #f7fafc !important;
    color: #667eea !important;
}
.nav-dropdown-menu a.active {
    background: rgba(255,224,102,0.2) !important;
    color: #3b5bdb !important;
    font-weight: 600;
}
.nav-dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
}

/* === NESTED SUBMENU (Generate → QR Groups ▸ / Tools ▸) === */
/* The parent menu must let the flyout escape its box. */
.nav-dropdown-menu:has(.nav-submenu) { overflow: visible; }
.nav-submenu { position: relative; }
.nav-submenu-label {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 9px 16px; color: #2d3748; font-size: 13px; font-weight: 600;
    cursor: default; white-space: nowrap;
}
.nav-submenu-label:hover { background: #f7fafc; color: #667eea; }
.nav-submenu-label.active { color: #3b5bdb; }
/* Font-independent right-caret (CSS triangle) so it always renders. */
.nav-submenu-arrow {
    margin-left: auto;
    width: 0; height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 6px solid #667eea;
    flex: none;
}
.nav-submenu:hover > .nav-submenu-label .nav-submenu-arrow { border-left-color: #3b5bdb; }
.nav-submenu-menu {
    display: none;
    position: absolute; top: -4px; left: 100%;
    background: white; border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    min-width: 180px; padding: 4px 0; z-index: 1100;
}
/* Open the flyout on hover (desktop) or when JS marks it open (keyboard/touch). */
.nav-submenu:hover > .nav-submenu-menu,
.nav-submenu.open > .nav-submenu-menu { display: block; }

/* A nav entry the plan does not include. Muted rather than disabled, and it
   still LINKS -- to billing, which is where the route guard was sending people
   anyway, except now they can see why before they click. Not hidden: a tier
   nobody can see is a tier nobody buys. */
.nav-locked { opacity: .72; }
.nav-locked:hover { opacity: 1; }
.nav-submenu-menu a {
    display: block; padding: 9px 16px; color: #2d3748 !important;
    font-size: 13px; text-decoration: none; white-space: nowrap; transition: background 0.15s;
}
.nav-submenu-menu a:hover { background: #f7fafc !important; color: #667eea !important; }
.nav-submenu-menu a.active {
    background: rgba(255,224,102,0.2) !important; color: #3b5bdb !important; font-weight: 600;
}

/* === COLLAPSIBLE DISCLOSURE ARROW === */
.disclosure-arrow {
    display: inline-block;
    transition: transform .2s ease;
    flex-shrink: 0;
    line-height: 1;
}
details[open] > summary .disclosure-arrow { transform: rotate(90deg); }

/* === AUTH / LOGIN PAGE === */
/* The brand's navy (Optrical tokens) behind sign-in, MFA and registration;
   was the app's old purple. A platform that sets its own branding colours
   (System settings) still overrides it on the page. 2026-10-12. */
body.auth-page {
    background: linear-gradient(135deg, #023151 0%, #00243D 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
    margin: 20px; /* Safe padding for mobile */
}

.auth-page h1 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-size: 24px;
}

.link {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
}

.link a {
    color: #CF4A13;
    text-decoration: none;
}
.auth-page .btn-primary { background: #023151; border-color: #023151; color: #fff; }
.auth-page .btn-primary:hover { background: #0868AA; border-color: #0868AA; }

.link a:hover {
    text-decoration: underline;
}

.divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 20px 0;
}

/* Base.html missing alert type */
.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* The one thing people come here to do.
   It used to be the first entry inside a dropdown, which made the most frequent
   action in the product cost the same two clicks as the least frequent. A button
   rather than a link because it is an action, not a place -- and filled rather
   than ghosted so it reads as the primary affordance in a bar of plain links. */
.nav-cta {
    align-self: center;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 6px;
    color: #fff !important;
    font-weight: 600;
    padding: 5px 12px !important;
    margin: 0 4px 0 0;
    white-space: nowrap;
    line-height: 1.3;
}
.nav-cta:hover, .nav-cta.active {
    background: rgba(255,255,255,0.28);
    border-color: rgba(255,255,255,0.45);
}

/* ══ Icon rail ═══════════════════════════════════════════════════════════
   The client nav docks left as a rail instead of running along the top. Only
   the client nav: .nav-rail, never .nav, so the admin bar is untouched.

   Why: measured on the live bar, the eleven controls needed 1113px at a 1100px
   viewport and 1000px at 1000px. It was full. The stylesheet was already hiding
   the brand and dropping every label to 12px between 950 and 1080 to cope, and
   the next section to ship had nowhere to go. Vertical space is the one axis
   this product is not short of.

   Pinned open by default so nothing about discoverability regresses; the people
   who live in the wide tables collapse it and get 126px back. The choice is
   remembered per browser in localStorage.

   Below 950px none of this applies -- the existing fixed top bar and drawer
   take over untouched, which is why every rule here is inside the media query. */
:root { /* 224, not 186: the longest labels (Content & Catalogue, Manage
           Groups) wrapped onto two lines at 186 (user, 2026-10-13). */
        --railw: 224px; --railw-collapsed: 52px;
        /* The OPTRICAL navy (--c-navy in brand-tokens.css, the wordmark's
           colour; was a sampled #083150). Scoped to the client rail,
           so the admin bar keeps its own colour and the two surfaces stay
           telling-apart-able at a glance. */
        --rail-bg: #023151;
        /* The OPTRICAL orange (--c-orange), for the app bar and brand accents. */
        --brand-orange: #F26429; }

/* Both selectors on purpose: `body.client-page .nav` sets the old indigo at a
   higher specificity than `.nav.nav-rail` can reach, and not every client page
   carries that body class. */
.nav.nav-rail,
body.client-page .nav.nav-rail { background: var(--rail-bg); }

@media (min-width: 950px) {
  .nav.nav-rail {
    /* Starts under the app bar, whose left end is the rail's head. */
    position: fixed; top: 52px; left: 0; bottom: 0;
    width: var(--railw);
    height: auto;   /* the top-bar .nav sets a fixed height */
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 500;
    transition: width .13s ease;
  }
  html.rail-collapsed .nav.nav-rail { width: var(--railw-collapsed); }

  /* Content clears the rail. :has() covers the no-JS case (the rail is a direct
     child of body on every client page); the html class covers browsers where
     :has() is unavailable. Either alone is enough, and they agree. */
  html.has-rail body,
  body:has(> .nav.nav-rail) { padding-left: var(--railw); }
  html.rail-collapsed.has-rail body,
  html.rail-collapsed body:has(> .nav.nav-rail) { padding-left: var(--railw-collapsed); }

  .nav-rail .nav-left { flex-direction: column; align-items: stretch; flex: 0 0 auto; }
  .nav-rail .nav-left .nav-links { margin-left: 0 !important; flex-direction: column; align-items: stretch; }
  .nav-rail .nav-right { flex-direction: column; align-items: stretch; margin-top: auto; padding-bottom: 6px; }
  .nav-rail .nav-group-sep { display: none !important; }

  /* The brand moved into the app bar's head; the rail keeps it only for the
     top nav below 950px. */
  .nav-rail .nav-brand { display: none !important; }

  /* One row shape for every item in the rail, so the icons form a column and
     the labels form a column. Padding-left matches the brand's. */
  .nav-rail .nav-links > a,
  .nav-rail .nav-dropdown-btn,
  .nav-rail .nav-pin,
  .nav-rail .nav-signout {
    display: flex; align-items: center; gap: 11px;
    height: 38px; padding: 0 12px 0 18px;
    width: 100%; text-align: left; border-radius: 0;
    font-size: 13.5px; white-space: nowrap;
  }
  .nav-rail .nav-dropdown { display: block; }
  .nav-rail .nav-dropdown-arrow { display: none; }
  .nav-rail .nav-ic { width: 23px; height: 23px; flex: none; stroke: currentColor;
                      stroke-width: 1.7; fill: none; stroke-linecap: round;
                      stroke-linejoin: round; opacity: .92; }
  /* WRAPS, rather than being clipped at the rail's edge. text-overflow only
     ellipsises a single line, and there was no `white-space: nowrap` to make
     one -- so a label longer than the rail ("Content & Catalogue") simply ran
     under the edge and was cut, with no ellipsis to say so.
     Wrapping keeps the whole label readable and costs one taller row on the
     one item that needs it. `overflow-wrap: anywhere` so a single long word
     still cannot push the rail out. */
  /* `.nav a` sets white-space: nowrap for the horizontal top bar, where
     wrapping would break the row. In the RAIL the constraint is the opposite:
     a fixed width and as much height as an item needs. Without this override
     a label longer than the rail ("Content & Catalogue") stayed on one line
     and ran under the rail's edge -- clipped, with no ellipsis to admit it,
     because text-overflow only works on a line that cannot wrap.

     min-width: 0 matters as much: a flex child will not shrink below its own
     content width without it, so the text would have kept its 207px whatever
     the wrapping rules said. */
  /* On the LABEL, not on `.nav-rail a`. A rail item that owns a submenu --
     "Content & Catalogue" is one -- is a <button>, not an <a>, so a rule
     targeting the anchor never reached the item that actually overflowed.
     Setting it here overrides the inherited nowrap whatever the parent is. */
  .nav-rail .nav-tx { white-space: normal; min-width: 0;
                      overflow-wrap: anywhere; line-height: 1.25; }
  .nav-rail .nav-badge { margin-left: auto; }

  .nav-rail .nav-cta {
    margin: 8px 12px 10px; width: auto; height: 36px;
    padding-left: 12px; justify-content: flex-start; border-radius: 7px;
  }
  .nav-rail .nav-cta .nav-ic { stroke-width: 2.2; }
  /* An outline at rest: the filled chip read as "you are here" on every page,
     beside the item that really was current. Filled only on hover or when it
     is the current page. */
  .nav-rail .nav-cta { background: transparent; border-color: rgba(255,255,255,.3); }
  .nav-rail .nav-cta:hover, .nav-rail .nav-cta.active {
    background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.45); }

  /* Submenus open beside the rail, not beneath it. The coordinates are set in
     nav-dropdown.js because the rail scrolls and would otherwise clip them;
     these are the fallback for the first paint before that runs. */
  .nav-rail .nav-dropdown-menu { top: 0; left: 100%; margin-left: 4px; }
  .nav-rail .nav-dropdown-menu.open { max-height: 88vh; overflow-y: auto; }

  .nav-rail .nav-pin {
    background: none; border: none; color: rgba(255,255,255,.6);
    border-bottom: 1px solid rgba(255,255,255,.14);
    cursor: pointer; font: inherit; font-size: 12.5px;
  }
  .nav-rail .nav-pin:hover { color: #fff; background: rgba(255,255,255,.1); }
  .nav-rail .nav-pin .nav-ic { transition: transform .13s ease; }
  /* `.nav .nav-signout` is a 44px square filled red at rest -- deliberate, so a
     lone glyph on a blue bar reads as "this signs you out" before it is
     touched. Both halves of that break in a column: align-self:stretch plus
     aspect-ratio:1 makes a slab as tall as the rail is wide, and a full-width
     red band at the foot of the rail reads as an alarm rather than a control.
     The intent is kept and the weight moved into the ink. */
  .nav.nav-rail .nav-signout {
    aspect-ratio: auto; min-width: 0; align-self: auto;
    height: 38px; padding: 0 12px 0 18px; justify-content: flex-start;
    background: transparent; color: #ff9c94;
    font-size: 13.5px; font-weight: 400; text-shadow: none; margin: 0;
  }
  .nav.nav-rail .nav-signout:hover,
  .nav.nav-rail .nav-signout:focus-visible {
    background: #b3261e; color: #fff; text-shadow: none;
  }
  html.rail-collapsed .nav.nav-rail .nav-signout { padding: 0; justify-content: center; }

  /* The cart is an icon with no label, so nothing pulled it into the icon
     column and it sat centred while every row above it was left-aligned. */
  .nav.nav-rail .nav-links a.nav-cart {
    height: 38px; margin: 0; padding: 0 12px 0 18px;
    justify-content: flex-start; gap: 11px; border-radius: 0;
  }
  .nav.nav-rail .nav-links a.nav-cart svg { width: 20px; height: 20px; }
  html.rail-collapsed .nav.nav-rail .nav-links a.nav-cart { padding: 0; justify-content: center; }
  .nav-rail .nav-cart { margin: 0; justify-content: flex-start; }

  /* ── Collapsed ── labels out, icons centred, everything still reachable. */
  html.rail-collapsed .nav-rail .nav-tx,
  html.rail-collapsed .nav-rail .nav-brand span { display: none; }
  html.rail-collapsed .nav-rail .nav-links > a,
  html.rail-collapsed .nav-rail .nav-dropdown-btn,
  html.rail-collapsed .nav-rail .nav-pin,
  html.rail-collapsed .nav-rail .nav-signout { padding: 0; justify-content: center; }
  html.rail-collapsed .nav-rail .nav-cta { margin: 8px 7px 10px; justify-content: center; padding: 0; }
  html.rail-collapsed .nav-rail .nav-pin .nav-ic { transform: rotate(180deg); }
  /* The badge cannot sit beside a label that is gone, so it becomes a dot on
     the icon -- Inbox still has to be able to say something is waiting. */
  html.rail-collapsed .nav-rail .nav-badge {
    position: absolute; top: 5px; right: 9px; margin: 0;
    width: 8px; height: 8px; padding: 0; border-radius: 50%;
    overflow: hidden; text-indent: -99px; min-width: 0;
  }
  html.rail-collapsed .nav-rail .nav-dropdown-btn { position: relative; }
}

/* ══ App bar ═════════════════════════════════════════════════════════════
   Fills the band above the page title rather than adding to it. That band was
   76-106px of nothing on every page, with the floating help buttons sitting
   inside it, on top of the content. Holds where you are (breadcrumb, title) and
   the things that are not navigation and so do not belong in the rail. */
/* LIGHT, but not white. It was #fff on a #f5f5f5 page: a fixed bar whose edge
   you could not see, where the only sign it existed was content disappearing
   under it. A tint plus a firmer border and a soft shadow give it presence.
   
   Deliberately NOT the rail's navy. Two dark surfaces meeting at a corner read
   as one L-shaped border rather than as two things, and making the rail only
   SLIGHTLY lighter to separate them is worse: a small step between adjacent
   darks looks like a rendering artefact, not a decision. The rail is the app's
   anchor and keeps the colour; the bar carries a page title and account
   controls, so it stays subordinate to it. */
/* Two looks, chosen in Admin > Settings (client_appbar_style) and carried as
   a class on the bar. LIGHT is the base rules (a grey that keeps its colours); ORANGE, the default setting, overrides them. */
.appbar {
  --appbar-bg: #e4e7eb; --appbar-edge: #d0d5db; --appbar-ink: var(--color-text);
  --appbar-ctl: #4a5568; --appbar-hover: #d6dbe1;
  position: fixed; top: 0; left: 0; right: 0; height: 52px; z-index: 490;
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  background: var(--appbar-bg); border-bottom: 1px solid var(--appbar-edge);
  box-shadow: 0 1px 3px rgba(16, 32, 64, .07);
  box-sizing: border-box;
}
/* ORANGE: the OPTRICAL orange (optrical tokens.css --c-orange). White on it
   is 3.2:1 and fails for body-size text, so its ink is near-black (5.2:1). */
.appbar.appbar--orange {
  --appbar-bg: var(--brand-orange); --appbar-edge: #CF4A13; --appbar-ink: #1a202c;
  --appbar-ctl: #1a202c; --appbar-hover: rgba(0, 0, 0, .1);
  box-shadow: 0 1px 3px rgba(16, 32, 64, .12);
}
.appbar-l { display: flex; flex-direction: column; justify-content: center;
            min-width: 0; margin-right: auto; }
/* Two classes (0,2,0) rather than one, so the broad page-heading rule
       div > h1:first-of-type { color: var(--color-text) }
   at (0,1,2) does not decide the title's colour by accident. It happens to want
   the same colour on a light bar, which is exactly why this was invisible until
   the bar went dark for an afternoon. */
.appbar .appbar-title { margin: 0; font-size: 18px; font-weight: 700;
                color: var(--appbar-ink);
                line-height: 1.25; white-space: nowrap; overflow: hidden;
                text-overflow: ellipsis; }
.appbar-l nav[aria-label="Breadcrumb"] { margin: 0 0 1px !important; font-size: 11.5px !important; }
/* The breadcrumb macro colours its links inline for a light page. On orange,
   and on a darkened grey (appbar--inked), those indigo links fail, so they
   take the bar's ink. */
.appbar--inked .appbar-l nav[aria-label="Breadcrumb"] { color: rgba(26, 32, 44, .7) !important; }
.appbar--inked .appbar-l nav[aria-label="Breadcrumb"] a,
.appbar--inked .appbar-l nav[aria-label="Breadcrumb"] span { color: var(--appbar-ink) !important; }
.appbar--inked .appbar-l nav[aria-label="Breadcrumb"] a:hover { text-decoration: underline !important; }
.appbar-r { display: flex; align-items: center; gap: 2px; flex: none; }

/* These controls were styled for a dark nav; the bar is light. */
.appbar .nav-dropdown { display: inline-block; }
.appbar .nav-dropdown-btn {
  height: 34px; padding: 0 10px; border-radius: 6px; gap: 7px;
  color: var(--appbar-ctl); background: none; border: none; font-size: 13px;
  display: inline-flex; align-items: center; cursor: pointer; white-space: nowrap;
}
.appbar .nav-dropdown-btn:hover { background: var(--appbar-hover); color: #1a202c; }
.appbar .nav-dropdown-btn .nav-ic { width: 18px; height: 18px; stroke: currentColor;
  stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.appbar .nav-dropdown-menu { top: calc(100% + 4px); left: auto; right: 0; }
/* On a short window (a laptop at high Windows scaling is ~400px tall) the Plan
   & billing menu ran past the bottom with no way to reach its last items. It
   scrolls inside itself instead: 52px bar + 4px gap + 8px margin below. */
.appbar .nav-dropdown-menu.open { max-height: calc(100vh - 64px); overflow-y: auto;
                                  overscroll-behavior: contain; }

/* A menu's parent stays marked while the menu is open, so it is plain which
   item the menu belongs to. Hover alone cannot do it: the pointer leaves the
   parent to reach the menu. A bar on the side the menu opens from: left in the
   rail, underneath in the admin bar. */
.nav-dropdown:has(> .nav-dropdown-menu.open) > .nav-dropdown-btn {
    background: rgba(255,255,255,.18);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 0 -3px 0 var(--brand-orange, #F26429);
}
.nav-rail .nav-dropdown:has(> .nav-dropdown-menu.open) > .nav-dropdown-btn {
    box-shadow: inset 3px 0 0 var(--brand-orange, #F26429);
}
.appbar .nav-dropdown:has(> .nav-dropdown-menu.open) > .nav-dropdown-btn {
    background: var(--appbar-hover);
    color: #1a202c;
    box-shadow: inset 0 -3px 0 currentColor;
}
.nav-submenu:hover > .nav-submenu-label,
.nav-submenu.open > .nav-submenu-label { background: #eef2ff; color: #3b5bdb; }
.appbar a.nav-cart {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 6px; color: var(--appbar-ctl); position: relative;
}
.appbar a.nav-cart:hover { background: var(--appbar-hover); color: #1a202c; }
.appbar a.nav-cart svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.appbar .masquerade-badge { margin-right: 6px; }
/* The admin bar's red sign-out square, flush with the bar's right edge and
   full bar height. Below 950px .appbar-r is hidden; the drawer has Logout. */
.appbar .appbar-signout { align-self: stretch; margin: 0 -22px 0 8px; min-width: 52px; }

/* The icon sprite is a real element in the flow. width/height 0 is not enough:
   an inline box still generates a line box, which pushed every page down by a
   line-height before the container even started. Taken out of flow instead of
   display:none, which breaks <use> references in some browsers. */
.nav-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Folder filter on the scan content library. Chips rather than a select: the
   whole set is visible at once, each carries its own count, and the state is a
   link, so a filtered view can be bookmarked. */
.rec-folders { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.rec-folder {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 14px; font-size: 12.5px;
  border: 1px solid #e2e8f0; background: #fff; color: #4a5568; text-decoration: none;
}
.rec-folder:hover { border-color: #cbd5e0; color: #2d3748; }
.rec-folder.on { background: #ebf0ff; border-color: #a9bcf5; color: #2b45a8; font-weight: 600; }
.rec-folder .n { font-size: 11px; color: #5f6b7a; font-variant-numeric: tabular-nums; }
.rec-folder.on .n { color: #5a72c9; }

/* ── Typed image field on a scan content record ───────────────────────────
   A strip of thumbnails, not a file list: what the field holds is pictures,
   and a row of filenames tells you nothing about whether the right one is
   attached. Order is left to right and is the order the scan renders. */
.uc-img-strip { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 0; }
.uc-img-strip:empty { display: none; }
.uc-img-cell {
  position: relative; margin: 0; width: 104px; height: 104px; border-radius: 8px;
  overflow: hidden; border: 1px solid #e2e8f0; background: #f7fafc; flex: none;
}
.uc-img-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.uc-img-cell-bar {
  position: absolute; inset: auto 0 0 0; display: flex; justify-content: flex-end;
  gap: 2px; padding: 3px; background: linear-gradient(transparent, rgba(0,0,0,.55));
}
.uc-img-cell-btn {
  width: 22px; height: 22px; border: none; border-radius: 4px; cursor: pointer;
  background: rgba(255,255,255,.85); color: #2d3748; font-size: 12px; line-height: 1;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.uc-img-cell-btn:hover { background: #fff; }
.uc-img-cell-btn:focus-visible { outline: 2px solid #3b5bdb; outline-offset: 1px; }
/* One uploaded file, named. A chip rather than a thumbnail strip: what tells
   somebody they picked the right document is its filename, not a preview of
   page one. */
.uc-file-chip { display: inline-flex; align-items: center; gap: 9px;
    border: 1px solid #e2e8f0; border-radius: 9px; padding: 7px 10px;
    background: #f7fafc; font-size: 13px; max-width: 100%; }
.uc-file-chip .uc-file-name { overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; }
.uc-file-chip .uc-file-size { color: #5f6b7a; font-size: 11.5px; flex: none; }
.uc-file-chip button { border: 0; background: none; color: #c53030; cursor: pointer;
    font-size: 15px; line-height: 1; padding: 0 2px; flex: none; }
.uc-img-controls { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.uc-img-add, .uc-img-pick {
  font-size: 13px; padding: 5px 11px; border-radius: 6px; cursor: pointer;
  border: 1px solid #cbd5e0; background: #fff; color: #2d3748;
}
.uc-img-add:hover:not(:disabled), .uc-img-pick:hover:not(:disabled) { border-color: #3b5bdb; color: #3b5bdb; }
.uc-img-add:disabled, .uc-img-pick:disabled { opacity: .5; cursor: not-allowed; }
.uc-img-count { font-size: 12px; color: #5f6b7a; font-variant-numeric: tabular-nums; }
.uc-img-note { font-size: 12px; color: #3a7368; margin: 6px 0 0; }
.uc-img-note[hidden] { display: none; }

/* Collapsed drawer sections. Every section was expanded, so the menu ran to
   several screens and the thing you wanted was rarely on the first one.

   The header is now a control, not a divider, so it is styled as one. It used
   to be a 10px uppercase whisper at 45% white -- correct for a passive label
   above a list you could already see, and wrong for the thing you have to
   press to see anything at all. */
.mob-group { border: none; margin: 3px 0; }
.mob-group > summary.mob-section-label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  cursor: pointer; list-style: none; user-select: none;
  margin: 0 8px; padding: 10px 12px; border-radius: 7px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
  font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  transition: background .12s ease;
}
.mob-group > summary.mob-section-label::-webkit-details-marker { display: none; }
.mob-group > summary.mob-section-label:hover { background: rgba(255,255,255,.15); }
.mob-group > summary.mob-section-label:focus-visible {
  outline: 2px solid var(--brand-orange); outline-offset: 1px;
}
/* Open reads as open without waiting for the caret: the accent bar is the
   OPTRICAL orange, so the drawer's one highlight matches the wordmark. */
.mob-group[open] > summary.mob-section-label {
  background: rgba(255,255,255,.16); color: #fff;
  border-left: 3px solid var(--brand-orange); padding-left: 9px;
  border-radius: 7px 7px 0 0;
}
.mob-caret { font-size: 15px; opacity: .7; transition: transform .13s ease;
             transform: rotate(90deg); line-height: 1; flex: none; }
.mob-group[open] > summary .mob-caret { transform: rotate(-90deg); }
/* The children read as belonging to the header above them. */
.mob-group[open] > .mob-item,
.mob-group[open] > a.mob-item {
  background: rgba(255,255,255,.04); margin: 0 8px; border-radius: 0;
}
.mob-group[open] > a.mob-item:last-child { border-radius: 0 0 7px 7px; padding-bottom: 11px; }
.mob-group .mob-item { padding-left: 26px; }

/* The bar already separates itself from the content; 30px on top of that read
   as a gap nobody had put there. Sibling selector rather than :has, since the
   container always follows the bar. */
.appbar ~ .container,
.appbar ~ .container-medium,
.appbar ~ .container-small { padding-top: 14px; }

/* Docked help: the same buttons, no longer floating over the page they help
   with. Fixed positioning is dropped so the bar's flex row places them. */
.appbar-help { display: flex; align-items: center; }
#fab-stack.docked { position: static; top: auto; right: auto; transition: none; }
#fab-stack.docked #help-fab { width: 30px; height: 30px; font-size: 17px; box-shadow: none; }
/* What next was left out of the dock sizing when the other two were added, so
   it kept its floating 38px beside a 30px '?': a near-miss reads as a
   rendering fault rather than as a hierarchy. (It matched the Guide me pill,
   removed 2026-10-24.)
   The 19px radius needs no override: on a 30px box the browser clamps it to
   half the height, so it stays a pill. */
#fab-stack.docked #what-next-fab { height: 30px; padding: 0 11px; font-size: 12.5px; box-shadow: none; }
.appbar-help + .appbar-r { margin-left: 6px; }

/* ── Page size (app bar; shared/_page_size.html, static/js/page-size.js) ──
   One button on every page, beside Help and Search: − / Fit / + over the app's
   own scale, and Layout tips. A dot when this page measures cramped. */
.pgsize { position: relative; flex: none; margin-left: 6px; }
.pgsize-toggle { position: relative; display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border: none; border-radius: 15px; cursor: pointer;
  background: #fff; color: var(--appbar-ink, #1a202c); box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
  transition: background .15s, transform .1s; }
.pgsize-toggle:hover, .pgsize.is-open .pgsize-toggle { background: #fff1e9; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.pgsize-toggle:active { transform: scale(.94); }
.pgsize-toggle:focus-visible { outline: 2px solid #3b5bdb; outline-offset: 2px; }
.pgsize-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.pgsize-dot { display: none; position: absolute; top: -1px; right: -1px; width: 9px; height: 9px;
  border-radius: 50%; background: #dd6b20; box-shadow: 0 0 0 2px #fff; }
.pgsize.has-issue .pgsize-dot { display: block; }
.pgsize-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 650; width: 270px;
  background: #fff; color: #2d3748; border: 1px solid #e2e8f0; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(16, 32, 64, .18); padding: 12px 14px; font-size: 13px; text-align: left; }
.pgsize-panel[hidden] { display: none; }
.pgsize.is-float .pgsize-panel { position: fixed; top: 52px; right: 10px; }
.pgsize-row { display: flex; align-items: center; gap: 6px; }
.pgsize-label { font-weight: 700; margin-right: auto; }
.pgsize-btn { min-width: 34px; height: 30px; padding: 0 8px; border: 1px solid #cbd5e0; border-radius: 6px;
  background: #fff; color: #2d3748; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.pgsize-btn:hover:not(:disabled) { border-color: #667eea; color: #3b5bdb; }
.pgsize-btn:disabled, .pgsize-pct:disabled { opacity: .45; cursor: default; }
.pgsize-fit { font-size: 13px; }
.pgsize-fit[aria-pressed="true"],
.pgsize-fit[aria-pressed="true"]:hover:not(:disabled) { background: #667eea; border-color: #667eea; color: #fff; }
.pgsize-fit[aria-pressed="true"]:hover:not(:disabled) { background: #5a67d8; border-color: #5a67d8; }
.pgsize-pct { min-width: 46px; height: 30px; border: none; background: none; color: #3b5bdb; font: inherit;
  font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; }
.pgsize-hint { margin: 8px 0 6px; color: #3a7368; font-size: 12px; line-height: 1.45; }
.pgsize-tips { display: block; width: 100%; margin-top: 2px; padding: 7px 0 0; border: none;
  border-top: 1px solid #edf2f7; background: none; color: #3b5bdb; font: inherit; font-size: 13px;
  text-align: left; cursor: pointer; }
.pgsize-tips:hover { text-decoration: underline; }
/* The admin bar is navy: the button sits on it like the bar's own controls. */
.nav-right > .pgsize { align-self: center; margin: 0 6px 0 0; }

/* ── Search (app bar) ── the lens opens the whole search form
   (client/_search_form.html) as a dropdown below the bar (2026-10-27). */
.appbar-find { position: relative; flex: none; margin-left: 4px; }
/* A solid round button, not a decoration (user, 2026-10-26: the lens "does not
   look like a button to click"). */
.appbar-find-toggle { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  padding: 0; border: none; border-radius: 15px; background: #1a202c; color: #fff; cursor: pointer;
  transition: background .15s, transform .1s; }
.appbar-find-toggle:hover, .appbar-find.is-open .appbar-find-toggle { background: #3a7368; }
.appbar-find-toggle:active { transform: scale(.94); }
.appbar-find-toggle:focus-visible { outline: 2px solid #3a7368; outline-offset: 2px; }
.appbar-find-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.appbar-find-panel { position: absolute; top: calc(100% + 8px); right: 0; width: min(640px, calc(100vw - 24px));
  max-height: calc(100vh - 110px); overflow: auto; background: #fff; border: 1px solid #e2e8f0;
  border-radius: 10px; box-shadow: 0 10px 30px rgba(16, 32, 64, .18); z-index: 600; padding: 14px 16px; }
.appbar-find-panel[hidden] { display: none; }
.appbar-find-note { padding: 8px 2px; font-size: 13px; color: #5f6b7a; }

/* ── Group page: Traceability panel (manage_batch.html) ── */
.grp-trace { margin: 12px 0 14px; padding: 10px 14px; background: #fff; border: 1px solid #e2e8f0;
  border-radius: 10px; max-width: 900px; }
.grp-trace-h { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: #5f6b7a; font-weight: 700; background: none; padding: 0; }
.grp-trace-rows { margin: 0; }
.grp-trace-row { display: flex; gap: 12px; padding: 5px 0; border-top: 1px solid #f1f5f9; font-size: 13px; }
.grp-trace-row:first-child { border-top: none; }
.grp-trace-row dt { flex: 0 0 110px; color: #5f6b7a; display: flex; align-items: center; gap: 4px; }
.grp-trace-row dd { margin: 0; color: #2d3748; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.grp-trace-row.is-locked dt, .grp-trace-row.is-locked dd { color: #5f6b7a; }
.grp-trace-row svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }

/* A code's Packing & custody (client/_code_trace.html, utils/code_trace.py). */
.ct-kind { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
    background: #e6f2ef; color: #285e55; border: 1px solid #cfe5df; }
.ct-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; font-size: 13.5px; }
.ct-explore { margin-left: 12px; font-size: 12.5px; font-weight: 600; }
/* A module's facts under a QR group's name in the list (page_sockets.group_facts). */
.grp-facts { font-size: 12px; color: #5f6b7a; margin-top: 3px; }
.ct-facts > div { display: contents; }
.ct-facts dt { color: #5f6b7a; font-weight: 600; }
.ct-facts dd { margin: 0; color: #2d3748; }
.ct-code { font-family: monospace; font-size: 13px; }
.ct-sub { color: #5f6b7a; font-size: 12px; }
.ct-moves { width: 100%; font-size: 13px; }
.ct-moves svg { width: 13px; height: 13px; vertical-align: -2px; fill: none; stroke: currentColor; stroke-width: 2; }
.ct-result { font-weight: 600; }
.ct-result.is-ok { color: #276749; }
.ct-result.is-wait { color: #975a16; }
.ct-result.is-warn { color: #c05621; }
.ct-result.is-bad { color: #c53030; }
@media (max-width: 560px) { .ct-facts { grid-template-columns: 1fr; } .ct-facts dt { margin-top: 4px; } }

/* Traceability > Custody narrowed to one group (?group=N). */
.tr-filter { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 10px;
  padding: 8px 12px; background: #f7fafc; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; }

/* ── Search page and the app bar's dropdown (client/_search_form.html,
   utils/search.py) ── */
.srch-form { max-width: 820px; margin: 4px 0 14px; }
.srch-bar { display: flex; gap: 8px; }
.srch-bar input[type="search"] { flex: 1 1 auto; min-width: 0; height: 38px; padding: 0 12px;
  border: 1px solid #cbd5e0; border-radius: 8px; font-size: 14px; }
.srch-help { color: #3a7368; font-size: 13px; margin: 6px 0 10px; }
.srch-legend { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: #5f6b7a; padding: 0; margin: 0 0 6px; }
/* The kind is one choice: radio buttons drawn as a row of pills. */
.srch-bar .btn { white-space: nowrap; }
.srch-opts { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; font-size: 13px; color: #5f6b7a; }
.srch-opts[hidden], .srch-help[hidden] { display: none; }
.srch-row mark { background: #fef08a; color: inherit; padding: 0 1px; border-radius: 2px; }
.srch-in { flex: 0 0 auto; width: 180px; height: 34px; margin: 0; }
@media (max-width: 560px) {
  .srch-bar { flex-wrap: wrap; }
  .srch-bar input[type="search"] { flex-basis: 100%; }
  .srch-bar .btn { flex: 1 1 0; }
  .srch-in { flex: 1 1 auto; width: auto; }
}
.srch-locked { font-size: 12.5px; color: #5f6b7a; margin: 0 0 10px; }
.srch-locked a { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; color: #5f6b7a; }
.srch-locked svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; }
.srch-filters { margin: 0 0 6px; }
.srch-filters summary { cursor: pointer; list-style: revert; }
.srch-on { margin-left: 4px; color: #3a7368; text-transform: none; letter-spacing: 0; }
.srch-filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 12px;
  margin: 4px 0 8px; }
.srch-filter { display: flex; flex-direction: column; gap: 3px; margin: 0; }
.srch-filter[hidden], .srch-filters[hidden] { display: none; }
.srch-filter-l { font-size: 12.5px; color: #4a5568; font-weight: 600; }
.srch-filter .form-control { height: 34px; font-size: 13px; padding: 0 8px; }
.srch-filters [data-search-reset] { border: 0; background: none; padding: 0; cursor: pointer; }
.srch-error { color: #b42318; font-size: 13px; margin: 4px 0 0; }
.srch-error[hidden] { display: none; }
.srch-more { color: #3a7368; font-size: 13px; margin: 0 0 8px; }
.is-dropdown.srch-form { margin: 0; max-width: none; }
.srch-sec { margin: 0 0 18px; }
.srch-sec-h { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: #5f6b7a;
  margin: 0 0 8px; font-weight: 700; }
.srch-n { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 9px;
  background: #edf2f7; color: #4a5568; font-size: 11px; text-align: center; letter-spacing: 0; }
.srch-note, .srch-empty { color: #5f6b7a; font-size: 13.5px; padding: 10px 0; }
.srch-row { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 14px;
  margin: 0 0 8px; }
.srch-row-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.srch-title { font-weight: 700; color: #1a202c; font-size: 14.5px; }
.srch-title.is-code { font-family: monospace; color: #2b6cb0; text-decoration: none; }
.srch-title.is-code:hover { text-decoration: underline; }
.srch-sub { color: #5f6b7a; font-size: 12.5px; }
.srch-facts { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 6px 0 0; }
.srch-facts > div { display: flex; gap: 5px; font-size: 12.5px; }
.srch-facts dt { color: #5f6b7a; }
.srch-facts dd { margin: 0; color: #2d3748; font-weight: 600; }
.srch-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; }
@media (max-width: 949px) {
  .appbar-find-panel { position: fixed; top: 92px; left: 10px; right: 10px; width: auto; }
}
/* Docked on the orange bar, the three coloured pills (indigo, green, teal)
   clashed with it and each other. White pills with dark ink read as one set
   and stand off the orange. */
.appbar--orange #fab-stack.docked #what-next-fab,
.appbar--orange #fab-stack.docked #help-fab { background: #fff; color: var(--appbar-ink);
                                             box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.appbar--orange #fab-stack.docked #what-next-fab:hover,
.appbar--orange #fab-stack.docked #help-fab:hover { background: #fff1e9; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }

/* Collapsed rail: the item's name beside it on hover or keyboard focus. One
   fixed element placed by nav-dropdown.js -- a label inside the rail would be
   clipped by the rail's own overflow. */
.rail-tip {
  position: fixed; z-index: 9200; pointer-events: none;
  padding: 5px 10px; border-radius: 6px; white-space: nowrap;
  background: #1a202c; color: #fff; font-size: 12.5px; font-weight: 600;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .25); transform: translateY(-50%);
}
.rail-tip[hidden] { display: none; }

/* The rail's head, at the left of the bar: rail-wide, rail-coloured, and
   narrowing with it. Desktop only. */
.appbar-brand { display: none; }
@media (min-width: 950px) {
  .appbar { padding-left: 0; }
  .appbar-brand {
    display: flex; align-items: center; gap: 10px; flex: none;
    align-self: stretch; margin: 0 8px -1px 0; padding: 0 12px 0 14px;
    width: var(--railw); box-sizing: border-box; overflow: hidden;
    background: var(--rail-bg); transition: width .13s ease, padding .13s ease;
    /* The divider between the brand and the rail below it, on the same line
       as the bar's own bottom border: the -1px margin above makes the block
       end exactly where the bar does, so an inset line lands on that border. */
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .22);
  }
  /* Collapsed, the block stops matching the rail and fits the burger plus the
     tenant name instead (up to 300px, room the collapsed rail frees): the rail starts
     collapsed, and a bar that never says whose account it is was the cost.
     The 10px inset centres the 32px burger over the 52px rail. */
  html.rail-collapsed .appbar-brand {
    width: auto; min-width: var(--railw-collapsed); max-width: 300px;
    padding-left: 10px;
  }
  .appbar-burger {
    flex: none; width: 32px; height: 32px; padding: 0 7px; border: none;
    border-radius: 6px; background: none; cursor: pointer;
    display: flex; flex-direction: column; justify-content: center; gap: 4px;
  }
  .appbar-burger span { display: block; height: 2px; border-radius: 1px;
                        background: rgba(255,255,255,.85); }
  .appbar-burger:hover { background: rgba(255,255,255,.12); }
  .appbar-burger:hover span { background: #fff; }
  .appbar-home {
    display: flex; align-items: center; gap: 8px; min-width: 0;
    color: #fff; text-decoration: none; font-size: 14px; font-weight: 700;
  }
  .appbar-home img { max-height: 28px; max-width: 64px; width: auto;
                     object-fit: contain; display: block; flex: none; }
  .appbar-home span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Stop masquerading, beside the account name (platform staff only). */
  .appbar-stop-masq {
    flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 3px;
    padding: 4px 9px; border-radius: 5px; background: #ed8936; color: #fff; text-decoration: none;
    font-size: 12px; font-weight: 700; white-space: nowrap; transition: background .15s;
  }
  .appbar-stop-masq:hover, .appbar-stop-masq:focus-visible { background: #c05621; color: #fff; }
  .appbar-stop-masq .nav-ic { width: 13px; height: 13px; stroke-width: 2.4; }
  html.has-rail body,
  body:has(> .nav.nav-rail) { padding-top: 52px; }
}

@media (max-width: 949px) { .nav-rail .nav-pin { display: none; } }

/* Below 950 the bar sits under the 44px top nav and carries the title and the
   help buttons -- the drawer already holds Top-Ups, the cart and the account
   menu. The buttons used to float here, and landed on the breadcrumb; docked,
   the title gives way (it ellipsises) rather than the buttons. */
@media (max-width: 949px) {
  .appbar { top: 44px; height: 44px; padding: 0 10px 0 14px; gap: 8px; }
  .appbar-r { display: none; }
  .appbar-help { flex: none; }
  .appbar-title { font-size: 16px; }
  html.has-rail body { padding-top: 88px !important; }
}

/* Nav group separator */
.nav-group-sep {
    width:0; align-self:stretch; margin:0 10px;
    border-left:1px solid rgba(255,255,255,0.22);
    flex-shrink:0; pointer-events:none;
}
@media (max-width:1080px) { .nav-group-sep { display:none !important; } }



/* ── Help + "What next": one stack ───────────────────────────────────────────
   The container is the only thing pinned to the viewport. The buttons inside
   are in normal flow, so their spacing is a gap rather than a pair of top
   coordinates in two different files that had to be kept 46px apart by hand. */
#fab-stack {
    position: fixed; right: 14px; top: 52px;
    z-index: 9100;
    /* One row, and row-REVERSE: the DOM order is help then "What next" (the
       nav macro's button is appended into this container), while on screen the
       round help button stays hard against the right edge where it has always
       lived, with the wider pill to its left. */
    display: flex; flex-direction: row-reverse; align-items: center; gap: 8px;
    transition: top .15s;
}
#fab-stack.scrolled-down { top: 8px; }

/* Help button — top of the stack */
#help-fab {
    position:static;
    width:38px; height:38px; border-radius:50%;
    background:#38b2ac; color:#fff;
    display:flex; align-items:center; justify-content:center;
    font-size:18px; font-weight:700; text-decoration:none;
    box-shadow:0 3px 12px rgba(56,178,172,0.45); z-index:9100;
    transition:background 0.15s, box-shadow 0.15s;
}
#help-fab:hover { background:#2c9491; box-shadow:0 4px 16px rgba(56,178,172,0.6); }

/* The compass was an emoji (🧭), so it was drawn by the visitor's OS font and
   the brand had no say in it -- the same fault the public pages were fixed for.
   It is now macros/public_icons.html's `compass`, and its rules live HERE rather
   than in icons.css because app pages do not load that file. Scoped to
   #what-next-fab (the Guide me pill it was written for was removed 2026-10-24).

   MONOCHROME, NOT THE THREE-COLOUR GRAMMAR. icons.css paints .ic-k navy and
   .ic-a orange, and both need a light ground -- public.css states the rule at
   --accent. This pill is solid #2f855a with white text, where navy would be
   nearly illegible and orange would fight the green. So the role classes are
   overridden to currentColor and the icon inherits the label's white, which is
   also what makes it follow the pill on :hover without a second rule.

   Sized in em so it tracks the label: the pill is 13px normally and 12.5px when
   #fab-stack.docked shrinks it to 30px, and one value covers both. Below 640px
   the <span> is hidden and this icon becomes the ENTIRE button, so it has to
   carry the meaning on its own -- which is why it is a compass rose with a
   filled needle rather than a thin outline. */
/* What next's bulb is drawn the same way, so the pair reads as one set. */
#what-next-fab .guide-ic { width: 1.25em; height: 1.25em; flex: none; }
#what-next-fab .guide-ic .ic-k,
#what-next-fab .guide-ic .ic-a,
#what-next-fab .guide-ic .ic-s {
                             fill: none; stroke: currentColor; stroke-width: 1.8;
                             stroke-linecap: round; stroke-linejoin: round; }
#what-next-fab .guide-ic .ic-af,
#what-next-fab .guide-ic .ic-sf { fill: currentColor; stroke: none; }

/* Layout note (static/js/layout-watch.js): once a session, when the window --
   usually display scaling -- is too small for the page. Bottom-left, clear of
   the scroll and help buttons on the right. */
.layout-note {
    position:fixed; left:16px; bottom:16px; z-index:9150;
    width:min(420px, calc(100vw - 32px)); box-sizing:border-box;
    background:#fff; color:#2d3748; border:1px solid #cbd5e0; border-left:4px solid #667eea;
    border-radius:10px; padding:12px 14px 10px; font-size:13px; line-height:1.5;
    box-shadow:0 6px 20px rgba(0,0,0,0.18);
}
.layout-note-title { font-weight:700; font-size:14px; margin:0 0 4px; }
.layout-note p { margin:0 0 6px; }
.layout-note .layout-note-lead { font-weight:600; margin:0 0 2px; }
.layout-note ul { margin:0 0 8px; padding-left:18px; }
.layout-note li { margin:0 0 2px; }
.layout-note .layout-note-where { color: #3a7368; font-size: 12px; margin: 0 0 8px; }
.layout-note-actions { display:flex; justify-content:flex-end; align-items:center; gap:12px; }
.layout-note-never { background:none; border:none; padding:0; color:#5f6b7a; font-size:12px;
                     text-decoration:underline; cursor:pointer; }

/* Scroll FAB: bottom right, as on the marketing site (2026-11-03). It sat
   halfway down the right edge while it also offered "scroll to bottom"; it is
   scroll-to-top only now, and the corner is where that is looked for. */
#scroll-fab {
    position:fixed; right:14px; bottom:24px;
    width:42px; height:42px; border-radius:50%;
    /* Solid rather than 92% opaque: the arrow was competing with whatever
       happened to be behind it. */
    /* Navy, the rail's colour: orange matched the app bar in its orange style,
       and a grey would vanish on the light one. */
    background:var(--rail-bg, #023151); color:#fff;
    display:flex; align-items:center; justify-content:center;
    cursor:pointer; border:none;
    box-shadow:0 3px 10px rgba(0,0,0,0.22); z-index:8900;
    opacity:0; transition:opacity 0.2s, box-shadow 0.15s; pointer-events:none; padding:0; line-height:1;
}
/* The arrowhead is drawn, not typed. As a ▲/▼ glyph it sat visibly low in the
   circle: a triangle's ink fills only part of its em box, and flex centres the
   box, not the ink -- so the optical centre ended up below the geometric one
   and no amount of line-height fixed it across fonts. A border triangle is a
   real box exactly the size of the shape, so centring it centres what you see.
   One element, rotated for the other direction. */
#scroll-fab .sf-arrow {
    width:0; height:0;
    border-left:9px solid transparent;
    border-right:9px solid transparent;
    border-bottom:12px solid #fff;
    filter:drop-shadow(0 1px 1px rgba(0,0,0,.25));
    /* A triangle looks bottom-heavy when its bounding box is centred, because
       the visual mass sits low. One pixel up puts the apparent centre right. */
    margin-top:-1px;
}
#scroll-fab.is-down .sf-arrow { transform:rotate(180deg); margin-top:1px; }
#scroll-fab.visible { opacity:1; pointer-events:auto; }
#scroll-fab:hover { background:#0a4570; box-shadow:0 4px 16px rgba(0,0,0,0.3); }
@media (max-width:1080px) { #scroll-fab { right:6px; } #fab-stack { right:10px; } }
/* Phones: not at all. Halfway down the right edge it sat on figures, table
   cells and form fields on every page; moved to the bottom corner it sat on
   the right-aligned Add / Edit buttons instead. A phone scrolls with a flick,
   so the button is in the way and adds little. */
@media (max-width:640px) {
    #scroll-fab { display:none !important; }
}


/* === HELP FAB HEARTBEAT (new accounts) === */
@keyframes gs-heartbeat {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,215,0,0); opacity:1; }
    40%       { box-shadow: 0 0 0 6px rgba(255,215,0,0.35); opacity:1; }
    50%       { box-shadow: 0 0 0 10px rgba(255,215,0,0); opacity:0.75; }
}
#help-fab.heartbeat {
    animation: gs-heartbeat 4s ease-in-out infinite;
    background: #2c9491;
    border: 2px solid rgba(255,215,0,0.6);
}


/* === GLOBAL MODAL OVERLAY ===
   Light veil — no blur — consistent across all pages.
   Individual modals use .modal-overlay or .help-modal-overlay.
   Any element with role="dialog" or .modal-overlay gets this treatment. */
.modal-overlay,
.help-modal-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
/* The background veil colour — extremely light, no blur */
.modal-overlay { background: rgba(0,0,0,0.08) !important; }
/* Help: no veil at all (user, 2026-11-23); it closes only with its close button. */
.help-modal-overlay { background: transparent !important; }

/* Hide the help FABs on the help page (redundant when help is already open).
   The scroll button stays: it scrolls whichever Help tab is open (3.26). */
body[data-page="help"] #fab-stack { display: none !important; }

/* Hide FABs behind the open mobile drawer */
body.mob-menu-open #fab-stack,
body.mob-menu-open #scroll-fab { display: none !important; }

/* Consistent page-title spacing across all pages */
.container > h1,
.container-medium > h1,
.container-small > h1,
.content > h1,
div > h1:first-of-type {
    margin: 20px 0 16px;
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 8px;
}


/* ========================================
   MOBILE RESPONSIVE ENHANCEMENTS
   Patch: 2026-06 — systematic mobile pass
   ======================================== */

/* ── Responsive grid utilities ──────────────────────────────────────────────
   Use these classes instead of inline grid-template-columns where possible.
   .grid-2col : 2 columns on desktop → 1 column below 600px
   .grid-auto : auto-fill with 260px min (already used in many places inline)
   ─────────────────────────────────────────────────────────────────────────── */
.grid-2col {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.grid-3col {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

/* ── Responsive inline grids — override hard columns below 600px ────────── */
@media (max-width: 600px) {
    /* Any inline grid that forces 2 equal columns */
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns:repeat(2"],
    [style*="grid-template-columns: repeat(2"] {
        grid-template-columns: 1fr !important;
    }
    /* 3-col and 4-col inline grids collapse to single column on mobile */
    [style*="grid-template-columns:1fr 1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr 1fr"],
    [style*="grid-template-columns:repeat(3"],
    [style*="grid-template-columns: repeat(3"],
    [style*="grid-template-columns:1fr 1fr 1fr 1fr"],
    [style*="grid-template-columns:repeat(4"] {
        grid-template-columns: 1fr !important;
    }
    /* Compass grid for sheet margins — always keeps 3 columns */
    .compass-grid {
        grid-template-columns: 1fr 1fr 1fr !important;
    }
}

/* ── Batch-view logo row ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
    /* The logo + details flex row in batch_view */
    .bv-logo-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 14px !important;
    }
}

/* ── Pagination control ──────────────────────────────────────────────────── */
/* table_controls.html — wrap neatly on narrow screens */
@media (max-width: 640px) {
    /* Pagination container: stack show-rows + page buttons */
    .pagination-bar,
    /* target the inline-styled wrapper directly */
    [style*="justify-content: space-between"][style*="border-top: 1px solid"] {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    /* Shrink First/Last buttons on small screens */
    .pagination-bar .btn,
    [style*="justify-content: space-between"][style*="border-top: 1px solid"] .btn {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }
}

/* ── Stats bar (batches_list, dashboard) ─────────────────────────────────── */
@media (max-width: 640px) {
    /* quota/stats flex row: wrap and shrink the progress bar */
    .stats-bar {
        flex-wrap: wrap;
        gap: 10px;
    }
    .stats-bar .quota-progress {
        width: 80px !important;
    }
}

/* ── Action toolbar (dashboard batch selection bar) ─────────────────────── */
@media (max-width: 640px) {
    .action-toolbar {
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        font-size: 12px !important;
    }
}

/* ── Button row / form footer actions ───────────────────────────────────── */
@media (max-width: 480px) {
    /* Any flex row of buttons inside a .section or .card */
    .section > div[style*="display:flex"][style*="gap"],
    .card > div[style*="display:flex"][style*="gap"] {
        flex-wrap: wrap !important;
    }
    /* Buttons stay content-width on every screen size, mobile included. Only
       .btn-block opts into full width. A button stretched to its container reads
       as a banner and gives every action the same weight regardless of
       importance, so the stack of them loses its hierarchy. */
    .form-actions {
        flex-wrap: wrap;
    }
    .form-actions .btn:not(.btn-block) {
        width: fit-content;
        text-align: center;
    }
}

/* ── Users page role stat cards ─────────────────────────────────────────── */
@media (max-width: 640px) {
    .role-stats-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    }
}

/* ── Section headers (title + action button row) ────────────────────────── */
@media (max-width: 480px) {
    .section-header,
    .page-header {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    .section-header h1,
    .section-header h2,
    .page-header h1,
    .page-header h2 {
        font-size: 18px !important;
    }
}

/* ── Generate page: use-case section grid ───────────────────────────────── */
@media (max-width: 600px) {
    #uc-category-row,
    .uc-row {
        grid-template-columns: 1fr !important;
    }
}

/* ── Help panel full-screen on mobile ───────────────────────────────────── */
@media (max-width: 768px) {
    #help-panel {
        width: 100% !important;
        right: 0 !important;
        border-radius: 0 !important;
    }
}

/* ── GS panel: inner padding tighter on mobile ───────────────────────────── */
@media (max-width: 640px) {
    #gs-panel-inner {
        padding: 14px 14px 18px !important;
    }
    #gs-panel.open {
        max-height: 88vh;
    }
}

/* ── Masquerade badge ────────────────────────────────────────────────────── */
@media (max-width: 949px) {
    .masquerade-badge {
        display: none; /* shown in mobile menu instead */
    }
}

/* ── body padding-top: fixed nav already adds 44px at ≤949px.
   On desktop the admin nav is in-flow so no body padding is needed — but a
   client page has a fixed app bar above it and does need the room. The
   :not() is what keeps this !important from undoing that; without it this
   rule wins on order and the bar covers the top of every client page. ── */
@media (min-width: 950px) {
    body:not(:has(> .nav.nav-rail)) { padding-top: 0 !important; }
}



/* ── Compact batch-creation form layout ───────────────────────────────────
   .form-2col  : two equal columns, top-aligned, fields fill their column.
                 Collapses to single column below 600px.
   .col-span-2 : a field that needs full width spans both columns.
   .field-xs   : caps field width (e.g. Quantity, Delay dropdowns).
   .field-sm   : medium cap (e.g. short selects).
   .field-md   : wider cap (e.g. Batch Name).
   ─────────────────────────────────────────────────────────────────────── */

/* Two equal columns, top-aligned. minmax(0, 1fr), not 1fr: a bare 1fr track
   cannot shrink below its content's min-content width, so one wide child --
   the QR style picker, a row of thumbnails that is meant to scroll sideways --
   grew its column to the whole row and squeezed the other to ~70px. On the
   import page, "Codes" and its notes box were set one word per line. */
.form-2col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 28px;
    align-items: start;
}
.form-2col .form-group { margin-bottom: 18px; }

/* Full-width span inside the two-col grid */
.form-2col .col-span-2 { grid-column: 1 / -1; }

/* Width caps on .form-group wrapper */
.field-xs { max-width: 140px; }
.field-sm { max-width: 240px; }
.field-md { max-width: 400px; }

/* Inputs/selects always fill their (possibly capped) container */
.form-compact input,
.form-compact select,
.form-compact textarea { width: 100%; }

/* Submit button: fit-content, not full-width */
.form-compact button[type="submit"] {
    width: auto !important;
    min-width: 180px;
    padding: 12px 32px;
    font-size: 15px;
}

/* Global: all submit buttons default to fit-content */
button[type="submit"]:not(.btn-block) { width: auto; }

/* Collapse to single column on mobile */
@media (max-width: 600px) {
    .form-2col { grid-template-columns: 1fr; }
    .field-xs, .field-sm, .field-md { max-width: 100%; }
}

/* ── Global table scroll on mobile ────────────────────────────────────────
   Any table inside .section or .card gets horizontal scroll on narrow screens,
   even without an explicit .table-wrapper parent. */
@media (max-width: 768px) {
    .section, .card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .section > table,
    .card > table {
        min-width: 600px;
    }
}


/* Count on a nav item — used by Scan Follow-ups for work awaiting an answer.
   Sized to sit inside a menu label without changing the bar's height. */
.nav-badge {
    display: inline-block;
    min-width: 18px;
    padding: 1px 6px;
    margin-left: 6px;
    border-radius: 9px;
    background: var(--brand-orange, #F26429);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}
.nav-submenu-label .nav-badge { background: #e2e8f0; color: #7b341e; }


/* ── Client dashboard: compact, informative, actionable ──────────────────────
   Replaces four stacked cards that spent over a thousand pixels on nine
   numbers. Every stat is a link, because a number you cannot act on is
   decoration. */
.dash-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}
.dash-stat {
    /* Equal height, stated rather than inferred: the labels are of different
       lengths, so one wrapping to a second line used to leave its neighbours
       short and the strip looking ragged. A flex column with height:100% keeps
       every card the height of the tallest whatever its label does. */
    display: flex; flex-direction: column; justify-content: center;
    height: 100%; box-sizing: border-box;
    padding: 8px 12px; text-decoration: none;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    transition: border-color .15s, transform .15s;
}
.dash-strip { align-items: stretch; }
.dash-stat:hover { border-color: #667eea; transform: translateY(-1px); }
.dash-stat .n {
    display: block; font-size: 20px; font-weight: 800; color: #1a202c;
    line-height: 1.15; font-variant-numeric: tabular-nums;
}
.dash-stat .k {
    display: block; margin-top: 2px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em; color: #5f6b7a;
}
.dash-stat.warn .n  { color: #c05621; }
.dash-stat.warn     { border-color: #fbd38d; }
.dash-stat.warn .k  { color: #b7791f; }
/* -is-alert, not -alert: `.alert` above is a notification box carrying
   padding and margin-bottom:15px, and a card wearing both would inherit that
   margin — knocking it out of a row whose whole point is equal-height cards.
   Latent rather than visible: the variant only renders when there is something
   pending. Same trap as the submissions pill, which was named `alert` too. */
.dash-stat.is-alert .n { color: #c53030; }
.dash-stat.is-alert    { border-color: #feb2b2; }
.dash-stat.is-alert .k { color: #c53030; }
.dash-stat.over .n  { color: #c53030; }

/* The numbers in sections (2026-10-26): each a shaded panel with a small
   title -- Codes, Scans, Needs attention, then one per module the customer
   has (Traceability). A section is as wide as its tiles want and grows to
   fill the row, so two tiles never stretch across half the page. */
.dash-sections { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 16px; align-items: stretch; }
.dash-sec { flex: 1 1 auto; min-width: 250px; box-sizing: border-box; padding: 9px 11px 11px;
    background: #f7f9fb; border: 1px solid #e2e8f0; border-radius: 12px; }
.dash-sec.is-attention { background: #fffaf6; border-color: #f6e0cf; }
.dash-sec.is-module { background: #f1f8f6; border-color: #cfe5df; }
.dash-sec .dash-sec-h { margin: 0 0 7px;
    font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
    color: #4a5568; display: block; }
.dash-sec.is-attention .dash-sec-h { color: #9c4221; }
.dash-sec.is-module .dash-sec-h { color: #2c7a6b; }
.dash-sec-tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-sec-tiles .dash-stat { flex: 1 1 128px; min-width: 128px; height: auto; }
@media (max-width: 640px) {
    .dash-sec { min-width: 100%; }
}

.dash-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 18px; }
.dash-actions .btn { font-size: 13.5px; padding: 9px 16px; }
.dash-pill {
    display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 9px;
    background: var(--brand-orange, #F26429); color: #fff; font-size: 11px; font-weight: 700;
}

.dash-cols {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;
    align-items: start;      /* cards size to content — no more 367px of nothing */
}
@media (max-width: 860px) { .dash-cols { grid-template-columns: 1fr; } }
.dash-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 6px 4px 4px; }
.dash-card-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 14px 7px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em; color: #5f6b7a;
}
.dash-card-head a { font-size: 11.5px; color: #667eea; text-decoration: none; text-transform: none; letter-spacing: 0; }
.dash-row {
    display: flex; align-items: center; gap: 10px; padding: 6px 14px;
    border-top: 1px solid #f1f5f9; text-decoration: none; color: inherit;
}
.dash-row:hover { background: #f8fafc; }
.dash-row-main { flex: 1; min-width: 0; }
.dash-row-main strong { display: block; font-size: 13.5px; color: #1a202c; }
/* The clickable part of a dashboard row. The row used to be the target, which
   left no room for a second link and made the date and counts beside it look
   clickable when they were not. */
.dash-code {
    display: block; font-size: 13.5px; font-weight: 600; color: #4c51bf;
    text-decoration: none; cursor: pointer;
}
.dash-code:hover { text-decoration: underline; }

/* The code, on any page that lists codes: click it for everything known about
   it. Only the code — these rows carry their own actions, and a row that
   navigates on any click cannot also hold them. */
.code-link {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #4c51bf; cursor: pointer; text-decoration: none;
    border-bottom: 1px dashed rgba(76,81,191,.45);
}
.code-link:hover { border-bottom-style: solid; }
.dash-row-sub {
    display: block; font-size: 11.5px; color: #5f6b7a;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* The group's QR action, as its own column between the name and the date.
   Capped at 140px because that clears the longest label in the catalogue --
   "Digital Product Passport" measures 135px at this size -- so nothing
   truncates in practice, while the cap still stops a future longer label from
   pushing the date off the card. Ellipsis and the title attribute cover that
   case if it ever arrives. */
.dash-row-uc {
    flex: 0 0 auto; max-width: 140px;
    font-size: 11px; color: #64748b; background: #f1f5f9;
    border-radius: 10px; padding: 2px 8px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* .dash-row-main is flex:1 with a 0 basis, so it takes what is left AFTER this
   chip has claimed its width. At 375px that left the group name 97px against
   the chip's 135 -- the least important column winning against the most. The
   chip yields first on narrow screens; the full label stays on title. */
@media (max-width: 640px) {
    .dash-row-uc { max-width: 92px; }
}
.dash-row-when { font-size: 11.5px; color: #5f6b7a; white-space: nowrap; }
.dash-row-acts { display: flex; gap: 10px; }
.dash-row-acts a { font-size: 12px; color: #667eea; text-decoration: none; }
.dash-kind {
    font-size: 11px; padding: 2px 8px; border-radius: 10px; white-space: nowrap;
    background: #edf2f7; color: #4a5568;
}
.dash-kind.k-ownership { background: #e9e8fd; color: #434190; }
.dash-kind.k-warranty_claim { background: #feebc8; color: #7b341e; }
.dash-kind.k-incident { background: #fed7d7; color: #822727; }
.dash-empty { padding: 18px 14px; font-size: 13px; color: #5f6b7a; }

/* ── Quick links ─────────────────────────────────────────────────────────────
   The five steps of the batch-QR loop, in the order they happen: make codes,
   find them, get them out, watch the job, see them used.

   Deliberately NOT styled like .dash-library below. Those are state — a place
   with a count attached — and they sit at the foot of the page. These are
   actions and they sit at the top. All of them carry the same weight: the
   strip is one journey, and a filled first button made the remaining stops
   look optional.

   These do repeat nav items, which is why the earlier shortcut block was
   removed from this page. The difference is that the nav spreads this journey
   across four separate menus, two of them behind a hover; a tenant whose whole
   job is generating and using batches should not have to reassemble the order
   from a menu bar every visit. */
/* 10px to the library row below, 18px from the library to the stats: the two
   link rows belong together, and equal spacing would orphan them apart. */
/* Both link rows in one wrapping line on a wide screen (2026-10-01): the
   journey first, a gap, then the library. They still differ in shape. */
.dash-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0 0 12px; }
.dash-links > .dash-quick, .dash-links > .dash-library { margin: 0; }
@media (max-width: 640px) {
    .dash-links { display: block; }
    .dash-links > .dash-quick { margin-bottom: 8px; }
}
.dash-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.dash-quick a {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 600; color: #4a5568; text-decoration: none;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 6px 12px; transition: border-color .15s, color .15s, box-shadow .15s;
}
.dash-quick a:hover {
    border-color: #667eea; color: #667eea;
    box-shadow: 0 1px 4px rgba(102,126,234,.16);
}
.dash-quick a .qi { font-size: 15px; line-height: 1; }
@media (max-width: 640px) {
    /* Four-plus pills wrapping into stubs is worse than a scrolling row: the
       order is the point, and wrapping hides where the journey restarts. */
    .dash-quick { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
                  padding-bottom: 4px; }
    .dash-quick a { white-space: nowrap; flex: 0 0 auto; }
}
/* D2: a table's scrolling box while more of the table is off to its right
   (set by shared/runtime_scripts.html): the edge fades, so the hidden
   columns read as "more this way" rather than as the end of the table. */
.x-more {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), rgba(0,0,0,.25));
            mask-image: linear-gradient(to right, #000 calc(100% - 36px), rgba(0,0,0,.25));
}
/* E5: a row that scrolls sideways on a phone says so with a fade at its right
   edge; the end padding lets the last item clear the fade once scrolled there.
   Used by the dashboard's quick links and the Buy tabs. */
@media (max-width: 640px) {
    .hscroll-cue {
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
                mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
        padding-right: 28px;
    }
}

/* The reusable material a batch is made from, sitting under the quick links.
   Deliberately still a pill where .dash-quick is a rounded rectangle: these
   carry counts and are things you HAVE, the strip above are things you DO, and
   the shape is what keeps two adjacent rows of links from reading as one
   undifferentiated wall of ten buttons.

   Raised from the footer treatment it had when it lived at the bottom of the
   page -- darker text, real weight, a count that stands out as a number rather
   than as punctuation, and a hover that lifts. Prominent enough to be seen
   before the work that needs it, not so loud that it competes with Generate. */
.dash-library { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.dash-library a {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; color: #3d4759; text-decoration: none;
    background: #fff; border: 1px solid #dbe2ec; border-radius: 999px;
    padding: 5px 13px;
    transition: border-color .15s, color .15s, box-shadow .15s, transform .15s;
}
.dash-library a:hover {
    border-color: #667eea; color: #4c51bf;
    box-shadow: 0 1px 4px rgba(102,126,234,.16);
    transform: translateY(-1px);
}
/* The count reads as a value, not as a trailing digit. */
.dash-library b {
    color: #4c51bf; background: #eef1fe; border-radius: 999px;
    padding: 1px 8px; font-size: 12px; margin-left: 1px;
}
@media (max-width: 640px) {
    .dash-library { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
                    padding-bottom: 4px; }
    .dash-library a { white-space: nowrap; flex: 0 0 auto; }
}


/* ── "What next" drawer ──────────────────────────────────────────────────────
   The workflow hint used to sit above the content on 21 pages, pushing the
   actual work down for guidance most people read once. It lives behind this
   button instead, directly under the help FAB. */
#what-next-fab {
    /* Positioned by #fab-stack, not by itself — see the stack rule above. */
    position: static;
    display: flex; align-items: center; gap: 6px;
    height: 38px; padding: 0 13px; border: none; border-radius: 19px;
    background: #5a67d8; color: #fff; cursor: pointer;
    font: inherit; font-size: 13px; font-weight: 600;
    box-shadow: 0 3px 12px rgba(90, 103, 216, .42);
    transition: background .15s, box-shadow .15s;
}
#what-next-fab:hover { background: #4c51bf; box-shadow: 0 4px 16px rgba(90,103,216,.6); }
/* On a narrow screen the label costs more than it explains. */
@media (max-width: 640px) {
    #what-next-fab span { display: none; }
    #what-next-fab { padding: 0; width: 38px; justify-content: center; }
}

#what-next-scrim {
    position: fixed; inset: 0; background: rgba(15, 23, 42, .35);
    z-index: 9190; animation: wnFade .15s ease-out;
}
@keyframes wnFade { from { opacity: 0; } to { opacity: 1; } }

#what-next-drawer {
    /* Parked off-screen with a transform, which still counts toward the page's
       scrollable width — it was adding 2px of horizontal scrollbar at every
       width above 1500px. Clipped at the root instead, so nothing a fixed
       overlay does can give the document a horizontal bar. */
    position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 92vw;
    background: #fff; z-index: 9200;
    box-shadow: -8px 0 28px rgba(0, 0, 0, .18);
    transform: translateX(100%);
    transition: transform .22s ease-out;
    display: flex; flex-direction: column;
}
#what-next-drawer.open { transform: translateX(0); }
.wn-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px; border-bottom: 1px solid #e2e8f0;
    font-size: 14px; font-weight: 700; color: #2d3748;
}
.wn-title { display: inline-flex; align-items: center; gap: 7px; }
/* The drawer's bulb, drawn like the button that opens it. */
.wn-title .guide-ic { width: 1.25em; height: 1.25em; flex: none; color: #5a67d8; }
.wn-title .guide-ic .ic-k, .wn-title .guide-ic .ic-a {
    fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round; }
.wn-close {
    border: none; background: none; cursor: pointer; font-size: 16px; color: #5f6b7a;
    padding: 4px 6px; line-height: 1;
}
.wn-close:hover { color: #4a5568; }
.wn-body { padding: 14px 18px 22px; overflow-y: auto; display: grid; gap: 11px; }
.wn-task { border: 1px solid #e2e8f0; border-radius: 9px; padding: 12px 14px; background: #f8fafc; }
.wn-task-title { font-size: 13.5px; font-weight: 600; color: #2d3748; margin-bottom: 4px; }
.wn-task-title a { color: #3b5bdb; text-decoration: none; }
.wn-task-desc { font-size: 12.5px; color: #5f6b7a; line-height: 1.55; }
/* The workflow's own "what to do after" line (What next lists the page's
   workflows since 2026-10-24; the hand-kept list's prerequisite note went). */
.wn-task-next { margin-top: 6px; font-size: 12px; color: #3a7368; line-height: 1.5; }


/* ── Keep the nav inside the window ──────────────────────────────────────────
   The desktop bar needs about 1390px laid out at full size, but it was shown
   from 1081px up — so every window between those two sizes gave the whole PAGE
   a horizontal scrollbar, on a 1366px laptop as much as anywhere. Two changes:
   the bar compresses before it runs out of room (measured: the full-size bar
   needs ~1442px, so compression starts below 1500), and the mobile menu takes over
   while there is still room rather than 300px too late.

   Three steps now, not two. Two got the bar down to a measured 1070px, which is
   why the burger took over at 1080; the third trades the two pieces of text that
   are not menu items — the brand and the signed-in address — for the width the
   menu itself needs, and holds the full bar down to 950. */
/* Every tier below compresses the BAR only, never the dropdown panels: the
   child combinators keep these off `.nav-dropdown-menu a`, which is a plain
   `.nav-dropdown-menu a` (same specificity as `.nav a`) and so lost its
   `padding: 9px 16px` to whichever of the two came last in the file. That
   flattened every leaf item to the bar's own padding and left the panels
   uneven. A dropdown is a panel of its own; the bar running out of room is not
   a reason to shrink it. */
@media (min-width: 950px) and (max-width: 1499px) {
    .nav > a, .nav-links > a, .nav-links > span { padding: 0 9px; font-size: 13px; }
    .nav-brand { max-width: 120px; padding-right: 10px; margin-right: 4px; font-size: 14px; }
    .nav-dropdown-btn { padding: 0 9px; font-size: 13px; }
    .nav-links a.nav-cart { padding: 0 8px; }
    .nav-group-sep { display: none !important; }
}
@media (min-width: 950px) and (max-width: 1279px) {
    /* Tighter still: the arrow glyphs are decoration once things are this snug. */
    .nav > a, .nav-links > a, .nav-links > span { padding: 0 7px; font-size: 12.5px; }
    .nav-dropdown-btn { padding: 0 7px; font-size: 12.5px; }
    .nav-dropdown-arrow { display: none; }
}
@media (min-width: 950px) and (max-width: 1080px) {
    /* Last step before the burger, and the tightest it gets. A seventh top-level
       menu (Buy) pushed the bar's natural width to 1095px, so at 950 the menu
       items had begun to collide with the account controls — no horizontal
       scrollbar, because flex simply squeezed them into each other.
       The width comes from the two things in the bar that are not navigation:
       the brand, which is dropped here rather than truncated to a syllable —
       Dashboard sits immediately beside it and goes to the same place — and the
       signed-in address, cut to a stub. Both return above 1080. */
    /* .nav .nav-brand, not .nav-brand: the plain selector is the same
       specificity as the base rule and lost to it here, so the brand stayed and
       the bar stayed too wide. */
    .nav .nav-brand { display: none !important; }
    .js-current-username { max-width: 46px !important; }
    .nav { padding: 0 10px; }
    .nav > a, .nav-links > a, .nav-links > span { padding: 0 4px; font-size: 12px; }
    .nav-dropdown-btn { padding: 0 4px; font-size: 12px; }
    /* The avatar button keeps its inline padding, hence the specificity here. */
    #clientAvatar .nav-dropdown-btn, #adminAvatar .nav-dropdown-btn { padding: 4px 6px !important; }
    .js-current-username {
        display: inline-block; max-width: 96px; overflow: hidden;
        text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom;
    }
    .nav-links a.nav-cart { margin-left: 2px; }
}
/* The bar may never make the page wider than the window; a dropdown is
   positioned against its trigger, so this cannot clip an open menu. */
.navbar, .nav, .nav-left, .nav-links { min-width: 0; }


/* Nothing should ever scroll the page sideways: the layout is responsive and a
   horizontal bar here always means something escaped, not that there is more to
   see. `clip` rather than `hidden` so this does not turn <html> into a scroll
   container and break position: sticky inside it. */
html { overflow-x: clip; }
@supports not (overflow-x: clip) { html { overflow-x: hidden; } }


/* ── List filter bar ──────────────────────────────────────────────────────
   The search box, its button and the use-case select sat in one flex row but
   each worked out its own height from its own padding and font size, and the
   <label> wrapping the select also picked up the global label margin-bottom.
   Flex centres the margin box, not the border box, so that 8px bottom margin
   lifted the whole use-case group about 4px above the search group.

   One declared height for every control in the bar, and no margins on the
   groups, so alignment stops depending on three paddings agreeing. */
.list-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 14px;
    font-size: 13px;
}
.list-filter-bar > * { margin: 0; }

.lfb-group {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.lfb-control {
    height: 32px;
    box-sizing: border-box;
    padding: 0 9px;
    font-size: 13px;
    line-height: normal;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #2d3748;
}
/* .btn sets its own padding and an inline-flex display with !important, so the
   Search button needs the height restated to match the fields beside it. */
button.lfb-control { padding: 0 14px; }

.lfb-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #5f6b7a;
    white-space: nowrap;
}


/* ── Buttons size to their content ────────────────────────────────────────
   A button in a column flex or a grid cell stretches to the cross-axis by
   default, so buttons ended up as wide as whatever sat beside them — a
   two-letter "PDF" spanning a whole card, and the same word a different width
   on two pages. Sized to content and centred in the space instead.

   Rows are left alone: `align-self` only affects the cross axis, so a button in
   a normal left-to-right toolbar keeps its place. */
.btn,
button.btn,
a.btn {
    width: fit-content;
    max-width: 100%;
    align-self: center;
    justify-self: center;
}
/* Nav controls are layout, not content: their width comes from the bar they
   divide up, and shrinking them to their labels leaves gaps in the menu. */
.nav .btn, .nav-dropdown-btn, .nav-links .btn { width: auto; align-self: auto; }

/* ── Unit-weight badges ───────────────────────────────────────────────────
   What publishing one piece of scan content costs, as a badge that can sit on
   a card, in a table cell or beside a heading. Shared here rather than copied
   into each page because the colours only mean anything if they mean the SAME
   thing everywhere: a customer learns the ramp on one screen and reads it on
   the next.

   A sequential ramp, not a traffic light. Ten units is richer content, not an
   error, and red would tell people the expensive actions are the wrong ones.
   Depth increases with cost; hue shifts along one arc from teal to plum.

   The cost is always written out as text too. Colour alone would exclude
   anyone who cannot separate these hues, and the number is the thing that
   actually answers the question. */
.uw {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    padding: 3px 7px;
    border-radius: 20px;
    border: 1px solid transparent;
}
.uw-t0 { background: #edf2f7; color: #4a5568; border-color: #cbd5e0; }
.uw-t1 { background: #e6fffa; color: #234e52; border-color: #9decdf; }
.uw-t2 { background: #ebf8ff; color: #1a4971; border-color: #a7d8f5; }
.uw-t3 { background: #f2ecff; color: #4c327f; border-color: #cbb9f2; }
.uw-t4 { background: #fff0f6; color: #7b2b53; border-color: #f2b5cf; }

/* On a tile the badge is a corner marker, not part of the label. */
.uw-corner { position: absolute; top: 6px; right: 6px; }


/* ── The scan-content estimator ───────────────────────────────────────────
   Lives on the buy page's scan-content top-up. In the stylesheet rather than
   that partial because the weight badges above are shared with the records
   library, and a badge that looks different on two pages teaches nothing. */
.est-details { border:1px solid #e2e8f0; border-radius:10px; background:#fff;
               margin:0 0 16px; }
.est-details > summary { cursor:pointer; padding:11px 15px; font-weight:600;
                         font-size:14px; color:#2b6cb0; list-style:none; }
.est-details > summary::-webkit-details-marker { display:none; }
.est-details > summary::before { content:'\25B8'; display:inline-block;
                                 margin-right:8px; transition:transform .15s; }
.est-details[open] > summary::before { transform:rotate(90deg); }
.est-body { padding:2px 15px 15px; }
.est-wrap { overflow-x:auto; }
.est { width:100%; border-collapse:collapse; font-size:13px; }
.est th, .est td { padding:6px 8px; border-bottom:1px solid #edf2f7; text-align:left; }
.est th { font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:#5f6b7a; }
.est td.num, .est th.num { text-align:right; font-variant-numeric:tabular-nums; }
.est input { width:72px; padding:5px 7px; border:1px solid #cbd5e0; border-radius:6px;
             font-size:13px; text-align:right; font-variant-numeric:tabular-nums; }
.est tfoot td { border-top:2px solid #e2e8f0; border-bottom:none;
                font-weight:700; color:#2d3748; padding-top:10px; }
.est-free { font-size:12.5px; color:#5f6b7a; line-height:1.65; margin:10px 2px 0; }
.est-free strong { color:#4a5568; }
.est-out { display:flex; align-items:center; flex-wrap:wrap; gap:4px;
           border:1px solid #c3cefe; background:#f8f9ff; border-radius:9px;
           padding:10px 13px; margin:13px 0 0; font-size:13px; color:#2d3748; }

/* ── Pack matrix ──────────────────────────────────────────────────────────
   Packs down, plans across. Replaces a rate card plus a pack list that said
   the same thing twice in different units.

   The pack column is sticky so a row stays identifiable while the plans scroll
   past on a narrow screen — comparison across plans is the entire point of the
   table, so it has to survive a phone rather than be hidden on one. */
.pm-wrap { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.pm { width: 100%; border-collapse: collapse; font-size: 13px; }
.pm th, .pm td { padding: 9px 12px; border-bottom: 1px solid #edf2f7; white-space: nowrap; }
.pm tbody tr:last-child th, .pm tbody tr:last-child td { border-bottom: none; }
.pm thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
               color: #5f6b7a; text-align: right; vertical-align: bottom;
               background: #f7fafc; border-bottom: 2px solid #e2e8f0; }
.pm .pm-sub { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0;
              text-transform: none; color: #5f6b7a; margin-top: 2px; }
.pm-name { position: sticky; left: 0; z-index: 1; text-align: left !important;
           font-weight: 600; color: #2d3748; background: #fff; }
/* A row header is a data label, not a column heading. The global
   `th { text-transform: uppercase }` was shouting "25 RECORD UNITS" at the
   customer in the middle of a price table. */
.pm tbody th.pm-name { text-transform: none; letter-spacing: normal; font-size: 13px; }
.pm thead .pm-name { background: #f7fafc; }
.pm-num { text-align: right; font-variant-numeric: tabular-nums; color: #4a5568; }
.pm-add { text-align: right; }
/* The column the customer actually pays. Marked in words as well as tint —
   the header carries "your plan" — so the highlight is never the only signal. */
.pm .is-yours { background: #f0f7ff; color: #2b6cb0; font-weight: 700; }
.pm thead .is-yours { color: #2b6cb0; background: #e6f0fb; }
.pm thead .is-yours .pm-sub { color: #2f855a; }
.pm .pm-unit td, .pm .pm-unit th { color: #5f6b7a; background: #fcfdfe; }
.pm .pm-unit .is-yours { color: #2b6cb0; }
.pm .btn-sm { padding: 4px 12px; font-size: 12px; }
.pm-upsell { font-size: 12.5px; color: #5f6b7a; margin: 9px 2px 0; line-height: 1.55; }
/* Phones: your plan's column only, others on request (buy/_shared.html). */
.pm-cmp { position: absolute; opacity: 0; pointer-events: none; }
.pm-cmp-label, .pm-cmp-hide { display: none; }
@media (max-width: 640px) {
    /* Not the phones' blanket `table { min-width:600px }`: with only your
       column showing, that stretched it and pushed Add off-screen. Its
       nowrap cells still widen it, and the wrap scrolls, when all are shown. */
    .pm-wrap .pm { min-width: 0; }
    .pm-wrap.has-yours .pm-num:not(.is-yours) { display: none; }
    .pm-cmp:checked ~ .pm-wrap.has-yours .pm-num { display: table-cell; }
    .pm-cmp-label { display: inline-block; margin: 9px 2px 0; font-size: 12.5px;
                    font-weight: 600; color: #2b6cb0; cursor: pointer; }
    .pm-cmp:checked ~ .pm-cmp-label .pm-cmp-show { display: none; }
    .pm-cmp:checked ~ .pm-cmp-label .pm-cmp-hide { display: inline; }
}
.pm-upsell a { color: #2b6cb0; font-weight: 600; }

/* Told before the button, not by the payment provider after the fact. */
.min-warn { margin-top: 14px; padding: 10px 13px; border-radius: 8px;
            border: 1px solid #f6c177; background: #fffaf0; color: #7b4a10;
            font-size: 12.5px; line-height: 1.55; }
.min-warn[hidden] { display: none; }
.min-warn strong { color: #5c3708; }

/* Quick amounts for a credit top-up. Chips rather than a select: there are
   four, they are the answer most of the time, and one tap beats two. */
.credit-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.credit-chip { font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
               padding: 9px 16px; border-radius: 8px; color: #2b6cb0;
               background: #fff; border: 1px solid #cbd5e0; }
.credit-chip:hover { border-color: #2b6cb0; background: #f0f7ff; }
.credit-chip.is-on { background: #2b6cb0; border-color: #2b6cb0; color: #fff; }

/* ── Shared QR-group form controls ──────────────────────────────────────────
   Used by client/_qr_group_*.html, which the create page and the group's edit
   page both render. They lived in manage_batch.html's own <style>, so a partial
   including them was styled on that page and unstyled anywhere else -- which is
   how the create page came to show its "this is what the group will serve" hint
   with no styling at all, and the edit page to draw the QR style picker at full
   size. Identical markup, unrecognisably different pages, and invisible to
   every structural check because the DOM matches.
   ------------------------------------------------------------------------- */
.warning-box {
    background:#fffbeb; border:1px solid #f6e05e; border-radius:7px;
    padding:10px 14px; font-size:12px; color:#744210; margin-bottom:14px;
    display:flex; gap:8px; align-items:flex-start;
}
.regen-warning {
    background:#fff5f5; border:1px solid #fed7d7; border-radius:7px;
    padding:10px 14px; font-size:12px; color:#742a2a; margin-top:8px;
    display:none;
}
/* Help text is TEAL (#3a7368), so it reads as guidance rather than as data:
   5:1 on the grey page, 5.5:1 on white (WCAG AA). Secondary DATA text --
   dates, counts, subtitles -- is grey #5f6b7a. #a0aec0 and #718096 are never
   text colours (too faint on the grey page). Public scan pages and emails
   keep grey: they carry the tenant's brand, not ours. (2026-10-01) */
.fg-hint { font-size:12px; color:#3a7368; margin-top:3px; }
/* An active recall covering a QR group, under its chain (manage_batch, 2026-10-19). */
.grp-recall-note { background:#fff5f5; border:1px solid #feb2b2; border-radius:8px; padding:8px 10px; color:#822727; margin:8px 0; font-size:13px; display:flex; gap:10px; flex-wrap:wrap; align-items:baseline; }
.grp-recall-note .grp-recall-scope { color:#5f6b7a; }
/* .help-text is the older hint class (Settings, Users). Teal on client pages
   like every other piece of help text; admin pages keep the grey until their
   pass (deferred). */
.client-page .help, .client-page .help-text { color:#3a7368; }
.readonly-field {
    background:#f7fafc; color:#5f6b7a; padding:7px 10px; border-radius:6px;
    font-size:13px; border:1px solid #e2e8f0;
}
.form-section-title {
    font-size:12px; font-weight:700; color:#5568d3; text-transform:uppercase;
    letter-spacing:.06em; margin:18px 0 10px; padding-bottom:6px;
    border-bottom:1px solid #e2e8f0;
}

/* ══ In-page section nav ("On this page") ═══════════════════════════════════
   macros/section_nav.html + static/js/section-nav.js. For long pages whose
   lower sections cannot be seen from the top: one row of links, each with a
   one-line summary, so the row says what the page holds without scrolling.
   Sticks just under the fixed app bar (52px) and marks the section in view.
   Opaque page background so content does not show through while stuck. */
.section-nav {
    position: sticky; top: 52px; z-index: 40;
    display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin;
    margin: 0 0 12px; padding: 6px 0;
    background: var(--color-bg); border-bottom: 1px solid #e2e8f0;
    /* Full width when the page lays its sections out in a grid (Settings tabs). */
    grid-column: 1 / -1;
}
.section-nav-link {
    flex: none; display: flex; flex-direction: column; gap: 1px;
    padding: 5px 12px; border: 1px solid transparent; border-radius: 8px;
    color: #2d3748; text-decoration: none; line-height: 1.25;
}
.section-nav-link:hover { background: #edf2f7; text-decoration: none; }
.section-nav-link.active { background: #fff; border-color: #cbd5e0;
                           box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
.section-nav-link .sn-label { font-size: 13px; font-weight: 600; }
.section-nav-link .sn-label .nav-ic { width: 14px; height: 14px; vertical-align: -2px; color: #2f855a; }
.section-nav-link .sn-hint { font-size: 11.5px; color: #5f6b7a; white-space: nowrap; }
/* Below 950px the rail becomes a 44px top bar with the 44px app bar under it
   (see the max-width: 949px block above), so the header is 88px, not 52. */
@media (max-width: 949px) { .section-nav { top: 88px; } }
/* Admin pages have no fixed app bar (their header scrolls away) and sit in a
   white panel: stick to the very top, on white. */
body.admin-page .section-nav { top: 0; background: #fff; }
/* A form shown in an overlay frame (?embed=1, e.g. the scan page form opened
   from a group) has no app bar either. */
body.is-embed .section-nav { top: 0; }
/* Scan page form: optional parts folded to their heading and a one-line
   summary of what they are set to (record_form.html, .rf-fold). */
.rf-fold > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.rf-fold > summary::-webkit-details-marker { display: none; }
.rf-fold > summary h3 { margin: 0 !important; }
.rf-fold > summary h3::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 10px;
    border-right: 2px solid #5568d3; border-bottom: 2px solid #5568d3; transform: translateY(-3px) rotate(45deg);
    transition: transform .15s; }
.rf-fold[open] > summary h3::after { transform: translateY(1px) rotate(-135deg); }
.rf-fold > summary .rf-sum { font-size: 12.5px; color: #5f6b7a; }
.rf-fold[open] > summary { margin-bottom: 12px; }
.rf-blockers { border: 1px solid #f6e05e; background: #fffbeb; color: #744210; border-radius: 8px;
               padding: 10px 14px; margin: 0 0 14px; font-size: 13px; }
.rf-blockers ul { margin: 4px 0 0; padding-left: 18px; }
.rf-example { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
/* New QR group: choose a scan page, or write it here. */
.grp-source { display: flex; gap: 18px; flex-wrap: wrap; margin: 0 0 10px; font-size: 13.5px; }
/* display:flex beat [hidden]: a product group showed a Write it here that did nothing. */
.grp-source[hidden] { display: none; }
.grp-source label { display: flex; align-items: center; gap: 6px; font-weight: 600; margin: 0; }
.grp-source input { width: auto; margin: 0; }
.wh-uc { border: 0; padding: 0; margin: 0; min-width: 0; }

/* ── Line icons outside the rail, and the Plan & billing menu (2026-10-09) ──
   Every glyph the client chrome used to draw with an emoji or a text character
   (padlock, carets, close, sign-out, masquerade, the help panel's cards, the
   pending-payment banner, What next) is now a sprite symbol from
   macros/nav.html, stroked in currentColor so it takes the text colour of
   wherever it sits. The base rule sizes an inline icon to the text; the rail's
   own 23px rule is undone wherever an icon sits inside text rather than
   standing for a rail item. */
svg.nav-ic {
  width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.14em;
}
/* The caret: the rail hides it (its own rule); everywhere else it is a small
   line chevron. No `display` here -- set at this specificity it would beat the
   rail's display:none, which comes earlier in this file. */
.appbar .nav-dropdown-btn .nav-dropdown-arrow { display: inline-flex; margin-left: 3px; opacity: .75; }
.nav-dropdown-btn .nav-dropdown-arrow .nav-ic,
.appbar .nav-dropdown-btn .nav-dropdown-arrow .nav-ic { width: 12px; height: 12px; stroke-width: 2.2; }
.nav-lock { display: inline-flex; margin-left: 4px; opacity: .8; }
/* `.nav-links span` outranks `.nav-lock`: on the rail's white submenus it made the
   padlock white on white, and a full-width flex row of its own. */
.nav-dropdown-menu .nav-lock { display: inline-flex; padding: 0; margin-left: 6px; vertical-align: -2px; color: #5f6b7a; }
.nav-dropdown-menu .nav-lock .nav-ic { width: 14px; height: 14px; stroke: #5f6b7a; }
.nav-rail .nav-dropdown-menu .nav-ic,
.nav-rail .nav-mobile-menu .nav-ic,
.nav-rail .masquerade-badge .nav-ic { width: 14px; height: 14px; stroke-width: 2; }
.mob-caret { display: inline-flex; }
.mob-caret .nav-ic { width: 15px; height: 15px; }
.mob-menu-close button .nav-ic { width: 18px; height: 18px; }
.masquerade-badge .nav-ic { width: 14px; height: 14px; }
.masquerade-badge a { display: inline-flex; align-items: center; gap: 3px; }
.nav-signout .nav-ic,
.nav.nav-rail .nav-signout .nav-ic { width: 19px; height: 19px; stroke-width: 2.2; }
.appbar a.nav-cart .nav-ic { width: 19px; height: 19px; stroke-width: 1.7; }
.disclosure-arrow { display: inline-flex; }
.disclosure-arrow .nav-ic { width: 12px; height: 12px; stroke-width: 2.4; }
.uhp-uc-title .nav-ic { width: 16px; height: 16px; margin-right: 3px; vertical-align: -3px; }
.uhp-uc-link .nav-ic, .wn-task .nav-ic { width: 13px; height: 13px; vertical-align: -2px; }
.wn-close .nav-ic { width: 15px; height: 15px; }

/* The menu: what you are on, what is left, then buy, then records. */
.nav-dropdown-menu.bill-menu { min-width: 270px; }
/* Section headings (Buy / Records): a navy band in small capitals, so they read
   as headings and not as one more grey line among the links (user, 2026-10-13). */
.nav-dropdown-label {
  margin: 4px 0 2px; padding: 6px 14px; font-size: 11px; font-weight: 700;
  color: var(--rail-bg, #023151); background: #eef2f7;
  border-left: 3px solid var(--brand-orange, #F26429);
  text-transform: uppercase; letter-spacing: .08em;
}
.bill-sum { padding: 8px 14px 6px; font-size: 12px; color: #4a5568; }
.bill-sum-wait { color: #3a7368; padding: 4px 0; }
.bill-sum-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.bill-sum-head strong { font-size: 14px; color: #1a202c; }
.bill-sum-head span { color: #5f6b7a; font-size: 11px; white-space: nowrap; }
.bill-meter { margin: 6px 0; }
.bill-meter-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 3px; }
.bill-meter-n { color: #5f6b7a; }
.bill-bar { height: 5px; border-radius: 3px; background: #e2e8f0; overflow: hidden; }
.bill-bar-fill { height: 100%; border-radius: 3px; background: var(--rail-bg, #023151); }
.bill-bar-fill.is-high { background: var(--brand-orange, #F26429); }
.bill-incl { display: flex; gap: 8px; align-items: baseline; font-size: 12px; margin: -2px 0 8px; }
.bill-incl-k { color: #5f6b7a; white-space: nowrap; }
.bill-incl-v { color: #1a202c; font-weight: 600; }
.bill-wallet { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 6px; border-top: 1px solid #edf2f7; }
.bill-wallet strong { color: #1a202c; }

/* The rail's bands (utils/client_nav.py BANDS): a hairline where the work
   changes -- after the design library, and before Settings. The rail hid every
   separator when the only one sat after New QR group; these mark sections, so
   they are drawn, rail only. */
@media (min-width: 950px) {
  .nav-rail .nav-left .nav-group-sep {
    display: block !important; height: 1px; margin: 7px 14px;
    background: rgba(255,255,255,.2); flex: none;
  }
}

/* ── QR group progress strip (client/_group_progress.html) ─────────────────
   Five steps across the top of a group's Overview. One "current" step carries
   the filled button; done steps keep a quiet link; waiting steps are muted. */
.gp {
  list-style: none; margin: 0 0 16px; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px;
}
@media (max-width: 1100px) { .gp { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .gp { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .gp { grid-template-columns: minmax(0, 1fr); } }
.gp-step {
  border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px;
  background: #fff; display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.gp-head { display: flex; align-items: center; gap: 8px; }
.gp-mark {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; background: #edf2f7; color: #5f6b7a;
}
.gp-mark .nav-ic { width: 14px; height: 14px; stroke-width: 2.6; }
.gp-title { font-size: 13px; font-weight: 600; color: #1a202c; }
.gp-tag {
  margin-left: auto; font-size: 11px; padding: 1px 7px; border-radius: 9px;
  background: #edf2f7; color: #5f6b7a;
}
.gp-detail { font-size: 12px; color: #5f6b7a; overflow-wrap: anywhere; }
.gp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; }
/* An action link, like .link-action (2026-10-16): it was teal and underlined,
   and teal is the help-text colour. */
.gp-link {
  background: none; border: none; padding: 0; cursor: pointer; font-family: inherit;
  font-size: 12px; font-weight: 600; color: #5a67d8; text-decoration: none;
}
.gp-link:hover { color: #434190; text-decoration: underline; text-underline-offset: 2px; }
.gp-btn { margin: 0; }

.gp-done { background: #f6fbf8; border-color: #c6e6d3; }
.gp-done .gp-mark { background: #2f855a; color: #fff; }
.gp-working .gp-mark { background: #ebf4ff; color: #2b6cb0; }
.gp-current { border: 2px solid var(--rail-bg, #023151); padding: 9px 11px; }
.gp-current .gp-mark { background: var(--rail-bg, #023151); color: #fff; }
.gp-current .gp-btn { background: var(--rail-bg, #023151); color: #fff; border-color: var(--rail-bg, #023151); }
.gp-todo { background: #fafbfc; }
.gp-todo .gp-title { color: #5f6b7a; }
.gp-optional { border-style: dashed; }

/* ── Dashboard: Getting set up (utils/account_progress.py) ─────────────────
   The account-level twin of the group strip, drawn by the same partial. */
.setup-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px 4px; margin: 0 0 16px; }
.setup-card[hidden] { display: none; }
.setup-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.setup-head h2 { font-size: 15px; margin: 0; color: #1a202c; }
.setup-count { font-size: 12px; color: #5f6b7a; }
.setup-hide { margin-left: auto; }
/* Hidden: one line where the card was, so the checklist can come back. */
.setup-folded { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; font-size: 13px; color: #1a202c; }
.setup-folded[hidden] { display: none; }
.gp.gp-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1280px) { .gp.gp-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px)  { .gp.gp-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px)  { .gp.gp-6 { grid-template-columns: minmax(0, 1fr); } }

/* ── Page icons (the emoji sweep) ──────────────────────────────────────────
   Tenant pages draw icons from the same sprite as the nav (macros/nav.html),
   sized to the text by svg.nav-ic above. These are the few places that need
   something else. */
.live-dot { display: inline-flex; }
.live-dot .nav-ic { fill: currentColor; stroke: none; width: .75em; height: .75em; }
.th-arrow .nav-ic { width: 12px; height: 12px; vertical-align: -1px; }
.tb-dd-caret .nav-ic { width: 11px; height: 11px; vertical-align: -1px; }
.modal-close .nav-ic { width: 18px; height: 18px; }
/* A flex button drops the space between an icon and its label ("Overview"
   touched its eye). Gap only acts on flex and grid containers, and :where()
   keeps this at the specificity of the :has() alone, so the rail and app bar,
   which set their own gaps more specifically, keep theirs. */
:where(.btn, button, a, label, span, h2, h3, h4, p, div):has(> svg.nav-ic) { column-gap: .3em; }
/* A filled glyph where the outline one means "not this": the default star. */
.ic-filled svg.nav-ic { fill: currentColor; }

/* The sprite's sort arrows and caret as CSS masks, for the few places a
   pseudo-element draws the icon (sortable headers, a <summary> marker): a
   ::after cannot hold <use>. Same paths as macros/nav.html. The pseudo-element
   sets --ic and paints currentColor through it; data: is allowed by img-src. */
:root {
    --ic-sort: 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' stroke-linejoin='round'%3E%3Cpath d='M8 4v16m0-16L5 7m3-3 3 3M16 20V4m0 16-3-3m3 3 3-3'/%3E%3C/svg%3E");
    --ic-sort-up: 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' stroke-linejoin='round'%3E%3Cpath d='M12 19V5m0 0-5 5m5-5 5 5'/%3E%3C/svg%3E");
    --ic-sort-down: 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' stroke-linejoin='round'%3E%3Cpath d='M12 5v14m0 0-5-5m5 5 5-5'/%3E%3C/svg%3E");
    --ic-caret: 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' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
}

/* The group page's toolbar fits one row at full width by a few pixels, as it
   did with emoji: icons a touch smaller there keep Archive and Delete on it. */
.group-toolbar .btn .nav-ic { width: .9em; height: .9em; }

/* "How this works" pictures (macros/howto.html). A fold above a page's working
   area: open on a first visit, remembered once closed. The drawing keeps a
   readable minimum width and scrolls inside its own box on a phone rather than
   shrinking its 11px labels to nothing. */
.howto { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; margin: 0 0 16px; }
.howto > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
                   padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: #3a7368; }
.howto > summary::-webkit-details-marker { display: none; }
.howto > summary:focus-visible { outline: 2px solid #3a7368; outline-offset: -2px; border-radius: 10px; }
.howto-fig { margin: 0; padding: 0 14px 14px; }
.howto-img { overflow-x: auto; background: #f4f6f8; border-radius: 8px; padding: 10px; }
.howto-img img { display: block; width: 100%; max-width: 900px; min-width: 600px; height: auto; margin: 0 auto; }
.howto-fig figcaption { font-size: 13px; color: #3a7368; margin-top: 8px; max-width: 75ch; line-height: 1.55; }
/* Same picture on a workflow card in Help. */
.wf-pic { overflow-x: auto; background: #f4f6f8; border: 1px solid #e2e8f0; border-radius: 8px;
          padding: 8px; margin: 8px 0 12px; }
.wf-pic img { display: block; width: 100%; min-width: 560px; height: auto; }

/* ── QR group form: shared by New QR group and the group's Edit tab ─────────
   (client/_qr_group_*.html). One set of rules for both pages, so the same
   partial cannot be drawn two ways again. */
/* QR group info: what the group is on the left, the production lot on the
   right; one column when the lot does not apply or the screen is narrow. */
@media (min-width: 900px) {
    .grp-info-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
                     column-gap: 36px; align-items: start; }
    .grp-info-cols:not(:has(> .grp-info-lot:not([hidden]))) { grid-template-columns: minmax(0, 1fr); }
    .grp-info-lot { padding-left: 36px; border-left: 1px solid #e2e8f0; margin-left: -18px; }
}
.grp-info-main > .form-section-title:first-child,
.grp-info-lot > .form-section-title:first-child { margin-top: 0; }
/* Stacked under the left column, the lot needs the space a section gets. */
@media (max-width: 899px) { .grp-info-lot > .form-section-title:first-child { margin-top: 22px; } }
.grp-sec { margin-top: 22px; }
.grp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grp-lot-lead { max-width: 760px; margin: 0 0 12px; }
.grp-live-btn { margin-top: 8px; }
/* The intro and the scan page, side by side where there is room. */
.grp-scan-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
                 gap: 16px; align-items: start; margin-bottom: 20px; }
.grp-box { border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; }
.grp-scan-pair > .grp-box, .grp-scan-pair > p { margin: 0; }
/* One line of help under a group box's heading. */
.grp-box .grp-lead { font-size: 12px; color: #3a7368; margin: 0 0 10px; max-width: 760px; }
/* What a group box still needs before the group can be made. */
.grp-box .grp-need { font-size: 12px; color: #b7791f; margin: 8px 0 0; }
/* "What a scan shows": the phone outline beside the Scan page tab, on both
   group forms (_qr_group_scan_map.html). The edit page draws the group's real
   parts; the create page draws an example for the chosen QR action. */
.sx-wrap { display:grid; grid-template-columns:300px minmax(0,1fr);
           gap:22px; align-items:start; }
.sx-main { min-width:0; }
@media (max-width:1100px) { .sx-wrap { grid-template-columns:1fr; }
    .sx-map { position:static !important; max-width:360px; } }
.sx-map { position:sticky; top:70px; }
.sx-phone { border:2px solid #2d3748; border-radius:26px; padding:14px 10px 16px;
            background:#f7fafc; }
.sx-phone::before { content:''; display:block; width:56px; height:5px;
                    border-radius:3px; background:#cbd5e0; margin:0 auto 10px; }
.sx-cap { font-size:12px; color:#3a7368; margin:0 0 8px; }
.sx-blk { display:block; width:100%; text-align:left; font:inherit;
          background:#fff; border:1px solid #e2e8f0; border-radius:8px;
          padding:7px 10px; margin:0 0 6px; cursor:pointer; }
.sx-blk:hover, .sx-blk:focus-visible { border-color:#667eea;
          box-shadow:0 0 0 2px rgba(102,126,234,.25); outline:none; }
.sx-blk.is-empty { border-style:dashed; background:transparent; }
.sx-blk.is-fixed { cursor:default; background:#f0fff4; border-color:#c6f6d5; }
.sx-blk.is-fixed:hover { box-shadow:none; border-color:#c6f6d5; }
.sx-k { display:flex; justify-content:space-between; gap:6px;
        font-size:11px; font-weight:700; letter-spacing:.03em;
        text-transform:uppercase; color:#5568d3; }
.sx-k small { font-weight:500; text-transform:none; letter-spacing:0;
              color:#5f6b7a; display:inline; margin:0; font-size:11px; }
.sx-v { font-size:13px; color:#2d3748; margin-top:2px; overflow-wrap:anywhere;
        display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical;
        overflow:hidden; }
.sx-blk.is-empty .sx-v { color:#5f6b7a; }
.sx-row { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.sx-note { font-size:12px; background:#fffbeb; border:1px solid #f6e05e;
           color:#744210; border-radius:6px; padding:6px 8px; margin:8px 0 0; }
.sx-sep { border:0; border-top:1px dashed #cbd5e0; margin:10px 0 8px; }
.sx-flash { animation:sx-flash 1.6s ease-out 1; }
@keyframes sx-flash { from { box-shadow:0 0 0 4px rgba(102,126,234,.45); }
                      to { box-shadow:0 0 0 4px rgba(102,126,234,0); } }
/* The example has nothing to point at on a narrow screen, where it would push
   the controls a whole phone-height down: dropped there. A use case with no
   scan page drops it everywhere. */
.sx-phone.is-example .sx-v { font-style: italic; }
@media (max-width:1100px) { .sx-map.is-example, .sx-map.is-live { display: none; } }
/* The scan page form with its live outline: form left, outline right. */
.container-medium:has(> .rf-wrap.has-outline) { max-width: 1260px; }
.rf-wrap.has-outline { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
/* A gutter for the scroll button (#scroll-fab: right 14px, 42px wide): with the
   side rail open the box reaches the window edge and the button sat on the
   preview's right edge (2026-10-17). */
@media (min-width:1101px) { .rf-wrap.has-outline { margin-right: 48px; } }
.rf-main { min-width: 0; }
.rf-wrap .sx-map { top: 116px; max-height: calc(100vh - 128px); overflow-y: auto; }
body.is-embed .rf-wrap .sx-map { top: 64px; max-height: calc(100vh - 76px); }
/* The section links bar's way back to the outline (record_form.html). */
.section-nav .sn-outline { margin-left: auto; font: inherit; background: none; cursor: pointer;
                           color: #5568d3; }
/* In the group page's overlay (at most 1100px wide) the outline still fits
   from 820px, in a narrower column. */
@media (min-width:820px) and (max-width:1100px) {
    body.is-embed .rf-wrap.has-outline { grid-template-columns: minmax(0, 1fr) 250px; gap: 16px; }
    body.is-embed .sx-map.is-live { display: block; }
}
/* The part last clicked, and its section, stay marked. */
.sx-blk.is-current { border-color: #667eea; background: #eef1fe; box-shadow: 0 0 0 2px rgba(102,126,234,.3); }
.panel.rf-current { border-color: #667eea; box-shadow: 0 0 0 2px rgba(102,126,234,.25); }
/* A part each QR group sets: shown on the scan page form, not clickable. */
.sx-blk.is-group { cursor: default; background: #f7fafc; border-style: dashed; }
.sx-blk.is-group:hover { box-shadow: none; border-color: #e2e8f0; }
@media (max-width:1100px) { .rf-wrap.has-outline { grid-template-columns: minmax(0, 1fr); } }
.sx-wrap.no-map { grid-template-columns: minmax(0,1fr); }
.sx-wrap.no-map > .sx-map { display: none; }
/* Top of the scan page, and Verdict & checks. */
.top-panel { border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; margin-bottom: 20px; }
.top-panel h3 { margin: 0 0 4px; font-size: 14px; color: #5568d3; }
.top-panel > .help-text { margin: 0 0 10px; }
.top-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 18px; }
.top-grid select { width: 100%; height: 36px; padding: 0 10px; border: 1px solid #e2e8f0;
                   border-radius: 6px; background: #fff; font: inherit; }
.top-grid .help-text { margin-top: 4px; }
.vd-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.vd-note { margin: 0 0 8px; }
.vd-later { margin: 10px 0 0; color: #3a7368; font-size: 13px; }
.vd-later[hidden] { display: none; }
/* Settings > Copy detection (utils/copy_detection). */
.cd-wrap { grid-column: 1 / -1; }
.cd-lead { color: #3a7368; font-size: 13px; margin: 0 0 14px; max-width: 80ch; }
.cd-rule { border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.cd-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cd-badge { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 10px;
            background: #edf2f7; color: #4a5568; }
.cd-badge.is-own { background: var(--title-ribbon-bg); border: 1px solid var(--title-ribbon-line); color: #5a6b1f; }
.cd-about { color: #5f6b7a; font-size: 13px; margin: 4px 0 10px; }
.cd-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 16px; }
.cd-input { display: flex; align-items: center; gap: 6px; }
.cd-input input { width: 110px; }
.cd-input span, .cd-default { color: #5f6b7a; font-size: 12.5px; }
.cd-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.vd-table { border-collapse: collapse; font-size: 13px; color: #2d3748; }
.vd-k { padding: 3px 14px 3px 0; color: #5f6b7a; vertical-align: top; white-space: nowrap; }
/* Which product? -- chosen on New QR group, shown (read-only) on the group's page. */
.gp-product { background: #f8f9ff; border: 1px solid #e2e8f0; border-radius: 8px;
              padding: 14px 16px; margin-bottom: 14px; }
.gp-q { font-weight: 600; color: #5568d3; margin: 0 0 10px; }
.gp-cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
.gp-cols3 select { width: 100%; }
@media (max-width: 700px) { .gp-cols3 { grid-template-columns: 1fr; } }
.gp-opt { color: #5f6b7a; font-weight: 400; }
.gp-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.gp-row .help-text { margin: 0; flex: 1 1 280px; }

/* ══ Step chain (2026-10-11) ═══════════════════════════════════════════════
   Circles joined by a line, filled when done, each with its name, Required /
   Optional and one line on where it stands. Drawn by _step_chain.html (the
   group page's Overview, Help's workflows) and on New QR group's tab buttons
   (_qr_group_tabs.html), which use the same .sc-dot/.sc-name/.sc-tag pieces. */
.sc-chain { list-style: none; margin: 0 0 18px; padding: 6px 2px 4px; display: flex;
            align-items: flex-start; overflow-x: auto; }
.sc-step, .gen-tabs.sc-tabs .gen-tab { flex: 1 1 0; min-width: 128px; position: relative;
            text-align: center; padding: 0 6px; display: flex; flex-direction: column;
            align-items: center; gap: 2px; }
.sc-step + .sc-step::before, .gen-tabs.sc-tabs .gen-tab + .gen-tab::before {
            content: ''; position: absolute; top: 19px; right: calc(50% + 20px);
            width: calc(100% - 40px); height: 2px; background: #e2e8f0; }
.sc-step.sc-done + .sc-step::before,
.gen-tabs.sc-tabs .gen-tab.sc-done + .gen-tab::before { background: #2f855a; }
.sc-where { font-size: 11px; font-weight: 700; letter-spacing: .03em; color: #5568d3; min-height: 16px; }
.sc-chain:has(.sc-where) .sc-step + .sc-step::before { top: 37px; }
.sc-dot { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
          font-weight: 700; font-size: 14px; border: 2px solid #e2e8f0; background: #fff;
          color: #5f6b7a; position: relative; z-index: 1; margin-bottom: 4px; }
.sc-dot svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3;
              stroke-linecap: round; stroke-linejoin: round; }
.sc-done .sc-dot { background: #2f855a; border-color: #2f855a; color: #fff; }
.sc-current .sc-dot, .sc-need .sc-dot { border-color: #b7791f; color: #b7791f; background: #fffbeb; }
.sc-current .sc-dot { box-shadow: 0 0 0 4px rgba(183,121,31,.18); }
.sc-todo { opacity: .6; }
.sc-name { font-weight: 700; font-size: 13.5px; color: #2d3748; }
.sc-tag { font-size: 11px; font-weight: 700; letter-spacing: .03em; border-radius: 999px;
          padding: 1px 8px; border: 1px solid #e2e8f0; background: #f1f4f8; color: #5f6b7a; }
.sc-tag-required { background: #fffbeb; border-color: #f6e05e; color: #7a4e0e; }
.sc-tag-done { background: #e6f4ec; border-color: #b7dfc6; color: #2f855a; }
.sc-detail { font-size: 12px; color: #5f6b7a; line-height: 1.35; max-width: 24ch; }
.sc-actions { display: flex; gap: 10px; justify-content: center; margin-top: 4px; flex-wrap: wrap; }
.sc-link { background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px; color: #5a67d8;
           font-weight: 600; text-decoration: none; cursor: pointer; }
.sc-link:hover { text-decoration: underline; text-underline-offset: 2px; }
/* The compact chain (_step_chain.html mini_chain): a recall's or a transfer's
   row on the supply chain pages. Same pieces, sized for a table cell, plus two
   states the full chain never needs: warn (needs someone -- Disputed) and stop
   (ended early -- Cancelled). Line top = half the 22px dot. */
.sc-chain.sc-mini { margin: 0; padding: 2px 0; min-width: 240px; }
.sc-mini .sc-step { min-width: 66px; padding: 0 3px; gap: 1px; }
.sc-mini .sc-step + .sc-step::before { top: 11px; right: calc(50% + 12px); width: calc(100% - 24px); }
.sc-mini .sc-dot { width: 22px; height: 22px; font-size: 11px; border-width: 2px; margin-bottom: 2px; }
.sc-mini .sc-dot svg { width: 12px; height: 12px; }
.sc-mini .sc-current .sc-dot { box-shadow: 0 0 0 3px rgba(183,121,31,.18); }
.sc-mini .sc-name { font-size: 12px; line-height: 1.25; }
.sc-mini .sc-detail { font-size: 11px; max-width: 18ch; }
.sc-warn .sc-dot { border-color: #b7791f; background: #b7791f; color: #fff; }
.sc-warn .sc-name { color: #7a4e0e; }
.sc-stop .sc-dot { border-color: #a0aec0; background: #edf2f7; color: #5f6b7a; }
/* The group forms' tabs drawn as the chain (_qr_group_tabs.html). Overrides the
   underline-tab look both pages still carry in their own <style>. */
.gen-tabs.sc-tabs { display: flex; gap: 0; border-bottom: 1px solid #e2e8f0; margin: 0 0 18px;
                    padding: 6px 2px 12px; overflow-x: auto; }
.gen-tabs.sc-tabs .gen-tab { border: 0; background: none; cursor: pointer; font: inherit;
                    color: inherit; margin: 0; padding: 0 6px; }
.gen-tabs.sc-tabs .gen-tab[hidden] { display: none; }
.gen-tabs.sc-tabs .gen-tab.sc-done .sc-dot { background: #2f855a; border-color: #2f855a; color: #fff; }
.gen-tabs.sc-tabs .gen-tab.sc-need .sc-dot { border-color: #b7791f; color: #b7791f; background: #fffbeb; }
.gen-tabs.sc-tabs .gen-tab.is-on .sc-dot { box-shadow: 0 0 0 4px rgba(85,104,211,.25); }
.gen-tabs.sc-tabs .gen-tab.is-on .sc-name { color: #5568d3; }
.gen-tabs.sc-tabs .gen-tab:hover .sc-name { color: #5568d3; }
.gen-tabs.sc-tabs .gen-tab:focus-visible { outline: 3px solid rgba(85,104,211,.45); outline-offset: 2px; border-radius: 8px; }
.chain-missing { font-size: 12.5px; color: #7a4e0e; margin: 6px 0 0; }
/* The group ID column on every QR group list (main, draft, archived, deleted,
   admin): narrow, right-aligned digits, quiet. */
th.col-id, td.col-id { width: 64px; text-align: right; white-space: nowrap;
                       font-variant-numeric: tabular-nums; color: #5f6b7a; }
/* The bar of QR group lists on every list page (_group_list_nav.html). */
.grp-lists { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.grp-lists-link { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
                  border: 1px solid #e2e8f0; border-radius: 999px; background: #fff;
                  color: #2d3748; font-size: 13px; font-weight: 600; text-decoration: none; }
.grp-lists-link:hover { border-color: #5568d3; color: #5568d3; text-decoration: none; }
.grp-lists-link.is-on { background: #5568d3; border-color: #5568d3; color: #fff; }
.grp-lists-n { font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums;
               background: #f1f4f8; color: #5f6b7a; border-radius: 999px; padding: 0 7px; }
.grp-lists-link.is-on .grp-lists-n { background: rgba(255,255,255,.25); color: #fff; }

/* Required fields (todo 3.16) -- ONE marker. static/js/required-marks.js adds it
   to the label of every [required] control; a field needed only to PUBLISH (scan
   page fields) renders the same span itself. Never type an asterisk into a label. */
.req-mark { color: #c53030; font-weight: 700; margin-left: 3px; }


/* === LINKS (2026-10-16) — one look per kind, instead of a colour per link ===
   Indigo #5a67d8 (not the brand #667eea, which is too light for small text on
   white). Help text stays teal and data stays grey; neither is a link colour.
   .crumbs        the breadcrumb macro (macros/nav.html) — every page's trail
   .link-action   a small standalone action: "New print job →", "view codes",
                  "Full map", "Download". Underlined only on hover.
   .link-inline   a link inside a sentence: keeps its underline, so it still
                  reads as a link among words. */
.crumbs { font-size: 13px; color: #5f6b7a; margin-bottom: 10px; }
.crumbs a { color: #5a67d8; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 2px; }
.crumbs .crumb-sep { margin: 0 6px; color: #5f6b7a; }
.crumbs .crumb-here { color: #2d3748; }
.link-action { color: #5a67d8; font-weight: 600; text-decoration: none; cursor: pointer; }
.link-action:hover { color: #434190; text-decoration: underline; text-underline-offset: 2px; }
.link-action.is-small { font-size: 12px; }
.link-inline { color: #5a67d8; text-decoration: underline; text-underline-offset: 2px; }
.link-inline:hover { color: #434190; }

/* Leaflet maps (code detail, analytics, analytics map). Its panes and controls
   carry z-index 400-1000 inside a container that is no stacking context, so the
   zoom control (1000) rose over the rail's menus (also 1000) and won by coming
   later (2026-10-18). Isolated, the map's layers stack only among themselves. */
.leaflet-container { isolation: isolate; }

/* ── Quality hold and release (Manage Groups > Quality, 2026-10-20) ───────── */
.q-h3 { font-size:15px; margin:16px 0 6px; }
.q-chip { display:inline-block; font-size:12px; font-weight:600; border-radius:10px; padding:1px 8px; white-space:nowrap; }
.q-chip.q-released    { background:#e6f6ec; color:#22543d; }
.q-chip.q-inspection  { background:#fefcbf; color:#744210; }
.q-chip.q-quarantined { background:#feebc8; color:#7b341e; }
.q-chip.q-blocked     { background:#fed7d7; color:#822727; }
.q-chip.q-destroyed   { background:#e2e8f0; color:#2d3748; }
.q-check { display:flex; gap:8px; align-items:center; font-weight:normal; margin:0; }
.q-check input { width:auto; margin:0; }
.q-refs { margin:0 0 12px; }
.q-refs summary { cursor:pointer; font-size:13px; color:#3a7368; margin-bottom:6px; }
/* The group page's line under its chain while the lot is not released. */
.grp-quality-note { background:#fffaf0; border:1px solid #fbd38d; border-radius:8px; padding:8px 10px; color:#7b341e; margin:8px 0; font-size:13px; display:flex; gap:10px; flex-wrap:wrap; align-items:baseline; }
.grp-quality-note .grp-quality-why { color:#5f6b7a; }
/* The code page's Void panel (any code, 2026-10-20). */
.void-panel { border:1px solid #feb2b2; background:#fff5f5; border-radius:8px; padding:10px 12px; margin:10px 0; }
.void-panel[hidden] { display:none; }
.void-row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.void-row label { margin:0; font-weight:600; font-size:13px; }
.void-row select, .void-row input { width:auto; min-width:160px; }
.void-msg { color:#9b2c2c; font-size:12px; margin-top:6px; }

/* ── GS1 links (client/gs1_links.html, GS1 resolver R2) ─────────────────── */
.gs1l-intro { max-width: 820px; margin: 0 0 8px; }
.gs1l-dl { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #5f6b7a;
           overflow-wrap: anywhere; margin: 0 0 8px; }
.gs1l-lots { font-size: 13px; margin: 0 0 10px; }
.gs1l-lots .is-current { font-weight: 700; text-decoration: underline; }
.gs1l-locked { background: #fffbeb; border: 1px solid #f6e05e; color: #744210; border-radius: 8px;
               padding: 10px 12px; font-size: 13px; margin: 0 0 12px; }
.gs1l-sub { font-size: 12px; color: #5f6b7a; margin-top: 2px; }
.gs1l-href { overflow-wrap: anywhere; max-width: 260px; }
.gs1l-off { color: #c05621; font-weight: 600; }
.gs1l-inherited td { background: #fafbfc; }
.gs1l-empty { text-align: center; color: #5f6b7a; }
.gs1l-actions { white-space: nowrap; }
.gs1-register { border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; margin: 14px 0; max-width: 820px; }
.gs1-register .help-text { margin: 4px 0 8px; }
.gs1-register-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 4px 0; }
.gs1-register-row .gs1l-dl { margin: 0; }
.gs1-register-label { font-size: 12px; font-weight: 600; min-width: 110px; }
.gs1l-inline { display: inline; }
.gs1l-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.gs1l-wide { grid-column: 1 / -1; }
.gs1l-check { display: flex; gap: 8px; align-items: flex-start; font-weight: normal; margin: 6px 0; }
.gs1l-check input { width: auto; margin-top: 3px; }
.gs1l-buttons { display: flex; gap: 10px; margin-top: 12px; }

/* ── Your GS1 domain (client/gs1_domain.html, GS1 resolver R4) ───────────── */
.gs1d-mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; overflow-wrap: anywhere; }
.gs1d-claim { max-width: 460px; }
.gs1d-status { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 6px 0 12px; font-size: 14px; }
.gs1d-status dt { color: #5f6b7a; }
.gs1d-status dd { margin: 0; }
.gs1d-live { color: #276749; font-weight: 700; }
.gs1d-h3 { font-size: 14px; margin: 14px 0 6px; }
.gs1d-actions { display: flex; gap: 10px; margin: 12px 0; }

/* ── GS1 setup (client/gs1_setup.html, migration 437) ────────────────────── */
.gs1s-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px;
             align-items: start; max-width: 820px; margin: 8px 0 14px; }
.gs1s-form > .btn { justify-self: start; margin-bottom: 15px; }
/* A lone button in a form is centred site-wide (place-self: center, auto side margins, at
   (0,4,1)); in these grids it sits at the start of its row, at the top. Same specificity, later. */
form.gs1s-form > .btn:only-of-type.btn { margin-left: 0; margin-right: 0; justify-self: start; align-self: start; }
.gs1s-wide { grid-column: 1 / -1; }
.gs1s-check { display: flex; gap: 8px; align-items: flex-start; font-weight: normal; }
.gs1s-check input { width: auto; margin-top: 3px; }
.gs1s-h3 { font-size: 14px; margin: 16px 0 6px; }
.gs1s-ok { color: #276749; font-weight: 600; }
form.gs1s-form > .btn.gs1s-inline-btn { margin-top: 25px; margin-bottom: 0; }   /* level with the inputs (label 22px + 4px) */
.gs1s-actions { white-space: nowrap; width: 1%; }

/* Integrations tab row (client/data_exchange.html, client/gs1_setup.html).
   Same tab treatment as Print & Download. */
.dx-tabs { display:flex; gap:8px; margin-bottom:10px; flex-wrap:wrap; }
.dx-tab { padding:6px 14px; border-radius:7px; font-size:14px; font-weight:600;
          text-decoration:none; background:#edf2f7; color:#4a5568; }
.dx-tab:hover  { background:#e2e8f0; color:#2d3748; }
.dx-tab.active { background:#5a67d8; color:#fff; }

/* ── Compliance › Overview (client/compliance.html, utils/compliance.py) ─── */
.cmp-intro { max-width: 820px; margin: 0 0 8px; }
.cmp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.cmp-title { font-size: 17px; margin: 0 0 4px; }
.cmp-meta { font-size: 12.5px; color: #5f6b7a; }
.cmp-kind { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 10px;
            margin-right: 6px; text-transform: uppercase; letter-spacing: .04em; }
.cmp-kind-standard { background: #e6fffa; color: #285e61; }
.cmp-kind-regulation { background: #ebf4ff; color: #2c5282; }
.cmp-status { font-size: 13px; }
.cmp-chain { overflow-x: auto; margin: 6px 0 10px; }
.cmp-open { margin-top: 4px; }
.gs1s-warn { color: #c05621; font-weight: 600; }
.rf-gs1-lock { font-size: 12px; margin: 6px 0 0; }
.gs1d-switches { border-top: 1px solid #e2e8f0; margin-top: 14px; padding-top: 10px; max-width: 760px; }

/* ── Code page: the code's GS1 DataMatrix (design G7) ───────────────────── */
.gs1dm-code { display: inline-flex; gap: 8px; align-items: center; font-size: 11px; color: #5f6b7a; }
.gs1dm-code img { image-rendering: pixelated; border: 1px solid #e2e8f0; }

/* Purchases closed (client/_purchases_closed.html, 2026-10-24): on Buy, Cart
   and Plan & invoices while "Paid plans on sale" is off. */
.purchases-closed { max-width: 1100px; margin: 12px auto; padding: 10px 14px; border-radius: 8px;
                    border: 1px solid #f6ad55; background: #fffaf0; color: #7b341e; font-size: 14px; }
.purchases-closed a { color: #7b341e; font-weight: 600; margin-left: 4px; }

/* Sign-up consent (public/register.html, 2026-10-24). */
.reg-consent { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 10px;
               font-size: 13.5px; color: #2d3748; cursor: pointer; }
.reg-consent input { margin-top: 3px; width: auto; flex: 0 0 auto; }
.reg-consent a { color: #5568d3; }

/* ── A page in a framed dialog (shared/_frame_dialog.html, 2026-10-26) ──
   Links a module puts on a core page (data-frame-dialog) open their page here
   in embed mode, e.g. Traceability's packing explorer. */
.fdlg-overlay { position:fixed; inset:0; z-index:9400; background:rgba(15,23,42,.45);
                display:flex; align-items:center; justify-content:center; padding:16px; }
.fdlg-overlay[hidden] { display:none; }
.fdlg { background:#fff; border-radius:12px; width:min(1000px, 100%); height:min(86vh, 900px);
        display:flex; flex-direction:column; padding:14px 16px; box-shadow:0 20px 60px rgba(0,0,0,.3); }
.fdlg-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.fdlg-head h3 { margin:0; font-size:16px; color:#2d3748; }
.fdlg-box { flex:1; position:relative; display:flex; min-height:0; }
.fdlg-box iframe { flex:1; width:100%; border:1px solid #e2e8f0; border-radius:8px; background:#f5f6f8; }
.fdlg-loading { position:absolute; inset:0; z-index:1; display:flex; gap:10px; align-items:center;
                justify-content:center; background:#fff; color:#5f6b7a; font-size:13px; border-radius:8px; }
.fdlg-loading[hidden] { display:none; }
.fdlg-spinner { width:16px; height:16px; border-radius:50%; border:2px solid #cbd5e0;
                border-top-color:#667eea; animation:fdlg-spin .7s linear infinite; }
@keyframes fdlg-spin { to { transform:rotate(360deg); } }

/* ── Gateways (macros/gateway.html; docs/ranjan/GATEWAY-PAGES.md, 2026-10-29) ──
   A number, card or section on a summary page that opens the list or page
   behind it. One look everywhere: the card keeps its own shape (dash-stat,
   metric, kpi …) and gains the hover border, focus ring and → cue. */
a.gw-tile { display:block; color:inherit; text-decoration:none; cursor:pointer;
            transition:border-color .15s, box-shadow .15s; }
a.gw-tile:hover { border-color:var(--color-primary); box-shadow:0 2px 8px rgba(102,126,234,.18); }
a.gw-tile:focus-visible, a.gw-row-link:focus-visible, a.gw-sec-go:focus-visible {
    outline:2px solid var(--color-primary); outline-offset:2px; }
.gw-cue { float:right; margin-left:6px; color:var(--color-primary); font-weight:700; }
.gw-sec-go { margin-left:auto; font-size:12px; font-weight:600; color:var(--color-primary);
             text-decoration:none; white-space:nowrap; }
.gw-sec-go:hover { text-decoration:underline; }
a.gw-row-link { display:flex; color:inherit; text-decoration:none; border-radius:4px; }
a.gw-row-link:hover { background:#f7fafc; }
a.gw-row-link:hover .bar-label { color:var(--color-primary); text-decoration:underline; }
a.gw-link { color:var(--color-primary); text-decoration:none; }
a.gw-link:hover { text-decoration:underline; }
.gw-showing { margin:6px 0 10px; padding:6px 12px; border-radius:6px; background:#eef1fd;
              border-left:3px solid var(--color-primary); font-size:13px; color:#2d3748; }
.tr-panel-h { display:flex; align-items:baseline; gap:8px; }

/* Help opened at one step or reference term (static/js/help-anchor.js): a brief
   mark on it so the eye lands where Help was asked for. */
.help-hit { animation: help-hit 2.2s ease-out; border-radius: 4px; }
@keyframes help-hit {
    0%, 35% { background: #fef3c7; box-shadow: 0 0 0 4px #fef3c7; }
    100%    { background: transparent; box-shadow: 0 0 0 4px transparent; }
}

/* Help text's paragraphs and bullets (utils/help_content.help_text_html). */
.help-p { margin: 6px 0 0; }
.help-ul { margin: 4px 0 4px 18px; padding: 0; }
.help-ul li { margin-bottom: 2px; }

/* Journey map (2026-10-20; shared since 2026-11-03 by the code page and the
   Traceability Trace result, static/js/journey-map.js): expected vs actual route. */
.jr-legend { display:flex; flex-wrap:wrap; gap:6px 16px; font-size:11.5px; color:#5f6b7a; margin:6px 0 2px; }
.jr-legend span { display:inline-flex; align-items:center; gap:6px; }
.jr-key { width:22px; height:0; border-top:3px solid #2f855a; display:inline-block; }
.jr-key.is-expected { border-top:3px dashed #a0aec0; }
.jr-key.is-transit { border-top:3px dashed #d69e2e; }
.jr-key.is-missing { border-top:3px solid #c53030; }
.jr-key.is-scans { border-top:2px dotted #3b82f6; }
.jr-dot { width:10px; height:10px; border-radius:50%; background:#c53030; display:inline-block; }
.jr-note { font-size:12px; color:#3a7368; margin-top:4px; }
.jr-num { background:#2d3748; color:#fff; border-radius:50%; width:20px; height:20px; display:flex;
          align-items:center; justify-content:center; font:600 11px -apple-system,sans-serif; border:2px solid #fff; }
.jr-stop { background:#fff; color:#2d3748; border:2px solid #a0aec0; border-radius:4px; width:14px; height:14px; }
.jr-origin { background:#c05621; border:2px solid #fff; border-radius:3px; width:16px; height:16px; }
.leaflet-tooltip.jr-place { font-size:11px; font-weight:600; padding:1px 6px; color:#2d3748;
                            background:rgba(255,255,255,.92); border:1px solid #cbd5e0; box-shadow:none; }
.jr-map { height:340px; border-radius:8px; border:1px solid #e2e8f0; margin:6px 0; }

/* DPP "ahead of the rules" notice on the Product Passport pages
   (templates/client/_dpp_early_notice.html, 2026-11-04). */
.dpp-early-note { margin: 10px 0 14px; padding: 10px 14px; border: 1px solid #f6d7a7;
                  border-left: 3px solid #dd6b20; border-radius: 8px; background: #fffaf0;
                  color: #4a3b2a; font-size: 13.5px; line-height: 1.5; }
.dpp-early-note strong { color: #7b341e; margin-right: 4px; }

/* Generate card: free overs for printing waste (migration 425). */
.gen-overs { display: flex; align-items: center; gap: 8px; margin: 12px 0 0;
             font-size: 13px; color: #2d3748; cursor: pointer; }
.gen-overs input { width: auto; margin: 0; }
.gen-overs-hint { margin: 4px 0 0 24px; font-size: 12px; color: #3a7368; max-width: 66ch; }
.gen-overs-last { margin-bottom: 12px; }
.gen-cancel { margin-top: 10px; }
.btn.gen-cancel[hidden] { display: none; }

/* Jobs tray in the app bar (2026-11-11). Same badge rules as the cart: the
   selector must outrank `.nav-links span` (0,2,0) or the pill flattens. */
.nav-links .jobs-btn { position: relative; }
.nav-links .jobs-btn .jobs-n:empty { display: none; }
.nav-links .jobs-btn .jobs-n {
    position: absolute; top: 4px; right: 4px; left: auto;
    min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
    background: #2b6cb0; color: #fff; border-radius: 8px;
    font-size: 10px; font-weight: 700; line-height: 16px; justify-content: center;
}
.nav-dropdown-menu.jobs-menu { min-width: 300px; max-width: 360px; right: 0; left: auto; }
.jobs-menu .jobs-list { max-height: 60vh; overflow-y: auto; padding: 4px 0; }
.jobs-menu .jobs-empty { padding: 10px 12px; font-size: 13px; color: #5f6b7a; }
.jobs-menu .jobs-row { padding: 8px 12px; border-bottom: 1px solid #edf2f7; font-size: 13px; }
.jobs-menu .jobs-row:last-child { border-bottom: 0; }
.jobs-menu .jobs-top { display: flex; justify-content: space-between; gap: 8px; }
.nav-dropdown-menu.jobs-menu span.jobs-title { padding: 0; color: #2d3748; font-weight: 600; display: inline; }
.nav-dropdown-menu.jobs-menu span.jobs-st { padding: 0; font-size: 11px; color: #5f6b7a; display: inline; white-space: nowrap; }
.jobs-menu .is-running span.jobs-st, .jobs-menu .is-queued span.jobs-st { color: #2b6cb0; }
.jobs-menu .is-done span.jobs-st { color: #276749; }
.jobs-menu .is-failed span.jobs-st { color: #c53030; }
.jobs-menu .jobs-group { color: #5f6b7a; font-size: 12px; margin-top: 2px; }
.jobs-menu .jobs-note { color: #c05621; font-size: 12px; margin-top: 2px; }
.jobs-menu .jobs-bar { height: 4px; background: #e2e8f0; border-radius: 2px; margin-top: 6px; overflow: hidden; }
.jobs-menu .jobs-bar-fill { height: 100%; background: #3182ce; }
.jobs-menu .jobs-acts { display: flex; gap: 12px; margin-top: 6px; align-items: center; }
.nav-dropdown-menu.jobs-menu .jobs-acts a { padding: 0; display: inline; color: #2b6cb0; font-size: 12px; }
.jobs-menu .jobs-cancel { background: none; border: 0; padding: 0; color: #c53030; font-size: 12px; cursor: pointer; }

/* Rail panels: section headings inside a menu (2026-11-11). Same band as the
   Plan & billing headings; the first one needs no gap above it. */
.nav-dropdown-menu .nav-dropdown-label.nav-section:first-child { margin-top: 0; }
.mob-heading { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
               color: rgba(255,255,255,0.55); padding: 8px 16px 2px 36px; }

/* A group's serial range under its name in the group lists (mig 428). */
.grp-serials { font-size: 12px; color: #5f6b7a; margin-top: 3px; font-variant-numeric: tabular-nums; }

/* Settings > Code usage (2026-11-11). */
.cu-intro { color: #3a7368; font-size: 13px; margin: 0 0 12px; max-width: 760px; }
.cu-note { color: #5f6b7a; font-size: 12px; margin: 6px 0 12px; }
.cu-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 12px 0; font-size: 13px; color: #4a5568; }
.cu-filters label { display: flex; flex-direction: column; gap: 3px; }
.cu-filters input, .cu-filters select { width: auto; padding: 6px 8px; }
.cu-num { text-align: right; font-variant-numeric: tabular-nums; }
.cu-ser { font-size: 12px; color: #5f6b7a; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cu-sub { font-size: 12px; color: #5f6b7a; margin-top: 2px; }
.cu-h { margin: 22px 0 6px; }

/* Print & Download > Stock labels (2026-11-11). */
.sl-h { margin-top: 0; }
.sl-row, .sl-grid { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; font-size: 13px; color: #4a5568; }
.sl-row label, .sl-grid label { display: flex; flex-direction: column; gap: 4px; }
.sl-row label.sl-trial { flex-direction: row; align-items: center; gap: 6px; flex-basis: 100%; }
.sl-row input, .sl-grid input, .sl-grid select { width: auto; min-width: 160px; }
.sl-result { margin: 12px 0; border-radius: 6px; padding: 10px 12px; font-size: 13px; }
.sl-result.hd-ok  { background: #f0fff4; border: 1px solid #9ae6b4; color: #22543d; }
.sl-result.hd-pre { background: #f7fafc; border: 1px solid #e2e8f0; color: #4a5568; }
.sl-result.hd-err { background: #fff5f5; border: 1px solid #feb2b2; color: #c53030; }
.sl-acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }

/* The Helper (2026-11-11): the What next drawer, grown. */
#what-next-fab { position: relative; }
#what-next-fab .hp-n:empty { display: none; }
#what-next-fab .hp-n { margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: #5a67d8; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.hp-sec { display: grid; gap: 8px; }
.hp-sec[hidden] { display: none; }
.hp-h { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #023151;
        background: #eef2f7; border-left: 3px solid var(--brand-orange, #F26429); padding: 5px 10px; }
.hp-muted { font-size: 12.5px; color: #5f6b7a; }
.hp-next { display: grid; gap: 8px; }
.hp-item { display: grid; gap: 2px; border: 1px solid #e2e8f0; border-radius: 9px; padding: 10px 12px;
           background: #f8fafc; text-decoration: none; }
.hp-item:hover { border-color: #a3bffa; }
.hp-item.is-alert { border-left: 3px solid #c53030; }
.hp-item.is-wait  { border-left: 3px solid #2b6cb0; }
.hp-item.is-todo  { border-left: 3px solid #d69e2e; }
.hp-item-t { font-size: 13.5px; font-weight: 600; color: #2d3748; }
.hp-item-d { font-size: 12.5px; color: #5f6b7a; line-height: 1.45; }
.hp-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: hp; }
.hp-step { counter-increment: hp; display: grid; gap: 2px; padding: 8px 10px 8px 38px; position: relative;
           border: 1px solid #e2e8f0; border-radius: 8px; }
.hp-step::before { content: counter(hp); position: absolute; left: 10px; top: 9px; width: 20px; height: 20px;
           border-radius: 50%; background: #e2e8f0; color: #4a5568; font-size: 11px; font-weight: 700;
           text-align: center; line-height: 20px; }
.hp-step.is-done::before { content: '✓'; background: #2f855a; color: #fff; }
.hp-step.is-current { border-color: #5a67d8; background: #f5f7ff; }
.hp-step.is-current::before { background: #5a67d8; color: #fff; }
.hp-step a { font-size: 13.5px; font-weight: 600; color: #3b5bdb; text-decoration: none; }
.hp-start { display: grid; gap: 6px; }
.hp-try-note { margin: 0 0 6px; font-size: 12px; }
.tr-check-list { list-style: none; margin: 0; padding: 0; font-size: 12px; color: #5f6b7a; }
.tr-check-list li.is-done { color: #276749; }
.hp-start a { font-size: 13.5px; color: #3b5bdb; text-decoration: none; padding: 6px 10px;
              border: 1px solid #e2e8f0; border-radius: 8px; }
.hp-start a:hover { background: #f5f7ff; }
.hp-ask { display: flex; gap: 6px; }
.hp-ask input { flex: 1; min-width: 0; }
/* Docked beside the Dashboard on a wide screen: the page makes room for it. */
html.helper-docked body.client-page { padding-right: 380px; }
html.helper-docked #what-next-drawer { top: var(--appbar-h, 56px); box-shadow: -1px 0 0 #e2e8f0; }

/* Helper: the header and "Something else" stay put; only the middle scrolls. */
#what-next-drawer .wn-body { flex: 1 1 auto; min-height: 0; }
.hp-foot { flex: none; display: grid; gap: 8px; padding: 12px 18px 16px; background: #fff;
           border-top: 1px solid #e2e8f0; box-shadow: 0 -6px 12px -10px rgba(0,0,0,.18); }
.run-levels tfoot .run-total td { border-top: 2px solid #cbd5e0; background: #f7fafc; }

/* Generate card: Your code numbering (migration 432). */
.gen-ref { margin: 4px 0 12px; }
.gen-ref summary { list-style: none; cursor: pointer; }
.gen-ref summary::-webkit-details-marker { display: none; }
.gen-ref-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 0 24px; font-size: 13px; color: #4a5568; }
.gen-ref-grid label { display: flex; flex-direction: column; gap: 3px; }
.gen-ref-grid input { width: 130px; }
.tr-acts { display: flex; gap: 12px; align-items: center; }
.tr-acts form { margin: 0; }
