/* VeloTime WebUI styles: layout, pages and the shared components. Colours, fonts and shape come from the design
   tokens in _content/VeloTime.Ui.Tokens/velotime-tokens.css (src/Ui.Tokens); info screens from velotime-display.css there. */
/* Times, speeds and counts line up in columns. */
td, th, .mud-table-cell, .vt-num { font-variant-numeric: tabular-nums; }

/* App bar: ink bar with the three track lines along its bottom edge. */
.vt-appbar { position: relative; }
.vt-appbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--vt-stripe); }
.vt-brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-family: var(--vt-font-display); font-weight: 700; font-size: 1.5rem; letter-spacing: -0.01em; }
.vt-brand-mark { flex: none; }
.vt-area-link { color: rgba(255, 255, 255, 0.78) !important; font-weight: 500 !important; text-transform: none !important; }
.vt-area-link.active { color: #fff !important; background: rgba(255, 255, 255, 0.12) !important; }

/* Section navigation under the app bar for public and rider areas. */
.vt-subnav { display: flex; gap: 4px; padding: 0 24px; border-bottom: 1px solid var(--vt-line); background: var(--vt-surface); overflow-x: auto; }
.vt-subnav a { padding: 12px 14px; color: var(--vt-text-muted); text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent; white-space: nowrap; }
.vt-subnav a:hover { color: var(--vt-text); }
.vt-subnav a.active { color: var(--vt-primary); border-bottom-color: var(--vt-primary); }

/* Notices: one banner row in the slot under the app bar; the bell lists everything. */
.vt-notice-slot:empty { display: none; }
.vt-banner { --vt-tone: var(--vt-tone-info); display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px 4px 20px; border-bottom: 1px solid var(--vt-line); border-left: 4px solid var(--vt-tone); background: color-mix(in srgb, var(--vt-tone) 12%, var(--vt-surface)); color: var(--vt-text); }
.vt-banner.vt-tone-warning { --vt-tone: var(--vt-tone-warning); }
.vt-banner.vt-tone-error { --vt-tone: var(--vt-tone-error); }
.vt-banner-icon { color: var(--vt-tone); flex: none; }
.vt-banner-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-banner-text strong { margin-right: 8px; }
.vt-bell { display: inline-flex; margin-right: 4px; }
.vt-bell-popover { width: min(26rem, calc(100vw - 16px)); max-height: min(70vh, 36rem); overflow-y: auto; }
.vt-bell-panel { padding: 4px 0 8px; }
.vt-bell-header { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 4px 16px; font-family: var(--vt-font-display); font-weight: 700; font-size: 1.125rem; }
.vt-bell-empty { padding: 8px 16px 12px; color: var(--vt-text-muted); }
.vt-notice { padding: 10px 16px; border-top: 1px solid var(--vt-line); }
.vt-notice-hidden { opacity: 0.6; }
.vt-notice-head { display: flex; align-items: center; gap: 8px; }
.vt-notice-state { font-size: 0.8125rem; color: var(--vt-text-muted); }
.vt-notice-title { margin: 6px 0 2px; font-size: 1rem; font-weight: 600; }
.vt-notice-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.vt-notice-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; margin-top: 4px; }
/* Admin notice editor: fields beside a live preview on wide drawers, stacked below. */
.vt-notice-editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 960px) { .vt-notice-editor { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); align-items: start; } .vt-notice-preview { position: sticky; top: 0; } }
.vt-notice-editor-fields { display: flex; flex-direction: column; gap: 20px; }
.vt-editor-group { display: flex; flex-direction: column; gap: 12px; }
.vt-editor-group-title { margin: 0; font-family: var(--vt-font-display); font-size: 1rem; font-weight: 700; }
.vt-editor-alert-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.vt-notice-preview { border: 1px solid var(--vt-line); border-radius: var(--vt-radius-card); padding: 12px; background: var(--vt-bg); }
.vt-notice-preview-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.vt-notice-preview-label { margin: 12px 0 4px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--vt-text-muted); }
.vt-notice-preview-none { margin: 0; font-size: 0.875rem; color: var(--vt-text-muted); }
.vt-notice-preview .vt-banner { border-bottom: none; border-radius: 4px; }
.vt-notice-preview .vt-banner-text { white-space: normal; }
.vt-notice-preview-bell { border: 1px solid var(--vt-line); border-radius: 4px; background: var(--vt-surface); }
.vt-notice-preview-action { padding: 4px 8px; font-size: 0.8125rem; font-weight: 500; text-transform: uppercase; color: var(--vt-primary); }

/* Admin rail group headings. */
.vt-rail-heading { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--vt-text-muted); padding: 16px 16px 4px; }

