/* =============================================================================
   Design tokens — source of truth: docs/redesign-plan.md → design canvas
   ("Design tokens" board). Every colour has one light and one dark value; dark
   mode is made only by swapping these, never by changing layout or sizes.
   `data-theme` on <html> is set server-side from the theme cookie (App.razor)
   and kept in sync by js/app-init.js, so this works identically on interactive
   pages and on the non-interactive Identity pages.
   ============================================================================= */
:root {
    --bg: #F5F6F8;
    --surface: #FFFFFF;
    --surface-subtle: #FAFBFC;
    --surface-muted: #F2F3F5;
    --sidebar: #0C1733;
    --sidebar-raised: #101E40;
    --sidebar-active: #1B2A52;
    --sidebar-border: #22325C;
    --sidebar-avatar: #2B3C6B;
    --sidebar-text: #AEB9D1;
    --sidebar-muted: #8391B0;

    --border: #E6E8EC;
    --divider: #EEF0F3;
    --border-strong: #D5D9E0;

    --text: #0E1526;
    --text-secondary: #5B6477;
    --text-tertiary: #4B5468;

    --primary: #1F4DBB;
    --primary-hover: #173A8F;
    --link: #1F4DBB;
    --link-hover: #173A8F;
    --primary-soft: #EBF0FB;
    --primary-border: #C9D6F3;

    --success-bg: #E7F6EE;  --success: #0F7B4F;
    --warning-bg: #FFF4E0;  --warning: #935400;
    --danger-bg: #FDECEA;   --danger: #B42318;
    --neutral-bg: #EEF0F3;  --neutral: #4B5468;
    --orange-bg: #FFEDE3;   --orange: #B93C0A;

    --row-selected: #F3F6FD;
    --segmented-bg: #EAECF0;
    --control-border: #B8BFCC;
    --mark-bg: #FFE9A8;
    --warning-border: #F3D199;

    /* Signals: identical in both themes */
    --signal-critical: #D92D20;
    --signal-attention: #D97706;
    --signal-healthy: #12B76A;
    --signal-incomplete: #98A2B3;

    --radius: 8px;
    --radius-card: 12px;
    --radius-dialog: 14px;
    --sidebar-width: 248px;
    --shadow-float: 0 12px 32px rgba(14, 21, 38, 0.14), 0 2px 6px rgba(14, 21, 38, 0.06);

    --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

    color-scheme: light;
}

:root[data-theme='dark'] {
    --bg: #0B1120;
    --surface: #131B2E;
    --surface-subtle: #0F1727;
    --surface-muted: #1B2438;
    --sidebar: #070C18;
    --sidebar-raised: #0E1628;
    --sidebar-active: #18223A;
    --sidebar-border: #18223A;
    --sidebar-avatar: #22304F;

    --border: #222C42;
    --divider: #1B2438;
    --border-strong: #2E3A54;

    --text: #E7EBF3;
    --text-secondary: #98A3BA;
    --text-tertiary: #AAB4C8;

    --link: #8FB0FF;
    --link-hover: #B5C8FF;
    --primary-soft: #172447;
    --primary-border: #2C4787;

    --success-bg: #0E2A20;  --success: #4ADE9A;
    --warning-bg: #2E2210;  --warning: #F5B454;
    --danger-bg: #351719;   --danger: #F59189;
    --neutral-bg: #1B2438;  --neutral: #AAB4C8;
    --orange-bg: #35200F;   --orange: #FB9A5B;

    --row-selected: #172447;
    --segmented-bg: #0F1727;
    --control-border: #46526B;
    --mark-bg: #5A4712;
    --warning-border: #5C4418;

    --shadow-float: 0 12px 32px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);

    color-scheme: dark;
}

/* -----------------------------------------------------------------------------
   MudBlazor palette → tokens.
   MudThemeProvider emits its own :root block, but on [ExcludeFromInteractiveRouting]
   pages (Identity) it always emits the *light* palette. Re-pointing the palette
   variables at the tokens here (higher specificity than plain :root) makes every
   page follow `data-theme`, interactive or not. The MudTheme palettes in
   MainLayout.razor hold the same values, so interactive pages agree either way.
   ----------------------------------------------------------------------------- */
:root[data-theme] {
    --mud-palette-background: var(--bg);
    --mud-palette-background-gray: var(--surface-muted);
    --mud-palette-surface: var(--surface);
    --mud-palette-drawer-background: var(--sidebar);
    --mud-palette-drawer-text: var(--sidebar-text);
    --mud-palette-drawer-icon: var(--sidebar-text);
    --mud-palette-appbar-background: var(--surface);
    --mud-palette-appbar-text: var(--text);
    --mud-palette-text-primary: var(--text);
    --mud-palette-text-secondary: var(--text-secondary);
    --mud-palette-lines-default: var(--border);
    --mud-palette-lines-inputs: var(--border-strong);
    --mud-palette-table-lines: var(--divider);
    --mud-palette-divider: var(--divider);
    --mud-palette-divider-light: var(--divider);
    --mud-palette-skeleton: var(--surface-muted);
    --mud-typography-default-family: var(--font);
    --mud-default-borderradius: var(--radius);
    --mud-drawer-width-left: var(--sidebar-width);
}

:root[data-theme='light'] {
    --mud-palette-primary: #1F4DBB;
    --mud-palette-primary-rgb: 31,77,187;
    --mud-palette-primary-text: #FFFFFF;
    --mud-palette-primary-darken: #173A8F;
    --mud-palette-primary-lighten: #3F68CC;
    --mud-palette-primary-hover: rgba(31,77,187,0.06);
    --mud-palette-secondary: #4B5468;
    --mud-palette-secondary-rgb: 75,84,104;
    --mud-palette-secondary-text: #FFFFFF;
    --mud-palette-secondary-darken: #3A4152;
    --mud-palette-secondary-lighten: #5E6880;
    --mud-palette-secondary-hover: rgba(75,84,104,0.06);
    --mud-palette-info: #1F4DBB;
    --mud-palette-info-rgb: 31,77,187;
    --mud-palette-info-text: #FFFFFF;
    --mud-palette-info-darken: #173A8F;
    --mud-palette-info-lighten: #3F68CC;
    --mud-palette-info-hover: rgba(31,77,187,0.06);
    --mud-palette-success: #0F7B4F;
    --mud-palette-success-rgb: 15,123,79;
    --mud-palette-success-text: #FFFFFF;
    --mud-palette-success-darken: #0B5E3C;
    --mud-palette-success-lighten: #13985F;
    --mud-palette-success-hover: rgba(15,123,79,0.06);
    --mud-palette-warning: #935400;
    --mud-palette-warning-rgb: 147,84,0;
    --mud-palette-warning-text: #FFFFFF;
    --mud-palette-warning-darken: #7A4600;
    --mud-palette-warning-lighten: #B06500;
    --mud-palette-warning-hover: rgba(147,84,0,0.06);
    --mud-palette-error: #B42318;
    --mud-palette-error-rgb: 180,35,24;
    --mud-palette-error-text: #FFFFFF;
    --mud-palette-error-darken: #912018;
    --mud-palette-error-lighten: #D92D20;
    --mud-palette-error-hover: rgba(180,35,24,0.06);
    --mud-palette-text-primary-rgb: 14,21,38;
    --mud-palette-text-disabled: rgba(14,21,38,0.38);
    --mud-palette-action-default: #5B6477;
    --mud-palette-action-default-hover: rgba(14,21,38,0.05);
    --mud-palette-action-disabled: rgba(14,21,38,0.26);
    --mud-palette-action-disabled-background: rgba(14,21,38,0.08);
    --mud-palette-table-hover: rgba(14,21,38,0.03);
    --mud-palette-table-striped: rgba(14,21,38,0.02);
    --mud-palette-divider-rgb: 238,240,243;
    --mud-palette-overlay-dark: rgba(14,21,38,0.5);
}

:root[data-theme='dark'] {
    /* Filled buttons stay brand blue with white text; blue *text* becomes #8FB0FF. */
    --mud-palette-primary: #1F4DBB;
    --mud-palette-primary-rgb: 31,77,187;
    --mud-palette-primary-text: #FFFFFF;
    --mud-palette-primary-darken: #8FB0FF;
    --mud-palette-primary-lighten: #3F68CC;
    --mud-palette-primary-hover: rgba(143,176,255,0.1);
    --mud-palette-secondary: #AAB4C8;
    --mud-palette-secondary-rgb: 170,180,200;
    --mud-palette-secondary-text: #0B1120;
    --mud-palette-secondary-darken: #98A3BA;
    --mud-palette-secondary-lighten: #C3CBDA;
    --mud-palette-secondary-hover: rgba(170,180,200,0.1);
    --mud-palette-info: #8FB0FF;
    --mud-palette-info-rgb: 143,176,255;
    --mud-palette-info-text: #0B1120;
    --mud-palette-info-darken: #6F97F5;
    --mud-palette-info-lighten: #B5C8FF;
    --mud-palette-info-hover: rgba(143,176,255,0.1);
    --mud-palette-success: #4ADE9A;
    --mud-palette-success-rgb: 74,222,154;
    --mud-palette-success-text: #0B1120;
    --mud-palette-success-darken: #2FC47F;
    --mud-palette-success-lighten: #7BE8B6;
    --mud-palette-success-hover: rgba(74,222,154,0.1);
    --mud-palette-warning: #F5B454;
    --mud-palette-warning-rgb: 245,180,84;
    --mud-palette-warning-text: #0B1120;
    --mud-palette-warning-darken: #E69C2F;
    --mud-palette-warning-lighten: #F8C97F;
    --mud-palette-warning-hover: rgba(245,180,84,0.1);
    --mud-palette-error: #F59189;
    --mud-palette-error-rgb: 245,145,137;
    --mud-palette-error-text: #0B1120;
    --mud-palette-error-darken: #F06B60;
    --mud-palette-error-lighten: #F8B3AD;
    --mud-palette-error-hover: rgba(245,145,137,0.1);
    --mud-palette-text-primary-rgb: 231,235,243;
    --mud-palette-text-disabled: rgba(231,235,243,0.38);
    --mud-palette-action-default: #98A3BA;
    --mud-palette-action-default-hover: rgba(231,235,243,0.06);
    --mud-palette-action-disabled: rgba(231,235,243,0.26);
    --mud-palette-action-disabled-background: rgba(231,235,243,0.1);
    --mud-palette-table-hover: rgba(231,235,243,0.04);
    --mud-palette-table-striped: rgba(231,235,243,0.02);
    --mud-palette-divider-rgb: 27,36,56;
    --mud-palette-overlay-dark: rgba(0,0,0,0.6);
}

/* =============================================================================
   Base
   ============================================================================= */
html, body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    font-size: 14px;
}

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

a:hover {
    color: var(--link-hover);
}

h1:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

:root[data-theme='dark'] :focus-visible {
    outline-color: var(--link);
}

/* Amounts, invoice numbers, usernames, times. */
.mono,
.app-mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.mud-typography,
.mud-button-root,
.mud-input,
.mud-table,
.mud-chip {
    font-family: var(--font);
}

/* =============================================================================
   MudBlazor restyle — keep the components, change the look.
   ============================================================================= */
.mud-typography-h4,
.mud-typography-h5 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

.mud-typography-h6 {
    font-weight: 600;
    font-size: 1.0625rem;
    letter-spacing: -0.01em;
}

.mud-typography-subtitle1,
.mud-typography-subtitle2 {
    font-weight: 600;
}

/* Cards use a border, not a shadow. Floating layers (menus, dialogs) keep one. */
.mud-paper {
    border-radius: var(--radius-card);
}

.mud-paper:not(.mud-popover):not(.mud-dialog):not(.mud-drawer):not(.mud-appbar):not(.mud-snackbar):not(.mud-alert) {
    border: 1px solid var(--border);
    box-shadow: none;
}

.mud-card {
    border-radius: var(--radius-card);
}

.mud-popover.mud-paper,
.mud-popover {
    border: 1px solid var(--border);
    box-shadow: var(--shadow-float);
    border-radius: var(--radius-card);
}

.mud-dialog {
    border-radius: var(--radius-dialog);
    box-shadow: var(--shadow-float);
}

.mud-button-root.mud-button {
    text-transform: none;
    font-weight: 500;
    letter-spacing: 0;
    border-radius: var(--radius);
    box-shadow: none;
}

.mud-button-filled {
    box-shadow: none !important;
}

.mud-button-outlined {
    border-color: var(--border-strong);
}

.mud-button-outlined.mud-button-outlined-default {
    color: var(--text);
    background: var(--surface);
}

/* Dark mode: MudBlazor uses --mud-palette-primary both as a fill and as a text colour.
   Fills stay brand blue; primary-coloured *text* switches to the lighter link blue. */
:root[data-theme='dark'] .mud-button-text.mud-button-text-primary,
:root[data-theme='dark'] .mud-button-outlined.mud-button-outlined-primary,
:root[data-theme='dark'] .mud-icon-button.mud-primary-text,
:root[data-theme='dark'] .mud-primary-text,
:root[data-theme='dark'] .mud-link.mud-primary-text,
:root[data-theme='dark'] .mud-tab.mud-tab-active,
:root[data-theme='dark'] .mud-chip-text.mud-chip-color-primary,
:root[data-theme='dark'] .mud-chip-outlined.mud-chip-color-primary {
    color: var(--link) !important;
}

:root[data-theme='dark'] .mud-button-outlined.mud-button-outlined-primary {
    border-color: var(--primary-border);
}

:root[data-theme='dark'] .mud-tabs-toolbar .mud-tab-slider,
:root[data-theme='dark'] .mud-tab-slider.mud-primary {
    background: var(--link);
}

.mud-chip {
    border-radius: 999px;
    font-weight: 500;
}

.mud-table-head .mud-table-cell {
    background: var(--surface-subtle);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
}

.mud-tab {
    text-transform: none;
    font-weight: 500;
    letter-spacing: 0;
}

.mud-alert {
    border-radius: var(--radius-card);
}

.mud-nav-link {
    white-space: nowrap;
}

/* =============================================================================
   App shell: navy sidebar (both themes), no top bar on desktop.
   ============================================================================= */
.mud-layout {
    background: var(--bg);
}

.mud-main-content {
    background: var(--bg);
    min-height: 100vh;
}

/* The top bar only exists below the md breakpoint (hamburger + logo). */
.app-topbar.mud-appbar {
    background: var(--surface);
    color: var(--text);
    border-bottom: 1px solid var(--border);
    box-shadow: none;
}

.app-topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14.5px;
}

/* Opens the search palette on phones and tablets, where the sidebar's search button sits in the closed drawer. */
.app-topbar-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: auto;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.app-topbar-search:hover {
    background: var(--surface-muted);
}

.app-topbar-search:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 2px;
}

.app-topbar-search .ui-icon {
    width: 20px;
    height: 20px;
}

@media (min-width: 960px) {
    .app-topbar.mud-appbar {
        display: none;
    }

    .mud-layout .mud-main-content.app-main {
        padding-top: 0;
    }

    .mud-layout .app-drawer.mud-drawer {
        top: 0;
        height: 100vh;
    }
}

.app-drawer.mud-drawer {
    background: var(--sidebar);
    color: var(--sidebar-text);
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.app-drawer .mud-drawer-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px 12px;
    gap: 2px;
    overflow-x: hidden;
    overflow-y: auto;
}

.app-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 16px;
    color: #FFFFFF;
    text-decoration: none;
}

.app-sidebar-brand:hover {
    color: #FFFFFF;
}

/* The logo always sits on a white tile so its blue stays visible. */
.app-logo-tile {
    width: 44px;
    height: 34px;
    object-fit: contain;
    background: #FFFFFF;
    border-radius: var(--radius);
    padding: 3px 4px;
    flex-shrink: 0;
}

.app-sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.app-sidebar-brand-name {
    font-weight: 600;
    font-size: 14.5px;
    color: #FFFFFF;
}

.app-sidebar-brand-role {
    font-size: 12px;
    color: var(--sidebar-muted);
}

.app-nav-menu.mud-navmenu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-nav-label {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sidebar-muted);
    padding: 0 10px;
    margin: 18px 0 6px;
}

.app-nav-label:first-child {
    margin-top: 4px;
}

/* Thin divider between the daily pages and the rest. */
.app-nav-rule {
    height: 1px;
    margin: 8px 10px;
    background: var(--sidebar-active);
}

/* A hub entry (Billing, Time, System) stays highlighted on every page of its tabs; MudNavLink only knows its own Href. */
.app-drawer .app-nav-menu.mud-navmenu .app-nav-link.is-hub-active .mud-nav-link {
    background: var(--sidebar-active);
    color: #FFFFFF;
}

.app-nav-link.is-hub-active .mud-nav-link .mud-nav-link-icon {
    color: #FFFFFF;
}

/* Tab strip at the top of every hub page. */
.adm-hub-tabs {
    margin-bottom: -6px;
}

.app-nav-link .mud-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 0 10px;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.2;
}

.app-nav-link .mud-nav-link .mud-nav-link-icon {
    color: inherit;
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin: 0;
}

.app-nav-link .mud-nav-link .mud-nav-link-text {
    margin: 0;
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: 0;
}

.app-drawer .app-nav-menu.mud-navmenu .app-nav-link .mud-nav-link:hover:not(.mud-nav-link-disabled) {
    color: #FFFFFF;
    background: var(--sidebar-raised);
}

/* Prefixed to out-rank MudBlazor's .mud-navmenu-default active/hover rules. */
.app-drawer .app-nav-menu.mud-navmenu .app-nav-link .mud-nav-link.active:not(.mud-nav-link-disabled),
.app-drawer .app-nav-menu.mud-navmenu .app-nav-link .mud-nav-link.active:not(.mud-nav-link-disabled):hover:not(.mud-nav-link-disabled) {
    background: var(--sidebar-active);
    color: #FFFFFF;
}

.app-nav-link .mud-nav-link.active .mud-nav-link-icon {
    color: #FFFFFF;
}

.app-nav-link .mud-nav-link:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: -2px;
}

.app-nav-spacer {
    flex-grow: 1;
    min-height: 16px;
}

/* ---- Collapsible sidebar (desktop only): data-sidebar="collapsed" on <html> shows icons only.
        Set by app-init.js (cookie) and rendered by App.razor. Below 960px the drawer is an overlay
        and the toggle is hidden. ------------------------------------------------------------- */
.app-sidebar-toggle {
    display: none;
}

@media (min-width: 960px) {
    .app-sidebar-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
    }

    .app-sidebar-head .app-sidebar-brand {
        flex-grow: 1;
        min-width: 0;
    }

    .app-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 32px;
        height: 32px;
        margin: 6px 0 0;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: var(--sidebar-muted);
        cursor: pointer;
    }

    .app-sidebar-toggle:hover {
        background: var(--sidebar-raised);
        color: #FFFFFF;
    }

    .app-sidebar-toggle:focus-visible {
        outline: 2px solid var(--link);
        outline-offset: 2px;
    }

    .app-sidebar-toggle .ui-icon {
        width: 18px;
        height: 18px;
    }

    :root[data-sidebar='collapsed'] {
        --sidebar-width: 72px;
    }

    :root[data-sidebar='collapsed'] .app-drawer .mud-drawer-content {
        padding-left: 12px;
        padding-right: 12px;
    }

    :root[data-sidebar='collapsed'] .app-sidebar-head {
        flex-direction: column;
        align-items: center;
    }

    :root[data-sidebar='collapsed'] .app-sidebar-brand {
        justify-content: center;
        padding: 4px 0 8px;
    }

    :root[data-sidebar='collapsed'] .app-sidebar-toggle {
        margin: 0 0 12px;
    }

    /* Text goes, but stays available to screen readers. */
    :root[data-sidebar='collapsed'] .app-sidebar-brand-text,
    :root[data-sidebar='collapsed'] .app-search-label,
    :root[data-sidebar='collapsed'] .app-search-btn .app-kbd,
    :root[data-sidebar='collapsed'] .app-nav-link .mud-nav-link-text,
    :root[data-sidebar='collapsed'] .app-usermenu-who,
    :root[data-sidebar='collapsed'] .app-usermenu-chevron,
    :root[data-sidebar='collapsed'] .app-org-text,
    :root[data-sidebar='collapsed'] .app-org-chevron {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    :root[data-sidebar='collapsed'] .app-nav-label {
        height: 1px;
        margin: 10px 8px;
        padding: 0;
        overflow: hidden;
        font-size: 0;
        background: var(--sidebar-active);
    }

    :root[data-sidebar='collapsed'] .app-nav-label:first-child {
        display: none;
    }

    :root[data-sidebar='collapsed'] .app-nav-rule {
        margin: 10px 8px;
    }

    :root[data-sidebar='collapsed'] .app-nav-link .mud-nav-link {
        justify-content: center;
        padding: 0;
        position: relative;
    }

    /* The count becomes a small dot on the icon. */
    :root[data-sidebar='collapsed'] .app-nav-link .app-nav-count {
        position: absolute;
        top: 4px;
        right: 8px;
        min-width: 8px;
        width: 8px;
        height: 8px;
        padding: 0;
        margin: 0;
        font-size: 0;
    }

    :root[data-sidebar='collapsed'] .app-search-btn,
    :root[data-sidebar='collapsed'] .app-org > summary,
    :root[data-sidebar='collapsed'] .app-usermenu > summary {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    /* The panels are wider than the icon rail and the drawer content clips overflow, so they are
       fixed to the viewport and open to the right of the rail. */
    :root[data-sidebar='collapsed'] .app-usermenu-panel,
    :root[data-sidebar='collapsed'] .app-org .app-menu-panel {
        position: fixed;
        left: calc(var(--sidebar-width) + 8px);
        right: auto;
        width: 240px;
    }

    :root[data-sidebar='collapsed'] .app-usermenu-panel {
        bottom: 12px;
    }

    /* No top/bottom: a fixed box keeps the vertical position it would have had. */
    :root[data-sidebar='collapsed'] .app-org .app-menu-panel {
        top: auto;
    }
}

/* ---- User block + menu (a native <details>, so it also works on the
        non-interactive Identity pages without a Blazor circuit) ---------- */
.app-usermenu {
    position: relative;
    margin-top: 8px;
    border-top: 1px solid var(--sidebar-active);
    padding-top: 8px;
}

.app-usermenu > summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    color: #FFFFFF;
}

.app-usermenu > summary::-webkit-details-marker {
    display: none;
}

.app-usermenu > summary:hover,
.app-usermenu[open] > summary {
    background: var(--sidebar-raised);
}

.app-usermenu > summary:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: -2px;
}

.app-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sidebar-avatar);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 600;
    flex-shrink: 0;
}

.app-usermenu-who {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    flex-grow: 1;
    min-width: 0;
}

