/*
 * Public status page - modern visual layer (loaded after status-page-public.css and the theme file).
 * Restyles the existing markup only: class names, the charts and status-page-public.js are untouched.
 * Flat surfaces, one border colour, system font, solid status banner. No gradients, animations or accent stripes.
 * Every colour comes from the tokens below, set per theme on <body class="sp-modern status-page-theme-*">.
 */

body.sp-modern {
    --sp-bg: #f6f7f9;
    --sp-surface: #ffffff;
    --sp-surface-2: #f9fafb;
    --sp-border: #e4e7ec;
    --sp-text: #101828;
    --sp-muted: #667085;
    --sp-accent: #573ff7;
    --sp-header-bg: transparent;
    --sp-header-text: #101828;
    --sp-header-muted: #667085;
    --sp-radius: 12px;
    --sp-ok: #067647;
    --sp-warn: #b54708;
    --sp-bad: #b42318;
    --sp-info: #175cd3;
    --sp-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body.sp-modern.status-page-theme-dark {
    --sp-bg: #0b0d12;
    --sp-surface: #14171f;
    --sp-surface-2: #1a1e28;
    --sp-border: #262b36;
    --sp-text: #eef0f4;
    --sp-muted: #9aa3b2;
    --sp-header-text: #eef0f4;
    --sp-header-muted: #9aa3b2;
    --sp-ok: #17b26a;
    --sp-warn: #f79009;
    --sp-bad: #f97066;
    --sp-info: #53b1fd;
}

body.sp-modern.status-page-theme-minimal {
    --sp-bg: #ffffff;
    --sp-surface: #ffffff;
    --sp-surface-2: #fafafa;
    --sp-border: #ececec;
    --sp-radius: 8px;
}

body.sp-modern.status-page-theme-corporate {
    --sp-bg: #f2f4f7;
    --sp-accent: #1d2939;
    --sp-header-bg: #1d2939;
    --sp-header-text: #ffffff;
    --sp-header-muted: #cbd5e1;
    --sp-radius: 6px;
}

body.sp-modern.status-page-theme-brand {
    --sp-bg: #010036;
    --sp-surface: #0b0b4a;
    --sp-surface-2: #10105a;
    --sp-border: #26267a;
    --sp-text: #e7ebef;
    --sp-muted: #a3a8d6;
    --sp-header-bg: #0b0b4a;
    --sp-header-text: #ffffff;
    --sp-header-muted: #a3a8d6;
    --sp-ok: #17b26a;
    --sp-warn: #f79009;
    --sp-bad: #f97066;
    --sp-info: #8e7dff;
}

/* ---------- Base ---------- */
body.sp-modern {
    background: var(--sp-bg);
    color: var(--sp-text);
    font-family: var(--sp-font);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* One-per-row layouts read best narrow; stacked keeps the full Bootstrap container so its cards sit side by side */
body.sp-modern.sp-layout-list .container {
    max-width: 880px;
}

body.sp-modern .text-muted,
body.sp-modern small.text-muted {
    color: var(--sp-muted) !important;
}

body.sp-modern a {
    color: var(--sp-accent);
}

body.sp-modern.status-page-theme-dark a,
body.sp-modern.status-page-theme-brand a {
    color: var(--sp-info);
}

/* ---------- Header ---------- */
body.sp-modern .status-header {
    background: var(--sp-header-bg);
    color: var(--sp-header-text);
    padding: 2.75rem 0 1.5rem;
    margin: 0 0 1.5rem;
    box-shadow: none;
    border-bottom: 1px solid transparent;
    overflow: visible;
}

body.sp-modern.status-page-theme-corporate .status-header,
body.sp-modern.status-page-theme-brand .status-header {
    border-bottom-color: var(--sp-border);
    padding: 2rem 0;
}

body.sp-modern .status-header::before,
body.sp-modern .status-header::after {
    content: none;
    display: none;
    animation: none;
}

body.sp-modern .status-header .status-title,
body.sp-modern .status-header h1 {
    color: var(--sp-header-text);
    font-size: 1.75rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    margin: 0 0 0.25rem;
    text-shadow: none;
}

body.sp-modern .status-header-subtitle {
    color: var(--sp-header-muted);
    font-size: 1rem;
    margin: 0;
    opacity: 1;
}

body.sp-modern .status-header-logo {
    max-height: 56px;
    max-width: 200px;
    width: auto;
    margin-bottom: 1rem;
}

body.sp-modern .status-header-logo-only {
    text-align: center;
    padding: 2rem 0 1rem;
}

/* ---------- Overall status banner (solid, one colour per state) ---------- */
body.sp-modern .status-banner {
    --sp-state: var(--sp-ok-solid, var(--sp-ok));
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    padding: 1.25rem 1.5rem;
    background: var(--sp-state);
    color: #ffffff;
    border: 0;
    border-radius: var(--sp-radius);
    box-shadow: none;
}

body.sp-modern .status-banner.degraded { --sp-state: var(--sp-warn-solid, var(--sp-warn)); }
body.sp-modern .status-banner.outage { --sp-state: var(--sp-bad-solid, var(--sp-bad)); }
body.sp-modern .status-banner.maintenance { --sp-state: var(--sp-info-solid, var(--sp-info)); }

body.sp-modern.status-page-theme-dark .status-banner,
body.sp-modern.status-page-theme-brand .status-banner {
    color: #0b0d12;
}

body.sp-modern .status-banner::before,
body.sp-modern .status-banner::after {
    content: none;
}

body.sp-modern .status-banner .status-icon {
    background: none;
    border: 0;
    width: auto;
    height: auto;
    font-size: 2rem;
    line-height: 1;
    color: inherit;
    box-shadow: none;
}

body.sp-modern .status-banner .status-content {
    flex: 1 1 260px;
    min-width: 0;
}

body.sp-modern .status-banner .status-title {
    color: inherit;
    font-size: 1.25rem;
    font-weight: 650;
    margin: 0 0 0.125rem;
}

body.sp-modern .status-banner .status-subtitle {
    color: inherit;
    opacity: 0.92;
    margin: 0;
    font-size: 0.9375rem;
}

body.sp-modern .status-banner .status-link {
    color: inherit;
    text-decoration: underline;
}

body.sp-modern .status-stats {
    display: flex;
    gap: 2rem;
    margin: 0;
}

body.sp-modern .status-stats .stat-item {
    background: none;
    border: 0;
    padding: 0;
    text-align: left;
}

body.sp-modern .status-stats .stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 650;
    color: inherit;
    font-variant-numeric: tabular-nums;
}

body.sp-modern .status-stats .stat-label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: inherit;
    opacity: 0.85;
}

