/* Plus Jakarta Sans (OFL, fonts/OFL.txt), bundled so the installed app sets it offline and no font host is needed (D2). */
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url(../fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url(../fonts/plus-jakarta-sans-latin-wght-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

html, body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Text for screen readers only, e.g. "(you)" beside Me's name where only colour marks it. */
.ft-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/*
 * Brand colours the MudBlazor palette has no slot for (ui-redesign D1). Light here, dark below, with the same
 * selectors as the dark page rules. Pairs are bg/fg; each fg is at least 4.5:1 on its bg.
 */
:root {
    --ft-owe: #B54708;
    --ft-owe-soft: #FDF0E6;
    --ft-owed: #0F766E;
    --ft-tile-accommodation-bg: #EFEAFB;
    --ft-tile-accommodation-fg: #5B3FA6;
    --ft-tile-transport-bg: #E6ECFB;
    --ft-tile-transport-fg: #2F4FB5;
    --ft-tile-groceries-bg: #E3F2EF;
    --ft-tile-groceries-fg: #0F766E;
    --ft-tile-restaurants-bg: #FDF0E6;
    --ft-tile-restaurants-fg: #B54708;
    --ft-tile-entertainment-bg: #FBE8F0;
    --ft-tile-entertainment-fg: #A3305F;
    --ft-tile-other-bg: #EEF1F0;
    --ft-tile-other-fg: #3D4C48;
    --ft-pill-changed-bg: #E8EDFB;
    --ft-pill-changed-fg: #2F4FB5;
    --ft-pill-unsynced-bg: #FFF4D6;
    --ft-pill-unsynced-fg: #7A5200;
    --ft-pill-photos-bg: #EEF1F0;
    --ft-pill-photos-fg: #3D4C48;
    --ft-pill-refused-bg: #FDECEA;
    --ft-pill-refused-fg: #B42318;
    --ft-pill-conflict-bg: var(--ft-pill-refused-bg);
    --ft-pill-conflict-fg: var(--ft-pill-refused-fg);
    --ft-owe-text: #7A3A0C;
    --ft-owe-border: #F4D8C1;
    --ft-bar-neg: #E8925A;
    --ft-bar-pos: #2A9D8F;
    --ft-bar-track: #F3F5F4;
    --ft-tabs-bg: #E6EBE9;
    --ft-tab-on-bg: #FFFFFF;
    --ft-row-soft: #F7F9F8;
    --ft-row-low: #FFFBEE;
    --ft-tip-bg: #1F2A27;
    --ft-tip-fg: #FFFFFF;
}

html[data-theme=dark] {
    --ft-owe: #F59E62;
    --ft-owe-soft: #33231A;
    --ft-owed: #5EC9B8;
    --ft-tile-accommodation-bg: #2A2240;
    --ft-tile-accommodation-fg: #B9A6F2;
    --ft-tile-transport-bg: #1E2742;
    --ft-tile-transport-fg: #9DB2F5;
    --ft-tile-groceries-bg: #15302C;
    --ft-tile-groceries-fg: #5EC9B8;
    --ft-tile-restaurants-bg: #3A2618;
    --ft-tile-restaurants-fg: #F5A66E;
    --ft-tile-entertainment-bg: #3A1E2B;
    --ft-tile-entertainment-fg: #F28DB5;
    --ft-tile-other-bg: #26322F;
    --ft-tile-other-fg: #B9C6C2;
    --ft-pill-changed-bg: #1E2742;
    --ft-pill-changed-fg: #9DB2F5;
    --ft-pill-unsynced-bg: #3A2E10;
    --ft-pill-unsynced-fg: #F2C94C;
    --ft-pill-photos-bg: #26322F;
    --ft-pill-photos-fg: #B9C6C2;
    --ft-pill-refused-bg: #3D1F1C;
    --ft-pill-refused-fg: #F59C92;
    --ft-owe-text: #F2C3A0;
    --ft-owe-border: #4A3222;
    --ft-bar-neg: #F59E62;
    --ft-bar-pos: #5EC9B8;
    --ft-bar-track: #0E1413;
    --ft-tabs-bg: #1C2624;
    --ft-tab-on-bg: #2C3936;
    --ft-row-soft: #1C2624;
    --ft-row-low: #2A2414;
    --ft-tip-bg: #E8EEEC;
    --ft-tip-fg: #161E1C;
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme=light]) {
        --ft-owe: #F59E62;
        --ft-owe-soft: #33231A;
        --ft-owed: #5EC9B8;
        --ft-tile-accommodation-bg: #2A2240;
        --ft-tile-accommodation-fg: #B9A6F2;
        --ft-tile-transport-bg: #1E2742;
        --ft-tile-transport-fg: #9DB2F5;
        --ft-tile-groceries-bg: #15302C;
        --ft-tile-groceries-fg: #5EC9B8;
        --ft-tile-restaurants-bg: #3A2618;
        --ft-tile-restaurants-fg: #F5A66E;
        --ft-tile-entertainment-bg: #3A1E2B;
        --ft-tile-entertainment-fg: #F28DB5;
        --ft-tile-other-bg: #26322F;
        --ft-tile-other-fg: #B9C6C2;
        --ft-pill-changed-bg: #1E2742;
        --ft-pill-changed-fg: #9DB2F5;
        --ft-pill-unsynced-bg: #3A2E10;
        --ft-pill-unsynced-fg: #F2C94C;
        --ft-pill-photos-bg: #26322F;
        --ft-pill-photos-fg: #B9C6C2;
        --ft-pill-refused-bg: #3D1F1C;
        --ft-pill-refused-fg: #F59C92;
        --ft-owe-text: #F2C3A0;
        --ft-owe-border: #4A3222;
        --ft-bar-neg: #F59E62;
        --ft-bar-pos: #5EC9B8;
        --ft-bar-track: #0E1413;
        --ft-tabs-bg: #1C2624;
        --ft-tab-on-bg: #2C3936;
        --ft-row-soft: #1C2624;
        --ft-row-low: #2A2414;
        --ft-tip-bg: #E8EEEC;
        --ft-tip-fg: #161E1C;
    }
}

