:root {
    --bg: #07111f;
    --panel: #0d1a2b;
    --panel-2: #102238;
    --panel-3: rgba(255, 255, 255, 0.055);
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.16);
    --text: #f4f7fb;
    --muted: #95a4b8;
    --muted-2: #64748b;
    --green: #2bd576;
    --red: #ff4d5d;
    --amber: #f4b942;
    --blue: #70a7ff;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    --radius: 22px;
    --radius-sm: 14px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(112, 167, 255, 0.17), transparent 34rem),
        radial-gradient(circle at top right, rgba(43, 213, 118, 0.09), transparent 30rem),
        var(--bg);
}

a {
    color: inherit;
}

button,
select {
    color: var(--text);
    font: inherit;
}

button {
    cursor: pointer;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.72rem clamp(1rem, 4vw, 3rem);
    border-bottom: 1px solid var(--line);
    background: rgba(7, 17, 31, 0.88);
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
    text-decoration: none;
}

.brand-logo {
    width: 2.2rem;
    height: 2.2rem;
    flex: 0 0 auto;
    border-radius: 0.8rem;
    box-shadow: 0 0 30px rgba(112, 167, 255, 0.35);
    object-fit: contain;
}

.brand strong,
.brand small {
    display: block;
    line-height: 1.1;
}

.brand strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand small {
    margin-top: 0.18rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.page-shell {
    width: min(1480px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.25rem 0 3rem;
}

.panel,
.legal-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.072), rgba(255, 255, 255, 0.034));
    box-shadow: var(--shadow);
}

.panel {
    margin-bottom: 1.25rem;
    overflow: hidden;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0.35rem;
    font-size: clamp(1.45rem, 3vw, 2.15rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

h2 {
    margin-bottom: 0.25rem;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.eyebrow {
    margin: 0 0 0.45rem;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    font-weight: 800;
}

.muted {
    color: var(--muted);
    line-height: 1.6;
}

.compact {
    margin-bottom: 0;
}

.status-panel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.85rem 1rem;
    padding: 0.72rem 0.85rem;
    border-bottom: 1px solid var(--line);
}

.compact-head {
    min-height: 0;
}

.panel-summary {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.45rem;
    min-width: 0;
}

.summary-chip {
    display: inline-flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.55rem;
    min-width: 5.15rem;
    padding: 0.42rem 0.62rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

.summary-chip b {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.summary-chip strong {
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1;
    letter-spacing: -0.02em;
}

.summary-chip.good strong { color: var(--green); }
.summary-chip.bad strong { color: var(--red); }
.summary-chip.neutral strong { color: var(--text); }

.status-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.status-meta span {
    white-space: nowrap;
}

.panel-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.4rem;
}


.updated-pill {
    display: inline-flex;
    align-items: center;
    min-height: 2.05rem;
    padding: 0.45rem 0.62rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 760;
    white-space: nowrap;
}

.action-button {
    padding: 0.45rem 0.62rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 760;
}

.action-button:hover {
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.service-list {
    column-count: 2;
    column-gap: 0.55rem;
    padding: 0.7rem;
}

.service-row {
    display: inline-block;
    width: 100%;
    min-width: 0;
    margin: 0 0 0.55rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.044);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
    overflow: hidden;
    break-inside: avoid;
}

.service-row:hover {
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.058);
}

.service-row[open] {
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.055);
}

.service-row.up { box-shadow: inset 3px 0 rgba(43, 213, 118, 0.82); }
.service-row.down { box-shadow: inset 3px 0 rgba(255, 77, 93, 0.88); }
.service-row.partial { box-shadow: inset 3px 0 rgba(244, 185, 66, 0.88); }
.service-row.unknown { box-shadow: inset 3px 0 rgba(112, 167, 255, 0.82); }

.service-summary {
    display: grid;
    gap: 0.36rem;
    padding: 0.54rem 0.68rem 0.52rem 0.78rem;
    list-style: none;
    cursor: pointer;
}

.service-summary::-webkit-details-marker {
    display: none;
}

.service-compact-top,
.service-compact-foot,
.service-chart-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.service-compact-top {
    align-items: center;
}

.service-check-url {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
    font-size: 0.91rem;
    font-weight: 760;
    letter-spacing: -0.018em;
}

.service-summary:hover .service-check-url {
    color: var(--blue);
}

.service-pills {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    gap: 0.35rem;
}

.status-pill,
.uptime-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
    align-self: center;
    margin-top: 0.06rem;
    padding: 0.32rem 0.52rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 18px currentColor;
}

.status-pill.up { color: var(--green); }
.status-pill.down { color: var(--red); }
.status-pill.partial { color: var(--amber); }
.status-pill.unknown { color: var(--blue); }
.status-pill.up .dot { background: var(--green); }
.status-pill.down .dot { background: var(--red); }
.status-pill.partial .dot { background: var(--amber); }
.status-pill.unknown .dot { background: var(--blue); }

.uptime-pill {
    justify-content: center;
    min-width: 4.55rem;
    padding-inline: 0.54rem;
    letter-spacing: -0.01em;
}

.uptime-pill.up {
    color: var(--green);
    border-color: rgba(43, 213, 118, 0.24);
    background: rgba(43, 213, 118, 0.075);
}

.uptime-pill.partial {
    color: var(--amber);
    border-color: rgba(244, 185, 66, 0.25);
    background: rgba(244, 185, 66, 0.08);
}

.uptime-pill.down {
    color: #ffd6da;
    border-color: rgba(255, 77, 93, 0.25);
    background: rgba(255, 77, 93, 0.08);
}

.uptime-pill.unknown {
    color: #d7e7ff;
    border-color: rgba(112, 167, 255, 0.24);
    background: rgba(112, 167, 255, 0.08);
}

.status-bar {
    display: grid;
    grid-template-columns: repeat(var(--bucket-count, 96), minmax(2px, 1fr));
    gap: 2px;
    width: 100%;
}

.bucket {
    height: 0.46rem;
    min-width: 2px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.09);
}

.bucket.ok { background: var(--green); }
.bucket.fail { background: var(--red); }
.bucket.partial { background: var(--amber); }
.bucket.incomplete { background: rgba(43, 213, 118, 0.44); }
.bucket.gap { background: repeating-linear-gradient(135deg, rgba(112, 167, 255, 0.86) 0 3px, rgba(112, 167, 255, 0.34) 3px 6px); }
.bucket.empty { background: rgba(255, 255, 255, 0.09); }

