﻿@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* ======= EPC energy-class palette (EU standard A=green … G=red) =======
   Single source for every HTML/CSS energy-class indicator (building-card badge,
   distribution arrows, legend, EPC list). Referenced via var(--epc-x) — never hardcode
   these hex values inline. The map layer keeps matching RGB values in EcoMenderMap.razor
   because GeoBlazor needs MapColor objects, not CSS variables. */
:root {
    --epc-a: #1a9641;
    --epc-b: #52b151;
    --epc-c: #a6d96a;
    --epc-d: #fee08b;
    --epc-e: #fdae61;
    --epc-f: #f46d43;
    --epc-g: #d7191c;
    --epc-unknown: #cfd8dc;
}

/* ======= Base HTML and Body ======= */
html, body {
    font-family: var(--mud-typography-default-family);
}

/* ======= Links and Buttons ======= */
a, .btn-link {
    color: var(--mud-palette-primary);
}

.btn-primary {
    color: var(--mud-palette-white) !important;
    background-color: var(--mud-palette-primary) !important;
    border-color: var(--mud-palette-primary-darken) !important;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--mud-palette-primary-lighten);
}

/* ======= Content and Headings ======= */
.content {
    padding-top: 1.1rem;
}

/*h1:focus {
    outline: none;
}*/

/* ======= Validation ======= */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--mud-palette-success);
}

.invalid {
    outline: 1px solid var(--mud-palette-error);
}

.validation-message {
    color: var(--mud-palette-error);
}

/* ======= Labels and Inputs ======= */
label {
    font-size: 12px;
}

    label:disabled,
    input:disabled,
    .form-control:disabled,
    .form-control[readonly] {
        color: InactiveCaptionText !important;
    }

.e-grid[disabled] {
    opacity: 0.5;
}

/* ======= Input Group Text ======= */
.input-group-text {
    font-size: 12px !important;
}

/* ======= Row Layout ======= */
.some-row {
    margin: 0px !important;
}

/* ======= Info Tooltip ======= */
.info-tooltip-text {
    color: black;
    margin-bottom: 4px;
}

/* ======= Blazor Error UI: Shared/SessionRecovery.razor.css (#657) ======= */

/* ======= Blazor Error Boundary ======= */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

.darker-border-checkbox.form-check-input {
    border-color: var(--mud-palette-text-secondary);
}

/* ======= Floating Form Controls ======= */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ======= Close Button ======= */
.close {
    position: relative;
    top: 0px;
    width: 19px;
    height: 19px;
    opacity: 0.3;
}

    .close:hover {
        opacity: 1;
    }

    .close:before, .close:after {
        position: absolute;
        left: 10px;
        content: ' ';
        height: 20px;
        width: 2px;
        background-color: var(--mud-palette-text-primary);
    }

    .close:before {
        transform: rotate(45deg);
    }

    .close:after {
        transform: rotate(-45deg);
    }

/* ======= Toasts and Misc ======= */
.blazored-toast-container {
    z-index: 10000 !important;
}

.mud-radio-only {
    margin-bottom: auto;
    margin-top: auto;
    margin-right: 0 !important;
    padding-right: 0 !important;
}

.pdf-dialog {
    padding: 0px 15px !important;
}

.crud-btn {
    margin-right: 0.5rem !important;
}

.info-button {
    padding: 3px 3px 3px 0 !important;
    font-size: 1.125rem;
}

/* The GeoBlazor free-license attribution ("GeoBlazor by dymaptic") is merged into the basemap attribution
   footer (.esri-attribution__sources) as plain text by setupMapAttribution() — so hide the separate dark
   badge. The free-license requirement is still satisfied: the credit stays visible, in the footer. */
.dymaptic-branding {
    display: none !important;
}