/*
 * Dark mode before MudBlazor's palette exists; afterwards its variables take over. boot.js sets data-theme from the
 * stored choice. Before it runs (no data-theme yet), a dark OS already gets the dark page through the media query and
 * the color-scheme meta in index.html; data-theme=light (Off, or Automatic on a light OS) forces light (R7).
 */
html[data-theme=light] {
    color-scheme: light;
}

html[data-theme=dark] {
    color-scheme: dark;
}

html[data-theme=dark] body {
    background: var(--mud-palette-background, #0E1413);
    color: var(--mud-palette-text-primary, #E8EFED);
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme=light]) body {
        background: var(--mud-palette-background, #0E1413);
        color: var(--mud-palette-text-primary, #E8EFED);
    }
}

/*
 * App shell (Layout/MainLayout, D3, D4): from 900 px a permanent sidebar beside the main column, and the app bar
 * beside the sidebar without its menu button and name; below 900 px the top bar and drawer. CSS only, so a resize
 * needs no re-render.
 */
.ft-sidebar {
    display: none;
    flex-direction: column;
    gap: 24px;
    padding: 24px 16px;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
    background: var(--mud-palette-surface);
    border-right: 1px solid var(--mud-palette-lines-default);
}

@media (min-width: 900px) {
    .ft-shell:has(> .ft-sidebar) {
        display: grid;
        grid-template-columns: 272px minmax(0, 1fr);
    }

    .ft-sidebar {
        display: flex;
    }

    .mud-appbar.ft-appbar-beside {
        left: 272px;
        width: auto;
    }

    /* display: none, so role locators skip the hidden copy of the FairTrip link. */
    .ft-narrow-only {
        display: none !important;
    }
}

.ft-sidebar a {
    text-decoration: none;
    color: inherit;
}

.ft-side-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.ft-side-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}

.ft-side-trips {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ft-side-trip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
}

    .ft-side-trip:hover, .ft-side-links a:hover {
        background: var(--mud-palette-action-default-hover);
    }

    .ft-side-trip[aria-current=page] {
        background: rgba(var(--mud-palette-primary-rgb), 0.12);
    }

.ft-side-initial {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}

.ft-side-trip-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ft-side-trip-title {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ft-side-trip-sub {
    font-size: 12px;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

.ft-sidebar .ft-side-new {
    color: var(--mud-palette-primary);
    font-size: 14px;
    font-weight: 700;
}

.ft-side-initial.ft-side-plus {
    background: none;
    color: inherit;
    border: 1.5px dashed rgba(var(--mud-palette-primary-rgb), 0.45);
}

.ft-side-links {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
    font-weight: 600;
}

    .ft-sidebar .ft-side-links a {
        padding: 10px;
        border-radius: 10px;
        color: var(--ft-tile-other-fg);
    }

.ft-tile-transport {
    background: var(--ft-tile-transport-bg);
    color: var(--ft-tile-transport-fg);
}

.ft-tile-restaurants {
    background: var(--ft-tile-restaurants-bg);
    color: var(--ft-tile-restaurants-fg);
}

.ft-tile-accommodation {
    background: var(--ft-tile-accommodation-bg);
    color: var(--ft-tile-accommodation-fg);
}

.ft-tile-entertainment {
    background: var(--ft-tile-entertainment-bg);
    color: var(--ft-tile-entertainment-fg);
}

.ft-tile-groceries {
    background: var(--ft-tile-groceries-bg);
    color: var(--ft-tile-groceries-fg);
}

/*
 * Trip screen (Pages/TripDetail, Components/SummaryCard, Pages/Balances, D5): the header, the totals row led by my
 * balance, and the Expenses and Balances panes, side by side from 1100 px and one at a time with a switch below.
 */
.ft-trip {
    max-width: 1160px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ft-trip-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px 24px;
}

.ft-trip-heading {
    flex: 1 1 360px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ft-trip-title {
    margin: 0;
    font-size: 36px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
}

.ft-trip-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--mud-palette-text-secondary);
}

.ft-trip-desc.mud-typography {
    font-size: 15px;
    color: var(--ft-tile-other-fg);
}

.ft-trip-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.mud-icon-button.ft-iconbtn {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
    color: var(--ft-tile-other-fg);
}

.ft-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.ft-stat {
    min-width: 0;
    padding: 20px;
    border-radius: 20px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ft-stat-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--mud-palette-text-secondary);
}

.ft-stat-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.ft-stat-main .ft-stat-value {
    font-size: 32px;
}

.ft-stat-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 14px;
    color: var(--mud-palette-text-secondary);
}