.service-compact-foot {
    align-items: center;
    color: var(--muted-2);
    font-size: 0.73rem;
    line-height: 1.25;
}

.service-compact-foot span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.service-note {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    max-width: max-content;
    padding: 0.14rem 0.36rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    font-size: 0.68rem;
    font-weight: 800;
}

.service-note.down { color: #ffd6da; border-color: rgba(255, 77, 93, 0.22); background: rgba(255, 77, 93, 0.07); }
.service-note.partial { color: #ffe3a5; border-color: rgba(244, 185, 66, 0.22); background: rgba(244, 185, 66, 0.08); }
.service-note.unknown { color: #d7e7ff; border-color: rgba(112, 167, 255, 0.24); background: rgba(112, 167, 255, 0.08); }

.codes-preview {
    margin-left: auto;
    text-align: right;
}

.service-details {
    display: grid;
    gap: 0.58rem;
    margin: 0 0.68rem 0.68rem 0.78rem;
    padding-top: 0.58rem;
    border-top: 1px solid var(--line);
}

.row-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.42rem;
}

.row-metrics span {
    min-width: 0;
    padding: 0.46rem 0.52rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
}

.row-metrics b,
.service-code-panel b {
    display: block;
    overflow: hidden;
    color: var(--muted-2);
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.row-metrics strong {
    display: block;
    overflow: hidden;
    margin-top: 0.18rem;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.86rem;
    letter-spacing: -0.025em;
}

.service-code-panel {
    display: grid;
    gap: 0.36rem;
    padding: 0.54rem 0.58rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.026);
}

.code-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.code-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.28rem 0.44rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.045);
    font-size: 0.72rem;
    font-weight: 760;
}

.code-badge.ok { color: var(--green); }
.code-badge.fail { color: #ffd6da; border-color: rgba(255, 77, 93, 0.28); background: rgba(255, 77, 93, 0.08); }
.code-badge.neutral { color: var(--muted); }

.error-text,
.warning-text,
.info-text {
    margin: 0;
    padding: 0.7rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    line-height: 1.45;
}

.error-text {
    border: 1px solid rgba(255, 77, 93, 0.28);
    color: #ffd6da;
    background: rgba(255, 77, 93, 0.08);
}

.warning-text {
    border: 1px solid rgba(112, 167, 255, 0.28);
    color: #d7e7ff;
    background: rgba(112, 167, 255, 0.08);
}

.info-text {
    border: 1px solid rgba(149, 164, 184, 0.22);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
}

.error-text b,
.warning-text b,
.info-text b {
    color: #fff;
}

.service-chart-card {
    display: grid;
    gap: 0.55rem;
    padding: 0.58rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(3, 9, 17, 0.22);
}

.service-chart-head {
    align-items: center;
}

.service-chart-head > span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.service-chart-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.service-chart-controls label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--muted-2);
    font-size: 0.74rem;
}

.service-chart-controls select {
    min-width: 7.8rem;
    padding: 0.34rem 0.46rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    background: var(--panel-2);
    font-size: 0.76rem;
}

.range-buttons {
    display: flex;
    gap: 0.25rem;
    padding: 0.18rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
}

.range-buttons button {
    padding: 0.32rem 0.44rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 0.74rem;
}

.range-buttons button:hover,
.range-buttons button.active {
    background: rgba(255, 255, 255, 0.09);
    color: var(--text);
}

.chart-stack {
    display: grid;
    gap: 0.58rem;
}

.metric-chart {
    display: grid;
    gap: 0.34rem;
}

.metric-chart-title {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 820;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.service-chart-canvas {
    display: block;
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(3, 9, 17, 0.4);
}

.chart-hint {
    color: var(--muted-2);
    font-size: 0.82rem;
}

.compact-hint {
    margin: -0.12rem 0 0;
    font-size: 0.72rem;
}

.footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    width: min(1480px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 0 0 2rem;
    color: var(--muted-2);
    font-size: 0.86rem;
}

.footer a {
    color: inherit;
}

.legal-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 1rem;
    align-items: start;
}

.legal-card {
    padding: clamp(1.2rem, 4vw, 2rem);
    overflow-wrap: anywhere;
}

.legal-card h1 {
    font-size: clamp(2.1rem, 5vw, 3.6rem);
}

.legal-card h2 {
    margin-top: 1.4rem;
}

.legal-card p,
.legal-card li {
    color: var(--muted);
    line-height: 1.7;
}

.legal-card address {
    color: var(--muted);
    font-style: normal;
    line-height: 1.7;
}

.legal-card ul {
    padding-left: 1.2rem;
}