.app-usermenu-name {
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-usermenu-sub {
    color: var(--sidebar-muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-usermenu-chevron {
    color: var(--sidebar-muted);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.app-usermenu[open] .app-usermenu-chevron {
    transform: rotate(180deg);
}

.app-usermenu-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 6px);
    z-index: 1400;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-float);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-usermenu-heading {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 8px 10px 4px;
}

.app-usermenu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 13.5px;
    text-align: left;
    justify-content: flex-start;
    text-decoration: none;
    cursor: pointer;
}

.app-usermenu-item:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.app-usermenu-item[aria-pressed='true'],
.app-usermenu-item[aria-current='true'] {
    color: var(--link);
    font-weight: 500;
}

.app-usermenu-item .mud-icon-root {
    font-size: 18px;
    color: var(--text-secondary);
}

.app-usermenu-item[aria-pressed='true'] .mud-icon-root,
.app-usermenu-item[aria-current='true'] .mud-icon-root {
    color: var(--link);
}

.app-usermenu-check {
    margin-left: auto;
}

.app-usermenu-segmented {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 2px 4px 6px;
}

.app-usermenu-segmented .app-usermenu-item {
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 50px;
    padding: 4px;
    font-size: 12px;
    text-align: center;
    border: 1px solid var(--border);
}

.app-usermenu-segmented .app-usermenu-item[aria-pressed='true'] {
    border-color: var(--primary-border);
    background: var(--primary-soft);
}

.app-usermenu-divider {
    height: 1px;
    background: var(--divider);
    margin: 4px 0;
}

.app-usermenu-version {
    font-size: 11.5px;
    color: var(--text-secondary);
    padding: 4px 10px 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Main content --------------------------------------------------------- */
.app-content-shell.mud-container {
    max-width: 1360px;
    padding: 32px 40px 48px;
}

@media (max-width: 959.98px) {
    .app-content-shell.mud-container {
        padding: 20px 16px 40px;
    }
}

.app-nudge {
    margin-bottom: 24px;
    align-items: center;
}

.app-nudge .ui-btn {
    flex-shrink: 0;
}

/* "Install as app" invitation. Hidden until app-init.js sets data-install-cta="show" on <html>.
   The inbox's "turn on notifications" hint (.notif-push-hint, data-push-hint="show") is the same banner. */
.app-install-cta,
.notif-push-hint {
    display: none;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding: 14px 12px 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: linear-gradient(90deg, var(--primary-soft), var(--surface) 70%);
}

:root[data-install-cta='show'] .app-install-cta,
:root[data-push-hint='show'] .notif-push-hint {
    display: flex;
}

.app-install-cta .ui-icon-tile,
.notif-push-hint .ui-icon-tile {
    flex-shrink: 0;
}

.app-install-cta-text,
.notif-push-hint-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-secondary);
}

.app-install-cta-text strong,
.notif-push-hint-text strong {
    font-size: 14px;
    color: var(--text);
}

.app-install-cta-go,
.notif-push-hint-go {
    flex-shrink: 0;
}

.app-install-cta-close,
.notif-push-hint-close {
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.app-install-cta-close:hover,
.notif-push-hint-close:hover {
    background: var(--primary-soft);
    color: var(--text);
}

.app-install-cta-close .ui-icon,
.notif-push-hint-close .ui-icon {
    width: 16px;
    height: 16px;
}

@media (max-width: 599.98px) {
    .app-install-cta,
    .notif-push-hint {
        flex-wrap: wrap;
        padding-right: 44px;
        position: relative;
    }

    .app-install-cta-text,
    .notif-push-hint-text {
        flex-basis: calc(100% - 60px);
    }

    .app-install-cta-go,
    .notif-push-hint-go {
        margin-left: 54px;
    }

    .app-install-cta-close,
    .notif-push-hint-close {
        position: absolute;
        top: 8px;
        right: 8px;
    }
}

/* "View as customer" banner: stays at the top while scrolling. */
.app-impersonation {
    position: sticky;
    top: 8px;
    z-index: 50;
    margin-bottom: 20px;
    align-items: center;
    box-shadow: var(--shadow-float);
}

.app-impersonation-form {
    margin: 0;
    flex-shrink: 0;
}

/* Running work-order timer: on every admin page, so a running timer is never forgotten. The whole bar is a link. */
.ui-banner.app-timer {
    position: sticky;
    top: 8px;
    z-index: 49;
    margin-bottom: 20px;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-color: var(--primary-border);
    background: var(--primary-soft);
    color: var(--link);
    text-decoration: none;
    transition: border-color 0.15s;
}

.ui-banner.app-timer:hover,
.ui-banner.app-timer:has(.app-timer-title:hover) {
    border-color: currentColor;
}

.ui-banner.app-timer:has(.app-timer-title:focus-visible) {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.ui-banner.app-timer.long {
    border-color: var(--warning-border);
    background: var(--warning-bg);
    color: var(--warning);
}

.app-timer-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-radius: 50%;
    background: currentColor;
    animation: app-timer-pulse 1.6s ease-in-out infinite;
}

@keyframes app-timer-pulse {
    50% { opacity: 0.3; }
}

@media (prefers-reduced-motion: reduce) {
    .app-timer-dot { animation: none; }
}

.app-timer-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-timer-title,
.app-timer-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-timer-title {
    font-weight: 600;
    font-size: 13.5px;
}

.app-timer-sub {
    font-size: 12px;
    opacity: 0.85;
}

.app-timer-clock {
    flex-shrink: 0;
    font-weight: 600;
    font-size: 16px;
}

.app-timer-title {
    color: inherit;
    text-decoration: none;
}

.app-timer-title::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.app-timer-title:hover {
    text-decoration: none;
}

.ui-banner.app-timer .app-timer-stop {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    background: var(--surface);
}

.adm-aside-work {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* Work orders: a two-column page (timer, sessions and summary on the left; billing rail on the right). */
.wo-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 20px;
    align-items: start;
}

.wo-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.wo-rail {
    position: sticky;
    top: 16px;
    min-width: 0;
}

@media (max-width: 1199.98px) {
    .wo-layout { grid-template-columns: minmax(0, 1fr); }
    .wo-rail { position: static; }
}

.wo-eyebrow {
    margin: 0;
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.wo-pulse {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
    flex-shrink: 0;
}

@media (prefers-reduced-motion: no-preference) {
    .wo-pulse { animation: wo-pulse 1.8s ease-in-out infinite; }
    @keyframes wo-pulse {
        50% { box-shadow: 0 0 0 7px transparent; }
    }
}

/* The timer card: the labor product first, then a big clock and one big action. */
.wo-hero {
    overflow: hidden;
}

.wo-hero.running {
    border-color: var(--primary-border);
    background: linear-gradient(180deg, var(--primary-soft), var(--surface) 62%);
}

.wo-hero-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 22px 26px 20px;
}

.wo-labor {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 460px;
}

.wo-labor.empty .wo-labor-label {
    color: var(--warning);
}

.wo-labor-label {
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.wo-labor-name {
    font-size: 17px;
    font-weight: 600;
}

.wo-labor-select {
    min-height: 44px;
    font-size: 15px;
    font-weight: 600;
}

.wo-clock-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    flex-wrap: wrap;
}

.wo-clock {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wo-clock-time {
    font-size: 68px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.03em;
}

.wo-hero.done .wo-clock-time {
    color: var(--text-tertiary);
}

.wo-clock-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

.wo-clock-sub strong {
    color: var(--text);
    font-family: var(--font-mono);
    font-weight: 500;
}

.wo-clock-sub .ui-icon {
    width: 14px;
    height: 14px;
}

.wo-main-action {
    min-width: 176px;
    min-height: 52px;
    padding: 0 26px;
    border-radius: 12px;
    font-size: 15.5px;
}

.wo-when {
    display: flex;
    align-items: center;
    gap: 8px 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--primary-border);
}

.wo-hero:not(.running) .wo-when {
    border-top-color: var(--border);
}

.wo-when-text {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.wo-when-text strong {
    color: var(--text);
    font-family: var(--font-mono);
}

.wo-nudges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex-grow: 1;
}

.wo-nudge-edit {
    margin-left: auto;
}

.wo-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--divider);
    background: var(--surface);
}

.wo-stats > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 26px;
}

.wo-stats > div + div {
    border-left: 1px solid var(--divider);
}

.wo-figure-label {
    display: block;
    color: var(--text-secondary);
    font-size: 12.5px;
}

.wo-figure-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
}

/* Sessions as a timeline. */
.wo-sessions {
    margin: 0;
    padding: 0;
    list-style: none;
}

.wo-session {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    border-top: 1px solid var(--divider);
}

.wo-session:first-child {
    border-top: 0;
}

.wo-session.live {
    background: var(--row-selected);
}

.wo-session-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--control-border);
    background: var(--surface);
    flex-shrink: 0;
}

.wo-session.live .wo-session-dot {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.wo-session-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-grow: 1;
    min-width: 0;
}

.wo-session-times {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 13.5px;
    font-weight: 500;
}

.wo-session-note {
    color: var(--text-secondary);
    font-size: 12.5px;
}

.wo-session-duration {
    min-width: 64px;
    text-align: right;
    font-weight: 600;
}

.wo-session-actions {
    display: flex;
    gap: 2px;
    min-width: 64px;
    justify-content: flex-end;
}

/* Summary. */
.wo-summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 16px;
}

.wo-internal {
    background: var(--surface-subtle);
}

.wo-summary-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.wo-spacer {
    flex-grow: 1;
}

/* Billing rail. */
.wo-billing-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px 4px;
}

.wo-billing-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 12px 20px 20px;
}

.wo-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.wo-tile {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--bg);
}

.wo-steps {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wo-step {
    position: relative;
    display: flex;
    gap: 12px;
    padding-bottom: 18px;
}

.wo-step:last-child {
    padding-bottom: 0;
}

.wo-step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 9.5px;
    top: 24px;
    bottom: 4px;
    width: 1px;
    background: var(--border-strong);
}

.wo-step-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--border-strong);
    border-radius: 50%;
    flex-shrink: 0;
    color: transparent;
}

.wo-step.current .wo-step-mark {
    border-color: var(--primary);
}

.wo-step.done .wo-step-mark {
    border-color: transparent;
    background: var(--success-bg);
    color: var(--success);
}

.wo-step-mark .ui-icon {
    width: 12px;
    height: 12px;
    stroke-width: 2.5;
}

.wo-step-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
    min-width: 0;
}

.wo-step-title {
    font-size: 13.5px;
    font-weight: 600;
}

.wo-lines-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.wo-lines {
    margin: -8px 0 0;
    padding: 0;
    list-style: none;
}

.wo-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid var(--divider);
}

.wo-line:first-child {
    border-top: 0;
}

.wo-line-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-grow: 1;
    min-width: 0;
}

.wo-line-title {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13.5px;
    font-weight: 500;
}

.wo-line-calc {
    font-size: 12px;
}

.wo-line-total {
    font-weight: 500;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Every line reserves the room of its two buttons (also the labor line, which has none), so the amounts
   stay in one column; the totals box below has the same inner edge. */
.wo-line-actions {
    display: flex;
    justify-content: flex-end;
    flex: none;
    width: 62px;
}

.wo-line {
    padding-inline: 14px;
}

/* While the lines have their button column, the totals leave the same room so every amount shares one right edge. */
.wo-totals.with-actions {
    padding-right: 86px;
}

.wo-totals .mono {
    font-variant-numeric: tabular-nums;
}

.wo-totals {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--bg);
}

.wo-totals > div {
    display: flex;
    gap: 24px;
    justify-content: space-between;
}

.wo-totals dt {
    color: var(--text-secondary);
    font-size: 12.5px;
}

.wo-totals dd {
    margin: 0;
}

.wo-totals .strong {
    padding-top: 6px;
    border-top: 1px solid var(--border-strong);
}

.wo-totals .strong dt,
.wo-totals .strong dd {
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
}

.wo-finalize {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--divider);
    border-radius: 0 0 var(--radius-card) var(--radius-card);
    background: var(--surface-subtle);
}

.wo-finalize-btn {
    min-height: 42px;
}

.wo-blockers {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
}

.wo-blockers li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wo-product-pick {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wo-product-pick .ui-select {
    flex-grow: 1;
    min-width: 0;
}

.wo-edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

/* The list. */
.wo-list-clock {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.wo-refreshing {
    opacity: 0.6;
    transition: opacity 0.15s;
}

.wo-list-row.running {
    background: var(--row-selected);
}

.wo-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--primary-soft);
    color: var(--link);
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.wo-list-time {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 84px;
    font-weight: 500;
}

.wo-list-status {
    display: flex;
    justify-content: flex-end;
    min-width: 140px;
}

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

@media (max-width: 599.98px) {
    .wo-hero-body { padding: 18px 18px 16px; }
    .wo-clock-time { font-size: 52px; }
    /* On a phone the one action sticks to the bottom, above the tab bar. */
    .wo-main-action {
        position: sticky;
        bottom: calc(env(safe-area-inset-bottom) + 76px);
        z-index: 5;
        width: 100%;
        box-shadow: var(--shadow-float);
    }
    .wo-clock-row { flex-direction: column; align-items: stretch; }
    .wo-stats > div { padding: 12px 14px; }
    .wo-nudge-edit { margin-left: 0; }
    .wo-list-status { min-width: 0; }
    .wo-session { flex-wrap: wrap; padding: 12px 16px; }
    .wo-session-duration { min-width: 0; margin-left: auto; }
    .ui-banner.app-timer { top: 4px; }
}

.wo-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.wo-stat {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 16px 18px;
    text-align: left;
    font: inherit;
    color: inherit;
}

button.wo-stat {
    cursor: pointer;
}

.wo-stat.warn {
    border-color: var(--warning-border);
    background: var(--warning-bg);
}

.wo-stat-label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
}

.wo-stat.warn .wo-stat-label,
.wo-stat.warn .wo-stat-hint {
    color: var(--warning);
}

.wo-stat-value {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
}

.wo-stat-hint {
    color: var(--text-secondary);
    font-size: 12px;
}

.wo-list-amount {
    min-width: 92px;
    text-align: right;
}

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

@media (max-width: 599.98px) {
    .wo-list-amount { display: none; }
    .wo-stat { padding: 14px; }
    .wo-stat-value { font-size: 20px; }
}

.wo-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.wo-filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.wo-customer-filter {
    width: auto;
    min-width: 200px;
    margin-left: auto;
}

.wo-list-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    font-size: 11.5px;
}

.wo-avatar-space {
    width: 36px;
    flex-shrink: 0;
}

.wo-list-head-title {
    flex-grow: 1;
}

.wo-list-head .wo-list-time,
.wo-list-head .wo-list-amount {
    justify-content: flex-end;
    text-align: right;
}

.wo-chevron,
.wo-chevron-space {
    display: inline-flex;
    width: 16px;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.wo-blockers li.done {
    color: var(--text-secondary);
}

.wo-blockers li .wo-step-mark {
    flex-shrink: 0;
}

.wo-blockers li.done .wo-step-mark {
    border-color: transparent;
    background: var(--success-bg);
    color: var(--success);
}

button.wo-stat:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

@media (max-width: 599.98px) {
    .wo-list-head,
    .wo-chevron-space { display: none; }
    .wo-customer-filter { width: 100%; margin-left: 0; }
}

/* Install action is pointless once running as an installed app. */
@media (display-mode: standalone) {
    .app-install-prompt {
        display: none !important;
    }
}

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

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

/* =============================================================================
   Sign-in shell (AuthLayout): form column + navy brand panel.
   ============================================================================= */
.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    background: var(--surface);
    color: var(--text);
}

.auth-column {
    display: flex;
    flex-direction: column;
    padding: 40px 56px;
    min-height: 100vh;
}

.auth-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.auth-logo {
    width: 88px;
    height: 66px;
    object-fit: contain;
}

/* Logo stays on a white tile in dark mode too. */
:root[data-theme='dark'] .auth-logo {
    background: #FFFFFF;
    border-radius: var(--radius-card);
    padding: 6px 8px;
}

.auth-top-actions {
    display: flex;
    gap: 8px;
}

.auth-pill {
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-tertiary);
    font: inherit;
    font-size: 12.5px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    text-decoration: none;
}

.auth-pill:hover {
    color: var(--text);
    border-color: var(--text-secondary);
}

.auth-pill .mud-icon-root {
    font-size: 16px;
}

/* One button, three icons: the one matching the current mode is shown. */
.app-theme-cycle .mud-icon-root {
    display: none;
}

:root:not([data-theme-mode]) .app-theme-cycle .app-theme-cycle-system,
:root[data-theme-mode='system'] .app-theme-cycle .app-theme-cycle-system,
:root[data-theme-mode='light'] .app-theme-cycle .app-theme-cycle-light,
:root[data-theme-mode='dark'] .app-theme-cycle .app-theme-cycle-dark {
    display: inline-block;
}

.auth-main {
    margin: auto;
    width: 100%;
    max-width: 380px;
    padding: 40px 0;
}

.auth-footer {
    color: var(--text-secondary);
    font-size: 12px;
    display: flex;
    gap: 16px;
}

.auth-panel {
    background: #0C1733;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 64px;
}

:root[data-theme='dark'] .auth-panel {
    background: var(--sidebar);
}

.auth-panel-dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(#22325C 1px, transparent 1px);
    background-size: 22px 22px;
}

.auth-panel-cards {
    position: absolute;
    left: 64px;
    right: 64px;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-panel-card {
    background: #FFFFFF;
    border-radius: var(--radius-card);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.auth-panel-card .mud-icon-root {
    color: #1F4DBB;
    font-size: 20px;
}

.auth-panel-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    background: #EBF0FB;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-panel-card-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.auth-panel-card-lines span {
    display: block;
    height: 8px;
    border-radius: 99px;
    background: #EEF0F3;
}

.auth-panel-card-lines span:first-child {
    background: #D5D9E0;
}

.auth-panel-card .auth-panel-chip {
    height: 22px;
    padding: 0 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.auth-panel-copy {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 520px;
}

.auth-panel-copy h2 {
    margin: 0;
    color: #FFFFFF;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.auth-panel-copy p {
    margin: 0;
    color: #AEB9D1;
    font-size: 15px;
    line-height: 1.55;
}

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

    .auth-panel {
        display: none;
    }

    .auth-column {
        padding: 32px 24px 28px;
    }

    .auth-logo {
        width: 80px;
        height: 60px;
    }

    .auth-main {
        margin: 24px 0 auto;
        max-width: none;
    }

    .auth-footer {
        justify-content: center;
        margin-top: 32px;
    }
}

/* ---- Auth page content ---------------------------------------------------- */
.auth-heading {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 22px;
}

.auth-heading h1,
.auth-main > h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.auth-heading p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.auth-main > h1 {
    margin-bottom: 12px;
}

.auth-main > h2,
.auth-main h2 {
    font-size: 17px;
    font-weight: 600;
}

.auth-main > p,
.auth-main p {
    color: var(--text-secondary);
    line-height: 1.55;
}

.auth-main hr {
    border: 0;
    border-top: 1px solid var(--divider);
    margin: 20px 0;
}

.auth-note {
    margin: 22px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

.auth-field-with-aside {
    position: relative;
}

.auth-forgot {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
}

.auth-error {
    margin-bottom: 18px;
}

/* =============================================================================
   Forms shared by the Identity pages (sign-in and Account/Manage).
   ============================================================================= */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-field label,
.login-field .auth-label-row > label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.login-input,
.form-control {
    width: 100%;
    box-sizing: border-box;
    height: 44px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    padding: 0 14px;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-input:disabled,
.form-control:disabled,
.form-control[readonly] {
    background: var(--surface-muted);
    color: var(--text-secondary);
}

.login-input:focus,
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* 16px keeps iOS Safari from zooming into a focused field; 48px is a comfortable tap target. */
@media (max-width: 959.98px) {
    .login-input,
    .form-control {
        height: 48px;
        font-size: 16px;
        border-radius: 12px;
    }

    .login-submit,
    .btn-primary,
    .btn-danger {
        height: 50px;
        border-radius: 12px;
        font-size: 16px;
    }
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: var(--text);
    cursor: pointer;
}

.login-remember input[type=checkbox],
.auth-main input[type=checkbox] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary);
}

.login-submit,
.btn-primary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 9px;
    background: var(--primary);
    color: #FFFFFF;
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.login-submit {
    width: 100%;
}

.login-submit:hover,
.btn-primary:hover {
    background: var(--primary-hover);
    color: #FFFFFF;
}

/* "Sign in with Microsoft" under the password form: a quiet outlined button next to the primary one. */
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    color: var(--text-secondary);
    font-size: 13px;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex-grow: 1;
    height: 1px;
    background: var(--divider);
}

.login-alt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 44px;
    padding: 0 18px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
}

.login-alt:hover {
    background: var(--surface-subtle);
}

.login-alt:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.login-alt .ui-icon {
    width: 18px;
    height: 18px;
}

.btn-danger {
    background: #B42318;
}

.btn-danger:hover {
    background: #912018;
    color: #FFFFFF;
}

.login-submit:focus-visible,
.btn-primary:focus-visible,
.btn-danger:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.btn.btn-primary,
.btn.btn-danger {
    border: 0;
    color: #FFFFFF;
    font-weight: 600;
}

.btn.btn-primary {
    background: var(--primary);
}

.btn.btn-primary:hover {
    background: var(--primary-hover);
}

.btn.btn-danger {
    background: #B42318;
}

.btn.btn-danger:hover {
    background: #912018;
}

.btn-lg {
    min-height: 44px;
    font-size: 14.5px;
}

.w-100 {
    width: 100%;
}

.btn-link,
.btn.btn-link {
    border: 0;
    background: transparent;
    padding: 0;
    min-height: 0;
    color: var(--link);
}

.form-floating {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Scaffolded Identity markup puts the <label> after the input; show it above. */
.form-floating > label {
    order: -1;
}

.form-floating > label,
.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.form-floating > .form-control::placeholder {
    color: transparent;
}

.checkbox label,
.form-check label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
}

.valid.modified:not([type=checkbox]) {
    outline: none;
    border-color: var(--success);
}

.invalid {
    outline: none;
    border-color: var(--danger) !important;
}

.validation-message,
.text-danger {
    color: var(--danger);
    font-size: 13px;
}

ul.validation-errors,
.validation-message ul {
    margin: 0;
    padding-left: 18px;
}

.alert {
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 13.5px;
    margin-bottom: 18px;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.alert-info {
    background: var(--primary-soft);
    color: var(--link);
}

.blazor-error-boundary {
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: var(--radius-card);
    padding: 1rem 1.25rem;
}

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

.darker-border-checkbox.form-check-input {
    border-color: var(--text-secondary);
}

/* ---- Account/Manage ------------------------------------------------------- */
.account-manage-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.account-manage-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 760px);
    gap: 40px;
    margin-top: 24px;
}

