/* ===== AltaFit Global Styles ===== */

html, body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
}


/* ================================================================
   THEME CSS VARIABLES
   Navigation / content / scrollbar colours now derive from
   MudBlazor's palette CSS variables (--mud-palette-*) so they
   automatically follow whichever theme preset is active.
   Only the loading-screen variables stay hardcoded because they
   are rendered before Blazor / MudBlazor boots.
   ================================================================ */

:root {
    /* ── Navigation (icon-rail & sub-nav) ────────────────────────── */
    --rail-bg: var(--mud-palette-drawer-background);
    --rail-border: var(--mud-palette-lines-default);
    --rail-hover: color-mix(in srgb, var(--mud-palette-primary) 8%, transparent);
    --rail-active: color-mix(in srgb, var(--mud-palette-primary) 14%, transparent);
    --rail-indicator: var(--mud-palette-primary);

    --subnav-bg: var(--mud-palette-drawer-background);
    --subnav-border: var(--mud-palette-lines-default);
    --subnav-header-text: var(--mud-palette-text-primary);
    --subnav-group-text: var(--mud-palette-primary);
    --subnav-link-text: var(--mud-palette-text-secondary);
    --subnav-link-active-text: var(--mud-palette-primary);
    --subnav-link-hover-bg: color-mix(in srgb, var(--mud-palette-primary) 6%, transparent);
    --subnav-link-active-bg: color-mix(in srgb, var(--mud-palette-primary) 10%, transparent);

    /* ── Main content area ───────────────────────────────────────── */
    --content-bg: var(--mud-palette-background);
    --overlay-bg: rgba(0, 0, 0, 0.25);

    /* ── Scrollbars ──────────────────────────────────────────────── */
    --scrollbar-track: var(--mud-palette-background);
    --scrollbar-thumb: var(--mud-palette-action-disabled);
    --scrollbar-thumb-hover: var(--mud-palette-action-default);

    /* ── Auth pages ──────────────────────────────────────────────── */
    --auth-card-bg: var(--mud-palette-surface);
     
    /* ── Loading screen (pre-Blazor — must be hardcoded) ─────────── */
    --loading-bg: #f4f5f7;
    --loading-text: #2d2d3a;
    --loading-text-secondary: #5a5a6e;
    --loading-text-muted: #8a8a9e;
    --loading-spinner-track: #dcdce8;
    --loading-spinner-active: #6c3fc5;
}

[data-theme="dark"] {
    /* Only loading-screen vars need dark overrides (shown before Blazor boots).
       All other colours are handled by MudBlazor's palette variables. */
    --overlay-bg: rgba(0, 0, 0, 0.4);

    --loading-bg: #1a1a2e;
    --loading-text: #e0e0e0;
    --loading-text-secondary: #b0b0c8;
    --loading-text-muted: #6a6a8a;
    --loading-spinner-track: #2e2e4a;
    --loading-spinner-active: #7c4dff;
}


/* ===== Loading screen — shown while WASM boots ===== */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--loading-bg, #1a1a2e);
    gap: 8px;
}

.loading-logo {
    opacity: 0.9;
    animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.05); }
}

.loading-brand {
    font-family: 'Inter', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--loading-text, #e0e0e0);
    margin-bottom: 16px;
}

.loading-spinner-wrap {
    position: relative;
    width: 6rem;
    height: 6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-progress {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.loading-progress circle {
    fill: none;
    stroke: var(--loading-spinner-track, #2e2e4a);
    stroke-width: 0.4rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--loading-spinner-active, #7c4dff);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: relative;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--loading-text-secondary, #b0b0c8);
    z-index: 1;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "0%");
}

.loading-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: var(--loading-text-muted, #6a6a8a);
    margin-top: 12px;
    letter-spacing: 0.3px;
}

/* ===== Blazor error overlay ===== */
#blazor-error-ui {
    background: #900;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: white;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}


/* ================================================================
   APP SHELL — Icon Rail + Sub-Nav Panel + Main Content
   ================================================================ */

/* Container that sits below the fixed 64px top bar */
.app-shell {
    display: flex;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
}


/* ---- Icon Rail (far-left, always visible) ---- */
.icon-rail {
    width: 60px;
    min-width: 60px;
    background: var(--rail-bg);
    border-right: 1px solid var(--rail-border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    z-index: 1200;
    overflow-y: auto;
    transition: background 0.25s;
}

.icon-rail-top,
.icon-rail-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.icon-rail-brand {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-bottom: 4px;
    border-radius: 12px;
    transition: background 0.15s;
}

.icon-rail-brand:hover {
    background: var(--rail-hover);
}

.icon-rail-item {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 12px;
    margin: 2px 0;
    transition: background 0.15s;
    position: relative;
}

.icon-rail-item:hover {
    background: var(--rail-hover);
}

.icon-rail-item.active {
    background: var(--rail-active);
}

/* Active indicator bar on the left edge */
.icon-rail-item.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--rail-indicator);
    border-radius: 0 3px 3px 0;
}


/* ---- Sub-Navigation Panel (slides in from icon rail) ---- */
.sub-nav-panel {
    width: 220px;
    min-width: 220px;
    background: var(--subnav-bg);
    border-right: 1px solid var(--subnav-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    animation: slideIn 0.2s ease-out;
    z-index: 1150;
    transition: background 0.25s;
}

@keyframes slideIn {
    from { width: 0; min-width: 0; opacity: 0; }
    to   { width: 220px; min-width: 220px; opacity: 1; }
}

.sub-nav-header {
    padding: 20px 20px 12px 20px;
    border-bottom: 1px solid var(--subnav-border);
}

.sub-nav-header .mud-typography {
    color: var(--subnav-header-text) !important;
}

.sub-nav-links {
    padding: 8px 0;
    flex: 1;
}

.sub-nav-link {
    padding: 8px 20px;
    cursor: pointer;
    transition: background 0.12s, padding-left 0.12s;
}

.sub-nav-link:hover {
    background: var(--subnav-link-hover-bg);
    padding-left: 24px;
}

.sub-nav-link.active {
    background: var(--subnav-link-active-bg);
    border-left: 3px solid var(--rail-indicator);
    padding-left: 17px;
}


/* ---- Sub-nav pin button ---- */
.sub-nav-pin {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    opacity: 0.3;
    color: var(--subnav-group-text);
    transform: rotate(45deg);
    transition: opacity 0.2s, transform 0.2s, color 0.2s;
}

.sub-nav-pin:hover {
    opacity: 0.7;
    background: var(--subnav-link-hover-bg);
}

.sub-nav-pin.pinned {
    opacity: 0.6;
    color: var(--mud-palette-primary);
    transform: rotate(0deg);
}

.sub-nav-pin.pinned:hover {
    opacity: 0.85;
}

/* ---- Overlay (closes sub-nav on mobile) ---- */
.sub-nav-overlay {
    display: none;
}


/* ---- Main Content Area ---- */
.app-main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    background: var(--content-bg);
    transition: background 0.25s;
}


/* ---- Auth pages (Login / Signup) background ---- */
.auth-page-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mud-palette-background);
    background-image: linear-gradient(
        135deg,
        transparent 0%,
        color-mix(in srgb, var(--mud-palette-primary) 5%, transparent) 50%,
        color-mix(in srgb, var(--mud-palette-secondary) 8%, transparent) 100%
    );
    transition: background 0.25s;
}

.auth-card {
    background: var(--auth-card-bg) !important;
    transition: background 0.25s;
}

/* Auth pages on the phone (below 600px): Login, Signup, FinishSignup, ForgotPassword,
   ResetPassword, Verification, PaymentResult. The card goes and the page is the screen: the
   logo, a large title (.auth-brand / .auth-title), labels above 48px fields (the .sheet-form
   field rules), app-style buttons (sentence case, 52px, the main one with the sheen), and on
   Signup / FinishSignup the bordered boxes become grouped sections with a small caps label
   (.auth-section / .auth-section-title) and the plan cards flat rounded tiles
   (.signup-plan-card). Above 600px the centred card stays as it is. */
@media (max-width: 599.98px) {
    .auth-page-bg {
        align-items: flex-start !important;
        min-height: 100dvh;
        padding: max(12px, env(safe-area-inset-top)) 0 max(24px, env(safe-area-inset-bottom)) !important;
        background-image: none;
    }

    /* A status screen with nothing above it (PaymentResult) sits in the middle */
    .auth-page-bg.auth-centred {
        align-items: center !important;
    }

    .auth-page-bg > .mud-container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .auth-page-bg .mud-paper.auth-card {
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
    }

    .auth-brand {
        margin-bottom: 28px !important;
        gap: 14px;
    }

    .auth-brand img {
        height: 64px !important;
        max-width: 70%;
        object-fit: contain;
    }

    .auth-page-bg .auth-title {
        font-size: 1.75rem !important;
        font-weight: 800 !important;
        letter-spacing: -0.02em;
        line-height: 1.15;
        color: var(--mud-palette-text-primary) !important;
        margin-top: 0 !important;
        text-align: center;
    }

    /* Buttons as everywhere else on the phone */
    .auth-page-bg .mud-button-root {
        text-transform: none;
        letter-spacing: 0;
    }

    .auth-page-bg .mud-button-root.mud-button-filled,
    .auth-page-bg .mud-button-root.mud-button-outlined {
        min-height: 52px;
        border-radius: 15px;
        font-size: 1rem;
        font-weight: 600;
    }

    .auth-page-bg .mud-button-root.mud-button-filled-primary:not(:disabled) {
        background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 60%);
        box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--mud-palette-primary) 85%, transparent);
        transition: transform 0.12s, box-shadow 0.2s, background-color 0.2s;
    }

    .auth-page-bg .mud-button-root.mud-button-filled-primary:not(:disabled):active {
        transform: scale(0.97);
    }

    .auth-page-bg .mud-divider {
        margin-top: 24px !important;
        margin-bottom: 20px !important;
    }

    .auth-page-bg .mud-alert {
        border-radius: 14px;
    }

    /* Signup / FinishSignup: the bordered boxes become sections with a small caps label */
    .auth-page-bg .mud-paper.auth-section {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin-bottom: 28px !important;
    }

    .auth-page-bg .auth-section-title {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 12px !important;
        font-size: 0.8125rem !important;
        font-weight: 700 !important;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--mud-palette-text-secondary);
    }

    .auth-page-bg .auth-section-title > .mud-icon-root {
        display: none;
    }

    .auth-page-bg .auth-section-title .mud-chip {
        margin: 0;
        text-transform: none;
        letter-spacing: 0;
    }

    /* Plan cards: flat rounded tiles; the chosen one keeps its 2px theme-colour edge */
    .auth-page-bg .mud-card.signup-plan-card {
        box-shadow: none !important;
        border-radius: 16px !important;
        padding: 12px 14px 12px 6px !important;
        background: var(--mud-palette-surface);
    }

    /* Contract box and signature pad (FinishSignup's contract step) */
    .auth-page-bg .contract-content,
    .auth-page-bg .signature-pad-box {
        border-radius: 14px !important;
    }
}


/* ================================================================
   TOP BAR BRAND TEXT — fluid sizing
   ================================================================ */
.brand-text {
    font-size: clamp(0.75rem, 2vw, 1.25rem) !important;
}


/* ================================================================
   PHONE CHROME — below 960px
   PhoneAppBar on top, PhoneTabBar at the bottom (Layout/). TopBar, the
   icon rail and the sub-nav are desktop only; menu pages that aren't a
   tab are on the Mere page (/more, .more-* below).
   ================================================================ */
.phone-app-bar,
.phone-tab-bar {
    display: none;
}

