/* ==========================================================================
   SiteWatch — application styles
   Orange/neutral operational design system. Light + dark themes.

   1.  Design tokens
   2.  Base & typography
   3.  Application shell (sidebar, topbar, page header)
   4.  Buttons & controls
   5.  Forms
   6.  Panels, sections & cards
   7.  Tables & toolbars
   8.  Status, metrics & data display
   9.  Charts & timelines
   10. Lists (incidents, activity, delivery log)
   11. Feedback (empty, loading, toasts, modals, alerts, tooltips)
   12. Reports & print
   13. Auth & installer
   14. Responsive & motion
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations"), url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations"), url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root,
[data-bs-theme="light"] {
    /* Surfaces */
    --sw-bg: #F6F7F9;
    --sw-card: #FFFFFF;
    --sw-card-hover: #F9FAFB;
    --sw-sunken: #F3F4F6;
    --sw-hover: #EEF0F3;
    --sw-sidebar-bg: #F6F7F9;
    --sw-input-bg: #FFFFFF;

    /* Text */
    --sw-text: #111827;
    --sw-text-secondary: #475569;
    --sw-muted: #64748B;
    --sw-faint: #64748B;
    --sw-decor: #94A3B8;

    /* Lines */
    --sw-border: #E4E7EC;
    --sw-border-strong: #D0D5DD;

    /* Brand */
    --sw-primary: #EA580C;
    --sw-primary-text: #C2410C;
    --sw-primary-solid: #C2410C;
    --sw-primary-hover: #9A3412;
    --sw-primary-soft: #FFF7ED;
    --sw-primary-ring: rgba(234, 88, 12, .28);

    /* Operational colours */
    --sw-success: #15803D;
    --sw-success-solid: #16A34A;
    --sw-success-soft: #F0FDF4;
    --sw-warning: #B45309;
    --sw-warning-text: #B45309;
    --sw-warning-solid: #F59E0B;
    --sw-warning-soft: #FFFBEB;
    --sw-danger: #DC2626;
    --sw-danger-solid: #DC2626;
    --sw-danger-soft: #FEF2F2;
    --sw-info: #1D4ED8;
    --sw-info-soft: #EFF6FF;
    --sw-neutral: #64748B;
    --sw-neutral-solid: #94A3B8;
    --sw-neutral-soft: #F1F5F9;

    /* Effects */
    --sw-shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --sw-shadow: 0 4px 12px rgba(15, 23, 42, .08);
    --sw-shadow-lg: 0 12px 28px rgba(15, 23, 42, .12);
    --sw-skeleton: #E7ECF2;
    --sw-skeleton-shine: #F4F7FA;
    --sw-chart-grid: #E9EEF4;
    --sw-logo-word: #111827;
    --sw-sticky-shadow: 8px 0 8px -8px rgba(15, 23, 42, .16) inset;

    /* Geometry */
    --sw-radius-control: 8px;
    --sw-radius-panel: 10px;
    --sw-radius-sm: 6px;
    --sw-sidebar-w: 240px;
    --sw-sidebar-collapsed-w: 68px;
    --sw-topbar-h: 60px;

    /* Bootstrap bridge */
    --bs-body-bg: var(--sw-bg);
    --bs-body-color: var(--sw-text);
    --bs-border-color: var(--sw-border);
    --bs-primary: #C2410C;
    --bs-primary-rgb: 194, 65, 12;
    --bs-link-color: #C2410C;
    --bs-link-hover-color: #9A3412;
    --bs-secondary-color: var(--sw-muted);
    --bs-tertiary-bg: var(--sw-hover);
    --bs-emphasis-color: var(--sw-text);
    --bs-font-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

[data-bs-theme="dark"] {
    --sw-bg: #0F1113;
    --sw-card: #16191D;
    --sw-card-hover: #1B1F24;
    --sw-sunken: #13161A;
    --sw-hover: #1F2328;
    --sw-sidebar-bg: #0F1113;
    --sw-input-bg: #14171A;

    --sw-text: #F3F4F6;
    --sw-text-secondary: #A8B0BA;
    --sw-muted: #A8B0BA;
    --sw-faint: #8D97A3;
    --sw-decor: #6B7480;

    --sw-border: #252A30;
    --sw-border-strong: #353B43;

    --sw-primary: #FB923C;
    --sw-primary-text: #FB923C;
    --sw-primary-solid: #C2410C;
    --sw-primary-hover: #9A3412;
    --sw-primary-soft: #2A1A10;
    --sw-primary-ring: rgba(251, 146, 60, .34);

    --sw-success: #4ADE80;
    --sw-success-solid: #22C55E;
    --sw-success-soft: #12251A;
    --sw-warning: #FBBF24;
    --sw-warning-text: #FBBF24;
    --sw-warning-solid: #F59E0B;
    --sw-warning-soft: #2A2110;
    --sw-danger: #F87171;
    --sw-danger-solid: #EF4444;
    --sw-danger-soft: #2C1618;
    --sw-info: #93C5FD;
    --sw-info-soft: #16202E;
    --sw-neutral: #A8B0BA;
    --sw-neutral-solid: #6B7480;
    --sw-neutral-soft: #22262B;

    --sw-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --sw-shadow: 0 4px 14px rgba(0, 0, 0, .45);
    --sw-shadow-lg: 0 14px 34px rgba(0, 0, 0, .55);
    --sw-skeleton: #23272D;
    --sw-skeleton-shine: #2C3138;
    --sw-chart-grid: #262B31;
    --sw-logo-word: #F3F4F6;
    --sw-sticky-shadow: 8px 0 8px -8px rgba(0, 0, 0, .5) inset;

    --bs-primary: #C2410C;
    --bs-primary-rgb: 194, 65, 12;
    --bs-link-color: #FB923C;
    --bs-link-hover-color: #FDBA74;
}

/* --------------------------------------------------------------------------
   2. Base & typography
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

body.sw-body {
    background: var(--sw-bg);
    color: var(--sw-text);
    font-family: var(--bs-font-sans-serif);
    font-size: 14px;
    line-height: 1.5;
    font-feature-settings: "cv05" 1, "cv08" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { font-weight: 600; color: var(--sw-text); letter-spacing: -0.01em; }
h1 { font-size: 20px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }

a { color: var(--sw-primary-text); text-decoration: none; }
a:hover { color: var(--sw-primary-hover); text-decoration: underline; }
[data-bs-theme="dark"] a:hover { color: #FDBA74; }
a.text-reset:hover { color: var(--sw-text) !important; }

.text-muted { color: var(--sw-muted) !important; }
.text-faint { color: var(--sw-faint) !important; }
.text-success { color: var(--sw-success) !important; }
.text-danger { color: var(--sw-danger) !important; }
.text-warning { color: var(--sw-warning-text) !important; }
.text-primary { color: var(--sw-primary-text) !important; }
.text-info { color: var(--sw-info) !important; }
.text-body { color: var(--sw-text) !important; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fs-13 { font-size: 13px; }
.fs-12 { font-size: 12px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 12.5px;
}
.min-w-0 { min-width: 0; }
.w-min { width: 1%; white-space: nowrap; }
.break-anywhere { overflow-wrap: anywhere; word-break: break-word; }

/* Numeric data always uses tabular figures. */
.sw-table td,
.sw-table th,
.metric-value,
.stat-value,
.rt,
.http-code,
.sw-pagination,
.kv-list dd { font-variant-numeric: tabular-nums; }

.skip-link {
    position: fixed;
    left: 16px;
    top: -80px;
    z-index: 2000;
    background: var(--sw-primary-solid);
    color: #fff;
    padding: 10px 16px;
    border-radius: var(--sw-radius-control);
    font-weight: 600;
}
.skip-link:focus { top: 12px; color: #fff; text-decoration: none; }

:focus-visible { outline: 2px solid var(--sw-primary); outline-offset: 2px; }
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible { outline: 2px solid var(--sw-primary); outline-offset: 1px; }

/* --------------------------------------------------------------------------
   3. Application shell
   -------------------------------------------------------------------------- */
.sw-layout { display: flex; min-height: 100vh; }

.sw-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sw-sidebar-w);
    background: var(--sw-sidebar-bg);
    border-right: 1px solid var(--sw-border);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width .16s ease, transform .16s ease;
}
.sw-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sw-sidebar-w);
    display: flex;
    flex-direction: column;
    transition: margin-left .16s ease;
}
html.sidebar-collapsed .sw-sidebar { width: var(--sw-sidebar-collapsed-w); }
html.sidebar-collapsed .sw-main { margin-left: var(--sw-sidebar-collapsed-w); }

/* Brand */
.sw-brand {
    display: flex;
    align-items: center;
    height: var(--sw-topbar-h);
    padding: 0 16px;
    flex: 0 0 auto;
    border-bottom: 1px solid var(--sw-border);
    color: var(--sw-logo-word);
}
.sw-brand:hover { color: var(--sw-logo-word); text-decoration: none; }
.sw-logo { display: block; height: auto; max-width: 100%; }
.sw-logo-mark { display: block; }
.sw-brand .sw-logo-mark { margin: 0 auto; }
html.sidebar-collapsed .sw-brand { padding: 0 8px; justify-content: center; }
html.sidebar-collapsed .sw-brand .sw-logo { display: none; }
.sw-brand .sw-logo-mark { display: none; }
html.sidebar-collapsed .sw-brand .sw-logo-mark { display: block; }

/* Navigation */
.sw-nav { flex: 1 1 auto; overflow-y: auto; padding: 8px; min-height: 0; }
.sw-nav-group + .sw-nav-group { margin-top: 8px; }
.sw-nav-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--sw-faint);
    padding: 10px 10px 4px;
}
.sw-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--sw-radius-control);
    color: var(--sw-text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    background: none;
    border: 0;
    width: 100%;
    text-align: left;
    min-height: 36px;
}
.sw-nav-link:hover { background: var(--sw-hover); color: var(--sw-text); text-decoration: none; }
.sw-nav-link i { font-size: 17px; width: 18px; flex: 0 0 18px; text-align: center; color: var(--sw-decor); }
.sw-nav-link:hover i { color: var(--sw-text-secondary); }
.sw-nav-link.active { background: var(--sw-primary-soft); color: var(--sw-primary-text); font-weight: 600; }
.sw-nav-link.active i { color: var(--sw-primary); }
.sw-nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    bottom: 7px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--sw-primary);
}
.sw-nav-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-nav-count {
    margin-left: auto;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    border-radius: 9px;
    background: var(--sw-danger-soft);
    color: var(--sw-danger);
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}
.sw-nav-count:empty { display: none; }
html.sidebar-collapsed .sw-nav-label,
html.sidebar-collapsed .sw-nav-link span,
html.sidebar-collapsed .sw-nav-count,
html.sidebar-collapsed .sw-user-text { display: none; }
html.sidebar-collapsed .sw-nav-link { justify-content: center; padding: 8px 0; gap: 0; }
html.sidebar-collapsed .sw-nav-group + .sw-nav-group {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--sw-border);
}
html.sidebar-collapsed .sw-sidebar-footer { padding: 8px; }
html.sidebar-collapsed .sw-user { justify-content: center; }

/* Sidebar footer */
.sw-sidebar-footer { flex: 0 0 auto; border-top: 1px solid var(--sw-border); padding: 8px; }
.sw-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 6px 8px;
    border-radius: var(--sw-radius-control);
    color: var(--sw-text-secondary);
    width: 100%;
}
a.sw-user:hover { background: var(--sw-hover); color: var(--sw-text); text-decoration: none; }
.sw-avatar {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    background: var(--sw-primary-soft);
    color: var(--sw-primary-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .02em;
    border: 1px solid var(--sw-border);
}
.sw-avatar.lg { width: 52px; height: 52px; flex-basis: 52px; font-size: 18px; }
.sw-avatar.xl { width: 96px; height: 96px; flex-basis: 96px; font-size: 32px; }
.sw-avatar.has-img { overflow: hidden; padding: 0; background: var(--sw-card); }
.sw-avatar.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Profile picture + square crop */
.avatar-editor { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.avatar-editor .actions { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.avatar-editor .actions .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar-drop { outline: 2px dashed transparent; outline-offset: 6px; border-radius: 50%; transition: outline-color .15s; }
.avatar-drop.dragover { outline-color: var(--sw-primary); }
.crop-stage { position: relative; width: min(100%, 320px); aspect-ratio: 1; margin: 0 auto; overflow: hidden; border-radius: var(--sw-radius-panel); background: repeating-conic-gradient(var(--sw-border) 0% 25%, transparent 0% 50%) 50% / 16px 16px; touch-action: none; cursor: grab; user-select: none; }
.crop-stage:active { cursor: grabbing; }
.crop-stage:focus-visible { outline: 2px solid var(--sw-primary); outline-offset: 2px; }
.crop-stage img { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-stage .crop-frame { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 2px rgba(255,255,255,.9); }
.crop-stage .crop-frame::before, .crop-stage .crop-frame::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)), linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)); background-repeat: no-repeat; }
.crop-stage .crop-frame::before { background-size: 1px 100%, 1px 100%; background-position: 33.33% 0, 66.66% 0; }
.crop-stage .crop-frame::after { background-size: 100% 1px, 100% 1px; background-position: 0 33.33%, 0 66.66%; }
.crop-controls { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.crop-controls input[type=range] { flex: 1; }
.crop-previews { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.crop-previews canvas { border-radius: 50%; border: 1px solid var(--sw-border); background: var(--sw-card); }
.crop-previews canvas.sq { border-radius: 8px; }
.sw-user-text { min-width: 0; display: block; flex: 1; }
.sw-version { display: flex; align-items: center; gap: 6px; padding: 2px 8px 8px; font-size: 11.5px; color: var(--sw-muted); text-decoration: none; font-variant-numeric: tabular-nums; }
a.sw-version:hover { color: var(--sw-primary); }
html.sidebar-collapsed .sw-version span { display: none; }
html.sidebar-collapsed .sw-version { justify-content: center; padding: 2px 0 8px; }
.sw-user-text .n { display: block; font-size: 13px; font-weight: 600; color: var(--sw-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-user-text .e { display: block; font-size: 12px; color: var(--sw-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Topbar */
.sw-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 8px;
    height: var(--sw-topbar-h);
    padding: 0 16px;
    background: var(--sw-card);
    border-bottom: 1px solid var(--sw-border);
}
.sw-topbar-brand { display: none; }
.sw-topbar-spacer { flex: 1 1 auto; min-width: 8px; }
.sw-topbar-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Engine status chip — the single, compact home for normal monitoring health */
.sw-engine {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border: 1px solid var(--sw-border);
    border-radius: 999px;
    background: var(--sw-card);
    font-size: 12px;
    color: var(--sw-text-secondary);
    text-decoration: none;
    white-space: nowrap;
    min-height: 32px;
}
.sw-engine:hover { background: var(--sw-hover); color: var(--sw-text); text-decoration: none; border-color: var(--sw-border-strong); }
.sw-engine-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: var(--sw-neutral-solid);
}
.sw-engine.state-running .sw-engine-dot { background: var(--sw-success-solid); }
.sw-engine.state-problem .sw-engine-dot,
.sw-engine.state-stopped .sw-engine-dot,
.sw-engine.state-never .sw-engine-dot,
.sw-engine.state-unknown .sw-engine-dot { background: var(--sw-danger-solid); }
.sw-engine-text { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; }
.sw-engine-text .t { display: none; }
.sw-engine-text .s { font-weight: 600; color: var(--sw-text); }
.sw-engine-text .m { color: var(--sw-muted); font-variant-numeric: tabular-nums; }
.sw-engine.state-problem .s,
.sw-engine.state-stopped .s,
.sw-engine.state-never .s,
.sw-engine.state-unknown .s { color: var(--sw-danger); }

.refresh-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--sw-muted);
    white-space: nowrap;
}
.refresh-indicator .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sw-success-solid); }
.refresh-indicator.paused .dot { background: var(--sw-neutral-solid); }
.refresh-indicator.failed { color: var(--sw-danger); }
.refresh-indicator.failed .dot { background: var(--sw-danger-solid); }