.account-manage-content.mud-paper {
    padding: 24px;
}

.account-manage-nav.mud-navmenu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-manage-nav .mud-nav-link {
    min-height: 36px;
    padding: 0 12px;
    border-radius: var(--radius);
    color: var(--text-tertiary);
    font-size: 13.5px;
    font-weight: 500;
    border: 1px solid transparent;
}

.account-manage-nav .mud-nav-link .mud-nav-link-text {
    margin-inline-start: 10px;
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: 0;
}

.account-manage-nav .mud-nav-link .mud-nav-link-icon {
    font-size: 18px;
    color: inherit;
}

.account-manage-layout .account-manage-nav.mud-navmenu .mud-nav-link:hover:not(.mud-nav-link-disabled) {
    background: var(--surface-muted);
    color: var(--text);
}

.account-manage-layout .account-manage-nav.mud-navmenu .mud-nav-link.active:not(.mud-nav-link-disabled),
.account-manage-layout .account-manage-nav.mud-navmenu .mud-nav-link.active:not(.mud-nav-link-disabled):hover:not(.mud-nav-link-disabled) {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

@media (max-width: 959.98px) {
    .account-manage-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        margin-top: 16px;
    }

    .account-manage-nav.mud-navmenu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .account-manage-content.mud-paper {
        padding: 18px;
    }
}

.account-manage-content .row {
    margin-left: 0;
    margin-right: 0;
}

.account-manage-content h3,
.account-manage-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px;
}

.account-manage-content p {
    color: var(--text-secondary);
    line-height: 1.55;
}

.manage-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 480px;
}

.manage-field-hint {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

select.login-input {
    appearance: auto;
    padding-right: 10px;
}

.manage-form .login-submit {
    width: auto;
    align-self: flex-start;
}

.manage-email-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.manage-email-input {
    flex: 1;
}

.manage-email-verified {
    color: var(--success);
    font-weight: 700;
    font-size: 1.1rem;
}

.manage-email-verify-btn {
    white-space: nowrap;
    font-size: 0.85rem;
    color: var(--link);
    text-decoration: underline;
    cursor: pointer;
}

/* =============================================================================
   Page-specific pieces kept from before the redesign (restyled in phase 2).
   ============================================================================= */

/* Billing account selector. The outer .mud-select wrapper is the flex item and
   defaults to min-width:auto, which overflows narrow viewports. */
.billing-selector-row .mud-select {
    min-width: 0;
    flex: 1 1 0%;
}

.billing-selector-select .mud-input-control-input-container {
    min-width: 0;
    width: 100%;
}

.billing-selector-select .mud-input.mud-select-input {
    min-width: 0;
    width: 100%;
}

.billing-selector-select .mud-input-adornment.mud-input-adornment-end {
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .billing-selector-row {
        flex-wrap: wrap;
    }

    .billing-selector-row .mud-select {
        width: 100%;
    }
}

/* Rompslomp "oninbaar" (uncollectable) status. */
.payment-status-oninbaar {
    background-color: var(--orange-bg) !important;
    color: var(--orange) !important;
}

.payment-status-oninbaar .mud-chip-icon,
.payment-status-oninbaar .mud-icon-root {
    color: var(--orange) !important;
}

/* =============================================================================
   Customer account switcher (sidebar) and nav counts
   ============================================================================= */
.app-org {
    position: relative;
    margin: 0 0 14px;
}

.app-org > summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--sidebar-border);
    background: var(--sidebar-raised);
    color: #FFFFFF;
}

.app-org > summary {
    cursor: pointer;
}

.app-org > summary::-webkit-details-marker {
    display: none;
}

.app-org > summary:hover,
.app-org[open] > summary {
    background: var(--sidebar-active);
}

.app-org > summary:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 2px;
}

.app-org-tile {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: var(--primary-soft);
    color: var(--link);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.app-org-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
    flex-grow: 1;
}

.app-org-name,
.app-org-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-org-name {
    font-size: 13px;
    font-weight: 500;
}

.app-org-sub {
    font-size: 11.5px;
    color: var(--sidebar-muted);
}

.app-org-chevron {
    width: 16px;
    height: 16px;
    color: var(--sidebar-muted);
    flex-shrink: 0;
}

.app-menu-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 1400;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-float);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: min(420px, 70vh);
    overflow-y: auto;
}

.app-menu-heading {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 8px 10px 4px;
}

.app-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 13.5px;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
}

.app-menu-item:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.app-menu-item[aria-current='true'] {
    color: var(--link);
    font-weight: 500;
}

.app-menu-item-label {
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* In-page dropdown (e.g. the hosting account button): same panel, anchored to its trigger. */
.app-menu.ui-dropdown {
    position: relative;
    display: inline-block;
}

.app-menu.ui-dropdown > summary {
    list-style: none;
}

.app-menu.ui-dropdown > summary::-webkit-details-marker {
    display: none;
}

.app-menu.ui-dropdown .app-menu-panel {
    right: auto;
    min-width: 240px;
}

.app-nav-link .mud-nav-link .mud-nav-link-text {
    display: flex;
    align-items: center;
    flex-grow: 1;
    min-width: 0;
}

.app-nav-count {
    margin-left: auto;
    font-size: 11.5px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 99px;
    background: var(--primary);
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

/* =============================================================================
   UI kit (redesign phase 2): plain-HTML building blocks shared by the pages.
   Everything reads the tokens above, so both themes come for free.
   ============================================================================= */
.ui-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.ui-icon.lg {
    width: 20px;
    height: 20px;
}

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

.ui-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.ui-page-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ui-h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.ui-h1.lg {
    font-size: 26px;
}

.ui-h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}

.ui-h2.lg {
    font-size: 17px;
}

.ui-sub,
.ui-muted {
    color: var(--text-secondary);
}

.ui-sub {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.ui-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.ui-eyebrow {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.ui-small {
    font-size: 12.5px;
}

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

.ui-danger-text {
    color: var(--danger);
}

.ui-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    min-width: 0;
}

.ui-card.highlight {
    border-color: var(--primary-border);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.ui-card.warn {
    border-color: var(--warning-border);
}

.ui-card.clip {
    overflow: hidden;
}

.ui-card-pad {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ui-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
}

.ui-card-header.divided {
    border-bottom: 1px solid var(--divider);
}

/* A select as a header action (e.g. a status picker) keeps its natural width. */
.ui-card-header > .ui-select {
    width: auto;
    flex-shrink: 0;
}

.ui-card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    border-top: 1px solid var(--divider);
    background: var(--surface-subtle);
    border-radius: 0 0 var(--radius-card) var(--radius-card);
    flex-wrap: wrap;
}

.ui-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.ui-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    border-top: 1px solid var(--divider);
}

.ui-row:first-child {
    border-top: 0;
}

.ui-row-text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ui-row-title {
    font-size: 13.5px;
    font-weight: 500;
}

.ui-row-sub {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.ui-divided > * + * {
    border-top: 1px solid var(--divider);
}

/* A row that opens something (a link or button): the whole row is the target. */
.ui-row.clickable {
    width: 100%;
    color: inherit;
    text-decoration: none;
    text-align: left;
    font: inherit;
    background: none;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    cursor: pointer;
}

.ui-row.clickable:hover {
    background: var(--surface-subtle);
}

/* A conversation (support requests): the viewer's own messages sit on the right, tinted. */
.ui-thread {
    list-style: none;
    margin: 0;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ui-message {
    max-width: min(640px, 88%);
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface-subtle);
}

.ui-message.mine {
    align-self: flex-end;
    background: var(--primary-soft);
    border-color: var(--primary-border);
}

.ui-message-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.ui-message-author {
    font-weight: 600;
    color: var(--text);
}

.ui-message-body {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ui-thread-reply {
    border-top: 1px solid var(--divider);
}

/* Status chip: soft fill + strong text + always a label. */
.ui-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    background: var(--neutral-bg);
    color: var(--neutral);
    line-height: 1;
}

.ui-chip::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.ui-chip.plain::before {
    display: none;
}

.ui-chip .ui-icon {
    width: 13px;
    height: 13px;
}

.ui-chip.ok { background: var(--success-bg); color: var(--success); }
.ui-chip.warn { background: var(--warning-bg); color: var(--warning); }

.ui-chip.bad { background: var(--danger-bg); color: var(--danger); }
.ui-chip.info { background: var(--primary-soft); color: var(--link); }
.ui-chip.neu { background: var(--neutral-bg); color: var(--neutral); }
.ui-chip.orange { background: var(--orange-bg); color: var(--orange); }

.ui-count {
    font-size: 11.5px;
    padding: 0 6px;
    height: 18px;
    line-height: 18px;
    border-radius: 99px;
    background: var(--neutral-bg);
    color: var(--neutral);
    font-weight: 500;
    white-space: nowrap;
}

.ui-count.info {
    background: var(--primary-soft);
    color: var(--link);
}

.ui-tag {
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--surface-muted);
    color: var(--text);
}

/* Buttons for plain markup (MudButton keeps its own restyle above). */
.ui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border-radius: var(--radius);
    font: inherit;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}

.ui-btn:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.ui-btn:disabled,
.ui-btn[aria-disabled='true'] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.ui-btn.pri {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
}

.ui-btn.pri:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #FFFFFF;
}

:root[data-theme='dark'] .ui-btn.pri:hover {
    background: #3F68CC;
    border-color: #3F68CC;
}

.ui-btn.danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #FFFFFF;
}

:root[data-theme='dark'] .ui-btn.danger {
    background: #B42318;
    border-color: #B42318;
}

.ui-btn.danger-text {
    color: var(--danger);
}

.ui-btn.accent {
    border-color: var(--primary);
    color: var(--link);
    background: var(--row-selected);
}

:root[data-theme='dark'] .ui-btn.accent {
    border-color: var(--primary-border);
}

.ui-btn.ghost {
    border-color: transparent;
    background: transparent;
    color: var(--text-tertiary);
}

.ui-btn.ghost:hover {
    background: var(--surface-muted);
}

.ui-btn.sm {
    height: 30px;
    padding: 0 10px;
    font-size: 12.5px;
}

.ui-btn.icon {
    width: 36px;
    padding: 0;
}

.ui-btn.sm.icon {
    width: 30px;
}

.ui-btn.block {
    width: 100%;
}

.ui-btn.grow {
    flex-grow: 1;
}

/* Busy button/link (e.g. a PDF being fetched by app-init.js's data-download): its icon turns
   into a spinner and further clicks are ignored. */
.ui-btn[aria-busy='true'] {
    cursor: progress;
    pointer-events: none;
}

.ui-btn[aria-busy='true'] > .ui-icon:first-child {
    display: none;
}

.ui-btn[aria-busy='true']::before,
.ui-spinner {
    content: '';
    display: inline-block;
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: ui-spin 0.7s linear infinite;
}

@keyframes ui-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .ui-btn[aria-busy='true']::before,
    .ui-spinner {
        animation-duration: 2s;
    }
}

.ui-download-error {
    flex-basis: 100%;
    font-size: 12.5px;
    color: var(--danger);
}

td > .ui-download-error {
    display: block;
    margin-top: 4px;
}

.ui-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.ui-link-btn {
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--link);
    cursor: pointer;
}

.ui-link-btn:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Filter chips ("All 14", "Unpaid 1"). */
.ui-fchips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ui-fchip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border-radius: 99px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    font: inherit;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    white-space: nowrap;
}

.ui-fchip:hover {
    background: var(--surface-muted);
}

.ui-fchip[aria-pressed='true'] {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
}

.ui-fchip b {
    font-weight: 500;
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
}

/* Underlined tabs. */
.ui-tabs {
    display: flex;
    gap: 28px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    /* the tabs' -1px margin would otherwise overflow by 1px and give the bar a tiny vertical scroll */
    padding-bottom: 1px;
    scrollbar-width: none;
}

.ui-tabs::-webkit-scrollbar {
    display: none;
}

.ui-tab {
    height: 42px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: transparent;
    font: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
}

.ui-tab:hover {
    color: var(--text);
}

/* aria-selected for role="tab" buttons, aria-current for tabs that are links (the customer page). */
.ui-tab[aria-selected='true'],
.ui-tab[aria-current='page'] {
    color: var(--text);
    border-bottom-color: var(--primary);
}

:root[data-theme='dark'] .ui-tab[aria-selected='true'],
:root[data-theme='dark'] .ui-tab[aria-current='page'] {
    border-bottom-color: var(--link);
}

/* Segmented control (Upcoming / Past). */
.ui-seg {
    display: inline-flex;
    padding: 3px;
    background: var(--segmented-bg);
    border-radius: 9px;
    gap: 2px;
}

.ui-seg.block {
    display: flex;
}

.ui-seg button {
    height: 30px;
    padding: 0 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
}

.ui-seg.block button {
    flex: 1;
    height: 32px;
}

.ui-seg button[aria-selected='true'],
.ui-seg button[aria-pressed='true'] {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1);
}

/* Search field. */
.ui-search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    width: 260px;
    max-width: 100%;
    color: var(--text-secondary);
}

.ui-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.ui-search input {
    border: 0;
    outline: 0;
    font: inherit;
    font-size: 13px;
    flex-grow: 1;
    background: transparent;
    min-width: 0;
    color: var(--text);
}

.ui-search input::placeholder {
    color: var(--text-secondary);
}

.ui-search button {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    padding: 0;
    display: flex;
    cursor: pointer;
}

/* UiSearchBox: a lookup field (person, group, account) with the search button as the icon at its right end. */
.ui-search.ui-searchbox {
    width: 100%;
    padding: 0 4px 0 12px;
}

.ui-searchbox .ui-searchbox-btn {
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm, 6px);
    flex-shrink: 0;
}

.ui-searchbox .ui-searchbox-btn:hover:not(:disabled) {
    background: var(--primary-soft);
    color: var(--primary);
}

.ui-searchbox .ui-searchbox-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.ui-searchbox .ui-searchbox-btn[aria-busy='true'] {
    opacity: 0.6;
    cursor: progress;
}

.ui-searchbox-hint {
    margin: 6px 0 0;
}