.ft-stat-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ft-stat-summary {
    font-weight: 700;
}

.ft-stat-owe {
    background: var(--ft-owe-soft);
    border-color: var(--ft-owe-border);
}

    .ft-stat-owe .ft-stat-label, .ft-stat-owe .ft-stat-line {
        color: var(--ft-owe-text);
    }

    .ft-stat-owe .ft-stat-value {
        color: var(--ft-owe);
    }

.ft-stat-owed {
    background: rgba(var(--mud-palette-primary-rgb), 0.08);
    border-color: rgba(var(--mud-palette-primary-rgb), 0.3);
}

    .ft-stat-owed .ft-stat-value {
        color: var(--ft-owed);
    }

.mud-button-root.ft-stat-pay:not(:disabled) {
    background: var(--mud-palette-text-primary);
    color: var(--mud-palette-surface);
}

.mud-button-root.ft-stat-pay {
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: none;
}

.ft-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 14px;
    background: var(--ft-tabs-bg);
}

    .ft-tabs > button {
        flex: 1;
        height: 44px;
        border: 0;
        border-radius: 10px;
        font: inherit;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        background: transparent;
        color: var(--ft-tile-other-fg);
    }

    .ft-tabs > button[aria-selected=true] {
        background: var(--ft-tab-on-bg);
        color: var(--mud-palette-text-primary);
        box-shadow: 0 1px 2px rgba(15, 31, 28, 0.08);
    }

.ft-pane {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (max-width: 1099.98px) {
    .ft-pane[data-on=false] {
        display: none;
    }
}

@media (min-width: 1100px) {
    .ft-tabs {
        display: none;
    }

    .ft-panes {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 380px;
        gap: 24px;
        align-items: start;
    }
}

@media (max-width: 599.98px) {
    .ft-trip-title {
        font-size: 28px;
    }

    .ft-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .ft-stat-main {
        grid-column: 1 / -1;
    }

    .ft-stat:not(.ft-stat-main) {
        padding: 12px 14px;
        border-radius: 16px;
    }

        .ft-stat:not(.ft-stat-main) .ft-stat-value {
            font-size: 19px;
        }
}

.ft-card {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ft-card-title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
}

.balance-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-variant-numeric: tabular-nums;
}

/* A balance bar: the left half fills towards the left for a negative balance, the right half to the right. */
.ft-bar {
    display: flex;
    gap: 2px;
    height: 8px;
}

.ft-bar-half {
    flex: 1;
    display: flex;
    overflow: hidden;
    background: var(--ft-bar-track);
}

.ft-bar-neg {
    justify-content: flex-end;
    border-radius: 4px 0 0 4px;
}

.ft-bar-pos {
    border-radius: 0 4px 4px 0;
}

.ft-bar-fill {
    height: 100%;
}

.ft-bar-neg .ft-bar-fill {
    background: var(--ft-bar-neg);
}

.ft-bar-pos .ft-bar-fill {
    background: var(--ft-bar-pos);
}