/* Content & page header */
.sw-content { flex: 1; width: 100%; max-width: 1600px; margin: 0 auto; padding: 24px 28px 56px; min-width: 0; }
.sw-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.sw-page-head h1 { font-size: 20px; margin: 0; line-height: 1.3; letter-spacing: -0.015em; }
.sw-page-head .sw-page-context {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--sw-muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
}
.sw-page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Monitoring banner — reserved for stale, stopped or degraded monitoring */
.monitor-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--sw-danger-solid) 32%, var(--sw-border));
    background: var(--sw-danger-soft);
    border-radius: var(--sw-radius-panel);
    margin-bottom: 20px;
    color: var(--sw-danger);
}
.monitor-banner[hidden] { display: none; }
.monitor-banner > i { font-size: 18px; line-height: 1.3; flex: 0 0 auto; }
.monitor-banner > div { flex: 1 1 220px; min-width: 0; }
.monitor-banner strong { display: block; font-size: 13px; }
.monitor-banner span { display: block; font-size: 12.5px; color: var(--sw-text-secondary); margin-top: 2px; }
.monitor-banner a { color: inherit; font-weight: 600; font-size: 12.5px; white-space: nowrap; align-self: center; }
.monitor-banner.state-stopped,
.monitor-banner.state-never {
    border-color: color-mix(in srgb, var(--sw-warning-solid) 38%, var(--sw-border));
    background: var(--sw-warning-soft);
    color: var(--sw-warning-text);
}

.sw-backdrop { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 1035; }

/* --------------------------------------------------------------------------
   4. Buttons & controls
   -------------------------------------------------------------------------- */
.btn {
    --bs-btn-focus-box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: var(--sw-radius-control);
    font-size: 13.5px;
    font-weight: 600;
    padding: 7px 12px;
    min-height: 36px;
    border: 1px solid transparent;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
    white-space: nowrap;
}
.btn i { font-size: 16px; line-height: 1; }
.btn-sm { padding: 5px 10px; min-height: 32px; font-size: 13px; border-radius: var(--sw-radius-sm); }
.btn-sm i { font-size: 15px; }
.btn-lg { padding: 10px 18px; min-height: 44px; font-size: 14.5px; }

/* Primary — reserved for the main action on a screen */
.btn-primary {
    background: var(--sw-primary-solid);
    border-color: var(--sw-primary-solid);
    color: #fff;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active { background: var(--sw-primary-hover); border-color: var(--sw-primary-hover); color: #fff; }
.btn-primary:disabled,
.btn-primary.disabled { background: var(--sw-primary-solid); border-color: var(--sw-primary-solid); color: #fff; opacity: .55; }

/* Secondary — bordered neutral */
.btn-light,
.btn-outline-secondary,
.btn-secondary {
    background: var(--sw-card);
    border-color: var(--sw-border-strong);
    color: var(--sw-text-secondary);
}
.btn-light:hover,
.btn-outline-secondary:hover,
.btn-secondary:hover,
.btn-light:focus,
.btn-outline-secondary:focus { background: var(--sw-hover); border-color: var(--sw-border-strong); color: var(--sw-text); }
.btn-light:disabled,
.btn-outline-secondary:disabled { opacity: .55; }

/* Tertiary — quiet */
.btn-ghost { background: transparent; border-color: transparent; color: var(--sw-muted); }
.btn-ghost:hover { background: var(--sw-hover); color: var(--sw-text); }

/* Destructive */
.btn-danger { background: var(--sw-danger-solid); border-color: var(--sw-danger-solid); color: #fff; }
.btn-danger:hover, .btn-danger:focus { background: #B91C1C; border-color: #B91C1C; color: #fff; }
[data-bs-theme="dark"] .btn-danger { background: #B91C1C; border-color: #B91C1C; }
[data-bs-theme="dark"] .btn-danger:hover { background: #991B1B; border-color: #991B1B; }
.btn-outline-danger { background: var(--sw-card); border-color: color-mix(in srgb, var(--sw-danger-solid) 45%, var(--sw-border)); color: var(--sw-danger); }
.btn-outline-danger:hover { background: var(--sw-danger-solid); border-color: var(--sw-danger-solid); color: #fff; }
.btn-success { background: var(--sw-success-solid); border-color: var(--sw-success-solid); color: #fff; }

.btn .spinner-border { width: 14px; height: 14px; border-width: 2px; }
.btn.is-loading { pointer-events: none; opacity: .8; }

/* Icon buttons */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--sw-radius-control);
    border: 1px solid transparent;
    background: transparent;
    color: var(--sw-muted);
    font-size: 17px;
    flex: 0 0 auto;
}
.btn-icon:hover { background: var(--sw-hover); color: var(--sw-text); }
.btn-icon.bordered { border-color: var(--sw-border-strong); background: var(--sw-card); }
.btn-icon.btn-sm { width: 32px; height: 32px; font-size: 15px; border-radius: var(--sw-radius-sm); }

/* Segmented control */
.segmented {
    display: inline-flex;
    background: var(--sw-sunken);
    border: 1px solid var(--sw-border);
    padding: 2px;
    border-radius: var(--sw-radius-control);
    gap: 2px;
}
.segmented button {
    border: 0;
    background: transparent;
    color: var(--sw-muted);
    font-size: 12.5px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: var(--sw-radius-sm);
    cursor: pointer;
    min-height: 28px;
    white-space: nowrap;
}
.segmented button:hover:not(.active) { color: var(--sw-text); }
.segmented button.active { background: var(--sw-card); color: var(--sw-text); box-shadow: var(--sw-shadow-sm); }

/* Dropdowns */
.dropdown-menu {
    border-radius: var(--sw-radius-panel);
    border: 1px solid var(--sw-border);
    box-shadow: var(--sw-shadow-lg);
    padding: 6px;
    background: var(--sw-card);
    font-size: 13.5px;
    min-width: 200px;
}
.dropdown-item {
    border-radius: var(--sw-radius-sm);
    padding: 8px 10px;
    color: var(--sw-text);
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
}
.dropdown-item i { color: var(--sw-muted); width: 16px; text-align: center; font-size: 16px; }
.dropdown-item:hover,
.dropdown-item:focus { background: var(--sw-hover); color: var(--sw-text); text-decoration: none; }
.dropdown-item.text-danger:hover { background: var(--sw-danger-soft); }
.dropdown-item.text-danger i { color: var(--sw-danger); }
.dropdown-divider { border-color: var(--sw-border); margin: 4px 0; }
.dropdown-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--sw-faint);
    padding: 6px 10px 4px;
    font-weight: 600;
}

/* Tabs */
.nav-tabs { border-bottom: 1px solid var(--sw-border); gap: 2px; }
.nav-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--sw-muted);
    font-weight: 600;
    font-size: 13.5px;
    padding: 10px 12px;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: transparent;
}
.nav-tabs .nav-link:hover { color: var(--sw-text); border-bottom-color: var(--sw-border-strong); }
.nav-tabs .nav-link.active { color: var(--sw-primary-text); border-bottom-color: var(--sw-primary); background: transparent; }

/* --------------------------------------------------------------------------
   5. Forms
   -------------------------------------------------------------------------- */
.form-control,
.form-select {
    background: var(--sw-input-bg);
    border: 1px solid var(--sw-border-strong);
    border-radius: var(--sw-radius-control);
    color: var(--sw-text);
    font-size: 13.5px;
    padding: 7px 11px;
    min-height: 36px;
    box-shadow: none;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--sw-primary);
    box-shadow: 0 0 0 3px var(--sw-primary-ring);
    background: var(--sw-input-bg);
    color: var(--sw-text);
}
.form-control::placeholder { color: var(--sw-faint); opacity: 1; }
.form-control-sm,
.form-select-sm { padding: 5px 9px; min-height: 32px; font-size: 13px; border-radius: var(--sw-radius-sm); }
.form-control[type="file"] { padding: 6px 11px; }
.form-control:disabled,
.form-select:disabled { background: var(--sw-sunken); color: var(--sw-muted); }
textarea.form-control { min-height: 72px; line-height: 1.55; }

.form-label { font-size: 13px; font-weight: 600; color: var(--sw-text-secondary); margin-bottom: 5px; }
.form-text { font-size: 12.5px; color: var(--sw-muted); margin-top: 5px; }
.form-text .code-inline { font-size: 12px; }
.required-mark { color: var(--sw-danger); }

.form-check-input {
    border-color: var(--sw-border-strong);
    background-color: var(--sw-input-bg);
    width: 16px;
    height: 16px;
    margin-top: 3px;
}
.form-check-input:checked { background-color: var(--sw-primary-solid); border-color: var(--sw-primary-solid); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--sw-primary-ring); border-color: var(--sw-primary); }
.form-check-label { font-size: 13.5px; color: var(--sw-text); }
.form-switch .form-check-input { width: 34px; height: 19px; margin-top: 1px; }
.form-switch .form-check-input:not(:checked) { background-color: var(--sw-border-strong); border-color: var(--sw-border-strong); }

.input-group-text {
    background: var(--sw-sunken);
    border-color: var(--sw-border-strong);
    color: var(--sw-muted);
    font-size: 13px;
    border-radius: var(--sw-radius-control);
}
.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > :not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }

.invalid-feedback { font-size: 12.5px; color: var(--sw-danger); }
.form-control.is-invalid,
.form-select.is-invalid,
.was-validated .form-control:invalid { border-color: var(--sw-danger); background-image: none; }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--sw-danger-solid) 25%, transparent); }

/* Neutral checkbox rows — replaces large selected tiles */
.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.option-list { display: flex; flex-direction: column; }
.option-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 2px;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--sw-border);
    border-radius: 0;
    cursor: pointer;
    margin: 0;
}
.option-card:last-child { border-bottom: 0; }
.option-card:hover .t { color: var(--sw-primary-text); }
.option-card input { margin-top: 2px; flex: 0 0 auto; }
.option-card .t { display: block; font-weight: 600; font-size: 13.5px; color: var(--sw-text); }
.option-card .d { display: block; font-size: 12.5px; color: var(--sw-muted); margin-top: 1px; }

/* Progressive disclosure */
.sw-disclosure { border: 1px solid var(--sw-border); border-radius: var(--sw-radius-panel); background: var(--sw-card); }
.sw-disclosure > summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
    color: var(--sw-text);
    border-radius: var(--sw-radius-panel);
}
.sw-disclosure > summary::-webkit-details-marker { display: none; }
.sw-disclosure > summary::after {
    content: "\F282";
    font-family: bootstrap-icons;
    margin-left: auto;
    font-size: 13px;
    color: var(--sw-muted);
    transition: transform .15s ease;
}
.sw-disclosure[open] > summary::after { transform: rotate(180deg); }
.sw-disclosure > summary:hover { background: var(--sw-hover); }
.sw-disclosure > summary .hint { font-weight: 400; font-size: 12.5px; color: var(--sw-muted); }
.sw-disclosure .sw-disclosure-body { padding: 4px 16px 16px; border-top: 1px solid var(--sw-border); padding-top: 16px; }

/* --------------------------------------------------------------------------
   6. Panels, sections & cards
   -------------------------------------------------------------------------- */
.sw-card {
    background: var(--sw-card);
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius-panel);
}
.sw-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--sw-border);
    flex-wrap: wrap;
}
.sw-card-header > *:not(:only-child):last-child { margin-left: auto; }
.sw-card-header h3 { font-size: 15px; margin: 0; display: flex; align-items: center; gap: 8px; }
.sw-card-header .sub { font-size: 12.5px; color: var(--sw-muted); margin: 2px 0 0; }
.sw-card-body { padding: 16px; }
.sw-card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--sw-border);
    font-size: 13px;
    color: var(--sw-muted);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Lightweight grouping without a card */
.sw-section { margin-bottom: 24px; }
.sw-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--sw-border);
}
.sw-section-head h2 { font-size: 16px; margin: 0; }
.sw-section-head .sub { font-size: 12.5px; color: var(--sw-muted); margin: 0; }
.sw-section-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.sw-fieldset { border: 0; padding: 0; margin: 0 0 24px; }
.sw-fieldset > legend {
    float: none;
    width: auto;
    font-size: 15px;
    font-weight: 600;
    color: var(--sw-text);
    margin-bottom: 2px;
    padding: 0;
}
.sw-fieldset > .desc { font-size: 12.5px; color: var(--sw-muted); margin: 0 0 12px; }

