:root {
  color-scheme: dark;
  --bg: #071019;
  --surface: #0d1923;
  --surface-2: #101f2b;
  --line: #223746;
  --text: #f4f8fa;
  --muted: #91a5b4;
  --green: #59d9aa;
  --yellow: #f4c15d;
  --red: #ff7c7c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 90% 0, #12382f55, transparent 30%), var(--bg); color: var(--text); }
button, a { font: inherit; }
.skip-link { position: fixed; top: -70px; left: 18px; z-index: 20; padding: 10px 14px; border-radius: 8px; background: var(--green); color: #071019; }
.skip-link:focus { top: 18px; }
header, main, footer { width: min(1320px, calc(100% - 40px)); margin: 0 auto; }
header { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--green); color: #071019; font-weight: 900; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 1px; color: var(--muted); font-weight: 500; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.updated { color: var(--muted); font-size: .84rem; }
.admin { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; }
.admin:hover, .admin:focus-visible { border-color: var(--green); outline: none; }
main { padding: 44px 0 58px; }
section + section { margin-top: 42px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.section-heading.compact { align-items: center; }
.eyebrow { margin: 0 0 6px; color: var(--green); font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -.045em; }
h2 { margin-bottom: 0; font-size: clamp(1.35rem, 2.3vw, 1.8rem); letter-spacing: -.025em; }
.overall { min-width: 255px; display: flex; align-items: center; gap: 12px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.overall i, .service i { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.overall strong, .overall small { display: block; }
.overall small { margin-top: 2px; color: var(--muted); font-size: .77rem; }
.overall.ok i, .service.ok i { background: var(--green); box-shadow: 0 0 16px #59d9aa88; }
.overall.warning i, .service.warning i { background: var(--yellow); }
.overall.error i, .service.error i { background: var(--red); }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.summary-card, .service { border: 1px solid var(--line); background: linear-gradient(145deg, var(--surface-2), var(--surface)); box-shadow: 0 15px 36px #0002; }
.summary-card { min-height: 132px; display: flex; flex-direction: column; justify-content: center; padding: 20px; border-radius: 16px; }
.summary-card.primary { border-top: 3px solid var(--green); }
.label { color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.summary-card > strong { margin: 9px 0 4px; font-size: clamp(1.55rem, 2.5vw, 2.1rem); line-height: 1.05; }
.summary-card > small { color: var(--muted); }
.section-meta { color: var(--muted); font-size: .84rem; }
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.service { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border-radius: 14px; }
.service > span:first-child { min-width: 0; display: flex; align-items: center; gap: 11px; }
.service strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service small { color: var(--muted); }
.empty { grid-column: 1 / -1; margin: 0; padding: 28px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.data-alert { margin-top: 24px; padding: 14px 16px; border: 1px solid #71434a; border-radius: 12px; background: #2a171c; color: #ffd4d8; }
footer { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }

@media (max-width: 1050px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  header { min-height: 72px; }
  .updated { display: none; }
  .admin { padding: 9px 11px; font-size: .78rem; }
  main { padding-top: 30px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .overall { width: 100%; min-width: 0; }
  .summary-grid, .service-grid { grid-template-columns: 1fr; }
  .summary-card { min-height: 116px; }
  .service strong { white-space: normal; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; padding: 18px 0; }
}

@media (max-width: 420px) {
  header, main, footer { width: min(100% - 28px, 1320px); }
  .brand small { display: none; }
  .summary-card { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