.vt-main { display: flex; flex-direction: column; min-height: calc(100vh - var(--vt-appbar-height)); }
.vt-page { flex: 1 0 auto; }
.vt-footer { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; padding: 16px 24px; border-top: 1px solid var(--vt-line); color: var(--vt-text-muted); font-size: 0.8125rem; }
.vt-footer a { color: inherit; }

/* Cards and papers share one radius. */
.mud-paper:not(.mud-appbar):not(.mud-drawer):not(.mud-popover) { border-radius: var(--vt-radius-card); }
.mud-paper-outlined { border-color: var(--vt-line); }

/* ---- Shared components (redesign phase 2) ---- */
.vt-muted { color: var(--vt-text-muted); }
.vt-overline { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--vt-text-muted); }

/* Page header: display-font title with optional breadcrumbs and actions. */
.vt-page-header { margin: 8px 0 24px; }
.vt-page-header-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.vt-page-title { font-family: var(--vt-font-display) !important; font-weight: 700 !important; letter-spacing: -0.01em; line-height: 1.1 !important; }
.vt-page-subtitle { color: var(--vt-text-muted); margin-top: 4px !important; }
.vt-page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vt-breadcrumbs .mud-breadcrumb-item a { color: var(--vt-text-muted); }

/* Section card. */
.vt-section { background: var(--vt-surface); border: 1px solid var(--vt-line); border-radius: var(--vt-radius-card); padding: 20px; margin-bottom: 24px; }
.vt-section-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
/* Plain reference tables (Privacy cookie list): ruled rows, top-aligned cells, scrolls inside .vt-plain-scroll on narrow screens. */
.vt-plain-scroll { overflow-x: auto; }
.vt-plain-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 0.875rem; }
.vt-plain-table th { text-align: left; font-weight: 600; color: var(--vt-text-muted); padding: 8px 12px; border-bottom: 1px solid var(--vt-line); }
.vt-plain-table td { padding: 10px 12px; vertical-align: top; border-bottom: 1px solid var(--vt-line); }
.vt-plain-table tr:last-child td { border-bottom: 0; }
.vt-plain-table code { font-size: 0.8125rem; white-space: nowrap; }
.vt-privacy-list { margin: 0; padding-left: 20px; }
.vt-privacy-list li { margin-bottom: 6px; }
.vt-release-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-width: 78ch; }
.vt-release-item { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; line-height: 1.5; }
/* Cookie consent: a quiet strip under the notice slot, two equal buttons; wraps under the text on narrow screens. */
.vt-consent { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px 10px 20px; border-bottom: 1px solid var(--vt-line); background: var(--vt-surface); color: var(--vt-text); }
.vt-consent-icon { color: var(--vt-text-muted); flex: none; }
.vt-consent-text { flex: 1 1 320px; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.vt-consent-actions { display: flex; gap: 8px; flex: none; }
.vt-consent-error { color: var(--vt-error); }
.vt-consent-settings { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--vt-line); }

