/* SAAR. Every component is a flat glass slab lit from behind: see docs/PLAN.md section 13.
   lens.js renders the slabs on a canvas behind the page and adds the "gl" class to <html>. Without it, this file's
   frosted-glass rules are the fallback. Colours are all tokens, set for each mode on :root[data-theme]. */

:root[data-theme] {
    --display: "Michroma", "Eurostile", "Arial Black", sans-serif;
    --body: "Barlow", "Segoe UI", Arial, sans-serif;
    --mono: "Chivo Mono", "Cascadia Mono", Consolas, monospace;
    --radius: 28px;
    /* How much glass floating over the page softens what's behind it. Enough to read over, not enough to hide it. */
    --float-blur: blur(8px) saturate(140%);

    /* MudBlazor's text styles all follow the same three faces. */
    --mud-typography-default-family: var(--body);
    --mud-typography-body1-family: var(--body);
    --mud-typography-body2-family: var(--body);
    --mud-typography-button-family: var(--body);
    --mud-typography-caption-family: var(--body);
    --mud-typography-subtitle1-family: var(--body);
    --mud-typography-subtitle2-family: var(--body);
    --mud-typography-overline-family: var(--body);
    --mud-default-borderradius: 16px;

    /* MudBlazor's palette follows the tokens below. */
    --mud-palette-background: var(--bg);
    --mud-palette-background-gray: var(--edge);
    --mud-palette-surface: var(--solid);
    --mud-palette-appbar-background: transparent;
    --mud-palette-appbar-text: var(--ink);
    --mud-palette-drawer-background: var(--solid);
    --mud-palette-drawer-text: var(--ink);
    --mud-palette-drawer-icon: var(--muted);
    --mud-palette-text-primary: var(--ink);
    --mud-palette-text-secondary: var(--muted);
    --mud-palette-text-disabled: var(--faint);
    --mud-palette-action-default: var(--muted);
    --mud-palette-action-default-hover: var(--edge);
    --mud-palette-action-disabled: var(--faint);
    --mud-palette-action-disabled-background: var(--edge);
    --mud-palette-lines-default: var(--rowline);
    --mud-palette-lines-inputs: var(--edge-strong);
    --mud-palette-table-lines: var(--rowline);
    --mud-palette-table-striped: transparent;
    --mud-palette-table-hover: var(--edge);
    --mud-palette-divider: var(--rowline);
    --mud-palette-divider-light: var(--rowline);
    --mud-palette-primary: var(--amber);
    --mud-palette-primary-rgb: var(--amber-rgb);
    --mud-palette-primary-text: var(--on-amber);
    --mud-palette-primary-darken: var(--amber);
    --mud-palette-primary-lighten: var(--amber);
    --mud-palette-primary-hover: var(--edge);
    --mud-palette-secondary: var(--ink);
    --mud-palette-secondary-text: var(--bg);
    --mud-palette-secondary-darken: var(--ink);
    --mud-palette-secondary-lighten: var(--ink);
    --mud-palette-secondary-hover: var(--edge);
    --mud-palette-success: var(--better);
    --mud-palette-success-text: var(--bg);
    --mud-palette-success-hover: var(--edge);
    --mud-palette-warning: var(--flag-y);
    --mud-palette-warning-text: var(--bg);
    --mud-palette-warning-hover: var(--edge);
    --mud-palette-error: var(--worse);
    --mud-palette-error-text: var(--bg);
    --mud-palette-error-hover: var(--edge);
    --mud-palette-info: var(--s1);
    --mud-palette-info-text: var(--bg);
    --mud-palette-info-hover: var(--edge);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #08070c; --ink: #f6f1ea; --muted: #b7aeb2; --faint: #7f787c; --gm: #e4dddf; --halo: rgb(0 0 0 / .62);
    --panel: rgb(30 24 32 / .56); --float: rgb(20 16 23 / .6); --solid: rgb(20 16 23 / .92); --edge: rgb(255 255 255 / .15); --edge-strong: rgb(255 255 255 / .34); --hi: rgb(255 255 255 / .24); --tick: rgb(255 255 255 / .5);
    --lamp: #ff2a36; --amber: #ffae3b; --amber-rgb: 255, 174, 59; --on-amber: #15120c; --self: rgb(255 174 59 / .13); --rowline: rgb(255 255 255 / .1);
    --better: #4bdc72; --worse: #ff6b6b; --fastest: #d492f7; --flag-y: #f4c62f; --flag-r: #ff6b6b;
    --s1: #3f8fe0; --s2: #c97c14; --s3: #27a585; --grid: rgb(255 255 255 / .09); --shadow: rgb(0 0 0 / .5);
    --fallback: radial-gradient(40% 30% at 14% 50%, rgb(255 30 45 / .5), transparent), radial-gradient(40% 30% at 86% 50%, rgb(255 30 45 / .5), transparent), #08070c;
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #e7eaec; --ink: #15161a; --muted: #4f545b; --faint: #7d8187; --gm: #2a2d33; --halo: rgb(255 255 255 / .72);
    --panel: rgb(255 255 255 / .5); --float: rgb(250 250 248 / .62); --solid: rgb(250 250 248 / .94); --edge: rgb(20 22 30 / .13); --edge-strong: rgb(20 22 30 / .4); --hi: rgb(255 255 255 / .95); --tick: rgb(20 22 30 / .55);
    --lamp: #c8102e; --amber: #a85c00; --amber-rgb: 168, 92, 0; --on-amber: #fff; --self: rgb(200 120 20 / .13); --rowline: rgb(20 22 30 / .1);
    --better: #0b7a35; --worse: #b3141c; --fastest: #7a2fb0; --flag-y: #7f5e00; --flag-r: #b3141c;
    --s1: #1d6fb8; --s2: #c9690f; --s3: #0f8a6d; --grid: rgb(20 22 30 / .1); --shadow: rgb(40 50 70 / .18);
    --fallback: radial-gradient(40% 30% at 14% 50%, rgb(226 24 48 / .3), transparent), radial-gradient(40% 30% at 86% 50%, rgb(226 24 48 / .3), transparent), #eceeee;
}

