:root {
    color-scheme: light;
    --ink: #102130;
    --ink-soft: #5e6b74;
    --canvas: #f2f1ec;
    --surface: #fbfaf6;
    --line: #dcded9;
    --navy: #0c1724;
    --navy-soft: #13273a;
    --success: #117a59;
    --success-bright: #46d6a1;
    --success-pale: #e5f5ee;
    --processing: #c17a12;
    --processing-pale: #fff2d8;
    --failure: #c0493d;
    --failure-pale: #fae7e4;
    --shadow: 0 14px 40px rgba(12, 23, 36, 0.07);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--canvas);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background:
        radial-gradient(circle at 90% 6%, rgba(70, 214, 161, 0.1), transparent 24rem),
        var(--canvas);
}

a {
    color: inherit;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 20;
    padding: 10px 14px;
    color: white;
    background: var(--navy);
    border-radius: 8px;
    transform: translateY(-150%);
    transition: transform 140ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header,
main,
footer {
    width: min(1460px, calc(100% - 64px));
    margin-inline: auto;
}

.site-header {
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    gap: 12px;
    align-items: center;
    text-decoration: none;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--navy);
    display: grid;
    grid-template-columns: repeat(3, 4px);
    gap: 4px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 7px 18px rgba(12, 23, 36, 0.18);
}

.brand-mark i {
    width: 4px;
    height: 14px;
    border-radius: 99px;
    background: var(--success-bright);
}

.brand-mark i:nth-child(2) {
    height: 22px;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 0.95rem;
    letter-spacing: 0.04em;
}

.brand small {
    margin-top: 2px;
    color: var(--ink-soft);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--ink-soft);
    font-size: 0.79rem;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 5px rgba(17, 122, 89, 0.11);
    animation: breathe 2.6s ease-in-out infinite;
}

.header-divider {
    width: 1px;
    height: 14px;
    margin-inline: 4px;
    background: var(--line);
}

@keyframes breathe {
    50% { box-shadow: 0 0 0 8px rgba(17, 122, 89, 0.03); }
}

.status-hero {
    min-height: 244px;
    padding: 48px 54px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 48px;
    overflow: hidden;
    position: relative;
    color: white;
    background:
        linear-gradient(120deg, rgba(70, 214, 161, 0.1), transparent 42%),
        var(--navy);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(12, 23, 36, 0.15);
}

.status-hero::after {
    content: "";
    position: absolute;
    width: 340px;
    height: 340px;
    right: -120px;
    top: -215px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    box-shadow:
        0 0 0 42px rgba(255, 255, 255, 0.025),
        0 0 0 90px rgba(255, 255, 255, 0.018);
}

.hero-copy,
.hero-aside {
    position: relative;
    z-index: 1;
}

.eyebrow {
    margin: 0 0 10px;
    color: #70808c;
    font-size: 0.69rem;
    font-weight: 750;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.status-hero .eyebrow {
    color: #8fa9b8;
}

.health-heading {
    display: flex;
    align-items: center;
    gap: 16px;
}

.health-heading h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.45rem);
    line-height: 1;
    letter-spacing: -0.045em;
    font-weight: 660;
}

.health-orb {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
}

.health-orb--success {
    background: var(--success-bright);
    box-shadow: 0 0 28px rgba(70, 214, 161, 0.58);
}

.health-orb--warning {
    background: #f0ad3f;
    box-shadow: 0 0 28px rgba(240, 173, 63, 0.45);
}

.health-orb--failure {
    background: #ed6c60;
    box-shadow: 0 0 28px rgba(237, 108, 96, 0.5);
}

.hero-message {
    max-width: 650px;
    margin: 17px 0 0 34px;
    color: #adbac4;
    font-size: 0.98rem;
    line-height: 1.55;
}