/* Stat tiles: overline label, large display value, optional delta and sparkline. */
.vt-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.vt-stat-tile { --vt-tone: var(--vt-track-blue); position: relative; overflow: hidden; background: var(--vt-surface); border: 1px solid var(--vt-line); border-radius: var(--vt-radius-card); padding: 16px 18px 14px; }
.vt-stat-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--vt-tone); }
.vt-stat-tile.vt-tone-success { --vt-tone: var(--vt-tone-success); }
.vt-stat-tile.vt-tone-warning { --vt-tone: var(--vt-tone-warning); }
.vt-stat-tile.vt-tone-error { --vt-tone: var(--vt-tone-error); }
.vt-stat-tile.vt-tone-info { --vt-tone: var(--vt-azure); }
.vt-stat-tile.vt-tone-live { --vt-tone: var(--vt-tone-live); }
.vt-stat-value { font-family: var(--vt-font-display); font-weight: 700; font-size: 2.25rem; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.vt-stat-tile.vt-compact .vt-stat-value { font-family: inherit; font-size: 1rem; font-weight: 600; line-height: 1.4; margin-top: 10px; }
.vt-stat-unit { font-size: 1rem; font-weight: 600; margin-left: 4px; color: var(--vt-text-muted); }
.vt-stat-delta { font-size: 0.8125rem; font-weight: 600; margin-top: 2px; }
.vt-stat-delta.up { color: var(--vt-success); }
.vt-stat-delta.down { color: var(--vt-error); }
.vt-stat-caption { font-size: 0.8125rem; color: var(--vt-text-muted); margin-top: 4px; }
.vt-stat-trend { display: block; width: 100%; height: 28px; margin-top: 8px; color: var(--vt-tone); }

/* Status chip: tinted pill with a dot; Live pulses. */
.vt-status { --vt-tone: var(--vt-tone-neutral); display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; line-height: 1.6; white-space: nowrap; color: var(--vt-tone); background: color-mix(in srgb, var(--vt-tone) 12%, transparent); }
.vt-status.vt-tone-success { --vt-tone: var(--vt-tone-success); }
.vt-status.vt-tone-warning { --vt-tone: var(--vt-tone-warning); }
.vt-status.vt-tone-error { --vt-tone: var(--vt-tone-error); }
.vt-status.vt-tone-info { --vt-tone: var(--vt-tone-info); }
.vt-status.vt-tone-live { --vt-tone: var(--vt-tone-live); }
.vt-status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.vt-status.vt-tone-live .vt-status-dot { animation: vt-pulse 1.6s ease-in-out infinite; }
@keyframes vt-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Empty and error states. */
.vt-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 32px 16px; }
.vt-empty-icon { font-size: 2.5rem !important; color: var(--vt-text-disabled); margin-bottom: 4px; }
.vt-error { margin-bottom: 16px; }
.vt-error-body { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.vt-load { position: relative; }
.vt-refresh-bar { position: absolute !important; left: 0; right: 0; top: 0; z-index: 1; }
.vt-skeleton-table { display: flex; flex-direction: column; gap: 4px; }

/* Results table: ranked rows with podium marks. */
.vt-results { background: var(--vt-surface); border: 1px solid var(--vt-line); border-radius: var(--vt-radius-card); overflow: hidden; }
.vt-results-table { width: 100%; min-width: 520px; table-layout: fixed; border-collapse: collapse; }
.vt-results-table caption { caption-side: top; text-align: left; padding: 10px 14px 0; font-size: 0.8125rem; color: var(--vt-text-muted); }
.vt-results-table .rank-column { width: 56px; }
.vt-results-table .rider-column { width: auto; }
.vt-results-table .value-column { width: 20%; }
.vt-results-table .facility-column { width: 22%; }
.vt-results-table .date-column { width: 16%; }
.vt-results-table tr { height: 48px; }
.vt-results-table th, .vt-results-table td { padding: 8px 14px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--vt-line); }
.vt-results-table thead th { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--vt-text-muted); background: var(--vt-bg-gray); }
.vt-results-table tbody th { font-weight: 600; }
.vt-results-table tbody th a { color: inherit; text-decoration: none; }
.vt-results-table tbody th a:hover { color: var(--vt-primary); text-decoration: underline; }
.vt-results-table .numeric { text-align: right; }
.vt-results-table td.primary { font-family: var(--vt-font-display); font-weight: 700; font-size: 1.0625rem; }
.vt-results-table tr:last-child > * { border-bottom: none; }
.vt-results-table .placeholder-row td { border-bottom-color: transparent; }
.vt-results-table .result-row:hover { background: var(--vt-hover); }
.vt-results-table .result-row.highlight { background: color-mix(in srgb, var(--vt-track-blue) 10%, transparent); box-shadow: inset 4px 0 0 var(--vt-track-blue); }
/* Wide tables scroll inside their own region, never the page. */
.table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
/* Edge shadows hint that more columns are off to the side; the covers scroll with the content and hide them at each end. */
.vt-section > .table-scroll {
    background:
        linear-gradient(to right, var(--vt-surface) 30%, transparent) left / 24px 100% no-repeat local,
        linear-gradient(to left, var(--vt-surface) 30%, transparent) right / 24px 100% no-repeat local,
        radial-gradient(farthest-side at 0 50%, color-mix(in srgb, var(--vt-text) 22%, transparent), transparent) left / 10px 100% no-repeat scroll,
        radial-gradient(farthest-side at 100% 50%, color-mix(in srgb, var(--vt-text) 22%, transparent), transparent) right / 10px 100% no-repeat scroll;
}
/* Rider session tables: many short columns, so size to content instead of the fixed results layout.
   Headers and text columns wrap; numbers stay on one line and the region scrolls when they still don't fit. */