/* ======= MudBlazor Input Labels ======= */
.mud-shrink ~ label.mud-input-label.mud-input-label-inputcontrol,
.mud-input:focus-within ~ label.mud-input-label.mud-input-label-inputcontrol {
    padding-left: 30px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.label-without-info-btn label {
    padding-left: unset !important;
}

/* ======= Tab Contents ======= */
.ecomender-tab-content {
    overflow-y: auto;
    overflow-x: hidden;
}

/* Heights re-anchored to --page-chrome-height: the old literals were tuned for the 120px chrome (with the
   breadcrumb bar). 100vh-N → 100vh - var - (N-120); 50vh-N → 50vh - var/2 - (N-60). Tune the variable, not these. */
.full-height-tab-content {
    height: calc(100vh - var(--page-chrome-height) - 60px);
}

.full-height-tab-content-with-button {
    height: calc(100vh - var(--page-chrome-height) - 114px);
}

.half-height-tab-content {
    height: calc(50vh - (var(--page-chrome-height) / 2) - 55px);
}

.half-height-tab-content-with-button {
    height: calc(50vh - (var(--page-chrome-height) / 2) - 105px);
}

/* ======= Results Animation ======= */
.results-section-visible {
    transform: scaleY(1);
    transform-origin: top;
    transition: transform 0.5s ease;
}

.results-section-hidden {
    height: 0px;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.26s ease;
}

.no-overflow {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ======= Grid Related ======= */
    .general-ecomender-grid td {
        height: 45px;
        box-sizing: border-box;
        max-width: 250px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.grid-in-tab {
    padding: 0px 12px;
}

.ecomender-grid-footer-row {
    height: 55px;
}

.ecomender-grid-content-row {
    height: 34px;
}

.ecomender-grid-footer-td {
    font-weight: bold !important;
    border-right: 1px solid var(--mud-palette-table-lines);
    border-top: 1px solid var(--mud-palette-table-lines);
}

.summary-grid-radio-head-row span {
    padding: 0px;
}

.mud-table-head .header-centered th {
    text-align: center;
    font-size: 1.1em;
}

th[style*="text-align:center"] .mud-table-sort-label,
th[style*="text-align: center"] .mud-table-sort-label {
    justify-content: center;
    position: relative;
}

th[style*="text-align:center"] .mud-table-sort-label-icon,
th[style*="text-align: center"] .mud-table-sort-label-icon {
    position: absolute;
    right: -1.5rem;
}

.radio-centered-th {
    text-align: center !important;
    vertical-align: middle !important;
}

    .radio-centered-th .mud-radio {
        display: flex;
        justify-content: center;
        align-items: center;
    }

.checkbox-centered-td {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 0 !important;
}

    .checkbox-centered-td .mud-input-control-boolean-input {
        padding-left: 0 !important;
    }

    .checkbox-centered-td .mud-checkbox {
        display: flex;
        justify-content: center;
        align-items: center;
    }

.summary-table {
    overflow-x: auto;
}

/* The summary tab's card renders flush, like the result grids in the tabs beside it: its 8px of
   padding used to step the content in when a reader switched tabs (PO 2026-09-26). The MudGrid
   inside cancels its own gutter at the edges, so zero here IS flush. ResultTabInsetTests pins it. */
.result-summary-paper {
    padding: 0;
}

.ecomender-cell-container div {
    display: inline;
    width: inherit !important;
}

/* ======= Selected and highlighted table rows (#595) =======
   One rule for every table. A selected row takes the primary colour (the tertiary one inside a structure's parts, which
   sit on a primary frame), a highlighted row the primary's light tint. The row names its background and the foreground
   that reads on it, from the palette in force: white on the light theme's dark teal, near-black on the dark theme's
   light one. White was written here before, and read at 2.45:1 in the dark theme.

   Everything a cell holds takes that foreground: its text, and every checkbox, radio, switch, icon button, icon, chip,
   link, input, select, button and progress indicator. Each of them used to keep its own colour - grey, or primary on
   primary - and could not be told from the row (PO 2026-11-12, the scenarios page). MudBlazor gives them colour
   classes, most of them !important and loaded after this file, hence the !important and the .mud-table-row/.mud-table-cell
   specificity here. What carries a colour of its own on a fill of its own keeps it: a coloured chip, and a filled button
   or a fab, which is inverted.

   Checked, unchecked and disabled stay apart: a checkbox and a radio by their glyphs, a switch by its thumb's side and
   its track (filled when on, an outline when off), a disabled control by the muted foreground - 65 % of the foreground
   over the row, still 3:1 on every row class in both themes. The tokens are checked against both palettes by
   SelectedRowContrastGuardTests (App.Tests) and the rendered controls by SelectedRowContrastTests (E2E). */
.selected-row {
    --row-bg: var(--mud-palette-primary);
    --row-fg: var(--mud-palette-primary-text);
}

.structure-row-details .selected-row {
    --row-bg: var(--mud-palette-tertiary-darken);
    --row-fg: var(--mud-palette-tertiary-text);
}

/* The primary's light tint is light in both themes: its foreground is the palette's black in both. */
.highlighted-row {
    --row-bg: var(--mud-palette-primary-lighten);
    --row-fg: var(--mud-palette-black);
}

:is(.selected-row, .highlighted-row) {
    --row-fg-muted: color-mix(in srgb, var(--row-fg) 65%, var(--row-bg));
    background-color: var(--row-bg) !important;
}

    :is(.selected-row, .highlighted-row) > td,
    .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell :not(:where(
        .mud-chip-filled:not(.mud-chip-color-default), .mud-chip-filled:not(.mud-chip-color-default) *,
        .mud-button-filled, .mud-button-filled *, .mud-fab, .mud-fab *)) {
        color: var(--row-fg) !important;
        --mud-ripple-color: var(--row-fg) !important;
    }

    .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell :is(.mud-disabled, .mud-switch-disabled, :disabled),
    .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell :is(.mud-disabled, .mud-switch-disabled, :disabled) * {
        color: var(--row-fg-muted) !important;
    }

    /* A hover or focus ring in the row's foreground, not a primary one that is the row itself */
    .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell :is(.mud-icon-button, .mud-switch-base, .mud-button-text, .mud-button-outlined):is(:hover, :focus-visible) {
        background-color: color-mix(in srgb, var(--row-fg) 14%, transparent) !important;
    }

    /* Switch: the thumb paints its base's colour, the foreground. The track is filled when on and an outline when off. */
    .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell .mud-switch-track {
        opacity: 1 !important;
        background-color: transparent !important;
        box-shadow: inset 0 0 0 2px var(--row-fg-muted);
    }

    .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell .mud-switch-base.mud-checked + .mud-switch-track {
        background-color: var(--row-fg-muted) !important;
        box-shadow: none;
    }

    .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell .mud-switch-base.mud-switch-disabled + .mud-switch-track {
        opacity: .5 !important;
    }

    /* Chips: one of its own colour keeps it and gets an edge in the foreground; the default, outlined and text chips are
       drawn in the foreground, as an outline. */
    .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell .mud-chip:is(.mud-chip-color-default, .mud-chip-outlined, .mud-chip-text) {
        background-color: transparent !important;
        border-color: transparent !important;
        outline: 1px solid var(--row-fg) !important;
        outline-offset: -1px;
    }

    .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell .mud-chip-filled:not(.mud-chip-color-default) {
        outline: 1px solid var(--row-fg) !important;
        outline-offset: 1px;
    }

    /* A filled button (or a fab) is inverted: the foreground's fill, the row's colour on it */
    .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell :is(.mud-button-filled, .mud-fab) {
        background-color: var(--row-fg) !important;
        color: var(--row-bg) !important;
        --mud-ripple-color: var(--row-bg) !important;
    }

        .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell :is(.mud-button-filled, .mud-fab) * {
            color: inherit !important;
        }

        .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell :is(.mud-button-filled, .mud-fab):disabled {
            background-color: transparent !important;
            color: var(--row-fg-muted) !important;
            box-shadow: inset 0 0 0 1px var(--row-fg-muted) !important;
        }

    .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell .mud-button-outlined {
        border-color: var(--row-fg) !important;
    }

    /* A link stays a link without its colour */
    .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell :is(a[href], .mud-link) {
        text-decoration: underline;
    }

    /* Inputs and selects: the outline or underline in the foreground, muted when disabled */
    .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell .mud-input-outlined-border {
        border-color: var(--row-fg) !important;
    }

    .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell .mud-input-underline::before,
    .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell .mud-input-underline::after {
        border-bottom-color: var(--row-fg) !important;
    }

    .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell .mud-input.mud-disabled :is(.mud-input-outlined-border),
    .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell .mud-input-underline.mud-disabled::before {
        border-color: var(--row-fg-muted) !important;
    }

    .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell .mud-input-root::placeholder {
        color: var(--row-fg-muted) !important;
        opacity: 1;
    }

    /* Progress: the bar in the foreground on a rail of it */
    .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell .mud-progress-linear {
        background-color: color-mix(in srgb, var(--row-fg) 30%, transparent) !important;
    }

    .mud-table-row:is(.selected-row, .highlighted-row) > .mud-table-cell .mud-progress-linear-bar {
        background-color: var(--row-fg) !important;
    }

/* ======= Loader (Outside Blazor) ======= */
.loader-x-container {
    margin: 0;
    padding: 0;
    height: calc(100vh);
    background: var(--mud-palette-dark);
}

.loader-inner-1-container {
    position: absolute;
    top: 50%;
    width: 100%;
    text-align: center;
}

.loader-inner-2-container {
    color: antiquewhite;
}

.loader-column-2 {
    text-align: left;
}

.one, .two, .three {
    opacity: 0;
    animation: dot 1.3s infinite;
}

.one {
    animation-delay: 0.0s;
}

.two {
    animation-delay: 0.2s;
}

.three {
    animation-delay: 0.3s;
}

@keyframes dot {
    0%, 50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* ======= No Padding MudList ======= */
.no-padding-mud-list {
    padding: 0 !important;
}

    .no-padding-mud-list > .mud-list-item {
        padding: 0 !important;
    }

        .no-padding-mud-list > .mud-list-item.mud-list.mud-list-padding {
            padding-top: 0 !important;
            padding-bottom: 0 !important;
        }

/* ======= MudTabs ======= */
.mud-tab {
    font-size: 0.85rem;
}

/* The LCC settings dialog's tab panels contain a MudGrid whose negative top margin (grid spacing), together
   with the panels container's visible overflow, pushed the panel content up ~24px OVER the tab-header row,
   leaving the lower half of the tab headers unclickable (real UX bug; also blocked automated tab switching).
   Shift the panels down so the grid box no longer overflows above the tab row. */
.lcc-dialog .mud-tabs-panels {
    margin-top: 24px;
}

/* The project and building settings dialogs' tab panel (#452, PO 2026-11-10): one height on every tab, so the dialog
   does not jump and move its buttons when the tab changes. 520px holds the tallest usual tab, the building's basics
   (496px measured); the viewport caps it as before, and a longer tab scrolls inside the panel.
   The panel spans the dialog from edge to edge (#594, #598: its dialog takes the content's side padding away), so its
   scrollbar sits at the dialog's right edge; its own side padding is the content's 24px, given back inside it. That also
   keeps the fields' info buttons whole: each sits 3px left of its field (.ecomender-info-btn-container), and the hidden
   horizontal overflow cut that edge off every field at the panel's left side (PO 2026-11-10). The gutter is reserved,
   so the fields stay put when a tab's scrollbar comes and goes.
   Gates: Tests/Layout/SettingsDialogHeightTests, InfoButtonsAreWholeTests, DialogScrollbarAtRightEdgeTests. */
.settings-dialog-panel {
    height: min(520px, calc(100vh - 300px));
    overflow-y: auto;
    overflow-x: hidden;
    padding-inline: 24px;
    scrollbar-gutter: stable;
}

/* ======= Dialog content from edge to edge (#594, #598; PO 2026-11-12) ======= */
/* MudBlazor pads a dialog's content 24px at the sides. A scroll container inside that padding showed its scrollbar 24px
   in from the dialog's right edge, with the fields running up to the scrollbar; a tab component's frame sat 24px in from
   both edges. Such a dialog takes the side padding away from its content (ContentClass="dialog-edge"; CRUDReusableDialog
   does it for every CRUD dialog) and gives it back inside:
   - its scroll container (.dialog-scroll) pads its content 24px, so its scrollbar sits at the dialog's right edge and
     the fields keep their distance from the edges and from the scrollbar (#598). The gutter is reserved: the fields
     stay where they are whether a scrollbar shows or not;
   - a tab component spans the dialog, so the scroll container in its panels does too, and its panels keep the padding
     (#594): .dialog-tab-panels, the settings dialogs' .settings-dialog-panel, or a tab's own MudContainer. Its tab row
     keeps the content's inset (.dialog-tabs, PO 2026-11-15), so the tab row and the fields start at the same x;
   - anything else beside the tabs (a notice, a refusal) takes .dialog-gutter.
   (.mud-dialog .mud-dialog-content.dialog-edge outranks MudBlazor's .mud-dialog .mud-dialog-content, which loads later.)
   Gates: Tests/Layout/DialogScrollbarAtRightEdgeTests, DialogTabRowTests; App.Tests Guards/DialogEdgeGuardTests. */
.mud-dialog .mud-dialog-content.dialog-edge {
    padding-inline: 0;
}

.dialog-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    padding-inline: 24px;
    scrollbar-gutter: stable;
}

/* A scroll container whose content is a tab component (the scenario and the admin user dialogs, CRUDReusableDialog's
   EdgeToEdge): the tab component spans it, so no side padding and no reserved gutter; the tab panels pad the fields, and
   the tab row keeps the same inset (.dialog-tabs). */
.dialog-scroll.dialog-scroll--flush {
    padding-inline: 0;
    scrollbar-gutter: auto;
}

/* The panels pad the fields at the sides as the tab row is inset, and at the top as the other tab dialogs' panels do
   (the scenario dialog's py-4, the settings' pt-4; PO 2026-11-15): the first field sits 22px below the tab row. */
.dialog-tab-panels {
    padding-inline: 24px;
    padding-top: 16px;
}

/* A dialog's tab row does not reach its edges (PO 2026-11-15): it keeps the content's 24px inset, the fields below start
   at the same x, and the line under it (Border) spans the row. The panels below it still span the dialog, so a tab's
   scrollbar sits at the dialog's right edge. Only the dialog's own tab row: a tab component inside a tab keeps its place. */
.dialog-tabs > .mud-tabs-tabbar {
    margin-inline: 24px;
}

/* The tab row stays above its panels. A panel's first MudGrid row reaches 24px up into the tab row (the grid's negative
   top margin, which its items' top padding gives back), and the panels come later in the page, so the items' empty top
   took the clicks meant for the lower half of every tab, its middle included: the admin user dialog's "Lisenssit" could
   not be clicked (#594). MudBlazor positions the tab row (position: relative), so a z-index lifts it. */
.dialog-edge .mud-tabs-tabbar {
    z-index: 1;
}

.dialog-edge .dialog-gutter {
    margin-inline: 24px;
}

/* The product selector of a CRUD dialog (#586, PO 2026-11-12: item-level product selectors are uniform): the first row of
   the content, above the fields it drives, so the title keeps one line. Where the selector shows nothing (no products to
   pick from), its row takes no room. */
.crud-product-source:not(:has(*)) {
    display: none;
}

/* ======= Brand utility classes ======= */
.font-bold       { font-weight: var(--typography-fontWeight-bold); }
.font-heading    { font-family: var(--typography-fontFamily-heading); }
.text-2xl        { font-size: var(--typography-fontSize-h3); line-height: 2rem; }
.whitespace-nowrap { white-space: nowrap; }
.self-center     { align-self: center; }
.h-8             { height: 2rem; }
.flex            { display: flex; }
.items-center    { align-items: center; }
.mr-3            { margin-right: 0.75rem; }

/* ======= Split Page Layout ======= */
/* THE single height knob. Every full-height page derives its height from this; hardcoded calcs are
   re-anchored to it (calc(100vh - var(--page-chrome-height) - inPagePx)), so tuning this one value
   aligns every page at once. The breadcrumb trail now lives inside the AppBar (no separate bar).
   Budget: AppBar (48px dense) + content top breathing room (pt-1 = 4px) + bottom padding (pb-1 = 4px). */
:root {
    --page-chrome-height: 56px;

    /* How far a split page's content sits from its edge. TWO numbers, because a table and a button want
       different things (PO 2026-09-27): a table's cells carry their own padding, so a table reads as clean
       at the very edge and gains the width, while a heading or a button standing alone at the edge reads as
       though it fell off. Chrome takes the larger inset; tables pull back out to the smaller one. */
    --page-content-inset: 8px;
    --page-table-inset: 2px;

    /* The space on EACH side of a breadcrumb chevron, anywhere in the appbar. One number, because the bar
       renders its segments from two places — the context chain's own chips and MudBlazor's breadcrumb list
       — and a reader sees one row: chain gaps of 3px beside trail gaps of 13px read as a break in the chain
       (measured 2026-09-28). The separator owns ALL of it, so nothing else may add margin or padding beside
       a chevron; BreadcrumbSeparatorUniformityTests measures from the glyph and fails if anything does.
       The value is the page trail's own, which is the spacing this was uniformed TO (PO 2026-09-28). */
    --crumb-gap: 12px;
}

/* Breadcrumb trail hosted inside the dense, colour-filled AppBar — strip its default block
   padding/margins so it sits on the toolbar baseline, keep it on one line, and inherit the
   AppBar's text colour (its default link/typography colours are illegible on the bar). */
/* Direction A chrome: the app bar is white on a white/grey page, so a 2px brand-gold rule replaces the
   shadow as its edge — the one place the untouched gold remains in the logged-in chrome. */
#mainappbar { border-bottom: 2px solid var(--color-gold-base, #CDBC6B); }

/* Brand marks in the app bar (colour review 2026-09-11, option F): the logomark at the far end of the bar in
   the logo's own brand gold in every theme, and a three-leaf sprig before the theme toggle as a CSS mask in
   the Tertiary slot so it follows the palette. */
#mainappbar .appbar-brandmark { width: 26px; height: 20px; margin: 0 2px 0 16px; flex: none; border: 0; padding: 0; cursor: pointer;
    background: url('/_content/EcoMender.App/img/logo.svg') center / contain no-repeat; /* the logo in its own gold, never re-coloured by the palette */ }
#mainappbar .appbar-sprig { width: 66px; align-self: stretch; margin-right: 14px; flex: none; opacity: .32; background: var(--mud-palette-tertiary);
    -webkit-mask: url('/_content/EcoMender.App/img/monumend-leaf-sprig.svg') center / auto 110% no-repeat; mask: url('/_content/EcoMender.App/img/monumend-leaf-sprig.svg') center / auto 110% no-repeat; }
@media (max-width: 900px) { #mainappbar .appbar-sprig { display: none; } }
/* The bell's unread count sits on the bell (2026-10-15). MudBadge's overlap puts the count's lower edge 12px into the
   button, so most of it sat above the button - and the bar's buttons reach the top of the viewport, which cut it. From
   the left, the count starts 22px in from the button's right edge: on the bell's upper right, not over the next button. */
#mainappbar .notifications-bell .mud-badge.mud-badge-top.right.mud-badge-overlap { inset: auto auto calc(100% - 24px) calc(100% - 22px); }

.appbar-breadcrumbs .mud-breadcrumbs { padding: 0; margin: 0; flex-wrap: nowrap; }
.appbar-breadcrumbs .mud-breadcrumb-item { white-space: nowrap; }
.appbar-breadcrumbs .mud-breadcrumb-item a,
.appbar-breadcrumbs .mud-breadcrumb-item .mud-typography,
.appbar-breadcrumbs .mud-breadcrumbs .mud-icon-root { color: inherit; }
/* The trail's crumbs are PILLS now (rule 6), so they answer the pointer the way the chain's chips do — with
   the chip's own hover background. An underline on top of that would be a second hover affordance, and the
   chain's root chip already had to turn one off for being a link. */
#mainappbar .page-crumb-chip { cursor: pointer; text-decoration: none; }
#mainappbar .page-crumb-chip:hover { text-decoration: none; }

/* The context chain's separator (LoggedInLayout: Project › lot › Building › Round › page trail).
   Each segment renders its own LEADING chevron, so a segment that cannot render takes its
   separator with it and never leaves a dangling one behind. */
#mainappbar .crumb-sep { flex: none; opacity: .45; padding: 0 var(--crumb-gap); user-select: none; }
/* MudBlazor pads its own separator li (12px a side in 9.9.0), which would land ON TOP of the chevron's
   own padding and make the trail's gaps double the chain's. The separator inside it carries the number. */
.appbar-breadcrumbs .mud-breadcrumb-separator { padding: 0; }

/* EVERY segment of the row, in one place. No side margins: the chevron beside a segment owns the gap
   (--crumb-gap), and a segment's own margin would add to it on one side only — which is exactly how the
   chain drifted from the trail. The lot pill, the building switcher and the round menu each declared
   'margin: 0 2px' in their own <style> block; spacing that belongs to the ROW cannot be restated by three
   components, so they now declare shape only and the bar spaces them. */
#mainappbar .projects-root-chip,
#mainappbar .project-crumb-chip,
#mainappbar .lot-crumb-pill,
#mainappbar .bcs-chip,
#mainappbar .rcm-chip,
#mainappbar .page-crumb-chip { margin: 0; }

/* The chain's own chips share one geometry; the root is a LINK, so it also has to stop looking
   like one (the bar supplies its own colour). */
#mainappbar .projects-root-chip,
#mainappbar .project-crumb-chip { cursor: pointer; }
#mainappbar .projects-root-chip { text-decoration: none; }

/* The legacy calculation engine, as a badge on the project's own name rather than a chip floating
   after the page trail. A fact, not a button: the convert ACTION lives in the project menu. */
.project-crumb-legacy {
    margin-left: 6px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: .72em;
    line-height: 1.5;
    border: 1px solid currentColor;
    opacity: .75;
}
.project-crumb-legacy-note { padding: 2px 16px 8px; max-width: 320px; opacity: .8; }

/* ======= FabDock (Shared/Dock/FabDock.razor) =======
   Reusable top-corner FAB dock: a row of FAB toggles + one animated reveal surface. Global (not scoped)
   so it reaches the MudPaper/MudFab the component wraps. Width via the --fab-dock-width custom property. */
.fab-dock {
    position: absolute;
    top: 8px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: calc(100vw - 16px);
    pointer-events: none;
}
.fab-dock--top-right { right: 8px; align-items: flex-end; }
.fab-dock--top-left  { left: 8px;  align-items: flex-start; }

.fab-dock__fabs { display: flex; flex-direction: row; gap: 8px; pointer-events: auto; }

/* Closed: width 0 (clipped). Open: animate width so the inner card is revealed; the inner is pinned to the
   dock's anchored edge so that edge stays put as the width grows. */
.fab-dock__surface {
    pointer-events: auto;
    width: 0;
    opacity: 0;
    overflow: hidden;
    border-radius: 12px;
    display: flex;
    max-width: calc(100vw - 16px);
    transition: width .28s ease, opacity .2s ease;
}
.fab-dock--top-right .fab-dock__surface { justify-content: flex-end; }
.fab-dock--top-left  .fab-dock__surface { justify-content: flex-start; }
.fab-dock__surface--open { width: min(var(--fab-dock-width, 360px), calc(100vw - 16px)); opacity: 1; }

/* Fixed-width inner so content doesn't reflow during the reveal; height bounded with internal scroll. */
.fab-dock__inner {
    width: min(var(--fab-dock-width, 360px), calc(100vw - 16px));
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--page-chrome-height) - 84px);
}
.fab-dock__header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 6px 8px 6px 14px;
    border-bottom: 1px solid var(--mud-palette-divider);
}
.fab-dock__body { min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 12px; }