.ft-suggestion {
    padding: 12px;
    border-radius: 14px;
    background: var(--ft-row-soft);
}

.ft-suggestion-owe {
    background: var(--ft-owe-soft);
}

.ft-suggestion-owed {
    background: rgba(var(--mud-palette-primary-rgb), 0.1);
}

.ft-suggestion-amount.mud-typography {
    font-size: 16px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

h1:focus {
    outline: none;
}

.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);
}

#blazor-error-ui {
    /* Theme tokens, not a fixed light yellow: in dark mode the inherited light text was unreadable on it. */
    background: var(--ft-pill-unsynced-bg);
    color: var(--ft-pill-unsynced-fg);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui a {
        color: inherit;
        font-weight: 600;
        text-decoration: underline;
    }

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.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."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #E3E8E6;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #0F766E;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

/* The loader shows before MudBlazor's palette variables exist, so its dark colours are set here (R4, R7). */
html[data-theme=dark] .loading-progress circle {
    stroke: #26322F;
}

    html[data-theme=dark] .loading-progress circle:last-child {
        stroke: #5EC9B8;
    }

@media (prefers-color-scheme: dark) {
    html:not([data-theme=light]) .loading-progress circle {
        stroke: #26322F;
    }

        html:not([data-theme=light]) .loading-progress circle:last-child {
            stroke: #5EC9B8;
        }
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: var(--mud-palette-secondary);
}

.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;
}
.trip-card-link {
    color: inherit;
    text-decoration: none;
}

/*
 * Trip list (Pages/TripList, Components/TripCard, D7): the new and join buttons, and cards with an initial
 * tile and my balance chip (Phone-Trips artboard).
 */