.divider { border-top: 1px solid var(--sw-border); margin: 16px 0; }
.kv-list { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 20px; font-size: 13.5px; margin: 0; }
.kv-list dt { color: var(--sw-muted); font-weight: 500; }
.kv-list dd { margin: 0; overflow-wrap: anywhere; color: var(--sw-text); }
.copy-box {
    background: var(--sw-sunken);
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius-control);
    padding: 10px 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    overflow-x: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--sw-text-secondary);
    max-width: 100%;
}
.code-inline {
    background: var(--sw-sunken);
    border: 1px solid var(--sw-border);
    border-radius: 4px;
    padding: 1px 5px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--sw-text-secondary);
    overflow-wrap: anywhere;
}
.progress { background: var(--sw-sunken); border-radius: 999px; height: 6px; }
.progress-bar { background: var(--sw-primary-solid); }

/* --------------------------------------------------------------------------
   7. Tables & toolbars
   -------------------------------------------------------------------------- */
.sw-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}
.sw-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
    color: var(--sw-text);
}
.sw-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--sw-sunken);
    color: var(--sw-muted);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 9px 12px;
    border-bottom: 1px solid var(--sw-border);
    white-space: nowrap;
    text-align: left;
}
.sw-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--sw-border);
    vertical-align: middle;
}
.sw-table tbody tr:last-child td { border-bottom: 0; }
.sw-table tbody tr:hover { background: var(--sw-card-hover); }
.sw-table tbody tr.selected { background: var(--sw-primary-soft); }
.sw-table.compact tbody td { padding: 8px 12px; }
.sw-table.compact thead th { padding: 8px 12px; }
.sw-table th.num,
.sw-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.sw-table th.sortable { cursor: pointer; user-select: none; }
.sw-table th.sortable:hover { color: var(--sw-text); }
.sw-table th.sortable i { font-size: 11px; margin-left: 4px; opacity: .55; }
.sw-table th.sorted { color: var(--sw-text); }
.sw-table th.sorted i { opacity: 1; color: var(--sw-primary); }
.sw-table .form-check-input { margin: 0; cursor: pointer; vertical-align: middle; }

/* Right-hand actions stay reachable while the table scrolls horizontally */
.sw-table th.actions,
.sw-table td.actions {
    position: sticky;
    right: 0;
    z-index: 1;
    text-align: right;
    white-space: nowrap;
    background: var(--sw-card);
    border-left: 1px solid var(--sw-border);
}
.sw-table thead th.actions { background: var(--sw-sunken); z-index: 3; }
.sw-table tbody tr:hover td.actions { background: var(--sw-card-hover); }
.sw-table tbody tr.selected td.actions { background: var(--sw-primary-soft); }
/* The cell with an open menu sits above neighbouring sticky cells (and the sticky header). */
.sw-table td.actions.menu-open,
.sw-table td.actions:has(.dropdown-menu.show) { z-index: 6; }
.sw-table td.actions .row-actions { display: inline-flex; gap: 4px; align-items: center; justify-content: flex-end; }

/* Website identity cell */
.site-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.site-cell .site-text { min-width: 0; }
.site-name {
    display: block;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--sw-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}
.site-name:hover { color: var(--sw-primary-text); text-decoration: underline; }
.site-domain {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--sw-muted);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.site-domain:hover { color: var(--sw-primary-text); }
.client-name {
    display: block;
    font-size: 13px;
    color: var(--sw-text-secondary);
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sw-favicon,
.sw-favicon-fallback {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: var(--sw-radius-sm);
    background: var(--sw-sunken);
    border: 1px solid var(--sw-border);
    object-fit: contain;
    padding: 3px;
}
.sw-favicon-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sw-decor);
    font-size: 12px;
    padding: 0;
}
.sw-favicon.lg,
.sw-favicon-fallback.lg { width: 40px; height: 40px; flex-basis: 40px; border-radius: var(--sw-radius-control); font-size: 18px; padding: 5px; }
.sw-favicon-fallback.lg { padding: 0; }

/* Toolbar */
.sw-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-bottom: 1px solid var(--sw-border);
    background: var(--sw-card);
}
/* Search field with a leading icon. The component styles itself wherever it is used — a toolbar, a card
   header or the domain lookup form — and each container only sets how wide it should be. */
.search { position: relative; }
.search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sw-decor);
    pointer-events: none;
    font-size: 14px;
}
.search input { padding-left: 30px; width: 100%; }

.sw-toolbar .search { flex: 1 1 220px; max-width: 320px; min-width: 180px; }
.sw-card-header .search { flex: 0 1 260px; min-width: 170px; }
.sw-toolbar .spacer { flex: 1 1 auto; }
.sw-toolbar .toolbar-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sw-toolbar .toolbar-sep { width: 1px; align-self: stretch; background: var(--sw-border); margin: 0 2px; }
.sw-toolbar label.inline-label { font-size: 12.5px; color: var(--sw-muted); white-space: nowrap; }
.sw-toolbar .form-select { width: auto; min-width: 132px; max-width: 220px; }
.sw-toolbar .date-range { display: inline-flex; align-items: center; gap: 6px; }
.sw-toolbar .date-range .form-control { width: auto; min-width: 130px; }

/* Applied filters */
.filter-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 16px;
    border-bottom: 1px solid var(--sw-border);
    background: var(--sw-sunken);
    font-size: 12.5px;
    color: var(--sw-muted);
}
.filter-summary[hidden] { display: none; }
.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px 3px 9px;
    border-radius: var(--sw-radius-sm);
    border: 1px solid var(--sw-border-strong);
    background: var(--sw-card);
    color: var(--sw-text-secondary);
    font-size: 12.5px;
    max-width: 260px;
}
.filter-tag b { color: var(--sw-text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-tag button {
    border: 0;
    background: none;
    color: var(--sw-muted);
    padding: 0;
    line-height: 1;
    display: inline-flex;
    font-size: 13px;
    cursor: pointer;
}
.filter-tag button:hover { color: var(--sw-danger); }

/* Legacy chip filters (kept for compatibility) */
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip {
    border: 1px solid var(--sw-border-strong);
    background: var(--sw-card);
    color: var(--sw-text-secondary);
    border-radius: var(--sw-radius-sm);
    padding: 4px 9px;
    font-size: 12.5px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.filter-chip.active { background: var(--sw-primary-soft); border-color: var(--sw-primary); color: var(--sw-primary-text); }
.filter-chip .c { font-size: 11px; color: var(--sw-muted); font-variant-numeric: tabular-nums; }

/* Bulk actions */
.bulk-bar {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--sw-primary-soft);
    border-bottom: 1px solid var(--sw-border);
    flex-wrap: wrap;
    font-size: 13px;
}
.bulk-bar.show { display: flex; }
.bulk-bar .count { font-weight: 600; color: var(--sw-primary-text); }
.site-name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.site-name-row .site-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plugin-badge { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex: 0 0 18px; border-radius: 5px; font-size: 11px; cursor: help; }
.plugin-badge.tone-success { background: var(--sw-success-soft); color: var(--sw-success); }
.plugin-badge.tone-warning { background: var(--sw-warning-soft); color: var(--sw-warning-text); }
.plugin-badge.tone-muted { background: var(--sw-border); color: var(--sw-muted); }
.bulk-bar [data-select-matching] { font-size: 13px; font-weight: 600; text-decoration: underline; }

/* Bulk check progress */
.check-progress { padding: 12px 16px; border-bottom: 1px solid var(--sw-border); background: var(--sw-card); font-size: 13px; }
.check-progress .cp-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.check-progress .cp-head > .bi { font-size: 18px; }
.check-progress .cp-title { display: flex; flex-direction: column; min-width: 0; flex: 1 1 240px; }
.check-progress .cp-meta { font-size: 12px; color: var(--sw-muted); font-variant-numeric: tabular-nums; }
.check-progress .cp-stats { display: flex; gap: 14px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.check-progress .cp-bar { height: 6px; margin-top: 10px; background: var(--sw-border); }
.check-progress .cp-bar .progress-bar { background: var(--sw-primary); transition: width .4s ease; }
.check-progress .cp-log { list-style: none; margin: 10px 0 0; padding: 0; max-height: 132px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; }
.check-progress .cp-log li { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; }
.check-progress .cp-log .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.check-progress .cp-log .d { color: var(--sw-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (prefers-reduced-motion: reduce) { .check-progress .cp-bar .progress-bar { transition: none; } }

/* Pagination */
.sw-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-top: 1px solid var(--sw-border);
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--sw-muted);
}
.sw-pagination:empty { display: none; }
.sw-pagination .pages { display: flex; gap: 4px; flex-wrap: wrap; }
.sw-pagination .pages button {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: var(--sw-radius-sm);
    border: 1px solid var(--sw-border-strong);
    background: var(--sw-card);
    color: var(--sw-text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}
.sw-pagination .pages button:disabled { opacity: .45; cursor: default; }
.sw-pagination .pages button.active { background: var(--sw-primary-solid); border-color: var(--sw-primary-solid); color: #fff; }
.sw-pagination .pages button:not(:disabled):not(.active):hover { background: var(--sw-hover); }

/* --------------------------------------------------------------------------
   8. Status, metrics & data display
   -------------------------------------------------------------------------- */
.sw-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: var(--sw-radius-sm);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid transparent;
    white-space: nowrap;
}
.sw-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 6px; }
.sw-badge.no-dot::before { display: none; }
.sw-badge.sev-ok { background: var(--sw-success-soft); color: var(--sw-success); border-color: color-mix(in srgb, var(--sw-success-solid) 22%, transparent); }
.sw-badge.sev-warning { background: var(--sw-warning-soft); color: var(--sw-warning-text); border-color: color-mix(in srgb, var(--sw-warning-solid) 30%, transparent); }
.sw-badge.sev-down { background: var(--sw-danger-soft); color: var(--sw-danger); border-color: color-mix(in srgb, var(--sw-danger-solid) 25%, transparent); }
.sw-badge.sev-neutral { background: var(--sw-neutral-soft); color: var(--sw-muted); border-color: var(--sw-border); }
.sw-badge.sev-info { background: var(--sw-info-soft); color: var(--sw-info); border-color: color-mix(in srgb, var(--sw-info) 22%, transparent); }
.sw-badge.sev-primary { background: var(--sw-primary-soft); color: var(--sw-primary-text); border-color: color-mix(in srgb, var(--sw-primary) 25%, transparent); }
.sw-badge.lg { font-size: 12.5px; padding: 4px 10px; }

.sw-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: var(--sw-radius-sm);
    font-size: 12px;
    font-weight: 600;
    background: var(--sw-neutral-soft);
    color: var(--sw-muted);
    border: 1px solid var(--sw-border);
    white-space: nowrap;
}
.sw-pill i { font-size: 13px; }
.sw-pill.tone-success { background: var(--sw-success-soft); color: var(--sw-success); border-color: color-mix(in srgb, var(--sw-success-solid) 22%, transparent); }
.sw-pill.tone-warning { background: var(--sw-warning-soft); color: var(--sw-warning-text); border-color: color-mix(in srgb, var(--sw-warning-solid) 30%, transparent); }
.sw-pill.tone-danger { background: var(--sw-danger-soft); color: var(--sw-danger); border-color: color-mix(in srgb, var(--sw-danger-solid) 25%, transparent); }
.sw-pill.tone-info { background: var(--sw-info-soft); color: var(--sw-info); border-color: color-mix(in srgb, var(--sw-info) 22%, transparent); }
.sw-pill.tone-primary { background: var(--sw-primary-soft); color: var(--sw-primary-text); border-color: color-mix(in srgb, var(--sw-primary) 25%, transparent); }
.sw-pill.tone-neutral,
.sw-pill.tone-muted { background: var(--sw-neutral-soft); color: var(--sw-muted); border-color: var(--sw-border); }
.sw-pill.quiet { background: transparent; border-color: transparent; padding-left: 0; padding-right: 0; }

/* Routine values stay neutral; exceptions get emphasis. */
.http-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--sw-text-secondary);
}
.http-code.ok { color: var(--sw-text-secondary); }
.http-code.warn { color: var(--sw-warning-text); }
.http-code.bad { color: var(--sw-danger); }

.rt { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--sw-text); }
.rt.fast { color: var(--sw-text); }
.rt.moderate { color: var(--sw-text); }
.rt.slow { color: var(--sw-warning-text); }
.rt.critical { color: var(--sw-danger); }

/* Compact portfolio summary */
.metric-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 0;
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius-panel);
    background: var(--sw-card);
    overflow: hidden;
    margin-bottom: 20px;
}
.metric-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px;
    border-right: 1px solid var(--sw-border);
    background: var(--sw-card);
    text-align: left;
    color: inherit;
    border-top: 0;
    border-bottom: 0;
    border-left: 0;
    min-width: 0;
}
.metric-item:last-child { border-right: 0; }
button.metric-item { cursor: pointer; }
button.metric-item:hover { background: var(--sw-hover); }
button.metric-item[aria-pressed="true"] { background: var(--sw-primary-soft); box-shadow: inset 0 -2px 0 var(--sw-primary); }
.metric-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--sw-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.metric-label .marker { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 8px; background: var(--sw-neutral-solid); }
.metric-label .marker.ok { background: var(--sw-success-solid); }
.metric-label .marker.warn { background: var(--sw-warning-solid); }
.metric-label .marker.down { background: var(--sw-danger-solid); }
.metric-label .marker.brand { background: var(--sw-primary); }
.metric-value {
    font-size: 22px;
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--sw-text);
    font-variant-numeric: tabular-nums;
}
.metric-item.tone-danger .metric-value { color: var(--sw-danger); }
.metric-item.tone-warning .metric-value { color: var(--sw-warning-text); }
.metric-item.tone-success .metric-value { color: var(--sw-success); }
.metric-item.is-zero .metric-value { color: var(--sw-text); }
.metric-sub { font-size: 12px; color: var(--sw-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Grouped statistics (website details, reports) */
.stat-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.stat-group {
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius-panel);
    background: var(--sw-card);
    padding: 14px 16px;
    min-width: 0;
}
.stat-group > h3 {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--sw-muted);
    margin: 0 0 10px;
}
.stat-rows { display: flex; flex-direction: column; gap: 8px; }
.stat-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}
.stat-row .l { font-size: 13px; color: var(--sw-text-secondary); white-space: nowrap; }
.stat-row .v { font-size: 15px; font-weight: 600; color: var(--sw-text); font-variant-numeric: tabular-nums; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.stat-row .v.lead { font-size: 20px; letter-spacing: -0.02em; }
.stat-note { font-size: 12px; color: var(--sw-muted); margin-top: 8px; }

/* Summary strip for reports */
.summary-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius-panel);
    background: var(--sw-card);
    overflow: hidden;
}
.summary-item { padding: 12px 16px; border-right: 1px solid var(--sw-border); min-width: 0; }
.summary-item:last-child { border-right: 0; }
.summary-item .l { font-size: 12px; color: var(--sw-muted); font-weight: 600; white-space: nowrap; }
.summary-item .v {
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--sw-text);
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}
.summary-item .s {
    font-size: 12px;
    color: var(--sw-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 18px;
}

/* Simple key figures used inside panels */
.overview-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.overview-item { padding: 10px 12px; border: 1px solid var(--sw-border); border-radius: var(--sw-radius-control); background: var(--sw-card); min-width: 0; }
.overview-item .l { font-size: 12px; color: var(--sw-muted); }
.overview-item .v { font-size: 18px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* Health distribution */
.health-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--sw-neutral-soft); }
.health-bar span { display: block; height: 100%; }
.health-bar .h-ok { background: var(--sw-success-solid); }
.health-bar .h-warn { background: var(--sw-warning-solid); }
.health-bar .h-down { background: var(--sw-danger-solid); }
.health-bar .h-paused { background: var(--sw-neutral-solid); }
.health-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; }
.health-legend .item { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--sw-text-secondary); }
.health-legend .item b { color: var(--sw-text); font-size: 14px; font-variant-numeric: tabular-nums; }
.health-legend .dot,
.legend-dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex: 0 0 9px; }
.dot-ok { background: var(--sw-success-solid); }
.dot-warn { background: var(--sw-warning-solid); }
.dot-down { background: var(--sw-danger-solid); }
.dot-paused { background: var(--sw-neutral-solid); }