.split-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--page-chrome-height));
    overflow: hidden;
    position: relative;
}

.split-page__inputs {
    flex: 1 1 50%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: flex 0.3s ease;
}

.split-page__inputs--full {
    flex: 1 1 100%;
}

/* Both halves start their content at the same x. The input half's toolbar carried MudBlazor's own
   16px while the result half's chrome sat flush at 0, so a reader's eye stepped sideways when it
   crossed the divider (PO 2026-09-26). 8px on each half, and the table toolbars inside give up
   their own, so toolbar and table begin together. SectionContentAlignmentTests pins it. */
/* WHERE A SPLIT PAGE'S CONTENT SITS, and it is two numbers (PO 2026-09-27): a table's cells carry their own
   padding, so a table reads as clean at the very edge and gains the width a page of figures wants, while a
   heading or a button standing alone there reads as though it fell off.

   The SECTION takes the table inset and the CHROME indents itself to the content inset. That is the reverse
   of the obvious arrangement — section at the content inset, tables pulled out by a negative margin — and it
   is the only one that works: the result half's tab panels clip their overflow, so a table pulled outside
   them simply lost its left border and looked offset, which is how it was reported. Nothing is pulled
   outside anything now, so nothing can be clipped. */
.split-page__inputs,
.split-page__results-inner {
    padding-left: var(--page-table-inset);
    padding-right: var(--page-table-inset);
}

