/* Theme CSS variables - Intelis brand.
   Tokens live on :root (light defaults) and are overridden by the .dark-mode
   class on <html> (set by themeManager.setDarkModeClass). A future global
   style adds a parallel .theme-{style} class on <html> via
   themeManager.setStyleClass and overrides the same tokens. */
:root {
    /* Brand */
    --intelis-primary: #022a3a;
    --intelis-secondary: #f47b30;
    --intelis-tertiary: #277493;

    /* AppBar */
    --intelis-appbar-start: #022a3a;
    --intelis-appbar-end: #277493;

    /* Links */
    --intelis-link: #277493;

    /* Buttons (bootstrap fallback used outside MudBlazor) */
    --intelis-btn-primary-text: #ffffff;
    --intelis-btn-primary-bg: #022a3a;
    --intelis-btn-primary-border: #03121a;

    /* Drawer */
    --intelis-drawer-bg: #edf2f5;
    --intelis-drawer-border: #d5dee3;
    --intelis-drawer-text: #414e56;
    --intelis-drawer-hover-bg: #dce5ea;
    --intelis-drawer-hover-text: #022a3a;
    --intelis-drawer-active-text: #f47b30;
    --intelis-drawer-active-icon: #f47b30;
    --intelis-drawer-active-border: #f47b30;
    --intelis-drawer-active-bg: rgba(244, 123, 48, 0.12);
    --intelis-drawer-icon: #277493;
    --intelis-drawer-icon-hover: #022a3a;

    /* Version badge in drawer */
    --intelis-badge-text: #277493;
    --intelis-badge-border: #cfd1d2;
    --intelis-badge-hover-text: #022a3a;

    /* Primary roles (WI-07027): MudBlazor's --mud-palette-primary is the TEXT role (links,
       tabs, outlined/text buttons, icons); filled primary components (buttons, chips,
       badges, FABs…) take the FILL role from these tokens — see "Primary fill role" below.
       By default both roles are the same; a style overrides them when one colour cannot
       serve both (Intelis light). */
    --app-primary-fill: var(--mud-palette-primary);
    --app-primary-fill-hover: var(--mud-palette-primary-darken);
    --app-primary-fill-text: var(--mud-palette-primary-text);
}

.dark-mode {
    color-scheme: dark;
    --intelis-appbar-start: #03121a;
    --intelis-appbar-end: #214453;

    --intelis-drawer-bg: #1a1a1a;
    --intelis-drawer-border: #333333;
    --intelis-drawer-text: #b0bec5;
    --intelis-drawer-hover-bg: rgba(255, 255, 255, 0.08);
    --intelis-drawer-hover-text: #e0e0e0;
    --intelis-drawer-icon: #5b8a9a;
    /* Faithful to the pre-token cascade: in dark mode the later
       `.dark-mode .mud-nav-link` / `... .mud-nav-link-icon` rules used to win
       over the light `.active` / `:hover .mud-nav-link-icon` rules, so an
       active item kept the plain text/icon colours (only its tinted background
       and mini-drawer border stayed orange), and the hover icon kept the plain
       icon colour. Verified by a computed-style before/after probe (TP-1403). */
    --intelis-drawer-active-text: #b0bec5;
    --intelis-drawer-active-icon: #5b8a9a;
    --intelis-drawer-icon-hover: #5b8a9a;
    /* --intelis-drawer-active-border, --intelis-drawer-active-bg and
       --intelis-badge-hover-text keep their light values in dark mode
       (also behaviour preserved from the pre-token CSS). */

    --intelis-badge-text: #7fa8b8;
    --intelis-badge-border: #444444;
}

/* ── Intelis style (ES-299) ─────────────────────────────────────────────
   Token overrides for the theme-intelis class on <html> (set by
   themeManager.setStyleClass). MudBlazor palette colours come from
   IntelisTheme.BuildIntelisTheme(); the tokens below drive the app-level
   CSS (appbar gradient, drawer accents, badges).
   NOTE: this block must come after .dark-mode, and every token that differs
   in dark mode must be re-set in .theme-intelis.dark-mode below — the
   two-class selector wins over both single-class blocks. */
.theme-intelis {
    --intelis-primary: #c24a00;
    --intelis-secondary: #0e2a38;

    /* WI-07027: fills are the light orange with navy text (7.1:1; hover = brand
       #f27a1a, 6.4:1); the primary itself is the dark orange #c24a00 for text. */
    --app-primary-fill: #f58742;
    --app-primary-fill-hover: #f27a1a;
    --app-primary-fill-text: #071a24;

    /* AppBar: navy → deep orange. NOT the pure brand #f27a1a — white appbar
       icons on it would be ~2.8:1 (below the 3:1 non-text minimum);
       #c8601a gives ~4.1:1. */
    --intelis-appbar-start: #0e2a38;
    --intelis-appbar-end: #c8601a;

    /* Drawer active accents (WI-07027): one step darker than the text orange #c24a00,
       #b24400 keeps 4.5:1 on the tinted background (the brand #f27a1a was 2.2:1);
       the border keeps the brand orange. */
    --intelis-drawer-active-text: #b24400;
    --intelis-drawer-active-icon: #b24400;
    --intelis-drawer-active-border: #f27a1a;
    --intelis-drawer-active-bg: rgba(242, 122, 26, 0.12);

    /* Tile accent palette (intelis.cz landing tiles). Applied only through
       the .tile-accent-* classes below — opt-in per component. */
    --intelis-tile-1: #f27a1a;
    --intelis-tile-2: #f7b88a;
    --intelis-tile-3: #c9cdd0;
    --intelis-tile-4: #8aa9b5;
    --intelis-tile-5: #5a8193;
    --intelis-tile-6: #0e2a38;
}

.theme-intelis.dark-mode {
    /* Dark mode: one orange (#f29a5c, navy text) serves both roles again. */
    --app-primary-fill: var(--mud-palette-primary);
    --app-primary-fill-hover: var(--mud-palette-primary-darken);
    --app-primary-fill-text: var(--mud-palette-primary-text);

    --intelis-appbar-start: #051821;
    --intelis-appbar-end: #8a4512;

    /* Navy-tinted drawer instead of neutral gray (mirrors the Intelis
       PaletteDark in IntelisTheme). */
    --intelis-drawer-bg: #0b222e;
    --intelis-drawer-border: #1d3d4c;
    --intelis-drawer-text: #cfe0e8;
    --intelis-drawer-hover-bg: rgba(255, 255, 255, 0.08);
    --intelis-drawer-hover-text: #ffffff;
    --intelis-drawer-icon: #6ba5bd;
    /* Same dark-mode semantics as the default style: active/hover items keep
       the plain text/icon colours, only the tinted background and the
       mini-drawer border stay orange. */
    --intelis-drawer-active-text: #cfe0e8;
    --intelis-drawer-active-icon: #6ba5bd;
    --intelis-drawer-icon-hover: #6ba5bd;

    --intelis-badge-text: #6ba5bd;
    --intelis-badge-border: #2a4a5a;

    /* Muted tile accents for dark surfaces. */
    --intelis-tile-1: #c8601a;
    --intelis-tile-2: #b57f52;
    --intelis-tile-3: #6d7275;
    --intelis-tile-4: #5a7482;
    --intelis-tile-5: #3d5a6b;
    --intelis-tile-6: #163847;
}

/* ── Primary fill role (WI-07027) ────────────────────────────────────────
   Filled primary components re-point the MudBlazor primary variables to the
   --app-primary-fill* tokens, so MudBlazor's own rules paint them with the fill
   role. Only custom properties are set here, so the cascade order against
   MudBlazor.min.css does not matter. */
.mud-button-filled-primary,
.mud-button-group-filled-primary .mud-button-root,
.mud-chip-filled.mud-chip-color-primary,
.mud-theme-primary,
.mud-fab-primary,
.mud-avatar-filled-primary,
.mud-alert-filled-primary,
.mud-timeline-dot-primary,
.mud-slider-primary .mud-slider-value-label,
.mud-tabs-tabbar-primary,
.travel-file-button-primary {
    --mud-palette-primary: var(--app-primary-fill);
    --mud-palette-primary-darken: var(--app-primary-fill-hover);
    --mud-palette-primary-text: var(--app-primary-fill-text);
}

/* ── Avocado style ("Avocado Toast", ES-299) ──────────────────────────── */
.theme-avocado {
    --intelis-primary: #4f772d;
    --intelis-secondary: #bc4749;

    --intelis-appbar-start: #31572c;
    --intelis-appbar-end: #6a994e;

    --intelis-link: #4f772d;

    --intelis-drawer-bg: #eef2e6;
    --intelis-drawer-border: #dbe3cd;
    --intelis-drawer-text: #445c3c;
    --intelis-drawer-hover-bg: #e0e8d2;
    --intelis-drawer-hover-text: #1a2417;
    --intelis-drawer-active-text: #4f772d;
    --intelis-drawer-active-icon: #4f772d;
    --intelis-drawer-active-border: #4f772d;
    --intelis-drawer-active-bg: rgba(79, 119, 45, 0.12);
    --intelis-drawer-icon: #6a994e;
    --intelis-drawer-icon-hover: #1a2417;

    --intelis-badge-text: #6a994e;
    --intelis-badge-border: #cfd8c2;
}

.theme-avocado.dark-mode {
    --intelis-appbar-start: #10180e;
    --intelis-appbar-end: #31572c;

    --intelis-link: #90c975;

    --intelis-drawer-bg: #151d12;
    --intelis-drawer-border: #2c3a27;
    --intelis-drawer-text: #c0cfb8;
    --intelis-drawer-hover-bg: rgba(255, 255, 255, 0.08);
    --intelis-drawer-hover-text: #f2f7ee;
    --intelis-drawer-active-text: #c0cfb8;
    --intelis-drawer-active-icon: #90c975;
    --intelis-drawer-icon: #90c975;
    --intelis-drawer-icon-hover: #90c975;

    --intelis-badge-text: #90c975;
    --intelis-badge-border: #3a4c33;
}

/* ── Blueberry style ("Blueberry Dumplings", ES-299) ──────────────────── */
.theme-blueberry {
    --intelis-primary: #5f4b8b;
    --intelis-secondary: #a4508b;

    --intelis-appbar-start: #3b2f5c;
    --intelis-appbar-end: #8272ab;

    --intelis-link: #5f4b8b;

    --intelis-drawer-bg: #efecf6;
    --intelis-drawer-border: #ded8ec;
    --intelis-drawer-text: #524a6b;
    --intelis-drawer-hover-bg: #e3ddf0;
    --intelis-drawer-hover-text: #2a2140;
    --intelis-drawer-active-text: #5f4b8b;
    --intelis-drawer-active-icon: #5f4b8b;
    --intelis-drawer-active-border: #5f4b8b;
    --intelis-drawer-active-bg: rgba(95, 75, 139, 0.12);
    --intelis-drawer-icon: #8272ab;
    --intelis-drawer-icon-hover: #2a2140;

    --intelis-badge-text: #8272ab;
    --intelis-badge-border: #d5cfe5;
}

.theme-blueberry.dark-mode {
    --intelis-appbar-start: #171028;
    --intelis-appbar-end: #3b2f5c;

    --intelis-link: #b39ddb;

    --intelis-drawer-bg: #1b1430;
    --intelis-drawer-border: #332a52;
    --intelis-drawer-text: #c3bad8;
    --intelis-drawer-hover-bg: rgba(255, 255, 255, 0.08);
    --intelis-drawer-hover-text: #f2eefc;
    --intelis-drawer-active-text: #c3bad8;
    --intelis-drawer-active-icon: #b39ddb;
    --intelis-drawer-icon: #b39ddb;
    --intelis-drawer-icon-hover: #b39ddb;

    --intelis-badge-text: #b39ddb;
    --intelis-badge-border: #3f3563;
}

/* ── Graphite style ("Corporate Grey", ES-299) ────────────────────────── */
.theme-graphite {
    --intelis-primary: #37474f;
    --intelis-secondary: #546e7a;

    --intelis-appbar-start: #263238;
    --intelis-appbar-end: #546e7a;

    --intelis-link: #546e7a;

    --intelis-drawer-bg: #eceff1;
    --intelis-drawer-border: #d8dee2;
    --intelis-drawer-text: #424242;
    --intelis-drawer-hover-bg: #dde3e6;
    --intelis-drawer-hover-text: #212121;
    --intelis-drawer-active-text: #37474f;
    --intelis-drawer-active-icon: #37474f;
    --intelis-drawer-active-border: #37474f;
    --intelis-drawer-active-bg: rgba(55, 71, 79, 0.12);
    --intelis-drawer-icon: #546e7a;
    --intelis-drawer-icon-hover: #212121;

    --intelis-badge-text: #546e7a;
    --intelis-badge-border: #cfd8dc;
}

.theme-graphite.dark-mode {
    --intelis-appbar-start: #101417;
    --intelis-appbar-end: #37474f;

    --intelis-link: #90a4ae;

    --intelis-drawer-bg: #1a1a1a;
    --intelis-drawer-border: #333333;
    --intelis-drawer-text: #b0bec5;
    --intelis-drawer-hover-bg: rgba(255, 255, 255, 0.08);
    --intelis-drawer-hover-text: #e0e0e0;
    --intelis-drawer-active-text: #b0bec5;
    --intelis-drawer-active-icon: #90a4ae;
    --intelis-drawer-icon: #90a4ae;
    --intelis-drawer-icon-hover: #90a4ae;

    --intelis-badge-text: #90a4ae;
    --intelis-badge-border: #444444;
}

/* Tile accents (ES-299, opt-in): give a card/tile one of the six intelis.cz
   gradient hues, e.g. <MudPaper Class="tile-accent-1">. Active only under
   the Intelis style — in the Default style the classes are inert (no token).
   Usage example:
       <MudPaper Class="pa-4 tile-accent-5">...</MudPaper> */
.tile-accent-1 { background-color: var(--intelis-tile-1); }
.tile-accent-2 { background-color: var(--intelis-tile-2); }
.tile-accent-3 { background-color: var(--intelis-tile-3); }
.tile-accent-4 { background-color: var(--intelis-tile-4); }
.tile-accent-5 { background-color: var(--intelis-tile-5); }
.tile-accent-6 { background-color: var(--intelis-tile-6); }

/* AppBar gradient */
.mud-appbar {
    background: linear-gradient(90deg, var(--intelis-appbar-start) 0%, var(--intelis-appbar-end) 100%) !important;
}

.brand-gradient {
    background: linear-gradient(135deg, var(--intelis-appbar-start) 0%, var(--intelis-appbar-end) 100%);
}


html, body {
    font-family: 'Red Hat Display', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: var(--intelis-link);
}

.btn-primary {
    color: var(--intelis-btn-primary-text);
    background-color: var(--intelis-btn-primary-bg);
    border-color: var(--intelis-btn-primary-border);
}

.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 #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.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: #929292;
}

.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;
}

