/*
 * Fyrabe – Off-Grid CI colors, mobile-first.
 * CI: orange #FF9524, green #274F2A, warm off-white #f5f4f0 (from the Off-Grid landing page).
 * Theme: light by default; dark via the system setting or the toggle (html[data-theme]).
 * Contrast: text on orange uses night green #14291a (≈6.9:1); #274F2A on orange is only ≈4.2:1.
 */
:root {
    --orange: #FF9524;
    --orange-hover: #f58410;
    --orange-ink: #a85800;   /* orange dark enough for text on light backgrounds */
    --orange-soft: #fff1e0;
    --green: #274F2A;
    --green-2: #3d6b41;
    --green-soft: #e5ece4;
    --night: #14291a;

    --bg: #f5f4f0;
    --surface: #ffffff;
    --surface-2: #faf9f6;
    --text: #1d2a1f;
    --text-2: #435045;
    --muted: #646d63;
    --line: #e4e2d9;

    --primary: var(--orange);
    --primary-hover: var(--orange-hover);
    --on-primary: var(--night);
    --secondary: var(--green);
    --on-secondary: #ffffff;
    --link: var(--green);
    --nav-active-bg: var(--green-soft);
    --nav-active: var(--green);
    --highlight: var(--orange-ink);
    --highlight-soft: var(--orange-soft);
    --focus: var(--orange);

    --warn: #8a6410;
    --warn-soft: #fbf3d9;
    --danger: #b83a3a;
    --danger-soft: #f9e4e2;
    --ok: var(--green-2);
    /* Dashboard chart (income vs expenses): checked for colour-blind separation and 3:1 against the surface. */
    --chart-income: #2f6b35;
    --chart-expense: #d06f00;
    /* Profit line: the ink colour, so it stands apart from both bar hues in every mode (resolves per theme). */
    --chart-profit: var(--text);

    --radius: 16px;
    --shadow: 0 1px 2px rgba(29, 42, 31, .06), 0 8px 24px rgba(29, 42, 31, .06);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color-scheme: light;
}

/* Dark: explicit choice … */
:root[data-theme="dark"] {
    --bg: #0f1c12;
    --surface: #15271a;
    --surface-2: #1a2f1f;
    --text: #f5f4f0;
    --text-2: #c9cec4;
    --muted: #9da79a;
    --line: #253a2a;

    --primary: var(--orange);
    --primary-hover: #ffa846;
    --on-primary: var(--night);
    --secondary: var(--green-2);
    --on-secondary: #ffffff;
    --link: #ffb25e;
    --nav-active-bg: #2e2412;
    --nav-active: var(--orange);
    --highlight: #ffb25e;
    --highlight-soft: #2e2412;
    --focus: var(--orange);

    --warn: #e8c46a;
    --warn-soft: #332a12;
    --danger: #f08a80;
    --danger-soft: #3a1f1c;
    --ok: #8fc796;
    --chart-income: #2f7337;
    --chart-expense: #d27d22;

    --shadow: none;
    color-scheme: dark;
}