.m365-person-search {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

mark.ui-mark {
    background: var(--mark-bg);
    color: inherit;
    border-radius: 2px;
}

/* Form fields for plain markup. */
.ui-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.ui-field > .ui-field-label {
    font-size: 13px;
    font-weight: 500;
}

.ui-field-hint {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.ui-input,
.ui-textarea,
.ui-select {
    height: 38px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 0 12px;
    font: inherit;
    font-size: 13.5px;
    color: var(--text);
    background: var(--surface);
    width: 100%;
}

.ui-textarea {
    height: auto;
    min-height: 110px;
    padding: 10px 12px;
    line-height: 1.5;
    resize: vertical;
}

.ui-input:focus,
.ui-textarea:focus,
.ui-select:focus {
    outline: 0;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Text with light formatting (bold/italic/underline/bullets, Domain LightMarkup): the toolbar over
   a Ui/UiFormattedTextArea, its preview, and the text rendered by Ui/FormattedText. */
.ui-format-bar {
    display: flex;
    gap: 4px;
}

.ui-format-bar .ui-btn {
    min-width: 32px;
    font-size: 13px;
}

/* The hint/preview under the textarea keeps one height whichever it shows, so the toolbar above it
   never moves under the pointer (a centred dialog would otherwise shift when the preview appears). */
.ui-format-aside {
    display: flex;
    flex-direction: column;
    height: 92px;
}

.ui-format-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
    padding: 8px 12px;
    overflow-y: auto;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-muted);
    font-size: 13.5px;
}

.ui-formatted {
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.ui-formatted ul {
    margin: 6px 0;
    padding-left: 20px;
    list-style: disc;
}

.ui-formatted ol {
    margin: 6px 0;
    padding-left: 22px;
    list-style: decimal;
}

.ui-formatted ul:first-child,
.ui-formatted ol:first-child {
    margin-top: 0;
}

.ui-formatted ul:last-child,
.ui-formatted ol:last-child {
    margin-bottom: 0;
}

.notif-preview-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.notif-email-frame {
    display: block;
    width: 100%;
    height: min(560px, 60vh);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
}

.notif-portal-preview {
    padding: 16px;
}

.notif-portal-preview > strong {
    display: block;
    margin-bottom: 6px;
}

.ui-formatted h3 {
    margin: 10px 0 4px;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 600;
}

.ui-formatted h3:first-child {
    margin-top: 0;
}

.ui-formatted a {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* A banner shows the first paragraph of an announcement, at most a few lines of it. */
.ui-formatted.notif-banner-body {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    overflow: hidden;
}

/* An announcement's body is light markup (lists, line breaks) rather than one pre-wrapped line of text. */
.ui-formatted.notif-body {
    white-space: normal;
}

.ui-formatted li {
    margin: 0 0 2px;
}

.ui-input[readonly] {
    background: var(--surface-muted);
    color: var(--text-tertiary);
}

.ui-input.mono {
    font-family: var(--font-mono);
}

/* The push status message (Account -> Notifications) is filled by app-init.js; its row only shows when it has text. */
.ui-row:has(> [data-push-status][hidden]),
[data-push-status][hidden] {
    display: none;
}

/* Custom checkbox / radio drawn over a real (visually hidden) input. */
.ui-check,
.ui-radio {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
}

.ui-check > input,
.ui-radio > input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.ui-check-box {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--control-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #FFFFFF;
    background: var(--surface);
}

.ui-check-box .ui-icon {
    width: 12px;
    height: 12px;
    visibility: hidden;
}

.ui-check > input:checked + .ui-check-box {
    background: var(--primary);
    border-color: var(--primary);
}

.ui-check > input:checked + .ui-check-box .ui-icon {
    visibility: visible;
}

.ui-check > input:focus-visible + .ui-check-box,
.ui-radio > input:focus-visible ~ .ui-radio-dot {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.ui-check > input:disabled + .ui-check-box {
    opacity: 0.5;
}

.ui-radio.card-option {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.ui-radio.card-option:has(> input:checked) {
    border-color: var(--primary);
    background: var(--row-selected);
    box-shadow: 0 0 0 1px var(--primary);
}

/* Radio cards (UiRadioCards): a single choice whose options have a description. */
.ui-radio-cards {
    display: grid;
    gap: 8px;
}

.ui-radio-cards.columns {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.ui-radio-cards .ui-row-text {
    flex: 1 1 auto;
}

.ui-radio-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    background: var(--surface-subtle);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ui-radio.card-option:has(> input:checked) .ui-radio-icon {
    background: var(--primary-soft);
    color: var(--link);
}

.ui-radio-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--control-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ui-radio > input:checked ~ .ui-radio-dot {
    border-color: var(--primary);
}

.ui-radio > input:checked ~ .ui-radio-dot::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

/* Usage meter. */
.ui-meter {
    height: 6px;
    border-radius: 99px;
    background: var(--neutral-bg);
    overflow: hidden;
}

.ui-meter > span {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: var(--primary);
}

.ui-meter.ok > span { background: var(--success); }
.ui-meter.warn > span { background: var(--signal-attention); }
.ui-meter.bad > span { background: var(--signal-critical); }

/* Tables. */
.ui-table-wrap {
    overflow-x: auto;
}

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

.ui-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0 16px;
    height: 36px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-subtle);
    white-space: nowrap;
}

.ui-table td {
    padding: 8px 16px;
    height: 54px;
    border-bottom: 1px solid var(--divider);
    font-size: 13.5px;
    vertical-align: middle;
}

.ui-table.compact td {
    height: 48px;
}

.ui-table tr:last-child td {
    border-bottom: 0;
}

.ui-table .r {
    text-align: right;
}

.ui-table td.mono,
.ui-table td > .mono {
    white-space: nowrap;
}

.ui-table tbody tr.clickable {
    cursor: pointer;
}

.ui-table tbody tr.clickable:hover td {
    background: var(--surface-subtle);
}

.ui-table tbody tr[aria-selected='true'] td {
    background: var(--row-selected);
}

.ui-table tbody tr[aria-selected='true'] td:first-child {
    box-shadow: inset 3px 0 0 var(--primary);
}

.ui-table .ui-cell-sub {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.ui-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-top: 1px solid var(--divider);
    font-size: 12.5px;
    color: var(--text-secondary);
}

/* Big date block (THU / 24 / SEP). */
.ui-date {
    width: 52px;
    min-height: 56px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    padding: 6px 0;
}

.ui-date.lg {
    width: 64px;
    padding: 10px 0;
}

.ui-date-dow,
.ui-date-month {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.ui-date-day {
    font-size: 20px;
    font-weight: 600;
}

.ui-date.lg .ui-date-day {
    font-size: 22px;
}

/* Label/value grid. */
.ui-kv {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    font-size: 13px;
}

.ui-kv > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ui-kv-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}

.ui-kv-list > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

/* A line of its own inside inline content (e.g. a username under a customer name in a table cell). */
.ui-block {
    display: block;
}

/* A field that shouldn't stretch across a wide card (a single select or short input). */
.ui-field.narrow {
    max-width: 420px;
}

/* Callouts. */
.ui-callout {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 12.5px;
    line-height: 1.45;
}

.ui-callout .ui-icon {
    margin-top: 1px;
}

.ui-callout.bad {
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 13px;
}

.ui-callout.warn {
    background: var(--warning-bg);
    color: var(--warning);
    font-size: 13px;
}

.ui-callout.info {
    background: var(--primary-soft);
    color: var(--link);
    font-size: 13px;
}

/* Banner across the top of a card ("Can't reach the billing system"). */
.ui-banner {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.45;
    border-radius: var(--radius-card);
    border: 1px solid var(--warning-border);
    background: var(--warning-bg);
    color: var(--warning);
}

.ui-banner.bad {
    border-color: var(--danger-bg);
    background: var(--danger-bg);
    color: var(--danger);
}

.ui-banner > span {
    flex-grow: 1;
}

.ui-banner .ui-btn {
    background: transparent;
    border-color: currentColor;
    color: inherit;
}

/* Empty / not-set-up states. */
.ui-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    padding: 40px 28px;
}

.ui-empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-muted);
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.ui-empty-icon.info {
    background: var(--primary-soft);
    color: var(--link);
}

.ui-empty-icon .ui-icon {
    width: 22px;
    height: 22px;
}

.ui-empty-title {
    font-size: 15px;
    font-weight: 600;
}

.ui-empty-text {
    font-size: 13px;
    line-height: 1.5;
    max-width: 340px;
    color: var(--text-secondary);
    margin: 0;
}

/* Loading skeleton. */
.ui-sk {
    height: 10px;
    border-radius: 6px;
    background: var(--neutral-bg);
    animation: ui-pulse 1.4s ease-in-out infinite;
}

.ui-sk.tall {
    height: 28px;
}

.ui-sk-rows {
    display: flex;
    flex-direction: column;
    padding: 6px 18px;
}

.ui-sk-rows > div {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 52px;
    border-bottom: 1px solid var(--divider);
}

.ui-sk-rows > div:last-child {
    border-bottom: 0;
}

@keyframes ui-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

/* Numbered step bullet. */
.ui-step {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--link);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ui-icon-tile {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--surface-muted);
    color: var(--text-tertiary);
}

.ui-icon-tile.round {
    border-radius: 50%;
}

.ui-icon-tile.ok { background: var(--success-bg); color: var(--success); }
.ui-icon-tile.warn { background: var(--warning-bg); color: var(--warning); }
.ui-icon-tile.bad { background: var(--danger-bg); color: var(--danger); }
.ui-icon-tile.info { background: var(--primary-soft); color: var(--link); }

.ui-icon-tile .ui-icon {
    width: 20px;
    height: 20px;
}

/* Side panel / sheet: a column on wide screens, a full-screen sheet on phones. */
.ui-sheet-backdrop {
    display: none;
}

@media (max-width: 959.98px) {
    .ui-sheet {
        position: fixed;
        inset: 0;
        z-index: 1300;
        border-radius: 0;
        border: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        background: var(--surface);
    }

    /* The page behind an open sheet mustn't scroll (on iOS it otherwise takes the swipe). */
    html:has(.ui-sheet),
    html:has(.ui-sheet) body {
        overflow: hidden;
    }
}

/* Modal dialog for plain markup (3-step restore). */
.ui-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1350;
    background: rgba(14, 21, 38, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.ui-modal {
    width: 440px;
    max-width: 100%;
    max-height: calc(100vh - 48px);
    background: var(--surface);
    color: var(--text);
    border-radius: 16px;
    box-shadow: var(--shadow-float);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ui-modal-head {
    padding: 20px 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-bottom: 1px solid var(--divider);
}

.ui-modal-body {
    padding: 16px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    flex-grow: 1;
}

.ui-modal-foot {
    padding: 14px 22px;
    border-top: 1px solid var(--divider);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.ui-progress-steps {
    display: flex;
    gap: 6px;
}

.ui-progress-steps span {
    height: 4px;
    flex: 1;
    border-radius: 99px;
    background: var(--border);
}

.ui-progress-steps span.on {
    background: var(--primary);
}

@media (max-width: 599.98px) {
    .ui-modal-backdrop {
        padding: 0;
        align-items: flex-end;
    }

    .ui-modal {
        width: 100%;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ui-sk {
        animation: none;
    }
}

/* =============================================================================
   Customer home
   ============================================================================= */
.home-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.home-card {
    min-height: 100%;
}

.home-card-action {
    margin-top: auto;
}

a.ui-btn.home-card-action,
button.ui-btn.home-card-action {
    width: 100%;
}

.home-card-empty {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.home-card-empty .ui-empty-text {
    max-width: none;
}

.home-amount {
    font-size: 34px;
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.home-invoice-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--divider);
}

.home-invoice-list > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--divider);
    font-size: 13px;
}

.home-invoice-list > div:last-child {
    border-bottom: 0;
}

.home-appointment {
    display: flex;
    gap: 14px;
    align-items: center;
}

.home-appointment-text,
.home-quotation-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.home-appointment-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.home-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-meter {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.home-meter-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.home-hosting-facts {
    border-top: 1px solid var(--divider);
    padding-top: 12px;
}

.home-lower {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.home-lower.single {
    grid-template-columns: minmax(0, 1fr);
}

.home-quotation-amount {
    font-size: 22px;
    font-weight: 500;
}

.home-quotation-amount .ui-muted {
    font-family: var(--font);
    font-size: 12.5px;
    font-weight: 400;
}

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

@media (max-width: 599.98px) {
    .hide-sm {
        display: none;
    }

    .home-amount {
        font-size: 28px;
    }
}

/* =============================================================================
   Billing (shared by /portal/invoices and /admin/invoices) and contact editor
   ============================================================================= */
.billing {
    gap: 20px;
}

.billing-head {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.billing-stats {
    display: flex;
    gap: 28px;
    margin: 0;
    flex-wrap: wrap;
}

.billing-stats > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-end;
}

.billing-stats dd {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

.billing-selector-row {
    max-width: 480px;
}

.billing-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.billing-body.with-detail {
    grid-template-columns: minmax(0, 1fr) 400px;
}

.billing-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.billing-toolbar {
    display: flex;
    align-items: center;
    gap: 8px 12px;
    flex-wrap: wrap;
}

.billing-result {
    margin-left: auto;
    font-size: 13px;
}

.billing-table td:first-child > .mono,
.billing-table td:first-child > .ui-cell-sub:not(.show-sm) {
    white-space: nowrap;
}

.ui-table .ui-cell-sub.show-sm {
    display: none;
}

/* A saved copy shown while the billing system is unreachable: readable, but visibly not live. */
.billing-saved .ui-table tbody {
    opacity: 0.8;
}

.billing-detail {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: sticky;
    top: 24px;
}

.billing-detail-section {
    padding: 16px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-bottom: 1px solid var(--divider);
}

.billing-detail-section:first-child {
    padding-top: 20px;
    gap: 14px;
}

.billing-detail-section:last-child {
    border-bottom: 0;
}

.billing-detail-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.billing-detail-amount {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.billing-detail-amount > .mono {
    font-size: 32px;
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.ui-kv .span-2 {
    grid-column: span 2;
}

.billing-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.billing-line .ui-cell-sub {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.billing-line > .mono {
    white-space: nowrap;
}

.billing-detail-section.ui-kv {
    display: grid;
}

.billing-line.total {
    padding-top: 10px;
    border-top: 1px dashed var(--border-strong);
    font-weight: 600;
}

.billing-attachment {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--divider);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 13px;
    text-decoration: none;
}

.billing-attachment:hover {
    background: var(--surface-subtle);
    color: var(--text);
}

.billing-attachment .ui-icon {
    color: var(--text-secondary);
}

.billing-attachment-name {
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.show-sm {
    display: none;
}

@media (max-width: 1279.98px) {
    .billing-body.with-detail {
        grid-template-columns: minmax(0, 1fr) 360px;
    }

    /* Narrow list next to the panel: the description moves under the invoice number. */
    .billing-body.with-detail .hide-sm {
        display: none;
    }

    .billing-body.with-detail .ui-table .ui-cell-sub.show-sm {
        display: block;
        white-space: normal;
    }

    .hide-md {
        display: none;
    }
}

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

    /* Full-screen sheet: it scrolls itself (the desktop column's overflow: hidden would cut off
       the totals row) and keeps the scroll from chaining to the page behind it. */
    .billing-detail {
        position: fixed;
        top: 0;
        overflow-x: hidden;
        overflow-y: auto;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .billing-stats > div {
        align-items: flex-start;
    }
}

@media (max-width: 599.98px) {
    .show-sm,
    .ui-table .ui-cell-sub.show-sm {
        display: block;
    }

    .billing-toolbar .ui-search {
        width: 100%;
    }

    .billing-toolbar .ui-fchips {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        max-width: 100%;
    }

    .billing-result {
        margin-left: 0;
    }

    .billing-stats {
        gap: 20px;
    }
}

/* Contact editor (Account settings → Company & billing details, admin Contact tab). */
.contact-section {
    padding: 20px 22px;
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 24px;
    border-top: 1px solid var(--divider);
}

.contact-section:first-child {
    border-top: 0;
}

.contact-section-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.45;
}

.contact-section-title {
    font-size: 14px;
    font-weight: 600;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.contact-grid .span-2 {
    grid-column: span 2;
}

.contact-error {
    padding: 0 22px 16px;
}

@media (max-width: 1279.98px) {
    .contact-section {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }
}

@media (max-width: 767.98px) {
    .contact-section {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        padding: 18px;
    }

    .contact-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .contact-grid .span-2 {
        grid-column: auto;
    }
}

/* =============================================================================
   Hosting (shared by /portal/hosting and /admin/hosting)
   ============================================================================= */
.hosting {
    gap: 20px;
}

.hosting-header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
}

.hosting-account-label {
    font-size: 13px;
}

.hosting-account-menu > summary {
    gap: 6px;
}

.hosting-health {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 22px;
    flex-wrap: wrap;
}

.hosting-health.bad {
    border-color: var(--danger);
    background: var(--danger-bg);
}

.hosting-health-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 260px;
    min-width: 0;
}

.hosting-health-title {
    font-size: 15px;
    font-weight: 600;
}

.hosting-health-issues {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-tertiary);
}

.hosting-health-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hosting-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) repeat(4, minmax(0, 0.6fr));
    gap: 16px;
}

.hosting-tile {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.hosting-tile.wide {
    gap: 10px;
}

.hosting-tile b {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.hosting-tile-limit {
    font-size: 14px;
    font-weight: 400;
}

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

.hosting-tile-value {
    font-size: 22px;
    font-weight: 500;
}

.hosting-tile-value .ui-muted {
    font-size: 14px;
}

.hosting-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.hosting-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.hosting-domain-name {
    font-weight: 500;
}

/* Admin Hosting: nameservers of all domains */
/* Admin: New customer wizard */
.newcust-card {
    max-width: 860px;
}

.newcust-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 24px 0;
}

.newcust-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px 24px;
}

.newcust-foot {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--divider);
}

.newcust-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.newcust-source {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--divider);
}

.parity-different td {
    background: var(--warning-bg);
}

.newcust-grid .ui-field.wide {
    grid-column: 1 / -1;
}

.newcust-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.newcust-section + .newcust-section {
    padding-top: 18px;
    border-top: 1px solid var(--divider);
}

.newcust-section > legend {
    padding: 0;
    margin-bottom: 4px;
}

.newcust-problems {
    margin: 0;
    padding-left: 18px;
}

.newcust-summary dd strong {
    font-weight: 600;
}

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

    .newcust-head, .newcust-body, .newcust-foot {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* Email tab: domain overview (where email arrives, catch-all, actions). The rows share the
   container's columns (subgrid), so the header lines up with rows of any action width. */
.hosting-maildomains {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.2fr) auto;
}

.hosting-maildomain {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    column-gap: 16px;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid var(--divider);
}

.hosting-maildomain.head {
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-top: 0;
}

.hosting-maildomain > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
}

.hosting-maildomain-name .ui-row-title {
    overflow-wrap: anywhere;
}

.hosting-maildomain-host {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

.hosting-maildomain > .hosting-maildomain-actions {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

@media (max-width: 720px) {
    .hosting-maildomains {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .hosting-maildomain {
        row-gap: 8px;
    }

    .hosting-maildomain.head {
        display: none;
    }

    .hosting-maildomain-name {
        grid-column: 1;
        grid-row: 1;
    }

    .hosting-maildomain > .hosting-maildomain-actions {
        grid-column: 2;
        grid-row: 1;
    }

    .hosting-maildomain > div[data-label] {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px 8px;
    }

    .hosting-maildomain > div[data-label]::before {
        content: attr(data-label);
        min-width: 110px;
        font-size: 12px;
        color: var(--text-secondary);
    }
}

.hosting-ns-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 20px 0;
}

.hosting-check-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex: 0 0 auto;
}

.hosting-ns-registrar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.hosting-ns-registrar-card {
    margin: 0 20px 12px;
}

.hosting-check-value.wrap {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
}

.hosting-ns-names {
    white-space: pre-line;
}

.hosting-ns-error {
    color: var(--danger);
}

.hosting-ns-fix-list {
    max-height: 200px;
    overflow-y: auto;
    margin: 0;
    padding-left: 18px;
}

.hosting-ns-filter {
    padding: 12px 20px;
}

.hosting-backup-row,
.hosting-task-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
}

.hosting-task-row {
    gap: 12px;
}

.hosting-site-url {
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hosting-site-url:hover {
    text-decoration: underline;
}

.hosting-sites-note {
    margin: 12px 20px;
}

/* Websites tab: WordPress sites, databases (HostingSitesPanel); DNS tab: subdomains (HostingDnsPanel). */
.hosting-card-count {
    margin-left: 8px;
    vertical-align: 2px;
}

.hosting-list-search {
    width: 220px;
    flex-shrink: 0;
}

.hosting-wp-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hosting-wp-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--divider);
}

.hosting-wp-row:last-child {
    border-bottom: 0;
}

.hosting-wp-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--primary-soft);
    color: var(--link);
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    font-size: 17px;
}

.hosting-wp-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.hosting-wp-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    min-width: 0;
}

.hosting-wp-title .ui-row-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hosting-wp-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 0;
    font-size: 12.5px;
    color: var(--text-secondary);
    min-width: 0;
}

.hosting-wp-meta > * + *::before {
    content: "\00b7";
    margin: 0 7px;
    color: var(--text-tertiary);
}

.hosting-wp-meta .hosting-site-url {
    color: var(--text-secondary);
    max-width: 100%;
}

.hosting-db-table td.mono {
    font-size: 12.5px;
}

.hosting-db-table .hosting-site-url {
    display: inline-block;
    max-width: 260px;
    vertical-align: middle;
    color: var(--text-secondary);
}

.hosting-db-size {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    min-width: 88px;
}

.hosting-db-size .ui-meter {
    width: 88px;
    height: 4px;
}

.hosting-sub-groups {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px 20px 16px;
}

.hosting-sub-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hosting-sub-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 8px;
}

.hosting-sub-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 7px 6px 7px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-subtle);
}

.hosting-sub-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.hosting-sub-name {
    color: var(--text);
    text-decoration: none;
    font-size: 13.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hosting-sub-name strong {
    font-weight: 600;
}

.hosting-sub-name span {
    color: var(--text-secondary);
}

.hosting-sub-name:hover strong {
    text-decoration: underline;
}

.hosting-sub-path {
    font-size: 11.5px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .hosting-wp-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .hosting-wp-row > .ui-btn {
        grid-column: 2;
        justify-self: start;
    }

    .hosting-list-search {
        width: 100%;
    }

    .hosting-db-table .hosting-db-site,
    .hosting-db-table .hosting-db-users {
        display: none;
    }
}

/* Hosting page tabs (HostingOverview). [hidden] has to win over the panels' own display. */
.hosting-tabs {
    margin-top: 4px;
}

.hosting-tabs .ui-tab .ui-icon {
    width: 15px;
    height: 15px;
}

.hosting-tab-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hosting-tab-stack[hidden],
[role='tabpanel'][hidden] {
    display: none !important;
}

/* Subdomains & DNS (HostingDnsPanel) */
.hosting-dns-header {
    align-items: flex-start;
    gap: 16px;
}

.hosting-dns-header > div:first-child {
    min-width: 0;
}

.hosting-dns-header .ui-muted,
.hosting-tab-stack .ui-card-header .ui-muted {
    margin: 2px 0 0;
}

.hosting-dns-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.hosting-dns-actions .ui-select {
    width: auto;
    max-width: 220px;
    height: 32px;
}

.hosting-dns-table td {
    vertical-align: top;
}

/* `.ui-table td.mono` is nowrap, which let long names/values (DKIM keys, _domainkey CNAMEs) run out of
   the table and under the delete button; these two columns wrap anywhere instead. */
.ui-table td.hosting-dns-name {
    white-space: normal;
    overflow-wrap: anywhere;
    min-width: 120px;
    max-width: 260px;
    font-size: 12.5px;
}

.ui-table td.hosting-dns-value {
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 12.5px;
    width: 100%;
}

/* A margin, not a space: Razor drops the whitespace-only text between the two, which rendered "0mail.example". */
.hosting-dns-priority {
    margin-right: 8px;
}

.hosting-dns-lock {
    display: inline-flex;
    color: var(--text-tertiary);
    padding: 6px;
}

.hosting-dns-lock .ui-icon {
    width: 14px;
    height: 14px;
}

.hosting-dns-input {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

.hosting-dns-input:focus-within {
    border-color: var(--primary);
}

.hosting-dns-input > .ui-input {
    border: 0;
    border-radius: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.hosting-dns-input > .ui-select {
    border: 0;
    border-left: 1px solid var(--border);
    border-radius: 0;
    width: auto;
    max-width: 55%;
}

/* Websites tab: database management (HostingDatabasesCard), redirects (HostingRedirectsCard), PHP settings. */
.hosting-db-prefix {
    padding-right: 0;
    max-width: 45%;
}

.hosting-db-prefix + .ui-input {
    padding-left: 2px;
}

.hosting-db-subhead {
    margin: 18px 0 6px;
}

.hosting-db-subhead:first-of-type {
    margin-top: 4px;
}

.hosting-db-list {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.hosting-db-list > li + li {
    border-top: 1px solid var(--divider);
}

.hosting-db-list-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 6px 6px 12px;
    min-width: 0;
}

.hosting-db-list-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.hosting-db-inline {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px 12px;
    background: var(--surface-subtle);
    border-top: 1px solid var(--divider);
}

.hosting-db-inline.column {
    flex-direction: column;
    align-items: stretch;
}

.hosting-db-inline .hosting-db-password {
    flex: 1 1 260px;
    margin: 0;
}

.hosting-db-privs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 6px 12px;
    font-size: 12px;
}

.hosting-db-add {
    display: flex;
    gap: 8px;
    align-items: center;
}

.hosting-db-add > :first-child {
    flex: 1;
    min-width: 0;
}

.hosting-db-credentials {
    margin: 4px 0 10px;
}

.hosting-db-file {
    padding-top: 7px;
    height: auto;
    min-height: 38px;
}

.hosting-db-tables {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 320px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.hosting-db-tables > li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 12px;
    font-size: 12.5px;
}

.hosting-db-tables > li + li {
    border-top: 1px solid var(--divider);
}

.hosting-db-tables .ui-chip {
    max-width: 55%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hosting-redirect-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hosting-redirect-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--divider);
}

.hosting-redirect-row:last-child {
    border-bottom: 0;
}

.hosting-redirect-main {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px 8px;
    flex: 1;
    min-width: 0;
    font-size: 13px;
}

.hosting-redirect-from {
    font-size: 12.5px;
    overflow-wrap: anywhere;
}

.hosting-redirect-arrow {
    color: var(--text-tertiary);
}

.hosting-redirect-to {
    color: var(--text-secondary);
    max-width: 100%;
}

.hosting-redirect-confirm {
    display: inline-flex;
    gap: 6px;
}

.hosting-account-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.hosting-php-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

/* Hosting plans and upgrades: the admin plan card (HostingSubscriptionCard) and the customer's upgrade card. */
.hosting-plan-card,
.hosting-upgrade-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
}

.hosting-plan-card .ui-actions,
.hosting-upgrade-card .ui-actions {
    flex-wrap: wrap;
}

.hosting-upgrade-summary {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}

.hosting-upgrade-summary > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.hosting-upgrade-summary dd {
    margin: 0;
    text-align: right;
}

.c360-plan-line {
    margin-bottom: 8px;
}

/* Hosting Overview: domains card (HostingDomainsCard). */
.hosting-domain-cell {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
}

.hosting-domain-suspended .hosting-domain-name {
    color: var(--text-secondary);
    text-decoration: line-through;
}

.hosting-domain-limit {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.hosting-domain-limit > .hosting-dns-input {
    flex: 1 1 180px;
}

.hosting-domain-limit > .hosting-dns-input > .ui-input:disabled {
    background: var(--surface-muted);
}

.hosting-domain-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    border: 0;
    margin: 0;
    padding: 0;
}

.hosting-domain-options > legend {
    width: 100%;
    margin-bottom: 6px;
}

.hosting-dns-suffix {
    padding: 0 12px;
    color: var(--text-tertiary);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.hosting-dns-value-row {
    display: flex;
    gap: 12px;
}

.hosting-dns-value-row > .ui-field {
    flex: 1 1 auto;
    min-width: 0;
}

.hosting-dns-value-row > .hosting-dns-priority {
    flex: 0 0 110px;
}

.hosting-dns-summary {
    overflow-wrap: anywhere;
    font-size: 12.5px;
}

/* Domain and email check (HostingDomainCheck, HostingDnsPlanPreview) */
/* Email tab: all mail goes to another provider, the hosting's mail UI is folded away. */
.hosting-mail-elsewhere {
    align-items: center;
}

.hosting-mail-elsewhere > span {
    flex: 1 1 auto;
}

.hosting-check-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
}

.hosting-check-sk-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
}

.hosting-check-sk-title {
    width: 40%;
}

.hosting-check-sk-sub {
    width: 60%;
}

/* The uptime chip on a domain row opens its details: a chip that reads as a button. */
.hosting-uptime-button {
    border: 0;
    font: inherit;
    cursor: pointer;
    gap: 4px;
}

.hosting-uptime-button svg {
    width: 12px;
    height: 12px;
}

.hosting-uptime-button:hover {
    box-shadow: inset 0 0 0 1px currentColor;
}

.hosting-check-row > .ui-row-text {
    flex: 1 1 auto;
    min-width: 0;
}

.hosting-check-row > .ui-btn {
    flex-shrink: 0;
}

.hosting-check-value {
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hosting-plan {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.hosting-plan-step {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 8px;
    padding: 8px 12px;
    font-size: 13px;
}

.hosting-plan-step + .hosting-plan-step {
    border-top: 1px solid var(--border);
}

.hosting-plan-step.setting {
    flex-wrap: nowrap;
}

.hosting-plan-sign {
    flex-shrink: 0;
    width: 12px;
    font-weight: 600;
    text-align: center;
}

.hosting-plan-step.add .hosting-plan-sign { color: var(--success); }
.hosting-plan-step.remove .hosting-plan-sign { color: var(--danger); }
.hosting-plan-step.remove .hosting-plan-value { text-decoration: line-through; color: var(--text-secondary); }

.hosting-plan-name {
    font-size: 12.5px;
}

.hosting-plan-value {
    flex-basis: 100%;
    padding-left: 20px;
    font-size: 12px;
    overflow-wrap: anywhere;
}


/* Spam filter dialog (HostingMailFiltersCard) */
.hosting-spam-number {
    max-width: 120px;
    margin-top: 8px;
}

/* Email tab (HostingEmailPanel and its cards) */
.hosting-mailbox-text {
    flex: 1 1 auto;
    min-width: 0;
}

.hosting-mailbox-text .ui-row-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    overflow-wrap: anywhere;
}

.hosting-mailbox-meter {
    width: min(220px, 100%);
    margin-top: 6px;
}

.hosting-forward-targets {
    overflow-wrap: anywhere;
}

.hosting-input-button {
    flex-shrink: 0;
    margin-right: 4px;
}

.hosting-secret {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-muted, var(--surface));
    margin: 4px 0 12px;
}