/* A framed scroll container's declared height must INCLUDE its frame. Height is set on these containers in
   pixels, and with content-box sizing the 1px border lands outside that height — so the box overflowed its
   clipping parent by exactly 1px and the bottom of the frame was cut off, on every page whose grid fills its
   panel (2026-09-27). border-box makes the number mean what it says. */
.split-page__inputs .mud-table-container,
.split-page__results-inner .mud-table-container {
    box-sizing: border-box;
}

/* The chrome: the input half's toolbar and pager, the result half's tab strip. Each indents itself by the
   difference, so a button lands on the content inset while the table beside it keeps the page's width. */
.split-page__inputs .mud-table-toolbar,
.split-page__inputs .mud-table-pagination,
.split-page__results-inner .mud-tabs-toolbar {
    padding-left: calc(var(--page-content-inset) - var(--page-table-inset));
    padding-right: calc(var(--page-content-inset) - var(--page-table-inset));
}

/* A summary card's heading is chrome too, and it moves by MARGIN: padding would shift the text inside the
   box and leave the box where it was, so the heading only looked indented. Scoped to the card's first
   column, which is the one that lines up with the page; a heading in the second column lines up with its
   own column instead. */
.result-summary-paper .mud-grid-item:first-of-type .mud-typography-h6 {
    margin-left: calc(var(--page-content-inset) - var(--page-table-inset));
}

/* The summary card is SQUARE, because the table's frame sits flush on its edge and the card clips its
   content: 4px of rounding cut the corners off a square frame. Not the elevation — a box-shadow paints
   outside the box and cannot cover a border inside it (measured 2026-09-27). Rule 5 already made these
   tables square; the surface they sit on has to agree. */
.split-page__results-inner .result-summary-paper {
    /* TWO classes, because MudBlazor's own .mud-paper rule is one and its stylesheet loads after this file:
       an equal-specificity rule loses to it silently, which is what happened the first time. */
    border-radius: 0;
}

/* Input form card: content-sized with button following content */
.input-form-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.input-form-card > .mud-card-content {
    flex: 1 1 0;
    min-height: 0;
    overflow-x: auto;
}

.input-form-card > .mud-card-actions {
    margin-top: auto;
    transition: padding-left 0.3s ease;
}

/* Offset card actions when the floating toggle FAB overlaps */
.split-page--results-hidden .input-form-card > .mud-card-actions {
    padding-left: 56px;
}

.split-page__results {
    flex: 1 1 50%;
    min-height: 0;
    overflow: hidden;
    transition: flex 0.3s ease, opacity 0.3s ease;
}

.split-page__results--hidden {
    flex: 0 0 0;
    opacity: 0;
    pointer-events: none;
}

/* ResultsToggleFab: container removed from flex flow. The 6px centres the 40px toggle on the
   52px bottom row it sits on — the card's action row on a form page, the pager on a grid page:
   the container's bottom edge coincides with that row's, so (52 - 40) / 2 = 6. Measured, and
   pinned by ResultsToggleAlignmentTests (8px sat 2px high, 4px sat 2px low). */
.split-page__toggle-container {
    position: absolute;
    bottom: 6px;
    left: 8px;
    z-index: 1100;
    pointer-events: none;
}

.split-page__toggle-container > * {
    pointer-events: auto;
}

/* MudTable that fills its parent container via flex */
.mud-table.fill-height-table {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mud-table.fill-height-table > .mud-table-container {
    flex: 1 1 0;
    min-height: 0;
    overflow: auto;
}

/* MudTabs that fills the viewport minus page chrome */
.fill-height-tabs {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--page-chrome-height));
}

.fill-height-tabs > .mud-tabs-panels {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

.fill-height-tabs .split-page {
    height: 100%;
}

/* MudTabs panels that fill their container height (for nested tabs inside cards). TabPanelsClass puts the class on the
   panels box, and a tab taller than its room scrolls in it: not in its panel, which MudBlazor renders as display:
   contents, so a rule on the panel reaches nothing, and the tab was cut off with no scrollbar (#496). A tab that fills
   its room exactly (a grid page, height: 100%) resolves its height against this box and so never scrolls it. */
.fill-height-tab-panel {
    flex: 1 1 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

/* The profile page (#487, #495): a page of tabs like the structures page. .fill-height-tabs gives the tabs exactly the
   page's height, and neither they nor the tab strip ever scroll. Every tab scrolls in the panels box under the strip:
   not in its panel, which MudBlazor renders as display: contents, so a rule on it reaches nothing (#496). Content takes
   the other tab pages' insets: 8 px down from the strip (pt-2), and each tab's own px-2 (--page-content-inset). */
.fill-height-tabs.profile-tabs > .mud-tabs-panels {
    overflow-y: auto;
    padding-top: 8px;
}

/* Lisenssit's table fills the room under the strip, by the chain the result summaries use (see
   .result-summary-paper .mud-table): the table root is a full-height column, whose height resolves against the panels
   box since the panel has no box, and its scroll box flexes inside it. So the table needs no viewport calculation of
   its own. It sits at --page-table-inset and its toolbar indents itself to --page-content-inset, as on a split page's
   input half. One pixel of bottom padding keeps its bottom frame off the clip edge. Scoped to the profile: the admin's
   licence view keeps its fixed height. */
.profile-tabs > .mud-tabs-panels > .mud-tab-panel > .mud-table {
    height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0 var(--page-table-inset);
    padding-bottom: 1px;
}

.profile-tabs > .mud-tabs-panels > .mud-tab-panel > .mud-table > .mud-table-container {
    flex: 1 1 auto;
    min-height: 0;
}

.profile-tabs > .mud-tabs-panels > .mud-tab-panel > .mud-table > .mud-table-toolbar {
    padding-left: calc(var(--page-content-inset) - var(--page-table-inset));
    padding-right: calc(var(--page-content-inset) - var(--page-table-inset));
}

/* ResultsToggleFab: floating at bottom-left of split-page when results are hidden */
.results-toggle-fab--floating {
}

/* ResultsToggleFab: inline in tab header toolbar */
.results-toggle-fab--inline {
    align-self: center;
    margin: 0 4px 0 0;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
}

.split-page__results-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Toolbar row hosting the result-set selector on pages that have no tab strip
   (every tab there was a family duplicate). It has to occupy exactly what MudTabs
   did above the grid, because those pages' grid heights are calc()s with a hardcoded
   constant: the 48px tabs toolbar plus the 8px the panels' pt-2 added. */
.result-family-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    margin-bottom: 8px;
    padding: 0 8px;
}

/* Result-set swap cue: a subtle fade-in replayed when the result-family selector
   changes, so it is visible that the whole result section now shows another
   calculation. Two identical animations under different names because a CSS
   animation only restarts when the animation-name changes. */
@keyframes results-family-swap-a {
    from { opacity: 0.3; transform: translateY(3px); }
    to { opacity: 1; transform: none; }
}

@keyframes results-family-swap-b {
    from { opacity: 0.3; transform: translateY(3px); }
    to { opacity: 1; transform: none; }
}

.results-family-swap--a {
    animation: results-family-swap-a 260ms ease-out;
}

.results-family-swap--b {
    animation: results-family-swap-b 260ms ease-out;
}

/* Building switch cue (PO 2026-10-26): the same fade on the page a building switch re-creates (the drawer's summary
   card replays the results swap itself). The page fades without the rise: nothing between a page and <html> may carry
   a transform, which would catch the floating table toolbar's position: fixed. The page's box is new after each switch,
   so the animation plays once, on insertion. */
@keyframes building-swap-page {
    from { opacity: 0.3; }
    to { opacity: 1; }
}

.building-swap-page {
    animation: building-swap-page 260ms ease-out;
}

/* A derived ("mirror") building's pages (PO 2026-10-26): its disclaimer row heads them. The row is in the page's own
   budget - the page chrome grows by its 36px and the 4px under it - so the pages, which size themselves to
   calc(100vh - var(--page-chrome-height)), shrink by it and the body still never scrolls. One line: the full text is
   in the row's hover card. */
.building-page--read-only {
    --page-chrome-height: 96px;
}

/* A real standing building without its VTJ-PRT (#364): its identity row heads its pages in the same budget */
.building-page--notice {
    --page-chrome-height: 96px;
}

.mirror-notice.identity-notice {
    border-left-color: var(--mud-palette-warning);
    background: color-mix(in srgb, var(--mud-palette-warning) 10%, var(--mud-palette-surface));
}

.mirror-notice.identity-notice > .mud-icon-root {
    color: var(--mud-palette-warning);
}

.mirror-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    margin-bottom: 4px;
    padding: 0 8px 0 12px;
    border-radius: var(--mud-default-borderradius);
    border-left: 3px solid var(--mud-palette-info);
    /* A tint of the info colour over the surface, so the text and the action keep their contrast in both themes */
    background: color-mix(in srgb, var(--mud-palette-info) 10%, var(--mud-palette-surface));
    color: var(--mud-palette-text-primary);
    overflow: hidden;
}