.vt-session-table { table-layout: auto; min-width: 0; }
.vt-session-table thead th { white-space: normal; vertical-align: bottom; overflow-wrap: normal; hyphens: auto; }
.vt-session-table td.wrap { white-space: normal; min-width: 9rem; }
.vt-session-table td.set-bests { min-width: 16rem; }
/* Below desktop width, tighten cells and let values break between number and unit so most tables fit without scrolling. */
@media (max-width: 959.98px) {
    .vt-session-table th, .vt-session-table td { padding: 8px 10px; }
    .vt-session-table td { white-space: normal; }
    .vt-session-table thead th { letter-spacing: 0.02em; }
    .vt-session-table td.wrap { min-width: 7rem; }
    .vt-session-table td.set-bests { min-width: 14rem; }
}
@media (max-width: 599.98px) {
    .vt-section { padding: 14px; }
    .vt-session-table { font-size: 0.8125rem; }
    .vt-session-table th, .vt-session-table td { padding: 6px 6px; }
    .vt-session-table td.primary { font-size: 0.9375rem; }
}
/* Session sets: one expandable row per set; the body holds that set's time-per-attempt chart and results. */
.vt-set-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--vt-line); border-radius: var(--vt-radius-card); overflow: hidden; }
.vt-set + .vt-set { border-top: 1px solid var(--vt-line); }
.vt-set-toggle { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.vt-set-toggle:hover { background: var(--vt-hover); }
.vt-set-toggle:focus-visible { outline: 2px solid var(--vt-primary); outline-offset: -2px; }
.vt-set.open > .vt-set-toggle { background: color-mix(in srgb, var(--vt-track-blue) 8%, transparent); box-shadow: inset 4px 0 0 var(--vt-track-blue); }
.vt-set-summary { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.vt-set-title { font-weight: 700; }
.vt-set-stats { display: flex; flex-wrap: wrap; column-gap: 16px; row-gap: 2px; font-variant-numeric: tabular-nums; }
.vt-set-stat { white-space: nowrap; }
.vt-set-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--vt-text-muted); }
.vt-set-bests { overflow-wrap: anywhere; }
.vt-set-chevron { flex: none; color: var(--vt-text-muted); }
.vt-set-body { padding: 4px 14px 16px; min-width: 0; }
.vt-set-chart-switch { max-width: 24rem; }
@media (max-width: 599.98px) {
    .vt-set-toggle { gap: 8px; padding: 10px 8px; align-items: flex-start; }
    .vt-set-toggle .vt-rank { min-width: 24px; height: 24px; }
    .vt-set-stats { column-gap: 12px; font-size: 0.875rem; }
    .vt-set-body { padding: 4px 6px 12px; }
}
.vt-rank { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; border-radius: 50%; font-family: var(--vt-font-display); font-weight: 700; color: var(--vt-text-muted); }
.podium-1 .vt-rank { background: var(--vt-gold); color: #3B2A00; }
.podium-2 .vt-rank { background: var(--vt-silver); color: #1F2937; }
.podium-3 .vt-rank { background: var(--vt-bronze); color: #2B1700; }
.vt-badge { display: inline-block; margin-left: 8px; padding: 0 6px; border-radius: 4px; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; vertical-align: 2px; }
.vt-badge-pb { background: color-mix(in srgb, var(--vt-azure) 18%, transparent); color: var(--vt-azure); }
.vt-badge-record { background: var(--vt-sprint-red); color: #fff; }

/* Filter bar. */
.vt-filter-bar { margin-bottom: 16px; }
.vt-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.vt-filter-row > .mud-input-control, .vt-filter-row > .mud-select { flex: 0 1 220px; margin: 0 !important; }
.vt-filter-more { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.vt-filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 8px; }

/* Admin table and editor drawer. */
.vt-admin-table { border-radius: var(--vt-radius-card); }
.vt-admin-table .mud-table-head .mud-table-cell { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--vt-text-muted); }
.vt-admin-table .mud-table-row.vt-clickable { cursor: pointer; }
.vt-row-actions { text-align: right; width: 1%; }
.vt-editor { display: flex; flex-direction: column; height: 100%; }
.vt-editor-header { display: flex; align-items: center; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--vt-line); }
.vt-editor-body { flex: 1 1 auto; overflow-y: auto; padding: 20px; }
.vt-editor-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--vt-line); }

