:root {
    --or-page: #fafaf8;
    --or-paper: #ffffff;
    --or-line: #e2e2dc;
    --or-ink: #14171f;
    --or-text-dim: #4b5261;
    --or-text-faint: #676c7a;
    --or-blue: #1a365d;
    --or-accent: #f26522;
    --or-cta: #c44e12;
    --or-cta-hover: #a8410f;
    --or-dark: #111318;
    --or-radius: 8px;
    --or-content: 1200px;
    --or-gutter: clamp(20px, 4vw, 64px);
    --good: #2f9e44;
    --warn: #e6b325;
    --partial: #f26522;
    --down: #d64545;
    --maintenance: #2f6fed;
    --empty: #e4e4de;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--or-page);
    color: var(--or-ink);
    font-family: Montserrat, -apple-system, "Segoe UI", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

a { color: var(--or-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
    color: var(--or-blue);
    letter-spacing: -0.03em;
    font-weight: 700;
    margin: 0;
}

.container {
    width: min(var(--or-content), calc(100% - (var(--or-gutter) * 2)));
    margin: 0 auto;
}

.site-header {
    background: var(--or-page);
    border-bottom: 1px solid var(--or-line);
}

.nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 76px;
}

.logo { height: 36px; width: auto; display: block; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-links a {
    color: var(--or-blue);
    font-size: 13.5px;
    font-weight: 500;
    padding: 4px 0;
}

.nav-links a.is-active { box-shadow: inset 0 -2px 0 var(--or-accent); }

.btn-primary,
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--or-radius);
    padding: 11px 20px;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: var(--or-cta);
    color: #fff;
    border: 1px solid transparent;
}

.btn-primary:hover { background: var(--or-cta-hover); text-decoration: none; color: #fff; }

.btn-outline {
    background: #fff;
    color: var(--or-blue);
    border: 1px solid rgba(20, 23, 31, 0.12);
}

.page { flex: 1; padding: 48px 0 72px; }

.flash {
    background: #fff;
    border: 1px solid var(--or-line);
    border-radius: var(--or-radius);
    padding: 12px 16px;
    margin: 0 0 24px;
}

.banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    margin: 12px 0 36px;
}

.banner h1 { font-size: clamp(32px, 4vw, 44px); }

.lede { color: var(--or-text-dim); margin: 0; max-width: 36rem; }

.state-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
}

.dot.state-operational,
.state-icon.state-operational { background: var(--good); }
.dot.state-degraded,
.state-icon.state-degraded { background: var(--warn); }
.dot.state-partial,
.state-icon.state-partial { background: var(--partial); }
.dot.state-major,
.state-icon.state-major { background: var(--down); }
.dot.state-maintenance,
.state-icon.state-maintenance { background: var(--maintenance); }
.dot.state-unknown,
.state-icon.state-unknown { background: #c8c8c0; }

.state-icon { color: #fff; }

.incident-card,
.panel,
.day,
.auth-card,
.incident-detail {
    background: var(--or-paper);
    border: 1px solid var(--or-line);
    border-radius: var(--or-radius);
}

.incident-card { padding: 20px 24px; margin: 0 auto 28px; max-width: 760px; }

.incident-title { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.incident-title a { color: var(--or-ink); }

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex: none;
}

.meta, .empty, .range, .affected, .kicker, .lede { color: var(--or-text-dim); }
.meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.kicker { text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; font-weight: 600; margin-bottom: 8px; }

.pill {
    display: inline-flex;
    border: 1px solid var(--or-line);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--or-blue);
    background: var(--or-page);
}

.panel { margin-top: 12px; padding: 8px 0 20px; }
.panel-head, .page-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-end;
    padding: 22px 28px 8px;
}
.page-head { padding: 0 0 20px; align-items: center; }
.page-head p { margin: 8px 0 0; color: var(--or-text-dim); }
.range { margin: 0; font-size: 14px; }

.group + .group { border-top: 1px solid var(--or-line); }

.group-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: 0;
    padding: 18px 28px 8px;
    font: inherit;
    font-weight: 700;
    color: var(--or-ink);
    cursor: pointer;
    text-align: left;
}

.group-toggle em { font-style: normal; font-weight: 500; color: var(--or-text-faint); margin-left: 8px; font-size: 14px; }

.chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--or-text-dim);
    border-bottom: 2px solid var(--or-text-dim);
    transform: rotate(45deg);
    margin-top: -4px;
}

.group-toggle[aria-expanded="false"] .chevron { transform: rotate(-45deg); margin-top: 4px; }

