﻿        :root {
            --color-bg: #0a1628;
            --color-panel: #1a2535;
            --color-panel-soft: #2a3a4a;
            --color-border: #3a4a5a;
            --color-row-even: #1a2535;
            --color-row-odd: #15202d;
            --color-text: #eee;
            --color-text-dim: #cccccc;
            --color-strong-text: #ffffff;
            --color-text-outline: rgba(0, 0, 0, 0.55);
            --lane-col: 108px;
            --team-col: 80px;
            --time-col: 200px;
            --place-col: 80px;
            --base-font: 31px;
            --header-font: 38px;
            --header-pad-y: 21px;
            --header-pad-x: 31px;
            --scoreboard-margin-x: 30px;
            --logo-bar-height: 120px;
            --logo-img-max-width: 260px;
            --row-height: 88px;
            --row-gap: 8px;
            --lane-box-height: 74px;
            --lane-font: 45px;
            --name-font: 29px;
            --team-font: 31px;
            --time-font: 42px;
            --place-font: 45px;
            --safe-top: env(safe-area-inset-top, 0px);
            --safe-right: env(safe-area-inset-right, 0px);
            --safe-bottom: env(safe-area-inset-bottom, 0px);
            --safe-left: env(safe-area-inset-left, 0px);
            --viewer-chrome-top: calc(var(--safe-top) + 58px);
            --brand-primary: #4EA1FF;
            --brand-secondary: #7C3AED;
            --brand-bg: #060D1B;
            --brand-surface: #111C31;
            --brand-text: #F1F5FF;
            --brand-accent: #22D3EE;
        }

        body {
            margin: 0;
            background:
                radial-gradient(140% 120% at 10% -20%, rgba(78, 161, 255, 0.16), transparent 55%),
                radial-gradient(120% 120% at 90% 120%, rgba(124, 58, 237, 0.14), transparent 56%),
                var(--color-bg);
            color: var(--color-text);
            font-family: 'Segoe UI', Arial, sans-serif;
            overflow: hidden;
            height: 100vh;
            display: flex;
            flex-direction: column;
            padding-top: var(--safe-top);
            padding-right: var(--safe-right);
            padding-bottom: var(--safe-bottom);
            padding-left: var(--safe-left);
            box-sizing: border-box;
            -webkit-font-smoothing: antialiased;
            text-rendering: optimizeLegibility;
        }

        #siteShell {
            position: fixed;
            top: calc(var(--safe-top) + 8px);
            left: calc(var(--safe-left) + 10px);
            right: calc(var(--safe-right) + 10px);
            z-index: 1150;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            gap: 8px 12px;
            padding: 8px 12px;
            border-radius: 12px;
            background: linear-gradient(120deg, var(--brand-surface), var(--brand-bg));
            border: 1px solid rgba(122, 162, 224, 0.35);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
            backdrop-filter: blur(8px);
            transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
        }

        #shellMeetTicker {
            flex: 1 1 200px;
            min-width: 0;
            padding: 0 8px;
            text-align: center;
        }

        /* Meet title: same field as sender Settings → TitleTextBox / layout.title */
        #shellMeetTitle {
            font-size: clamp(12px, 2.6vw, 22px);
            font-weight: 700;
            color: #E8F0FF;
            line-height: 1.25;
            max-height: 2.5em;
            overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            text-overflow: ellipsis;
        }

        #shellRightCluster {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-shrink: 0;
        }

        #siteShell:hover {
            border-color: rgba(151, 192, 255, 0.55);
            box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34);
        }

        #poolViewSelector {
            position: fixed;
            top: calc(var(--safe-top) + 76px);
            left: calc(var(--safe-left) + 12px);
            z-index: 1145;
            display: none;
            align-items: center;
            gap: 8px;
            padding: 6px 8px;
            border-radius: 10px;
            background: rgba(8, 18, 35, 0.84);
            border: 1px solid rgba(129, 170, 232, 0.35);
            backdrop-filter: blur(6px);
        }

        .pool-view-btn {
            border: 1px solid rgba(140, 176, 238, 0.34);
            border-radius: 8px;
            background: rgba(19, 33, 57, 0.88);
            color: var(--brand-text);
            padding: 6px 10px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
        }

        .pool-view-btn.active {
            background: linear-gradient(120deg, var(--brand-primary), var(--brand-secondary));
            border-color: rgba(182, 214, 255, 0.55);
            color: #FFFFFF;
        }

        #poolViewHint {
            font-size: 11px;
            color: #B9CDEE;
            margin-left: 2px;
            display: none;
        }

        #brandBlock {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 8px;
            min-width: 0;
        }

        #brandTextGroup {
            display: flex;
            flex-direction: column;
            min-width: 0;
        }

        #brandTitle {
            font-size: clamp(14px, 2vw, 20px);
            font-weight: 700;
            color: var(--brand-text);
            letter-spacing: 0.02em;
            line-height: 1.15;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        #brandTagline {
            font-size: clamp(10px, 1.3vw, 13px);
            color: #B8CCE8;
            line-height: 1.15;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        #brandLogo {
            display: none;
            width: auto;
            height: auto;
            max-height: var(--brand-logo-max-height, 44px);
            max-width: min(42vw, 160px);
            border-radius: 6px;
            object-fit: contain;
            object-position: center;
            background: transparent;
            border: 1px solid rgba(178, 209, 255, 0.22);
            box-shadow: none;
            padding: 0;
            margin: 0;
        }

        #hamburgerButton {
            border: 1px solid rgba(155, 193, 252, 0.35);
            color: var(--brand-text);
            background: linear-gradient(120deg, var(--brand-primary), var(--brand-secondary));
            border-radius: 10px;
            width: 44px;
            height: 38px;
            font-size: 20px;
            cursor: pointer;
            line-height: 1;
            transition: transform 150ms ease, filter 180ms ease, box-shadow 180ms ease;
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.26);
        }

        #hamburgerButton:hover {
            filter: brightness(1.06);
            transform: translateY(-1px);
        }

        #hamburgerButton:active {
            transform: translateY(0);
        }

        #hamburgerButton[aria-expanded="true"] {
            outline: 2px solid rgba(255, 255, 255, 0.35);
        }

        #menuDrawer {
            position: fixed;
            top: calc(var(--safe-top) + 72px);
            right: calc(var(--safe-right) + 10px);
            width: min(330px, calc(100vw - 20px));
            max-height: calc(100vh - 90px - var(--safe-top) - var(--safe-bottom));
            overflow-y: auto;
            z-index: 1160;
            display: block;
            border-radius: 14px;
            background: linear-gradient(180deg, var(--brand-surface), var(--brand-bg));
            border: 1px solid rgba(133, 169, 227, 0.36);
            box-shadow: 0 16px 45px rgba(0, 0, 0, 0.35);
            padding: 12px;
            opacity: 0;
            transform: translateY(-8px) scale(0.98);
            pointer-events: none;
            transition: opacity 180ms ease, transform 180ms ease;
        }

        #menuDrawer.open {
            opacity: 1;
            transform: translateY(0) scale(1);
            pointer-events: auto;
        }

        .menu-item {
            width: 100%;
            margin: 6px 0;
            border-radius: 10px;
            border: 1px solid rgba(106, 142, 201, 0.34);
            background: rgba(20, 34, 58, 0.7);
            color: var(--brand-text);
            text-align: left;
            padding: 11px 12px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: border-color 160ms ease, background 160ms ease, transform 120ms ease;
        }

        .menu-item:hover {
            border-color: rgba(140, 180, 240, 0.55);
            transform: translateY(-1px);
        }

        .menu-item.active {
            border-color: var(--brand-primary);
            background: linear-gradient(120deg, var(--brand-primary), var(--brand-secondary));
        }

        .menu-drawer-display-section {
            margin-top: 8px;
            padding-top: 10px;
            border-top: 1px solid rgba(106, 142, 201, 0.28);
        }

        .menu-drawer-subhead {
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: #8FAFD9;
            margin: 2px 4px 8px;
        }

        .menu-display-toggle {
            width: 100%;
            margin: 6px 0;
            border-radius: 10px;
            border: 1px solid rgba(106, 142, 201, 0.34);
            background: rgba(20, 34, 58, 0.7);
            color: var(--brand-text);
            text-align: left;
            padding: 11px 12px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: border-color 160ms ease, background 160ms ease, transform 120ms ease;
        }

        .menu-display-toggle:hover {
            border-color: rgba(140, 180, 240, 0.55);
            transform: translateY(-1px);
        }

        #siteAdminOverlay {
            position: fixed;
            inset: 0;
            z-index: 4000;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 16px;
            box-sizing: border-box;
        }

        #siteAdminOverlay.open {
            display: flex;
        }

        /* /admin (and #admin): dedicated page — not a dialog over the live board */
        html.admin-route body {
            overflow: auto;
            height: auto;
            min-height: 100vh;
        }

        html.admin-route #liveStage,
        html.admin-route #poolViewSelector,
        html.admin-route #status {
            display: none !important;
        }

        html.admin-route #siteAdminOverlay,
        html.admin-route #siteAdminOverlay.open {
            display: block;
            position: fixed;
            top: var(--viewer-chrome-top, calc(var(--safe-top) + 58px));
            left: 0;
            right: 0;
            bottom: 0;
            padding: 0;
            z-index: 1200;
            background: var(--color-bg);
            overflow: hidden;
        }

        html.admin-route .site-admin-backdrop {
            display: none;
        }

        html.admin-route .site-admin-dialog {
            position: absolute;
            inset: 0;
            width: 100%;
            max-width: none;
            max-height: none;
            height: 100%;
            margin: 0;
            border: none;
            border-radius: 0;
            box-shadow: none;
            padding: 16px clamp(16px, 3vw, 32px) 24px;
            box-sizing: border-box;
            overflow: auto;
        }

        html.admin-route #siteAdminClose {
            position: static;
            order: -1;
            align-self: flex-end;
            margin: 0 0 8px auto;
            font-size: 14px;
            font-weight: 600;
            padding: 8px 14px;
            border-radius: 10px;
            border: 1px solid rgba(106, 142, 201, 0.45);
            background: rgba(20, 34, 58, 0.88);
        }

        html.admin-route .site-admin-dialog {
            display: flex;
            flex-direction: column;
        }

        html.admin-route #siteAdminTitle {
            font-size: clamp(20px, 3vw, 28px);
        }

        html.admin-route .site-admin-tabs {
            position: sticky;
            top: 0;
            z-index: 2;
            padding: 8px 0;
            background: linear-gradient(180deg, rgba(8, 14, 27, 0.98) 70%, rgba(8, 14, 27, 0));
        }

        /* /admin requires sign-in before any editor UI is shown */
        html.admin-route:not(.admin-authenticated) #siteAdminEditorPanel {
            display: none !important;
        }

        html.admin-route:not(.admin-authenticated) #siteAdminLoginPanel {
            display: block !important;
        }

        html.admin-route #siteAdminLoginPanel {
            max-width: 420px;
            margin: 24px auto 0;
            padding: 20px;
            border-radius: 14px;
            border: 1px solid rgba(122, 157, 216, 0.35);
            background: rgba(10, 18, 32, 0.92);
        }

        .site-admin-backdrop {
            position: absolute;
            inset: 0;
            z-index: 0;
            background: rgba(4, 10, 22, 0.72);
            backdrop-filter: blur(4px);
        }

        .site-admin-dialog {
            position: relative;
            z-index: 1;
            width: min(640px, 100%);
            max-height: min(90vh, 820px);
            overflow: auto;
            pointer-events: auto;
            border-radius: 16px;
            border: 1px solid rgba(122, 157, 216, 0.38);
            background: linear-gradient(180deg, rgba(13,22,40,0.98), rgba(8,14,27,0.99));
            color: var(--brand-text);
            padding: 18px 20px 16px;
            box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
        }

        .site-admin-dialog h3 {
            margin: 0 0 6px;
            font-size: 18px;
        }

        .site-admin-dialog .site-admin-help {
            margin: 0 0 12px;
            font-size: 12px;
            color: #A9C0EB;
            line-height: 1.45;
        }

        .site-admin-field {
            display: flex;
            flex-direction: column;
            gap: 4px;
            margin-bottom: 10px;
        }

        .site-admin-field label {
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #8FAFD9;
        }

        .site-admin-field input[type="text"],
        .site-admin-field input[type="password"],
        .site-admin-field input[type="number"],
        .site-admin-field textarea {
            border-radius: 10px;
            border: 1px solid rgba(106, 142, 201, 0.4);
            background: rgba(6, 14, 28, 0.92);
            color: var(--brand-text);
            padding: 9px 11px;
            font-size: 14px;
            font-family: inherit;
            box-sizing: border-box;
            width: 100%;
        }

        .site-admin-field textarea {
            min-height: 72px;
            resize: vertical;
        }

        #siteAdminCardsHint {
            font-size: 11px;
            color: #96B2E2;
            margin-top: -4px;
            margin-bottom: 8px;
        }

        .site-admin-tabs {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin: 12px 0 10px;
        }

        .site-admin-tab {
            border-radius: 999px;
            border: 1px solid rgba(106, 142, 201, 0.45);
            background: rgba(20, 34, 58, 0.65);
            color: var(--brand-text);
            padding: 6px 12px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            pointer-events: auto;
            position: relative;
            z-index: 2;
        }

        .site-admin-brand-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 8px 10px;
            margin-bottom: 4px;
        }

        .site-admin-brand-colors {
            grid-template-columns: repeat(3, minmax(0, 1fr));
        }

        .site-admin-logo-row {
            align-items: end;
        }

        .site-admin-logo-preview-wrap {
            display: flex;
            flex-direction: column;
            gap: 6px;
            min-width: 0;
        }

        .site-admin-logo-preview-label {
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #8FAFD9;
        }

        .site-admin-logo-preview {
            display: none;
            align-items: center;
            justify-content: flex-start;
            min-height: 52px;
            padding: 10px 12px;
            border-radius: 10px;
            border: 1px solid rgba(106, 142, 201, 0.35);
            background: rgba(6, 14, 28, 0.92);
        }

        .site-admin-logo-preview img {
            display: block;
            object-fit: contain;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(178, 209, 255, 0.28);
        }

        .site-admin-field select {
            border-radius: 10px;
            border: 1px solid rgba(106, 142, 201, 0.4);
            background: rgba(6, 14, 28, 0.92);
            color: var(--brand-text);
            padding: 9px 11px;
            font-size: 14px;
            font-family: inherit;
            box-sizing: border-box;
            width: 100%;
        }

        @media (max-width: 520px) {
            .site-admin-brand-colors {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }

        .site-admin-tab.active {
            border-color: var(--brand-primary);
            background: linear-gradient(120deg, var(--brand-primary), var(--brand-secondary));
        }

        .site-admin-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 14px;
            align-items: center;
        }

        .site-admin-actions button {
            border-radius: 10px;
            border: 1px solid rgba(106, 142, 201, 0.45);
            background: rgba(20, 34, 58, 0.88);
            color: var(--brand-text);
            padding: 9px 14px;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
        }

        .site-admin-actions button.primary {
            border-color: transparent;
            background: linear-gradient(120deg, var(--brand-primary), var(--brand-secondary));
        }

        .site-admin-actions button.danger {
            border-color: rgba(248, 113, 113, 0.55);
            color: #FECACA;
            margin-left: auto;
        }

        #siteAdminClose {
            position: absolute;
            top: 10px;
            right: 12px;
            border: none;
            background: transparent;
            color: #B9CDEE;
            font-size: 22px;
            line-height: 1;
            cursor: pointer;
            padding: 4px 8px;
        }

        #siteAdminLoginErr,
        #siteAdminSaveErr {
            font-size: 12px;
            color: #FCA5A5;
            margin-top: 8px;
            min-height: 1.2em;
        }

        #siteAdminErrorLogPanel {
            margin-top: 8px;
        }

        #siteAdminErrorLogPanel .site-admin-help {
            margin-bottom: 10px;
        }

        #siteAdminErrorsList {
            font-family: ui-monospace, Consolas, monospace;
            font-size: 11px;
            line-height: 1.45;
            color: #E2E8F0;
            background: rgba(10, 18, 32, 0.92);
            border: 1px solid rgba(106, 142, 201, 0.35);
            border-radius: 10px;
            padding: 12px;
            max-height: min(52vh, 420px);
            overflow: auto;
            white-space: pre-wrap;
            word-break: break-word;
            margin: 0;
        }

        #sectionPanels {
            position: fixed;
            top: var(--viewer-chrome-top, calc(var(--safe-top) + 84px));
            left: calc(var(--safe-left) + 24px);
            right: calc(var(--safe-right) + 24px);
            bottom: calc(var(--safe-bottom) + 24px);
            z-index: 1120;
            display: none;
        }

        .section-panel {
            display: none;
            width: 100%;
            height: 100%;
            border-radius: 16px;
            padding: 20px;
            border: 1px solid rgba(122, 157, 216, 0.3);
            background: linear-gradient(180deg, rgba(13,22,40,0.95), rgba(8,14,27,0.97));
            color: var(--brand-text);
            overflow: auto;
            box-sizing: border-box;
            animation: panelIn 220ms ease;
        }

        .section-panel.visible {
            display: block;
        }

        .panel-title {
            margin: 0 0 8px;
            font-size: clamp(24px, 3.6vw, 42px);
            font-weight: 800;
            color: var(--brand-text);
        }

        .panel-subtitle {
            margin: 0 0 18px;
            color: #B8CCE8;
            font-size: clamp(13px, 1.8vw, 18px);
        }

        .placeholder-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 12px;
        }

        .placeholder-card {
            border: 1px solid rgba(114, 152, 212, 0.28);
            border-radius: 12px;
            padding: 14px;
            background: rgba(17, 28, 49, 0.65);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
        }

        .placeholder-card strong,
        .placeholder-card-heading {
            display: block;
            margin-bottom: 6px;
            color: var(--brand-accent);
            letter-spacing: 0.01em;
            line-height: 1.35;
            white-space: pre-line;
        }

        .placeholder-card-body {
            margin: 0;
            color: var(--brand-text);
            font-size: clamp(13px, 1.6vw, 16px);
            line-height: 1.45;
            white-space: pre-line;
        }

        .section-meta {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
            flex-wrap: wrap;
        }

        .meta-pill {
            padding: 6px 10px;
            border-radius: 999px;
            font-size: 12px;
            border: 1px solid rgba(132, 169, 229, 0.35);
            background: rgba(17, 28, 49, 0.75);
            color: #D6E6FF;
        }

        #panelResults.visible {
            display: flex;
            flex-direction: column;
        }

        .meet-cuts-banner {
            width: 100%;
            margin: 0 0 16px;
            padding: clamp(18px, 3.5vw, 32px) clamp(14px, 2.5vw, 24px);
            border-radius: 14px;
            text-align: center;
            border: 1px solid rgba(34, 211, 238, 0.35);
            background:
                linear-gradient(135deg, rgba(34, 211, 238, 0.14) 0%, rgba(124, 58, 237, 0.2) 55%, rgba(78, 161, 255, 0.12) 100%);
            box-shadow: 0 10px 36px rgba(8, 14, 27, 0.45);
            box-sizing: border-box;
        }

        .meet-cuts-banner-headline {
            font-size: clamp(28px, 5.5vw, 52px);
            font-weight: 900;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: var(--brand-accent);
            line-height: 1.05;
            text-wrap: balance;
        }

        .meet-cuts-banner-subtext {
            margin-top: 10px;
            font-size: clamp(13px, 1.8vw, 18px);
            color: #D6E6FF;
            line-height: 1.45;
            text-wrap: balance;
        }

        .meet-cuts-banner-subtext:empty {
            display: none;
        }

        .meet-cuts-summary {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 14px;
        }

        .meet-cuts-stat {
            flex: 1 1 140px;
            min-width: 120px;
            padding: 12px 14px;
            border-radius: 12px;
            border: 1px solid rgba(114, 152, 212, 0.28);
            background: rgba(17, 28, 49, 0.72);
        }

        .meet-cuts-stat-value {
            font-size: clamp(24px, 4vw, 34px);
            font-weight: 800;
            color: var(--brand-accent);
            line-height: 1.1;
        }

        .meet-cuts-stat-label {
            margin-top: 4px;
            font-size: 12px;
            color: #B8CCE8;
            letter-spacing: 0.02em;
        }

        .meet-cuts-empty {
            padding: 18px 16px;
            border-radius: 12px;
            border: 1px dashed rgba(114, 152, 212, 0.35);
            color: #B8CCE8;
            font-size: clamp(13px, 1.7vw, 16px);
            line-height: 1.45;
        }

        .meet-cuts-empty p {
            margin: 0;
        }

        .meet-cuts-split {
            display: grid;
            grid-template-columns: minmax(220px, 34%) 1fr;
            gap: 14px;
            flex: 1 1 auto;
            min-height: 240px;
            align-items: stretch;
        }

        .meet-cuts-events {
            overflow: auto;
            border-radius: 12px;
            border: 1px solid rgba(114, 152, 212, 0.28);
            background: rgba(8, 14, 27, 0.72);
            padding: 8px;
        }

        .meet-cuts-events-title {
            margin: 4px 8px 10px;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: #8FAFD8;
        }

        .meet-cuts-event-btn {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 10px;
            width: 100%;
            margin: 0 0 6px;
            padding: 10px 12px;
            border-radius: 10px;
            border: 1px solid transparent;
            background: rgba(17, 28, 49, 0.55);
            color: #E8F2FF;
            text-align: left;
            cursor: pointer;
            font: inherit;
            transition: border-color 120ms ease, background 120ms ease;
        }

        .meet-cuts-event-btn:hover {
            border-color: rgba(114, 152, 212, 0.45);
            background: rgba(17, 28, 49, 0.85);
        }

        .meet-cuts-event-btn.active {
            border-color: rgba(34, 211, 238, 0.55);
            background: rgba(34, 211, 238, 0.12);
        }

        .meet-cuts-event-btn-label {
            flex: 1 1 auto;
            min-width: 0;
        }

        .meet-cuts-event-btn-no {
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.04em;
            color: #8FAFD8;
            margin-bottom: 2px;
        }

        .meet-cuts-event-btn-name {
            font-size: clamp(12px, 1.4vw, 14px);
            font-weight: 600;
            line-height: 1.3;
        }

        .meet-cuts-event-btn-count {
            flex: 0 0 auto;
            min-width: 24px;
            padding: 4px 8px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 800;
            text-align: center;
            background: rgba(34, 211, 238, 0.16);
            color: #67E8F9;
            border: 1px solid rgba(34, 211, 238, 0.35);
        }

        .meet-cuts-detail {
            display: flex;
            flex-direction: column;
            min-height: 0;
            min-width: 0;
        }

        .meet-cuts-detail-head {
            margin-bottom: 10px;
            padding: 10px 12px;
            border-radius: 10px;
            border: 1px solid rgba(114, 152, 212, 0.22);
            background: rgba(17, 28, 49, 0.55);
        }

        .meet-cuts-detail-head-title {
            font-size: clamp(15px, 2vw, 20px);
            font-weight: 800;
            color: var(--brand-text);
            line-height: 1.25;
        }

        .meet-cuts-detail-head-meta {
            margin-top: 4px;
            font-size: 12px;
            color: #B8CCE8;
        }

        .meet-cuts-detail .meet-cuts-table-wrap {
            flex: 1 1 auto;
            min-height: 0;
        }

        @media (max-width: 820px) {
            .meet-cuts-split {
                grid-template-columns: 1fr;
            }

            .meet-cuts-events {
                max-height: 220px;
            }
        }

        .meet-cuts-table-wrap {
            overflow: auto;
            border-radius: 12px;
            border: 1px solid rgba(114, 152, 212, 0.28);
            background: rgba(8, 14, 27, 0.72);
        }

        .meet-cuts-table {
            width: 100%;
            border-collapse: collapse;
            font-size: clamp(12px, 1.5vw, 15px);
        }

        .meet-cuts-table th,
        .meet-cuts-table td {
            padding: 10px 12px;
            text-align: left;
            border-bottom: 1px solid rgba(114, 152, 212, 0.18);
            vertical-align: top;
        }

        .meet-cuts-table th {
            position: sticky;
            top: 0;
            z-index: 1;
            background: rgba(17, 28, 49, 0.96);
            color: #D6E6FF;
            font-size: 11px;
            letter-spacing: 0.06em;
            text-transform: uppercase;
        }

        .meet-cuts-table tbody tr:nth-child(even) {
            background: rgba(17, 28, 49, 0.35);
        }

        .meet-cuts-table .swimmer-cell {
            font-weight: 700;
            color: var(--brand-text);
        }

        .meet-cuts-table .time-cell {
            font-variant-numeric: tabular-nums;
            font-weight: 700;
            white-space: nowrap;
        }

        .meet-cut-badge {
            display: inline-block;
            margin: 0 4px 4px 0;
            padding: 3px 8px;
            border-radius: 999px;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }

        .meet-cut-badge.junior {
            background: rgba(34, 211, 238, 0.18);
            color: #67E8F9;
            border: 1px solid rgba(34, 211, 238, 0.45);
        }

        .meet-cut-badge.senior {
            background: rgba(124, 58, 237, 0.22);
            color: #C4B5FD;
            border: 1px solid rgba(124, 58, 237, 0.45);
        }

        #siteAdminStandardsJson {
            font-family: ui-monospace, Consolas, monospace;
            font-size: 12px;
            line-height: 1.4;
        }

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

        /* TOP STATUS (matches sender) */
        #status {
            position: absolute;
            top: calc(var(--safe-top) + 72px);
            right: calc(var(--safe-right) + 10px);
            font-size: 11px;
            color: #888;
            opacity: 0.8;
            z-index: 1000;
        }

        html.cloud-viewer #standbyOverlay {
            display: none !important;
        }

        /* Live timing boards + standby (below shell/pool chrome); schedule/results/about stay outside */
        #liveStage {
            position: fixed;
            top: var(--viewer-chrome-top);
            left: 0;
            right: 0;
            bottom: calc(var(--safe-bottom));
            z-index: 900;
            display: flex;
            flex-direction: column;
            min-height: 0;
            overflow: hidden;
            box-sizing: border-box;
        }

        html.cloud-viewer .meet-strip-rt,
        html.cloud-viewer .dual-pool-running {
            display: none !important;
        }

        html.cloud-viewer .meet-strip-main {
            grid-template-columns: minmax(0, auto) minmax(0, 1fr);
        }

        html.cloud-viewer {
            --lane-col: 110px;
            --time-col: 210px;
            --place-col: 115px;
            --base-font: 26px;
            --header-font: 28px;
            --header-pad-y: 14px;
            --header-pad-x: 16px;
            --scoreboard-margin-x: 12px;
            --logo-bar-height: 96px;
            --logo-img-max-width: 180px;
            --row-height: 72px;
            --row-gap: 6px;
            --lane-box-height: 58px;
            --lane-font: 34px;
            --name-font: 22px;
            --team-font: 24px;
            --time-font: 30px;
            --place-font: 34px;
        }

        /* Cloud: header grid stays aligned inside each pane (single or split). */
        html.cloud-viewer .lane-board-pane {
            min-width: 0;
        }

        html.cloud-viewer .lane-board--split .lane-board-pane {
            flex: 1 1 0;
            max-width: 50%;
        }

        html.cloud-viewer .column-headers-grid {
            grid-template-columns: var(--lane-col) minmax(0, 1fr) var(--time-col) minmax(76px, var(--place-col));
            width: 100%;
            margin-bottom: 6px;
        }

        html.cloud-viewer .column-headers-grid .header,
        html.cloud-viewer .dual-column-headers .header {
            box-sizing: border-box;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            padding: 8px 6px;
            font-size: var(--header-font);
            font-weight: bold;
            color: var(--color-strong-text);
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
            background: none;
            border: none;
            margin: 0;
            border-radius: 0;
            box-shadow: none;
        }

        html.cloud-viewer .column-headers-grid .header.lane,
        html.cloud-viewer .column-headers-grid .header.place,
        html.cloud-viewer .dual-column-headers .header.lane,
        html.cloud-viewer .dual-column-headers .header.place {
            background: none;
            border: none;
            margin: 0;
            border-radius: 0;
            box-shadow: none;
        }

        html.cloud-viewer .column-headers-grid .header.lane {
            grid-column: 1;
        }

        html.cloud-viewer .column-headers-grid .header.name {
            grid-column: 2;
            text-align: left;
            justify-content: flex-start;
            padding-left: 12px;
            padding-right: 8px;
        }

        html.cloud-viewer .column-headers-grid .header.team {
            display: none;
        }

        html.cloud-viewer .column-headers-grid .header.time {
            grid-column: 3;
        }

        html.cloud-viewer .column-headers-grid .header.place {
            grid-column: 4;
        }

        html.cloud-viewer .dual-column-headers {
            grid-template-columns: var(--lane-col) minmax(0, 1fr) var(--time-col) minmax(76px, var(--place-col));
            width: 100%;
        }

        html.cloud-viewer .dual-column-headers .header.name {
            text-align: left;
            justify-content: flex-start;
            padding-left: 10px;
            padding-right: 8px;
        }

        /* Cloud: lane/place values match name/time — no boxed cells */
        html.cloud-viewer .lane-cell-box {
            height: auto;
            min-height: 0;
            background: none;
            border: none;
            border-radius: 0;
            box-shadow: none;
            text-shadow: none;
            display: block;
            padding: 0;
            font-weight: 700;
        }

        html.cloud-viewer .scoreboard-lane-table tbody td:first-child .lane-cell-box,
        html.cloud-viewer .dual-scoreboard-table tbody td:first-child .lane-cell-box {
            font-size: var(--name-font);
            font-family: inherit;
        }

        html.cloud-viewer .scoreboard-lane-table tbody td:last-child .lane-cell-box,
        html.cloud-viewer .dual-scoreboard-table tbody td:last-child .lane-cell-box {
            font-size: var(--time-font);
            font-family: 'Segoe UI', Arial, Consolas, monospace;
            font-variant-numeric: tabular-nums;
            font-feature-settings: "tnum" 1;
        }

        html.cloud-viewer .lane-name-cell {
            text-align: left;
            padding-left: 8px;
            padding-right: 6px;
            vertical-align: middle;
            min-width: 0;
            overflow: hidden;
            white-space: normal;
        }

        html.cloud-viewer .lane-name-line,
        html.cloud-viewer .lane-team-line {
            display: block;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            line-height: 1.12;
        }

        html.cloud-viewer .lane-name-line {
            font-size: var(--name-font);
            font-weight: 700;
            color: var(--color-strong-text);
        }

        html.cloud-viewer .lane-team-line {
            font-size: max(10px, calc(var(--name-font) * 0.82));
            font-weight: 600;
            color: var(--color-text-dim);
            margin-top: 1px;
        }

        html.cloud-viewer .lane-team-line:empty {
            display: none;
        }

        html.cloud-viewer #siteShell {
            display: grid;
            grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
            grid-template-areas: "brand meet clock";
            align-items: center;
            column-gap: 10px;
            row-gap: 2px;
            padding: 5px 10px;
        }

        html.cloud-viewer #brandBlock {
            grid-area: brand;
            max-width: min(48vw, 380px);
            min-width: 0;
            align-items: center;
            gap: 7px;
        }

        html.cloud-viewer #brandLogo {
            max-width: min(38vw, 132px);
            border: none;
            background: transparent;
        }

        html.cloud-viewer #brandTextGroup {
            min-width: 0;
        }

        html.cloud-viewer #brandTitle {
            max-width: 100%;
        }

        html.cloud-viewer #brandTagline {
            display: block;
            max-width: 100%;
        }

        html.cloud-viewer #shellMeetTicker {
            grid-area: meet;
            flex: unset;
            order: unset;
            min-width: 0;
            padding: 0 6px;
        }

        html.cloud-viewer #shellRightCluster {
            grid-area: clock;
        }

        html.cloud-viewer #shellMeetTitle {
            width: 100%;
        }

        html.cloud-viewer .meet-strip-main {
            grid-template-columns: minmax(0, auto) minmax(0, 1fr);
        }

        /* Compact meet strip: event · heat · name (race clock hidden on cloud until timing is stable) */
        #meetStrip {
            background: var(--color-bg);
            padding: 6px var(--header-pad-x);
            margin-top: calc(var(--safe-top) + 54px);
            border-bottom: 2px solid var(--color-border);
            display: none;
            flex-direction: column;
            align-items: stretch;
            gap: 4px;
            min-width: 0;
            flex-shrink: 0;
            overflow: visible;
        }

        .meet-strip-main {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr) minmax(0, 1fr);
            align-items: center;
            gap: 6px 10px;
            min-width: 0;
            width: 100%;
        }

        .meet-strip-ev-heat,
        .meet-strip-meta {
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            align-items: baseline;
            gap: 4px 6px;
            justify-self: start;
            min-width: 0;
        }

        .meet-strip-event-center,
        .meet-strip-meta .meet-event-name {
            justify-self: center;
            text-align: center;
            font-weight: 700;
            color: var(--color-strong-text);
            text-shadow: 0 1px 2px var(--color-text-outline);
            min-width: 0;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            line-height: 1.2;
            padding: 0 4px;
        }

        .meet-strip-ev-heat .meet-label,
        .meet-strip-meta .meet-label {
            font-size: clamp(11px, 1.8vw, 14px);
            color: var(--color-text-dim);
            font-weight: 600;
            letter-spacing: 0.04em;
        }

        .meet-strip-ev-heat .meet-value,
        .meet-strip-meta .meet-value {
            font-size: clamp(16px, 3.6vw, 30px);
            color: var(--color-strong-text);
            font-weight: 800;
            text-shadow: 0 1px 2px var(--color-text-outline);
            margin-right: 2px;
            min-width: 0;
            flex-shrink: 1;
        }

        .meet-strip-ev-heat .meet-dot,
        .meet-strip-meta .meet-dot {
            color: var(--color-text-dim);
            font-weight: 700;
            opacity: 0.75;
            user-select: none;
        }

        .meet-strip-rt {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            flex-shrink: 0;
            justify-self: end;
            min-width: 0;
            max-width: 100%;
        }

        .meet-strip-rt .meet-label-sub {
            font-size: clamp(10px, 1.6vw, 12px);
            color: var(--color-text-dim);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }

        #runningTimeValue {
            font-size: clamp(15px, 3.4vw, 30px);
            color: var(--color-strong-text);
            font-weight: bold;
            font-variant-numeric: tabular-nums;
            font-feature-settings: "tnum" 1;
            text-shadow: 0 1px 2px var(--color-text-outline);
            white-space: nowrap;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* Timing event description (ScoreboardState.EventName); below EVENT·HEAT like local MainWindow */
        #timingEventDescription {
            font-weight: 700;
            font-size: clamp(14px, 3vw, 24px);
            color: var(--color-strong-text);
            margin: 2px 0 0;
            padding: 0 var(--header-pad-x);
            text-shadow: 0 1px 2px var(--color-text-outline);
            text-align: left;
            opacity: 0.92;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            display: none;
        }

        #timingEventDescription:not(:empty) {
            display: block;
        }

        #liveStage #meetStrip {
            margin-top: 0;
            flex-shrink: 0;
        }

        #liveStage #logoBar {
            flex-shrink: 0;
        }

        #currentTime {
            font-size: clamp(13px, 2.6vw, 18px);
            color: var(--color-strong-text);
            font-weight: 700;
            font-variant-numeric: tabular-nums;
            white-space: nowrap;
        }

        #standbyOverlay {
            position: absolute;
            inset: 0;
            display: none;
            z-index: 10;
            background:
                radial-gradient(120% 120% at 10% 15%, #1f3f74 0%, rgba(31, 63, 116, 0) 62%),
                radial-gradient(120% 120% at 86% 82%, #2d1f5e 0%, rgba(45, 31, 94, 0) 60%),
                linear-gradient(140deg, #03070f 0%, #091325 45%, #060a14 100%);
            overflow: hidden;
        }

        #standbyOverlay::before {
            content: "";
            position: absolute;
            inset: -20%;
            background:
                repeating-linear-gradient(
                    120deg,
                    rgba(255, 255, 255, 0.028) 0px,
                    rgba(255, 255, 255, 0.028) 2px,
                    transparent 2px,
                    transparent 24px
                );
            animation: standbyDrift 20s linear infinite;
            opacity: 0.5;
        }

        .standby-orb {
            position: absolute;
            border-radius: 50%;
            filter: blur(1px);
            opacity: 0.55;
            animation: standbyFloat 10s ease-in-out infinite;
        }

        .standby-orb.one {
            width: 320px;
            height: 320px;
            top: -80px;
            left: -70px;
            background: radial-gradient(circle at 30% 30%, #60a5fa, #1d4ed8 70%);
        }

        .standby-orb.two {
            width: 280px;
            height: 280px;
            right: -60px;
            bottom: -70px;
            background: radial-gradient(circle at 40% 30%, #a78bfa, #6d28d9 68%);
            animation-delay: -2.5s;
        }

        .standby-card {
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            width: min(760px, calc(100vw - 70px));
            border-radius: 18px;
            border: 1px solid rgba(154, 186, 255, 0.25);
            background: linear-gradient(180deg, rgba(10, 21, 40, 0.82), rgba(8, 14, 26, 0.92));
            box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.09);
            backdrop-filter: blur(8px);
            padding: 34px 32px 30px;
            text-align: center;
        }

        .standby-title {
            margin: 0;
            font-size: clamp(32px, 6vw, 74px);
            font-weight: 800;
            letter-spacing: -0.02em;
            color: #ffffff;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
            background: linear-gradient(92deg, #f8fbff 0%, #b9d6ff 48%, #ffffff 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .standby-subtitle {
            margin: 12px 0 0;
            font-size: clamp(14px, 2.1vw, 22px);
            color: #d2def2;
        }

        .standby-pulse {
            margin: 22px auto 0;
            width: 240px;
            max-width: 65%;
            height: 4px;
            border-radius: 999px;
            background: linear-gradient(90deg, rgba(96,165,250,0.1), #60a5fa, #c4b5fd, rgba(96,165,250,0.1));
            animation: standbyPulse 2.25s ease-in-out infinite;
        }

        /* MAIN SCOREBOARD — JS picks single column vs split from viewport height/width */
        #laneBoard {
            display: flex;
            flex-direction: row;
            flex: 1;
            min-height: 0;
            gap: 10px;
            align-items: stretch;
        }

        .lane-board-pane {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-width: 0;
            min-height: 0;
        }

        #lanePaneRight {
            display: none;
        }

        .lane-board--split #lanePaneRight {
            display: flex;
        }

        .lane-board--split .lane-board-pane {
            flex: 1 1 0;
            max-width: 50%;
        }

        #scoreboardContainer {
            flex: 1;
            margin: 0 var(--scoreboard-margin-x);
            padding-top: 5px;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            min-height: 0;
        }

        #dualCombinedContainer {
            flex: 1;
            margin: 0 var(--scoreboard-margin-x);
            padding-top: 5px;
            display: none;
            gap: 8px;
            min-height: 0;
            overflow: hidden;
        }

        @media (max-width: 900px) and (orientation: portrait) {
            html.cloud-viewer #dualCombinedContainer {
                flex-direction: column;
            }
        }

        .dual-pool-pane {
            flex: 1 1 0;
            min-width: 0;
            display: flex;
            flex-direction: column;
            border: 1px solid var(--color-border);
            border-radius: 10px;
            background: rgba(8, 15, 26, 0.72);
            overflow: hidden;
        }

        .dual-pool-pane-header {
            display: grid;
            grid-template-columns: 1fr auto;
            align-items: center;
            gap: 8px;
            padding: 9px 9px 7px;
            background: linear-gradient(180deg, rgba(26, 37, 53, 0.96), rgba(20, 30, 45, 0.92));
            border-bottom: 1px solid var(--color-border);
        }

        .dual-pool-title {
            font-size: 14px;
            font-weight: 700;
            color: var(--color-text-dim);
            margin-bottom: 2px;
        }

        .dual-pool-event {
            font-size: clamp(13px, 1.8vw, 20px);
            font-weight: 700;
            color: var(--color-strong-text);
            text-shadow: 0 1px 2px var(--color-text-outline);
        }

        .dual-pool-name {
            font-size: clamp(11px, 1.2vw, 14px);
            color: var(--color-strong-text);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .dual-pool-running {
            text-align: right;
            min-width: 90px;
        }

        .dual-pool-running-label {
            font-size: 10px;
            color: var(--color-text-dim);
        }

        .dual-pool-running-value {
            font-size: clamp(16px, 2.2vw, 26px);
            font-weight: 700;
            color: var(--color-strong-text);
            text-shadow: 0 1px 2px var(--color-text-outline);
            font-variant-numeric: tabular-nums;
        }

        .dual-pool-board {
            display: flex;
            flex-direction: column;
            min-height: 0;
            flex: 1;
            padding: 5px 7px 7px;
        }

        .dual-column-headers {
            display: grid;
            grid-template-columns: var(--lane-col) 1fr var(--time-col) var(--place-col);
            background: var(--color-panel);
            margin-bottom: 6px;
        }

        .dual-column-headers .header {
            padding: 7px 0;
            font-size: max(11px, calc(var(--header-font) - 2px));
            font-weight: 700;
            color: var(--color-strong-text);
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .dual-column-headers .header.lane,
        .dual-column-headers .header.place {
            background: var(--color-panel-soft);
            border: 2px solid var(--color-border);
            border-radius: 2px;
            margin: 3px;
            padding: 5px 0;
        }

        .dual-column-headers .header.name {
            justify-content: flex-start;
            padding-left: 10px;
        }

        .dual-scoreboard-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0 var(--row-gap);
            table-layout: fixed;
            flex: 1;
        }

        .dual-scoreboard-table thead {
            display: none;
        }

        .dual-scoreboard-table col:nth-child(1) {
            width: var(--lane-col);
        }

        .dual-scoreboard-table col:nth-child(2) {
            width: auto;
        }

        .dual-scoreboard-table col:nth-child(4) {
            width: var(--time-col);
        }

        .dual-scoreboard-table col:nth-child(5) {
            width: var(--place-col);
        }

        .dual-scoreboard-table tbody tr {
            background: var(--color-row-odd);
            height: max(60px, calc(var(--row-height) - 14px));
        }

        .dual-scoreboard-table tbody tr.lane-even {
            background: var(--color-row-even);
        }

        .dual-scoreboard-table tbody td {
            padding: 0;
            text-align: center;
            color: var(--color-strong-text);
            font-size: var(--base-font);
            font-weight: 700;
            vertical-align: middle;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .dual-scoreboard-table tbody td:first-child {
            width: var(--lane-col);
            text-align: center;
            padding: 0 4px;
        }

        .dual-scoreboard-table tbody td:nth-child(2),
        .dual-scoreboard-table tbody td.lane-name-cell {
            text-align: left;
            padding-left: 10px;
            padding-right: 6px;
            font-size: max(11px, calc(var(--name-font) - 2px));
        }

        html.cloud-viewer .dual-scoreboard-table tbody td:nth-child(2),
        html.cloud-viewer .dual-scoreboard-table tbody td.lane-name-cell {
            font-size: inherit;
            padding-left: 8px;
            padding-right: 6px;
        }

        .dual-scoreboard-table tbody td:nth-child(3),
        .dual-scoreboard-table col:nth-child(3) {
            display: none;
        }

        .dual-scoreboard-table tbody td:nth-child(4) {
            width: var(--time-col);
            text-align: center;
            font-size: max(11px, calc(var(--time-font) - 2px));
            font-family: 'Segoe UI', Arial, Consolas, monospace;
        }

        .dual-scoreboard-table tbody td:last-child {
            width: var(--place-col);
            text-align: center;
            padding: 0 4px;
        }

        #dualCombinedContainer .lane-cell-box {
            height: max(42px, calc(var(--lane-box-height) - 14px));
            font-size: max(12px, calc(var(--lane-font) - 5px));
        }

        #dualCombinedContainer .dual-scoreboard-table tbody td:last-child .lane-cell-box {
            font-size: max(12px, calc(var(--place-font) - 4px));
        }

        body.dual-fit-standard #dualCombinedContainer {
            gap: 10px;
        }

        body.dual-fit-standard .dual-pool-pane-header {
            padding: 10px 10px 8px;
        }

        body.dual-fit-standard .dual-pool-event {
            font-size: clamp(14px, 2vw, 22px);
        }

        body.dual-fit-standard .dual-pool-name {
            font-size: clamp(12px, 1.5vw, 16px);
        }

        body.dual-fit-standard .dual-pool-running-value {
            font-size: clamp(18px, 2.7vw, 30px);
        }

        body.dual-fit-standard .dual-pool-board {
            padding: 5px 8px 8px;
        }

        body.dual-fit-standard .dual-column-headers .header {
            padding: 8px 0;
        }

        body.dual-fit-standard .dual-column-headers .header.lane,
        body.dual-fit-standard .dual-column-headers .header.place {
            margin: 4px;
            padding: 6px 0;
        }

        body.dual-fit-standard .dual-scoreboard-table tbody tr {
            height: var(--row-height);
        }

        body.dual-fit-standard #dualCombinedContainer .lane-cell-box {
            height: max(42px, calc(var(--lane-box-height) - 11px));
            font-size: max(12px, calc(var(--lane-font) - 4px));
        }

        @media (max-width: 1300px) {
            #dualCombinedContainer {
                gap: 6px;
            }

            .dual-pool-pane-header {
                padding: 7px 7px 6px;
            }

            .dual-pool-running-value {
                font-size: clamp(14px, 2vw, 22px);
            }

            .dual-column-headers .header {
                font-size: max(10px, calc(var(--header-font) - 3px));
                padding: 6px 0;
            }

            .dual-scoreboard-table tbody td:nth-child(2) {
                font-size: max(10px, calc(var(--name-font) - 3px));
            }

            .dual-scoreboard-table tbody td:nth-child(4) {
                font-size: max(10px, calc(var(--time-font) - 3px));
            }
        }

        /* COLUMN HEADERS — shared by left/right lane panes */
        .column-headers-grid {
            display: grid;
            grid-template-columns: var(--lane-col) 1fr var(--time-col) var(--place-col);
            gap: 0;
            background: var(--color-panel);
            margin-bottom: 8px;
            flex-shrink: 0;
        }

        .column-headers-grid .header {
            padding: 11px 0;
            font-size: var(--header-font);
            font-weight: bold;
            color: var(--color-strong-text);
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .column-headers-grid .header.lane,
        .column-headers-grid .header.place {
            background: var(--color-panel-soft);
            border: 2px solid var(--color-border);
            border-radius: 2px;
            margin: 5px;
            padding: 11px 0;
        }

        .column-headers-grid .header.name {
            text-align: left;
            padding-left: 20px;
            padding-right: 0;
            justify-content: flex-start;
        }

        /* Local/LAN viewer: compact headers, no logo bar (AWS keeps defaults). */
        html.local-viewer {
            --header-font: 24px;
            --logo-bar-height: 0px;
        }

        html.local-viewer .column-headers-grid .header {
            padding: 4px 0;
        }

        html.local-viewer .column-headers-grid .header.lane,
        html.local-viewer .column-headers-grid .header.place {
            margin: 2px;
            padding: 3px 0;
        }

        html.local-viewer .dual-column-headers .header {
            padding: 4px 0;
        }

        html.local-viewer .dual-column-headers .header.lane,
        html.local-viewer .dual-column-headers .header.place {
            margin: 2px;
            padding: 3px 0;
        }

        html.local-viewer #logoBar {
            display: none !important;
            height: 0 !important;
            margin: 0 !important;
            padding: 0 !important;
        }

        .scoreboard-lane-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0 var(--row-gap);
            flex: 1 1 auto;
            min-height: 0;
            overflow: hidden;
            table-layout: fixed;
        }

        html.cloud-viewer .lane-board-pane {
            overflow: hidden;
        }

        .scoreboard-lane-table thead {
            display: none;
        }

        .scoreboard-lane-table col:nth-child(1) {
            width: var(--lane-col);
        }

        .scoreboard-lane-table col:nth-child(2) {
            width: auto;
        }

        .scoreboard-lane-table col:nth-child(4) {
            width: var(--time-col);
        }

        .scoreboard-lane-table col:nth-child(5) {
            width: var(--place-col);
        }

        .scoreboard-lane-table tbody tr {
            background: var(--color-row-odd);
            height: var(--row-height);
        }

        .scoreboard-lane-table tbody tr.lane-even {
            background: var(--color-row-even);
        }

        .scoreboard-lane-table tbody td {
            padding: 0;
            text-align: center;
            color: var(--color-strong-text);
            font-size: var(--base-font);
            font-weight: 700;
            vertical-align: middle;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .scoreboard-lane-table tbody td:first-child {
            width: var(--lane-col);
            text-align: center;
            padding: 0 5px;
        }

        .scoreboard-lane-table tbody td:nth-child(2),
        .scoreboard-lane-table tbody td.lane-name-cell {
            text-align: left;
            padding-left: 20px;
            padding-right: 10px;
            font-size: var(--name-font);
        }

        html.cloud-viewer .scoreboard-lane-table tbody td:nth-child(2),
        html.cloud-viewer .scoreboard-lane-table tbody td.lane-name-cell {
            padding-left: 8px;
            padding-right: 6px;
            white-space: normal;
        }

        .column-headers-grid .header:nth-child(3),
        .scoreboard-lane-table tbody td:nth-child(3),
        .scoreboard-lane-table col:nth-child(3) {
            display: none;
        }

        .scoreboard-lane-table tbody td:nth-child(4) {
            width: var(--time-col);
            text-align: center;
            font-size: var(--time-font);
            font-family: 'Segoe UI', Arial, Consolas, monospace;
            font-variant-numeric: tabular-nums;
            font-feature-settings: "tnum" 1;
        }

        .scoreboard-lane-table tbody td:last-child {
            width: var(--place-col);
            text-align: center;
            padding: 0 5px;
        }

        .scoreboard-lane-table tbody td:last-child .lane-cell-box {
            font-size: var(--place-font);
        }

        .lane-cell-box {
            height: var(--lane-box-height);
            background: var(--color-panel-soft);
            border: 2px solid var(--color-border);
            border-radius: 2px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: var(--lane-font);
            font-weight: 700;
            text-shadow: 0 1px 2px var(--color-text-outline);
            font-variant-numeric: tabular-nums;
            font-feature-settings: "tnum" 1;
        }

        /* LOGO BAR (matches sender) */
        #logoBar {
            height: var(--logo-bar-height);
            background: var(--color-bg);
            margin-top: 5px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 var(--scoreboard-margin-x);
            pointer-events: none;
        }

        #logoBar img {
            display: block;
            max-width: var(--logo-img-max-width);
            object-fit: contain;
            margin: 0 10px;
        }

        /* Tablet and small laptop */
        @media (max-width: 1100px) {
            :root {
                --lane-col: 76px;
                --team-col: 70px;
                --time-col: 150px;
                --place-col: 64px;
                --base-font: 28px;
                --header-font: 30px;
                --header-pad-y: 18px;
                --header-pad-x: 21px;
                --scoreboard-margin-x: 10px;
                --logo-bar-height: 108px;
                --logo-img-max-width: 160px;
                --row-height: 80px;
                --row-gap: 5px;
                --lane-box-height: 63px;
                --lane-font: 36px;
                --name-font: 25px;
                --team-font: 28px;
                --time-font: 35px;
                --place-font: 36px;
            }

            .column-headers-grid .header.name,
            .scoreboard-lane-table tbody td:nth-child(2),
            .scoreboard-lane-table tbody td:nth-child(3) {
                padding-left: 10px;
            }

            #logoBar img { margin: 0 4px; }
        }

        /* iPad portrait/tablet portrait rhythm */
        @media (max-width: 1024px) and (orientation: portrait) {
            :root {
                --row-height: 78px;
                --row-gap: 5px;
                --lane-box-height: 60px;
                --lane-font: 35px;
                --name-font: 24px;
                --team-font: 26px;
                --time-font: 34px;
                --place-font: 35px;
            }
        }

        /* iPad landscape/tablet landscape rhythm */
        @media (max-height: 1024px) and (orientation: landscape) {
            :root {
                --row-height: 74px;
                --row-gap: 4px;
                --lane-box-height: 56px;
                --lane-font: 34px;
                --name-font: 28px;
                --team-font: 25px;
                --time-font: 31px;
                --place-font: 34px;
            }
        }

        /* Cloud: phones / narrow browsers — stack meet strip, tighten chrome */
        @media (max-width: 820px) {
            html.cloud-viewer #siteShell {
                padding: 4px 8px;
                grid-template-columns: minmax(0, 1fr) auto;
                grid-template-areas:
                    "brand clock"
                    "meet meet";
            }

            html.cloud-viewer #brandBlock {
                max-width: 100%;
            }

            html.cloud-viewer #shellMeetTicker {
                padding: 2px 0 0;
            }

            html.cloud-viewer .meet-strip-ev-heat .meet-label,
            html.cloud-viewer .meet-strip-meta .meet-label {
                font-size: 10px;
            }

            html.cloud-viewer .meet-strip-ev-heat .meet-value,
            html.cloud-viewer .meet-strip-meta .meet-value {
                font-size: clamp(14px, 4vw, 20px);
            }

            html.cloud-viewer .meet-strip-rt {
                flex-direction: row;
                align-items: baseline;
                justify-content: flex-end;
                gap: 8px;
            }

            html.cloud-viewer .column-headers-grid .header,
            html.cloud-viewer .dual-column-headers .header {
                padding: 6px 4px;
                font-size: var(--header-font);
            }

            html.cloud-viewer .column-headers-grid .header.name,
            html.cloud-viewer .dual-column-headers .header.name {
                padding-left: 8px;
            }
        }

        /* Phone portrait/compact */
        @media (max-width: 700px) {
            :root {
                --lane-col: 54px;
                --time-col: 92px;
                --place-col: 65px;
                --base-font: 23px;
                --header-font: 21px;
                --header-pad-y: 10px;
                --header-pad-x: 10px;
                --scoreboard-margin-x: 3px;
                --logo-bar-height: 78px;
                --logo-img-max-width: 104px;
                --row-height: 66px;
                --row-gap: 4px;
                --lane-box-height: 49px;
                --lane-font: 26px;
                --name-font: 18px;
                --team-font: 23px;
                --time-font: 25px;
                --place-font: 26px;
            }

            html.cloud-viewer {
                --row-height: 44px;
                --row-gap: 2px;
                --lane-box-height: 36px;
                --header-pad-y: 6px;
                --header-pad-x: 6px;
                --logo-bar-height: 52px;
                --logo-img-max-width: 84px;
            }

            html.cloud-viewer .meet-strip-main {
                grid-template-columns: minmax(0, auto) minmax(0, 1fr);
            }

            html.cloud-viewer #meetStrip {
                padding-top: 4px;
                padding-bottom: 4px;
            }

            html.cloud-viewer .column-headers-grid {
                margin-bottom: 3px;
            }

            html.cloud-viewer .column-headers-grid .header,
            html.cloud-viewer .dual-column-headers .header {
                padding: 4px 3px;
            }

            #siteShell {
                left: calc(var(--safe-left) + 6px);
                right: calc(var(--safe-right) + 6px);
                top: calc(var(--safe-top) + 6px);
                padding: 8px 10px;
                border-radius: 10px;
            }

            #poolViewSelector {
                top: calc(var(--safe-top) + 68px);
                left: calc(var(--safe-left) + 8px);
                padding: 5px 6px;
                gap: 6px;
            }

            .pool-view-btn {
                padding: 5px 8px;
                font-size: 11px;
            }

            #brandTitle {
                font-size: 14px;
            }

            #brandTagline {
                font-size: 10px;
            }

            #brandLogo {
                max-width: min(36vw, 112px);
            }

            #hamburgerButton {
                width: 40px;
                height: 34px;
                font-size: 18px;
            }

            #menuDrawer {
                top: calc(var(--safe-top) + 68px);
                right: calc(var(--safe-right) + 6px);
                width: min(360px, calc(100vw - 12px));
            }

            #sectionPanels {
                top: var(--viewer-chrome-top, calc(var(--safe-top) + 72px));
                left: calc(var(--safe-left) + 8px);
                right: calc(var(--safe-right) + 8px);
                bottom: calc(var(--safe-bottom) + 8px);
            }

            #status {
                top: calc(var(--safe-top) + 64px);
                right: calc(var(--safe-right) + 8px);
            }

            #meetStrip {
                margin-top: 0;
                padding-left: 8px;
                padding-right: 8px;
            }

            .meet-strip-main {
                flex-wrap: nowrap;
            }

            html.cloud-viewer .meet-strip-meta .meet-label {
                font-size: 10px;
            }

            html.cloud-viewer .meet-strip-meta .meet-value {
                font-size: clamp(14px, 4.2vw, 20px);
            }

            html.cloud-viewer #runningTimeValue {
                font-size: clamp(14px, 4vw, 20px);
            }

            #timingEventDescription {
                font-size: clamp(12px, 3.2vw, 17px);
            }

            .meet-strip-meta .meet-value {
                font-size: clamp(15px, 4.8vw, 22px);
            }

            #runningTimeValue {
                font-size: clamp(15px, 4.5vw, 21px);
            }

            #currentTime {
                font-size: clamp(12px, 3.2vw, 16px);
            }

            .column-headers-grid .header.name,
            .scoreboard-lane-table tbody td:nth-child(2),
            .scoreboard-lane-table tbody td:nth-child(3) {
                padding-left: 6px;
                padding-right: 4px;
            }

            .scoreboard-lane-table tbody td:nth-child(4) {
                font-variant-numeric: tabular-nums;
                font-weight: 700;
            }

            #logoBar img { max-height: 52px; }
        }

        /* Cloud phone portrait: stack NAME / TEAM column header */
        @media (max-width: 520px) and (orientation: portrait) {
            html.cloud-viewer .column-headers-grid .header.name,
            html.cloud-viewer .dual-column-headers .header.name {
                font-size: 0;
                flex-direction: column;
                align-items: flex-start;
                justify-content: center;
                gap: 1px;
                line-height: 1.05;
                white-space: normal;
                padding-top: 4px;
                padding-bottom: 4px;
            }

            html.cloud-viewer .column-headers-grid .header.name::before,
            html.cloud-viewer .dual-column-headers .header.name::before {
                content: "NAME";
                font-size: max(9px, calc(var(--header-font) * 0.92));
                font-weight: 700;
                color: var(--color-strong-text);
            }

            html.cloud-viewer .column-headers-grid .header.name::after,
            html.cloud-viewer .dual-column-headers .header.name::after {
                content: "TEAM";
                font-size: max(8px, calc(var(--header-font) * 0.78));
                font-weight: 600;
                color: var(--color-text-dim);
            }

            html.cloud-viewer .lane-name-cell {
                padding-left: 5px;
                padding-right: 3px;
            }
        }

        /* Extra-small phones (iPhone 15/16/17 class) */
        @media (max-width: 430px) {
            :root {
                --lane-col: 36px;
                --time-col: 76px;
                --place-col: 60px;
                --time-font: 15px;
                --header-font: 11px;
                --lane-font: 14px;
                --place-font: 14px;
            }

            html.cloud-viewer .scoreboard-lane-table tbody tr {
                height: max(var(--row-height), 52px);
            }
        }

        /* Phone landscape: keep compact but use horizontal space better */
        @media (max-height: 500px) and (orientation: landscape) {
            #meetStrip {
                padding-top: 3px;
                padding-bottom: 3px;
                margin-top: 0;
            }

            html.cloud-viewer .meet-strip-main {
                grid-template-columns: minmax(0, auto) minmax(0, 1fr);
                align-items: center;
            }

            html.cloud-viewer {
                --row-height: 40px;
                --row-gap: 2px;
                --lane-box-height: 32px;
                --logo-bar-height: 44px;
                --logo-img-max-width: 72px;
            }

            :root {
                --row-height: 63px;
                --row-gap: 4px;
                --lane-box-height: 49px;
                --logo-bar-height: 62px;
                --logo-img-max-width: 92px;
                --lane-font: 28px;
                --name-font: 20px;
                --team-font: 21px;
                --time-font: 26px;
                --place-font: 28px;
            }

            #timingEventDescription {
                margin-top: 1px;
            }

            #logoBar { margin-top: 2px; }
        }

        /* User-selectable compact mode (works regardless of screen size) */
        body.compact-mode {
            --lane-col: 64px;
            --team-col: 64px;
            --time-col: 130px;
            --place-col: 56px;
            --base-font: 25px;
            --header-font: 25px;
            --header-pad-y: 14px;
            --header-pad-x: 18px;
            --scoreboard-margin-x: 8px;
            --row-height: 74px;
            --row-gap: 5px;
            --lane-box-height: 56px;
            --lane-font: 31px;
            --name-font: 26px;
            --team-font: 23px;
            --time-font: 28px;
            --place-font: 31px;
        }

        body.compact-mode .meet-strip-ev-heat .meet-value,
        body.compact-mode .meet-strip-meta .meet-value {
            font-size: clamp(20px, 3.8vw, 30px);
        }

        body.compact-mode #timingEventDescription {
            font-size: clamp(18px, 3.2vw, 26px);
        }

        body.compact-mode #runningTimeValue {
            font-size: clamp(18px, 3.6vw, 28px);
        }

        body.compact-mode .lane-cell-box {
            font-size: var(--lane-font);
        }

        @media (max-width: 700px) {
            body.compact-mode {
                --row-height: 60px;
                --lane-box-height: 45px;
                --lane-font: 26px;
                --name-font: 18px;
                --team-font: 19px;
                --time-font: 25px;
                --place-font: 26px;
            }
        }

        #anthemOverlay {
            position: fixed;
            inset: 0;
            display: none;
            z-index: 2000;
            overflow: hidden;
            background:
                repeating-linear-gradient(
                    180deg,
                    #b22234 0%,
                    #b22234 7.69%,
                    #ffffff 7.69%,
                    #ffffff 15.38%
                );
            transform-origin: center;
            animation: anthemWave 3.1s ease-in-out infinite;
        }

        #anthemOverlay.video-mode {
            background: none;
            animation: none;
        }

        #anthemOverlay.video-mode::before,
        #anthemOverlay.video-mode::after {
            display: none;
        }

        #anthemVideo {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: none;
            z-index: 1;
        }

        #anthemOverlay::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 42%;
            height: 53.85%;
            background-color: #0b2c76;
            background-image:
                radial-gradient(circle, #ffffff 0 1.3px, transparent 1.6px);
            background-size: 22px 22px;
            box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.18);
        }

        #anthemOverlay::after {
            content: "";
            position: absolute;
            inset: -12%;
            background:
                radial-gradient(110% 65% at 15% 50%, rgba(255,255,255,0.24), rgba(255,255,255,0) 54%),
                radial-gradient(120% 70% at 82% 50%, rgba(0,0,0,0.24), rgba(0,0,0,0) 56%);
            animation: anthemShimmer 4.2s ease-in-out infinite;
            pointer-events: none;
        }

        @keyframes anthemWave {
            0% { transform: perspective(900px) rotateY(-2deg) skewX(0deg) scale(1.02); }
            25% { transform: perspective(900px) rotateY(1.2deg) skewX(1.6deg) scale(1.02); }
            50% { transform: perspective(900px) rotateY(0deg) skewX(-1.7deg) scale(1.015); }
            75% { transform: perspective(900px) rotateY(1.3deg) skewX(1.4deg) scale(1.02); }
            100% { transform: perspective(900px) rotateY(-2deg) skewX(0deg) scale(1.02); }
        }

        @keyframes anthemShimmer {
            0% { transform: translateX(-4%); opacity: 0.8; }
            50% { transform: translateX(4%); opacity: 1; }
            100% { transform: translateX(-4%); opacity: 0.8; }
        }

        @keyframes standbyDrift {
            0% { transform: translate3d(0, 0, 0); }
            50% { transform: translate3d(42px, 18px, 0); }
            100% { transform: translate3d(0, 0, 0); }
        }

        @keyframes standbyFloat {
            0% { transform: translate3d(0, 0, 0) scale(1); }
            50% { transform: translate3d(0, -18px, 0) scale(1.03); }
            100% { transform: translate3d(0, 0, 0) scale(1); }
        }

        @keyframes standbyPulse {
            0% { transform: scaleX(0.64); opacity: 0.62; }
            50% { transform: scaleX(1); opacity: 1; }
            100% { transform: scaleX(0.64); opacity: 0.62; }
        }