/* Drawer - Intelis style */
.mud-drawer {
    background: var(--intelis-drawer-bg) !important;
    border-right: 1px solid var(--intelis-drawer-border) !important;
    overflow-x: hidden;
}

.mud-drawer-content {
    overflow-x: hidden;
}

.mud-drawer .mud-navmenu .mud-nav-link {
    color: var(--intelis-drawer-text) !important;
    transition: all 0.2s;
}

/* Expanded drawer - links flush to edges */
.mud-drawer--open .mud-navmenu .mud-nav-link {
    border-radius: 0;
    margin: 0;
}

.mud-drawer .mud-navmenu .mud-nav-link:hover {
    background-color: var(--intelis-drawer-hover-bg) !important;
    color: var(--intelis-drawer-hover-text) !important;
}

.mud-drawer .mud-navmenu .mud-nav-link.active {
    background-color: var(--intelis-drawer-active-bg) !important;
    color: var(--intelis-drawer-active-text) !important;
}

/* Mini drawer - clean icon-only view */
.mud-drawer:not(.mud-drawer--open) .mud-navmenu .mud-nav-link {
    border-radius: 0;
    margin: 0;
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    overflow: hidden;
}

.mud-drawer:not(.mud-drawer--open) .mud-navmenu .mud-nav-link .mud-nav-link-text {
    display: none !important;
}

.mud-drawer:not(.mud-drawer--open) .mud-navmenu .mud-nav-link .mud-nav-link-icon {
    margin: 0 auto !important;
}

.mud-drawer:not(.mud-drawer--open) .mud-navmenu .mud-nav-link.active {
    border-left: 3px solid var(--intelis-drawer-active-border);
}

.mud-drawer:not(.mud-drawer--open) .mud-navmenu .mud-nav-group .mud-nav-link-text {
    display: none !important;
}

.mud-drawer:not(.mud-drawer--open) .mud-navmenu .mud-nav-group .mud-nav-group-expand-icon {
    display: none !important;
}

.mud-drawer .mud-navmenu .mud-nav-link.active .mud-nav-link-icon {
    color: var(--intelis-drawer-active-icon) !important;
}

.mud-drawer .mud-navmenu .mud-nav-link .mud-nav-link-icon {
    color: var(--intelis-drawer-icon) !important;
}

.mud-drawer .mud-navmenu .mud-nav-link:hover .mud-nav-link-icon {
    color: var(--intelis-drawer-icon-hover) !important;
}

/* Nav group text (WI-00068): the colour must sit directly on the
   .mud-nav-link-text span — it would otherwise lose to the colour inherited
   from `... .mud-nav-link` above. Dark mode is handled by the token override. */
.mud-drawer .mud-navmenu .mud-nav-group .mud-nav-link-text,
.mud-drawer .mud-navmenu .mud-nav-group .mud-collapse-wrapper {
    color: var(--intelis-drawer-text);
}

.mud-drawer .mud-navmenu .mud-nav-group .mud-nav-group-expand-icon {
    color: var(--intelis-drawer-icon) !important;
}

/* Version badge in drawer */
.version-badge {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    font-size: 0.75rem;
    color: var(--intelis-badge-text) !important;
    border-color: var(--intelis-badge-border) !important;
}

.version-badge:hover {
    opacity: 0.9;
    color: var(--intelis-badge-hover-text) !important;
}

/* Dark mode drawer/badge colours come from the token overrides in the
   .dark-mode block at the top of this file — no per-rule duplication. */

/* Dark mode - headings (WI-00068).
   Radzen's default.css sets `h4, .h4 { color: var(--rz-text-title-color) }` on bare
   heading tags; MudText renders bare <h1>..<h6>, so that fixed dark title color bleeds
   onto MudBlazor headings and is not dark-mode aware — headings rendered dark-on-dark.
   Keep MudBlazor typography on the MudBlazor palette in dark mode (light mode unchanged). */
.dark-mode .mud-typography-h1,
.dark-mode .mud-typography-h2,
.dark-mode .mud-typography-h3,
.dark-mode .mud-typography-h4,
.dark-mode .mud-typography-h5,
.dark-mode .mud-typography-h6 {
    color: var(--mud-palette-text-primary);
}

/* Dark mode - Expansion Panel contrast improvements */
.dark-mode .mud-expand-panel {
    background-color: #252525;
    border: 1px solid #404040;
}

.dark-mode .mud-expand-panel .mud-expand-panel-header {
    background-color: #2d2d2d;
}

.dark-mode .mud-expand-panel .mud-expand-panel-header:hover {
    background-color: #353535;
}

.dark-mode .mud-expand-panel.mud-panel-expanded .mud-expand-panel-header {
    background-color: #303030;
}

.dark-mode .mud-expand-panel .mud-expand-panel-content {
    background-color: #252525;
}

/* Rich text content (Markdig-rendered markdown) */
.rich-content {
    overflow-wrap: break-word;
    word-break: break-word;
    font-size: 1rem;
    line-height: 1.5;
    font-family: inherit;
}

.rich-content > :first-child {
    margin-top: 0;
}

.rich-content > :last-child {
    margin-bottom: 0;
}

.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    /* WI-06708: no image in a text may fill the screen (a pasted e-mail avatar did). */
    max-height: min(480px, 60vh);
    object-fit: contain;
}

/* Thumbnail of an image attachment (work item Attachments tab, opportunity attachments) — WI-06575,
   WI-06864: the server's ?size=thumb version, never the original. */
.attachment-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
    border-radius: var(--mud-default-borderradius);
    border: 1px solid var(--mud-palette-lines-default);
}

/* WI-06708: placeholder of an image from a foreign server (MarkdownRenderer + editor preview);
   external-images.js swaps the image in on click / Enter / Space. */
.external-image[data-external-src] {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    max-width: 100%;
    padding: 0.15em 0.6em;
    border: 1px dashed var(--mud-palette-lines-inputs);
    border-radius: 4px;
    background: var(--mud-palette-background-gray);
    color: var(--mud-palette-text-secondary);
    font-size: 0.875em;
    line-height: 1.4;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.external-image[data-external-src]::before {
    content: "";
    flex: 0 0 auto;
    width: 1.1em;
    height: 1.1em;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 8h.01'/%3E%3Cpath d='M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12z'/%3E%3Cpath d='M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5'/%3E%3Cpath d='M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 8h.01'/%3E%3Cpath d='M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12z'/%3E%3Cpath d='M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5'/%3E%3Cpath d='M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3'/%3E%3C/svg%3E") no-repeat center / contain;
}

.external-image[data-external-src]:hover,
.external-image[data-external-src]:focus-visible {
    border-color: var(--mud-palette-primary);
    color: var(--mud-palette-text-primary);
    outline: none;
}

/* Links leaving the app (MarkdownRenderer adds .external-link + target=_blank): a small
   Tabler "external-link" glyph after the text. Drawn via mask + currentColor so it follows
   the link color in both themes without inline SVG in the sanitized HTML. */
.rich-content a.external-link::after {
    content: "";
    display: inline-block;
    width: 0.8em;
    height: 0.8em;
    margin-left: 0.15em;
    vertical-align: -0.05em;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6'/%3E%3Cpath d='M11 13l9 -9'/%3E%3Cpath d='M15 4h5v5'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6'/%3E%3Cpath d='M11 13l9 -9'/%3E%3Cpath d='M15 4h5v5'/%3E%3C/svg%3E") no-repeat center / contain;
}

.rich-content p {
    margin-top: 0;
    margin-bottom: 0.5em;
}

.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4,
.rich-content h5,
.rich-content h6 {
    margin-top: 1em;
    margin-bottom: 0.4em;
    font-weight: 600;
    line-height: 1.3;
}

.rich-content h1 { font-size: 1.5rem; }
.rich-content h2 { font-size: 1.25rem; }
.rich-content h3 { font-size: 1.125rem; }
.rich-content h4 { font-size: 1rem; }
.rich-content h5 { font-size: 0.95rem; }
.rich-content h6 { font-size: 0.9rem; }

/* Dark mode - markdown headings (WI-06594). Same root cause as WI-00068: Radzen's default.css
   colours bare h1..h6 with the fixed dark --rz-text-title-color (#28363c), which rendered
   description, comment, help and release-note headings dark-on-dark (1.5:1). Follow the
   MudBlazor palette text colour in dark mode; light mode keeps its current colour. */
.dark-mode .rich-content h1,
.dark-mode .rich-content h2,
.dark-mode .rich-content h3,
.dark-mode .rich-content h4,
.dark-mode .rich-content h5,
.dark-mode .rich-content h6 {
    color: var(--mud-palette-text-primary);
}

.rich-content ul,
.rich-content ol {
    padding-left: 1.75em;
    margin-top: 0;
    margin-bottom: 0.5em;
}

.rich-content ul { list-style-type: disc; }
.rich-content ol { list-style-type: decimal; }
.rich-content ul ul { list-style-type: circle; }
.rich-content ul ul ul { list-style-type: square; }

.rich-content li {
    margin-bottom: 0.2em;
}

.rich-content li > p {
    margin-bottom: 0.2em;
}

/* Task-list items (Markdig UseTaskLists generates <input type="checkbox"> inside <li>) */
.rich-content li:has(> input[type="checkbox"]) {
    list-style-type: none;
    margin-left: -1.25em;
}

.rich-content li > input[type="checkbox"] {
    margin-right: 0.4em;
}

.rich-content blockquote {
    margin: 0.5em 0;
    padding: 0.25em 0.75em;
    border-left: 3px solid var(--mud-palette-lines-default);
    color: var(--mud-palette-text-secondary);
}

.rich-content code {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.1em 0.3em;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Cascadia Mono', Menlo, Consolas, 'Courier New', monospace;
}

.dark-mode .rich-content code {
    background: rgba(255, 255, 255, 0.1);
}

.rich-content pre {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.6em 0.8em;
    border-radius: 4px;
    overflow-x: auto;
    margin: 0.5em 0;
}

.dark-mode .rich-content pre {
    background: rgba(255, 255, 255, 0.08);
}

.rich-content pre code {
    background: transparent;
    padding: 0;
    font-size: 0.9em;
}

.rich-content table {
    border-collapse: collapse !important;
    margin: 0.5em 0;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.rich-content th,
.rich-content td {
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    padding: 0.3em 0.6em;
    text-align: left;
}

.rich-content th {
    background: rgba(0, 0, 0, 0.04);
    font-weight: 600;
}

.dark-mode .rich-content table,
.dark-mode .rich-content th,
.dark-mode .rich-content td {
    border-color: rgba(255, 255, 255, 0.18) !important;
}

.dark-mode .rich-content th {
    background: rgba(255, 255, 255, 0.06);
}

.rich-content hr {
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    margin: 1em 0;
}

/* ─── Markdown editor (CzMarkdownEditor, CodeMirror 6 — WI-06644) ──────── */
.md-editor {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: var(--mud-default-borderradius);
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
}

/* Resize="vertical": as tall as MaxHeight, the grip resizes it; "none" grows Min→Max with the text. */
.md-editor--resizable {
    height: var(--md-max-h);
    min-height: calc(var(--md-min-h) + 70px);
    resize: vertical;
    overflow: hidden;
}

.md-editor:focus-within {
    border-color: var(--mud-palette-primary);
    box-shadow: 0 0 0 2px rgba(2, 42, 58, 0.25);
}

.md-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.md-editor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--mud-palette-text-primary);
    cursor: pointer;
}

.md-editor-btn:hover,
.md-editor-btn.active {
    background: var(--mud-palette-action-default-hover);
    border-color: var(--mud-palette-lines-default);
}

.md-editor-btn:disabled {
    opacity: 0.4;
    cursor: default;
    background: transparent;
    border-color: transparent;
}

.md-editor-sep {
    align-self: stretch;
    width: 1px;
    margin: 4px 4px;
    background: var(--mud-palette-lines-default);
}

@media (max-width: 600px) {
    .md-editor-btn--desktop { display: none; }
}

.md-editor-body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}

.md-editor-input {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
}

.md-editor .cm-editor {
    flex: 1 1 auto;
    min-width: 0;
    min-height: var(--md-min-h);
    max-height: var(--md-max-h);
}

.md-editor--resizable .cm-editor {
    min-height: 0;
    max-height: none;
}

.md-editor .cm-editor.cm-focused { outline: none; }

/* Mac Safari defaults to 10pt — readable size and the project's monospace font. */
.md-editor .cm-scroller {
    font-family: 'Cascadia Mono', Menlo, Consolas, 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: auto;
}

/* caret-color: CodeMirror's base theme assumes a light page (black caret); follow the app theme. */
.md-editor .cm-content { padding: 8px 0; caret-color: var(--mud-palette-text-primary); }
.md-editor .cm-line { padding: 0 10px; }
.md-editor .cm-placeholder { color: var(--mud-palette-text-disabled); }
.md-editor .md-editor-tok-link { color: var(--mud-palette-primary); }
.md-editor .md-editor-tok-code { background: rgba(0, 0, 0, 0.06); border-radius: 3px; }
.md-editor .md-editor-tok-quote { color: var(--mud-palette-text-secondary); font-style: italic; }
.md-editor .md-editor-tok-meta { color: var(--mud-palette-text-secondary); }

/* Preview: the server render (.rich-content), shown instead of the text or beside it (F9). */
.md-editor-preview {
    display: none;
    flex: 1 1 0;
    min-width: 0;
    overflow: auto;
    padding: 8px 12px;
}

.md-editor-preview:focus { outline: none; }

.md-editor--preview .md-editor-input { display: none; }

.md-editor--preview .md-editor-preview {
    display: block;
    min-height: var(--md-min-h);
    max-height: var(--md-max-h);
}

.md-editor--side .md-editor-preview {
    display: block;
    max-height: var(--md-max-h);
    border-left: 1px solid var(--mud-palette-lines-default);
}

.md-editor--resizable .md-editor-preview {
    min-height: 0;
    max-height: none;
}

/* Full screen (F11), WI-06782. The script puts the editor into the browser's top layer
   (popover="manual" + showPopover()), so no ancestor (the MudDialog's transform and clipping, the sticky
   comment bar, the app bar and drawer) can cover or clip it. The fixed-position rules below are the
   fallback for browsers without the Popover API; MudBlazor z-indexes: drawer 1100, popover 1200,
   appbar 1300, dialog 1400, snackbar 1500. */
.md-editor.md-editor--fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1400;
    height: auto;
    resize: none;
    border-radius: 0;
}

/* Overrides of the UA [popover] style (margin auto, fit-content, border, padding, overflow). */
.md-editor.md-editor--fullscreen[popover] {
    margin: 0;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    border: 0;
    overflow: hidden;
    box-sizing: border-box;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    display: flex;
    flex-direction: column;
}

.md-editor.md-editor--fullscreen[popover]::backdrop { background: var(--mud-palette-surface); }