.hosting-secret code {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    overflow-wrap: anywhere;
    user-select: all;
}

.hosting-copied-label,
[data-copied] .hosting-copy-label {
    display: none;
}

[data-copied] .hosting-copied-label {
    display: inline;
}

.hosting-mail-settings {
    margin: 0;
    padding: 12px 20px 16px;
    display: grid;
    gap: 10px;
}

.ui-dialog .hosting-mail-settings,
.mud-dialog .hosting-mail-settings {
    padding: 0;
}

/* FTP card: the domain choice sits inline after the server name. */
.hosting-mail-settings > div {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    column-gap: 12px;
}

.hosting-mail-settings dt {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
}

.hosting-mail-settings dd {
    margin: 0;
    grid-column: 2;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.hosting-autoreply-period {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 12px;
}

@media (max-width: 599.98px) {
    .hosting-mail-settings > div {
        grid-template-columns: minmax(0, 1fr);
    }

    .hosting-mail-settings dd {
        grid-column: 1;
    }

    .hosting-autoreply-period {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    }
}

@media (max-width: 599.98px) {
    .hosting-dns-header {
        flex-direction: column;
    }

    .hosting-dns-actions {
        width: 100%;
    }

    .hosting-dns-actions .ui-select {
        flex: 1 1 auto;
        max-width: none;
    }

    .hosting-dns-name {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

.hosting-backups-more {
    padding: 12px 20px;
    border-top: 1px solid var(--divider) !important;
    width: 100%;
    text-align: left;
}

.hosting-ssl-status {
    display: flex;
    gap: 14px;
    align-items: center;
}

.hosting-ssl-headline {
    font-size: 15px;
    font-weight: 600;
}

.hosting-ssl .ui-card-top {
    flex-wrap: wrap;
}

.hosting-ssl .ui-card-top h2 {
    white-space: nowrap;
}

.hosting-ssl-domain {
    min-width: 0;
    max-width: 100%;
}

.hosting-ssl-domain .ui-select {
    height: 30px;
    font-size: 12.5px;
    width: auto;
    max-width: 100%;
    text-overflow: ellipsis;
}

.hosting-ssl-names {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hosting-meter {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hosting-skeleton {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Restore / download wizard. */
.restore-group-label {
    padding-top: 6px;
}

.restore-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.restore-group {
    display: flex;
    flex-direction: column;
    padding-bottom: 8px;
}

.restore-group-head {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0 2px;
}

.restore-group-head .ui-link-btn {
    font-size: 12px;
}

.restore-item {
    min-height: 40px;
    font-size: 13.5px;
}

.restore-more {
    align-self: flex-start;
    padding: 6px 0;
}

.restore-summary {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.restore-summary-row {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-top: 1px solid var(--divider);
    font-size: 13px;
}

.restore-summary-row:first-child {
    border-top: 0;
}

.grow {
    flex-grow: 1;
    min-width: 0;
}

.restore-confirm {
    align-items: flex-start;
    font-size: 13.5px;
    line-height: 1.45;
    padding: 4px 2px;
}

.restore-hint {
    margin-top: auto;
}

@media (max-width: 1279.98px) {
    .hosting-tiles {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .hosting-tile.wide {
        grid-column: span 2;
    }
}

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

@media (max-width: 599.98px) {
    .hosting-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hosting-health-chips {
        display: none;
    }
}

/* =============================================================================
   Customer appointments
   ============================================================================= */
.appointments {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.appointments.with-panel {
    grid-template-columns: minmax(0, 1fr) 400px;
}

.appointments-main {
    gap: 20px;
}

.appointments-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.appointments-month {
    margin: 4px 0 0;
}

.appointment-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.appointment-card.inactive {
    opacity: 0.65;
}

.appointment-card-main {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

.appointment-card-text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.appointment-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.appointment-card-title .ui-h2 {
    margin: 0;
}

.appointment-card-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
}

.appointment-card-meta > span {
    display: flex;
    gap: 6px;
    align-items: center;
}

.appointment-card-desc {
    margin: 4px 0 0;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text-tertiary);
}

.appointment-card-actions {
    display: flex;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--divider);
    flex-wrap: wrap;
}

.appointments-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 24px;
}

.appointments-panel-head {
    padding: 22px 22px 16px;
    border-bottom: 1px solid var(--divider);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.appointments-panel-body {
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.appointments-panel-foot {
    padding: 14px 22px;
    border-top: 1px solid var(--divider);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.appointments-panel-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

.appointments-slots {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.appointments-slots > legend {
    padding: 0;
    margin-bottom: 2px;
    font-size: 13px;
    font-weight: 500;
}

.appointments-slot {
    display: grid;
    grid-template-columns: 22px minmax(0, 1.4fr) minmax(0, 1fr) 30px;
    gap: 8px;
    align-items: center;
}

.appointments-slot-no {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--surface-muted);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.appointments-slot-add {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.appointments-slot-add .ui-icon {
    width: 15px;
    height: 15px;
}

.appointment-proposals {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.appointment-proposals ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13.5px;
}

.appointment-proposals li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.appointment-proposals li .ui-icon {
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
}

.appointment-proposals li.past {
    color: var(--text-secondary);
    text-decoration: line-through;
}

.appointment-proposals-inline {
    display: block;
    margin-top: 2px;
    font-size: 12.5px;
    color: var(--text-secondary);
}

.appointment-card-note {
    align-self: center;
}

/* Add-to-calendar dropdown. */
.cal-menu > summary {
    cursor: pointer;
}

.cal-menu .cal-menu-chevron {
    width: 14px;
    height: 14px;
    margin-left: -2px;
}

.cal-menu[open] .cal-menu-chevron {
    transform: rotate(180deg);
}

.cal-menu.grow {
    display: flex;
}

.cal-menu.grow > summary {
    flex-grow: 1;
}

/* Customer's proposed times in the admin side panel. */
.adm-proposals {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.adm-proposals li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 13px;
}

.adm-proposals li.past {
    color: var(--text-secondary);
    text-decoration: line-through;
}

.adm-proposal-when {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.adm-proposal-clash {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--danger);
}

.adm-proposal-clash .ui-icon {
    width: 13px;
    height: 13px;
}

@media (max-width: 1099.98px) {
    .appointments.with-panel {
        grid-template-columns: minmax(0, 1fr) 340px;
    }
}

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

    .appointments-panel {
        position: fixed;
        top: 0;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .appointments-panel-foot {
        margin-top: auto;
    }
}

@media (max-width: 599.98px) {
    .appointment-card-main {
        gap: 14px;
    }

    .appointment-card .ui-date.lg {
        width: 52px;
    }

    .appointment-card-actions > .ui-btn {
        flex: 1 1 auto;
    }

    .appointment-card-actions > .grow {
        display: none;
    }
}

/* =============================================================================
   Account settings (phase 2 layout: section nav + pages made of cards)
   ============================================================================= */
.account-manage-layout {
    grid-template-columns: 220px minmax(0, 860px);
}

.account-manage-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-manage-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    color: var(--text-tertiary);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.account-manage-link:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.account-manage-link[aria-current='page'] {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.account-manage-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.manage-card {
    padding: 24px;
}

.manage-card-title {
    margin-bottom: 16px;
}

.manage-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    align-self: flex-start;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: -8px;
}

.manage-page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.manage-section-head {
    border-top: 0;
    padding-bottom: 4px;
}

.manage-inline-form {
    border-top: 0;
    padding-top: 8px;
    flex-wrap: wrap;
}

.manage-inline-form .ui-field {
    max-width: 320px;
}

.manage-theme {
    max-width: 420px;
    width: 100%;
}

.manage-2fa {
    padding: 20px 22px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.manage-2fa-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.manage-2fa-actions {
    flex-wrap: wrap;
    gap: 8px;
}

.manage-steps {
    list-style: none;
    margin: 0;
    padding: 4px 22px 22px 78px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-size: 13.5px;
}

.manage-steps li {
    display: flex;
    gap: 12px;
    align-items: center;
}

.manage-steps-action {
    padding-top: 4px;
}

#qrCode {
    display: inline-block;
    margin: 12px 0;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
}

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

    .account-manage-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .manage-card {
        padding: 18px;
    }
}

@media (max-width: 599.98px) {
    .manage-steps {
        padding-left: 22px;
    }

    .ui-row {
        flex-wrap: wrap;
        padding: 16px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-submit,
    .login-input,
    .form-control,
    .app-usermenu-chevron {
        transition: none;
    }
}

/* =============================================================================
   Admin (redesign phase 4): dashboard, customers overview, customer 360,
   appointments week view. Plain markup on the ui-* kit above.
   ============================================================================= */

.adm-page {
    gap: 18px;
}

.adm-date {
    font-size: 13px;
    color: var(--text-secondary);
}

.adm-dim {
    color: var(--text-secondary);
}

.adm-red {
    color: var(--danger);
}

.adm-amb {
    color: var(--warning);
}

.adm-ok {
    color: var(--success);
}

.adm-strong {
    font-weight: 500;
}

.adm-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--signal-incomplete);
}

.adm-dot.critical { background: var(--signal-critical); }
.adm-dot.attention { background: var(--signal-attention); }
.adm-dot.healthy { background: var(--signal-healthy); }
.adm-dot.incomplete,
.adm-dot.inactive { background: var(--signal-incomplete); }

.adm-card-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--link);
    text-decoration: none;
    white-space: nowrap;
}

.adm-card-link:hover {
    text-decoration: underline;
}

.adm-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--divider);
}

.adm-card-head.plain {
    border-bottom: 0;
    padding: 16px 20px;
}

.adm-card-head-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

/* Dashboard: KPI strip. */
.adm-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.adm-kpi {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    border-right: 1px solid var(--divider);
}

.adm-kpi:last-child {
    border-right: 0;
}

.adm-kpi-value {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.adm-kpi-value.mono {
    font-weight: 500;
}

.adm-kpi-value.bad {
    color: var(--danger);
}

.adm-kpi-sub {
    font-size: 12.5px;
    color: var(--text-secondary);
}

.adm-kpi .ui-sk {
    height: 32px;
    width: 60%;
}

.adm-dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

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

/* Dashboard: needs attention. */
.adm-attn-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--divider);
}

.adm-attn-row:last-child {
    border-bottom: 0;
}

.adm-attn-row .ui-icon-tile {
    width: 36px;
    height: 36px;
    border-radius: 9px;
}

.adm-attn-row .ui-icon-tile .ui-icon {
    width: 18px;
    height: 18px;
}

.adm-attn-text {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.adm-attn-text.meter {
    gap: 6px;
}

.adm-attn-title {
    font-size: 13.5px;
    font-weight: 500;
}

.adm-attn-sub {
    font-size: 12.5px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adm-attn-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.adm-attn-row .ui-meter {
    height: 5px;
}

.adm-attn-more {
    padding: 12px 20px;
    font-size: 12.5px;
    color: var(--text-secondary);
    border-top: 1px solid var(--divider);
}

.adm-all-clear {
    padding: 28px 20px;
}

.adm-attn-checking {
    width: 13px;
    height: 13px;
    color: var(--text-secondary);
}

/* Dashboard: agenda. */
.adm-agenda-day {
    padding: 14px 20px 6px;
}

.adm-agenda-row {
    display: flex;
    gap: 14px;
    padding: 10px 20px;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.adm-agenda-row:last-child {
    padding-bottom: 18px;
}

a.adm-agenda-row:hover .adm-agenda-title {
    color: var(--link);
}

.adm-agenda-time {
    width: 48px;
    font-size: 12.5px;
    flex-shrink: 0;
}

.adm-agenda-bar {
    width: 3px;
    align-self: stretch;
    border-radius: 3px;
    background: var(--primary);
    flex-shrink: 0;
}

.adm-agenda-bar.c { background: var(--success); }
.adm-agenda-bar.s { background: var(--primary); }
.adm-agenda-bar.r { background: var(--signal-attention); }
.adm-agenda-bar.d { background: var(--border-strong); }

.adm-agenda-text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.adm-agenda-title {
    font-size: 13.5px;
    font-weight: 500;
}

.adm-agenda-sub {
    font-size: 12.5px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dashboard: integrations. */
.adm-integrations-card {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Red only while an integration is offline; one that's merely not set up gets the plain card. */
.adm-integrations-card.bad {
    border-color: var(--danger);
    background: var(--danger-bg);
}

.adm-integrations-card.bad .ui-h2 {
    color: var(--danger);
}

.adm-integrations {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.adm-integration {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--divider);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    min-width: 0;
}

/* The environment settings a not-set-up integration needs: long names, so they wrap anywhere. */
.adm-integration-settings {
    font-weight: 400;
    font-size: 11.5px;
    overflow-wrap: anywhere;
}

/* Customers overview. */
.adm-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.adm-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    min-width: 0;
}

.adm-tile:hover {
    border-color: var(--border-strong);
}

.adm-tile[aria-pressed='true'] {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.adm-tile-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.adm-tile-count {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.adm-tile-sub {
    font-size: 12px;
    color: var(--text-secondary);
}

.adm-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.adm-filters .ui-search {
    width: 280px;
}

.adm-filters .ui-select {
    width: auto;
    height: 36px;
    font-size: 13px;
    padding-right: 32px;
}

.adm-spacer {
    flex-grow: 1;
}

.adm-sort-note {
    font-size: 12.5px;
    color: var(--text-secondary);
}

.adm-seg-icons button {
    width: 34px;
    padding: 0;
}

.adm-cust-table td {
    white-space: nowrap;
}

.adm-cust-table td:first-child {
    white-space: normal;
    min-width: 180px;
}

.adm-cust-table tbody tr.critical td {
    background: color-mix(in srgb, var(--danger-bg) 40%, var(--surface));
}

.adm-cust-table tbody tr.inactive td {
    color: var(--text-secondary);
}

.adm-cust-name {
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
}

a.adm-cust-name:hover {
    color: var(--link);
}

.adm-sev {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.adm-sev.critical { color: var(--danger); }
.adm-sev.attention { color: var(--warning); }
.adm-sev.healthy { color: var(--success); }
.adm-sev.incomplete,
.adm-sev.inactive { color: var(--text-secondary); }

.adm-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.adm-mini {
    width: 64px;
    height: 5px;
    border-radius: 99px;
    background: var(--neutral-bg);
    overflow: hidden;
    flex-shrink: 0;
}

.adm-mini > span {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: var(--primary);
}

.adm-mini.warn > span { background: var(--signal-attention); }
.adm-mini.bad > span { background: var(--signal-critical); }

.adm-cust-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 12px;
}

.adm-cust-card {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.adm-cust-card.critical {
    border-color: color-mix(in srgb, var(--signal-critical) 35%, var(--border));
}

.adm-cust-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.adm-cust-card-facts {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 6px 12px;
    font-size: 12.5px;
}

.adm-cust-card-facts > span:nth-child(odd) {
    color: var(--text-secondary);
}

.adm-issues {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Customer 360: header band. */
.c360-band {
    position: relative;
    isolation: isolate;
    /* Above the page content, so the header's "…" dropdown isn't painted over by the cards below. */
    z-index: 2;
    margin: -32px -40px 0;
    padding: 24px 40px 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.c360-band::before {
    content: "";
    position: absolute;
    inset: 0 -100vmax;
    z-index: -1;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.app-main:has(.c360-band) {
    overflow-x: clip;
}

/* The band pulls itself up to the top edge; with any banner above it (2FA nudge, running timer,
   view-as-customer, install invitation) that would paint it over the banner. */
.app-content-shell:has(.app-nudge, .app-timer, .app-impersonation) .c360-band,
:root[data-install-cta='show'] .app-content-shell:has(.app-install-cta) .c360-band {
    margin-top: 0;
}

.app-content-shell:has(.app-nudge) .c360-band::before {
    border-top: 1px solid var(--border);
}

.c360-crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.c360-crumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.c360-crumb a:hover {
    color: var(--link);
}

.c360-crumb .ui-icon {
    width: 14px;
    height: 14px;
}

.c360-crumb [aria-current] {
    color: var(--text);
}

.c360-head {
    display: flex;
    align-items: center;
    gap: 18px;
}

.c360-avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--link);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    flex-shrink: 0;
}

.c360-title {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.c360-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.c360-meta {
    display: flex;
    gap: 4px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.c360-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.c360-band .ui-tabs {
    border-bottom: 0;
}

a.ui-tab {
    text-decoration: none;
}

.c360-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}

.c360-main,
.c360-side {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.c360-side {
    gap: 16px;
}

.c360-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.c360-stat {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.c360-stat > *,
.c360-stat-line > *,
.c360-chips > * {
    min-width: 0;
    max-width: 100%;
}

.c360-stat .ui-label,
.c360-stat .ui-muted,
.c360-stat-value,
.c360-stat .adm-card-link {
    overflow-wrap: anywhere;
}

.c360-stat .adm-card-link {
    white-space: normal;
}

.c360-stat-value {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.c360-stat-value.mono {
    font-weight: 500;
}

.c360-stat-value.sm {
    font-size: 16px;
    letter-spacing: 0;
}

.c360-stat-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.c360-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.c360-appt-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    border-top: 1px solid var(--divider);
    color: inherit;
    text-decoration: none;
}

.c360-appt-row .ui-row-text > * {
    overflow-wrap: anywhere;
}

.c360-appt-row > .ui-chip {
    min-width: 0;
    max-width: 100%;
    height: auto;
    min-height: 22px;
    padding-block: 4px;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
}

a.c360-appt-row:hover {
    background: var(--surface-subtle);
}

.c360-appt-date {
    width: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
    flex-shrink: 0;
}

.c360-appt-date .ui-label {
    font-size: 11px;
    text-transform: uppercase;
}

.c360-appt-date strong {
    font-size: 18px;
    font-weight: 600;
}

.c360-side-card {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.c360-side-card.tight {
    gap: 12px;
}

.c360-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.c360-side-head > :first-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.c360-kv {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 10px 12px;
    font-size: 13px;
}

.c360-kv > span:nth-child(odd) {
    color: var(--text-secondary);
}

.c360-kv > span {
    overflow-wrap: anywhere;
}

.c360-edit {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.c360-edit .ui-textarea {
    min-height: 80px;
}

.c360-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.c360-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--neutral-bg);
    color: var(--neutral);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 600;
    flex-shrink: 0;
}

.c360-user-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.c360-user-text > span:first-child {
    font-size: 13.5px;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.c360-linked-user {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--divider);
}

.c360-linked-user:last-of-type {
    border-bottom: 0;
}

.c360-btn-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* The customer 360's email addresses card: one row per address (name, address, the kinds of email it gets). */
.c360-email-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--divider);
}

.c360-email-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.c360-email-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.c360-email-purposes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 0;
    padding: 0;
    margin: 0;
}

.c360-email-purpose {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ui-btn.warn-text {
    color: var(--warning);
}

.c360-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--divider);
    border-radius: 10px;
    min-width: 0;
}

.c360-link.off {
    opacity: 0.65;
}

.c360-link-tile {
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
    background: var(--primary-soft);
    color: var(--link);
}

.c360-link-tile.rs {
    background: var(--warning-bg);
    color: var(--warning);
}

.c360-link-tile.ms {
    background: var(--success-bg);
    color: var(--success);
}

.c360-link-text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.c360-link-text > span:first-child {
    font-size: 13px;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.c360-link-text > span:last-child {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ui-toggle {
    width: 34px;
    height: 20px;
    border-radius: 99px;
    border: 0;
    padding: 0;
    background: var(--border-strong);
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.15s ease;
}

.ui-toggle::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.2);
    transition: transform 0.15s ease;
}

.ui-toggle[aria-checked='true'] {
    background: var(--primary);
}

.ui-toggle[aria-checked='true']::after {
    transform: translateX(14px);
}

.ui-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.ui-toggle:disabled {
    opacity: 0.5;
    cursor: default;
}

/* "More" menus reuse the in-page dropdown (details.app-menu.ui-dropdown), anchored to the right. */
.app-menu.ui-dropdown.end .app-menu-panel {
    left: auto;
    right: 0;
}

.app-menu-item.danger {
    color: var(--danger);
}

.app-menu-item.danger:hover {
    color: var(--danger);
}

.app-menu-panel hr {
    border: 0;
    border-top: 1px solid var(--divider);
    margin: 4px 0;
}

.ui-count.bad {
    background: var(--danger-bg);
    color: var(--danger);
}

.c360-hr {
    border: 0;
    border-top: 1px solid var(--divider);
    margin: 0;
}

.c360-tab-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.c360-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.c360-hosting-card {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.c360-hosting-card .ui-row-text > *,
.c360-hosting-card .ui-callout,
.c360-hosting-card .ui-muted {
    overflow-wrap: anywhere;
}

.c360-stat .ui-chip,
.c360-hosting-card .ui-chip {
    height: auto;
    min-height: 22px;
    padding-block: 4px;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Appointments: toolbar. */
.adm-appt-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* The customer and status filters sit side by side at a fixed width on the right of the toolbar; on a phone they share the row. */
.adm-appt-toolbar > .ui-select,
.adm-appt-toolbar > .adm-customer-picker {
    width: 220px;
    flex: 0 1 220px;
    min-width: 0;
}

@media (max-width: 599.98px) {
    .adm-appt-toolbar > .adm-spacer {
        display: none;
    }

    .adm-appt-toolbar > .ui-select,
    .adm-appt-toolbar > .adm-customer-picker {
        flex: 1 1 100%;
        width: auto;
    }
}

.adm-appt-range {
    font-size: 15px;
    font-weight: 600;
    margin-left: 6px;
}

.adm-select {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.adm-select > .ui-icon {
    position: absolute;
    left: 11px;
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    pointer-events: none;
}

.adm-select > .ui-select {
    padding-left: 34px;
}

.adm-appt-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
    align-items: start;
}

.adm-appt-grid.single {
    grid-template-columns: minmax(0, 1fr);
}

/* Appointments: week calendar. */
.wk {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 7 days x 24 hours: the grid scrolls inside the card (the day header stays put) and opens at
   the working day, see web2b1Calendar.scrollTo. */
.wk-scroll {
    overflow: auto;
    max-height: max(420px, calc(100vh - 260px));
    overscroll-behavior: contain;
}

.wk-inner {
    min-width: 760px;
    user-select: none;
}

.wk-head,
.wk-body {
    display: grid;
    grid-template-columns: 52px repeat(var(--wk-days, 7), minmax(0, 1fr));
}

.wk-head {
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--surface);
}

.wk-dayhead {
    padding: 12px 10px;
    display: flex;
    gap: 6px;
    align-items: center;
    border-left: 1px solid var(--divider);
    min-height: 50px;
}

.wk-dayhead-num {
    font-size: 16px;
    font-weight: 600;
}

.wk-dayhead.today .ui-label {
    color: var(--link);
}

.wk-dayhead.today .wk-dayhead-num {
    font-size: 14px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wk-body {
    padding-top: 10px;
}

.wk-gutter {
    position: relative;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}

.wk-gutter span {
    position: absolute;
    right: 8px;
}

.wk-day {
    position: relative;
    border-left: 1px solid var(--divider);
    background-image: linear-gradient(var(--divider) 1px, transparent 1px);
    background-size: 100% var(--wk-hour, 52px);
}

.wk-day.weekend {
    background-color: color-mix(in srgb, var(--divider) 35%, transparent);
}

.wk-day.today {
    background-color: color-mix(in srgb, var(--primary-soft) 35%, transparent);
}

.wk-slot {
    position: absolute;
    left: 0;
    right: 0;
    cursor: pointer;
}

.wk-slot:hover,
.wk-slot:focus-visible {
    background: color-mix(in srgb, var(--primary-soft) 55%, transparent);
    outline: 0;
}

.wk-slot.dragging {
    background: var(--primary-soft);
    box-shadow: inset 0 0 0 1px var(--primary-border);
}

.wk-now {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--signal-critical);
    z-index: 3;
    pointer-events: none;
}

.wk-now::before {
    content: "";
    position: absolute;
    left: -4px;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--signal-critical);
}

.wk-ev {
    position: absolute;
    z-index: 2;
    border-radius: 7px;
    padding: 6px 8px;
    font-size: 12px;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid transparent;
    background: var(--success-bg);
    color: var(--success);
    text-align: left;
    min-height: 20px;
}

.wk-ev b {
    font-size: 12.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.wk-ev span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
}

.wk-ev.row {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
}

.wk-ev .ui-icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    color: var(--danger);
}

.wk-ev.c {
    background: var(--success-bg);
    border-color: color-mix(in srgb, var(--success) 25%, transparent);
    box-shadow: inset 3px 0 0 var(--success);
}

.wk-ev.s {
    background: var(--primary-soft);
    border: 1px dashed var(--primary-border);
    box-shadow: inset 3px 0 0 var(--primary);
}

.wk-ev.r {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    box-shadow: inset 3px 0 0 var(--signal-attention);
}

/* Requested by the customer, not booked yet: an outline only, so it never reads as a booking. */
.wk-ev.q {
    background: var(--surface);
    border: 1px dashed var(--warning-border);
    box-shadow: inset 3px 0 0 var(--signal-attention);
}

.wk-ev.d {
    background: var(--surface-muted);
    border-color: var(--border);
}

.wk-ev.d b {
    color: var(--text-secondary);
}

.wk-ev.x {
    background: var(--surface-muted);
    border-color: var(--border);
    opacity: 0.75;
}

.wk-ev.x b {
    color: var(--text-secondary);
    text-decoration: line-through;
}

.wk-ev.sel {
    box-shadow: 0 0 0 2px var(--primary);
    z-index: 4;
}

.wk-ev:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.wk-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding: 12px 18px;
    border-top: 1px solid var(--divider);
    font-size: 12px;
    color: var(--text-secondary);
}

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

.wk-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    border: 1px solid var(--border);
}

.wk-swatch.c { background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.wk-swatch.s { background: var(--primary-soft); border: 1px dashed var(--primary-border); }
.wk-swatch.r { background: var(--warning-bg); border-color: var(--warning-border); }
.wk-swatch.d { background: var(--surface-muted); }
.wk-swatch.q { background: var(--surface); border: 1px dashed var(--warning-border); }

.wk-legend .overlap {
    color: var(--danger);
}

.wk-legend .ui-icon {
    width: 13px;
    height: 13px;
}

.wk-loading {
    padding: 24px;
}

/* Appointments: side panel. */
.adm-aside {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: sticky;
    top: 16px;
}

.adm-aside-top {
    padding: 18px 20px;
    border-bottom: 1px solid var(--divider);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.adm-aside-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.adm-aside-bar > div {
    display: flex;
    gap: 4px;
}

.adm-aside-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.adm-aside-facts {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}

.adm-aside-facts > span {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
    overflow-wrap: anywhere;
}

.adm-aside-facts .ui-icon {
    color: var(--text-secondary);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.adm-aside-resched {
    padding: 16px 20px;
    border-bottom: 1px solid var(--divider);
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: color-mix(in srgb, var(--warning-bg) 55%, var(--surface));
}

.adm-aside-resched .ui-label {
    color: var(--warning);
}

.adm-aside-resched p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.adm-aside-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.adm-aside-body .ui-textarea {
    min-height: 64px;
}

.adm-aside-kv {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12.5px;
}

.adm-aside-kv > span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.adm-aside-kv .adm-ok {
    display: flex;
    align-items: center;
    gap: 6px;
}

.adm-aside-kv .ui-icon {
    width: 14px;
    height: 14px;
}

.adm-aside-foot {
    padding: 14px 20px;
    border-top: 1px solid var(--divider);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.adm-aside-desc {
    margin: 0;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.adm-aside-call {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.adm-aside-time {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 8px;
}

.adm-aside-foot .adm-grow {
    flex-grow: 1;
    justify-content: center;
}

.adm-appt-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.adm-more {
    border-top: 1px solid var(--divider);
    display: flex;
    justify-content: center;
}

.wk-swatch.x { background: var(--surface-muted); opacity: 0.6; }

.adm-aside-empty {
    padding: 36px 20px;
}

.ui-callout .ui-icon {
    flex-shrink: 0;
}

@media (max-width: 1279.98px) {
    .adm-dash-grid,
    .c360-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .adm-appt-grid {
        grid-template-columns: minmax(0, 1fr) 320px;
    }
}

@media (max-width: 1099.98px) {
    .adm-kpis,
    .adm-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .adm-kpi:nth-child(2) {
        border-right: 0;
    }

    .adm-kpi:nth-child(-n+2) {
        border-bottom: 1px solid var(--divider);
    }

    .c360-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 959.98px) {
    .c360-band {
        margin: -20px -16px 0;
        padding: 20px 16px 0;
    }

    .c360-head {
        flex-wrap: wrap;
    }

    .c360-actions {
        width: 100%;
        position: relative;
    }

    /* Anchor the customer header menu to the full action row on narrow screens.
       Its content can otherwise make the shrink-to-fit panel wider than the
       space to the left of the trigger (especially with text scaling or longer
       translations), pushing the menu beyond the viewport. */
    .c360-actions > .app-menu.ui-dropdown {
        position: static;
    }

    .c360-actions > .app-menu.ui-dropdown.end .app-menu-panel {
        width: min(280px, 100%);
        min-width: 0;
        max-width: 100%;
    }

    .adm-appt-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    /* .ui-sheet makes it full screen; these repeat what .adm-aside overrides. */
    .adm-aside {
        position: fixed;
        top: 0;
        overflow-y: auto;
    }

    .adm-aside-foot {
        margin-top: auto;
    }

    .c360-grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 599.98px) {
    .adm-kpis,
    .adm-tiles {
        grid-template-columns: minmax(0, 1fr);
    }

    .adm-kpi {
        border-right: 0;
        border-bottom: 1px solid var(--divider);
    }

    .adm-kpi:last-child {
        border-bottom: 0;
    }

    .adm-integrations {
        grid-template-columns: minmax(0, 1fr);
    }

    .adm-filters .ui-search {
        width: 100%;
    }

    .adm-attn-row {
        flex-wrap: wrap;
    }

    .adm-attn-row .ui-btn {
        margin-left: 50px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ui-toggle,
    .ui-toggle::after {
        transition: none;
    }
}

.ui-icon-tile.neu { background: var(--neutral-bg); color: var(--neutral); }


/* =============================================================================
   Mobile and states (redesign phase 5): bottom tab bar, whole-page states
   (404 / no access / server error), the section error card and the
   connection-lost bar. Design: the canvas's mobile screens and "Error and
   system states" board.
   ============================================================================= */
:root {
    --tabbar-height: 56px;
}

/* ---- Bottom tab bar (below md; the sidebar drawer takes over on desktop) --- */
.app-tabbar {
    display: none;
}

@media (max-width: 959.98px) {
    .app-tabbar {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1090; /* under MudBlazor's drawer and its overlay, over the page */
        padding: 0 4px env(safe-area-inset-bottom, 0px);
        background: var(--surface);
        border-top: 1px solid var(--border);
    }

    /* Keep the last content above the fixed bar. */
    .mud-layout:has(.app-tabbar) .app-content-shell.mud-container {
        padding-bottom: calc(40px + var(--tabbar-height) + env(safe-area-inset-bottom, 0px));
    }
}

.app-tab {
    flex: 1 1 0;
    min-width: 0;
    height: var(--tabbar-height);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.app-tab > span:not(.app-tab-dot) {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-tab .ui-icon {
    width: 20px;
    height: 20px;
}

.app-tab:hover {
    color: var(--text);
}

.app-tab.active,
.app-tab[aria-expanded='true'] {
    color: var(--link);
}

.app-tab:focus-visible {
    outline-offset: -4px;
}

.app-tab-dot {
    position: absolute;
    top: 8px;
    left: calc(50% + 6px);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--signal-critical);
    border: 2px solid var(--surface);
}

/* The unhandled-error bar sits above the tab bar too. */
@media (max-width: 959.98px) {
    #blazor-error-ui {
        bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0px));
    }
}

#blazor-error-ui .dismiss .ui-icon {
    width: 16px;
    height: 16px;
}

/* ---- Whole-page states --------------------------------------------------- */
.status-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 32px 16px;
    background: var(--bg);
    color: var(--text);
}

.status-card {
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-dialog);
    box-shadow: 0 1px 2px rgba(12, 23, 51, 0.06);
    padding: 20px 22px 40px;
}

.status-logo img {
    width: 52px;
    height: 39px;
    object-fit: contain;
    display: block;
}

:root[data-theme='dark'] .status-logo img {
    background: #FFFFFF;
    border-radius: var(--radius);
    padding: 4px 6px;
    box-sizing: content-box;
}

.status-footer {
    justify-content: center;
}

.ui-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 32px 8px 0;
}

/* Inside the app shell (a signed-in customer on an admin URL) the panel is its own card. */
.app-content-shell .ui-status {
    max-width: 560px;
    margin: 48px auto 0;
    padding: 48px 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-dialog);
}

.ui-status-code {
    font-size: 56px;
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--link);
    font-variant-numeric: tabular-nums;
}

.ui-status-title {
    margin: 6px 0 0;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
}

.ui-status-title:focus {
    outline: none;
}

.ui-status-text {
    margin: 0;
    max-width: 320px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.ui-status-actions {
    justify-content: center;
    margin-top: 10px;
}

.ui-status .ui-empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    margin-bottom: 6px;
}

.ui-status .ui-empty-icon .ui-icon {
    width: 24px;
    height: 24px;
}

.ui-empty-icon.bad {
    background: var(--danger-bg);
    color: var(--danger);
}

.ui-inline-form {
    display: contents;
}

/* ---- Section error (SentryErrorBoundary) ---------------------------------- */
.ui-state-card .ui-empty {
    padding: 48px 24px;
}

.ui-state-card .ui-empty-title {
    margin: 0;
}

.ui-state-card .ui-actions {
    margin-top: 6px;
}

.ui-state-ref {
    margin-top: 4px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-secondary);
}

/* ---- Connection-lost bar (ReconnectBar.razor + app-init.js) --------------- */
.app-reconnect {
    display: none;
}

/* MudBlazor.min.css gives #components-reconnect-modal z-index 9999 and a page background, both
   !important, for Blazor's own full-screen modal. */
#components-reconnect-modal.app-reconnect {
    z-index: 1450 !important; /* over dialogs, under snackbars */
    background-color: transparent !important;
}

.app-reconnect.components-reconnect-show,
.app-reconnect.components-reconnect-paused,
.app-reconnect.components-reconnect-failed,
.app-reconnect.components-reconnect-resume-failed {
    display: block;
    position: fixed;
    bottom: 24px;
    left: calc(50% + var(--sidebar-width) / 2);
    transform: translateX(-50%);
    width: min(560px, calc(100vw - var(--sidebar-width) - 48px));
}

/* Reconnecting starts with instant retries; a blip that resolves within a moment never shows. */
.app-reconnect.components-reconnect-show {
    animation: app-reconnect-in 0.2s ease-out 0.8s both;
}

@keyframes app-reconnect-in {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 959.98px) {
    .app-reconnect.components-reconnect-show,
    .app-reconnect.components-reconnect-paused,
    .app-reconnect.components-reconnect-failed,
    .app-reconnect.components-reconnect-resume-failed {
        left: 50%;
        width: calc(100vw - 24px);
        bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0px) + 12px);
    }
}

.app-reconnect-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-card);
    background: #0E1526;
    border: 1px solid #0E1526;
    color: #FFFFFF;
    box-shadow: 0 12px 32px rgba(12, 23, 51, 0.3);
}

:root[data-theme='dark'] .app-reconnect-bar {
    background: var(--surface-muted);
    border-color: var(--border-strong);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.app-reconnect-icon.ui-icon {
    width: 18px;
    height: 18px;
    color: #FBBF24;
}

.app-reconnect-text {
    flex-grow: 1;
    min-width: 0;
}

.app-reconnect-text > span {
    display: none;
    flex-direction: column;
    gap: 2px;
}

.components-reconnect-show .app-reconnect-text > .app-reconnect-when-connecting,
.components-reconnect-paused .app-reconnect-text > .app-reconnect-when-paused,
.components-reconnect-failed .app-reconnect-text > .app-reconnect-when-failed,
.components-reconnect-resume-failed .app-reconnect-text > .app-reconnect-when-resume-failed {
    display: flex;
}

.app-reconnect-title {
    font-size: 13.5px;
    font-weight: 500;
}

.app-reconnect-sub {
    font-size: 12.5px;
    color: #AEB9D1;
}

/* Scoped by the id: MudBlazor.min.css styles "#components-reconnect-modal button" (uppercase,
   margin: 40px auto !important) for Blazor's own modal. */
#components-reconnect-modal .app-reconnect-btn {
    display: none;
    flex-shrink: 0;
    height: 32px;
    min-width: 0;
    margin: 0 !important;
    padding: 0 12px;
    border-radius: var(--radius);
    border: 1px solid #3A4763;
    background: transparent;
    color: #FFFFFF;
    font: inherit;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    cursor: pointer;
}

#components-reconnect-modal .app-reconnect-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

#components-reconnect-modal .app-reconnect-btn.app-reconnect-reload,
#components-reconnect-modal.components-reconnect-failed .app-reconnect-btn.app-reconnect-when-failed,
#components-reconnect-modal.components-reconnect-paused .app-reconnect-btn.app-reconnect-when-paused {
    display: inline-flex;
    align-items: center;
}

/* The page behind the bar: dimmed, and `inert` (set by app-init.js) so nothing is clicked into a
   circuit that can't answer. */
.app-disconnected .mud-layout {
    opacity: 0.45;
    transition: opacity 0.2s ease 0.8s;
}

@media (prefers-reduced-motion: reduce) {
    .app-reconnect.components-reconnect-show {
        animation: none;
    }

    .app-disconnected .mud-layout {
        transition: none;
    }
}

@media print {
    .app-tabbar,
    .app-reconnect {
        display: none !important;
    }
}

/* ---- Account settings sub-pages (email, password, authenticator, recovery codes, your data) ---- */
.ui-callout.ok {
    background: var(--success-bg);
    color: var(--success);
    font-size: 13px;
}

.manage-card > .ui-callout + *,
.manage-card > .manage-status + * {
    margin-top: 16px;
}

.manage-status {
    margin-bottom: 16px;
}

.manage-card-status:has(.manage-status) {
    padding: 0 22px;
}

.manage-intro {
    margin: 0 0 16px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-secondary);
    max-width: 560px;
}

