:root {
    color-scheme: light;
    --primary: #880e4f;
    --background: #f6f7f9;
    --surface: #ffffff;
    --text: #20232a;
    --muted: #737780;
    --border: #e0e3e8;
    --green: #269766;
    --yellow: #d99b25;
    --red: #d64c4c;
    --blue: #4285d4;
    --unknown: #a3a7ae;
    --shadow: 0 2px 8px #00000008;
}

[data-theme="dark"] {
    color-scheme: dark;
    --primary: #f28abb;
    --background: #121418;
    --surface: #1c1f25;
    --text: #e4e6eb;
    --muted: #999fa9;
    --border: #343842;
    --shadow: none;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: "Pretendard", "Noto Sans KR",
        system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.65;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 70px;
}

.brand {
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -1px;
}

.brand span {
    font-size: 20px;
    color: var(--text);
    font-weight: 400;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

button, select {
    padding: 8px 12px;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}

.intro {
    padding-top: 35px;
}

h1 {
    margin: 0 0 8px;
    font-size: 32px;
    letter-spacing: -1px;
}

h2 {
    font-size: 20px;
    margin: 0 0 16px;
    letter-spacing: -.4px;
}

p {
    margin: 6px 0;
}

.intro p, .muted {
    color: var(--muted);
}

section {
    margin-bottom: 32px;
}

.overall {
    padding: 22px 26px;
    border-radius: 8px;
    color: #fff;
    margin-bottom: 6px;
}

.overall h2 {
    margin: 0;
    font-size: 23px;
}

.overall.operational {
    background: #23865b;
}

.overall.degraded {
    background: #9c6814;
}

.overall.down {
    background: #bc3d3d;
}

.overall.unknown {
    background: #626a77;
}

.updated {
    text-align: right;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 32px;
}

.panel {
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.service {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.service:last-child, .item:last-child {
    border-bottom: 0;
}

.service-top, .section-heading, .item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.service-name {
    font-weight: 650;
    font-size: 16px;
}

.service-url {
    color: var(--muted);
    font-size: 12px;
}

.state {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.state.operational { color: var(--green); }
.state.degraded { color: var(--yellow); }
.state.down { color: var(--red); }
.state.unknown { color: var(--muted); }

.uptime-bar {
    display: grid;
    grid-template-columns: repeat(90, minmax(0, 1fr));
    gap: 2px;
    margin: 16px 0 8px;
}

.uptime-day {
    height: 28px;
    background: var(--unknown);
    border-radius: 2px;
}

.uptime-day.operational {
    background: var(--green);
}

.uptime-day.degraded {
    background: var(--yellow);
}

.uptime-day.down {
    background: var(--red);
}

.uptime-day:hover {
    opacity: .7;
}

.uptime-labels {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
}

.metrics {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 14px;
    font-size: 13px;
    color: var(--muted);
}

.metrics strong {
    color: var(--text);
}

.chart-panel {
    padding: 20px;
}

.chart-panel canvas {
    display: block;
    width: 100%;
    height: 280px;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 13px;
}

.legend span::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 2px;
}

.cf-legend::before {
    background: #f48120;
}

.gc-legend::before {
    background: #4285d4;
}

.item {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.item-title {
    font-weight: 650;
}

.item-meta {
    color: var(--muted);
    font-size: 12px;
    margin-top: 5px;
}

.item-message {
    margin-top: 10px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.empty {
    padding: 22px;
    color: var(--muted);
}

.footer {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    padding-bottom: 32px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 600px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .header-actions {
        gap: 8px;
        font-size: 12px;
    }

    .brand {
        font-size: 22px;
    }

    .brand span {
        font-size: 16px;
    }

    .uptime-bar {
        gap: 1px;
    }

    .uptime-day {
        height: 22px;
    }

    .service {
        padding: 15px;
    }
}