/* Fallback only: an animated dialog keeps a transform, which would make it the containing block. */
.mud-dialog:has(.md-editor--fullscreen:not([popover])) { animation: none; transform: none; overflow: visible; }
.comment-editor-sticky:has(.md-editor--fullscreen:not([popover])) { position: static; z-index: auto; }

.md-editor--fullscreen .cm-editor,
.md-editor--fullscreen .md-editor-preview {
    max-height: none;
}

.md-editor-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px 12px;
    padding: 2px 10px 4px;
    font-size: 12px;
    color: var(--mud-palette-text-secondary);
}

.md-editor-status-upload { margin-right: auto; }

.dark-mode .md-editor .md-editor-tok-code { background: rgba(255, 255, 255, 0.08); }

/* Work item detail header (WI-06509, reworked by WI-06550). Density norm: every control is
   32 px, groups sit 8 px apart. Row 1 = back arrow + a wrapping group of title and tags; the
   h5 title is 32 px tall, so arrow, title and chips share one centre line. Row 2 = copy icons
   with the codes; each "icon + text" group stays together and the groups wrap at phone width. */
.wi-header-row {
    gap: 8px;
}

.wi-header-back.mud-icon-button {
    padding: 4px; /* 24 px icon in a 32 px control */
}

.wi-header-tags {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 32px;
    gap: 8px;
}

.wi-header-title {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* WI-06629: the header actions keep their natural width and one-line labels ("Začít měřit čas"
   used to break onto two lines); the title and the tags wrap in the remaining width and keep a
   clear gap from the buttons instead of running up to them. */
.wi-header-actions {
    flex-shrink: 0;
    padding-left: 24px;
}

/* When the title column would fall under ~28rem next to the buttons, the buttons move to a row of
   their own (still right-aligned) instead of squeezing the title into a narrow strip. */
.wi-header {
    flex-wrap: wrap;
    row-gap: 8px;
}

.wi-header-main {
    flex: 1 1 28rem;
}

.wi-header-actions .mud-button-label {
    white-space: nowrap;
}

.wi-header-caption {
    column-gap: 8px;
    row-gap: 0;
    margin-top: 4px;
}

.wi-header-caption .mud-icon-button {
    padding: 6px; /* 20 px icon in a 32 px control, same box as the back arrow above */
}

.wi-header-group {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
}

.wi-header-code {
    padding-left: 2px;
}

/* On a phone the two groups wrap onto their own lines, where a "·" would dangle at a line end. */
@media (max-width: 599.98px) {
    .wi-header-sep {
        display: none;
    }
}

.wi-header-project {
    min-width: 0;
    overflow-wrap: anywhere;
    padding-left: 2px;
}

/* The project link must read as a link next to the grey caption text. The light theme's primary
   is a near-black navy (#022a3a), so colour alone barely separates it from the grey — a medium
   weight and a faint resting underline carry the "clickable" cue; hover/focus make the underline
   solid. */
.wi-header-caption .wi-header-project-link {
    color: var(--mud-palette-primary);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
    text-underline-offset: 3px;
    border-radius: var(--mud-default-borderradius);
}

.wi-header-caption .wi-header-project-link:hover,
.wi-header-caption .wi-header-project-link:focus-visible {
    text-decoration-color: currentColor;
}

.wi-header-caption .wi-header-project-link:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* ─── Work item detail, WI-06629 ─────────────────────────────────────────────────────────────
   Pinned header: sticks below the app bar while the detail scrolls — only on screens wide AND tall
   enough (a phone or a low window would lose too much of its height to it). Opaque page
   background, so the content scrolls under it; the separating shadow appears only once it is
   stuck (data-stuck, set by work-item-detail.js). Above the sticky comment editor (10), below
   the app bar, drawer and every popover. */
.wi-header-sentinel {
    height: 0;
}

.wi-comment-anchor {
    scroll-margin-top: 80px;
    scroll-margin-bottom: 360px;
}

@media (min-width: 960px) and (min-height: 760px) {
    .wi-header.wi-header-sticky {
        position: sticky;
        top: var(--mud-appbar-height, 64px);
        z-index: 12;
        background-color: var(--mud-palette-background);
        margin-left: -8px;
        margin-right: -8px;
        padding: 8px;
        border-bottom-left-radius: var(--mud-default-borderradius);
        border-bottom-right-radius: var(--mud-default-borderradius);
        transition: box-shadow .15s ease;
    }

    .wi-header.wi-header-sticky[data-stuck="true"] {
        box-shadow: 0 1px 0 var(--mud-palette-lines-default), 0 6px 10px -8px rgba(0, 0, 0, .35);
    }

    /* An anchored comment must land below the pinned header, not under it. */
    .wi-comment-anchor {
        scroll-margin-top: 190px;
    }
}

/* Double click opens the edit form (title, description). */
.wi-editable {
    cursor: pointer;
}

/* Long description: capped at 40vh (scrolls inside); the "show full text" line appears only when
   the text is taller than the cap (data-overflows, measured by work-item-detail.js). */
.wi-desc:not(.wi-desc-expanded) .wi-desc-box {
    --scroll-shadow: rgba(0, 0, 0, .18);
    max-height: 40vh;
    overflow-y: auto;
    /* Scroll shadows (WI-06665): covers move with the text (local), shadows stay on the edges (scroll). */
    background:
        linear-gradient(var(--mud-palette-background) 30%, transparent) center top,
        linear-gradient(transparent, var(--mud-palette-background) 70%) center bottom,
        radial-gradient(farthest-side at 50% 0, var(--scroll-shadow), transparent) center top,
        radial-gradient(farthest-side at 50% 100%, var(--scroll-shadow), transparent) center bottom;
    background-repeat: no-repeat;
    background-size: 100% 40px, 100% 40px, 100% 18px, 100% 18px;
    background-attachment: local, local, scroll, scroll;
}

.dark-mode .wi-desc:not(.wi-desc-expanded) .wi-desc-box {
    --scroll-shadow: rgba(0, 0, 0, .45);
}

.wi-desc-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.wi-desc[data-overflows="true"] .wi-desc-toggle {
    display: flex;
}

.wi-desc-toggle::before,
.wi-desc-toggle::after {
    content: "";
    flex: 1 1 auto;
    border-top: 1px solid var(--mud-palette-lines-default);
}

/* WI-06960 — grouped label–value layout (BO rule, src/Intercom.Web/AGENTS.md "Detail attributes";
   components Shared/Attributes/AttributeGroup + AttributeRow). Theme tokens only. */
.attr-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 48px;
    align-items: start;
}

@media (max-width: 959.98px) {
    .attr-columns {
        grid-template-columns: minmax(0, 1fr);
    }

    .attr-columns > .attr-column + .attr-column {
        margin-top: 24px;
    }
}

.attr-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.attr-group-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding-bottom: 6px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.attr-group-heading .attr-group-title {
    color: var(--mud-palette-text-primary);
    white-space: nowrap; /* a narrow heading wraps its actions below, never its text */
    text-transform: none;
}

.attr-group-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.attr-group-rows {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 24px;
    row-gap: 10px;
    align-items: baseline;
    font-size: var(--mud-typography-body2-size, 0.875rem);
    line-height: 1.5;
}

.attr-group-rows--edit {
    align-items: center;
    row-gap: 16px;
}

/* Edit mode (BO return of WI-06960, 2026-11-01): a form field spans the whole group and carries
   its own label inside the outlined input, like every MudBlazor form; no label column. */
.attr-field {
    grid-column: 1 / -1;
    min-width: 0;
}

.attr-row {
    display: contents;
}

.attr-label {
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

.attr-value {
    font-weight: 400;
    color: var(--mud-palette-text-primary);
    min-width: 0;
    overflow-wrap: anywhere;
}

.attr-value--multiline {
    white-space: pre-line;
}

.attr-value--empty {
    /* Light grey in every theme: half of the text colour over the page (WI-06960 acceptance:
       clearly lighter than a value, still >= 3:1 against the background). */
    color: color-mix(in srgb, var(--mud-palette-text-primary) 50%, transparent);
}

.attr-value .attr-muted {
    color: color-mix(in srgb, var(--mud-palette-text-primary) 50%, transparent);
}

.attr-link {
    color: var(--mud-palette-primary);
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}

.attr-link:hover {
    text-decoration-style: solid;
}

/* Form fields of a group: no extra top margin from MudBlazor — the row gap spaces them. */
.attr-field .mud-input-control {
    margin-top: 0;
}

/* Sidebar (PO design): section heading = 20 px icon + subtitle, 8 px apart; fields 12 px apart. */
.wi-sidebar-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

button.wi-sidebar-heading-toggle {
    width: 100%;
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: var(--mud-default-borderradius);
}

button.wi-sidebar-heading-toggle:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

.wi-sidebar-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wi-sidebar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    min-height: 36px;
}

.wi-field-error {
    margin: 2px 14px 0;
}

.wi-logged-hours {
    display: inline-block;
    margin: 2px 0 0 14px;
}

/* Chips + add button in one row; the add field opens under it (labels, collaborators). */
.wi-chip-picker {
    margin-top: 8px;
}

.wi-chip-picker-row {
    gap: 4px;
    min-height: 32px;
}

.wi-chip-picker-chips {
    gap: 4px;
    min-width: 0;
}

.wi-economics-table {
    width: 100%;
    border-collapse: collapse;
}

.wi-economics-table th {
    font-weight: 400;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
    text-align: right;
    padding: 4px 0 4px 8px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.wi-economics-table td {
    font-size: .875rem;
    text-align: right;
    white-space: nowrap;
    padding: 6px 0 6px 8px;
}

.wi-economics-table th:first-child,
.wi-economics-table td:first-child {
    text-align: left;
    white-space: normal;
    padding-left: 0;
    color: var(--mud-palette-text-secondary);
}

.wi-economics-table tr.wi-economics-total td {
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    border-top: 1px solid var(--mud-palette-lines-default);
}

/* WI-06632: Attachments tab drop zone and the per-file status list of a batch. */
.wi-attachments-dropzone {
    min-height: 96px;
}

.wi-upload-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wi-upload-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
}

.wi-upload-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wi-upload-status {
    width: 96px;
    display: flex;
    justify-content: flex-end;
}

.wi-upload-error {
    padding-left: 28px;
}

/* Milestones tab header (WI-06531): status filter + "New milestone", both 32 px tall and 8 px
   apart — the same density as the Tasks toolbar (Shared/WorkItems/WorkItemList.razor.css). */
.milestones-header-actions {
    gap: 8px;
}

.milestones-header-actions .mud-button-root:not(.mud-icon-button) {
    height: 32px;
    min-height: 32px;
}

.milestones-status-filter {
    width: 240px;
    max-width: 100%;
}

.milestones-status-filter .mud-input-control {
    margin: 0;
}

.milestones-status-filter .mud-input-control .mud-input-root {
    box-sizing: border-box;
    height: 32px;
    min-height: 32px;
}

/* Sticky add-comment editor (WorkItem + Opportunity detail): pinned to the
   viewport bottom while the comment list scrolls past, settles into its
   natural position at the end of the list. Negative margins span the tab's
   pa-4 padding so comments don't peek through beside/below the editor. */
.comment-editor-sticky {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-lines-default);
    border-bottom-left-radius: var(--mud-default-borderradius);
    border-bottom-right-radius: var(--mud-default-borderradius);
    margin: 16px -16px -16px;
    padding: 12px 16px 16px;
}

/* Jira-like collapse of the sticky editor: CodeMirror renders its placeholder
   element only while the document is empty, so "empty AND not focused" can be
   expressed in pure CSS — no component state, no focus-race JS. Collapsed, the
   editor is a one-line field; clicking it focuses CodeMirror and expands the
   toolbar, status bar and submit button back. A non-empty draft never
   collapses (no placeholder element), so unsent text stays visible. Only focus in the editor or its
   actions expands it: a click on a button of the backup notice above it (WI-06673) must not grow the
   sticky block upward under the pointer and lose the click. */
.comment-editor-sticky:has(.cm-placeholder):not(:has(.md-editor:focus-within, .comment-editor-actions:focus-within)) .md-editor-toolbar,
.comment-editor-sticky:has(.cm-placeholder):not(:has(.md-editor:focus-within, .comment-editor-actions:focus-within)) .md-editor-status,
.comment-editor-sticky:has(.cm-placeholder):not(:has(.md-editor:focus-within, .comment-editor-actions:focus-within)) .comment-editor-actions {
    /* !important: the actions row carries MudBlazor's d-flex utility, which is
       itself display: flex !important. */
    display: none !important;
}

.comment-editor-sticky:has(.cm-placeholder):not(:has(.md-editor:focus-within, .comment-editor-actions:focus-within)) .cm-editor {
    height: 42px;
    min-height: 0;
}

/* Rounded MudTabs clip their box (overflow: hidden), which would make the tabs
   div the sticky containing block — and it doesn't scroll, so the editor would
   never pin. The tab hosts that contain the sticky editor opt out of the clip
   and get the rounding re-applied to the toolbar/panels directly. */
.mud-tabs.comment-sticky-host {
    overflow: visible;
}

.mud-tabs.comment-sticky-host > .mud-tabs-toolbar {
    border-top-left-radius: var(--mud-default-borderradius);
    border-top-right-radius: var(--mud-default-borderradius);
}

.mud-tabs.comment-sticky-host .mud-tabs-panels {
    border-bottom-left-radius: var(--mud-default-borderradius);
    border-bottom-right-radius: var(--mud-default-borderradius);
}

/* Tab-header count badges as normal inline boxes (WI-00061 #8). MudBlazor renders them as a
   zero-size .mud-badge-root anchor whose bubble is absolutely positioned — auto-sized tabs
   reserve no width for it, so the bubble crosses the tab edge and .mud-tab (overflow: hidden)
   clips it. Opt-in per MudTabs via the tab-badge-inline class (opportunity detail). */
.mud-tabs.tab-badge-inline .mud-tab .mud-tab-badge {
    display: inline-flex;
    align-items: center;
}

.mud-tabs.tab-badge-inline .mud-tab .mud-tab-badge .mud-badge-wrapper {
    position: static;
    width: auto;
    height: auto;
}

.mud-tabs.tab-badge-inline .mud-tab .mud-tab-badge .mud-badge {
    position: static;
}

/* New work item dialog: Description / Attachments panes (WI-06575). Both panes share one grid
   cell and stay laid out; the inactive one is only hidden. The cell's height therefore always
   follows the Description pane, and switching tabs moves neither the tab strip nor the
   attributes below. contain: size keeps the Attachments pane from adding height of its own — it
   stretches to the Description pane's height and its file list scrolls inside. */
.wi-content-stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.wi-content-stack > .wi-content-pane {
    grid-area: 1 / 1;
    min-width: 0;
}

.wi-content-stack > .wi-content-pane-hidden {
    visibility: hidden;
}

.wi-attachments-pane {
    contain: size;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
}

.wi-attachments-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
}

