@import "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css";

/*
 * Kleur-tokens voor licht en donker. Gebruik deze variabelen in plaats van vaste kleuren,
 * dan klopt een component meteen in beide thema's. Het thema staat als data-theme op <html>
 * (gezet door js/theme.js en ThemeService); MudBlazor-kleuren komen uit AppTheme.cs.
 */
:root {
    color-scheme: light;

    --malfi-bg: #F6F7FB;
    --malfi-surface: #FFFFFF;
    --malfi-surface-subtle: #F8F9FC;
    --malfi-surface-accent: #F0F3FA;
    --malfi-surface-hover: #F5F8FF;
    --malfi-border: #E6EAF2;
    --malfi-border-subtle: #F0F2F6;
    --malfi-border-strong: #C7D2EA;
    --malfi-input-border: #D0D5DD;

    --malfi-text: #101828;
    --malfi-text-secondary: #344054;
    --malfi-text-muted: #667085;
    --malfi-text-faint: #98A2B3;

    /* Navy als tekst/icoon-kleur, en als vlak met tekst erop */
    --malfi-accent: #12307A;
    --malfi-accent-strong: #0B1F55;
    --malfi-accent-solid: #12307A;
    --malfi-on-accent-solid: #FFFFFF;
    --malfi-ring: 0 0 0 4px rgba(18, 48, 122, 0.15);

    --malfi-danger: #B42318;
    --malfi-danger-bg: #FEF6F6;
    --malfi-danger-border: #FDE2E1;
    --malfi-warning: #B26A00;
    --malfi-warning-dot: #F79009;

    --malfi-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.04);
    --malfi-shadow-md: 0 8px 24px rgba(16, 24, 40, 0.08);
    --malfi-shadow-hover: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 24px -12px rgba(18, 48, 122, 0.25);

    /* Rolkleuren (RoleUIHelper) */
    --malfi-role-bg: #F3F5FA;
    --malfi-role-border: #DDE3EE;
    --malfi-role-text: #12307A;
    --malfi-role-admin-bg: #E9EDF7;
    --malfi-role-admin-border: #C3CDE4;
    --malfi-role-admin-text: #0B1F55;
}

:root[data-theme="dark"] {
    color-scheme: dark;

    --malfi-bg: #0B1120;
    --malfi-surface: #121A2D;
    --malfi-surface-subtle: #0F1728;
    --malfi-surface-accent: #1A2747;
    --malfi-surface-hover: #182340;
    --malfi-border: #232E48;
    --malfi-border-subtle: #1C2640;
    --malfi-border-strong: #3A4A78;
    --malfi-input-border: #33416A;

    --malfi-text: #E7EBF3;
    --malfi-text-secondary: #C2C9D6;
    --malfi-text-muted: #8A94A8;
    --malfi-text-faint: #5E6880;

    --malfi-accent: #8FA9FF;
    --malfi-accent-strong: #B4C6FF;
    --malfi-accent-solid: #8FA9FF;
    --malfi-on-accent-solid: #0B1120;
    --malfi-ring: 0 0 0 4px rgba(143, 169, 255, 0.22);

    --malfi-danger: #FDA29B;
    --malfi-danger-bg: rgba(240, 68, 56, 0.1);
    --malfi-danger-border: rgba(240, 68, 56, 0.28);
    --malfi-warning: #FDB022;
    --malfi-warning-dot: #FDB022;

    --malfi-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.18);
    --malfi-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --malfi-shadow-hover: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 24px -12px rgba(0, 0, 0, 0.6);

    --malfi-role-bg: #16213D;
    --malfi-role-border: #2A3760;
    --malfi-role-text: #A9BCFF;
    --malfi-role-admin-bg: #1C2A52;
    --malfi-role-admin-border: #3A4A78;
    --malfi-role-admin-text: #C9D5FF;
}