@media (max-width: 1320px) {
    .row-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .status-panel-head {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .panel-summary,
    .panel-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 1100px) {
    .legal-layout {
        grid-template-columns: 1fr;
    }

    .service-list {
        column-count: 1;
    }
}

@media (max-width: 760px) {
    .topbar {
        align-items: stretch;
    }

    .panel-summary {
        justify-content: stretch;
    }

    .summary-chip {
        flex: 1 1 calc(50% - 0.45rem);
    }

.updated-pill {
        width: 100%;
        justify-content: center;
    }

    .service-compact-top,
    .service-compact-foot,
    .service-chart-head {
        align-items: stretch;
        flex-direction: column;
        gap: 0.45rem;
    }

    .service-pills {
        justify-content: flex-start;
    }

    .codes-preview {
        margin-left: 0;
        text-align: left;
    }

    .service-chart-controls,
    .service-chart-controls label,
    .service-chart-controls select,
    .range-buttons {
        width: 100%;
    }

    .service-chart-controls label {
        display: grid;
    }

    .range-buttons button {
        flex: 1;
    }

    .row-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .page-shell,
    .footer {
        width: min(100% - 1rem, 1480px);
    }

    .service-list {
        padding: 0.55rem;
        gap: 0.55rem;
    }

    .row-metrics {
        grid-template-columns: 1fr;
    }

    .bucket {
        height: 0.52rem;
        border-radius: 2px;
    }
}

/* v1.5.0 mobile-first refinements */
@media (hover: none) {
    .service-row:hover,
    .service-summary:hover .service-check-url {
        border-color: var(--line);
        color: var(--text);
    }
}

.service-chart-canvas {
    cursor: grab;
    touch-action: none;
}

.service-chart-canvas:active {
    cursor: grabbing;
}

@media (max-width: 760px) {
    html {
        -webkit-text-size-adjust: 100%;
    }

    body {
        background:
            radial-gradient(circle at top left, rgba(112, 167, 255, 0.14), transparent 25rem),
            radial-gradient(circle at top right, rgba(43, 213, 118, 0.08), transparent 24rem),
            var(--bg);
    }

    button,
    summary,
    a {
        -webkit-tap-highlight-color: transparent;
    }

    .topbar {
        align-items: center;
        min-height: 3.45rem;
        padding: calc(0.54rem + env(safe-area-inset-top, 0px)) max(0.85rem, env(safe-area-inset-left, 0px)) 0.54rem max(0.85rem, env(safe-area-inset-right, 0px));
    }

    .brand {
        gap: 0.62rem;
    }

    .brand-logo {
        width: 2rem;
        height: 2rem;
        border-radius: 0.72rem;
    }

    .brand strong {
        font-size: 0.96rem;
    }

    .brand small {
        font-size: 0.72rem;
    }

    .page-shell {
        width: 100%;
        padding: 0.58rem 0.48rem 2rem;
    }

    .panel {
        border-radius: 18px;
        margin-bottom: 0.9rem;
    }

    .status-panel-head {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.52rem;
        padding: 0.56rem;
    }

    .panel-summary {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.34rem;
    }

    .summary-chip {
        flex: none;
        align-items: center;
        justify-content: center;
        min-width: 0;
        min-height: 2.45rem;
        gap: 0.16rem;
        padding: 0.34rem 0.28rem;
        text-align: center;
    }

    .summary-chip b,
    .summary-chip strong {
        display: block;
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .summary-chip b {
        font-size: 0.62rem;
    }

    .summary-chip strong {
        font-size: 0.86rem;
    }

    .panel-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        width: 100%;
        gap: 0.34rem;
    }

    .updated-pill,
    .action-button {
        min-height: 44px;
        padding: 0.38rem 0.48rem;
        font-size: 0.71rem;
    }

    .updated-pill {
        width: auto;
        justify-content: center;
        overflow: hidden;
        min-width: 0;
        text-overflow: ellipsis;
    }

    .action-button {
        white-space: nowrap;
    }

    .service-list {
        column-count: 1;
        padding: 0.48rem;
    }

    .service-row {
        margin-bottom: 0.48rem;
        border-radius: 15px;
    }

    .service-summary {
        gap: 0.32rem;
        padding: 0.58rem 0.62rem 0.52rem 0.72rem;
    }

    .service-compact-top {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.48rem;
    }

    .service-check-url {
        font-size: 0.88rem;
        line-height: 1.22;
    }

    .service-pills {
        justify-content: flex-end;
        gap: 0.24rem;
    }

    .status-pill,
    .uptime-pill {
        min-height: 1.62rem;
        padding: 0.25rem 0.39rem;
        font-size: 0.62rem;
        gap: 0.27rem;
    }

    .uptime-pill {
        min-width: 4.12rem;
    }

    .dot {
        width: 0.42rem;
        height: 0.42rem;
    }

    .status-bar {
        gap: 1px;
    }

    .bucket {
        height: 0.42rem;
        min-width: 1px;
    }

    .service-compact-foot {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.26rem 0.42rem;
        font-size: 0.68rem;
    }

    .service-note {
        justify-self: end;
        padding: 0.13rem 0.34rem;
        font-size: 0.61rem;
    }

    .codes-preview {
        grid-column: 1 / -1;
        margin-left: 0;
        text-align: left;
    }

    .service-details {
        gap: 0.48rem;
        margin: 0 0.58rem 0.62rem 0.68rem;
        padding-top: 0.5rem;
    }

    .row-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.34rem;
    }

    .row-metrics span {
        padding: 0.42rem 0.45rem;
        border-radius: 11px;
    }

    .row-metrics b,
    .service-code-panel b {
        font-size: 0.6rem;
    }

    .row-metrics strong {
        font-size: 0.8rem;
    }

    .service-code-panel,
    .service-chart-card {
        border-radius: 12px;
        padding: 0.48rem;
    }

    .code-badge {
        padding: 0.25rem 0.39rem;
        font-size: 0.66rem;
    }

    .error-text,
    .warning-text,
    .info-text {
        padding: 0.6rem 0.64rem;
        font-size: 0.78rem;
    }

    .service-chart-head {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.42rem;
    }

    .range-buttons {
        width: 100%;
        gap: 0.18rem;
        padding: 0.16rem;
    }

    .range-buttons button {
        flex: 1;
        min-height: 44px;
        padding: 0.3rem 0.2rem;
        font-size: 0.68rem;
    }

    .metric-chart-title {
        font-size: 0.67rem;
    }

    .service-chart-canvas {
        height: 150px;
        border-radius: 11px;
    }

    .compact-hint {
        font-size: 0.66rem;
        line-height: 1.35;
    }

    .footer {
        width: 100%;
        padding: 0.25rem 0.7rem calc(1.2rem + env(safe-area-inset-bottom, 0px));
        gap: 0.42rem;
        font-size: 0.72rem;
        line-height: 1.4;
    }
}

@media (max-width: 420px) {
    .page-shell {
        padding-inline: 0.36rem;
    }

    .status-panel-head {
        padding: 0.48rem;
    }

    .summary-chip {
        min-height: 2.28rem;
        padding-inline: 0.18rem;
    }

    .summary-chip b {
        font-size: 0.58rem;
    }

    .summary-chip strong {
        font-size: 0.8rem;
    }

    .panel-actions {
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 0.28rem;
    }

    .updated-pill,
    .action-button {
        min-height: 44px;
        padding-inline: 0.4rem;
        font-size: 0.66rem;
    }

    .service-summary {
        padding-inline: 0.56rem;
    }

    .service-check-url {
        font-size: 0.84rem;
    }

    .status-pill,
    .uptime-pill {
        font-size: 0.58rem;
        padding-inline: 0.32rem;
    }

    .uptime-pill {
        min-width: 3.86rem;
    }

    .service-chart-canvas {
        height: 138px;
    }
}