.hero-aside {
    min-width: 385px;
    padding: 21px 24px;
    display: grid;
    grid-template-columns: 1.3fr 0.8fr 0.8fr;
    gap: 18px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.hero-aside div + div {
    padding-left: 18px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-aside span,
.hero-aside strong {
    display: block;
}

.hero-aside span {
    color: #8699a7;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hero-aside strong {
    margin-top: 7px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.metric-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.metric-card {
    min-height: 168px;
    padding: 25px 26px 22px;
    background: var(--surface);
    border: 1px solid rgba(16, 33, 48, 0.06);
    border-radius: 17px;
    box-shadow: var(--shadow);
}

.metric-topline {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #596873;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.metric-icon {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 5px currentColor;
    outline: 5px solid transparent;
}

.metric-card--processing .metric-topline {
    color: var(--processing);
}

.metric-card--processing .metric-icon {
    box-shadow: 0 0 0 5px rgba(193, 122, 18, 0.12);
}

.metric-card--success .metric-topline {
    color: var(--success);
}

.metric-card--success .metric-icon {
    box-shadow: 0 0 0 5px rgba(17, 122, 89, 0.11);
}

.metric-card--failure .metric-topline {
    color: var(--failure);
}

.metric-card--failure .metric-icon {
    box-shadow: 0 0 0 5px rgba(192, 73, 61, 0.11);
}

.metric-value {
    display: block;
    margin-top: 20px;
    color: var(--ink);
    font-size: 2.2rem;
    line-height: 1;
    letter-spacing: -0.05em;
    font-variant-numeric: tabular-nums;
}

.metric-card p {
    margin: 13px 0 0;
    color: #77828a;
    font-size: 0.77rem;
    line-height: 1.45;
}

.metric-card--rate {
    display: flex;
    align-items: center;
    gap: 20px;
}

.metric-card--rate > div:last-child {
    min-width: 0;
}

.rate-visual {
    width: 68px;
    height: 68px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--success) calc(var(--rate) * 1%), #e6e7e2 0);
}

.rate-visual span {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--surface);
}

.metric-value--rate {
    margin-top: 12px;
    font-size: 1.75rem;
}

.content-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 370px;
    gap: 18px;
    align-items: start;
}