html, body {
    margin: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Wisselen van thema: een cirkel die vanaf de knop uitwaaiert (js/theme.js). Tijdens het wisselen geen
   CSS-transities, anders legt de browser halfweg-kleuren vast in de momentopname. Uitzondering: .theme-animate
   (de themaknop en -keuze), die bewust mee animeren. */
html.theme-switching *:not(.theme-animate, .theme-animate *),
html.theme-switching *:not(.theme-animate, .theme-animate *)::before,
html.theme-switching *:not(.theme-animate, .theme-animate *)::after {
    transition: none !important;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

/* Square buttons in the app bar (ThemeToggle, LanguageToggle). */
.appbar-toggle {
    position: relative;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-right: 4px;
    padding: 0;
    border: 1px solid var(--malfi-border);
    border-radius: 12px;
    background: var(--malfi-surface);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

    .appbar-toggle:hover {
        border-color: var(--malfi-border-strong);
        background: var(--malfi-surface-accent);
    }

    .appbar-toggle:active {
        transform: scale(0.94);
    }

    .appbar-toggle:focus-visible {
        outline: none;
        box-shadow: var(--malfi-ring);
    }

/* Taalwissel: de oude pagina vervaagt, de nieuwe komt zacht in beeld (zie malfiTheme.crossfade). */
html.crossfading::view-transition-old(root) {
    animation: malfi-fade-out 0.22s ease both;
}

html.crossfading::view-transition-new(root) {
    animation: malfi-fade-in 0.32s cubic-bezier(0.2, 0, 0, 1) both;
}

@keyframes malfi-fade-out {
    to { opacity: 0; }
}

@keyframes malfi-fade-in {
    from { opacity: 0; transform: translateY(6px); }
}

h1:focus {
    outline: none;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

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

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

/* Zijbalk: wit vlak zoals de app bar, met navy als accent (actief item, logo, avatar). */
.malfi-drawer {
    --drawer-bg: var(--mud-palette-appbar-background);
    --drawer-line: var(--malfi-border-subtle);
    --drawer-accent: var(--malfi-accent);
    /* MudBlazor kleurt het actieve item met deze twee (specifiekere selector dan de onze) */
    --mud-palette-primary: var(--drawer-accent);
    --mud-palette-action-default-hover: var(--malfi-surface-accent);
    color: var(--malfi-text);
    background: var(--drawer-bg);
    border-right: 1px solid var(--malfi-border);
}

/* Even hoog als de app bar, zodat de lijn eronder doorloopt. */
.malfi-drawer-header {
    display: flex;
    align-items: center;
    /* 64px toolbar + 1px border van .malfi-appbar, zodat beide lijnen op één hoogte liggen */
    height: 65px;
    padding: 0 12px;
    border-bottom: 1px solid var(--malfi-border);
}

    .malfi-drawer-header .auth-lockup {
        font-size: 18px;
        line-height: 36px;
        color: var(--malfi-accent-strong);
    }

    .malfi-drawer-header .auth-lockup-tile {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        box-shadow: inset 0 0 0 1px var(--malfi-border);
    }

        .malfi-drawer-header .auth-lockup-tile img {
            width: 26px;
            height: 26px;
        }

.malfi-drawer-footer {
    padding: 12px;
    border-top: 1px solid var(--malfi-border);
}

/* Logo (naar het dashboard) en account (naar de accountpagina): zelfde hover als de menu-items. */
.malfi-drawer-link {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

    .malfi-drawer-link:hover,
    .malfi-drawer-link:focus-visible {
        background-color: var(--malfi-surface-hover);
        outline: none;
    }

    .malfi-drawer-link:focus-visible {
        box-shadow: var(--malfi-ring);
    }

/* Accountkaart onderaan, zoals de aangemelde gebruiker op de rolselectie */
.malfi-account {
    gap: 12px;
}

.malfi-account-avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--malfi-accent-solid);
    color: var(--malfi-on-accent-solid);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.malfi-account-text {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
    line-height: 1.3;
}

.malfi-account-name,
.malfi-account-role {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.malfi-account-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--malfi-text);
}

.malfi-account-role {
    font-size: 13px;
    color: var(--malfi-text-muted);
}

.malfi-account-arrow {
    flex-shrink: 0;
    font-size: 20px;
    color: var(--malfi-text-faint);
}

/* Menu: lijnen tussen de items, het actieve item met een navy accentbalk links */
.malfi-drawer .mud-navmenu {
    margin-top: 16px;
    padding: 0 12px;
}

.malfi-drawer .mud-nav-item + .mud-nav-item {
    border-top: 1px solid var(--drawer-line);
}

.malfi-drawer .mud-nav-link {
    --mud-palette-drawer-icon: currentColor; /* icoon volgt de tekstkleur (MudBlazor zet het anders vast) */
    position: relative;
    align-items: center;
    padding: 14px 12px;
    margin: 0;
    border-radius: 0;
    color: var(--malfi-text-secondary);
    transition: background-color 0.15s ease, color 0.15s ease;
}

    .malfi-drawer .mud-nav-link .mud-nav-link-text,
    .malfi-drawer .mud-nav-link .mud-nav-link-icon {
        color: inherit;
    }

    .malfi-drawer .mud-nav-link .mud-nav-link-text {
        font-size: 16px;
        font-weight: 500;
        letter-spacing: 0.01em;
    }

    .malfi-drawer .mud-nav-link .mud-nav-link-icon {
        font-size: 22px;
        margin-right: 2px;
        color: var(--malfi-text-muted);
    }

    .malfi-drawer .mud-nav-link:hover:not(.mud-nav-link-disabled),
    .malfi-drawer .mud-nav-link:focus-visible:not(.mud-nav-link-disabled) {
        background: var(--malfi-surface-hover);
        color: var(--malfi-accent);
    }

    .malfi-drawer .mud-nav-link.active:not(.mud-nav-link-disabled) {
        background: var(--malfi-surface-accent);
        color: var(--drawer-accent);
    }

        .malfi-drawer .mud-nav-link.active:not(.mud-nav-link-disabled) .mud-nav-link-text {
            font-weight: 600;
        }

        .malfi-drawer .mud-nav-link.active:not(.mud-nav-link-disabled)::before {
            content: "";
            position: absolute;
            left: 0;
            top: 10px;
            bottom: 10px;
            width: 3px;
            border-radius: 0 3px 3px 0;
            background: var(--drawer-accent);
        }

        .malfi-drawer .mud-nav-link:hover:not(.mud-nav-link-disabled) .mud-nav-link-icon,
        .malfi-drawer .mud-nav-link.active:not(.mud-nav-link-disabled) .mud-nav-link-icon {
            color: var(--drawer-accent);
        }

/* App bar: licht doorschijnend met blur */
.malfi-appbar {
    border-bottom: 1px solid var(--malfi-border);
    background-color: color-mix(in srgb, var(--mud-palette-appbar-background) 82%, transparent) !important;
    backdrop-filter: saturate(1.4) blur(12px);
}

@media (max-width: 959.98px) {
    .malfi-drawer {
        max-width: 85vw;
    }

    .malfi-drawer .mud-nav-link {
        padding: 14px 12px;
    }
}

/* Tabellen met "fit-height" scrollen in een eigen vak dat het venster vult (hoogte: js/fit-height.js);
   de kolomkoppen blijven staan (FixedHeader) en aan het einde scrolt de pagina niet mee. "fit-height-box": hetzelfde voor een lijst. */
.fit-height .mud-table-container,
.fit-height-box {
    max-height: 60vh; /* tot het script de juiste hoogte zet */
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

/* Controles: adviesbadge, lege lijst en tekst enkel voor schermlezers */
.advice-chip {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1f1f1f;
    white-space: nowrap;
}

.inspection-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 40px 16px;
    color: var(--malfi-text-faint);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Label/waarde-regels (vennootschap en controle): op een gsm een smaller label, lange waarden lopen door */
.info-label {
    min-width: 10rem;
    flex-shrink: 0;
}

.info-value {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    white-space: pre-line;
}

@media (max-width: 599.98px) {
    .info-label {
        min-width: 0;
        flex: 0 0 42%;
    }
}

/* ---------- Kaart vennootschappen (wwwroot/js/company-map.js, US 140) ---------- */

/* One colour per state: chips, dots and the badge in the popup. */
.state-Overdue { --state-colour: #F04438; --state-bg: #FEF3F2; --state-text: #B42318; }
.state-Running { --state-colour: #2E90FA; --state-bg: #EFF8FF; --state-text: #175CD3; }
.state-NoInspection { --state-colour: #98A2B3; --state-bg: #F2F4F7; --state-text: #344054; }
.state-Done { --state-colour: #12B76A; --state-bg: #ECFDF3; --state-text: #027A48; }

.company-map-swatch { background: var(--state-colour); }

.company-dot-icon,
.company-cluster-icon {
    background: transparent;
    border: 0;
}

.company-dot {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.35);
}

.company-cluster {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(16, 24, 40, 0.35);
}

    /* White centre, so the number stays readable on every mix of colours. */
    .company-cluster span {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 62%;
        height: 62%;
        border-radius: 50%;
        background: #fff;
        color: #101828;
        font-size: 12px;
        font-weight: 600;
    }

.company-popup {
    display: grid;
    gap: 2px;
    font-size: 13px;
    line-height: 1.45;
    color: #101828;
}

    .company-popup strong {
        font-size: 14px;
    }

.company-popup-muted {
    color: #667085;
}

.company-popup-badge {
    justify-self: start;
    margin-top: 4px;
    padding: 1px 8px;
    border-radius: 10px;
    background: var(--state-bg);
    color: var(--state-text);
    font-size: 12px;
    font-weight: 600;
}

.company-popup-links {
    display: flex;
    gap: 12px;
    margin-top: 6px;
    font-weight: 600;
}

    .company-map .company-popup-links a {
        color: #12307A;
    }

.app-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--malfi-accent);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

    .app-link:hover,
    .app-link:focus-visible {
        text-decoration: underline;
    }

/* ---------- Wijkkaart (wwwroot/js/district-map.js, RI2627G04-705) ---------- */

/* OpenStreetMap has no dark tiles: in the dark theme the light ones are turned dark, the wijken on top keep their colours. */
[data-theme="dark"] .district-map .leaflet-tile-pane,
[data-theme="dark"] .company-map .leaflet-tile-pane {
    filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9);
}

.district-label span {
    display: inline-block;
    transform: translate(-50%, -50%);
    padding: 1px 6px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--malfi-surface) 85%, transparent);
    color: var(--malfi-text);
    font: 600 11px/1.4 Roboto, Helvetica, Arial, sans-serif;
    white-space: nowrap;
    pointer-events: none;
}

.district-tooltip {
    font-size: 12px;
    line-height: 1.5;
}

.district-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--malfi-surface);
    color: var(--malfi-text-secondary);
    box-shadow: var(--malfi-shadow-sm);
    font: 12px Roboto, Helvetica, Arial, sans-serif;
}

.district-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.district-legend i {
    display: inline-block;
    width: 18px;
    height: 10px;
    border-radius: 2px;
}

.district-legend .legend-wijk {
    background: linear-gradient(90deg, #2E90FA 0 33%, #12B76A 33% 66%, #F79009 66%);
    opacity: 0.6;
}

.district-legend .legend-inactive {
    border: 1.5px dashed var(--malfi-text-faint);
}

.district-legend .legend-zone {
    height: 0;
    border-top: 3px solid var(--malfi-text);
}

/* ---------- Tables on the phone (US 657): MobileList / MobileListItem ---------- */

/* Same breakpoint as Breakpoint.Md of the MudTables: below it the list, above it the table. */
@media (max-width: 959.98px) {
    .desktop-only { display: none !important; }
}

@media (min-width: 960px) {
    .phone-only { display: none !important; }
}

.mobile-list ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mobile-item {
    display: flex;
    gap: 12px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--malfi-border);
    color: inherit;
    text-decoration: none;
}

    .mobile-item:hover,
    .mobile-item:focus-visible {
        background: var(--malfi-surface-subtle);
        outline: none;
    }

    .mobile-item:focus-visible {
        box-shadow: var(--malfi-ring);
    }

    .mobile-item.is-loading {
        flex-direction: column;
        gap: 6px;
    }

.mobile-item-bar {
    flex: none;
    width: 4px;
    border-radius: 2px;
}

.mobile-item-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr); /* lets a long name end in "…" instead of widening the page */
    flex: 1;
    gap: 2px;
    min-width: 0;
}

