:root {
    --tr-bg: #f4f7fa;
    --tr-splash-text: #52606d;
    --tr-cold: #3b82f6;
    --tr-cool: #06b6d4;
    --tr-warm: #f59e0b;
    --tr-hot: #ef4444;
    --tr-none: #9aa5b1;
    --tr-river: #1f5fbf;
    --tr-river-hi: #e8590c;
}

/* Dark values apply to a pinned Dark theme and, unless Light is pinned, to a dark operating system. */
:root[data-theme="dark"] {
    --tr-bg: #0e1620;
    --tr-splash-text: #9fb0c0;
    --tr-cold: #60a5fa;
    --tr-cool: #22d3ee;
    --tr-warm: #fbbf24;
    --tr-hot: #f87171;
    --tr-none: #6b7a89;
    --tr-river: #4da3ff;
    --tr-river-hi: #ffb347;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --tr-bg: #0e1620;
        --tr-splash-text: #9fb0c0;
        --tr-cold: #60a5fa;
        --tr-cool: #22d3ee;
        --tr-warm: #fbbf24;
        --tr-hot: #f87171;
        --tr-none: #6b7a89;
        --tr-river: #4da3ff;
        --tr-river-hi: #ffb347;
    }
}

html, body {
    background: var(--tr-bg);
    font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

body { margin: 0; }

/* Shown until the interactive circuit has rendered the layout. */
#splash {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--tr-splash-text);
    background: var(--tr-bg);
    z-index: 0;
}
body:has(.mud-layout) #splash { display: none; }

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 1.25rem;
    background: #b91c1c;
    color: #fff;
    z-index: 2000;
}
#blazor-error-ui .reload { color: #fff; margin-left: 12px; text-decoration: underline; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.app-bar .brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-height: 40px; }
.app-bar .brand img { width: 28px; height: 28px; border-radius: 7px; }

.station-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-left: 4px solid var(--tr-none);
    transition: box-shadow 120ms ease-out, transform 120ms ease-out;
}
.station-card:hover { transform: translateY(-1px); }
.station-card.band-cold { border-left-color: var(--tr-cold); }
.station-card.band-cool { border-left-color: var(--tr-cool); }
.station-card.band-warm { border-left-color: var(--tr-warm); }
.station-card.band-hot { border-left-color: var(--tr-hot); }
.station-card a.card-link { color: inherit; text-decoration: none; display: block; flex: 1; }

.temp-value { font-variant-numeric: tabular-nums; font-weight: 600; line-height: 1.1; }
.band-cold .temp-value { color: var(--tr-cold); }
.band-cool .temp-value { color: var(--tr-cool); }
.band-warm .temp-value { color: var(--tr-warm); }
.band-hot .temp-value { color: var(--tr-hot); }

.mono { font-family: "Cascadia Mono", Consolas, "Courier New", monospace; }
.wrap-anywhere { overflow-wrap: anywhere; }

/* The page never scrolls sideways; wide content scrolls in its own box. */
.mud-main-content { overflow-x: hidden; }
.scroll-x { overflow-x: auto; max-width: 100%; }

/* Links that stand alone (not inside a sentence) are 40 px high targets. */
.tr-touch { display: inline-flex; align-items: center; min-height: 40px; padding: 0 8px; }

/* Focus moved to the page heading after a navigation (screen readers, FocusOnNavigate) draws no box for mouse / touch users;
   keyboard focus keeps its outline. */
h1:focus:not(:focus-visible), h1[tabindex="-1"]:focus { outline: none; }

/* The consent banner is fixed to the bottom; leave room so it never hides the footer. */
html[data-tomlabs-consent-open] body { padding-bottom: var(--tomlabs-consent-height, 0px); }

/* Touch targets of at least 40 px. */
.mud-icon-button, .mud-button-root { min-height: 40px; }
.mud-icon-button { min-width: 40px; }

.chart-box { width: 100%; min-height: 260px; }
.chart-box .mud-chart { width: 100%; }


@media (prefers-reduced-motion: reduce) {
    .station-card { transition: none; }
}

