        /* Base Variables & Shell */
        :root {
            --surface: #111418; --border: #1e2530; --accent: #00e5ff;
            --text: #c5c6c7; --dim: #888; --font-mono: monospace;
            --text-bright: #f0f0f0; /* idea #171: off-white instead of pure white */
            --meta-font-scale: 1; /* idea #169: bumped by the A+/A- toggle below */
        }
        body {
            background: #0b0c10; color: var(--text);
            font-family: 'Segoe UI', system-ui, sans-serif;
            margin: 0; padding-bottom: 50px;
        }
        a { text-decoration: none; color: inherit; transition: opacity 0.2s; }
        a:hover { opacity: 0.8; }

        /* Idea #166: visible, consistent focus outlines for keyboard navigation. */
        :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

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

        /* Idea #167: skip-to-content link. */
        .skip-link {
            position: absolute; left: -9999px; top: 0; background: var(--accent); color: #000;
            padding: 10px 16px; z-index: 10000; font-weight: bold; border-radius: 0 0 6px 0;
        }
        .skip-link:focus { left: 0; }

        /* Idea #164: visually-hidden but screen-reader-accessible label. */
        .visually-hidden {
            position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
            overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
        }

        /* Idea #169: font-size scale toggle for the small 11-13px metadata text
           used throughout (battle meta, superlative sub-text, hof-value spans). */
        .meta-text, .hof-value span, td[style*="font-family"] {
            font-size: calc(1em * var(--meta-font-scale));
        }
        .font-scale-toggle { display: flex; gap: 4px; align-items: center; }
        .font-scale-toggle button {
            background: #1e2530; border: 1px solid var(--border); color: var(--dim);
            width: 26px; height: 26px; border-radius: 4px; cursor: pointer; font-size: 13px;
        }

        /* Topbar & Search */
        .topbar { 
            display: flex; align-items: center; gap: 16px; padding: 12px 24px; 
            background: var(--surface); border-bottom: 1px solid var(--border); 
            position: sticky; top: 0; z-index: 100; flex-wrap: wrap; 
        }
        .topbar-title { font-size: 22px; font-weight: 700; text-transform: uppercase; color: var(--accent); flex: 1; min-width: 200px; text-shadow: 0 0 10px rgba(0,229,255,0.2); }
        .topbar-title span { color: var(--dim); font-weight: 400; }
        
        .search-bar { 
            padding: 8px 14px; border-radius: 6px; border: 1px solid var(--border); 
            background: #0b0c10; color: var(--text); outline: none; flex: 1; min-width: 150px;
            font-family: var(--font-mono);
        }
        .search-bar:focus { border-color: var(--accent); }
        
        .lfg-btn { 
            padding: 8px 16px; background: #5865F2; color: var(--text-bright); 
            border: none; border-radius: 4px; font-weight: bold; 
            cursor: pointer; transition: 0.2s; font-size: 13px;
        }
        .lfg-btn:hover { background: #4752c4; box-shadow: 0 0 10px rgba(88,101,242,0.5); }

        .container { max-width: 1200px; margin: 30px auto; padding: 0 15px; }

        /* --- NEW: Dashboard Grid (Hall of Fame & Leadership) --- */
        .dashboard-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }
        .dash-card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 20px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        }
        .dash-card-title {
            font-size: 13px;
            font-family: var(--font-mono);
            letter-spacing: 1px;
            text-transform: uppercase;
            color: var(--accent);
            margin-bottom: 16px;
            padding-bottom: 8px;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        /* Hall of Fame specific */
        .hof-item { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 14px; gap: 10px; }
        .hof-label { color: var(--dim); display: flex; align-items: center; gap: 6px; }
        .hof-value { font-weight: bold; color: var(--text-bright); text-align: right; }
        .hof-value span { color: var(--dim); font-size: 12px; font-family: var(--font-mono); margin-left: 6px; }
        /* A category still showing its last known (non-zero) leader rather than
           a fresh result this cycle -- see _merge_leaderboard_entry in
           data_harvester.py for why this exists instead of ever showing "Name: 0". */
        .hof-item.stale .hof-value { color: var(--dim); opacity: 0.75; }
        .hof-stale-note { display: block; font-size: 10px; font-style: italic; color: var(--dim); font-weight: normal; }

        /* Small "ⓘ" info icon next to a card title -- native title="" tooltip on
           hover/focus, explaining the calculation behind that section. Keyboard-
           focusable (tabindex) so the explanation isn't mouse-hover-only. */
        .info-tip { cursor: help; color: var(--dim); font-size: 13px; font-weight: normal; text-transform: none; letter-spacing: 0; margin-left: auto; }
        .info-tip:hover, .info-tip:focus-visible { color: var(--accent); }

        /* Leadership specific -- grid instead of plain flex-wrap so a
           "full row" badge (task #180: Mythic's name gets its own whole
           horizontal line) can span every column via grid-column, while the
           remaining leaders/co-leaders auto-fit to share the rest of the
           card's width evenly. */
        .leader-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
        .leader-badge {
            background: #0b0c10;
            padding: 6px 12px;
            border-radius: 6px;
            font-size: 13px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            border: 1px solid var(--border);
            font-weight: 600;
        }
        .leader-badge.boss { border-color: #f1c40f; color: #f1c40f; box-shadow: 0 0 10px rgba(241,196,15,0.1); }
        .leader-badge.co { border-color: rgba(0,229,255,0.3); color: var(--text-bright); }
        .leader-badge-full { grid-column: 1 / -1; font-size: 16px; padding: 10px 14px; }

        /* Mobile-Optimized Table */
        .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--surface); border-radius: 10px; border: 1px solid var(--border); max-width: 100%; }
        table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
        th {
            padding: 12px 10px; min-height: 44px; box-sizing: border-box;
            background: rgba(0,229,255,0.05); color: var(--accent);
            font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; border-bottom: 1px solid var(--border);
            cursor: pointer; user-select: none; transition: background 0.2s;
        }
        th:hover { background: rgba(0,229,255,0.15); }
        td { padding: 11px 10px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
        tr:hover td { background: rgba(255,255,255,0.03); }

        /* Admin Visitor View preview mode — hides every admin-only marker & control */
        html.visitor-view-mode .admin-only-indicator,
        html.visitor-view-mode .card-hide-btn,
        html.visitor-view-mode .admin-only-bar,
        html.visitor-view-mode .dash-card.card-is-hidden {
            display: none !important;
        }
        #visitorViewToggle[aria-pressed="true"] {
            border-color: var(--accent);
            color: var(--accent);
            background: rgba(0, 229, 255, 0.12);
        }
        
        .role-tag { font-size: 11px; padding: 4px 8px; border-radius: 4px; background: #1e2530; font-family: var(--font-mono); }
        
        /* Activity Indicators.
           Idea #165: color-blind-safe — a shape/glyph difference, not hue alone.
           Active gets a filled circle + no glyph; inactive gets a ring shape
           (border instead of fill) plus a small "!" glyph, so the distinction
           survives even in grayscale/color-blind simulation. */
        .status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; position: relative; }
        .status-active { background: #2ecc71; box-shadow: 0 0 8px #2ecc71; }
        .status-warn { background: transparent; border: 2px solid #e74c3c; width: 6px; height: 6px; }
        .status-warn::after {
            content: "!"; position: absolute; top: -7px; left: 1px; font-size: 9px; font-weight: bold;
            color: #e74c3c; line-height: 1;
        }
        /* Task #187 (supersedes task #148's single global toggle): admin-only
           markers (currently just the active/inactive status dot) get hidden
           per-card when that card's own "👁️ Admin Info" button is toggled --
           see toggleAdminInfoCard() and admin_info_icon() above. Scoped to
           whichever card element carries data-admin-info-hidden, not a
           single <body>-wide class, so each card's state is independent. */
        [data-admin-info-hidden="1"] .admin-only-indicator { display: none !important; }
        /* Task #155: hide-a-dashboard-card-behind-the-admin-wall feature. */
        .card-hide-btn { background: none; border: none; cursor: pointer; font-size: 12px; margin-left: 6px; padding: 2px 4px; opacity: 0.7; vertical-align: middle; }
        .card-hide-btn:hover { opacity: 1; }
        .card-hidden-badge { display: inline-block; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: #e74c3c; border: 1px solid #e74c3c; border-radius: 4px; padding: 1px 6px; margin-left: 8px; vertical-align: middle; }
        /* Task #181: admin-editable free-text note per card, separate from
           that card's actual data. */
        .card-blurb-wrap { margin: -4px 0 10px; display: flex; align-items: flex-start; gap: 6px; }
        .card-blurb-text { font-size: 12px; color: var(--dim); font-style: italic; line-height: 1.4; flex: 1; }
        /* River Race boat visualization -- one horizontal track per top fame
           contributor, a boat emoji sliding along it proportional to fame
           (day-by-day if this-war data exists, or straight to the final spot
           if falling back to the last completed race). See renderBoatRace(). */
        .boat-race-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
        .boat-race-name { width: 110px; flex: 0 0 auto; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .boat-race-track { flex: 1; position: relative; height: 22px; background: rgba(255,255,255,0.05); border-radius: 11px; overflow: visible; }
        .boat-race-track::after { content: ''; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 2px; height: 14px; background: rgba(255,255,255,0.15); }
        .boat-race-boat { position: absolute; top: 50%; transform: translate(-50%, -50%); font-size: 18px; transition: left 1.1s ease-in-out; left: 0%; line-height: 1; }
        .boat-race-fame { width: 56px; flex: 0 0 auto; text-align: right; font-size: 12px; font-family: var(--font-mono); color: var(--dim); }
        .boat-race-day-label { font-size: 11px; color: var(--dim); font-family: var(--font-mono); margin-bottom: 10px; text-align: right; }