.mobile-item-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.mobile-item-title {
    overflow: hidden;
    color: var(--malfi-text);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-item-aside {
    flex: none;
    font-size: 0.8125rem;
}

    .mobile-item-aside .mud-typography {
        font-size: inherit;
    }

.mobile-item-meta {
    overflow: hidden;
    color: var(--malfi-text-muted);
    font-size: 0.8125rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-list-more {
    width: 100%;
    min-height: 44px;
    margin-top: 12px;
    border: 1px solid var(--malfi-border-strong);
    border-radius: 10px;
    background: var(--malfi-surface);
    color: var(--malfi-text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

    .mobile-list-more:focus-visible {
        outline: none;
        box-shadow: var(--malfi-ring);
    }

.mobile-list-empty {
    padding: 32px 8px;
    color: var(--malfi-text-muted);
    text-align: center;
}

/* ---------- MobileSection: a section that opens on the phone (US 657) ---------- */

.mobile-section {
    border: 1px solid var(--malfi-border);
    border-radius: 14px;
    background: var(--malfi-surface);
    scroll-margin-top: 72px; /* below the app bar when the page scrolls to it */
}

.mobile-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 52px;
    padding: 12px 14px 12px 16px;
    border: 0;
    border-radius: 14px;
    background: none;
    color: var(--malfi-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

    .mobile-section-head:focus-visible {
        outline: none;
        box-shadow: var(--malfi-ring);
    }

.mobile-section-title {
    flex: 1;
    font-weight: 600;
}

.mobile-section-summary {
    color: var(--malfi-text-muted);
    font-size: 0.875rem;
}

.mobile-section-chevron {
    color: var(--malfi-text-muted);
    transition: transform 0.2s ease;
}

.mobile-section.is-open .mobile-section-chevron {
    transform: rotate(180deg);
}

.mobile-section-body {
    padding: 0 16px 16px;
    overflow-x: auto; /* a wide table (questionnaire) scrolls by itself instead of widening the page */
}

@media (prefers-reduced-motion: reduce) {
    .mobile-section-chevron { transition: none; }
}

/* A MobileListItem with actions: the link takes the room, the actions (⋮) sit on the right. */
.mobile-item-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--malfi-border);
}

    .mobile-item-row .mobile-item {
        flex: 1;
        min-width: 0;
        border-bottom: 0;
    }

.mobile-item-actions {
    flex: none;
}