@media (max-width: 959.98px) {
    .desktop-topbar,
    .icon-rail,
    .sub-nav-panel,
    .sub-nav-overlay {
        display: none !important;
    }

    /* Page between the app bar and the tab bar */
    .app-shell {
        top: calc(56px + env(safe-area-inset-top, 0px));
        flex-direction: column;
    }

    /* On an iPhone in the app the web view reaches the screen's bottom edge, but WebKit still
       ends the page above the home-indicator strip, so the tab bar stops there and the page's
       background shows below it. Giving the page the bar's colour makes the bar look like it
       runs to the edge, with its tabs above the home indicator (like a native tab bar). */
    html:has(.app-shell) {
        background-color: var(--mud-palette-surface);
    }

    .app-main-content {
        padding: 16px;
    }

    /* ── App bar ─────────────────────────────────────────────────── */
    .phone-app-bar {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1300;
        height: calc(56px + env(safe-area-inset-top, 0px));
        padding: env(safe-area-inset-top, 0px) max(4px, env(safe-area-inset-right, 0px)) 0 max(4px, env(safe-area-inset-left, 0px));
        background: var(--mud-palette-background);
        color: var(--mud-palette-text-primary);
        border-bottom: 1px solid transparent;
        transition: border-color 0.2s, background-color 0.2s;
    }

    body.main-scrolled .phone-app-bar {
        border-bottom-color: var(--mud-palette-lines-default);
    }

    .phone-app-bar-start {
        justify-self: start;
        display: flex;
        align-items: center;
        min-width: 0;
    }

    .phone-app-bar-logo {
        height: 30px;
        width: auto;
        max-width: 140px;
        margin-left: 12px;
        object-fit: contain;
    }

    .phone-app-bar-back {
        width: 44px;
        height: 44px;
        border: 0;
        border-radius: 50%;
        background: transparent;
        color: var(--mud-palette-primary);
        display: grid;
        place-items: center;
        cursor: pointer;
    }

    .phone-app-bar-back:active {
        background: var(--mud-palette-action-default-hover);
    }

    .phone-app-bar-title {
        font-weight: 600;
        font-size: 1.0625rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 56vw;
        transition: opacity 0.2s;
    }

    /* The page's own heading is the large title; the bar's title fades in once it has
       scrolled under the bar (altafitPhoneChrome in altafit.js). */
    .phone-app-bar-title {
        opacity: 0;
    }

    body.main-scrolled .phone-app-bar-title {
        opacity: 1;
    }

    .phone-app-bar-end {
        justify-self: end;
        display: flex;
        align-items: center;
    }

    /* ── Tab bar ─────────────────────────────────────────────────── */
    .phone-tab-bar {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        flex: none;
        background: var(--mud-palette-surface);
        border-top: 1px solid var(--mud-palette-lines-default);
        padding: 6px max(4px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px));
        z-index: 1200;
    }

    .phone-tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-width: 0;
        min-height: 52px;
        text-decoration: none;
        color: var(--mud-palette-text-secondary);
        font-size: 0.6875rem;
        font-weight: 500;
        -webkit-tap-highlight-color: transparent;
    }

    .phone-tab-indicator {
        display: grid;
        place-items: center;
        width: 56px;
        height: 30px;
        border-radius: 15px;
        transition: background-color 0.2s, transform 0.1s;
    }

    .phone-tab:active .phone-tab-indicator {
        transform: scale(0.92);
    }

    .phone-tab.active {
        color: var(--mud-palette-primary);
        font-weight: 700;
    }

    .phone-tab.active .phone-tab-indicator {
        background: color-mix(in srgb, var(--mud-palette-primary) 16%, transparent);
    }

    .phone-tab-label {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ================================================================
   PHONE LOOK — below 960px, every page
   Large page titles, flat rounded cards, sentence-case buttons, page
   transitions, and dialogs as bottom sheets (below 600px). Matches the
   "AltaFit App Concept" prototype. Desktop is untouched.
   ================================================================ */
@media (max-width: 959.98px) {
    /* The page scrolls inside .app-main-content; a page sliding in mustn't make it scroll sideways */
    .app-main-content {
        overflow-x: hidden;
    }

    /* Large title: the page's own h4 heading (not numbers or headings inside cards and dialogs) */
    .page-content .mud-typography-h4:not(.mud-paper .mud-typography-h4) {
        font-size: 2rem !important;
        font-weight: 800 !important;
        letter-spacing: -0.025em;
        line-height: 1.12;
    }

    /* Titles are text only on the phone (e.g. the people icon before "Medlemsliste") */
    .page-content .mud-typography-h4:not(.mud-paper .mud-typography-h4) > .mud-icon-root {
        display: none;
    }

    /* The line under a title */
    .page-content .mud-typography-h4 + .mud-typography-body1.mud-text-secondary {
        font-size: 0.9375rem;
        margin-bottom: 16px !important;
    }

    /* Cards and panels: flat with rounder corners; set apart by the surface colour, not shadow */
    .page-content .mud-paper:not(.mud-popover) {
        box-shadow: none !important;
        border-radius: 18px !important;
    }

    /* Buttons: sentence case, rounder, tall enough for a thumb */
    .page-content .mud-button-root,
    .mud-dialog .mud-button-root {
        text-transform: none;
        letter-spacing: 0;
    }

    .page-content .mud-button-root.mud-button-filled,
    .page-content .mud-button-root.mud-button-outlined {
        border-radius: 14px;
        min-height: 44px;
    }

    /* Main buttons: a soft sheen, a shadow in the theme colour and a press */
    .page-content .mud-button-root.mud-button-filled-primary:not(:disabled),
    .mud-dialog .mud-button-root.mud-button-filled-primary:not(:disabled) {
        background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 60%);
        box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--mud-palette-primary) 85%, transparent);
        transition: transform 0.12s, box-shadow 0.2s, background-color 0.2s;
    }

    .page-content .mud-button-root.mud-button-filled-primary:not(:disabled):active,
    .mud-dialog .mud-button-root.mud-button-filled-primary:not(:disabled):active {
        transform: scale(0.97);
    }
}

/* Page transitions (MainLayout keys .page-content by path, so a new page is a new element) */
@media (max-width: 959.98px) and (prefers-reduced-motion: no-preference) {
    .page-content.page-enter-forward {
        animation: page-in-right 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    }

    .page-content.page-enter-back {
        animation: page-in-left 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    }

    .page-content.page-enter-tab {
        animation: page-fade-in 0.2s ease-out both;
    }

    @keyframes page-in-right {
        from { transform: translateX(30%); opacity: 0; }
        to   { transform: none; opacity: 1; }
    }

    @keyframes page-in-left {
        from { transform: translateX(-20%); opacity: 0; }
        to   { transform: none; opacity: 1; }
    }

    @keyframes page-fade-in {
        from { opacity: 0.2; }
        to   { opacity: 1; }
    }
}

/* Dialogs as bottom sheets on phones: docked to the bottom edge, rounded top with a grab
   handle, full-width stacked buttons with the main action (last in the markup) on top.
   Full-screen dialogs keep their own layout. The selectors carry .mud-dialog-container so
   they win over the older .phone-dialog / .campaign-dialog margin rules. */
@media (max-width: 599.98px) {
    .mud-dialog-container {
        align-items: flex-end !important;
        justify-content: center !important;
    }

    .mud-dialog-container .mud-dialog:not(.mud-dialog-fullscreen) {
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: calc(100dvh - 32px) !important;
        border-radius: 24px 24px 0 0 !important;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3) !important;
    }

    .mud-dialog-container .mud-dialog:not(.mud-dialog-fullscreen)::before {
        content: "";
        flex: none;
        align-self: center;
        width: 38px;
        height: 5px;
        margin-top: 8px;
        border-radius: 3px;
        background: var(--mud-palette-text-secondary);
        opacity: 0.45;
    }

    .mud-dialog-container .mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-title {
        padding: 10px 20px 4px;
    }

    /* The padding above wins over MudBlazor's room for the close X (padding-inline-end: 64px),
       so give it back, or a title's own buttons (the member dialog's Vis/Rediger switch) slide
       under the X. The X moves down past the grab handle to sit on the title's line. */
    .mud-dialog-container .mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-title:has(.mud-button-close) {
        padding-inline-end: 60px;
    }

    .mud-dialog-container .mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-title .mud-button-close {
        top: 22px;
    }

    .mud-dialog-container .mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-title .mud-typography-h6 {
        font-size: 1.375rem;
        font-weight: 700;
        letter-spacing: -0.01em;
    }

    .mud-dialog-container .mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-content {
        padding-left: 20px;
        padding-right: 20px;
    }

    .mud-dialog-container .mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 8px;
        padding: 8px 16px 16px;
    }

    .mud-dialog-container .mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-actions > * {
        margin: 0 !important;
        width: 100%;
    }

    .mud-dialog-container .mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-actions > .mud-button-root {
        min-height: 48px;
        border-radius: 14px;
    }

    /* A spacer between buttons means nothing in a stacked column */
    .mud-dialog-container .mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-actions > .flex-grow-1:empty,
    .mud-dialog-container .mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-actions > .mud-spacer {
        display: none;
    }
}

@media (max-width: 599.98px) and (prefers-reduced-motion: no-preference) {
    .mud-dialog-container .mud-dialog:not(.mud-dialog-fullscreen) {
        animation: sheet-up 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    }

    @keyframes sheet-up {
        from { transform: translateY(100%); }
        to   { transform: none; }
    }
}

/* ---- Sheet content pieces (prototype's sheets), reusable by any dialog ----
   .sheet-tag + .sheet-title: a coloured label above a large title. .sheet-info: lines with an
   icon. .sheet-cap + .sheet-bar: "x af y" over a thick bar. .sheet-note ok|warn|info: a tinted
   note with an icon. */
.sheet-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--mud-palette-primary);
}

.sheet-title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.sheet-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sheet-info > div {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.97rem;
}

.sheet-info .mud-icon-root {
    flex: none;
    color: var(--mud-palette-text-secondary);
}

.sheet-cap {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

.sheet-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--mud-palette-action-disabled-background);
    overflow: hidden;
}

.sheet-bar i {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: var(--mud-palette-primary);
}

.sheet-bar.full i {
    background: var(--mud-palette-warning);
}

.sheet-desc {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.45;
    color: var(--mud-palette-text-secondary);
    white-space: pre-line;
}

.sheet-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.sheet-note .mud-icon-root {
    flex: none;
    font-size: 1.375rem;
}

.sheet-note.ok   { background: color-mix(in srgb, var(--mud-palette-success) 13%, transparent); }
.sheet-note.warn { background: color-mix(in srgb, var(--mud-palette-warning) 14%, transparent); }
.sheet-note.info { background: color-mix(in srgb, var(--mud-palette-info) 13%, transparent); }
.sheet-note.ok .mud-icon-root   { color: var(--mud-palette-success); }
.sheet-note.warn .mud-icon-root { color: var(--mud-palette-warning); }
.sheet-note.info .mud-icon-root { color: var(--mud-palette-info); }

/* ---- Form sheets (.sheet-form on <MudDialog Class>), below 600px ----
   The Profil sheets (cancel membership, pause, change password, terms, biometric setup):
   the title without its icon, each field's label above a 48px outlined field with 14px
   corners (MudBlazor's floating label is moved out of the border), and radio choices
   (.sheet-choices) as tappable rows. The buttons already stack full width (bottom sheets,
   PHONE LOOK); an Annuller/Luk button marked .sheet-close goes. Desktop is untouched.
   The field rules also serve the login/signup pages (.auth-page-bg, see "Auth pages"). */