/* ---------- Section titles ---------- */
body.sp-modern .section-title {
    font-size: 1.0625rem;
    font-weight: 650;
    color: var(--sp-text);
    margin: 0.75rem 0 0.75rem;
}

body.sp-modern .category-section {
    margin: 1.75rem 0 0.5rem;
}

body.sp-modern .category-title {
    font-size: 0.8125rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sp-muted);
    margin: 0 0 0.25rem;
}

body.sp-modern .category-description {
    color: var(--sp-muted);
    font-size: 0.875rem;
    margin: 0 0 0.5rem;
}

/* ---------- Services ---------- */
body.sp-modern .services-grid,
body.sp-modern .services-grid-single-row,
body.sp-modern .services-grid-compact {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin: 0 0 1rem;
}

/* Stacked layout keeps its original multi-column grid (as many 400px+ cards per row as fit). single-row and compact stay one per row. */
body.sp-modern .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
    align-items: start;
}

body.sp-modern .service-card {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    box-shadow: none;
    padding: 1rem 1.25rem;
    transform: none;
    transition: none;
    min-width: 0;
}

body.sp-modern .service-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--sp-border);
}

body.sp-modern .service-card::before,
body.sp-modern .service-card::after {
    content: none;
}

body.sp-modern .service-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 0.75rem;
    padding: 0;
    border: 0;
}

body.sp-modern .service-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--sp-text);
    margin: 0;
    overflow-wrap: anywhere;
}

/* status text: a coloured label, not a pill */
body.sp-modern .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: none;
    border: 0;
    padding: 0;
    border-radius: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: none;
}

body.sp-modern .status-badge.operational { color: var(--sp-ok); }
body.sp-modern .status-badge.outage { color: var(--sp-bad); }
body.sp-modern .status-badge.degraded { color: var(--sp-warn); }
body.sp-modern .status-badge.maintenance { color: var(--sp-info); }

body.sp-modern .service-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 2rem;
    margin: 0 0 0.75rem;
    padding: 0;
    background: none;
    border: 0;
}

body.sp-modern .service-metrics .metric {
    display: flex;
    flex-direction: column;
    background: none;
    border: 0;
    padding: 0;
}

body.sp-modern .metric-label {
    font-size: 0.75rem;
    color: var(--sp-muted);
    letter-spacing: 0.02em;
}

body.sp-modern .metric-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--sp-text);
    font-variant-numeric: tabular-nums;
}

body.sp-modern .chart-header,
body.sp-modern .chart-header-compact {
    display: flex;
    justify-content: space-between;
    margin: 0 0 0.25rem;
}

body.sp-modern .chart-period {
    font-size: 0.75rem;
    color: var(--sp-muted);
}

body.sp-modern .chart-title {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sp-muted);
    margin: 0.75rem 0 0.25rem;
}

body.sp-modern .chart-uptime-percentage-compact {
    font-size: 0.8125rem;
    color: var(--sp-muted);
    margin-top: 0.25rem;
    font-variant-numeric: tabular-nums;
}

/* ---------- Incidents and maintenance ---------- */
body.sp-modern .incidents-list {
    display: grid;
    gap: 0.75rem;
}

body.sp-modern .incident-item,
body.sp-modern .maintenance-banner {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    box-shadow: none;
    padding: 1rem 1.25rem;
}

body.sp-modern .incident-item::before,
body.sp-modern .maintenance-banner::before {
    content: none;
}

body.sp-modern .incident-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    margin: 0 0 0.5rem;
    padding: 0;
    background: none;
    border: 0;
}

body.sp-modern .incident-title,
body.sp-modern .maintenance-banner-title {
    font-size: 1rem;
    font-weight: 650;
    color: var(--sp-text);
    margin: 0;
}

body.sp-modern .incident-badges {
    display: flex;
    gap: 0.75rem;
}

body.sp-modern .incident-status,
body.sp-modern .incident-severity,
body.sp-modern .maintenance-status {
    background: none;
    border: 0;
    padding: 0;
    border-radius: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--sp-muted);
}

body.sp-modern .incident-status.status-resolved { color: var(--sp-ok); }
body.sp-modern .incident-status.status-investigating,
body.sp-modern .incident-status.status-identified { color: var(--sp-bad); }
body.sp-modern .incident-status.status-monitoring { color: var(--sp-warn); }
body.sp-modern .incident-severity.severity-critical,
body.sp-modern .incident-severity.severity-major { color: var(--sp-bad); }
body.sp-modern .incident-severity.severity-minor { color: var(--sp-warn); }

body.sp-modern .incident-description,
body.sp-modern .maintenance-banner-description {
    color: var(--sp-text);
    margin: 0 0 0.5rem;
}

body.sp-modern .incident-time,
body.sp-modern .incident-duration,
body.sp-modern .maintenance-banner-time,
body.sp-modern .incident-services {
    color: var(--sp-muted);
    font-size: 0.8125rem;
}

body.sp-modern .maintenance-banner {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 0;
}

body.sp-modern .maintenance-banner-icon {
    background: none;
    border: 0;
    width: auto;
    height: auto;
    color: var(--sp-info);
    font-size: 1.25rem;
    line-height: 1.3;
}

/* ---------- Footer ---------- */
body.sp-modern .status-footer {
    text-align: center;
    padding: 1.5rem 0 2.5rem;
    border-top: 1px solid var(--sp-border);
    background: none;
}

body.sp-modern .status-footer p {
    margin: 0 0 0.25rem;
    font-size: 0.8125rem;
    color: var(--sp-muted);
}