@media (max-width: 360px) {
    .panel-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .panel-actions {
        grid-template-columns: 1fr 1fr;
    }

    .updated-pill {
        grid-column: 1 / -1;
    }

    .service-compact-top {
        grid-template-columns: 1fr;
        gap: 0.32rem;
    }

    .service-pills {
        justify-content: flex-start;
    }

    .row-metrics {
        grid-template-columns: 1fr;
    }
}

/* v1.6.0 heartbeat and nested status history */
.heartbeat-pill {
    display: inline-flex;
    align-items: center;
    min-height: 2.05rem;
    padding: 0.45rem 0.62rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 760;
    white-space: nowrap;
}

.heartbeat-pill.ok {
    color: var(--green);
    border-color: rgba(43, 213, 118, 0.22);
    background: rgba(43, 213, 118, 0.07);
}

.heartbeat-pill.stale,
.heartbeat-pill.unknown {
    color: #d7e7ff;
    border-color: rgba(112, 167, 255, 0.24);
    background: rgba(112, 167, 255, 0.08);
}

.heartbeat-pill.error {
    color: #ffd6da;
    border-color: rgba(255, 77, 93, 0.28);
    background: rgba(255, 77, 93, 0.08);
}

.history-panel {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.026);
    overflow: hidden;
}

.history-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.58rem 0.64rem;
    list-style: none;
    cursor: pointer;
}

.history-summary::-webkit-details-marker {
    display: none;
}

.history-summary span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.history-summary small {
    flex: 0 0 auto;
    color: var(--muted-2);
    font-size: 0.72rem;
    font-weight: 760;
}

.history-panel[open] .history-summary {
    border-bottom: 1px solid var(--line);
}

.history-list {
    display: grid;
    gap: 0.32rem;
    padding: 0.5rem;
}

.history-item {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 0.46rem;
    padding: 0.42rem 0.48rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.026);
}

.history-item.up { box-shadow: inset 2px 0 rgba(43, 213, 118, 0.72); }
.history-item.down { box-shadow: inset 2px 0 rgba(255, 77, 93, 0.78); }
.history-item.unknown { box-shadow: inset 2px 0 rgba(112, 167, 255, 0.72); }

.history-time {
    color: var(--muted-2);
    font-size: 0.68rem;
    font-weight: 760;
    white-space: nowrap;
}

.history-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.7rem;
    padding: 0.2rem 0.35rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.03em;
}

.history-badge.up { color: var(--green); border-color: rgba(43, 213, 118, 0.24); background: rgba(43, 213, 118, 0.07); }
.history-badge.down { color: #ffd6da; border-color: rgba(255, 77, 93, 0.28); background: rgba(255, 77, 93, 0.08); }
.history-badge.unknown { color: #d7e7ff; border-color: rgba(112, 167, 255, 0.24); background: rgba(112, 167, 255, 0.08); }

.history-main {
    display: grid;
    min-width: 0;
    gap: 0.08rem;
}

.history-main b,
.history-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-main b {
    color: var(--text);
    font-size: 0.76rem;
}

.history-main small,
.history-empty {
    color: var(--muted-2);
    font-size: 0.7rem;
}

.history-empty {
    margin: 0;
    padding: 0.35rem 0.2rem;
    line-height: 1.4;
}

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

    .heartbeat-pill,
    .updated-pill,
    .action-button {
        min-height: 44px;
        padding: 0.38rem 0.48rem;
        font-size: 0.69rem;
    }

    .heartbeat-pill,
    .updated-pill {
        justify-content: center;
        overflow: hidden;
        min-width: 0;
        text-overflow: ellipsis;
    }

    .history-summary {
        padding: 0.5rem 0.54rem;
    }

    .history-list {
        padding: 0.42rem;
    }

    .history-item {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 0.32rem 0.42rem;
        padding: 0.4rem 0.42rem;
    }

    .history-time {
        font-size: 0.64rem;
    }

    .history-badge {
        min-width: 4.2rem;
        font-size: 0.58rem;
    }

    .history-main {
        grid-column: 1 / -1;
    }

    .history-main b {
        font-size: 0.72rem;
    }

    .history-main small {
        font-size: 0.66rem;
        white-space: normal;
    }
}

@media (max-width: 360px) {
    .panel-actions {
        grid-template-columns: 1fr;
    }

    .heartbeat-pill,
    .updated-pill,
    .action-button {
        width: 100%;
    }
}

/* ===========================================================================
   PETUJA NAVBAR / THEME SYSTEM
   ========================================================================== */
:root {
    --surface-solid: #102238;
    --surface-soft: #13283e;
    --surface-hover: rgba(112, 167, 255, 0.12);
    --accent: #70a7ff;
    --accent-strong: #a8c8ff;
    --accent-soft: rgba(112, 167, 255, 0.14);
    --navbar-bg: rgba(7, 17, 31, 0.76);
    --navbar-bg-scrolled: rgba(7, 17, 31, 0.96);
    --navbar-shadow: 0 14px 38px rgba(0, 0, 0, 0.28);
    --danger-text: #ffd6da;
    --info-text: #d7e7ff;
    --chart-bg: rgba(3, 9, 17, 0.4);
    --navbar-height: 72px;
    --navbar-height-compact: 66px;
    --navbar-inline: clamp(16px, 3vw, 44px);
    --navbar-z: 1000;
    --overlay-z: 1200;
    --navbar-radius: 18px;
    --navbar-control-size: 42px;
    --ease-standard: cubic-bezier(.2, .8, .2, 1);
    --ease-emphasized: cubic-bezier(.2, .9, .2, 1);
    --duration-fast: 140ms;
    --duration-normal: 220ms;
}

html[data-theme="light"] {
    --bg: #f4f8fb;
    --panel: #ffffff;
    --panel-2: #edf5f8;
    --panel-3: rgba(29, 41, 45, 0.045);
    --line: rgba(29, 41, 45, 0.14);
    --line-strong: rgba(29, 41, 45, 0.24);
    --text: #1d292d;
    --muted: #60747b;
    --muted-2: #71838a;
    --green: #18875d;
    --red: #c93447;
    --amber: #a66b10;
    --blue: #087fa7;
    --shadow: 0 20px 60px rgba(37, 66, 77, 0.14);
    --surface-solid: #ffffff;
    --surface-soft: #edf5f8;
    --surface-hover: #e5f3f7;
    --accent: #0dacdb;
    --accent-strong: #357386;
    --accent-soft: rgba(13, 172, 219, 0.13);
    --navbar-bg: rgba(255, 255, 255, 0.78);
    --navbar-bg-scrolled: rgba(255, 255, 255, 0.96);
    --navbar-shadow: 0 14px 38px rgba(37, 66, 77, 0.14);
    --danger-text: #a51f2e;
    --info-text: #245d78;
    --chart-bg: rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] body {
    background:
        radial-gradient(circle at top left, rgba(13, 172, 219, 0.12), transparent 34rem),
        radial-gradient(circle at top right, rgba(24, 135, 93, 0.08), transparent 30rem),
        var(--bg);
}

body {
    transition: background-color var(--duration-normal), color var(--duration-normal);
}

/* The status monitor uses a compact extraction of the reference navbar. */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--navbar-z);
    height: var(--navbar-height);
    transition: transform var(--duration-normal) var(--ease-standard), background var(--duration-normal), box-shadow var(--duration-normal);
}