/* Trend chart card. */
.vt-trend { margin-bottom: 16px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* Previous and next buttons under a paged results table. */
.vt-pager { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Hall of Fame podium: second, first, third left to right, first raised; stacked in rank order on small screens. */
.vt-podium { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 12px; }
.vt-podium-place { --vt-medal: var(--vt-bronze); position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 148px; padding: 16px 12px 14px; text-align: center; background: var(--vt-surface); border: 1px solid var(--vt-line); border-top: 4px solid var(--vt-medal); border-radius: var(--vt-radius-card); }
.vt-podium-place.podium-1 { --vt-medal: var(--vt-gold); order: 2; min-height: 176px; background: linear-gradient(180deg, color-mix(in srgb, var(--vt-gold) 14%, var(--vt-surface)), var(--vt-surface) 70%); }
.vt-podium-place.podium-2 { --vt-medal: var(--vt-silver); order: 1; }
.vt-podium-place.podium-3 { order: 3; }
.vt-podium-place.vacant { border-style: dashed; border-top-style: solid; background: transparent; opacity: 0.55; }
.vt-podium-place .vt-rank { width: 36px; height: 36px; font-size: 1.125rem; }
.vt-podium-place.podium-1 .vt-rank { background: var(--vt-gold); color: #3B2A00; }
.vt-podium-place.podium-2 .vt-rank { background: var(--vt-silver); color: #1F2937; }
.vt-podium-place.podium-3 .vt-rank { background: var(--vt-bronze); color: #2B1700; }
.vt-podium-rider { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-podium-value { font-family: var(--vt-font-display); font-weight: 700; font-size: 2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.vt-podium-place.podium-1 .vt-podium-value { font-size: 2.5rem; }
.vt-podium-detail { font-size: 0.8125rem; color: var(--vt-text-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 599.98px) {
    .vt-podium { grid-template-columns: 1fr; }
    .vt-podium-place, .vt-podium-place.podium-1 { min-height: 0; flex-direction: row; justify-content: flex-start; text-align: left; gap: 12px; }
    .vt-podium-place.podium-1 { order: 1; } .vt-podium-place.podium-2 { order: 2; }
    .vt-podium-value, .vt-podium-place.podium-1 .vt-podium-value { font-size: 1.5rem; margin-left: auto; }
    .vt-podium-detail { display: none; }
}

/* Today hero: ink panel with the track lines and the day's fastest time in large display type. */
.vt-hero { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; padding: 28px 28px 32px; border-radius: var(--vt-radius-card); background: var(--vt-ink); color: #fff; }
.vt-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--vt-stripe); }
.vt-hero .vt-hero-overline { color: rgba(255, 255, 255, 0.7); }
.vt-hero-time { font-family: var(--vt-font-display); font-weight: 700; font-size: clamp(3rem, 9vw, 5.5rem); line-height: 1; letter-spacing: -0.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.vt-hero-detail { margin-top: 10px; color: rgba(255, 255, 255, 0.85); font-variant-numeric: tabular-nums; }
.vt-hero-empty { font-family: var(--vt-font-display); font-weight: 600; font-size: 1.75rem; margin-top: 8px; color: rgba(255, 255, 255, 0.85); }
.vt-hero .mud-skeleton { background-color: rgba(255, 255, 255, 0.12); }
.vt-hero .vt-status { background: rgba(255, 255, 255, 0.1); }
.vt-hero .vt-status.vt-tone-live { color: #FF6A5C; }
.vt-hero .vt-status.vt-tone-neutral { color: rgba(255, 255, 255, 0.75); }
.vt-tiles.mb-0 { margin-bottom: 0; }

/* Account: tabs over sections, inline language and theme, linked sign-ins as rows. */
.vt-account-tabs .mud-tabs-tabbar, .vt-tabs .mud-tabs-tabbar { background: transparent; border-bottom: 1px solid var(--vt-line); }
.vt-account-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; }
.vt-account-row .language-selector { min-width: 200px; max-width: 360px; }
.vt-linked-accounts { display: grid; gap: 8px; }
.vt-linked-account { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 16px; border: 1px solid var(--vt-line); border-radius: var(--vt-radius-card); }
.vt-linked-account-name { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* Account → Privacy: coaches, open coach invites and riders I coach (access-control phase 3). */
.vt-coach-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.vt-coach-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 16px; border: 1px solid var(--vt-line); border-radius: var(--vt-radius-card); }
.vt-coach-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.vt-coach-row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.vt-coach-subheading { margin: 16px 0 8px; }
.vt-coach-invite-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; padding: 12px 16px; border: 1px dashed var(--vt-line); border-radius: var(--vt-radius-card); }
.vt-coach-invite-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.vt-coach-invite-date { flex: 0 1 260px; }
/* Access history: the coach history on Account → Privacy and the audit table on Admin → Access. */
.vt-coach-history { display: grid; gap: 8px; margin-top: 16px; justify-items: start; }
.vt-coach-history > div { width: 100%; }
.vt-audit-list .vt-coach-row { padding: 8px 12px; }
/* A one-time invite link with its copy button (Account → Privacy and Admin → Access). */
.vt-invite-link, .vt-access-link { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0; }
.vt-invite-link code, .vt-access-link code { overflow-wrap: anywhere; }

/* Transponder status: health chips, warnings as a timeline, collapsible ownership history. */
.vt-status-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.vt-timeline { list-style: none; margin: 0; padding: 0; }
.vt-timeline-item { position: relative; display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 4px 16px; padding: 10px 0 10px 20px; border-left: 2px solid var(--vt-line); }
.vt-timeline-item::before { content: ""; position: absolute; left: -6px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--vt-warning); box-shadow: 0 0 0 3px var(--vt-surface); }
.vt-timeline-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.vt-timeline-body { display: grid; gap: 6px; }
.vt-collapsible > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.vt-collapsible > summary::-webkit-details-marker { display: none; }
.vt-collapsible > summary::before { content: "▸"; color: var(--vt-text-muted); transition: transform 0.15s ease; }
.vt-collapsible[open] > summary::before { transform: rotate(90deg); }
@media (max-width: 599.98px) { .vt-timeline-item { grid-template-columns: 1fr; } }

/* My transponders: one card per transponder with ownership state and health. */
.vt-tabular { font-variant-numeric: tabular-nums; }
.vt-transponder-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.vt-transponder-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px 18px 12px; background: var(--vt-surface); border: 1px solid var(--vt-line); border-radius: var(--vt-radius-card); overflow: hidden; }
.vt-transponder-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--vt-stripe); }
.vt-transponder-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.vt-transponder-card-title { font-family: var(--vt-font-display); font-size: 1.5rem; font-weight: 700; line-height: 1.15; margin: 2px 0; }
.vt-transponder-card-title a { color: inherit; text-decoration: none; }
.vt-transponder-card-title a:hover, .vt-transponder-card-title a:focus-visible { text-decoration: underline; }
.vt-transponder-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: 0.875rem; }
.vt-transponder-facts dt { color: var(--vt-text-muted); }
.vt-transponder-facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.vt-transponder-card-actions { display: flex; align-items: center; gap: 4px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--vt-line); }

/* Admin editors: the save action sticks to the bottom of the viewport while there are unsaved changes. */
.vt-save-bar { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }
.vt-save-bar-dirty { position: sticky; bottom: 0; z-index: 2; margin: 20px -20px -20px; padding: 12px 20px; background: var(--vt-surface); border-top: 1px solid var(--vt-line); box-shadow: 0 -4px 12px rgba(10, 16, 32, 0.08); }

/* Loop health overview: one card per installation, a strip with one segment per loop coloured by state. */
.vt-wrap { overflow-wrap: anywhere; }
.vt-loop-cards { display: grid; gap: 16px; }
.vt-loop-card { display: grid; gap: 12px; padding: 18px 20px; background: var(--vt-surface); border: 1px solid var(--vt-line); border-radius: var(--vt-radius-card); }
.vt-loop-card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.vt-loop-card-title { font-family: var(--vt-font-display); font-size: 1.35rem; font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.vt-loop-strip { display: flex; gap: 3px; height: 12px; }
.vt-loop-segment { flex: 1 1 0; border-radius: 3px; background: var(--vt-tone, var(--vt-tone-neutral)); }
.vt-loop-segment.vt-tone-success, .loop-health-sparkline.vt-tone-success { --vt-tone: var(--vt-tone-success); color: var(--vt-tone-success); }
.vt-loop-segment.vt-tone-warning, .loop-health-sparkline.vt-tone-warning { --vt-tone: var(--vt-tone-warning); color: var(--vt-tone-warning); }
.vt-loop-segment.vt-tone-error, .loop-health-sparkline.vt-tone-error { --vt-tone: var(--vt-tone-error); color: var(--vt-tone-error); }
.vt-loop-segment.vt-tone-neutral { --vt-tone: var(--vt-line); }
.vt-loop-worst { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vt-chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 16px; }
.vt-section.mb-0 { margin-bottom: 0; }

/* Course layout diagram: segments around an oval, timing points filled. */
.vt-track { margin: 0; }
.vt-track svg { width: 100%; max-width: 520px; height: auto; display: block; }
.vt-track-base { stroke: var(--vt-line); stroke-width: 14; stroke-linecap: round; }
.vt-track-segment { stroke-width: 6; stroke-linecap: round; }
.vt-track-point circle { fill: var(--vt-surface); stroke: var(--vt-text); stroke-width: 2; }
.vt-track-point.timed circle { fill: var(--vt-sprint-red); stroke: var(--vt-surface); }
.vt-track-point text { font-size: 10px; font-weight: 600; fill: var(--vt-text); paint-order: stroke; stroke: var(--vt-bg); stroke-width: 3px; }
.vt-layout-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 420px); gap: 24px; align-items: start; }
@media (max-width: 959.98px) { .vt-layout-grid { grid-template-columns: 1fr; } }
.vt-save-bar-page { margin: 0 0 24px; border: 1px solid var(--vt-line); border-radius: var(--vt-radius-card); }