/* ---------- Small screens ---------- */
@media (max-width: 575.98px) {
    body.sp-modern .status-header {
        padding: 1.75rem 0 1rem;
    }

    body.sp-modern .status-header .status-title,
    body.sp-modern .status-header h1 {
        font-size: 1.5rem;
    }

    body.sp-modern .status-banner {
        padding: 1rem 1.125rem;
    }

    body.sp-modern .status-stats {
        gap: 1.5rem;
    }

    body.sp-modern .service-card,
    body.sp-modern .incident-item,
    body.sp-modern .maintenance-banner {
        padding: 0.875rem 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.sp-modern * {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- Flatten: no boxes inside cards, tighter rhythm ---------- */
body.sp-modern .service-chart-section,
body.sp-modern .response-time-section,
body.sp-modern .service-chart-section-compact,
body.sp-modern .response-time-section-compact,
body.sp-modern .uptime-chart,
body.sp-modern .uptime-chart-compact,
body.sp-modern .response-time-chart {
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin-left: 0;
    margin-right: 0;
}

body.sp-modern .service-chart-section,
body.sp-modern .service-chart-section-compact {
    margin-top: 0.25rem;
}

body.sp-modern .response-time-section,
body.sp-modern .response-time-section-compact {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--sp-border);
}

body.sp-modern .response-time-chart {
    margin-top: 0.25rem;
}

body.sp-modern .service-metrics {
    justify-content: flex-start;
    text-align: left;
}

body.sp-modern .service-metrics .metric {
    align-items: flex-start;
    text-align: left;
}

body.sp-modern .category-title {
    border: 0;
    padding: 0;
}

body.sp-modern .category-section {
    border: 0;
    padding: 0;
    margin: 1.5rem 0 0.5rem;
}

body.sp-modern .status-content {
    padding-top: 0;
    padding-bottom: 0;
}

/* Page wrapper: with the header hidden nothing sits above it, so it needs its own top space (with a header, the header provides it) */
body.sp-modern > .status-content {
    padding-top: 2rem;
}

body.sp-modern > .status-header + .status-content {
    padding-top: 0;
}

body.sp-modern .status-content > .container > .row {
    margin-bottom: 0.5rem;
}

body.sp-modern .status-header + .status-content .row.mb-4:first-child {
    margin-top: 0;
}

/* ---------- Beat the legacy per-theme rules (gradients, glows, !important colours in status-page-public.css) ---------- */
body.sp-modern .status-header {
    background: var(--sp-header-bg) !important;
    background-image: none !important;
    box-shadow: none !important;
}

body.sp-modern .status-banner,
body.sp-modern .status-banner.operational,
body.sp-modern .status-banner.degraded,
body.sp-modern .status-banner.outage,
body.sp-modern .status-banner.maintenance {
    background: var(--sp-state) !important;
    background-image: none !important;
    box-shadow: none !important;
    border: 0 !important;
}

body.sp-modern .service-card,
body.sp-modern .service-card-compact,
body.sp-modern .incident-item,
body.sp-modern .maintenance-banner {
    background: var(--sp-surface) !important;
    background-image: none !important;
    box-shadow: none !important;
    border: 1px solid var(--sp-border) !important;
}

body.sp-modern .status-badge,
body.sp-modern .status-badge.operational,
body.sp-modern .status-badge.outage,
body.sp-modern .status-badge.degraded,
body.sp-modern .status-badge.maintenance,
body.sp-modern .incident-status,
body.sp-modern .incident-severity,
body.sp-modern .maintenance-status {
    background: none !important;
    background-image: none !important;
    box-shadow: none !important;
    border: 0 !important;
}

body.sp-modern .status-badge.operational { color: var(--sp-ok) !important; }
body.sp-modern .status-badge.outage { color: var(--sp-bad) !important; }
body.sp-modern .status-badge.degraded { color: var(--sp-warn) !important; }
body.sp-modern .status-badge.maintenance { color: var(--sp-info) !important; }
body.sp-modern .status-banner,
body.sp-modern .status-banner .status-title,
body.sp-modern .status-banner .status-subtitle,
body.sp-modern .status-banner .stat-value,
body.sp-modern .status-banner .stat-label,
body.sp-modern .status-banner .status-icon { color: #ffffff !important; }

body.sp-modern.status-page-theme-dark .status-banner,
body.sp-modern.status-page-theme-dark .status-banner .status-title,
body.sp-modern.status-page-theme-dark .status-banner .status-subtitle,
body.sp-modern.status-page-theme-dark .status-banner .stat-value,
body.sp-modern.status-page-theme-dark .status-banner .stat-label,
body.sp-modern.status-page-theme-dark .status-banner .status-icon,
body.sp-modern.status-page-theme-brand .status-banner,
body.sp-modern.status-page-theme-brand .status-banner .status-title,
body.sp-modern.status-page-theme-brand .status-banner .status-subtitle,
body.sp-modern.status-page-theme-brand .status-banner .stat-value,
body.sp-modern.status-page-theme-brand .status-banner .stat-label,
body.sp-modern.status-page-theme-brand .status-banner .status-icon { color: #0b0d12 !important; }

body.sp-modern .status-banner .status-icon {
    background: none !important;
    box-shadow: none !important;
}

/* ---------- Final overrides for the remaining legacy per-theme boxes and colours ---------- */
body.sp-modern .service-chart-section,
body.sp-modern .response-time-section,
body.sp-modern .service-chart-section-compact,
body.sp-modern .response-time-section-compact,
body.sp-modern .uptime-chart,
body.sp-modern .uptime-chart-compact,
body.sp-modern .response-time-chart,
body.sp-modern .chart-header,
body.sp-modern .chart-header-compact {
    background: none !important;
    background-image: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
}

body.sp-modern .service-chart-section,
body.sp-modern .service-chart-section-compact,
body.sp-modern .uptime-chart,
body.sp-modern .uptime-chart-compact,
body.sp-modern .response-time-chart,
body.sp-modern .chart-header,
body.sp-modern .chart-header-compact {
    border-top: 0 !important;
}

body.sp-modern .response-time-section,
body.sp-modern .response-time-section-compact {
    border-top: 1px solid var(--sp-border) !important;
}

body.sp-modern .metric-value,
body.sp-modern .service-name,
body.sp-modern .incident-title,
body.sp-modern .maintenance-banner-title {
    color: var(--sp-text) !important;
}

body.sp-modern .metric-label,
body.sp-modern .chart-period,
body.sp-modern .chart-title,
body.sp-modern .category-title,
body.sp-modern .category-description {
    color: var(--sp-muted) !important;
}

body.sp-modern .section-title {
    color: var(--sp-text) !important;
}

body.sp-modern .status-header .status-title,
body.sp-modern .status-header h1 {
    color: var(--sp-header-text) !important;
}

body.sp-modern .status-header-subtitle {
    color: var(--sp-header-muted) !important;
}

/* incident state text colours (legacy rules set them with !important) */
body.sp-modern .incident-status.status-resolved { color: var(--sp-ok) !important; }
body.sp-modern .incident-status.status-investigating,
body.sp-modern .incident-status.status-identified { color: var(--sp-bad) !important; }
body.sp-modern .incident-status.status-monitoring { color: var(--sp-warn) !important; }
body.sp-modern .incident-severity.severity-critical,
body.sp-modern .incident-severity.severity-major { color: var(--sp-bad) !important; }
body.sp-modern .incident-severity.severity-minor { color: var(--sp-warn) !important; }
body.sp-modern .incident-status,
body.sp-modern .incident-severity {
    letter-spacing: 0.04em;
}

/* ---------- Mobile: explicit layout (legacy rules stack and centre everything) ---------- */
@media (max-width: 768px) {
    body.sp-modern .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    body.sp-modern .status-banner {
        flex-direction: row !important;
        flex-wrap: wrap;
        align-items: flex-start;
        text-align: left !important;
        gap: 0.75rem 1rem;
        padding: 1rem 1.125rem;
    }

    body.sp-modern .status-banner .status-content {
        flex: 1 1 0;
        min-width: 0;
    }

    body.sp-modern .status-banner .status-content h2,
    body.sp-modern .status-banner .status-title {
        font-size: 1.125rem;
    }

    body.sp-modern .status-banner .status-icon {
        font-size: 1.5rem;
    }

    body.sp-modern .status-stats {
        flex: 1 0 100%;
        justify-content: flex-start;
        gap: 2rem;
        width: 100%;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.3);
    }

    body.sp-modern .status-stats .stat-item {
        flex: 0 0 auto;
    }

    body.sp-modern .service-header {
        text-align: left;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    body.sp-modern .service-name {
        text-align: left;
        flex: 1 1 60%;
    }

    body.sp-modern .maintenance-banner {
        flex-direction: row;
        text-align: left;
    }

    body.sp-modern .incident-header {
        flex-direction: column;
        align-items: flex-start;
    }

    body.sp-modern .status-header-subtitle,
    body.sp-modern .status-header .status-title {
        overflow-wrap: anywhere;
    }
}

body.sp-modern .maintenance-banner-content,
body.sp-modern .maintenance-banner-description,
body.sp-modern .maintenance-banner-time,
body.sp-modern .incident-body {
    text-align: left;
}

/* =====================================================================================================================
 * Theme definitions (tokens + the few structural differences). Each theme is meant to look clearly different.
 * ===================================================================================================================== */

/* ---------- Slate: cool dark slate, calm and technical ---------- */
body.sp-modern.status-page-theme-slate {
    --sp-bg: #0f172a;
    --sp-surface: #1e293b;
    --sp-surface-2: #273449;
    --sp-border: #334155;
    --sp-text: #e2e8f0;
    --sp-muted: #94a3b8;
    --sp-accent: #38bdf8;
    --sp-header-text: #f8fafc;
    --sp-header-muted: #94a3b8;
    --sp-radius: 10px;
    --sp-ok: #4ade80;
    --sp-warn: #fbbf24;
    --sp-bad: #f87171;
    --sp-info: #38bdf8;
    --sp-ok-solid: #15803d;
    --sp-warn-solid: #b45309;
    --sp-bad-solid: #b91c1c;
    --sp-info-solid: #1d4ed8;
}

body.sp-modern.status-page-theme-slate a {
    color: var(--sp-accent);
}

/* ---------- Paper: warm off-white, serif headings, outlined banner (editorial) ---------- */
body.sp-modern.status-page-theme-paper {
    --sp-bg: #faf7f2;
    --sp-surface: #fffdf9;
    --sp-surface-2: #f6f1e8;
    --sp-border: #e7dfd1;
    --sp-text: #2a2118;
    --sp-muted: #7a6c58;
    --sp-accent: #8a4b08;
    --sp-header-text: #2a2118;
    --sp-header-muted: #7a6c58;
    --sp-radius: 4px;
    --sp-ok: #3f6212;
    --sp-warn: #b45309;
    --sp-bad: #b91c1c;
    --sp-info: #1d4ed8;
}

body.sp-modern.status-page-theme-paper .status-header .status-title,
body.sp-modern.status-page-theme-paper .status-header h1,
body.sp-modern.status-page-theme-paper .section-title,
body.sp-modern.status-page-theme-paper .service-name,
body.sp-modern.status-page-theme-paper .incident-title,
body.sp-modern.status-page-theme-paper .status-banner .status-title {
    font-family: Georgia, "Iowan Old Style", "Times New Roman", serif !important;
    font-weight: 600;
}

body.sp-modern.status-page-theme-paper .status-banner,
body.sp-modern.status-page-theme-paper .status-banner.operational,
body.sp-modern.status-page-theme-paper .status-banner.degraded,
body.sp-modern.status-page-theme-paper .status-banner.outage,
body.sp-modern.status-page-theme-paper .status-banner.maintenance {
    background: var(--sp-surface) !important;
    border: 1px solid var(--sp-state) !important;
}

body.sp-modern.status-page-theme-paper .status-banner,
body.sp-modern.status-page-theme-paper .status-banner .status-subtitle,
body.sp-modern.status-page-theme-paper .status-banner .stat-value,
body.sp-modern.status-page-theme-paper .status-banner .stat-label {
    color: var(--sp-text) !important;
}

body.sp-modern.status-page-theme-paper .status-banner .status-title,
body.sp-modern.status-page-theme-paper .status-banner .status-icon {
    color: var(--sp-state) !important;
}

/* ---------- Mono: developer look, monospace, square corners, hard borders ---------- */
body.sp-modern.status-page-theme-mono {
    --sp-bg: #ffffff;
    --sp-surface: #ffffff;
    --sp-surface-2: #f5f5f5;
    --sp-border: #111111;
    --sp-text: #111111;
    --sp-muted: #525252;
    --sp-accent: #111111;
    --sp-header-text: #111111;
    --sp-header-muted: #525252;
    --sp-radius: 0;
    --sp-ok: #15803d;
    --sp-warn: #a16207;
    --sp-bad: #b91c1c;
    --sp-info: #1d4ed8;
    --sp-font: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 14px;
}

body.sp-modern.status-page-theme-mono .status-header .status-title,
body.sp-modern.status-page-theme-mono .section-title,
body.sp-modern.status-page-theme-mono .category-title {
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

body.sp-modern.status-page-theme-mono .status-banner {
    border: 2px solid #111111 !important;
}

body.sp-modern.status-page-theme-mono .service-card,
body.sp-modern.status-page-theme-mono .incident-item,
body.sp-modern.status-page-theme-mono .maintenance-banner {
    border: 1px solid #111111 !important;
}

/* ---------- Minimal: no cards, no fill; hairline dividers on a narrow column ---------- */
body.sp-modern.status-page-theme-minimal .container {
    max-width: 720px;
}

body.sp-modern.status-page-theme-minimal .status-header {
    padding: 2.5rem 0 1rem;
    text-align: left;
}

body.sp-modern.status-page-theme-minimal .status-header .col-12 {
    text-align: left !important;
}

body.sp-modern.status-page-theme-minimal .status-header-logo {
    margin-left: 0;
}

body.sp-modern.status-page-theme-minimal .status-banner,
body.sp-modern.status-page-theme-minimal .status-banner.operational,
body.sp-modern.status-page-theme-minimal .status-banner.degraded,
body.sp-modern.status-page-theme-minimal .status-banner.outage,
body.sp-modern.status-page-theme-minimal .status-banner.maintenance {
    background: none !important;
    border: 0 !important;
    border-top: 1px solid var(--sp-border) !important;
    border-bottom: 1px solid var(--sp-border) !important;
    border-radius: 0 !important;
    padding: 1.25rem 0;
}

body.sp-modern.status-page-theme-minimal .status-banner,
body.sp-modern.status-page-theme-minimal .status-banner .status-subtitle,
body.sp-modern.status-page-theme-minimal .status-banner .stat-value,
body.sp-modern.status-page-theme-minimal .status-banner .stat-label {
    color: var(--sp-text) !important;
}

body.sp-modern.status-page-theme-minimal .status-banner .status-title,
body.sp-modern.status-page-theme-minimal .status-banner .status-icon {
    color: var(--sp-state) !important;
}

body.sp-modern.status-page-theme-minimal .service-card,
body.sp-modern.status-page-theme-minimal .service-card-compact,
body.sp-modern.status-page-theme-minimal .incident-item,
body.sp-modern.status-page-theme-minimal .maintenance-banner {
    background: none !important;
    border: 0 !important;
    border-bottom: 1px solid var(--sp-border) !important;
    border-radius: 0 !important;
    padding-left: 0;
    padding-right: 0;
}

body.sp-modern.status-page-theme-minimal .services-grid,
body.sp-modern.status-page-theme-minimal .services-grid-single-row,
body.sp-modern.status-page-theme-minimal .services-grid-compact {
    gap: 0;
}

body.sp-modern.status-page-theme-minimal .services-grid-single-row,
body.sp-modern.status-page-theme-minimal .services-grid-compact {
    grid-template-columns: 1fr;
}

body.sp-modern.status-page-theme-minimal .incidents-list {
    gap: 0;
}

body.sp-modern.status-page-theme-minimal .section-title,
body.sp-modern.status-page-theme-minimal .category-title {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sp-muted) !important;
    font-weight: 600;
}

body.sp-modern.status-page-theme-minimal .status-footer {
    border-top: 0;
    text-align: left;
}

/* maintenance notice text: legacy per-theme colours made it unreadable on dark themes */
body.sp-modern .maintenance-banner-description,
body.sp-modern .maintenance-banner-description strong {
    color: var(--sp-text) !important;
}

body.sp-modern .maintenance-banner-time,
body.sp-modern .maintenance-banner-time i {
    color: var(--sp-muted) !important;
}

body.sp-modern .maintenance-banner-title {
    color: var(--sp-text) !important;
}

body.sp-modern .maintenance-banner-icon,
body.sp-modern .maintenance-banner-icon i {
    color: var(--sp-info) !important;
}

/* Mono: every heading uses the monospace stack */
body.sp-modern.status-page-theme-mono h1,
body.sp-modern.status-page-theme-mono h2,
body.sp-modern.status-page-theme-mono h3,
body.sp-modern.status-page-theme-mono h4,
body.sp-modern.status-page-theme-mono .service-name,
body.sp-modern.status-page-theme-mono .incident-title,
body.sp-modern.status-page-theme-mono .maintenance-banner-title,
body.sp-modern.status-page-theme-mono .status-banner .status-title {
    font-family: var(--sp-font) !important;
}

/* ---------- Orbit: futuristic mission-control view. Dark glass panels, cyan accent, interactive service map (status-page-orbit.js) ----------
 * Performance rules for this theme: no backdrop-filter (blurring behind every panel repainted the page on scroll), no
 * background-attachment: fixed (the backdrop is a single fixed layer on its own compositor layer), no preserve-3d / translateZ
 * on children, will-change only on the one card being hovered. Service cards start collapsed so their charts are not drawn
 * until opened. */
body.sp-modern.status-page-theme-orbit {
    --sp-bg: #05070d;
    --sp-surface: #0d121c;
    --sp-surface-2: #131a27;
    --sp-border: rgba(255, 255, 255, 0.1);
    --sp-text: #e6edf7;
    --sp-muted: #8a97ad;
    --sp-accent: #22d3ee;
    --sp-header-text: #f4f8ff;
    --sp-header-muted: #8a97ad;
    --sp-radius: 18px;
    --sp-ok: #34d399;
    --sp-warn: #fbbf24;
    --sp-bad: #fb7185;
    --sp-info: #22d3ee;
    --sp-ok-solid: #34d399;
    --sp-warn-solid: #fbbf24;
    --sp-bad-solid: #fb7185;
    --sp-info-solid: #22d3ee;
    background-color: #05070d;
    background-image: none;
}

/* the backdrop: one fixed layer, composited once, never repainted on scroll */
body.sp-modern.status-page-theme-orbit::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    transform: translateZ(0);
    background-image:
        radial-gradient(1200px 600px at 50% -10%, rgba(34, 211, 238, 0.07), transparent 60%),
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: auto, 56px 56px, 56px 56px;
}

body.sp-modern.status-page-theme-orbit a {
    color: var(--sp-accent);
}

body.sp-modern.status-page-theme-orbit .status-header .status-title,
body.sp-modern.status-page-theme-orbit .status-header h1 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

body.sp-modern.status-page-theme-orbit .status-header-subtitle {
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

/* panels: flat translucent fill and a lighter top edge (cheap to paint) */
body.sp-modern.status-page-theme-orbit .service-card,
body.sp-modern.status-page-theme-orbit .service-card-compact,
body.sp-modern.status-page-theme-orbit .incident-item,
body.sp-modern.status-page-theme-orbit .maintenance-banner {
    background: var(--sp-surface) !important;
    border: 1px solid var(--sp-border) !important;
    border-top-color: rgba(255, 255, 255, 0.2) !important;
    border-radius: var(--sp-radius) !important;
    box-shadow: none !important;
}

/* status banner: tinted panel, state colour in the text */
body.sp-modern.status-page-theme-orbit .status-banner,
body.sp-modern.status-page-theme-orbit .status-banner.operational,
body.sp-modern.status-page-theme-orbit .status-banner.degraded,
body.sp-modern.status-page-theme-orbit .status-banner.outage,
body.sp-modern.status-page-theme-orbit .status-banner.maintenance {
    background: color-mix(in srgb, var(--sp-state) 11%, #0d121c) !important;
    border: 1px solid color-mix(in srgb, var(--sp-state) 45%, transparent) !important;
    border-top-color: color-mix(in srgb, var(--sp-state) 70%, white 10%) !important;
    border-radius: 22px !important;
    padding: 1.5rem 1.75rem;
}

body.sp-modern.status-page-theme-orbit .status-banner,
body.sp-modern.status-page-theme-orbit .status-banner .status-subtitle,
body.sp-modern.status-page-theme-orbit .status-banner .stat-label {
    color: var(--sp-muted) !important;
}

body.sp-modern.status-page-theme-orbit .status-banner .status-title,
body.sp-modern.status-page-theme-orbit .status-banner .status-icon {
    color: var(--sp-state) !important;
}

body.sp-modern.status-page-theme-orbit .status-banner .status-title {
    font-size: 1.5rem;
    letter-spacing: 0.01em;
}

body.sp-modern.status-page-theme-orbit .status-banner .stat-value {
    color: var(--sp-text) !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.375rem;
    font-weight: 500;
}

body.sp-modern.status-page-theme-orbit .status-banner .status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border: 1px solid color-mix(in srgb, var(--sp-state) 60%, transparent) !important;
    border-radius: 50%;
    font-size: 1.5rem;
    background: color-mix(in srgb, var(--sp-state) 14%, transparent) !important;
}

body.sp-modern.status-page-theme-orbit .metric-value,
body.sp-modern.status-page-theme-orbit .chart-uptime-percentage-compact {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 500;
}

body.sp-modern.status-page-theme-orbit .metric-label,
body.sp-modern.status-page-theme-orbit .chart-title,
body.sp-modern.status-page-theme-orbit .category-title,
body.sp-modern.status-page-theme-orbit .chart-period,
body.sp-modern.status-page-theme-orbit .status-badge {
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.6875rem;
}

body.sp-modern.status-page-theme-orbit .response-time-section,
body.sp-modern.status-page-theme-orbit .response-time-section-compact {
    border-top-color: rgba(255, 255, 255, 0.08) !important;
}

body.sp-modern.status-page-theme-orbit .status-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

/* ---------- Collapsible service cards: a closed card draws no charts ---------- */
body.sp-modern.status-page-theme-orbit .service-card .service-header {
    cursor: pointer;
}

body.sp-modern.status-page-theme-orbit .service-card .service-header::after {
    content: '';
    flex: 0 0 auto;
    width: 0.5rem;
    height: 0.5rem;
    margin-left: 0.25rem;
    border-right: 2px solid var(--sp-muted);
    border-bottom: 2px solid var(--sp-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease-out;
}

body.sp-modern.status-page-theme-orbit .service-card.is-open .service-header::after {
    transform: rotate(-135deg);
}

body.sp-modern.status-page-theme-orbit .service-card:not(.is-open) .service-chart-section,
body.sp-modern.status-page-theme-orbit .service-card:not(.is-open) .response-time-section,
body.sp-modern.status-page-theme-orbit .service-card-compact:not(.is-open) .service-chart-section-compact,
body.sp-modern.status-page-theme-orbit .service-card-compact:not(.is-open) .response-time-section-compact {
    display: none;
}

body.sp-modern.status-page-theme-orbit .service-card:not(.is-open) .service-header {
    margin-bottom: 0.5rem;
}

body.sp-modern.status-page-theme-orbit .service-card.is-selected {
    border-color: rgba(34, 211, 238, 0.6) !important;
}

/* tilt only the card under the pointer, only on a precise pointer, only when motion is allowed */
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
    body.sp-modern.status-page-theme-orbit .service-card:hover,
    body.sp-modern.status-page-theme-orbit .service-card-compact:hover {
        transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
        will-change: transform;
        border-color: rgba(34, 211, 238, 0.45) !important;
    }

    body.sp-modern.status-page-theme-orbit .service-card,
    body.sp-modern.status-page-theme-orbit .service-card-compact {
        transition: transform 0.15s ease-out, border-color 0.15s ease-out;
    }
}

/* ---------- Crystal: light liquid-glass. Cool colour behind translucent panels with a thick bright rim, a refracted inner edge and a light streak ----------
 * Performance: the colour field is ONE fixed layer on its own compositor layer (never repainted on scroll) and drifts slowly
 * with a transform. The big panels use NO backdrop-filter (the field behind them is smooth colour, so blurring it adds nothing but
 * cost); only the status banner gets a real, small blur. The glass look comes from the rim, the inner edge light and the streak. */
body.sp-modern.status-page-theme-crystal {
    --sp-bg: #e6eef9;
    --sp-surface: rgba(255, 255, 255, 0.4);
    --sp-surface-2: rgba(255, 255, 255, 0.58);
    --sp-border: rgba(255, 255, 255, 0.8);
    --sp-text: #0c1a2e;
    --sp-muted: #4b5d78;
    --sp-accent: #1d5fd1;
    --sp-header-text: #0c1a2e;
    --sp-header-muted: #4b5d78;
    --sp-radius: 28px;
    --sp-ok: #0b8a5a;
    --sp-warn: #a85f00;
    --sp-bad: #c0343a;
    --sp-info: #1d5fd1;
    --sp-ok-solid: #0b8a5a;
    --sp-warn-solid: #a85f00;
    --sp-bad-solid: #c0343a;
    --sp-info-solid: #1d5fd1;
    background-color: #e6eef9;
    background-image: none;
}

/* cool colour field: sky, aqua, ice and soft cyan blobs, slowly drifting (transform only) */
body.sp-modern.status-page-theme-crystal::before {
    content: '';
    position: fixed;
    inset: -12%;
    z-index: -1;
    pointer-events: none;
    background-image:
        radial-gradient(closest-side, rgba(56, 152, 255, 0.8), rgba(56, 152, 255, 0) 100%),
        radial-gradient(closest-side, rgba(34, 211, 200, 0.75), rgba(34, 211, 200, 0) 100%),
        radial-gradient(closest-side, rgba(90, 170, 255, 0.7), rgba(90, 170, 255, 0) 100%),
        radial-gradient(closest-side, rgba(103, 232, 249, 0.65), rgba(103, 232, 249, 0) 100%),
        radial-gradient(closest-side, rgba(70, 140, 255, 0.6), rgba(70, 140, 255, 0) 100%),
        radial-gradient(closest-side, rgba(45, 212, 191, 0.55), rgba(45, 212, 191, 0) 100%);
    background-size: 46% 46%, 44% 44%, 48% 48%, 42% 42%, 44% 44%, 42% 42%;
    background-repeat: no-repeat;
    background-position: 2% 6%, 98% 14%, 96% 90%, 4% 92%, 22% 46%, 80% 58%;
    will-change: transform;
    animation: crystal-drift 38s ease-in-out infinite alternate;
}

@keyframes crystal-drift {
    from { transform: translate3d(-2%, -1%, 0) scale(1); }
    to { transform: translate3d(2%, 2%, 0) scale(1.06); }
}

body.sp-modern.status-page-theme-crystal a {
    color: var(--sp-accent);
}

body.sp-modern.status-page-theme-crystal .status-header .status-title,
body.sp-modern.status-page-theme-crystal .status-header h1 {
    font-size: 2rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

/* THE GLASS: translucent fill, bright rim, inner edge light (refraction at the border), a diagonal light streak on top */
body.sp-modern.status-page-theme-crystal .service-card,
body.sp-modern.status-page-theme-crystal .service-card-compact,
body.sp-modern.status-page-theme-crystal .incident-item,
body.sp-modern.status-page-theme-crystal .maintenance-banner,
body.sp-modern.status-page-theme-crystal .status-banner,
body.sp-modern.status-page-theme-crystal .status-banner.operational,
body.sp-modern.status-page-theme-crystal .status-banner.degraded,
body.sp-modern.status-page-theme-crystal .status-banner.outage,
body.sp-modern.status-page-theme-crystal .status-banner.maintenance {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.08) 38%, rgba(255, 255, 255, 0.02) 62%, rgba(255, 255, 255, 0.34) 100%),
        var(--sp-surface) !important;
    border: 1px solid var(--sp-border) !important;
    border-radius: var(--sp-radius) !important;
    box-shadow:
        inset 0 1.5px 0 rgba(255, 255, 255, 1),
        inset 0 -1.5px 0 rgba(255, 255, 255, 0.45),
        inset 1.5px 0 0 rgba(255, 255, 255, 0.5),
        inset -1.5px 0 0 rgba(255, 255, 255, 0.5),
        inset 0 0 22px rgba(120, 190, 255, 0.28),
        0 14px 28px -18px rgba(12, 40, 90, 0.4) !important;
}

/* banner: tinted by state, the one panel with a real (small) blur */
body.sp-modern.status-page-theme-crystal .status-banner,
body.sp-modern.status-page-theme-crystal .status-banner.operational,
body.sp-modern.status-page-theme-crystal .status-banner.degraded,
body.sp-modern.status-page-theme-crystal .status-banner.outage,
body.sp-modern.status-page-theme-crystal .status-banner.maintenance {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.08) 40%, rgba(255, 255, 255, 0.02) 62%, rgba(255, 255, 255, 0.34) 100%),
        color-mix(in srgb, var(--sp-state) 16%, rgba(255, 255, 255, 0.5)) !important;
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    backdrop-filter: blur(10px) saturate(160%);
    border-radius: 34px !important;
    padding: 1.5rem 1.75rem;
}

body.sp-modern.status-page-theme-crystal .status-banner,
body.sp-modern.status-page-theme-crystal .status-banner .status-subtitle,
body.sp-modern.status-page-theme-crystal .status-banner .stat-label {
    color: var(--sp-muted) !important;
}

body.sp-modern.status-page-theme-crystal .status-banner .status-title {
    color: color-mix(in srgb, var(--sp-state) 78%, #0c1a2e) !important;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
}

body.sp-modern.status-page-theme-crystal .status-banner .stat-value {
    color: var(--sp-text) !important;
    font-size: 1.375rem;
}

/* the banner icon sits in a small glass lens */
body.sp-modern.status-page-theme-crystal .status-banner .status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    font-size: 1.5rem;
    color: color-mix(in srgb, var(--sp-state) 85%, #0c1a2e) !important;
    background: radial-gradient(circle at 30% 25%, #ffffff 0%, rgba(255, 255, 255, 0.55) 60%, rgba(255, 255, 255, 0.35) 100%) !important;
    box-shadow: inset 0 1.5px 0 #fff, inset 0 -3px 6px rgba(120, 190, 255, 0.3), 0 6px 14px -8px rgba(12, 40, 90, 0.45) !important;
}

/* status label: a small glass capsule */
body.sp-modern.status-page-theme-crystal .status-badge {
    padding: 0.22rem 0.7rem !important;
    border-radius: 999px !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.45)) !important;
    box-shadow: inset 0 1px 0 #fff, 0 2px 6px -3px rgba(12, 40, 90, 0.35) !important;
}

body.sp-modern.status-page-theme-crystal .response-time-section,
body.sp-modern.status-page-theme-crystal .response-time-section-compact {
    border-top-color: rgba(12, 26, 46, 0.08) !important;
}

body.sp-modern.status-page-theme-crystal .status-footer {
    border-top-color: rgba(12, 26, 46, 0.08);
}

/* pointer-following light (status-page-orbit.js sets --mx / --my): a soft white specular spot, not a glow */
body.sp-modern.status-page-theme-crystal .service-card::after,
body.sp-modern.status-page-theme-crystal .service-card-compact::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 60%);
    transition: opacity 0.2s ease-out;
}