.icon {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(112, 167, 255, .34);
    border-radius: 8px;
}

html[data-theme="light"] :focus-visible {
    box-shadow: 0 0 0 3px rgba(13, 172, 219, .28);
}

.navbar {
    position: relative;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    padding-inline: var(--navbar-inline);
    border-bottom: 1px solid transparent;
    background: var(--navbar-bg);
    box-shadow: none;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    transition: background var(--duration-normal), border-color var(--duration-normal), box-shadow var(--duration-normal);
}

.site-header.is-scrolled .navbar {
    background: var(--navbar-bg-scrolled);
    border-color: var(--line);
    box-shadow: var(--navbar-shadow);
}

.navbar__left,
.navbar__right {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
    transform: translateY(-50%);
}

.navbar__left { left: var(--navbar-inline); }
.navbar__right { right: var(--navbar-inline); justify-content: flex-end; }

.navbar__center {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: calc(100vw - (2 * var(--navbar-inline)));
    transform: translate(-50%, -50%);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    border-radius: 12px;
    text-decoration: none;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(13, 172, 219, 0.22);
    object-fit: contain;
}

.brand__text {
    display: grid;
    min-width: 0;
    line-height: 1.05;
}

.brand__eyebrow {
    margin-bottom: 4px;
    color: var(--muted-2);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.brand__name {
    max-width: min(26vw, 330px);
    overflow: hidden;
    color: var(--text);
    font-size: 16px;
    font-weight: 780;
    letter-spacing: -.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.desktop-nav {
    position: relative;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 3px;
}

.nav-item,
.action-wrap { position: relative; }

.nav-link,
.nav-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--duration-fast), background var(--duration-fast);
}

.nav-link:hover,
.nav-trigger:hover,
.nav-item.is-open > .nav-trigger,
.nav-link[aria-current="page"] {
    color: var(--text);
    background: var(--surface-hover);
}

.chevron {
    width: 14px;
    height: 14px;
    transition: transform var(--duration-fast) var(--ease-standard);
}

.nav-item.is-open > .nav-trigger > .chevron { transform: rotate(180deg); }

.magic-line {
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 3px;
    border-radius: 999px;
    background: var(--accent);
    opacity: 0;
    pointer-events: none;
    transform: translateX(0);
    transition: transform var(--duration-normal) var(--ease-emphasized), width var(--duration-normal) var(--ease-emphasized), opacity var(--duration-fast);
}

.magic-line.is-visible { opacity: 1; }

.dropdown,
.action-popover {
    position: absolute;
    z-index: 5;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--navbar-radius);
    background: var(--surface-solid);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px) scale(.985);
    transition: opacity var(--duration-fast), transform var(--duration-fast) var(--ease-standard), visibility 0s linear var(--duration-fast);
}

.dropdown {
    top: calc(100% + 12px);
    right: 0;
    width: min(420px, calc(100vw - 24px));
    transform-origin: top right;
}

.action-popover {
    top: calc(100% + 11px);
    right: 0;
    width: 230px;
    border-radius: 16px;
    transform-origin: top right;
}

.nav-item.is-open > .dropdown,
.action-wrap.is-open > .action-popover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition-delay: 0s;
}

.dropdown__header {
    padding: 10px 12px 7px;
    color: var(--muted-2);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.menu-link,
.choice-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    padding: 9px 10px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--text);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--duration-fast), color var(--duration-fast);
}

.menu-link:hover,
.choice-button:hover,
.choice-button[aria-checked="true"] {
    background: var(--surface-hover);
}

.menu-link__icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 10px;
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.menu-link__icon .icon { width: 17px; height: 17px; }
.menu-link__body { min-width: 0; flex: 1; }
.menu-link__title { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; }
.menu-link__description { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.menu-link__aside { margin-left: auto; color: var(--muted-2); }
.menu-link__aside .icon { width: 15px; height: 15px; }

.action-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-button,
.menu-button {
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast);
}

.icon-button {
    width: var(--navbar-control-size);
    height: var(--navbar-control-size);
    display: grid;
    place-items: center;
    border-radius: 12px;
}

.menu-button {
    min-height: var(--navbar-control-size);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

.icon-button:hover,
.menu-button:hover,
.action-wrap.is-open > .icon-button,
.action-wrap.is-open > .menu-button {
    color: var(--text);
    background: var(--surface-hover);
}

.icon-button:active,
.menu-button:active { transform: scale(.97); }
.choice-list { display: grid; gap: 3px; }
.choice-button { min-height: 42px; padding: 8px 10px; }
.choice-button .icon { flex: 0 0 auto; }
.choice-button__check { margin-left: auto; opacity: 0; }
.choice-button[aria-checked="true"] { color: var(--accent-strong); }
.choice-button[aria-checked="true"] .choice-button__check { opacity: 1; }

.mobile-toggle { display: none; }
.mobile-toggle__line { transform-box: fill-box; transform-origin: center; transition: transform var(--duration-normal) var(--ease-standard), opacity var(--duration-fast); }
.mobile-toggle[aria-expanded="true"] .mobile-toggle__line--top { transform: translateY(5px) rotate(45deg); }
.mobile-toggle[aria-expanded="true"] .mobile-toggle__line--middle { opacity: 0; }
.mobile-toggle[aria-expanded="true"] .mobile-toggle__line--bottom { transform: translateY(-5px) rotate(-45deg); }

.mobile-backdrop {
    position: fixed;
    inset: 0;
    z-index: calc(var(--overlay-z) - 1);
    background: rgba(0, 0, 0, .58);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--duration-normal), visibility 0s linear var(--duration-normal);
}

