/* ==================================================================
   Design tokens. Three themes share one set of names:
   - page:      --bg-color (the window), --sidebar-bg
   - surfaces:  --surface (cards and panels), --surface-raised (menus,
                pop-ups, the selected segment), --surface-sunken (wells),
                --field-bg (text boxes), --input-bg (tiles inside a panel)
   - text:      --text-primary, --text-secondary, --text-muted
   - lines:     --border-light / --border-medium / --border-strong
   - brand:     --accent-color, --accent-hover, --on-accent (text on it)
   Surfaces are solid, not see-through glass: crisper, and much cheaper to
   draw (no blur behind every card). --glass-bg / --glass-border are the old
   names, kept so every component still picks the new surfaces up.
   ================================================================== */
:root {
    /* Tells the browser the page is dark (Maroon and Dark): whatever it fills in by
       itself while a page changes - parts not drawn yet - is then dark, not white. */
    color-scheme: dark;
    --bg-color: #370806;
    --sidebar-bg: #2c0605;
    --surface: #44100d;
    --surface-raised: #521814;
    --surface-sunken: #2f0705;
    --field-bg: #2f0705;
    --input-bg: rgba(0, 0, 0, 0.16);
    --text-primary: #fbf3e6;
    --text-secondary: #d8b48e;
    --text-muted: #ad8b6d;
    --accent-color: #e8c396;
    --accent-hover: #f3d6b0;
    --on-accent: #3F0A08;
    --glass-bg: var(--surface);
    --glass-border: var(--border-medium);
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --table-header-bg: #3c0d0a;
    --border-light: rgba(255, 224, 194, 0.08);
    --border-medium: rgba(255, 224, 194, 0.14);
    --border-strong: rgba(255, 224, 194, 0.24);
    --hover-bg: rgba(255, 224, 194, 0.05);
    --type-internal: #a78bfa;
    --type-external: #2dd4bf;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 10px 28px -8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 28px 64px -16px rgba(0, 0, 0, 0.65);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --control-h: 2.5rem;
    --control-h-sm: 2rem;
    --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent-color) 32%, transparent);
}

[data-theme="dark"] {
    --bg-color: #0b1120;
    --sidebar-bg: #0d1526;
    --surface: #111a2d;
    --surface-raised: #18233a;
    --surface-sunken: #0a101e;
    --field-bg: #0c1424;
    --input-bg: rgba(2, 6, 23, 0.32);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #7a889e;
    --accent-color: #3b82f6;
    --accent-hover: #60a5fa;
    --on-accent: #ffffff;
    --table-header-bg: #0f1729;
    --border-light: rgba(148, 163, 184, 0.1);
    --border-medium: rgba(148, 163, 184, 0.16);
    --border-strong: rgba(148, 163, 184, 0.28);
    --hover-bg: rgba(148, 163, 184, 0.06);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 10px 28px -8px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 28px 64px -16px rgba(0, 0, 0, 0.7);
}

/* Light uses the brand maroon as its accent (the logo's colour) rather than
   a stock purple, so it reads as the same product as Maroon and Dark. */
[data-theme="light"] {
    color-scheme: light;
    --bg-color: #f4f5f7;
    --sidebar-bg: #ffffff;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --surface-sunken: #f6f7f9;
    --field-bg: #ffffff;
    --input-bg: #f9fafb;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --accent-color: #8b1d16;
    --accent-hover: #6f150f;
    --on-accent: #ffffff;
    /* Deeper status colours: the bright ones are too faint as text on white. */
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --table-header-bg: #f8f9fb;
    --border-light: rgba(17, 24, 39, 0.07);
    --border-medium: rgba(17, 24, 39, 0.12);
    --border-strong: rgba(17, 24, 39, 0.2);
    --hover-bg: rgba(17, 24, 39, 0.035);
    --type-internal: #7c3aed;
    --type-external: #0f766e;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.05);
    --shadow-md: 0 12px 28px -10px rgba(16, 24, 40, 0.18);
    --shadow-lg: 0 28px 64px -16px rgba(16, 24, 40, 0.28);
}

html {
    /* The page colour lives here, not on <body>: a transparent root makes the browser
       fill any part of the page it hasn't drawn yet with white (a white flash during
       page transitions on Maroon and Dark). */
    background-color: var(--bg-color);
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border-medium) transparent;
}

::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background-color: var(--border-medium);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent-color);
}
::-webkit-scrollbar-corner {
    background: transparent;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
/* A chart's canvas starts at the browser's default 300px before Chart.js sizes it -
   wider than a card on a 320px phone, which made the browser zoom the page out. */
canvas { max-width: 100%; }

body {
    /* Source Sans 3 = Adobe's renamed Source Sans Pro; the new name has every weight 300-700 (Pro has no 500). */
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    background-color: transparent; /* the colour is on <html>; the glow orbs show through */
    color: var(--text-primary);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 4rem 1rem;
    position: relative;
    /* Horizontal-overflow clipping lives on <html> instead of here - CSS spec
       auto-upgrades a lone non-"visible" overflow-x to make overflow-y "auto"
       too, which silently makes body register as its own scroll container
       even though it never actually scrolls (html does, and already clips
       overflow-x itself). A body that's an accidental scroll container breaks
       position:sticky for every descendant, since sticky then measures
       against body's non-scrolling box instead of the real viewport scroll. */
}
/* Buttons and form fields default to the browser's font - use the page font.
   (Code fields keep their own monospace rules further down.) */
button, input, select, textarea { font-family: inherit; }

/* Dynamic Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

/* Soft glows: the gradients fade out on their own. (They had a 100px blur filter
   too - very costly to draw, and when a page transition captured the page before
   it was drawn, that area came out white.) */
/* Now a still, faint warmth in two corners: the cards are solid, so only the
   gaps between them show it (the drifting animation was retired with the glass). */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    opacity: 0.45;
}
[data-theme="light"] .glow-orb { opacity: 0; }

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle closest-side, rgba(232, 195, 150, 0.15) 0%, rgba(232, 195, 150, 0.06) 40%, rgba(232, 195, 150, 0) 100%);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle closest-side, rgba(212, 163, 115, 0.1) 0%, rgba(212, 163, 115, 0.04) 40%, rgba(212, 163, 115, 0) 100%);
    bottom: -150px;
    right: -150px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 50px) scale(1.1); }
    100% { transform: translate(-30px, 80px) scale(0.9); }
}

.text-input {
    width: 100%;
    min-height: var(--control-h);
    background: var(--field-bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 0.55rem 0.85rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.4;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.text-input:hover:not(:focus):not(:disabled) { border-color: color-mix(in srgb, var(--text-primary) 30%, transparent); }
.text-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: var(--focus-ring);
}
.text-input:disabled { opacity: 0.6; cursor: not-allowed; }
textarea.text-input { min-height: 0; }
/* The closed <select> box picks up the theme via .text-input above, but its
   open <option> popup list is browser-rendered and won't inherit those
   colors unless set explicitly - without this it falls back to a low-contrast
   system style (light-on-light) regardless of the app's theme. */
select.text-input option {
    background: var(--bg-color);
    color: var(--text-primary);
}
.text-input[type="date"] {
    color-scheme: dark;
}
[data-theme="light"] .text-input[type="date"] {
    color-scheme: light;
}
/* Number boxes: the browser's grey spinner is hidden; app_shell.js puts a themed up/down
   pair inside the right edge instead. */
.text-input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.text-input[type="number"]::-webkit-inner-spin-button, .text-input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.num-field { position: relative; display: block; min-width: 0; }
.num-field > .text-input { padding-right: 2.4rem; }
.num-step {
    position: absolute; top: 5px; right: 5px; bottom: 5px; width: 1.55rem; display: flex; flex-direction: column; overflow: hidden;
    border-radius: calc(var(--radius) - 4px); border: 1px solid var(--border-medium); background: var(--surface-raised);
    transition: border-color 0.15s ease, opacity 0.15s ease;
}
.num-step button {
    flex: 1; display: grid; place-items: center; min-height: 0; padding: 0; border: 0; background: transparent; color: var(--text-muted);
    cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; transition: background-color 0.15s ease, color 0.15s ease;
}
.num-step button + button { border-top: 1px solid var(--border-medium); }
.num-step button:hover { color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 14%, transparent); }
.num-step button:active { background: color-mix(in srgb, var(--accent-color) 26%, transparent); }
.num-step svg { width: 11px; height: 11px; transition: transform 0.15s ease; }
.num-step button[data-dir="1"]:active svg { transform: translateY(-1px); }
.num-step button[data-dir="-1"]:active svg { transform: translateY(1px); }
.num-field:focus-within .num-step { border-color: color-mix(in srgb, var(--accent-color) 45%, var(--border-medium)); }
.num-field > .text-input:disabled + .num-step, .num-field > .text-input[readonly] + .num-step { opacity: 0.45; pointer-events: none; }
@media print { .num-step { display: none; } }
.container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 1;
}

.app-header {
    text-align: center;
    margin-bottom: 1rem;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #e0e7ff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.05em;
}

.app-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Cards and panels: a solid surface, a hairline border and a soft shadow.
   (The class name is from the old frosted-glass look.) Panels don't lift on
   hover - only things you can click do. */
.glass-panel {
    background: var(--surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
/* Clickable cards: lift a little and take the brand colour on the edge. */
button.glass-panel:hover, a.glass-panel:hover {
    border-color: color-mix(in srgb, var(--accent-color) 55%, var(--border-medium));
    box-shadow: var(--shadow-md);
}

/* Form Styles */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1.15rem;
}

label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}
/* Labels above a text box: smaller and semi-bold, like a field caption. */
.input-group > label, .settings-row label, .app-dialog-field label { font-weight: 600; font-size: 0.86rem; }

textarea {
    width: 100%;
    height: 150px;
    background: var(--field-bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 0.7rem 0.85rem;
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: var(--focus-ring);
}

/* Buttons. Three kinds - primary (solid brand colour, one per view), secondary
   (outlined), small - all the same height, corners and type. */
.btn-primary {
    width: 100%;
    min-height: var(--control-h);
    padding: 0.6rem 1.1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--accent-color);
    color: var(--on-accent);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.45rem;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--accent-color) 55%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-primary:focus-visible, .btn-secondary:focus-visible, .btn-small:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn-primary .btn-text { display: inline-flex; align-items: center; gap: 0.45rem; }

/* Loader */
.loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid color-mix(in srgb, currentColor 30%, transparent);
    border-radius: 50%;
    border-top-color: currentColor;
    animation: spin 1s ease-in-out infinite;
    position: absolute;
}

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

.btn-primary.loading .btn-text {
    opacity: 0;
}

.btn-primary.loading .loader {
    display: block;
}

/* Results Section */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.85rem 1rem;
    position: sticky;
    top: var(--shell-top, 93px); /* just below the fixed top bar (.top-nav, or the phone bar with the sidebar) */
    z-index: 50;
    background: var(--surface); /* the panel's own colour, so rows scroll under it cleanly */
    padding: 0.75rem 0;
    margin-top: -0.75rem;
}

.results-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.results-header h2 {
    font-size: 1.2rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    margin: 0;
}

.results-filters {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.filter-input.text-input {
    width: 250px;
}

/* Any <select class="text-input"> gets a consistently-positioned custom
   arrow instead of the browser's native one (which renders inconsistently
   across browsers/OSes against this dark, custom-styled input). The arrow is
   in each theme's secondary text colour. */
select.text-input {
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23d8b48e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 8l4.5 4.5L14.5 8'/%3E%3C/svg%3E");
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.3rem;
    background-image: var(--select-arrow);
    background-repeat: no-repeat;
    background-position: right 0.7rem top 50%;
    background-size: 1rem auto;
}
[data-theme="dark"] select.text-input {
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 8l4.5 4.5L14.5 8'/%3E%3C/svg%3E");
}
[data-theme="light"] select.text-input {
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 8l4.5 4.5L14.5 8'/%3E%3C/svg%3E");
}
/* The open list of a dropdown, in the app's own style rather than the browser's plain
   list with its bright blue highlight: a raised panel just under the box, rounded rows,
   a soft accent hover and the chosen one ticked. (Chrome and Edge draw it this way;
   other browsers keep their own list, coloured by the option rule further up.) */
@supports (appearance: base-select) {
    select.text-input, select.text-input::picker(select) { appearance: base-select; }
    select.text-input::picker-icon { display: none; } /* the arrow stays the one above */
    /* Drawn this way a dropdown would size to its chosen option (and jump wider and
       narrower with the choice); one without a width of its own is as wide as its
       longest option instead, as before - app_shell.js measures it into --select-fit. */
    /* Long option text stays on one line and is cut at the box's edge, as before (left
       to spill over, it made the Notifications page wider than a phone screen). */
    /* Text too long for a narrow box is cut before the arrow, never painted over it. */
    select.text-input { white-space: nowrap; overflow: clip; overflow-clip-margin: content-box; }
    /* (Over rules that only say "width: auto", which app_shell.js checked first.) */
    select.text-input[data-fit] { width: var(--select-fit, auto) !important; } /* any max-width still applies */
    select.text-input:open { border-color: var(--accent-color); box-shadow: var(--focus-ring); }
    /* Never wider than the screen: a long option (a registrar's full company name)
       wraps onto a second line instead of running off a phone's edge. */
    select.text-input::picker(select) {
        min-width: anchor-size(width);
        max-width: calc(100vw - 16px);
        max-height: min(20rem, 55vh);
        margin-block: 6px;
        padding: 0.35rem;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: var(--border-strong) transparent;
        border: 1px solid var(--border-strong);
        border-radius: 12px;
        background: var(--surface-raised);
        color: var(--text-primary);
        box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0, 0, 0, 0.12);
        opacity: 0;
        translate: 0 -6px;
        transition: opacity 0.15s ease, translate 0.18s var(--ease-out, ease-out), overlay 0.18s allow-discrete, display 0.18s allow-discrete;
    }
    /* Phones: the list lines up with its box on both sides (only a very narrow box
       gets a slightly wider list), long options wrapping. */
    @media (max-width: 600px) { select.text-input::picker(select) { width: max(anchor-size(width), 10rem); } }
    select.text-input:open::picker(select) { opacity: 1; translate: 0 0; }
    @starting-style { select.text-input:open::picker(select) { opacity: 0; translate: 0 -6px; } }
    select.text-input option {
        display: flex;
        align-items: center;
        gap: 0.55rem;
        min-height: 2.25rem;
        padding: 0.45rem 0.75rem 0.45rem 0.6rem;
        border-radius: 8px;
        background: transparent;
        color: var(--text-primary);
        font-size: 0.93rem;
        line-height: 1.3;
        white-space: normal;
        overflow-wrap: anywhere;
        cursor: pointer;
        transition: background-color 0.12s ease, color 0.12s ease;
    }
    select.text-input option::checkmark { order: 0; width: 1rem; color: var(--accent-color); font-weight: 700; }
    select.text-input option:not(:checked)::checkmark { visibility: hidden; } /* keeps the rows lined up */
    select.text-input option:hover, select.text-input option:focus-visible { background: color-mix(in srgb, var(--accent-color) 16%, transparent); outline: none; }
    select.text-input option:checked { font-weight: 650; background: color-mix(in srgb, var(--accent-color) 9%, transparent); }
    select.text-input option:checked:hover, select.text-input option:checked:focus-visible { background: color-mix(in srgb, var(--accent-color) 20%, transparent); }
    select.text-input option:disabled { opacity: 0.45; cursor: default; background: transparent; }
    select.text-input optgroup { padding-top: 0.25rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
    select.text-input optgroup option { text-transform: none; letter-spacing: normal; }
    @media (prefers-reduced-motion: reduce) { select.text-input::picker(select) { transition: none; translate: none; } }
}

.filter-select.text-input {
    width: 150px;
    padding-right: 2.3rem;
}

/* Count pill next to a heading ("35 Domains") */
.badge {
    display: inline-flex;
    align-items: center;
    background: color-mix(in srgb, var(--accent-color) 14%, transparent);
    color: var(--text-primary);
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid color-mix(in srgb, var(--accent-color) 30%, transparent);
    white-space: nowrap;
}

/* Table */
.table-container {
    overflow-x: auto;
    /* Bounded height + its own vertical scroll, rather than relying on
       whole-page scroll, is the reliable way to get a sticky <th> - Chromium
       (confirmed via direct testing) does not consistently honor
       position:sticky on table header cells when the scrolling happens at
       the page/viewport level, but does when it happens on the immediate
       scrolling ancestor. */
    overflow-y: auto;
    max-height: calc(100vh - 260px);
    border-radius: var(--radius);
    border: 1px solid var(--border-medium);
}

table {
    width: 100%;
    /* separate (not collapse) - sticky-positioned <th> cells have
       long-standing, inconsistent browser bugs inside border-collapse
       tables; border-spacing:0 keeps the visual result identical. */
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

th {
    /* Layered over the panel and page colours so it's solid: rows scrolling
       under a sticky heading must not show through (light theme's is 5% black). */
    background: var(--table-header-bg);
    padding: 0.7rem 1rem;
    font-weight: 650;
    color: var(--text-secondary);
    font-size: 0.74rem;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-medium);
    white-space: nowrap;
    position: sticky;
    top: 0; /* relative to .table-container's own scroll, not the page */
    z-index: 40;
}

th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

th.sortable:hover {
    color: var(--text-primary);
}

th.sortable::after {
    content: ' \2195'; /* Up/down arrow */
    opacity: 0.3;
    margin-left: 0.35rem;
}

th.sortable.asc::after {
    content: ' \2191'; /* Up arrow */
    opacity: 1;
    color: var(--accent-color);
}

th.sortable.desc::after {
    content: ' \2193'; /* Down arrow */
    opacity: 1;
    color: var(--accent-color);
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 0.93rem;
}

.date-cell, .actions-cell {
    white-space: nowrap;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--hover-bg);
}

.domain-name {
    font-weight: 500;
    color: var(--domain-color);
}
.domain-name a.domain-link {
    color: inherit;
    text-decoration: none;
}
.domain-name a.domain-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

tr.health-row-healthy td:first-child { box-shadow: inset 4px 0 0 0 var(--success); }
tr.health-row-watch td:first-child { box-shadow: inset 4px 0 0 0 var(--warning); }
tr.health-row-at-risk td:first-child { box-shadow: inset 4px 0 0 0 var(--danger); }

.tag-chip {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    margin: 0.1rem 0.25rem 0.1rem 0;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--accent-color);
    background: var(--input-bg);
    border: 1px solid var(--border-medium);
    white-space: nowrap;
}

.tag-suggestion-item {
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-primary);
}
.tag-suggestion-item:hover {
    background: var(--hover-bg);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 650;
    letter-spacing: 0.03em;
    line-height: 1.35;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-valid {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-expiring {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-expired {
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
/* On white, the bright status colours need their darker shades to be readable. */
[data-theme="light"] .status-valid { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
[data-theme="light"] .status-expiring { color: #b45309; background: #fffbeb; border-color: #fde68a; }
[data-theme="light"] .status-expired { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }

.badge-pulse {
    animation: badge-pulse 1.1s ease-out 2;
}
@keyframes badge-pulse {
    0% { box-shadow: 0 0 0 0 currentColor; }
    70% { box-shadow: 0 0 0 7px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.status-unknown {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Modals & Dashboard Specifics */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
}

.nav-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo {
    height: 44px;
    max-width: 60vw;
    object-fit: contain;
}
/* The Kolam Kare logo comes in two colourings: cream for the maroon and dark
   themes, maroon + black for the light theme (and print). Pages carry both. */
.logo-on-light { display: none; }
[data-theme="light"] .logo-on-dark { display: none; }
[data-theme="light"] .logo-on-light { display: inline-block; }

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 120%;
    right: 0;
    width: 200px;
    background: var(--surface-raised);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius);
    padding: 0.4rem;
    box-shadow: var(--shadow-md);
    display: none;
    flex-direction: column;
    z-index: 100;
}

.profile-dropdown.active .dropdown-menu {
    display: flex;
}

.dropdown-header {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.dropdown-item {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: var(--hover-bg);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-medium);
    margin: 0.5rem 0;
}

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

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: var(--control-h);
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    padding: 0.5rem 0.95rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.btn-secondary .icon { margin-right: 0 !important; }

.btn-secondary:hover {
    background: color-mix(in srgb, var(--text-primary) 7%, var(--surface-raised));
    border-color: color-mix(in srgb, var(--text-primary) 32%, transparent);
}
.btn-secondary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-secondary.text-danger:hover { background: color-mix(in srgb, var(--danger) 12%, var(--surface-raised)); border-color: var(--danger); }

.dashboard-container {
    width: 100%;
    max-width: 1200px;
    margin-top: 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 1;
}

/* Page header: title and one-line description on the left, actions on the right. */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem 1.5rem;
}
.dashboard-header h1, .detail-title-row h1 {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}
.dashboard-header h1 + p, .dashboard-header > div > p, .detail-heading > p {
    margin-top: 0.3rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}
/* Title takes the free room; the buttons stay on one row and move under the
   title only when both don't fit side by side. */
.dashboard-header { flex-wrap: wrap; }
.dashboard-header > :first-child { flex: 1 1 320px; min-width: 0; }
.dashboard-header .header-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.6rem !important; margin-left: auto; }
.dashboard-container h2 { letter-spacing: -0.01em; }
.dashboard-container .glass-panel h2 { font-size: 1.15rem; font-weight: 650; line-height: 1.3; }

.dashboard-header .btn-primary {
    width: auto;
    padding: 0.6rem 1.15rem;
}

/* Pop-up windows (pages open them with style.display = 'flex'; app_shell.js adds
   Esc, click-outside, focus and the closing fade for all of them). The page behind
   dims and blurs; the window has a thin accent line on top, a soft accent wash behind
   its title and a divider under it. On phones it is a sheet rising from the bottom. */
.modal {
    --modal-scrim: color-mix(in srgb, var(--bg-color) 45%, rgba(0, 0, 0, 0.6));
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-scrim);
    -webkit-backdrop-filter: blur(6px) saturate(115%);
    backdrop-filter: blur(6px) saturate(115%);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}
[data-theme="light"] .modal { --modal-scrim: rgba(15, 23, 42, 0.38); }
/* The page behind doesn't scroll while a window is open (the scrollbar keeps its place). */
html.kk-modal-open { overflow-y: hidden; scrollbar-gutter: stable; }

.modal-content {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
.modal-content.glass-panel {
    background:
        radial-gradient(120% 140px at 0 0, color-mix(in srgb, var(--accent-color) 9%, transparent), transparent 70%),
        var(--surface-raised);
    border-color: var(--border-strong);
    border-radius: 20px;
    padding: 1.6rem 1.75rem 1.75rem;
    box-shadow: var(--shadow-lg), 0 0 0 1px color-mix(in srgb, var(--accent-color) 10%, transparent), 0 0 48px -18px color-mix(in srgb, var(--accent-color) 45%, transparent);
}
/* Accent line along the top edge. */
.modal-content.glass-panel::before {
    content: ""; position: absolute; top: 0; left: 1.5rem; right: 1.5rem; height: 3px; border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, transparent, var(--accent-color) 25%, var(--accent-hover) 75%, transparent);
    pointer-events: none;
}
/* Room kept at the title's right for the close button. */
.modal-content { --close-room: 4.75rem; }
.modal-content > h2 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.3;
    margin: -0.1rem -1.75rem 1.25rem;
    padding: 0 var(--close-room) 1rem 1.75rem;
    border-bottom: 1px solid var(--border-light);
}
.modal-content > h2 + p, .modal-content > h2 + .muted { margin-top: -0.4rem; }
@media (max-width: 600px) {
    /* --keyboard-inset (app_shell.js): an iPhone keyboard's height, so the window sits above it. */
    .modal { align-items: flex-end; padding: 0 0 var(--keyboard-inset, 0px); }
    .modal > .modal-content.glass-panel {
        max-width: none !important; /* some windows set a narrower width inline */
        max-height: calc(92dvh - var(--keyboard-inset, 0px)); border-radius: 22px 22px 0 0; border-bottom: none;
        padding: 1.9rem 1.15rem calc(1.25rem + env(safe-area-inset-bottom));
    }
    .modal-content { --close-room: 4rem; }
    .modal-content > h2 { margin: -0.1rem -1.15rem 1.1rem; padding: 0 var(--close-room) 0.9rem 1.15rem; font-size: 1.18rem; }
    /* A grab handle in place of the accent line. */
    .modal-content.glass-panel::before { left: 50%; right: auto; top: 0.6rem; width: 2.6rem; height: 4px; margin-left: -1.3rem; border-radius: 4px; background: var(--border-strong); }
}

.tabs-header {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-medium);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.6rem 0.85rem;
    font-size: 0.95rem;
    font-weight: 550;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: all 0.2s;
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}

.tab-btn.active {
    color: var(--text-primary);
    font-weight: 650;
    border-bottom-color: var(--accent-color);
}

/* Centred on the title's first line, its right edge in line with the fields
   below (as the title lines up with their left edge). */
.close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.75rem;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: color-mix(in srgb, var(--text-primary) 4%, transparent);
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.25s var(--ease-out, ease-out);
    -webkit-user-select: none;
    user-select: none;
}
.close-btn:hover { color: var(--text-primary); background: color-mix(in srgb, var(--accent-color) 16%, transparent); border-color: color-mix(in srgb, var(--accent-color) 40%, transparent); transform: rotate(90deg); }
.close-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); color: var(--text-primary); }
@media (max-width: 600px) { .modal .close-btn { top: 1.45rem; right: 1.15rem; } }

/* Login Page - Split Layout */
.login-body {
    display: block;
    padding: 0;
}

.login-split {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.login-branding {
    position: relative;
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 3rem;
    background:
        radial-gradient(ellipse 80% 60% at 15% 10%, color-mix(in srgb, var(--accent-color) 14%, transparent), transparent 70%),
        radial-gradient(ellipse 70% 60% at 90% 100%, color-mix(in srgb, var(--accent-color) 9%, transparent), transparent 70%),
        var(--sidebar-bg);
    overflow: hidden;
    border-right: 1px solid var(--border-medium);
}
[data-theme="light"] .login-branding {
    background:
        radial-gradient(ellipse 80% 60% at 15% 10%, rgba(139, 29, 22, 0.08), transparent 70%),
        radial-gradient(ellipse 70% 60% at 90% 100%, rgba(232, 195, 150, 0.25), transparent 70%),
        #fbf8f5;
}

.login-branding .background-effects {
    position: absolute;
}

.login-branding-content {
    position: relative;
    z-index: 1;
    max-width: 440px;
}

.brand-logo {
    width: 300px;
    max-width: 100%;
    margin-bottom: 2.5rem;
}

.login-branding-content h1 {
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-branding-content > p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

.brand-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.brand-features li {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.brand-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--accent-color) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent-color) 28%, transparent);
    color: var(--accent-color);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.login-form-panel {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-form-card {
    width: 100%;
    max-width: 410px;
}
.login-form-card.glass-panel { padding: 2.25rem 2.25rem 2rem; border-radius: 18px; box-shadow: var(--shadow-lg); }
.login-form-card .text-input { min-height: 2.85rem; }
.login-form-card .btn-primary { min-height: 2.85rem; font-size: 1rem; }

.login-form-header {
    margin-bottom: 1.75rem;
}
.login-form-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}
.login-form-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    font-size: 1rem;
    pointer-events: none;
}
.text-input.has-icon {
    padding-left: 2.75rem;
}
.text-input.has-trailing-icon {
    padding-right: 2.75rem;
}
.input-trailing-btn {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1rem;
    padding: 0.25rem;
}
.input-trailing-btn:hover {
    color: var(--text-primary);
}

.login-submit-btn {
    width: 100%;
}

.error-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--danger);
    font-size: 0.9rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
}
.error-text:empty {
    display: none;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
}

@media (max-width: 900px) {
    .login-split {
        flex-direction: column;
    }
    .login-branding {
        flex: 0 0 auto;
        padding: 3rem 2rem 2rem;
        border-right: none;
        border-bottom: 1px solid var(--border-medium);
        text-align: center;
    }
    .login-branding-content {
        margin: 0 auto;
    }
    .brand-logo {
        margin-left: auto;
        margin-right: auto;
    }
    .brand-features {
        display: none;
    }
    .login-form-panel {
        padding: 2rem 1.5rem 3rem;
    }
}

/* Table Actions */
.btn-action {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1.05rem;
    cursor: pointer;
    margin-right: 0.1rem;
    vertical-align: middle;
    text-decoration: none;
    transition: color 0.15s, background-color 0.15s;
}
.btn-action:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}
.btn-action:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.delete-btn:hover {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 12%, transparent);
}
/* Native checkboxes and radios in the theme's brand colour */
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent-color); color-scheme: dark; }
[data-theme="light"] input[type="checkbox"], [data-theme="light"] input[type="radio"] { color-scheme: light; }

/* Custom Checkbox */
.remember-me-group {
    margin-bottom: 1.5rem;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    user-select: none;
    transition: color 0.3s ease;
}

.custom-checkbox:hover {
    color: var(--text-primary);
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    background-color: var(--field-bg);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.custom-checkbox:hover input ~ .checkmark {
    border-color: var(--accent-color);
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}
.custom-checkbox input:focus-visible ~ .checkmark { box-shadow: var(--focus-ring); }

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.custom-checkbox .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid var(--on-accent);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}


.text-input::placeholder, textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Icon set */
.icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    flex-shrink: 0;
}
.dropdown-item .icon {
    margin-right: 0.4rem;
}
.btn-primary .icon, .btn-secondary .icon { margin-right: 0; width: 1.05em; height: 1.05em; }
.btn-action .icon {
    width: 1.05em;
    height: 1.05em;
    vertical-align: -0.2em;
}
.input-icon .icon {
    width: 1rem;
    height: 1rem;
    vertical-align: -0.15em;
}
.brand-feature-icon .icon {
    width: 1.1rem;
    height: 1.1rem;
}

/* Nav avatar bubble */
.nav-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--accent-color);
    color: var(--on-accent);
    font-weight: 700;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Skeleton loading placeholders */
.skeleton-bar {
    height: 0.9rem;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--border-light) 25%, var(--border-medium) 37%, var(--border-light) 63%);
    background-size: 400% 100%;
    animation: skeleton-shimmer 1.4s ease infinite;
}
@keyframes skeleton-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* Empty states */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    text-align: center;
    gap: 0.75rem;
}
/* The icon sits in a soft round badge, like the empty screens of most apps. */
.empty-state .icon {
    width: 52px;
    height: 52px;
    padding: 13px;
    border-radius: 50%;
    background: var(--hover-bg);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    opacity: 1;
}
.empty-state p {
    font-size: 0.95rem;
    max-width: 340px;
    line-height: 1.5;
}

/* Scheduled-job health warning */
.cron-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid rgba(245, 158, 11, 0.32);
    border-left: 3px solid var(--warning);
    background: rgba(245, 158, 11, 0.1);
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.5;
}
[data-theme="light"] .cron-banner, [data-theme="light"] .notice-banner { background: #fffbeb; border-color: #fde68a; border-left-color: #f59e0b; }
[data-theme="light"] .cron-banner > .icon, [data-theme="light"] .notice-banner > .icon { color: #d97706; }
.cron-banner[hidden] { display: none; }
.cron-banner > .icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 0.1rem;
    color: var(--warning);
}
.cron-banner ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* KPI stat-card strip */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.1rem 1.25rem;
}

.kpi-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kpi-icon .icon {
    width: 21px;
    height: 21px;
    margin-right: 0;
}
.kpi-icon-total { background: color-mix(in srgb, var(--accent-color) 16%, transparent); color: var(--accent-color); }
.kpi-icon-warning { background: rgba(245, 158, 11, 0.14); color: var(--warning); }
.kpi-icon-danger { background: rgba(239, 68, 68, 0.14); color: var(--danger); }
[data-theme="light"] .kpi-icon-warning { color: #d97706; }
[data-theme="light"] .kpi-icon-danger { color: #dc2626; }

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.kpi-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

@media (max-width: 900px) {
    .kpi-strip {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 340px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    border-left: 3px solid var(--text-secondary);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.4;
    animation: toast-in 0.25s ease forwards;
}
.toast.toast-out {
    animation: toast-out 0.2s ease forwards;
}
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-info { border-left-color: var(--accent-color); }

.toast-icon {
    flex-shrink: 0;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: #fff;
}
.toast.toast-success .toast-icon { background: var(--success); }
.toast.toast-error .toast-icon { background: var(--danger); }
.toast.toast-info .toast-icon { background: var(--accent-color); color: var(--on-accent); }

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    font-size: 1rem;
    line-height: 1;
}
.toast-close:hover { color: var(--text-primary); }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(30px); }
}

/* Calendar (calendar.html): month / year / agenda views of every date -
   domain expiry, SSL, hosting renewals, alert days, snoozes and incidents.
   --chip-type = the kind of date (left border, icon, swatch);
   --chip-color = how urgent a renewal date is (red / amber / green). */
.calendar-page {
    --cal-domain: #60a5fa;
    --cal-ssl: #f472b6;
    --cal-hosting: #22d3ee;
    --cal-alert: #94a3b8;
    --cal-pause: #818cf8;
    --cal-incident: #f87171;
    page: calendar;
}
[data-theme="light"] .calendar-page {
    --cal-domain: #2563eb;
    --cal-ssl: #db2777;
    --cal-hosting: #0891b2;
    --cal-alert: #64748b;
    --cal-pause: #4f46e5;
    --cal-incident: #dc2626;
}
.type-domain { --chip-type: var(--cal-domain); }
.type-ssl { --chip-type: var(--cal-ssl); }
.type-hosting { --chip-type: var(--cal-hosting); }
.type-alert { --chip-type: var(--cal-alert); }
.type-pause { --chip-type: var(--cal-pause); }
.type-incident { --chip-type: var(--cal-incident); }
.calendar-page .due-expired { --chip-color: var(--danger); }
.calendar-page .due-expiring { --chip-color: var(--warning); }
.calendar-page .due-valid { --chip-color: var(--success); }
.incident-down, .incident-site_broken { --chip-color: var(--danger); }
.incident-up, .incident-site_fixed { --chip-color: var(--success); }
.incident-dns { --chip-color: #c084fc; }

.cal-header-btn { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.95rem; }
.cal-header-btn .icon { margin: 0; }
.cal-panel { padding: 1.5rem; }

/* Overdue strip */
.cal-overdue {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-left: 4px solid var(--danger);
    background: rgba(239, 68, 68, 0.1);
}
.cal-overdue[hidden] { display: none; }
.cal-overdue-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 0.75rem; }
.cal-overdue-head .icon { width: 20px; height: 20px; color: var(--danger); }
.cal-overdue-head span { color: var(--text-secondary); font-size: 0.88rem; }
.cal-overdue-list { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.75rem; }
.cal-overdue-item {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.35rem 0.7rem; border-radius: 999px; cursor: pointer;
    border: 1px solid rgba(239, 68, 68, 0.35); background: transparent;
    color: var(--text-primary); font-size: 0.85rem;
}
.cal-overdue-item:hover { background: rgba(239, 68, 68, 0.12); }
.cal-overdue-item .icon { width: 14px; height: 14px; color: var(--danger); }
.cal-overdue-item span { color: var(--text-secondary); }

/* Summary tiles */
.cal-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 1rem; }
.cal-summary-tile { display: flex; align-items: flex-start; gap: 0.8rem; padding: 1rem 1.1rem; }
.cal-summary-tile div { display: flex; flex-direction: column; min-width: 0; }
.cal-summary-tile strong { font-size: 1.45rem; line-height: 1.1; }
.cal-summary-tile span { font-size: 0.82rem; color: var(--text-secondary); }
.cal-summary-cost strong { font-size: 1.05rem; overflow-wrap: anywhere; }

