:root {
  --bg: #091727;
  --bg-secondary: #10243a;
  --surface: #1c3858;
  --surface-hover: #24486f;
  --accent: #af2000;
  --text-primary: #faf6f0;
  --text-secondary: #b9c5d2;
  --text-muted: #7f91a5;
  --border: rgba(122, 151, 183, 0.22);
  --border-light: rgba(250, 246, 240, 0.08);
  --success: #3fae74;
  --warning: #d98a2b;
  --danger: #e05548;
  --shadow: 0 20px 80px rgba(0, 0, 0, .18);
}

:root[data-theme="light"] {
  --bg: #faf6f0;
  --bg-secondary: #f3ece2;
  --surface: #ffffff;
  --surface-hover: #f0e8de;
  --text-primary: #091727;
  --text-secondary: #40536a;
  --text-muted: #758397;
  --border: #dfd6ca;
  --border-light: #ebe3d8;
  --success: #2d7a4f;
  --warning: #a86412;
  --danger: #bb2718;
  --shadow: 0 20px 80px rgba(70, 46, 20, .08);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-primary);
  font-family: Montserrat, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background .25s ease, color .25s ease;
  overflow-x: hidden;
}

button, a { font: inherit; }

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(110px);
  pointer-events: none;
  opacity: .34;
  z-index: 0;
}

.ambient-one {
  width: 520px;
  height: 520px;
  left: -260px;
  top: -240px;
  background: rgba(28, 56, 88, .8);
}

.ambient-two {
  width: 420px;
  height: 420px;
  right: -220px;
  bottom: 5vh;
  background: rgba(175, 32, 0, .14);
}

:root[data-theme="light"] .ambient { opacity: .12; }

.shell {
  width: min(1080px, calc(100% - 40px));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--text-primary);
  text-decoration: none;
}

.brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 8px;
}

.brand-divider {
  width: 1px;
  height: 26px;
  background: var(--border);
}

.brand-product {
  font-weight: 650;
  letter-spacing: -.02em;
}

.theme-switcher {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-secondary) 75%, transparent);
}

.theme-switcher button {
  border: 0;
  border-radius: 7px;
  padding: 7px 9px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.theme-switcher button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text-primary);
}

.hero { padding: 72px 0 42px; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .19em;
}

.hero-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 12px;
  font-size: clamp(46px, 7vw, 72px);
  line-height: .95;
  letter-spacing: -.055em;
  font-weight: 650;
}

.hero-copy {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--text-secondary);
  line-height: 1.65;
}

.overall-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  padding: 12px 15px;
  border: 1px solid color-mix(in srgb, var(--success) 35%, var(--border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--success) 8%, transparent);
  color: var(--success);
  font-size: 13px;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 10%, transparent);
}

.overall-badge.is-loading { color: var(--text-muted); border-color: var(--border); }
.overall-badge.is-degraded { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 35%, var(--border)); }
.overall-badge.is-outage { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.metric-card {
  padding: 28px 28px 26px 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.metric-card + .metric-card { padding-left: 28px; }
.metric-card:nth-child(3n) { border-right: 0; }
.metric-card:nth-last-child(-n + 3) { border-bottom: 0; }

.metric-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.metric-value {
  font-size: clamp(28px, 4vw, 39px);
  font-weight: 670;
  letter-spacing: -.045em;
  margin-bottom: 7px;
}

.metric-date { font-size: clamp(20px, 3vw, 29px); }

.metric-note {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.section { padding: 62px 0 0; }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 20px;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(25px, 4vw, 34px);
  letter-spacing: -.035em;
}

.section-helper {
  max-width: 370px;
  margin-bottom: 2px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: right;
}

.components {
  border-top: 1px solid var(--border);
}

.component {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px 2px;
  border-bottom: 1px solid var(--border);
}

.component-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.component-name { font-size: 14px; font-weight: 650; }

.component-latency {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

.component-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.component-status.degraded { color: var(--warning); }
.component-status.partial_outage,
.component-status.major_outage { color: var(--danger); }
.component-status.maintenance { color: var(--text-muted); }

.component-status .status-dot {
  width: 7px;
  height: 7px;
  box-shadow: none;
}

.skeleton {
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 45%, transparent), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}

@keyframes shimmer { to { background-position: -200% 0; } }

.history-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 13px;
  color: var(--text-muted);
  font-size: 10px;
}

.history-legend span { display: inline-flex; align-items: center; gap: 5px; }

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.legend-dot.degraded { background: var(--warning); }
.legend-dot.outage { background: var(--danger); }
.legend-dot.no-data { background: var(--border); }

.history-panel {
  padding: 24px 0 18px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.history-bar {
  display: grid;
  grid-template-columns: repeat(90, minmax(2px, 1fr));
  gap: 2px;
  min-height: 34px;
}

.day {
  min-width: 2px;
  height: 34px;
  border-radius: 3px;
  background: var(--success);
}

.day.degraded { background: var(--warning); }
.day.partial_outage,
.day.major_outage { background: var(--danger); }
.day.no_data { background: var(--border); opacity: .45; }

.history-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 10px;
}

.incidents { border-top: 1px solid var(--border); }

.incident {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 13px;
  padding: 19px 2px;
  border-bottom: 1px solid var(--border);
}

.incident-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  background: var(--danger);
}