/* Drop zone: fills the pane while no file is chosen, one ~32px row once there is one. The
   current file input lies transparently over it, so a click opens the file dialog and a drop
   lands in the input. */
.wi-dropzone {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 32px;
    /* 4px above and below: the Add files button never touches the dashed border (row ~40px). */
    padding: 4px 8px;
    border: 1px dashed var(--mud-palette-lines-inputs);
    border-radius: var(--mud-default-borderradius);
    transition: border-color .15s, background-color .15s;
}

.wi-dropzone.wi-dropzone-empty {
    flex: 1 1 auto;
    flex-direction: column;
    padding: 16px;
}

.wi-dropzone.drag-over {
    border-color: var(--mud-palette-primary);
    background-color: var(--mud-palette-primary-hover);
}

.wi-dropzone:has(input:focus-visible) {
    /* Inset ring: the pane clips overflow (overflow: hidden), an outside outline would be cut off. */
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: -2px;
}

.wi-dropzone .wi-dropzone-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    /* Above the Add files button (.mud-button-root is position: relative and later in the DOM,
       so without this it would paint on top and take the drop — the browser then opens the file
       in place of the page). The whole zone, button and caption included, hits the input. */
    z-index: 1;
}

.wi-dropzone .wi-dropzone-input:disabled {
    cursor: default;
}

/* The button sits under the input, so it gets no hover of its own — mirror it from the zone. */
.wi-dropzone:hover:not(:has(input:disabled)) .mud-button-root,
.wi-dropzone:has(.wi-dropzone-input:focus-visible) .mud-button-root {
    background-color: var(--mud-palette-action-default-hover);
}

.wi-attachments-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* Help screenshots: clickable inline, full size in the overlay (see helpLightbox in uiState.js). */
.help-drawer__content img,
.user-guide__section img {
    cursor: zoom-in;
}

#help-lightbox {
    position: fixed;
    inset: 0;
    /* Above MudBlazor's drawer and dialog layers so the overlay is never half-covered. */
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: rgba(0, 0, 0, 0.75);
    cursor: zoom-out;
}

#help-lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--mud-default-borderradius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
/* Projects list, grouped by type (WI-00101 follow-up): the group header itself is the toggle
   and the expanded set is persisted per user, so MudDataGrid's own expander (no change event)
   is hidden and every click runs through the page. */
.projects-type-group-row .mud-table-row-expander {
    display: none;
}

.projects-type-group-toggle {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    /* native <button> reset — it has to look like the plain group caption it replaces */
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    border-radius: var(--mud-default-borderradius);
}

.projects-type-group-toggle:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* ── Column filter editors of a data grid (TP-2695 follow-up) ─────────────────────────────
   The value editor a column supplies through MudDataGrid's FilterTemplate is rendered inside the
   grid's own filter popover, which the popover provider moves to the end of the document — outside
   the page's DOM subtree, where a scoped stylesheet can never reach it. Hence a global rule.
   Every colour is a theme token, so light and dark mode both work unchanged. */
.filter-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 240px;
    max-width: 320px;
    padding: 12px;
}

.filter-panel .filter-options {
    display: flex;
    flex-direction: column;
    max-height: 260px;
    overflow-y: auto;
}

.filter-panel .filter-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid var(--mud-palette-lines-default);
    padding-top: 8px;
}

.filter-panel .filter-operator {
    border-radius: var(--mud-default-borderradius);
}

/* WI-06816: a custom field column's filter — a from / to pair side by side. */
.cf-column-filter .cf-column-filter-range {
    display: flex;
    gap: 8px;
}

.cf-column-filter .cf-column-filter-range > * {
    flex: 1 1 0;
    min-width: 0;
}

/* On a phone the popover is nearly the width of the screen; the panel must not force it wider. */
@media (max-width: 420px) {
    .filter-panel {
        min-width: 0;
        max-width: calc(100vw - 48px);
    }
}

/* ── Saved views menu (TP-2696) ────────────────────────────────────────────────────────────
   MudMenu renders its items through the popover provider, which moves them out of the bar's own
   DOM subtree — a scoped selector in SavedViewBar.razor.css could never reach them. */

.saved-views-group {
    pointer-events: none;
    min-height: 0;
    padding-top: 6px;
    padding-bottom: 2px;
    opacity: 1;
}

.saved-views-group-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.saved-views-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 320px;
}

.saved-views-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Whose shared view it is — the one thing that turns a foreign name in the list into information.
   Pushed to the right edge, so the names stay one column. */
.saved-views-item-owner {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
    margin-left: auto;
    padding-left: 12px;
}

/* The menu is a list to choose from, 240 px at least so a long name is not cut at once. */
.saved-views-item-row {
    min-width: 240px;
}

.saved-views-item-row .saved-views-item {
    width: 100%;
}

/* The filter that is open: weight and the accent colour instead of an icon (the item icons went,
   and a tick would be a third glyph kind in a menu that has none left). */
.saved-views-item--active .saved-views-item-name {
    font-weight: 500;
    color: var(--mud-palette-primary);
}

/* ── Keyboard focus ───────────────────────────────────────────────────────────────────────
   MudBlazor 9.2 gives a focused button the same background it gives a hovered one, and removes the
   outline from links altogether. On a filled button the two are indistinguishable, so anyone
   working from the keyboard cannot see where they are. One ring, in the accent colour, for every
   button and link in the application; :focus-visible means a mouse click never draws it. */
.mud-button-root:focus-visible,
.mud-icon-button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* WI-06512: Quick Find in the app bar. Centred in the bar (absolute, so the icons on either side
   never push it off-centre); hidden below md by the d-none d-md-block utilities in MainLayout,
   where the magnifier + dialog take over. At md (960px) 34vw is ~326px, which clears both the
   logo on the left and the icon group on the right. */
.quick-find-slot {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, 34vw);
}

.quick-find-slot .mud-input-control {
    margin: 0;
}

.quick-find-slot .mud-input.mud-input-outlined {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-radius: var(--mud-default-borderradius);
}

.quick-find-slot .mud-input.mud-input-outlined:focus-within {
    background: rgba(255, 255, 255, 0.22);
}

.quick-find-slot .mud-input-outlined-border {
    border-color: rgba(255, 255, 255, 0.35) !important;
}

.quick-find-slot .mud-input:focus-within .mud-input-outlined-border {
    border-color: rgba(255, 255, 255, 0.85) !important;
}

.quick-find-slot input::placeholder {
    color: rgba(255, 255, 255, 0.75);
    opacity: 1;
}

.quick-find-slot .mud-input-adornment,
.quick-find-slot .mud-input-adornment .mud-icon-root,
.quick-find-slot .mud-progress-circular {
    color: rgba(255, 255, 255, 0.85);
}

.quick-find-popover {
    min-width: min(520px, calc(100vw - 32px));
}

/* WI-06510: on a phone the running timer indicator (reading + Pause/Stop) does not fit next to
   the logo — it pushed the notification bell and the user menu past the right screen edge. While
   a timer runs the logo steps aside below sm; the menu button stays. */
@media (max-width: 599.98px) {
    .mud-appbar:has(.running-timer-indicator) .app-bar-logo {
        display: none;
    }
}

/* On the narrowest phones (360-375px) even without the logo the user menu ran ~4px past the
   edge; the stopwatch icon goes, the time and Pause/Stop stay. Not in the failure state, where
   the warning icon is the message and the row is narrower anyway (no Pause/Stop). */
@media (max-width: 379.98px) {
    .running-timer-indicator:not(:has([data-testid='worktimer-indicator-menu'])) .mud-button-icon-start {
        display: none;
    }
}

/* WI-06528: a role action row with the work-type binding is taller (select + helper under the
   name) — every cell sits at the top so checkbox, name, code and scope read as one line. */
.role-actions-table .mud-table-body td {
    vertical-align: top;
}

/* Same first-line centre as the name (body1, 24px line): the code is body2 with a 20px line and
   the dense scope select carries its own top offset. Measured: spread 6.5px -> <= 1px. */
.role-actions-table .mud-table-body td:nth-child(3) .mud-typography {
    line-height: 1.5rem;
}

.role-actions-table .mud-table-body td:nth-child(4) .mud-select {
    margin-top: 0;
}

/* WI-06510: the timer reading on the task detail sits in one row with 36px outlined buttons —
   same height and corner radius as they have (no pill), digits of fixed width so the chip does not
   jitter every second. */
.worktimer-reading.mud-chip {
    height: 36px;
    border-radius: var(--mud-default-borderradius);
    font-variant-numeric: tabular-nums;
}

/* Below md Quick Find lives in a dialog whose input is narrower than the desktop list — keep the
   results as wide as the input so they never run past the dialog and the screen edge. */
@media (max-width: 959.98px) {
    .quick-find-popover {
        min-width: 0;
        max-width: calc(100vw - 32px);
    }
}

.quick-find-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.quick-find-item__icon {
    flex-shrink: 0;
    color: var(--mud-palette-text-secondary);
}

.quick-find-item__body {
    flex: 1;
    min-width: 0;
}

.quick-find-item__line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.quick-find-item__code {
    flex-shrink: 0;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
}

.quick-find-item__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
}

.quick-find-item__secondary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

.quick-find-item--closed .quick-find-item__title {
    color: var(--mud-palette-text-secondary);
}

/* ── Work item cards (WI-06620) ──────────────────────────────────────────────────────────────
   Up to 960 px — a phone, or a tablet — a list of work items is a list of cards, not a table:
   the section Úkoly, the Úkoly tab of a project, the sub-items of a work item and the work items of
   a milestone all use it (class `wi-cards` on the grid, the table, or a wrapper round it).

   The grids that are MudBlazor's own (MudDataGrid, MudTable) switch into their native stacked mode
   at the same width (Breakpoint="Breakpoint.Sm") and name every cell through data-label; the two
   hand-written tables carry the same attribute themselves. This block only lays that native
   stack out as a card: code and name on top across the whole width (`wi-card-code` /
   `wi-card-title`, always first, whatever the column order), then every other cell as a small
   tile — its label above its value — in as many columns as the width holds (two on a phone, four
   or five on a tablet). Labels and values wrap; nothing is cut. A tap anywhere on the card is the
   row's own click; the code and the name stay real links.

   A row with a spanning cell (a group header, "no records") is not a card and is left alone.
   The class is doubled on purpose: MudBlazor's own stacked rules are `.mud-sm-table.mud-table-dense
   .mud-table-cell` (three classes), and the layout has to win over them; the few !important ones
   beat inline styles of the hand-written tables or MudBlazor's own :last-child border. */
@media (max-width: 960px) {
    .wi-cards.wi-cards table,
    .wi-cards.wi-cards tbody {
        display: block;
        width: 100%;
        min-width: 0 !important; /* the milestone table asks for 520 px inline */
    }

    .wi-cards.wi-cards thead,
    .wi-cards.wi-cards tfoot {
        display: none;
    }

    .wi-cards.wi-cards tbody > tr:not(:has(> [colspan])) {
        position: relative;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
        gap: 8px 12px;
        /* A sub-item of the project tree steps in under its parent (--wi-card-depth, set by the tree;
           capped so a deep branch still leaves the card its width). */
        padding: 10px 12px 12px calc(15px + min(var(--wi-card-depth, 0), 4) * 20px);
        border-bottom: 1px solid var(--mud-palette-table-lines);
        /* The type's colour, where the page hands it over (Úkoly), is the card's left edge. */
        box-shadow: inset 3px 0 0 0 var(--work-items-row-accent, transparent);
    }

    .wi-cards.wi-cards tbody > tr:not(:has(> [colspan])) > td {
        display: block;
        min-width: 0;
        max-width: none;
        width: auto !important; /* hand-written tables fix column widths inline */
        height: auto;
        padding: 0 !important;
        border: none !important; /* MudBlazor's stacked last cell: .mud-sm-table .mud-table-row .mud-table-cell:last-child */
        box-shadow: none;
        white-space: normal;
        overflow: hidden;
        overflow-wrap: anywhere;
        text-overflow: clip;
        text-align: start;
        line-height: 1.35;
    }

    .wi-cards.wi-cards tbody > tr:not(:has(> [colspan])) > td::before {
        content: attr(data-label);
        display: block;
        padding: 0 0 2px;
        font-size: 0.75rem;
        font-weight: 400;
        line-height: 1.3;
        color: var(--mud-palette-text-secondary);
        white-space: normal;
    }

    .wi-cards.wi-cards tbody > tr > td:not([data-label])::before,
    .wi-cards.wi-cards tbody > tr > td[data-label=""]::before,
    .wi-cards.wi-cards tbody > tr > td.wi-card-code::before,
    .wi-cards.wi-cards tbody > tr > td.wi-card-title::before {
        display: none;
    }

    /* Code and name head the card, across its whole width, and need no label to say what they are. */
    .wi-cards.wi-cards tbody > tr > td.wi-card-code,
    .wi-cards.wi-cards tbody > tr > td.wi-card-title {
        grid-column: 1 / -1;
    }

    .wi-cards.wi-cards tbody > tr > td.wi-card-code {
        order: -2;
        /* room for a card action in the top right corner (see wi-card-action) */
        padding-right: 36px !important;
    }

    .wi-cards.wi-cards tbody > tr > td.wi-card-title {
        order: -1;
        margin-top: -4px;
        font-size: 1rem;
        font-weight: 500;
    }

    /* A per-row button (the project tree's "add a sub-item") sits in the card's top right corner
       instead of taking a tile of its own. */
    .wi-cards.wi-cards tbody > tr > td.wi-card-action {
        position: absolute;
        top: 6px;
        right: 8px;
        overflow: visible;
    }

    /* WI-06556: the selection checkbox of the project tree stands in the corner too, left of the
       "add a sub-item" button, and the code makes room for both. */
    .wi-cards.wi-cards tbody > tr > td.wi-card-select {
        position: absolute;
        top: 6px;
        right: 44px;
        overflow: visible;
    }

    /* The row checkbox of MudDataGrid's own selection (Úkoly, a milestone's tasks) does the same. */
    .wi-cards.wi-cards tbody > tr > td:not(.wi-card-select):has(input[type="checkbox"]) {
        position: absolute;
        top: 6px;
        right: 8px;
        overflow: visible;
    }

    .wi-cards.wi-cards tbody > tr:has(> td input[type="checkbox"]) > td.wi-card-code {
        padding-right: 80px !important;
    }

    .wi-cards.wi-cards tbody > tr:has(> td.wi-card-select) > td.wi-card-code {
        padding-right: 80px !important;
    }

    .wi-cards.wi-cards tbody > tr > td .mud-chip {
        max-width: 100%;
        margin: 0;
    }

    /* Tree indentation moves from the code to the whole card (see --wi-card-depth above); the empty
       slot that aligns a childless row with its expanding siblings would only push the code away
       from the name. */
    .wi-cards.wi-cards tbody > tr > td.wi-card-code > .wi-card-indent {
        padding-left: 0 !important;
    }

    .wi-cards.wi-cards tbody > tr > td.wi-card-code .wi-card-spacer {
        display: none !important;
    }

    /* The type colour legend under the project's list says what it is, not just two lonely chips. */
    .wi-type-legend::before {
        content: attr(data-label);
        align-self: center;
        font-size: 0.75rem;
        color: var(--mud-palette-text-secondary);
    }

    /* The milestone table asks for 520 px on its own root, above the table itself. */
    .wi-cards.wi-cards .mud-simple-table {
        min-width: 0 !important;
    }

    /* The pager under the cards: MudBlazor only lets it wrap below ~420 px, so between that and
       960 px "rows per page · 1–50 of 1 536 · ‹ ›" ran past a 430 px phone and widened the page. */
    .wi-cards.wi-cards .mud-table-pagination-toolbar {
        flex-wrap: wrap;
        height: auto;
        min-height: 52px;
        row-gap: 4px;
        column-gap: 8px;
        padding: 6px 8px 6px 16px;
        justify-content: flex-end;
    }

    /* A spanning row (group header, "no records") keeps the full width. */
    .wi-cards.wi-cards tbody > tr:has(> [colspan]) {
        display: block;
    }

    .wi-cards.wi-cards tbody > tr:has(> [colspan]) > [colspan] {
        display: block;
        max-width: none;
    }

    .wi-cards.wi-cards tbody > tr:has(> [colspan]) > [colspan]::before {
        display: none;
    }
}