/* --------------------------------------------------------------------------
   9. Charts & timelines
   -------------------------------------------------------------------------- */
.chart-box { position: relative; width: 100%; }
.chart-box canvas { max-width: 100%; }
.chart-note { font-size: 12px; color: var(--sw-muted); margin: 0 0 12px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--sw-text-secondary); margin-top: 12px; }
.chart-legend .item { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend .swatch { width: 14px; height: 3px; border-radius: 2px; background: var(--sw-primary); flex: 0 0 14px; }
.chart-legend .swatch.dashed { background: repeating-linear-gradient(90deg, var(--sw-warning-solid) 0 4px, transparent 4px 7px); }

.timeline-bar { display: flex; gap: 2px; height: 30px; align-items: stretch; }
.timeline-bar .seg { flex: 1 1 0; border-radius: 2px; background: var(--sw-neutral-soft); min-width: 2px; }
.timeline-bar .seg.ok { background: var(--sw-success-solid); }
.timeline-bar .seg.warning { background: var(--sw-warning-solid); }
.timeline-bar .seg.down { background: var(--sw-danger-solid); }
.timeline-bar .seg.neutral { background: var(--sw-neutral-soft); border: 1px dashed var(--sw-border-strong); }
.timeline-labels { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--sw-muted); margin-top: 6px; gap: 8px; }
.sparkline { width: 100px; height: 26px; color: var(--sw-primary); }

/* --------------------------------------------------------------------------
   10. Lists (incidents, activity, delivery log)
   -------------------------------------------------------------------------- */
.incident-row {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--sw-border);
    align-items: flex-start;
}
.incident-row:last-child { border-bottom: 0; }
.incident-row .marker { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: 0 0 8px; background: var(--sw-success-solid); }
.incident-row.open .marker { background: var(--sw-danger-solid); }
.incident-row .body { min-width: 0; flex: 1; }
.incident-row .title { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.incident-row .meta { font-size: 12.5px; color: var(--sw-muted); margin-top: 2px; }
.incident-row .msg { font-size: 12.5px; color: var(--sw-text-secondary); margin-top: 4px; overflow-wrap: anywhere; }

/* Expandable secondary detail */
.detail-toggle { margin-top: 6px; }
.detail-toggle > summary {
    list-style: none;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--sw-primary-text);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 0;
}
.detail-toggle > summary::-webkit-details-marker { display: none; }
.detail-toggle > summary::after { content: "\F282"; font-family: bootstrap-icons; font-size: 11px; }
.detail-toggle[open] > summary::after { content: "\F286"; }
.detail-body {
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius-control);
    background: var(--sw-sunken);
    font-size: 12.5px;
    color: var(--sw-text-secondary);
    overflow-wrap: anywhere;
}
.detail-body dl { margin: 0; }

/* Activity & delivery rows */
.activity-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--sw-border);
    align-items: start;
}
.activity-item:last-child { border-bottom: 0; }
.activity-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--sw-radius-sm);
    flex: 0 0 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: var(--sw-neutral-soft);
    color: var(--sw-muted);
    border: 1px solid var(--sw-border);
}
.activity-icon.tone-danger { background: var(--sw-danger-soft); color: var(--sw-danger); border-color: color-mix(in srgb, var(--sw-danger-solid) 20%, transparent); }
.activity-icon.tone-success { background: var(--sw-success-soft); color: var(--sw-success); border-color: color-mix(in srgb, var(--sw-success-solid) 20%, transparent); }
.activity-icon.tone-warning { background: var(--sw-warning-soft); color: var(--sw-warning-text); border-color: color-mix(in srgb, var(--sw-warning-solid) 26%, transparent); }
.activity-icon.tone-primary { background: var(--sw-primary-soft); color: var(--sw-primary-text); border-color: color-mix(in srgb, var(--sw-primary) 22%, transparent); }
.activity-item .b { min-width: 0; }
.activity-item .t { font-size: 13.5px; color: var(--sw-text); overflow-wrap: anywhere; }
.activity-item .m { font-size: 12.5px; color: var(--sw-muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }

/* Structured event rows for the activity log */
.event-row {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 8px 16px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--sw-border);
    align-items: baseline;
    font-size: 13.5px;
}
.event-row:last-child { border-bottom: 0; }
.event-row:hover { background: var(--sw-card-hover); }
.event-desc { min-width: 0; }
.event-desc .d { color: var(--sw-text); overflow-wrap: anywhere; }
.event-desc .k { font-size: 12px; color: var(--sw-muted); margin-top: 2px; }
.event-site,
.event-actor { font-size: 13px; color: var(--sw-text-secondary); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.event-time { font-size: 12.5px; color: var(--sw-muted); font-variant-numeric: tabular-nums; text-align: right; }
.event-head {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 8px 16px;
    padding: 10px 16px;
    background: var(--sw-sunken);
    border-bottom: 1px solid var(--sw-border);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--sw-muted);
}
.event-head span:last-child { text-align: right; }

.import-report .list-group-item {
    background: transparent;
    border-color: var(--sw-border);
    color: var(--sw-text);
    font-size: 13px;
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   11. Feedback
   -------------------------------------------------------------------------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--sw-muted); }
.empty-state .ico {
    width: 40px;
    height: 40px;
    border-radius: var(--sw-radius-control);
    background: var(--sw-sunken);
    border: 1px solid var(--sw-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--sw-decor);
    margin-bottom: 12px;
}
.empty-state h4 { font-size: 14.5px; margin-bottom: 4px; color: var(--sw-text); }
.empty-state p { margin: 0 0 12px; font-size: 13px; }

.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--sw-skeleton);
    border-radius: 4px;
    color: transparent !important;
}
.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, var(--sw-skeleton-shine), transparent);
    animation: sw-shimmer 1.4s infinite;
}
@keyframes sw-shimmer { 100% { transform: translateX(100%); } }
.skeleton-line { height: 11px; margin: 4px 0; }
.skeleton-line.w-25 { width: 25%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-75 { width: 75%; }
.skeleton-block { height: 120px; }
.is-refreshing { opacity: .55; transition: opacity .15s ease; }

.toast {
    border-radius: var(--sw-radius-panel);
    border: 1px solid var(--sw-border);
    background: var(--sw-card);
    color: var(--sw-text);
    box-shadow: var(--sw-shadow-lg);
    font-size: 13.5px;
    min-width: 300px;
}
.toast .toast-body { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; }
.toast .toast-icon { font-size: 16px; line-height: 1.3; }
.toast.t-success .toast-icon { color: var(--sw-success); }
.toast.t-danger .toast-icon { color: var(--sw-danger); }
.toast.t-warning .toast-icon { color: var(--sw-warning-text); }
.toast.t-info .toast-icon { color: var(--sw-info); }
.toast .btn-close { margin-left: auto; font-size: 10px; }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(1) brightness(2); }

.modal-content {
    border-radius: var(--sw-radius-panel);
    border: 1px solid var(--sw-border);
    background: var(--sw-card);
    box-shadow: var(--sw-shadow-lg);
}
.modal-header { border-bottom: 1px solid var(--sw-border); padding: 14px 18px; }
.modal-title { font-size: 16px; }
.modal-body { padding: 18px; }
.modal-footer { border-top: 1px solid var(--sw-border); padding: 12px 18px; gap: 8px; }
.modal-backdrop { background: rgba(15, 23, 42, .55); }

.alert {
    border-radius: var(--sw-radius-panel);
    font-size: 13.5px;
    border: 1px solid transparent;
    padding: 12px 14px;
}
.alert-danger { background: var(--sw-danger-soft); color: var(--sw-danger); border-color: color-mix(in srgb, var(--sw-danger-solid) 28%, transparent); }
.alert-success { background: var(--sw-success-soft); color: var(--sw-success); border-color: color-mix(in srgb, var(--sw-success-solid) 26%, transparent); }
.alert-warning { background: var(--sw-warning-soft); color: var(--sw-warning-text); border-color: color-mix(in srgb, var(--sw-warning-solid) 32%, transparent); }
.alert-info { background: var(--sw-info-soft); color: var(--sw-info); border-color: color-mix(in srgb, var(--sw-info) 26%, transparent); }