/* Filters, type switches, toolbar */
.cal-panel .domain-tabs { margin-bottom: 1rem; }
.cal-filters { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.75rem; }
.cal-search { flex: 1 1 260px; }
.cal-search .text-input, .cal-select { padding: 0.6rem 0.85rem; }
.cal-select { width: auto; min-width: 150px; max-width: 240px; }
.cal-select[hidden] { display: none; }
.cal-search-result { font-size: 0.9rem; margin: 0 0 0.75rem; color: var(--text-secondary); }
.cal-search-result[hidden] { display: none; }
.cal-search-result strong { color: var(--text-primary); }
.cal-search-result .link-btn { font-size: inherit; }

.cal-types { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-bottom: 1.1rem; }
.cal-type-toggle {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.35rem 0.75rem; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--border-medium); background: transparent;
    color: var(--text-secondary); font-size: 0.85rem;
    transition: background 0.15s, color 0.15s, opacity 0.15s;
}
.cal-type-toggle .icon { width: 14px; height: 14px; color: var(--chip-type); }
.cal-type-toggle.active { color: var(--text-primary); background: color-mix(in srgb, var(--chip-type) 14%, transparent); border-color: color-mix(in srgb, var(--chip-type) 45%, transparent); }
.cal-type-toggle:not(.active) { opacity: 0.6; }
.cal-type-toggle:not(.active) .cal-type-swatch { background: transparent; }
.cal-type-swatch { width: 9px; height: 9px; border-radius: 50%; background: var(--chip-type); border: 1.5px solid var(--chip-type); }
.cal-type-count { font-size: 0.75rem; font-weight: 600; padding: 0 0.4rem; border-radius: 999px; background: var(--border-medium); }
.cal-status-legend { display: inline-flex; flex-wrap: wrap; gap: 0.9rem; margin-left: auto; font-size: 0.8rem; color: var(--text-secondary); }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 0.35rem; }
.legend-dot.due-expired { background: var(--danger); }
.legend-dot.due-expiring { background: var(--warning); }
.legend-dot.due-valid { background: var(--success); }

.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem 1rem; margin-bottom: 1.1rem; }
.cal-nav { display: flex; align-items: center; gap: 0.5rem; }
.cal-nav-btn { font-size: 1.2rem; line-height: 1; padding: 0.4rem 0.8rem; }
.cal-period-label { min-width: 220px; margin: 0; text-align: center; font-size: 1.3rem; }
.cal-view-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; }
.cal-week-select { min-width: 0; }

/* Month */
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 0.5rem; }
.calendar-weekdays span {
    text-align: center; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.05em; padding: 0.5rem 0;
}
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar-day {
    min-height: 112px; min-width: 0; padding: 0.4rem;
    border: 1px solid var(--border-light); border-radius: 8px; background: var(--input-bg);
    display: flex; flex-direction: column; gap: 0.2rem; overflow: hidden; cursor: pointer;
    transition: border-color 0.15s;
}
.calendar-day:hover { border-color: var(--border-medium); }
.calendar-day.other-month { opacity: 0.4; }
.calendar-day.today { border-color: var(--accent-color); box-shadow: 0 0 0 1px var(--accent-color); }
.calendar-day.busy-week { background: color-mix(in srgb, var(--warning) 8%, var(--input-bg)); }
.calendar-day.has-highlight { border-color: var(--accent-color); }
.cal-day-head { display: flex; align-items: center; justify-content: space-between; gap: 0.3rem; min-height: 1.6rem; }
.calendar-day-number {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.6rem; height: 1.6rem; padding: 0 0.3rem; border: none; border-radius: 999px;
    background: transparent; color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.calendar-day-number:hover { background: var(--border-medium); color: var(--text-primary); }
.calendar-day.today .calendar-day-number { background: var(--accent-color); color: var(--on-accent); }
.cal-busy-badge { font-size: 0.66rem; font-weight: 600; color: var(--warning); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-bands { display: flex; flex-direction: column; gap: 2px; }
.cal-band { height: 4px; border-radius: 2px; background: repeating-linear-gradient(45deg, var(--band) 0 4px, transparent 4px 7px); }
.cal-band.band-snooze { --band: var(--cal-alert); }
.cal-band.band-maintenance { --band: var(--cal-pause); }

.cal-chip {
    display: flex; align-items: center; gap: 0.3rem; width: 100%; min-width: 0;
    padding: 0.14rem 0.4rem; border: none; border-left: 3px solid var(--chip-type); border-radius: 4px;
    background: color-mix(in srgb, var(--chip-color, var(--text-secondary)) 15%, transparent);
    color: var(--chip-color, var(--text-primary));
    font-size: 0.74rem; font-weight: 500; text-align: left; cursor: pointer;
    transition: filter 0.15s;
}
.cal-chip:hover { filter: brightness(1.2); }
.cal-chip .icon { width: 12px; height: 12px; flex-shrink: 0; color: var(--chip-type); }
.cal-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip.type-alert { background: transparent; color: var(--text-secondary); font-weight: 400; outline: 1px dashed var(--border-medium); outline-offset: -1px; }
.cal-chip.type-incident { background: color-mix(in srgb, var(--chip-color) 12%, transparent); }
.cal-chip.is-muted span { text-decoration: line-through; opacity: 0.7; }
.cal-chip.is-highlight { box-shadow: 0 0 0 2px var(--accent-color); }
.cal-chip-extra { display: none; }
.cal-more {
    align-self: flex-start; padding: 0.1rem 0.3rem; border: none; border-radius: 4px; background: none;
    color: var(--accent-color); font-size: 0.74rem; font-weight: 600; cursor: pointer;
}
.cal-more:hover { text-decoration: underline; }

/* Year */
.cal-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 1rem; }
.cal-mini { padding: 0.75rem; border: 1px solid var(--border-light); border-radius: 10px; background: var(--input-bg); }
.cal-mini.is-current { border-color: var(--accent-color); }
.cal-mini-title {
    display: flex; flex-direction: column; width: 100%; padding: 0 0 0.5rem; margin-bottom: 0.4rem;
    border: none; border-bottom: 1px solid var(--border-light); background: none; color: var(--text-primary);
    text-align: left; cursor: pointer;
}
.cal-mini-title:hover strong { color: var(--accent-color); }
.cal-mini-title span { font-size: 0.76rem; color: var(--text-secondary); }
.cal-mini-weekdays, .cal-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-mini-weekdays span { text-align: center; font-size: 0.62rem; color: var(--text-secondary); text-transform: uppercase; padding-bottom: 0.2rem; }
.cal-mini-day {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center; padding: 0;
    border: none; border-radius: 4px; background: transparent; color: var(--text-secondary);
    font-size: 0.7rem; cursor: pointer;
}
.cal-mini-day:hover { outline: 1px solid var(--accent-color); }
.cal-mini-day.heat-1 { background: color-mix(in srgb, var(--accent-color) 18%, transparent); }
.cal-mini-day.heat-2 { background: color-mix(in srgb, var(--accent-color) 32%, transparent); }
.cal-mini-day.heat-3 { background: color-mix(in srgb, var(--accent-color) 48%, transparent); }
.cal-mini-day.heat-4 { background: color-mix(in srgb, var(--accent-color) 65%, transparent); color: var(--text-primary); }
.cal-mini-day.due-expired, .cal-mini-day.due-expiring, .cal-mini-day.due-valid { color: var(--chip-color); font-weight: 700; }
.cal-mini-day.today { box-shadow: inset 0 0 0 1.5px var(--accent-color); }
.cal-mini-day.is-highlight { outline: 2px solid var(--accent-color); }
.cal-heat-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 0.3rem; margin: 1rem 0 0; font-size: 0.8rem; color: var(--text-secondary); }
.cal-heat-legend .cal-mini-day { width: 12px; height: 12px; cursor: default; }

/* Agenda */
.cal-agenda { display: flex; flex-direction: column; gap: 1.4rem; }
.cal-agenda-month h3 {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.3rem 0.75rem;
    margin: 0 0 0.4rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border-medium); font-size: 1.05rem;
}
.cal-agenda-month h3 span { font-size: 0.82rem; font-weight: 400; color: var(--text-secondary); }
.cal-agenda-row {
    display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; align-items: center; gap: 0.75rem;
    padding: 0.5rem 0.6rem; border-radius: 10px; border-left: 3px solid var(--chip-type);
}
.cal-agenda-row:hover { background: var(--hover-bg); }
.cal-agenda-row.is-highlight { box-shadow: inset 0 0 0 2px var(--accent-color); }
.cal-agenda-row.is-muted .cal-agenda-text { text-decoration: line-through; }
.cal-agenda-date {
    display: flex; flex-direction: column; align-items: center; width: 3rem; padding: 0.15rem 0;
    border: none; border-radius: 8px; background: none; color: var(--text-primary); cursor: pointer;
}
.cal-agenda-date:hover { background: var(--border-medium); }
.cal-agenda-date strong { font-size: 1.2rem; line-height: 1.1; }
.cal-agenda-date span { font-size: 0.7rem; text-transform: uppercase; color: var(--text-secondary); }
.cal-agenda-icon .icon { width: 18px; height: 18px; color: var(--chip-type); }
.cal-agenda-main { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.cal-agenda-text { font-size: 0.86rem; color: var(--chip-color, var(--text-secondary)); }
.cal-countdown { font-size: 0.82rem; color: var(--text-secondary); white-space: nowrap; }
.cal-renew, .cal-action {
    display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.38rem 0.75rem;
    font-size: 0.85rem; text-decoration: none; white-space: nowrap;
}
.cal-renew .icon, .cal-action .icon { width: 14px; height: 14px; margin: 0; }
.cal-empty { padding: 2rem 1rem; text-align: center; color: var(--text-secondary); }

/* Day panel */
.cal-day-modal { max-width: 660px; }
/* Title and its "31 days ago · 3 items" line are one header; the divider goes under both. */
.cal-day-modal > h2 { margin-bottom: 0.2rem; padding-bottom: 0; border-bottom: none; }
.cal-day-modal > h2 + .card-intro { margin: 0 -1.75rem 1.1rem; padding: 0 4rem 0.9rem 1.75rem; border-bottom: 1px solid var(--border-light); }
@media (max-width: 600px) { .cal-day-modal > h2 + .card-intro { margin: 0 -1.15rem 1rem; padding: 0 3.5rem 0.85rem 1.15rem; } }
.cal-day-list { display: flex; flex-direction: column; gap: 0.75rem; }
.cal-day-card { padding: 0.9rem 1rem; border: 1px solid var(--border-medium); border-left: 4px solid var(--chip-type); border-radius: 12px; }
.cal-day-card header { display: flex; align-items: flex-start; gap: 0.7rem; }
.cal-day-card header div { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.cal-day-card header span { font-size: 0.88rem; color: var(--chip-color, var(--text-secondary)); }
.cal-day-card-icon .icon { width: 20px; height: 20px; margin-top: 0.1rem; color: var(--chip-type); }
.cal-day-card dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin: 0.75rem 0 0; font-size: 0.87rem; }
.cal-day-card dl div { display: contents; }
.cal-day-card dt { color: var(--text-secondary); }
.cal-day-card dd { margin: 0; overflow-wrap: anywhere; }
.cal-day-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.85rem; }
.cal-day-actions:empty { display: none; }
.cal-snooze-select { width: auto; padding: 0.38rem 0.6rem; font-size: 0.85rem; }

.cal-shortcuts { margin: 1.1rem 0 0; font-size: 0.8rem; color: var(--text-secondary); line-height: 1.8; }
.cal-shortcuts kbd, .calendar-page kbd {
    display: inline-block; min-width: 1.4em; padding: 0 0.35em; border: 1px solid var(--border-medium);
    border-bottom-width: 2px; border-radius: 4px; font-family: inherit; font-size: 0.85em; text-align: center; color: var(--text-primary);
}

@media (max-width: 900px) {
    .cal-status-legend { margin-left: 0; }
    .cal-period-label { min-width: 0; flex: 1; font-size: 1.1rem; }
    .cal-nav { flex: 1 1 100%; }
}
@media (max-width: 700px) {
    .calendar-grid { gap: 3px; }
    .calendar-day { min-height: 74px; padding: 0.25rem; }
    .calendar-weekdays span { font-size: 0.62rem; padding: 0.3rem 0; }
    .calendar-day-number { font-size: 0.72rem; min-width: 1.3rem; height: 1.3rem; }
    .cal-busy-badge { display: none; }
    .cal-chip { font-size: 0.6rem; padding: 0.1rem 0.2rem; border-left-width: 2px; }
    .cal-chip .icon { display: none; }
    .cal-more { font-size: 0.62rem; }
    .cal-select { flex: 1 1 140px; max-width: none; }
    .cal-agenda-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.5rem; }
    .cal-agenda-icon { display: none; }
    .cal-agenda-row .cal-renew { grid-column: 2 / -1; justify-self: start; }
    .cal-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
    .cal-summary-tile { padding: 0.75rem; }
    .cal-shortcuts { display: none; }
}
@media (max-width: 600px) {
    /* Month on phones: each item is a coloured bar in its status colour (tapping the
       day lists them), and "+46" without "more" - names don't fit a 40px-wide day. */
    .calendar-day { min-height: 64px; }
    .cal-month-grid .cal-chip { height: 5px; padding: 0; border: none; border-radius: 3px; background: var(--chip-color, var(--text-secondary)); }
    .cal-month-grid .cal-chip.type-alert { background: var(--border-strong); outline: none; }
    .cal-month-grid .cal-chip > * { display: none; }
    .cal-month-grid .cal-more { padding: 0; }
    .cal-more-word { display: none; }
    /* Overdue: name on the first line, what happened under it. */
    .cal-overdue-item { flex-wrap: wrap; row-gap: 0.1rem; border-radius: 10px; text-align: left; }
    .cal-overdue-item span { flex-basis: 100%; padding-left: calc(14px + 0.4rem); font-size: 0.8rem; }
}

/* Printed: white page, landscape, every chip of a day (not "+N more") */
@page calendar { size: landscape; margin: 10mm; }
@media print {
    .calendar-page { -webkit-print-color-adjust: exact; print-color-adjust: exact; color: #111111; gap: 0.75rem; }
    .calendar-page .cal-print-header.print-only { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
    .calendar-page .cal-print-period.print-only { display: block; margin: 0 0 0.5rem; }
    .cal-print-logo { height: 34px; }
    #cal-print-caption { margin: 0; font-size: 9pt; color: #555555; }
    .calendar-page .dashboard-header { display: none; }
    .calendar-page .glass-panel, .calendar-page .cal-overdue { background: #ffffff !important; border-color: #cccccc !important; box-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; color: #111111 !important; padding: 0.6rem; }
    .calendar-page .cal-summary { gap: 0.4rem; }
    .calendar-page .cal-overdue-item { color: #111111 !important; border-color: #e0a0a0 !important; }
    .calendar-page .cal-summary-tile span, .calendar-page .muted, .calendar-page .cal-overdue-head span, .calendar-page .cal-agenda-text, .calendar-page .cal-countdown { color: #555555 !important; }
    .calendar-page .calendar-day { background: #ffffff !important; border-color: #cccccc !important; min-height: 70px; break-inside: avoid; cursor: default; }
    .calendar-page .calendar-day.busy-week { background: #fff8e6 !important; }
    .calendar-page .calendar-day-number, .calendar-page .calendar-weekdays span { color: #333333 !important; background: none !important; }
    .calendar-page .cal-chip { color: #111111 !important; background: #f2f2f2 !important; font-size: 7pt; }
    .calendar-page .cal-chip-extra { display: flex; }
    .calendar-page .cal-more, .calendar-page .cal-renew { display: none; }
    .calendar-page .cal-mini { background: #ffffff !important; border-color: #cccccc !important; break-inside: avoid; }
    .calendar-page .cal-mini-title, .calendar-page .cal-agenda-month h3, .calendar-page .cal-agenda-date { color: #111111 !important; }
    .calendar-page .cal-agenda-row { break-inside: avoid; }
}

@media (max-width: 900px) {
    .table-container { overflow-x: visible; overflow-y: visible; max-height: none; border: none; }
}
/* Dashboard List view -> one card per domain whenever the page is too narrow for
   the table (phones, tablets, laptops with the sidebar open), side by side when
   there's room. Follows the page's width, so collapsing the sidebar counts too. */
@container dash (max-width: 1099px) {
    #list-view { overflow: visible; max-height: none; border: none; }
    #domains-table thead { display: none; }
    #domains-table, #domains-table tr, #domains-table td {
        display: block;
        width: 100%;
    }
    #domains-table tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 0.85rem; align-items: start; }
    #domains-table tr:has(> td[colspan]) { grid-column: 1 / -1; }
    /* A long name plus its markers and subdomain chip wrap inside the card. */
    #domains-table td.col-domain { flex-wrap: wrap; justify-content: flex-end; row-gap: 0.35rem; column-gap: 0.4rem; text-align: right; overflow-wrap: anywhere; }
    #domains-table td.col-domain::before { margin-right: auto; }
    #domains-table tr {
        margin-bottom: 0;
        border: 1px solid var(--border-light);
        border-radius: 10px;
        padding: 0.5rem 0.9rem;
        background: var(--input-bg);
    }
    #domains-table tr.health-row-healthy { box-shadow: inset 4px 0 0 0 var(--success); }
    #domains-table tr.health-row-watch { box-shadow: inset 4px 0 0 0 var(--warning); }
    #domains-table tr.health-row-at-risk { box-shadow: inset 4px 0 0 0 var(--danger); }
    /* Hover shades the whole card, not the cells inside its padding (and not at
       all on touch screens, where it would stick after a tap). */
    #domains-table tr:hover td { background: none; }
    @media (hover: hover) { #domains-table tbody tr:hover { background: linear-gradient(var(--hover-bg), var(--hover-bg)), var(--input-bg); } }

    #domains-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.6rem 0;
        border-bottom: 1px solid var(--border-light);
        text-align: right;
        white-space: normal;
        box-shadow: none !important;
    }
    #domains-table td:last-child { border-bottom: none; }
    #domains-table td[data-label]:before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.78rem;
        color: var(--text-secondary);
        text-align: left;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        flex-shrink: 0;
    }
    #domains-table td.actions-cell {
        justify-content: flex-end;
        gap: 0.75rem;
    }
}

/* ------------------------------------------------------------------
   Accounts, admin, reports, share page (roles / 2FA / reports features)
   ------------------------------------------------------------------ */

/* Anything toggled with the hidden attribute stays hidden, even when a
   class elsewhere sets display:flex/grid. */
[hidden] { display: none !important; }

/* General notice (same look as the cron warning) */
.notice-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid rgba(245, 158, 11, 0.32);
    border-left: 3px solid var(--warning);
    background: rgba(245, 158, 11, 0.1);
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.5;
}
.notice-banner > .icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 0.1rem;
    color: var(--warning);
}
.notice-banner ul {
    margin: 0;
    padding: 0;
    list-style: none;
    min-width: 0;
    overflow-wrap: anywhere;
}
.notice-banner a { color: var(--accent-color); }
.dashboard-container > .notice-banner, .dashboard-container > .cron-banner { margin-bottom: 0; }

/* Profile menu: signed-in user + link items */
.dropdown-user {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}
.dropdown-user strong { color: var(--text-primary); font-weight: 600; }
.dropdown-user span {
    color: var(--text-secondary);
    text-transform: capitalize;
    font-size: 0.8rem;
}
.dropdown-menu { width: 230px; }
a.dropdown-item {
    display: flex;
    align-items: center;
    text-decoration: none;
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1rem;
}
.form-row.form-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-row > .input-group { min-width: 0; }
.form-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin: 0.5rem 0 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-medium);
}
.field-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
textarea.notes-input {
    height: 80px;
    font-family: inherit;
    font-size: 0.95rem;
}
.form-message {
    min-height: 1.2em;
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}
.form-message:empty { margin: 0; min-height: 0; }
.form-message.error { color: var(--danger); }
.form-message.success { color: var(--success); }
.form-message .text-input { margin-top: 0.5rem; }

.btn-primary.btn-inline {
    width: auto;
    display: inline-flex;
    padding: 0.6rem 1.15rem;
    font-size: 0.95rem;
}
.btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: var(--control-h-sm);
    padding: 0.3rem 0.7rem;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 8px;
    white-space: nowrap;
}
.actions-cell .btn-small { margin: 0.1rem 0.25rem 0.1rem 0; }
.link-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent-color);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-underline-offset: 3px;
}
.link-btn:hover { text-decoration: underline; }

.inline-form {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.inline-form.wrap { flex-wrap: wrap; }
.inline-form > .text-input {
    flex: 1 1 180px;
    width: auto;
    min-width: 0;
}
.inline-form > select.text-input { flex: 0 1 auto; padding-right: 2.3rem; }
.inline-form > .btn-primary.btn-inline { padding: 0.6rem 1.15rem; }
.inline-form > .btn-secondary { white-space: nowrap; }
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

/* Page layouts */
.page-narrow { max-width: 760px; }
.page-panel:hover, .settings-card:hover { transform: none; }
.page-panel .tabs-header { flex-wrap: wrap; }
.settings-card h2 {
    font-size: 1.15rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}
.card-intro {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 1.25rem;
}
.card-intro code, .secret-reveal code {
    font-size: 0.85em;
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
    background: var(--input-bg);
    border: 1px solid var(--border-light);
    overflow-wrap: anywhere;
}

/* Two-factor setup */
.twofa-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}
.twofa-status:empty { display: none; }
.setup-steps {
    margin: 0 0 1rem 1.25rem;
    line-height: 1.8;
    font-size: 0.95rem;
}
.secret-code {
    font-family: monospace;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: var(--input-bg);
    user-select: all;
    overflow-wrap: anywhere;
}
/* The QR code needs dark-on-white to scan reliably in every theme */
.qr-box {
    width: 200px;
    max-width: 100%;
    margin: 0 0 1.25rem;
    padding: 0.5rem;
    background: #ffffff;
    border-radius: 10px;
    line-height: 0;
}
.qr-box svg { width: 100%; height: auto; display: block; }
.twofa-code-input.text-input {
    font-family: monospace;
    font-size: 1.2rem;
    letter-spacing: 0.3em;
    text-align: center;
}
.inline-form > .twofa-code-input.text-input { flex: 0 1 180px; }
.twofa-intro {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}
#twofa-back-btn { margin-top: 1rem; }
.recovery-codes {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 1.5rem;
    margin: 1rem 0 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    background: var(--input-bg);
    border: 1px solid var(--border-medium);
    font-family: monospace;
    font-size: 1rem;
    letter-spacing: 0.05em;
}

/* One-time secrets (new share link / API key) */
.secret-reveal {
    margin: 0 0 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-left: 4px solid var(--success);
    background: rgba(16, 185, 129, 0.1);
    font-size: 0.9rem;
}
.secret-reveal p { margin-bottom: 0.75rem; }
.secret-reveal .inline-form:last-child { margin-bottom: 0; }
.secret-reveal .text-input { font-family: monospace; font-size: 0.85rem; }

/* Admin + reports tables */
.page-panel .table-container { max-height: none; margin-bottom: 1rem; }
.page-panel td { padding: 0.75rem 1rem; }
.page-panel select.role-select.text-input {
    width: auto;
    min-height: var(--control-h-sm);
    padding: 0.3rem 2.1rem 0.3rem 0.7rem;
    font-size: 0.88rem;
    border-radius: 8px;
}
.wrap-cell {
    max-width: 320px;
    overflow-wrap: anywhere;
    font-size: 0.88rem;
}
tr.activity-risky td:first-child { box-shadow: inset 4px 0 0 0 var(--warning); }

/* Dashboard: small icons after the domain name, renew button */
.domain-marker {
    display: inline-flex;
    align-items: center;
    margin-left: 0.35rem;
    color: var(--text-secondary);
    cursor: help;
    vertical-align: middle;
}
.domain-marker .icon { width: 0.95em; height: 0.95em; }
.domain-marker.marker-muted { color: var(--text-secondary); opacity: 0.8; }
.domain-marker.marker-danger { color: var(--danger); }
.domain-marker.marker-warning { color: var(--warning); }
a.renew-btn { text-decoration: none; }
a.renew-btn:hover { color: var(--success); }
a.renew-btn.renew-btn-urgent { color: var(--warning); }
a.renew-btn.renew-btn-urgent:hover { color: var(--success); }

/* Reports */
.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.report-summary .kpi-card { padding: 1rem 1.25rem; }
.report-summary .kpi-card:hover { transform: none; }
.report-summary .kpi-value { font-size: 1.4rem; }
.report-subtitle {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
}
.report-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
}
.cost-bar {
    display: block;
    width: 100%;
    min-width: 60px;
    height: 8px;
    border-radius: 999px;
    background: var(--input-bg);
    overflow: hidden;
}
.cost-bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--accent-color);
}
.group-row {
    border-bottom: 1px solid var(--border-light);
    font-size: 0.92rem;
}
.group-row summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.5rem 30%;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.25rem;
    cursor: pointer;
    list-style: none;
}
.group-row summary::-webkit-details-marker { display: none; }
.group-row summary:hover { background: var(--hover-bg); }
.group-row[open] summary .group-name { color: var(--accent-color); }
.group-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-count { text-align: right; font-weight: 600; color: var(--text-secondary); }
.group-row > :not(summary) {
    padding: 0 0.25rem 0.75rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}
tr.clickable-row { cursor: pointer; }
tr.clickable-row.selected td { background: var(--hover-bg); }
.uptime-detail {
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-medium);
}
.uptime-days {
    display: flex;
    gap: 3px;
    height: 36px;
    margin-bottom: 1.25rem;
}
.uptime-day {
    flex: 1 1 0;
    min-width: 3px;
    border-radius: 3px;
    background: var(--border-medium);
}
.uptime-day.day-good { background: var(--success); }
.uptime-day.day-warn { background: var(--warning); }
.uptime-day.day-bad { background: var(--danger); }