.log-line { font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.log-line .log-exception { white-space: pre-wrap; opacity: .8; }

/* Static pages without the MudBlazor layout (sign-in). */
.plain-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; color: var(--tr-text, #16202b); }
:root[data-theme="dark"] .plain-page { --tr-text: #e6edf3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .plain-page { --tr-text: #e6edf3; } }
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 8px; }
.login-card h1 { font-size: 20px; margin: 8px 0 12px; }
.login-card form { display: flex; flex-direction: column; gap: 6px; }
.login-card label { font-size: 13px; opacity: .75; }
.login-card input { font: inherit; padding: 10px 12px; min-height: 40px; border-radius: 8px; border: 1px solid rgba(128,128,128,.4); background: transparent; color: inherit; }
.login-card button { font: inherit; margin-top: 10px; min-height: 44px; border: 0; border-radius: 8px; background: #0B6FB3; color: #fff; cursor: pointer; }
.login-card a { color: inherit; opacity: .75; margin-top: 12px; padding: 8px 0; }
.login-error { color: #dc2626; margin: 4px 0; }

/* SVG temperature chart. Colours come from the MudBlazor palette so both themes work. */
.tr-chart-wrap { position: relative; width: 100%; }
.tr-chart { width: 100%; height: auto; display: block; touch-action: pan-y; }
.tr-chart .grid { stroke: var(--mud-palette-lines-default); stroke-width: 1; }
.tr-chart .grid-x { stroke: var(--mud-palette-lines-default); stroke-width: 1; stroke-dasharray: 2 4; }
.tr-chart .axis { fill: var(--mud-palette-text-secondary); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.tr-chart .line { fill: none; stroke: var(--mud-palette-primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tr-chart .area { fill: var(--mud-palette-primary); opacity: .12; stroke: none; }
.tr-chart .cursor-line { stroke: var(--mud-palette-text-secondary); stroke-width: 1; }
.tr-chart .cursor-dot { fill: var(--mud-palette-primary); stroke: var(--mud-palette-surface); stroke-width: 2; }
.tr-chart-tip { position: absolute; top: 0; pointer-events: none; padding: 4px 8px; border-radius: 6px; font-size: 12px; line-height: 1.3;
    display: flex; flex-direction: column; background: var(--mud-palette-surface); color: var(--mud-palette-text-primary);
    border: 1px solid var(--mud-palette-lines-default); box-shadow: 0 2px 8px rgba(0,0,0,.18); white-space: nowrap; }
.tr-chart-tip[hidden] { display: none; }
.tr-chart-tip span { color: var(--mud-palette-text-secondary); font-size: 11px; }

/* Year browsing: previous / year picker / next. Buttons keep a 40 px+ touch target. */
.tr-year-nav { display: flex; align-items: center; justify-content: center; gap: 8px; }
.tr-year-nav .mud-icon-button { min-width: 44px; min-height: 44px; }
.tr-year-select { max-width: 140px; }

/* Year overlay: one colour slot per year (newest = 0), the current year in the accent colour and thicker. */
:root { --yo-0: #0e7490; --yo-1: #b45309; --yo-2: #7c3aed; --yo-3: #15803d; --yo-4: #be185d; --yo-5: #475569; --yo-6: #a16207; --yo-7: #0369a1; }
:root[data-theme="dark"] { --yo-0: #22d3ee; --yo-1: #fbbf24; --yo-2: #a78bfa; --yo-3: #4ade80; --yo-4: #f472b6; --yo-5: #94a3b8; --yo-6: #facc15; --yo-7: #38bdf8; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) { --yo-0: #22d3ee; --yo-1: #fbbf24; --yo-2: #a78bfa; --yo-3: #4ade80; --yo-4: #f472b6; --yo-5: #94a3b8; --yo-6: #facc15; --yo-7: #38bdf8; }
}
.yo-0 { --yc: var(--yo-0); } .yo-1 { --yc: var(--yo-1); } .yo-2 { --yc: var(--yo-2); } .yo-3 { --yc: var(--yo-3); }
.yo-4 { --yc: var(--yo-4); } .yo-5 { --yc: var(--yo-5); } .yo-6 { --yc: var(--yo-6); } .yo-7 { --yc: var(--yo-7); }
.tr-chart .yline { fill: none; stroke: var(--yc); stroke-width: 1.5; stroke-opacity: .72; stroke-linejoin: round; stroke-linecap: round; }
.tr-chart .yline.now { stroke: var(--mud-palette-primary); stroke-width: 3; stroke-opacity: 1; }
/* This year against the average: dashed mean line, shaded min-max band of the earlier years. */
.tr-chart .avg-line { fill: none; stroke: var(--mud-palette-text-secondary); stroke-width: 2; stroke-dasharray: 6 4; stroke-linejoin: round; stroke-linecap: round; }
.tr-chart .avg-band { fill: var(--mud-palette-text-secondary); fill-opacity: .2; stroke: none; }
.tr-legend-item.static { cursor: default; }
.tr-legend-item .swatch.avg { background: repeating-linear-gradient(90deg, var(--mud-palette-text-secondary) 0 6px, transparent 6px 9px); }
.tr-legend-item .swatch.band { height: 10px; background: var(--mud-palette-text-secondary); opacity: .35; }
.tr-mode-two.mud-toggle-group-horizontal { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
/* Six range buttons do not fit one row of a phone ("Porovnání" was clipped), so they wrap into two rows of three.
   MudToggleGroup writes its column count into an inline style, hence !important. */
@media (max-width: 599.98px) { .tr-range-six.mud-toggle-group-horizontal { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; grid-auto-flow: row; } }
.tr-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tr-legend-item { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; min-width: 40px; padding: 0 14px; cursor: pointer;
    font: inherit; font-variant-numeric: tabular-nums; color: var(--mud-palette-text-primary); background: transparent;
    border: 1px solid var(--mud-palette-lines-default); border-radius: 20px; }
.tr-legend-item .swatch { width: 18px; height: 4px; border-radius: 2px; background: var(--yc); }
.tr-legend-item.now { font-weight: 600; border-color: var(--mud-palette-primary); }
.tr-legend-item.now .swatch { height: 6px; background: var(--mud-palette-primary); }
.tr-legend-item.off { opacity: .45; text-decoration: line-through; }
.tr-legend-item:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }

/* Static pages without the MudBlazor layout (sign-in). */
.plain-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; color: var(--tr-text, #16202b); }
:root[data-theme="dark"] .plain-page { --tr-text: #e6edf3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .plain-page { --tr-text: #e6edf3; } }
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 8px; }
.login-card h1 { font-size: 20px; margin: 8px 0 12px; }
.login-card form { display: flex; flex-direction: column; gap: 6px; }
.login-card label { font-size: 13px; opacity: .75; }
.login-card input { font: inherit; padding: 10px 12px; min-height: 40px; border-radius: 8px; border: 1px solid rgba(128,128,128,.4); background: transparent; color: inherit; }
.login-card button { font: inherit; margin-top: 10px; min-height: 44px; border: 0; border-radius: 8px; background: #0B6FB3; color: #fff; cursor: pointer; }
.login-card a { color: inherit; opacity: .75; margin-top: 12px; padding: 8px 0; }
.login-error { color: #dc2626; margin: 4px 0; }

/* Station map (/mapa). */
.tr-map-wrap { position: relative; }
.tr-map { width: 100%; height: calc(100dvh - 250px); min-height: 340px; border-radius: 8px; border: 1px solid rgba(0,0,0,.12); z-index: 0; background: #e5e9ee; }
.tr-map-loading { position: absolute; top: 0; left: 0; right: 0; z-index: 2; }
.tr-map-error { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 2; }
.near-button { min-height: 40px; }
.tr-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; margin: 8px 0 4px; padding: 0; font-size: 0.8125rem; }
.tr-legend li { display: inline-flex; align-items: center; gap: 6px; }
.tr-legend .dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.3); }
.tr-legend .dot.band-cold { background: var(--tr-cold); }
.tr-legend .dot.band-cool { background: var(--tr-cool); }
.tr-legend .dot.band-warm { background: var(--tr-warm); }
.tr-legend .dot.band-hot { background: var(--tr-hot); }
/* Leaflet controls grown to the 40 px touch target. */
.tr-map.leaflet-container .leaflet-bar a { width: 40px; height: 40px; line-height: 40px; }
.leaflet-control-attribution { font-size: 11px; }
.leaflet-control-attribution a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 4px; }
.tr-popup { min-width: 150px; }
.tr-popup-river { font-size: 12px; opacity: .75; }
.tr-popup-name { font-weight: 600; margin-bottom: 2px; }
.tr-popup-temp { font-size: 22px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tr-popup-time { font-size: 12px; opacity: .75; margin-bottom: 4px; }
.tr-popup-link { display: inline-flex; align-items: center; min-height: 40px; font-weight: 600; }
.leaflet-popup-content { margin: 10px 14px; }
/* Rivers layer on the map (/mapa): toggle, highlighted course and the panel with its stations. */
.tr-river-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; min-width: 40px; padding: 0 14px; font: inherit; font-size: 0.875rem;
    color: inherit; background: transparent; border: 1px solid rgba(128,128,128,.5); border-radius: 20px; cursor: pointer; }
.tr-river-toggle .swatch { width: 18px; height: 4px; border-radius: 2px; background: var(--tr-river); }
.tr-river-toggle.on { font-weight: 600; border-color: var(--tr-river); }
.tr-river-toggle:not(.on) { opacity: .65; }
.tr-river-toggle:not(.on) .swatch { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.tr-river-toggle:disabled { opacity: .4; cursor: default; }
.tr-river-toggle:focus-visible, .tr-river-close:focus-visible, .tr-river-station:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }
.tr-river-line { stroke-linecap: round; }
.tr-popup-river-button { background: none; border: 0; padding: 0; margin-left: 14px; font: inherit; font-weight: 600; color: #0B6FB3; cursor: pointer; }
.tr-river-panel { position: absolute; z-index: 3; top: 8px; left: 58px; right: 8px; max-width: 340px; max-height: calc(100% - 16px); display: flex; flex-direction: column;
    background: var(--mud-palette-surface, #fff); color: var(--mud-palette-text-primary, #16202b); border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.35); overflow: hidden; }
.tr-river-head { display: flex; align-items: center; gap: 8px; padding: 6px 4px 6px 12px; border-bottom: 3px solid var(--tr-river-hi); }
.tr-river-title { flex: 1; min-width: 0; }
.tr-river-name { font-weight: 600; overflow-wrap: anywhere; }
.tr-river-count { font-size: 12px; opacity: .75; }
.tr-river-close { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; color: inherit; background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.tr-river-stations { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.tr-river-station { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding: 0 12px; color: inherit; text-decoration: none; }
.tr-river-station:hover { background: rgba(128,128,128,.15); }
.tr-river-station-name { overflow-wrap: anywhere; font-size: 0.875rem; }
.tr-river-station .temp-value { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
/* Dark theme: darken the OSM tiles and the popups; the markers keep their colours. */
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.95) contrast(.9); }
:root[data-theme="dark"] .tr-map { background: #1b2430; border-color: rgba(255,255,255,.12); }
:root[data-theme="dark"] .leaflet-popup-content-wrapper, :root[data-theme="dark"] .leaflet-popup-tip { background: #151f2b; color: #e6edf3; }
:root[data-theme="dark"] .tr-popup-link { color: #5ab4f0; }
:root[data-theme="dark"] .tr-popup-river-button { color: #5ab4f0; }
:root[data-theme="dark"] .tr-river-panel { background: #151f2b; color: #e6edf3; }
:root[data-theme="dark"] .leaflet-bar a { background: #151f2b; color: #e6edf3; border-bottom-color: rgba(255,255,255,.15); }
:root[data-theme="dark"] .leaflet-control-attribution { background: rgba(21,31,43,.8); color: #9fb0c0; }
:root[data-theme="dark"] .leaflet-control-attribution a { color: #5ab4f0; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.95) contrast(.9); }
    :root:not([data-theme="light"]) .tr-map { background: #1b2430; border-color: rgba(255,255,255,.12); }
    :root:not([data-theme="light"]) .leaflet-popup-content-wrapper, :root:not([data-theme="light"]) .leaflet-popup-tip { background: #151f2b; color: #e6edf3; }
    :root:not([data-theme="light"]) .tr-popup-link { color: #5ab4f0; }
    :root:not([data-theme="light"]) .tr-popup-river-button { color: #5ab4f0; }
    :root:not([data-theme="light"]) .tr-river-panel { background: #151f2b; color: #e6edf3; }
    :root:not([data-theme="light"]) .leaflet-bar a { background: #151f2b; color: #e6edf3; border-bottom-color: rgba(255,255,255,.15); }
    :root:not([data-theme="light"]) .leaflet-control-attribution { background: rgba(21,31,43,.8); color: #9fb0c0; }
    :root:not([data-theme="light"]) .leaflet-control-attribution a { color: #5ab4f0; }
}

/* The page is prerendered with MudBlazor's light palette (the server cannot know the visitor's theme), and MudThemeProvider
   only switches to the dark palette once the circuit is interactive, a few seconds on a phone. Until then a dark operating
   system (or a pinned Dark theme) got dark text on a dark background, so the whole page looked faded. These are the dark
   values the provider will write (Components/Layout/MainLayout.razor, PaletteDark), so the prerendered page already has
   them; a test compares the two. When PaletteDark changes, regenerate this block. */
:root[data-theme="dark"] {
    --mud-palette-black: rgba(39,39,47,1);
    --mud-palette-primary: rgba(90,180,240,1);
    --mud-palette-primary-rgb: 90,180,240;
    --mud-palette-primary-darken: rgb(59,166,237);
    --mud-palette-primary-lighten: rgb(124,195,243);
    --mud-palette-primary-hover: rgba(90,180,240,0.058823529411764705);
    --mud-palette-secondary: rgba(159,176,192,1);
    --mud-palette-secondary-rgb: 159,176,192;
    --mud-palette-secondary-darken: rgb(138,159,178);
    --mud-palette-secondary-lighten: rgb(181,194,207);
    --mud-palette-secondary-hover: rgba(159,176,192,0.058823529411764705);
    --mud-palette-info: rgba(50,153,255,1);
    --mud-palette-info-rgb: 50,153,255;
    --mud-palette-info-darken: rgb(10,133,255);
    --mud-palette-info-lighten: rgb(92,173,255);
    --mud-palette-info-hover: rgba(50,153,255,0.058823529411764705);
    --mud-palette-success: rgba(11,186,131,1);
    --mud-palette-success-rgb: 11,186,131;
    --mud-palette-success-darken: rgb(9,154,108);
    --mud-palette-success-lighten: rgb(13,222,156);
    --mud-palette-success-hover: rgba(11,186,131,0.058823529411764705);
    --mud-palette-warning: rgba(255,168,0,1);
    --mud-palette-warning-rgb: 255,168,0;
    --mud-palette-warning-darken: rgb(214,143,0);
    --mud-palette-warning-lighten: rgb(255,182,36);
    --mud-palette-warning-hover: rgba(255,168,0,0.058823529411764705);
    --mud-palette-error: rgba(246,78,98,1);
    --mud-palette-error-rgb: 246,78,98;
    --mud-palette-error-darken: rgb(244,47,70);
    --mud-palette-error-lighten: rgb(248,119,134);
    --mud-palette-error-hover: rgba(246,78,98,0.058823529411764705);
    --mud-palette-dark: rgba(39,39,47,1);
    --mud-palette-dark-rgb: 39,39,47;
    --mud-palette-dark-darken: rgb(23,23,28);
    --mud-palette-dark-lighten: rgb(56,56,67);
    --mud-palette-dark-hover: rgba(39,39,47,0.058823529411764705);
    --mud-palette-text-primary: rgba(230,237,243,1);
    --mud-palette-text-primary-rgb: 230,237,243;
    --mud-palette-text-secondary: rgba(159,176,192,1);
    --mud-palette-text-secondary-rgb: 159,176,192;
    --mud-palette-text-disabled: rgba(255,255,255,0.2);
    --mud-palette-text-disabled-rgb: 255,255,255;
    --mud-palette-action-default: rgba(173,173,177,1);
    --mud-palette-action-default-hover: rgba(173,173,177,0.058823529411764705);
    --mud-palette-action-disabled: rgba(255,255,255,0.25882352941176473);
    --mud-palette-action-disabled-background: rgba(255,255,255,0.11764705882352941);
    --mud-palette-surface: rgba(21,31,43,1);
    --mud-palette-surface-rgb: 21,31,43;
    --mud-palette-background: rgba(14,22,32,1);
    --mud-palette-background-gray: rgba(39,39,47,1);
    --mud-palette-drawer-background: rgba(17,27,39,1);
    --mud-palette-drawer-text: rgba(255,255,255,0.4980392156862745);
    --mud-palette-drawer-icon: rgba(255,255,255,0.4980392156862745);
    --mud-palette-appbar-background: rgba(17,27,39,1);
    --mud-palette-appbar-text: rgba(230,237,243,1);
    --mud-palette-lines-default: rgba(255,255,255,0.0784313725490196);
    --mud-palette-lines-inputs: rgba(255,255,255,0.2980392156862745);
    --mud-palette-table-lines: rgba(255,255,255,0.11764705882352941);
    --mud-palette-table-striped: rgba(255,255,255,0.2);
    --mud-palette-divider: rgba(255,255,255,0.0784313725490196);
    --mud-palette-divider-rgb: 255,255,255;
    --mud-palette-divider-light: rgba(255,255,255,0.058823529411764705);
    --mud-palette-skeleton: rgba(255,255,255,0.10980392156862745);
    --mud-native-html-color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --mud-palette-black: rgba(39,39,47,1);
        --mud-palette-primary: rgba(90,180,240,1);
        --mud-palette-primary-rgb: 90,180,240;
        --mud-palette-primary-darken: rgb(59,166,237);
        --mud-palette-primary-lighten: rgb(124,195,243);
        --mud-palette-primary-hover: rgba(90,180,240,0.058823529411764705);
        --mud-palette-secondary: rgba(159,176,192,1);
        --mud-palette-secondary-rgb: 159,176,192;
        --mud-palette-secondary-darken: rgb(138,159,178);
        --mud-palette-secondary-lighten: rgb(181,194,207);
        --mud-palette-secondary-hover: rgba(159,176,192,0.058823529411764705);
        --mud-palette-info: rgba(50,153,255,1);
        --mud-palette-info-rgb: 50,153,255;
        --mud-palette-info-darken: rgb(10,133,255);
        --mud-palette-info-lighten: rgb(92,173,255);
        --mud-palette-info-hover: rgba(50,153,255,0.058823529411764705);
        --mud-palette-success: rgba(11,186,131,1);
        --mud-palette-success-rgb: 11,186,131;
        --mud-palette-success-darken: rgb(9,154,108);
        --mud-palette-success-lighten: rgb(13,222,156);
        --mud-palette-success-hover: rgba(11,186,131,0.058823529411764705);
        --mud-palette-warning: rgba(255,168,0,1);
        --mud-palette-warning-rgb: 255,168,0;
        --mud-palette-warning-darken: rgb(214,143,0);
        --mud-palette-warning-lighten: rgb(255,182,36);
        --mud-palette-warning-hover: rgba(255,168,0,0.058823529411764705);
        --mud-palette-error: rgba(246,78,98,1);
        --mud-palette-error-rgb: 246,78,98;
        --mud-palette-error-darken: rgb(244,47,70);
        --mud-palette-error-lighten: rgb(248,119,134);
        --mud-palette-error-hover: rgba(246,78,98,0.058823529411764705);
        --mud-palette-dark: rgba(39,39,47,1);
        --mud-palette-dark-rgb: 39,39,47;
        --mud-palette-dark-darken: rgb(23,23,28);
        --mud-palette-dark-lighten: rgb(56,56,67);
        --mud-palette-dark-hover: rgba(39,39,47,0.058823529411764705);
        --mud-palette-text-primary: rgba(230,237,243,1);
        --mud-palette-text-primary-rgb: 230,237,243;
        --mud-palette-text-secondary: rgba(159,176,192,1);
        --mud-palette-text-secondary-rgb: 159,176,192;
        --mud-palette-text-disabled: rgba(255,255,255,0.2);
        --mud-palette-text-disabled-rgb: 255,255,255;
        --mud-palette-action-default: rgba(173,173,177,1);
        --mud-palette-action-default-hover: rgba(173,173,177,0.058823529411764705);
        --mud-palette-action-disabled: rgba(255,255,255,0.25882352941176473);
        --mud-palette-action-disabled-background: rgba(255,255,255,0.11764705882352941);
        --mud-palette-surface: rgba(21,31,43,1);
        --mud-palette-surface-rgb: 21,31,43;
        --mud-palette-background: rgba(14,22,32,1);
        --mud-palette-background-gray: rgba(39,39,47,1);
        --mud-palette-drawer-background: rgba(17,27,39,1);
        --mud-palette-drawer-text: rgba(255,255,255,0.4980392156862745);
        --mud-palette-drawer-icon: rgba(255,255,255,0.4980392156862745);
        --mud-palette-appbar-background: rgba(17,27,39,1);
        --mud-palette-appbar-text: rgba(230,237,243,1);
        --mud-palette-lines-default: rgba(255,255,255,0.0784313725490196);
        --mud-palette-lines-inputs: rgba(255,255,255,0.2980392156862745);
        --mud-palette-table-lines: rgba(255,255,255,0.11764705882352941);
        --mud-palette-table-striped: rgba(255,255,255,0.2);
        --mud-palette-divider: rgba(255,255,255,0.0784313725490196);
        --mud-palette-divider-rgb: 255,255,255;
        --mud-palette-divider-light: rgba(255,255,255,0.058823529411764705);
        --mud-palette-skeleton: rgba(255,255,255,0.10980392156862745);
        --mud-native-html-color-scheme: dark;
    }
}

/* Water level, discharge and flood stages (SPA 1 bdelost, 2 pohotovost, 3 ohrozeni). */
:root { --spa-1: #a16207; --spa-2: #c2410c; --spa-3: #b91c1c; }
:root[data-theme="dark"] { --spa-1: #facc15; --spa-2: #fb923c; --spa-3: #f87171; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --spa-1: #facc15; --spa-2: #fb923c; --spa-3: #f87171; } }
.tr-metric-three.mud-toggle-group-horizontal { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.tr-chart .flood { stroke-width: 1.5; stroke-dasharray: 6 4; fill: none; }
.tr-chart .flood.s1 { stroke: var(--spa-1); } .tr-chart .flood.s2 { stroke: var(--spa-2); } .tr-chart .flood.s3 { stroke: var(--spa-3); }
.tr-chart .flood-label { font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tr-chart .flood-label.s1 { fill: var(--spa-1); } .tr-chart .flood-label.s2 { fill: var(--spa-2); } .tr-chart .flood-label.s3 { fill: var(--spa-3); }
.tr-spa { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 14px; font-size: 13px; font-weight: 600;
    border: 1.5px solid var(--spa-c); color: var(--spa-c); font-variant-numeric: tabular-nums; }
.tr-spa.s0 { --spa-c: var(--mud-palette-text-secondary); font-weight: 400; border-color: var(--mud-palette-lines-default); }
.tr-spa.s1 { --spa-c: var(--spa-1); } .tr-spa.s2 { --spa-c: var(--spa-2); } .tr-spa.s3 { --spa-c: var(--spa-3); }
.tr-spa.on { background: color-mix(in srgb, var(--spa-c) 16%, transparent); }
.tr-spa-row { display: flex; flex-wrap: wrap; gap: 8px; }
.station-card .tr-spa { min-height: 24px; font-size: 12px; }