html { background: var(--fallback) fixed; }
html.gl { background: var(--bg); }
body { background: transparent !important; color: var(--ink); font-family: var(--body); font-variant-numeric: tabular-nums; }
/* The background stays still. The glass scrolls with the page, so the browser moves it in step with the text, and a bounce
   carries it along too. lens.js sets its height and keeps it around the window, and the track stops it making the page longer. */
body { position: relative; }
#backdrop { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -3; display: block; pointer-events: none; }
#lens-track { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
#lens { position: absolute; top: 0; left: 0; width: 100%; height: 100dvh; display: block; will-change: transform; }
html:not(.gl) #backdrop, html:not(.gl) #lens { display: none; }
/* The clip starts at the bottom of the page and travels with it, while the words inside are fixed to the window, so they
   only show once the bounce lifts the page off them. A desktop bounce only lifts it about 26px, so they sit low enough
   to clear within that. */
#underneath-track { position: absolute; inset: 0; z-index: -2; clip-path: inset(100% 0 -200px 0); pointer-events: none; }
#underneath { position: fixed; left: 16px; right: 16px; bottom: calc(4px + env(safe-area-inset-bottom, 0px)); text-align: center; font-size: 15px; line-height: 18px; font-weight: 500; color: var(--ink); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
/* Blazor moves focus to the page's heading after each navigation, for screen readers. It isn't something to show. */
h1:focus, h1:focus-visible, [tabindex="-1"]:focus { outline: none; }