/* Public share page */
.share-page { margin-top: 0; }
.share-header { align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.share-logo { height: 44px; }
.share-footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.share-page .glass-panel:hover { transform: none; }

@media (max-width: 700px) {
    .form-row, .form-row.form-row-3, .report-columns { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .report-columns { gap: 1rem; }
    .recovery-codes { grid-template-columns: minmax(0, 1fr); }
    .page-panel .tabs-header { gap: 0.25rem; }
    .page-panel .tab-btn { padding: 0.5rem 0.6rem; font-size: 0.92rem; }
    .dashboard-header { flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
    .inline-form:not(.wrap) { flex-wrap: wrap; }
    /* Phones: page title smaller; its buttons share the full row evenly. */
    .dashboard-header h1, .detail-title-row h1 { font-size: 1.45rem; }
    .dashboard-header .header-actions { width: 100%; margin-left: 0; justify-content: stretch; }
    .dashboard-header .header-actions > :is(button, a) { flex: 1 1 calc(50% - 0.3rem); width: auto; justify-content: center; }
    /* Stat cards: tighter, so two fit side by side without the labels breaking up. */
    .kpi-strip { gap: 0.6rem; }
    .kpi-card { padding: 0.85rem 0.9rem; gap: 0.65rem; }
    .kpi-icon { width: 34px; height: 34px; border-radius: 9px; }
    .kpi-icon .icon { width: 17px; height: 17px; }
    .kpi-value { font-size: 1.4rem; }
    .kpi-label { font-size: 0.78rem; line-height: 1.25; }
    /* Filter rows: search on its own row, the drop-downs two per row. */
    .results-filters { width: 100%; }
    .results-filters > .filter-input.text-input { flex: 1 1 100%; width: auto; }
    .results-filters > .filter-select.text-input { flex: 1 1 calc(50% - 0.3rem); width: auto; min-width: 0; }
    .results-filters > .column-toggle-container { flex: 1 1 calc(50% - 0.3rem); }
    .results-filters > .column-toggle-container > .btn-secondary { width: 100%; }
    .analytics-dashboard { gap: 0.75rem; }
    .glass-panel { padding: 1.1rem; }
}

/* The stacked-card mobile layout is only for the dashboard's #domains-table;
   plain tables on the other pages scroll sideways inside their panel. */
@media (max-width: 900px) {
    .share-page .table-container, .page-panel .table-container {
        overflow-x: auto;
        border: 1px solid var(--border-light);
    }
    .page-panel, .settings-card, .share-page .results-section { padding: 1.25rem; }
    .share-page .kpi-strip { margin-bottom: 0; }
    .share-page .kpi-card { padding: 1rem 1.25rem; min-width: 0; }
}

/* Printable client report: only #print-report is printed */
.print-report { display: none; }
@media print {
    @page { margin: 15mm; }
    html, body {
        background: #ffffff !important;
        color: #111111 !important;
        padding: 0 !important;
        display: block !important;
        min-height: 0 !important;
    }
    .no-print, .top-nav, .app-sidebar, .mobile-topbar, .sidebar-backdrop, .background-effects, .toast-container { display: none !important; }
    .dashboard-container { margin: 0 !important; max-width: none !important; }
    .print-report:not([hidden]) { display: block !important; color: #111111; }
    .print-header {
        display: flex;
        align-items: center;
        gap: 1.25rem;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid #3F0A08;
    }
    .print-header img { height: 44px; }
    .print-header h1 { font-size: 18pt; margin: 0 0 0.25rem; color: #3F0A08; }
    .print-header p { margin: 0; font-size: 10pt; color: #555555; }
    .print-table { width: 100%; border-collapse: collapse; font-size: 10pt; }
    .print-table th {
        position: static;
        background: #f1ece6 !important;
        color: #3F0A08;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        padding: 6pt 8pt;
        border-bottom: 1px solid #999999;
        font-size: 9pt;
    }
    .print-table td {
        padding: 6pt 8pt;
        border-bottom: 1px solid #dddddd;
        color: #111111;
        vertical-align: top;
    }
    .print-table tr { page-break-inside: avoid; }
    .print-table small { color: #555555; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ------------------------------------------------------------------
   Internal / External tabs, Cards / List switch, client cards
   ------------------------------------------------------------------ */
/* Segmented switches: a sunken track; the chosen option is a raised chip. */
.segment-bar {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    align-self: flex-start;
    padding: 0.25rem;
    border-radius: 12px;
    background: var(--surface-sunken);
    border: 1px solid var(--border-medium);
}
.segment-btn, .view-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-weight: 550;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.segment-btn {
    padding: 0.42rem 0.95rem;
    border-radius: 9px;
    font-size: 0.9rem;
}
.segment-btn:hover, .view-btn:hover { color: var(--text-primary); }
.segment-btn.active, .view-btn.active {
    background: var(--surface-raised);
    color: var(--text-primary);
    font-weight: 650;
    box-shadow: var(--shadow-sm), 0 0 0 1px var(--border-medium);
}
[data-theme="light"] .segment-btn.active, [data-theme="light"] .view-btn.active { box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12), 0 0 0 1px rgba(17, 24, 39, 0.06); }
.segment-count {
    min-width: 1.5rem;
    padding: 0.02rem 0.42rem;
    border-radius: 999px;
    background: var(--hover-bg);
    border: 1px solid var(--border-light);
    font-size: 0.74rem;
    font-weight: 650;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.segment-btn.active .segment-count { background: color-mix(in srgb, var(--accent-color) 18%, transparent); border-color: transparent; }

.type-dot {
    display: inline-block;
    flex-shrink: 0;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    border: 2px solid var(--text-secondary);
    opacity: 0.6;
}
.type-dot.type-internal { background: var(--type-internal); border-color: var(--type-internal); opacity: 1; }
.type-dot.type-external { background: var(--type-external); border-color: var(--type-external); opacity: 1; }

.type-badge {
    display: inline-block;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 650;
    line-height: 1.4;
    white-space: nowrap;
    border: 1px solid color-mix(in srgb, currentColor 45%, transparent);
}
.type-badge.type-internal { color: var(--type-internal); background: color-mix(in srgb, var(--type-internal) 14%, transparent); }
.type-badge.type-external { color: var(--type-external); background: color-mix(in srgb, var(--type-external) 14%, transparent); }
.type-badge.type-mixed { color: var(--warning); background: rgba(245, 158, 11, 0.12); }
.type-badge.type-none { color: var(--text-secondary); border-style: dashed; }

.results-title-group { flex-wrap: wrap; }
.view-toggle {
    display: inline-flex;
    gap: 0.2rem;
    padding: 0.2rem;
    border-radius: 10px;
    background: var(--surface-sunken);
    border: 1px solid var(--border-medium);
}
.view-btn {
    padding: 0.32rem 0.75rem;
    border-radius: 7px;
    font-size: 0.85rem;
}
.view-btn .icon { width: 15px; height: 15px; }

/* Internal / External tabs at the top of the domains panel: underline tabs. */
.results-header .domain-tabs { flex-basis: 100%; }
.domain-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border-medium);
}
.domain-tabs .segment-btn {
    padding: 0.65rem 1rem;
    border-radius: 8px 8px 0 0;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    box-shadow: none;
}
.domain-tabs .segment-btn:hover { background: var(--hover-bg); }
.domain-tabs .segment-btn.active {
    background: transparent;
    color: var(--text-primary);
    border-bottom-color: var(--accent-color);
    box-shadow: none;
}
.domain-tabs .segment-btn[data-type="internal"].active { border-bottom-color: var(--type-internal); }
.domain-tabs .segment-btn[data-type="external"].active { border-bottom-color: var(--type-external); }
.domain-tabs .segment-btn.active .segment-count { background: var(--accent-color); color: var(--on-accent); }
.domain-tabs .segment-btn.active .type-dot { border-color: var(--text-secondary); }
.domain-tabs .segment-btn.active .type-dot.type-internal { border-color: var(--type-internal); }
.domain-tabs .segment-btn.active .type-dot.type-external { border-color: var(--type-external); }

.tile-select-all {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
    cursor: pointer;
}
.tile-select-all input { width: 16px; height: 16px; cursor: pointer; }
#tile-sort.filter-select { width: 190px; }

/* Cards view: one square card per domain */
.domain-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 1rem;
}
.domain-tiles > .empty-state { grid-column: 1 / -1; }
.domain-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    aspect-ratio: 1 / 1;
    padding: 0.85rem 0.9rem 0.55rem;
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    border: 1px solid var(--border-medium);
    box-shadow: inset 0 3px 0 0 var(--border-medium);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
[data-theme="light"] .domain-tile, [data-theme="light"] .site-card { background: #ffffff; }
.domain-tile:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.domain-tile.tile-healthy { box-shadow: inset 0 3px 0 0 var(--success); }
.domain-tile.tile-watch { box-shadow: inset 0 3px 0 0 var(--warning); }
.domain-tile.tile-at-risk { box-shadow: inset 0 3px 0 0 var(--danger); }
.domain-tile.tile-selected { outline: 2px solid var(--accent-color); outline-offset: -1px; }
.tile-skeleton { justify-content: center; gap: 0.9rem; }

/* Three columns with equal sides, so the markers sit on the card's centre line (in line with the ring). */
.tile-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    min-height: 1.5rem;
}
.tile-top > :first-child { justify-self: start; }
.tile-top .card-checkbox { width: 16px; height: 16px; margin: 0; cursor: pointer; }
.tile-markers {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.tile-markers .domain-marker { margin-left: 0; }
.tile-markers .domain-marker .icon { width: 1rem; height: 1rem; }
.tile-top .type-badge { grid-column: 3; justify-self: end; font-size: 0.7rem; padding: 0.12rem 0.5rem; }

.tile-ring {
    position: relative;
    flex-shrink: 0;
    width: 92px;
    height: 92px;
    color: var(--text-secondary);
}
.tile-ring.ring-valid { color: var(--success); }
.tile-ring.ring-expiring { color: var(--warning); }
.tile-ring.ring-expired { color: var(--danger); }
.tile-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--border-medium); stroke-width: 3; }
.ring-value { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    text-align: center;
}
.ring-label strong { font-size: 1.65rem; font-weight: 700; color: var(--text-primary); }
.ring-label .ring-word { font-size: 0.95rem; color: currentColor; }
.tile-ring.ring-expired .ring-word { color: var(--danger); }
.tile-ring.ring-expiring .ring-word { color: var(--warning); }
.ring-label > span { font-size: 0.68rem; color: var(--text-secondary); }

.tile-name {
    width: 100%;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tile-name .domain-link { color: var(--text-primary); text-decoration: none; }
.tile-name .domain-link:hover { color: var(--accent-color); text-decoration: underline; }
.tile-client {
    width: 100%;
    margin-top: -0.4rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tile-client-none { font-style: italic; opacity: 0.7; }

.tile-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
}
.tile-chip {
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.chip-status-valid { color: var(--success); background: rgba(16, 185, 129, 0.12); }
.chip-status-expiring { color: var(--warning); background: rgba(245, 158, 11, 0.14); }
.chip-status-expired { color: var(--danger); background: rgba(239, 68, 68, 0.14); }
.chip-muted, .chip-status-unknown { color: var(--text-secondary); background: var(--border-light); }

.tile-actions {
    display: flex;
    justify-content: center;
    gap: 0.1rem;
    width: 100%;
    margin-top: auto;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border-light);
    opacity: 0.55;
    transition: opacity 0.15s;
}
.domain-tile:hover .tile-actions, .domain-tile:focus-within .tile-actions { opacity: 1; }
@media (hover: none) { .tile-actions { opacity: 1; } }
.tile-actions .btn-action { font-size: 1rem; margin: 0; width: 1.9rem; height: 1.9rem; }

@media (max-width: 700px) {
    .segment-bar { border-radius: 14px; }
    .segment-btn { padding: 0.45rem 0.8rem; font-size: 0.88rem; }
    .domain-tabs .segment-btn { padding: 0.6rem 0.7rem; font-size: 0.9rem; }
    .domain-tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; }
    .domain-tile { aspect-ratio: auto; padding: 0.75rem 0.6rem 0.45rem; }
    .tile-ring { width: 76px; height: 76px; }
    .tile-top { gap: 0.2rem; }
    .tile-top .type-badge { padding: 0.12rem 0.4rem; font-size: 0.68rem; }
    .ring-label strong { font-size: 1.35rem; }
    .analytics-dashboard { flex-direction: column; }
    .analytics-dashboard > .glass-panel { min-width: 0; }
}

/* Dashboard at every screen size. Sizes follow the page's own width (not the
   window's), so they also adapt when the sidebar is collapsed. */
.dashboard-container.dash-page { container: page dash / inline-size; }
@media (min-width: 1600px) { .dashboard-container.dash-page { max-width: 1480px; } }
@media (min-width: 2200px) { .dashboard-container.dash-page { max-width: 1840px; } }
/* Stat cards: four in a row only when each has room for its label on one line. */
@container dash (max-width: 960px) { .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Bulk actions (shown once domains are ticked): beside the filters on a wide page;
   otherwise a row of their own above them, the buttons wrapping and sharing each row. */
#bulk-actions-toolbar { flex-wrap: wrap; max-width: 100%; }
#bulk-actions-toolbar > button { white-space: nowrap; }
#bulk-count { white-space: nowrap; }
@container dash (max-width: 1099px) {
    #bulk-actions-toolbar { flex: 1 1 100%; margin-right: 0 !important; padding: 0 0 0.75rem !important; border-right: none !important; border-bottom: 1px solid var(--border-medium); }
    #bulk-count { margin-right: 0.25rem; }
}
@media (max-width: 700px) {
    #bulk-actions-toolbar > button { flex: 1 1 auto; justify-content: center; padding: 0.55rem 0.7rem !important; }
}
@media (min-width: 701px) {
    /* Filters get their own full row and share it evenly, wrapping into tidy rows. */
    .dash-page .results-filters { flex: 1 1 100%; }
    .dash-page .results-filters > .filter-input.text-input { flex: 2 1 220px; width: auto; }
    .dash-page .results-filters > .filter-select.text-input { flex: 1 1 150px; width: auto; min-width: 0; }
    .dash-page .results-filters > #tile-sort.filter-select { flex-basis: 180px; }
    .dash-page .domain-tiles { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (max-width: 700px) {
    /* Header buttons share the row two by two, each label on one line (a long one takes a row of its own). */
    .dashboard-header .header-actions > :is(button, a) { white-space: nowrap; padding-left: 0.6rem; padding-right: 0.6rem; }
    .dash-page .chart-panel-canvas { height: 190px; }
    .dash-page .results-title-group .view-toggle { margin-left: auto; }
}
/* List view as a table (wide pages): snug cells, and the action buttons stay
   pinned at the right edge when extra columns make the table scroll sideways. */
@container dash (min-width: 1100px) {
    #domains-table th, #domains-table td { padding-left: 0.7rem; padding-right: 0.7rem; }
    #domains-table td.actions-cell .btn-action { margin-right: 0; width: 1.85rem; height: 1.85rem; }
    #domains-table th.col-actions, #domains-table td.actions-cell { position: sticky; right: 0; }
    #domains-table th.col-actions { z-index: 41; }
    #domains-table td.actions-cell { z-index: 1; background: var(--surface); }
    #domains-table tr:hover td.actions-cell { background: linear-gradient(var(--hover-bg), var(--hover-bg)), var(--surface); }
    #list-view.table-wide :is(th.col-actions, td.actions-cell) { box-shadow: -12px 0 12px -12px rgba(0, 0, 0, 0.35); }
}
/* Small phones: "All" instead of "All domains", so the tabs fit on one line. */
/* Phones and short screens (a phone on its side): the filter bar scrolls away with
   the page - pinned, its tabs, search and drop-downs would cover a third to a half
   of the screen. */
@media (max-width: 700px), (max-height: 560px) {
    .results-header { position: static; margin-top: 0; padding-top: 0; }
}
@media (max-width: 480px) {
    .seg-word { display: none; }
    .domain-tabs { gap: 0.1rem; }
    .domain-tabs .segment-btn { padding-left: 0.55rem; padding-right: 0.55rem; }
}
/* Common phones (360-414px): a slimmer panel edge so the cards fit two per row. */
@media (max-width: 440px) {
    .dash-page .results-section { padding-left: 0.75rem; padding-right: 0.75rem; }
    .dash-page .domain-tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.6rem; }
}
@media (max-width: 380px) {
    .dash-page .tile-top .type-badge { padding: 0.1rem 0.32rem; font-size: 0.64rem; }
    .dash-page .tile-chips { gap: 0.25rem; }
    .dash-page .domain-tile .tile-chip { padding-inline: 0.42rem; }
    .domain-tabs .segment-btn { gap: 0.3rem; padding-left: 0.45rem; padding-right: 0.45rem; font-size: 0.86rem; }
    .domain-tabs .type-dot { display: none; }
}
/* Touch screens: controls a finger can hit. */
@media (pointer: coarse) {
    .view-btn { min-height: 2.25rem; }
    .tile-actions { gap: 0; }
    .tile-actions .btn-action { flex: 1 1 0; width: auto; max-width: 2.6rem; height: 2.3rem; }
    .domain-tile .tile-chip { padding-block: 0.3rem; }
}

/* ------------------------------------------------------------------
   Site Status page (sites.html): screenshot card per website
   ------------------------------------------------------------------ */
.sites-header { gap: 0.75rem 1rem; }
.sites-header .filter-input.text-input { width: 220px; margin-left: auto; }
.state-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.state-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.1rem;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--border-medium);
    background: var(--surface-raised);
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 550;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.state-filter span:last-child { font-weight: 650; font-variant-numeric: tabular-nums; }
.state-filter:hover { color: var(--text-primary); border-color: var(--border-strong); }
.state-filter.active { border-color: var(--accent-color); color: var(--text-primary); background: color-mix(in srgb, var(--accent-color) 14%, var(--surface-raised)); }
.state-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--text-secondary); }
.state-working .state-dot { background: var(--success); }
.state-broken .state-dot { background: var(--danger); }
.state-not_live .state-dot { background: var(--warning); }
/* Phone-width pages: each chip group is an even two-column grid, label at the left
   and count at the right (like the other filter grids); an odd last chip spans the row. */
@container page (max-width: 599px) {
    .sites-header .state-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); flex: 1 1 100%; width: 100%; }
    .sites-header .state-filter { min-width: 0; padding-inline: 0.75rem; white-space: nowrap; }
    .sites-header .state-filter > span:last-child { margin-left: auto; }
    .sites-header .state-filter:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.25rem;
}
.sites-grid > .empty-state { grid-column: 1 / -1; }
.site-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    border: 1px solid var(--border-medium);
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.site-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.site-card.site-working { box-shadow: inset 0 3px 0 0 var(--success); }
.site-card.site-broken { box-shadow: inset 0 3px 0 0 var(--danger); border-color: rgba(239, 68, 68, 0.45); }
.site-card.site-not_live { box-shadow: inset 0 3px 0 0 var(--warning); }
.site-card.site-busy { opacity: 0.6; }

.site-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #ffffff;
    background: var(--text-secondary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.site-working .site-badge { background: #059669; }
.site-broken .site-badge { background: #dc2626; }
.site-not_live .site-badge { background: #d97706; }

/* The status badge and health score sit in the top corners, above the name */
.site-body { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; padding: 3.1rem 1rem 0.75rem; }
.site-title-row { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.site-name {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: 1.02rem;
    color: var(--text-primary);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.site-name:hover { color: var(--accent-color); text-decoration: underline; }
.site-title-row .type-badge { font-size: 0.7rem; padding: 0.12rem 0.5rem; }
.site-client { font-size: 0.8rem; color: var(--text-secondary); }
.site-reason {
    font-size: 0.86rem;
    color: var(--text-primary);
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.site-broken .site-reason { color: #fca5a5; }
.site-not_live .site-reason { color: var(--warning); }
[data-theme="light"] .site-broken .site-reason { color: var(--danger); }
.site-changed { font-size: 0.76rem; color: var(--text-secondary); font-style: italic; }
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}
.site-meta { font-size: 0.75rem; color: var(--text-secondary); }


@media (max-width: 700px) {
    .sites-header .filter-input.text-input { width: 100%; margin-left: 0; }
    .sites-grid { grid-template-columns: minmax(0, 1fr); }
}
/* ------------------------------------------------------------------
   Site Status cards: security / speed / issue chips
   ------------------------------------------------------------------ */
.site-visit { display: inline-flex; color: var(--text-secondary); flex-shrink: 0; }
.site-visit:hover { color: var(--accent-color); }
.site-visit .icon { width: 15px; height: 15px; }
.site-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.15rem; }
.site-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    white-space: nowrap;
}
.site-chip .icon { width: 13px; height: 13px; }
.site-chip:hover { filter: brightness(1.15); }
.chip-good { color: #34d399; background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.35); }
.chip-average { color: #fbbf24; background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.35); }
.chip-poor { color: #f87171; background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.35); }
[data-theme="light"] .chip-good { color: #047857; }
[data-theme="light"] .chip-average { color: #b45309; }
[data-theme="light"] .chip-poor { color: #b91c1c; }

/* ------------------------------------------------------------------
   Site details page (site.html)
   ------------------------------------------------------------------ */
.site-detail { display: flex; flex-direction: column; gap: 1.5rem; }
.site-detail > .dashboard-header { margin-bottom: 0; }
.detail-heading { min-width: 0; }
.detail-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; }
.detail-title-row h1 { overflow-wrap: anywhere; }
#detail-subtitle { overflow-wrap: anywhere; }
.detail-state, .detail-state-inline {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    background: var(--text-secondary);
}
.detail-state-inline { font-size: 0.78rem; padding: 0.1rem 0.55rem; }
.detail-state.site-working, .detail-state-inline.site-working { background: #059669; }
.detail-state.site-broken, .detail-state-inline.site-broken { background: #dc2626; }
.detail-state.site-not_live, .detail-state-inline.site-not_live { background: #d97706; }
.detail-link-btn { text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem; }
.detail-link-btn .icon { margin: 0; }
#detail-message { margin: 0; }


.detail-facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.55rem 1rem;
    margin: 0;
    font-size: 0.92rem;
}
.detail-facts dt { color: var(--text-secondary); font-weight: 500; }
.detail-facts dd { margin: 0; color: var(--text-primary); overflow-wrap: anywhere; }
.detail-facts a { color: var(--accent-color); }
.detail-facts code { font-size: 0.82rem; }
.redirect-hop { display: block; overflow-wrap: anywhere; }
.redirect-hop code { color: var(--warning); margin-right: 0.2rem; }

.score-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.score-tile {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem 1.2rem;
    border-radius: 14px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 3px 0 0 var(--text-secondary);
    color: var(--text-primary);
    text-decoration: none;
    transition: transform 0.15s ease;
}
.score-tile:hover { transform: translateY(-2px); }
.score-label { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text-secondary); font-size: 0.85rem; font-weight: 500; }
.score-label .icon { width: 16px; height: 16px; }
.score-grade { font-size: 2rem; line-height: 1.1; }
.score-sub { font-size: 0.8rem; color: var(--text-secondary); }
.score-tile.level-good { box-shadow: inset 0 3px 0 0 var(--success); }
.score-tile.level-good .score-grade { color: var(--success); }
.score-tile.level-average { box-shadow: inset 0 3px 0 0 var(--warning); }
.score-tile.level-average .score-grade { color: var(--warning); }
.score-tile.level-poor { box-shadow: inset 0 3px 0 0 var(--danger); }
.score-tile.level-poor .score-grade { color: var(--danger); }

.detail-section { scroll-margin-top: 1rem; }
.detail-section-title { display: flex; align-items: center; gap: 0.55rem; font-size: 1.3rem; margin-bottom: 0.3rem; }
.detail-section-title .icon { width: 22px; height: 22px; color: var(--accent-color); }
.detail-section .card-intro { margin-bottom: 1rem; overflow-wrap: anywhere; }
.detail-subhead { font-size: 1rem; font-weight: 600; margin: 1.4rem 0 0.6rem; color: var(--text-primary); }
.detail-empty { display: flex; align-items: center; gap: 0.5rem; color: var(--text-secondary); margin: 0.25rem 0; }
.detail-empty .icon { width: 18px; height: 18px; color: var(--success); }
.muted { color: var(--text-secondary); }
.small { font-size: 0.82rem; }
.text-warning { color: var(--warning); }

.issue-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.issue {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    background: var(--input-bg);
    border-left: 4px solid var(--text-secondary);
}
.issue-icon { display: inline-flex; flex-shrink: 0; margin-top: 0.1rem; }
.issue-icon .icon { width: 18px; height: 18px; }
.issue-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.issue-area {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-medium);
}
.issue-critical { border-left-color: var(--danger); }
.issue-critical .issue-icon { color: var(--danger); }
.issue-warning { border-left-color: var(--warning); }
.issue-warning .issue-icon { color: var(--warning); }
.issue-info .issue-icon { color: var(--text-secondary); }

.header-summary { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; margin-bottom: 1rem; }
.header-grade {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    border-radius: 14px;
    color: #ffffff;
    background: #dc2626;
    flex-shrink: 0;
}
.header-grade strong { font-size: 2.1rem; line-height: 1; }
.header-grade span { font-size: 0.78rem; opacity: 0.9; }
.header-grade.grade-Aplus, .header-grade.grade-A { background: #059669; }
.header-grade.grade-B { background: #65a30d; }
.header-grade.grade-C { background: #d97706; }
.header-grade.grade-D, .header-grade.grade-E { background: #ea580c; }
.header-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; flex: 1; min-width: 0; }
.header-chip, .header-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.65rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
}
.header-chip .icon, .header-status .icon { width: 14px; height: 14px; stroke-width: 3; }
.header-good { background: #15803d; }
.header-weak { background: #b45309; }
.header-missing { background: #b91c1c; }

.detail-table-wrap { overflow-x: auto; border: 1px solid var(--border-light); border-radius: 10px; }
.detail-table th { position: static; padding: 0.7rem 0.9rem; font-size: 0.78rem; }
.detail-table td { padding: 0.75rem 0.9rem; vertical-align: top; font-size: 0.9rem; }
.detail-table tr:last-child td { border-bottom: none; }
.header-about { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.25rem; line-height: 1.35; max-width: 34rem; }
.header-value {
    display: block;
    font-size: 0.8rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-height: 7.5rem;
    overflow-y: auto;
    color: var(--text-primary);
}
.header-note { margin-top: 0.3rem; font-size: 0.8rem; color: var(--warning); }
.headers-table td:nth-child(1) { width: 38%; }
.headers-table td:nth-child(2) { width: 1%; white-space: nowrap; }

.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.check-list li { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.9rem; overflow-wrap: anywhere; }
.check-list .icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 0.15rem; stroke-width: 3; }
.check-good .icon { color: var(--success); }
.check-weak .icon { color: var(--warning); }
.check-missing .icon { color: var(--danger); }
.check-info .icon { color: var(--text-secondary); stroke-width: 2.5; }
.detail-section p.muted a { color: var(--accent-color); }
.url-list { margin: 0.5rem 0 0 1.6rem; font-size: 0.82rem; overflow-wrap: anywhere; }
.url-list a, .url-cell a { color: var(--accent-color); }
.raw-headers { margin-top: 1.2rem; }
.raw-headers summary { cursor: pointer; color: var(--text-secondary); font-weight: 500; margin-bottom: 0.6rem; }
.raw-headers td:first-child { width: 1%; white-space: nowrap; }

.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 0.8rem; }
.metric {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: var(--input-bg);
    border: 1px solid var(--border-medium);
    border-top: 3px solid var(--text-secondary);
}
.metric-label { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }
.metric-value { font-size: 1.45rem; line-height: 1.2; }
.metric-help { font-size: 0.74rem; color: var(--text-secondary); line-height: 1.35; }
.metric-good { border-top-color: var(--success); }
.metric-good .metric-value { color: var(--success); }
.metric-average { border-top-color: var(--warning); }
.metric-average .metric-value { color: var(--warning); }
.metric-poor { border-top-color: var(--danger); }
.metric-poor .metric-value { color: var(--danger); }

.timing-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--border-light); }
.timing-seg { min-width: 3px; }
.seg-0 { background: #38bdf8; }
.seg-1 { background: #a78bfa; }
.seg-2 { background: #f472b6; }
.seg-3 { background: #fbbf24; }
.seg-4 { background: #34d399; }
.timing-legend { list-style: none; margin: 0.6rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; font-size: 0.84rem; color: var(--text-secondary); }
.timing-legend li { display: inline-flex; align-items: center; gap: 0.35rem; }
.timing-legend strong { color: var(--text-primary); font-weight: 600; }
.timing-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.timing-total { margin-left: auto; }


.errors-table td:nth-child(1) { width: 1%; white-space: nowrap; }
.errors-table td:nth-child(3) { width: 1%; white-space: nowrap; }
.url-cell { overflow-wrap: anywhere; word-break: break-all; font-size: 0.84rem; }
.error-code { color: var(--danger); font-weight: 600; font-size: 0.84rem; }

@media (max-width: 700px) {
    .detail-facts { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
    .detail-facts dd { margin-bottom: 0.5rem; }
    .score-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
    .score-tile { padding: 0.8rem; }
    .score-grade { font-size: 1.5rem; }
    .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
    /* The title takes the full row; area tag and Ignore go underneath. */
    .issue-head { flex-wrap: wrap; row-gap: 0.35rem; }
    .issue-text { flex: 1 1 calc(100% - 2.6rem); min-width: 0; }
    .issue-area { order: 3; margin-left: 1.9rem; }
    .timing-total { margin-left: 0; }
    /* Tables become stacked blocks. */
    .detail-table thead { display: none; }
    .detail-table tr { display: block; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border-light); }
    .detail-table td { display: block; width: auto !important; white-space: normal !important; padding: 0.2rem 0; border: none; }
    .detail-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.72rem;
        font-weight: 600;
        text-transform: uppercase;
        color: var(--text-secondary);
    }
}
/* Site details: "How to fix" suggestions */
.issue { flex-direction: column; align-items: stretch; gap: 0.45rem; }
.issue-head { display: flex; align-items: flex-start; gap: 0.7rem; }
.issue-fix { margin-left: 1.9rem; font-size: 0.87rem; min-width: 0; }
.fix-code, .fix-code pre { max-width: 100%; min-width: 0; }
.issue-fix summary {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.82rem;
    list-style: none;
}
.issue-fix summary::-webkit-details-marker { display: none; }
.issue-fix summary::after { content: '▸'; font-size: 0.75rem; transition: transform 0.15s ease; }
.issue-fix[open] summary::after { transform: rotate(90deg); }
.issue-fix summary .icon { width: 14px; height: 14px; }
.issue-fix p { margin: 0.4rem 0 0; color: var(--text-primary); line-height: 1.5; overflow-wrap: anywhere; }
.fix-code { position: relative; margin-top: 0.55rem; }
.fix-code pre {
    margin: 0;
    padding: 0.75rem 0.9rem;
    padding-right: 6.5rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-medium);
    overflow-x: auto;
    font-size: 0.8rem;
    line-height: 1.5;
}
[data-theme="light"] .fix-code pre { background: rgba(0, 0, 0, 0.05); }
.fix-code code { white-space: pre; color: var(--text-primary); }
.copy-code {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
}
.copy-code .icon { width: 13px; height: 13px; }
.header-fix { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem; margin-top: 0.4rem; font-size: 0.78rem; }
.header-fix span { color: var(--success); font-weight: 600; }
.header-fix code { font-size: 0.76rem; overflow-wrap: anywhere; word-break: break-all; color: var(--text-primary); }
.fix-all .detail-subhead { display: flex; align-items: center; gap: 0.45rem; }
.fix-all .detail-subhead .icon { width: 18px; height: 18px; color: var(--accent-color); }
.fix-all p code { font-size: 0.8rem; }
@media (max-width: 700px) {
    .issue-fix { margin-left: 0; }
    .fix-code pre { padding-right: 0.9rem; padding-top: 2.4rem; }
}
/* ------------------------------------------------------------------
   Subdomains: chip on the domain card / table row, and the manager modal
   ------------------------------------------------------------------ */
button.tile-chip { border: none; font-family: inherit; cursor: pointer; }
.chip-subdomains {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--accent-color);
    background: var(--hover-bg);
    box-shadow: inset 0 0 0 1px var(--border-medium);
}
.chip-subdomains .icon { width: 12px; height: 12px; }
.chip-subdomains:hover { box-shadow: inset 0 0 0 1px var(--accent-color); }
.chip-subdomains.chip-muted { color: var(--text-secondary); box-shadow: none; }
.chip-subdomains-bad { color: var(--danger); box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.45); }
td.col-domain .chip-subdomains { margin-left: 0.35rem; vertical-align: middle; }

.subdomain-modal-content { max-width: 620px; }
.subdomain-modal-content h2 { overflow-wrap: anywhere; }
.subdomain-modal-content .card-intro a { color: var(--accent-color); }
.subdomain-list { list-style: none; margin: 0 0 1.2rem; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.subdomain-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    background: var(--input-bg);
    border: 1px solid var(--border-medium);
}
.subdomain-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.subdomain-name { color: var(--text-primary); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.subdomain-name:hover { color: var(--accent-color); text-decoration: underline; }
.subdomain-status { font-size: 0.8rem; color: var(--text-secondary); overflow-wrap: anywhere; }
.subdomain-row .btn-action { flex-shrink: 0; }
.subdomain-empty { color: var(--text-secondary); padding: 0.4rem 0; }
.state-dot-working, .state-dot-broken, .state-dot-not_live, .state-dot-unchecked {
    width: 0.65rem; height: 0.65rem; border-radius: 50%; flex-shrink: 0; background: var(--text-secondary);
}
.state-dot-working { background: var(--success); }
.state-dot-broken { background: var(--danger); }
.state-dot-not_live { background: var(--warning); }
.subdomain-add-form label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
.subdomain-input-row { display: flex; align-items: center; gap: 0.5rem; }
.subdomain-input-row .text-input { flex: 1; min-width: 0; }
.subdomain-suffix { color: var(--text-secondary); font-size: 0.9rem; white-space: nowrap; max-width: 40%; overflow: hidden; text-overflow: ellipsis; }
.form-hint { font-size: 0.8rem; color: var(--text-secondary); margin: 0.4rem 0 0; }

/* Site Status: which domain a subdomain belongs to */
.site-parent { font-size: 0.78rem; color: var(--text-secondary); }
.site-parent a { color: var(--accent-color); text-decoration: none; }
.site-parent a:hover { text-decoration: underline; }
.subdomain-links { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; }
.subdomain-links a { display: inline-flex; align-items: center; gap: 0.3rem; }

@media (max-width: 700px) {
    .subdomain-input-row { flex-wrap: wrap; }
    .subdomain-suffix { max-width: none; }
    .subdomain-input-row .btn-primary { width: 100%; }
}
/* Site Status: the page checked when it isn't the home page */
.site-path { color: var(--text-secondary); font-weight: 500; }
/* Site Status: Domains / Subdomains filter, set apart from the status filters */
.kind-filters { padding-right: 0.9rem; border-right: 1px solid var(--border-medium); }
.kind-filter .icon { width: 14px; height: 14px; }
@media (max-width: 700px) {
    .kind-filters { padding-right: 0; border-right: none; }
}
/* ------------------------------------------------------------------
   Site Status monitoring: health, summary strip, report, history...
   ------------------------------------------------------------------ */
.text-success { color: var(--success); }
.checkbox-inline { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; color: var(--text-primary); font-size: 0.9rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--border-light); flex-wrap: wrap; }

/* Themed confirm / alert / prompt (assets/js/dialog.js) - replaces the browser's boxes */
.app-dialog {
    --dlg-bg: var(--surface-raised);
    --dlg-tone: var(--accent-color);
    --dlg-on-accent: var(--on-accent);
    width: min(440px, calc(100vw - 32px));
    margin: auto;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    /* A soft wash of the box's tone (red for a delete, amber for a warning) behind the icon. */
    background:
        radial-gradient(90% 150px at 0 0, color-mix(in srgb, var(--dlg-tone) 12%, transparent), transparent 70%),
        var(--dlg-bg);
    color: var(--text-primary);
    box-shadow: 0 28px 70px -14px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.15), 0 0 44px -16px color-mix(in srgb, var(--dlg-tone) 50%, transparent);
    font: inherit;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
[data-theme="light"] .app-dialog { box-shadow: var(--shadow-lg), 0 0 40px -18px color-mix(in srgb, var(--dlg-tone) 40%, transparent); }
/* The tone's line along the top edge. */
.app-dialog::before {
    content: ""; position: absolute; top: 0; left: 1.4rem; right: 1.4rem; height: 3px; border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, transparent, var(--dlg-tone) 30%, var(--dlg-tone) 70%, transparent);
}
.app-dialog-danger { --dlg-tone: var(--danger); }
.app-dialog-warning { --dlg-tone: var(--warning); }
.app-dialog-success { --dlg-tone: var(--success); }
.app-dialog::backdrop, .qs-dialog::backdrop {
    background: color-mix(in srgb, var(--bg-color) 45%, rgba(0, 0, 0, 0.6));
    -webkit-backdrop-filter: blur(6px) saturate(115%);
    backdrop-filter: blur(6px) saturate(115%);
}
[data-theme="light"] .app-dialog::backdrop, [data-theme="light"] .qs-dialog::backdrop { background: rgba(15, 23, 42, 0.38); }
.app-dialog[open] { animation: app-dialog-in 0.18s ease-out; }
.app-dialog[open]::backdrop { animation: app-dialog-fade 0.18s ease-out; }
@keyframes app-dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes app-dialog-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .app-dialog[open], .app-dialog[open]::backdrop { animation: none; } }
.app-dialog-box { padding: 1.5rem 1.5rem 1.3rem; }
.app-dialog-head { display: flex; gap: 1rem; align-items: flex-start; }
.app-dialog-icon { flex-shrink: 0; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%;
    color: var(--dlg-tone); background: color-mix(in srgb, var(--dlg-tone) 16%, transparent);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--dlg-tone) 7%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--dlg-tone) 30%, transparent);
    animation: app-dialog-icon-in 420ms var(--ease-spring, ease-out) 80ms both; }
@keyframes app-dialog-icon-in { from { opacity: 0; transform: scale(0.5) rotate(-12deg); } }
.app-dialog-icon svg { width: 1.35rem; height: 1.35rem; }
.app-dialog-text { min-width: 0; padding-top: 0.15rem; }
.app-dialog-title { margin: 0; font-size: 1.08rem; font-weight: 650; line-height: 1.35; color: var(--text-primary); overflow-wrap: anywhere; }
.app-dialog-message { margin: 0.4rem 0 0; font-size: 0.93rem; line-height: 1.55; color: var(--text-secondary); overflow-wrap: anywhere; }
.app-dialog-field { margin: 1rem 0 0; }
.app-dialog-field label { display: block; margin-bottom: 0.35rem; font-size: 0.85rem; color: var(--text-secondary); }
.app-dialog-field .text-input { width: 100%; }
.app-dialog-error { min-height: 1.1rem; margin: 0.35rem 0 0; font-size: 0.82rem; color: var(--danger); }
.app-dialog-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin: 1.4rem -1.5rem -1.3rem; padding: 0.95rem 1.5rem 1.1rem;
    border-top: 1px solid var(--border-light); border-radius: 0 0 19px 19px; background: color-mix(in srgb, var(--text-primary) 2.5%, transparent); }
.app-dialog-field + .app-dialog-actions { margin-top: 0.7rem; }
.app-dialog-btn { min-width: 6rem; padding: 0.6rem 1.1rem; border-radius: 10px; border: 1px solid transparent; font: inherit; font-size: 0.92rem; font-weight: 600;
    cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease; }
.app-dialog-btn:active { transform: scale(0.97); }
.app-dialog-cancel { background: transparent; color: var(--text-primary); border-color: var(--border-medium); }
.app-dialog-cancel:hover { background: color-mix(in srgb, var(--text-primary) 8%, transparent); }
.app-dialog-ok { background: linear-gradient(180deg, var(--accent-hover), var(--accent-color)); color: var(--dlg-on-accent);
    box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent-color) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.14); }
.app-dialog-ok:hover { filter: brightness(1.08); box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--accent-color) 80%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.14); }
.app-dialog-danger .app-dialog-ok { background: linear-gradient(180deg, color-mix(in srgb, var(--danger) 88%, #ffffff), var(--danger)); color: #ffffff;
    box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--danger) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.16); }
.app-dialog-btn:focus-visible { outline: 2px solid var(--dlg-tone); outline-offset: 2px; }
@media (max-width: 480px) {
    .app-dialog-actions { flex-direction: column-reverse; }
    .app-dialog-btn { width: 100%; }
}
.print-only { display: none; }

/* Health score badge (cards, report, share page) */
.health-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.3rem;
    height: 2.3rem;
    padding: 0 0.35rem;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    color: #ffffff;
    background: #6b7280;
    flex-shrink: 0;
}
.health-good { background: #059669; }
.health-average { background: #d97706; }
.health-poor { background: #dc2626; }
.site-health { position: absolute; top: 0.6rem; right: 0.6rem; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); border: 2px solid rgba(255, 255, 255, 0.85); }

/* Site Status card: traffic light (red broken, amber not live, green working) beside the name,
   status and health; the details, chips and Check now below */
.site-card-tl.site-working, .site-card-tl.site-not_live, .site-card-tl.site-broken, .site-card-tl { box-shadow: var(--shadow-sm); }
.site-card-tl.site-broken { border-color: color-mix(in srgb, var(--danger) 45%, var(--border-medium)); }
.site-card-tl:hover { box-shadow: var(--shadow-md); }
.site-card-tl .site-body { gap: 0.45rem; padding: 1rem 1.05rem 0.85rem; }
.tl-top { display: flex; align-items: stretch; gap: 0.9rem; min-width: 0; }
.tl-lights {
    display: flex; flex-direction: column; justify-content: center; gap: 0.4rem; flex-shrink: 0; padding: 0.5rem;
    border-radius: 14px; background: #15110f; box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
}
.tl-light {
    width: 1.65rem; height: 1.65rem; padding: 0; border-radius: 50%; cursor: pointer; opacity: 0.22;
    border: 2px solid rgba(255, 255, 255, 0.08); transition: opacity 0.2s, box-shadow 0.2s, transform 0.15s;
}
.tl-light-r { background: #ef4444; }
.tl-light-a { background: #f59e0b; }
.tl-light-g { background: #10b981; }
.tl-light.is-on { opacity: 1; box-shadow: 0 0 12px 2px currentColor; }
.tl-light-r.is-on { color: rgba(239, 68, 68, 0.7); }
.tl-light-a.is-on { color: rgba(245, 158, 11, 0.7); }
.tl-light-g.is-on { color: rgba(16, 185, 129, 0.7); }
.tl-light:hover, .tl-light.is-picked { opacity: 0.9; transform: scale(1.1); }
.tl-light:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; }
.site-card-tl:hover .tl-light.is-on { animation: tl-glow 1.4s ease-in-out infinite; }
@keyframes tl-glow { 50% { box-shadow: 0 0 20px 5px currentColor; } }
.tl-info { display: flex; flex-direction: column; gap: 0.3rem; flex: 1; min-width: 0; }
.tl-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.45rem; min-width: 0; }
.tl-title .site-name { flex: 0 1 auto; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.tl-title .type-badge { font-size: 0.7rem; padding: 0.12rem 0.5rem; }
.tl-state-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.tl-state { font-size: 1.2rem; font-weight: 700; color: var(--text-secondary); }
.site-working .tl-state { color: var(--success); }
.site-broken .tl-state { color: var(--danger); }
.site-not_live .tl-state { color: var(--warning); }
.tl-health { min-width: 2.2rem; height: 2.2rem; border-radius: 10px; font-size: 0.88rem; }
.site-card-tl .site-reason.is-explained { color: var(--text-secondary); font-style: italic; }
/* Check steps: DNS -> Server -> HTTPS -> Page -> Content, joined by a line */
.tl-steps { display: flex; margin: 0.35rem 0 0.1rem; padding: 0; list-style: none; }
.tl-steps li { position: relative; flex: 1; min-width: 0; }
.tl-steps li + li::before { content: ''; position: absolute; top: 0.85rem; right: 50%; width: 100%; height: 2px; background: var(--border-medium); }
.tl-step {
    position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 0.25rem; width: 100%; padding: 0;
    cursor: pointer; font: inherit; font-size: 0.72rem; font-weight: 600; color: var(--text-secondary); background: none; border: none;
}
.tl-step span {
    display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%;
    font-size: 0.85rem; font-weight: 800; color: #ffffff; background: var(--border-strong); transition: transform 0.15s;
}
.tl-step.is-ok span { background: var(--success); }
.tl-step.is-bad span { background: var(--danger); }
.tl-step.is-warn span { background: var(--warning); }
.tl-step.is-wait span { color: var(--text-muted); background: var(--surface-raised); border: 2px dashed var(--border-strong); }
.tl-step:hover span, .tl-step.is-picked span { transform: scale(1.15); }
.tl-step.is-picked { color: var(--text-primary); }
.tl-step:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; border-radius: 6px; }
.site-card-tl .site-parent, .site-card-tl .site-client { display: flex; align-items: center; gap: 0.35rem; }
.site-card-tl .site-parent .icon, .site-card-tl .site-client .icon { width: 12px; height: 12px; flex-shrink: 0; color: var(--text-muted); }
@media (prefers-reduced-motion: reduce) { .site-card-tl:hover .tl-light.is-on { animation: none; } }
.site-maintenance { display: flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; color: var(--warning); }
.site-maintenance .icon { width: 14px; height: 14px; }
.site-stale { color: var(--warning); font-weight: 600; }

/* Summary strip above the site grid */
.site-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.summary-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 3px 0 0 var(--text-secondary);
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.15s ease;
}
.summary-tile:hover { transform: translateY(-2px); }
.summary-tile strong { font-size: 1.6rem; line-height: 1.1; }
.summary-tile strong em { font-style: normal; font-size: 0.95rem; color: var(--text-secondary); font-weight: 500; }
.summary-tile span { font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; }
.summary-tile small { font-size: 0.72rem; color: var(--text-secondary); }
.summary-tile.level-good { box-shadow: inset 0 3px 0 0 var(--success); }
.summary-tile.level-average { box-shadow: inset 0 3px 0 0 var(--warning); }
.summary-tile.level-average strong { color: var(--warning); }
.summary-tile.level-poor { box-shadow: inset 0 3px 0 0 var(--danger); }
.summary-tile.level-poor strong { color: var(--danger); }
.focus-filter { margin: 0 0 1rem; color: var(--text-secondary); }
.sites-sort { width: auto; min-width: 12rem; }
#stale-notice code { font-size: 0.85em; }

/* Site details: extra facts, badges, jump links */
.score-grade small { font-size: 0.9rem; color: var(--text-secondary); font-weight: 500; }
.page-list { display: flex; flex-direction: column; gap: 0.2rem; }
.page-row { display: inline-flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.page-row a { color: var(--accent-color); }
.detail-jump { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.detail-jump a {
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--text-primary);
    text-decoration: none;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}
.detail-jump a:hover { border-color: var(--accent-color); color: var(--accent-color); }
.new-badge {
    display: inline-block;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #ffffff;
    background: #2563eb;
    vertical-align: middle;
}
.sev-label {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #ffffff;
    background: #6b7280;
    white-space: nowrap;
}
.sev-critical { background: #dc2626; }
.sev-warning { background: #d97706; }
.sev-info { background: #6b7280; }
.sev-good { background: #059669; }

/* Issues: first seen, ignore */
.issue-action { flex-shrink: 0; font-size: 0.8rem; }
.issue-since { display: block; margin-top: 0.15rem; font-size: 0.76rem; color: var(--text-secondary); }
.issue-ignored { opacity: 0.7; border-left-style: dashed; }
.issue-ignore-note { display: flex; align-items: center; gap: 0.35rem; margin-left: 1.9rem; font-size: 0.82rem; color: var(--text-secondary); overflow-wrap: anywhere; }
.issue-ignore-note .icon { width: 14px; height: 14px; flex-shrink: 0; }
.ignored-issues { margin-top: 1rem; }
.ignored-issues > summary { cursor: pointer; color: var(--text-secondary); font-weight: 500; margin-bottom: 0.6rem; }

/* History */
.history-summary { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; margin-bottom: 1rem; }
.history-summary div { display: flex; flex-direction: column; }
.history-summary strong { font-size: 1.5rem; }
.history-summary span { font-size: 0.82rem; color: var(--text-secondary); }
.state-strip { display: flex; gap: 2px; height: 22px; border-radius: 6px; overflow: hidden; }
.state-strip span { flex: 1; min-width: 2px; background: var(--text-secondary); }
.state-strip .strip-working { background: var(--success); }
.state-strip .strip-broken { background: var(--danger); }
.state-strip .strip-not_live { background: var(--warning); }
.trend-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; }
.trend-chart svg { display: block; width: 100%; height: 140px; background: var(--input-bg); border: 1px solid var(--border-light); border-radius: 10px; }
.trend-chart .grid-line { stroke: var(--border-medium); stroke-dasharray: 4 4; }
.trend-chart .trend-line { fill: none; stroke: var(--accent-color); stroke-width: 2; vector-effect: non-scaling-stroke; }
.trend-chart circle { fill: var(--text-secondary); }
.trend-chart .dot-good { fill: var(--success); }
.trend-chart .dot-average { fill: var(--warning); }
.trend-chart .dot-poor { fill: var(--danger); }
.trend-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin-top: 0.4rem; font-size: 0.82rem; color: var(--text-secondary); }
.trend-legend strong { color: var(--text-primary); }

/* Phone view */

/* Software, accessibility */
.plugin-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.plugin-chips code { padding: 0.1rem 0.4rem; border-radius: 5px; background: var(--input-bg); border: 1px solid var(--border-medium); font-size: 0.78rem; }

/* Screenshot history: before/after slider */

/* Monitoring settings / ignore dialogs */
.settings-modal-content { max-width: 620px; }
.settings-form { display: flex; flex-direction: column; gap: 0.35rem; }
.settings-form label { font-weight: 600; margin-top: 0.6rem; }
.settings-form textarea { resize: vertical; min-height: 4.5rem; font-family: inherit; }
.settings-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1rem; }
.settings-row label { display: block; margin-bottom: 0.35rem; }
.maintenance-row { display: flex; gap: 0.5rem; align-items: center; }
.maintenance-row .text-input { flex: 1; min-width: 0; }

/* Error report */
.site-report { display: flex; flex-direction: column; gap: 1.25rem; }
.site-report > .dashboard-header { margin-bottom: 0; }
.report-filters { display: flex; flex-direction: column; gap: 0.9rem; }
.report-filter-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1rem; }
.report-filter-row > label:not(.checkbox-inline) { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }
.report-filter-row .text-input { width: auto; min-width: 11rem; }
.report-filter-row .filter-input { flex: 1; min-width: 12rem; margin-left: auto; }
.report-toggles { gap: 0.5rem 1.5rem; }
.report-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.75rem; }
.report-kpi { display: flex; flex-direction: column; padding: 0.8rem 1rem; }
.report-kpi strong { font-size: 1.6rem; line-height: 1.15; }
.report-kpi span { font-size: 0.82rem; color: var(--text-secondary); }
.kpi-critical strong { color: var(--danger); }
.kpi-warning strong { color: var(--warning); }
.kpi-new strong { color: #3b82f6; }
.report-group { display: flex; flex-direction: column; gap: 1rem; }
.report-group-title { font-size: 1.25rem; margin: 0.5rem 0 0; }
.report-group-title .muted { font-size: 0.9rem; font-weight: 400; }
#report-root { display: flex; flex-direction: column; gap: 1rem; }
.report-site { padding: 1.1rem 1.25rem; }
.report-site-head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.75rem; }
.report-site-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; overflow-wrap: anywhere; }
.report-site-name a, .report-site-name strong { font-weight: 600; font-size: 1.05rem; color: var(--text-primary); text-decoration: none; }
.report-site-name a:hover { color: var(--accent-color); text-decoration: underline; }
.report-issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.report-issue { padding: 0.55rem 0.75rem; border-radius: 8px; background: var(--input-bg); border-left: 4px solid var(--text-secondary); }
.report-issue.issue-critical { border-left-color: var(--danger); }
.report-issue.issue-warning { border-left-color: var(--warning); }
.report-issue-head { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 0.4rem 0.6rem; }
.report-issue-site { font-weight: 600; color: var(--accent-color); text-decoration: none; overflow-wrap: anywhere; }
.report-issue-text { flex: 1; min-width: 12rem; overflow-wrap: anywhere; }
.report-fix { margin-top: 0.45rem; font-size: 0.85rem; line-height: 1.5; color: var(--text-primary); overflow-wrap: anywhere; }
.report-site > .report-fix { margin-top: 0.8rem; }
.report-fix pre { margin: 0.4rem 0 0; padding: 0.6rem 0.8rem; border-radius: 8px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border-medium); overflow-x: auto; font-size: 0.78rem; }
[data-theme="light"] .report-fix pre { background: rgba(0, 0, 0, 0.05); }
.report-fix code { white-space: pre; }

/* Share page: websites */
.share-sites { margin-top: 1.5rem; }
.share-sites-title { font-size: 1.3rem; margin-bottom: 0.25rem; }
.share-sites-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.share-site { padding: 1rem; border-radius: 12px; background: var(--input-bg); border: 1px solid var(--border-medium); display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.share-site-head { display: flex; align-items: center; gap: 0.7rem; }
.share-site-name { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.share-site-name span { font-size: 0.78rem; color: var(--text-secondary); }
.share-site-reason { margin: 0; font-size: 0.88rem; color: var(--warning); overflow-wrap: anywhere; }
.share-site-issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; }
.share-site-issues li { padding: 0.3rem 0.55rem; border-radius: 6px; border-left: 3px solid var(--warning); background: var(--hover-bg); overflow-wrap: anywhere; }
.share-site-issues li.sev-critical { border-left-color: var(--danger); background: rgba(239, 68, 68, 0.08); }
.share-site-issues li span { display: inline-block; margin-right: 0.4rem; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: var(--text-secondary); }
.share-site-ok { margin: 0; font-size: 0.85rem; color: var(--success); }
.share-site-meta { margin: 0; font-size: 0.75rem; color: var(--text-secondary); }

@media (max-width: 900px) {
    .trend-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
    .site-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
    .summary-tile { padding: 0.65rem 0.8rem; }
    .summary-tile strong { font-size: 1.3rem; }
    .sites-sort { width: 100%; }
    .settings-row { grid-template-columns: minmax(0, 1fr); }
    .issue-action { order: 4; }
    .issue-ignore-note { margin-left: 0; }
    .report-filter-row > label:not(.checkbox-inline), .report-filter-row .text-input, .report-filter-row .filter-input { width: 100%; min-width: 0; margin-left: 0; }
    .report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-site { padding: 0.9rem; }
    .share-sites-list { grid-template-columns: minmax(0, 1fr); }
}

/* Error report on paper: white background, no filters, keep items together */
@media print {
    .site-report .print-only { display: block; }
    .site-report .report-logo { height: 40px; margin-bottom: 0.5rem; }
    .site-report h1 { color: #3F0A08 !important; font-size: 18pt; }
    .site-report #report-subtitle { color: #555555 !important; }
    .site-report .glass-panel { background: #ffffff !important; border: 1px solid #cccccc !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; color: #111111 !important; }
    .site-report .report-kpi strong { color: #111111 !important; }
    .site-report .report-kpi span, .site-report .muted { color: #555555 !important; }
    .site-report .report-site { page-break-inside: avoid; break-inside: avoid; }
    .site-report .report-issue { background: #f7f5f2 !important; color: #111111 !important; }
    .site-report .report-issue-site, .site-report .report-site-name a, .site-report .report-site-name strong { color: #3F0A08 !important; }
    .site-report .report-fix { color: #222222 !important; }
    .site-report .report-fix pre { background: #f1f1f1 !important; color: #111111 !important; white-space: pre-wrap; }
    .site-report .report-fix code { white-space: pre-wrap; color: #111111 !important; }
    .site-report .issue-area { color: #555555 !important; border-color: #bbbbbb !important; }
    .site-report a[href]::after { content: none !important; }
}

/* Site details on paper (Print / PDF): site.js switches to the Light theme and
   opens every "How to fix"; this adds the logo, white panels, brand maroon and
   leaves out the buttons, jump links and the before/after slider. */
.site-print-head img { height: 40px; }
@media print {
    .site-detail { --accent-color: #3F0A08; gap: 1rem; color: #111111; }
    .site-detail .site-print-head.print-only { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: 0.6rem; border-bottom: 2px solid #3F0A08; }
    .site-print-head p { margin: 0; font-size: 9pt; color: #555555; }
    .site-detail .header-actions, .site-detail .detail-jump, .site-detail .issue-action, .site-detail .copy-code,
    .site-detail #detail-message { display: none !important; }
    .site-detail .glass-panel, .site-detail .score-tile { background: #ffffff !important; border: 1px solid #cccccc !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
    .site-detail .glass-panel { box-shadow: none !important; padding: 1rem 1.2rem; }
    .site-detail .score-tiles { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.6rem; }
    /* A4 is phone-width in CSS pixels: keep the desktop columns */
    .site-detail .trend-columns { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .site-detail .detail-facts { grid-template-columns: max-content minmax(0, 1fr); gap: 0.35rem 1rem; font-size: 0.85rem; }
    .site-detail .detail-facts dd { margin-bottom: 0; }
    .site-detail .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .site-detail .fix-code pre { padding-top: 0.9rem; }
    .site-detail .detail-table { font-size: 0.8rem; }
    .site-detail .detail-table thead { display: table-header-group; }
    .site-detail .detail-table tr { display: table-row; padding: 0; break-inside: avoid; page-break-inside: avoid; }
    .site-detail .detail-table td { display: table-cell; padding: 0.35rem 0.5rem; border-bottom: 1px solid #dddddd; }
    .site-detail .detail-table td[data-label]::before { content: none; }
    .site-detail .raw-headers { display: none !important; }
    /* Only small blocks are kept whole - a big one would jump to the next
       page and leave an empty gap. Headings stay with what follows them. */
    .site-detail .detail-section-title, .site-detail .detail-subhead, .site-detail .issue-head { break-after: avoid; page-break-after: avoid; }
    .site-detail .score-tiles, .site-detail .trend-chart,
    .site-detail .metric, .site-detail .print-keep { break-inside: avoid; page-break-inside: avoid; }
    /* Paper can't scroll: Chrome won't split a scroll box across pages and
       crops what's off to the side, so everything wraps and flows instead. */
    .site-detail .detail-table-wrap, .site-detail .fix-code pre, .site-detail .header-value { overflow: visible !important; max-height: none !important; }
    .site-detail .fix-code pre, .site-detail .fix-code code { white-space: pre-wrap !important; overflow-wrap: anywhere; word-break: break-word; }
    .site-detail .fix-code pre { padding-right: 0.9rem; }
    .site-detail a[href]::after { content: none !important; }
}

/* Buttons next to link-buttons in page headers: same font as the links */
button.detail-link-btn { font-family: inherit; font-size: 1rem; gap: 0.4rem; }
button.detail-link-btn .icon, a.detail-link-btn .icon { width: 16px; height: 16px; }
a.detail-link-btn { gap: 0.4rem; }
/* Space between the overview, score tiles, section links and sections */
#detail-root { display: flex; flex-direction: column; gap: 1.5rem; }
/* Site Status: Health check dialog (one-off checks of any address) */
.quick-modal-content { max-width: 680px; }
.quick-modal-content .inline-form { margin-bottom: 0.5rem; }
.quick-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; max-height: 45vh; overflow-y: auto; }
.quick-item {
    display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
    padding: 0.55rem 0.75rem; border-radius: 10px; border: 1px solid var(--border-medium);
    color: var(--text-primary); text-decoration: none;
}
.quick-item:hover, .quick-item:focus-visible { background: rgba(255, 255, 255, 0.05); border-color: var(--accent-color, var(--border-medium)); }
.quick-name { font-weight: 600; overflow-wrap: anywhere; }
.quick-item .health-badge { font-size: 0.8rem; }
.quick-meta { margin-left: auto; color: var(--text-secondary); font-size: 0.85rem; }
/* Phones: the wide logo leaves room for the menu button, which stays on one
   line; on very narrow screens the logo shrinks instead. */
.profile-dropdown { flex-shrink: 0; }
.profile-btn { white-space: nowrap; }
.nav-brand { min-width: 0; }
@media (max-width: 600px) {
    .nav-logo { height: 34px; max-width: 100%; }
}

/* Public home page (index.html): the free website health check */
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.home-logo-link { display: flex; min-width: 0; }
.home-container { max-width: 1100px; }
.home-hero { text-align: center; padding: 3rem 0 0.5rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.home-hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; line-height: 1.15;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.home-hero > p { color: var(--text-secondary); font-size: 1.1rem; max-width: 680px; line-height: 1.6; }
.home-search { display: flex; gap: 0.75rem; width: 100%; max-width: 680px; margin-top: 0.75rem; }
.home-search .text-input { flex: 1 1 auto; min-width: 0; font-size: 1.15rem; padding: 1rem 1.25rem; border-radius: 14px; }
.home-search .btn-primary { padding: 1rem 1.6rem; font-size: 1.05rem; white-space: nowrap; border-radius: 14px; }
.home-hero .home-message { max-width: 680px; margin: 0; color: var(--text-primary); }
.home-hero .home-message.text-danger { color: var(--danger); }
.home-hero .home-note { font-size: 0.9rem; opacity: 0.85; }
.home-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.home-feature { display: flex; flex-direction: column; gap: 0.35rem; padding: 1.1rem 1.2rem; border-radius: 16px; }
.home-feature strong { font-size: 1.02rem; }
.home-feature span:last-child { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.45; }
.home-feature-icon { color: var(--accent-color); display: flex; }
.home-feature-icon svg { width: 22px; height: 22px; }
.home-bulk { padding: 1.75rem; }
.home-bulk h2 { margin-bottom: 0.25rem; }
.home-bulk textarea { min-height: 7rem; }
.home-bulk-results { margin-top: 1.5rem; }
.home-footer {
    text-align: center; color: var(--text-secondary); font-size: 0.9rem; padding: 1.5rem 0 1rem;
    border-top: 1px solid var(--border-medium); display: flex; flex-direction: column; gap: 0.3rem;
}
.home-footer a { color: var(--text-primary); font-weight: 600; text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.2s, color 0.2s; }
.home-footer a:hover, .home-footer a:focus-visible { color: var(--accent-color); border-bottom-color: currentColor; }@media (max-width: 600px) {
    .home-search { flex-direction: column; }
    .home-hero { padding-top: 1.5rem; }
}
/* Home page - interactive parts */
.home-search { position: relative; }
.home-search-icon {
    position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%);
    color: var(--text-secondary); display: flex; pointer-events: none; transition: color 0.2s;
}
.home-search-icon svg { width: 20px; height: 20px; }
.home-search .text-input { padding-left: 3rem; transition: border-color 0.2s, box-shadow 0.2s; }
.home-search .text-input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-color) 25%, transparent); }
.home-search.is-valid .home-search-icon { color: var(--success); }
.home-search.is-valid .text-input { border-color: color-mix(in srgb, var(--success) 60%, transparent); }
.home-search.is-invalid .text-input { border-color: color-mix(in srgb, var(--danger) 60%, transparent); }
.home-search .btn-primary { transition: transform 0.15s, box-shadow 0.2s; }
.home-search .btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 24px color-mix(in srgb, var(--accent-color) 35%, transparent); }
.home-preview { min-height: 1.4rem; margin: -0.25rem 0 0; font-size: 0.95rem; color: var(--text-secondary); display: flex; align-items: center; gap: 0.4rem; justify-content: center; flex-wrap: wrap; }
.home-preview svg { width: 16px; height: 16px; color: var(--success); }
.home-preview strong { color: var(--text-primary); }

/* Progress panel */
.home-progress {
    width: 100%; max-width: 760px; display: flex; gap: 2rem; align-items: center; text-align: left;
    padding: 1.75rem 2rem; border-radius: 20px; animation: home-pop 0.35s ease-out;
}
.home-progress[hidden] { display: none; }
.home-progress-ring { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.home-progress-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
/* Scoped to the home page: the dashboard's expiry rings use the same class names. */
.home-progress-ring .ring-track { fill: none; stroke: var(--border-medium); stroke-width: 10; }
.ring-bar { fill: none; stroke: var(--accent-color); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 0.3s linear, stroke 0.3s; }
.home-progress.is-done .ring-bar { stroke: var(--success); }
.home-progress-ring .ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.home-progress-ring .ring-label strong { font-size: 2rem; line-height: 1; }
.home-progress-ring .ring-label span { color: var(--text-secondary); font-size: 0.85rem; margin-top: 0.3rem; font-variant-numeric: tabular-nums; }
.home-progress-body { flex: 1; min-width: 0; }
.home-progress-body h2 { font-size: 1.25rem; margin-bottom: 0.2rem; overflow-wrap: anywhere; }
.home-progress-body .muted { margin-bottom: 0.9rem; }
.progress-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.progress-steps li { display: flex; align-items: center; gap: 0.6rem; color: var(--text-secondary); opacity: 0.55; font-size: 0.93rem; transition: opacity 0.3s, color 0.3s; }
.progress-steps li.active { opacity: 1; color: var(--text-primary); font-weight: 600; }
.progress-steps li.done { opacity: 0.9; }
.step-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-medium); flex-shrink: 0; position: relative; transition: all 0.3s; }
.progress-steps li.active .step-dot { border-color: var(--accent-color); border-top-color: transparent; animation: home-spin 0.8s linear infinite; }
.progress-steps li.done .step-dot { background: var(--success); border-color: var(--success); }
.progress-steps li.done .step-dot::after {
    content: ''; position: absolute; left: 3px; top: 0; width: 4px; height: 7px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
@keyframes home-spin { to { transform: rotate(360deg); } }
@keyframes home-pop { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }

/* Stats strip */
.home-stats { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; gap: 2.5rem; justify-content: center; flex-wrap: wrap; }
.home-stats li { display: flex; flex-direction: column; align-items: center; }
.home-stats strong { font-size: 1.8rem; line-height: 1.1; color: var(--accent-color); font-variant-numeric: tabular-nums; }
.home-stats span { color: var(--text-secondary); font-size: 0.85rem; }

/* Feature cards: animate in, lift on hover, open to an example */
.home-feature {
    font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.5s, translate 0.5s;
}
.home-features .home-feature { opacity: 0; translate: 0 16px; transition-delay: var(--delay, 0ms); }
.home-features .home-feature.is-visible { opacity: 1; translate: 0 0; }
.home-feature:hover, .home-feature:focus-visible { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent-color) 55%, transparent); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25); transition-delay: 0s; }
.home-feature:hover .home-feature-icon, .home-feature[aria-expanded="true"] .home-feature-icon { transform: scale(1.12) rotate(-6deg); }
/* Only as big as the icon, so it scales/turns in place instead of swinging
   around the middle of the full-width card onto the title. */
.home-feature-icon {
    transition: transform 0.25s; align-self: flex-start; width: 38px; height: 38px; transform-origin: center;
    align-items: center; justify-content: center; margin-bottom: 0.35rem; border-radius: 10px;
    background: color-mix(in srgb, var(--accent-color) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent-color) 26%, transparent);
}
.home-feature-icon svg { width: 19px; height: 19px; }
.home-feature .home-feature-text { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.45; }
.home-feature-example {
    display: grid; grid-template-rows: 0fr; opacity: 0; font-size: 0.88rem; line-height: 1.45;
    transition: grid-template-rows 0.3s, opacity 0.3s, margin 0.3s; overflow: hidden;
}
.home-feature-example > span { min-height: 0; overflow: hidden; }
.home-feature[aria-expanded="true"] .home-feature-example {
    grid-template-rows: 1fr; opacity: 1; margin-top: 0.35rem; padding: 0.6rem 0.7rem; border-radius: 10px;
    background: color-mix(in srgb, var(--accent-color) 12%, transparent); border-left: 3px solid var(--accent-color);
}
.home-feature-example em { display: block; font-style: normal; font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent-color); margin-bottom: 0.2rem; }
.home-feature-more { margin-top: auto; padding-top: 0.4rem; font-size: 0.82rem; color: var(--accent-color); font-weight: 600; }
.home-feature-more::after { content: ' →'; display: inline-block; transition: transform 0.2s; }
.home-feature:hover .home-feature-more::after { transform: translateX(3px); }

@media (max-width: 600px) {
    .home-progress { flex-direction: column; text-align: center; padding: 1.5rem 1.25rem; gap: 1.25rem; }
    .progress-steps { text-align: left; }
    .home-stats { gap: 1.25rem 2rem; }
    .home-search-icon { top: 1.55rem; }
}
@media (prefers-reduced-motion: reduce) {
    .home-features .home-feature { opacity: 1; translate: none; }
    .home-feature, .home-feature-icon, .ring-bar, .home-feature-example { transition: none; }
    .progress-steps li.active .step-dot, .home-progress { animation: none; }
}
/* Home page: bulk expiry checker (same look as the health check above it) */
.bulk-form { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.home-bulk .bulk-form textarea {
    font-family: inherit; font-size: 1rem; height: auto; min-height: 6.5rem; resize: vertical;
    padding: 0.9rem 1.1rem; border-radius: 14px; line-height: 1.5;
}
.bulk-preview { display: flex; flex-wrap: wrap; gap: 0.4rem; min-height: 0; }
.bulk-chip {
    display: inline-flex; align-items: center; padding: 0.2rem 0.65rem; border-radius: 999px; font-size: 0.85rem;
    background: color-mix(in srgb, var(--accent-color) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent-color) 35%, transparent);
    animation: home-pop 0.2s ease-out;
}
.bulk-chip-bad { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: color-mix(in srgb, var(--danger) 45%, transparent); text-decoration: line-through; opacity: 0.85; }
.bulk-chip-over { opacity: 0.45; }
.bulk-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.bulk-actions .muted { font-size: 0.9rem; }
.bulk-form .form-message { margin: 0; }
.bulk-form .form-message.text-danger { color: var(--danger); }
.bulk-table .bulk-days { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bulk-table td:last-child { text-align: right; }
.bulk-health { white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .bulk-chip { animation: none; } }
/* Form controls don't inherit the page font by default */
.home-page button, .home-page input, .home-page textarea { font-family: inherit; }

/* Notification Settings: daily website report section */
.site-report-settings { margin: 1.5rem 0; padding-top: 1.25rem; border-top: 1px solid var(--border-medium); }
.site-report-settings .settings-section-label { color: var(--text-secondary); font-size: 0.9rem; text-transform: uppercase; margin-bottom: 0.8rem; display: block; }
.site-report-settings .checkbox-row { display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.8rem; cursor: pointer; color: var(--text-primary); line-height: 1.4; }
.site-report-settings .checkbox-row input { margin-top: 0.2rem; }
.site-report-settings .field-hint { display: block; margin-top: 0.3rem; }

/* 404.php: page not found */
.not-found { text-align: center; padding: 3rem 0 2rem; }
.not-found > .not-found-code { font-size: clamp(4rem, 18vw, 7rem); font-weight: 700; line-height: 1; margin: 0 0 0.5rem; background: linear-gradient(135deg, var(--accent-color), var(--text-secondary)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.not-found-home { display: inline-flex; margin-top: 1.5rem; text-decoration: none; }

/* Sidebar navigation on the signed-in pages (built by app_shell.js). Wide
   screens: fixed on the left, collapsible to icons (html.sidebar-collapsed).
   Phones: a slide-in drawer opened from a slim top bar. */
:root {
    --sidebar-width: 248px;
    --sidebar-collapsed-width: 76px;
}
body.has-sidebar {
    --shell-top: 0px;
    padding: 1.9rem 2rem 3rem calc(var(--sidebar-width) + 2rem);
    transition: padding-left 0.2s ease;
}
body.has-sidebar .top-nav { display: none; }
/* Chart panels may shrink below their canvas's last size, so the charts follow
   the page when the sidebar expands or the window narrows (Chart.js re-measures). */
.analytics-dashboard > .glass-panel { min-width: 0; }
body.has-sidebar .dashboard-container { margin-top: 0; }
/* Dashboard charts: a titled card each, status 1/3 and expiries 2/3 wide. */
.analytics-dashboard { display: flex; gap: 1rem; }
.chart-panel { padding: 1.15rem 1.25rem 1.25rem; }
.chart-panel-status { flex: 1; }
.chart-panel-expiry { flex: 2; }
.chart-panel-title { margin: 0 0 0.85rem; font-size: 0.95rem; font-weight: 650; color: var(--text-primary); letter-spacing: -0.005em; }
.chart-panel-canvas { position: relative; height: 210px; width: 100%; }
.chart-panel-canvas-center { display: flex; justify-content: center; }

.app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    z-index: 120;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1.1rem 0.75rem 1rem;
    background: var(--sidebar-bg); /* solid: no blur to redraw, and never undrawn-white during a page change */
    border-right: 1px solid var(--border-medium);
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    transition: width 0.2s ease, transform 0.25s ease;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0 0.2rem 0.75rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-medium);
}
.sidebar-brand-link { display: flex; align-items: center; min-width: 0; }
.sidebar-brand .nav-logo { height: 40px; max-width: 170px; }
.sidebar-mark { display: none; width: 36px; height: 36px; border-radius: 10px; }
.sidebar-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 9px;
    border: 1px solid var(--border-medium);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.sidebar-icon-btn .icon { width: 18px; height: 18px; }
.sidebar-icon-btn:hover { color: var(--text-primary); background: color-mix(in srgb, var(--text-primary) 8%, transparent); }

.sidebar-nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1 0 auto; }
.sidebar-section {
    padding: 1rem 0.8rem 0.3rem;
    font-size: 0.7rem;
    font-weight: 650;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.52rem 0.75rem;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.93rem;
    font-weight: 550;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.sidebar-link .icon { width: 18px; height: 18px; margin: 0; }
.sidebar-link:hover { color: var(--text-primary); background: var(--hover-bg); }
.sidebar-link.active {
    color: var(--text-primary);
    font-weight: 650;
    background: color-mix(in srgb, var(--accent-color) 16%, transparent);
}
[data-theme="light"] .sidebar-link.active { background: color-mix(in srgb, var(--accent-color) 9%, transparent); color: var(--accent-color); }
.sidebar-link.active .icon { color: var(--accent-color); }
.sidebar-link[hidden] { display: none; }
.sidebar-link:focus-visible, .sidebar-icon-btn:focus-visible, .sidebar-theme-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.85rem;
    margin-top: 0.75rem;
    border-top: 1px solid var(--border-medium);
}
.sidebar-theme { display: flex; gap: 0.25rem; padding: 0.2rem; border-radius: 10px; background: var(--surface-sunken); border: 1px solid var(--border-light); }
.sidebar-theme-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.4rem 0.3rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
/* The buttons carry data-theme-choice, not data-theme - a [data-theme] attribute
   would pull that theme's colour variables onto the button itself. */
.sidebar-theme-btn:hover { color: var(--text-primary); background: color-mix(in srgb, var(--text-primary) 8%, transparent); }
.sidebar-theme-btn[aria-pressed="true"] {
    color: var(--text-primary);
    font-weight: 650;
    background: var(--surface-raised);
    box-shadow: var(--shadow-sm), 0 0 0 1px var(--border-medium);
}
.sidebar-theme-btn[aria-pressed="true"]:hover { background: var(--surface-raised); }
.theme-swatch { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; border: 1px solid var(--text-secondary); }
.theme-swatch-maroon { background: #3F0A08; }
.theme-swatch-dark { background: #0b1120; }
.theme-swatch-light { background: #f4f5f7; }
.sidebar-user { display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0.6rem; min-width: 0; }
.sidebar-user .nav-avatar { width: 2rem; height: 2rem; margin: 0; font-size: 0.9rem; flex-shrink: 0; }
.sidebar-user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sidebar-user-text strong { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-text span { font-size: 0.75rem; color: var(--text-secondary); text-transform: capitalize; }
.sidebar-logout:hover { color: var(--danger); }

.mobile-topbar, .sidebar-backdrop { display: none; }

/* Collapsed to icons (wide screens only) */
@media (min-width: 901px) {
    html.sidebar-collapsed body.has-sidebar { padding-left: calc(var(--sidebar-collapsed-width) + 2rem); }
    html.sidebar-collapsed .app-sidebar { width: var(--sidebar-collapsed-width); padding-left: 0.6rem; padding-right: 0.6rem; }
    html.sidebar-collapsed .app-sidebar .sidebar-label,
    html.sidebar-collapsed .sidebar-brand .nav-logo { display: none; }
    html.sidebar-collapsed .sidebar-mark { display: block; }
    html.sidebar-collapsed .sidebar-brand { flex-direction: column; padding-left: 0; padding-right: 0; }
    html.sidebar-collapsed #sidebar-collapse-btn { transform: rotate(180deg); }
    html.sidebar-collapsed .sidebar-section { padding: 0; margin: 0.6rem 0.5rem; height: 1px; background: var(--border-medium); opacity: 1; }
    html.sidebar-collapsed .sidebar-link { justify-content: center; padding: 0.65rem; }
    html.sidebar-collapsed .sidebar-link.active { box-shadow: none; }
    html.sidebar-collapsed .sidebar-theme { flex-direction: column; }
    html.sidebar-collapsed .sidebar-theme-btn { padding: 0.45rem; }
    html.sidebar-collapsed .sidebar-user { justify-content: center; padding: 0.35rem 0; }
}

/* Phones and small tablets: drawer */
@media (max-width: 900px) {
    body.has-sidebar {
        --shell-top: 60px;
        padding: calc(60px + 1.25rem) 1rem 3rem;
    }
    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        padding: 0 1rem;
        z-index: 110;
        background: var(--sidebar-bg);
        border-bottom: 1px solid var(--border-medium);
    }
    .mobile-topbar .nav-logo { height: 34px; max-width: 60vw; }
    .app-sidebar {
        width: min(280px, 85vw);
        transform: translateX(-100%);
        box-shadow: none;
    }
    body.sidebar-open .app-sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, 0.5); }
    body.sidebar-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 115;
        background: rgba(0, 0, 0, 0.5);
    }
}
@media (prefers-reduced-motion: reduce) {
    .app-sidebar, body.has-sidebar, .sidebar-icon-btn { transition: none; }
}

/* Reports (reports.html): ten tabs sharing one filter row; sortable tables,
   stat tiles, charts (Chart.js), and print for any tab. */
.report-head-btn { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.95rem; }
.report-head-btn .icon { margin: 0; }
.reports-page .report-filters { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.reports-page .report-filters .segment-bar { margin: 0; }
.report-select { width: auto; min-width: 160px; max-width: 260px; padding: 0.55rem 0.85rem; }
.report-select[hidden] { display: none; }
.report-panel { display: flex; flex-direction: column; }
.report-panel .tabs-header { margin-bottom: 1.25rem; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; gap: 0.25rem; }
.report-panel .tabs-header::-webkit-scrollbar { display: none; }
.report-panel .tab-btn { white-space: nowrap; }
.report-panel > .form-message:empty { display: none; }
.report-body { display: flex; flex-direction: column; gap: 1.5rem; min-height: 200px; transition: opacity 0.15s; }
.report-body.is-loading { opacity: 0.45; pointer-events: none; }
.report-keys { margin: 1.25rem 0 0; font-size: 0.8rem; color: var(--text-secondary); }
.report-keys kbd {
    display: inline-block; min-width: 1.3em; padding: 0 0.3em; border: 1px solid var(--border-medium); border-bottom-width: 2px;
    border-radius: 4px; font-family: inherit; font-size: 0.85em; text-align: center; color: var(--text-primary);
}

.report-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.9rem; }
.report-toolbar-label { font-size: 0.85rem; color: var(--text-secondary); }
.report-section .report-toolbar { margin-bottom: 0.6rem; }
.report-toolbar-end { justify-content: flex-end; }
.report-toolbar .link-btn { display: inline-flex; align-items: center; gap: 0.35rem; }
.report-toolbar .link-btn .icon { width: 15px; height: 15px; }
.report-options .view-btn { font-size: 0.88rem; }
.report-search { width: 220px; padding: 0.5rem 0.85rem; }
.report-check { margin-bottom: 0.25rem; }
.report-section .report-subtitle { margin-top: 0; }
.report-section > .card-intro { margin-top: -0.4rem; }
.report-columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.report-columns-wide { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
/* Overview: the "Coming up" table needs room for all three columns. */
.report-columns-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 1.5rem; }
.report-empty, .report-ok, .report-callout {
    display: flex; align-items: flex-start; gap: 0.6rem; margin: 0; padding: 1rem 1.2rem; border-radius: 12px;
    background: var(--input-bg); border: 1px solid var(--border-medium); color: var(--text-secondary);
}
.report-empty .icon, .report-ok .icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 0.1rem; }
.report-ok .icon { color: var(--success); }
.report-callout { color: var(--text-primary); display: block; }

/* Stat tiles */
.report-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.report-table .nowrap { white-space: nowrap; }
/* Icon level with the top of the text, so the numbers line up across a row even
   when one card's label wraps onto more lines. */
.report-tile { display: flex; align-items: flex-start; gap: 0.85rem; padding: 1rem 1.1rem; }
.report-tile:hover { transform: none; }
/* The tile's icon sits in a tinted rounded square, like the dashboard's stat cards. */
.report-tile > .icon, .cal-summary-tile > .icon {
    width: 40px; height: 40px; padding: 10px; flex-shrink: 0; border-radius: 11px;
    color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 14%, transparent);
}
.cal-summary-tile > .icon { color: var(--chip-type, var(--accent-color)); background: color-mix(in srgb, var(--chip-type, var(--accent-color)) 14%, transparent); }
.report-tile.tone-bad > .icon { color: var(--danger); background: rgba(239, 68, 68, 0.14); }
.report-tile.tone-warn > .icon { color: var(--warning); background: rgba(245, 158, 11, 0.14); }
.report-tile.tone-good > .icon { color: var(--success); background: rgba(16, 185, 129, 0.14); }
.report-tile div { display: flex; flex-direction: column; min-width: 0; }
.report-tile strong { font-size: 1.45rem; line-height: 1.15; overflow-wrap: anywhere; }
.report-tile span { font-size: 0.84rem; color: var(--text-secondary); }
.report-tile small { font-size: 0.78rem; color: var(--text-secondary); opacity: 0.85; }
.report-tile.tone-good { box-shadow: inset 0 3px 0 0 var(--success); }
.report-tile.tone-warn { box-shadow: inset 0 3px 0 0 var(--warning); }
.report-tile.tone-bad { box-shadow: inset 0 3px 0 0 var(--danger); }
.report-tile.tone-bad strong { color: var(--danger); }
.report-tile.tone-warn strong { color: var(--warning); }

/* Sortable tables */
.report-table-wrap { margin-bottom: 0; }
.report-table td.num, .report-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.report-table a:not(.btn-secondary) { color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--border-medium); text-underline-offset: 3px; }
.report-table a:not(.btn-secondary):hover { color: var(--accent-color); text-decoration-color: currentColor; }
.report-table th.num .th-sort { flex-direction: row-reverse; }
.th-sort {
    display: inline-flex; align-items: center; gap: 0.3rem; padding: 0; border: none; background: none;
    color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; white-space: nowrap;
}
.th-sort:hover, .th-sort:focus-visible { color: var(--text-primary); }
.th-arrow { width: 0.6em; opacity: 0.35; }
.th-arrow::after { content: '↕'; }
.th-sort.is-asc .th-arrow, .th-sort.is-desc .th-arrow { opacity: 1; color: var(--accent-color); }
.th-sort.is-asc .th-arrow::after { content: '↑'; }
.th-sort.is-desc .th-arrow::after { content: '↓'; }
.report-health.health-badge { min-width: 2rem; height: 2rem; font-size: 0.82rem; }
.report-table .status-badge .icon { width: 12px; height: 12px; margin-right: 0.15rem; vertical-align: -0.1em; }
.inline-details summary { cursor: pointer; }
.inline-details p { margin: 0.4rem 0 0; font-size: 0.85rem; color: var(--text-secondary); white-space: normal; }

/* Charts: fixed plot height that includes the axis band (no nested scroll) */
.chart-box { position: relative; height: 280px; margin-bottom: 1rem; }
.chart-box-small { height: 200px; margin-bottom: 0; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 0.5rem; font-size: 0.85rem; color: var(--text-secondary); }
.chart-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.trend-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.trend-card { margin: 0; padding: 1rem; border: 1px solid var(--border-medium); border-radius: 12px; background: var(--input-bg); }
.trend-card figcaption { margin-bottom: 0.6rem; font-weight: 600; font-size: 0.95rem; }
.trend-table summary { cursor: pointer; color: var(--accent-color); font-weight: 600; margin-bottom: 0.75rem; }

/* Overview: chart cards, grouped (Domains, Renewals & costs, Websites, Uptime...) */
.ov-chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); grid-auto-flow: dense; gap: 1rem; }
.ov-chart {
    display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; margin: 0; padding: 1rem 1.05rem 0.9rem;
    background: var(--surface-raised); border: 1px solid var(--border-medium); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.ov-chart figcaption { display: flex; flex-direction: column; gap: 0.15rem; }
.ov-chart figcaption span { font-size: 0.95rem; font-weight: 650; color: var(--text-primary); }
.ov-chart figcaption small { font-size: 0.8rem; color: var(--text-muted); }
.ov-chart-box { position: relative; height: 220px; }
.ov-chart-empty {
    display: grid; place-items: center; flex: 1; min-height: 220px; margin: 0; padding: 1rem; text-align: center;
    font-size: 0.87rem; color: var(--text-muted); border: 1px dashed var(--border-medium); border-radius: var(--radius-sm);
}
/* HTML-drawn charts: mosaic (treemap), waffle, heatmap, meters */
.ov-chart-html { display: flex; flex-direction: column; gap: 0.7rem; flex: 1; min-height: 220px; }
.ov-mosaic { display: flex; flex-wrap: wrap; align-content: stretch; gap: 4px; height: 220px; }
.ov-mosaic-tile {
    display: flex; flex-direction: column; justify-content: space-between; min-width: 64px; padding: 0.5rem 0.6rem;
    border-radius: var(--radius-sm); overflow: hidden;
}
.ov-mosaic-tile strong { font-size: 0.95rem; font-weight: 700; }
.ov-mosaic-tile span { font-size: 0.78rem; opacity: 0.85; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-waffle { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 5px; }
.ov-waffle i { width: var(--sq, 18px); height: var(--sq, 18px); border-radius: 5px; }
.ov-html-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin-top: auto; font-size: 0.82rem; color: var(--text-secondary); }
.ov-html-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.ov-html-legend i { width: 9px; height: 9px; border-radius: 50%; }
.ov-html-legend b { color: var(--text-primary); font-weight: 650; font-variant-numeric: tabular-nums; }
.ov-html-note { font-size: 0.76rem; color: var(--text-muted); }
.ov-heatmap { display: grid; grid-template-columns: 2.4rem repeat(13, minmax(0, 1fr)); align-items: center; gap: 5px; }
.ov-heatmap > span { font-size: 0.76rem; color: var(--text-muted); }
.ov-heatmap i { height: 40px; border-radius: 6px; }
.ov-heat-scale { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: auto; font-size: 0.76rem; color: var(--text-muted); }
.ov-heat-scale i { width: 14px; height: 14px; border-radius: 3px; }
.ov-heat-scale span:first-child { margin-right: 2px; }
.ov-heat-scale .ov-heat-peak { margin-left: auto; color: var(--text-secondary); }
.ov-meters { display: flex; flex-direction: column; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.ov-meters li > div { display: flex; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.25rem; font-size: 0.82rem; color: var(--text-secondary); }
.ov-meters strong { font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-meter { display: block; height: 7px; border-radius: 99px; background: var(--border-medium); overflow: hidden; }
.ov-meter span { display: block; height: 100%; border-radius: 99px; }
@media (min-width: 1150px) { .ov-chart-wide { grid-column: span 2; } }
.ov-chart-full .ov-chart-empty { min-height: 120px; }
.ov-chart-full { grid-column: 1 / -1; }
.ov-chart-tables { margin-top: 1.5rem; }
.ov-chart-table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 1rem 1.25rem; }
.ov-chart-table h4 { margin: 0 0 0.4rem; font-size: 0.88rem; font-weight: 650; }
.ov-chart-table .table-container { max-height: none; }

/* Lists */
.attention-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.attention-list a {
    display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.55rem 0.75rem; border-radius: 10px;
    border-left: 3px solid var(--border-medium); background: var(--input-bg); color: var(--text-primary); text-decoration: none; font-size: 0.92rem;
}
.attention-list a:hover { background: var(--hover-bg); }
.attention-list .icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 0.15rem; }
.attention-bad a { border-left-color: var(--danger); }
.attention-bad .icon { color: var(--danger); }
.attention-warn a { border-left-color: var(--warning); }
.attention-warn .icon { color: var(--warning); }
.attention-info .icon { color: var(--text-secondary); }
.slow-list { display: flex; flex-direction: column; gap: 0.45rem; }
/* Name, bar, number: in a narrow column the name gives way first (the bar keeps 40px). */
.slow-row { display: grid; grid-template-columns: minmax(0, 12rem) minmax(40px, 1fr) minmax(2.5rem, max-content); align-items: center; gap: 0.75rem; font-size: 0.9rem; }
.slow-row .cost-bar { min-width: 0; }
.slow-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slow-row strong { text-align: right; font-variant-numeric: tabular-nums; }

/* Missing costs: inline form per domain */
.cost-form { display: flex; flex-wrap: nowrap; align-items: center; gap: 0.4rem; min-width: max-content; }
.cost-form .text-input { width: 7.5rem; padding: 0.4rem 0.55rem; font-size: 0.88rem; }
.cost-form .text-input[type="date"] { width: 9.5rem; }
.cost-form .cost-currency { width: 4.2rem; text-transform: uppercase; }
.cost-form .num-field { flex: none; width: 7.5rem; }
.cost-form .num-field > .text-input { width: 100%; padding-right: 2rem; }
.cost-form .num-step { top: 4px; right: 4px; bottom: 4px; width: 1.3rem; }

@media (max-width: 1100px) {
    .report-columns-3 { grid-template-columns: minmax(0, 1fr); }
    .report-columns-wide, .report-columns-even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
    .trend-grid { grid-template-columns: minmax(0, 1fr); }
    .report-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
    .report-tile { padding: 0.75rem; gap: 0.6rem; }
    .report-tile > .icon, .cal-summary-tile > .icon { width: 30px; height: 30px; padding: 7px; border-radius: 8px; }
    .report-tile strong { font-size: 1.2rem; }
    .report-select, .report-search { flex: 1 1 140px; max-width: none; width: auto; }
    .slow-row { grid-template-columns: minmax(0, 1fr) 4.5rem; }
    .slow-row .cost-bar { display: none; }
    .report-keys { display: none; }
    .chart-box { height: 220px; }
}

/* Printed: one tab (Print button) or one client's report (Print report) */
@media print {
    .reports-page .report-print-head.print-only { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 0.5rem; }
    .report-print-head img { height: 40px; }
    .report-print-head h1 { margin: 0; font-size: 17pt; color: #3F0A08; }
    .report-print-head p { margin: 0.15rem 0 0; font-size: 9.5pt; color: #555555; }
    .reports-page { color: #111111; gap: 0.75rem; }
    .reports-page .glass-panel { background: #ffffff !important; border: 1px solid #cccccc !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; color: #111111 !important; }
    .reports-page .page-panel { padding: 0.5rem 0; border: none !important; }
    .reports-page .report-toolbar, .reports-page .cost-edit-cell, .reports-page .actions-cell, .reports-page .report-check { display: none !important; }
    .reports-page .report-tile span, .reports-page .report-tile small, .reports-page .muted, .reports-page .card-intro, .reports-page .field-hint { color: #555555 !important; }
    .reports-page .report-tiles { grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
    .reports-page table, .reports-page th, .reports-page td { color: #111111 !important; background: #ffffff !important; border-color: #dddddd !important; }
    .reports-page .table-container { max-height: none !important; overflow: visible !important; border-color: #dddddd !important; }
    .reports-page tr { break-inside: avoid; }
    .reports-page .report-section, .reports-page .trend-card { break-inside: avoid; }
    .reports-page .ov-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .reports-page .ov-chart { break-inside: avoid; box-shadow: none; }
    .reports-page .ov-chart-wide { grid-column: span 2; }
    .reports-page .ov-chart-html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .reports-page .trend-card, .reports-page .ov-chart, .reports-page .ov-chart-empty, .reports-page .report-empty, .reports-page .report-callout, .reports-page .attention-list a { background: #ffffff !important; color: #111111 !important; border-color: #dddddd; }
    .reports-page a { color: #111111 !important; }
    body.print-client .dashboard-container > :not(#print-report) { display: none !important; }
    .print-section { font-size: 12pt; color: #3F0A08; margin: 1rem 0 0.4rem; }
}
/* ---------- Notifications page ---------- */
.notify-page #notify-form { display: flex; flex-direction: column; gap: 1.5rem; }
.notify-page #notify-form[hidden] { display: none; }
.notify-page .settings-card { scroll-margin-top: 4.5rem; }
.notify-page .site-report-settings { margin: 0; padding-top: var(--card-padding, 1.5rem); border-top: none; }
.notify-page .checkbox-row { display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.7rem; cursor: pointer; color: var(--text-primary); line-height: 1.4; }
.notify-page .checkbox-row input { margin-top: 0.2rem; flex-shrink: 0; }
.notify-page .field-hint { margin-top: 0.3rem; }
.notify-rule-group { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; margin: 1.1rem 0 0.6rem; font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }
.notify-rule-group:first-of-type { margin-top: 0.4rem; }
.notify-rule-group span { font-size: 0.8rem; font-weight: 500; color: var(--accent-color); }
.notify-page .settings-card > .form-message { margin: 0.75rem 0 0; }
.notify-page .form-row:has(.notify-narrow) { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
.notify-jump { position: sticky; top: 0.75rem; z-index: 5; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.45rem; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border-medium); box-shadow: var(--shadow-md); width: fit-content; max-width: 100%; }
.notify-jump a { padding: 0.35rem 0.85rem; border-radius: 999px; color: var(--text-secondary); text-decoration: none; font-size: 0.88rem; white-space: nowrap; }
.notify-jump a { transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease; }
.notify-jump a:hover { color: var(--text-primary); background: var(--hover-bg); }
.notify-jump a[aria-current="true"] { color: var(--text-primary); background: color-mix(in srgb, var(--accent-color) 20%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-color) 55%, transparent); }
.notify-jump a[aria-current="true"]:hover { background: color-mix(in srgb, var(--accent-color) 26%, transparent); }
.notify-save-bar { position: sticky; bottom: 0.75rem; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: 1rem; padding: 0.75rem 1rem; }
.notify-save-bar:hover { transform: none; }
.notify-save-bar .form-message { margin: 0 auto 0 0; }
#notify-form.is-dirty .notify-save-bar { border-color: var(--accent-color); }
@media (max-width: 600px) {
    .notify-page .form-row:has(.notify-narrow) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .notify-page .form-row:has(.notify-narrow) > :first-child { grid-column: 1 / -1; }
    .notify-jump { border-radius: 14px; top: 4rem; }
}

/* ---------- Account & security page ---------- */
.account-page .account-tabs { margin-bottom: 0; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; gap: 0.25rem; }
.account-page .account-tabs::-webkit-scrollbar { display: none; }
.account-page .account-tabs .tab-btn { white-space: nowrap; padding-inline: 0.8rem; }
.account-tab { display: flex; flex-direction: column; gap: 1.5rem; }
.account-tab[hidden] { display: none; }
.account-page .settings-card > .form-message { margin: 0.75rem 0 0; }
.security-score { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1rem; }
.security-score h2 { margin-bottom: 0.25rem; }
.security-score .card-intro { margin: 0; }
.score-ring { --score: 0; --tone: var(--text-secondary); position: relative; width: 84px; height: 84px; flex-shrink: 0; display: grid; place-items: center; }
.score-ring::before {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    background: conic-gradient(var(--tone) calc(var(--score) * 1%), var(--border-medium) 0);
    -webkit-mask: radial-gradient(circle, transparent 0 33px, #000 34px); mask: radial-gradient(circle, transparent 0 33px, #000 34px);
}
.score-ring.tone-good { --tone: var(--success); }
.score-ring.tone-warn { --tone: var(--warning); }
.score-ring.tone-bad { --tone: var(--danger); }
#score-value { position: relative; font-size: 1.6rem; font-weight: 700; color: var(--text-primary); }
.security-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.security-checklist li { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.65rem 0.8rem; border-radius: 10px; border: 1px solid var(--border-medium); }
.security-checklist li > .icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 0.1rem; }
.security-checklist li.is-ok > .icon { color: var(--success); }
.security-checklist li.is-todo > .icon { color: var(--warning); }
.security-checklist li.is-todo { border-color: rgba(245, 158, 11, 0.45); }
.security-checklist li div { display: flex; flex-direction: column; gap: 0.15rem; }
.security-checklist li span { font-size: 0.88rem; color: var(--text-secondary); }
.security-checklist a { color: var(--accent-color); font-weight: 600; }
.account-facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.25rem; margin: 0; }
.account-facts dt { color: var(--text-secondary); font-size: 0.9rem; }
.account-facts dd { margin: 0; overflow-wrap: anywhere; }
.password-field { position: relative; }
.password-field .text-input { padding-right: 2.75rem; }
.password-toggle { position: absolute; right: 0.35rem; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 34px; height: 34px;
    background: none; border: none; border-radius: 8px; color: var(--text-secondary); cursor: pointer; }
.password-toggle:hover { color: var(--text-primary); background: var(--hover-bg); }
.password-toggle .icon { width: 18px; height: 18px; }
.strength-meter { height: 6px; border-radius: 999px; background: var(--border-medium); margin: 0.45rem 0 0.3rem; overflow: hidden; }
.strength-meter span { display: block; height: 100%; width: 4%; border-radius: inherit; background: var(--text-secondary); transition: width 0.2s, background 0.2s; }
.strength-meter.level-1 span { background: var(--danger); }
.strength-meter.level-2 span { background: var(--warning); }
.strength-meter.level-3 span, .strength-meter.level-4 span { background: var(--success); }
.password-tips { margin: 0 0 1rem 1.1rem; padding: 0; font-size: 0.86rem; color: var(--text-secondary); }
.password-tips:empty { display: none; }
.password-tips li { margin-bottom: 0.2rem; }
.recovery-left { margin: 0 0 1rem; font-size: 0.92rem; color: var(--text-secondary); }
.recovery-left:empty { display: none; }
.device-list { display: flex; flex-direction: column; gap: 0.5rem; }
.device-row { display: flex; align-items: center; gap: 0.85rem; padding: 0.7rem 0.85rem; border: 1px solid var(--border-medium); border-radius: 10px; }
.device-row.is-current { border-color: var(--accent-color); }
.device-row > .icon { width: 22px; height: 22px; flex-shrink: 0; color: var(--accent-color); }
.device-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; flex: 1; }
.device-text span { font-size: 0.85rem; color: var(--text-secondary); overflow-wrap: anywhere; }
.account-table-wrap { max-height: 480px; }
.account-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.account-table th, .account-table td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--border-medium); vertical-align: top; }
.account-table tr.row-failed td { background: rgba(239, 68, 68, 0.06); }
.activity-more { justify-content: space-between; margin-top: 0.75rem; }
.account-page .checkbox-row { display: flex; align-items: flex-start; gap: 0.5rem; margin: 0.4rem 0 0.3rem; cursor: pointer; color: var(--text-primary); line-height: 1.4; }
.account-page .checkbox-row input { margin-top: 0.2rem; flex-shrink: 0; }
#prefs-form .field-hint { margin-bottom: 0.75rem; }
@media (max-width: 600px) {
    .security-score { flex-direction: column; align-items: flex-start; }
    .account-facts { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
    .account-facts dd { margin-bottom: 0.5rem; }
}
@media print {
    body.print-recovery main > :not(.account-tab), body.print-recovery .account-tab > :not(:has(#recovery-codes-panel)),
    body.print-recovery #recovery-codes-panel .button-row, body.print-recovery #recovery-codes-panel ~ *,
    body.print-recovery .settings-card > :not(#recovery-codes-panel) { display: none !important; }
    body.print-recovery .recovery-codes code { color: #111111 !important; }
}
.account-table .nowrap { white-space: nowrap; }

/* ---------- AMC page ---------- */
.amc-page #amc-list-view, .amc-page #amc-detail-view { display: flex; flex-direction: column; gap: 1.5rem; }
.amc-page [hidden] { display: none !important; }
.amc-page > div > .form-message:empty { display: none; }
.amc-tiles button.report-tile { font: inherit; color: inherit; text-align: left; cursor: pointer; }
.amc-tiles button.report-tile:hover { border-color: var(--accent-color); }
.amc-section-title { font-size: 1.15rem; font-weight: 600; margin: 0 0 0.75rem; }
.amc-suggest-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.75rem; }
.amc-suggest-item { display: flex; flex-direction: column; gap: 0.6rem; justify-content: space-between; padding: 0.85rem 1rem; border: 1px dashed var(--border-medium); border-radius: 12px; }
.amc-suggest-item > div { display: flex; flex-direction: column; gap: 0.2rem; }
.amc-suggest-item span { font-size: 0.86rem; color: var(--text-secondary); }
.amc-suggest-item .btn-small { align-self: flex-start; display: inline-flex; align-items: center; gap: 0.3rem; }
.amc-suggest-item .icon, .amc-actions .icon, #amc-new-btn .icon, #amc-csv-btn .icon { width: 16px; height: 16px; }
.amc-filters { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.amc-filters .view-toggle { flex-wrap: wrap; }
.amc-filters .text-input { width: auto; flex: 0 1 280px; min-width: 180px; }
.amc-table-wrap { max-height: none; }
.amc-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-light); vertical-align: top; }
.amc-table th.num, .amc-table td.num { text-align: right; }
.amc-table td.nowrap { white-space: nowrap; }
.amc-table a:not(.btn-secondary) { color: var(--text-primary); }
.amc-table a:hover { color: var(--accent-color); }
.amc-back { display: inline-block; margin-bottom: 0.5rem; color: var(--text-secondary); text-decoration: none; font-size: 0.92rem; }
.amc-back:hover { color: var(--accent-color); }
.amc-actions { flex-wrap: wrap; justify-content: flex-end; }
.amc-actions .btn-secondary, .amc-actions .btn-primary { display: inline-flex; align-items: center; gap: 0.4rem; }
#amc-detail-subtitle { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.amc-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1.5rem; }
.amc-detail-grid > .glass-panel { min-width: 0; }
.pre-line { white-space: pre-line; }
.amc-now-summary { margin: 0 0 0.85rem; color: var(--text-secondary); line-height: 1.5; }
.amc-sites-wrap { max-height: none; }
.amc-sites td, .amc-sites th { padding: 0.55rem 0.75rem; font-size: 0.9rem; }
.text-warning { color: var(--warning); }
[data-theme="light"] .text-warning { color: #b45309; } /* plain amber is too light to read on white */
.amc-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.amc-check { padding: 0.85rem 1rem; border: 1px solid var(--border-medium); border-left: 4px solid var(--success); border-radius: 10px; break-inside: avoid; }
.amc-check.is-issues { border-left-color: var(--warning); }
.amc-check-head { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.amc-check-head .amc-by { font-size: 0.85rem; }
.amc-check-head .link-btn { margin-left: auto; font-size: 0.85rem; }
.amc-check-summary { margin: 0.45rem 0 0; }
.amc-check-details { margin: 0.35rem 0 0; color: var(--text-secondary); font-size: 0.92rem; }
.amc-snapshot { margin-top: 0.6rem; }
.amc-snapshot summary { cursor: pointer; color: var(--text-secondary); font-size: 0.88rem; }
.amc-snapshot[open] summary { margin-bottom: 0.5rem; }
.amc-danger { display: flex; gap: 0.75rem; justify-content: flex-end; }
.amc-modal-content { max-width: 760px; }
.amc-domain-search { margin-bottom: 0.5rem; }
.amc-domain-picker { max-height: 220px; overflow-y: auto; border: 1px solid var(--border-medium); border-radius: 10px; padding: 0.35rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.1rem 0.5rem; }
.amc-pick { display: flex; align-items: baseline; gap: 0.45rem; padding: 0.3rem 0.45rem; border-radius: 6px; cursor: pointer; font-size: 0.9rem; min-width: 0; }
.amc-pick:hover { background: var(--hover-bg); }
.amc-pick.is-client span { font-weight: 600; }
.amc-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amc-pick small { margin-left: auto; white-space: nowrap; font-size: 0.75rem; }
.amc-result-toggle { width: fit-content; }
.amc-result-toggle label { display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.amc-result-toggle label:has(input:checked) { background: var(--accent-color); color: var(--on-accent); }
.amc-result-toggle input { accent-color: currentColor; }
.amc-details-input { height: 110px; }
#check-form label .link-btn { margin-left: 0.5rem; font-size: 0.85rem; font-weight: 500; }
.amc-page .checkbox-row, #check-modal .checkbox-row { display: flex; align-items: flex-start; gap: 0.5rem; margin: 0.25rem 0 0.75rem; cursor: pointer; line-height: 1.4; }
@media (max-width: 900px) {
    .amc-detail-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .amc-filters .text-input { flex: 1 1 100%; }
    .amc-table-wrap table, .amc-sites-wrap table { min-width: 640px; }
    .amc-table-wrap, .amc-sites-wrap { overflow-x: auto; }
}
@media print {
    .amc-page .amc-print-head.print-only { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 0.5rem; }
    .amc-print-head img { height: 40px; }
    .amc-print-head h1 { margin: 0; font-size: 17pt; color: #3F0A08; }
    .amc-print-head p { margin: 0.15rem 0 0; font-size: 9.5pt; color: #555555; }
    .amc-page { color: #111111; }
    .amc-page .glass-panel { background: #ffffff !important; border: 1px solid #cccccc !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; color: #111111 !important; }
    .amc-page .report-tile span, .amc-page .report-tile small, .amc-page .muted, .amc-page .amc-now-summary, .amc-page .amc-check-details, .amc-page dt { color: #555555 !important; }
    .amc-page table, .amc-page th, .amc-page td { color: #111111 !important; background: #ffffff !important; border-color: #dddddd !important; }
    .amc-page .table-container { max-height: none !important; overflow: visible !important; }
    .amc-page .amc-detail-grid { grid-template-columns: minmax(0, 1fr); }
    .amc-page .report-tiles { grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
    .amc-page a { color: #111111 !important; text-decoration: none; }
    .amc-page section { break-inside: avoid; }
}
#amc-detail-view .dashboard-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
#amc-detail-view .amc-actions { justify-content: flex-start; }
#amc-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.amc-page .account-facts a { color: var(--accent-color); }
@media (max-width: 900px) { #amc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { #amc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; } }
.amc-client-name { margin-top: 0.5rem; }
/* AMC: what the client pays for, and bills paid / not paid */
.amc-chips { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; }
.amc-chip { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.75rem; line-height: 1.5; white-space: nowrap; border: 1px solid var(--border-medium); color: var(--text-secondary); }
.amc-chip.is-server { border-color: var(--accent-color); color: var(--text-primary); font-weight: 600; }
.amc-pays-for { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
.amc-pay-opt { display: flex; align-items: center; gap: 0.45rem; padding: 0.5rem 0.7rem; border: 1px solid var(--border-medium); border-radius: 8px; cursor: pointer; font-size: 0.92rem; }
.amc-pay-opt:hover { background: var(--hover-bg); }
.amc-pay-opt:has(input:checked) { border-color: var(--accent-color); background: var(--hover-bg); font-weight: 600; }
@media (max-width: 600px) { .amc-pays-for { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.amc-pays-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 1.1rem; }
.amc-pays-list li { display: flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.amc-pays-list .icon { width: 15px; height: 15px; flex: none; }
.amc-pays-list .is-yes .icon { color: var(--success); }
.amc-pays-list .is-no { color: var(--text-secondary); opacity: 0.75; }
.amc-bills .btn-small { display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.amc-bills .btn-small .icon { width: 14px; height: 14px; }

/* ------------------------------------------------------------------
   Delivery log (delivery.html): destination cards, message table, details
   ------------------------------------------------------------------ */
.sidebar-dot { width: 8px; height: 8px; margin-left: auto; flex-shrink: 0; border-radius: 50%; background: var(--danger);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); }
@media (min-width: 901px) {
    html.sidebar-collapsed .sidebar-link { position: relative; }
    html.sidebar-collapsed .sidebar-dot { position: absolute; top: 6px; right: 6px; margin: 0; }
}
.delivery-page { display: flex; flex-direction: column; gap: 1.25rem; }
.delivery-page > .dashboard-header { margin-bottom: 0; }
.delivery-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.delivery-range { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text-secondary); font-size: 0.9rem; }
.delivery-range .text-input { width: auto; min-width: 150px; }

.delivery-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.delivery-card { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; padding: 1rem 1.2rem; text-align: left;
    font: inherit; color: var(--text-primary); cursor: pointer; box-shadow: inset 0 3px 0 0 var(--text-secondary); transition: transform 0.15s ease, border-color 0.15s ease; }
.delivery-card:hover { transform: translateY(-2px); }
.delivery-card.selected { border-color: var(--accent-color); }
.delivery-card:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; }
.delivery-card-good { box-shadow: inset 0 3px 0 0 var(--success); }
.delivery-card-bad { box-shadow: inset 0 3px 0 0 var(--danger); }
.delivery-card-head { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 600; }
.delivery-card-head .icon { width: 17px; height: 17px; color: var(--accent-color); }
.delivery-card-status { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 1.25rem; font-weight: 650; }
.delivery-state-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--text-secondary); }
.delivery-card-good .delivery-state-dot { background: var(--success); }
.delivery-card-good .delivery-card-status { color: var(--success); }
.delivery-card-bad .delivery-state-dot { background: var(--danger); }
.delivery-card-bad .delivery-card-status { color: var(--danger); }
.delivery-card-off .delivery-card-status { color: var(--text-secondary); font-size: 1.05rem; }
.delivery-card-error { font-size: 0.8rem; color: var(--danger); overflow-wrap: anywhere; }
.delivery-card-line { font-size: 0.85rem; color: var(--text-secondary); }
.delivery-card-line strong { color: var(--text-primary); font-weight: 600; }
.delivery-card-line strong.text-danger { color: var(--danger); }

.delivery-panel { display: flex; flex-direction: column; }
.delivery-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.delivery-filters select.text-input { width: auto; min-width: 170px; }
.delivery-filters .filter-input { margin-left: auto; }
.delivery-segments { display: inline-flex; gap: 0.2rem; padding: 0.25rem; border-radius: 999px; background: var(--input-bg); border: 1px solid var(--border-medium); }
.delivery-segments .segment-btn { padding: 0.4rem 1rem; font-size: 0.9rem; }
.delivery-table td { vertical-align: top; }
.delivery-when { white-space: nowrap; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.delivery-kind { display: block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text-secondary); }
.delivery-title { text-align: left; color: var(--text-primary); font-weight: 600; font-size: 0.95rem; overflow-wrap: anywhere; }
.delivery-title:hover { color: var(--accent-color); }
.delivery-sub { display: flex; align-items: center; gap: 0.3rem; margin-top: 0.25rem; font-size: 0.8rem; color: var(--text-secondary); overflow-wrap: anywhere; }
.delivery-sub .icon { width: 13px; height: 13px; flex-shrink: 0; }
.delivery-sub.text-success { color: var(--success); }
.delivery-error { color: var(--danger); max-width: 22rem; }
.delivery-row.is-failed { background: color-mix(in srgb, var(--danger) 6%, transparent); }
.delivery-actions-cell { text-align: right; white-space: nowrap; }
.delivery-actions-cell .btn-small { display: inline-flex; align-items: center; gap: 0.35rem; }
.delivery-actions-cell .icon { width: 14px; height: 14px; }
.delivery-pager { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.delivery-pager > div { display: flex; gap: 0.5rem; }

.delivery-detail { width: min(640px, calc(100vw - 32px)); }
.delivery-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.delivery-facts { font-size: 0.9rem; }
.delivery-facts dd .delivery-sub:first-child { margin-top: 0; }
.delivery-detail-sub { margin: 1.1rem 0 0.4rem; font-size: 0.92rem; color: var(--text-secondary); font-weight: 600; }
.delivery-summary { margin: 0; max-height: 18rem; overflow: auto; padding: 0.75rem 0.9rem; border-radius: 10px; background: var(--input-bg);
    border: 1px solid var(--border-medium); font-family: inherit; font-size: 0.85rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 700px) {
    .delivery-filters select.text-input, .delivery-filters .filter-input { width: 100%; margin-left: 0; }
    .delivery-table thead { display: none; }
    .delivery-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.2rem 0.75rem; padding: 0.75rem 0.5rem; border-bottom: 1px solid var(--border-light); }
    .delivery-table td { display: block; padding: 0 !important; border: none; }
    .delivery-table .delivery-when { grid-column: 1 / -1; font-size: 0.8rem; }
    .delivery-table td:nth-child(2), .delivery-table td:nth-child(3) { grid-column: 1 / -1; }
    .delivery-table td:nth-child(3) { font-size: 0.85rem; color: var(--text-secondary); }
    .delivery-actions-cell { text-align: left; }
}

/* ------------------------------------------------------------------
   Clients (clients.html), Admin backups / recycle bin, site.html issue
   actions - added in schema v18
   ------------------------------------------------------------------ */
.clients-page { display: flex; flex-direction: column; gap: 1.25rem; }
.clients-page .dashboard-header { margin-bottom: 0; }
#clients-list-view, #client-detail-view { display: flex; flex-direction: column; gap: 1.25rem; }
#clients-list-view[hidden], #client-detail-view[hidden] { display: none; }
.list-filters { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
.list-filters .view-toggle { flex-wrap: wrap; }
.list-filters input[type="search"] { width: auto; flex: 0 1 280px; min-width: 180px; margin-left: auto; }
.clients-table td { vertical-align: top; }
.clients-table a:not(.btn-secondary) { color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--border-medium); text-underline-offset: 3px; }
.clients-table a:not(.btn-secondary):hover { color: var(--accent-color); text-decoration-color: currentColor; }
.clients-page .account-facts a, .clients-page .page-panel p a { color: var(--accent-color); }
.clients-page button.report-tile { font: inherit; color: inherit; text-align: left; cursor: pointer; }
.clients-page button.report-tile:hover { border-color: var(--accent-color); }
.split-form-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; }
.client-address { min-height: 3.5rem; }
.client-renewals { list-style: none; margin: 0; padding: 0; }
.client-renewals li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border-light); }
.client-renewals li:last-child { border-bottom: none; }
.client-renewals li > a { color: var(--text-primary); overflow-wrap: anywhere; }
.client-renewals li > a:hover { color: var(--accent-color); }
.client-renewals li > span { font-size: 0.88rem; }
.clients-page h1 .type-badge { vertical-align: middle; font-size: 0.8rem; }
.clients-table .type-badge { margin-left: 0.35rem; }
.clients-page .header-actions .btn-secondary { display: inline-flex; align-items: center; gap: 0.4rem; text-decoration: none; }
.clients-page .header-actions .icon { width: 16px; height: 16px; }

.issue-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem; flex-shrink: 0; margin-left: auto; }
.issue-actions .issue-action { margin: 0; }

.admin-subhead { font-size: 1.05rem; font-weight: 600; margin: 1.75rem 0 0.5rem; }
.admin-tab > .admin-subhead:first-child { margin-top: 0; }
.backup-status p { display: flex; align-items: flex-start; gap: 0.45rem; margin: 0 0 0.75rem; }
.backup-status .icon { width: 17px; height: 17px; flex-shrink: 0; margin-top: 0.1rem; }
#recycle-body .btn-small, #backups-body .btn-small { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; height: 2rem; line-height: 1; }
#recycle-body .row-actions { display: flex; align-items: center; gap: 0.5rem; }
#recycle-body .row-actions .btn-small { margin: 0; }
#recycle-body .icon, #backups-body .icon { width: 14px; height: 14px; }

@media (max-width: 700px) {
    .list-filters input[type="search"] { width: 100%; flex: 1 1 100%; margin-left: 0; }
    /* Recycle bin: one card per item, buttons full width underneath */
    .recycle-table thead { display: none; }
    .recycle-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.5rem 0.75rem; padding: 0.85rem 0.75rem; border-bottom: 1px solid var(--border-light); }
    .recycle-table td { display: block; padding: 0 !important; border: none; white-space: normal; overflow-wrap: anywhere; }
    .recycle-table td:first-child, .recycle-table td.actions-cell, .recycle-table td[colspan] { grid-column: 1 / -1; }
    .recycle-table td[data-label]::before { content: attr(data-label); display: block; font-size: 0.72rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em; }
    #recycle-body .row-actions .btn-small { flex: 1 1 0; }
    .issue-actions { order: 4; margin-left: 0; }
}

/* ------------------------------------------------------------------
   Admin > Website checks: open ports (admin.js renderPorts)
   ------------------------------------------------------------------ */
.port-server { border: 1px solid var(--border-medium); border-radius: 10px; padding: 0.85rem 1rem; margin-bottom: 0.85rem; }
.port-server-head { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 0.5rem; }
.port-server-head > .icon { width: 20px; height: 20px; color: var(--accent-color); flex-shrink: 0; }
.port-server-head div { display: flex; flex-direction: column; }
.port-server p { display: flex; align-items: flex-start; gap: 0.4rem; margin: 0.35rem 0; }
.port-server p .icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 0.15rem; }
.port-findings { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.port-finding { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.6rem 0; border-top: 1px solid var(--border-light); }
.port-finding > div { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.4; }
.port-finding .sev-label { flex-shrink: 0; margin-top: 0.1rem; }
.port-finding .btn-small { flex-shrink: 0; }
.port-finding.is-ok > div { color: var(--text-secondary); }
#ports-form { margin-top: 0.5rem; }
#ports-servers { flex: 1 1 280px; }
.ports-list { margin-top: 0.75rem; }
.ports-list summary { cursor: pointer; color: var(--text-secondary); font-size: 0.9rem; }
@media (max-width: 600px) {
    .port-finding { flex-wrap: wrap; }
    .port-finding .btn-small { width: 100%; }
}

/* ------------------------------------------------------------------
   Account > Phone app (push.js) - schema v19
   ------------------------------------------------------------------ */
.phone-head { display: flex; align-items: flex-start; gap: 1rem; }
.phone-head .card-intro { margin-bottom: 1rem; }
.phone-app-icon { width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); }
.phone-state-box { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.85rem 1rem; border-radius: 10px; border: 1px solid var(--border-medium);
    background: var(--input-bg); line-height: 1.45; margin-bottom: 1rem; }
.phone-state-box > .icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 0.1rem; }
.phone-state-box.tone-good { border-color: color-mix(in srgb, var(--success) 55%, transparent); }
.phone-state-box.tone-good > .icon { color: var(--success); }
.phone-state-box.tone-warn { border-color: color-mix(in srgb, var(--warning) 55%, transparent); }
.phone-state-box.tone-warn > .icon { color: var(--warning); }
.phone-state-box.tone-info > .icon { color: var(--accent-color); }
#phone-actions:empty { display: none; }
#phone-actions { align-items: stretch; }
#phone-install .button-row { margin-bottom: 1rem; }
#phone-actions .btn-text, #phone-install .btn-text { display: inline-flex; align-items: center; gap: 0.4rem; }
#phone-actions .icon, #phone-install .btn-text .icon { width: 16px; height: 16px; }
.phone-choices { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.phone-choices .checkbox-row span { display: flex; flex-direction: column; gap: 0.1rem; }
.phone-choices .checkbox-row .field-hint { margin: 0; }
.phone-steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.phone-steps { padding: 0.9rem 1rem; border: 1px solid var(--border-medium); border-radius: 10px; }
.phone-steps h3 { margin: 0 0 0.5rem; font-size: 0.98rem; }
.phone-steps ol { margin: 0; padding-left: 1.2rem; line-height: 1.5; color: var(--text-secondary); }
.phone-steps li + li { margin-top: 0.3rem; }
.phone-steps strong { color: var(--text-primary); }
.phone-installed { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.phone-installed .icon { width: 18px; height: 18px; color: var(--success); }
.phone-device-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
#phone-devices .device-text .text-danger { font-size: 0.85rem; }
@media (max-width: 600px) {
    .phone-app-icon { width: 44px; height: 44px; border-radius: 11px; }
    #phone-devices .device-row { flex-wrap: wrap; }
    .phone-device-actions { width: 100%; }
    .phone-device-actions .btn-small { flex: 1 1 0; }
    #phone-actions .btn-primary, #phone-actions .btn-secondary { width: 100%; justify-content: center; }
}

/* ===== Servers page (servers.html): cPanel account usage from WHM ===== */
.servers-page .page-panel { margin-top: 1.25rem; }
.servers-page .report-tiles { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.servers-page button.report-tile { font: inherit; color: inherit; text-align: left; cursor: pointer; }
.servers-page button.report-tile:hover { border-color: var(--accent-color); }
.servers-page #srv-notes:not(:empty) { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.srv-note { display: flex; gap: 0.6rem; align-items: flex-start; }
.srv-note .icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 0.1rem; color: var(--accent-color); }
.srv-note-error .icon { color: var(--danger); }
.srv-steps { margin: 0 0 0.75rem; padding-left: 1.3rem; line-height: 1.6; color: var(--text-secondary); }
.srv-steps strong { color: var(--text-primary); }
.servers-page .dashboard-header { gap: 1.5rem; align-items: flex-start; }
.servers-page .header-actions { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
/* Both header buttons the same height, text and corners. */
.servers-page .header-actions > button {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    height: 2.75rem; padding: 0 1.15rem; font-size: 0.95rem; font-weight: 600; line-height: 1; border-radius: 10px; white-space: nowrap;
}
.servers-page .header-actions .btn-text { display: inline-flex; align-items: center; gap: 0.45rem; }
.servers-page .header-actions .icon { width: 16px; height: 16px; }
@media (max-width: 760px) {
    .servers-page .dashboard-header { flex-direction: column; align-items: stretch; }
    .servers-page .header-actions > button { flex: 1 1 0; }
}
#srv-sort { width: auto; flex: 0 0 auto; }
#srv-search { flex: 1 1 220px; }
.srv-table { width: 100%; }
.srv-table td { vertical-align: top; }
.srv-table td > .muted { font-size: 0.88rem; }
.srv-table th:nth-child(2), .srv-table th:nth-child(3) { width: 24%; }
.srv-table th:nth-child(4) { width: 30%; }
.srv-table a { color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--border-medium); text-underline-offset: 3px; }
.srv-table a:hover { color: var(--accent-color); text-decoration-color: currentColor; }
.srv-table .status-badge { margin-left: 0.3rem; font-size: 0.75rem; vertical-align: 0.1em; }
.srv-table .status-badge .icon { width: 12px; height: 12px; margin-right: 0.2rem; vertical-align: -0.1em; }
.srv-sub { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.15rem; overflow-wrap: anywhere; }
.srv-row-full td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.srv-row-warn td:first-child { box-shadow: inset 3px 0 0 var(--warning); }

.usage { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.usage-bar { height: 8px; border-radius: 4px; background: var(--border-medium); overflow: hidden; }
.usage-bar span { display: block; height: 100%; border-radius: 4px; background: var(--accent-color); }
.usage-bar.level-warn span { background: var(--warning); }
.usage-bar.level-full span { background: var(--danger); }
.usage-text { font-size: 0.84rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.usage-pct { color: var(--text-primary); font-weight: 600; margin-left: 0.2rem; }
.usage-flag { font-size: 0.75rem; font-weight: 600; margin-left: 0.25rem; }
.usage-flag.level-warn { color: var(--warning); }
.usage-flag.level-full { color: var(--danger); }
.usage-small .usage-bar { height: 5px; }
.usage-small .usage-text { font-size: 0.78rem; }
.srv-mail-count { font-size: 0.88rem; margin-bottom: 0.35rem; }
.srv-box { display: flex; flex-direction: column; gap: 0.15rem; margin-top: 0.45rem; }
.srv-box-name { font-size: 0.8rem; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.srv-disks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem 1.5rem; }
.srv-disk { display: flex; flex-direction: column; gap: 0.4rem; }
.srv-disk-name { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; }
.srv-disk-name .icon { width: 16px; height: 16px; color: var(--accent-color); }

@media (max-width: 760px) {
    .srv-table thead { display: none; }
    .srv-table, .srv-table tbody, .srv-table tr, .srv-table td { display: block; width: 100%; }
    .srv-table tr { border: 1px solid var(--border-medium); border-radius: 10px; padding: 0.4rem 0.2rem; margin-bottom: 0.75rem; }
    .srv-table td { border: none; padding: 0.4rem 0.8rem; }
    .srv-table td[data-label]:not([data-label="Account"])::before { content: attr(data-label); display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); margin-bottom: 0.25rem; }
    .srv-row-full, .srv-row-warn { border-left-width: 3px !important; }
    .srv-row-full { border-left-color: var(--danger) !important; }
    .srv-row-warn { border-left-color: var(--warning) !important; }
    .srv-row-full td:first-child, .srv-row-warn td:first-child { box-shadow: none; }
    #srv-sort { flex: 1 1 100%; }
}
.srv-error { color: var(--text-secondary); opacity: 0.85; max-width: 32ch; }
.srv-office { border-left: 3px solid var(--warning); }
.srv-office p { margin: 0; color: var(--text-secondary); line-height: 1.55; }
.srv-office strong { color: var(--text-primary); }
.srv-office a { color: var(--accent-color); }
.office-ips { min-height: 5.5rem; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; margin-bottom: 0.75rem; max-width: 420px; }
#office-form .button-row > button { display: inline-flex; align-items: center; justify-content: center; height: 2.6rem; padding: 0 1.1rem; font-size: 0.92rem; font-weight: 600; line-height: 1; border-radius: 10px; }
#office-hint { margin-top: 0.6rem; }

/* ===== Quick search (Ctrl+K): assets/js/quick_search.js ===== */
.sidebar-search { margin: 0.35rem 0 0.2rem; border: 1px solid var(--border-medium); background: var(--input-bg); }
.sidebar-search .sidebar-label:not(kbd) { flex: 1; }
.sidebar-kbd, .qs-dialog kbd {
    display: inline-flex; align-items: center; padding: 0.1rem 0.4rem; border-radius: 6px; border: 1px solid var(--border-medium);
    background: color-mix(in srgb, var(--text-primary) 6%, transparent); color: var(--text-secondary);
    font-family: inherit; font-size: 0.72rem; font-weight: 600; line-height: 1.3;
}
.topbar-search-btn { margin-left: auto; }
@media (min-width: 901px) {
    html.sidebar-collapsed .sidebar-search { border-color: transparent; background: transparent; }
}

.qs-dialog {
    --qs-bg: var(--surface-raised);
    width: min(620px, calc(100vw - 32px));
    max-height: min(560px, calc(100vh - 120px));
    margin: 12vh auto auto;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    background:
        radial-gradient(80% 120px at 0 0, color-mix(in srgb, var(--accent-color) 9%, transparent), transparent 70%),
        var(--qs-bg);
    color: var(--text-primary);
    box-shadow: 0 28px 70px -14px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.15), 0 0 48px -18px color-mix(in srgb, var(--accent-color) 45%, transparent);
    font: inherit;
    overflow: hidden;
}
[data-theme="light"] .qs-dialog { box-shadow: var(--shadow-lg), 0 0 40px -18px color-mix(in srgb, var(--accent-color) 35%, transparent); }
.qs-dialog::before {
    content: ""; position: absolute; top: 0; left: 1.5rem; right: 1.5rem; height: 3px; border-radius: 0 0 3px 3px; pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--accent-color) 25%, var(--accent-hover) 75%, transparent);
}
.qs-dialog[open] { display: flex; animation: app-dialog-in 0.15s ease-out; }
@media (prefers-reduced-motion: reduce) { .qs-dialog[open] { animation: none; } }
.qs-box { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.qs-input-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.9rem 1rem; border-bottom: 1px solid var(--border-medium); }
.qs-input-row > .icon { width: 20px; height: 20px; color: var(--accent-color); flex-shrink: 0; }
.qs-input-row input {
    flex: 1; min-width: 0; border: none; outline: none; background: transparent; color: var(--text-primary);
    font: inherit; font-size: 1.08rem;
}
.qs-input-row input::placeholder { color: var(--text-secondary); opacity: 0.8; }
.qs-close {
    flex-shrink: 0; padding: 0.2rem 0.5rem; border-radius: 6px; border: 1px solid var(--border-medium); background: transparent;
    color: var(--text-secondary); font: inherit; font-size: 0.75rem; font-weight: 600; cursor: pointer;
}
.qs-close:hover { color: var(--text-primary); }
.qs-list { list-style: none; margin: 0; padding: 0.4rem; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.qs-group { padding: 0.65rem 0.65rem 0.3rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.qs-item a {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0.7rem; border-radius: 10px;
    color: var(--text-primary); text-decoration: none;
}
.qs-item a > .icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-secondary); transition: color 0.12s; }
.qs-item a { position: relative; transition: background-color 0.12s; }
.qs-item a:hover { background: var(--hover-bg); }
.qs-item.active a { background: color-mix(in srgb, var(--accent-color) 18%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-color) 28%, transparent); }
.qs-item.active a::before { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 3px; border-radius: 3px; background: var(--accent-color); }
.qs-item.active a > .icon { color: var(--accent-color); }
.qs-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.qs-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.95rem; }
.qs-label mark { background: none; color: var(--accent-color); font-weight: 700; }
.qs-sub { font-size: 0.8rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-enter { flex-shrink: 0; }
.qs-empty { padding: 1.2rem 0.8rem; color: var(--text-secondary); font-size: 0.92rem; }
.qs-foot {
    display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; padding: 0.6rem 1rem; border-top: 1px solid var(--border-medium);
    font-size: 0.78rem; color: var(--text-secondary);
}
.qs-foot span { display: inline-flex; align-items: center; gap: 0.25rem; }
@media (max-width: 600px) {
    .qs-dialog { margin-top: 10px; max-height: calc(100vh - 20px); width: calc(100vw - 20px); }
    .qs-foot, .qs-dialog .qs-enter { display: none; }
    .qs-item a { padding: 0.7rem; }
}

/* ===== Servers page: which sites run on which server ===== */
.servers-page #srv-server-tiles { margin-bottom: 1.25rem; }
.srv-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 1.25rem; align-items: start; }
.srv-card { padding: 1.2rem 1.3rem; display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; scroll-margin-top: 90px; }
.srv-card:hover { transform: none; }
.srv-card-down { box-shadow: inset 0 3px 0 0 var(--danger); }
.srv-card-highlight { outline: 2px solid var(--accent-color); outline-offset: 2px; }
.srv-card-head { display: flex; align-items: flex-start; gap: 0.8rem; }
.srv-card-icon { flex-shrink: 0; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 10px;
    color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 14%, transparent); }
.srv-card-icon .icon { width: 20px; height: 20px; }
.srv-card-title { flex: 1; min-width: 0; }
.srv-card-title h3 { margin: 0; font-size: 1.08rem; line-height: 1.35; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; overflow-wrap: anywhere; }
.srv-card-title .status-badge { font-size: 0.72rem; }
.srv-card-title .status-badge .icon { width: 12px; height: 12px; margin-right: 0.2rem; vertical-align: -0.1em; }
.srv-card-title code { font-size: 0.82rem; }
.srv-edit-btn { flex-shrink: 0; display: inline-flex; align-items: center; gap: 0.3rem; }
.srv-edit-btn .icon { width: 14px; height: 14px; }
.srv-card-stats { margin: 0; font-size: 0.92rem; color: var(--text-secondary); }
.srv-card-stats strong { color: var(--text-primary); }
.srv-card-renewal, .srv-card-note { margin: 0; font-size: 0.88rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; color: var(--text-secondary); }
.srv-card-renewal strong { color: var(--text-primary); }
.srv-card-renewal .icon, .srv-card-note .icon { width: 15px; height: 15px; color: var(--accent-color); flex-shrink: 0; }
.srv-card-renewal a, .srv-usage-link, .srv-site a { color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--border-medium); text-underline-offset: 3px; }
.srv-card-renewal a:hover, .srv-usage-link:hover, .srv-site a:hover { color: var(--accent-color); text-decoration-color: currentColor; }
.srv-card-notes { margin: 0; font-size: 0.85rem; color: var(--text-secondary); white-space: pre-line; border-left: 2px solid var(--border-medium); padding-left: 0.6rem; }
.srv-site-list { list-style: none; margin: 0.2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 0.35rem 1rem; }
.srv-site { display: flex; align-items: center; gap: 0.45rem; min-width: 0; font-size: 0.9rem; flex-wrap: wrap; }
.srv-site > a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 100%; }
.srv-site [class^="state-dot-"] { flex-shrink: 0; }
.srv-down-tag { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--danger); }
.srv-move { font-size: 0.8rem; }
.srv-more { align-self: flex-start; font-size: 0.85rem; }
.srv-usage-link { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.88rem; align-self: flex-start; }
.srv-usage-link .icon { width: 15px; height: 15px; color: var(--accent-color); }
#srv-unplaced-panel .srv-site-list { margin-top: 0.4rem; }
.srv-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; margin: 2.5rem 0 1rem; padding-top: 1.5rem; border-top: 1px solid var(--border-medium); scroll-margin-top: 80px; }
.srv-section-head h2 { margin: 0 0 0.35rem; font-size: 1.35rem; }
.srv-section-head p { margin: 0; color: var(--text-secondary); max-width: 70ch; line-height: 1.5; }
.servers-page .srv-section-head + .page-panel, .servers-page .srv-section-head + #srv-setup { margin-top: 0; }
@media (max-width: 760px) {
    .srv-section-head { flex-direction: column; align-items: stretch; }
    .srv-section-head .header-actions > button { flex: 1 1 0; }
    .srv-card-head { flex-wrap: wrap; }
}

/* ===== Claude accounts page (claude.html) =====
   Each account has its own colour (--hue, by its place among all accounts, so a
   filter never repaints it); people get one by name. Deeper shades on Light, where
   the bright ones are too faint on white. */
.cl-hue-0, .av-0 { --hue: #fb923c; } .cl-hue-1, .av-1 { --hue: #60a5fa; } .cl-hue-2, .av-2 { --hue: #34d399; } .cl-hue-3, .av-3 { --hue: #a78bfa; }
.cl-hue-4, .av-4 { --hue: #f472b6; } .cl-hue-5, .av-5 { --hue: #22d3ee; } .cl-hue-6, .av-6 { --hue: #facc15; } .cl-hue-7, .av-7 { --hue: #cbd5e1; }
[data-theme="light"] :is(.cl-hue-0, .av-0) { --hue: #c2410c; } [data-theme="light"] :is(.cl-hue-1, .av-1) { --hue: #1d4ed8; }
[data-theme="light"] :is(.cl-hue-2, .av-2) { --hue: #047857; } [data-theme="light"] :is(.cl-hue-3, .av-3) { --hue: #7c3aed; }
[data-theme="light"] :is(.cl-hue-4, .av-4) { --hue: #be185d; } [data-theme="light"] :is(.cl-hue-5, .av-5) { --hue: #0e7490; }
[data-theme="light"] :is(.cl-hue-6, .av-6) { --hue: #a16207; } [data-theme="light"] :is(.cl-hue-7, .av-7) { --hue: #475569; }

/* Summary cards: the big number with a small picture of it (account badges,
   faces, a bar of seats per account, the days to the next renewal). */
.cl-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.cl-stat-of { font-size: 0.55em; font-weight: 700; color: var(--text-muted); letter-spacing: 0; }
.cl-stat-chips i.is-quiet { opacity: 0.5; border-style: dashed; }
.cl-stat { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; min-width: 0; padding: 1rem 1.1rem 1.05rem;
    font: inherit; color: var(--text-primary); text-align: left; cursor: pointer; isolation: isolate;
    transition: transform 0.3s var(--ease-out, ease-out), box-shadow 0.3s, border-color 0.3s; }
.cl-stat::before { content: ''; position: absolute; z-index: -1; top: -60px; right: -60px; width: 160px; height: 160px; border-radius: 50%; pointer-events: none;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--stat-tone, var(--accent-color)) 16%, transparent), transparent); transition: transform 0.6s var(--ease-out, ease-out); }
.cl-stat:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--stat-tone, var(--accent-color)) 45%, var(--border-medium)); box-shadow: var(--shadow-md); }
.cl-stat:hover::before { transform: scale(1.35); }
.cl-stat:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cl-stat.is-warn { --stat-tone: var(--warning); box-shadow: inset 0 3px 0 0 var(--warning); }
.cl-stat.is-bad { --stat-tone: var(--danger); box-shadow: inset 0 3px 0 0 var(--danger); }
.cl-stat.is-good { --stat-tone: var(--success); }
.cl-stat-head { width: 100%; display: flex; align-items: center; gap: 0.6rem; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.cl-stat-head > .icon { flex-shrink: 0; width: 32px; height: 32px; padding: 7px; border-radius: 10px; color: var(--stat-tone, var(--accent-color));
    background: color-mix(in srgb, var(--stat-tone, var(--accent-color)) 14%, transparent); }
.cl-stat-head > span:first-of-type { flex: 1; min-width: 0; line-height: 1.25; }
.cl-stat-go { flex-shrink: 0; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; color: var(--stat-tone, var(--accent-color));
    opacity: 0; transform: translateX(-6px); transition: opacity 0.25s, transform 0.3s var(--ease-out, ease-out); }
.cl-stat-go .icon { width: 14px; height: 14px; }
.cl-stat:hover .cl-stat-go, .cl-stat:focus-visible .cl-stat-go { opacity: 1; transform: none; }
.cl-stat-num { font-size: 2.1rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.cl-stat.is-warn .cl-stat-num { color: var(--warning); }
.cl-stat.is-bad .cl-stat-num { color: var(--danger); }
.cl-stat.is-empty .cl-stat-num { color: var(--text-muted); }
.cl-stat small { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.35; }
.cl-stat.is-empty small { color: var(--accent-color); font-weight: 600; }
.cl-stat-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.cl-stat-chips i { font-style: normal; font-size: 0.72rem; font-weight: 750; font-variant-numeric: tabular-nums; padding: 0.14rem 0.45rem; border-radius: 6px; color: var(--hue);
    background: color-mix(in srgb, var(--hue) 14%, transparent); border: 1px solid color-mix(in srgb, var(--hue) 32%, transparent); transition: transform 0.2s; }
.cl-stat:hover .cl-stat-chips i { transform: translateY(-1px); }
.cl-stat-chips i.is-off { opacity: 0.45; text-decoration: line-through; }
.cl-stat .cl-stack { padding-left: 9px; }
.cl-stat .cl-stack .cl-avatar { width: 1.75rem; height: 1.75rem; font-size: 0.64rem; }
.cl-stat:hover .cl-stack .cl-avatar { margin-left: -3px; }
.cl-stat-bar { width: 100%; display: flex; gap: 3px; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-sunken); }
.cl-stat-bar i { min-width: 6px; background: var(--hue); transition: filter 0.2s; }
.cl-stat-bar i:hover { filter: brightness(1.15); }
.cl-stat-legend { display: flex; flex-wrap: wrap; gap: 0.15rem 0.75rem; margin-top: -0.25rem; font-size: 0.74rem; font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.cl-stat-legend span { display: inline-flex; align-items: center; gap: 0.3rem; }
.cl-stat-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--hue); }
.cl-stat-meter { width: 100%; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-sunken); }
.cl-stat-meter i { display: block; height: 100%; border-radius: inherit; background: var(--stat-tone, var(--accent-color)); animation: cl-meter 0.9s var(--ease-out, ease-out) both; }
@keyframes cl-meter { from { width: 0; } }
@container page (max-width: 899px) {
    .cl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container page (max-width: 599px) {
    .cl-stats { gap: 0.6rem; }
    .cl-stat { padding: 0.8rem 0.8rem 0.85rem; gap: 0.5rem; }
    .cl-stat-head { gap: 0.45rem; font-size: 0.66rem; letter-spacing: 0.04em; }
    .cl-stat-head > .icon { width: 28px; height: 28px; padding: 6px; }
    .cl-stat-go { display: none; }
    .cl-stat-num { font-size: 1.7rem; }
    .cl-stat small { font-size: 0.74rem; }
}
@media (prefers-reduced-motion: reduce) { .cl-stat:hover { transform: none; } }
.cl-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; padding: 0.65rem 0.75rem; margin-bottom: 1.25rem; }
.cl-toolbar:hover { transform: none; }
.cl-toolbar #cl-team { width: auto; flex: 0 1 210px; min-width: 0; }
.cl-toolbar #cl-search { width: auto; flex: 1 1 220px; min-width: 0; }
.cl-toolbar #cl-order { width: auto; flex: 0 1 175px; min-width: 0; }
.cl-toolbar #cl-team { flex-basis: 180px; }
.cl-toolbar #cl-search { flex-basis: 160px; }
@container page (max-width: 1399px) {
    /* Locked: just the padlock (its words in the tooltip), so the bar stays one row. */
    .cl-lock-state:not(.is-open) span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.cl-lock { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; min-height: var(--control-h-sm); }
.cl-lock-state { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cl-lock-state .icon { width: 15px; height: 15px; }
.cl-lock-state.is-open { color: var(--success); font-weight: 600; }

/* Account cards: a coloured top in the account's colour with its number, the
   sign-in rows (a click copies), and the people as a row of faces. The whole card
   opens the account's panel. With a mouse, a card leans a little towards it and
   catches a soft light under it (--rx/--ry/--mx/--my from claude.js). */
.cl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 1.35rem; align-items: stretch; }
.cl-card { position: relative; padding: 0; display: flex; flex-direction: column; min-width: 0; overflow: hidden; cursor: pointer; isolation: isolate;
    border-color: color-mix(in srgb, var(--hue) 22%, var(--border-medium)); scroll-margin-top: 90px;
    transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
    transition: transform 0.35s var(--ease-out, ease-out), box-shadow 0.3s, border-color 0.3s, opacity 0.2s; }
.cl-card:hover { --lift: -5px; border-color: color-mix(in srgb, var(--hue) 55%, var(--border-medium));
    box-shadow: var(--shadow-md), 0 18px 40px -22px color-mix(in srgb, var(--hue) 70%, transparent); }
.cl-card::after { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 0.3s; border-radius: inherit;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.09), transparent 45%); }
.cl-card:hover::after { opacity: 1; }
[data-theme="light"] .cl-card::after { background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--hue) 7%, transparent), transparent 45%); }
.cl-card-off { opacity: 0.7; filter: saturate(0.6); }
.cl-card-off:hover, .cl-card-off:focus-within { opacity: 1; filter: none; }
.cl-cards.cl-intro > .cl-card { animation: cl-rise 0.55s var(--ease-out, ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes cl-rise { from { opacity: 0; transform: translateY(16px) scale(0.98); } }

/* The coloured top (also the panel's) */
.cl-card-hero, .cl-drawer-hero { position: relative; overflow: hidden; padding: 1.1rem 1.2rem 1rem;
    background:
        radial-gradient(130% 120% at 100% 0%, color-mix(in srgb, var(--hue) 30%, transparent), transparent 60%),
        linear-gradient(160deg, color-mix(in srgb, var(--hue) 16%, var(--surface)), var(--surface) 85%);
    border-bottom: 1px solid color-mix(in srgb, var(--hue) 20%, var(--border-light)); }
.cl-hero-mark { position: absolute; top: -26px; right: -26px; z-index: 0; width: 132px; height: 132px; color: var(--hue); opacity: 0.16; pointer-events: none;
    transition: transform 0.8s var(--ease-out, ease-out), opacity 0.4s; }
.cl-hero-mark .icon { width: 100%; height: 100%; stroke-width: 1.2; }
.cl-card:hover .cl-hero-mark { transform: rotate(28deg) scale(1.08); opacity: 0.26; }
/* Company logos: a white plate where the number was, and the first logo large and faint behind */
.cl-brand-plate { position: relative; display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.65rem; border-radius: 12px; min-width: 0;
    background: #fff; border: 1px solid color-mix(in srgb, var(--hue) 22%, #e6e8ee);
    box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--hue) 70%, transparent), 0 1px 2px rgba(0, 0, 0, 0.06); }
.cl-brand-plate .cl-logo-img { display: block; height: 30px; width: auto; max-width: 112px; object-fit: contain; }
.cl-brand-plate.is-pair { gap: 0.45rem; padding: 0.35rem 0.5rem; }
.cl-brand-plate.is-pair .cl-logo-img { height: 19px; max-width: 76px; }
.cl-card-hero.has-logo .cl-hero-top { gap: 0.5rem; }
/* The school's logo is a detailed block: it needs more height than a word mark to read */
.cl-brand-plate .cl-logo-img.is-anan { height: 40px; max-width: 90px; }
.cl-brand-plate.is-pair .cl-logo-img.is-anan { height: 30px; max-width: 60px; }
.cl-brand-plate { min-height: 46px; }
.cl-brand-plate.is-pair .cl-logo-img + .cl-logo-img { padding-left: 0.45rem; border-left: 1px solid #e6e8ee; }
/* Every logo sits at the same spot (its middle on the same line, the same distance in from the
   right) with about the same weight: the wider the logo, the lower it is, so they cover about
   the same area. */
.cl-hero-logo { --logo-h: 100px; --logo-k: 1; position: absolute; z-index: 0; right: -14px; top: 58%; height: calc(var(--logo-h) * var(--logo-k)); pointer-events: none;
    opacity: 0.13; transform: translateY(-50%) rotate(-8deg); transition: transform 0.8s var(--ease-out, ease-out), opacity 0.4s; }
.cl-hero-logo.is-anan { --logo-h: 104px; }
.cl-hero-logo.is-point { --logo-h: 92px; }
.cl-hero-logo.is-kolam { --logo-h: 80px; }
.cl-hero-logo img { display: block; height: 100%; width: auto; max-width: none; }
/* Dark themes: the logo turned light, so it shows on the dark top; the light theme keeps its colours */
:root .cl-hero-logo img, [data-theme="dark"] .cl-hero-logo img { filter: grayscale(1) brightness(3); }
:root .cl-hero-logo .is-dark-only { filter: none; }
.cl-hero-logo .is-light-only { display: none; }
[data-theme="light"] .cl-hero-logo .is-light-only { display: block; }
[data-theme="light"] .cl-hero-logo .is-dark-only { display: none; }
[data-theme="light"] .cl-hero-logo img { filter: none; }
:root .cl-hero-logo { opacity: 0.17; }
[data-theme="light"] .cl-hero-logo { opacity: 0.2; }
.cl-card:hover .cl-hero-logo { transform: translateY(-50%) rotate(-4deg) scale(1.04); opacity: 0.28; }
.cl-card-hero.has-logo h3, .cl-card-hero.has-logo .cl-card-code { z-index: 1; }
.cl-drawer-hero .cl-hero-logo { --logo-k: 1.3; right: 2.5rem; top: 55%; }
.cl-drawer-hero .cl-brand-plate { padding: 0.5rem 0.8rem; }
.cl-drawer-hero .cl-brand-plate .cl-logo-img { height: 38px; max-width: 140px; }
.cl-drawer-hero .cl-brand-plate.is-pair .cl-logo-img { height: 30px; max-width: 120px; }
.cl-drawer-hero .cl-brand-plate .cl-logo-img.is-anan { height: 46px; max-width: 100px; }
/* The picker in the account form */
.cl-logo-pick { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.cl-logo-pick legend { padding: 0; margin-bottom: 0.45rem; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.cl-logo-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.6rem; }
.cl-logo-option { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; cursor: pointer; text-align: center; }
.cl-logo-option input { position: absolute; opacity: 0; pointer-events: none; }
.cl-logo-tile { display: flex; align-items: center; justify-content: center; width: 100%; height: 64px; padding: 0.5rem; border-radius: 12px; background: #fff;
    border: 2px solid var(--border-medium); transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s; }
.cl-logo-tile img { max-height: 40px; max-width: 100%; object-fit: contain; }
.cl-logo-option small { font-size: 0.74rem; color: var(--text-secondary); line-height: 1.25; }
.cl-logo-option:hover .cl-logo-tile { transform: translateY(-2px); }
.cl-logo-option input:checked + .cl-logo-tile { border-color: var(--accent-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 25%, transparent); }
.cl-logo-option input:checked + .cl-logo-tile::after { content: '✓'; position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
    display: grid; place-items: center; font-size: 0.7rem; font-weight: 800; color: var(--surface); background: var(--accent-color); }
.cl-logo-option input:focus-visible + .cl-logo-tile { outline: 2px solid var(--accent-color); outline-offset: 2px; }
.cl-hero-top { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.cl-card-no { position: relative; display: block; font-size: 2.15rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
    color: var(--hue); text-shadow: 0 1px 0 color-mix(in srgb, var(--surface) 60%, transparent); }
.cl-hero-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.35rem; padding-top: 0.2rem; }
.cl-card-hero h3 { position: relative; margin: 0.7rem 0 0.25rem; font-size: 1.1rem; line-height: 1.3; overflow-wrap: anywhere; }
.cl-card-code { position: relative; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-size: 0.8rem; }
.cl-card-code code { font-size: 0.76rem; padding: 0.1rem 0.45rem; border-radius: 6px; color: var(--text-secondary);
    background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--border-light); }
.cl-renew { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.74rem; font-weight: 650;
    color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); }
.cl-renew.is-soon { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.cl-renew .icon { width: 12px; height: 12px; }

.cl-plan { display: inline-flex; align-items: center; padding: 0.14rem 0.55rem; border-radius: 999px; font-size: 0.68rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--hue); background: color-mix(in srgb, var(--surface) 75%, transparent); border: 1px solid color-mix(in srgb, var(--hue) 40%, transparent); }
.cl-plan:is(.cl-plan-max5, .cl-plan-max20) { color: #fbbf24; border-color: rgba(245, 158, 11, 0.45); }
[data-theme="light"] .cl-plan:is(.cl-plan-max5, .cl-plan-max20) { color: #b45309; }
.cl-plan-free { color: var(--text-secondary); border-color: var(--border-medium); }
.cl-state { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.14rem 0.55rem 0.14rem 0.45rem; border-radius: 999px; font-size: 0.72rem; font-weight: 650;
    color: var(--text-secondary); background: color-mix(in srgb, var(--surface) 75%, transparent); border: 1px solid var(--border-light); }
.cl-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); }
.cl-state-active { color: var(--success); }
.cl-state-active i { background: var(--success); box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 55%, transparent); animation: cl-live 2.4s ease-out infinite; }
.cl-state-paused { color: var(--warning); }
.cl-state-paused i { background: var(--warning); }
@keyframes cl-live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 6px transparent; } }

/* Sign-in rows */
.cl-card-body { padding: 1rem 1.2rem 0.4rem; }
.cl-fields { display: grid; gap: 0.45rem; }
.cl-field { position: relative; display: flex; align-items: center; gap: 0.7rem; min-width: 0; padding: 0.45rem 0.45rem 0.45rem 0.5rem; border-radius: 12px;
    border: 1px solid var(--border-light); background: var(--surface-sunken); cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, transform 0.15s; }
.cl-field:hover { border-color: color-mix(in srgb, var(--hue) 45%, var(--border-medium)); background: color-mix(in srgb, var(--hue) 6%, var(--surface-sunken)); }
.cl-field[role="button"]:active { transform: scale(0.985); }
.cl-field:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cl-field-icon { flex-shrink: 0; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 10px; color: var(--hue);
    background: color-mix(in srgb, var(--hue) 14%, transparent); transition: background-color 0.2s, color 0.2s; }
.cl-field-icon .icon { width: 16px; height: 16px; }
.cl-field-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.05rem; line-height: 1.3; }
.cl-field-main small { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.cl-field-value { font-size: 0.9rem; color: var(--text-primary); overflow-wrap: anywhere; }
.cl-field-act { flex-shrink: 0; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; color: var(--text-secondary);
    opacity: 0; transform: translateX(-4px); transition: opacity 0.2s, transform 0.2s, color 0.2s; }
.cl-field-act .icon { width: 16px; height: 16px; }
.cl-field:hover .cl-field-act, .cl-field:focus-visible .cl-field-act { opacity: 1; transform: none; }
@media (hover: none) { .cl-field-act { opacity: 0.7; transform: none; } }
.cl-field.is-empty .cl-field-value { color: var(--text-muted); font-style: italic; }
.cl-field.is-empty .cl-field-icon { color: var(--text-muted); background: var(--hover-bg); }
.cl-field.is-copied { border-color: var(--success); animation: cl-copied 1.6s var(--ease-out, ease-out); }
.cl-field.is-copied .cl-field-icon { color: #fff; background: var(--success); }
.cl-field.is-copied .cl-field-act { opacity: 1; transform: none; color: var(--success); }
@keyframes cl-copied { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 45%, transparent); } 60%, 100% { box-shadow: 0 0 0 8px transparent; } }
.cl-field-secret { cursor: default; }
.cl-secret { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: 0.16em; color: var(--text-secondary); }
.cl-field-secret.is-open .cl-secret { letter-spacing: 0.02em; color: var(--text-primary); -webkit-user-select: all; user-select: all; animation: cl-pop 0.25s var(--ease-out, ease-out); }
.cl-field-secret.is-open { border-color: color-mix(in srgb, var(--hue) 40%, var(--border-medium)); background: color-mix(in srgb, var(--hue) 7%, var(--surface-sunken)); }
@keyframes cl-pop { from { opacity: 0; transform: translateY(2px); } }

.cl-icon-btn { flex-shrink: 0; display: inline-grid; place-items: center; width: 2rem; height: 2rem; padding: 0; border: none; border-radius: 8px; background: transparent;
    color: var(--text-secondary); cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.cl-icon-btn .icon { width: 16px; height: 16px; }
.cl-icon-btn:hover { background: color-mix(in srgb, var(--hue, var(--accent-color)) 12%, transparent); color: var(--text-primary); }
.cl-icon-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cl-icon-btn:disabled { opacity: 0.5; cursor: progress; }

/* The people: a row of faces */
.cl-card-foot { margin-top: auto; width: 100%; display: flex; align-items: center; gap: 0.8rem; padding: 0.85rem 1.2rem 1rem; border: none; background: none;
    color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cl-card-foot:focus-visible { outline: none; box-shadow: inset var(--focus-ring); }
.cl-stack { display: flex; flex-shrink: 0; padding-left: 8px; }
.cl-stack .cl-avatar { margin-left: -9px; border: 2px solid var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); transition: margin 0.35s var(--ease-out, ease-out), transform 0.2s; }
.cl-card:hover .cl-stack .cl-avatar { margin-left: -3px; }
.cl-stack .cl-avatar:hover { transform: translateY(-3px); }
.cl-avatar-more { color: var(--text-secondary) !important; background: var(--surface-sunken) !important; }
.cl-stack-empty { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; color: var(--text-muted); border: 1.5px dashed var(--border-strong); }
.cl-stack-empty .icon { width: 15px; height: 15px; }
.cl-foot-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cl-foot-text strong { font-size: 0.9rem; }
.cl-foot-text small { font-size: 0.76rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-foot-go { flex-shrink: 0; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; color: var(--hue);
    background: color-mix(in srgb, var(--hue) 12%, transparent); transition: transform 0.3s var(--ease-out, ease-out), background-color 0.2s, color 0.2s; }
.cl-foot-go .icon { width: 16px; height: 16px; }
.cl-card:hover .cl-foot-go { transform: translateX(3px); background: var(--hue); color: var(--surface); }

.cl-avatar { flex-shrink: 0; display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; font-size: 0.72rem; font-weight: 750; letter-spacing: 0.02em;
    color: var(--hue); background: color-mix(in srgb, var(--hue) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--hue) 30%, transparent); }
.cl-avatar-lg { width: 2.9rem; height: 2.9rem; font-size: 0.95rem; }
.cl-flash { animation: cl-flash 1.4s var(--ease-out, ease-out); }
@keyframes cl-flash { 0%, 30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--hue) 40%, transparent), var(--shadow-md); } }

/* The account's panel: slides in from the right (a sheet from the bottom on phones). */
#cl-drawer .modal-content.cl-drawer-panel { padding: 0; overflow-x: hidden; }
@media (min-width: 601px) {
    .modal.cl-drawer { justify-content: flex-end; align-items: stretch; padding: 0.75rem; }
    .modal.cl-drawer > .modal-content.cl-drawer-panel { max-width: 500px; max-height: none; height: 100%; border-radius: 20px; animation: cl-drawer-in 420ms var(--ease-out) both; }
    .modal.cl-drawer.modal-leaving > .modal-content { animation: cl-drawer-out 220ms var(--ease-in) both; }
    #cl-drawer .modal-content.glass-panel::before { display: none; }
}
@keyframes cl-drawer-in { from { opacity: 0.4; transform: translateX(48px); } }
@keyframes cl-drawer-out { to { opacity: 0; transform: translateX(40px); } }
.cl-drawer-hero { padding: 1.4rem 1.5rem 1.25rem; }
.cl-drawer-hero .cl-hero-mark { width: 170px; height: 170px; top: -36px; right: 3rem; animation: cl-spin-in 0.9s var(--ease-out, ease-out) both; }
@keyframes cl-spin-in { from { transform: rotate(-40deg) scale(0.8); opacity: 0; } }
.cl-drawer-hero .cl-card-no { font-size: 2.6rem; }
.cl-drawer-hero h2 { position: relative; margin: 0.6rem 3rem 0.35rem 0; font-size: 1.35rem; line-height: 1.25; overflow-wrap: anywhere; }
.cl-drawer-actions { position: relative; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.cl-drawer-actions .btn-small .icon { width: 14px; height: 14px; }
.cl-drawer-section { padding: 1.15rem 1.5rem 0; }
.cl-drawer-section:last-child { padding-bottom: 1.5rem; }
.cl-drawer-h { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.65rem; font-size: 0.74rem !important; font-weight: 700 !important; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.cl-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; padding: 1.15rem 1.5rem 0; }
.cl-fact { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.7rem 0.75rem; border-radius: 12px; background: var(--surface-sunken); border: 1px solid var(--border-light); min-width: 0; }
.cl-fact-icon { flex-shrink: 0; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 9px; color: var(--hue); background: color-mix(in srgb, var(--hue) 13%, transparent); }
.cl-fact-icon .icon { width: 15px; height: 15px; }
.cl-fact > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.cl-fact small { font-size: 0.72rem; color: var(--text-secondary); }
.cl-fact strong { font-size: 0.95rem; overflow-wrap: anywhere; }
.cl-fact em { font-style: normal; font-size: 0.75rem; color: var(--text-muted); }
.cl-notes { margin: 0; font-size: 0.88rem; color: var(--text-secondary); white-space: pre-line; overflow-wrap: anywhere; padding: 0.7rem 0.85rem; border-radius: 12px;
    background: var(--surface-sunken); border-left: 3px solid var(--hue); }
.cl-roster { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.cl-roster-row { display: flex; align-items: center; gap: 0.7rem; min-width: 0; padding: 0.5rem 0.5rem 0.5rem 0.6rem; border-radius: 12px; border: 1px solid var(--border-light);
    background: var(--surface); transition: border-color 0.2s, background-color 0.2s; }
.cl-roster-row:hover { border-color: color-mix(in srgb, var(--hue) 40%, var(--border-medium)); background: color-mix(in srgb, var(--hue) 4%, var(--surface)); }
.cl-roster-row.is-removed { opacity: 0.6; }
.cl-roster-row.is-removed strong { text-decoration: line-through; text-decoration-color: var(--text-muted); }
.cl-roster-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cl-roster-text strong { font-size: 0.92rem; font-weight: 600; overflow-wrap: anywhere; }
.cl-roster-text small { font-size: 0.77rem; color: var(--text-secondary); }
.cl-roster-actions { flex-shrink: 0; display: flex; align-items: center; gap: 0.2rem; }
.cl-roster-row { position: relative; }
.cl-roster-actions [aria-expanded="true"] { color: var(--hue); background: color-mix(in srgb, var(--hue) 14%, transparent); }
.cl-move-menu { position: absolute; top: calc(100% - 0.25rem); right: 0.5rem; z-index: 5; width: min(270px, calc(100% - 1rem)); padding: 0.35rem; border-radius: 12px;
    background: var(--surface-raised); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); animation: cl-menu-in 0.18s var(--ease-out, ease-out) both; transform-origin: top right; }
.cl-move-menu.is-up { top: auto; bottom: calc(100% - 0.25rem); transform-origin: bottom right; }
.cl-move-menu p { margin: 0.25rem 0.55rem 0.35rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.cl-move-menu button { width: 100%; display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.6rem; border: none; border-radius: 8px; background: none;
    color: var(--text-primary); font: inherit; font-size: 0.86rem; text-align: left; cursor: pointer; }
.cl-move-menu button:hover, .cl-move-menu button:focus-visible { outline: none; background: color-mix(in srgb, var(--hue) 13%, transparent); }
.cl-move-menu small { min-width: 0; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes cl-menu-in { from { opacity: 0; transform: scale(0.96); } }
.cl-roster-empty { margin: 0 0 0.5rem; font-size: 0.88rem; color: var(--text-secondary); }
.cl-roster-add { width: 100%; display: flex; align-items: center; justify-content: center; gap: 0.4rem; margin-top: 0.55rem; padding: 0.65rem; border-radius: 12px;
    border: 1.5px dashed color-mix(in srgb, var(--hue) 40%, var(--border-medium)); background: none; color: var(--hue); font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s; }
.cl-roster-add:hover { background: color-mix(in srgb, var(--hue) 8%, transparent); border-color: var(--hue); }
.cl-roster-add:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cl-roster-add .icon { width: 15px; height: 15px; }
.cl-removed { margin-top: 0.8rem; }
.cl-removed summary { font-size: 0.82rem; color: var(--text-secondary); cursor: pointer; width: fit-content; }
.cl-removed summary:hover { color: var(--text-primary); }
.cl-removed[open] summary { margin-bottom: 0.45rem; }
.cl-roster-row.cl-flash { animation: cl-row-flash 1.6s var(--ease-out, ease-out); }
@keyframes cl-row-flash { 0%, 35% { border-color: var(--hue); background: color-mix(in srgb, var(--hue) 14%, var(--surface)); } }
.cl-toast-undo { flex-shrink: 0; font-size: 0.85rem; }
@media (max-width: 480px) {
    .cl-drawer-hero, .cl-drawer-section, .cl-facts { padding-left: 1.15rem; padding-right: 1.15rem; }
    .cl-facts { gap: 0.5rem; }
    .cl-fact { padding: 0.6rem; gap: 0.5rem; }
}

/* Usage: two meters (5-hour, weekly) - green, amber from 70%, red from 90% - and
   where the figures came from and when. */
.cl-usage { margin-top: 0.7rem; padding: 0.75rem 0.8rem 0.65rem; border-radius: 12px; background: var(--surface-sunken); border: 1px solid var(--border-light); }
.cl-usage.is-big { margin-top: 0; padding: 0.95rem 1rem 0.8rem; }
.cl-usage.is-old { border-style: dashed; }
.cl-usage-meters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }
/* In use now (a live dot) / Last used */
.cl-usage-live { margin: -0.15rem 0 0.55rem; }
.cl-live { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.12rem 0.55rem 0.12rem 0.45rem; border-radius: 999px; font-size: 0.74rem; font-weight: 600;
    color: var(--text-secondary); background: color-mix(in srgb, var(--text-secondary) 10%, transparent); }
.cl-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted, var(--text-secondary)); opacity: 0.7; }
.cl-live.is-on { color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); }
.cl-live.is-on i { position: relative; background: var(--success); opacity: 1; }
.cl-live.is-on i::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--success); animation: cl-live-ping 1.8s ease-out infinite; }
@keyframes cl-live-ping { from { transform: scale(0.4); opacity: 0.9; } to { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cl-live.is-on i::after { animation: none; opacity: 0; } }
.cl-meter { --tone: var(--success); min-width: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.cl-meter.is-warn { --tone: var(--warning); }
.cl-meter.is-bad { --tone: var(--danger); }
.cl-meter.is-reset, .cl-meter.is-none { --tone: var(--text-muted); }
.cl-meter-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.cl-meter-top strong { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.01em; color: var(--tone); font-variant-numeric: tabular-nums; text-transform: none; }
.cl-usage.is-big .cl-meter-top strong { font-size: 1.5rem; }
.cl-meter-bar { display: block; height: 7px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--text-primary) 8%, transparent); }
.cl-usage.is-big .cl-meter-bar { height: 9px; }
.cl-meter-bar i { display: block; height: 100%; border-radius: inherit; background: var(--tone); transition: width 0.6s var(--ease-out, ease-out); animation: cl-meter 0.9s var(--ease-out, ease-out) both; }
.cl-meter small { font-size: 0.74rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-meter.is-bad small { color: var(--danger); }
.cl-usage-src { margin: 0.6rem 0 0; padding-top: 0.5rem; border-top: 1px dashed var(--border-light); display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; font-size: 0.74rem; color: var(--text-muted); }
.cl-src-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); }
.cl-src-dot.is-claude_code { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 20%, transparent); }
.cl-src-dot.is-browser { background: var(--type-external); box-shadow: 0 0 0 3px color-mix(in srgb, var(--type-external) 20%, transparent); }
.cl-usage.is-old .cl-usage-src { color: var(--warning); }
.cl-usage.is-empty { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; font-size: 0.84rem; color: var(--text-secondary); }
.cl-usage.is-empty > span { display: inline-flex; align-items: center; gap: 0.45rem; }
.cl-usage.is-empty .icon { width: 16px; height: 16px; color: var(--text-muted); }
.cl-usage.is-empty .link-btn { font-size: 0.84rem; }
.cl-drawer-h .cl-h-action { margin-left: auto; display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; letter-spacing: 0; text-transform: none; }
.cl-drawer-h .cl-h-action .icon { width: 13px; height: 13px; }
.cl-usage-hint { margin: 0.6rem 0 0; font-size: 0.8rem; color: var(--text-secondary); line-height: 1.45; }
.cl-usage-history { margin-top: 0.6rem; }
.cl-usage-history summary { display: flex; align-items: center; gap: 0.4rem; width: fit-content; font-size: 0.82rem; color: var(--text-secondary); cursor: pointer; }
.cl-usage-history summary small { color: var(--text-muted); }
.cl-usage-history ul { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.15rem; }
.cl-usage-history li { display: grid; grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr) 2.6rem 3.7rem minmax(0, 6.5rem); align-items: center; gap: 0.6rem; padding: 0.3rem 0.4rem; border-radius: 7px; font-size: 0.78rem; }
.cl-usage-history li:hover { background: var(--hover-bg); }
.cl-hist-when { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-hist-bar { height: 6px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--text-primary) 8%, transparent); }
.cl-hist-bar i { display: block; height: 100%; background: var(--hue, var(--accent-color)); border-radius: inherit; }
.cl-usage-history li strong { text-align: right; font-variant-numeric: tabular-nums; }
.cl-hist-week { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.cl-usage-history li small { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) {
    .cl-usage-history li { grid-template-columns: minmax(0, 1fr) 2.6rem 3.7rem; }
    .cl-usage-history li :is(.cl-hist-bar, small) { display: none; }
}

/* Under the meters on a card: the 7-day line and "ran out N× this week". */
.cl-usage-extra { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 0.75rem; margin-top: 0.6rem; }
.cl-spark { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--hue, var(--accent-color)); }
.cl-spark svg { display: block; overflow: visible; }
.cl-spark .cl-spark-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cl-spark .cl-spark-gap { fill: none; stroke: currentColor; stroke-width: 1; stroke-dasharray: 1.5 2.5; opacity: 0.45; }
.cl-spark circle { fill: currentColor; }
.cl-spark .cl-spark-limit { stroke: var(--danger); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0.45; }
.cl-spark-hit rect { fill: transparent; }
.cl-spark-hit rect:hover { fill: color-mix(in srgb, currentColor 14%, transparent); }
.cl-spark small { font-size: 0.7rem; color: var(--text-muted); }
.cl-hits { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.74rem; font-weight: 650; color: var(--warning); }
.cl-hits.is-bad { color: var(--danger); }
.cl-hits .icon { width: 13px; height: 13px; }
.cl-stale-badge { display: inline-flex; align-items: center; gap: 0.25rem; margin-right: 0.3rem; padding: 0.08rem 0.45rem; border-radius: 999px; font-weight: 650;
    color: var(--warning); background: color-mix(in srgb, var(--warning) 13%, transparent); }