.tooltip { font-size: 12px; }
.tooltip-inner { background: #111827; color: #fff; border-radius: var(--sw-radius-sm); padding: 6px 9px; max-width: 280px; text-align: left; }
[data-bs-theme="dark"] .tooltip-inner { background: #E5E7EB; color: #111827; }
.tooltip .tooltip-arrow::before { border-top-color: #111827; }
[data-bs-theme="dark"] .tooltip .tooltip-arrow::before { border-top-color: #E5E7EB; }

/* Informational note beside data */
.coverage-note {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius-panel);
    background: var(--sw-card);
    font-size: 12.5px;
    color: var(--sw-text-secondary);
}
.coverage-note i { color: var(--sw-primary); font-size: 15px; line-height: 1.4; flex: 0 0 auto; }
.coverage-note strong { color: var(--sw-text); display: block; margin-bottom: 2px; font-size: 13px; }

/* --------------------------------------------------------------------------
   12. Reports & print
   -------------------------------------------------------------------------- */
.report-print-heading { display: none; }
.report-context {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    font-size: 12.5px;
    color: var(--sw-muted);
    margin-top: 10px;
}
.report-context .item { display: inline-flex; gap: 5px; }
.report-context .item b { color: var(--sw-text-secondary); font-weight: 600; }

/* --------------------------------------------------------------------------
   13. Auth & installer
   -------------------------------------------------------------------------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: var(--sw-bg);
}
.auth-shell { width: 100%; max-width: 400px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 24px; color: var(--sw-logo-word); }
.auth-card {
    background: var(--sw-card);
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius-panel);
    padding: 28px;
}
.auth-card h1 { font-size: 20px; margin: 0 0 4px; }
.auth-card .lead-text { color: var(--sw-muted); font-size: 13.5px; margin: 0 0 20px; }
.auth-card .form-control { min-height: 40px; font-size: 14px; }
.auth-footer { text-align: center; margin-top: 16px; font-size: 12.5px; color: var(--sw-muted); }
.auth-theme-toggle { position: absolute; top: 16px; right: 16px; z-index: 2; }

.install-steps { display: flex; gap: 6px; margin-bottom: 24px; flex-wrap: wrap; }
.install-steps .step {
    flex: 1 1 96px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--sw-muted);
    padding: 8px 6px;
    border-radius: var(--sw-radius-sm);
    background: var(--sw-sunken);
    border: 1px solid var(--sw-border);
}
.install-steps .step.active { background: var(--sw-primary-soft); color: var(--sw-primary-text); border-color: color-mix(in srgb, var(--sw-primary) 32%, transparent); }
.install-steps .step.done { background: var(--sw-success-soft); color: var(--sw-success); border-color: color-mix(in srgb, var(--sw-success-solid) 26%, transparent); }
.req-list { list-style: none; padding: 0; margin: 0; }
.req-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--sw-border);
    font-size: 13.5px;
}
.req-list li:last-child { border-bottom: 0; }
.req-list .ok { color: var(--sw-success); font-weight: 600; }
.req-list .bad { color: var(--sw-danger); font-weight: 600; }
.req-list .warn { color: var(--sw-warning-text); font-weight: 600; }

/* --------------------------------------------------------------------------
   14. Responsive & motion
   -------------------------------------------------------------------------- */
@media (max-width: 1399.98px) {
    .sw-content { padding: 20px 20px 40px; }
}

@media (max-width: 1199.98px) {
    .site-name,
    .site-domain { max-width: 200px; }
    .event-row,
    .event-head { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.4fr) minmax(0, 1.2fr); }
    .event-row .event-actor { grid-column: 2; }
    .event-head span:nth-child(3) { display: none; }
}

@media (max-width: 991.98px) {
    .metric-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .metric-strip .metric-item:nth-child(-n+3) { border-bottom: 1px solid var(--sw-border); }
    .metric-strip .metric-item:nth-child(3n) { border-right: 0; }
    .sw-sidebar { transform: translateX(-100%); width: 272px; }
    html.sidebar-open .sw-sidebar { transform: translateX(0); box-shadow: var(--sw-shadow-lg); }
    html.sidebar-open .sw-backdrop { display: block; }
    .sw-main { margin-left: 0 !important; }
    html.sidebar-collapsed .sw-sidebar { width: 272px; }
    html.sidebar-collapsed .sw-nav-link { justify-content: flex-start; padding: 8px 10px; gap: 10px; }
    html.sidebar-collapsed .sw-nav-label,
    html.sidebar-collapsed .sw-nav-link span,
    html.sidebar-collapsed .sw-nav-count,
    html.sidebar-collapsed .sw-user-text { display: block; }
    html.sidebar-collapsed .sw-version span { display: inline; }
    html.sidebar-collapsed .sw-version { justify-content: flex-start; padding: 2px 8px 8px; }
    html.sidebar-collapsed .sw-brand { padding: 0 16px; justify-content: flex-start; }
    html.sidebar-collapsed .sw-brand .sw-logo { display: block; }
    html.sidebar-collapsed .sw-brand .sw-logo-mark { display: none; }
    html.sidebar-collapsed .sw-nav-group + .sw-nav-group { border-top: 0; padding-top: 0; }
    .sw-topbar-brand { display: flex; align-items: center; color: var(--sw-logo-word); }
    .sw-topbar-brand:hover { color: var(--sw-logo-word); }
}

@media (max-width: 767.98px) {
    .sw-content { padding: 16px 16px 40px; }
    .sw-page-head h1 { font-size: 19px; }
    .sw-card-body { padding: 14px; }
    .sw-card-header { padding: 12px 14px; }
    .sw-toolbar { padding: 12px 14px; }
    .sw-toolbar .search { max-width: none; flex-basis: 100%; }
    .sw-card-header .search { flex-basis: 100%; }
    .sw-toolbar .form-select { flex: 1 1 140px; max-width: none; }
    .sw-toolbar .date-range { flex: 1 1 100%; }
    .sw-toolbar .date-range .form-control { flex: 1 1 0; min-width: 0; }
    .metric-item { border-right: 0; border-bottom: 1px solid var(--sw-border); }
    .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric-strip .metric-item:nth-child(odd) { border-right: 1px solid var(--sw-border); }
    .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .summary-item { border-bottom: 1px solid var(--sw-border); }
    .summary-item:nth-child(odd) { border-right: 1px solid var(--sw-border); }
    .summary-item:last-child { border-bottom: 0; }
    .option-grid { grid-template-columns: 1fr; }
    .kv-list { grid-template-columns: 1fr; gap: 2px 0; }
    .kv-list dt { margin-top: 8px; }
    .kv-list dt:first-child { margin-top: 0; }
    .event-row,
    .event-head { grid-template-columns: minmax(0, 1fr); }
    .event-head { display: none; }
    .event-row .event-time { text-align: left; }
    .event-row { gap: 2px; }
    .site-name,
    .site-domain { max-width: 180px; }
    .hide-mobile { display: none !important; }
    .sw-table thead th { position: static; }
    .sw-pagination { justify-content: center; }
    .monitor-banner { flex-wrap: wrap; }
    .monitor-banner a { align-self: flex-start; }
    .stat-groups { grid-template-columns: 1fr; }
}

@media (max-width: 575.98px) {
    .sw-content { padding: 16px 12px 32px; }
    .sw-topbar { padding: 0 12px; gap: 6px; }
    .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .site-name,
    .site-domain { max-width: 150px; }
    .btn { min-height: 40px; }
    .btn-sm { min-height: 36px; }
    .btn-icon { width: 40px; height: 40px; }
    .btn-icon.btn-sm { width: 36px; height: 36px; }
    .segmented button { min-height: 34px; }
    .toast { min-width: 0; }
}

/* Touch targets */
@media (pointer: coarse) {
    .btn, .btn-icon, .dropdown-item, .sw-nav-link { min-height: 44px; }
    .btn-icon { width: 44px; height: 44px; }
    .segmented button { min-height: 36px; }
    .form-control, .form-select { min-height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}

/* --------------------------------------------------------------------------
   Print — clean report output
   -------------------------------------------------------------------------- */
@media print {
    .sw-sidebar,
    .sw-topbar,
    .sw-backdrop,
    .skip-link,
    .monitor-banner,
    .sw-toolbar,
    .sw-pagination,
    .sw-page-actions,
    .toast-container,
    .btn { display: none !important; }

    .sw-main { margin-left: 0 !important; }
    .sw-content { padding: 0; max-width: none; }
    body.sw-body { background: #fff; color: #111827; font-size: 11pt; }

    .report-print-heading { display: block; margin-bottom: 20px; border-bottom: 2px solid #E2E8F0; padding-bottom: 12px; }
    .report-print-heading .sw-logo { color: #111827; }
    .report-print-heading h1 { font-size: 16pt; margin: 12px 0 4px; color: #111827; }
    .report-print-heading p { margin: 0; color: #475569; font-size: 10pt; }

    .sw-card,
    .summary-strip,
    .metric-strip,
    .coverage-note { border-color: #CBD5E1 !important; background: #fff !important; box-shadow: none !important; break-inside: avoid; }
    .sw-table { min-width: 0; }
    .sw-table-wrap { overflow: visible; }
    .sw-table thead th { background: #F1F5F9 !important; color: #334155 !important; position: static; }
    .sw-table td,
    .sw-table th,
    .summary-item .v,
    .summary-item .l,
    .coverage-note,
    .coverage-note strong { color: #111827 !important; }
    .sw-table td.actions,
    .sw-table th.actions { position: static; box-shadow: none; }
    .hide-mobile { display: table-cell !important; }
    .sw-table tbody tr { break-inside: avoid; }
    /* Printed reports show full names rather than ellipses. */
    .site-name,
    .site-domain,
    .client-name { max-width: none; overflow: visible; white-space: normal; }
    .report-filter-card { display: none !important; }
    .summary-item .s { white-space: normal; overflow: visible; }
    .sw-subnav,
    .detail-toggle > summary { display: none !important; }
    .detail-toggle[open] .detail-body { display: block; }
    a { color: #111827 !important; text-decoration: none; }
}

/* --------------------------------------------------------------------------
   15. Page compositions
   -------------------------------------------------------------------------- */

/* Forms read best in a constrained measure */
.sw-form-col { max-width: 880px; }
.sw-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--sw-border);
    margin-bottom: 24px;
}

/* Secondary navigation inside a settings area */
.sw-subnav { display: flex; gap: 2px; border-bottom: 1px solid var(--sw-border); flex-wrap: wrap; }
.sw-subnav a {
    padding: 8px 12px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--sw-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.sw-subnav a:hover { color: var(--sw-text); text-decoration: none; border-bottom-color: var(--sw-border-strong); }
.sw-subnav a.active { color: var(--sw-primary-text); border-bottom-color: var(--sw-primary); }

/* Website details identity block */
.site-identity { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.site-identity-main { flex: 1 1 320px; min-width: 0; }
.site-identity-main h1 { font-size: 20px; margin: 0; overflow-wrap: anywhere; }
.site-identity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--sw-muted);
}
.site-identity-meta a { color: var(--sw-muted); overflow-wrap: anywhere; }
.site-identity-meta a:hover { color: var(--sw-primary-text); }
.site-identity-issue { margin-top: 8px; font-size: 13px; color: var(--sw-danger); overflow-wrap: anywhere; }
.site-identity-issue:empty { display: none; }
.site-identity-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }

/* Profile header */
.profile-identity { display: flex; align-items: center; gap: 14px; }

/* Import page */
.import-split { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.import-aside {
    border-left: 1px solid var(--sw-border);
    padding-left: 20px;
    min-width: 0;
}
.import-aside h3 { font-size: 13px; margin: 0 0 8px; color: var(--sw-text-secondary); }
.import-aside .copy-box { font-size: 12px; line-height: 1.6; margin: 0; }
.import-outcome + .import-outcome { margin-top: 20px; }
.import-outcome h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin: 0 0 4px;
}
.import-outcome .list-group { border-top: 1px solid var(--sw-border); }

/* Sidebar account row */
.sw-user.active { background: var(--sw-primary-soft); }
.sw-user.active .n { color: var(--sw-primary-text); }
html.sidebar-collapsed .sw-sidebar-footer form { display: none; }

/* Metric strip links behave like the buttons beside them */
a.metric-item { text-decoration: none; }
a.metric-item:hover { background: var(--sw-hover); text-decoration: none; }
a.metric-item .metric-label,
a.metric-item .metric-sub { color: var(--sw-muted); }

/* Sign-in / installer page needs a positioning context for the theme toggle */
.auth-page { position: relative; }

/* Report toolbar keeps its rows tidy when it wraps */
.report-toolbar { row-gap: 10px; }

@media (max-width: 991.98px) {
    .import-split { grid-template-columns: minmax(0, 1fr); }
    .import-aside { border-left: 0; border-top: 1px solid var(--sw-border); padding-left: 0; padding-top: 16px; }
    .site-identity-actions { width: 100%; }
}

@media (max-width: 575.98px) {
    .site-identity-actions .btn { flex: 1 1 auto; }
    .sw-form-actions { position: sticky; bottom: 0; background: var(--sw-bg); padding-bottom: 12px; z-index: 5; }
}

/* --------------------------------------------------------------------------
   16. Domains & hosting, users and roles
   -------------------------------------------------------------------------- */

/* Key facts at the top of a registration / hosting panel */
.domain-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.domain-fact { padding: 10px 12px; border: 1px solid var(--sw-border); border-radius: var(--sw-radius-control); background: var(--sw-sunken); min-width: 0; }
.domain-fact .l { font-size: 12px; font-weight: 600; color: var(--sw-muted); }
.domain-fact .v { font-size: 15px; font-weight: 650; color: var(--sw-text); margin-top: 2px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.domain-fact .s { font-size: 12px; color: var(--sw-muted); margin-top: 2px; overflow-wrap: anywhere; }
.domain-section-title { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--sw-muted); margin: 0 0 10px; }
.domain-loading { display: flex; align-items: center; gap: 10px; color: var(--sw-muted); font-size: 13px; padding: 8px 0; }
.domain-raw { white-space: pre; overflow: auto; overflow-wrap: normal; max-height: 60vh; font-size: 12px; line-height: 1.5; }
.chip-list { display: inline-flex; flex-wrap: wrap; gap: 4px; }

/* Ad-hoc domain lookup */
.lookup-form { display: flex; gap: 8px; flex-wrap: wrap; }
/* A full-size input rather than form-control-sm, so the icon sits a little further in. */
.lookup-form .search { flex: 1 1 260px; min-width: 0; }
.lookup-form .search i { left: 11px; }
.lookup-form .search input { padding-left: 32px; }
.lookup-result { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--sw-border); }
.lookup-result:empty { display: none; }

/* Provider / country breakdown */
.breakdown-title { font-size: 12px; font-weight: 600; color: var(--sw-muted); margin: 0 0 4px; }
.breakdown-list { list-style: none; margin: 0 0 16px; padding: 0; }
.breakdown-list:last-child { margin-bottom: 0; }
.breakdown-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--sw-border); font-size: 13.5px; }
.breakdown-list li:last-child { border-bottom: 0; }
.breakdown-list .name { flex: 1 1 auto; min-width: 0; text-align: left; background: none; border: 0; padding: 0; color: var(--sw-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breakdown-list button.name:hover { color: var(--sw-primary-text); text-decoration: underline; }
.breakdown-list .bar { flex: 0 0 64px; height: 6px; border-radius: 999px; background: var(--sw-sunken); overflow: hidden; }
.breakdown-list .bar span { display: block; height: 100%; border-radius: 999px; background: var(--sw-primary); }
.breakdown-list .count { min-width: 22px; text-align: right; color: var(--sw-muted); font-variant-numeric: tabular-nums; }

/* Users */
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-cell .n { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--sw-text); min-width: 0; }
.user-cell .e { font-size: 12px; color: var(--sw-muted); }
.sw-table tbody tr.is-inactive td:not(.actions) { color: var(--sw-muted); }
.sw-table tbody tr.is-inactive .sw-avatar { opacity: .6; }

/* Roles */
.perm-group + .perm-group { margin-top: 16px; }
.perm-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--sw-border); }
.perm-group-head h3 { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--sw-muted); margin: 0; }
.option-card.is-disabled { cursor: not-allowed; opacity: .6; }
.perm-matrix th.role-col,
.perm-matrix td.cell { text-align: center; white-space: nowrap; }
.perm-matrix .group-row td { background: var(--sw-sunken); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--sw-muted); }
.perm-matrix .perm-yes { color: var(--sw-success); font-size: 16px; }
.perm-matrix .perm-no { color: var(--sw-decor); }

/* Database updates */
.update-status { display: flex; align-items: flex-start; gap: 16px; }
.update-status h2 { font-size: 18px; margin: 2px 0 4px; }
.update-status p { font-size: 13.5px; color: var(--sw-text-secondary); margin: 0; }
.update-icon { width: 44px; height: 44px; flex: 0 0 44px; border-radius: var(--sw-radius-panel); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; border: 1px solid var(--sw-border); }
.update-icon.tone-success { background: var(--sw-success-soft); color: var(--sw-success); }
.update-icon.tone-warning { background: var(--sw-warning-soft); color: var(--sw-warning-text); }
.change-list { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--sw-text-secondary); }
.change-list li + li { margin-top: 4px; }
.version-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.version-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--sw-card); border: 1px solid var(--sw-border); border-radius: var(--sw-radius-panel); min-width: 0; }
.version-tile .label { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--sw-muted); }
.version-tile .value { font-size: 20px; font-weight: 700; color: var(--sw-text); font-variant-numeric: tabular-nums; }
.version-tile .value .sw-pill { font-size: 13px; }
.version-tile .hint { font-size: 12.5px; color: var(--sw-text-secondary); overflow-wrap: anywhere; }
@media (max-width: 640px) { .version-grid { grid-template-columns: 1fr; } }
.release-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 2px; }
.release-head h4 { font-size: 16px; margin: 0; font-variant-numeric: tabular-nums; }
.release-group { display: grid; grid-template-columns: 76px 1fr; gap: 8px; margin-top: 8px; align-items: start; }
.release-tag { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: 4px; text-align: center; }
.release-tag.tag-added { background: var(--sw-success-soft); color: var(--sw-success); }
.release-tag.tag-improved { background: var(--sw-info-soft); color: var(--sw-info); }
.release-tag.tag-fixed { background: var(--sw-warning-soft); color: var(--sw-warning-text); }
@media (max-width: 480px) { .release-group { grid-template-columns: 1fr; gap: 4px; } .release-tag { justify-self: start; } }
.divider-top { border-top: 1px solid var(--sw-border); margin-top: 16px; padding-top: 16px; }