/* Tooltips on a touch-only device (WI-06620): a tap is also a hover there, so a MudTooltip opened
   by a tap stays up over the neighbouring controls until something else is tapped (the presets,
   the conditions funnel, the grouping button, a milestone's expander). A touch screen has no way to
   ask for a tooltip on purpose, and every control that has one also carries its own label or
   aria-label, so there the popover is simply not shown. Mouse and trackpad devices (hover: hover),
   including touch laptops with a mouse, keep them unchanged. */
@media (hover: none) {
    .mud-popover.mud-tooltip {
        display: none !important;
    }
}
/* MudTabs scrolls its tab row with a transform, but the row's box is overflow: hidden, so focusing
   a tab that is off screen (a tap, the keyboard) also made the browser scroll that box natively —
   the two offsets added up and the row came out empty, only the < > arrows left (project detail,
   Milníky tab at 390 px; WI-06620). overflow: clip draws the same, but cannot be scrolled; unlike
   hidden it does not make the flex item shrinkable, hence the explicit min-width. */
.mud-tabs-tabbar-content {
    overflow: clip;
    min-width: 0;
}

/* WI-06556: the milestone's work items grid keeps its header labels on one line. */
.milestone-workitems-grid th {
    white-space: nowrap;
}

/* WI-06673: form backup notice (FormBackupAlert) — global, not scoped: the rules reach into
   MudAlert's own icon and message elements.
   Grid: the notice is 8 + 32 + 8 px; buttons 32 px, 8 px inside the decision group, 24 px
   between the display action (difference) and the decision. The icon sits in a 32 px box and the
   text has 6 px block padding, so the icon centre, the first text line and the button row share
   one axis whether the message wraps or not. The layout follows the notice's own width (container
   query), not the viewport: the same notice lives on a page, in a comment card and in a dialog. */
.mud-alert.form-backup-alert {
    padding: 8px 12px;
}

.form-backup-alert .mud-alert-position {
    flex: 1 1 auto;
    min-width: 0;
    align-items: flex-start;
}

.form-backup-alert .mud-alert-icon {
    padding: 4px 0;
    margin-right: 12px;
}

.form-backup-alert .mud-alert-message {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    container: form-backup-alert / inline-size;
}

.form-backup-alert__body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 24px;
}

.form-backup-alert__text {
    padding: 6px 0;
    min-width: 0;
}

.form-backup-alert__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.form-backup-alert__btn.mud-button-root {
    height: 32px;
    padding: 0 10px;
    white-space: nowrap;
}

/* The display action stands apart from the decision group: 8 + 16 = 24 px. */
.form-backup-alert__actions--decide .form-backup-alert__diff {
    margin-right: 16px;
}

.form-backup-alert__diff-icon.mud-icon-root {
    display: none;
}

/* Narrow notice (phone; a dialog or comment card on a phone): message on top, then the actions
   in a grid — primary full width, keep at the start, the difference icon-only at the end. */
@container form-backup-alert (max-width: 469.98px) {
    .form-backup-alert__body {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .form-backup-alert__actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        margin-left: 0;
    }

    .form-backup-alert__actions > .form-backup-alert__btn {
        grid-row: 1;
        grid-column: 1;
        justify-self: start;
    }

    .form-backup-alert__actions > .form-backup-alert__diff {
        grid-column: 2;
        margin-right: 0;
    }

    .form-backup-alert__actions--decide > .form-backup-alert__restore {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    .form-backup-alert__actions--decide > .form-backup-alert__keep,
    .form-backup-alert__actions--decide > .form-backup-alert__diff {
        grid-row: 2;
    }

    .form-backup-alert__btn.form-backup-alert__diff {
        width: 32px;
        min-width: 32px;
        padding: 0;
    }

    .form-backup-alert__diff-icon.mud-icon-root {
        display: inline-block;
    }

    .form-backup-alert__diff-label {
        display: none;
    }
}

/* The difference dialog (FormBackupDiffDialog) takes the whole screen below the desktop breakpoint. */
@media (max-width: 959.98px) {
    .mud-dialog:has([data-testid="form-backup-diff-dialog"]) {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        margin: 0;
        border-radius: 0;
    }

    .mud-dialog:has([data-testid="form-backup-diff-dialog"]) .mud-dialog-content {
        flex: 1 1 auto;
    }
}

/* WI-06653: the two halves of a custom field range filter (from–to) share the cell equally, so
   each keeps room for the field name in its label (CustomFieldFilterSlot gives a range a double cell). */
.cf-filter-half {
    flex: 1 1 0;
    min-width: 0;
}

/* ── Native columns panel of every MudDataGrid (WI-06565 round 2, PO point 6) ──────────────────
   MudDataGrid 9.2 draws a filter button on every row of its columns panel (no parameter turns it
   off); it opens a second popover over the first, and the two overlapped. The panel is for showing,
   hiding and ordering columns — a column is filtered from its own header. Global, because the panel
   is a popover rendered outside the page's DOM subtree, where no scoped stylesheet reaches (PT-26
   sec. 14/9). */
.mud-data-grid-columns-panel .filter-button {
    display: none;
}

/* WI-06565 acceptance round 2, V4: the panel lists every rendered column (MudDataGrid 9.2 has no
   parameter to leave one out), the technical ones too — the row selection box and "+ podúkol" —
   as rows with a switch and arrows but no name. A technical column is the one without a title, so
   its row is the one whose switch has no label: it is not shown. The first named column then has
   nothing above it to move past, so its "move up" arrow keeps its place but is not offered. */
.mud-data-grid-columns-panel .mud-drop-item:has(label.mud-switch):not(:has(label.mud-switch > .mud-typography)) {
    display: none;
}

.mud-data-grid-columns-panel .mud-drop-item:has(label.mud-switch):not(:has(label.mud-switch > .mud-typography))
    + .mud-drop-item:has(label.mud-switch > .mud-typography) .flex-column > button:first-child:not(:last-child) {
    visibility: hidden;
}

/* The mirror image at the end (a milestone's "remove from milestone" column is the last one): the
   last named column offers no "move down" — it would swap places with the column nobody sees and
   shift the grid. An unnamed switch holds its track only (no :has() inside :has()). */
.mud-data-grid-columns-panel .mud-drop-item:has(+ .mud-drop-item label.mud-switch > .mud-switch-span:last-child)
    .flex-column > button:last-child:not(:first-child) {
    visibility: hidden;
}

/* ── Reference grid page (PT-26) — shared page-level layout (WI-06651) ─────────────────────────
   The page frame of a reference grid outside the Úkoly page: the header with the count, the one
   control row (search · presets + filter combo · grouping · columns), the conditions panel, the
   table's density and the group rows. The Projekty overview is the first page on it; the Úkoly page
   still carries the same rules in its scoped stylesheet (Shared/WorkItems/WorkItemList.razor.css) and can
   move onto this block with WI-06565. Global rather than scoped because nearly every rule lands on
   markup MudBlazor owns. Theme tokens only — no hex value — so dark mode follows. */
.ref-grid { max-width: 100%; }

.ref-grid .ref-grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.ref-grid-count {
    margin-left: 10px;
    font-size: 1rem;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    color: var(--mud-palette-text-secondary);
}

.ref-grid .ref-grid-controls {
    display: flex;
    align-items: center;
    column-gap: 24px;
    /* WI-06565 round 3: the tools wrap to a second line, right-aligned, when the row cannot hold them. */
    flex-wrap: wrap;
    row-gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    margin-bottom: 12px;
}

.ref-grid .ref-grid-controls .grid-toolbar { display: contents; }
.ref-grid .ref-grid-controls .grid-toolbar-narrow { flex: 1 1 240px; min-width: 240px; max-width: 360px; }
.ref-grid .ref-grid-controls .grid-toolbar-narrow .grid-toolbar-search { flex: 1 1 auto; min-width: 0; max-width: none; }
.ref-grid .ref-grid-controls .grid-toolbar-center,
.ref-grid .ref-grid-controls .grid-toolbar-center .saved-views { flex: 0 0 auto; flex-wrap: nowrap; }
.ref-grid .ref-grid-controls .grid-toolbar-tools { margin-left: auto; }

@media (max-width: 1279px) {
    .ref-grid .ref-grid-controls { flex-wrap: wrap; gap: 12px 24px; }
    .ref-grid .ref-grid-controls .grid-toolbar { display: flex; flex: 1 1 100%; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
    .ref-grid .ref-grid-controls .grid-toolbar-narrow { flex: 1 1 100%; width: auto; max-width: 480px; }
    .ref-grid .ref-grid-controls .grid-toolbar-center,
    .ref-grid .ref-grid-controls .grid-toolbar-center .saved-views { flex-wrap: wrap; }
}

@media (max-width: 600px) {
    .ref-grid .ref-grid-controls .grid-toolbar-narrow { max-width: none; }
    .ref-grid .ref-grid-controls .grid-toolbar-center { flex: 1 1 100%; min-width: 0; }
    .ref-grid .ref-grid-presets { width: 100%; }
    .ref-grid .ref-grid-presets .mud-tooltip-root { flex: 1 1 0; }
    .ref-grid .ref-grid-presets .ref-grid-preset { width: 100%; }
}

/* One 32 px height for every control of the row — set on the components themselves (they declare
   the variable on their own root, see Components/Shared/Grid/README.md). */
.ref-grid .ref-grid-controls .saved-views,
.ref-grid .ref-grid-controls .grid-toolbar {
    --grid-control-height: 32px;
    --saved-views-control-height: var(--grid-control-height);
    --grid-toolbar-control-height: var(--grid-control-height);
}

.ref-grid .ref-grid-controls .mud-button-root:not(.mud-icon-button) {
    height: var(--grid-control-height, 32px);
    min-height: var(--grid-control-height, 32px);
}

.ref-grid .ref-grid-controls .mud-input-control .mud-input-root {
    box-sizing: border-box;
    height: var(--grid-control-height, 32px);
    min-height: var(--grid-control-height, 32px);
}

.ref-grid .ref-grid-controls .mud-input-control { margin: 0; }

.ref-grid .ref-grid-controls .grid-toolbar-search .mud-input-control-helper-container,
.ref-grid .ref-grid-controls .grid-toolbar-search .mud-input-helper-text { display: none; }

.ref-grid .ref-grid-presets { display: flex; align-items: center; gap: 8px; }

.ref-grid .ref-grid-preset {
    text-transform: none;
    white-space: nowrap;
    border-radius: var(--mud-default-borderradius);
}

.ref-grid .ref-grid-preset--modified {
    background-color: var(--mud-palette-primary-hover);
    color: var(--mud-palette-primary);
    border: 1px solid var(--mud-palette-primary);
}

.ref-grid .ref-grid-grouping > .mud-button-root {
    width: var(--grid-control-height, 32px);
    height: var(--grid-control-height, 32px);
    min-width: var(--grid-control-height, 32px);
    padding: 0;
    border-radius: var(--mud-default-borderradius);
}

.ref-grid .ref-grid-grouping-split { display: inline-flex; align-items: center; }
.ref-grid .ref-grid-grouping-split .mud-tooltip-root { display: flex; align-items: center; }
.ref-grid .ref-grid-grouping--split > .mud-button-root { border-top-right-radius: 0; border-bottom-right-radius: 0; }

.ref-grid .ref-grid-grouping-caret > .mud-button-root {
    width: 20px;
    min-width: 20px;
    height: var(--grid-control-height, 32px);
    padding: 0;
    border-radius: 0 var(--mud-default-borderradius) var(--mud-default-borderradius) 0;
    box-shadow: inset 1px 0 0 var(--mud-palette-primary-darken);
}

/* The menus are rendered by the popover provider, outside the page — hence unscoped names. */
.ref-grid-menu-caption { opacity: 1; pointer-events: none; }
.ref-grid-menu-caption-text {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--mud-palette-text-secondary);
}

/* Column funnels: quiet until they mean something (contrast ≥ 3 : 1 through the token, PT-26 sec. 10). */
.ref-grid .mud-table-head .filter-button { color: var(--mud-palette-text-disabled); padding: 4px; transition: color 120ms ease-in-out; }
.ref-grid .mud-table-head th:hover .filter-button,
.ref-grid .mud-table-head .filter-button:focus-visible { color: var(--mud-palette-text-primary); }
.ref-grid .mud-table-head .filter-button.filtered { opacity: 1; color: var(--mud-palette-primary); }

/* One line per row at 37 px (PT-26 sec. 3 and 9) — table layout only, the cards below 961 px wrap. */
@media (min-width: 961px) {
    .ref-grid .mud-table-dense .mud-table-body .mud-table-cell {
        padding: 6px 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 0;
    }
}

.ref-grid .mud-table-root { table-layout: auto; width: 100%; }
.ref-grid .mud-table-dense .mud-table-head th.ref-grid-col-title { min-width: 220px; }
.ref-grid .mud-table-head .column-options .mud-menu { display: none; }
.ref-grid .mud-table-head .column-options .sort-direction-icon:not(.mud-direction-asc):not(.mud-direction-desc) {
    width: 0; min-width: 0; padding: 0; margin: 0; overflow: hidden;
}
.ref-grid .mud-table-dense .mud-table-head .mud-table-cell { padding: 6px 12px; white-space: nowrap; vertical-align: middle; }

/* WI-06909: the sort number only when two or more columns sort. MudBlazor 9.2 paints "1" next to a
   lone sorted column or not depending on render timing; there it tells nothing. Every data grid. */
.mud-table-head th .mud-sort-index { visibility: hidden; }
.mud-table-head th:has(~ th .mud-sort-index:not(.invisible)) .mud-sort-index:not(.invisible),
.mud-table-head th:has(.mud-sort-index:not(.invisible)) ~ th .mud-sort-index:not(.invisible) { visibility: visible; }
.ref-grid .mud-table-body .mud-table-cell > .mud-chip { max-width: 100%; }

.ref-grid .ref-grid-code {
    font-family: var(--mud-typography-caption-family, ui-monospace, monospace);
    font-variant-numeric: tabular-nums;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

.ref-grid .ref-grid-title { font-weight: 500; }

.ref-grid .ref-grid-chip { border-radius: var(--mud-default-borderradius); margin: 0; max-width: 100%; }

/* Numbers (hours, amounts, versions) right-aligned, header included (WI-06850; same rule as the Sales list). */
@media (min-width: 961px) {
    .ref-grid th.ref-grid-num, .ref-grid td.ref-grid-num { text-align: right; font-variant-numeric: tabular-nums; }
    .ref-grid th.ref-grid-num .column-header { justify-content: flex-end; }
}

/* MudDataGrid's own expander raises no event; the shared GridGroupHeader is the toggle. */
.ref-grid .ref-grid-group-row .mud-table-row-expander { display: none; }

.ref-grid .grid-active-filters { margin-bottom: 12px; }

.ref-grid-shell { position: relative; min-height: 360px; }

.ref-grid .mud-table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Conditions that have no column of their own (team member, custom fields), inside the panel. */
.ref-grid-panel-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    padding-top: 4px;
}

.ref-grid-panel-filters > div { max-width: 320px; }
.ref-grid-panel-filters .ref-grid-panel-filter { min-width: 220px; flex: 0 1 260px; }

/* ── WI-06982: the Ekonomika overview on the reference grid ─────────────────────────────────────
   The period chip (left) and the view switch (right) in one row under the controls, like the row
   above the project's economics tiles; a margin below zero in the theme's error colour; the group
   header carries the sums of the visible amount columns; the total row under the table is bold. */
.econ-overview .econ-overview-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 24px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.econ-overview .econ-negative { color: var(--mud-palette-error); }

.econ-overview .econ-group-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 24px;
}