.cl-stale-badge .icon { width: 12px; height: 12px; }
.cl-usage.is-stale { border-color: color-mix(in srgb, var(--warning) 45%, var(--border-light)); }

/* Needs attention: one row per thing to look at, the worst first. */
#cl-attention:empty { display: none; }
.cl-attention { padding: 0.9rem 1rem 0.75rem; margin-bottom: 1.25rem; }
.cl-attention:hover { transform: none; }
.cl-attention-h { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.6rem; font-size: 0.78rem !important; font-weight: 700 !important; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-secondary); }
.cl-attention-h .icon { width: 16px; height: 16px; color: var(--accent-color); }
.cl-attention ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.cl-notice { --tone: var(--type-external); display: flex; align-items: center; gap: 0.75rem; min-width: 0; padding: 0.55rem 0.6rem 0.55rem 0.7rem; border-radius: 12px;
    background: color-mix(in srgb, var(--tone) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--tone) 22%, var(--border-light)); border-left: 3px solid var(--tone); }
.cl-notice.is-bad { --tone: var(--danger); }
.cl-notice.is-warn { --tone: var(--warning); }
.cl-notice-icon { flex-shrink: 0; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 9px; color: var(--tone); background: color-mix(in srgb, var(--tone) 13%, transparent); }
.cl-notice-icon .icon { width: 16px; height: 16px; }
.cl-notice-text { flex: 1; min-width: 0; font-size: 0.88rem; line-height: 1.45; color: var(--text-primary); }
.cl-notice-actions { flex-shrink: 0; display: flex; align-items: center; gap: 0.5rem; }
.cl-notice-actions .link-btn { font-size: 0.84rem; }
.cl-attention-more { margin-top: 0.55rem; font-size: 0.84rem; }
@container page (max-width: 699px) {
    .cl-notice { flex-wrap: wrap; }
    .cl-notice-text { flex-basis: calc(100% - 3rem); }
    .cl-notice-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
}