.activity-panel,
.station-panel {
    background: var(--surface);
    border: 1px solid rgba(16, 33, 48, 0.06);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.panel-heading {
    min-height: 89px;
    padding: 22px 25px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid #e7e7e2;
}

.panel-heading .eyebrow {
    margin-bottom: 5px;
}

.panel-heading h2 {
    margin: 0;
    font-size: 1.06rem;
    letter-spacing: -0.02em;
}

.filters {
    padding: 4px;
    display: flex;
    gap: 2px;
    background: #ecece7;
    border-radius: 10px;
}

.filters a {
    padding: 7px 11px;
    color: #66737b;
    border-radius: 7px;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 650;
}

.filters a:hover {
    color: var(--ink);
}

.filters a:focus-visible {
    outline: 2px solid var(--success);
    outline-offset: 2px;
}

.filters a.active {
    color: var(--ink);
    background: var(--surface);
    box-shadow: 0 2px 5px rgba(12, 23, 36, 0.08);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 13px 16px;
    color: #81909a;
    background: #f6f5f1;
    border-bottom: 1px solid #e5e5df;
    font-size: 0.63rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

th:first-child,
td:first-child {
    padding-left: 25px;
}

th:last-child,
td:last-child {
    padding-right: 25px;
}

td {
    padding: 16px;
    border-bottom: 1px solid #ecece7;
    color: #53626c;
    font-size: 0.77rem;
    vertical-align: middle;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: #f8f8f4;
}

.status-pill {
    width: fit-content;
    padding: 6px 9px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 99px;
    font-size: 0.69rem;
    font-weight: 700;
}

.status-pill i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-pill--success {
    color: var(--success);
    background: var(--success-pale);
}

.status-pill--processing {
    color: var(--processing);
    background: var(--processing-pale);
}

.status-pill--processing i {
    animation: breathe 1.5s ease infinite;
}

.status-pill--failure {
    color: var(--failure);
    background: var(--failure-pale);
}

.event-name,
.event-id,
.error-message,
.station-name,
.http-status {
    display: block;
}

.event-name,
.station-name {
    color: var(--ink);
    font-weight: 650;
}

.event-id,
.http-status {
    margin-top: 4px;
    color: #91a0a9;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.65rem;
}

.error-message {
    max-width: 400px;
    margin-top: 5px;
    color: var(--failure);
    font-size: 0.68rem;
}

.event-link {
    width: fit-content;
    max-width: 100%;
    display: block;
    text-decoration: none;
}

.event-link .event-name {
    transition: color 140ms ease;
}

.event-link:hover .event-name {
    color: var(--success);
}

.event-link:focus-visible {
    outline: 2px solid var(--success);
    outline-offset: 5px;
    border-radius: 4px;
}

.event-link-action {
    margin-top: 7px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--success);
    font-size: 0.66rem;
    font-weight: 750;
}

.empty-state {
    min-height: 330px;
    padding: 50px 24px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
}

.empty-symbol {
    width: 64px;
    height: 64px;
    margin-bottom: 18px;
    display: grid;
    place-items: center;
    background: #edede8;
    border-radius: 18px;
}

.empty-symbol span {
    width: 28px;
    height: 18px;
    border-left: 2px solid #92a0a9;
    border-bottom: 2px solid #92a0a9;
    transform: skewY(-24deg);
}

.empty-state h3 {
    margin: 0;
    font-size: 0.95rem;
}

.empty-state p,
.station-empty p {
    margin: 8px 0 0;
    color: #849099;
    font-size: 0.76rem;
}

.time-label {
    padding: 6px 8px;
    color: #7b8992;
    background: #ecece7;
    border-radius: 7px;
    font-size: 0.66rem;
    font-weight: 700;
}

.station-list {
    min-height: 258px;
    margin: 0;
    padding: 8px 24px 14px;
    list-style: none;
}

.station-list li {
    padding: 17px 0;
    border-bottom: 1px solid #ecece7;
}

.station-list li:last-child {
    border-bottom: 0;
}

.station-row {
    display: flex;
    align-items: center;
    gap: 11px;
}

.station-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #536671;
    background: #e7ecea;
    border-radius: 9px;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.station-identity {
    min-width: 0;
    flex: 1;
}

.station-identity strong,
.station-identity span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.station-identity strong {
    font-size: 0.78rem;
}

.station-identity span {
    margin-top: 4px;
    color: #89959d;
    font-size: 0.66rem;
}

.station-state {
    color: var(--success);
    font-size: 0.65rem;
    font-weight: 700;
}

.station-state--failure {
    color: var(--failure);
}

.station-bar {
    height: 3px;
    margin: 12px 0 0 45px;
    overflow: hidden;
    background: #e9eae5;
    border-radius: 99px;
}

.station-bar span {
    height: 100%;
    display: block;
    background: var(--success);
    border-radius: inherit;
}

.station-empty {
    min-height: 258px;
    display: grid;
    place-items: center;
    text-align: center;
}

.legend {
    min-height: 56px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    color: #7b8992;
    background: #f6f5f1;
    border-top: 1px solid #e7e7e2;
    border-radius: 0 0 18px 18px;
    font-size: 0.64rem;
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.legend-success {
    background: var(--success);
}

.legend-processing {
    background: var(--processing);
}

.legend-failure {
    background: var(--failure);
}

footer {
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #859199;
    font-size: 0.68rem;
}

.detail-main {
    padding-bottom: 18px;
}

.back-link {
    width: fit-content;
    margin: 5px 0 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #586872;
    text-decoration: none;
    font-size: 0.76rem;
    font-weight: 700;
}

.back-link:hover {
    color: var(--success);
}

.back-link:focus-visible {
    outline: 2px solid var(--success);
    outline-offset: 5px;
    border-radius: 4px;
}

.detail-hero {
    min-height: 210px;
    padding: 42px 48px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    color: white;
    background:
        radial-gradient(circle at 91% 14%, rgba(70, 214, 161, 0.2), transparent 17rem),
        var(--navy);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(12, 23, 36, 0.15);
}

.detail-hero .eyebrow {
    color: #8fa9b8;
}

.detail-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.detail-title-row h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1;
    letter-spacing: -0.045em;
}

.detail-event-id {
    margin: 17px 0 0;
    color: #a7b5bf;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.76rem;
    overflow-wrap: anywhere;
}

.detail-hero-aside {
    min-width: 150px;
    padding: 20px 22px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
}

.detail-hero-aside span,
.detail-hero-aside strong {
    display: block;
}

.detail-hero-aside span {
    color: #8fa0ad;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.detail-hero-aside strong {
    margin-top: 7px;
    font-size: 1.55rem;
}

.detail-summary-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.detail-summary-card {
    min-width: 0;
    padding: 20px 22px;
    background: var(--surface);
    border: 1px solid rgba(16, 33, 48, 0.06);
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.detail-summary-card span,
.detail-summary-card strong {
    display: block;
}

.detail-summary-card span {
    color: #839099;
    font-size: 0.64rem;
    font-weight: 750;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.detail-summary-card strong {
    margin-top: 8px;
    overflow-wrap: anywhere;
    font-size: 0.83rem;
}

.detail-panel {
    margin-top: 18px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(16, 33, 48, 0.06);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.detail-panel-heading {
    min-height: 84px;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid #e7e7e2;
}

.detail-panel-heading .eyebrow {
    margin-bottom: 5px;
}

.detail-panel-heading h2 {
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.detail-panel--error {
    border-color: rgba(192, 73, 61, 0.18);
}

.detail-panel--error .detail-panel-heading {
    background: var(--failure-pale);
    border-bottom-color: rgba(192, 73, 61, 0.12);
}

.detail-error-message {
    margin: 0;
    padding: 22px 25px 25px;
    color: #8c352c;
    font-size: 0.82rem;
    line-height: 1.65;
}

.detail-data-list {
    margin: 0;
    padding: 8px 25px 22px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 38px;
}

.detail-data-list div {
    min-width: 0;
    padding: 17px 0;
    border-bottom: 1px solid #ecece7;
}

.detail-data-list .detail-data-wide {
    grid-column: 1 / -1;
}

.detail-data-list dt {
    color: #85929a;
    font-size: 0.63rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.detail-data-list dd {
    margin: 7px 0 0;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.75rem;
    line-height: 1.55;
}

.detail-json {
    max-height: 680px;
    margin: 0;
    padding: 27px 30px;
    overflow: auto;
    color: #d7e4eb;
    background: #0a1420;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.76rem;
    line-height: 1.65;
    tab-size: 2;
}

.detail-empty-data {
    min-height: 310px;
    padding: 52px 28px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
}

.detail-empty-data h2 {
    margin: 0;
    font-size: 1.05rem;
}

.detail-empty-data p {
    max-width: 570px;
    margin: 10px 0 0;
    color: #7c8992;
    font-size: 0.78rem;
    line-height: 1.6;
}

@media (max-width: 1120px) {
    .status-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-aside {
        width: 100%;
        min-width: 0;
    }

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

    .content-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 720px) {
    .site-header,
    main,
    footer {
        width: min(100% - 28px, 1460px);
    }

    .site-header {
        min-height: 72px;
    }

    .header-meta span:not(.live-dot):not(:nth-child(2)) {
        display: none;
    }

    .status-hero {
        min-height: 0;
        padding: 34px 25px 25px;
        border-radius: 19px;
    }

    .health-heading {
        gap: 11px;
    }

    .health-orb {
        width: 15px;
        height: 15px;
        border-width: 3px;
    }

    .hero-message {
        margin-left: 26px;
        font-size: 0.88rem;
    }

    .hero-aside {
        padding: 16px;
        grid-template-columns: 1fr 1fr;
    }

    .hero-aside div:last-child {
        display: none;
    }

    .metric-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .metric-card {
        min-height: 145px;
        padding: 21px 18px;
    }

    .metric-card--rate {
        display: block;
    }

    .rate-visual {
        display: none;
    }

    .metric-value {
        margin-top: 17px;
        font-size: 1.8rem;
    }

    .metric-value--rate {
        margin-top: 17px;
    }

    .metric-card p {
        font-size: 0.7rem;
    }

    .panel-heading {
        padding: 20px;
        align-items: flex-start;
        flex-direction: column;
    }

    .station-panel .panel-heading {
        align-items: center;
        flex-direction: row;
    }

    .filters {
        width: 100%;
        overflow-x: auto;
    }

    .filters a {
        flex: 1;
        text-align: center;
        white-space: nowrap;
    }

    th:first-child,
    td:first-child {
        padding-left: 20px;
    }

    th,
    td {
        padding: 13px 12px;
    }

    footer {
        min-height: 74px;
    }

    footer span:last-child {
        display: none;
    }

    .detail-hero {
        min-height: 0;
        padding: 34px 25px 25px;
        align-items: flex-start;
        flex-direction: column;
        border-radius: 19px;
    }

    .detail-hero-aside {
        width: 100%;
    }

    .detail-summary-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .detail-panel-heading {
        padding: 18px 20px;
    }

    .detail-data-list {
        padding: 6px 20px 18px;
        grid-template-columns: 1fr;
    }

    .detail-data-list .detail-data-wide {
        grid-column: auto;
    }

    .detail-json {
        padding: 22px 20px;
        font-size: 0.7rem;
    }
}

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