.econ-overview .econ-group-sums {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.econ-overview .econ-group-sum-label {
    font-weight: 400;
    color: var(--mud-palette-text-secondary);
    margin-right: 6px;
}

/* Cards (< 961 px): the empty spacer cells take no room; title and sums flow in one line as before. */
.econ-overview .econ-group-spacer { display: none; }

/* WI-07036: on the table layout the group sums sit in the columns of the table. MudDataGrid renders a
   group row as ONE cell spanning every column; with display: contents on that cell and its wrappers,
   the page's own cells (one per rendered column, Index.razor RenderGroupHeader) become cells of the
   group row, so the browser lays them out in the grid's columns: same widths, same order, same right
   edge as the rows and the total row — also after hiding, reordering or resizing a column. The title
   starts in the first cell and runs over the empty cells before the first amount. A header whose first
   column is an amount keeps the flowing layout (no econ-group-aligned). */
@media (min-width: 961px) {
    .econ-overview td.mud-datagrid-group:has(> div > .econ-group-aligned),
    .econ-overview .econ-group-aligned,
    .econ-overview .econ-group-aligned .econ-group-sums { display: contents; }

    /* MudDataGrid writes display:flex inline on the wrapper of the group template. */
    .econ-overview td.mud-datagrid-group:has(> div > .econ-group-aligned) > div { display: contents !important; }

    .econ-overview .econ-group-aligned .econ-group-cell {
        display: table-cell;
        vertical-align: middle;
        padding: 6px 12px;
        border-bottom: 1px solid var(--mud-palette-table-lines);
        /* What MudDataGrid gives its own group cell, which display: contents no longer paints. */
        background-color: var(--mud-palette-background-gray);
        color: var(--mud-palette-text-primary);
        font-family: var(--mud-typography-body2-family);
        font-size: var(--mud-typography-body2-size);
        line-height: var(--mud-typography-body2-lineheight);
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
        font-weight: 600;
    }

    .econ-overview .econ-group-aligned .econ-group-sum { text-align: right; }

    /* The column header names the value; the label stays for screen readers only. */
    .econ-overview .econ-group-aligned .econ-group-sum-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    /* The title may be wider than the first column: it overflows over the empty cells after it without
       widening the column (max-width 0, like every body cell of the reference grid). */
    .econ-overview .econ-group-aligned .econ-group-title-cell {
        position: relative;
        z-index: 1;
        max-width: 0;
        overflow: visible;
        padding-left: 4px;
    }

    .econ-overview .econ-group-aligned .econ-group-spacer {
        display: table-cell;
        pointer-events: none;
    }
}

/* MudDataGrid 9.2 repeats the column footers after every group; the page marks those rows and they go
   (the group's sums are in its header). The grid's own total row stays. */
/* !important: the card layout (< 961 px) sets display on every row with a stronger selector, which
   brought the repeated "Celkem" rows back under each group (WI-07036). */
.econ-overview tr:has(.econ-group-foot),
.econ-overview .mud-table-body tr:has(.econ-foot) { display: none !important; }

.econ-overview .mud-table-foot .mud-table-cell {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    border-top: 1px solid var(--mud-palette-lines-default);
    padding: 6px 12px;
}

/* WI-07036: MudBlazor pads the last cell of a dense row 16 px on the right; the body cells of the
   reference grid and the group sums use 12 px, so the total of the last column keeps the same edge. */
.econ-overview .mud-table-dense .mud-table-foot .mud-table-row .mud-table-cell:last-child { padding-right: 12px; padding-inline-end: 12px; }

/* WI-07036 (V3): an amount is never cut. The reference grid's body cells take no width from their
   content (max-width 0 + ellipsis), so an amount column without a designed width shrank to its header
   and a margin such as "-150 000 Kč" lost its end at 1280 px. Every amount column keeps room for a
   home-currency amount in the hundreds of millions, and the amount itself never ellipsizes. */
@media (min-width: 961px) {
    .econ-overview .mud-table-head th.ref-grid-num:not(.econ-col-percent) { min-width: 128px; }
    .econ-overview td.ref-grid-num.mud-table-cell { text-overflow: clip; }
}

@media (min-width: 961px) {
    .econ-overview td.ref-grid-num.mud-table-cell,
    .econ-overview .mud-table-foot td.ref-grid-num { text-align: right; }
}
/* ── WI-06770 F: mobile primitives of the Sales module ─────────────────────────────────────────
   Phone ≤ 600 px, tablet 601–960 px, "touch layout" ≤ 960 px. Touch targets ≥ 44×44 px with ≥ 8 px
   between them apply up to 960 px and on any coarse pointer; the desktop keeps 32 px controls and
   the 8/24 rhythm of the grid README. Components: Components/Shared/Mobile/*, the stage picker and
   the full-screen dialogs (MobileDialog). Packages P1–P4 add their own styles to .razor.css. */

/* Page header: title (+ count, meta line) left, actions right. */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.page-header-title { min-width: 0; flex: 1 1 auto; }

.page-header-heading { overflow-wrap: anywhere; }

.page-header-count { color: var(--mud-palette-text-secondary); font-weight: 400; margin-left: 8px; }

.page-header-meta { margin-top: 4px; font-size: 0.875rem; }

.page-header-actions,
.page-header-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .page-header { flex-wrap: nowrap; align-items: center; }
    .page-header .page-header-heading { font-size: 1.5rem; line-height: 1.25; }
    .page-header-actions { flex-wrap: nowrap; flex: 0 0 auto; }
}

/* Quick action bar pinned to the bottom (≤ 960 px only). */
.mobile-action-bar,
.mobile-action-bar-spacer { display: none; }

@media (max-width: 960px) {
    .mobile-action-bar {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1250; /* above the page and the sticky headers, below dialogs (1400) and popovers of its own menu */
        justify-content: space-around;
        align-items: stretch;
        gap: 8px;
        padding: 0 8px env(safe-area-inset-bottom, 0px);
        background-color: var(--mud-palette-surface);
        border-top: 1px solid var(--mud-palette-lines-default);
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    }

    .mobile-action-bar-spacer {
        display: block;
        height: calc(56px + 16px + env(safe-area-inset-bottom, 0px));
    }

    .mobile-action-bar > .mobile-action-bar-item,
    .mobile-action-bar > .mobile-action-bar-menu { flex: 1 1 0; min-width: 44px; max-width: 120px; }

    .mobile-action-bar-menu > .mud-menu-activator,
    .mobile-action-bar-menu .mobile-action-bar-item { width: 100%; height: 100%; }

    .mobile-action-bar-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-width: 44px;
        min-height: 56px;
        padding: 4px 2px;
        border: 0;
        background: transparent;
        color: var(--mud-palette-text-primary);
        font: inherit;
        text-decoration: none;
        cursor: pointer;
        border-radius: var(--mud-default-borderradius);
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-action-bar-item:disabled { color: var(--mud-palette-text-disabled); cursor: default; }

    .mobile-action-bar-item:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: -2px; }

    .mobile-action-bar-item:active:not(:disabled) { background-color: var(--mud-palette-action-default-hover); }

    .mobile-action-bar-label {
        font-size: 0.6875rem; /* 11 px */
        line-height: 1.2;
        text-align: center;
        max-width: 100%;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow-wrap: anywhere;
    }
}

/* Full-screen dialog on a phone (MobileDialog.SheetClass). */
@media (max-width: 600px) {
    .mud-dialog-container:has(> .mud-dialog.mobile-sheet) { align-items: stretch; justify-content: stretch; }

    .mud-dialog.mobile-sheet {
        margin: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        display: flex;
        flex-direction: column;
    }

    .mud-dialog.mobile-sheet .mud-dialog-content { flex: 1 1 auto; overflow-y: auto; }

    .mud-dialog.mobile-sheet .mud-dialog-actions {
        position: sticky;
        bottom: 0;
        gap: 8px;
        padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
        background-color: var(--mud-palette-surface);
        border-top: 1px solid var(--mud-palette-lines-default);
    }

    .mud-dialog.mobile-sheet .mud-dialog-actions > .mud-button-root { min-height: 44px; flex: 1 1 0; margin: 0; }
}

/* Stage picker ("Posunout do fáze…"). */
.stage-picker { display: flex; flex-direction: column; gap: 8px; }

.stage-picker-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 44px;
    width: 100%;
    padding: 8px 12px 8px 16px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    box-shadow: inset 4px 0 0 0 var(--stage-picker-color, var(--mud-palette-lines-default));
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.stage-picker-option:hover:not(:disabled) { background-color: var(--mud-palette-action-default-hover); }

.stage-picker-option:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }

.stage-picker-option-current { cursor: default; font-weight: 500; }

.stage-picker-current { font-size: 0.75rem; color: var(--mud-palette-text-secondary); }

/* Filters on a phone: the "Filtry (n)" button and the full-screen draft panel. */
.mobile-filter-open { min-height: 44px; white-space: nowrap; }

.mobile-filter-count { margin-left: 4px; }

.mobile-filter-panel {
    position: fixed;
    inset: 0;
    z-index: 1350; /* above the app bar (1300) and the action bar; its select popovers rise above it */
    display: flex;
    flex-direction: column;
    background-color: var(--mud-palette-background);
}

.mobile-filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 56px;
    padding: 4px 8px 4px 16px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background-color: var(--mud-palette-surface);
}

.mobile-filter-panel-header .mud-icon-button { min-width: 44px; min-height: 44px; }

.mobile-filter-panel-title { margin: 0; outline: none; }

.mobile-filter-panel-body {
    flex: 1 1 auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
}

.mobile-filter-panel-footer {
    display: flex;
    gap: 8px;
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--mud-palette-lines-default);
    background-color: var(--mud-palette-surface);
}

.mobile-filter-panel-footer > .mud-button-root { flex: 1 1 0; min-height: 44px; }

/* Stage rail of the phone board: horizontally scrolling chips (name, count, Σ). */
.stage-rail {
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    padding: 2px 0 8px;
    -webkit-overflow-scrolling: touch;
}

.stage-rail::-webkit-scrollbar { display: none; }

.stage-rail-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    box-shadow: inset 0 -3px 0 0 var(--stage-rail-color, transparent);
    font: inherit;
    font-size: 0.875rem;
    white-space: nowrap;
    cursor: pointer;
}

.stage-rail-chip-active {
    border-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary);
    font-weight: 500;
}

.stage-rail-chip:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }

.stage-rail-count { color: var(--mud-palette-text-secondary); }

.stage-rail-sum { color: var(--mud-palette-text-secondary); font-size: 0.8125rem; }