/* The panel's usage chart: 5-hour in the account's colour, weekly dashed and grey. */
.cl-chart-wrap { margin-top: 0.85rem; }
.cl-chart-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.4rem; }
.cl-legend { display: inline-flex; gap: 0.85rem; font-size: 0.78rem; color: var(--text-secondary); }
.cl-legend span, .cl-tip span { display: inline-flex; align-items: center; gap: 0.35rem; }
.cl-legend i, .cl-tip i { width: 14px; height: 0; border-top: 2px solid var(--hue, var(--accent-color)); }
.cl-legend .is-week i, .cl-tip .is-week i { border-top: 2px dashed var(--text-secondary); }
.cl-range { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--surface-sunken); border: 1px solid var(--border-light); }
.cl-range button { padding: 0.2rem 0.6rem; border: none; border-radius: 7px; background: none; color: var(--text-secondary); font: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer; }
.cl-range button.is-on { background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.cl-range button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cl-chart { position: relative; min-height: 80px; }
.cl-chart-svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.cl-chart-svg .cl-grid { stroke: var(--border-light); stroke-width: 1; }
.cl-chart-svg .cl-axis { font-size: 10px; fill: var(--text-muted); font-family: inherit; }
.cl-chart-svg .cl-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cl-chart-svg .cl-line.is-five { stroke: var(--hue, var(--accent-color)); }
.cl-chart-svg .cl-line.is-week { stroke: var(--text-secondary); stroke-dasharray: 5 4; }
.cl-chart-svg .cl-cross { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.cl-chart-svg .cl-dot-five { fill: var(--hue, var(--accent-color)); stroke: var(--surface); stroke-width: 2; }
.cl-chart-svg .cl-dot-week { fill: var(--text-secondary); stroke: var(--surface); stroke-width: 2; }
.cl-chart-svg .cl-hit { fill: transparent; cursor: crosshair; }
.cl-tip { position: absolute; top: 0; transform: translateX(-50%); z-index: 3; display: flex; flex-direction: column; gap: 0.15rem; padding: 0.45rem 0.6rem; border-radius: 9px; pointer-events: none;
    font-size: 0.76rem; white-space: nowrap; color: var(--text-primary); background: var(--surface-raised); border: 1px solid var(--border-strong); box-shadow: var(--shadow-md); }
.cl-tip b { font-variant-numeric: tabular-nums; margin-left: auto; padding-left: 0.6rem; }
.cl-chart-empty { margin: 0.6rem 0; font-size: 0.84rem; color: var(--text-muted); }
.cl-usage-more { margin-top: 0.6rem; }
.cl-usage-more summary { display: flex; align-items: center; gap: 0.4rem; width: fit-content; font-size: 0.84rem; color: var(--text-secondary); cursor: pointer; }
.cl-usage-more summary .icon { width: 14px; height: 14px; }
.cl-usage-more summary small { color: var(--text-muted); }
.cl-usage-more summary:hover { color: var(--text-primary); }
.cl-heat-sum { margin: 0.5rem 0 0.4rem; font-size: 0.82rem; color: var(--text-secondary); }
.cl-heat { display: grid; grid-template-columns: 2.2rem repeat(24, minmax(0, 1fr)); gap: 2px; align-items: center; }
.cl-heat i { aspect-ratio: 1; border-radius: 3px; background: color-mix(in srgb, var(--hue, var(--accent-color)) var(--v), var(--surface-sunken)); border: 1px solid var(--border-light); }
.cl-heat-day, .cl-heat-hour { font-size: 0.66rem; color: var(--text-muted); white-space: nowrap; }
.cl-reporters { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.35rem; }
.cl-reporters li { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.6rem; border-radius: 10px; background: var(--surface-sunken); border: 1px solid var(--border-light); }
.cl-rep-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cl-rep-name strong { font-size: 0.86rem; overflow-wrap: anywhere; }
.cl-rep-name small { font-size: 0.74rem; color: var(--text-secondary); }
.cl-rep-last { flex-shrink: 0; font-size: 0.76rem; color: var(--success); font-weight: 600; }
.cl-rep-last.is-quiet { color: var(--warning); }

/* claude.ai accounts reporting that aren't tied to a card yet */
#cl-unlinked:empty { display: none; }
#cl-unlinked { display: grid; gap: 0.6rem; margin-bottom: 1.25rem; }
.cl-unlinked-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin: 0; }
.cl-unlinked-text { flex: 1 1 280px; min-width: 0; font-size: 0.9rem; line-height: 1.45; overflow-wrap: anywhere; }
.cl-unlinked-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.cl-unlinked-actions select.text-input { width: auto; min-height: var(--control-h-sm); }

/* The "Usage reporting" window */
.modal-content.cl-reporting-content { max-width: 720px; }
.cl-rep-step { padding: 1rem 0; border-top: 1px solid var(--border-light); }
.cl-rep-step:first-of-type { border-top: none; padding-top: 0.25rem; }
.cl-rep-step h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; margin: 0 0 0.45rem; font-size: 1rem; }
.cl-rep-step h3 > span { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; font-size: 0.8rem; font-weight: 800; color: var(--on-accent); background: var(--accent-color); }
.cl-rep-tag { font-style: normal; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.12rem 0.5rem; border-radius: 999px;
    color: var(--text-secondary); background: var(--surface-sunken); border: 1px solid var(--border-light); }