.manage-card > .ui-callout + .manage-intro {
    margin-top: 16px;
}

.manage-actions {
    margin-top: 20px;
}

.manage-danger .manage-card-title {
    color: var(--danger);
}

.manage-email-row .ui-btn,
.manage-email-row .ui-chip {
    flex-shrink: 0;
}

.manage-setup {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.manage-setup > li {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.manage-setup-body {
    min-width: 0;
    flex-grow: 1;
}

.manage-setup-body > p {
    margin: 3px 0 10px;
    font-size: 13.5px;
    line-height: 1.55;
}

.manage-qr {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.manage-qr #qrCode {
    margin: 0;
    border: 1px solid var(--border);
}

.manage-key {
    display: inline-block;
    padding: 8px 12px;
    border-radius: var(--radius);
    background: var(--surface-muted);
    font-size: 14px;
    letter-spacing: 0.04em;
    word-break: break-all;
}

.manage-code-input {
    max-width: 200px;
    letter-spacing: 0.2em;
}

.manage-codes {
    list-style: none;
    margin: 16px 0 20px;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, max-content));
    gap: 8px 32px;
    border-radius: var(--radius-card);
    background: var(--surface-muted);
}

.manage-codes code {
    font-size: 14px;
    letter-spacing: 0.04em;
}

/* ---- Admin appointment page (/admin/appointments/{id}) --------------------- */
.appt-detail-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ui-page-heading > .ui-sub {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.appt-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
    gap: 20px;
    align-items: start;
}

.appt-detail-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.appt-detail-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.appt-detail-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.appt-detail-actions {
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.appt-detail-customer {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.appt-detail-sync {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.appt-detail-sync .ui-field-hint {
    margin: 0;
}

.appt-detail-sync a .ui-icon {
    width: 13px;
    height: 13px;
    margin-left: 3px;
    vertical-align: -1px;
}

.ui-card.clip > .adm-aside-resched {
    border-bottom: 0;
}

.appt-detail-conflicts {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13.5px;
}

.appt-detail-conflicts .mono {
    display: block;
    font-size: 12.5px;
}

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

@media (max-width: 599.98px) {
    .appt-detail-row,
    .appt-detail-form .adm-aside-time {
        grid-template-columns: minmax(0, 1fr);
    }

    .manage-codes {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---- Dialogs (Ui/UiDialog.razor on MudDialog, and the static-page <dialog class="ui-native-dialog">) ----
   Same card as the backup-restore wizard's .ui-modal: 16px radius, header / scrolling body / footer
   separated by dividers, actions right-aligned. */
.mud-dialog.ui-dialog,
.ui-native-dialog {
    background: var(--surface);
    color: var(--text);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-float);
    overflow: hidden;
}

.mud-dialog.ui-dialog .ui-dialog-title,
.ui-native-dialog .ui-dialog-title {
    padding: 20px 56px 16px 22px;
    border-bottom: 1px solid var(--divider);
}

.ui-dialog-head {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ui-dialog-head .ui-h2 {
    margin: 0;
}

.mud-dialog.ui-dialog .ui-dialog-body,
.ui-native-dialog .ui-dialog-body {
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ui-dialog-text {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-secondary);
}

.mud-dialog.ui-dialog .ui-dialog-foot,
.ui-native-dialog .ui-dialog-foot {
    padding: 14px 22px;
    border-top: 1px solid var(--divider);
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.mud-dialog.ui-dialog .mud-button-close {
    top: 16px;
    right: 14px;
    color: var(--text-secondary);
}

.mud-dialog.ui-dialog .mud-button-close:hover {
    color: var(--text);
}

.mud-dialog-container .mud-overlay-dialog,
.ui-native-dialog::backdrop {
    background: rgba(14, 21, 38, 0.5);
}

.ui-native-dialog {
    padding: 0;
    width: min(440px, calc(100vw - 32px));
    /* MudBlazor.min.css resets every element to margin: 0, which drops the browser's centring of a modal <dialog>. */
    margin: auto;
    max-height: calc(100vh - 32px);
}

.ui-native-dialog[open] {
    animation: ui-dialog-in 0.15s ease-out;
}

@keyframes ui-dialog-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .ui-native-dialog[open] {
        animation: none;
    }
}

/* Phones: the dialog uses the full width with a small gutter, actions stack full-width. */
@media (max-width: 599.98px) {
    .mud-dialog.ui-dialog {
        margin: 12px;
        max-height: calc(100% - 24px);
    }

    .mud-dialog.ui-dialog .ui-dialog-foot > .ui-btn,
    .ui-native-dialog .ui-dialog-foot > .ui-btn {
        flex: 1 1 auto;
    }
}

/* Filled warning button (suspend, "save anyway"). */
.ui-btn.warn {
    background: var(--signal-attention);
    border-color: var(--signal-attention);
    color: #FFFFFF;
}

.ui-btn.warn:hover {
    filter: brightness(0.94);
}

/* Thin indeterminate bar (a dialog field that is still loading its options). */
.ui-progress-line {
    height: 3px;
    border-radius: 99px;
    background: var(--primary-soft);
    overflow: hidden;
    position: relative;
}

.ui-progress-line::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 35%;
    border-radius: inherit;
    background: var(--primary);
    animation: ui-progress-slide 1.1s ease-in-out infinite;
}

@keyframes ui-progress-slide {
    from { transform: translateX(-100%); }
    to { transform: translateX(300%); }
}

@media (prefers-reduced-motion: reduce) {
    .ui-progress-line::after {
        animation: none;
        width: 100%;
        opacity: 0.4;
    }
}

/* MudAutocomplete (kept where search-as-you-type earns its keep) dressed as a .ui-input. */
.ui-autocomplete.mud-input-control {
    margin: 0;
}

.ui-autocomplete .mud-input.mud-input-outlined {
    min-height: 38px;
    font-size: 13.5px;
    background: var(--surface);
}

.ui-autocomplete .mud-input-outlined-border {
    border-color: var(--border-strong);
    border-radius: var(--radius);
}

.ui-autocomplete .mud-input.mud-input-outlined:focus-within .mud-input-outlined-border {
    border-width: 1px;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* MudAutocomplete gives both the popover and its inner list vertical overflow. Our popover
   border makes the list two pixels taller than the popover's content box, so both otherwise
   render a scrollbar. Keep the list as the single scroll container. */
.mud-popover.ui-autocomplete-popover {
    overflow-y: hidden !important;
}

/* ---- Snackbars (MudSnackbarProvider): a card with the status colour on the icon and a left
   accent, like the rest of the UI (soft fill + strong text), instead of Mud's solid colour block. */
.mud-snackbar {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-float);
    font-family: var(--font);
    font-size: 13.5px;
    line-height: 1.45;
    padding: 12px 14px;
    min-width: min(360px, calc(100vw - 32px));
}

.mud-snackbar[class*="mud-alert-filled-"] {
    background: var(--surface);
    color: var(--text);
}

.mud-snackbar .mud-snackbar-icon {
    border-radius: 8px;
    padding: 5px;
    margin-inline-end: 12px;
}

.mud-snackbar.mud-alert-filled-success .mud-snackbar-icon { background: var(--success-bg); color: var(--success); }
.mud-snackbar.mud-alert-filled-warning .mud-snackbar-icon { background: var(--warning-bg); color: var(--warning); }
.mud-snackbar.mud-alert-filled-error .mud-snackbar-icon { background: var(--danger-bg); color: var(--danger); }
.mud-snackbar.mud-alert-filled-info .mud-snackbar-icon,
.mud-snackbar.mud-alert-filled-normal .mud-snackbar-icon { background: var(--primary-soft); color: var(--link); }

.mud-snackbar.mud-alert-filled-success { border-left: 3px solid var(--success); }
.mud-snackbar.mud-alert-filled-warning { border-left: 3px solid var(--signal-attention); }
.mud-snackbar.mud-alert-filled-error { border-left: 3px solid var(--signal-critical); }
.mud-snackbar.mud-alert-filled-info,
.mud-snackbar.mud-alert-filled-normal { border-left: 3px solid var(--primary); }

.mud-snackbar .mud-snackbar-close-button {
    color: var(--text-secondary);
}

/* Phones: above the tab bar, not under it. */
@media (max-width: 959.98px) {
    .mud-snackbar-location-bottom-center,
    .mud-snackbar-location-bottom-left,
    .mud-snackbar-location-bottom-right {
        bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0px) + 8px);
    }
}

/* ---- Dev sign-in (/dev/sign-in, local development only) ---------------------------------- */
.dev-signin-personas {
    width: 100%;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.dev-signin-persona {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface-subtle);
}

.dev-signin-persona .ui-row-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.dev-signin-persona .ui-row-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dev-signin-persona .ui-btn {
    margin-left: auto;
    flex-shrink: 0;
}

/* =============================================================================
   Admin command palette (phase 6): sidebar button, Ctrl+K dialog, shortcuts list
   ============================================================================= */
.app-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    background: var(--surface);
    color: var(--text-secondary);
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
}

/* Only the hint for this platform (data-platform on <html>, set by app-init.js). */
.kbd-mac,
:root[data-platform='mac'] .kbd-other {
    display: none;
}

:root[data-platform='mac'] .kbd-mac {
    display: inline-flex;
}

.app-search-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 36px;
    margin: 0 0 14px;
    padding: 0 10px;
    border-radius: 9px;
    border: 1px solid var(--sidebar-border);
    background: var(--sidebar-raised);
    color: var(--sidebar-text);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
}