/* Core Web Vitals & screenshots */
.kv-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; }
.kv-tile { border: 1px solid var(--sw-border); border-radius: var(--sw-radius-sm); padding: 8px 10px; background: var(--sw-sunken); }
.kv-tile-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--sw-muted); }
.kv-tile-value { font-size: 15px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.cwv-score { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; border: 2px solid currentColor; }
.cwv-score.tone-success { color: var(--sw-success); background: var(--sw-success-soft); }
.cwv-score.tone-warning { color: var(--sw-warning-text); background: var(--sw-warning-soft); }
.cwv-score.tone-danger { color: var(--sw-danger); background: var(--sw-danger-soft); }
.cwv-score.tone-neutral { color: var(--sw-muted); background: var(--sw-sunken); }
.cwv-metric { font-variant-numeric: tabular-nums; font-weight: 600; }
.shot-frame { display: block; border: 1px solid var(--sw-border); border-radius: var(--sw-radius-sm); overflow: hidden;
    background: var(--sw-sunken); line-height: 0; }
/* The image sizes the frame. Its own 16:10 keeps the card stable, so no aspect-ratio is imposed here. */
.shot-frame img { display: block; width: 100%; height: auto; }
.shot-frame:hover { border-color: var(--sw-border-strong); }

/* WordPress (SiteWatch Connector) section */
.wp-inside { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 12.5px; color: var(--sw-text-secondary); padding: 8px 12px; border: 1px dashed var(--sw-border); border-radius: var(--sw-radius-sm); }
.wp-inside .bi { margin-right: 3px; }
.wp-steps { margin: 0; padding-left: 20px; font-size: 13.5px; }
.wp-steps li + li { margin-top: 4px; }
.wp-tabs { flex-wrap: wrap; }
.wp-tabs .wp-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--sw-primary-soft); color: var(--sw-primary-text); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.wp-errors { display: flex; flex-direction: column; gap: 12px; }
.wp-error { border: 1px solid var(--sw-border); border-left: 3px solid var(--sw-danger); border-radius: var(--sw-radius-sm); padding: 10px 12px; }
.wp-error-msg { margin: 4px 0 6px; padding: 8px 10px; background: var(--sw-sunken); border-radius: 6px; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; max-height: 160px; overflow: auto; }
.wp-remote-row { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--sw-border); }
.wp-remote-row > .min-w-0 { flex: 1 1 260px; }
.wp-remote-list { display: flex; flex-direction: column; gap: 2px; }
.wp-subhead { font-size: 14px; font-weight: 600; margin: 0; color: var(--sw-text); }
.wp-checks, .wp-activity, .wp-admins { list-style: none; margin: 0; padding: 0; }
.wp-checks li, .wp-activity li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--sw-border); font-size: 13.5px; }
.wp-checks li:last-child, .wp-activity li:last-child { border-bottom: 0; }
.wp-checks li > .bi, .wp-activity li > .bi { font-size: 15px; margin-top: 1px; flex: 0 0 auto; }
.wp-admins li { font-size: 13px; padding: 3px 0; }
.wp-fleet-list { list-style: none; margin: 0; padding: 0; }
.wp-fleet-list li { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-top: 1px solid var(--sw-border); font-size: 13px; }
.wp-fleet-list li .n { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-fleet-list li .d { color: var(--sw-muted); font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --------------------------------------------------------------------------
   17. SiteWatch 2.0 shell
   Sidebar and top bar sit on the page background; content lives on cards. One accent colour (orange)
   for the primary action, the active item and focus. Motion is short and only shows change.
   -------------------------------------------------------------------------- */

/* Sidebar */
.sw-sidebar { background: var(--sw-sidebar-bg); }
.sw-brand { border-bottom: 0; height: 60px; padding: 0 18px; }
.sw-nav { padding: 4px 10px 12px; }
.sw-nav-group + .sw-nav-group { margin-top: 14px; }
.sw-nav-label { font-size: 11px; letter-spacing: .06em; padding: 6px 10px 6px; color: var(--sw-decor); }
.sw-nav-link { min-height: 34px; padding: 7px 10px; font-size: 13.5px; color: var(--sw-text-secondary); border: 1px solid transparent; }
.sw-nav-link i { font-size: 16px; }
.sw-nav-link:hover { background: var(--sw-hover); }
.sw-nav-link.active { background: var(--sw-card); border-color: var(--sw-border); color: var(--sw-text); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.sw-nav-link.active::before { display: none; }
.sw-nav-link.active i { color: var(--sw-primary); }
[data-bs-theme="dark"] .sw-nav-link.active { background: var(--sw-hover); border-color: var(--sw-border); box-shadow: none; }
.sw-sidebar-footer { border-top: 1px solid var(--sw-border); padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.sw-version { padding: 4px 8px; border-radius: var(--sw-radius-sm); }
.sw-version.active { color: var(--sw-primary-text); }
html.sidebar-collapsed .sw-nav-link { border-radius: var(--sw-radius-control); }

/* Top bar */
.sw-topbar { background: color-mix(in srgb, var(--sw-bg) 92%, transparent); border-bottom: 1px solid var(--sw-border); height: 60px; gap: 10px; padding: 0 20px; }
@supports not (background: color-mix(in srgb, red 50%, blue)) { .sw-topbar { background: var(--sw-bg); } }
.sw-topbar-brand { color: var(--sw-logo-word); }

.sw-search-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: min(420px, 100%);
    min-width: 0;
    height: 36px;
    padding: 0 8px 0 12px;
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius-control);
    background: var(--sw-card);
    color: var(--sw-faint);
    font-size: 13.5px;
    text-align: left;
    cursor: pointer;
    transition: border-color .12s ease, background-color .12s ease;
}
.sw-search-trigger:hover { border-color: var(--sw-border-strong); color: var(--sw-muted); }
.sw-search-trigger .t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-search-trigger i { font-size: 14px; }

.sw-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border: 1px solid var(--sw-border);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: var(--sw-sunken);
    color: var(--sw-muted);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    box-shadow: none;
}

/* Engine chip: text on wide screens, a single dot on phones */
.sw-engine { display: inline-flex; }
@media (max-width: 767.98px) {
    .sw-engine { padding: 0; width: 36px; height: 36px; min-height: 36px; justify-content: center; border-radius: var(--sw-radius-control); }
    .sw-engine-text { display: none; }
    .sw-search-trigger { width: 36px; padding: 0; justify-content: center; }
    .sw-search-trigger .t,
    .sw-search-trigger .sw-kbd { display: none; }
}

/* Account menu */
.sw-account-btn { border-radius: 50%; }
.sw-account-menu { min-width: 250px; }
.sw-account-head { display: flex; align-items: center; gap: 10px; padding: 6px 10px 4px; }
.sw-account-head .n { display: block; font-weight: 600; font-size: 13.5px; color: var(--sw-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-account-head .e { display: block; font-size: 12px; color: var(--sw-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-item .sw-kbd { margin-left: auto; }
.dropdown-item[hidden] { display: none; }

/* Page header, breadcrumb and tabs */
.sw-page-head { align-items: flex-end; margin-bottom: 20px; min-height: 40px; }
.sw-page-head.has-tabs { margin-bottom: 12px; }
.sw-page-actions { align-self: center; }
.sw-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--sw-muted); margin-bottom: 4px; }
.sw-breadcrumb a { color: var(--sw-muted); }
.sw-breadcrumb a:hover { color: var(--sw-text); text-decoration: none; }
.sw-breadcrumb i { font-size: 10px; color: var(--sw-decor); }
.sw-breadcrumb i:last-child { display: none; }

.sw-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--sw-border);
    margin-bottom: 20px;
    overflow-x: auto;
    scrollbar-width: none;
}
.sw-tabs::-webkit-scrollbar { display: none; }
.sw-tabs a,
.sw-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px 10px;
    margin-bottom: -1px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--sw-muted);
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}
.sw-tabs a i,
.sw-tabs button i { font-size: 15px; }
.sw-tabs a:hover,
.sw-tabs button:hover { color: var(--sw-text); text-decoration: none; }
.sw-tabs a.active,
.sw-tabs button.active { color: var(--sw-text); border-bottom-color: var(--sw-primary); }
.sw-tabs a.active i,
.sw-tabs button.active i { color: var(--sw-primary); }
.sw-tab-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--sw-sunken); border: 1px solid var(--sw-border); color: var(--sw-text-secondary); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.sw-tab-count.tone-danger { background: var(--sw-danger-soft); color: var(--sw-danger); border-color: transparent; }

/* Cards: slightly roomier headers */
.sw-card-header { padding: 14px 18px; }
.sw-card-body { padding: 18px; }
.sw-card-header h3 { font-size: 14.5px; letter-spacing: -0.005em; }

/* Status dot used in lists and the palette */
.sw-status-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; background: var(--sw-neutral-solid); display: inline-block; }
.sw-status-dot.sev-ok { background: var(--sw-success-solid); }
.sw-status-dot.sev-warning { background: var(--sw-warning-solid); }
.sw-status-dot.sev-down { background: var(--sw-danger-solid); }

/* Top progress bar during in-app navigation */
.sw-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 2100; pointer-events: none; opacity: 0; transition: opacity .2s ease; }
.sw-progress span { display: block; height: 100%; width: 0; background: var(--sw-primary); transition: width .2s ease; }
.sw-progress.is-active { opacity: 1; }
.sw-progress.is-done { opacity: 0; transition-delay: .12s; }

/* Page swap: new content settles in; a restored snapshot is shown but not usable until it is fresh */
.sw-content.sw-enter { animation: sw-enter .16s ease-out; }
@keyframes sw-enter { from { opacity: .4; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.sw-content.is-preview { pointer-events: none; }
.sw-content.is-preview canvas { visibility: hidden; }

/* Command palette */
.sw-palette { position: fixed; inset: 0; z-index: 2000; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.sw-palette[hidden] { display: none; }
.sw-palette-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); animation: sw-fade .12s ease-out; }
.sw-palette-panel {
    position: relative;
    width: 100%;
    max-width: 620px;
    max-height: min(560px, 76vh);
    display: flex;
    flex-direction: column;
    background: var(--sw-card);
    border: 1px solid var(--sw-border);
    border-radius: 12px;
    box-shadow: var(--sw-shadow-lg);
    overflow: hidden;
    animation: sw-pop-in .14s ease-out;
}
@keyframes sw-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sw-pop-in { from { opacity: 0; transform: translateY(-6px) scale(.99); } to { opacity: 1; transform: none; } }
.sw-palette-input { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--sw-border); }
.sw-palette-input i { color: var(--sw-muted); font-size: 16px; }
.sw-palette-input input { flex: 1 1 auto; min-width: 0; height: 52px; border: 0; outline: 0; background: transparent; color: var(--sw-text); font-size: 15px; }
.sw-palette-input input::placeholder { color: var(--sw-faint); }
.sw-palette-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1 1 auto; }
.sw-palette-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--sw-faint); }
.sw-palette-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--sw-radius-control); cursor: pointer; min-height: 40px; }
.sw-palette-item > i { color: var(--sw-muted); font-size: 15px; width: 18px; text-align: center; flex: 0 0 18px; }
.sw-palette-item > .sw-status-dot { margin: 0 5px; }
.sw-palette-item .l { display: block; font-size: 13.5px; font-weight: 500; color: var(--sw-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-palette-item .s { display: block; font-size: 12px; color: var(--sw-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-palette-item.active { background: var(--sw-hover); }
.sw-palette-item.active > i { color: var(--sw-primary); }
.sw-palette-empty { padding: 28px 16px; text-align: center; color: var(--sw-muted); font-size: 13px; }
.sw-palette-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--sw-border); background: var(--sw-sunken); font-size: 12px; color: var(--sw-muted); }
.sw-palette-foot span { display: inline-flex; align-items: center; gap: 4px; }
html.palette-open { overflow: hidden; }
@media (max-width: 575.98px) {
    .sw-palette { padding: 0; }
    .sw-palette-panel { max-width: none; max-height: 100vh; height: 100%; border-radius: 0; border: 0; }
    .sw-palette-foot { display: none; }
}

/* Keyboard shortcut list */
.sw-shortcut-list { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 0; font-size: 13.5px; align-items: center; }
.sw-shortcut-list dt { font-weight: 500; color: var(--sw-text); }
.sw-shortcut-list dd { margin: 0; text-align: right; white-space: nowrap; }
.sw-shortcut-list .then { font-size: 11.5px; color: var(--sw-muted); margin: 0 2px; }

/* Compact table density (account menu) */
html.density-compact .sw-table tbody td { padding-top: 6px; padding-bottom: 6px; }
html.density-compact .sw-table thead th { padding-top: 7px; padding-bottom: 7px; }
html.density-compact .sw-table .site-domain,
html.density-compact .sw-table .s-sub { display: none; }

/* Filter bar: one row on desktop; Export/Print always sit on the right and never look disabled */
.sw-filterbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--sw-border); }
.sw-filterbar .search { flex: 1 1 220px; max-width: 320px; min-width: 180px; }
.sw-filterbar .form-select { width: auto; min-width: 140px; max-width: 220px; }
.sw-filterbar .date-range { display: inline-flex; align-items: center; gap: 6px; }
.sw-filterbar .date-range .form-control { width: auto; min-width: 136px; }
.sw-filterbar .inline-label { font-size: 12.5px; color: var(--sw-muted); white-space: nowrap; }
.sw-filterbar .spacer { flex: 1 1 auto; }
.sw-filterbar .actions { display: inline-flex; gap: 6px; margin-left: auto; }
@media (max-width: 767.98px) {
    .sw-filterbar { padding: 12px 14px; }
    .sw-filterbar .search { max-width: none; flex-basis: 100%; }
    .sw-filterbar .form-select { flex: 1 1 140px; max-width: none; }
    .sw-filterbar .date-range { flex: 1 1 100%; }
    .sw-filterbar .date-range .form-control { flex: 1 1 0; min-width: 0; }
    .sw-filterbar .actions { width: 100%; }
    .sw-filterbar .actions .btn { flex: 1 1 0; }
}