/* Display type: colour copies scaled about the word's centre, so the fringe is nil mid-word and grows outwards. */
.ab { position: relative; z-index: 0; }
.ab::before, .ab::after { content: attr(data-t); position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.ab::before { color: rgb(255 40 60 / .8); transform: scale(1.004); }
.ab::after { color: rgb(0 200 255 / .8); transform: scale(.996); }

.wide { font-family: var(--display); font-weight: 400; }
.label { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.t { font-family: var(--mono); font-weight: 500; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.fast { color: var(--fastest); }
.better { color: var(--better); }
.worse { color: var(--worse); }

/* The glass, as frosted CSS. With WebGL the canvas draws it instead. */
.glass, .mud-paper, .mud-table {
    position: relative;
    border-radius: var(--radius);
    border: 1px solid var(--edge);
    background: var(--panel);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
    box-shadow: inset 0 1px 0 var(--hi), 0 14px 34px var(--shadow);
    --muted: var(--gm);
    text-shadow: 0 0 3px var(--halo), 0 0 12px var(--halo);
}
html.gl .glass, html.gl .mud-paper, html.gl .mud-table {
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-color: transparent;
    box-shadow: 0 14px 34px var(--shadow);
}
/* Nothing nests a second slab inside a slab. */
.glass .mud-paper, .glass .mud-table, .mud-paper .mud-paper, .mud-paper .mud-table, .mud-table .mud-table {
    background: transparent; border: 0; box-shadow: none; border-radius: 0; -webkit-backdrop-filter: none; backdrop-filter: none;
}

/* Big readouts run into the rim. With WebGL the glass paints them so they bend; this copy stays for screen readers. */
.bleed { --bc: var(--ink); color: var(--bc); }
html.gl .bleed { color: transparent !important; text-shadow: none; }
html.gl svg .bleed { visibility: hidden; }

/* Shell */
.saar-shell { max-width: 1300px; min-height: 100dvh; margin: 0 auto; padding-block: 16px 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 22px; box-sizing: border-box; }
.saar-main { flex: 1; min-width: 0; }
.topbar { z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 10px 14px 10px 24px; border-radius: 36px; }
.logo { font-size: 24px; line-height: 1; color: inherit; text-decoration: none; }
.logo:empty { display: none; }
.brand { flex: none; display: flex; align-items: center; gap: 18px; border-radius: 36px; }
.trim { display: inline-flex; align-items: center; gap: .5em; min-height: 44px; font-family: var(--display); font-size: 11px; color: var(--muted); transform: skewX(-14deg); white-space: nowrap; }
.trim button { min-height: 44px; padding: 0 3px; border: 0; background: transparent; color: inherit; font: inherit; white-space: inherit; cursor: pointer; }
.trim button:empty { display: none; }
.trim .typing::after { content: ""; display: inline-block; width: 1px; height: 1em; margin-left: 2px; vertical-align: -.12em; background: currentColor; animation: caret .7s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.nav { position: relative; display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; align-items: center; }
/* Words too long for the room left in the bar: the links fade and give up their space, keeping the bar on one line. */
.topbar.hush { flex-wrap: nowrap; }
.hush .nav { flex: 0 1 auto; min-width: 0; flex-wrap: nowrap; justify-content: flex-end; overflow: hidden; }
.hush .nav > a, .hush .nav > .nav-pill { opacity: 0; pointer-events: none; }
/* One glass bar on wider screens. On phones the bar is just a row, and its two halves are slabs of their own. lens.js reads --slab. */
@media (min-width: 861px) {
    .brand, .nav { --slab: off; }
    .brand, .nav, html.gl .brand, html.gl .nav { background: transparent; border: 0; border-radius: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* Every link in the bar, the dock and the profile menu is the same pill: an icon stacked over a short label. */
.nav > a, .dock a, .menu-tiles a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 44px; border-radius: 999px; color: var(--ink); font-size: 12px; font-weight: 600; text-decoration: none; }
.nav > a { padding: 0 11px; }
.nav > a, .dock > a { position: relative; transition: opacity .2s, color .2s, text-shadow .2s; }
.nav svg, .dock svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav a:hover, .dock a:hover { background: var(--edge); }
.nav a.on, .dock a.on { background: var(--ink); color: var(--bg); text-shadow: none; }
/* The lit pill in the bar and the dock is one element, which saar.js slides under whichever link is on. Until it has, the link lights itself. */
.nav-pill { position: absolute; left: 0; top: 0; border-radius: 999px; background: var(--ink); opacity: 0; pointer-events: none; transition: transform .28s cubic-bezier(.3, .7, .2, 1), width .28s cubic-bezier(.3, .7, .2, 1), height .28s cubic-bezier(.3, .7, .2, 1), opacity .2s; }
.nav-pill.shown { opacity: 1; }
.nav:has(> .nav-pill.shown) > a.on, .dock:has(> .nav-pill.shown) > a.on { background: transparent; }
@media (prefers-reduced-motion: reduce) { .nav-pill, .nav > a, .dock > a { transition: none; } }

.navmenu { position: relative; --bar-inset: 14px; }
.navmenu > summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 999px; cursor: pointer; }
.navmenu > summary::-webkit-details-marker { display: none; }
.navmenu > summary:hover, .navmenu[open] > summary { background: var(--edge); }
.navmenu > summary svg { width: 22px; height: 22px; transition: opacity .15s; }
.joining .navmenu > summary { pointer-events: none; }
.joining .navmenu > summary svg { opacity: 0; }

/* The profile menu is a slab of its own hanging under the bar, lined up with the bar's edge. lens.js paints its rim and
   tint onto the canvas inside it, and the page shows through, softened here. Without WebGL it's solid, because the bar's
   frosting stops a blur inside it from seeing the page. */
.menu-panel { --rim: 16; --muted: var(--gm); position: absolute; right: calc(0px - var(--bar-inset)); top: calc(100% + 18px); z-index: 60; width: min(304px, calc(100vw - 32px)); border-radius: var(--radius); border: 1px solid var(--edge); background: var(--bg); box-shadow: 0 20px 50px var(--shadow); text-shadow: 0 0 3px var(--halo), 0 0 12px var(--halo); }
html.gl .menu-panel { background: transparent; -webkit-backdrop-filter: var(--float-blur); backdrop-filter: var(--float-blur); border-color: transparent; animation: menu-in .14s ease-out; }
@keyframes menu-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { html.gl .menu-panel { animation: none; } }
.menu-body { display: flex; flex-direction: column; gap: 14px; max-height: calc(100dvh - 110px); padding: 20px 18px; overflow-y: auto; box-sizing: border-box; border-radius: inherit; }
.menu-who { display: flex; flex-direction: column; gap: 3px; padding-inline: 6px; min-width: 0; }
.menu-name { display: block; font-size: 20px; line-height: 1.2; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.menu-email { color: var(--muted); font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.menu-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
.menu-tiles a { min-height: 50px; }
.menu-admin { display: flex; flex-direction: column; gap: 6px; }
.menu-admin .label { padding-inline: 6px; }
.menu-panel form { margin: 0; }
.menu-row { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; min-height: 44px; padding: 0 6px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font: 600 13px var(--body); text-decoration: none; text-shadow: inherit; cursor: pointer; box-sizing: border-box; }
.menu-row:hover { background: var(--edge); }
.lights { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-left: 6px; }
.lampswitch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--edge); }
.lampswitch button { min-width: 44px; min-height: 38px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 600 11px/1 var(--body); letter-spacing: .07em; text-transform: uppercase; cursor: pointer; }
.lampswitch button[aria-pressed="true"] { background: var(--amber); color: var(--on-amber); }
.phone-only { display: none !important; }

/* The dock on phones matches the top bar. It floats over the page, so the canvas behind the page can't draw it: lens.js
   paints the same glass onto a canvas inside it, and the page shows through, softened here. Without WebGL it's frosted CSS. */
.dock { display: none; position: fixed; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 45; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 10px; border-radius: 36px; border: 1px solid var(--edge); background: var(--float); -webkit-backdrop-filter: var(--float-blur); backdrop-filter: var(--float-blur); box-shadow: 0 14px 34px var(--shadow); text-shadow: 0 0 3px var(--halo), 0 0 12px var(--halo); }
html.gl .dock { background: transparent; border-color: transparent; }
.float-glass { display: none; position: absolute; left: -1px; top: -1px; width: calc(100% + 2px); height: calc(100% + 2px); z-index: -1; pointer-events: none; }
html.gl .float-glass { display: block; }

@media (max-width: 860px) {
    .nav > a, .nav > .nav-pill { display: none; }
    .phone-only { display: flex !important; }
    .dock { display: grid; }
    .saar-shell { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
    #underneath { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
    .topbar { --slab: off; padding: 0; gap: 8px; flex-wrap: nowrap; align-items: stretch; border-radius: 0; }
    .topbar, html.gl .topbar { background: transparent; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
    .brand, .nav { --slab: on; min-width: 0; }
    .brand { padding: 10px 14px 10px 18px; }
    .nav { flex: none; flex-wrap: nowrap; padding: 10px; border-radius: 36px; }
    .navmenu { --bar-inset: 10px; }
    /* Stops short of the dock, and scrolls if it has to. */
    .menu-body { max-height: calc(100dvh - 196px - env(safe-area-inset-bottom, 0px)); }
}

/* Installing. install.js sets data-install on <html> only where there's a way to install and it hasn't been already,
   so every piece starts hidden. The banner is for phones, until it's closed. */
.install-row, .install-banner { display: none; }
html[data-install] .install-row { display: flex; }
.install-banner { position: fixed; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 44; align-items: center; gap: 6px; padding: 8px 8px 8px 20px; border-radius: 36px; border: 1px solid var(--edge); background: var(--float); -webkit-backdrop-filter: var(--float-blur); backdrop-filter: var(--float-blur); box-shadow: 0 14px 34px var(--shadow); text-shadow: 0 0 3px var(--halo), 0 0 12px var(--halo); }
@media (max-width: 860px) {
    html[data-install]:not([data-install-banner]) .install-banner { display: flex; }
}
.install-banner-text { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; }
.install-banner-go, .install-sheet-button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--amber); color: var(--on-amber); font: 600 13px var(--body); cursor: pointer; }
.install-banner-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; }
.install-banner-close:hover { background: var(--edge); }
.install-banner-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.install-sheet { position: fixed; inset: 0; margin: auto; height: fit-content; width: min(420px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--edge); border-radius: var(--radius); background: var(--solid); color: var(--ink); box-shadow: 0 20px 50px var(--shadow); }
.install-sheet::backdrop { background: rgb(0 0 0 / .45); }
.install-sheet-body { display: flex; flex-direction: column; gap: 14px; padding: 24px 22px 18px; font-size: 15px; line-height: 1.45; }
.install-sheet-body h2 { margin: 0; font-size: 18px; }
.install-sheet-body p { margin: 0; }
.install-steps { display: flex; flex-direction: column; gap: 10px; margin: 0 0 12px; padding-left: 1.3em; }
.install-share { width: 20px; height: 20px; vertical-align: -4px; fill: none; stroke: var(--amber); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.install-sheet [data-install-for] { display: none; flex-direction: column; gap: 10px; }
html[data-install="ios"] .install-sheet [data-install-for="ios"], html[data-install="inapp"] .install-sheet [data-install-for="inapp"] { display: flex; }
.install-sheet [data-install-copy] { align-self: flex-start; background: transparent; color: var(--ink); border: 1px solid var(--edge-strong); }
.install-sheet-actions { display: flex; justify-content: flex-end; }

/* Home */
.hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px 32px; padding-inline: 8px; }
.hero h1 { margin: 0; font-size: clamp(24px, 3.2vw, 42px); line-height: 1.12; text-wrap: balance; max-width: 19em; }
.home { display: flex; flex-direction: column; gap: 24px; }

.cluster { display: flex; justify-content: center; align-items: center; gap: clamp(8px, 1.1vw, 16px); padding-block: 6px; }
.dial { position: relative; flex: 208 1 0; min-width: 0; aspect-ratio: 1; container-type: inline-size; border-radius: 50%; display: grid; place-items: center; text-align: center; }
.dial.step { flex-grow: 278; }
.dial.main { flex-grow: 348; }
.dial svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dial .read { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; width: 72%; }
.dial .label { font-size: max(10px, 5.2cqw); }
.dial .big { font-family: var(--mono); font-size: 14cqw; font-weight: 500; line-height: 1.12; }
.dial .note { font-size: max(12px, 6cqw); line-height: 1.2; color: var(--muted); text-wrap: balance; }
.dial.main .read { position: absolute; top: 56%; left: 18%; width: 64%; }
.dial.main .big { font-size: 12.5cqw; }
.dial.main .zone { font-family: var(--display); font-size: 3.5cqw; line-height: 1.25; color: var(--amber); }
.dial.main .label { font-size: 3.3cqw; line-height: 1.25; }
.dial.main .note { font-size: 3.8cqw; }
@media (max-width: 760px) {
    .cluster { flex-wrap: wrap; }
    .dial { flex: none; width: min(44%, 170px); order: 2; }
    .dial.step { width: min(48%, 190px); order: 1; }
    .dial.main { width: min(100%, 348px); order: 0; }
    .dial.main .label { font-size: 11px; } .dial.main .note { font-size: 13px; } .dial.main .zone { font-size: 12px; }
}

.slab:has(.bleed) { --rim: 26; }
.slab { display: flex; justify-content: space-between; gap: 20px; min-height: clamp(112px, 13vw, 178px); border-radius: 42px; overflow: hidden; }
.slab-pos { align-self: flex-end; font-size: clamp(70px, 12vw, 168px); line-height: .76; margin: 0 0 10px 8px; }
.slab-time { align-self: flex-start; font-size: clamp(44px, 7.6vw, 108px); line-height: .86; margin: 12px 12px 0 0; letter-spacing: 0; font-weight: 600; }
.slab-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 0 0 22px 0; max-width: 24em; }
.slab-mid .label { color: var(--ink); }
.slab-empty { align-self: center; padding: 22px 28px; }
/* Too narrow for one row, so it stacks, keeping the time in the top right rim and the position in the bottom left, as on
   desktop. The bend is a fixed distance, so a narrower rim and bigger type keep it to the same share of each digit. */
@media (max-width: 820px) {
    .slab:has(.bleed) { --rim: 18; }
    .slab { flex-direction: column; gap: 14px; }
    .slab-time { order: 1; align-self: flex-end; font-size: clamp(50px, 15vw, 72px); margin: 9px 8px 0 0; }
    .slab-mid { order: 2; flex: none; max-width: none; padding: 0 24px; }
    .slab-pos { order: 3; align-self: flex-start; font-size: clamp(84px, 25vw, 110px); margin: 0 0 7px 5px; }
}

.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 370px), 1fr)); gap: 20px; }
.span2 { grid-column: span 2; }
@media (max-width: 860px) { .span2 { grid-column: auto; } }
.panel { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel h2 { margin: 0; font-size: 15px; line-height: 1.3; }
.panelhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 14px; }
.panelhead a { color: inherit; font-weight: 500; }
.scroll { overflow-x: auto; }
.readings { width: 100%; border-collapse: collapse; }
.readings th { text-align: right; font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 6px 10px; white-space: nowrap; }
.readings td { text-align: right; padding: 9px 10px; border-top: 1px solid var(--rowline); white-space: nowrap; }
.readings th.l, .readings td.l { text-align: left; }
.readings td.t { font-size: 15px; }
.readings tr.self td { background: var(--self); }
.readings tr.self td:first-child { border-radius: 10px 0 0 10px; }
.readings tr.self td:last-child { border-radius: 0 10px 10px 0; }
.driver { font-weight: 600; }
.pbrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 9px; border-top: 1px solid var(--rowline); }
.pbrow:first-of-type { border-top: 0; }
.pbrow a { color: inherit; }
.big41 { position: absolute; left: 8px; bottom: 8px; font-size: 104px; line-height: .86; letter-spacing: 0; font-weight: 600; }
.pbrow.excl { flex-direction: column; align-items: flex-start; gap: 2px; padding-left: 146px; min-height: 92px; }
.tile { display: flex; flex-direction: column; }
.tile .value { font-family: var(--mono); font-size: 24px; font-weight: 500; line-height: 1.2; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
/* Our next night: upcoming bookings, with everyone on them. */
.booking { align-items: flex-start; justify-content: flex-start; gap: 18px; }
.booking-when { display: flex; flex-direction: column; flex: none; min-width: 112px; }
.booking-date { font-size: 22px; line-height: 1.15; }
.booking-what { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.booking-what a { color: inherit; font-weight: 600; }
.booking-note { font-size: 13px; }
.people { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.person { padding: 2px 10px; border-radius: 999px; border: 1px solid var(--rowline); font-size: 13px; line-height: 20px; }
.booking-what a.person { font-weight: 600; text-decoration: none; }
.person.member { background: var(--self); border-color: transparent; }
.person.you { border-color: var(--amber); }
.booking-you { margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.booking-you.in { color: var(--better); }
@media (max-width: 480px) { .booking { flex-direction: column; gap: 6px; } }

/* What's on: a strip of days, then the day's sessions as small tiles. */
.days { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.day { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: 12px; border: 1px solid transparent; background: none; color: inherit; font: inherit; cursor: pointer; }
.day:hover { border-color: var(--rowline); }
.day.on { background: var(--self); border-color: var(--edge); }
.day .dow { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.day .dom { font-family: var(--mono); font-size: 17px; line-height: 1.3; }
.slots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.slot { display: inline-flex; flex-direction: column; align-items: center; min-width: 58px; padding: 3px 8px; border-radius: 10px; border: 1px solid var(--rowline); cursor: default; }
.slot .t { font-size: 15px; }
.slot .left { font-size: 11px; color: var(--muted); }
.slot.few .left { color: var(--worse); font-weight: 600; }
.slot.full { opacity: .45; }

.hello { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 28px; }
.notice { padding: 12px 20px; }
.notice a { color: inherit; font-weight: 600; }
/* Tracks: countries, then providers, then tracks, as tiles or a list. A whole country or provider tile is the link. */
.track-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.track-grid-wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.track-tile { display: block; color: inherit; text-decoration: none; border-radius: var(--radius); }
.track-tile:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.track-tile-body { display: flex; align-items: center; gap: 12px; height: 100%; min-height: 104px; padding: 18px 44px 18px 20px; box-sizing: border-box; }
.track-tile-text { flex: 1; min-width: 0; }
/* Each country's own shape, scaled to fill the same square, so a small country looks as big as a large one. */
.country-outline { flex: none; width: 76px; height: 76px; fill: currentColor; fill-opacity: .07; stroke: currentColor; stroke-width: 1.4px; stroke-linejoin: round; vector-effect: non-scaling-stroke; color: var(--ink); opacity: .7; overflow: visible; }
.country-outline path { vector-effect: non-scaling-stroke; }
.country-outline-small { width: 26px; height: 26px; stroke-width: 1px; }
/* Providers' own logos, from their websites. A one-colour logo is turned light at night, and one made for dark
   backgrounds gets a fine dark edge by day so its white parts still show. */
.provider-logo { display: block; height: 30px; width: auto; max-width: 100%; object-fit: contain; object-position: left center; margin-bottom: 8px; }
.provider-logo-small { height: 16px; max-width: 120px; margin: 0; }
.provider-logo-slot { display: inline-flex; align-items: center; width: 120px; }
.provider-logo-heading { height: 26px; margin: 0; }
:root[data-theme="dark"] .provider-logo.ink-dark { filter: invert(1); }
:root:not([data-theme="dark"]) .provider-logo.ink-for-dark { filter: drop-shadow(0 0 .5px #000) drop-shadow(0 0 .5px #000); }
.provider-initials { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--edge); font: 400 15px/1 var(--display); letter-spacing: .04em; color: var(--ink); }
.provider-initials-small { width: 26px; height: 26px; border-radius: 8px; font-size: 10px; }
/* The glass is drawn where the tile sits, so the tile itself stays put and only the arrow moves. */
.track-tile-arrow { position: absolute; right: 14px; top: 50%; translate: 0 -50%; color: var(--muted); transition: translate .15s, color .15s; }
.track-tile:hover .track-tile-arrow, .track-tile:focus-visible .track-tile-arrow { translate: 4px -50%; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .track-tile-arrow { transition: none; } }
/* Live timing: a header slab with the clock, then the whole field. Rows open to show every lap seen. */
.live { display: flex; flex-direction: column; gap: 20px; }
.live-pick { max-width: 640px; }
.live-title { margin: 0; font-size: clamp(20px, 3vw, 30px); line-height: 1.2; }
.live-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 16px 24px; }
.live-session { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.live-clock-box { display: flex; flex-direction: column; align-items: flex-end; }
.live-clock { font-size: clamp(44px, 8vw, 84px); line-height: .9; font-weight: 600; letter-spacing: 0; }
.live-tiles { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.live-tiles .muted { font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.live-table .live-row { cursor: pointer; }
.live-table .live-row:hover td, .live-table .live-row:focus-visible td { background: var(--edge); }
.live-table .live-row:focus-visible { outline: none; }
.live-table .live-row.self td { background: var(--self); }
.live-table .member td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.live-table .open td { border-bottom: 0; }
.live-table .driver-cell { max-width: 16em; overflow: hidden; text-overflow: ellipsis; }
.live-table .you { margin-left: 6px; color: var(--amber); }
.live-table .gain { margin-left: 4px; font-size: 11px; }
.live-table .live-detail td { text-align: left; white-space: normal; border-top: 0; padding: 2px 10px 16px; }
.live-detail-body { display: flex; flex-direction: column; gap: 12px; }
.live-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.live-facts .label { margin-right: 4px; }
.live-laps { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 4px 14px; }
.live-lap .label { display: inline-block; min-width: 2.2em; }
.live-key { font-size: 13px; }
.live-table .narrow-only { display: none; }
/* Phones: kart joins the driver's name, and laps and interval wait in the opened row. */
@media (max-width: 640px) {
    .live-head { grid-template-columns: 1fr; }
    .live-clock-box { align-items: flex-start; }
    .live-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .live-board { padding-inline: 14px; }
    .live-table .wide-only { display: none; }
    .live-table .narrow-only { display: inline; margin-right: 5px; font-size: 12px; }
    .live-table th, .live-table td { padding-inline: 4px; }
    .live-table td.t { font-size: 13px; }
    .live-table .driver-cell { max-width: 7.5em; }
    .live-table .you { display: none; }
}
.live-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
/* Every lap: drivers down the side in position order, laps across. The names float over the laps as they scroll. */
.lap-table th, .lap-table td { padding-inline: 8px; }
.lap-table td.t { font-size: 14px; }
.lap-table td.muted { color: var(--faint); }
.lap-table .lap-who { position: sticky; left: 0; z-index: 1; max-width: 13em; overflow: hidden; text-overflow: ellipsis; background: var(--float); -webkit-backdrop-filter: var(--float-blur); backdrop-filter: var(--float-blur); box-shadow: inset -1px 0 0 var(--rowline); }
.lap-table tr.self td.lap-who { background: linear-gradient(var(--self), var(--self)), var(--float); }
.lap-table tr.member td.lap-who { box-shadow: inset 3px 0 0 var(--amber), inset -1px 0 0 var(--rowline); }
.lap-table .lap-pos { display: inline-block; min-width: 1.7em; }
.lap-table .lap-kart { margin-left: 6px; font-size: 12px; }
@media (max-width: 640px) {
    .lap-table th, .lap-table td { padding-inline: 5px; }
    .lap-table td.t { font-size: 13px; }
    .lap-table .lap-who { max-width: 9em; }
}
.pill-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; text-decoration: none; text-shadow: none; }

/* MudBlazor components */
h1, h2, h3 { text-wrap: balance; }
.mud-typography-h1, .mud-typography-h2, .mud-typography-h3, .mud-typography-h4, .mud-typography-h5, .mud-typography-h6 { font-family: var(--display); font-weight: 400; letter-spacing: .01em; line-height: 1.2; }
.mud-typography-h3 { font-size: clamp(24px, 3.2vw, 40px); }
.mud-typography-h4 { font-size: clamp(22px, 2.6vw, 32px); }
.mud-typography-h5 { font-size: clamp(18px, 2vw, 24px); }
.mud-typography-h6 { font-size: 16px; }
.mud-typography-overline { font-weight: 600; letter-spacing: .1em; }
.mud-button-root { border-radius: 999px; text-transform: none; letter-spacing: 0; font-weight: 600; box-shadow: none !important; text-shadow: none; }
.mud-button-filled.mud-button-filled-primary { background: var(--amber); color: var(--on-amber); }
.mud-chip { border-radius: 999px; text-shadow: none; }
.mud-alert { border-radius: 20px; text-shadow: none; }
.mud-link { color: inherit; font-weight: 500; text-decoration: underline; text-decoration-color: var(--edge-strong); text-underline-offset: 3px; }
/* Keeps table text clear of the rim, where it would warp. */
.mud-table-container { border-radius: inherit; padding: 10px 18px 14px; box-sizing: border-box; }
.mud-table .mud-table-container { padding: 10px 18px 14px; }
.mud-paper .mud-table-container, .glass .mud-table-container { padding: 0; }
.mud-table, .mud-table-root, .mud-table-head, .mud-table-body, .mud-table-cell, .mud-table-pagination-toolbar { background: transparent; }
.mud-table-cell { font-variant-numeric: tabular-nums; }
.mud-table-head .mud-table-cell { font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.mud-tabs, .mud-tabs-tabbar, .mud-tabs-toolbar, .mud-tabs-tabbar-wrapper, .mud-tabs-panels { background: transparent !important; }
.mud-tab { text-transform: none; font-weight: 600; letter-spacing: 0; border-radius: 14px; }
.mud-tab-slider, .mud-tabs-tabbar .mud-tab-slider { background: var(--amber) !important; }
.mud-input-control .mud-input-outlined-border { border-radius: 14px; }
.mud-toggle-group { border-radius: 999px; }

/* Things that float over the page are frosted CSS, not the canvas. A popover is also .mud-paper, which is why the html.gl
   selector is needed: that rule would otherwise turn its blur off. */
.mud-popover, .mud-dialog, .mud-snackbar { background: var(--float) !important; text-shadow: 0 0 3px var(--halo), 0 0 12px var(--halo); --muted: var(--gm); }
.mud-popover, .mud-dialog, .mud-snackbar, html.gl .mud-popover, html.gl .mud-dialog, html.gl .mud-snackbar { -webkit-backdrop-filter: var(--float-blur); backdrop-filter: var(--float-blur); }
/* Popovers are also .mud-paper, which is relative here. An open one would join the page's flow and push it all down. */
.mud-popover { position: absolute; border-radius: 18px !important; border: 1px solid var(--edge) !important; }
.mud-dialog { border-radius: 28px !important; border: 1px solid var(--edge); box-shadow: 0 24px 60px var(--shadow) !important; }
.mud-overlay-scrim, .mud-overlay-dark { background: rgb(4 3 8 / .55) !important; }

/* Charts */
.apexcharts-canvas { background: transparent !important; }
.apexcharts-text, .apexcharts-xaxis-label, .apexcharts-yaxis-label { fill: var(--muted) !important; }
.apexcharts-legend-text { color: var(--ink) !important; }
.apexcharts-gridline { stroke: var(--grid) !important; }
.apexcharts-tooltip, .apexcharts-xaxistooltip { background: var(--float) !important; -webkit-backdrop-filter: var(--float-blur); backdrop-filter: var(--float-blur); color: var(--ink) !important; border-color: var(--edge) !important; border-radius: 12px !important; text-shadow: 0 0 3px var(--halo), 0 0 12px var(--halo); }
.apexcharts-tooltip-title { background: transparent !important; border-color: var(--edge) !important; }

/* The plain sign-in pages */
.row { display: flex; flex-wrap: wrap; gap: 24px; margin: 0; }
.row > [class*="col-"] { flex: 1 1 320px; min-width: 0; padding: 0; }
.form-floating, .mb-3 { margin-bottom: 14px; }
.form-floating { display: flex; flex-direction: column-reverse; gap: 4px; }
.form-label, .form-floating > label { font-size: 13px; font-weight: 600; color: var(--muted); }
.form-control { width: 100%; min-height: 46px; padding: 8px 14px; box-sizing: border-box; border-radius: 14px; border: 1px solid var(--edge-strong); background: var(--panel); color: var(--ink); font: 16px var(--body); }
.form-control::placeholder { color: transparent; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--edge-strong); background: transparent; color: var(--ink); font: 600 15px var(--body); text-decoration: none; cursor: pointer; }
.btn-primary, .btn.btn-lg.btn-primary { background: var(--amber); border-color: transparent; color: var(--on-amber); }
.btn-danger { background: var(--worse); border-color: transparent; color: var(--bg); }
.btn-secondary { background: var(--edge); }
.w-100 { width: 100%; }
.text-danger { color: var(--worse); }
.alert { padding: 12px 18px; border-radius: 16px; border: 1px solid var(--edge); background: var(--panel); margin-bottom: 14px; }
.alert-danger { border-color: var(--worse); }
.alert-warning { border-color: var(--flag-y); }
.alert-success { border-color: var(--better); }
.list-group { list-style: none; margin: 0; padding: 0; }
#blazor-error-ui { color: #15161a; }