.app-search-btn:hover {
    background: var(--sidebar-active);
    color: #FFFFFF;
}

.app-search-btn:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 2px;
}

.app-search-btn .ui-icon {
    width: 16px;
    height: 16px;
}

.app-search-label {
    flex-grow: 1;
}

.app-search-btn .app-kbd {
    background: transparent;
    border-color: var(--sidebar-border);
    color: var(--sidebar-muted);
}

dialog.cmdk {
    width: min(680px, calc(100vw - 32px));
    max-height: min(620px, calc(100vh - 96px));
    margin: 12vh auto auto;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 24px 64px rgba(12, 23, 51, 0.28), 0 2px 6px rgba(12, 23, 51, 0.12);
    overflow: hidden;
}

dialog.cmdk[open] {
    display: flex;
    flex-direction: column;
}

dialog.cmdk::backdrop {
    background: rgba(12, 23, 51, 0.42);
}

.cmdk-input {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 58px;
    padding: 0 18px;
    border-bottom: 1px solid var(--divider);
    flex-shrink: 0;
}

.cmdk-input .ui-icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.cmdk-input input {
    flex-grow: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 16px;
    color: var(--text);
}

.cmdk-list {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 8px;
    flex-grow: 1;
}

.cmdk-group {
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 12px 16px 6px;
}

.cmdk-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 6px 12px;
    margin: 0 6px;
    border-radius: 8px;
    font-size: 13.5px;
    color: var(--text);
    text-decoration: none;
}

.cmdk-item:hover {
    color: var(--text);
}

.cmdk-item[aria-selected='true'] {
    background: var(--row-selected);
}

.cmdk-tile {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: var(--surface-muted);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cmdk-tile .ui-icon {
    width: 16px;
    height: 16px;
}

.cmdk-tile.initials {
    background: var(--primary);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 600;
}

.cmdk-text {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.cmdk-title {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cmdk-sub {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cmdk-item mark {
    background: color-mix(in srgb, var(--signal-attention) 30%, transparent);
    color: inherit;
    border-radius: 2px;
}

.cmdk-meta {
    font-size: 13px;
    flex-shrink: 0;
}

.cmdk-item .ui-chip {
    flex-shrink: 0;
}

.cmdk-enter {
    visibility: hidden;
}

.cmdk-item[aria-selected='true'] .cmdk-enter {
    visibility: visible;
}

.cmdk-empty {
    padding: 28px 18px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13.5px;
}

.cmdk-foot {
    display: flex;
    gap: 18px;
    align-items: center;
    height: 40px;
    padding: 0 16px;
    border-top: 1px solid var(--divider);
    background: var(--surface-muted);
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.cmdk-foot > span {
    display: flex;
    gap: 6px;
    align-items: center;
}

.cmdk-foot-end {
    margin-left: auto;
}

.shortcuts-list {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shortcuts-list > div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    font-size: 13.5px;
}

.shortcuts-list dt {
    display: flex;
    gap: 4px;
}

.shortcuts-list dd {
    margin: 0;
}

@media (max-width: 599.98px) {
    dialog.cmdk {
        margin-top: 16px;
        max-height: calc(100vh - 32px);
    }

    .cmdk-foot,
    .cmdk-meta {
        display: none;
    }
}

/* An invoice's summary falls back to all its line descriptions, which can be long: two lines at most in the list. */
.billing-summary {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}


/* Backups tab: a summary of what's there, then the snapshots as a grid that uses the full width. */
.hosting-backup-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--divider);
}

.hosting-backup-summary > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 16px 20px;
    min-width: 0;
}

.hosting-backup-summary > div + div {
    border-left: 1px solid var(--divider);
}

.hosting-backup-summary-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.hosting-backup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin: 0;
    padding: 16px 20px;
    list-style: none;
}

.hosting-backup-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    min-width: 0;
}

.hosting-backup-item.latest {
    border-color: var(--success-bg);
    background: var(--success-bg);
}

.hosting-backup-item .ui-row-text {
    flex: 1;
}

@media (max-width: 599.98px) {
    .hosting-backup-summary {
        grid-template-columns: minmax(0, 1fr);
    }

    .hosting-backup-summary > div + div {
        border-left: 0;
        border-top: 1px solid var(--divider);
    }

    .hosting-backup-summary > div {
        padding: 12px 16px;
    }

    .hosting-backup-grid {
        padding: 12px 16px;
    }
}


/* Hosting health on the Hosting page (no account selected): its own heading row, then the page's gap. */
.hosting-health-overview {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hosting-health-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 16px;
    flex-wrap: wrap;
}


/* Collapsible information cards on the Hosting health overview (not monitored, monitors without a customer). */
.hosting-collapse-heading {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
}

.hosting-collapse-toggle {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 14px 20px;
    border: 0;
    background: none;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.hosting-collapse-toggle:hover {
    background: var(--surface-subtle);
}

.hosting-collapse-toggle .ui-row-text {
    flex: 1;
    min-width: 0;
}

.hosting-collapse-chevron {
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: transform 150ms ease;
}

.hosting-collapse-toggle[aria-expanded='true'] .hosting-collapse-chevron {
    transform: rotate(180deg);
}

.hosting-collapse-toggle[aria-expanded='true'] {
    border-bottom: 1px solid var(--divider);
}

.hosting-collapse-empty {
    margin: 0;
    padding: 12px 20px;
}

@media (max-width: 599.98px) {
    .hosting-collapse-toggle {
        padding: 12px 16px;
    }
}


/* Wizard step 1: the chosen backup, collapsed (looks like the selected radio card), with "Change". */
.restore-chosen {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--primary);
    border-radius: 10px;
    background: var(--row-selected);
    box-shadow: 0 0 0 1px var(--primary);
}

.restore-chosen .ui-radio-icon {
    background: var(--primary-soft);
    color: var(--link);
}

.restore-chosen .ui-row-text {
    flex: 1;
    min-width: 0;
}

/* Hosting Overview: "What takes up space" (disk usage per website, email, databases, other). */
.hosting-disk {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hosting-disk-bar {
    display: flex;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-muted);
}

.hosting-disk-seg {
    /* Keep tiny categories proportional; a minimum width makes rounded 0% items look significant. */
    flex: 0 0 auto;
}

.hosting-disk-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hosting-disk-list li {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto 44px;
    align-items: center;
    gap: 10px;
}

.hosting-disk-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hosting-disk-list li > :last-child {
    text-align: right;
}

.hosting-disk-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.hosting-disk-seg.site-0, .hosting-disk-swatch.site-0 { background: var(--primary); }
.hosting-disk-seg.site-1, .hosting-disk-swatch.site-1 { background: var(--orange); }
.hosting-disk-seg.site-2, .hosting-disk-swatch.site-2 { background: var(--primary-border); }
.hosting-disk-seg.email, .hosting-disk-swatch.email { background: var(--success); }
.hosting-disk-seg.db, .hosting-disk-swatch.db { background: var(--signal-attention); }
.hosting-disk-seg.other, .hosting-disk-swatch.other { background: var(--neutral); }

/* Hosting Overview: website health (score rings) beside "What takes up space" (hover for details). */
.hosting-grid.hosting-grid-health {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}

.wh-list {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wh-site {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 20px;
}

.wh-site + .wh-site {
    border-top: 1px solid var(--border);
}

.wh-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
}

.wh-domain {
    font-weight: 500;
    overflow-wrap: anywhere;
}

.wh-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.wh-rings {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.wh-ring-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.wh-ring {
    --wh-color: var(--neutral);
    position: relative;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: conic-gradient(var(--wh-color) calc(var(--v) * 1%), var(--surface-muted) 0);
    font-size: 18px;
    font-weight: 600;
}

.wh-ring::before {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: var(--surface);
}

.wh-ring > span {
    position: relative;
}

.wh-ring.ok { --wh-color: var(--success); }
.wh-ring.warn { --wh-color: var(--warning); }
.wh-ring.bad { --wh-color: var(--danger); }
.wh-ring.none { --wh-color: var(--surface-muted); color: var(--text-secondary); }

.wh-ring-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.hosting-disk-bar {
    position: relative;
    height: 16px;
    overflow: visible;
    gap: 2px;
    background: transparent;
}

.hosting-disk-seg {
    /* Shrinks with the bar (the gaps and 3px minimums would otherwise push it past the card edge). */
    flex: 0 1 auto;
    min-width: 3px;
    border-radius: 4px;
    transition: filter 0.12s ease;
}

.hosting-disk-bar:hover .hosting-disk-seg:not(:hover) {
    filter: opacity(0.45);
}

.hosting-disk-seg:focus-visible {
    outline: 2px solid var(--focus-ring, var(--primary));
    outline-offset: 2px;
}

/* The tip hangs below the bar, positioned against the bar (not the segment) and pinned to its
   edges near the ends, so it never leaves the card. */
.hosting-disk-seg::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 8px);
    left: var(--tip-x, 50%);
    z-index: 5;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%);
    transition: opacity 0.12s ease;
}

.hosting-disk-seg.tip-start::after {
    left: 0;
    transform: none;
}

.hosting-disk-seg.tip-end::after {
    left: auto;
    right: 0;
    transform: none;
}

.hosting-disk-seg:hover::after,
.hosting-disk-seg:focus-visible::after {
    opacity: 1;
}

.wh-more {
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--border);
}

.hosting-disk-list li {
    padding: 4px 6px;
    margin: 0 -6px;
    border-radius: var(--radius);
}

.hosting-disk-list li:hover {
    background: var(--surface-muted);
}

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

@media (max-width: 599.98px) {
    .wh-rings {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Admin mileage page: a month's heading row inside the rides table. */
.ui-table .mileage-month th,
.ui-table .mileage-month td {
    background: var(--surface-subtle);
    font-weight: 600;
}

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

/* Hosting Websites tab (admin): a website's error log. */
.hosting-errorlog-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.hosting-errorlog-controls .ui-field {
    min-width: 180px;
}

.hosting-errorlog {
    max-height: 480px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
    border-top: 1px solid var(--divider);
}

.hosting-errorlog li {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--divider);
}

.hosting-errorlog-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.hosting-errorlog-message {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (max-width: 599.98px) {
    .hosting-errorlog li {
        padding: 10px 16px;
    }
}

/* Billing: the "send for signing" dialog while it looks up the recipient. */
.billing-signing-sk {
    height: 40px;
}

/* Support attachments: the picker under a reply / new request, and the files under a message. */
.ui-attach {
    align-items: flex-start;
    gap: 8px;
}

.ui-attach-pick {
    cursor: pointer;
}

.ui-attach-pick[aria-disabled='true'] {
    opacity: 0.5;
    cursor: not-allowed;
}

.ui-attach-pick:has(input:focus-visible) {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

:root[data-theme='dark'] .ui-attach-pick:has(input:focus-visible) {
    outline-color: var(--link);
}

.ui-attach-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-self: stretch;
}

.ui-attach-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 13px;
}

.ui-attach-list .ui-attach-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ui-attach-list.links a.ui-attach-name {
    color: var(--link);
}

/* =============================================================================
   Notifications: customer inbox, home banners, topbar bell, admin composer.
   ============================================================================= */
/* Keep the inbox visible while reading a linked notification. */
.notif-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.notif-layout.has-selection {
    grid-template-columns: minmax(0, 1fr) 360px;
}

.notif-list,
.notif-detail {
    min-width: 0;
}

.notif-detail {
    position: sticky;
    top: 20px;
    overflow-wrap: anywhere;
}

.notif-detail-close {
    justify-content: flex-end;
}

.notif-row.selected {
    background: var(--primary-soft);
    box-shadow: inset 3px 0 var(--primary);
}

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

    .notif-detail {
        position: static;
        grid-row: 1;
    }
}

.notif-groups {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notif-group-title {
    margin: 12px 2px 0;
}

.notif-row {
    gap: 12px;
}

.notif-dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
}

.notif-row.unread .notif-dot {
    background: var(--primary);
}

.notif-row.unread .ui-row-title {
    font-weight: 650;
}

.notif-snippet {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-meta {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.notif-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.notif-filters .ui-select {
    width: auto;
    min-width: 200px;
}

.notif-detail-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.notif-detail-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.notif-body {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.6;
}

.notif-banners {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ui-banner.info {
    border-color: var(--primary-soft);
    background: var(--primary-soft);
    color: var(--link);
}

.ui-banner.ok {
    border-color: var(--success-bg);
    background: var(--success-bg);
    color: var(--success);
}

.notif-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.notif-banner-text .notif-body {
    font-size: 13px;
    line-height: 1.45;
}

.notif-banner-actions {
    display: flex;
    flex: none;
    align-items: center;
    gap: 8px;
}

/* The phone's bell sits in the top bar next to search; the desktop sidebar has its own link. */
.app-topbar-bell {
    position: relative;
    text-decoration: none;
}

.app-topbar-search + .app-topbar-bell {
    margin-left: 0;
}

.app-topbar-bell-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--signal-critical);
    border: 2px solid var(--surface);
}

.notif-lang-grid,
.notif-compose-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.notif-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 0;
    font-size: 13px;
}

.notif-summary b {
    font-variant-numeric: tabular-nums;
}

.notif-preview {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
}

.notif-customer-list {
    max-height: 240px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.notif-details > summary {
    cursor: pointer;
    font-size: 13px;
    color: var(--link);
}

.notif-details > summary:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 2px;
}

.notif-details ul {
    margin: 8px 0 0;
    padding-left: 18px;
    font-size: 13px;
}

.notif-figures {
    font-variant-numeric: tabular-nums;
}

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

@media (max-width: 599.98px) {
    /* Dot | icon | text, with the chip and time under the text. */
    .notif-row {
        display: grid;
        grid-template-columns: 8px 40px minmax(0, 1fr);
        column-gap: 12px;
        row-gap: 8px;
        align-items: start;
    }

    .notif-row .notif-dot {
        margin-top: 16px;
    }

    .notif-row .ui-row-text,
    .notif-row .notif-meta {
        grid-column: 3;
    }

    .notif-row .ui-icon-tile {
        grid-row: 1 / span 2;
    }

    .notif-meta {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .ui-banner.notif-banner {
        flex-wrap: wrap;
    }
}

/* ---- Microsoft 365 card (admin): role groups, group picker, recent activity. ---- */
.m365-roles {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--divider);
}

/* Recent activity is a native <details>, closed by default; the summary row is the heading. */
.m365-setup {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--divider);
}

.m365-setup-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    list-style: none;
}

.m365-setup-summary::-webkit-details-marker {
    display: none;
}

.m365-setup-summary::before {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--text-secondary);
    border-bottom: 2px solid var(--text-secondary);
    transform: rotate(-45deg);
    transition: transform 0.15s;
}

.m365-setup[open] > .m365-setup-summary::before {
    transform: rotate(45deg);
}

.m365-setup-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.m365-setup-step {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.m365-setup-step .ui-chip {
    flex: 0 0 auto;
    min-width: 72px;
    justify-content: center;
}

.m365-setup-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.m365-activity {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--divider);
}

.m365-activity-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    list-style: none;
}

.m365-activity-summary::-webkit-details-marker {
    display: none;
}

.m365-activity-summary::before {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--text-secondary);
    border-bottom: 2px solid var(--text-secondary);
    transform: rotate(-45deg);
    transition: transform 0.15s;
}

.m365-activity[open] > .m365-activity-summary::before {
    transform: rotate(45deg);
}

.m365-activity-summary .ui-label {
    margin: 0;
}

.m365-activity-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.m365-role-list,
.m365-activity-list,
.m365-member-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.m365-role-group-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--divider);
}

.m365-role-group-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.m365-role {
    padding: 12px 0;
    border-top: 1px solid var(--divider);
}

.m365-role:first-child {
    padding-top: 0;
    border-top: 0;
}

.m365-role-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 16px;
    flex-wrap: wrap;
}

.m365-role-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 13px;
    font-weight: 500;
}

.m365-role-group .ui-icon {
    width: 16px;
    height: 16px;
}

/* Names and addresses have no break opportunities: let them wrap instead of pushing the card wider on a phone. */
.m365-role-group,
.m365-member-list li > span,
.m365-activity-list .ui-row-title,
.m365-activity-list .ui-row-sub {
    min-width: 0;
    overflow-wrap: anywhere;
}

.m365-members {
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-subtle);
}

.m365-member-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    padding: 4px 0;
    font-size: 13px;
}

.m365-activity-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--divider);
}

.m365-activity-list li:first-child {
    border-top: 0;
}

.m365-picker-search {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.m365-picker-search .ui-search {
    flex: 1 1 220px;
    width: auto;
}

.m365-picker-results {
    max-height: 360px;
    overflow-y: auto;
}

/* Sign in with Microsoft (admin, inside the Microsoft 365 card): switch, multi-factor choice, approval link, accounts. */
.m365-sso {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--divider);
}

.m365-sso-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.m365-sso-accounts-heading {
    margin-top: 6px;
}

.m365-accounts {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.m365-accounts li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 0;
    border-top: 1px solid var(--divider);
}

.m365-accounts li:first-child {
    border-top: 0;
}

.m365-accounts .ui-row-title,
.m365-accounts .ui-row-sub {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* The customer's own Microsoft 365 page. */
.m365-overview {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.m365-rights {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.m365-rights li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}

/* Rename a push device: the form stays closed until asked for. */
.push-rename { margin-top: 4px; }
.push-rename > summary { cursor: pointer; color: var(--link); font-size: 13px; }
.push-rename-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.push-rename-form .ui-input { flex: 1 1 180px; min-width: 0; max-width: 360px; }

/* Every device (and the category list) is its own form, so its first row is a first child: keep the dividers the kit gives rows in one list. */
.push-card form > .ui-row:first-child { border-top: 1px solid var(--divider); }
.ui-row.push-device { align-items: flex-start; }
.push-device .ui-icon-tile { flex-shrink: 0; }
.push-device .ui-row-title .ui-chip { margin-left: 6px; vertical-align: middle; }
/* "This device" is decided in the browser (app-init.js sets data-this-device); the button is hidden once this device is registered. */
.push-device:not([data-this-device]) .push-this-device { display: none; }
[data-ui-action="enable-push"][hidden] { display: none; }

/* Microsoft 365 request forms share the kit and stack on phones. */
.m365-requests { display: grid; gap: 24px; min-width: 0; }
.m365-request-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 16px 0; }
.m365-request-fields .ui-input, .m365-request-fields .ui-select { width: 100%; box-sizing: border-box; min-width: 0; }
.m365-request-fields > .ui-field { min-width: 0; }
.m365-request-meta { display: flex; align-items: center; gap: 16px; }
.m365-request-row .ui-row-sub { overflow-wrap: anywhere; }
.m365-link-fields, .m365-request-detail { display: grid; gap: 16px; }
.m365-request-detail .mono { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 599.98px) {
    .m365-request-fields { grid-template-columns: minmax(0, 1fr); }
    .m365-request-row { flex-wrap: wrap; }
    .m365-request-row .ui-row-text { flex-basis: calc(100% - 40px); }
    .m365-request-meta { flex: 1; flex-wrap: wrap; gap: 8px; }
    .m365-request-row > .ui-icon { margin-left: auto; }
}

/* The approver edits the part before the @; the domain is fixed and shown next to it. */
.m365-upn { display: flex; align-items: center; gap: 8px; min-width: 0; }
.m365-upn .ui-input { flex: 1; min-width: 0; }
.m365-upn .ui-muted { overflow-wrap: anywhere; }

/* Long lists of groups and people scroll inside their own box instead of being cut off. `.ui-card.clip` hides overflow, so the
   picker needs the two-class selector to win. */
.ui-card.m365-picker-results {
    max-height: 360px;
    overflow-y: auto;
}

.m365-member-list {
    max-height: 320px;
    overflow-y: auto;
}

.m365-groups > .m365-role-list {
    max-height: 560px;
    overflow-y: auto;
}

/* Registered groups: the name gets a full line of its own when the card is narrow (never a letter per line), the chips follow it and the
   buttons sit at the right edge, wrapping underneath when they do not fit. Flex-wrap reacts to the card's own width, which a viewport
   media query cannot (the card sits next to the sidebar on desktop). */
.m365-group-cols {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.m365-group-cols .m365-role-group {
    flex: 1 1 260px;
    margin-top: 0;
    overflow-wrap: break-word;
}

.m365-group-cols .ui-chip {
    flex: 0 1 auto;
    max-width: 100%;
}

.m365-group-pattern {
    overflow-wrap: anywhere;
}

.m365-group-cols .ui-actions {
    margin-left: auto;
    flex: 0 1 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 599.98px) {
    .m365-group-cols .ui-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
    }
}

/* Approved features list on the Microsoft 365 card. */
.m365-perm-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.m365-perm-list li {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
}

.m365-perm-list .ui-chip {
    justify-self: start;
}

.m365-perm-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-wrap: anywhere;
}