.cl-rep-tag.is-good { color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, transparent); background: color-mix(in srgb, var(--success) 10%, transparent); }
.cl-rep-tag.is-warn { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 35%, transparent); background: color-mix(in srgb, var(--warning) 10%, transparent); }
.cl-rep-step p { margin: 0 0 0.7rem; font-size: 0.88rem; color: var(--text-secondary); line-height: 1.55; }
.cl-rep-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.2rem 0 0.75rem; }
.cl-rep-actions .btn-secondary { display: inline-flex; align-items: center; text-decoration: none; }
.cl-rep-list { margin: 0; padding-left: 1.2rem; font-size: 0.86rem; color: var(--text-secondary); line-height: 1.6; display: grid; gap: 0.35rem; }
.cl-rep-list code, .cl-rep-step p code { font-size: 0.8rem; }
.cl-rep-secret { display: flex; align-items: center; gap: 0.5rem; margin: 0.4rem 0 0.6rem; padding: 0.45rem 0.45rem 0.45rem 0.7rem; border-radius: 10px; background: var(--surface-sunken); border: 1px solid var(--border-light); }
.cl-rep-secret code { flex: 1; min-width: 0; font-size: 0.8rem; overflow-wrap: anywhere; color: var(--text-primary); }
#cl-rep-key-new { border-color: color-mix(in srgb, var(--success) 45%, var(--border-light)); }
.cl-rep-status { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.cl-rep-status li { display: grid; grid-template-columns: auto 5.5rem minmax(0, 1fr) auto; align-items: center; gap: 0.6rem; font-size: 0.86rem; padding: 0.4rem 0.55rem; border-radius: 9px; background: var(--surface-sunken); }
.cl-rep-linked { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.78rem; color: var(--success); }
.cl-rep-linked .icon { width: 13px; height: 13px; }
@media (max-width: 480px) {
    .cl-rep-status li { grid-template-columns: auto minmax(0, 1fr); }
    .cl-rep-status li > :nth-child(n+3) { grid-column: 2; }
}

/* People view */
.cl-people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 1rem; align-items: start; }
.cl-person-card { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.8rem; min-width: 0; transition: transform 0.3s var(--ease-out, ease-out), box-shadow 0.3s, border-color 0.3s; }
.cl-person-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.cl-person-card.is-removed { opacity: 0.65; }
.cl-person-card header { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.cl-person-card header > div { flex: 1; min-width: 0; }
.cl-person-card h3 { margin: 0; font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.cl-person-card header p { margin: 0.1rem 0 0; font-size: 0.82rem; color: var(--text-secondary); overflow-wrap: anywhere; }
.cl-person-card footer .link-btn { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.85rem; }
.cl-person-card footer .link-btn .icon { width: 14px; height: 14px; }
.cl-person-count { flex-shrink: 0; display: grid; place-items: center; min-width: 1.9rem; height: 1.9rem; padding: 0 0.45rem; border-radius: 999px; font-size: 0.85rem; font-weight: 700;
    background: var(--surface-sunken); border: 1px solid var(--border-light); font-variant-numeric: tabular-nums; }
.cl-acc-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cl-acc-chip { display: inline-flex; align-items: center; gap: 0.4rem; max-width: 100%; padding: 0.3rem 0.65rem; border-radius: 999px; font: inherit; font-size: 0.82rem; color: var(--text-primary); cursor: pointer;
    background: color-mix(in srgb, var(--hue) 9%, transparent); border: 1px solid color-mix(in srgb, var(--hue) 32%, var(--border-light)); transition: border-color 0.15s, background-color 0.15s, transform 0.15s; }
.cl-acc-chip:hover { border-color: var(--hue); background: color-mix(in srgb, var(--hue) 15%, transparent); transform: translateY(-1px); }
.cl-acc-chip:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cl-acc-chip small { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cl-acc-chip.is-removed { opacity: 0.6; border-style: dashed; }
.cl-dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--hue); }
.cl-person-card footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 1rem; font-size: 0.8rem; padding-top: 0.6rem; border-top: 1px solid var(--border-light); }
@media (prefers-reduced-motion: reduce) {
    .cl-card, .cl-card:hover { transform: none; }
    .cl-state-active i { animation: none; }
}

