    * { margin: 0; padding: 0; box-sizing: border-box; }
    :root {
      color-scheme: only dark;
      --primary: #7e4cbc;
      --primary-dim: #6a3fa3;
      --primary-soft: rgba(126, 76, 188, 0.12);
      --primary-faint: rgba(126, 76, 188, 0.05);
      --primary-glow: rgba(126, 76, 188, 0.15);

      --bg-dark: #0b0b0c;
      --bg-card: #101012;
      --bg-card-hover: #161618;
      --bg-input: #1c1c1f;
      --border: #1f1f23;
      --border-strong: #2a2a30;

      --text: #F1F3F5;
      --text-primary: #F1F3F5;
      --text-mid: #a0a0a8;
      --text-secondary: #a0a0a8;
      --text-muted: #5a5a60;
      --text-dim: #7a7a82;

      --red: #FF6B6B;
      --orange: #FFA94D;
      --teal: #20C997;
      --positive: #69DB7C;
      --gold: #FFD43B;

      --radius: 8px;
      --radius-sm: 6px;
      --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    }
    html[data-theme="purple"] { --primary:#7e4cbc; --primary-dim:#6a3fa3; --primary-soft:rgba(126,76,188,0.12); --primary-faint:rgba(126,76,188,0.05); --primary-glow:rgba(126,76,188,0.15); }
    html[data-theme="blue"]   { --primary:#2e60cf; --primary-dim:#2752b0; --primary-soft:rgba(46,96,207,0.12);  --primary-faint:rgba(46,96,207,0.05);  --primary-glow:rgba(46,96,207,0.15); }
    html[data-theme="red"]    { --primary:#bc4f48; --primary-dim:#a3433d; --primary-soft:rgba(188,79,72,0.12);  --primary-faint:rgba(188,79,72,0.05);  --primary-glow:rgba(188,79,72,0.15); }
    html[data-theme="green"]  { --primary:#31a032; --primary-dim:#298a2a; --primary-soft:rgba(49,160,50,0.12);  --primary-faint:rgba(49,160,50,0.05);  --primary-glow:rgba(49,160,50,0.15); }

    body { font-family: var(--font-sans); background: var(--bg-dark); color: var(--text); min-height: 100vh; overflow-x: hidden; }

    /* ===== AUTH OVERLAY ===== */
    .auth-overlay { position: fixed; inset: 0; background: var(--bg-dark); z-index: 9999; display: flex; align-items: center; justify-content: center; }
    .auth-overlay.hidden { display: none; }
    html.auth-loading .auth-card { display: none; }
    html.auth-loading .auth-loading-bar { display: block; }
    .auth-loading-bar { display: none; width: 240px; height: 3px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; position: relative; }
    .auth-loading-bar::after { content: ''; position: absolute; top: 0; left: 0; height: 100%; width: 35%; background: var(--primary); border-radius: 2px; animation: authSlide 1.1s ease-in-out infinite; }
    @keyframes authSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(370%); } }
    .auth-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 40px; max-width: 420px; width: 90%; text-align: center; font-family: 'Segoe UI', system-ui, sans-serif; }
    .auth-card img { width: 48px; height: 48px; margin: 0 auto 16px; display: block; object-fit: contain; }
    .auth-title { font-size: 22px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
    .auth-subtitle { font-size: 14px; color: var(--text-dim); margin-bottom: 24px; }
    .auth-input { width: 100%; padding: 12px 16px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 15px; margin-bottom: 16px; outline: none; font-family: inherit; }
    .auth-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
    .auth-btn { width: 100%; padding: 12px; background: var(--primary); color: #0b0b0c; font-weight: 700; font-size: 15px; border: none; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; }
    .auth-btn:hover { opacity: 0.9; }
    .auth-error { color: var(--red); font-size: 13px; margin-bottom: 14px; min-height: 18px; }
    .auth-privacy { font-size: 11px; color: var(--text-muted); line-height: 1.5; margin-top: 8px; }
    .auth-privacy strong { color: var(--text-dim); font-weight: 600; }

    /* ===== HEADER ===== */
    .header {
      display: flex; align-items: center; gap: 10px;
      padding: 14px 24px; border-bottom: 1px solid var(--border);
      background: var(--bg-dark); position: sticky; top: 0; z-index: 50;
    }
    .header-logo { width: 26px; height: 26px; border: none; background: transparent; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; }
    .header-logo img { width: 26px; height: 26px; object-fit: contain; }
    .burger {
      background: transparent; border: none;
      color: var(--text-mid); cursor: pointer;
      padding: 4px 6px; margin-right: -2px;
      display: inline-flex; align-items: center;
      border-radius: 4px;
      transition: color 0.15s, background 0.15s;
    }
    .burger:hover { color: var(--primary); background: var(--bg-card); }
    .burger svg { display: block; }
    .header-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; color: var(--text-dim); text-transform: uppercase; }
    .header-title { font-size: 15px; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: 0.02em; }
    .header-title:hover { color: var(--primary); }
    .header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
    .auth-user-info { display: flex; align-items: center; gap: 10px; }
    .user-name { font-size: 13px; color: var(--text-mid); }
    .logout-btn { background: transparent; border: 1px solid var(--border); color: var(--text-mid); padding: 6px 12px; border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; font-family: inherit; }
    .logout-btn:hover { color: var(--red); border-color: var(--red); }

    /* ===== NAV TABS ===== */
    /* Beyond convention: .nav is the horizontal-scroll container (scrollbar
       hidden). .nav-wrap is a plain flex row so the cog stays pinned right
       and doesn't get pulled into the scroll. Never put overflow on .nav-wrap
       — that leaks a vertical scrollbar next to the cog. */
    .nav-wrap {
      display: flex; align-items: stretch;
      border-bottom: 1px solid var(--border);
      background: var(--bg-dark);
    }
    .nav {
      display: flex; gap: 0; padding: 0 16px;
      background: var(--bg-dark);
      overflow-x: auto; scrollbar-width: none;
      flex: 1; min-width: 0;
    }
    .nav::-webkit-scrollbar { display: none; }
    .nav-tab {
      padding: 12px 18px; font-size: 13px; font-weight: 500;
      color: var(--text-mid); text-decoration: none;
      border-bottom: 2px solid transparent; margin-bottom: -1px;
      transition: color 0.15s, border-color 0.15s;
      white-space: nowrap;
    }
    .nav-tab:hover { color: var(--text); }
    .nav-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
    .nav-cog {
      flex: 0 0 auto;
      background: transparent; border: none; color: var(--text-dim);
      cursor: pointer; padding: 8px 14px; font-size: 16px;
    }
    .nav-cog:hover { color: var(--primary); }

    /* ===== CONTENT + BUTTONS ===== */
    .content { padding: 22px 24px; max-width: 100%; margin: 0 auto; }
    .panel { display: none; }
    .panel.active { display: block; }
    .btn {
      padding: 8px 14px; background: var(--primary); color: #0b0b0c;
      border: 1px solid var(--primary); border-radius: var(--radius-sm);
      font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
      transition: opacity 0.15s;
    }
    .btn:hover { opacity: 0.9; }
    .btn:disabled { opacity: 0.5; cursor: not-allowed; }
    .btn-outline { background: transparent; color: var(--text-mid); border-color: var(--border); }
    .btn-outline:hover { color: var(--primary); border-color: var(--primary); }
    .section-header {
      font-size: 18px; font-weight: 700; color: var(--text);
      margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
      position: relative;
    }
    .section-header::after { content: ''; position: absolute; bottom: -1px; left: 0; width: 60px; height: 2px; background: var(--primary); }

    /* ===== DENIED BLOCK ===== */
    .denied-block { padding: 32px; text-align: center; }
    .denied-block h2 { color: var(--text); font-size: 22px; margin-bottom: 16px; }
    .denied-block p { color: var(--text-mid); font-size: 14px; }

    /* ===== EMPTY STATE ===== */
    .empty-state { padding: 40px 24px; text-align: center; color: var(--text-mid); background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
    .empty-state-icon { font-size: 36px; margin-bottom: 12px; }
    .empty-state-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
    .empty-state-body { font-size: 13px; color: var(--text-mid); line-height: 1.5; }

    /* ===== TOAST ===== */
    .toast-container { position: fixed; top: 20px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 8px; }
    .toast { padding: 10px 16px; border-radius: var(--radius-sm); background: var(--bg-card); border: 1px solid var(--border); color: var(--text); font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
    .toast-error { border-color: var(--red); color: var(--red); }

    /* ===== SIDE MENU ===== */
    .side-menu-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 998; }
    .side-menu-backdrop.open { display: block; }
    .side-menu { position: fixed; top: 0; left: 0; height: 100vh; width: 280px; background: var(--bg-card); border-right: 1px solid var(--border); transform: translateX(-100%); transition: transform 0.2s ease-out; z-index: 999; display: flex; flex-direction: column; }
    .side-menu.open { transform: translateX(0); }
    .side-menu-header { padding: 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
    .side-menu-brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
    .side-menu-logo { width: 32px; height: 32px; object-fit: contain; }
    .side-menu-eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--text-dim); text-transform: uppercase; }
    .side-menu-user { font-size: 13px; color: var(--text); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .side-menu-close { background: transparent; border: none; color: var(--text-mid); font-size: 22px; cursor: pointer; padding: 0 6px; line-height: 1; }
    .side-menu-section-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--text-dim); text-transform: uppercase; padding: 12px 16px 6px; }
    .side-menu-items { flex: 1; overflow-y: auto; padding-bottom: 12px; }
    .side-menu-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; text-decoration: none; color: var(--text-mid); border-left: 3px solid transparent; }
    .side-menu-item:hover { background: var(--bg-card-hover); color: var(--text); }
    .side-menu-item.current { color: var(--primary); border-left-color: var(--primary); background: var(--primary-faint); }
    .side-menu-item-icon { color: inherit; display: inline-flex; }
    .side-menu-item-text { min-width: 0; }
    .side-menu-item-title { font-size: 13px; font-weight: 600; }
    .side-menu-item-desc { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
    .side-menu-item.current .side-menu-item-desc { color: var(--text-mid); }
    .side-menu-footer { padding: 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
    .side-menu-foot-btn { flex: 1; padding: 8px; background: var(--bg-input); color: var(--text-mid); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; text-decoration: none; font-family: inherit; }
    .side-menu-foot-btn:hover { color: var(--primary); border-color: var(--primary); }
    .side-menu-foot-btn.danger { color: var(--red); }
    .side-menu-foot-btn.danger:hover { border-color: var(--red); }

    /* ============================================================
       ARMORY-SPECIFIC — stock table + alerts + scorecards
       Ported from WMD's /armory/ landing page; vars mapped to Beyond.
       ============================================================ */

    /* Meta line + refresh button sit below the full-width section header */
    .stock-topbar {
      display: flex; align-items: center; justify-content: space-between;
      gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
    }
    .stock-meta {
      font-size: 12px; color: var(--text-mid);
      font-family: var(--font-mono);
    }
    .stock-meta b { color: var(--text); }

    /* Section headers */
    .armory-section-title {
      display: flex; align-items: center; gap: 10px;
      margin: 22px 0 10px;
      font-size: 11px; font-weight: 600; letter-spacing: 0.14em;
      text-transform: uppercase; color: var(--text-mid);
    }
    .armory-section-title::after { content:''; flex:1; height:1px; background: var(--border); }
    .armory-section-count {
      font-family: var(--font-mono); font-size: 10px;
      background: var(--bg-card); border: 1px solid var(--border);
      padding: 2px 6px; border-radius: 4px; color: var(--text);
    }

    /* Alerts grid (low stock) */
    .armory-alert-grid {
      display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 10px; margin-bottom: 8px;
    }
    .armory-alert {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: var(--radius); padding: 12px 14px;
      display: flex; flex-direction: column; gap: 4px;
    }
    .armory-alert.out-of-stock { border-left: 3px solid #ff6b6b; }
    .armory-alert.below-min    { border-left: 3px solid #e8a04b; }
    .armory-alert.low-stock    { border-left: 3px solid #f0c060; }
    .armory-alert-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
    .armory-alert-name { font-weight: 600; font-size: 13px; color: var(--text); }
    .armory-alert-kind {
      font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
      font-family: var(--font-mono); color: var(--text-mid);
    }
    .armory-alert.out-of-stock .armory-alert-kind { color: #ff6b6b; }
    .armory-alert.below-min    .armory-alert-kind { color: #e8a04b; }
    .armory-alert.low-stock    .armory-alert-kind { color: #f0c060; }
    .armory-alert-detail {
      font-size: 12px; color: var(--text-mid);
      display: flex; align-items: center; justify-content: space-between; gap: 8px;
    }
    .armory-alert-detail b { color: var(--text); font-family: var(--font-mono); }
    .armory-alert-cat {
      font-size: 9px; padding: 1px 6px; border-radius: 3px;
      letter-spacing: 0.06em; text-transform: uppercase;
      font-family: var(--font-mono);
      background: var(--bg-input); color: var(--text-mid);
      white-space: nowrap;
    }

    /* Scorecards */
    .stock-scorecards {
      display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 10px; margin-bottom: 6px;
    }
    .stock-scorecard {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: var(--radius); padding: 12px 14px;
    }
    .stock-scorecard-label {
      font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
      color: var(--text-mid);
    }
    .stock-scorecard-value {
      font-family: var(--font-mono); font-size: 22px; font-weight: 600;
      color: var(--text); margin-top: 6px; line-height: 1;
    }
    .stock-scorecard-value.warn { color: #e8a04b; }
    .stock-scorecard-sub {
      font-size: 11px; color: var(--text-mid); margin-top: 4px;
    }

    /* Category filter pills */
    .stock-filter {
      display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px;
    }
    .stock-filter-pill {
      padding: 6px 12px; border-radius: 6px;
      background: var(--bg-card); border: 1px solid var(--border);
      color: var(--text-mid); cursor: pointer;
      font-size: 12px; font-weight: 500;
      display: inline-flex; align-items: center; gap: 6px;
      transition: all 0.15s;
    }
    .stock-filter-pill:hover { color: var(--text); border-color: var(--text-dim); }
    .stock-filter-pill.active {
      background: var(--primary); border-color: var(--primary);
      color: #0a0a0a;
    }
    .stock-filter-pill.active .count { color: #0a0a0a; opacity: 1; }
    .stock-filter-pill .count {
      font-family: var(--font-mono); font-size: 10px;
      opacity: 0.8;
    }

    /* Stock table */
    .armory-table-wrap {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: var(--radius);
      overflow-x: auto; -webkit-overflow-scrolling: touch;
    }
    .armory-table { width: 100%; border-collapse: collapse; font-size: 13px; }
    .armory-table thead th {
      position: sticky; top: 0; z-index: 2;
      background: var(--bg-card-hover);
      padding: 10px 14px; text-align: left;
      font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
      text-transform: uppercase; color: var(--text-mid);
      border-bottom: 1px solid var(--border); white-space: nowrap;
      cursor: pointer; user-select: none;
    }
    .armory-table th.num { text-align: center; }
    .armory-table th.sort-asc::after  { content: ' ▲'; font-size: 9px; opacity: 0.7; }
    .armory-table th.sort-desc::after { content: ' ▼'; font-size: 9px; opacity: 0.7; }
    .armory-table td {
      padding: 10px 14px; border-bottom: 1px solid var(--border);
      color: var(--text);
    }
    .armory-table td.num { text-align: center; font-family: var(--font-mono); }
    .armory-table tr:last-child td { border-bottom: none; }
    .armory-table tr:hover td { background: var(--bg-card-hover); }
    .armory-table tr.low-stock td:first-child { box-shadow: inset 2px 0 0 #e8a04b; }
    .armory-table tr.no-snapshot td:first-child { box-shadow: inset 2px 0 0 var(--text-dim); }
    .armory-type-pill {
      font-size: 10px; padding: 2px 7px; border-radius: 3px;
      letter-spacing: 0.06em; text-transform: uppercase;
      font-family: var(--font-mono);
      background: var(--bg-input); color: var(--text-mid);
    }
    .armory-status-pill {
      font-size: 10px; padding: 2px 8px; border-radius: 10px;
      letter-spacing: 0.06em; text-transform: uppercase;
      font-family: var(--font-mono); font-weight: 600;
      display: inline-block; white-space: nowrap;
    }
    .armory-status-pill.out-of-stock { background: rgba(255,107,107,0.16); color: #ff6b6b; }
    .armory-status-pill.below-min    { background: rgba(232,160,75,0.18); color: #e8a04b; }
    .armory-status-pill.low-stock    { background: rgba(240,192,96,0.16); color: #f0c060; }
    .armory-status-pill.ok           { background: var(--bg-input); color: var(--text-mid); }
    .armory-status-pill.excess       { background: rgba(74,222,128,0.16); color: #4ade80; }
    .armory-status-pill.no-min       { color: var(--text-dim); }
    .armory-item-name a { color: var(--text); text-decoration: none; font-weight: 500; }
    .armory-item-name a:hover { text-decoration: underline; }
    .armory-min-cell { font-family: var(--font-mono); color: var(--text-dim); }
    .armory-min-cell.set { color: var(--text); }
    .armory-item-type-mobile { display: none; }
    .armory-table .avail-short { display: none; }
    @media (max-width: 768px) {
      .armory-table th, .armory-table td { padding: 8px 10px; font-size: 12px; }
      .armory-table .avail-full  { display: none; }
      .armory-table .avail-short { display: inline; }
      .armory-table th:nth-child(2),
      .armory-table td:nth-child(2) { display: none; }
      .armory-item-type-mobile {
        display: block; width: max-content; margin-top: 4px;
        font-size: 9px; padding: 1px 5px; border-radius: 3px;
        letter-spacing: 0.05em; text-transform: uppercase;
        font-family: var(--font-mono);
        background: var(--bg-input); color: var(--text-mid);
      }
    }

    /* ============================================================
       /armory/admin/ styles
       ============================================================ */

    /* Shared admin scaffolding (card grid + status pills) — same tokens
       used by /admin/**, restated here so bynd-armory-core.css is
       self-contained and this page doesn't need bynd-admin-core.css. */
    .admin-grid {
      display: grid; grid-template-columns: repeat(2, 1fr);
      gap: 14px;
    }
    @media (max-width: 768px) { .admin-grid { grid-template-columns: 1fr; } }
    .admin-card {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: var(--radius); padding: 16px;
    }
    .admin-card-title {
      font-size: 13px; font-weight: 600; color: var(--text-primary);
      margin-bottom: 6px;
      display: flex; align-items: center; gap: 8px;
    }
    .admin-card-icon { font-size: 16px; line-height: 1; flex-shrink: 0; }
    .admin-card-desc {
      font-size: 12px; color: var(--text-secondary);
      line-height: 1.5; margin-bottom: 12px;
    }
    .admin-card .status-line, .status-line {
      font-size: 12px; color: var(--text-muted);
      margin-top: 10px; min-height: 1.2em;
    }
    .admin-section-label {
      grid-column: 1 / -1;
      font-size: 10px; color: var(--text-secondary);
      text-transform: uppercase; letter-spacing: 0.16em;
      font-weight: 500;
      margin-top: 12px;
    }
    .admin-section-label:first-child { margin-top: 0; }
    .admin-status-pill {
      display: inline-flex; align-items: center; gap: 5px;
      padding: 2px 8px; border-radius: 10px;
      font-size: 11px; font-weight: 600;
      text-transform: uppercase; letter-spacing: 0.04em;
    }
    .admin-status-pill.success { background: rgba(32,201,151,0.13); color: var(--teal); }
    .admin-status-pill.failure { background: rgba(255,107,107,0.14); color: #FF6B6B; }
    .admin-status-pill.idle    { background: rgba(173,181,189,0.10); color: var(--text-muted); }
    .admin-status-row {
      display: flex; flex-wrap: wrap; align-items: baseline;
      gap: 8px; font-size: 12px; color: var(--text-secondary);
    }
    .admin-status-row .meta-count { color: var(--text-primary); font-weight: 600; }
    .admin-status-skel {
      display: inline-block; height: 1em; width: 180px;
      background: var(--bg-input); border-radius: 3px;
      opacity: 0.5; animation: skel-pulse 1.2s ease-in-out infinite;
    }
    @keyframes skel-pulse { 50% { opacity: 0.25; } }

    /* Sub-nav bar inside the admin panel — Fetch / Blood Drive / Min Stock. */
    .admin-subnav {
      display: flex; gap: 4px; padding: 4px;
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: var(--radius); margin-bottom: 18px;
      overflow-x: auto; scrollbar-width: none;
    }
    .admin-subnav::-webkit-scrollbar { display: none; }
    .admin-subnav-tab {
      padding: 8px 14px; cursor: pointer; color: var(--text-dim);
      font-size: 12px; font-weight: 500; background: transparent;
      border: none; border-radius: var(--radius-sm);
      white-space: nowrap; font-family: inherit;
      transition: color .12s, background .12s;
      text-decoration: none;
    }
    .admin-subnav-tab:hover { color: var(--text-primary); background: var(--bg-input); }
    .admin-subnav-tab.active { color: var(--primary); background: var(--primary-soft); }
    @media (max-width: 768px) {
      .admin-subnav-tab { font-size: 11px; padding: 7px 10px; }
    }

    /* Min Stock form (combobox + qty + add) */
    .minlevels-form {
      display: grid; grid-template-columns: 1fr 100px auto;
      gap: 8px; align-items: stretch; margin: 12px 0 14px;
    }
    .minlevels-qty {
      background: var(--bg-input); border: 1px solid var(--border);
      color: var(--text-primary); padding: 8px 10px; border-radius: 4px;
      font-family: var(--font-mono); font-size: 13px;
    }
    .minlevels-qty::placeholder { font-family: inherit; }
    @media (max-width: 640px) {
      .minlevels-form { grid-template-columns: 1fr 1fr; }
      .minlevels-form button { grid-column: 1 / -1; }
    }
    .combobox-wrapper { position: relative; }
    .combobox-wrapper input {
      width: 100%; background: var(--bg-input); border: 1px solid var(--border);
      color: var(--text-primary); padding: 8px 10px; border-radius: 4px;
      font-family: inherit; font-size: 13px;
    }
    .combobox-dropdown {
      display: none; position: absolute; top: 100%; left: 0; right: 0;
      max-height: 280px; overflow-y: auto;
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 4px; margin-top: 2px; z-index: 50;
    }
    .combobox-dropdown.open { display: block; }
    .combobox-option {
      padding: 7px 10px; cursor: pointer; font-size: 13px;
      display: flex; justify-content: space-between; gap: 12px;
      color: var(--text-primary);
    }
    .combobox-option:hover, .combobox-option.highlighted {
      background: var(--bg-card-hover);
    }
    .combobox-option-id {
      font-family: var(--font-mono); font-size: 11px;
      color: var(--text-dim);
    }
    .combobox-option-cat {
      font-family: var(--font-mono); font-size: 10px;
      letter-spacing: 0.06em; text-transform: uppercase;
      color: var(--text-secondary);
      padding: 1px 6px; border-radius: 3px;
      background: var(--bg-input); margin-right: 6px;
    }
    .combobox-option-empty {
      padding: 10px; font-size: 12px;
      color: var(--text-dim); text-align: center;
    }

    /* Min levels list — grid so columns line up across rows regardless of
       name length or chip width */
    .minlevels-row {
      display: grid;
      grid-template-columns: 1fr auto 80px auto;
      align-items: center; gap: 14px;
      padding: 8px 14px; border-bottom: 1px solid var(--border);
      font-size: 13px;
    }
    .minlevels-row:last-child { border-bottom: none; }
    .minlevels-list-wrap {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: var(--radius);
    }
    .ml-name {
      font-weight: 500; color: var(--text-primary);
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .ml-cat {
      font-family: var(--font-mono); font-size: 10px;
      letter-spacing: 0.06em; text-transform: uppercase;
      color: var(--text-secondary);
      padding: 1px 6px; border-radius: 3px;
      background: var(--bg-input);
      justify-self: start; white-space: nowrap;
    }
    .ml-qty {
      font-family: var(--font-mono); font-size: 12px;
      color: var(--text-primary);
      text-align: right;
    }
    .ml-remove {
      background: transparent; border: 1px solid var(--border);
      color: var(--text-dim); padding: 4px 10px; border-radius: 4px;
      font-size: 11px; cursor: pointer;
      font-family: inherit;
    }
    .ml-remove:hover { color: #ff6b6b; border-color: rgba(255,107,107,0.5); }

    /* Blood Drive admin — configure drives + manage which one is current in nav */
    .bd-form {
      display: grid;
      grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(140px, 1fr)) auto;
      gap: 12px; align-items: end;
      margin: 14px 0 8px;
    }
    .bd-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
    .bd-field label {
      font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
      color: var(--text-secondary); font-weight: 600;
    }
    .bd-field input {
      background: var(--bg-input); border: 1px solid var(--border);
      color: var(--text-primary); padding: 8px 10px; border-radius: 4px;
      font-family: inherit; font-size: 13px;
    }
    .bd-actions { display: flex; gap: 6px; align-items: stretch; }
    @media (max-width: 768px) {
      .bd-form { grid-template-columns: 1fr 1fr; }
      .bd-field-title, .bd-actions { grid-column: 1 / -1; }
    }
    .bd-list-title {
      font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
      color: var(--text-secondary); font-weight: 600;
      margin: 16px 0 8px;
    }
    .bd-list-wrap {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: var(--radius);
    }
    .bd-row {
      display: grid;
      grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto auto auto;
      align-items: center; gap: 14px;
      padding: 10px 14px; border-bottom: 1px solid var(--border);
      font-size: 13px;
    }
    .bd-row:last-child { border-bottom: none; }
    .bd-row.is-current { background: var(--primary-faint); }
    .bd-row-title { font-weight: 500; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .bd-row-window {
      font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary);
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .bd-pill {
      font-size: 10px; padding: 2px 7px; border-radius: 10px;
      letter-spacing: 0.06em; text-transform: uppercase;
      font-family: var(--font-mono); font-weight: 600;
      display: inline-block; white-space: nowrap;
    }
    .bd-pill.nav-on  { background: var(--primary-soft); color: var(--primary); }
    .bd-pill.nav-off { background: var(--bg-input); color: var(--text-dim); }
    .bd-pill.ended   { background: rgba(255,107,107,0.12); color: #ff6b6b; }
    .bd-pill.open    { background: rgba(96,165,250,0.14); color: #60a5fa; }
    .bd-pill.live    { background: rgba(74,222,128,0.14); color: #4ade80; }
    .bd-nav-toggle, .bd-edit-btn, .bd-del-btn {
      background: transparent; border: 1px solid var(--border);
      color: var(--text-dim); padding: 4px 10px; border-radius: 4px;
      font-size: 11px; cursor: pointer; font-family: inherit;
    }
    .bd-nav-toggle:hover { color: var(--primary); border-color: var(--primary); }
    .bd-edit-btn:hover { color: var(--text-primary); border-color: var(--text-dim); }
    .bd-del-btn:hover  { color: #ff6b6b; border-color: rgba(255,107,107,0.5); }
    .bd-empty {
      padding: 14px; font-size: 12px; color: var(--text-dim); text-align: center;
    }
    @media (max-width: 768px) {
      .bd-row {
        grid-template-columns: 1fr auto;
        gap: 6px 12px;
      }
      .bd-row-window { grid-column: 1 / -1; }
      .bd-nav-toggle, .bd-edit-btn, .bd-del-btn { grid-column: 1 / -1; justify-self: stretch; }
    }

    /* ============================================================
       App modal (styled confirm/alert, replaces native dialog)
       Matches the pattern already in bynd-dashboard-core.css.
       ============================================================ */
    .app-modal {
      position: fixed; inset: 0;
      background: rgba(0, 0, 0, 0.55);
      display: flex; align-items: center; justify-content: center;
      z-index: 9999;
    }
    .app-modal-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 22px 24px;
      max-width: 460px; width: 90%;
      box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    }
    .app-modal-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; }
    .app-modal-msg   { font-size: 13px; color: var(--text-secondary); margin-bottom: 18px; line-height: 1.5; }
    .app-modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
    .app-modal-actions button {
      padding: 8px 14px; font-family: inherit;
      font-size: 12px; font-weight: 600;
      background: var(--bg-input); color: var(--text-primary);
      border: 1px solid var(--border); border-radius: 6px;
      cursor: pointer;
    }
    .app-modal-actions button:hover { filter: brightness(1.1); }
    .app-modal-actions .app-modal-primary {
      background: var(--primary); color: var(--bg-card);
      border-color: var(--primary);
    }

    /* ============================================================
       Shared admin form primitives (row + field)
       Used by /armory/chain-supply/ config UI.
       ============================================================ */
    .admin-row {
      display: flex; gap: 12px; align-items: flex-end;
      margin-bottom: 12px; flex-wrap: wrap;
    }
    .admin-field { display: flex; flex-direction: column; gap: 6px; }
    .admin-field label {
      font-size: 10px; color: var(--text-muted);
      text-transform: uppercase; letter-spacing: 0.16em;
      font-weight: 500;
    }
    .admin-field input[type="datetime-local"],
    .admin-field input[type="text"],
    .admin-field input[type="number"],
    .admin-field select {
      background: var(--bg-input); border: 1px solid var(--border);
      border-radius: 6px; padding: 8px 12px;
      color: var(--text-primary); font-size: 13px;
      font-family: inherit;
      color-scheme: dark;
      /* Uniform height across number/text/datetime/select. Without this the
         browser default line boxes for each input type render slightly
         different heights (calendar picker adds vertical padding on
         datetime-local; number spinners add width). box-sizing keeps the
         explicit widths consistent regardless of border. */
      box-sizing: border-box;
      height: 36px;
      line-height: 1.2;
    }
    /* Hide number-input spinner arrows — chain_id is a plain identifier,
       spinner UI is distracting and eats width. */
    .admin-field input[type="number"]::-webkit-inner-spin-button,
    .admin-field input[type="number"]::-webkit-outer-spin-button {
      -webkit-appearance: none; margin: 0;
    }
    .admin-field input[type="number"] { -moz-appearance: textfield; }
    .admin-field select { padding-right: 24px; }
    .admin-field input:focus, .admin-field select:focus {
      outline: none; border-color: var(--primary);
    }

    /* ============================================================
       /armory/chain-supply/ — config form + records dropdown + pills
       ============================================================ */
    /* Field marker chips — required / optional / hint all rendered as small
       muted text next to the label. */
    .cs-required,
    .cs-optional,
    .cs-hint {
      font-weight: 400; text-transform: none; letter-spacing: 0;
      font-size: 10px; color: var(--text-muted);
    }

    /* Records row: dropdown grows to fill available space, all action buttons
       align to its right on desktop. On mobile (below 768px) the dropdown
       wraps to its own row and the buttons flex-fill the row below. */
    .cs-records-row { align-items: flex-end; gap: 8px; }
    .cs-records-field { flex: 1 1 260px; min-width: 0; }
    .cs-records-row select { width: 100%; }
    /* Match the dropdown's height (36px in existing input rule) so buttons
       align top-to-top with it. 3em at the button's 12px font = 36px, and
       stays proportional under any global font-size shift. */
    .cs-records-row .btn { min-height: 3em; }
    @media (max-width: 768px) {
      .cs-records-field { flex: 1 1 100%; }
      .cs-records-row .btn { flex: 1 1 0; min-width: 0; }
    }

    .cs-chain-link {
      display: inline-block; padding: 8px 12px;
      background: var(--bg-input); border: 1px solid var(--border);
      border-radius: 6px; font-size: 12px;
      color: var(--primary); text-decoration: none;
    }
    .cs-chain-link:hover { border-color: var(--primary); }

    /* Compact one-row config layout. Labels top-align so the Chain ID field
       can carry a link beneath its input without pushing the datetime inputs
       out of alignment. Each field is flex 1:1:190px — grows to fill the row
       on wide viewports, wraps to the next line when the row runs out of
       space. Inputs fill 100% of their field wrapper, so no fixed input
       widths + no mobile override hacks. */
    .cs-config-row { align-items: flex-start; }
    .cs-config-row .admin-field {
      flex: 1 1 190px;
      min-width: 0;
    }
    .cs-config-row .admin-field input {
      width: 100%;
    }
    .cs-chain-id-field { position: relative; }
    .cs-chain-link-inline {
      display: inline-block; margin-top: 6px;
      font-size: 11px; color: var(--primary);
      text-decoration: none; white-space: nowrap;
      padding: 3px 8px; background: var(--primary-soft);
      border-radius: 4px; align-self: flex-start;
    }
    .cs-chain-link-inline:hover { text-decoration: underline; }

    /* One card containing a 3-part flexed header + active body. Underline-
       accent tab pattern matches Beyond's main .nav-tab style so this feels
       like a nested version of the top nav. Header + body share the same
       card background — the underline is the only affordance separating
       active from inactive, keeping the visual weight low. */
    .cs-tabs-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      margin-bottom: 14px;
      overflow: hidden;
    }
    .cs-tabs-header {
      display: flex;
      border-bottom: 1px solid var(--border);
    }
    .cs-tabs-header-part {
      flex: 1 1 0;
      text-align: center;
      padding: 9px 10px;
      cursor: pointer;
      font-size: 12px; font-weight: 500;
      color: var(--text-mid);
      text-decoration: none;
      transition: color 0.15s, border-color 0.15s;
      border-bottom: 2px solid transparent;
      margin-bottom: -1px;                     /* overlap the header's border */
      white-space: nowrap;
      position: relative;                      /* anchor for divider pseudo-el */
    }
    /* Short divider between tabs — a 1px line inset from top and bottom so it
       reads as a subtle separator rather than a full-height border. */
    .cs-tabs-header-part::after {
      content: '';
      position: absolute;
      right: 0; top: 25%; bottom: 25%;
      width: 1px;
      background: var(--border);
    }
    .cs-tabs-header-part:last-child::after { display: none; }
    .cs-tabs-header-part:hover { color: var(--text); }
    .cs-tabs-header-part.active {
      color: var(--primary);
      border-bottom-color: var(--primary);
    }
    .cs-subpanel { display: none; }
    .cs-subpanel.active { display: block; padding: 14px; }

    /* Pill footer: Show more + Refresh below the pills. */
    .cs-pill-footer {
      display: flex; align-items: center; gap: 12px;
      margin-top: 12px;
      padding-top: 10px;
      border-top: 1px dashed var(--border);
    }
    .cs-refresh-mini {
      font-size: 10px; padding: 4px 10px;
      letter-spacing: 0.06em;
    }
    .cs-pills-show-more {
      font-size: 11px; color: var(--text-mid);
      text-decoration: none; cursor: pointer;
      white-space: nowrap;
    }
    .cs-pills-show-more:hover { color: var(--primary); }
    .cs-pills {
      display: flex; gap: 8px; flex-wrap: wrap;
    }
    .cs-pill {
      background: var(--bg-input); border: 1px solid var(--border);
      border-radius: 999px; padding: 5px 12px;
      font-size: 12px; color: var(--text-secondary);
      cursor: pointer; transition: all 0.15s;
      font-family: inherit;
      white-space: nowrap;
    }
    .cs-pill:hover { border-color: var(--primary); color: var(--primary); }
    .cs-pill.is-selected {
      border-color: var(--primary); color: var(--primary);
      background: var(--primary-soft);
    }
    .cs-pill .cs-pill-qty { color: var(--text-primary); font-weight: 600; }
    .cs-pill .cs-pill-actor { color: var(--text-dim); }
    /* Mobile: pills stay on one row + horizontal scroll (signals more off-screen). */
    @media (max-width: 768px) {
      .cs-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; -ms-overflow-style: none;
      }
      .cs-pills::-webkit-scrollbar { display: none; }
      .cs-pill { flex-shrink: 0; }
      /* Tighter row gap on mobile; the field wrapper's flex-basis + input's
         100% width already handles input sizing across viewports, no
         !important override needed. */
      .admin-row { gap: 8px; }
    }

    /* Button variants specific to chain-supply actions. */

    /* Dark neutral variant — same box as .btn (filled), just recoloured
       to a dark chip. Used for New / Delete / Unfinalise so they match the
       Save / Finalise / Refresh buttons in height + padding while reading
       as low-emphasis actions. */
    .cs-btn-dark {
      background: var(--bg-dark);
      color: var(--text-mid);
      border-color: var(--border);
    }
    .cs-btn-dark:hover { color: var(--primary); border-color: var(--primary); }

    .cs-btn-finalise {
      background: #4ade80;
      color: var(--bg-card);
      border-color: #4ade80;
    }
    .cs-btn-finalise:hover { background: #22c55e; border-color: #22c55e; }
    .cs-btn-warning:hover  { color: #f59e0b; border-color: #f59e0b; }
    .cs-btn-danger:hover   { color: #ff6b6b; border-color: rgba(255,107,107,0.5); }

    .cs-finalised-banner {
      background: rgba(74,222,128,0.12);
      border: 1px solid rgba(74,222,128,0.4);
      border-radius: var(--radius); padding: 10px 14px;
      font-size: 12px; color: #4ade80;
      margin-bottom: 14px;
      display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    }
    .cs-finalised-banner b { color: var(--text-primary); }

    .cs-empty {
      text-align: center; padding: 32px 20px;
      color: var(--text-muted); font-size: 13px;
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: var(--radius);
      margin-top: 16px;
    }

    /* ============================================================
       Stage 9 — Scorecards + per-member table
       ============================================================ */
    .cs-scorecards {
      display: grid; grid-template-columns: repeat(6, 1fr);
      gap: 12px; margin: 18px 0;
    }
    /* Below 1300px, single-row horizontal scroll instead of wrapping to two
       ragged rows — matches WMD's ws-scorecards pattern. */
    @media (max-width: 1300px) {
      .cs-scorecards {
        display: flex; grid-template-columns: none;
        overflow-x: auto; -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
      }
      .cs-scorecards::-webkit-scrollbar { display: none; }
      .cs-scorecards .cs-card { flex: 0 0 28%; scroll-snap-align: start; }
    }
    @media (max-width: 768px) {
      .cs-scorecards .cs-card { flex: 0 0 65%; }
    }
    .cs-card {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: var(--radius); padding: 14px 16px;
      min-width: 0;
    }
    .cs-card-label {
      font-size: 10px; color: var(--text-secondary);
      text-transform: uppercase; letter-spacing: 0.08em;
      font-weight: 600; margin-bottom: 6px;
    }
    .cs-card-value {
      font-size: 22px; font-weight: 700; color: var(--text-primary);
      font-variant-numeric: tabular-nums;
    }
    .cs-card.accent-pre     { box-shadow: inset 3px 0 0 var(--text-secondary); }
    .cs-card.accent-chain   { box-shadow: inset 3px 0 0 var(--primary); }
    .cs-card.accent-post    { box-shadow: inset 3px 0 0 var(--red); }
    .cs-card.accent-ret     { box-shadow: inset 3px 0 0 var(--teal); }
    .cs-card.accent-lost    { box-shadow: inset 3px 0 0 var(--gold); }
    /* Hybrid card = 2 values side-by-side (Deposit / Retrieval). */
    .cs-card.hybrid .cs-card-value-row {
      display: flex; gap: 14px; align-items: baseline;
    }
    .cs-card.hybrid .cs-card-value-pair {
      display: flex; flex-direction: column; gap: 2px;
    }
    .cs-card.hybrid .cs-card-value-sub {
      font-size: 9px; color: var(--text-muted);
      text-transform: uppercase; letter-spacing: 0.08em;
      font-weight: 600;
    }
    .cs-card.hybrid .cs-card-sep {
      color: var(--text-muted); font-size: 22px; font-weight: 300;
      padding-bottom: 14px;
    }

    .cs-section-title {
      font-size: 12px; font-weight: 600;
      text-transform: uppercase; letter-spacing: 0.1em;
      color: var(--text-secondary);
      margin: 22px 0 10px;
    }

    /* Member table (mirrors WMD's ws-table). Fixed layout on desktop so
       sort clicks don't reflow columns; auto layout on mobile so Member
       column shrinks and the table fits the viewport. */
    #csMemberTableWrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .cs-member-table {
      width: 100%; border-collapse: collapse;
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: var(--radius); overflow: hidden;
      table-layout: fixed;
    }
    .cs-member-table th,
    .cs-member-table td {
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    @media (max-width: 768px) {
      .cs-member-table { table-layout: auto; }
    }
    .cs-member-table th {
      background: var(--bg-input); color: var(--text-secondary);
      font-size: 11px; font-weight: 600; text-transform: uppercase;
      letter-spacing: 0.06em; padding: 10px 12px; text-align: left;
      border-bottom: 1px solid var(--border);
      cursor: pointer; user-select: none;
    }
    .cs-member-table th:hover { color: var(--text-primary); }
    .cs-member-table th.sort-asc::after  { content: ' \25B2'; font-size: 9px; }
    .cs-member-table th.sort-desc::after { content: ' \25BC'; font-size: 9px; }
    .cs-member-table td {
      padding: 10px 12px; color: var(--text-primary); font-size: 13px;
      border-bottom: 1px solid rgba(46,46,51,0.4);
    }
    .cs-member-table th.num,
    .cs-member-table td.num {
      text-align: right; font-variant-numeric: tabular-nums;
    }
    .cs-member-table tr:hover td { background: var(--bg-card-hover); }
    .cs-member-table tfoot td {
      background: var(--bg-input);
      font-weight: 700;
      border-top: 2px solid var(--border);
      border-bottom: none;
    }
    .cs-member-table tfoot tr:hover td { background: var(--bg-input); }
    .cs-member-table tfoot td.label-cell {
      text-transform: uppercase; letter-spacing: 0.08em;
      font-size: 11px; color: var(--text-secondary);
    }
    .cs-member-link {
      color: var(--text-primary); text-decoration: none; font-weight: 500;
    }
    .cs-member-link:hover { color: var(--primary); }
    .cs-overdose-count {
      color: var(--text-muted);
      margin-left: 4px;
      cursor: help;
    }

    /* ============================================================
       /armory/blood-drive/ — leaderboard + daily fills chart
       ============================================================ */
    .bd-topbar {
      display: flex; align-items: center; justify-content: space-between;
      gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
    }
    .bd-window {
      font-family: var(--font-mono); font-size: 12px;
      color: var(--text-secondary);
      display: flex; align-items: center; gap: 8px;
    }
    .bd-last-updated { margin-left: auto; color: var(--text-muted); }
    .bd-last-updated-mobile {
      display: none;
      font-family: var(--font-mono); font-size: 11px;
      color: var(--text-muted); text-align: right;
      margin: 4px 0 6px;
    }
    .bd-status-pill {
      font-size: 10px; padding: 2px 8px; border-radius: 10px;
      letter-spacing: 0.06em; text-transform: uppercase;
      font-family: var(--font-mono); font-weight: 600;
    }
    .bd-status-pill.live  { background: rgba(74,222,128,0.16); color: #4ade80; }
    .bd-status-pill.open  { background: rgba(96,165,250,0.14); color: #60a5fa; }
    .bd-status-pill.ended { background: rgba(255,107,107,0.12); color: #ff6b6b; }
    .bd-status-pill.soon  { background: var(--bg-input); color: var(--text-dim); }

    .bd-scorecards {
      display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 10px; margin-bottom: 6px;
    }
    .bd-scorecard {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: var(--radius); padding: 14px 16px;
    }
    .bd-scorecard-label {
      font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
      color: var(--text-secondary);
    }
    .bd-scorecard-value {
      font-family: var(--font-mono); font-size: 26px; font-weight: 600;
      color: var(--text-primary); margin-top: 6px; line-height: 1;
    }
    .bd-scorecard-sub {
      font-size: 11px; color: var(--text-secondary); margin-top: 4px;
    }

    .bd-section-title {
      display: flex; align-items: center; gap: 10px;
      margin: 22px 0 10px;
      font-size: 11px; font-weight: 600; letter-spacing: 0.14em;
      text-transform: uppercase; color: var(--text-secondary);
    }
    .bd-section-title::after { content:''; flex:1; height:1px; background: var(--border); }
    .bd-section-count {
      font-family: var(--font-mono); font-size: 10px;
      background: var(--bg-card); border: 1px solid var(--border);
      padding: 2px 6px; border-radius: 4px; color: var(--text-primary);
    }

    .bd-chart-wrap {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: var(--radius); padding: 14px;
    }
    .bd-chart-svg { width: 100%; height: 240px; display: block; }
    .bd-chart-svg .axis line,
    .bd-chart-svg .axis path { stroke: var(--border); }
    .bd-chart-svg .axis text { fill: var(--text-secondary); font-size: 10px; font-family: var(--font-mono); }
    .bd-chart-svg .grid line { stroke: var(--border); stroke-dasharray: 2,3; opacity: 0.5; }
    .bd-chart-svg .grid path { display: none; }
    .bd-chart-svg .bar { fill: #ef4444; }
    .bd-chart-svg .bar:hover { fill: #f87171; }
    .bd-chart-svg .bar-label {
      fill: var(--text-primary); font-family: var(--font-mono);
      font-size: 10px; text-anchor: middle;
    }

    .bd-lb-wrap {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: var(--radius); overflow-x: auto;
    }
    .bd-lb { width: 100%; border-collapse: collapse; font-size: 13px; }
    .bd-lb thead th {
      position: sticky; top: 0; z-index: 2;
      background: var(--bg-card-hover);
      padding: 10px 14px; text-align: left;
      font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
      text-transform: uppercase; color: var(--text-secondary);
      border-bottom: 1px solid var(--border); white-space: nowrap;
    }
    .bd-lb th.num { text-align: right; }
    .bd-lb td {
      padding: 10px 14px; border-bottom: 1px solid var(--border);
      color: var(--text-primary);
    }
    .bd-lb td.num { text-align: right; font-family: var(--font-mono); }
    .bd-lb tr:last-child td { border-bottom: none; }
    .bd-lb tr:hover td { background: var(--bg-card-hover); }
    .bd-rank {
      display: inline-flex; align-items: center; justify-content: center;
      width: 24px; height: 24px; border-radius: 50%;
      font-family: var(--font-mono); font-size: 11px; font-weight: 600;
      background: var(--bg-input); color: var(--text-secondary);
    }
    .bd-rank.rank-1 { background: rgba(252,211,77,0.18); color: #fcd34d; }
    .bd-rank.rank-2 { background: rgba(203,213,225,0.18); color: #cbd5e1; }
    .bd-rank.rank-3 { background: rgba(217,119,87,0.18); color: #d97757; }
    .bd-pct-bar {
      position: relative; height: 6px; background: var(--bg-input);
      border-radius: 3px; overflow: hidden; margin-top: 4px;
    }
    .bd-pct-bar-fill { position: absolute; top: 0; left: 0; bottom: 0; background: #ef4444; }
    .bd-pct-label { font-size: 10px; color: var(--text-secondary); font-family: var(--font-mono); }

    /* Mobile: force all 3 scorecards into a single row. Tighten padding +
       value font so the Top Filler name still has room to breathe. */
    @media (max-width: 768px) {
      .bd-window .bd-last-updated { display: none; }
      .bd-last-updated-mobile { display: block; }
      .bd-window { font-size: 10px; gap: 6px; }
      .bd-window .bd-status-pill { font-size: 9px; padding: 2px 6px; }
      .bd-last-updated-mobile + .bd-section-title { margin-top: 8px; }
      .bd-scorecards {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
      }
      .bd-scorecard { padding: 10px 10px; }
      .bd-scorecard-value { font-size: 18px; }
      .bd-scorecard-sub   { font-size: 10px; }
      /* Top Filler value can run long — clip with ellipsis instead of wrapping
         and pushing the card height. */
      .bd-scorecard:nth-child(3) .bd-scorecard-value {
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
      }
    }