.mirror-notice > .mud-icon-root {
    flex: none;
    color: var(--mud-palette-info);
}

.mirror-notice__text {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
}

.mirror-notice > :nth-child(2) {
    flex: 1 1 auto;
    min-width: 0;
}

.mirror-notice__action {
    flex: none;
}

@media (prefers-reduced-motion: reduce) {
    .results-family-swap--a,
    .results-family-swap--b,
    .building-swap-page {
        animation: none;
    }
}

.split-page__results-inner .mud-tabs {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.split-page__results-inner .mud-tabs > .mud-tabs-toolbar {
    flex-shrink: 0;
}

.split-page__results-inner .mud-tabs-panels {
    flex: 1;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.split-page__results-inner .mud-tabpanel {
    flex: 1;
    min-height: 0;
    min-width: 0;
    padding: 0;
}

.split-page__results-inner .mud-tabpanel > .mud-paper {
    height: 100%;
}
.fill-container-height {
    height: 100%;
}

/* ======= EcoMender Result Grid: Sticky Multi-Row Headers ======= */
/*
 * MudTable with CustomHeader + FixedHeader needs explicit sticky positioning
 * and overflow-y on the container for the scroll boundary.
 * Selectors must match MudBlazor's specificity (.mud-table-sticky-header).
 */
.ecomender-result-grid .mud-table-container {
    overflow-y: auto;
}

/* border-collapse:separate is required for sticky headers to keep their borders.
   border-spacing:0 prevents gaps. Each cell draws only bottom + right borders,
   with first-child/first-row handling the outer left/top edges. */
.ecomender-result-grid .mud-table-root {
    border-collapse: separate;
    border-spacing: 0;
}

/* Phantom spacer row absorbs leftover height so tfoot stays at the bottom
   even when data rows don't fill the container. Real rows keep natural height. */
.ecomender-result-grid .mud-table-root {
    min-height: 100%;
    /* On a wide screen the columns stretch to the width instead of leaving the right third empty
       (PO 2026-09-26/27). BOTH width and min-width: min-width alone left the heat-loss table 416px short of
       its container, because a table with column widths of its own settles at its content's width and a
       minimum it already satisfies changes nothing. width:100% makes it fill and hands the slack to the
       columns that can take it — the type column, which is the one with words in it. min-width stays so a
       table needing MORE than the container still grows past it and scrolls, exactly as before.

       This is also what puts the export button back over its own table: the button sits at the right edge of
       the scroll container, which used to be far right of a short table (PO 2026-09-27). A table that fills
       its container puts the two edges in the same place. */
    min-width: 100%;
}

.ecomender-result-grid .mud-table-body::after {
    content: '';
    display: table-row;
    height: 100%;
}

.ecomender-result-grid .mud-table-root th,
.ecomender-result-grid .mud-table-root td {
    border: none;
    border-bottom: 1px solid var(--mud-palette-lines-default, rgba(0,0,0,0.12));
    border-right: 1px solid var(--mud-palette-lines-default, rgba(0,0,0,0.12));
}

/* The outer frame belongs to the scroll container, not to the edge cells: a table stretched to its
   container's width puts the last column's border exactly on the scroll edge, where it is clipped
   and the main border simply is not there (PO 2026-09-26). Square, because the theme's paper
   rounding would curve only these tables. The cells keep drawing the inner grid. */
.ecomender-result-grid .mud-table-container,
.general-ecomender-grid .mud-table-container {
    border: 1px solid var(--mud-palette-lines-default, rgba(0,0,0,0.12));
    border-radius: 0;
}

/* The input grids draw the same inner grid as the result grids: the two halves sit one above the
   other in the same column, and drew different lines (PO 2026-09-26). */
.general-ecomender-grid .mud-table-root th,
.general-ecomender-grid .mud-table-root td {
    border: none;
    border-bottom: 1px solid var(--mud-palette-lines-default, rgba(0,0,0,0.12));
    border-right: 1px solid var(--mud-palette-lines-default, rgba(0,0,0,0.12));
}

.ecomender-result-grid .mud-table-head tr:first-child th {
    border-top: 1px solid var(--mud-palette-lines-default, rgba(0,0,0,0.12));
}

/* Header rows after the first draw their own top border (survives sticky overlap).
   The preceding row's border-bottom is removed to avoid doubling. */
.ecomender-result-grid .mud-table-head tr:has(+ tr) th {
    border-bottom: none;
}

.ecomender-result-grid .mud-table-head tr:nth-child(n+2) th {
    border-top: 1px solid var(--mud-palette-lines-default, rgba(0,0,0,0.12));
}

.mud-table-sticky-header.ecomender-result-grid .mud-table-container .mud-table-head th {
    position: sticky;
    z-index: 2;
    background: var(--mud-palette-surface);
}

.mud-table-sticky-header.ecomender-result-grid .mud-table-container .mud-table-head tr:first-child th {
    top: 0;
}

.mud-table-sticky-header.ecomender-result-grid .mud-table-container .mud-table-head tr:nth-child(2) th {
    top: 34px;
}

.mud-table-sticky-header.ecomender-result-grid .mud-table-container .mud-table-head tr:nth-child(3) th {
    top: 68px;
}

/* Footer border handling (border-collapse:separate) */
.ecomender-result-grid .mud-table-foot td {
    border-top: 1px solid var(--mud-palette-lines-default, rgba(0,0,0,0.12));
}

/* Tooltips are INFORMATIONAL: they must never intercept pointer events. Without this a
   tooltip popover that overlaps something clickable eats the click — concretely, the
   project-crumb tooltip painted over the crumb's own just-opened menu and made the
   settings item unclickable while the pointer rested on the chip. */
.mud-popover.mud-tooltip {
    pointer-events: none;
}

/* The app's hover card (HoverInfoTooltip, PO 2026-08-24): a MudPopover on the theme's paper, elevation 8. Here, not in
   the component, because EcoMenderTd opens the same card from every grid, app bar or not (PO 2026-10-10).
   max-width MUST hold against the popover's own sizing - the whole point of the template is that no tooltip ever spans
   the viewport again (PO 2026-08-24). pointer-events is "non-interactive by design" made literal, and it is
   load-bearing on the app bar: a chip's card opens exactly where that chip's own menu opens, and a card that swallowed
   those clicks is the defect the .mud-popover.mud-tooltip rule above was written for. */
.mud-popover.eco-hover-info { padding: 12px 16px; width: max-content !important; max-width: 380px !important; line-height: 1.45; pointer-events: none; }

/* EcoMenderTd's text: one line, shortened with "…" at the cell's actual width (PO 2026-10-10). A block, so the text
   keeps its cell's text-align - the result grids right-align their figures. */
.eco-td-root {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The hover CARD (#105, PO 2026-10-09): a MudTooltip that looks like the app bar's HoverInfoTooltip - the
   surface colour and its text colour, elevation 8, the same padding and width cap - but keeps the app's hover
   wait (MudGlobal.TooltipDefaults.Delay), which a list needs: a pointer crossing the projects list must not
   leave a trail of cards. Three classes, so it outranks MudBlazor's .mud-tooltip.mud-tooltip-default. */
.mud-popover.mud-tooltip.eco-hover-card {
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    box-shadow: var(--mud-elevation-8);
    padding: 12px 16px;
    max-width: 380px;
    line-height: 1.45;
    border-radius: var(--mud-default-borderradius);
}

/* Reset inherited styling for tables nested inside tooltips */
.mud-tooltip.mud-tooltip-default:has(.mud-table) {
    padding: 0;
    box-shadow: var(--mud-elevation-4);
    border: none;
    overflow: hidden;
    background-color: transparent;
}

.mud-tooltip .mud-table-body .mud-table-row:last-child .mud-table-cell {
    border-bottom: none;
}

.ecomender-result-grid .mud-table-foot tr:has(+ tr) td {
    border-bottom: none;
}

/* ======= Summary Table Styles ======= */
.summary-table td {
    max-width: 250px;
    min-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Structure row details slide-in animation */
.structure-row-details {
    animation: structureRowSlideDown 0.2s ease-out;
}

/* Its selected part row: the shared rule of the selected and highlighted rows (#595), with the tertiary colour. */

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

/* Hide sort arrow until header is hovered or actively sorted */
.mud-table-sort-label-icon.mud-direction-none {
    opacity: 0;
    transition: opacity 0.2s ease;
}

th:hover .mud-table-sort-label-icon.mud-direction-none {
    opacity: 0.5;
}

/* ======= ArcGIS Popup: Import Building Action Button ======= */
.action-import {
    --calcite-action-text-color: #1565c0;
    --calcite-action-text-color-active: #0d47a1;
    --calcite-action-background-color-hover: rgba(21, 101, 192, 0.12);
    --calcite-action-background-color-press: rgba(21, 101, 192, 0.2);
}

/* ======= MudSwitch track sweep hint ======= */
/* Apply .mud-switch-track-sweep to any ancestor of a MudSwitch to show a
   left-to-right primary-colour shimmer across the toggle track every 4 s. */
@keyframes mud-switch-track-sweep {
    0%          { transform: translateX(-100%); }
    25%         { transform: translateX(100%);  }
    25.1%, 100% { transform: translateX(-100%); }
}

.mud-switch-track-sweep .mud-switch-track {
    overflow: hidden;
}

.mud-switch-track-sweep .mud-switch-track::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, var(--mud-palette-primary) 50%, transparent 100%);
    animation: mud-switch-track-sweep 4s ease-in-out infinite;
    pointer-events: none;
}

/* ======= Cookie notice: full-width bottom banner ======= */
/* The notice rides the snackbar machinery (see CookieNotice.razor) but must read as a
   banner, not a toast: fixed positioning pulls it out of the snackbar stack container so
   it spans the viewport with even bottom/left/right padding. */
.mud-snackbar.cookie-notice-snackbar {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
    max-width: none;
}

/* ======= Onboarding wizard dialog ======= */
/* Design rule: the dialog spans 80vh (10% viewport margin top and bottom), and its main content
   NEVER scrolls — on the Terms step the PDF viewer's own scrollbar is the only one. The surface
   is a flex column so the fixed height flows down to the stepper content. */
/* Selectors are deliberately .mud-dialog.onboarding-dialog (0,3,0-ish specificity): app.css
   loads BEFORE MudBlazor.min.css, so an equal-specificity override of MudBlazor's own
   `.mud-dialog .mud-dialog-content { overflow: auto }` silently loses and the container grows
   a scrollbar (observed in testing). */
.mud-dialog.onboarding-dialog {
    /* Vertical margins match the horizontal ones (MudBlazor's canonical 32px dialog inset)
       instead of the earlier 10vh — the wizard uses effectively the whole viewport. */
    height: calc(100vh - 64px);
    max-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
}

/* MudBlazor renders focus-trap wrappers between the dialog surface and the content/actions;
   none of them are flex, so the fixed 80vh height never reached the actions row (the accept
   button floated with dead space under it, hugging the corner). Flex the whole chain. */
.mud-dialog.onboarding-dialog > div:not(.mud-dialog-title),
.mud-dialog.onboarding-dialog .mud-focus-trap,
.mud-dialog.onboarding-dialog .mud-focus-trap-child-container {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.mud-dialog.onboarding-dialog .mud-dialog-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

/* Align the action row with the content's horizontal inset (24px) instead of the dialog edge. */
.mud-dialog.onboarding-dialog .mud-dialog-actions {
    flex: 0 0 auto;
    padding: 12px 24px 16px;
}

.onboarding-stepper .mud-stepper-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

/* ======= A dialog that gives its content the window's height (.dialog-fill) ======= */
/* For content with a scroller of its own, a PDF viewer (#736, PO 2026-11-16: the Tiedot dialog's documents). The dialog
   spans the window as the onboarding's does (MudBlazor's 32px inset above and below), its content never scrolls, and the
   content's last child takes the room left, so the viewer's scrollbar is the only one. MudDialog's ContentClass carries
   .dialog-fill, and the dialog follows it by :has, so a dialog can fill for one content and fit another (the Tiedot
   dialog's facts). Specificity as the onboarding's: app.css loads before MudBlazor.min.css. */
.mud-dialog:has(.mud-dialog-content.dialog-fill) {
    height: calc(100vh - 64px);
    max-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
}

.mud-dialog:has(.mud-dialog-content.dialog-fill) > div:not(.mud-dialog-title),
.mud-dialog:has(.mud-dialog-content.dialog-fill) .mud-focus-trap,
.mud-dialog:has(.mud-dialog-content.dialog-fill) .mud-focus-trap-child-container {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.mud-dialog .mud-dialog-content.dialog-fill {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mud-dialog .mud-dialog-content.dialog-fill > :last-child {
    flex: 1 1 auto;
    min-height: 0;
}

/* ======= Table toolbars grow when their controls wrap ======= */
/* MudTable's toolbar has a fixed height; at narrow viewports wrapped controls (e.g. the
   scenarios page's LCC + emissions FAB/switch pairs) would slide UNDER the table header,
   leaving them visible but unclickable. Let the row wrap and the toolbar grow instead.
   (Double class: app.css loads before MudBlazor.min.css, so .mud-toolbar's fixed height
   would win an equal-specificity tie.) */
.mud-toolbar.mud-table-toolbar {
    height: auto;
    min-height: var(--mud-internal-toolbar-height);
    flex-wrap: wrap;
}

/* Login/register tab contents render stacked in one grid cell: the browser measures both and the
   card keeps the taller tab's height on both tabs - no height jump when switching. */
.login-tab-stack {
    display: grid;
}

.login-tab-stack > .login-tab-stack-item {
    grid-area: 1 / 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* MudBlazor styles .mud-selected-item for LIST items only, so the picked row of a MudTable looked
   exactly like every other one (product picker, 2026-09-14). The row carries a radio as well; this
   is the tint behind it. */
.picker-row-selected > td {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.12);
}

/* The chosen-product pill: the product's name is the only part that gives way. A flex item will not
   shrink below its content unless it is told it may, so every box between the chip and the name needs
   min-width:0 — without it the name never ellipsises and the pill overflows its row instead
   (2026-09-14). The icon, the U-value and the close cross keep the room they need. */
.structure-product-chip,
.structure-product-chip .mud-chip-content {
    min-width: 0;
    max-width: 100%;
}

/* The pill is the whole row, whatever it holds: a chip sized to its content made the section's width
   depend on the length of a product's name. Its own horizontal margins are zeroed so a full-width chip
   still fits the row it fills. */
.structure-product-chip {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    /* A chip centres its content; a full-width one must start it at the left instead. */
    justify-content: flex-start;
}

.structure-product-chip .mud-chip-content {
    flex: 1 1 auto;
}

.structure-product-chip .mud-chip-icon,
.structure-product-chip .mud-chip-close-button {
    flex: 0 0 auto;
}

/* The tooltip wraps the name in a root of its own, so THAT is the flex item that has to be allowed to
   shrink — styling only the span inside it would leave the cut never happening. */
/* The name takes only what it needs and gives way when there is not enough — it does NOT grow to fill,
   or the U-value would drift with the length of the name instead of sitting at the right edge. */
.structure-product-chip .mud-tooltip-root {
    display: block;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
}

.structure-product-chip__name {
    display: block;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A settings area a project cannot use yet (emissions on calculation version V1): really inert,
   not merely dimmed. A fieldset's disabled attribute reaches the form controls; MudBlazor opens
   some of its inputs from a wrapper div, which that attribute does not reach, so pointer events go
   too. The reset is because a fieldset carries a border, padding and an intrinsic min-width that
   would otherwise break the layout inside it. */
.settings-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.settings-fieldset--inert {
    pointer-events: none;
    opacity: 0.55;
}

/* ------------------------------------------------------------------------------------------------
   The projects list's cell cards (#105, PO 2026-10-07): a cell states its collective, and its tooltip
   says what that collective is made of - the buildings, their areas, uses, states and addresses, the
   people, the round. They replaced the selected row's details panel. Inside a tooltip, so colours
   inherit the tooltip's text colour rather than naming the page's.
   ------------------------------------------------------------------------------------------------ */
.project-cell-card {
    max-width: 420px;
    font-size: 0.8125rem;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
}

.project-cell-card__title {
    font-weight: 600;
    margin-bottom: 4px;
}

.project-cell-card__muted {
    opacity: 0.75;
}

/* Label/value pairs, so the values line up in a column instead of following the labels' widths. */
.project-cell-card__facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 12px;
}

.project-cell-card__facts > span:nth-child(odd) {
    opacity: 0.75;
}

/* A card's closing figure - the buildings card's total net area. */
.project-cell-card__total {
    margin-top: 4px;
    font-weight: 600;
}

/* A card's table (PO 2026-10-10) - the extent cards' and the state card's: emblem | name | value, one line per
   building - a long name shortens rather than wrapping - the values right-aligned in tabular digits, and a total set
   apart under a rule. The rows are subgrids, so each row is a box of its own and the columns still line up across
   them. */
.project-cell-card__table {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) auto;
    column-gap: 8px;
    row-gap: 2px;
    align-items: center;
}

.project-cell-card__table-row,
.project-cell-card__table-total {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    align-items: center;
}

.project-cell-card__table > .project-cell-card__muted {
    grid-column: 1 / -1;
}

/* The fleet card: emblem | name | registry identifier | state. */
.project-cell-card__table--fleet {
    grid-template-columns: 16px minmax(0, 1fr) auto auto;
}

/* The locality card: emblem | name | address, both texts shortening. */
.project-cell-card__table--address {
    grid-template-columns: 16px minmax(0, 1fr) minmax(0, 1.4fr);
}

/* The people card: name | role | last seen. */
.project-cell-card__table--people {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.project-cell-card__table-muted {
    opacity: 0.75;
    white-space: nowrap;
}

.project-cell-card__table-name {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-cell-card__table-value {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.project-cell-card__table-total {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--mud-palette-lines-default);
    font-weight: 600;
}

.project-cell-card__table-total > span:first-child {
    grid-column: 1 / 3;
}

/* What the project consists of, under the table: each kind's emblem and its count, on one line. */
.project-cell-card__counts {
    display: flex;
    flex-wrap: nowrap;
    gap: 14px;
    margin-top: 6px;
    opacity: 0.75;
}

.project-cell-card__counts > span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.project-cell-card .mud-icon-root.project-cell-card__emblem {
    width: 16px;
    height: 16px;
    font-size: 16px;
    flex: 0 0 auto;
}

.project-cell-card__table .project-cell-card__emblem {
    opacity: 0.75;
}

/* One pill per building in the projects list (PO 2026-10-09): on one line, each capped so a long name shortens
   rather than widening the column; the pill's card carries the whole name.
   As many pills show as fit the column, the rest fold into "+N" (PO 2026-10-10, fleetPills.js). contain: inline-size
   keeps the pills out of the column's width: the fold follows the column, and a column that grew with its unfolded
   pills would unfold more of them, and so on. */
.projects-building-pills {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    contain: inline-size;
}

/* A pill keeps its own width up to the cap; the fold, not shrinking, makes room. Only a lone first pill shrinks (down to
   3rem, its name shortening) when even it and "+N" do not fit - except while the script measures. The flex items are
   the pills' TOOLTIP ROOTS (MudTooltip wraps each chip), so the sizing is theirs and the chip fills its root. */
.projects-building-pill-root {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 8rem;
}

.projects-building-pills:not([data-measuring]) > .projects-building-pill-root:first-child {
    flex-shrink: 1;
    min-width: 3rem;
}

/* The "+N" pill never shrinks - it is how the reader knows there are more. Until the script has counted, it holds its
   place without a count. */
.projects-building-pill-more-root {
    flex: 0 0 auto;
}

.projects-building-pills > [data-folded] {
    display: none !important;
}

.projects-building-pills:not([data-fold-ready]) > .projects-building-pill-more-root {
    visibility: hidden;
}

.mud-chip.projects-building-pill {
    max-width: 100%;
    min-width: 0;
}

/* The chip's content keeps MudBlazor's centred inline-flex; the NAME carries the ellipsis. Making the content a
   block (the first version) dropped the centring and the text rode high in the pill. */
.mud-chip.projects-building-pill .mud-chip-content {
    min-width: 0;
    overflow: hidden;
}

.projects-building-pill__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* An icon-only pill: MudChip's icon margins make room for text (-4px before, 4px after), which leaves a lone icon
   4px left of centre. */
.mud-chip.projects-pill--icon-only .mud-chip-icon {
    margin-left: 0;
    margin-right: 0;
    margin-inline-start: 0;
    margin-inline-end: 0;
}

/* A summary card's table fills the room under its heading (PO 2026-09-26, built 2026-09-27).
   Each of the seven summary views used to compute its own height from the viewport while already sitting
   in a flex wrapper that had computed the same thing, and every one of them landed 10-19px short of its
   own card. The tables ask for 100% now, but 100% alone COLLAPSES them: MudBlazor puts the Height on the
   inner scroll box, whose parent — the table root — is content-sized, so the percentage resolves against
   nothing and the table came out 151-291px short instead. These two rules link the chain, so the height
   flows from the wrapper to the scroll box:
     wrapper (flex:1; min-height:0)  ->  .mud-table (height:100%, a column)  ->  .mud-table-container (flex:1)
   Scoped to the summary card, deliberately: every other grid on these pages is sized by its page. */
.result-summary-paper .mud-table {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.result-summary-paper .mud-table .mud-table-container {
    flex: 1 1 auto;
    /* Without this a long table refuses to shrink below its content and pushes the card open. */
    min-height: 0;
}

/* ONE PIXEL of room for the table's own bottom frame. These elements CLIP, and the scroll container now
   fills them exactly, so the frame's last pixel row landed on the clip boundary and was dropped — which is
   why a sum row appeared to have no line under it. Proved by giving the container 2px of room and watching
   the line reappear (2026-09-27).

   Exactly one pixel, and on the INNERMOST clipper only: reserving it on the card as well left a visible
   white gap under the frame, which is its own defect.

   .mud-tabs-panels gets two, because a result grid computes its height from the viewport and comes out 1px
   TALLER than its panel — so one pixel only brings it level. That extra pixel is a reservation against a
   sizing error, not a fix for it: the grids should fill their panel the way the summary tables now do,
   which is a separate change across 31 grids. */
.result-summary-paper .mud-table {
    padding-bottom: 1px;
}

/* REVERTED 2026-09-27: making the result grids fill their panel here made them INVISIBLE. The tab panel
   has no definite height for `height: 100%` to resolve against — the existing rule that would have given it
   one targets `.mud-tabpanel`, while MudBlazor renders `.mud-tab-panel` — so the table collapsed to nothing
   and took the grid with it.

   The gates did not catch it, which is the more important lesson: every one of them skips a table it cannot
   see, so a tab with no table at all reported success. `EveryResultTabHasAVisibleTable` now fails on that.

   The grids therefore still compute their height from the viewport and still come out 1px taller than their
   panel, so the bottom of their frame is clipped. That is a real but one-pixel defect, and it stays until
   the panels are given a definite height — which is the 31-grid change, not a patch. */

/* Two things still stood between a summary table and the bottom of its card, both measured rather than
   guessed (the chain probe in LayoutAndMenuProbeTests, 2026-09-27).

   ONE: the card's MudGrid hangs 24px of its own negative margin below the paper, so every table stopped a
   uniform 25px short (24 plus a border) however well it filled its wrapper. The grid's vertical gutter is
   cancelled here, since the card has no padding of its own for it to sit inside. */
.result-summary-paper > .mud-grid {
    margin-top: 0;
    margin-bottom: 0;
}

.result-summary-paper > .mud-grid > .mud-grid-item {
    padding-top: 0;
    padding-bottom: 0;
}

/* TWO: on the scenarios card the table lives inside a MudRadioGroup — an INPUT CONTROL, which MudBlazor
   pins to flex: 0 0 auto. The wrapper above it was 394px tall and the radio group stayed at 166, so that
   one card was 253px short while the rest were 25. Three classes, because MudBlazor's own stylesheet
   loads after this one and an equal-specificity rule loses to it. */
.result-summary-paper .mud-input-control.mud-input-control-boolean-input,
.result-summary-paper .mud-input-control .mud-input-control-input-container,
.result-summary-paper .mud-radio-group {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

/* The result grid's table FILLS its scroll container. MudBlazor sizes this table to its content when the
   grid is horizontally scrollable, so a table with narrow columns stopped short of the container and left
   the right third empty — and the export button, which sits at the container's right edge, ended up far
   away from the table it exports (PO 2026-09-27).

   Specific enough to beat the component's own sizing, and NOT !important: a table whose columns need more
   than the container still grows past 100% and scrolls, because content's minimum width wins over a
   percentage width. That is what keeps the wide grids working. */
.ecomender-result-grid .mud-table-container > table.mud-table-root {
    width: 100%;
}

/* A summary card's SUM ROW is as tall as the sum row on the grid tabs beside it (PO 2026-09-27). The card's
   table is dense and its footer inherited the dense 6px, while a result grid's footer carries 16px — 37px
   against 58px, which a reader sees the moment they switch tabs. The body rows stay dense: it is the
   closing row that has to line up, because that is the one the eye returns to. */
/* Three classes, because MudBlazor's dense-table rule carries two and its stylesheet loads after this one —
   a one-class selector here changed nothing at all, which is the third time today that has cost a round. */
.split-page__results-inner .result-summary-paper .mud-table-root tfoot td,
.split-page__results-inner .result-summary-paper .mud-table-root tfoot th {
    padding-top: 16px;
    padding-bottom: 16px;
    /* The last pixel of the difference, and it earns its place twice: it makes the row exactly as tall as
       the grid tabs' (58px, not 57), and it gives the sum row a closing line of its own rather than
       borrowing the container's frame — which is the line that kept going missing. */
    border-bottom: 1px solid var(--mud-palette-lines-default, rgba(0,0,0,0.12));
}

/* An input grid's export button belongs IN a header cell, not floated over one. Two earlier shapes were
   tried and both were guesses about the markup rather than statements about it: sniffing the header for a
   second row (the scenarios grid has one, and the icon landed through the word "Luotu"), then an opt-in
   class plus absolute positioning, which still had to keep an offset in step with the toolbar's height.
   A child of the cell just aligns (PO 2026-09-28). */
.general-ecomender-grid .mud-table-toolbar {
    position: relative;
}

/* ======= TABLE TOOLS (the export button and its siblings) =======
   Named for the component underneath: these act on a MudTable, not on the grid abstraction above it. They
   live in the FIRST group-header cell beside its label — the action at the cell's leading edge, the label
   keeping the rest — so the two align by ordinary flow, which is the whole reason the button is a child of
   the cell rather than floated over it. Dev-only indicators come after the controls everyone has. */
/* The ordering menu's heading row: its name, and the (i) that explains the orderings under it. Padded
   like a menu item so the list below reads as its contents, and dimmed so it is plainly not a choice. */
.table-sort-mode__title {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 16px 2px 16px;
    opacity: .85;
}

.table-tools-cell {
    display: flex;
    align-items: center;
    gap: 4px;
}

.table-tools-cell__label {
    flex: 1;
}

/* The slot is what the tools LEAVE BEHIND. A table wider than its container scrolls this cell out sideways,
   and the tools then pin themselves where they stood (below); the slot holds the width they occupied so the
   label beside them does not jump at the moment they go. table-tools.js sets that width. */
.table-tools-slot {
    display: inline-flex;
    flex: none;
}

.table-tools {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* AFLOAT: the cell has scrolled out from under the tools, so they hover in the place they occupied in it.
   Fixed, not absolute: the header cell is position:sticky and therefore the containing block for anything
   absolute, so an absolute toolbar would scroll away with the cell it is trying to escape. Nothing between
   here and <html> carries a transform, filter, contain or will-change (measured 2026-09-29), so a fixed box
   escapes both the scroll and the container's clip. table-tools.js writes the coordinates and owns the flag;
   these rules only say what floating LOOKS like — a surface of its own, over content that moves under it. */
.table-tools--afloat {
    position: fixed;
    z-index: 6;
    padding: 1px 4px;
    border-radius: 999px;
    background: var(--mud-palette-surface);
    box-shadow: 0 1px 5px rgba(0, 0, 0, .28);
}

/* A HIDDEN grid column, and the reason it is not done with visibility:collapse. Chromium pins a table that
   contains a collapsed column to a content-derived width and ignores width:100% entirely, so a single
   hidden id column stopped every other column from flexing — the heat-loss grid sat ~250px short of its
   container, and the export button beside it ended up nowhere near the table (PO 2026-09-28).

   The column is given no width and its CELLS are emptied out: a zero-width col alone still lets the cell's
   content push the column open, which widened the energy grid by 154px. Hiding the cell's children is what
   makes the column genuinely cost nothing. */
.grid-col-hidden {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    border: none !important;
    overflow: hidden !important;
    white-space: nowrap;
}

.grid-col-hidden > * {
    display: none;
}

/* The share bar (#716, ShareBar.razor), on a grid's CRUD row. Global, not scoped: its sections sit in MudTooltip
   roots, and its tab, its narrow-section field and its note in popovers, which a component's scope does not reach.
   The sections take light tints of the theme's hues with ink text (PO 2026-11-16); a narrow section shows only its
   share, a very narrow one nothing (its share stays focusable, and its tooltip and field say it). */
.sb-cell {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 16px;
}

.sb {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.sb-lock {
    flex: 0 0 auto;
    color: var(--mud-palette-text-secondary);
}

.sb-bar {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 36px;
}

.sb-segs {
    position: absolute;
    inset: 0;
    display: flex;
    user-select: none;
    touch-action: none;
}

.sb-segs > .sb-seg-root {
    container: sb-seg / inline-size;
    min-width: 0;
    height: 100%;
    display: block;
}

.sb-seg {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 8px;
    overflow: hidden;
    white-space: nowrap;
    color: #1F2328;
    border-top: 3px solid transparent;
    box-shadow: inset 0 -1px 0 var(--mud-palette-lines-default), inset 0 1px 0 var(--mud-palette-lines-default);
    transition: filter .12s ease;
}

.sb-seg-root.sb-first .sb-seg {
    border-radius: 7px 0 0 7px;
    box-shadow: inset 1px 0 0 var(--mud-palette-lines-default), inset 0 -1px 0 var(--mud-palette-lines-default), inset 0 1px 0 var(--mud-palette-lines-default);
}

.sb-seg-root.sb-last .sb-seg {
    border-radius: 0 7px 7px 0;
    box-shadow: inset -1px 0 0 var(--mud-palette-lines-default), inset 0 -1px 0 var(--mud-palette-lines-default), inset 0 1px 0 var(--mud-palette-lines-default);
}

.sb-seg-root.sb-first.sb-last .sb-seg {
    border-radius: 7px;
    box-shadow: inset 0 0 0 1px var(--mud-palette-lines-default);
}

.sb-seg.sb-editable {
    cursor: text;
}

.sb-seg.sb-hl {
    filter: brightness(.94);
}

.sb-seg.sb-unsaved {
    border-top-color: var(--mud-palette-warning);
}

.sb-ro .sb-seg {
    filter: saturate(.55);
}

.sb-lab {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: .78rem;
}

.sb-pct {
    flex: 0 0 auto;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 700;
    font-size: .8rem;
    font-variant-numeric: tabular-nums;
    outline: none;
}

.sb-editable .sb-pct:hover {
    background: rgba(255, 255, 255, .75);
    box-shadow: inset 0 0 0 1px var(--mud-palette-lines-default);
}

.sb-editable .sb-pct:focus-visible {
    background: #fff;
    box-shadow: 0 0 0 2px var(--mud-palette-info);
}

@container sb-seg (max-width: 127px) {
    .sb-seg .sb-lab {
        display: none;
    }
}

@container sb-seg (max-width: 45px) {
    .sb-seg {
        padding: 0;
    }

    .sb-seg .sb-pct {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .sb-seg:focus-within {
        box-shadow: inset 0 0 0 2px var(--mud-palette-info);
    }
}

.sb-input {
    width: 62px;
    padding: 3px 6px;
    border: 1px solid var(--mud-palette-primary);
    border-radius: 4px;
    background: #fff;
    color: #1F2328;
    font: inherit;
    font-weight: 700;
    font-size: .8rem;
    text-align: right;
    outline: none;
    box-shadow: 0 0 0 2px rgba(46, 107, 119, .18);
}

.sb-divider {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 16px;
    transform: translateX(-50%);
    z-index: 2;
    display: grid;
    place-items: center;
    cursor: ew-resize;
    touch-action: none;
    outline: none;
}

.sb-divider::before {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: rgba(31, 35, 40, .38);
}

.sb-grip {
    position: relative;
    width: 8px;
    height: 20px;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(31, 35, 40, .45), 0 1px 2px rgba(0, 0, 0, .2);
}

.sb-divider:hover .sb-grip,
.sb-dragging .sb-divider .sb-grip {
    box-shadow: 0 0 0 1.5px var(--mud-palette-primary), 0 1px 3px rgba(0, 0, 0, .25);
}

.sb-divider:focus-visible .sb-grip {
    box-shadow: 0 0 0 2px var(--mud-palette-info), 0 0 0 4px rgba(47, 94, 168, .25);
}

/* The tab that rises from the middle of the bar while a change is unsaved: Peruuta and Tallenna */
.mud-popover.sb-tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px 5px 10px;
    border: 1px solid var(--mud-palette-lines-default);
    border-bottom: 0;
    border-radius: 9px 9px 0 0;
    box-shadow: 0 -3px 10px rgba(0, 0, 0, .08);
    white-space: nowrap;
}

.sb-tab-msg {
    margin-right: 4px;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

/* The field above a section too narrow for it */
.mud-popover.sb-pop {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: -8px;
    padding: 7px 9px;
    font-size: .8rem;
}

.sb-pop-lab {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--mud-palette-text-secondary);
}

.mud-popover.sb-note {
    margin-top: 6px;
    padding: 4px 8px;
    font-size: .75rem;
    color: var(--mud-palette-warning);
    box-shadow: none;
    background: var(--mud-palette-surface);
}

/* A grid row's swatch: the section's tint, so a narrow section's item is found in the grid */
.sb-swatch {
    display: inline-block;
    width: 10px;
    height: 14px;
    margin-right: 8px;
    border-radius: 3px;
    vertical-align: -2px;
}

.mud-table-row.sb-row-hl > td {
    background: var(--mud-palette-action-default-hover);
}

/* In a narrow grid the bar takes its own line under the buttons */
.sb-host {
    container: sb-host / inline-size;
}

@container sb-host (max-width: 560px) {
    .sb-host .mud-table-toolbar {
        flex-wrap: wrap;
        height: auto;
        row-gap: 10px;
        padding-block: 8px;
    }

    .sb-host .sb-cell {
        flex-basis: 100%;
        margin-left: 0;
    }
}