.sheet-hero {
    display: none;
}

@media (max-width: 599.98px) {
    .sheet-form .mud-dialog-title .mud-typography-h6 > .mud-icon-root {
        display: none;
    }

    :is(.sheet-form, .auth-page-bg) .mud-input-control > .mud-input-control-input-container > .mud-input-label-outlined.mud-input-label-inputcontrol {
        position: static;
        order: -1;
        transform: none !important;
        max-width: 100%;
        padding: 0 0 6px 2px !important;
        font-size: 0.875rem;
        font-weight: 600;
        line-height: 1.3;
        white-space: normal;
        color: var(--mud-palette-text-primary);
    }

    :is(.sheet-form, .auth-page-bg) .mud-input-control > .mud-input-control-input-container > .mud-input:focus-within ~ .mud-input-label-outlined.mud-input-label-inputcontrol {
        color: var(--mud-palette-primary);
    }

    :is(.sheet-form, .auth-page-bg) .mud-input.mud-input-outlined > .mud-input-outlined-border legend {
        display: none;
    }

    :is(.sheet-form, .auth-page-bg) .mud-input.mud-input-outlined {
        min-height: 48px;
    }

    :is(.sheet-form, .auth-page-bg) .mud-input.mud-input-outlined > .mud-input-outlined-border {
        border-radius: 14px;
    }

    :is(.sheet-form, .auth-page-bg) .mud-input.mud-input-outlined > input.mud-input-root {
        padding-top: 14px;
        padding-bottom: 14px;
    }

    :is(.sheet-form, .auth-page-bg) .mud-input-helper-text {
        padding-left: 2px;
    }

    /* Radio choices as rows in a rounded block, hairlines between them */
    .sheet-form .sheet-choices {
        border-radius: 14px;
        overflow: hidden;
        background: var(--mud-palette-background);
    }

    .sheet-form .sheet-choices .mud-radio {
        display: flex;
        width: 100%;
        min-height: 48px;
        margin: 0;
        padding: 0 6px;
    }

    .sheet-form .sheet-choices .mud-radio + .mud-radio {
        border-top: 1px solid var(--mud-palette-lines-default);
    }

    /* A centred icon tile above a sheet's text (biometric setup); its title icon goes */
    .sheet-form .sheet-hero {
        display: grid;
        place-items: center;
        width: 64px;
        height: 64px;
        margin: 4px auto 14px;
        border-radius: 20px;
        background: color-mix(in srgb, var(--mud-palette-primary) 15%, transparent);
        color: var(--mud-palette-primary);
    }

    .sheet-form .sheet-hero .mud-icon-root {
        font-size: 2rem;
    }

    .sheet-form.sheet-centred .mud-dialog-title .mud-stack .mud-icon-root {
        display: none;
    }

    .sheet-form.sheet-centred .mud-dialog-title,
    .sheet-form.sheet-centred .mud-dialog-content {
        text-align: center;
    }

    .sheet-form.sheet-centred .mud-dialog-title .mud-stack {
        justify-content: center;
    }

    /* No empty button bar when its only button is the hidden Luk */
    .sheet-form .mud-dialog-actions:not(:has(> :not(.sheet-close))) {
        display: none;
    }

    /* Terms: the sheet scrolls, not a box inside it */
    .sheet-form .terms-body {
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
    }
}

/* ---- Class sheet on the phone (TrainingClassDetailsDialog, below 960px) ----
   Type label + large name, when/where/trainer, the capacity bar, the description and one note
   for the member's situation; the desktop layout (.class-sheet-desktop) is hidden there. As a
   bottom sheet (below 600px) the Luk button goes: the sheet closes by tapping outside it. */
.class-sheet,
.class-sheet-head {
    display: none;
}

@media (max-width: 959.98px) {
    .class-sheet-desktop {
        display: none !important;
    }

    .class-sheet-head {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .class-sheet {
        display: flex;
        flex-direction: column;
        gap: 16px;
        padding-top: 4px;
    }
}

@media (max-width: 599.98px) {
    /* A Luk/Close button marked .sheet-close goes on a bottom sheet (any dialog): the sheet
       closes by tapping outside it, or its ✕ */
    .mud-dialog-actions > .sheet-close {
        display: none;
    }

    /* .sheet-tall (payment comments): rises to at least half the screen, even for one line */
    .mud-dialog-container .mud-dialog.sheet-tall:not(.mud-dialog-fullscreen) {
        min-height: 50dvh;
    }

    .mud-dialog-container .mud-dialog.sheet-tall .mud-dialog-content {
        flex: 1 1 auto;
    }

    /* The disabled "not open yet" button sits in a tooltip wrapper, so it misses the stacked width */
    .mud-dialog-actions .class-sheet-wide {
        width: 100%;
        min-height: 48px;
        border-radius: 14px;
    }
}

/* ---- Home on the phone (Pages/Home.razor, below 960px) ----
   Members: membership card, next class, quick buttons, numbers and a news carousel (.mhome-*).
   Staff ("Overblik"): centre picker, number tiles, the age warning, the rest of today's classes
   (.hold-* rows) and the newest members (.ohome-*). The desktop header with the widget
   settings is hidden there. */
@media (max-width: 959.98px) {
    .home-header-desktop {
        display: none !important;
    }
}

.ohome-centre-menu {
    align-self: flex-start;
}

.ohome-centre {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px 0 10px;
    border-radius: 18px;
    background: var(--mud-palette-surface);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.ohome-centre .mud-icon-root:first-child {
    color: var(--mud-palette-primary);
}

.ohome-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ohome-tile {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 116px;
    padding: 14px;
    border-radius: 18px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    text-decoration: none;
    transition: transform 0.15s;
}

.ohome-tile:active {
    transform: scale(0.97);
}

.ohome-tile-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-bottom: auto;
    border-radius: 10px;
    background: color-mix(in srgb, var(--tile) 16%, transparent);
    color: var(--tile);
}

.ohome-tile b {
    margin-top: 10px;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.ohome-tile > span:last-child {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--mud-palette-text-secondary);
}

.ohome-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--mud-palette-warning) 14%, var(--mud-palette-surface));
    color: var(--mud-palette-text-primary);
    font-size: 0.9rem;
    text-decoration: none;
}

.ohome-alert > .mud-icon-root:first-child {
    color: var(--mud-palette-warning);
}

.ohome-alert span {
    flex: 1;
}

.ohome-avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--av);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
}

.ohome-member-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ohome-member-sub {
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

.ohome-missing {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 0 8px;
    height: 24px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--mud-palette-warning) 16%, transparent);
    color: var(--mud-palette-warning);
    font-size: 0.8rem;
    font-weight: 700;
}

.mhome {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mhome-eyebrow {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.mhome-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    aspect-ratio: 1.68;
    max-height: 240px;
    padding: 18px 20px;
    border-radius: 22px;
    overflow: hidden;
    color: #fff;
    text-decoration: none;
    background:
        radial-gradient(circle at 92% 8%, rgba(255, 255, 255, 0.28), transparent 42%),
        radial-gradient(circle at 10% 120%, rgba(0, 0, 0, 0.35), transparent 55%),
        linear-gradient(135deg, var(--mud-palette-primary), color-mix(in srgb, var(--mud-palette-primary) 45%, #000));
    box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--mud-palette-primary) 70%, transparent);
    isolation: isolate;
}

/* Card pattern: three wide rings in the top-right corner and fine diagonal lines that fade out */
.mhome-card::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: -48%;
    right: -26%;
    width: 96%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle,
        transparent 0 22%, rgba(255, 255, 255, 0.16) 22% calc(22% + 1px),
        transparent calc(22% + 1px) 42%, rgba(255, 255, 255, 0.12) 42% calc(42% + 1px),
        transparent calc(42% + 1px) 62%, rgba(255, 255, 255, 0.08) 62% calc(62% + 1px),
        transparent calc(62% + 1px));
    pointer-events: none;
}

.mhome-card::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 9px);
    -webkit-mask-image: linear-gradient(200deg, transparent 25%, #000 100%);
    mask-image: linear-gradient(200deg, transparent 25%, #000 100%);
    pointer-events: none;
}

/* A subtle edge on the flat (no gradient) tappable parts of the phone home screens.
   An inset outline, so nothing changes size and it also shows over a news cover image. */
.mhome-next,
.mhome-stat,
.mhome-news-card,
.ohome-tile,
.ohome-centre {
    outline: 1px solid color-mix(in srgb, var(--mud-palette-text-primary) 10%, transparent);
    outline-offset: -1px;
}

.mhome-card-top,
.mhome-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.mhome-card-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.0625rem;
    font-weight: 800;
}

.mhome-card-centre {
    font-size: 0.8125rem;
    opacity: 0.85;
    text-align: right;
}

.mhome-card-label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.8;
}

.mhome-card-name {
    display: block;
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.mhome-card-bottom {
    font-size: 0.875rem;
    opacity: 0.95;
}

.mhome-sec {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 4px 0;
}

.mhome-sec h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.mhome-sec a {
    color: var(--mud-palette-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
}

.mhome-next {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px;
    border: 0;
    border-radius: 18px;
    background: var(--mud-palette-surface);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.15s;
}

button.mhome-next:active {
    transform: scale(0.985);
}

.mhome-next-empty {
    justify-content: space-between;
    cursor: default;
}

.mhome-next-empty .mud-button-root {
    flex: none;
    white-space: nowrap;
}

.mhome-next-time {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--mud-palette-primary), color-mix(in srgb, var(--mud-palette-primary) 60%, #000));
    color: var(--mud-palette-primary-text);
    box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--mud-palette-primary) 75%, transparent);
}

.mhome-next-time b {
    font-size: 1.125rem;
    font-variant-numeric: tabular-nums;
}

.mhome-next-time span {
    font-size: 0.72rem;
    font-weight: 600;
}

.mhome-next-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.mhome-next-name {
    font-size: 1.0625rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mhome-next-sub {
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
}

.mhome-chevron {
    color: var(--mud-palette-text-secondary);
    opacity: 0.6;
}

.mhome-quick {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.mhome-quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--mud-palette-text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
}

.mhome-quick-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 20px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--mud-palette-primary) 16%, var(--mud-palette-surface)), var(--mud-palette-surface) 70%);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mud-palette-primary) 20%, transparent);
    color: var(--mud-palette-primary);
    transition: transform 0.15s;
}

.mhome-quick-item:active .mhome-quick-icon {
    transform: scale(0.93);
}

.mhome-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.mhome-stat {
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--mud-palette-surface);
    color: inherit;
    text-decoration: none;
}

.mhome-stat b {
    font-size: 1.625rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.mhome-stat span {
    font-size: 0.8125rem;
    line-height: 1.25;
    color: var(--mud-palette-text-secondary);
}

.mhome-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin: 0 -16px;
    padding: 0 16px 4px;
    /* Snap the cards 16px in, in line with the page, not flush with the screen edge */
    scroll-padding-inline: 16px;
}

.mhome-carousel::-webkit-scrollbar {
    display: none;
}

.mhome-news-card {
    flex: 0 0 76%;
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    background: var(--mud-palette-surface);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    scroll-snap-align: start;
}

.mhome-news-cover {
    display: grid;
    place-items: center;
    height: 110px;
    background-size: cover;
    background-position: center;
    color: rgba(255, 255, 255, 0.9);
}

.mhome-news-cover .mud-icon-root {
    font-size: 2.75rem;
}