.mobile-nav {
    position: fixed;
    inset: 0;
    z-index: var(--overlay-z);
    display: grid;
    grid-template-rows: auto 1fr;
    height: 100dvh;
    background: var(--surface-solid);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity var(--duration-normal), transform var(--duration-normal) var(--ease-standard), visibility 0s linear var(--duration-normal);
}

.mobile-nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition-delay: 0s;
}

.mobile-nav__header {
    min-height: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 var(--navbar-inline);
    border-bottom: 1px solid var(--line);
}

.mobile-nav__body {
    overflow: auto;
    overscroll-behavior: contain;
    padding: 22px max(var(--navbar-inline), env(safe-area-inset-left, 0px)) calc(28px + env(safe-area-inset-bottom, 0px));
}

.mobile-menu { width: min(100%, 820px); margin: 0 auto; }
.mobile-menu__section-label { margin: 18px 4px 7px; color: var(--muted-2); font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.mobile-link,
.mobile-accordion__trigger {
    width: 100%;
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    font-size: clamp(17px, 4vw, 22px);
    font-weight: 720;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.mobile-link[aria-current="page"] { color: var(--accent-strong); }
.mobile-accordion__trigger .chevron { width: 18px; height: 18px; margin-left: auto; }
.mobile-accordion.is-open > .mobile-accordion__trigger .chevron { transform: rotate(180deg); }
.mobile-accordion__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--duration-normal) var(--ease-standard); }
.mobile-accordion.is-open > .mobile-accordion__panel { grid-template-rows: 1fr; }
.mobile-accordion__inner { overflow: hidden; }
.mobile-submenu { margin: 0 0 8px 12px; padding: 4px 0 4px 14px; border-left: 2px solid var(--line); }
.mobile-submenu .mobile-link { min-height: 46px; border-bottom: 0; border-radius: 9px; font-size: 14px; font-weight: 650; }
.mobile-submenu .mobile-link:hover { background: var(--surface-hover); }
.mobile-link--external { font-size: 15px; }
.mobile-actions { display: grid; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.mobile-action-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; min-height: 52px; padding: 8px 0; }
.mobile-action-row__label { color: var(--text); font-weight: 700; }
.segmented { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-3); }
.segmented button { min-width: 38px; min-height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 760; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface-solid); color: var(--text); box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }

body.is-compact-nav .navbar__center,
body.is-compact-nav .navbar__right .desktop-only { display: none !important; }
body.is-compact-nav .mobile-toggle { display: grid; }

@media (max-width: 900px) {
    .navbar__center,
    .navbar__right .desktop-only { display: none !important; }
    .mobile-toggle { display: grid; }
    .brand__name { max-width: min(55vw, 320px); }
}

@media (max-width: 620px) {
    :root { --navbar-inline: 14px; --navbar-height: var(--navbar-height-compact); --navbar-control-size: 40px; }
    .brand__eyebrow { display: none; }
    .brand__name { max-width: 52vw; font-size: 15px; }
    .brand-logo { width: 36px; height: 36px; border-radius: 11px; }
    .mobile-nav__header { min-height: var(--navbar-height); }
    .mobile-nav__body { padding-top: 14px; }
}

@media (max-width: 380px) {
    .brand__text { display: none; }
}

html[data-theme="light"] .error-text {
    color: var(--danger-text);
    background: rgba(201, 52, 71, .08);
}

html[data-theme="light"] .warning-text {
    color: var(--info-text);
    background: rgba(8, 127, 167, .08);
}

html[data-theme="light"] .info-text {
    color: var(--muted);
    background: rgba(29, 41, 45, .035);
}

html[data-theme="light"] .error-text b,
html[data-theme="light"] .warning-text b,
html[data-theme="light"] .info-text b {
    color: var(--text);
}

html[data-theme="light"] .uptime-pill.down,
html[data-theme="light"] .code-badge.fail,
html[data-theme="light"] .history-badge.down,
html[data-theme="light"] .service-note.down {
    color: var(--danger-text);
}

html[data-theme="light"] .uptime-pill.unknown,
html[data-theme="light"] .history-badge.unknown,
html[data-theme="light"] .service-note.unknown,
html[data-theme="light"] .heartbeat-pill.stale,
html[data-theme="light"] .heartbeat-pill.unknown {
    color: var(--info-text);
}

html[data-theme="light"] .service-chart-card,
html[data-theme="light"] .service-chart-canvas {
    background: var(--chart-bg);
}

@media (forced-colors: active) {
    .magic-line { background: Highlight; }
    .dropdown, .action-popover, .panel, .legal-card, .service-row { border: 1px solid CanvasText; }
    :focus-visible { outline: 2px solid Highlight; outline-offset: 3px; box-shadow: none; }
}

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

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .navbar { background: var(--surface-solid); }
}

[hidden] {
    display: none !important;
}

/* ===========================================================================
   PETUJA SYSTEMS VISUAL THEME
   Semantic roles keep the brand palette consistent across both themes.
   ========================================================================== */

