:root {
  color-scheme: light dark;
  --page: #f5f7f7;
  --surface: #ffffff;
  --surface-soft: #f0f4f3;
  --ink: #142b28;
  --muted: #4d6560;
  --line: #d8e1de;
  --accent: #076b57;
  --ok: #0b785f;
  --ok-bg: #e1f3ec;
  --warn: #865500;
  --warn-bg: #fff0c7;
  --outage: #a52f35;
  --outage-bg: #fde7e8;
  --unknown: #4d6560;
  --unknown-bg: #e8efec;
  --shadow: 0 16px 44px rgba(16, 49, 42, .055);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page-shell { width: min(1040px, calc(100% - 40px)); margin: 0 auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; min-height: 84px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; font-size: 1.13rem; letter-spacing: .12em; }
.brand-dot { color: var(--accent); }
.language-switch { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; min-height: 42px; min-width: 94px; padding: 8px 16px; font: inherit; font-size: .88rem; font-weight: 650; cursor: pointer; }
.language-switch:hover { border-color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.intro { padding: 56px 0 30px; }
.eyebrow { color: var(--accent); font-size: .74rem; font-weight: 800; letter-spacing: .2em; margin: 0 0 7px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2.15rem, 4.6vw, 3.5rem); line-height: 1.12; letter-spacing: -.045em; margin-bottom: 0; }
h2 { font-size: 1.1rem; letter-spacing: -.015em; }

.status-panel { display: flex; gap: 17px; align-items: flex-start; padding: 24px 27px; border: 1px solid var(--line); border-left: 5px solid var(--unknown); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); }
.status-panel:has(#overall[data-state="operational"]) { border-left-color: var(--ok); }
.status-panel:has(#overall[data-state="region_degraded"]) { border-left-color: var(--warn); }
.status-panel:has(#overall[data-state="outage"]) { border-left-color: var(--outage); }
.status-marker { width: 13px; height: 13px; flex: 0 0 13px; margin-top: 9px; border-radius: 50%; background: var(--unknown); }
.status-panel:has(#overall[data-state="operational"]) .status-marker { background: var(--ok); }
.status-panel:has(#overall[data-state="region_degraded"]) .status-marker { background: var(--warn); }
.status-panel:has(#overall[data-state="outage"]) .status-marker { background: var(--outage); }
.overall-title { font-size: clamp(1.3rem, 2.6vw, 1.7rem); font-weight: 760; line-height: 1.25; margin-bottom: 4px; }
.overall-detail { color: var(--muted); margin-bottom: 0; }
.notice { margin: 15px 0 0; padding: 13px 17px; background: var(--unknown-bg); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
[hidden] { display: none !important; }

.announcements-section { margin-top: 34px; }
.announcements-section h2 { margin-bottom: 10px; }
.announcements { list-style: none; padding: 0; margin: 0; }
.announcement { display: flex; gap: 15px; justify-content: space-between; padding: 14px 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; margin-top: 8px; }
.announcement-text { overflow-wrap: anywhere; }
.announcement-time { color: var(--muted); font-size: .82rem; white-space: nowrap; }

.services-section { margin: 42px 0 60px; }
.section-heading { display: flex; align-items: center; gap: 17px; margin-bottom: 17px; }
.section-heading h2 { margin: 0; }
.section-rule { height: 1px; flex: 1; background: var(--line); }
.service-list { display: grid; gap: 14px; }
.service-card { min-width: 0; padding: 24px 27px 22px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.service-heading { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.service-name { font-size: 1.08rem; line-height: 1.35; margin: 0; overflow-wrap: anywhere; }
.status-badge { flex: 0 0 auto; border-radius: 999px; padding: 5px 11px; font-size: .79rem; font-weight: 760; background: var(--unknown-bg); color: var(--unknown); }
.status-badge[data-state="operational"] { background: var(--ok-bg); color: var(--ok); }
.status-badge[data-state="region_degraded"] { background: var(--warn-bg); color: var(--warn); }
.status-badge[data-state="outage"] { background: var(--outage-bg); color: var(--outage); }
.history { display: flex; gap: 3px; margin: 22px 0 18px; min-height: 27px; }
.history-day { display: block; height: 27px; flex: 1 1 0; min-width: 0; border-radius: 2px; background: var(--unknown-bg); }
.history-day[data-state="ok"] { background: var(--ok); }
.history-day[data-state="warn"] { background: #bb7500; }
.history-day[data-state="outage"] { background: var(--outage); }
.history-day[data-state="none"] { background: var(--unknown-bg); }
.history-day:focus-visible { outline-offset: 2px; }
.region-groups { display: grid; gap: 15px; }
.region-group { min-width: 0; }
.zone-title { margin: 0 0 8px; color: var(--muted); font-size: .75rem; font-weight: 750; letter-spacing: .025em; }
.regions { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.region-chip { max-width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); color: var(--ink); font-size: .78rem; overflow-wrap: anywhere; }
.region-chip[data-state="warn"] { border-color: var(--warn); background: var(--warn-bg); }
.region-chip[data-state="outage"] { border-color: var(--outage); background: var(--outage-bg); }
.muted, .empty-state, .loading-message { color: var(--muted); }
.empty-state, .loading-message { margin: 0; }
.placeholder-line { background: var(--surface-soft); border-radius: 5px; height: 15px; }
.placeholder-title { width: 30%; height: 22px; margin-bottom: 27px; }
.placeholder-bar { width: 100%; height: 25px; margin-bottom: 21px; }
.placeholder-regions { width: 62%; }
.loading-message { font-size: .85rem; }

.site-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 23px 0 35px; border-top: 1px solid var(--line); color: var(--muted); font-size: .83rem; }
.noscript-message { color: var(--muted); }

@media (max-width: 600px) {
  .page-shell { width: min(100% - 28px, 480px); }
  .site-header { min-height: 70px; }
  .intro { padding: 40px 0 25px; }
  .status-panel, .service-card { padding: 20px; }
  .status-panel { gap: 12px; }
  .services-section { margin-top: 32px; }
  .history-day.mobile-hidden { display: none; }
  .announcement { flex-direction: column; gap: 5px; }
  .announcement-time { white-space: normal; }
  .region-chip { width: 100%; }
  .site-footer { flex-direction: column; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #101b1a;
    --surface: #192927;
    --surface-soft: #223632;
    --ink: #f1f7f5;
    --muted: #bdd0ca;
    --line: #3a544e;
    --accent: #69d5b5;
    --ok: #73d8b7;
    --ok-bg: #204b3d;
    --warn: #ffd187;
    --warn-bg: #59411d;
    --outage: #ffadb2;
    --outage-bg: #582a30;
    --unknown: #c2d0cc;
    --unknown-bg: #30443f;
    --shadow: 0 16px 44px rgba(0, 0, 0, .16);
  }
  .history-day[data-state="warn"] { background: #dc9c3d; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