.mhome-cover-0 { background-image: linear-gradient(135deg, #ff9a62, #e0475f); }
.mhome-cover-1 { background-image: linear-gradient(135deg, #4f8cff, #4b3fd0); }
.mhome-cover-2 { background-image: linear-gradient(135deg, #2fd1a8, #138a6e); }
.mhome-cover-3 { background-image: linear-gradient(135deg, #c06bff, #e04f9c); }

.mhome-news-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px 14px;
}

.mhome-news-date {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--mud-palette-primary);
}

.mhome-news-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mhome-skeleton {
    border-radius: 18px;
}

/* ---- Medlemmer on the phone (Pages/Members/Members.razor, below 960px) ----
   Search + status chips at the top (.hold-tools / .hold-chips), then one row per member and an
   "Opret" button floating above the tab bar. */
.mlist-phone {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 72px; /* room for the floating button */
}

.mlist-search {
    margin: 0 !important;
}

.mlist-search .mud-input-outlined-border {
    border-radius: 12px;
}

.mlist-count {
    padding: 2px 4px 0;
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

.mlist-row {
    min-height: 60px;
}

.mlist-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.mlist-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

.mlist-status {
    flex: none;
    margin: 0 !important;
}

.mlist-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.875rem;
}

.mlist-fab-menu {
    position: fixed !important;
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    z-index: 1250;
}

.mlist-fab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 54px;
    padding: 0 20px 0 16px;
    border-radius: 18px;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 24px -6px color-mix(in srgb, var(--mud-palette-primary) 60%, transparent);
}

.mlist-fab:active {
    transform: scale(0.96);
}

/* ---- Nyheder | Medier tabs (Components/Shared/NewsMediaTabs.razor, phone only) ---- */
.seg-tabs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    margin-bottom: 14px;
    padding: 2px;
    border-radius: 11px;
    background: var(--mud-palette-action-disabled-background);
}

.seg-tabs a {
    display: grid;
    place-items: center;
    height: 34px;
    border-radius: 9px;
    color: var(--mud-palette-text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
}

.seg-tabs a.on {
    background: var(--mud-palette-surface);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    font-weight: 600;
}

/* ---- Nyheder on the phone (Pages/Content/MemberNews.razor): full-width story cards, same
   parts as the member home carousel (.mhome-news-*) ---- */
.news-phone {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-phone-card {
    flex: none;
    width: 100%;
}

.news-phone-card .mhome-news-cover {
    height: 150px;
}

/* ---- One news story (Pages/Content/MemberNewsArticle.razor, /nyheder/{guid}) ----
   The prototype's article screen: a large cover (the news image, or the tapped card's
   placeholder colour), the date, a large title and the text. On the phone the cover runs to
   the screen edges under the app bar; wider screens get a centred column with a rounded cover. */
.news-article {
    max-width: 760px;
    margin: 0 auto;
}

.news-article-cover {
    display: grid;
    place-items: center;
    height: 320px;
    border-radius: 18px;
    background-size: cover;
    background-position: center;
    color: rgba(255, 255, 255, 0.92);
}

.news-article-cover .mud-icon-root {
    font-size: 4.5rem;
}

.news-article-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 4px 8px;
}

.news-article-date {
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
}

.news-article-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.news-article-text {
    font-size: 1rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.news-article-text img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.news-article-missing {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 48px 16px;
    text-align: center;
    color: var(--mud-palette-text-secondary);
}

.news-article-missing .mud-icon-root {
    font-size: 2.75rem;
    opacity: 0.6;
}

@media (max-width: 959.98px) {
    .news-article-cover {
        height: 210px;
        margin: -16px -16px 0;
        border-radius: 0;
    }

    .news-article-title {
        font-size: 1.625rem;
    }
}

/* ---- Medier on the phone (Pages/Content/MemberMedia.razor): category tiles ---- */
.media-phone-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.media-phone-tile {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 120px;
    padding: 14px;
    border: 0;
    border-radius: 18px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.media-phone-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: #fff;
}

.media-phone-name {
    margin-top: auto;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

/* MediaViewDialog: a video file is 16:9 on the phone, not 70% of the screen tall */
@media (max-width: 959.98px) {
    .media-view-video {
        height: auto !important;
        aspect-ratio: 16 / 9;
    }
}

/* ---- Profil sub-pages on the phone: Mine kontrakter, Mine noter, Pause ----
   .profile-phone-list stacks the page's parts. .doc-row: a .more-row whose main part is its
   own button (open / edit) so a second control (download, status pill, ⋮) can sit beside it.
   .note-row: a note's whole text, wrapping. */
.profile-phone-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.doc-row {
    cursor: default;
    padding-right: 8px;
}

.doc-row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.doc-row-main:disabled {
    cursor: default;
}

.note-row {
    align-items: flex-start;
    padding-top: 12px;
    padding-bottom: 12px;
}

.note-row-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

/* ---- Om on the phone (Pages/About.razor) ----
   The prototype's header (the centre's logo, its name, the app version), then label | value rows
   (.settings-static-row / .settings-row-value). Tappable values (phone, e-mail) and the action
   rows are in the theme colour; the forced update in the warning colour. */
.about-phone-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 8px 12px;
    text-align: center;
}

.about-phone-logo {
    max-width: 200px;
    max-height: 72px;
    object-fit: contain;
    margin-bottom: 6px;
}

.about-phone-name {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.about-phone-version {
    font-size: 0.9rem;
    color: var(--mud-palette-text-secondary);
}

.about-phone .more-row-label {
    flex: none;
}

.about-phone .settings-row-value {
    flex: 1;
    min-width: 0;
}

.about-phone button.more-row {
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
}

.about-phone button.more-row .more-row-chevron {
    margin-left: auto;
}

.about-phone-link {
    color: var(--mud-palette-primary) !important;
}

.about-phone-warn {
    color: var(--mud-palette-warning);
}

.about-phone-comment {
    flex: 1;
    min-width: 0;
    padding: 4px 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--mud-palette-text-secondary);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.about-phone-note {
    margin: 0;
    padding: 0 6px;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--mud-palette-text-secondary);
    white-space: pre-line;
}

/* ---- Besøg on the phone (Pages/Account/MyAccessLogs.razor) ---- */
.visits-phone {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.visits-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.visits-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--mud-palette-action-disabled-background);
    line-height: 1.05;
}

.visits-date b {
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
}

.visits-date span {
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.visits-denied {
    color: var(--mud-palette-error);
}

/* ---- Kasse on the phone (Pages/Shop/Products.razor, below 960px) ----
   Customer search + group chips at the top, product tiles (a tap adds one, with a quantity
   badge), a cart bar above the tab bar and the checkout as a bottom sheet. */
.pos-phone {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 84px; /* room for the cart bar */
}

.pos-customer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 8px 12px;
    border-radius: 14px;
    background: var(--mud-palette-surface);
}

.pos-customer-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.pos-customer-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-customer-sub {
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.pos-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 124px;
    padding: 14px;
    border: 0;
    border-radius: 18px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.pos-tile:active {
    transform: scale(0.97);
}

.pos-tile-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: auto;
    border-radius: 13px;
    background: color-mix(in srgb, var(--mud-palette-primary) 16%, transparent);
    color: var(--mud-palette-primary);
    font-size: 1.125rem;
    font-weight: 800;
}

.pos-tile-name {
    margin-top: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pos-tile-price {
    font-size: 0.85rem;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

.pos-qty {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    border-radius: 13px;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    font-size: 0.8rem;
    font-weight: 700;
}

.pos-cartbar {
    position: fixed;
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    z-index: 1250;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 10px 10px 18px;
    border-radius: 20px;
    background: var(--mud-palette-text-primary);
    color: var(--mud-palette-background);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.pos-cartbar-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.pos-cartbar-text span {
    font-size: 0.8125rem;
    opacity: 0.75;
}

.pos-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1260;
    background: rgba(0, 0, 0, 0.42);
}

.pos-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1270;
    max-height: calc(100dvh - 72px);
    overflow-y: auto;
    padding: 8px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    border-radius: 24px 24px 0 0;
    background: var(--mud-palette-surface);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
}

.pos-sheet::before {
    content: "";
    display: block;
    width: 38px;
    height: 5px;
    margin: 0 auto 8px;
    border-radius: 3px;
    background: var(--mud-palette-text-secondary);
    opacity: 0.45;
}

@media (prefers-reduced-motion: no-preference) {
    .pos-sheet {
        animation: pos-sheet-up 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    }
}

@keyframes pos-sheet-up {
    from { transform: translateY(100%); }
    to   { transform: none; }
}

.pos-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pos-sheet-head h2 {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 700;
}

.pos-sheet-customer {
    margin-bottom: 12px;
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
}

.pos-sheet .mud-button-filled {
    min-height: 48px;
    border-radius: 14px;
}

/* ---- Hold on the phone (Pages/Calendar/TrainingClasses.razor, below 960px) ----
   Day strip + type chips that stay at the top while the list scrolls, then the day's classes
   grouped into morning / afternoon / evening rows with a status pill. */
.hold-phone {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* -16px: .app-main-content has 16px padding, so the strip sticks to the very top */
.hold-tools {
    position: sticky;
    top: -16px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 -16px;
    padding: 8px 16px 10px;
    background: var(--mud-palette-background);
}

.hold-days,
.hold-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -16px;
    padding: 2px 16px;
}

.hold-chips {
    gap: 8px;
}

.hold-days::-webkit-scrollbar,
.hold-chips::-webkit-scrollbar {
    display: none;
}

.hold-day {
    flex: 0 0 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 7px 0 6px;
    border: 0;
    border-radius: 15px;
    background: transparent;
    color: var(--mud-palette-text-primary);
    font: inherit;
    cursor: pointer;
}

.hold-day-wd {
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    color: var(--mud-palette-text-secondary);
}

.hold-day-dn {
    font-size: 1.125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.hold-day-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.hold-day-dot.on {
    background: var(--mud-palette-primary);
}

.hold-day.on {
    background: linear-gradient(160deg, var(--mud-palette-primary), color-mix(in srgb, var(--mud-palette-primary) 62%, #000));
    color: var(--mud-palette-primary-text);
    box-shadow: 0 8px 16px -8px color-mix(in srgb, var(--mud-palette-primary) 75%, transparent);
}

.hold-day.on .hold-day-wd {
    color: inherit;
    opacity: 0.85;
}

.hold-day.on .hold-day-dot.on {
    background: var(--mud-palette-primary-text);
}

.hold-chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 17px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.hold-chip.on {
    background: var(--mud-palette-text-primary);
    border-color: transparent;
    color: var(--mud-palette-background);
}

.hold-chip-filter.active {
    border-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary);
}

/* The Hold screen's filter button in the phone app bar; a dot when a filter is on */
.app-bar-filter {
    position: relative;
    display: inline-flex;
}

.app-bar-filter.active::after {
    content: "";
    position: absolute;
    top: 9px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mud-palette-primary);
    box-shadow: 0 0 0 2px var(--mud-palette-surface);
    pointer-events: none;
}

.hold-date {
    padding: 2px 4px 0;
    font-size: 1rem;
    font-weight: 600;
}

.hold-section-label {
    padding: 6px 4px 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.hold-list {
    background: var(--mud-palette-surface);
    border-radius: 16px;
    overflow: hidden;
}

.hold-row {
    position: relative;
    display: flex;
    align-items: center;
}

.hold-row + .hold-row::before {
    content: "";
    position: absolute;
    top: 0;
    left: 78px;
    right: 0;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.hold-row.done {
    opacity: 0.5;
}

.hold-row-main {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.hold-row-main:active {
    background: var(--mud-palette-action-default-hover);
}

.hold-row:has(.hold-row-menu) .hold-row-main {
    padding-right: 4px;
}

.hold-row-menu {
    flex: none;
    margin-right: 2px;
}

.hold-time {
    display: flex;
    flex-direction: column;
}

.hold-time b {
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
}

.hold-time small {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

.hold-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hold-name,
.hold-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hold-name {
    font-size: 1rem;
    font-weight: 600;
}

.hold-sub {
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

.hold-bar {
    display: block;
    max-width: 140px;
    height: 4px;
    margin-top: 4px;
    border-radius: 2px;
    background: var(--mud-palette-action-disabled-background);
    overflow: hidden;
}

.hold-bar i {
    display: block;
    height: 100%;
    border-radius: 2px;
    background: var(--mud-palette-primary);
}

.hold-bar.full i {
    background: var(--mud-palette-warning);
}

.hold-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 30px;
    padding: 0 12px;
    border-radius: 15px;
    font-size: 0.84rem;
    font-weight: 600;
    white-space: nowrap;
}

.hold-pill.brand { background: color-mix(in srgb, var(--mud-palette-primary) 16%, transparent); color: var(--mud-palette-primary); }
.hold-pill.ok    { background: color-mix(in srgb, var(--mud-palette-success) 16%, transparent); color: var(--mud-palette-success); }
.hold-pill.wait,
.hold-pill.warn  { background: color-mix(in srgb, var(--mud-palette-warning) 16%, transparent); color: var(--mud-palette-warning); }
.hold-pill.muted { background: var(--mud-palette-action-disabled-background); color: var(--mud-palette-text-secondary); }
.hold-pill.soft  { background: var(--mud-palette-action-disabled-background); color: var(--mud-palette-text-primary); font-variant-numeric: tabular-nums; }

.hold-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px 16px;
    color: var(--mud-palette-text-secondary);
    text-align: center;
}

/* Filter sheet (Components/Dialogs/Calendar/ClassFilterDialog.razor) */
.class-filter {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-bottom: 4px;
}

.class-filter-label {
    margin-bottom: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.class-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---- Mere page (/more) ---- */
.more-page {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.more-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--mud-palette-surface);
    color: inherit;
    text-decoration: none;
}

.more-profile-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.more-profile-name {
    font-weight: 600;
    font-size: 1.0625rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.more-profile-sub {
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

.more-search {
    margin: 0 !important;
}

.more-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.more-section-label {
    padding: 8px 4px 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--mud-palette-text-secondary);
}

.more-group-label {
    padding: 4px 4px 0;
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

.more-list {
    background: var(--mud-palette-surface);
    border-radius: 14px;
    overflow: hidden;
}

/* Hairline between rows, starting after the icon */
.more-list > * + * {
    position: relative;
}

.more-list > * + *::before {
    content: "";
    position: absolute;
    top: 0;
    left: 56px;
    right: 0;
    border-top: 1px solid var(--mud-palette-lines-default);
    z-index: 1;
}

.more-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    padding: 8px 14px;
    color: var(--mud-palette-text-primary);
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.more-row:hover,
.more-row:active {
    background: var(--mud-palette-action-default-hover);
}

.more-row-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    flex: none;
    color: #fff;
}

.more-row-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.more-row-value {
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
}

.more-row-chevron {
    flex: none;
    color: var(--mud-palette-text-secondary);
    opacity: 0.6;
}

/* Rows that open a menu (language, theme, centre) fill the row's width */
.more-menu,
.more-menu .mud-menu-activator {
    display: block !important;
    width: 100%;
}

/* Icon tiles: one colour per menu section, white icon on top in both themes */
.more-ic-dashboard     { background: #2f7fd8; }
.more-ic-management    { background: #7b4fd6; }
.more-ic-content       { background: #d1497b; }
.more-ic-reports       { background: #3a9d4a; }
.more-ic-configuration { background: #5b6b7a; }
.more-ic-about         { background: #13a085; }
.more-ic-settings      { background: #5b6b7a; }
.more-ic-app           { background: var(--mud-palette-primary); }
.more-ic-logout        { background: var(--mud-palette-error); }

.more-logout .more-row-label {
    color: var(--mud-palette-error);
}

.more-switch {
    position: relative;
    flex: none;
    width: 50px;
    height: 30px;
    border-radius: 15px;
    background: var(--mud-palette-action-disabled-background);
    transition: background-color 0.2s;
}

.more-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s;
}

.more-switch.on {
    background: var(--mud-palette-success);
}

.more-switch.on::after {
    transform: translateX(20px);
}

.more-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px 16px;
    color: var(--mud-palette-text-secondary);
}

/* Hide brand text on very small screens */
@media (max-width: 480px) {
    .brand-text {
        display: none;
    }
}

/* Profile menu popover — keep within the viewport on small phones.
   MudBlazor's right-anchored popover stops respecting the right edge when
   the menu's natural width exceeds the room from the anchor to viewport
   right; capping width forces it to wrap/shorten and stay on-screen. */
.profile-menu-popover {
    max-width: calc(100vw - 16px) !important;
}
.profile-menu-popover .mud-list {
    max-width: 100%;
}

/* Member dialog (view + edit) — claim more horizontal room on phones.
   The default desktop dialog margin leaves a wide gutter on a 360px screen;
   shrink it so the content (esp. the membership row) has space to breathe. */
@media (max-width: 600px) {
    .mud-dialog.member-details-dialog {
        margin: 12px 8px !important;
        max-width: calc(100vw - 16px) !important;
    }
}

/* Member dialog title: heading on the left, the Vis/Rediger switch on the right, just left of
   the close button (MudBlazor already pads the title for it). On phones only the heading's
   icon is shown, so the switch fits. */
.member-dialog-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.member-dialog-heading {
    display: flex;
    align-items: center;
    min-width: 0;
}
.member-dialog-heading-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.member-dialog-mode {
    margin-left: auto;
    flex-shrink: 0;
}
@media (max-width: 600px) {
    .member-dialog-heading-text {
        display: none;
    }
}

/* Phone tab picker in the member dialog (‹ chip ›): a long tab name ("Personlige
   Oplysninger") is cut with an ellipsis instead of pushing the right arrow out of the dialog. */
.member-tab-picker > .mud-icon-button {
    flex-shrink: 0;
}
.member-tab-picker > .mud-menu {
    min-width: 0;
}
.member-tab-picker .mud-menu-activator,
.member-tab-picker .mud-chip {
    max-width: 100%;
}
.member-tab-picker .mud-chip-content {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Fixed visual size regardless of which tab is active (a short Chips list
   vs. a tall Payments table used to make the dialog visibly grow/shrink).
   MudBlazor's own .mud-dialog-content (flex:1 1 auto; overflow:auto) then
   scrolls the WHOLE content — header and tabs together — as one region on
   every screen size; no custom scroll-splitting needed. MudBlazor's own
   .mud-dialog max-height (calc(100vh - appbar)) still clamps this on short
   viewports, so nothing overflows off-screen. */
.mud-dialog.dialog-fixed-size {
    height: 85vh;
}
/* Mobile browsers resize the layout viewport as the address bar collapses/
   expands during scroll, so a plain vh height recalculates mid-scroll and
   the dialog visibly jumps. svh is pinned to the smallest possible viewport
   (toolbars fully shown) and never changes, keeping the dialog rock-solid
   regardless of scroll position or content size. */
@media (max-width: 600px) {
    .mud-dialog.dialog-fixed-size {
        height: 85svh;
    }
}

[class^="tab-fade-"] {
    animation: dialogTabFadeSlide 0.25s ease;
}
@keyframes dialogTabFadeSlide {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Below 600px the built-in MudTabs strip is replaced by the chip+menu
   selector rendered in the .razor (see MudHidden Breakpoint="SmAndUp"). */
@media (max-width: 600px) {
    .dialog-tabs-scroll .mud-tabs-tabbar {
        display: none;
    }
}

/* Add-pause dialog (staff) — sit just left of centre on desktop so the member's pause
   history stays visible. The history is the right md=5 column (≈7/12) of the centred
   1280px (MaxWidth.Large + FullWidth) Edit Member dialog, so it begins at ≈ 50vw + 100px.
   This dialog is 600px wide (MaxWidth.Small): margin-right:auto left-aligns it and
   margin-left lands its right edge just left of that line. max() keeps it on-screen on
   narrower desktops (where it falls back to near-left). Tune the 520px — larger = further
   left, smaller = nearer centre (but starts covering the history). Mobile (<960px) keeps
   it centred, since there the history stacks below. */
@media (min-width: 960px) {
    .mud-dialog.pause-add-dialog {
        margin-right: auto;
        margin-left: max(1.5rem, calc(50vw - 520px));
    }
}


/* ================================================================
   PAGE & MISC
   ================================================================ */

/* Page transition */
.page-content {
    animation: fadeIn 0.25s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Scrollbar styling — theme-aware */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}


/* ================================================================
   Text field labels — stop Danish ring/diaeresis accents (Å/Ä/Ö) from
   being clipped at the top. MudBlazor's label box uses a tight
   line-height with overflow:hidden (needed for ellipsis truncation of
   long labels), which crops the ring above a capital Å. A touch more
   line-height gives accents room without disabling the truncation.
   Selectors mirror MudBlazor's own (.mud-input-label alone loses the
   cascade — MudBlazor's compound selector below is more specific). */
.mud-input-control > .mud-input-control-input-container > .mud-input-label-inputcontrol,
.mud-input-control > .mud-input-control-input-container > .mud-input-label-outlined.mud-input-label-inputcontrol {
    line-height: 1.4rem;
}

/* ================================================================
   MudDateRangePicker — force both nav arrows visible
   (MudBlazor hides the forward arrow on the left calendar by default)
   ================================================================ */
.mud-picker-nav-button-next,
.mud-picker-nav-button-prev {
    visibility: visible !important;
}

/* Calendar side-picker month arrows — bump the touch target on mobile.
   On phones this static picker is the only month nav (big calendar is hidden),
   and MudBlazor's arrows are ~32px, under the 44pt/48dp guideline. Enlarge the
   hit area to 44px and give it a subtle rounded surface so it reads as a button.
   To switch the tint for an explicit edge, swap `background` for
   `border: 1px solid var(--mud-palette-divider);`. Scoped to .cal-side-picker so
   desktop and other date pickers are untouched. */
@media (max-width: 959px) {
    .cal-side-picker .mud-picker-nav-button-prev,
    .cal-side-picker .mud-picker-nav-button-next {
        min-width: 44px;
        min-height: 44px;
        border-radius: 50%;
        background: var(--mud-palette-action-default-hover);
    }

    .cal-side-picker .mud-picker-nav-button-prev .mud-icon-root,
    .cal-side-picker .mud-picker-nav-button-next .mud-icon-root {
        font-size: 1.4rem;
    }
}


/* ================================================================
   NOTIFICATION BADGE — shift the red dot down so it's not clipped
   ================================================================ */
.notification-badge .mud-badge {
    top: 0px !important;
}


/* ================================================================
   NOTIFICATION PANEL
   ================================================================ */
.notification-popover {
    border-radius: 12px !important;
    overflow: hidden;
}

.notification-panel {
    max-height: 420px;
    display: flex;
    flex-direction: column;
}

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px 16px;
}

.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.notification-list {
    overflow-y: auto;
    max-height: 360px;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.notification-item:hover {
    background: var(--subnav-link-hover-bg);
}

.notification-item.unread {
    background: var(--subnav-link-active-bg);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    background: var(--rail-indicator);
    border-radius: 0 3px 3px 0;
}

.notification-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rail-hover);
    margin-top: 2px;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-dismiss {
    opacity: 0;
    transition: opacity 0.15s;
    margin-top: -2px;
}

.notification-item:hover .notification-dismiss {
    opacity: 0.6;
}

.notification-dismiss:hover {
    opacity: 1 !important;
}

/* ---- Notifications on the phone (NotificationsDialog, from the phone app bar's bell) ----
   Large title with "Markér alle som læst" beside it, then Mere-style rows (.more-list /
   .more-row) that wrap: icon tile, title, whole message, time; an unread row has a bold title
   and a dot. The ✕ is always shown (no hover on a phone). The empty state is .settings-empty. */
.notif-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.notif-sheet-head .sheet-title {
    margin: 0;
}

.notif-sheet-head .notif-sheet-markall {
    flex: none;
    min-height: 0;
    height: auto;
    text-transform: none;
}

.more-list.notif-list {
    background: var(--mud-palette-background);
}

.more-row.notif-row {
    align-items: flex-start;
    padding-top: 12px;
    padding-bottom: 12px;
}

.notif-row .more-row-icon {
    margin-top: 2px;
}

.notif-ic-error { background: var(--mud-palette-error); }

.notif-row-body {
    flex: 1;
    min-width: 0;
}

.notif-row-title {
    font-weight: 500;
    line-height: 1.3;
}

.notif-row.unread .notif-row-title {
    font-weight: 700;
}

.notif-row-text {
    margin-top: 2px;
    font-size: 0.875rem;
    line-height: 1.35;
    color: var(--mud-palette-text-secondary);
    overflow-wrap: anywhere;
}

.notif-row-time {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

.notif-row.unread .notif-row-time {
    color: var(--mud-palette-primary);
    font-weight: 600;
}

.notif-row-end {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: none;
    margin: -4px -8px 0 0;
}

.notif-row-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--mud-palette-primary);
}

.notif-row .notif-row-dismiss {
    color: var(--mud-palette-text-secondary);
    opacity: 0.7;
}


/* ================================================================
   CAMERA MODAL — webcam capture for profile photo (Settings page)
   Adapted from old project's imageupload.css
   ================================================================ */
@keyframes cameraFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes cameraSlideIn {
    from { opacity: 0; transform: scale(0.9) translateY(-20px); }
    to   { opacity: 1; transform: scale(1)   translateY(0); }
}

.camera-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
    animation: cameraFadeIn 0.2s ease-out;
}

/* Colours come from MudBlazor's palette variables, which always follow the current theme
   (not from [data-theme], which can lag behind it). */
.camera-modal-content {
    background: var(--mud-palette-surface, #ffffff);
    color: var(--mud-palette-text-primary);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    animation: cameraSlideIn 0.3s ease-out;
    position: relative;
}

.camera-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--mud-palette-divider, #e0e0e0);
}

.camera-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 500;
    margin: 0;
}

.camera-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mud-palette-text-secondary, #666);
    transition: all 0.2s;
}

.camera-modal-close:hover {
    background-color: var(--mud-palette-action-default-hover);
}

.camera-modal-body {
    padding: 20px;
}

.camera-video-container {
    position: relative;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    max-width: 400px;
    border-radius: 8px;
    overflow: hidden;
}

.camera-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--mud-palette-primary, #6c3fc5);
}

.camera-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--mud-palette-surface, #fff);
    border: 2px solid var(--mud-palette-divider, #e0e0e0);
    border-radius: 8px;
    z-index: 10;
    gap: 16px;
}

.camera-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 600px) {
    .camera-modal-content {
        width: 95%;
    }
    .camera-modal-body {
        padding: 16px;
    }
    .camera-video-container {
        height: 250px;
    }
    .camera-actions {
        flex-direction: column;
        gap: 8px;
    }
    .camera-actions .mud-button-root { min-height: 44px; }
}

/* POS cart — sticky only on md and up; on mobile, cart scrolls with the rest of the page */
.pos-cart-sticky {
    position: sticky;
    top: 80px;
}
@media (max-width: 959px) {
    .pos-cart-sticky {
        position: static;
    }
}

/* Membership plan card content — side-by-side on desktop, stacks on narrow phones
   so the title doesn't get squeezed into one-word-per-line. Used on Signup page. */
.plan-card-content {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-grow: 1;
}
.plan-card-prices {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}
/* Original price next to a campaign price on the signup plan cards */
.plan-card-original {
    text-decoration: line-through;
}
@media (max-width: 599px) {
    .plan-card-content {
        flex-direction: column;
    }
    .plan-card-prices {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
        column-gap: 8px;
        align-self: flex-start;
    }
}

/* Snackbar close-icon tap target on mobile.
   MudBlazor's default close X is ~24px — below Apple HIG 44pt / Material 48dp.
   Expand the hit area without changing the visible icon size, and grow the icon
   itself slightly so it's easier to aim for. The ripple gives a round tap
   feedback so the larger area feels intentional, not just empty padding. */
@media (max-width: 959px) {
    .mud-snackbar .mud-icon-button {
        min-width: 48px;
        min-height: 48px;
        padding: 12px;
    }
    .mud-snackbar .mud-icon-button .mud-icon-root {
        font-size: 1.5rem;
    }
}

/* Payment-method card (Settings + MemberDetailsDialog). Horizontal on desktop —
   info on the left, status chip + delete on the right. On narrow screens the chip
   drops below the title and the warning-panel buttons stack full-width. Pure CSS
   reflow (flex order/wrap), no breakpoint JS. */
/* Read-only fields derived from the CPR number (date of birth, gender): can't be clicked
   into — no caret, no focus ring, no picker. Pair with tabindex="-1" on the field. */
.cpr-derived-field { pointer-events: none; }

/* Ledger rows (payment history: MemberDetailsView + Settings): an upcoming row's saldo
   is a projection, shown in italics. */
.ledger-saldo-projected { font-style: italic; }

.payment-card-row { display: flex; align-items: center; gap: 10px; }
.payment-card-info { flex: 1 1 auto; min-width: 0; }
.payment-card-chip { flex: 0 0 auto; }
.payment-card-actions { display: flex; gap: 8px; margin-top: 10px; }

@media (max-width: 599px) {
    .payment-card-row { flex-wrap: wrap; }
    .payment-card-chip { order: 1; flex-basis: 100%; margin-left: 34px; margin-top: 6px; }
    .payment-card-actions { flex-direction: column; }
    .payment-card-actions .mud-button-root { width: 100%; min-height: 44px; }
}

/* SMS compose box (MemberContactPanel). One outlined container holding the
   borderless message field plus the grey auto-appended signature, so typed
   text and signature read as a single message with grey trailing text. */
.sms-compose-box {
    border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: var(--mud-default-borderradius);
    padding: 14px 16px 12px;
}

.sms-compose-box:focus-within {
    border-color: var(--mud-palette-primary);
}

.sms-compose-signature {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
    color: var(--mud-palette-text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.sms-compose-signature-text {
    white-space: pre-wrap;
    padding-top: 6px;
}

/* Income report month beam (Pages/Reports/Income.razor). One segment per month in the
   chosen period, newest first; segments share the full width and the beam scrolls
   sideways below ~72px each. Status colours are fixed opaque values (not theme
   variables) so a segment looks the same in light/dark mode and across all presets;
   each has a matching dark text colour so it stays readable whatever the theme. */
.income-beam {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 3px;
}

.income-beam-segment {
    flex: 1 0 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    font: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
}

.income-beam-segment:hover:not(:disabled) { border-color: var(--mud-palette-text-secondary); }
.income-beam-segment:disabled { cursor: progress; }

.income-beam-segment.ok      { background: #c8e6c9; border-color: #81c784; color: #1b5e20; }
.income-beam-segment.missing { background: #ffcdd2; border-color: #e57373; color: #b71c1c; }

.income-beam-segment.selected {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 1px;
}

.income-beam-month { font-weight: 600; }
.income-beam-missing { font-size: 0.75rem; }

/* SegmentedSwitch with no active option (e.g. the Income page's quick periods when a
   custom period is picked): hide the sliding thumb instead of leaving it on the last
   option. Beats the component's scoped thumb rule on specificity. */
.segmented-switch-wrap.no-selection .segmented-switch-thumb { opacity: 0; }

/* A one-option on/off button drawn like a SegmentedSwitch (same track, same option text,
   primary pill when on). Its styles are copied here because SegmentedSwitch's own are
   scoped (SegmentedSwitch.razor.css) and don't reach other components. Keep in sync.
   Used by the members list's "Ufærdige tilmeldinger" next to the role switch. */
.segmented-toggle {
    display: inline-flex;
    height: 34px;
    border-radius: 17px;
    background: var(--mud-palette-action-disabled-background);
    padding: 3px;
    box-sizing: border-box;
    border: none;
    cursor: pointer;
    user-select: none;
    font-family: inherit;
}
.segmented-toggle-option {
    display: flex;
    align-items: center;
    height: 100%;              /* fill the track like the switch's thumb (a <button> doesn't stretch its child) */
    box-sizing: border-box;
    border-radius: 14px;
    padding: 0 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    color: var(--mud-palette-text-secondary);
    transition: background-color 0.2s ease, color 0.2s ease;
}
.segmented-toggle.active .segmented-toggle-option {
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}
.segmented-toggle:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }

/* /payment-result (the FreePay tab's landing page): a round badge per result. "Accepted" pops
   in, so the second it's on screen reads clearly as approved before the tab closes. */
.payment-result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.payment-result-accepted { background: var(--mud-palette-success); animation: payment-result-pop 0.35s ease-out; }
.payment-result-declined { background: var(--mud-palette-error); }
.payment-result-cancelled { background: var(--mud-palette-warning); }
.payment-result-unknown { background: var(--mud-palette-info); }
@keyframes payment-result-pop {
    0% { transform: scale(0.4); opacity: 0; }
    70% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

/* Share bar in the missing-breakdown member table (IncomeReportDetails): each member's
   amount as a bar scaled to the largest amount for that reason, plus their percentage
   of the reason's total. */
.income-share { display: flex; align-items: center; gap: 8px; }
.income-share-track {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--mud-palette-lines-default);
}
.income-share-bar {
    height: 100%;
    border-radius: 3px;
    background: var(--mud-palette-error);
}
.income-share-label {
    min-width: 36px;
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    text-align: right;
}

/* Membership age check: both member tables use the widths from their <colgroup>
   instead of sizing to their own contents, so the columns line up between the lists */
.age-mismatch-table table { table-layout: fixed; }

/* Membership age check, phones: one card per member. Long names/membership names wrap
   instead of pushing the card wider than a 360px screen; the facts are a label/value grid */
.age-mismatch-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.age-mismatch-card-name,
.age-mismatch-card-wrap {
    min-width: 0;
    overflow-wrap: anywhere;
}
.age-mismatch-card-facts {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    row-gap: 2px;
}

/* ── Campaigns page (/campaigns): period card with Tidslinje / Varighed ── */
.campaign-period-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}
/* Campaign form errors (CampaignFormDialog): a red line under a section without an input of its
   own, a red border on a membership row with a problem, and the list next to the save button.
   .form-field-error is the same line for other forms (MemberAddDialog: no membership chosen). */
.campaign-field-error,
.form-field-error {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 6px 10px;
    border-left: 3px solid var(--mud-palette-error);
    border-radius: 4px;
    background: color-mix(in srgb, var(--mud-palette-error) 8%, transparent);
    color: var(--mud-palette-error);
    font-size: 0.8125rem;
    line-height: 1.4;
}
.campaign-row-error {
    border-color: var(--mud-palette-error) !important;
    box-shadow: 0 0 0 1px var(--mud-palette-error);
}
/* "Alle månedlige medlemskaber": the read-only list of every membership and its campaign price;
   one the fixed price leaves out is greyed */
.campaign-all-row {
    padding: 6px 8px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}
.campaign-all-row:last-child { border-bottom: none; }
.campaign-all-row.excluded { opacity: 0.6; }
.campaign-error-list {
    margin: 4px 0 0;
    padding-left: 20px;
}

/* Year scroll: ‹ period › between the quick options and the view toggle */
.campaign-year-stepper {
    display: flex;
    align-items: center;
    gap: 2px;
}
/* From/to month pickers: side by side, half width each on phones */
.campaign-period-pickers {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}
.campaign-period-pickers > * {
    flex: 0 1 170px;
    min-width: 0;
}
/* One column per month in the period — the count is set inline */
.campaign-months,
.campaign-duration-months {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
}
.campaign-months span {
    font-size: 12px;
    color: var(--mud-palette-text-secondary);
    text-align: center;
    padding: 4px 0;
    border-left: 1px solid var(--mud-palette-lines-default);
}
.campaign-months span.current,
.campaign-duration-months span.current {
    color: var(--mud-palette-primary);
    font-weight: 600;
}
.campaign-months span.current {
    background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent);
}

/* Tidslinje */
.campaign-timeline {
    position: relative;
    margin-top: 6px;
    overflow: hidden;
}
.campaign-bar,
.campaign-bar-label {
    position: absolute;
    height: 24px;
    line-height: 24px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    box-sizing: border-box;
}
.campaign-bar {
    border-radius: 5px;
    padding: 0 8px;
    min-width: 4px;
}
.campaign-bar.cut-start { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.campaign-bar.cut-end { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.campaign-bar.disabled { opacity: 0.6; }
/* Name beside the bar: no padding, or a one-day bar is drawn 16px wide and covers its own name */
.campaign-bar.label-outside { padding: 0; }
.campaign-bar-label {
    color: var(--mud-palette-text-primary);
    max-width: 40%;
    z-index: 1; /* above the today line */
}
.campaign-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 1.5px dashed var(--mud-palette-primary);
    pointer-events: none;
}

/* Varighed */
.campaign-duration-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr) 110px;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    cursor: pointer;
}
.campaign-duration-row.header {
    padding-top: 0;
    cursor: default;
    font-size: 12px;
    color: var(--mud-palette-text-secondary);
}
.campaign-duration-months span {
    font-size: 12px;
    text-align: center;
}
.campaign-duration-name { min-width: 0; }
.campaign-duration-name .name {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.campaign-duration-name .name.muted { color: var(--mud-palette-text-disabled); }
.campaign-duration-name .dates,
.campaign-duration-length .sub {
    font-size: 11px;
    color: var(--mud-palette-text-disabled);
}
.campaign-duration-strip {
    position: relative;
    height: 22px;
    background-image: repeating-linear-gradient(90deg, var(--mud-palette-lines-default) 0 1px, transparent 1px calc(100% / 12));
}
.campaign-duration-bar {
    position: absolute;
    top: 5px;
    height: 12px;
    min-width: 3px;
    border-radius: 3px;
    box-sizing: border-box;
}
.campaign-duration-bar.upcoming {
    background: transparent;
    border: 1.5px dashed;
}
.campaign-duration-bar.cut-start { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.campaign-duration-bar.cut-end { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.campaign-duration-length { text-align: right; }
.campaign-duration-length .main {
    font-size: 13px;
    font-weight: 500;
}
@media (max-width: 599px) {
    .campaign-duration-row {
        grid-template-columns: 96px minmax(0, 1fr) 72px;
        gap: 6px;
    }
}

/* ── Campaigns page on phones ──
   Period card: quick options + the view toggle (icons only) on the first line, the year stepper
   stretched across the second. Tidslinje keeps 56px per month and scrolls sideways. */
.campaign-view-icon { margin-right: 4px; }
.campaign-timeline-scroll { overflow-x: auto; }
@media (max-width: 599px) {
    .campaign-period-header { gap: 8px; }
    .campaign-year-stepper {
        order: 3;
        flex: 1 1 100%;
        justify-content: space-between;
    }
    .campaign-view-label { display: none; }
    .campaign-view-icon { margin-right: 0; }
    .campaign-period-pickers > * { flex: 1 1 0; }
    .campaign-timeline-inner { min-width: calc(var(--months, 12) * 56px); }
}

/* Campaign list header: title, status chips and add button wrap on one line on desktop; on
   phones the title and add button share the first line and the chips scroll sideways below */
.campaign-list-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.campaign-list-title { margin-right: 8px; }
.campaign-status-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}
.campaign-list-add { margin-left: auto; }
@media (max-width: 599px) {
    .campaign-list-title {
        flex: 1 1 0;
        min-width: 0;
        margin-right: 0;
        font-size: 1.05rem !important;
    }
    .campaign-list-add { order: 1; }
    .campaign-status-chips {
        order: 2;
        flex: 1 1 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        margin: 0 -4px;
    }
    .campaign-status-chips::-webkit-scrollbar { display: none; }
    .campaign-status-chips .mud-chip { flex-shrink: 0; }
}

/* Phone cards for campaigns, templates and a campaign's members (instead of the tables below 960px) */
.campaign-card {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 10px 12px 4px;
}
.campaign-card.clickable { cursor: pointer; }
.campaign-card.clickable:active { background: var(--mud-palette-action-default-hover); }
.campaign-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.campaign-card-name {
    font-weight: 600;
    min-width: 0;
    overflow-wrap: anywhere;
}
.campaign-card-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 4px;
    font-size: 0.875rem;
}
.campaign-card-line > .mud-icon-root {
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--mud-palette-text-secondary);
}
.campaign-card-sub {
    display: block;
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}
.campaign-card-prices { white-space: pre-line; }
.campaign-card-footer {
    display: flex;
    align-items: center;
    margin: 6px -8px 0;
    padding-top: 2px;
    border-top: 1px solid var(--mud-palette-lines-default);
    min-height: 40px;
}
.campaign-card:not(:has(.campaign-card-footer)) { padding-bottom: 10px; }

/* Below 600px every dialog, these included, is a bottom sheet (PHONE LOOK above): full width,
   stacked phone-style buttons. The campaign-dialog / phone-dialog classes are kept on their
   dialogs but no longer need rules of their own. */

/* ── Media category cards (Rediger Medier + Medier) ─────────────
   A long category name gets "…" instead of pushing the status and the edit/delete buttons
   off the card. On phones the status shows as its icon only (the "Aktiv" text is hidden). */
.media-category-header .mud-card-header-content { min-width: 0; }
.media-category-header .mud-card-header-actions { flex-shrink: 0; }
.media-category-header .mud-icon-root { flex-shrink: 0; }
.media-category-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 599.98px) {
    .media-status-text { display: none; }
}

/* ── Opret Medlem (MemberAddDialog) on phones ─────────────────────
   Narrow dialog margins and section padding, plan cards stacked (name, campaign, price,
   description) instead of name | price side by side, and the buttons stacked full width
   with the main one on top. */
@media (max-width: 599.98px) {
    .mud-dialog.member-add-dialog {
        margin: 12px 8px !important;
        max-width: calc(100vw - 16px) !important;
        width: calc(100vw - 16px) !important; /* FullWidth's own width keeps 32px each side */
    }
    .mud-dialog.member-add-dialog .mud-dialog-content { padding: 8px 12px; }
    .member-add-dialog .member-add-form { padding-right: 0 !important; }
    .member-add-dialog .member-add-section { padding: 12px !important; }

    .member-add-dialog .plan-card-body {
        flex-direction: column;
        align-items: stretch !important;
        gap: 2px !important;
    }
    .member-add-dialog .plan-card-info { display: contents; }
    .member-add-dialog .plan-card-name { order: 1; }
    .member-add-dialog .plan-card-campaign { order: 2; align-self: flex-start; }
    .member-add-dialog .plan-card-price { order: 3; align-items: flex-start !important; }
    .member-add-dialog .plan-card-desc { order: 4; margin-top: 4px; }

    .member-add-dialog .mud-dialog-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 8px;
    }
    .member-add-dialog .mud-dialog-actions > * { width: 100%; margin: 0 !important; }
    .member-add-dialog .mud-dialog-actions .mud-button-root { width: 100%; }
}

/* ── Phone layout helpers (< 600px) ─────────────────────────────
   Found in a sweep of every page at 360px (Android app). */
@media (max-width: 599.98px) {
    /* Page titles (MudText h4): smaller, and a long single word ("Organisationsindstillinger")
       hyphenates or breaks instead of running off the screen. */
    .app-main-content .mud-typography-h4 {
        font-size: 1.625rem;
        line-height: 1.25;
        overflow-wrap: anywhere;
        hyphens: auto;
    }

    /* search-toolbar: a search field + buttons on one line (list pages). The search takes the
       whole first line; the buttons share the line below, their labels on one line. */
    .search-toolbar {
        flex-wrap: wrap;
        row-gap: 8px;
    }
    .search-toolbar > .mud-input-control {
        flex: 1 1 100% !important;
        max-width: none !important;
    }
    .search-toolbar > .mud-button-root { flex: 1 1 auto; }
    .search-toolbar .mud-button-label { white-space: nowrap; }

    /* page-title-row: a page title with a button beside it — the button goes under the title. */
    .page-title-row { flex-wrap: wrap; row-gap: 8px; }
    .page-title-row > .mud-spacer { display: none; }
    .page-title-row > .mud-button-root { flex: 1 1 100%; }

    /* button-row: buttons side by side — stacked full width on phones. */
    .button-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .button-row .mud-button-label { white-space: nowrap; }

    /* Dashboard "newest members" table: tighter cells and smaller headers so its five columns
       fit a phone instead of scrolling sideways. */
    .dash-newest-table th,
    .dash-newest-table td { padding: 6px 2px !important; }
    .dash-newest-table th { font-size: 0.7rem; }
}

/* SubNavPanel (desktop only): a NavGroup with MobileOnly is listed only on the phone's Mere page (NavConfig.cs) */
.sub-nav-group-mobile-only { display: none; }

/* Start-up / fingerprint screen (MainLayout while the session is checked or the native app waits
   for the fingerprint): the logo centred on the theme background. */
.app-splash {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mud-palette-background);
    z-index: 1;
}
.app-splash img {
    max-width: 60vw;
    max-height: 30vh;
    width: auto;
    height: auto;
}

/* Cancellation reasons page (/configuration/cancellationreasons): one row per reason in a
   MudDropZone. The handle shows the row can be dragged; inactive reasons are greyed. "Andet"
   is a fixed last row (not draggable). */
.cancel-reason-zone {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 8px;
}
.cancel-reason-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    background: var(--mud-palette-surface);
}
.cancel-reason-handle {
    cursor: grab;
    color: var(--mud-palette-text-secondary);
    flex-shrink: 0;
}
.cancel-reason-name {
    overflow-wrap: anywhere;
}
.cancel-reason-inactive .cancel-reason-name {
    color: var(--mud-palette-text-disabled);
    text-decoration: line-through;
}
.cancel-reason-other {
    margin-top: 6px;
    border-style: dashed;
    background: transparent;
}
.mud-drop-item-dragging .cancel-reason-row,
.cancel-reason-zone .mud-drop-item[draggable="true"]:active .cancel-reason-row {
    cursor: grabbing;
}

/* Cancellation statistics report: a bar per reason behind its percentage */
.cancel-stat-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--mud-palette-primary);
    min-width: 2px;
}
.cancel-stat-bar-track {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--mud-palette-action-disabled-background);
    overflow: hidden;
}
/* ================================================================
   PHONE BUTTON RULES (shared)
   .phone-actions: a row of buttons, right-aligned on wider screens (-start: left-aligned);
   below 600px every button in it is full width and 44px tall, stacked.
   .phone-actions-pair: two buttons sharing one line on phones when they fit.
   .phone-full-button: the same rule for a single button with no wrapper.
   Used by Settings, PaymentCardsPanel and MemberHoldPeriodsPanel.
   ================================================================ */
.phone-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}
.phone-actions.phone-actions-start { justify-content: flex-start; }
.phone-actions-pair {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 599.98px) {
    .phone-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .phone-actions .mud-button-root,
    .mud-button-root.phone-full-button {
        width: 100%;
        min-height: 44px;
    }
    /* Side by side when both labels fit, otherwise each on its own full-width line
       (e.g. the German labels on a 375px phone) — never clipped. */
    .phone-actions-pair > * { flex: 1 1 auto; }
    /* a button inside a wrapper (MudFileUpload nests it a few levels deep) fills that
       wrapper, and so the whole line once the pair has stacked */
    .phone-actions-pair > :not(.mud-button-root) .mud-button-root { width: 100%; }
    .phone-actions-pair .mud-button-root {
        min-height: 44px;
        padding-left: 8px;
        padding-right: 8px;
    }
    .phone-actions-pair .mud-button-label { white-space: nowrap; }
}

/* Pause history panel header: title | count + add. On phones the add button gets its
   own full-width line under the title. */
.hold-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
.hold-panel-header-end {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
@media (max-width: 599.98px) {
    .hold-panel-header { flex-wrap: wrap; }
    .hold-panel-header-end { display: contents; }
    .hold-panel-header .mud-chip { margin-left: auto; }
    .mud-button-root.hold-panel-add {
        order: 10;
        flex-basis: 100%;
        min-height: 44px;
    }
}

/* ================================================================
   SETTINGS PAGE (/settings), see Settings.razor
   ================================================================ */
.settings-section {
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--mud-palette-divider);
}
.settings-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

/* Warning banners at the top (email not verified, card required) */
.settings-alert .mud-alert-message { flex: 1; min-width: 0; }
.settings-alert-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* Profile picture: avatar left of the buttons; centred above them on phones */
.settings-photo {
    display: flex;
    align-items: center;
    gap: 16px;
}
.mud-avatar.settings-photo-avatar {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

/* Account info: label/value pairs, two columns */
.settings-info-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 24px;
    margin: 0;
}
.settings-info-list dt {
    margin: 0;
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}
.settings-info-list dd {
    margin: 2px 0 0;
    font-weight: 500;
    overflow-wrap: anywhere;
}

/* Current membership card: name | price */
.settings-plan-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.settings-plan-info { min-width: 0; }
.settings-plan-price { flex-shrink: 0; white-space: nowrap; }

/* Account list (password, contracts, notes): tappable rows with icon, text and chevron */
.settings-link-list { margin: 0 -8px; }
.settings-link-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 56px;
    padding: 10px 8px;
    border: 0;
    border-top: 1px solid var(--mud-palette-divider);
    border-radius: 0;
    background: none;
    color: var(--mud-palette-text-primary);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.settings-link-row:first-child { border-top: 0; }
.settings-link-row:hover { background: var(--mud-palette-action-default-hover); }
.settings-link-row:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: -2px;
}
.settings-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}
.settings-link-icon.tone-primary { color: var(--mud-palette-primary); background: color-mix(in srgb, var(--mud-palette-primary) 14%, transparent); }
.settings-link-icon.tone-warning { color: var(--mud-palette-warning); background: color-mix(in srgb, var(--mud-palette-warning) 14%, transparent); }
.settings-link-icon.tone-info { color: var(--mud-palette-info); background: color-mix(in srgb, var(--mud-palette-info) 14%, transparent); }
.settings-link-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}
.settings-link-title { font-weight: 500; }
.settings-link-sub {
    font-size: 0.85rem;
    color: var(--mud-palette-text-secondary);
}
.settings-link-chevron { color: var(--mud-palette-text-secondary); flex-shrink: 0; }