:root {
    --brand-cyan: #0DACDB;
    --brand-blue: #2891B1;
    --brand-blue-deep: #357386;
    --brand-neutral-mid: #33525C;
    --brand-neutral-dark: #253033;
    --brand-neutral-deep: #2E3233;
    --brand-orange: #DB6500;
    --brand-orange-mid: #B1621D;
    --brand-orange-deep: #86572D;
    --brand-purple: #28184D;

    --color-page-background: #0D191C;
    --color-surface: #142327;
    --color-surface-elevated: #1B2D32;
    --color-surface-subtle: #20373D;
    --color-primary-text: #F4F8F8;
    --color-secondary-text: #C1D0D2;
    --color-muted-text: #8EA4A8;
    --color-border: rgba(51, 82, 92, .72);
    --color-border-strong: #53747D;
    --color-primary-accent: var(--brand-orange);
    --color-link: var(--brand-cyan);
    --color-hover: #244047;
    --color-active: #3A2B1D;
    --color-selected: rgba(219, 101, 0, .18);
    --color-focus: #F0A264;
    --color-success: #65D09A;
    --color-warning: #E7B85F;
    --color-error: #FF7D86;
    --color-info: #8ED4E3;
    --color-unknown-surface: #28184D;
    --color-unknown-text: #D8CCF5;

    --bg: var(--color-page-background);
    --panel: var(--color-surface);
    --panel-2: var(--color-surface-elevated);
    --panel-3: var(--color-surface-subtle);
    --line: var(--color-border);
    --line-strong: var(--color-border-strong);
    --text: var(--color-primary-text);
    --muted: var(--color-secondary-text);
    --muted-2: var(--color-muted-text);
    --green: var(--color-success);
    --red: var(--color-error);
    --amber: var(--color-warning);
    --blue: var(--color-link);
    --shadow: 0 16px 38px rgba(4, 12, 14, .28);
    --radius: 16px;
    --radius-sm: 10px;

    --surface-solid: var(--color-surface-elevated);
    --surface-soft: var(--color-surface-subtle);
    --surface-hover: var(--color-hover);
    --accent: var(--color-primary-accent);
    --accent-strong: var(--color-focus);
    --accent-soft: var(--color-selected);
    --navbar-bg: var(--color-surface);
    --navbar-bg-scrolled: var(--color-surface);
    --navbar-shadow: 0 12px 28px rgba(4, 12, 14, .32);
    --danger-text: #FFD9DC;
    --info-text: var(--color-info);
    --chart-bg: var(--color-surface-subtle);
    --navbar-radius: 12px;
}

html[data-theme="light"] {
    --color-page-background: #F4F8F8;
    --color-surface: #FFFFFF;
    --color-surface-elevated: #F0F6F7;
    --color-surface-subtle: #E6F0F2;
    --color-primary-text: var(--brand-neutral-dark);
    --color-secondary-text: var(--brand-neutral-mid);
    --color-muted-text: #5B737A;
    --color-border: #B8CDD2;
    --color-border-strong: #7F9EA6;
    --color-primary-accent: var(--brand-blue);
    --color-link: var(--brand-blue-deep);
    --color-hover: #E4F0F2;
    --color-active: #D6EBEF;
    --color-selected: #D9EDF1;
    --color-focus: #0A7E9E;
    --color-success: #1D7654;
    --color-warning: #875C0B;
    --color-error: #B52E3F;
    --color-info: #24657A;
    --color-unknown-surface: #EEE8F8;
    --color-unknown-text: #49356F;

    --shadow: 0 14px 32px rgba(37, 48, 51, .11);
    --navbar-shadow: 0 12px 28px rgba(37, 48, 51, .12);
    --danger-text: var(--color-error);
    --info-text: var(--color-info);
    --chart-bg: var(--color-surface-elevated);
}

html,
body {
    background: var(--color-page-background);
}

body {
    color: var(--color-primary-text);
}

.panel,
.legal-card {
    border-color: var(--color-border);
    background: var(--color-surface);
    box-shadow: var(--shadow);
}

.page-shell {
    padding-top: 1.4rem;
}

.eyebrow,
.footer a:hover,
.service-summary:hover .service-check-url {
    color: var(--color-primary-accent);
}

.muted,
.legal-card p,
.legal-card li,
.legal-card address {
    color: var(--color-secondary-text);
}

.summary-chip,
.updated-pill,
.action-button,
.service-row,
.status-pill,
.uptime-pill,
.service-note,
.row-metrics span,
.service-code-panel,
.code-badge,
.range-buttons,
.history-item {
    border-color: var(--color-border);
    background: var(--color-surface-elevated);
}

.summary-chip b,
.updated-pill,
.service-compact-foot,
.row-metrics b,
.service-code-panel b,
.history-time,
.history-main small,
.chart-hint {
    color: var(--color-muted-text);
}

.summary-chip.good strong,
.status-pill.up,
.uptime-pill.up,
.code-badge.ok,
.history-badge.up {
    color: var(--color-success);
}

.summary-chip.bad strong,
.status-pill.down,
.history-badge.down,
.error-text,
.error-text b {
    color: var(--color-error);
}

.summary-chip.neutral strong,
.status-pill.unknown,
.uptime-pill.unknown,
.history-badge.unknown,
.service-note.unknown,
.warning-text,
.info-text {
    color: var(--color-info);
}

.status-panel-head,
.service-details,
.mobile-actions {
    border-color: var(--color-border);
}

.action-button {
    border-color: var(--color-primary-accent);
    background: var(--color-primary-accent);
    color: #FFFFFF;
}

.action-button:hover {
    border-color: var(--brand-orange-mid);
    background: var(--brand-orange-mid);
    color: #FFFFFF;
}

html[data-theme="light"] .action-button {
    border-color: var(--color-primary-accent);
    background: var(--color-primary-accent);
}

html[data-theme="light"] .action-button:hover {
    border-color: var(--brand-blue-deep);
    background: var(--brand-blue-deep);
}

.service-row {
    box-shadow: inset 3px 0 var(--color-border);
}

.service-row:hover,
.service-row[open] {
    border-color: var(--color-border-strong);
    background: var(--color-surface-subtle);
}

.service-row.up { box-shadow: inset 3px 0 var(--color-success); }
.service-row.down { box-shadow: inset 3px 0 var(--color-error); }
.service-row.partial { box-shadow: inset 3px 0 var(--color-warning); }
.service-row.unknown { box-shadow: inset 3px 0 var(--color-link); }

.status-pill.up,
.uptime-pill.up,
.history-badge.up,
.service-note.up {
    border-color: rgba(101, 208, 154, .42);
    background: rgba(101, 208, 154, .11);
}

.status-pill.down,
.uptime-pill.down,
.history-badge.down,
.service-note.down,
.error-text {
    border-color: rgba(255, 125, 134, .42);
    background: rgba(255, 125, 134, .11);
}

.status-pill.partial,
.uptime-pill.partial,
.service-note.partial,
.warning-text {
    color: var(--color-warning);
    border-color: rgba(231, 184, 95, .44);
    background: rgba(231, 184, 95, .12);
}

.status-pill.unknown,
.uptime-pill.unknown,
.history-badge.unknown,
.service-note.unknown {
    border-color: rgba(142, 212, 227, .38);
    background: var(--color-unknown-surface);
}

.service-note.down,
.service-note.partial,
.service-note.unknown,
.history-badge.down,
.history-badge.unknown,
.code-badge.fail {
    color: var(--color-error);
}