/* Utilities replacing inline styles (phase 5) */
.vt-scroll-x { overflow-x: auto; width: 100%; }
.vt-wide-table { min-width: 56rem; }
.vt-pre-wrap { white-space: pre-wrap; }
.vt-actions-col { width: 1%; }
.vt-filter-row > .vt-filter-field { flex: 1 1 14rem; min-width: 12rem; max-width: 22rem; }
.vt-entries-table { min-width: 80rem; overflow-wrap: anywhere; }
.vt-break-all { word-break: break-all; }
.vt-min-0 { min-width: 0; }
.vt-clip { min-width: 0; overflow: hidden; }
.vt-tabs-fluid { min-width: 0; max-width: 100%; }
.vt-full-row { flex-basis: 100%; }
.vt-select-wide { min-width: 14rem; }
.vt-select-facility { min-width: 220px; }
.vt-max-320 { max-width: 320px; }
.vt-max-360 { max-width: 360px; }
.vt-text-start { justify-content: flex-start; text-align: left; }
.vt-avatar {
    display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
    background: var(--vt-timber); color: var(--vt-ink); font-weight: 700; font-size: 0.8125rem; letter-spacing: 0.02em;
}
.vt-entries-table th:nth-child(-n+3) { white-space: nowrap; }

/* Language menu in the app bar: a compact pill matching the icon buttons beside it. */
.vt-language-pill {
    display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 6px 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 999px; background: transparent; color: inherit;
    font-family: inherit; font-weight: 600; font-size: 0.8125rem; line-height: 1; letter-spacing: 0.06em; cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease;
}
.vt-language-pill:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.5); }
.vt-language-pill:focus-visible { outline: 2px solid var(--vt-azure); outline-offset: 2px; }
.vt-language-pill:disabled { opacity: 0.6; cursor: default; }
.vt-language-code { min-width: 1.5em; text-align: center; }
.vt-language-option { display: flex; align-items: center; gap: 12px; min-width: 11rem; }
.vt-language-option-code { font-weight: 700; font-size: 0.75rem; letter-spacing: 0.06em; color: var(--vt-text-muted); min-width: 1.75em; }
.vt-language-error { color: var(--vt-error); white-space: normal; }

