:root {
  --bg: #06091a;
  --panel: #0c1430;
  --panel-2: #111c3d;
  --line: rgba(210, 172, 70, .18);
  --line-strong: rgba(226, 192, 80, .4);
  --text: #f0ead8;
  --muted: #b7aa88;
  --dim: #82765e;
  --gold: #e2c050;
  --green: #52c27a;
  --amber: #e0a331;
  --red: #e9685d;
  --shadow: 0 24px 70px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); color-scheme: dark; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: radial-gradient(ellipse 90% 45% at 50% -10%, rgba(201, 168, 48, .13), transparent 65%), var(--bg);
  font-family: Arial, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.shell { width: min(calc(100% - 32px), 1080px); margin: 0 auto; padding: 28px 0 52px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--line-strong); border-radius: 14px; background: linear-gradient(145deg, #172554, #0e1736); color: var(--gold); font-size: 1.35rem; font-weight: 900; box-shadow: 0 0 22px rgba(201, 168, 48, .12); }
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; color: var(--gold); font-size: 1rem; font-weight: 850; }
.brand-copy span { display: block; overflow: hidden; color: var(--muted); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.back-link { color: var(--muted); font-size: .82rem; text-decoration: none; white-space: nowrap; }
.back-link:hover, .footer a:hover { color: var(--gold); }

.hero { padding: 38px 0 24px; }
.eyebrow { margin: 0 0 7px; color: var(--gold); font-size: .76rem; font-weight: 800; letter-spacing: .04em; }
.hero h1 { margin: 0; color: var(--text); font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.03em; line-height: 1.15; }
.hero p { max-width: 680px; margin: 12px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.8; }

.overall { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; padding: 22px 24px; border: 1px solid var(--line-strong); border-radius: 20px; background: linear-gradient(145deg, rgba(23, 35, 74, .96), rgba(12, 20, 48, .94)); box-shadow: var(--shadow); }
.overall-main { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.status-dot { width: 13px; height: 13px; flex: 0 0 13px; margin-top: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 6px rgba(82, 194, 122, .12), 0 0 18px rgba(82, 194, 122, .45); }
.status-dot.degraded, .status-dot.unknown { background: var(--amber); box-shadow: 0 0 0 6px rgba(224, 163, 49, .12), 0 0 18px rgba(224, 163, 49, .35); }
.status-dot.outage { background: var(--red); box-shadow: 0 0 0 6px rgba(233, 104, 93, .12), 0 0 18px rgba(233, 104, 93, .35); }
.overall h2 { margin: 0; color: var(--text); font-size: clamp(1.15rem, 2.6vw, 1.65rem); line-height: 1.3; }
.overall p { max-width: 680px; margin: 7px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.7; }
.overall-meta { flex: 0 0 auto; color: var(--dim); font-size: .73rem; text-align: left; }
.overall-meta strong { display: block; margin-bottom: 3px; color: var(--gold); font-size: .78rem; }
.overall-meta time, .service-foot time { direction: ltr; display: inline-block; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 34px 0 12px; }
.section-head h2 { margin: 0; color: var(--text); font-size: 1.15rem; }
.section-head p { margin: 3px 0 0; color: var(--dim); font-size: .76rem; }
.refresh-button { border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 13px; background: rgba(201, 168, 48, .1); color: var(--gold); font: inherit; font-size: .78rem; font-weight: 800; cursor: pointer; transition: background .15s, transform .15s; }
.refresh-button:hover, .refresh-button:focus-visible { outline: none; background: rgba(201, 168, 48, .18); transform: translateY(-1px); }
.refresh-button:focus-visible, .back-link:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.refresh-button:disabled { cursor: wait; opacity: .65; transform: none; }

.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.service-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(155deg, rgba(17, 28, 61, .95), rgba(12, 20, 48, .9)); transition: border-color .18s, transform .18s; }
.service-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.service-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.service-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.service-name h3 { margin: 0; color: var(--text); font-size: .98rem; }
.mini-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--green); }
.mini-dot.degraded, .mini-dot.unknown { background: var(--amber); }
.mini-dot.outage { background: var(--red); }
.service-badge { flex: 0 0 auto; border: 1px solid rgba(82, 194, 122, .28); border-radius: 999px; padding: 4px 9px; background: rgba(82, 194, 122, .08); color: var(--green); font-size: .68rem; font-weight: 800; white-space: nowrap; }
.service-badge.degraded, .service-badge.unknown { border-color: rgba(224, 163, 49, .3); background: rgba(224, 163, 49, .08); color: var(--amber); }
.service-badge.outage { border-color: rgba(233, 104, 93, .3); background: rgba(233, 104, 93, .08); color: var(--red); }
.service-summary { margin: 13px 0 4px; color: var(--text); font-size: .86rem; font-weight: 750; }
.service-detail { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.7; }
.service-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(210, 172, 70, .11); color: var(--dim); font-size: .68rem; }
.service-latency { direction: ltr; white-space: nowrap; }