.service { padding: 14px 28px 18px; }
.service + .service { border-top: 1px solid rgba(20, 23, 31, 0.06); }

.service-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: baseline;
}

.service h3 { font-size: 16px; color: var(--or-ink); letter-spacing: 0; }

.service-meta { display: flex; gap: 16px; align-items: center; margin: 0; }
.uptime { color: var(--or-text-faint); font-size: 14px; }

.state-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    background: transparent;
}

.state-label.state-operational { color: var(--good); }
.state-label.state-degraded { color: #9a7408; }
.state-label.state-partial { color: var(--or-cta); }
.state-label.state-major { color: var(--down); }
.state-label.state-maintenance { color: var(--maintenance); }
.state-label.state-unknown { color: var(--or-text-faint); }

.bars {
    display: flex;
    gap: 2px;
    height: 34px;
    margin-top: 10px;
}

.bar {
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    border-radius: 1px;
    background: var(--empty);
}

.bar.good, .swatch.good { background: var(--good); }
.bar.warn, .swatch.warn { background: var(--warn); }
.bar.partial, .swatch.partial { background: var(--partial); }
.bar.down, .swatch.down { background: var(--down); }
.swatch.maintenance { background: var(--maintenance); }

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 18px;
    list-style: none;
    margin: 8px 28px 0;
    padding: 16px 0 0;
    border-top: 1px solid var(--or-line);
    color: var(--or-text-dim);
    font-size: 13px;
}

.legend li { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 14px; height: 14px; border-radius: 2px; display: inline-block; }

.history-block { margin-top: 48px; }
.history-block > h2 { margin-bottom: 8px; }
.day { padding: 18px 24px; margin-top: 12px; }
.day h3 { font-size: 18px; margin-bottom: 8px; }
.day-item + .day-item { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--or-line); }
.day-item p { margin: 6px 0 0; }

.incident-detail, .timeline { padding: 28px; }
.incident-detail h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 12px; }
.timeline { list-style: none; margin: 20px 0 0; padding: 0; }
.timeline li + li { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--or-line); }

.site-footer {
    background: var(--or-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: 28px 0;
}

.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.footer-row .logo { background: var(--or-page); border-radius: var(--or-radius); padding: 6px 10px; }
.footer-row p { margin: 0; }

dialog {
    border: 1px solid var(--or-line);
    border-radius: var(--or-radius);
    padding: 24px;
    width: min(440px, calc(100% - 32px));
    color: var(--or-ink);
}

dialog::backdrop { background: rgba(17, 19, 24, 0.45); }

.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-copy { color: var(--or-text-dim); }
.dialog-close {
    border: 0;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--or-text-dim);
}

label { display: block; font-size: 14px; font-weight: 600; color: var(--or-blue); margin: 14px 0 6px; }

input, textarea, select {
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: var(--or-radius);
    padding: 11px 12px;
    font: inherit;
    color: var(--or-ink);
    background: #fff;
}

.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--or-ink); }
.check input { width: auto; }

fieldset { border: 1px solid var(--or-line); border-radius: var(--or-radius); margin: 16px 0; padding: 8px 16px 16px; }
legend { color: var(--or-blue); font-weight: 600; padding: 0 6px; }

.field-error { color: #b3261e; font-size: 14px; margin: 6px 0 0; }

.form-grid, .auth-card { padding: 28px; }
.auth-card { max-width: 440px; margin: 24px auto; }
.auth-card h1 { margin-bottom: 8px; }
.form-grid .btn-primary, .auth-card .btn-primary { margin-top: 18px; }

.admin-head { align-items: center; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-row { padding: 16px 28px; }
.admin-row + .admin-row { border-top: 1px solid var(--or-line); }
.admin-row a { font-weight: 700; color: var(--or-ink); }

.pager { display: flex; gap: 16px; align-items: center; padding: 16px 28px 0; font-size: 14px; }
.pager-disabled { color: var(--or-text-faint); }

.tooltip {
    position: fixed;
    transform: translate(-50%, -100%);
    background: var(--or-dark);
    color: #fff;
    font-size: 12px;
    padding: 6px 8px;
    border-radius: 6px;
    pointer-events: none;
    z-index: 20;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .nav-row, .service-row, .panel-head, .page-head, .footer-row, .admin-head { flex-direction: column; align-items: flex-start; }
    .nav-links { justify-content: flex-start; }
    .service { padding-inline: 20px; }
    .group-toggle, .panel-head, .admin-row { padding-inline: 20px; }
}
