:root {
  color-scheme: dark;
  --bg: #070a12;
  --panel: rgba(15, 20, 34, .78);
  --panel-solid: #0f1422;
  --border: rgba(255, 255, 255, .085);
  --text: #f7f8fb;
  --muted: #929aab;
  --green: #4ee6a8;
  --green-soft: rgba(78, 230, 168, .12);
  --yellow: #f5c451;
  --red: #ff667d;
  --blue: #7298ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -20%, rgba(81, 111, 255, .12), transparent 38%),
    linear-gradient(180deg, #080b14 0%, var(--bg) 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, a { font: inherit; }
a { color: inherit; }

.ambient {
  position: fixed;
  width: 30rem;
  height: 30rem;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .08;
  pointer-events: none;
}
.ambient-one { background: var(--blue); top: -16rem; right: -8rem; }
.ambient-two { background: var(--green); bottom: -20rem; left: -10rem; }

.shell { width: min(1080px, calc(100% - 40px)); margin: 0 auto; padding-bottom: 50px; }

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.brand { display: inline-flex; gap: 12px; align-items: center; text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(114, 152, 255, .45);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(114, 152, 255, .2), rgba(78, 230, 168, .08));
  color: #b9caff;
  font-weight: 800;
  box-shadow: inset 0 0 20px rgba(114, 152, 255, .08);
}
.brand strong { display: block; font-size: 13px; letter-spacing: .16em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; letter-spacing: .24em; }

.refresh-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .025);
  color: #cbd1dc;
  padding: 9px 13px;
  cursor: pointer;
  transition: .2s ease;
}
.refresh-button:hover { border-color: rgba(114, 152, 255, .45); color: #fff; background: rgba(114, 152, 255, .08); }
.refresh-button:disabled { cursor: wait; opacity: .65; }
.refresh-button.is-loading .refresh-icon { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero { padding: 80px 0 32px; }
.eyebrow { margin: 0 0 9px; color: #8297cf; font-size: 11px; font-weight: 700; letter-spacing: .2em; }
h1 { margin: 0; font-size: clamp(35px, 6vw, 58px); line-height: 1.05; letter-spacing: -.045em; }
.hero-copy { max-width: 610px; margin: 18px 0 30px; color: var(--muted); font-size: 17px; line-height: 1.65; }

.overall-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 17px;
  min-height: 92px;
  padding: 20px 23px;
  border: 1px solid rgba(78, 230, 168, .24);
  border-radius: 16px;
  background: linear-gradient(90deg, var(--green-soft), rgba(15, 20, 34, .75));
  box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
}
.overall-card.warning { border-color: rgba(245, 196, 81, .3); background: linear-gradient(90deg, rgba(245, 196, 81, .11), rgba(15, 20, 34, .75)); }
.overall-card.error { border-color: rgba(255, 102, 125, .3); background: linear-gradient(90deg, rgba(255, 102, 125, .11), rgba(15, 20, 34, .75)); }
.overall-card.loading { border-color: var(--border); background: var(--panel); }
.overall-card strong { display: block; font-size: 17px; }
.overall-card p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.overall-time { color: var(--muted); font-size: 12px; text-align: right; }
.status-orb { position: relative; width: 15px; height: 15px; border-radius: 50%; background: var(--green); box-shadow: 0 0 18px rgba(78, 230, 168, .65); }
.warning .status-orb { background: var(--yellow); box-shadow: 0 0 18px rgba(245, 196, 81, .55); }
.error .status-orb { background: var(--red); box-shadow: 0 0 18px rgba(255, 102, 125, .55); }
.loading .status-orb { background: var(--blue); box-shadow: 0 0 18px rgba(114, 152, 255, .55); }
.status-orb span { position: absolute; inset: -6px; border: 1px solid currentColor; border-radius: 50%; opacity: .2; animation: pulse 2s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.65); opacity: .45; } 100% { transform: scale(1.45); opacity: 0; } }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 28px; }
.metric-card { padding: 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); backdrop-filter: blur(20px); }
.metric-label, .metric-detail { display: block; color: var(--muted); font-size: 11px; }
.metric-label { text-transform: uppercase; letter-spacing: .12em; }
.metric-card strong { display: block; margin: 9px 0 7px; font-size: 25px; letter-spacing: -.03em; }

.panel { margin-top: 16px; padding: 25px; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); backdrop-filter: blur(20px); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.section-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.section-heading .eyebrow { margin-bottom: 6px; }
.muted { color: var(--muted); font-size: 12px; }
.live-label { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.live-label span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(78, 230, 168, .7); }

.service-list { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--border); }
.service-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1.3fr) auto; align-items: center; gap: 22px; min-height: 73px; padding: 15px 18px; background: var(--panel-solid); }
.service-name strong { display: block; font-size: 14px; }
.service-name small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.uptime-wrap { min-width: 0; }
.uptime-meta { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 10px; }
.uptime-bars { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; height: 23px; }
.uptime-bar { border-radius: 2px; background: rgba(78, 230, 168, .78); }
.uptime-bar.down { background: rgba(255, 102, 125, .78); }
.state-pill { display: inline-flex; align-items: center; gap: 7px; justify-self: end; min-width: 105px; color: var(--green); font-size: 12px; font-weight: 650; }
.state-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 9px currentColor; }
.state-pill.warning { color: var(--yellow); }
.state-pill.error { color: var(--red); }

.incident-list { display: grid; gap: 10px; }
.incident-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 15px 16px; border: 1px solid var(--border); border-radius: 11px; background: rgba(255,255,255,.018); }
.incident-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; background: rgba(78,230,168,.09); color: var(--green); font-size: 13px; font-weight: 800; }
.incident-icon.active { background: rgba(245,196,81,.1); color: var(--yellow); }
.incident-row strong { display: block; font-size: 13px; }
.incident-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.incident-date { color: var(--muted); font-size: 11px; }
.empty-state { margin: 0; padding: 27px; border: 1px dashed var(--border); border-radius: 11px; color: var(--muted); text-align: center; font-size: 13px; }

.skeleton { min-height: 73px; background: linear-gradient(100deg, #101624 20%, #151c2d 40%, #101624 60%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position-x: -200%; } }

footer { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 32px 0 0; color: var(--muted); font-size: 11px; }
footer a { color: #aebee9; text-decoration: none; }
footer a:hover { color: #fff; }
.footer-dot { width: 3px; height: 3px; border-radius: 50%; background: #485065; }

@media (max-width: 820px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .service-row { grid-template-columns: 1fr auto; }
  .uptime-wrap { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 24px, 1080px); }
  .topbar { min-height: 70px; }
  .refresh-button { padding: 9px; }
  .refresh-button:not(.is-loading) .refresh-icon { margin-right: 0; }
  .refresh-button { font-size: 0; }
  .refresh-icon { font-size: 18px; }
  .hero { padding-top: 54px; }
  .overall-card { grid-template-columns: auto 1fr; }
  .overall-time { grid-column: 2; text-align: left; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { padding: 15px; }
  .metric-card strong { font-size: 20px; }
  .panel { padding: 17px; }
  .section-heading { align-items: start; }
  .service-row { padding: 14px; gap: 12px; }
  .uptime-bars { grid-template-columns: repeat(15, 1fr); }
  .uptime-bar:nth-child(-n+15) { display: none; }
  .incident-row { grid-template-columns: auto 1fr; }
  .incident-date { grid-column: 2; }
}