.current-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.current-metric { min-width: 0; padding: 13px 15px; border: 1px solid rgba(210, 172, 70, .13); border-radius: 14px; background: rgba(12, 20, 48, .62); }
.current-metric span, .current-metric small { display: block; color: var(--muted); font-size: .7rem; }
.current-metric strong { display: block; margin: 2px 0 1px; color: var(--text); font-size: 1.15rem; direction: ltr; text-align: right; }
.current-metric small { color: var(--dim); font-size: .65rem; }

.history-panel { margin-top: 34px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, rgba(17, 28, 61, .96), rgba(12, 20, 48, .88)); box-shadow: var(--shadow); }
.history-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.history-head .eyebrow { margin-bottom: 6px; }
.history-head h2 { margin: 0; color: var(--text); font-size: clamp(1.1rem, 2.2vw, 1.45rem); }
.history-head p:not(.eyebrow) { max-width: 670px; margin: 7px 0 0; color: var(--muted); font-size: .8rem; }
.history-window { flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 10px; color: var(--gold); background: rgba(226, 192, 80, .08); font-size: .7rem; font-weight: 800; white-space: nowrap; }
.history-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.history-stat { min-width: 0; padding: 14px 15px; border: 1px solid rgba(210, 172, 70, .13); border-radius: 14px; background: rgba(6, 9, 26, .35); }
.history-stat span, .history-stat small { display: block; color: var(--muted); font-size: .7rem; }
.history-stat strong { display: block; margin: 3px 0 1px; color: var(--text); font-size: 1.25rem; direction: ltr; text-align: right; }
.history-stat small { color: var(--dim); font-size: .65rem; }
.history-chart { position: relative; display: flex; align-items: center; min-height: 94px; margin-top: 20px; padding: 22px 8px 26px; overflow-x: auto; border-top: 1px solid rgba(210, 172, 70, .11); border-bottom: 1px solid rgba(210, 172, 70, .11); scrollbar-width: thin; scrollbar-color: rgba(226, 192, 80, .45) transparent; }
.history-chart::before { position: absolute; right: 8px; left: 8px; top: 50%; height: 2px; border-radius: 999px; background: rgba(183, 170, 136, .15); content: ''; transform: translateY(-1px); pointer-events: none; }
.history-days { position: relative; z-index: 1; display: flex; align-items: center; gap: 5px; width: 100%; min-width: 720px; direction: ltr; }
.history-day { position: relative; display: flex; flex: 1 1 0; align-items: center; justify-content: center; min-width: 17px; height: 46px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.history-day:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 6px; }
.history-day-line { width: 100%; height: 9px; border: 1px solid rgba(82, 194, 122, .36); border-radius: 999px; background: var(--green); box-shadow: 0 0 12px rgba(82, 194, 122, .16); transition: height .15s, filter .15s, transform .15s; }
.history-day.degraded .history-day-line { border-color: rgba(224, 163, 49, .45); background: var(--amber); box-shadow: 0 0 12px rgba(224, 163, 49, .16); }
.history-day.outage .history-day-line { border-color: rgba(233, 104, 93, .5); background: var(--red); box-shadow: 0 0 13px rgba(233, 104, 93, .18); }
.history-day.unknown .history-day-line { border-color: rgba(183, 170, 136, .38); background: var(--dim); box-shadow: none; }
.history-day:hover .history-day-line, .history-day[aria-pressed="true"] .history-day-line { height: 15px; filter: brightness(1.15); transform: scaleY(1.12); }
.history-day-date { position: absolute; top: 31px; color: var(--dim); font-size: .56rem; white-space: nowrap; transform: rotate(-42deg); transform-origin: top center; pointer-events: none; }
.history-empty { width: 100%; padding: 17px; border: 1px dashed rgba(210, 172, 70, .22); border-radius: 12px; color: var(--dim); font-size: .76rem; text-align: center; }
.history-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 15px; color: var(--dim); font-size: .68rem; }
.history-legend span { display: inline-flex; align-items: center; gap: 6px; }
.history-key { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.history-key.degraded { background: var(--amber); }
.history-key.outage { background: var(--red); }
.history-detail { margin-top: 17px; min-height: 86px; padding: 16px 17px; border: 1px solid rgba(210, 172, 70, .15); border-radius: 14px; background: rgba(6, 9, 26, .36); }
.history-detail-placeholder { color: var(--dim); font-size: .78rem; }
.history-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.history-detail-title { margin: 0; color: var(--text); font-size: .95rem; }
.history-detail-status { border-radius: 999px; padding: 4px 9px; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.history-detail-status.operational { color: var(--green); background: rgba(82, 194, 122, .1); }
.history-detail-status.degraded, .history-detail-status.unknown { color: var(--amber); background: rgba(224, 163, 49, .1); }
.history-detail-status.outage { color: var(--red); background: rgba(233, 104, 93, .1); }
.history-detail-meta { display: flex; flex-wrap: wrap; gap: 5px 17px; margin-top: 7px; color: var(--muted); font-size: .72rem; }
.history-detail-meta b { color: var(--text); direction: ltr; }
.history-detail-issues { display: grid; gap: 5px; margin: 11px 0 0; padding: 10px 0 0; border-top: 1px solid rgba(210, 172, 70, .11); color: var(--muted); font-size: .72rem; }
.history-detail-issues strong { color: var(--text); }

.issues { margin-top: 18px; padding: 18px 20px; border: 1px solid rgba(224, 163, 49, .3); border-radius: 16px; background: linear-gradient(145deg, rgba(224, 163, 49, .09), rgba(12, 20, 48, .72)); }
.issues[hidden] { display: none; }
.issues h2 { margin: 0 0 8px; color: var(--gold); font-size: 1rem; }
.issues-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.issues-list li { display: grid; grid-template-columns: auto 1fr; gap: 8px; color: var(--muted); font-size: .8rem; line-height: 1.65; }
.issues-list li::before { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(224, 163, 49, .16); color: var(--amber); content: '!'; font-weight: 900; }
.issues-list strong { color: var(--text); }

.how-it-works { display: flex; align-items: flex-start; gap: 13px; margin-top: 18px; padding: 17px 19px; border: 1px solid var(--line); border-radius: 16px; background: rgba(12, 20, 48, .65); }
.how-icon { display: grid; place-items: center; width: 29px; height: 29px; flex: 0 0 29px; border-radius: 50%; background: rgba(82, 194, 122, .13); color: var(--green); font-weight: 900; }
.how-it-works h2 { margin: 0; color: var(--text); font-size: .92rem; }
.how-it-works p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.7; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 23px; color: var(--dim); font-size: .72rem; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.legend-dot.amber { background: var(--amber); }
.legend-dot.red { background: var(--red); }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--dim); font-size: .72rem; }
.footer a { color: var(--muted); text-decoration: none; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px; }
.skeleton { min-height: 116px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(90deg, rgba(17, 28, 61, .7), rgba(30, 45, 89, .7), rgba(17, 28, 61, .7)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 680px) {
  .shell { width: min(calc(100% - 22px), 1080px); padding-top: 17px; }
  .topbar { align-items: flex-start; padding-bottom: 16px; }
  .brand-copy span { white-space: normal; line-height: 1.3; }
  .back-link { font-size: 0; }
  .back-link::after { content: '↗'; font-size: 1.1rem; }
  .hero { padding-top: 26px; }
  .overall { flex-direction: column; gap: 14px; padding: 18px 16px; }
  .overall-meta { width: 100%; padding-top: 10px; border-top: 1px solid var(--line); text-align: right; }
  .current-metrics { grid-template-columns: 1fr; }
  .current-metric { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; }
  .current-metric strong { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
  .current-metric small { grid-column: 1; }
  .service-grid { grid-template-columns: 1fr; }
  .history-panel { padding: 18px 15px; }
  .history-head { flex-direction: column; gap: 10px; }
  .history-summary { grid-template-columns: 1fr; }
  .history-stat { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; }
  .history-stat strong { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
  .history-stat small { grid-column: 1; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .refresh-button { align-self: stretch; }
  .footer { align-items: flex-start; flex-direction: column; }
  .footer-links { gap: 8px 12px; }
}

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