html.sd-html,
body.sd-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: #f4f6fb !important;
    color: #0f172a !important;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

body.sd-page * {
    box-sizing: border-box;
}

.sd-wrap {
    max-width: 820px;
    margin: 0 auto;
    padding: 32px 20px 64px;
}

.sd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.sd-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

a.sd-brand:hover h1 {
    color: #1d4ed8;
}

.sd-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.sd-home {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #cbd5e1;
    font-size: 0.78rem;
    font-weight: 600;
    color: #1d4ed8;
    text-decoration: none;
    white-space: nowrap;
}

.sd-home:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.sd-brand img {
    width: 48px !important;
    height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    object-fit: contain;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 4px;
}

.sd-brand h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #0f172a;
}

.sd-brand p {
    margin: 3px 0 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.35;
}

.sd-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e2e8f0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.sd-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}

.sd-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    border-radius: 16px;
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    margin-bottom: 28px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.sd-banner.sd-is-warn {
    background: #fefce8;
    border-color: #fde047;
}

.sd-banner.sd-is-down {
    background: #fef2f2;
    border-color: #fca5a5;
}

.sd-banner.sd-is-maint {
    background: #eff6ff;
    border-color: #93c5fd;
}

.sd-banner-icon {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: #22c55e;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
}

.sd-banner.sd-is-warn .sd-banner-icon { background: #eab308; }
.sd-banner.sd-is-down .sd-banner-icon { background: #ef4444; }
.sd-banner.sd-is-maint .sd-banner-icon { background: #2563eb; }

.sd-banner h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #15803d;
}

.sd-banner.sd-is-warn h2 { color: #a16207; }
.sd-banner.sd-is-down h2 { color: #b91c1c; }
.sd-banner.sd-is-maint h2 { color: #1d4ed8; }

.sd-banner .sd-meta {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.84rem;
}

.sd-section {
    margin: 28px 0 0;
}

.sd-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
}

.sd-section h3 {
    margin: 0;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: #64748b;
}

.sd-legend {
    font-size: 0.75rem;
    color: #94a3b8;
}

.sd-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.sd-incident {
    padding: 18px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.sd-incident:last-child { border-bottom: 0; }

.sd-incident-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.sd-incident-head h4 {
    margin: 0;
    font-size: 1.02rem;
    color: #0f172a;
}

.sd-incident p {
    margin: 8px 0 0;
    color: #475569;
    font-size: 0.93rem;
    line-height: 1.55;
}

.sd-incident-times {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 12px;
    font-size: 0.8rem;
    color: #64748b;
}

.sd-component {
    padding: 16px 18px 14px;
    border-bottom: 1px solid #f1f5f9;
}

.sd-component:last-child { border-bottom: 0; }

.sd-component-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.sd-comp-left {
    display: flex;
    gap: 12px;
    min-width: 0;
}

.sd-comp-mark {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    margin-top: 1px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fff;
    background: #22c55e;
}

.sd-comp-mark.is-warn { background: #eab308; }
.sd-comp-mark.is-down { background: #ef4444; }
.sd-comp-mark.is-maint { background: #2563eb; }

.sd-component h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 650;
    color: #0f172a;
}

.sd-component .desc {
    margin: 2px 0 0;
    color: #64748b;
    font-size: 0.82rem;
}

.sd-component .msg {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.78rem;
}

.sd-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    background: #ecfdf3;
    color: #166534;
}

.sd-pill.sd-pill-warn { background: #fef9c3; color: #854d0e; }
.sd-pill.sd-pill-down { background: #fee2e2; color: #991b1b; }
.sd-pill.sd-pill-maint { background: #dbeafe; color: #1d4ed8; }

.uptime-wrap {
    margin-top: 12px;
    padding-left: 34px;
}

.uptime-bar {
    display: flex;
    gap: 2px;
    height: 34px;
}

.uptime-bar span {
    flex: 1;
    min-width: 0;
    border-radius: 3px;
    background: #e2e8f0;
}

.uptime-bar .u-ok { background: #22c55e; }
.uptime-bar .u-warn { background: #eab308; }
.uptime-bar .u-down { background: #ef4444; }
.uptime-bar .u-none { background: #e2e8f0; }

.sd-timeline { padding: 4px 0 0; }

.sd-update {
    position: relative;
    padding: 12px 0 12px 18px;
    border-left: 2px solid #e2e8f0;
    margin-left: 8px;
    color: #334155;
    font-size: 0.9rem;
}

.sd-update:last-child { padding-bottom: 0; }

.sd-update::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 18px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #94a3b8;
}

.sd-update .when {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 2px;
}

.sd-note {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
    font-size: 0.92rem;
    line-height: 1.45;
}

.sd-footer {
    margin-top: 40px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.78rem;
}

.sd-footer a {
    color: #64748b;
    text-decoration: none;
}

.sd-footer a:hover { text-decoration: underline; }

@media (max-width: 640px) {
    .sd-wrap { padding: 20px 14px 48px; }
    .sd-header { flex-direction: column; align-items: flex-start; }
    .uptime-bar { height: 24px; }
    .uptime-wrap { padding-left: 0; }
    .sd-banner h2 { font-size: 1.15rem; }
}