/* Account menu trigger: avatar, name on wide screens and a caret, in one button. */
.vt-account-trigger {
    display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 4px; margin-left: 4px;
    border: 0; border-radius: 999px; background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.vt-account-trigger:hover { background: rgba(255, 255, 255, 0.08); }
.vt-account-trigger:focus-visible { outline: 2px solid var(--vt-azure); outline-offset: 2px; }
.vt-account-name { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.vt-account-menu-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-width: 15rem; }
.vt-account-menu-name { font-weight: 600; overflow-wrap: anywhere; }

/* Language and theme in the menu drawer (phones). */
.vt-drawer-settings { display: flex; flex-direction: column; gap: 12px; padding: 8px 16px 16px; }
.vt-theme-switch { display: inline-flex; gap: 4px; padding: 2px; border: 1px solid var(--vt-line); border-radius: 999px; width: fit-content; }
.vt-theme-switch .active { background: var(--vt-primary); color: var(--vt-on-primary); }
.vt-drawer-signout { padding: 0 0 16px; }

/* ---- Info-screen admin (the screens themselves: velotime-display.css in src/Ui.Tokens) ---- */
/* Admin preview box: the chosen preset's aspect ratio (--vt-display-aspect, e.g. 1080 / 1920), width of its column. */
.vt-display-preview { width: 100%; aspect-ratio: var(--vt-display-aspect, 16 / 9); overflow: hidden; border-radius: var(--vt-radius-card); }

/* Info-screen admin: list, editor with tabs and the preview pinned beside them on wide screens, below on narrow ones. */
.vt-display-slug { font-size: 0.8125rem; padding: 1px 6px; border-radius: 4px; background: var(--vt-bg-gray); }
.vt-display-error-list { margin: 6px 0 0; padding-left: 20px; }
.vt-display-basic-address { margin-top: 16px; }
.vt-display-basic-address-label { font-weight: 600; }
.vt-display-basic-address-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0; }
.vt-display-basic-address-url { overflow-wrap: anywhere; user-select: all; }
.vt-display-editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
@media (min-width: 1280px) {
    .vt-display-editor { grid-template-columns: minmax(0, 1fr) minmax(380px, 0.85fr); }
    .vt-display-editor-preview { position: sticky; top: 72px; }
}
.vt-display-editor-main { min-width: 0; }
.vt-display-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 20px; align-items: start; }
.vt-display-sponsor-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.vt-display-sponsor-chip { display: inline-flex; align-items: center; gap: 8px; padding: 2px 2px 2px 8px; border: 1px solid var(--vt-line); border-radius: 999px; }
.vt-display-sponsor-chip-error { border-color: var(--vt-error); }
.vt-display-asset-option { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.vt-display-asset-thumb { display: block; flex: none; width: 40px; height: 24px; object-fit: contain; border-radius: 4px; background: var(--vt-bg-gray); }
.vt-display-asset-preview { display: block; width: 96px; height: 54px; object-fit: contain; border-radius: 6px; background: var(--vt-bg-gray); }
.vt-display-rename { display: flex; align-items: center; gap: 4px; min-width: 220px; }
.vt-display-page-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.vt-display-page-card { border: 1px solid var(--vt-line); border-radius: var(--vt-radius-card); padding: 12px 16px 16px; background: var(--vt-surface); }
.vt-display-page-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.vt-display-page-number { font-family: var(--vt-font-display); font-weight: 700; }
.vt-display-page-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 12px; }
.vt-display-slot-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.vt-display-slot-grid-twocolumns, .vt-display-slot-grid-grid2x2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vt-display-slot-grid-threecolumns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 600px) { .vt-display-slot-grid-twocolumns, .vt-display-slot-grid-threecolumns, .vt-display-slot-grid-grid2x2 { grid-template-columns: minmax(0, 1fr); } }
.vt-display-slot { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-height: 72px; padding: 10px 8px 10px 12px;
    border: 1px solid var(--vt-line); border-radius: 8px; background: var(--vt-bg); }