/* … or the system setting, unless light was chosen explicitly. Keep in sync with the block above. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0f1c12;
        --surface: #15271a;
        --surface-2: #1a2f1f;
        --text: #f5f4f0;
        --text-2: #c9cec4;
        --muted: #9da79a;
        --line: #253a2a;

        --primary: var(--orange);
        --primary-hover: #ffa846;
        --on-primary: var(--night);
        --secondary: var(--green-2);
        --on-secondary: #ffffff;
        --link: #ffb25e;
        --nav-active-bg: #2e2412;
        --nav-active: var(--orange);
        --highlight: #ffb25e;
        --highlight-soft: #2e2412;
        --focus: var(--orange);

        --warn: #e8c46a;
        --warn-soft: #332a12;
        --danger: #f08a80;
        --danger-soft: #3a1f1c;
        --ok: #8fc796;
        --chart-income: #2f7337;
        --chart-expense: #d27d22;

        --shadow: none;
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 1.75rem 0 .75rem; }
h3 { font-size: .95rem; margin: 1.25rem 0 .25rem; }
h1:focus { outline: none; }

/* ---- Shell ---- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: .75rem;
    padding: .7rem 1rem;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 1.15rem; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand .dot { color: var(--orange); }
.company-switch { max-width: 14rem; padding: .35rem .5rem; }
.topnav { display: flex; align-items: center; gap: .25rem; margin-left: auto; min-width: 0; }
.topnav > a, .menu-button { padding: .4rem .75rem; border-radius: 999px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.topnav > a.active, .menu-button.active { background: var(--nav-active-bg); color: var(--nav-active); }
.topnav > a:hover { text-decoration: none; color: var(--text); }

/* Top-bar dropdowns (NavDropdown): at most four entries on desktop, the rest in panels. */
.menu { position: relative; }
.menu-button {
    background: none; border: 0; box-shadow: none; margin: 0; font: inherit; cursor: pointer;
    display: inline-flex; align-items: center; gap: .3rem;
}
.menu-button:hover { color: var(--text); background: none; }
.menu-button.active:hover { background: var(--nav-active-bg); color: var(--nav-active); }
/* Lucide line icons (Components/Icon.razor): they draw in currentColor. */
.icon { display: block; flex: none; }
.icon.inline { display: inline-block; vertical-align: -.2em; }
.icon.ok { color: var(--ok); }
.icon.no { color: var(--danger); }
.menu-button .chevron { display: inline-flex; opacity: .7; margin-left: .1rem; vertical-align: middle; }
.menu-panel {
    position: absolute; top: calc(100% + .45rem); left: 0; z-index: 20;
    min-width: 13rem; display: flex; flex-direction: column; padding: .35rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.menu-right .menu-panel { left: auto; right: 0; }
.menu-panel a { padding: .55rem .75rem; border-radius: 8px; color: var(--text); white-space: nowrap; }
.menu-panel a:hover { background: var(--surface-2); text-decoration: none; }
.menu-panel a.active { color: var(--nav-active); background: var(--nav-active-bg); }
.menu-panel hr { border: 0; border-top: 1px solid var(--line); margin: .3rem .25rem; }
.menu-backdrop { position: fixed; inset: 0; z-index: 9; } /* below the sticky top bar (z 10): a click outside closes the menu */
.topbar .spacer { margin-left: auto; }

.theme-toggle {
    background: none; border: 1px solid var(--line); color: var(--text-2);
    flex: none; width: 2.25rem; height: 2.25rem; padding: 0; border-radius: 50%;
    display: inline-grid; place-items: center; line-height: 1;
}
.theme-toggle:hover { color: var(--highlight); border-color: var(--highlight); }

.lang-switch {
    flex: none; width: auto; margin-top: 0; height: 2.25rem;
    padding: 0 .5rem; border-radius: 999px; font-size: .85rem; font-weight: 700; color: var(--text-2);
}

.content { flex: 1; width: 100%; max-width: 56rem; margin: 0 auto; padding: 1.25rem 1rem 6rem; }

.tabbar { display: none; }

.logout-icon { display: none; }

/* Laptops and small windows: keep the top bar on one line (no sideways scrolling). */
@media (max-width: 1100px) {
    .topbar { gap: .5rem; }
    .company-switch { max-width: 10rem; text-overflow: ellipsis; }
    .topnav > a, .menu-button { padding: .4rem .55rem; }
    .logout { padding: .25rem; }
    .logout-text { display: none; }
    .logout-icon { display: inline-flex; }
}

@media (max-width: 860px) {
    .topnav { display: none; }
    .menu-backdrop { display: none; }
    /* Everything in the top bar must fit 360px; otherwise phones widen the layout viewport and the tab bar drops off-screen. */
    .topbar { gap: .4rem; padding: .6rem .75rem; }
    .company-switch { margin-left: auto; flex: 0 1 auto; min-width: 0; max-width: 9rem; text-overflow: ellipsis; }
    .logout { padding: .25rem; }
    .logout-text { display: none; }
    .logout-icon { display: inline-flex; }
    .hide-mobile { display: none !important; }
    .tabbar {
        position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
        display: flex; justify-content: space-around;
        padding: .4rem .5rem calc(.4rem + env(safe-area-inset-bottom));
        background: var(--surface); border-top: 1px solid var(--line);
    }
    .tabbar a, .tabbar .tab { display: flex; flex-direction: column; align-items: center; gap: .2rem; font-size: .75rem; color: var(--muted); padding: .25rem .6rem; min-width: 3.5rem; }
    .tabbar .tab { background: none; border: 0; box-shadow: none; margin: 0; font-family: inherit; font-weight: 400; cursor: pointer; }
    .tabbar .tab-primary { color: var(--text-2); }

    /* "Neu" action sheet above the tab bar. */
    .sheet-backdrop { position: fixed; inset: 0; z-index: 11; background: rgba(0, 0, 0, .35); }
    .sheet {
        position: fixed; left: .75rem; right: .75rem; bottom: calc(4.75rem + env(safe-area-inset-bottom)); z-index: 12;
        display: flex; flex-direction: column; gap: .15rem; padding: .5rem;
        background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
    }
    .sheet-icon { display: inline-flex; justify-content: center; width: 1.75rem; color: var(--highlight); }
    /* .tabbar .sheet: the sheet sits inside the tab bar, so it must beat ".tabbar a" (column layout, small text). */
    .tabbar .sheet .sheet-item { background: none; border: 0; box-shadow: none; width: 100%; display: flex; flex-direction: row; align-items: center; gap: .75rem; letter-spacing: normal; padding: .85rem 1rem; border-radius: 10px; color: var(--text); font-weight: 600; font-size: 1rem; text-align: left; }
    .sheet .sheet-item:hover { background: var(--surface-2); text-decoration: none; }
    .sheet-cancel { margin-top: .25rem; background: none; border: 0; box-shadow: none; color: var(--muted); padding: .7rem; font: inherit; }
    .tabbar a.active { color: var(--nav-active); }
    .tabbar a:hover { text-decoration: none; }
    .tab-icon { display: grid; place-items: center; height: 1.6rem; }
    .tabbar .tab-primary .tab-icon {
        background: var(--primary); color: var(--on-primary);
        width: 3rem; height: 3rem; border-radius: 50%;
        display: grid; place-items: center; margin-top: -1.4rem;
        box-shadow: 0 6px 18px rgba(255, 149, 36, .35);
    }
}

/* ---- Cards and layout ---- */
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1rem;
}
.card.narrow { max-width: 30rem; margin-left: auto; margin-right: auto; }
.danger-zone { border-color: var(--danger-soft); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.head-row h1 { margin: 0; }
.row { display: flex; gap: .75rem; }
.row > .w-1 { flex: 1; } .row > .w-2 { flex: 2; } .row > .w-3 { flex: 3; }
/* Flex items default to min-width: auto, i.e. the widest option of a select inside them; without this a long
   category label widens its column and pushes the row past the card (tablets, where rows sit side by side). */
.row > * { min-width: 0; }
@media (max-width: 480px) { .row { flex-direction: column; gap: 0; } }
.actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.grow { flex: 1; min-width: 0; }

/* ---- Forms ---- */
label { display: block; margin-bottom: .9rem; font-size: .9rem; font-weight: 600; color: var(--text-2); }
input, select, textarea {
    display: block; width: 100%; margin-top: .3rem;
    font: inherit; font-weight: 400; color: var(--text);
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
    padding: .6rem .7rem;
}
/* A select is as wide as its longest option unless capped (also for width: auto ones in filters). */
input, select, textarea { max-width: 100%; }
select { min-width: 0; text-overflow: ellipsis; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }
input[readonly] { color: var(--muted); }
input.big { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
input[type=file] { padding: .5rem; }
.topbar select { margin-top: 0; width: auto; }
/* Field errors sit directly under their input (ValidationMessage, client- and server-side, see ServerValidation). */
.validation-message { display: block; color: var(--danger); font-size: .85rem; font-weight: 600; margin-top: .3rem; }
input.invalid, select.invalid, textarea.invalid { border-color: var(--danger); }
input.invalid:focus, select.invalid:focus, textarea.invalid:focus { outline-color: var(--danger); }
.inline-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .25rem 0; }
.inline-form input { margin-top: 0; width: auto; flex: 1; min-width: 8rem; }
.inline-form .narrow-input { flex: 0 0 5rem; min-width: 0; }
/* An input with its validation message under it, inside an inline form. */
.inline-form .inline-field { flex: 1; min-width: 8rem; align-self: flex-start; }
.inline-form .inline-field input, .inline-form .inline-field select { width: 100%; }
.inline-form .inline-field.narrow-input { flex: 0 0 5rem; min-width: 0; }
.inline-form > .validation-message { flex-basis: 100%; margin-top: 0; }

/* ---- Buttons (primary = orange with night-green text, as on the Off-Grid site) ---- */
button, .button {
    font: inherit; font-weight: 700; cursor: pointer; display: inline-block;
    border-radius: 10px; padding: .6rem 1.15rem; border: 1px solid transparent; text-align: center;
}
button:disabled { opacity: .55; cursor: default; }
/* ActionButton: disabled with a spinner while its action runs. */
.action-button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.action-button[aria-busy=true] { cursor: progress; }
.action-button[aria-busy=true]:disabled { opacity: .8; }
.spinner {
    flex: none; width: 1em; height: 1em; border-radius: 50%;
    border: 2px solid currentColor; border-right-color: transparent;
    animation: spin .7s linear infinite;
}
.inline-spinner { display: inline-block; vertical-align: middle; margin-left: .4rem; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

/* LoadingSpinner: while a page loads; fades in after 250 ms so fast loads don't flash it. */
.loading-spinner {
    display: flex; justify-content: center; align-items: center; padding: 3rem 0;
    opacity: 0; animation: loading-fade-in .2s ease-out .25s forwards;
}
.loading-spinner-ring {
    width: 2.25rem; height: 2.25rem; border-radius: 50%;
    border: 3px solid var(--line); border-top-color: var(--primary);
    animation: spin .8s linear infinite;
}
@keyframes loading-fade-in { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .loading-spinner-ring { animation-duration: 2.4s; } }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
button:focus-visible, .button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 18px rgba(255, 149, 36, .25); }
.primary:hover { background: var(--primary-hover); text-decoration: none; }
.secondary { background: var(--secondary); color: var(--on-secondary); }
.secondary:hover { filter: brightness(1.1); text-decoration: none; }
.danger { background: var(--danger); color: #fff; }
.link { background: none; border: none; color: var(--link); padding: .25rem .4rem; font-weight: 600; box-shadow: none; }
.danger-text { color: var(--danger); }
.block { display: block; width: 100%; }
/* Sign in with Google: neutral, as Google's branding asks, with the "G" before the label. */
.external-login {
    display: flex; align-items: center; justify-content: center; gap: .6rem;
    background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: none;
}
.external-login:hover { background: var(--surface-2); }
.or-divider { display: flex; align-items: center; gap: .75rem; margin: 1rem 0; color: var(--muted); font-size: .85rem; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.action-button.block { display: flex; } /* keeps the spinner next to the label in full-width buttons */
button.small, .link.small { font-size: .85rem; padding: .3rem .6rem; }

.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.segmented button { background: none; color: var(--muted); border-radius: 999px; padding: .35rem .9rem; font-weight: 600; box-shadow: none; }
.segmented button.on { background: var(--secondary); color: var(--on-secondary); }
.segmented.wide { display: flex; margin-bottom: 1rem; }
.segmented.wide button { flex: 1; }

/* ---- Messages ---- */
.error { background: var(--danger-soft); color: var(--danger); padding: .6rem .8rem; border-radius: 10px; font-size: .9rem; }
.ok { color: var(--ok); font-weight: 600; }
.notice { background: var(--warn-soft); color: var(--warn); padding: .6rem .8rem; border-radius: 10px; }

/* ---- Lists ---- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: none; }
.list li.indent { padding-left: 1.25rem; }
.account-head { color: var(--highlight); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.share { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; }
.share.partial { color: var(--highlight); font-weight: 700; }

.filters { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin: 1rem 0; }
.filters select { width: auto; margin-top: 0; }

.totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.totals .money { overflow: hidden; text-overflow: ellipsis; }
.totals > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: .6rem .75rem; display: flex; flex-direction: column; }
.totals > div:last-child { background: var(--highlight-soft); border-color: transparent; }
.totals .money { font-weight: 700; font-size: 1.05rem; }
@media (max-width: 480px) {
    .totals { gap: .35rem; }
    .totals > div { padding: .5rem .55rem; }
    .totals .money { font-size: .85rem; }
}

.entries { list-style: none; margin: 0; padding: 0; }
.entries li a { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem .25rem; border-bottom: 1px solid var(--line); color: var(--text); }
.entries li a:hover { text-decoration: none; background: var(--surface-2); }
.entries .date { color: var(--muted); font-variant-numeric: tabular-nums; width: 3.2rem; flex: none; }
.entries .desc { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.entries .amount { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; font-weight: 600; }

.money { font-variant-numeric: tabular-nums; white-space: nowrap; }

.chip { font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; }
.chip.draft { background: var(--warn-soft); color: var(--warn); }
.chip.reversed, .chip.reversal { background: var(--danger-soft); color: var(--danger); }

.details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .4rem 1rem; margin: 0 0 1rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }

.logo-preview { max-height: 4rem; max-width: 12rem; display: block; margin-bottom: .5rem; }

/* ---- Account (ACC-01..03): server-rendered pages under /Identity share this stylesheet ---- */
.account-link {
    flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%;
    display: inline-grid; place-items: center; color: var(--text-2); border: 1px solid var(--line);
}
.account-link:hover { color: var(--highlight); border-color: var(--highlight); text-decoration: none; }
@media (max-width: 860px) { .account-link { display: none; } } /* phones: under "Mehr"; the top bar must fit 360px */
.back-to-app { margin-left: auto; color: var(--text-2); font-weight: 600; }
.account-nav { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 1.25rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
.account-nav a { padding: .35rem .8rem; border-radius: 999px; color: var(--text-2); font-weight: 600; font-size: .9rem; }
.account-nav a:hover { text-decoration: none; color: var(--text); }
.account-nav a.active { background: var(--nav-active-bg); color: var(--nav-active); }
.account form + h2, .account form + form { margin-top: 1.75rem; }
.status-ok { background: var(--green-soft); color: var(--green); padding: .6rem .8rem; border-radius: 10px; font-weight: 600; }
.chip.on, .chip.linked { background: var(--green-soft); color: var(--green); }
:root[data-theme="dark"] :is(.status-ok, .chip.on, .chip.linked) { background: #1e3523; color: var(--ok); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.status-ok, .chip.on, .chip.linked) { background: #1e3523; color: var(--ok); } }
.chip.off { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
label.checkbox { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
label.checkbox input { width: auto; margin: 0; }
.steps { padding-left: 1.25rem; margin: 0; }
.steps > li { margin-bottom: 1.25rem; }
/* QR code: always dark on white, also in the dark theme (scanners need the contrast). */
.qr-tile { width: 12rem; max-width: 100%; padding: .5rem; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
.qr-tile svg { display: block; width: 100%; height: auto; }
.shared-key, .recovery-codes code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95rem;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: .1rem .4rem;
    overflow-wrap: anywhere;
}
.recovery-codes { list-style: none; padding: 0; margin: 1rem 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.recovery-codes code { display: block; text-align: center; padding: .4rem; letter-spacing: .04em; }

/* ---- Audit ---- */
.audit { list-style: none; padding: 0; margin: 0; }
.audit li { border-bottom: 1px solid var(--line); }
.audit summary { display: flex; gap: .75rem; padding: .6rem 0; cursor: pointer; flex-wrap: wrap; }
.diff { padding: 0 0 .75rem; font-size: .85rem; }
.diff-row { display: grid; grid-template-columns: 9rem 1fr auto 1fr; gap: .5rem; padding: .15rem 0; }
.diff-row .field { color: var(--muted); }
.diff-row .before { color: var(--danger); overflow-wrap: anywhere; }
.diff-row .after { color: var(--ok); overflow-wrap: anywhere; }
@media (max-width: 480px) { .diff-row { grid-template-columns: 1fr; } .diff-row .arrow { display: none; } }

/* ---- Blazor loading and error UI ---- */
.loading-progress { position: absolute; display: block; width: 6rem; height: 6rem; inset: 30vh 0 auto 0; margin: 0 auto; }
.loading-progress circle { fill: none; stroke: var(--line); stroke-width: .5rem; transform-origin: 50% 50%; transform: rotate(-90deg); }
.loading-progress circle:last-child {
    stroke: var(--orange);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray .05s ease-in-out;
}
.loading-progress-text { position: absolute; text-align: center; font-weight: 700; inset: calc(30vh + 2.3rem) 0 auto .2rem; color: var(--muted); }
.loading-progress-text:after { content: var(--blazor-load-percentage-text, ""); }

#blazor-error-ui {
    background: var(--danger-soft); color: var(--danger);
    bottom: 0; left: 0; right: 0; display: none; position: fixed; z-index: 1000;
    padding: .75rem 1.25rem;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