/* Snap scroller: one column per screen on a phone, 280 px columns on a tablet, no effect on desktop. */
@media (max-width: 960px) {
    .snap-scroller {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .snap-scroller > * { flex: 0 0 280px; scroll-snap-align: start; min-width: 0; }
}

@media (max-width: 600px) {
    .snap-scroller { gap: 0; }
    .snap-scroller > * { flex: 0 0 100%; }
}

/* Long press on a card: no iOS link preview / text callout. */
.no-touch-callout { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* Card lists ≤ 960 px (wi-cards): with the opt-in class wi-cards-touch on the same element (Sales lists),
   the card actions are 44 px touch targets, right-aligned. Opt-in so the Úkoly lists stay as they are. */
@media (max-width: 960px) {
    .wi-cards.wi-cards-touch tbody > tr > td.wi-card-action .mud-icon-button,
    .wi-cards.wi-cards-touch tbody > tr > td.wi-card-action .mud-button-root { min-width: 44px; min-height: 44px; }

    .wi-cards.wi-cards-touch tbody > tr > td.wi-card-action { display: flex; justify-content: flex-end; gap: 8px; }

    .wi-cards.wi-cards-touch tbody > tr > td.wi-card-code:has(~ td.wi-card-action) { padding-right: 52px !important; }
}

/* Touch targets on any coarse pointer, whatever the width (a tablet in landscape). */
@media (pointer: coarse) {
    .mobile-filter-open,
    .stage-rail-chip,
    .stage-picker-option { min-height: 44px; }
}

/* WI-06770 F follow-up: shared parts that appear on the Sales screens keep the 44 px touch target
   in the touch layout (≤ 960 px) and on any coarse pointer, without changing their behaviour —
   the "Nová verze" notice and the pager of every grid (WI-06771). */
@media (max-width: 960px), (pointer: coarse) {
    .release-notice .release-notice__link {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }

    .release-notice .mud-icon-button {
        min-width: 44px;
        min-height: 44px;
    }

    .mud-table-pagination .mud-input-control,
    .mud-table-pagination .mud-input {
        min-height: 44px;
    }

    .mud-table-pagination .mud-input {
        align-items: center;
    }

    .mud-table-pagination .mud-icon-button {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Snackbars at the bottom sit above the quick action bar while it is on the page (it covers the
   bottom 56 px + the safe area); without the bar they keep MudBlazor's own position. */
@media (max-width: 960px) {
    body:has(.mobile-action-bar) [class*="mud-snackbar-location-bottom"] {
        bottom: calc(56px + 8px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* ── WI-06770 acceptance fixes (D2, D3, D15, pager) ─────────────────────────────────────────── */

/* D3: placeholders are hints the user must be able to read (≥ 4.5:1 in both themes); MudBlazor and
   CodeMirror render them at ~2.6:1 (light) / ~1.9:1 (dark). */
.mud-input input::placeholder,
.mud-input textarea::placeholder {
    color: var(--mud-palette-text-secondary);
    opacity: 0.85;
}

.cm-editor .cm-placeholder {
    color: var(--mud-palette-text-secondary) !important;
    opacity: 0.85;
}

/* D2: in the touch layout (≤ 960 px) and on any coarse pointer every dialog button is a 44 px
   target, 8 px apart — not only the phone's full-screen sheets. Desktop with a mouse unchanged. */
@media (max-width: 960px), (pointer: coarse) {
    .mud-dialog .mud-dialog-actions {
        gap: 8px;
    }

    .mud-dialog .mud-dialog-actions > .mud-button-root,
    .mud-dialog .mud-dialog-actions > * > .mud-button-root {
        min-height: 44px;
        margin: 0;
    }

    /* The markdown editor's toolbar (comments, descriptions): 44 px buttons 8 px apart. */
    .md-editor-toolbar {
        gap: 8px;
    }

    .md-editor-btn {
        width: 44px;
        height: 44px;
    }

    /* Pager of every grid (WI-06771): the rows-per-page select and the page buttons. MudBlazor's
       own rules here are !important, so these must be as well. */
    .mud-table-pagination-toolbar .mud-icon-button {
        min-width: 44px;
        min-height: 44px;
    }

    .mud-table-pagination-select,
    .mud-table-pagination-select .mud-input-control,
    .mud-table-pagination-select .mud-input,
    .mud-table-pagination-select .mud-select-input {
        min-height: 44px !important;
    }

    .mud-table-pagination-select .mud-input {
        align-items: center;
    }
}

/* D15: while a dialog is open, bottom snackbars sit above its footer (the confirm buttons of a
   sheet are at the bottom of the screen); without a dialog they keep their place (or the action
   bar rule above). */
body:has(.mud-dialog-container .mud-dialog) [class*="mud-snackbar-location-bottom"] {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Focused form field below the fixed app bar (WI-06839): when a form moves the focus to an invalid
   field above the visible part (Save sits at the bottom), the browser scrolls the field to the top
   edge - without this margin it ends up hidden under the app bar. Only affects scrolling a field
   into view (focus, scrollIntoView), never the layout. */
.mud-main-content :is(input, textarea, select, [contenteditable="true"]) {
    scroll-margin-top: calc(var(--mud-appbar-height, 64px) + 24px);
}

/* ── M19 Travel orders (WI-06915, F1-D) ─────────────────────────────────────────────────────────
   One block for the list, the detail, its plan sections and the administration — the components
   live in Components/Shared/TravelOrders and are rendered under different pages (and dialogs), so
   the module keeps its styles here like the Sales primitives. Layout = the Projekty detail (F9, R75:
   header, state banner, one level of text tabs). F9b (R4): the rules of the removed Postup, Další krok,
   side panel and icon tabs are gone. Rhythm 8 / 16 / 24 px, radius = the theme's. */
.travel-visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Overdue, findings and readiness rows (chip + text + action) */
.travel-overdue { color: var(--mud-palette-error); }
.travel-checklist { margin-top: 8px; display: flex; flex-direction: column; }
.travel-checklist-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-top: 1px dashed var(--mud-palette-lines-default);
    min-height: 40px;
}
.travel-checklist-chip { flex: none; min-width: 112px; justify-content: flex-start; }
.travel-checklist-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
/* "Doplnit" never shrinks into its text (it was cut to "OPLNI" at 390 px). */
.travel-checklist-row > .mud-button-root { flex: none; }
@media (max-width: 600px) {
    /* Phone: state chip + text on the first line, "Doplnit" under the text, aligned with it. */
    .travel-checklist-row { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; row-gap: 0; align-items: start; }
    .travel-checklist-chip { min-width: 0; margin-top: 2px; }
    .travel-checklist-row > .mud-button-root { grid-column: 2; justify-self: start; margin-left: -8px; }
}

/* Sections of the plan (tab "Základní údaje" since F9) */
.travel-plan { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; }
.travel-section { padding: 16px; scroll-margin-top: calc(var(--mud-appbar-height, 64px) + 96px); transition: box-shadow 0.4s ease-out; }
.travel-section:focus { outline: none; }
.travel-section-highlight {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mud-palette-warning) 45%, transparent);
}
.travel-section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.travel-section-title { font-size: 1.05rem !important; font-weight: 600 !important; }
.travel-section-state { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.travel-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 0; }
.travel-field dt { font-size: 0.75rem; color: var(--mud-palette-text-secondary); }
.travel-field dd { margin: 2px 0 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .travel-fields { grid-template-columns: minmax(0, 1fr); } }
.travel-editor { padding-top: 4px; }
.travel-question { border: 0; padding: 0; margin: 12px 0 4px; min-width: 0; }
.travel-question legend { padding: 0; margin-bottom: 6px; }
.travel-line-row { border-bottom: 1px dashed var(--mud-palette-lines-default); padding-bottom: 4px; margin-bottom: 4px; }

/* Transport tiles and human-question choices */
.travel-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1280px) { .travel-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .travel-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.travel-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 64px; padding: 8px; cursor: pointer; font: inherit; font-size: 0.875rem;
    color: var(--mud-palette-text-primary); background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-inputs); border-radius: var(--mud-default-borderradius);
}
.travel-tile:hover:not(:disabled) { border-color: var(--mud-palette-primary); }
.travel-tile:focus-visible, .travel-choice:focus-visible, .travel-choice-radio:focus-visible, .travel-why:focus-visible {
    outline: 2px solid var(--mud-palette-primary); outline-offset: 2px;
}
.travel-tile-selected { border: 2px solid var(--mud-palette-primary); background: var(--mud-palette-primary-hover); font-weight: 600; }
.travel-tile:disabled { cursor: default; opacity: 0.75; }
/* WI-06915 UX revision F4: the kind of an expense as chips (44 px touch target, wraps on a phone). */
.travel-kind-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.travel-kind-chip {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 12px; cursor: pointer;
    font: inherit; font-size: 0.875rem; color: var(--mud-palette-text-primary); background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-inputs); border-radius: var(--mud-default-borderradius);
}
.travel-kind-chip:hover:not(:disabled) { border-color: var(--mud-palette-primary); }
.travel-kind-chip:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }
.travel-kind-chip-selected { border: 2px solid var(--mud-palette-primary); background: var(--mud-palette-primary-hover); font-weight: 600; }
.travel-kind-chip-more { color: var(--mud-palette-text-secondary); }
.travel-kind-chip:disabled { cursor: default; opacity: 0.75; }
.travel-reveal {
    margin-top: 12px; padding: 12px; border-radius: var(--mud-default-borderradius);
    background: color-mix(in srgb, var(--mud-palette-warning) 7%, transparent);
    border: 1px solid color-mix(in srgb, var(--mud-palette-warning) 35%, transparent);
}
.travel-choice {
    display: flex; align-items: flex-start; gap: 8px; width: 100%; margin-bottom: 8px; padding: 10px 12px;
    text-align: left; font: inherit; color: inherit; cursor: pointer; background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-inputs); border-radius: var(--mud-default-borderradius);
}
.travel-choice-static { flex-direction: column; cursor: default; }
.travel-choice-selected { border: 2px solid var(--mud-palette-primary); }
.travel-choice-text { display: flex; flex-direction: column; min-width: 0; }
.travel-choice-radio {
    display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0; border: 0; background: none;
    font: inherit; color: inherit; cursor: pointer; text-align: left;
}
.travel-choice-hint { margin-left: 28px; }
.travel-choice-detail { margin: 6px 0 0 28px; width: calc(100% - 28px); }
.travel-choice:disabled, .travel-choice-radio:disabled { cursor: default; }

/* Estimate */
.travel-estimate { width: 100%; border-collapse: collapse; }
.travel-estimate td { padding: 8px; border-bottom: 1px solid var(--mud-palette-lines-default); vertical-align: top; }
.travel-estimate .travel-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.travel-estimate-total td { border-top: 2px solid var(--mud-palette-lines-default); }
.travel-why {
    margin-left: 8px; padding: 0; border: 0; background: none; font: inherit; font-size: 0.8125rem;
    color: var(--mud-palette-primary); text-decoration: underline dotted; cursor: pointer;
}
.travel-costs-list, .travel-checks { list-style: none; margin: 0; padding: 0; }
.travel-costs-list li, .travel-checks li { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; overflow-wrap: anywhere; }

/* The journey kind asked inline in the read view of "Cesta" (one click, saved at once). */
.travel-question-inline {
    margin-top: 16px; padding: 12px; border-radius: var(--mud-default-borderradius);
    background: color-mix(in srgb, var(--mud-palette-warning) 7%, transparent);
    border: 1px solid color-mix(in srgb, var(--mud-palette-warning) 35%, transparent);
}
.travel-question-answers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.travel-answer { width: auto; margin-bottom: 0; align-items: center; min-height: 40px; }
.travel-answer:hover:not(:disabled) { border-color: var(--mud-palette-primary); }
.travel-answer-suggested { border-color: var(--mud-palette-primary); }
@media (max-width: 600px) { .travel-answer { width: 100%; } }
@media (max-width: 960px), (pointer: coarse) { .travel-answer { min-height: 44px; } }

/* "Proč?": the plain answer, the exact calculation folded under it. */
.travel-why-answer { margin-top: 4px; max-width: 60ch; }
.travel-why-detail { margin-top: 4px; }
.travel-why-detail summary { cursor: pointer; color: var(--mud-palette-text-secondary); }
.travel-future { display: flex; align-items: flex-start; gap: 16px; padding: 24px 8px; }
.travel-future-icon { width: 40px; height: 40px; flex: none; }
.travel-comment-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }

/* Administration: readiness rows */
.travel-readiness-row {
    display: flex; align-items: center; gap: 12px; padding: 10px 8px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}
.travel-readiness-row:last-child { border-bottom: 0; }