.ft-trip-add {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

    .ft-trip-add .mud-button-root {
        height: 48px;
        border-radius: 14px;
        font-size: 14px;
        font-weight: 800;
    }

.mud-paper.ft-trip-card {
    padding: 16px 8px 16px 16px;
    border-radius: 20px;
}

    .ft-trip-card .trip-card-link {
        display: flex;
        gap: 14px;
        min-width: 0;
    }

.ft-trip-card-initial {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
}

.ft-trip-card-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .ft-trip-card-text .mud-typography-h6 {
        font-size: 16px;
        font-weight: 800;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ft-trip-card-text .mud-typography-body2 {
        font-size: 13px;
        color: var(--mud-palette-text-secondary);
        font-variant-numeric: tabular-nums;
    }

.ft-pill-owe {
    background: var(--ft-owe-soft);
    color: var(--ft-owe);
}

.ft-pill-owed {
    background: var(--ft-tile-groceries-bg);
    color: var(--ft-owed);
}

.ft-pill-settled {
    background: var(--ft-tile-other-bg);
    color: var(--ft-tile-other-fg);
}

.qr-code svg {
    width: 100%;
    max-width: 240px;
    height: auto;
}

/*
 * Expenses (Pages/TripDetail, Components/ExpenseRow, Components/CategoryIcon, Pages/ExpenseForm, D3, D5): day
 * headings with the day's total, rows in a card per day, marker pills, and the add actions.
 */
.ft-day-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding: 0 4px 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.ft-day-total {
    font-variant-numeric: tabular-nums;
}

.ft-day-rows {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 18px;
    overflow: hidden;
}

.expense-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    color: inherit;
    text-decoration: none;
    transition: background .15s;
}

    .expense-row:hover {
        background: var(--ft-row-soft);
    }

    .expense-row + .expense-row {
        border-top: 1px solid var(--mud-palette-lines-default);
    }

.ft-cat-tile {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .ft-cat-tile .mud-icon-root {
        font-size: 22px;
    }

.ft-tile-other {
    background: var(--ft-tile-other-bg);
    color: var(--ft-tile-other-fg);
}

.ft-row-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ft-row-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.ft-row-title {
    min-width: 0;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.expense-amount {
    flex: none;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.ft-row-sub {
    font-size: 13px;
    color: var(--mud-palette-text-secondary);
}

.ft-row-share {
    flex: none;
    font-size: 12px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.ft-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.ft-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

    .ft-pill .mud-icon-root {
        font-size: 14px;
    }

.ft-pill-changed {
    background: var(--ft-pill-changed-bg);
    color: var(--ft-pill-changed-fg);
}

.ft-pill-unsynced, .ft-pill-warn {
    background: var(--ft-pill-unsynced-bg);
    color: var(--ft-pill-unsynced-fg);
}

.ft-pill-photos {
    background: var(--ft-pill-photos-bg);
    color: var(--ft-pill-photos-fg);
}

.ft-pill-refused {
    background: var(--ft-pill-refused-bg);
    color: var(--ft-pill-refused-fg);
}

.ft-pill-conflict {
    background: var(--ft-pill-conflict-bg);
    color: var(--ft-pill-conflict-fg);
}

/* The add actions: header buttons from 900 px; below, fixed at the bottom right as the floating pair (D3). */
.ft-add {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .ft-add .mud-button-root {
        height: 44px;
        padding: 0 16px;
        border-radius: 12px;
        font-size: 14px;
        font-weight: 700;
        box-shadow: none;
    }

    .ft-add .ft-add-scan {
        border: 1.5px solid rgba(var(--mud-palette-primary-rgb), 0.3);
        background: var(--mud-palette-surface);
    }

@media (max-width: 899.98px) {
    .ft-add {
        position: fixed;
        right: 16px;
        bottom: 20px;
        gap: 10px;
        z-index: 3;
    }

        .ft-add .mud-button-root.ft-add-scan {
            width: 52px;
            min-width: 0;
            height: 52px;
            padding: 0;
            border-radius: 16px;
            box-shadow: 0 6px 20px rgba(15, 31, 28, 0.12);
        }

            .ft-add-scan .mud-button-icon-start {
                margin: 0;
            }

        .ft-add-scan-text {
            display: none;
        }

        .ft-add .mud-button-root.ft-add-expense {
            height: 56px;
            padding: 0 22px;
            border-radius: 18px;
            font-size: 15px;
            font-weight: 800;
            box-shadow: 0 8px 24px rgba(var(--mud-palette-primary-rgb), 0.35);
        }
}

/* Room under the last expense row so the floating add button (56px + 20px offset) never covers it. */
.expense-list {
    padding-bottom: 88px;
}

/*
 * Expense form (Pages/ExpenseForm, Components/SplitEditor, Components/ItemsEditor, D6): the amount in large type with
 * the currency beside it, the type switch, payer chips, date and category side by side, the split card and a Save bar
 * stuck to the bottom. The bar is in the flow (sticky), so at the end of the page it sits below the last field.
 */
.ft-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ft-seg {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 14px;
    background: var(--ft-tabs-bg);
}

    .ft-seg > button {
        flex: 1;
        min-height: 44px;
        padding: 0 8px;
        border: 0;
        border-radius: 10px;
        font: inherit;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        background: transparent;
        color: var(--ft-tile-other-fg);
    }

    .ft-seg > button[aria-pressed=true] {
        background: var(--ft-tab-on-bg);
        color: var(--mud-palette-text-primary);
        box-shadow: 0 1px 2px rgba(15, 31, 28, 0.08);
    }

.ft-seg-small {
    flex-wrap: wrap;
    border-radius: 12px;
}

    .ft-seg-small > button {
        flex: 1 0 auto;
        min-height: 40px;
        font-size: 13px;
    }

.ft-amount-card.ft-card {
    padding: 18px 16px;
    gap: 12px;
}

.ft-amount-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.ft-amount input.mud-input-slot {
    height: auto;
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.expense-currency {
    width: 7.5rem;
    flex-shrink: 0;
}

.ft-form-divided {
    padding-top: 12px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

    .ft-form-divided input.mud-input-slot {
        font-size: 17px;
        font-weight: 600;
    }

.ft-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ft-field-label {
    padding: 0 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--mud-palette-text-secondary);
}

.ft-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ft-chip {
    min-height: 44px;
    padding: 0 14px 0 6px;
    border-radius: 999px;
    border: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .ft-chip[aria-pressed=true] {
        border: 2px solid var(--mud-palette-primary);
        padding: 0 13px 0 5px;
        background: rgba(var(--mud-palette-primary-rgb), 0.12);
    }

.ft-chip-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
}

.ft-form-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@media (max-width: 359.98px) {
    .ft-form-pair {
        grid-template-columns: minmax(0, 1fr);
    }
}

.ft-cat-field {
    position: relative;
    min-width: 0;
}

.ft-cat-field-icon {
    position: absolute;
    left: 12px;
    top: 22px;
    z-index: 1;
    pointer-events: none;
}

.ft-cat-field .mud-input-outlined .mud-input-slot.mud-input-root-outlined {
    padding-inline-start: 50px;
}

.ft-cat-field .ft-cat-tile, .ft-cat-option .ft-cat-tile {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

    .ft-cat-field .ft-cat-tile .mud-icon-root, .ft-cat-option .ft-cat-tile .mud-icon-root {
        font-size: 16px;
    }

.ft-cat-option {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ft-split-card.ft-card {
    padding: 0;
    gap: 0;
    overflow: hidden;
}

.ft-split-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    padding: 14px 16px 10px;
}

    .ft-split-head .ft-card-title {
        font-size: 15px;
    }

.ft-split-row {
    min-height: 52px;
    padding: 4px 16px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

    .ft-split-row .split-share {
        font-weight: 700;
        font-variant-numeric: tabular-nums;
    }

.ft-split-foot {
    padding: 10px 16px 14px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.ft-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 16px 14px;
}

.ft-item-row {
    padding: 12px;
    border-radius: 14px;
    background: var(--ft-row-soft);
}

.ft-extras-title {
    flex-basis: 100%;
}

.ft-items-total.mud-typography {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.ft-save-bar {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: 12px 0 calc(16px + env(safe-area-inset-bottom));
    background: var(--mud-palette-background);
    border-top: 1px solid var(--mud-palette-lines-default);
}

    .ft-save-bar .mud-button-root {
        min-height: 52px;
        border-radius: 14px;
        font-size: 16px;
        font-weight: 800;
    }

.split-input {
    max-width: 9rem;
}

.split-auto {
    opacity: 0.7;
}

.split-share {
    min-width: 5rem;
    text-align: right;
}

/* The owe/owed colours, like the bars: MudBlazor's success and error are under 4.5:1 on white (ruling R23). */
.balance-positive {
    color: var(--ft-owed);
}

.balance-negative {
    color: var(--ft-owe);
}

/*
 * Claim items (Pages/ItemClaims, D9): from 1000 px the Who pays what panel is a sticky 360 px column beside the cards;
 * below that it sits above them.
 */
.ft-claims {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

@media (min-width: 1000px) {
    .ft-claims {
        grid-template-columns: minmax(0, 1fr) 360px;
        grid-template-areas: "main side";
        gap: 24px;
    }

    .ft-claims-side {
        grid-area: side;
        position: sticky;
        top: 72px;
    }

    .ft-claims-main {
        grid-area: main;
    }
}

.ft-claims-main {
    min-width: 0;
}

.ft-claims-side.ft-card {
    gap: 12px;
    padding: 18px;
}

.ft-claims-progress.mud-typography {
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.ft-claims-note.mud-typography {
    font-size: 13px;
    color: var(--mud-palette-text-secondary);
}

.ft-claims-people {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.ft-claims-person {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    text-align: left;
}

/* The people strip (D5): the By item cards' column template, and their border and padding, so each person's column lines up. */
.ft-claims-for {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--ft-claims-col, 64px), 1fr));
    gap: 4px;
    padding: 0 12px;
    border: 1px solid transparent;
    margin-bottom: 8px;
}

.ft-claims-tile {
    min-width: 0;
    padding: 6px 2px;
    border: 2px solid var(--mud-palette-lines-default);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: var(--mud-palette-surface);
}

    .ft-claims-tile .ft-claims-person-name {
        max-width: 100%;
        box-sizing: border-box;
        font-size: 13px;
        line-height: 1.25;
        /* Full names (people strip): a long name wraps between words inside its column, never cut with "…";
           only a single word wider than the column breaks inside. */
        white-space: normal;
        overflow-wrap: break-word;
        word-break: normal;
        text-align: center;
    }

        /* Me's name: a solid pill in Me's avatar colour; a rounded box rather than an oval, so a wrapped name stays readable. */
        .ft-claims-tile .ft-claims-person-name.is-me {
            padding: 1px 3px;
            border-radius: 8px;
            background: currentColor;
        }

    .ft-claims-tile .ft-claims-person-sub {
        text-align: center;
    }

            .ft-claims-tile .ft-claims-person-name.is-me > span {
                color: var(--mud-palette-surface);
            }

@media (max-width: 999.98px) {
    .ft-claims-people {
        display: none;
    }
}

@media (min-width: 1000px) {
    .ft-claims-people {
        gap: 4px;
        margin: 0 -8px;
        padding: 14px 0 0;
    }
}

.ft-claims-person-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ft-claims-person-name {
    font-size: 15px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.ft-claims-person-sub {
    font-size: 12px;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

.ft-claims-person-share {
    font-size: 16px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.ft-claims-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
}

/* By item (D4): a card per line; its person row has the strip's column template, so a person is at the same x everywhere. */
.ft-claims-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ft-claims-card {
    padding: 12px 12px 6px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 16px;
}

    /* Every unit has someone: a light tint, a teal left edge and the "All claimed" pill. */
    .ft-claims-card.is-done {
        background: color-mix(in srgb, var(--ft-owed) 6%, var(--mud-palette-surface));
        box-shadow: inset 3px 0 0 var(--ft-owed);
    }

.ft-claims-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin-bottom: 6px;
}

.ft-claims-card-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 15px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.ft-claims-card-state {
    font-size: 12px;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

.ft-pill.ft-claims-all {
    background: var(--ft-owed);
    color: var(--mud-palette-surface);
}

.ft-claims-card-price {
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.ft-claims-card-people {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--ft-claims-col, 64px), 1fr));
    gap: 4px;
}

.ft-claims-card-person {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* The avatar button: a 44 px target around a 38 px circle; its colour class (on the button) is the person's avatar colour. */
.ft-claims-add {
    position: relative;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    cursor: pointer;
}

    .ft-claims-add:disabled {
        cursor: default;
    }

    .ft-claims-add:focus-visible {
        outline: 2px solid var(--mud-palette-primary);
        outline-offset: 0;
        border-radius: 50%;
    }

/* Holding nothing: a dashed grey circle; Me's is pale in Me's colour. */
.ft-claims-add-dot {
    width: 38px;
    height: 38px;
    box-sizing: border-box;
    border-radius: 50%;
    border: 2px dashed var(--mud-palette-lines-inputs);
    color: var(--mud-palette-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
}

.ft-claims-add.is-me .ft-claims-add-dot {
    border-color: currentColor;
    background: color-mix(in srgb, currentColor 12%, transparent);
    color: inherit;
}

/* Holding a share: filled in the person's colour, initials in the surface colour. */
.ft-claims-add.is-on .ft-claims-add-dot {
    border: 2px solid currentColor;
    background: currentColor;
}

    .ft-claims-add.is-on .ft-claims-add-dot > span {
        color: var(--mud-palette-surface);
    }

/* The badge: the count, or a check on a single unit, in a surface pill ringed in the person's colour. */
.ft-claims-add-badge {
    position: absolute;
    top: -2px;
    right: -3px;
    min-width: 18px;
    height: 18px;
    box-sizing: border-box;
    padding: 0 4px;
    border-radius: 9px;
    border: 1.5px solid currentColor;
    background: var(--mud-palette-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

    .ft-claims-add-badge .mud-icon-root {
        width: 12px;
        height: 12px;
        font-size: 12px;
    }

/* "−": a small grey pill under the avatar; hidden at 0 but keeping its place, so the columns never shift. */
.ft-claims-remove {
    width: 34px;
    height: 24px;
    margin: 4px 0;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: var(--mud-palette-background-gray);
    color: var(--mud-palette-text-secondary);
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

    .ft-claims-remove.is-empty {
        visibility: hidden;
    }

    .ft-claims-remove:disabled {
        cursor: default;
    }

    .ft-claims-remove:focus-visible {
        outline: 2px solid var(--mud-palette-primary);
        outline-offset: 2px;
    }

/* Photos (Components/AttachmentsSection, PhotoViewerDialog, Pages/ShareTarget) */
.attachment-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.attachment-cell {
    width: 96px;
}

.attachment-thumb {
    display: block;
    width: 96px;
    height: 96px;
    padding: 0;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
    background: var(--mud-palette-background-gray);
    overflow: hidden;
    cursor: pointer;
}

.attachment-thumb img, .attachment-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-thumb-img {
    width: 96px;
    height: 96px;
    border-radius: 4px;
}

.attachment-full {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    margin: 0 auto;
}

.attachment-pick {
    width: 100%;
    background: none;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    font: inherit;
    cursor: pointer;
}

.ops-mono {
    font-family: ui-monospace, monospace;
    word-break: break-all;
}

.scan-input {
    display: none;
}

.scan-pick {
    cursor: pointer;
}

.scan-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
}

.crop-stage {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.crop-image {
    display: block;
    max-width: 100%;
    max-height: 65vh;
}

/*
 * Receipt review (Pages/ScanReviewPage, Components/ScanLineRow, D8): from 1000 px a sticky 400 px photo column beside
 * the lines; below that the photo sits above them, clipped to 260 px, and opens in full on tap. The total check and
 * Confirm are in a bar fixed to the bottom; the main column is padded by its height so it covers neither the last
 * field nor the guest footer.
 */
.review-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.review-pages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
}

.review-photo {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
}

    .review-photo img {
        width: 100%;
        display: block;
    }

/* A PDF receipt has no photo to show. */
.review-pages:not(:has(.review-photo)) {
    display: none;
}

@media (min-width: 1000px) {
    .review-layout {
        display: grid;
        grid-template-columns: 400px minmax(0, 1fr);
        gap: 28px;
        align-items: start;
    }

    .review-layout:not(:has(.review-photo)) {
        grid-template-columns: minmax(0, 1fr);
    }

    .review-pages {
        position: sticky;
        top: 72px;
        max-height: calc(100dvh - 72px - 120px);
        overflow-y: auto;
        padding: 12px;
    }
}

.review-main {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.review-card.ft-card {
    gap: 8px;
    padding: 16px 0;
}

    .review-card .ft-card-title, .review-card > .mud-button-root {
        margin: 0 18px;
    }

.review-line {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 18px;
}

    .review-line + .review-line {
        border-top: 1px solid var(--mud-palette-lines-default);
    }

    .review-line.line-low {
        background: var(--ft-row-low);
    }

.review-line-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

    .review-line-fields .mud-input-control {
        margin-top: 0;
    }

    .review-line-fields .review-line-name {
        flex: 1 1 220px;
        min-width: 0;
    }

    .review-line-fields .review-line-qty {
        flex: 0 0 5rem;
    }

    .review-line-fields .review-line-money {
        flex: 0 0 6.5rem;
    }

.review-line-total input {
    font-weight: 800;
}

.review-line-fields input {
    font-variant-numeric: tabular-nums;
}

.review-line-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.review-line-actions {
    display: flex;
    gap: 2px;
    margin-left: auto;
}

@media (max-width: 599.98px) {
    .review-line-fields .review-line-name {
        flex-basis: 100%;
    }

    .review-line-fields .review-line-qty, .review-line-fields .review-line-money {
        flex: 1 1 4.5rem;
    }
}

.review-extras {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

    .review-extras .mud-input-control {
        margin-top: 0;
    }

.review-printed-total input {
    font-weight: 800;
}

.review-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    background: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-lines-default);
    box-shadow: 0 -8px 24px rgba(15, 31, 28, 0.06);
}

.review-bar-inner {
    max-width: 1280px;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 20px;
}

.review-check {
    flex: 1 1 320px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.review-check-icon {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.total-ok .review-check-icon {
    background: var(--ft-tile-groceries-bg);
    color: var(--ft-owed);
}

.total-mismatch .review-check-icon {
    background: var(--ft-owe-soft);
    color: var(--ft-owe);
}

.total-mismatch .mud-typography-caption {
    color: var(--ft-owe-text);
}

.review-check-title.mud-typography {
    font-size: 15px;
    font-weight: 800;
}

.review-bar .review-confirm.mud-button-root {
    flex: 1 1 auto;
    max-width: 100%;
    min-height: 52px;
    padding: 0 28px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 800;
}

@media (min-width: 600px) {
    .review-bar .review-confirm.mud-button-root {
        flex: 0 0 auto;
    }
}

@media (min-width: 900px) {
    .review-bar {
        left: 272px;
    }
}

/* Room for the bar under the last field and the guest footer: the bar wraps to two rows below 600 px. */
.mud-main-content:has(.review-bar) {
    padding-bottom: 200px;
}

@media (min-width: 600px) {
    .mud-main-content:has(.review-bar) {
        padding-bottom: 110px;
    }
}

.review-photo-full {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
    box-sizing: border-box;
    overflow: auto;
    background: rgba(0, 0, 0, 0.85);
    cursor: zoom-out;
}

    .review-photo-full img {
        width: 100%;
        max-width: 1000px;
        height: auto;
        display: block;
    }

/*
 * Button tooltips (js/tooltip.js, ui-button-tooltips D5–D6). Fixed, placed by the script; above MudBlazor popovers so
 * items in an open menu can show one. Click-through unless opened by the pointer, which may then rest on it (D4).
 */
.ft-tip {
    position: fixed;
    z-index: 2000;
    max-width: min(280px, 100vw - 16px);
    box-sizing: border-box;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--ft-tip-bg);
    color: var(--ft-tip-fg);
    box-shadow: 0 6px 20px rgba(15, 31, 28, 0.12);
    font-size: 0.8125rem;
    line-height: 1.35;
    pointer-events: none;
}

    .ft-tip.ft-tip-hoverable {
        pointer-events: auto;
    }

    .ft-tip-name {
        display: block;
        font-weight: 700;
    }

/* A long-press shows the tip (D4): no iOS callout or text selection on the button. */
[data-tip] {
    -webkit-touch-callout: none;
    user-select: none;
}