/* All seats table */
.cl-table td { vertical-align: middle; }
.cl-sort { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0; border: none; background: none; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.cl-sort:hover, .cl-sort.is-sorted { color: var(--text-primary); }
.cl-sort::after { content: ''; width: 0.5em; opacity: 0.8; }
.cl-sort[data-dir="up"]::after { content: '▲'; font-size: 0.65em; }
.cl-sort[data-dir="down"]::after { content: '▼'; font-size: 0.65em; }
.cl-name-cell { display: inline-flex; align-items: center; gap: 0.55rem; }
/* A person's name: opens their panel. */
.cl-name-link { padding: 0; border: none; background: none; font: inherit; font-weight: 600; color: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere;
    text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color 0.2s, color 0.2s; }
.cl-name-link:hover { color: var(--hue, var(--accent-color)); text-decoration-color: currentColor; }
.cl-name-link:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }
.cl-roster-text .cl-name-link { font-size: 0.92rem; }
.cl-person-card h3 .cl-name-link { font-weight: 700; }
.cl-until { display: inline-flex; align-items: center; gap: 0.2rem; margin-left: 0.45rem; padding: 0.05rem 0.4rem; border-radius: 999px; font-size: 0.7rem; font-weight: 650; vertical-align: middle;
    color: var(--text-secondary); background: var(--surface-sunken); border: 1px solid var(--border-light); white-space: nowrap; }
.cl-until .icon { width: 11px; height: 11px; }
.cl-until.is-soon { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 40%, transparent); }
.cl-until.is-ended { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.cl-also { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; margin-top: 0.2rem; font-size: 0.74rem; color: var(--text-muted); }
.cl-also .cl-acc-inline { font-size: 0.74rem; }
.cl-mini-use { display: flex; gap: 0.75rem; margin-top: 0.2rem; font-size: 0.74rem; color: var(--text-secondary); }
.cl-mini-use b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.cl-mini-no { flex-shrink: 0; font-size: 1.35rem !important; min-width: 2.1rem; text-align: center; }
.cl-person-hero { text-align: left; }
.cl-avatar-xl { position: relative; width: 3.6rem; height: 3.6rem; font-size: 1.2rem; }
.cl-person-hero h2 { margin-top: 0.75rem !important; }
.cl-ends-quick { justify-content: flex-end; }
.cl-ends-label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.cl-ends-quick div { font-size: 0.86rem; color: var(--text-muted); padding: 0.55rem 0 0; }

/* Board: a column per account, side by side (scrolls sideways when they don't fit). */
.cl-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 1rem; align-items: start; overflow-x: auto; padding: 0.25rem 0.25rem 0.75rem; scroll-snap-type: x proximity; }
.cl-col { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; padding: 0.85rem; scroll-snap-align: start; border-top: 3px solid var(--hue); transition: background-color 0.2s, box-shadow 0.2s; }
.cl-col:hover { transform: none; }
.cl-col.is-off { opacity: 0.75; }
.cl-col.is-over-col { background: color-mix(in srgb, var(--hue) 9%, var(--surface)); box-shadow: 0 0 0 2px var(--hue), var(--shadow-md); }
.cl-col header { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.cl-col-title { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0; border: none; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; line-height: 1.3; }
.cl-col-title strong { font-size: 0.95rem; }
.cl-col-title small { font-size: 0.76rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-col-title:hover strong { color: var(--hue); }
.cl-col-title:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }
.cl-col-count { flex-shrink: 0; min-width: 1.9rem; padding: 0.15rem 0.45rem; border-radius: 999px; text-align: center; font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums;
    color: var(--hue); background: color-mix(in srgb, var(--hue) 13%, transparent); }
.cl-col-count.is-over { color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, transparent); }
.cl-col-use { display: block; height: 5px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--text-primary) 8%, transparent); }
.cl-col-use i { display: block; height: 100%; border-radius: inherit; background: var(--success); }
.cl-col-use i.is-warn { background: var(--warning); }
.cl-col-use i.is-bad { background: var(--danger); }
.cl-col-use.is-none { background: repeating-linear-gradient(90deg, var(--border-light) 0 6px, transparent 6px 10px); }
.cl-col-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.cl-chip-person { width: 100%; display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.55rem 0.45rem 0.3rem; border-radius: 10px; border: 1px solid var(--border-light);
    background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: grab; -webkit-user-select: none; user-select: none; transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s; }
.cl-chip-person:hover { border-color: color-mix(in srgb, var(--hue) 45%, var(--border-medium)); box-shadow: var(--shadow-sm); }
.cl-chip-person:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cl-chip-person .cl-avatar { width: 1.75rem; height: 1.75rem; font-size: 0.64rem; }
.cl-chip-person.is-dragging { opacity: 0.35; }
.cl-grip { flex-shrink: 0; width: 1rem; text-align: center; letter-spacing: -2px; font-size: 0.8rem; line-height: 1; color: var(--text-muted); touch-action: none; cursor: grab; }
.cl-chip-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cl-chip-text strong { font-size: 0.86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-chip-text small { font-size: 0.72rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-chip-person .cl-until { margin-left: 0; }
.cl-ghost { position: fixed; z-index: 1300; pointer-events: none; cursor: grabbing; box-shadow: var(--shadow-lg); transform: rotate(-2deg) scale(1.03); background: var(--surface-raised); }
.cl-board.is-dragging, .cl-board.is-dragging * { cursor: grabbing; }
.cl-col-empty { margin: 0; padding: 0.9rem 0.5rem; border-radius: 10px; border: 1.5px dashed var(--border-medium); text-align: center; font-size: 0.82rem; color: var(--text-muted); }
.cl-col-add { display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem; padding: 0.45rem; border-radius: 10px; border: 1px dashed color-mix(in srgb, var(--hue) 40%, var(--border-medium));
    background: none; color: var(--hue); font: inherit; font-size: 0.84rem; font-weight: 600; cursor: pointer; }
.cl-col-add:hover { background: color-mix(in srgb, var(--hue) 8%, transparent); }
.cl-col-add .icon { width: 14px; height: 14px; }
@container page (max-width: 599px) {
    .cl-board { grid-auto-columns: 82%; scroll-snap-type: x mandatory; }
}

/* Compare: usage as small bars with the figure. */
.cl-acc-table td { vertical-align: middle; }
.cl-cmp-pct { --tone: var(--success); display: inline-flex; align-items: center; gap: 0.45rem; min-width: 6.5rem; }
.cl-cmp-pct.is-warn { --tone: var(--warning); }
.cl-cmp-pct.is-bad { --tone: var(--danger); }
.cl-cmp-bar { display: block; width: 3.4rem; height: 6px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--text-primary) 8%, transparent); }
.cl-cmp-bar i { display: block; height: 100%; border-radius: inherit; background: var(--tone); }
.cl-cmp-pct b { font-variant-numeric: tabular-nums; color: var(--tone); }
.view-toggle .view-btn span { white-space: nowrap; }
@container page (max-width: 899px) {
    #cl-view .view-btn span { display: none; }
    #cl-view .view-btn { padding-left: 0.6rem; padding-right: 0.6rem; }
}