/* WI-06915 acceptance F6 MĚLO BY 7: a wide table scrolls in its own focusable region (axe scrollable-region-focusable) */
.travel-scroll-region { overflow-x: auto; max-width: 100%; }
.travel-scroll-region .mud-table-container { overflow: visible; }
.travel-scroll-region:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }
/* F9b (R75): the accounting handover on one line per row as the Projekty list (table layout only; the cards wrap). */
@media (min-width: 961px) {
    [data-testid='travel-export-grid'] .mud-table-body .mud-table-cell { white-space: nowrap; }
    [data-testid='travel-export-grid'] td.travel-handover-ref { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
}

/* Touch targets 44 px in the touch layout and on a coarse pointer (UX-09) */
@media (max-width: 960px), (pointer: coarse) {
    .travel-touch-target.mud-icon-button,
    .travel-touch-target.mud-button-root,
    .travel-touch-target.mud-toggle-item,
    .travel-detail .mud-button-root,
    .travel-detail .mud-icon-button,
    .travel-tile,
    .travel-choice-radio { min-height: 44px; min-width: 44px; }
    .travel-detail .mud-input.mud-input-outlined { min-height: 44px; }
    .travel-why { min-height: 44px; }
    .travel-detail .mud-checkbox, .travel-detail .mud-radio { min-height: 44px; }
}

/* F8 mobile pass: the M19 dialogs render outside the detail (MudDialog portal), so their buttons, chips, radios and
   checkboxes get the 44 px touch targets here — the expense dialog's kind / payer chips and the movement dialog's
   actions measured 38–42 px at 390 px. */
@media (max-width: 960px), (pointer: coarse) {
    .mud-dialog:has([data-testid^='travel-']) :is(.mud-button-root, .mud-icon-button, .mud-chip, [role='radio'], .mud-checkbox) {
        min-height: 44px;
    }
    .mud-dialog:has([data-testid^='travel-']) :is(.mud-icon-button, .mud-chip) { min-width: 44px; }
}
/* Travel list at phone width: the presets wrap instead of widening the toolbar past the screen (UX-08). */
@media (max-width: 600px) {
    [data-testid='travel-list'] .grid-toolbar-center,
    [data-testid='travel-list'] .grid-toolbar { min-width: 0; max-width: 100%; }
    [data-testid='travel-list'] .ref-grid-presets { flex-wrap: wrap; row-gap: 8px; min-width: 0; }
}

/* Leave list and the leave administration grids at phone width (WI-06948 F5c): the presets, the saved-filter combo and the
   tools wrap instead of widening the page / clipping the buttons — the same fix as the travel list above. */
@media (max-width: 600px) {
    :is([data-testid='leave-list'], [data-testid='leave-readiness'], [data-testid='leave-accounts']) :is(.grid-toolbar-center, .grid-toolbar, .grid-toolbar-tools, .grid-tools, .saved-views) { min-width: 0; max-width: 100%; }
    :is([data-testid='leave-list'], [data-testid='leave-readiness'], [data-testid='leave-accounts']) :is(.ref-grid-presets, .grid-toolbar-tools, .grid-tools) { flex-wrap: wrap; row-gap: 8px; min-width: 0; }
    :is([data-testid='leave-list'], [data-testid='leave-readiness'], [data-testid='leave-accounts']) .grid-toolbar-tools { margin-left: 0; }
}
/* Touch layout of the travel list and dialogs: 44 px targets (UX-09). */
@media (max-width: 960px), (pointer: coarse) {
    [data-testid='travel-list'] .mud-button-root,
    [data-testid='travel-list'] .mud-icon-button { min-height: 44px; min-width: 44px; }
    [data-testid='travel-create-dialog'] .mud-checkbox .mud-icon-button,
    [data-testid='travel-create-dialog'] .mud-input-adornment .mud-icon-button { min-height: 44px; min-width: 44px; }
    .travel-why { min-width: 44px; }
}

@media (max-width: 960px), (pointer: coarse) {
    [data-testid='travel-list'] .grid-toolbar { --grid-toolbar-control-height: 44px; }
    [data-testid='travel-list'] .ref-grid-preset,
    [data-testid='travel-list'] .grid-tools .mud-button-root,
    [data-testid='travel-list'] .grid-tools .mud-icon-button { height: 44px !important; min-height: 44px; min-width: 44px; }
    /* Acceptance F1, 7c: "Další předvolby", Sloupce and Export at 44 px, the code link of a card and the
       "Zobrazit další" / "Zobrazit celé" links of the order's history as tall touch targets — M19 only,
       the shared toolbar and history panel keep their desktop density elsewhere. */
    [data-testid='travel-list'] [data-testid='travel-preset-more'] .mud-button-root,
    [data-testid='travel-list'] [data-testid='travel-columns'],
    [data-testid='travel-list'] [data-testid='travel-export'],
    [data-testid='travel-list'] [data-testid='travel-export'] .mud-button-root,
    [data-testid='travel-list'] [data-testid='travel-export'] .mud-icon-button { height: 44px !important; min-height: 44px; min-width: 44px; }
    /* The shared tools size their squares from --grid-tools-height in the scoped GridTools CSS, which
       outranks this block — the list sets the variable itself (both sides follow it). */
    [data-testid='travel-list'] .grid-tools { --grid-tools-height: 44px !important; }
    [data-testid='travel-list'] .grid-tools .grid-toolbar-tool { width: 44px !important; min-width: 44px !important; height: 44px !important; }
    [data-testid='travel-grid'] .ref-grid-code { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
    .travel-detail .change-history-link { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
}

/* ── M19 F3-D (WI-06915): submission summary, approval tab, revision diff ──────────────────────
   The effective (approved) plan and a proposed change are told apart by a chip with text + icon,
   never by colour alone; the diff table turns into cards on a phone (no horizontal scroll, UX-08). */
.travel-inline-icon { vertical-align: text-bottom; }
.travel-plan-revision { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 8px 12px;
    border: 1px solid var(--mud-palette-lines-default); border-radius: var(--mud-default-borderradius); }
.travel-plan-revision-proposed { border-color: var(--mud-palette-warning); border-left-width: 4px; }
.travel-routing-step + .travel-routing-step { margin-top: 8px; }
.travel-routing-approvers, .travel-check-list, .travel-votes, .travel-phases { list-style: none; margin: 0; padding: 0; }
.travel-routing-approvers li { display: flex; align-items: flex-start; gap: 6px; padding: 2px 0; }
.travel-routing-icon { flex: none; margin-top: 2px; }
.travel-check-list li, .travel-votes li { padding: 2px 0; }
.travel-deficiencies { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.travel-decision-summary-active { border-left: 4px solid var(--mud-palette-primary); }
.travel-round { margin-top: 8px; padding-left: 12px; border-left: 2px solid var(--mud-palette-lines-default); }
.travel-phase-decision { margin-top: 4px; }
.travel-why-routing { margin-top: 8px; }
.travel-why-routing > summary { cursor: pointer; color: var(--mud-palette-primary); display: inline-flex; align-items: center; }
.travel-diff-table { width: 100%; border-collapse: collapse; }
.travel-diff-table th, .travel-diff-table td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--mud-palette-lines-default); overflow-wrap: anywhere; }
.travel-diff-table thead th { font-size: 0.75rem; color: var(--mud-palette-text-secondary); font-weight: 500; }
@media (max-width: 600px) {
    .travel-deficiencies { grid-template-columns: minmax(0, 1fr); }
    .travel-diff-table thead { display: none; }
    .travel-diff-table, .travel-diff-table tbody, .travel-diff-table tr, .travel-diff-table th, .travel-diff-table td { display: block; width: 100%; }
    .travel-diff-table tr { padding: 8px 0; border-bottom: 1px solid var(--mud-palette-lines-default); }
    .travel-diff-table th, .travel-diff-table td { border-bottom: 0; padding: 2px 0; }
    .travel-diff-table td::before { content: attr(data-label) ": "; color: var(--mud-palette-text-secondary); font-size: 0.75rem; }
}
@media (max-width: 960px), (pointer: coarse) {
    [data-testid='travel-submit-dialog'] .mud-checkbox .mud-icon-button,
    [data-testid='travel-decision-dialog'] .mud-checkbox .mud-icon-button { min-height: 44px; min-width: 44px; }
    .travel-why-routing > summary { min-height: 44px; }
}

/* ── M19 F4-C (WI-06915): journey, expenses and documents, calculation ──────────────────────────
   Cards on the pattern of the plan sections; states always icon + text; 44 px targets on touch;
   no horizontal scroll at 390 px (tables turn into rows of label + value). */
.travel-f4 { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; }
.travel-findings { padding: 8px 16px; }
.travel-findings .travel-checklist { margin-top: 0; }
.travel-findings .travel-checklist-row:first-child { border-top: 0; }
.travel-takeover { border-left: 4px solid var(--mud-palette-primary); }
.travel-datetime { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 8px; }
.travel-times { border-collapse: collapse; width: 100%; max-width: 640px; }
.travel-times th, .travel-times td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--mud-palette-lines-default); }
.travel-times thead th { font-size: 0.75rem; color: var(--mud-palette-text-secondary); font-weight: 500; }
.travel-times tbody th { font-weight: 500; width: 25%; }

/* Segments as a time line; the stay between them is part of the trip (grey row). */
.travel-timeline { list-style: none; margin: 0; padding: 0; }
.travel-segment {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 12px; align-items: start;
    padding: 10px 8px; border: 1px solid var(--mud-palette-lines-default); border-radius: var(--mud-default-borderradius);
    background: var(--mud-palette-surface); scroll-margin-top: calc(var(--mud-appbar-height, 64px) + 96px);
}
.travel-segment-derived { border-color: var(--mud-palette-warning); border-style: dashed; }
.travel-segment-icon { margin-top: 2px; color: var(--mud-palette-text-secondary); }
.travel-segment-line { display: flex; flex-wrap: wrap; gap: 4px 12px; overflow-wrap: anywhere; }
.travel-segment-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; }
.travel-segment-actions { display: flex; align-items: center; gap: 4px; }
.travel-segment-stay { padding: 6px 8px 6px 40px; border-left: 2px dotted var(--mud-palette-lines-default); margin-left: 18px; }
@media (max-width: 600px) {
    .travel-segment { grid-template-columns: auto minmax(0, 1fr); }
    .travel-segment-actions { grid-column: 1 / -1; justify-content: flex-end; }
    .travel-datetime { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* Meal grid: rows = days (row headers), columns = meals, a 44 px tick box per cell. */
.travel-meals-wrap { margin-top: 8px; }
.travel-meals { border-collapse: collapse; width: 100%; }
.travel-meals th, .travel-meals td { padding: 4px 8px; border-bottom: 1px solid var(--mud-palette-lines-default); text-align: left; vertical-align: middle; }
.travel-meals thead th { font-size: 0.75rem; color: var(--mud-palette-text-secondary); font-weight: 500; }
.travel-meals thead th::first-letter { text-transform: uppercase; }
.travel-meals tbody th { font-weight: 500; white-space: nowrap; }
.travel-meals-no-entitlement th, .travel-meals-no-entitlement td { color: var(--mud-palette-text-disabled); background: var(--mud-palette-action-disabled-background); }
.travel-meal-cell { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; min-height: 44px; }
.travel-meal-pending { border-radius: var(--mud-default-borderradius); outline: 1px dashed var(--mud-palette-warning); outline-offset: -2px; }
.travel-meals-single { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 8px; }
.travel-meal-cell .mud-checkbox .mud-icon-button { min-width: 44px; min-height: 44px; }
@media (max-width: 600px) {
    .travel-meals th, .travel-meals td { padding: 2px 4px; }
    .travel-meals tbody th { white-space: normal; }
    .travel-meal-cell .mud-chip { display: none; }
}
.travel-intervals { list-style: none; margin: 0; padding: 0; }
.travel-intervals li { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 0; border-top: 1px dashed var(--mud-palette-lines-default); }

/* File picker: the native input stays focusable (visually hidden), the label is the visible button. */
.travel-file-picker { position: relative; display: inline-flex; flex-direction: column; }
.travel-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.travel-file-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 4px 12px;
    border: 1px solid var(--mud-palette-primary); border-radius: var(--mud-default-borderradius);
    color: var(--mud-palette-primary); font-size: 0.875rem; font-weight: 500; cursor: pointer;
}
.travel-file-button-primary { background: var(--mud-palette-primary); color: var(--mud-palette-primary-text); min-height: 48px; font-size: 0.9375rem; }
.travel-file-button-disabled { opacity: 0.5; pointer-events: none; }
.travel-file-picker:focus-within .travel-file-button { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }
.travel-only-phone { display: none; }
@media (max-width: 600px) { .travel-only-phone { display: flex; width: 100%; } .travel-only-phone .travel-file-button { width: 100%; } }
@media (max-width: 960px), (pointer: coarse) { .travel-file-button { min-height: 44px; } }

/* Documents with thumbnails (WI-06864 renditions). */
.travel-docs { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.travel-doc { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.travel-doc-thumb { padding: 0; border: 1px solid var(--mud-palette-lines-default); border-radius: var(--mud-default-borderradius); background: none; cursor: zoom-in; width: 56px; height: 56px; overflow: hidden; }
.travel-doc-thumb img { width: 56px; height: 56px; object-fit: cover; display: block; }
.travel-doc-thumb:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }
.travel-doc-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 40px; color: var(--mud-palette-text-secondary); }
.travel-doc-body { display: flex; flex-direction: column; min-width: 0; }
.travel-doc-name { overflow-wrap: anywhere; }
/* The file name opens the original: a 44 px touch target on a phone (UX 7, UX revision F4). */
@media (max-width: 960px) { .travel-doc-name { display: inline-flex; align-items: center; min-height: 44px; } }
.travel-doc-actions { display: flex; align-items: center; }
.travel-doc-preview { display: flex; justify-content: center; }
.travel-doc-preview img { max-width: 100%; max-height: 75vh; object-fit: contain; }
.travel-picked { list-style: none; margin: 0 0 8px; padding: 0; }
.travel-picked li { display: flex; align-items: center; gap: 8px; min-width: 0; }

/* Expense cards and totals. */
.travel-expense-cards { display: flex; flex-direction: column; gap: 8px; }
.travel-expense-card {
    padding: 12px; border: 1px solid var(--mud-palette-lines-default); border-radius: var(--mud-default-borderradius);
    scroll-margin-top: calc(var(--mud-appbar-height, 64px) + 96px);
}
.travel-expense-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.travel-expense-title { min-width: 0; overflow-wrap: anywhere; }
.travel-expense-amount { white-space: nowrap; font-variant-numeric: tabular-nums; display: inline-flex; gap: 6px; }
.travel-expense-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.travel-expense-totals { margin: 12px 0 0; }
.travel-expense-totals > div { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; }
.travel-expense-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.travel-vehicle-evidence { padding: 8px 0; border-top: 1px dashed var(--mud-palette-lines-default); scroll-margin-top: calc(var(--mud-appbar-height, 64px) + 96px); }

/* Calculation: tiles, rows with "Proč?", the result in words. */
.travel-tiles-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.travel-metric {
    display: flex; flex-direction: column; gap: 2px; padding: 12px; min-width: 0;
    border: 1px solid var(--mud-palette-lines-default); border-radius: var(--mud-default-borderradius);
}
.travel-metric strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.travel-metric-result { border: 2px solid var(--mud-palette-primary); }
@media (max-width: 960px) { .travel-tiles-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.travel-calc-table { width: 100%; border-collapse: collapse; }
.travel-calc-table th, .travel-calc-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--mud-palette-lines-default); vertical-align: top; }
.travel-calc-table thead th { font-size: 0.75rem; color: var(--mud-palette-text-secondary); font-weight: 500; }
.travel-calc-table .travel-num, .travel-calc-row .travel-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.travel-calc-why-row td { background: var(--mud-palette-background-gray); }
.travel-calc-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--mud-palette-lines-default); }
.travel-calc-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.travel-calc-group + .travel-calc-group { margin-top: 12px; }
.travel-calc-total { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 8px; margin-top: 4px; border-top: 2px solid var(--mud-palette-lines-default); }
.travel-calc-final { font-size: 1.1rem; }
.travel-calc-unpaid { color: var(--mud-palette-text-secondary); text-decoration: line-through; }
.travel-calc-why { padding: 4px 0 8px; }
@media (max-width: 600px) {
    .travel-calc-table thead { display: none; }
    .travel-calc-table, .travel-calc-table tbody, .travel-calc-table tr, .travel-calc-table th, .travel-calc-table td { display: block; width: 100%; }
    .travel-calc-table tr { padding: 6px 0; border-bottom: 1px solid var(--mud-palette-lines-default); }
    .travel-calc-table th, .travel-calc-table td { border-bottom: 0; padding: 2px 0; text-align: left !important; }
    .travel-calc-table td[data-label]::before { content: attr(data-label) ": "; color: var(--mud-palette-text-secondary); font-size: 0.75rem; }
}
/* The vehicle picker beside "+ Nové vozidlo": a long vehicle name wraps the button instead of widening the phone dialog (UX revision F4). */
.travel-vehicle-pick > .mud-select { flex: 1 1 220px; min-width: 0; max-width: 100%; }

/* WI-06915 F5: "Co bude dál" of the settlement summary and the assessments of the review. */
.travel-next-steps { padding-left: 1.5rem; margin: 4px 0; }
.travel-assessment { padding: 8px 0; border-top: 1px solid var(--mud-palette-lines-default); }
.travel-assessment:first-of-type { border-top: none; }

/* WI-06915 UX revision F5: on a phone the long primary action of a travel dialog ("Kontrola v pořádku – předat ke schválení")
   takes the width, Zrušit stays compact (it was squeezed into four lines); the helper line keeps clear of the counter. */
@media (max-width: 600px) {
    .mud-dialog.mobile-sheet .mud-dialog-actions > [data-testid^="travel-"][data-testid$="-cancel"] { flex: 0 0 auto; padding-inline: 12px; }
    .mud-dialog.mobile-sheet .mud-dialog-actions > [data-testid^="travel-"]:not([data-testid$="-cancel"]) { flex: 1 1 auto; white-space: normal; }
    .mud-dialog.mobile-sheet [data-testid^="travel-"] .mud-input-helper-text { padding-right: 8px; }
    .mud-dialog.mobile-sheet [data-testid^="travel-"] .mud-input-control-helper-container { gap: 8px; }
}
/* Approval attachments (WI-07008 V7a): the native file input lies invisibly over the drop zone, so a
   click or a drop on the zone opens/takes the files. The utility classes it used before (opacity-0,
   absolute, z-10) are not part of MudBlazor 9, so the browser's own "Choose Files / No file chosen"
   showed in English above the zone. */
.attachment-drop { position: relative; }
.attachment-drop .attachment-drop-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 10;
    cursor: pointer;
    overflow: hidden;
}

/* WI-07027 (V5): <MudText Color="Color.Secondary"> is used throughout for muted, secondary text, but
   MudBlazor paints it in the palette's brand Secondary — the Default style's orange #f47b30 is 2.72 : 1
   on white. Secondary-coloured TEXT takes the palette's TextSecondary (>= 4.5 : 1 in every style and
   mode, ThemeTextContrastTests); icons, chips and buttons keep the brand colour. */
.mud-typography.mud-secondary-text { color: var(--mud-palette-text-secondary) !important; }