.m365-perms {
    margin-top: 14px;
}

/* Groups panel, below the list: the two switches, the patterns and the managers lists. Everything wraps with the card's own width. */
.m365-group-switch {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.m365-group-switch .ui-check:not(:first-child) {
    margin-top: 10px;
}

.m365-group-switch .ui-muted {
    margin: 0 0 0 28px;
}

.m365-patterns {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--divider);
}

.m365-patterns > .ui-muted {
    margin: 2px 0 8px;
}

.m365-patterns .m365-picker-search {
    margin: 12px 0 0;
}

.m365-patterns .m365-picker-search .ui-input {
    flex: 1 1 220px;
    min-width: 0;
    width: auto;
}

.m365-manager-list li {
    justify-content: space-between;
    gap: 6px 12px;
    padding: 8px 0;
    border-top: 1px solid var(--divider);
}

.m365-manager-list li:first-child {
    border-top: 0;
}

.m365-manager-list li > span {
    flex: 1 1 160px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.m365-members > .ui-btn {
    margin-top: 8px;
}

@media (max-width: 599.98px) {
    .m365-members {
        padding: 10px 12px;
    }

    .m365-patterns .m365-picker-search .ui-btn {
        flex: 1 1 100%;
    }

    .m365-group-switch .ui-muted {
        margin-left: 0;
    }
}

/* ---- Microsoft 365 redesign: one card with a header and tabs (admin), a hero and tabs (customer). Everything rarely needed sits in a
   quiet <details> or its own tab. Colours only through tokens. ---- */
.m365-card {
    padding: 0;
}

.m365-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 20px 24px;
}

.m365-tile {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: var(--primary-soft);
    color: var(--link);
}

.m365-tile .ui-icon {
    width: 22px;
    height: 22px;
}

.m365-hero-text {
    flex: 1 1 200px;
    min-width: 0;
}

.m365-hero-text .ui-h2 {
    margin: 0;
}

.m365-hero-sub {
    margin: 2px 0 0;
    overflow-wrap: anywhere;
}

.m365-hero-actions {
    margin-left: auto;
}

.m365-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 24px 24px;
    min-width: 0;
}

.m365-hero + .m365-body {
    border-top: 1px solid var(--divider);
}

.m365-tabs {
    padding: 0 24px;
    gap: 22px;
    border-top: 1px solid var(--divider);
}

.m365-area-tabs {
    padding: 0;
    margin-bottom: 16px;
    border-top: 0;
}

.m365-tab-badge {
    margin-left: 2px;
}

.m365-stack {
    gap: 24px;
}

.m365-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.m365-section > p {
    margin: 0;
}

.m365-member-list li > .ui-btn {
    margin-left: auto;
}

.m365-stack > .m365-section:not(:first-child) {
    padding-top: 24px;
    border-top: 1px solid var(--divider);
}

.m365-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.m365-section-intro {
    flex: 1 1 260px;
    min-width: 0;
}

.m365-section-intro p {
    margin: 2px 0 0;
}

.m365-section-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.m365-intro-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
}

.m365-lead {
    margin: 0;
}

/* The old section wrappers carried their own dividers and margins; inside the tabs the stack does that. */
.m365-roles.m365-section,
.m365-setup.m365-section,
.m365-perms.m365-section,
.m365-activity.m365-section,
.m365-sso.m365-section {
    margin: 0;
    padding: 0;
    border: 0;
}

.m365-stack > .m365-section.m365-roles:not(:first-child),
.m365-stack > .m365-section.m365-perms:not(:first-child) {
    padding-top: 24px;
    border-top: 1px solid var(--divider);
}

/* Feature rows on the overview: what is switched on, one click to where it is changed. */
.m365-features {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    overflow: hidden;
}

.m365-features li + li {
    border-top: 1px solid var(--divider);
}

.m365-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    border: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.m365-feature:hover {
    background: var(--surface-subtle);
}

.m365-feature:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.m365-feature > .ui-icon:last-child {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-tertiary);
}

.m365-feature-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: var(--surface-muted);
    color: var(--text-secondary);
}

.m365-feature-icon.ok {
    background: var(--success-bg);
    color: var(--signal-healthy);
}

.m365-feature-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* The one prompt that something is left to set up, instead of the whole checklist on top. */
.m365-nudge {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--warning-border);
    border-radius: var(--radius-card);
    background: var(--warning-bg);
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.m365-nudge-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.m365-nudge > .ui-icon:last-child {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

/* Numbered steps (connect a tenant, switch on sign-in). */
.m365-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.m365-step {
    display: flex;
    align-items: center;
    gap: 12px;
}

.m365-step-n {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    background: var(--surface-muted);
    color: var(--text-secondary);
}

.m365-step.current .m365-step-n {
    background: var(--primary-soft);
    color: var(--link);
    box-shadow: inset 0 0 0 1.5px var(--primary-border);
}

.m365-step.done .m365-step-n {
    background: var(--success-bg);
    color: var(--signal-healthy);
}

.m365-step-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.m365-steps-compact {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface-subtle);
}

.m365-switch {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Details nobody needs every day: a quiet line that opens in place. */
.m365-quiet {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 0 14px;
}

.m365-quiet[open] {
    padding-bottom: 14px;
}

.m365-quiet > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    list-style: none;
}

.m365-quiet > summary::-webkit-details-marker {
    display: none;
}

.m365-quiet > summary::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-right: 1.75px solid var(--text-tertiary);
    border-bottom: 1.75px solid var(--text-tertiary);
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.m365-quiet[open] > summary::after {
    transform: rotate(-135deg);
}

.m365-quiet > summary:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 6px;
}

.m365-patterns {
    margin: 0;
}

.m365-group-switch {
    margin-bottom: 0;
}

/* People: a round monogram instead of a bare name. */
.m365-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: var(--primary-soft);
    color: var(--link);
}

.m365-member-list li,
.m365-accounts li {
    align-items: center;
}

.m365-member-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.m365-accounts li > .ui-row-text {
    flex: 1;
}

/* Role groups: two side by side on a wide card, stacked on a narrow one. */
.m365-role-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.m365-role-cards > .m365-role,
.m365-role-cards > .m365-role:first-child {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 14px;
    background: var(--surface);
}

.m365-role-empty {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0 0;
}

.m365-role-empty .ui-icon {
    width: 14px;
    height: 14px;
    color: var(--signal-attention);
}

/* Groups list as a bordered list of rows. */
.m365-group-list {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
}

.m365-group-list > .m365-role-group-row {
    padding: 4px 14px;
}

.m365-group-list > .m365-role-group-row:first-child {
    border-top: 0;
}

.m365-setup-step.is-done {
    opacity: 0.8;
}

/* Request progress and the new-request form. */
.m365-progress {
    list-style: none;
    margin: 0 0 4px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
}

.m365-progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.m365-progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
}

.m365-progress-step.done {
    color: var(--text);
}

.m365-progress-step.done .m365-progress-dot {
    background: var(--signal-healthy);
    border-color: var(--signal-healthy);
}

.m365-progress-step.current {
    color: var(--text);
    font-weight: 600;
}

.m365-progress-step.current .m365-progress-dot {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.m365-progress-step.bad {
    color: var(--text);
    font-weight: 600;
}

.m365-progress-step.bad .m365-progress-dot {
    background: var(--signal-critical);
    border-color: var(--signal-critical);
}

.m365-form-section {
    margin: 0 0 14px;
    padding: 0;
    border: 0;
    min-width: 0;
}

.m365-form-title {
    padding: 0;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.m365-form-section .m365-request-fields {
    margin: 0;
}

.m365-address {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--surface-subtle);
}

.m365-address-preview {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 13px;
}

.m365-chosen {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 0;
}

/* Customer page: the rights as plain rows. */
.m365-overview .m365-rights {
    gap: 12px;
}

.m365-overview .m365-rights li {
    flex-wrap: nowrap;
    gap: 12px;
}

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

@media (max-width: 599.98px) {
    .m365-hero {
        padding: 16px;
    }

    .m365-body {
        padding: 16px;
    }

    .m365-tabs {
        padding: 0 16px;
        gap: 18px;
    }

    .m365-hero-actions {
        margin-left: 0;
        width: 100%;
    }

    .m365-feature .ui-chip {
        display: none;
    }
}

/* Notices for finished backup tasks: fixed at the top right, above the page content. */
.hosting-toasts {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1400;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(380px, calc(100vw - 32px));
}

.hosting-toast {
    box-shadow: var(--shadow-float);
    background: var(--surface);
}

@media (max-width: 599.98px) {
    .hosting-toasts {
        top: 8px;
        right: 8px;
        left: 8px;
        max-width: none;
    }
}
/* The domains card clips and scrolls its table, and the Microsoft 365 groups list scrolls inside its own box; both would cut
   off the row menu: the panel is fixed to the viewport instead, and app-init.js puts it under its button when it opens. */
.hosting-domains-card .app-menu.ui-dropdown .app-menu-panel,
.m365-groups .app-menu.ui-dropdown .app-menu-panel,
.adm-accounts-card .app-menu.ui-dropdown .app-menu-panel {
    position: fixed;
    right: auto;
    min-width: 220px;
    max-width: calc(100vw - 16px);
}

/* Accounts overview: a long address wraps instead of making the table scroll sideways on a phone. */
.adm-accounts-card .adm-accounts-email {
    overflow-wrap: anywhere;
}

@media (max-width: 599.98px) {
    .adm-accounts-card th,
    .adm-accounts-card td {
        padding-inline: 8px;
    }
}

/* The remove button of a person sits at the end of its row, as a small icon button. */
.m365-member-list li > .ui-btn.icon {
    margin-left: auto;
    flex: none;
}

/* One way to show a person on every Microsoft 365 screen (Components/Pages/M365PersonRow.razor): monogram, name with the sign-in name
   under it, optional chips, actions at the end. Rows that contain it only add their own padding and dividers. */
.m365-person {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
}

.m365-person-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.m365-person-name {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
    overflow-wrap: anywhere;
}

.m365-person-detail {
    font-size: 12px;
    color: var(--text-tertiary);
    overflow-wrap: anywhere;
}

.m365-person-chips,
.m365-person-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
}

.m365-person-chips:empty,
.m365-person-actions:empty {
    display: none;
}

.m365-member-list li,
.m365-manager-list li,
.m365-accounts li {
    padding: 8px 0;
    border-top: 1px solid var(--divider);
}

.m365-member-list li:first-child,
.m365-manager-list li:first-child,
.m365-accounts li:first-child {
    border-top: 0;
}

.m365-chosen > .m365-person {
    flex: 0 1 auto;
}

/* A person with several customers: the customer switcher sits above the billing/hosting switcher. */
.app-customer-switch {
    margin-bottom: 8px;
}

.c360-user-others {
    display: block;
}

/* A manager that is an Entra group: a group icon instead of the monogram; the person detail's monospace is for sign-in names. */
.m365-avatar.group .ui-icon,
.m365-avatar.group svg {
    width: 16px;
    height: 16px;
}

.m365-manager-kind {
    margin-bottom: 12px;
}

/* Sortable / filterable table headings (Ui/UiTableHead, Ui/UiTableFilterBar). The heading is a sort button plus a funnel
   that opens a small panel; the panel is fixed to the viewport (placed by app-init.js) because .ui-table-wrap scrolls and
   would clip it. */
.ui-th-inner {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.ui-th-sort {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    padding: 4px 6px;
    margin: 0 -6px;
    border-radius: 6px;
    cursor: pointer;
}

.ui-th-sort:hover,
.ui-th-filter-btn:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.ui-th-sort:focus-visible,
.ui-th-filter-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.ui-th-sort .ui-th-arrow {
    width: 14px;
    height: 14px;
    opacity: 0;
}

.ui-th-sort:hover .ui-th-arrow,
.ui-th-sort:focus-visible .ui-th-arrow {
    opacity: 0.55;
}

.ui-th[aria-sort='ascending'] .ui-th-arrow,
.ui-th[aria-sort='descending'] .ui-th-arrow {
    opacity: 1;
    color: var(--link);
}

.ui-th[aria-sort='ascending'],
.ui-th[aria-sort='descending'] {
    color: var(--text);
}

.ui-th-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
    list-style: none;
    color: var(--text-secondary);
    opacity: 0.55;
}

.ui-th-filter-btn::-webkit-details-marker {
    display: none;
}

.ui-th-filter-btn .ui-icon {
    width: 14px;
    height: 14px;
}

.ui-th:hover .ui-th-filter-btn,
.ui-th-filter-btn:focus-visible,
.ui-th-filter[open] .ui-th-filter-btn {
    opacity: 1;
}

.ui-th-filter-btn.active {
    opacity: 1;
    color: var(--link);
    background: var(--primary-soft);
}

.ui-th-filter .app-menu-panel {
    position: fixed;
    right: auto;
    width: 260px;
    max-width: calc(100vw - 16px);
    padding: 8px;
    gap: 6px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    white-space: normal;
}

.ui-th-filter .app-menu-heading {
    padding: 2px 2px 0;
}

.ui-th-choice {
    gap: 10px;
    min-height: 32px;
    padding: 0 4px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text);
}

.ui-th-choice:hover {
    background: var(--surface-muted);
}

.ui-th-choice-label {
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ui-th-choice-count {
    font-size: 12px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.ui-th-clear {
    align-self: flex-start;
}

.ui-table-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--divider);
}

.ui-table-filter-chip {
    height: 26px;
    padding-right: 4px;
}

.ui-table-filter-chip button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 0;
}

.ui-table-filter-chip button:hover {
    background: var(--surface-muted);
}

.ui-table-filter-chip .ui-icon {
    width: 12px;
    height: 12px;
}

/* Off-the-books appointments: still clearly there for the admin, but quieter than a normal booking. */
.appt-offbooks {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
}

.appt-offbooks-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.appt-offbooks-text .ui-field-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wk-ev.offbooks {
    border-style: dashed;
    opacity: 0.85;
}

.wk-ev.offbooks b svg {
    width: 12px;
    height: 12px;
    margin-right: 4px;
    vertical-align: -1px;
    opacity: 0.8;
}

.appt-offbooks-mark {
    display: inline-flex;
    margin-left: 6px;
    color: var(--text-secondary);
    vertical-align: middle;
}

.appt-offbooks-mark svg {
    width: 13px;
    height: 13px;
}


/* Price list (admin): the comparison dialog's per-product cards. */
.pl-sync-card {
    flex-shrink: 0;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.pl-sync-card .ui-table {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
}

.pl-sync-card th,
.pl-sync-card td {
    white-space: normal;
    overflow-wrap: anywhere;
}

.pl-sync-card th:first-child,
.pl-sync-card td:first-child {
    width: 26%;
}

.pl-sync-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.pl-sync-list {
    flex-shrink: 0;
    max-height: 240px;
    overflow-y: auto;
}

.pl-preview {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--surface-muted, var(--divider));
    font-size: 13px;
}

.pl-vat-line {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Quotation builder (admin): a two-column page, the form on the left and a sticky rail with the price box, checklist and actions. */
.qb-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
    align-items: start;
}

.qb-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.qb-rail {
    position: sticky;
    top: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.qb-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
}

.qb-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.qb-card-head .ui-h2,
.qb-card > .ui-h2 {
    margin: 0;
}

.qb-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.qb-pick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.qb-pick .ui-select {
    flex: 1 1 220px;
    min-width: 0;
}

.qb-line,
.qb-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-subtle);
}

.qb-line.optional {
    border-style: dashed;
}

.qb-line-main {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* The generated free-domain discount: one read-only row, set off from the editable lines. */
.qb-line.qb-line-auto {
    padding: 10px 14px;
    margin-top: -6px;
    background: var(--surface);
}

.qb-line-auto-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.qb-line-auto-main .ui-row-text {
    flex: 1 1 200px;
    min-width: 0;
}

.qb-grow {
    flex: 1 1 240px;
    min-width: 0;
}

.qb-narrow {
    flex: 0 1 130px;
    min-width: 96px;
}

.qb-line-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.qb-amount {
    margin-left: auto;
    font-weight: 600;
}

.qb-eyebrow {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.qb-totals {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}

.qb-total-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
}

.qb-total-row dt,
.qb-total-row dd {
    margin: 0;
}

.qb-total-row.strong {
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 15px;
    font-weight: 700;
}

.qb-optional {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
}

.qb-optional li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.qb-actions {
    gap: 10px;
}

.qb-actions .ui-btn {
    justify-content: center;
}

@media (max-width: 1199.98px) {
    .qb-layout { grid-template-columns: minmax(0, 1fr); }
    .qb-rail { position: static; }
}

@media (max-width: 599.98px) {
    .qb-two { grid-template-columns: minmax(0, 1fr); }
    .qb-narrow { flex: 1 1 120px; }
}

.qb-card textarea.ui-input {
    min-height: 96px;
    resize: vertical;
}

/* Dashboard: quotations card (a link to the quotations list, three figures). */
.adm-kpis.adm-kpis-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    color: inherit;
    text-decoration: none;
}

.adm-kpi-value.warn {
    color: var(--warning);
}

.adm-kpis.adm-quotations:hover {
    border-color: var(--border-strong, var(--divider));
}

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

    .adm-kpis-three .adm-kpi {
        border-right: 0;
        border-bottom: 1px solid var(--divider);
    }

    .adm-kpis-three .adm-kpi:last-child {
        border-bottom: 0;
    }
}

/* UiPicker: a field that opens an in-flow panel (search box + rows), the one control for choosing out of a list on the page. */
.ui-picker {
    position: relative;
    width: 100%;
}

.ui-picker > .ui-picker-field {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.ui-picker > .ui-picker-field::-webkit-details-marker {
    display: none;
}

.ui-picker[open] > .ui-picker-field {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.ui-picker-field[aria-disabled='true'] {
    opacity: 0.6;
    cursor: not-allowed;
}

.ui-picker-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ui-picker-placeholder {
    color: var(--text-secondary);
}

.ui-picker-field > .ui-icon,
.ui-picker-field > svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.ui-picker-clear {
    display: flex;
    border: 0;
    background: transparent;
    padding: 2px;
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
}

.ui-picker-clear:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

/* The list floats over the page and never pushes content down. It is fixed (so a scrolling card or a dialog body cannot clip it)
   and placed under the field by app-init.js (left/top/width/max-height, flipped above when there is no room below, kept above the
   on-screen keyboard); until it is placed it stays invisible so it never flashes in the wrong spot. */
.ui-picker > .ui-picker-panel {
    position: fixed;
    right: auto;
    margin: 0;
    z-index: 2000;
    max-height: 320px;
    overscroll-behavior: contain;
}

.ui-picker:not([data-placed]) > .ui-picker-panel {
    visibility: hidden;
}

.ui-picker-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* The search box stays at the top while a long list scrolls underneath it. */
.ui-picker-panel > .ui-searchbox,
.ui-picker-panel > .ui-searchbox-hint {
    position: sticky;
    top: -6px;
    z-index: 1;
    margin: -6px -6px 4px;
    padding: 6px;
    background: var(--surface);
}

.ui-picker-item {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    min-height: 44px;
    padding-top: 6px;
    padding-bottom: 6px;
    text-align: left;
}

.ui-picker-item-text,
.ui-picker-item-detail {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Phone: the on-screen keyboard takes half the screen, so a row is a proper touch target; 16 px in the search box stops the browser zooming in. */
@media (max-width: 599.98px) {
    .ui-picker-item {
        min-height: 48px;
        gap: 0;
    }

    .ui-picker-panel input[type='search'] {
        font-size: 16px;
    }
}

.ui-picker-item.selected {
    background: var(--primary-soft);
}

.ui-picker-item-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ui-picker-empty {
    margin: 4px 8px;
}

/* UiPicker inside the joined "name + domain" inputs: it takes its own row (its panel floats, so the group's clipping does not matter). */
.hosting-dns-input {
    flex-wrap: wrap;
}

.hosting-dns-input > .ui-picker {
    flex: 1 0 100%;
    border-top: 1px solid var(--border);
}

.hosting-dns-input > .ui-picker > .ui-picker-field {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.ui-picker.hosting-domain-picker,
.hosting-ssl-domain .ui-picker {
    width: auto;
    min-width: 200px;
    max-width: 100%;
}

/* The deposit invoice part of the Sending card: its children take part in the card's own column and gap. */
.qb-deposit {
    display: contents;
}

/* Customer: choose the optional extras of a quotation (QuotationChoiceForm, public link and portal page). */
.status-card.wide {
    max-width: 720px;
}

.qc {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 8px;
}

.qc-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.qc-line {
    align-items: flex-start;
}

.qc-extra {
    cursor: pointer;
}

.qc-amount {
    margin-left: auto;
    white-space: nowrap;
    text-align: right;
}

.qc-totals {
    background: var(--surface-2);
}

.qc-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.qc-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 0;
    text-align: center;
}

.qc-skeleton {
    height: 160px;
}

@media (max-width: 599.98px) {
    .qc-line {
        flex-wrap: wrap;
    }

    .qc-amount {
        margin-left: 0;
        text-align: left;
    }

    /* A ticked extra keeps its box and text on one line, with the price under the text. */
    .qc-extra {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: 12px;
        row-gap: 4px;
    }

    .qc-extra .qc-amount {
        grid-column: 2;
    }
}

/* The hosting subscription part of the Sending card: like the deposit part, its children take part in the card's own column and gap. */
.qb-hosting {
    display: contents;
}

.qb-hosting-dates {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 599.98px) {
    .qb-hosting-dates {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* "Calendar invite failed" callout (Admin/AppointmentCalendarRetry): text above the retry button. */
.appt-calendar-retry-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

/* Address field with suggestions (Ui/AddressInput): the popup is the shared menu panel under the text box. */
.ui-combobox {
    position: relative;
}

.ui-combobox-panel {
    top: calc(100% + 4px);
    max-height: 264px;
    overscroll-behavior: contain;
}

.ui-combobox-option {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    min-height: 48px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.ui-combobox-option.active {
    background: var(--primary-soft);
}

.ui-combobox-option .ui-picker-item-text,
.ui-combobox-option .ui-picker-item-detail {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 599.98px) {
    .ui-combobox > input {
        font-size: 16px;
    }
}