body.sp-modern.status-page-theme-crystal .service-card:hover::after,
body.sp-modern.status-page-theme-crystal .service-card-compact:hover::after {
    opacity: 1;
}

@media (max-width: 768px) {
    body.sp-modern.status-page-theme-crystal {
        --sp-radius: 22px;
    }

    body.sp-modern.status-page-theme-crystal .status-banner {
        border-radius: 26px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.sp-modern.status-page-theme-crystal::before {
        animation: none;
    }
}

body.sp-modern.status-page-theme-orbit .service-card .service-status {
    margin-left: auto;
}

/* =====================================================================================================================
 * Orbit: the 3D scene (status-page-orbit.js draws the canvas, everything here is the HUD around it)
 * ===================================================================================================================== */
.orbit-scene {
    position: relative;
    width: 100%;
    height: clamp(460px, 76vh, 700px);
    margin: 0 0 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    overflow: hidden;
    background: #03050a;
}

.orbit-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: none;
    outline: none;
}

.orbit-canvas:active {
    cursor: grabbing;
}

.orbit-canvas:focus-visible {
    box-shadow: inset 0 0 0 2px #22d3ee;
}

.orbit-hud {
    position: absolute;
    pointer-events: none;
    color: #e6edf7;
    font-size: 0.8125rem;
}