.incident.resolved .incident-mark { background: var(--success); }

.incident-title {
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 700;
}

.incident-copy {
  margin-bottom: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.incident-date {
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
}

.empty-state {
  padding: 24px 2px;
  color: var(--text-muted);
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 58px 0 42px;
  color: var(--text-muted);
  font-size: 10px;
}

footer p { margin-bottom: 0; }

.error-panel {
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border));
  border-radius: 12px;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 6%, transparent);
  font-size: 13px;
}

@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 1080px); }
  .topbar { min-height: 72px; }
  .brand img { width: 32px; height: 32px; }
  .hero { padding: 50px 0 34px; }
  .hero-title-row { align-items: flex-start; flex-direction: column; gap: 24px; }
  .overview-grid { grid-template-columns: 1fr; }
  .metric-card, .metric-card + .metric-card {
    padding: 20px 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .metric-card:last-child { border-bottom: 0; }
  .section { padding-top: 48px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .section-helper { text-align: left; }
  .history-legend { justify-content: flex-start; }
  .history-bar { gap: 1px; overflow: hidden; }
  .component { grid-template-columns: 1fr auto; }
  .component-latency { display: none; }
  .incident { grid-template-columns: 12px 1fr; }
  .incident-date { grid-column: 2; }
  footer { flex-direction: column; gap: 8px; }
}

@media (max-width: 500px) {
  .brand-divider, .brand-product { display: none; }
  .theme-switcher button { padding: 6px 7px; font-size: 10px; }
  h1 { font-size: 50px; }
  .overall-badge { width: 100%; justify-content: center; }
  .component-name { font-size: 13px; }
  .component-status { font-size: 11px; }
}

/* Status page layout — public, simple and service-first */
.status-main {
  max-width: 920px;
  padding-bottom: 36px;
}

.status-intro {
  padding: 64px 0 28px;
}

.status-intro h1 {
  margin: 0 0 10px;
  font-size: clamp(38px, 6vw, 54px);
  line-height: 1;
  letter-spacing: -.045em;
}

.status-intro .hero-copy {
  margin: 0;
  color: var(--text-secondary);
}

.status-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px;
  border: 1px solid color-mix(in srgb, var(--success) 40%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--success) 10%, var(--surface));
  color: var(--success);
}
.status-banner strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
  color: var(--text-primary);
}

.status-banner p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.status-banner.is-degraded {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 40%, var(--border));
  background: color-mix(in srgb, var(--warning) 10%, var(--surface));
}

.status-banner.is-outage {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 42%, var(--border));
  background: color-mix(in srgb, var(--danger) 9%, var(--surface));
}

.status-banner.is-maintenance,
.status-banner.is-loading {
  color: var(--text-muted);
  border-color: var(--border);
  background: var(--surface);
}

.status-section {
  margin-top: 54px;
}
.status-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.status-section-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -.025em;
}

.status-section-head span {
  color: var(--text-muted);
  font-size: 11px;
}

.status-components {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
}

.status-component {
  display: block;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
}

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

.component-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.component-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.component-meta {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.component-status.unknown {
  color: var(--text-muted);
}

.component-history {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 15px;
}

.component-history-bars {
  display: grid;
  grid-template-columns: repeat(90, minmax(1px, 1fr));
  gap: 2px;
  min-width: 0;
}

.history-segment {
  height: 26px;
  border-radius: 2px;
  background: var(--success);
}

.history-segment.degraded { background: var(--warning); }
.history-segment.partial_outage,
.history-segment.major_outage { background: var(--danger); }
.history-segment.no_data,
.history-segment.unknown { background: var(--border); opacity: .55; }

.component-uptime {
  min-width: 112px;
  color: var(--text-muted);
  font-size: 10px;
  text-align: right;
  white-space: nowrap;
}
@media (max-width: 680px) {
  .status-intro { padding-top: 44px; }
  .status-section { margin-top: 42px; }
  .status-section-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .status-component { padding: 18px 14px; }
  .component-header { gap: 12px; }
  .component-status { font-size: 10px; }
  .component-history {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .component-history-bars { gap: 1px; }
  .history-segment { height: 22px; }
  .component-uptime {
    min-width: 0;
    text-align: left;
  }
}