/* Summary strip: four equal tiles; tiles that filter a table are buttons */
.summary-strip.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.summary-strip.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
button.summary-item { background: none; border-top: 0; border-bottom: 0; border-left: 0; text-align: left; color: inherit; cursor: pointer; }
button.summary-item:hover { background: var(--sw-hover); }
button.summary-item[aria-pressed="true"] { background: var(--sw-primary-soft); box-shadow: inset 0 -2px 0 var(--sw-primary); }
.summary-item .v.tone-danger { color: var(--sw-danger); }
.summary-item .v.tone-warning { color: var(--sw-warning-text); }
.summary-item .v.tone-success { color: var(--sw-success); }
.summary-item .v small { font-size: 13px; font-weight: 600; color: var(--sw-muted); margin-left: 2px; letter-spacing: 0; }
@media (max-width: 991.98px) {
    .summary-strip.cols-4,
    .summary-strip.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .summary-strip.cols-4 .summary-item,
    .summary-strip.cols-5 .summary-item { border-bottom: 1px solid var(--sw-border); }
    .summary-strip.cols-4 .summary-item:nth-child(2n) { border-right: 0; }
}

/* Chart empty state sits where the chart would be */
.chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; }
.chart-empty .empty-state { padding: 0; }

/* Settings forms use the full width with two columns */
.sw-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; align-items: start; }
.sw-form-grid > .sw-card { margin-bottom: 0 !important; }
.sw-form-grid > .span-2 { grid-column: 1 / -1; }
@media (max-width: 1199.98px) { .sw-form-grid { grid-template-columns: minmax(0, 1fr); } }

/* Sticky save bar that appears only when a form has unsaved changes */
.sw-savebar {
    position: sticky;
    bottom: 16px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 10px 12px 10px 16px;
    background: var(--sw-card);
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius-panel);
    box-shadow: var(--sw-shadow);
    font-size: 13px;
    color: var(--sw-text-secondary);
}
.sw-savebar .spacer { flex: 1 1 auto; }

/* Side panel (incident details and similar) */
.sw-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); z-index: 1060; background: var(--sw-card); border-left: 1px solid var(--sw-border); box-shadow: var(--sw-shadow-lg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .18s ease; }
.sw-panel.show { transform: none; }
.sw-panel-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--sw-border); }
.sw-panel-head h2 { font-size: 16px; margin: 0; }
.sw-panel-body { flex: 1 1 auto; overflow-y: auto; padding: 18px; }
.sw-panel-backdrop { position: fixed; inset: 0; z-index: 1055; background: rgba(15, 23, 42, .35); }
.sw-panel-backdrop[hidden] { display: none; }

@media (max-width: 767.98px) {
    .sw-content { padding: 16px 16px 40px; }
    .sw-topbar { padding: 0 12px; }
    .sw-page-head { align-items: flex-start; }
}
@media print {
    .sw-tabs, .sw-progress, .sw-palette, .sw-splash, .sw-breadcrumb, .sw-filterbar, .sw-savebar { display: none !important; }
}

/* Shared website cell: name, then "domain · client" */
.site-cell .site-text { display: flex; flex-direction: column; min-width: 0; }
.site-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sw-muted); min-width: 0; white-space: nowrap; }
.site-sub .site-domain-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.site-sub .site-client { flex: 0 0 auto; max-width: 150px; overflow: hidden; text-overflow: ellipsis; color: var(--sw-text-secondary); }
.site-sub .sep { color: var(--sw-decor); }
.site-cell .site-name { max-width: 240px; }
.sw-table td:first-child .site-cell { min-width: 200px; }

/* Country availability matrix */
.cc-table th.cc-col,
.cc-table td.cc-col { width: 40px; padding-left: 2px; padding-right: 2px; text-align: center; }
.cc-table th.cc-col abbr { text-decoration: none; cursor: help; letter-spacing: .02em; }
.cc-cell {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid transparent;
    padding: 0;
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
    transition: transform .1s ease;
}
.cc-cell:hover { transform: scale(1.08); }
.cc-cell.tone-success { background: color-mix(in srgb, var(--sw-success-solid) 20%, transparent); border-color: color-mix(in srgb, var(--sw-success-solid) 45%, transparent); }
.cc-cell.tone-warning { background: color-mix(in srgb, var(--sw-warning-solid) 28%, transparent); border-color: color-mix(in srgb, var(--sw-warning-solid) 60%, transparent); }
.cc-cell.tone-danger { background: var(--sw-danger-solid); border-color: var(--sw-danger-solid); }
.cc-cell.tone-neutral { background: var(--sw-neutral-soft); border-color: var(--sw-border-strong); }
.cc-cell.tone-none { background: transparent; border: 1px dashed var(--sw-border-strong); }
.cc-legend { gap: 8px 18px; }
.cc-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--sw-text-secondary); }
.cc-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid transparent; }
.cc-dot.tone-success { background: color-mix(in srgb, var(--sw-success-solid) 20%, transparent); border-color: color-mix(in srgb, var(--sw-success-solid) 45%, transparent); }
.cc-dot.tone-warning { background: color-mix(in srgb, var(--sw-warning-solid) 28%, transparent); border-color: color-mix(in srgb, var(--sw-warning-solid) 60%, transparent); }
.cc-dot.tone-danger { background: var(--sw-danger-solid); }
.cc-dot.tone-neutral { background: var(--sw-neutral-soft); border-color: var(--sw-border-strong); }
.cc-dot.tone-none { border: 1px dashed var(--sw-border-strong); }

/* Country strip on the website page */
.cc-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.cc-strip-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--sw-border); border-radius: var(--sw-radius-sm); background: var(--sw-card); font-size: 12.5px; min-width: 0; cursor: default; text-align: left; color: var(--sw-text); }
.cc-strip-item .code { font-weight: 700; letter-spacing: .02em; }
.cc-strip-item .t { margin-left: auto; color: var(--sw-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Settings */
.sw-settings-heading { font-size: 15px; margin: 32px 0 12px; color: var(--sw-text); }
.sw-form-actions { justify-content: flex-end; border-top: 0; padding-top: 12px; margin-bottom: 8px; }
.sw-form-actions.is-dirty {
    position: sticky;
    bottom: 12px;
    z-index: 20;
    padding: 10px 12px 10px 16px;
    background: var(--sw-card);
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius-panel);
    box-shadow: var(--sw-shadow);
}
.sw-check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 16px; }
.sw-check-grid .form-check { margin: 0; min-height: 28px; display: flex; align-items: center; gap: 8px; padding-left: 0; }
.sw-check-grid .form-check-input { margin: 0; float: none; }

/* One-line notice that links somewhere (dashboard) */
.sw-notice { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--sw-border); border-radius: var(--sw-radius-panel); background: var(--sw-card); font-size: 13.5px; color: var(--sw-text); text-decoration: none; }
.sw-notice:hover { text-decoration: none; color: var(--sw-text); border-color: var(--sw-border-strong); }
.sw-notice > i { font-size: 16px; }
.sw-notice.tone-warning { background: var(--sw-warning-soft); border-color: color-mix(in srgb, var(--sw-warning-solid) 35%, var(--sw-border)); }
.sw-notice.tone-warning > i,
.sw-notice.tone-warning .fw-600 { color: var(--sw-warning-text); }
a.metric-item:hover .metric-value { color: inherit; }

/* Website page: header card with its section tabs */
.site-header .sw-card-body { padding-bottom: 12px; }
.site-header .site-tabs { margin: 0; padding: 0 12px; border-bottom: 0; border-top: 1px solid var(--sw-border); }
.site-header .site-tabs button { padding-top: 11px; padding-bottom: 11px; }
.site-pane { padding-top: 16px; }
.site-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.site-stats:has(> .stat-group:nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1399.98px) { .site-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .site-stats:has(> .stat-group:nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .site-stats, .site-stats:has(> .stat-group:nth-child(4):last-child) { grid-template-columns: minmax(0, 1fr); } }

/* Profile › This device */
.device-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--sw-border); }
.device-row:first-child { padding-top: 0; }
.device-row:last-of-type { border-bottom: 0; }
.device-list { list-style: none; margin: 0; padding: 0; }
.device-list li { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--sw-border); font-size: 13.5px; }
.device-list li:first-child { border-top: 0; }
.device-list .d { font-size: 12px; color: var(--sw-muted); }
.sw-table tbody tr.is-clickable { cursor: pointer; }
@media (max-width: 767.98px) {
    .sw-filterbar .date-range,
    .sw-toolbar .date-range { display: flex; min-width: 0; max-width: 100%; }
    .sw-filterbar .date-range .form-control,
    .sw-toolbar .date-range .form-control { width: 0; flex: 1 1 0; min-width: 0; }
    .sw-filterbar .segmented,
    .sw-toolbar .segmented { max-width: 100%; overflow-x: auto; }
}

/* Nothing outside the viewport (closed side panels, wide rows) may widen the page on phones. */
html, body.sw-body { overflow-x: clip; }
.sw-panel { visibility: hidden; transition: transform .18s ease, visibility .18s; }
.sw-panel.show { visibility: visible; }

/* --------------------------------------------------------------------------
   18. Website overview
   -------------------------------------------------------------------------- */
.ov-banner { padding: 16px 18px; }
.ov-banner-main { display: flex; align-items: center; gap: 18px; }
.ov-ring { position: relative; flex: 0 0 68px; width: 68px; height: 68px; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; color: var(--sw-text); }
.ov-ring:focus-visible { outline: 2px solid var(--sw-primary); outline-offset: 3px; }
.ov-ring svg { display: block; }
.ov-ring circle { fill: none; stroke-width: 6; }
.ov-ring .track { stroke: var(--sw-border); }
.ov-ring .value { stroke: var(--sw-neutral-solid); stroke-linecap: round; transition: stroke-dasharray .6s cubic-bezier(.4, 0, .2, 1); }
.ov-ring.tone-success .value { stroke: var(--sw-success-solid); }
.ov-ring.tone-warning .value { stroke: var(--sw-warning-solid); }
.ov-ring.tone-danger .value { stroke: var(--sw-danger-solid); }
.ov-ring .n { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.ov-kicker { font-size: 12px; font-weight: 600; color: var(--sw-muted); }
.ov-state { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; margin: 2px 0; }
.ov-state .pulse { position: relative; width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: var(--sw-neutral-solid); }
.ov-state .pulse.tone-success { background: var(--sw-success-solid); }
.ov-state .pulse.tone-warning { background: var(--sw-warning-solid); }
.ov-state .pulse.tone-danger { background: var(--sw-danger-solid); }
.ov-state .pulse.live::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; animation: ov-pulse 2.4s ease-out infinite; }
.ov-state .pulse.tone-success.live::after { color: var(--sw-success-solid); }
.ov-state .pulse.tone-danger.live::after { color: var(--sw-danger-solid); }
@keyframes ov-pulse { 0% { transform: scale(.6); opacity: .7; } 70%, 100% { transform: scale(1.6); opacity: 0; } }
.ov-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--sw-muted); font-variant-numeric: tabular-nums; }
.ov-meta b { color: var(--sw-text-secondary); font-weight: 600; }
.ov-error { margin-top: 6px; font-size: 13px; color: var(--sw-danger); overflow-wrap: anywhere; }
.ov-shot { flex: 0 0 150px; display: block; border: 1px solid var(--sw-border); border-radius: var(--sw-radius-control); overflow: hidden; background: var(--sw-sunken); line-height: 0; }
.ov-shot img { width: 150px; height: 94px; object-fit: cover; object-position: top; }
.ov-shot:hover { border-color: var(--sw-border-strong); }
.ov-score-parts { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--sw-border); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.ov-score-parts[hidden] { display: none; }
.ov-score-parts .part .t { font-size: 12px; font-weight: 600; color: var(--sw-text-secondary); }
.ov-score-parts .part .p { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; margin: 2px 0 4px; }
.ov-score-parts .part .p small { color: var(--sw-muted); font-weight: 500; }
.ov-score-parts .part .d { font-size: 12px; color: var(--sw-muted); }
.ov-score-parts .note { grid-column: 1 / -1; font-size: 12px; color: var(--sw-muted); }