.code-badge.fail {
    border-color: rgba(255, 125, 134, .42);
    background: rgba(255, 125, 134, .11);
}

.info-text {
    border: 1px solid var(--color-border);
    background: var(--color-surface-elevated);
}

.warning-text b,
.info-text b {
    color: var(--color-primary-text);
}

.service-chart-card,
.service-chart-canvas {
    border-color: var(--color-border);
    background: var(--color-chart-surface, var(--color-surface-elevated));
}

.service-chart-head > span,
.metric-chart-title {
    color: var(--color-secondary-text);
}

.service-chart-controls select {
    border-color: var(--color-border);
    background: var(--color-surface-elevated);
    color: var(--color-primary-text);
}

.range-buttons button:hover,
.range-buttons button.active {
    background: var(--color-active);
    color: var(--color-primary-text);
}

.footer {
    color: var(--color-muted-text);
}

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

.heartbeat-pill.ok {
    border-color: rgba(101, 208, 154, .42);
    background: rgba(101, 208, 154, .11);
    color: var(--color-success);
}

.heartbeat-pill.stale,
.heartbeat-pill.unknown {
    border-color: rgba(142, 212, 227, .38);
    background: var(--color-unknown-surface);
    color: var(--color-unknown-text);
}

.heartbeat-pill.error {
    border-color: rgba(255, 125, 134, .42);
    background: rgba(255, 125, 134, .11);
    color: var(--color-error);
}

.history-panel,
.history-item {
    border-color: var(--color-border);
    background: var(--color-surface-elevated);
}

.history-panel[open] .history-summary {
    border-color: var(--color-border-strong);
    background: var(--color-surface-subtle);
}

.history-item.up { box-shadow: inset 2px 0 var(--color-success); }
.history-item.down { box-shadow: inset 2px 0 var(--color-error); }
.history-item.unknown { box-shadow: inset 2px 0 var(--color-link); }

.history-badge.up { border-color: rgba(101, 208, 154, .42); background: rgba(101, 208, 154, .11); }
.history-badge.down { border-color: rgba(255, 125, 134, .42); background: rgba(255, 125, 134, .11); }
.history-badge.unknown { border-color: rgba(142, 212, 227, .38); background: var(--color-unknown-surface); }

.site-header {
    height: var(--navbar-height);
}

.navbar {
    border-bottom-color: var(--color-border);
    background: var(--color-surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.site-header.is-scrolled .navbar {
    background: var(--color-surface);
    border-bottom-color: var(--color-border-strong);
    box-shadow: var(--navbar-shadow);
}

.brand__eyebrow {
    color: var(--color-primary-accent);
}

.brand-logo {
    box-shadow: none;
}

.nav-link,
.nav-trigger,
.icon-button,
.menu-button {
    color: var(--color-secondary-text);
}

.nav-link:hover,
.nav-trigger:hover,
.nav-item.is-open > .nav-trigger,
.nav-link[aria-current="page"] {
    color: var(--color-primary-text);
    background: var(--color-hover);
}

.nav-link[aria-current="page"] {
    color: var(--color-primary-accent);
}

.magic-line {
    background: var(--color-primary-accent);
}

.dropdown,
.action-popover {
    border-color: var(--color-border-strong);
    background: var(--color-surface-elevated);
    box-shadow: var(--shadow);
}

.dropdown__header,
.mobile-menu__section-label {
    color: var(--color-muted-text);
}

.menu-link,
.choice-button {
    color: var(--color-primary-text);
}

.menu-link:hover,
.choice-button:hover,
.choice-button[aria-checked="true"] {
    background: var(--color-hover);
}

.menu-link__icon {
    color: var(--color-primary-accent);
    background: var(--color-selected);
}

.menu-link__description {
    color: var(--color-muted-text);
}

.menu-link__aside {
    color: var(--color-link);
}

.choice-button[aria-checked="true"] {
    color: var(--color-primary-accent);
}

.icon-button:hover,
.menu-button:hover,
.action-wrap.is-open > .icon-button,
.action-wrap.is-open > .menu-button {
    border-color: var(--color-border-strong);
    background: var(--color-hover);
    color: var(--color-primary-text);
}

.mobile-nav {
    background: var(--color-page-background);
}

.mobile-nav__header {
    border-bottom-color: var(--color-border);
    background: var(--color-surface);
}

.mobile-link,
.mobile-accordion__trigger {
    border-bottom-color: var(--color-border);
    color: var(--color-secondary-text);
}

.mobile-link:hover,
.mobile-accordion__trigger:hover,
.mobile-link[aria-current="page"] {
    background: var(--color-hover);
    color: var(--color-primary-text);
}

.mobile-link[aria-current="page"] {
    color: var(--color-primary-accent);
}

.mobile-submenu {
    border-left-color: var(--color-primary-accent);
}

.segmented {
    border-color: var(--color-border);
    background: var(--color-surface-elevated);
}

.segmented button {
    color: var(--color-muted-text);
}

.segmented button[aria-pressed="true"] {
    background: var(--color-primary-accent);
    color: #FFFFFF;
    box-shadow: none;
}

:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 3px;
    box-shadow: none;
}

html[data-theme="light"] .brand__eyebrow,
html[data-theme="light"] .nav-link[aria-current="page"],
html[data-theme="light"] .mobile-link[aria-current="page"],
html[data-theme="light"] .choice-button[aria-checked="true"] {
    color: var(--brand-blue-deep);
}

html[data-theme="light"] .mobile-submenu {
    border-left-color: var(--brand-blue);
}

html[data-theme="light"] .segmented button[aria-pressed="true"] {
    background: var(--brand-blue);
}

html[data-theme="light"] .error-text {
    color: var(--color-error);
}

html[data-theme="light"] .warning-text {
    color: var(--color-warning);
}

html[data-theme="light"] .info-text,
html[data-theme="light"] .warning-text,
html[data-theme="light"] .service-note.unknown,
html[data-theme="light"] .history-badge.unknown,
html[data-theme="light"] .uptime-pill.unknown {
    background: var(--color-unknown-surface);
    color: var(--color-unknown-text);
}

@media (max-width: 760px) {
    .page-shell {
        width: min(100% - 1rem, 1480px);
        padding-top: 1rem;
    }

    .panel,
    .legal-card {
        border-radius: 13px;
    }
}