.orbit-hud > *,
.orbit-hud button {
    pointer-events: auto;
}

.orbit-hud [hidden] {
    display: none !important;
}

.orbit-hud-top {
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.orbit-chip {
    --c: #34d399;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
    border-radius: 999px;
    background: rgba(5, 9, 16, 0.78);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.orbit-chip.is-down { --c: #fb7185; }
.orbit-chip.is-warn { --c: #fbbf24; }

.orbit-chip-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--c);
    animation: orbit-blink 1.6s ease-in-out infinite;
}

.orbit-hint {
    margin-top: 0.45rem;
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    color: #8a97ad;
    text-align: right;
}

.orbit-hud-card {
    --c: #34d399;
    left: 1rem;
    bottom: 1rem;
    width: min(330px, calc(100% - 2rem));
    padding: 1rem 1.15rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: rgba(5, 9, 16, 0.82);
}

.orbit-hud-card.is-down { --c: #fb7185; }
.orbit-hud-card.is-warn { --c: #fbbf24; }

.orbit-card-empty {
    margin: 0;
    color: #8a97ad;
    line-height: 1.5;
}

.orbit-card-state {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c);
}

.orbit-card-name {
    margin: 0.2rem 0 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #f4f8ff;
    overflow-wrap: anywhere;
}

.orbit-card-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.orbit-card-label {
    display: block;
    font-size: 0.625rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8a97ad;
}

.orbit-card-value {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.25rem;
    font-weight: 500;
    color: #e6edf7;
}

.orbit-btn {
    padding: 0.45rem 1rem;
    border: 1px solid #22d3ee;
    border-radius: 999px;
    background: transparent;
    color: #22d3ee;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.orbit-btn:hover,
.orbit-btn:focus-visible {
    background: rgba(34, 211, 238, 0.14);
    outline: none;
}

.orbit-hud-controls {
    right: 1rem;
    bottom: 1rem;
    display: flex;
    gap: 0.5rem;
}

.orbit-icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    background: rgba(5, 9, 16, 0.82);
    color: #e6edf7;
    font: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.orbit-icon:hover,
.orbit-icon:focus-visible {
    border-color: #22d3ee;
    color: #22d3ee;
    outline: none;
}

@keyframes orbit-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

@media (max-width: 640px) {
    .orbit-scene {
        height: clamp(520px, 80vh, 640px);
    }

    .orbit-hint {
        display: none;
    }

    .orbit-hud-controls {
        top: 3.4rem;
        bottom: auto;
        flex-direction: column;
    }
}

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

/* =====================================================================================================================
 * Crystal: EVERY glass component reacts like liquid glass (cards, banner, incidents, maintenance, labels, tooltips)
 * ===================================================================================================================== */
@keyframes crystal-liquid {
    0% { border-radius: 28px 32px 30px 34px / 34px 28px 32px 30px; }
    50% { border-radius: 34px 28px 32px 30px / 28px 34px 30px 32px; }
    100% { border-radius: 30px 34px 28px 32px / 32px 30px 34px 28px; }
}

body.sp-modern.status-page-theme-crystal .service-card,
body.sp-modern.status-page-theme-crystal .service-card-compact,
body.sp-modern.status-page-theme-crystal .incident-item,
body.sp-modern.status-page-theme-crystal .maintenance-banner,
body.sp-modern.status-page-theme-crystal .status-banner {
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease-out;
}

/* the pointer light on every panel, not only the service cards */
body.sp-modern.status-page-theme-crystal .incident-item::after,
body.sp-modern.status-page-theme-crystal .maintenance-banner::after,
body.sp-modern.status-page-theme-crystal .status-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 60%);
    transition: opacity 0.2s ease-out;
}

body.sp-modern.status-page-theme-crystal .incident-item:hover::after,
body.sp-modern.status-page-theme-crystal .maintenance-banner:hover::after,
body.sp-modern.status-page-theme-crystal .status-banner:hover::after {
    opacity: 1;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    body.sp-modern.status-page-theme-crystal .service-card:hover,
    body.sp-modern.status-page-theme-crystal .service-card-compact:hover,
    body.sp-modern.status-page-theme-crystal .incident-item:hover,
    body.sp-modern.status-page-theme-crystal .maintenance-banner:hover,
    body.sp-modern.status-page-theme-crystal .status-banner:hover {
        transform: translateY(-3px) scale(1.006);
        animation: crystal-liquid 3.4s ease-in-out infinite alternate;
        border-color: #ffffff !important;
        box-shadow:
            inset 0 2px 0 #ffffff,
            inset 0 -2px 0 rgba(255, 255, 255, 0.6),
            inset 2px 0 0 rgba(255, 255, 255, 0.6),
            inset -2px 0 0 rgba(255, 255, 255, 0.6),
            inset 0 0 34px rgba(120, 190, 255, 0.42),
            0 22px 36px -18px rgba(12, 40, 90, 0.5) !important;
    }

    body.sp-modern.status-page-theme-crystal .status-badge:hover {
        transform: translateY(-1px);
        box-shadow: inset 0 1px 0 #fff, inset 0 0 10px rgba(120, 190, 255, 0.4), 0 6px 12px -6px rgba(12, 40, 90, 0.45) !important;
    }

    body.sp-modern.status-page-theme-crystal .status-badge {
        transition: transform 0.25s ease-out, box-shadow 0.25s ease-out;
    }
}

/* chart tooltips and Bootstrap tooltips become small glass plates */
body.sp-modern.status-page-theme-crystal .chartjs-tooltip,
body.sp-modern.status-page-theme-crystal .tooltip .tooltip-inner {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(235, 244, 255, 0.78)) !important;
    border: 1px solid #ffffff !important;
    border-radius: 16px !important;
    color: #0c1a2e !important;
    box-shadow:
        inset 0 1.5px 0 #ffffff,
        inset 0 0 14px rgba(120, 190, 255, 0.3),
        0 14px 26px -14px rgba(12, 40, 90, 0.5) !important;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

body.sp-modern.status-page-theme-crystal .chartjs-tooltip *,
body.sp-modern.status-page-theme-crystal .tooltip .tooltip-inner * {
    color: #0c1a2e !important;
}

body.sp-modern.status-page-theme-crystal .tooltip .tooltip-arrow::before {
    border-top-color: rgba(255, 255, 255, 0.9) !important;
}

/* Orbit: live monitoring ticker, bottom centre of the scene */
.orbit-hud-ticker {
    --c: #34d399;
    left: 50%;
    bottom: 1.15rem;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: 38%;
    padding: 0.4rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(5, 9, 16, 0.7);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    color: #aebbd0;
    pointer-events: none;
    white-space: nowrap;
}

.orbit-hud-ticker.is-down { --c: #fb7185; }
.orbit-hud-ticker.is-warn { --c: #fbbf24; }

.orbit-ticker-dot {
    flex: 0 0 auto;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: var(--c);
    animation: orbit-blink 1.1s ease-in-out infinite;
}

.orbit-ticker-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 900px) {
    .orbit-hud-ticker {
        display: none;
    }
}

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

/* ticker: sits between the info card (left) and the controls (right) so it never overlaps either */
.orbit-hud-ticker {
    left: auto;
    right: 13rem;
    transform: none;
    max-width: calc(100% - 330px - 13rem - 3rem);
}

@media (max-width: 1000px) {
    .orbit-hud-ticker {
        display: none;
    }
}

/* Orbit: left column of the top bar (health chip + service picker for big pages) */
.orbit-hud-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    min-width: 0;
}

.orbit-jump {
    max-width: min(260px, 60vw);
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(5, 9, 16, 0.82);
    color: #e6edf7;
    font: inherit;
    font-size: 0.75rem;
    cursor: pointer;
}

.orbit-jump:hover,
.orbit-jump:focus-visible {
    border-color: #22d3ee;
    outline: none;
}

.orbit-jump option {
    background: #0b111b;
    color: #e6edf7;
}