.vt-display-slot-error { border-color: var(--vt-error); }
.vt-display-slot-empty { align-items: center; justify-content: center; gap: 6px; border-style: dashed; color: var(--vt-text-muted); font: inherit; cursor: pointer; }
.vt-display-slot-empty:hover:not(:disabled), .vt-display-slot-empty:focus-visible { border-color: var(--vt-primary); color: var(--vt-primary); }
.vt-display-slot-empty:disabled { cursor: default; opacity: 0.6; }
.vt-display-slot-text { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.vt-display-slot-kind { font-weight: 600; }
.vt-display-slot-title { color: var(--vt-text-muted); font-size: 0.875rem; overflow-wrap: anywhere; }
.vt-display-slot-actions { display: flex; flex: none; }
.vt-display-columns-fieldset { border: 1px solid var(--vt-line); border-radius: 8px; margin: 0; padding: 4px 12px 8px; }
.vt-display-columns-fieldset legend { padding: 0 4px; font-size: 0.75rem; color: var(--vt-text-muted); }
.vt-display-preview-pane { background: var(--vt-surface); border: 1px solid var(--vt-line); border-radius: var(--vt-radius-card); padding: 16px; }
.vt-display-preview-toolbar, .vt-display-preview-controls, .vt-display-preview-custom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.vt-display-preview-preset { max-width: 240px; }
.vt-display-preview-custom .mud-input-control { max-width: 140px; }
.vt-display-preview-step { font-size: 0.875rem; color: var(--vt-text-muted); font-variant-numeric: tabular-nums; }
/* The box keeps the preset's aspect ratio and fits both the column width and 70% of the viewport height. */
.vt-display-preview-stage { display: flex; justify-content: center; }
.vt-display-preview-stage .vt-display-preview { width: min(100%, calc(70vh * var(--vt-display-aspect, 16 / 9))); flex: none; box-shadow: 0 0 0 1px var(--vt-line); }
.vt-display-preview-empty { display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; color: var(--vt-text-muted); background: var(--vt-bg-gray); }


/* Live (docs/live-rider-feed-plan.md phase 2): the last time reads from arm's length on a phone at the track. */
.vt-live-tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.vt-live-tiles .vt-live-last { grid-column: 1 / -1; }
.vt-live-times .vt-results-table { min-width: 0; }
.vt-live-times .vt-results-table col:nth-child(2) { width: 22%; }
.vt-live-times .vt-results-table col:nth-child(3) { width: 38%; }
.vt-live-times .vt-results-table th, .vt-live-times .vt-results-table td { padding-left: 10px; padding-right: 10px; }
.vt-live-tiles .vt-live-last .vt-stat-value { font-size: clamp(3rem, 14vw, 6rem); line-height: 1.05; }
.vt-live-callouts { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.vt-live-callouts .mud-input-control { flex: 0 1 320px; margin-top: 0; }
.vt-live-squad-controls { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.vt-live-squad-controls .mud-input-control { flex: 0 1 320px; margin-top: 0; }
.vt-live-squad { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.vt-live-rider { display: block; color: inherit; text-decoration: none; }
.vt-live-rider:hover, .vt-live-rider:focus-visible { border-color: var(--vt-tone); }
.vt-live-rider-idle { --vt-tone: var(--vt-line); }
.vt-live-rider-idle .vt-stat-value { color: var(--vt-text-muted); }
.vt-live-rider-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vt-live-rider-head .vt-overline { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-live-rider .vt-stat-value { font-size: 2.75rem; }
.vt-live-rider-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: .875rem; font-variant-numeric: tabular-nums; color: var(--vt-text-muted); }