.ov-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.ov-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--sw-card); border: 1px solid var(--sw-border); border-radius: var(--sw-radius-panel); color: inherit; min-width: 0; }
a.ov-tile:hover { border-color: var(--sw-border-strong); text-decoration: none; color: inherit; }
.ov-tile .l { font-size: 12px; font-weight: 600; color: var(--sw-muted); }
.ov-tile .v { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.ov-tile .v.tone-danger { color: var(--sw-danger); }
.ov-tile .v.tone-warning { color: var(--sw-warning-text); }
.ov-tile .viz { height: 26px; display: flex; align-items: center; margin: 4px 0 2px; }
.ov-tile .viz svg { width: 100%; height: 26px; overflow: visible; }
.ov-tile .s { font-size: 12px; color: var(--sw-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.ov-tile .s .worse { color: var(--sw-danger); }
.ov-tile .s .better { color: var(--sw-success); }
.ov-bar { display: block; width: 100%; height: 6px; border-radius: 999px; background: var(--sw-sunken); overflow: hidden; }
.ov-bar > span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--sw-neutral-solid); transition: width .6s cubic-bezier(.4, 0, .2, 1); }
.ov-bar > span.tone-success { background: var(--sw-success-solid); }
.ov-bar > span.tone-warning { background: var(--sw-warning-solid); }
.ov-bar > span.tone-danger { background: var(--sw-danger-solid); }
.ov-bar > span.tone-info { background: var(--sw-info); }
.ov-spark-line { fill: none; stroke: var(--sw-primary); stroke-width: 1.75; vector-effect: non-scaling-stroke; }
.ov-spark-area { fill: var(--sw-primary); opacity: .1; }

.ov-days { display: grid; grid-template-columns: repeat(90, minmax(0, 1fr)); gap: 2px; height: 38px; }
.ov-days span { border-radius: 2px; background: var(--sw-success-solid); transition: transform .1s ease; }
.ov-days span:hover { transform: scaleY(1.12); }
.ov-days span.warn { background: var(--sw-warning-solid); }
.ov-days span.down { background: var(--sw-danger-solid); }
.ov-days span.none { background: var(--sw-sunken); box-shadow: inset 0 0 0 1px var(--sw-border); }
.ov-days-labels { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--sw-muted); }
.ov-days-legend { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.ov-days-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ov-days-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; background: var(--sw-success-solid); }
.ov-days-legend i.warn { background: var(--sw-warning-solid); }
.ov-days-legend i.down { background: var(--sw-danger-solid); }
.ov-days-legend i.none { background: var(--sw-sunken); box-shadow: inset 0 0 0 1px var(--sw-border-strong); }
.ov-days-total { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

.ov-map { margin-bottom: 12px; }
.ov-map svg { display: block; width: 100%; height: auto; }
.ov-map .land { fill: var(--sw-border-strong); }
[data-bs-theme="dark"] .ov-map .land { fill: #2E343B; }
.ov-map .pin { stroke: var(--sw-card); stroke-width: 1.5; }
.ov-map .pin.tone-success { fill: var(--sw-success-solid); }
.ov-map .pin.tone-warning { fill: var(--sw-warning-solid); }
.ov-map .pin.tone-danger { fill: var(--sw-danger-solid); }
.ov-map .pin.tone-neutral,
.ov-map .pin.tone-none { fill: var(--sw-neutral-solid); }
.ov-map .halo { fill: none; stroke-width: 1.5; opacity: .5; }
.ov-map .halo.tone-danger { stroke: var(--sw-danger-solid); }
.ov-map .halo.tone-warning { stroke: var(--sw-warning-solid); }

.ov-events { list-style: none; margin: 0; padding: 6px 18px 12px; }
.ov-events li { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; padding: 9px 0; align-items: start; }
.ov-events li + li { border-top: 1px dashed var(--sw-border); }
.ov-events .ic { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; background: var(--sw-neutral-soft); color: var(--sw-muted); }
.ov-events .ic.tone-success { background: var(--sw-success-soft); color: var(--sw-success); }
.ov-events .ic.tone-danger { background: var(--sw-danger-soft); color: var(--sw-danger); }
.ov-events .ic.tone-warning { background: var(--sw-warning-soft); color: var(--sw-warning-text); }
.ov-events .t { font-size: 13.5px; color: var(--sw-text); overflow-wrap: anywhere; }
.ov-events .m { font-size: 12px; color: var(--sw-muted); overflow-wrap: anywhere; }
.ov-events .w { font-size: 12px; color: var(--sw-muted); white-space: nowrap; }

@media (max-width: 991.98px) {
    .ov-score-parts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ov-shot { display: none !important; }
}
@media (max-width: 575.98px) {
    .ov-banner-main { align-items: flex-start; gap: 12px; }
    .ov-state { font-size: 16px; }
    .ov-days { gap: 1px; height: 30px; }
    .ov-days-legend { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ov-state .pulse.live::after { animation: none; } }

/* Overview screenshot slot: thumbnail that opens a preview, or a placeholder */
.ov-shot-slot { flex: 0 0 168px; }
.ov-shot { position: relative; display: block; width: 168px; height: 105px; padding: 0; border: 1px solid var(--sw-border); border-radius: var(--sw-radius-control); overflow: hidden; background: var(--sw-sunken); cursor: zoom-in; }
.ov-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .25s ease; }
.ov-shot:hover { border-color: var(--sw-border-strong); }
.ov-shot:hover img { transform: scale(1.03); }
.ov-shot:focus-visible { outline: 2px solid var(--sw-primary); outline-offset: 2px; }
.ov-shot-cap { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; background: rgba(17, 19, 21, .72); color: #fff; }
.ov-shot.empty { cursor: default; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; border-style: dashed; border-color: var(--sw-border-strong); color: var(--sw-muted); font-size: 12px; }
.ov-shot.empty > i { font-size: 22px; color: var(--sw-decor); }
.ov-shot-act { border: 0; background: none; padding: 0; font-size: 12px; font-weight: 600; color: var(--sw-primary-text); cursor: pointer; }
.ov-shot-act:hover { text-decoration: underline; }
.shot-preview-body { background: var(--sw-sunken); max-height: 75vh; overflow: auto; }
.shot-preview-body img { display: block; width: 100%; height: auto; }
.shot-frame[data-shot-preview] { cursor: zoom-in; }
@media (max-width: 991.98px) { .ov-shot-slot { display: none; } }
.ov-shot.empty { line-height: 1.35; padding: 8px; }

/* --------------------------------------------------------------------------
   19. Performance › Response time
   -------------------------------------------------------------------------- */
.rt-filters { padding: 0; border: 0; margin: -4px 0 16px; }
.rt-range { font-size: 13px; color: var(--sw-muted); font-variant-numeric: tabular-nums; }
.rt-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1199.98px) { .rt-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .rt-tiles { grid-template-columns: minmax(0, 1fr); } }
.rt-tiles .v small { font-size: 14px; font-weight: 600; color: var(--sw-muted); letter-spacing: 0; }
.rt-tiles .v.tone-success { color: var(--sw-success); }
.rt-site { height: 26px; display: flex; align-items: center; margin: 4px 0 2px; min-width: 0; }
.rt-site a { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--sw-text); }
.rt-site a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-site a:hover span { color: var(--sw-primary-text); }
.rt-site .sw-favicon,
.rt-site .sw-favicon-fallback { width: 22px; height: 22px; flex-basis: 22px; }
.rt-spread { display: flex; gap: 2px; width: 100%; height: 8px; border-radius: 999px; overflow: hidden; background: var(--sw-sunken); }
.rt-spread span { display: block; height: 100%; min-width: 4px; }
.rt-spread .tone-success, .rt-dot.tone-success, .rt-span.tone-success, .rt-avg.tone-success { background: var(--sw-success-solid); }
.rt-spread .tone-info, .rt-dot.tone-info, .rt-span.tone-info, .rt-avg.tone-info { background: var(--sw-info); }
.rt-spread .tone-warning, .rt-dot.tone-warning, .rt-span.tone-warning, .rt-avg.tone-warning { background: var(--sw-warning-solid); }
.rt-spread .tone-danger, .rt-dot.tone-danger, .rt-span.tone-danger, .rt-avg.tone-danger { background: var(--sw-danger-solid); }
.rt-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: 0; }
.rt-dot.tone-neutral { background: var(--sw-text-secondary); }

.rt-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--sw-text-secondary); align-items: center; }
.rt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rt-range-key { display: inline-block; width: 22px; height: 8px; border-radius: 999px; background: var(--sw-text-secondary); opacity: .25; }
.rt-line-key { display: inline-block; width: 0; height: 12px; border-left: 2px dashed var(--sw-warning-solid); }

.rt-rank { padding: 6px 18px 14px; }
.rt-rank-grid { display: flex; flex-direction: column; }
.rt-axis,
.rt-row { display: grid; grid-template-columns: minmax(150px, 240px) minmax(0, 1fr) 118px; gap: 16px; align-items: center; }
.rt-axis { height: 28px; font-size: 11.5px; color: var(--sw-muted); font-variant-numeric: tabular-nums; }
.rt-scale { position: relative; height: 100%; }
.rt-scale span { position: absolute; top: 7px; transform: translateX(-50%); white-space: nowrap; }
.rt-scale span:first-child { transform: none; }
.rt-row { padding: 7px 0; border-top: 1px solid var(--sw-border); color: inherit; text-decoration: none; border-radius: 6px; }
.rt-row:hover { background: var(--sw-card-hover); text-decoration: none; color: inherit; }
.rt-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; font-weight: 500; color: var(--sw-text); }
.rt-name .rt-n { width: 18px; flex: 0 0 18px; text-align: right; font-size: 12px; color: var(--sw-faint); font-variant-numeric: tabular-nums; }
.rt-name .sw-favicon,
.rt-name .sw-favicon-fallback { width: 22px; height: 22px; flex-basis: 22px; }
.rt-row:hover .rt-name .truncate { color: var(--sw-primary-text); }
.rt-track { position: relative; height: 22px; }
.rt-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--sw-border); }
.rt-th { position: absolute; top: -8px; bottom: -8px; width: 0; border-left: 1px dashed; opacity: .55; }
.rt-th.tone-info { border-color: var(--sw-info); opacity: .3; }
.rt-th.tone-warning { border-color: var(--sw-warning-solid); }
.rt-th.tone-danger { border-color: var(--sw-danger-solid); }
.rt-span { position: absolute; top: 50%; height: 8px; margin-top: -4px; border-radius: 999px; opacity: .28; }
.rt-avg { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid var(--sw-card); box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); transition: left .4s cubic-bezier(.4, 0, .2, 1); }
.rt-val { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; font-variant-numeric: tabular-nums; }
.rt-val b { font-size: 14px; font-weight: 650; }
.rt-val b.tone-success { color: var(--sw-success); }
.rt-val b.tone-info { color: var(--sw-info); }
.rt-val b.tone-warning { color: var(--sw-warning-text); }
.rt-val b.tone-danger { color: var(--sw-danger); }
.rt-val small { font-size: 11.5px; color: var(--sw-muted); }
.rt-rank-foot { display: flex; justify-content: center; padding: 0 18px 12px; }
.rt-trend svg { width: 110px; height: 26px; display: block; }
@media (max-width: 767.98px) {
    .rt-axis, .rt-row { grid-template-columns: minmax(0, 1fr) 84px; gap: 8px; }
    .rt-track, .rt-scale { grid-column: 1 / -1; grid-row: 2; }
    .rt-axis { display: none; }
    .rt-row { row-gap: 6px; }
}

/* ==========================================================================
   Client reports (2.1.0)
   ========================================================================== */
.cr-site-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; max-height: 260px; overflow-y: auto; border: 1px solid var(--sw-border); border-radius: var(--sw-radius-control); padding: 4px 12px; background: var(--sw-sunken); }
.cr-site { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; margin: 0; cursor: pointer; min-width: 0; }
.cr-site input { margin-top: 3px; flex: 0 0 auto; }
.cr-site .t { display: block; font-weight: 600; font-size: 13px; color: var(--sw-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-site .d { display: block; font-size: 12px; color: var(--sw-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-fieldset .desc.mt-2 { margin: 8px 0 0; font-size: 12.5px; color: var(--sw-muted); }

.cr-brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.cr-brand-empty { grid-column: 1 / -1; }
.cr-brand-card { overflow: hidden; display: flex; flex-direction: column; }
.cr-brand-logo { position: relative; height: 128px; display: flex; align-items: center; justify-content: center; padding: 22px 24px 18px; background: #FFFFFF; border-bottom: 1px solid var(--sw-border); }
.cr-brand-logo img { max-width: 100%; max-height: 76px; object-fit: contain; }
.cr-brand-stripe { position: absolute; top: 0; left: 0; right: 0; height: 5px; }
.cr-wordmark { font-size: 22px; font-weight: 800; letter-spacing: -.3px; text-align: center; line-height: 1.2; }
.cr-brand-body { padding: 14px 16px 14px; flex: 1; display: flex; flex-direction: column; }
.cr-brand-body .row-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: auto !important; padding-top: 10px; }
.cr-brand-name { font-size: 15px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-brand-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; }
.cr-brand-meta i { margin-right: 3px; }
.cr-swatches { display: flex; gap: 4px; flex: 0 0 auto; }
.cr-swatches span { width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 0 0 1px var(--sw-border-strong); }
.min-w-0 { min-width: 0; }

.cr-logo-drop { display: flex; gap: 14px; align-items: flex-start; }
.cr-logo-preview { flex: 0 0 150px; height: 72px; border: 1px dashed var(--sw-border-strong); border-radius: var(--sw-radius-control); display: flex; align-items: center; justify-content: center; padding: 8px; background: #FFFFFF; }
.cr-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cr-color .form-control-color { flex: 0 0 46px; max-width: 46px; padding: 4px; }

/* Brand preview: a miniature of the report's first page (always light, like the report itself). */
.cr-preview { background: #FFFFFF; color: #1E293B; border: 1px solid var(--sw-border); border-radius: 14px; padding: 20px; box-shadow: var(--sw-shadow-sm); font-size: 12px; position: sticky; top: 0; }
.cr-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.cr-preview-logo { font-weight: 800; font-size: 15px; min-width: 0; }
.cr-preview-logo img { max-height: 34px; max-width: 150px; display: block; }
.cr-preview-eyebrow { font-size: 8.5px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 700; text-align: right; }
.cr-preview-rule { height: 3px; border-radius: 2px; margin: 12px 0 14px; }
.cr-preview-title { font-size: 17px; font-weight: 800; color: #0F172A; letter-spacing: -.3px; }
.cr-preview-meta { color: #64748B; font-size: 11px; margin-top: 2px; }
.cr-preview-meta b { color: #0F172A; }
.cr-preview-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.cr-preview-kpis > div { border: 1px solid #E2E8F0; border-radius: 8px; padding: 8px 10px; }
.cr-preview-kpis span { display: block; width: 18px; height: 2px; border-radius: 2px; margin-bottom: 5px; }
.cr-preview-kpis small { display: block; font-size: 8.5px; text-transform: uppercase; letter-spacing: .8px; font-weight: 700; color: #64748B; }
.cr-preview-kpis b { font-size: 16px; color: #0F172A; }
.cr-preview-chart { --cr-c: #EA580C; height: 54px; margin-top: 12px; border-radius: 8px; border: 1px solid #E2E8F0; background:
    linear-gradient(to top, color-mix(in srgb, var(--cr-c) 14%, transparent), transparent 80%),
    linear-gradient(to right, transparent 0 8%, var(--cr-c) 8% 10%, transparent 10% 20%, var(--cr-c) 20% 22%, transparent 22% 32%, var(--cr-c) 32% 34%, transparent 34% 44%, var(--cr-c) 44% 46%, transparent 46% 56%, var(--cr-c) 56% 58%, transparent 58% 68%, var(--cr-c) 68% 70%, transparent 70% 80%, var(--cr-c) 80% 82%, transparent 82% 92%, var(--cr-c) 92% 94%, transparent 94%) bottom / 100% 60% no-repeat; }
.cr-preview-table { margin-top: 12px; border-radius: 6px; overflow: hidden; font-size: 10.5px; }
.cr-preview-table .th, .cr-preview-table .td { display: flex; justify-content: space-between; padding: 5px 8px; }
.cr-preview-table .th { font-size: 8.5px; text-transform: uppercase; letter-spacing: .8px; font-weight: 700; }
.cr-preview-table .td { border-bottom: 1px solid #EEF2F6; }
.cr-preview-table .td:nth-child(odd) { background: #F8FAFC; }
.cr-preview-foot { margin-top: 12px; padding-top: 8px; border-top: 1px solid #E2E8F0; color: #64748B; font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 767.98px) {
    .cr-site-picker { grid-template-columns: 1fr; }
    .cr-logo-drop { flex-direction: column; }
    .cr-logo-preview { flex-basis: auto; width: 100%; }
}