/* Header "More" and the getting-set-up list */
.cl-more-btn { display: inline-flex; align-items: center; gap: 0.35rem; }
.cl-more-btn .icon { width: 16px; height: 16px; }
#cl-setup:empty { display: none; }
.cl-setup { padding: 0.85rem 1rem; margin-bottom: 1.25rem; }
.cl-setup:hover { transform: none; }
.cl-setup summary { display: flex; align-items: center; gap: 0.85rem; cursor: pointer; list-style: none; }
.cl-setup summary::-webkit-details-marker { display: none; }
.cl-setup summary > span:last-child { display: flex; flex-direction: column; line-height: 1.35; }
.cl-setup summary strong { font-size: 0.98rem; }
.cl-setup summary small { font-size: 0.8rem; color: var(--text-secondary); }
.cl-setup-ring { flex-shrink: 0; display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: 50%;
    background: radial-gradient(closest-side, var(--surface) 76%, transparent 78%), conic-gradient(var(--success) calc(var(--p) * 1%), var(--surface-sunken) 0); }
.cl-setup-ring b { font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.cl-setup ol { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.35rem; }
.cl-setup li { display: flex; align-items: center; gap: 0.65rem; padding: 0.4rem 0.5rem; border-radius: 10px; font-size: 0.88rem; }
.cl-setup li:not(.is-done) { background: var(--surface-sunken); }
.cl-setup li > span:nth-child(2) { flex: 1; min-width: 0; }
.cl-setup li.is-done > span:nth-child(2) { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.cl-setup-tick { flex-shrink: 0; display: grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 1.5px solid var(--border-strong); }
.cl-setup li.is-done .cl-setup-tick { border-color: var(--success); background: var(--success); color: var(--surface); }
.cl-setup-tick .icon { width: 12px; height: 12px; }
.cl-setup-hide { margin-top: 0.6rem; font-size: 0.82rem; }

/* Activity, monthly summary, shortcuts windows */
.modal-content.cl-activity-content, .modal-content.cl-summary-content { max-width: 720px; }
.modal-content.cl-keys-content { max-width: 440px; }
.cl-activity-filter { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; margin-bottom: 0.9rem; border-radius: 10px; background: var(--surface-sunken); border: 1px solid var(--border-light); }
.cl-activity-filter button { padding: 0.3rem 0.75rem; border: none; border-radius: 8px; background: none; color: var(--text-secondary); font: inherit; font-size: 0.84rem; font-weight: 600; cursor: pointer; }
.cl-activity-filter button.is-on { background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.cl-activity-filter button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
#cl-activity-list { max-height: 60vh; overflow-y: auto; padding-right: 0.25rem; }
.cl-sum-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; margin-bottom: 1rem; }
.cl-sum-tiles > div { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.7rem 0.8rem; border-radius: 12px; background: var(--surface-sunken); border: 1px solid var(--border-light); min-width: 0; }
.cl-sum-tiles small { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.cl-sum-tiles strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cl-sum-tiles span { font-size: 0.76rem; color: var(--text-muted); }
.cl-sum-note { margin: 0.8rem 0 0; font-size: 0.86rem; color: var(--text-secondary); }
@container page (max-width: 699px) { .cl-sum-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .cl-sum-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cl-keys { display: grid; grid-template-columns: auto 1fr; gap: 0.55rem 1rem; margin: 0.5rem 0 0; align-items: center; }
.cl-keys dt { white-space: nowrap; }
.cl-keys dd { margin: 0; font-size: 0.9rem; color: var(--text-secondary); }
.cl-keys kbd { display: inline-block; min-width: 1.6rem; padding: 0.12rem 0.45rem; border-radius: 6px; text-align: center; font: inherit; font-size: 0.8rem; font-weight: 700;
    background: var(--surface-sunken); border: 1px solid var(--border-strong); box-shadow: 0 2px 0 var(--border-strong); }

/* Claude printing: the accounts sheet or the summary, nothing else. */
@media print {
    body.cl-print-mode > *:not(#cl-print) { display: none !important; }
    body.cl-print-mode #cl-print { display: block !important; color: #000; font-size: 11pt; }
    #cl-print .cl-print-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #000; margin-bottom: 10pt; }
    #cl-print h1, #cl-print h2 { margin: 0 0 6pt; font-size: 16pt; }
    #cl-print table { width: 100%; border-collapse: collapse; }
    #cl-print th, #cl-print td { border-bottom: 1px solid #bbb; padding: 5pt 6pt; text-align: left; vertical-align: top; }
    #cl-print th { font-size: 9pt; text-transform: uppercase; letter-spacing: 0.04em; }
    #cl-print .cl-sum-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6pt; margin-bottom: 10pt; }
    #cl-print .cl-sum-tiles > div { border: 1px solid #bbb; padding: 6pt; }
    #cl-print .card-intro, #cl-print .cl-print-note, #cl-print .cl-sum-note { font-size: 9pt; color: #333; }
    #cl-print .cl-dot { display: none; }
    #cl-print tr { break-inside: avoid; }
}

/* People by department: a heading with the department's usage, then its people. */
.cl-people-wrap { display: grid; gap: 1.5rem; }
.cl-team-group { display: grid; gap: 0.75rem; }
.cl-team-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-light); }
.cl-team-head h3 { margin: 0; font-size: 1.05rem; }
.cl-team-stat { font-size: 0.84rem; color: var(--text-secondary); }
.cl-team-accs { display: inline-flex; flex-wrap: wrap; gap: 0.3rem 0.7rem; }
.cl-team-accs .cl-acc-inline { padding: 0; border: none; background: none; font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--text-primary); cursor: pointer; }
.cl-team-accs .cl-acc-inline:hover { color: var(--hue); }
.cl-team-use { margin-left: auto; font-size: 0.82rem; color: var(--text-secondary); }
.cl-team-use b { color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* All seats: tick boxes and the bar that changes the ticked people. */
.cl-pick-cell { width: 2.4rem; }
.cl-pick-cell input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent-color); cursor: pointer; vertical-align: middle; }
.cl-table tr.is-picked > td { background: color-mix(in srgb, var(--accent-color) 6%, transparent); }
.cl-bulk { position: sticky; top: 0.5rem; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.6rem 0.75rem; margin-bottom: 0.75rem; border-radius: 12px;
    background: var(--surface-raised); border: 1px solid color-mix(in srgb, var(--accent-color) 35%, var(--border-medium)); box-shadow: var(--shadow-md); animation: cl-menu-in 0.18s var(--ease-out, ease-out) both; }
.cl-bulk strong { font-size: 0.9rem; margin-right: 0.25rem; }
.cl-bulk-move { display: inline-flex; gap: 0.4rem; }
.cl-bulk-move select { width: auto; min-width: 10rem; height: var(--control-h-sm, 2.2rem); padding-top: 0; padding-bottom: 0; }
.cl-bulk #cl-bulk-clear { margin-left: auto; font-size: 0.85rem; }
.cl-acc-inline { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; }
.cl-table tr.is-removed > td:not(.cl-row-edit) { opacity: 0.6; }
.cl-row-edit { width: 1%; text-align: right; }
.is-stacked .cl-row-edit { display: none !important; }
.is-stacked > table.cl-table > tbody > tr > td[data-label="Account"] :is(br, small) { display: none; }
.is-stacked > table.cl-table > tbody > tr > td:nth-last-child(2) { border-bottom: none; }
.is-stacked > table.cl-table > tbody > tr > td:first-child .cl-name-cell { font-size: 0.98rem; }

.cl-none { text-align: center; grid-column: 1 / -1; margin: 0; }
.cl-empty { text-align: center; padding: 3rem 1.5rem; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.cl-empty:hover { transform: none; }
.cl-empty h2 { margin: 0.25rem 0 0; }
.cl-empty p { margin: 0; max-width: 54ch; color: var(--text-secondary); line-height: 1.55; }
.cl-empty-mark { display: grid; place-items: center; width: 3.6rem; height: 3.6rem; border-radius: 16px; color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 13%, transparent); }
.cl-empty-mark .icon { width: 28px; height: 28px; }
.cl-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin-top: 0.5rem; }

/* Forms */
.cl-password-field { position: relative; }
.cl-password-field .text-input { padding-right: 2.75rem; }
.cl-field-btn { position: absolute; top: 50%; right: 0.3rem; transform: translateY(-50%); display: grid; place-items: center; width: 2rem; height: 2rem; padding: 0;
    border: none; border-radius: 7px; background: none; color: var(--text-secondary); cursor: pointer; }
.cl-field-btn:hover { color: var(--text-primary); background: var(--hover-bg); }
.cl-field-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cl-field-btn .icon { width: 17px; height: 17px; }
.cl-password-field .text-input { padding-right: 4.9rem; }
.cl-field-btn.cl-field-btn-2 { right: 2.4rem; }

/* An account's "more" menu (card hero, panel) and other small menus: above everything. */
.cl-card-more { align-self: center; width: 1.9rem; height: 1.9rem; color: var(--hue); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.cl-card-more:hover { background: var(--surface); }
.cl-drawer-more { width: auto; height: var(--control-h-sm, 2rem); padding: 0 0.55rem; border: 1px solid var(--border-medium); }
.cl-pop { position: fixed; z-index: 1200; width: max-content; min-width: 220px; max-width: min(300px, calc(100vw - 16px)); padding: 0.35rem; border-radius: 12px;
    background: var(--surface-raised); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); animation: cl-menu-in 0.16s var(--ease-out, ease-out) both; }
.cl-pop p { margin: 0.3rem 0.55rem 0.3rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-secondary); }
.cl-pop p:not(:first-child) { margin-top: 0.5rem; padding-top: 0.45rem; border-top: 1px solid var(--border-light); }
.cl-pop button { width: 100%; display: flex; align-items: center; gap: 0.55rem; padding: 0.48rem 0.6rem; border: none; border-radius: 8px; background: none;
    color: var(--text-primary); font: inherit; font-size: 0.87rem; text-align: left; cursor: pointer; }
.cl-pop button .icon { flex-shrink: 0; width: 15px; height: 15px; color: var(--hue, var(--accent-color)); }
.cl-pop button span { flex: 1; }
.cl-pop button small { color: var(--text-muted); font-size: 0.74rem; white-space: nowrap; }
.cl-pop button:hover:not(:disabled), .cl-pop button:focus-visible { outline: none; background: color-mix(in srgb, var(--hue, var(--accent-color)) 12%, transparent); }
.cl-pop button:disabled { cursor: default; font-weight: 650; }
.cl-pop button[aria-checked="true"] .icon { color: var(--success); }
.cl-pop [data-set-status]:not(:disabled) .icon { opacity: 0.35; }

/* Toolbar on/off chip (Cancelled accounts, Removed people, Group by department) */
.cl-chip-toggle { display: inline-flex; align-items: center; gap: 0.4rem; height: var(--control-h-sm, 2.2rem); padding: 0 0.75rem; border-radius: 999px; border: 1px solid var(--border-medium);
    background: var(--surface); color: var(--text-secondary); font: inherit; font-size: 0.84rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.cl-chip-toggle .icon { width: 15px; height: 15px; }
.cl-chip-toggle:hover { color: var(--text-primary); border-color: var(--border-strong); }
.cl-chip-toggle[aria-pressed="true"] { color: var(--accent-color); border-color: color-mix(in srgb, var(--accent-color) 45%, var(--border-medium)); background: color-mix(in srgb, var(--accent-color) 8%, var(--surface)); }
.cl-chip-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cl-fact-of { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.cl-fact em .link-btn { font-size: 0.75rem; }
.cl-notes a { color: var(--accent-color); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }

/* History: what changed, newest first (account panel, person panel, activity list). */
.cl-history summary { display: flex; align-items: center; gap: 0.45rem; width: fit-content; font-size: 0.86rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.cl-history summary .icon { width: 15px; height: 15px; }
.cl-history summary small { font-weight: 400; color: var(--text-muted); }
.cl-history summary:hover { color: var(--text-primary); }
.cl-activity { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0; }
.cl-activity li { position: relative; display: flex; gap: 0.65rem; padding: 0 0 0.8rem; }
.cl-activity li:not(:last-child)::before { content: ''; position: absolute; left: 0.85rem; top: 1.9rem; bottom: 0.15rem; width: 2px; background: var(--border-light); }
.cl-act-icon { flex-shrink: 0; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; color: var(--hue, var(--accent-color));
    background: color-mix(in srgb, var(--hue, var(--accent-color)) 12%, var(--surface)); border: 1px solid var(--border-light); }
.cl-act-icon .icon { width: 13px; height: 13px; }
.cl-act-text { min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; padding-top: 0.2rem; font-size: 0.86rem; line-height: 1.4; overflow-wrap: anywhere; }
.cl-act-text small { font-size: 0.74rem; color: var(--text-muted); }
#cl-s-hint:empty { display: none; }
#cl-s-hint { display: block; margin: -0.35rem 0 0.9rem; color: var(--accent-color); }

/* Paste from a sheet */
.modal-content.cl-import-content { max-width: 760px; }
.cl-import-cols { margin: -0.25rem 0 0.85rem; padding-left: 1.1rem; font-size: 0.86rem; color: var(--text-secondary); line-height: 1.6; }
.cl-import-cols strong { color: var(--text-primary); }
.cl-import-text { min-height: 7.5rem; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.8rem; white-space: pre; overflow: auto; resize: vertical; }
.cl-import-preview:empty { display: none; }
.cl-import-preview { margin-top: 0.85rem; }
.cl-import-summary { margin: 0 0 0.5rem; font-size: 0.88rem; }
.cl-import-rows { list-style: none; margin: 0 0 0.85rem; padding: 0; max-height: min(300px, 38vh); overflow: auto; border: 1px solid var(--border-light); border-radius: var(--radius); }
.cl-import-row { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr) auto; align-items: center; gap: 0.65rem; padding: 0.45rem 0.7rem; border-bottom: 1px solid var(--border-light); }
.cl-import-row:last-child { border-bottom: none; }
.cl-import-row.is-error { background: color-mix(in srgb, var(--danger) 6%, transparent); }
.cl-import-kind { display: grid; place-items: center; color: var(--text-secondary); }
.cl-import-kind .icon { width: 15px; height: 15px; }
.cl-import-row.is-error .cl-import-kind { color: var(--danger); }
.cl-import-text-cell { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.cl-import-text-cell strong { font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-import-text-cell small { font-size: 0.77rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-import-row.is-error small { color: var(--danger); }
.cl-import-row .status-badge { font-size: 0.7rem; }

@container page (max-width: 699px) {
    .cl-toolbar #cl-view { flex: 1 1 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cl-toolbar #cl-view .view-btn { justify-content: center; }
    .cl-toolbar #cl-team, .cl-toolbar #cl-search { flex: 1 1 180px; }
    .cl-lock { flex: 1 1 100%; justify-content: space-between; margin-left: 0; }
}
@container page (max-width: 479px) {
    .cl-card-hero { padding: 1rem 1rem 0.9rem; }
    .cl-card-body { padding: 0.9rem 1rem 0.3rem; }
    .cl-card-foot { padding: 0.8rem 1rem 0.95rem; }
    .cl-field { gap: 0.55rem; }
    .cl-toolbar #cl-view .view-btn .icon { display: none; }
}
@media (max-width: 600px) {
    .claude-page .dashboard-header .header-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
    .claude-page .dashboard-header .header-actions > #cl-account-btn { grid-column: 1 / -1; grid-row: 1; justify-content: center; }
    .claude-page .dashboard-header .header-actions > .btn-secondary { justify-content: center; }
}

/* ------------------------------------------------------------------
   Sticky table headings on every page.
   A sticky <th> sticks to its nearest scrolling box. On desktop a table box
   whose table fits uses overflow: clip (not auto) so it isn't one: the
   headings then stick to the top of the window while a long table scrolls
   with the page. A table wider than its box (table_fit.js adds .table-wide)
   needs to scroll sideways, so it keeps its own scroll box and the headings
   stick at the top of that. The dashboard's list keeps its own scroll box
   (#list-view). On phones wide tables must scroll sideways, so long ones get
   their own scroll box too; tables shown as cards there have no headings.
   ------------------------------------------------------------------ */
@media (min-width: 901px) {
    .table-container:not(#list-view) { overflow: clip; max-height: none; }
    .table-container.table-wide:not(#list-view) { overflow: auto; max-height: calc(100vh - 140px); }
}
@media (max-width: 900px) {
    .page-panel .table-container, .share-page .table-container, .report-table-wrap, .amc-table-wrap, .account-table-wrap { max-height: 75vh; overflow: auto; }
}
@media (max-width: 700px) {
    .page-panel .table-container:has(> .delivery-table, > .clients-table, > .recycle-table, > .srv-table) { max-height: none; }
}

/* ==================================================================
   Motion. One set of timings for the whole app, quick enough for daily
   use: --ease-out for things arriving, --ease-in for things leaving.
   Everything here is switched off for "reduce motion" at the end.
   ================================================================== */
:root {
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
    interpolate-size: allow-keywords; /* lets "How to fix" sections slide to their natural height */
}

/* --- Page changes: motion.js (the page arriving piece by piece, leaving, the menu
   highlight gliding). It switches off the browser's own page transition and carries
   its own few styles. Without motion.js the open page's menu item just lights up: --- */
.sidebar-link.active { animation: kk-nav-in 380ms var(--ease-out) 100ms both; }
@keyframes kk-nav-in { from { background-color: transparent; box-shadow: inset 0 0 0 var(--accent-color); } }

/* Theme switch (a View Transition on the same page): the new colours spread out in a
   circle from the button pressed, over the old ones. */
::view-transition { background-color: var(--bg-color); }
html.vt-theme::view-transition-old(root) { animation: none; opacity: 1; }
html.vt-theme::view-transition-new(root) { animation: kk-theme-reveal 650ms cubic-bezier(0.65, 0, 0.35, 1) both; }
@keyframes kk-theme-reveal { from { clip-path: circle(0 at var(--theme-x, 50%) var(--theme-y, 50%)); } to { clip-path: circle(var(--theme-r, 150vmax) at var(--theme-x, 50%) var(--theme-y, 50%)); } }

/* --- Tabs: the underline grows in, the tab's content fades up. --- */
.tab-btn { position: relative; transition: color 0.2s, background-color 0.2s; }
.tab-btn::after {
    content: ""; position: absolute; left: 0.5rem; right: 0.5rem; bottom: -2px; height: 2px; border-radius: 2px;
    background: var(--accent-color); transform: scaleX(0); transition: transform 320ms var(--ease-out);
}
.tab-btn.active { border-bottom-color: transparent; }
.tab-btn.active::after { transform: scaleX(1); }
:is(.admin-tab, .account-tab, .tab-panel, .report-tab):not([hidden]) { animation: kk-fade-up 300ms var(--ease-out) both; }
/* Not for the tab a page opens on: that arrives with the page (a fade from nothing
   under the page transition looked like a blink). app_shell.js drops the class once
   the page is in - the opening tab's fade is long over by then, so it doesn't replay. */
html.kk-arriving :is(.admin-tab, .account-tab, .tab-panel, .report-tab):not([hidden]) { animation-duration: 0s; }
@keyframes kk-fade-up { from { opacity: 0; transform: translateY(8px); } }

/* --- Pop-up windows. The page modals animate in when they open; the
   <dialog> ones (confirm boxes, quick search) also animate out. --- */
.modal { animation: kk-fade 200ms ease-out both; }
.modal > .modal-content { animation: kk-pop 340ms var(--ease-spring) both; }
/* Closing: app_shell.js leaves a copy of the window fading out where it was. */
.modal.modal-leaving { display: flex; pointer-events: none; animation: kk-fade-out 200ms var(--ease-in) both; }
.modal.modal-leaving > .modal-content { animation: kk-pop-out 200ms var(--ease-in) both; }
@keyframes kk-fade-out { to { opacity: 0; } }
@keyframes kk-pop-out { to { opacity: 0; transform: translateY(10px) scale(0.97); } }
@media (max-width: 600px) {
    .modal > .modal-content { animation: kk-sheet-up 380ms var(--ease-out) both; }
    .modal.modal-leaving > .modal-content { animation: kk-sheet-down 220ms var(--ease-in) both; }
}
@keyframes kk-sheet-up { from { transform: translateY(100%); } }
@keyframes kk-sheet-down { to { transform: translateY(100%); } }
@keyframes kk-fade { from { opacity: 0; } }
@keyframes kk-pop { from { opacity: 0; transform: translateY(14px) scale(0.96); } }
.app-dialog, .qs-dialog {
    opacity: 0; transform: translateY(10px) scale(0.96);
    transition: opacity 200ms var(--ease-in), transform 200ms var(--ease-in), overlay 200ms allow-discrete, display 200ms allow-discrete;
}
.app-dialog[open], .qs-dialog[open] {
    opacity: 1; transform: none; animation: none;
    transition: opacity 260ms var(--ease-out), transform 340ms var(--ease-spring), overlay 200ms allow-discrete, display 200ms allow-discrete;
}
@starting-style { .app-dialog[open], .qs-dialog[open] { opacity: 0; transform: translateY(14px) scale(0.96); } }
.app-dialog::backdrop, .qs-dialog::backdrop { opacity: 0; transition: opacity 200ms, overlay 200ms allow-discrete, display 200ms allow-discrete; }
.app-dialog[open]::backdrop, .qs-dialog[open]::backdrop { opacity: 1; animation: none; }
@starting-style { .app-dialog[open]::backdrop, .qs-dialog[open]::backdrop { opacity: 0; } }

/* --- "How to fix" and other expandable sections slide open and shut. --- */
details::details-content { block-size: 0; overflow: clip; transition: block-size 300ms var(--ease-out), content-visibility 300ms allow-discrete; }
details[open]::details-content { block-size: auto; }
details > summary svg { transition: transform 240ms var(--ease-out); }

/* --- Buttons press in; toasts and notices keep their own motion. --- */
:is(.btn-primary, .btn-secondary, .btn-small, .sidebar-link, .tab-btn, .link-btn):active { transform: scale(0.97); transition-duration: 80ms; }
.sidebar-link { transition: background-color 0.2s, color 0.2s, transform 0.15s; }

/* ==================================================================
   Responsive: pieces shared by all pages
   ================================================================== */
/* Every page's main area is a size container ("page"), so its pieces follow the
   room they actually get (the sidebar takes some on wide screens, none on phones). */
.dashboard-container { container: page / inline-size; }

/* Tables that turn into cards when they don't fit (table_fit.js adds .is-stacked
   to a .table-stackable box). Each row is a card: the first cell is its title, the
   rest are "LABEL  value" lines; cards sit side by side when there's room. */
.table-container.is-stacked { overflow: visible !important; max-height: none !important; border: none; border-radius: 0; }
.is-stacked > table, .is-stacked > table > tbody, .is-stacked > table > tbody > tr, .is-stacked > table > tbody > tr > td { display: block; width: auto; min-width: 0 !important; }
.is-stacked > table > thead, .is-stacked > table > caption { display: none; }
.is-stacked > table > tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 0.6rem; align-items: start; }
.is-stacked > table > tbody > tr { padding: 0.5rem 0.85rem; border: 1px solid var(--border-light); border-radius: 10px; background: var(--input-bg); }
.is-stacked > table > tbody > tr:has(> td[colspan]) { grid-column: 1 / -1; }
.is-stacked > table > tbody > tr:hover > td { background: none; }
@media (hover: hover) { .is-stacked > table > tbody > tr:hover { background: linear-gradient(var(--hover-bg), var(--hover-bg)), var(--input-bg); } }
.is-stacked > table > tbody > tr > td {
    display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.2rem 0.75rem;
    padding: 0.4rem 0; border: none; border-bottom: 1px dashed var(--border-light);
    text-align: right; white-space: normal; overflow-wrap: anywhere; background: none !important; box-shadow: none !important;
}
.is-stacked > table > tbody > tr > td:last-child { border-bottom: none; }
.is-stacked > table > tbody > tr > td::before {
    content: attr(data-label); flex: 0 1 auto; max-width: 48%; text-align: left;
    font-size: 0.72rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary);
}
.is-stacked > table > tbody > tr > td:first-child { justify-content: flex-start; text-align: left; font-size: 0.98rem; font-weight: 600; border-bottom-style: solid; }
.is-stacked > table > tbody > tr > td:is(:first-child, [colspan], [data-label=""])::before { display: none; }
.is-stacked > table > tbody > tr > td[colspan] { display: block; text-align: left; border: none; }
.is-stacked .cost-form { min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
.is-stacked > table > tbody > tr > td > * { max-width: 100%; }
/* A table only a little too wide gets snugger cells (table_fit.js) before it would scroll. */
.table-container.is-snug > table > * > tr > :is(th, td) { padding-left: 0.5rem; padding-right: 0.5rem; overflow-wrap: anywhere; }
.table-container.is-snug > table > thead th { letter-spacing: 0.03em; }
.is-stacked .status-badge { white-space: normal; overflow-wrap: anywhere; text-align: right; }
/* Clients cards: a small fact sheet - the name across the top, then two facts per
   row, each label above its value (a value can be a few lines, e.g. "1 working" /
   "4 problems to fix"). */
.is-stacked > table.clients-table > tbody > tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; }
.is-stacked > table.clients-table > tbody > tr > td { display: block; text-align: left; padding: 0.6rem 0; border-bottom: none; border-top: 1px dashed var(--border-light); }
.is-stacked > table.clients-table > tbody > tr > td:nth-child(-n+3) { border-top: none; }
.is-stacked > table.clients-table > tbody > tr > td:is(:first-child, [colspan]) { grid-column: 1 / -1; }
.is-stacked > table.clients-table > tbody > tr > td:first-child { padding-bottom: 0.6rem; border-bottom: 1px solid var(--border-light); }
.is-stacked > table.clients-table > tbody > tr > td:not(:first-child)::before { display: block; max-width: none; margin-bottom: 0.2rem; line-height: 1.3; }
.is-stacked > table.clients-table > tbody > tr > td > small { display: block; line-height: 1.3; margin-top: 0.15rem; }
.is-stacked > table.clients-table > tbody > tr > td:first-child small { font-weight: 400; margin-top: 0.25rem; }

/* Segmented buttons ("3 months", "≤ 30 days (4)") keep each label on one line;
   the group wraps instead. */
.view-btn { white-space: nowrap; }
.button-row > :is(.btn-primary, .btn-secondary) { white-space: nowrap; }
.view-toggle { flex-wrap: wrap; max-width: 100%; }
/* Phones: when a group of buttons wraps, every row fills the width evenly. */
@media (max-width: 700px) {
    .segment-bar { flex-wrap: wrap; }
    :is(.view-toggle > .view-btn, .segment-bar > .segment-btn) { flex: 1 1 auto; justify-content: center; }
}
/* Phone-width pages: a group of four or more filter buttons (Clients, AMC...) is an
   even two-column grid instead of ragged rows; an odd last button spans the row. */
@container page (max-width: 599px) {
    .view-toggle:has(> .view-btn:nth-child(4)) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
    .view-toggle:has(> .view-btn:nth-child(4)) > .view-btn { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; min-width: 0; padding-inline: 0.65rem 0.5rem; text-align: left; }
    .view-toggle:has(> .view-btn:nth-child(4)) > .view-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* Tablet-width pages: the same group as an even grid sized by its count - 4 in a row,
   5 as 3 + 2, 6 as 3 + 3, 7 as 4 + 3, 8 as 4 + 4 - instead of a row with one left over. */
@container page (min-width: 600px) and (max-width: 899px) {
    .view-toggle:has(> .view-btn:nth-child(4)) { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
    .view-toggle:has(> .view-btn:nth-child(4)) > .view-btn { display: flex; align-items: center; justify-content: center; gap: 0.4rem; min-width: 0; padding-inline: 0.5rem; }
    .view-toggle:has(> .view-btn:nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .view-toggle:has(> .view-btn:nth-child(5):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .view-toggle:has(> .view-btn:nth-child(5):last-child) > .view-btn:nth-child(-n+3) { grid-column: span 2; }
    .view-toggle:has(> .view-btn:nth-child(5):last-child) > .view-btn:nth-child(n+4) { grid-column: span 3; }
    .view-toggle:has(> .view-btn:nth-child(7):last-child) { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .view-toggle:has(> .view-btn:nth-child(7):last-child) > .view-btn:nth-child(-n+4) { grid-column: span 3; }
    .view-toggle:has(> .view-btn:nth-child(7):last-child) > .view-btn:nth-child(n+5) { grid-column: span 4; }
}
/* Smallest phones (320px): a little less panel padding so "No contact yet 7" fits half a row. */
@container page (max-width: 379px) {
    .page-panel.glass-panel { padding-left: 0.9rem; padding-right: 0.9rem; }
    .view-toggle:has(> .view-btn:nth-child(4)) > .view-btn { gap: 0.3rem; padding-inline: 0.5rem 0.4rem; }
}

/* Tab strips that scroll sideways fade out at the edge that has more tabs, so
   it's clear there are more (driven by the strip's own scroll position). */
@property --fade-start { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --fade-end { syntax: '<length>'; inherits: false; initial-value: 0px; }
@keyframes kk-scroll-fade { from { --fade-start: 0px; --fade-end: 2.5rem; } 2% { --fade-start: 2rem; } 98% { --fade-end: 2.5rem; } to { --fade-start: 2rem; --fade-end: 0px; } }
.report-panel .tabs-header, .account-page .account-tabs {
    mask-image: linear-gradient(to right, transparent, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent);
    animation: kk-scroll-fade linear both;
    animation-timeline: scroll(self inline);
}
/* Phones: a page's tabs stay on one line and scroll sideways (instead of
   wrapping into several rows); app_shell.js keeps the open tab in sight. */
@media (max-width: 700px) {
    .page-panel .tabs-header {
        flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
        mask-image: linear-gradient(to right, transparent, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent);
        animation: kk-scroll-fade linear both;
        animation-timeline: scroll(self inline);
    }
    .page-panel .tabs-header::-webkit-scrollbar { display: none; }
    .page-panel .tab-btn { flex-shrink: 0; white-space: nowrap; }
}
/* Phone-width pages: the tabs (Reports, Admin, Account) as a two-column grid of
   buttons - every tab in sight, none cut at the edge - styled like the filter
   buttons, the open one raised; an odd last tab spans the row. */
@container page (max-width: 599px) {
    :is(.report-panel .tabs-header, .account-page .account-tabs, .page-panel .tabs-header) {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.2rem;
        padding: 0.2rem; overflow: visible; mask-image: none; animation: none;
        border: 1px solid var(--border-medium); border-radius: 10px; background: var(--surface-sunken);
    }
    :is(.report-panel .tabs-header, .account-page .account-tabs, .page-panel .tabs-header) > .tab-btn {
        min-width: 0; margin: 0; padding: 0.5rem 0.5rem; border: none; border-radius: 7px;
        text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.9rem;
    }
    :is(.report-panel .tabs-header, .account-page .account-tabs, .page-panel .tabs-header) > .tab-btn.active {
        background: var(--surface-raised); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border-medium);
    }
    :is(.report-panel .tabs-header, .account-page .account-tabs, .page-panel .tabs-header) > .tab-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* Tablet-width pages: the ten report tabs don't fit one row - five per row instead. */
@container page (min-width: 600px) and (max-width: 899px) {
    .report-panel .tabs-header {
        display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.2rem;
        padding: 0.2rem; overflow: visible; mask-image: none; animation: none;
        border: 1px solid var(--border-medium); border-radius: 10px; background: var(--surface-sunken);
    }
    .report-panel .tabs-header > .tab-btn { min-width: 0; margin: 0; padding: 0.5rem; border: none; border-radius: 7px; text-align: center; white-space: nowrap; }
    .report-panel .tabs-header > .tab-btn.active { background: var(--surface-raised); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border-medium); }
}

/* Summary cards: rows come out even - never a lone card on the last row. Laid out
   by how many cards there are: one row when they fit, else 2 per row (an odd last
   card spans the row), 3 and 6 go three per row, 5 go 3 + 2. Screens only: printed
   pages keep their own layout. */
@media screen {
    @container page (max-width: 899px) {
        .dashboard-container :is(.report-tiles, .cal-summary, .site-summary, .score-tiles) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        :is(.report-tiles, .cal-summary, .site-summary, .score-tiles) > :last-child:nth-child(odd) { grid-column: 1 / -1; }
    }
    /* Phone-width cards: the icon above the number, so every card's icon, number
       and label start at the same place and the label gets the card's full width. */
    @container page (max-width: 599px) {
        :is(.report-tile, .cal-summary-tile) { flex-direction: column; align-items: flex-start; gap: 0.55rem; }
        :is(.report-tile, .cal-summary-tile) > div { width: 100%; }
    }
    @container page (min-width: 600px) and (max-width: 899px) {
        :is(.report-tiles, .cal-summary, .site-summary, .score-tiles):is(:has(> :nth-child(3):last-child), :has(> :nth-child(6):last-child)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        :is(.report-tiles, .cal-summary, .site-summary, .score-tiles):is(:has(> :nth-child(3):last-child), :has(> :nth-child(6):last-child)) > :last-child { grid-column: auto; }
    }
    @container page (min-width: 600px) and (max-width: 999px) {
        :is(.report-tiles, .cal-summary, .site-summary, .score-tiles):has(> :nth-child(5):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
        :is(.report-tiles, .cal-summary, .site-summary, .score-tiles):has(> :nth-child(5):last-child) > :nth-child(-n+3) { grid-column: span 2; }
        :is(.report-tiles, .cal-summary, .site-summary, .score-tiles):has(> :nth-child(5):last-child) > :nth-child(n+4) { grid-column: span 3; }
    }
    @container page (min-width: 900px) {
        :is(.report-tiles, .cal-summary, .site-summary, .score-tiles):has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        :is(.report-tiles, .cal-summary, .site-summary, .score-tiles):is(:has(> :nth-child(4):last-child), :has(> :nth-child(8):last-child)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
        :is(.report-tiles, .cal-summary, .site-summary, .score-tiles):has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    }
    @container page (min-width: 600px) and (max-width: 999px) {
        /* Seven: 4 + 3. */
        :is(.report-tiles, .cal-summary, .site-summary, .score-tiles):has(> :nth-child(7):last-child) { grid-template-columns: repeat(12, minmax(0, 1fr)); }
        :is(.report-tiles, .cal-summary, .site-summary, .score-tiles):has(> :nth-child(7):last-child) > :nth-child(-n+4) { grid-column: span 3; }
        :is(.report-tiles, .cal-summary, .site-summary, .score-tiles):has(> :nth-child(7):last-child) > :nth-child(n+5) { grid-column: span 4; }
    }
    @container page (min-width: 1000px) {
        :is(.report-tiles, .cal-summary, .site-summary, .score-tiles):has(> :nth-child(5):last-child) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
        :is(.report-tiles, .cal-summary, .site-summary, .score-tiles):has(> :nth-child(7):last-child) { grid-template-columns: repeat(7, minmax(0, 1fr)); }
    }
    @container page (min-width: 1200px) {
        :is(.report-tiles, .cal-summary, .site-summary, .score-tiles):has(> :nth-child(6):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    }
}

@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
    *, *::before, *::after, ::backdrop { animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
    details::details-content { transition: none; }
}