/* Save bar: at the bottom of the page on wider screens */
.settings-save-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}
.settings-save-hint {
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
}

/* ── Phone (below 960px, .settings-phone): the Profil list and its pages ──
   The lists are the Mere page's (.more-section / .more-list / .more-row, see above);
   what's below adds the header, plain label | value rows, payment rows and the plan card. */
.settings-phone {
    max-width: 640px;
    margin: 0 auto;
}
.settings-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.settings-card { padding: 16px; }

.settings-phone .settings-alert-row > .mud-button-root { width: 100%; min-height: 44px; }

/* Header: avatar, name, e-mail and a status pill */
.settings-phead {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 4px 6px;
}
.settings-avatar-wrap { display: contents; }
.mud-avatar.settings-phead-avatar {
    width: 64px;
    height: 64px;
    flex: none;
    font-size: 1.375rem;
    font-weight: 700;
}
.settings-phead-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
}
.settings-phead-name,
.settings-phead-sub {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.settings-phead-name { font-size: 1.25rem; font-weight: 700; }
.settings-phead-sub { font-size: 0.875rem; color: var(--mud-palette-text-secondary); }
.settings-phead .settings-pill { margin-top: 4px; }

/* Small coloured pill (status, payment status) */
.settings-pill {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 11px;
    background: color-mix(in srgb, currentColor 15%, transparent);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.settings-pill.tone-success { color: var(--mud-palette-success); }
.settings-pill.tone-info    { color: var(--mud-palette-info); }
.settings-pill.tone-warning { color: var(--mud-palette-warning); }
.settings-pill.tone-error   { color: var(--mud-palette-error); }
.settings-pill.tone-muted   { color: var(--mud-palette-text-secondary); }

/* Icon tiles on the list (same colours as the prototype), white icon in both themes */
.settings-ic-purple { background: #7b4fd6; }
.settings-ic-blue   { background: #2f7fd8; }
.settings-ic-teal   { background: #13a085; }
.settings-ic-grey   { background: #5b6b7a; }
.settings-ic-pink   { background: #d1497b; }
.settings-ic-orange { background: #e07a1f; }
.settings-ic-green  { background: #3a9d4a; }

/* Rows that are <button>s (change password) look like the link rows */
.settings-phone button.more-row {
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
}
.settings-phone button.more-row:hover,
.settings-phone button.more-row:active {
    background: var(--mud-palette-action-default-hover);
}

/* Label and value on one row (Medlemskab › plan name): the label stays whole and the
   value is the part that gets cut short ("Basis plus…") when there isn't room for both */
.settings-phone .more-row-label:has(+ .more-row-value) {
    flex: 1 0 auto;
    max-width: 60%;
}
.settings-phone .more-row-value {
    flex: 0 1 auto;
    min-width: 0;
    max-width: none;
}

/* A row with a title and a line under it (push switch, payments) */
.settings-row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.settings-row-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.settings-row-sub {
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}
.settings-row-value {
    margin-left: auto;
    text-align: right;
    color: var(--mud-palette-text-secondary);
    overflow-wrap: anywhere;
}

/* Rows that only show something: no tap feedback */
.settings-static-row { cursor: default; }
.settings-static-row:hover,
.settings-static-row:active { background: transparent !important; }

/* A switch the browser won't allow (push blocked or not supported) */
.more-row.is-disabled { cursor: default; }
.more-row.is-disabled:hover,
.more-row.is-disabled:active { background: transparent; }
.more-row.is-disabled .more-row-icon,
.more-row.is-disabled .more-switch,
.more-row.is-disabled .settings-row-title { opacity: 0.45; }

/* Lists without icon tiles: the hairline starts at the row's edge, not after the icon */
.settings-list-plain > * + *::before { left: 14px; }

/* Payment rows: type + date/saldo on the left, amount and status on the right */
.settings-pay-row { padding-top: 10px; padding-bottom: 10px; }
.settings-pay-end {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex: none;
}
.settings-pay-amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.settings-pay-amount.is-positive { color: var(--mud-palette-success); }
.settings-pay-amount.is-negative,
.settings-negative { color: var(--mud-palette-error); }
.settings-pill-row { display: flex; gap: 4px; }
.settings-nowrap { white-space: nowrap; }

/* The card panel already sits in a card here: drop its own bordered box (inline style) */
.settings-cards-card [role="group"] > div {
    border: 0 !important;
    padding: 0 !important;
}
.settings-pay-comment { flex: none; color: var(--mud-palette-text-secondary); }

/* Medlemskab page: the plan card */
.settings-plan-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.settings-plan-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--mud-palette-primary);
}
.settings-plan-name {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.settings-plan-amount {
    font-size: 1.875rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.settings-plan-desc {
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
}
.settings-text-link {
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    font-weight: 500;
    color: var(--mud-palette-primary);
    cursor: pointer;
}

/* "Opsig medlemskab": a soft red full-width button, like the prototype's */
.mud-button-root.settings-danger-button {
    min-height: 52px;
    border-radius: 15px;
    background: color-mix(in srgb, var(--mud-palette-error) 14%, transparent);
    font-size: 1rem;
    font-weight: 600;
}

.settings-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 32px 12px;
    text-align: center;
}
.settings-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--mud-palette-primary) 15%, transparent);
    color: var(--mud-palette-primary);
}

/* Profile photo: avatar centred above the buttons */
.settings-phone .settings-photo {
    flex-direction: column;
    gap: 12px;
    text-align: center;
}
.settings-phone .settings-photo-body { width: 100%; }
.settings-phone .mud-avatar.settings-photo-avatar { width: 96px; height: 96px; }

/* Save bar: always a full-width button at the bottom of the page. Once a profile field
   changes it also sticks to the bottom of the scrolling content (.app-main-content), just
   above the tab bar. The negative margins cancel the content's 16px padding so the bar
   runs edge to edge. */
.settings-phone .settings-save-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin: 4px 0 0;
}
.settings-phone .settings-save-bar.is-dirty {
    position: sticky;
    bottom: -16px;
    z-index: 5;
    margin: 4px -16px -16px;
    padding: 10px 16px 12px;
    background: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-divider);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
}
.settings-phone .settings-save-hint { text-align: center; }
.settings-phone .settings-save-bar .mud-button-root { width: 100%; min-height: 44px; }

/* MemberAddDialog plan card: "not public" eye-off icon right after the plan name. */
.plan-card-not-public {
    margin-left: 6px;
    vertical-align: -3px;
    color: var(--mud-palette-text-secondary);
}

/* SegmentedSwitch Disabled: keeps showing its value, greyed and not clickable. */
.segmented-switch-wrap.disabled .segmented-switch {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

/* ── Membership form: options (MembershipFormDialog) ─────────────────────
   One bordered block, one row per option: label on the left, the choice on the right
   (a SegmentedSwitch, or a checkbox), help text under the choice. Phones: label above. */
.ms-options {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
}
.ms-option-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
}
.ms-option-row + .ms-option-row {
    border-top: 1px solid var(--mud-palette-lines-default);
}
.ms-option-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
}
.ms-option-control { min-width: 0; }
.ms-option-help {
    margin-top: 4px;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--mud-palette-text-secondary);
}
/* MudCheckBox carries its own margin; line it up with the switches above. */
.ms-option-check { margin-left: -9px; }
.ms-option-check .mud-checkbox { margin: 0; }

@media (max-width: 599.98px) {
    .ms-option-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
        padding: 10px 12px;
    }
}

/* Buttons used as tiles/cards on the phone screens: a global button style centres flex
   contents, so these lay their contents out from the left like the prototype. */
.media-phone-tile,
.pos-tile {
    align-items: flex-start;
}

.mhome-news-card {
    align-items: stretch;
}
