.status-page {
  --down: #c9471f;
  --meh: #c28a12;
  --up: #3f7d4e;
  --empty: #e6dccf;
  font-size: 1rem;
  line-height: 1.6;
}
@media (prefers-color-scheme: dark) {
  .status-page { --down: #ef8259; --meh: #e0b04a; --up: #7fc28f; --empty: #3a332c; }
}

.status-page main { max-width: 52rem; padding-bottom: 2rem; }
.status-page h2 { font: 400 1.9rem/1.1 var(--serif); margin: 3.25rem 0 1rem; }
.status-page h3 { font: 600 1.05rem/1.35 var(--sans); margin: 0 0 .6rem; }

.sp-head { max-width: 52rem; margin: 0 auto; padding: 1.4rem 1.25rem 2rem; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.sp-brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: 1.1rem; text-decoration: none; white-space: nowrap; }
.sp-brand svg { width: 1.9rem; }
.sp-brand .face { fill: var(--accent); }
.sp-brand .fold { fill: var(--fold); }
.sp-sub {
  font: 600 .9rem/1 var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: .65rem .95rem; cursor: pointer; transition: border-color .15s ease;
}
.sp-sub:hover { border-color: var(--muted); }
.sp-sub:disabled { cursor: default; opacity: .6; }

.sp-banner {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25rem 1rem;
  background: var(--down); color: #fff; border-radius: 12px; padding: 1.1rem 1.35rem;
  animation: throb 3s ease-in-out infinite;
}
.sp-banner h1 { font: 600 1.35rem/1.2 var(--sans); letter-spacing: 0; margin: 0; }
.sp-banner span { font-size: .92rem; opacity: .92; }
@media (prefers-color-scheme: dark) { .sp-banner { color: #1a1714; } }
@media (max-width: 40rem) { .sp-sub { font-size: .8rem; padding: .55rem .7rem; white-space: nowrap; } .sp-stats dd { font-size: 1.4rem; } }
@keyframes throb { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--down) 25%, transparent); } }

.sp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 1px; margin: 1.25rem 0 0; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sp-stats div { background: var(--card); padding: .9rem 1rem; }
.sp-stats dt { font-size: .78rem; color: var(--muted); line-height: 1.35; }
.sp-stats dd { margin: .25rem 0 0; font: 400 1.65rem/1.1 var(--serif); font-variant-numeric: tabular-nums; }

.sp-hint { color: var(--muted); font-size: .9rem; margin-top: -.4rem; }
.sp-components { margin-top: .5rem; }
.sp-row { background: var(--card); border: 1px solid var(--line); border-bottom: 0; padding: .95rem 1.1rem 1rem; }
.sp-row:first-of-type { border-radius: 12px 12px 0 0; }
.sp-row:last-of-type { border-bottom: 1px solid var(--line); border-radius: 0 0 12px 12px; }
.sp-line { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.sp-line b { font-weight: 600; }
.sp-pill { font-size: .85rem; font-weight: 600; text-align: right; }
.sp-pill.down { color: var(--accent-ink); }
.sp-pill.meh { color: #8a5d00; }
.sp-pill.up { color: var(--up); }
@media (prefers-color-scheme: dark) { .sp-pill.meh { color: var(--meh); } }

.sp-bars { display: grid; grid-template-columns: repeat(90, 1fr); gap: 2px; height: 2.1rem; margin-top: .65rem; }
@media (max-width: 40rem) { .sp-bars { grid-template-columns: repeat(45, 1fr); } .sp-bars button:nth-child(-n+45) { display: none; } }
.sp-bars button { display: block; min-width: 0; border: 0; padding: 0; cursor: help; border-radius: 2px; background: var(--down); transition: transform .12s ease, opacity .12s ease; }
.sp-bars button.meh { background: var(--meh); }
.sp-bars button.up { background: var(--up); }
.sp-bars button.empty { background: var(--empty); }
.sp-bars button:hover, .sp-bars button:focus-visible { transform: scaleY(1.18); opacity: .8; }
.sp-bars button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sp-bars:empty { background: repeating-linear-gradient(90deg, var(--down) 0 calc(100% / 90 - 2px), transparent calc(100% / 90 - 2px) calc(100% / 90)); border-radius: 2px; }

.sp-card, .sp-incident { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.25rem; margin-bottom: .75rem; }
.sp-card p:last-child, .sp-incident li:last-child { margin-bottom: 0; }
.sp-meta { color: var(--accent-ink); font-size: .9rem; font-weight: 600; margin-bottom: .4rem; }
.sp-incident ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.sp-incident li { display: grid; gap: 0 1rem; }
.sp-incident li b { font-weight: 600; }
.sp-time { font-size: .8rem; color: var(--muted); }
@media (min-width: 40rem) {
  .sp-incident li { grid-template-columns: 7.5rem 1fr; grid-template-areas: "status text" "time text"; align-items: start; }
  .sp-incident li b { grid-area: status; }
  .sp-incident li .sp-time { grid-area: time; }
  .sp-incident li .sp-text { grid-area: text; }
}
.sp-incident code { font-size: .9em; background: var(--soft); padding: .05rem .3rem; border-radius: 4px; }

.sp-postmortem { border: 1px dashed var(--line); border-radius: 12px; padding: .9rem 1.25rem; }
.sp-postmortem summary { cursor: pointer; font-weight: 600; }
.sp-postmortem ol { margin: .9rem 0; padding-left: 1.3rem; }
.sp-postmortem p { margin: 0; color: var(--muted); }

.sp-foot { max-width: 52rem; margin: 0 auto; padding: 2rem 1.25rem 4rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.sp-foot p { margin: 0 0 .3rem; }

.sp-toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: .8rem 1.15rem; border-radius: 10px; font-size: .95rem; max-width: calc(100% - 2rem); box-shadow: 0 10px 30px rgb(0 0 0 / 20%); }
.sp-tip {
  position: fixed; z-index: 5; max-width: 18rem; pointer-events: none; background: var(--ink); color: var(--bg);
  font-size: .82rem; line-height: 1.45; padding: .55rem .75rem; border-radius: 8px; box-shadow: 0 8px 24px rgb(0 0 0 / 22%);
}
.sp-tip strong { display: block; font-weight: 600; margin-bottom: .15rem; }

@media (prefers-reduced-motion: reduce) {
  .sp-banner { animation: none; }
  .sp-bars button { transition: none; }
}
