/* Public status page. Light-first, VL brand; reuses site.css tokens. State colors match the dashboard. */
.st-grid, .st-region, .st-hero { --ok: #2e9d57; --warn: #c98a00; --bad: #d0453b; }
:root[data-theme="dark"] .st-grid, :root[data-theme="dark"] .st-region, :root[data-theme="dark"] .st-hero { --warn: #e0a93b; --bad: #ef9a9a; }

/* hero */
.st-hero { display: flex; align-items: center; gap: 20px; padding: 26px 30px; }
@media (max-width: 680px) { .st-hero { flex-wrap: wrap; } }
.st-bigdot { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 18%, transparent); }
.st-hero[data-state="warn"] .st-bigdot { background: var(--warn); box-shadow: 0 0 0 6px color-mix(in srgb, var(--warn) 18%, transparent); }
.st-hero[data-state="bad"] .st-bigdot { background: var(--bad); box-shadow: 0 0 0 6px color-mix(in srgb, var(--bad) 18%, transparent); }
.st-hero[data-state="loading"] .st-bigdot { background: var(--muted); box-shadow: none; animation: st-pulse 1.2s ease-in-out infinite; }
@keyframes st-pulse { 50% { opacity: .35; } }
.st-hero__main { flex: 1 1 auto; min-width: 0; }
.st-hero__main h2 { font-size: clamp(22px, 3vw, 30px); font-style: italic; font-weight: 900; letter-spacing: -.02em; }
.st-hero__sub { margin-top: 6px; font-size: 15px; }
.st-hero__side { display: grid; gap: 8px; justify-items: end; flex: none; }
@media (max-width: 680px) { .st-hero__side { justify-items: start; width: 100%; } }
.st-chip { font-family: var(--f-mono); font-size: 11px; letter-spacing: .04em; color: var(--muted);
  padding: 5px 10px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }

/* filter */
.st-filter { display: flex; align-items: center; gap: 10px; margin: 30px 0 0; padding: 11px 16px;
  border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); max-width: 360px; }
.st-filter input { border: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; width: 100%; outline: none; }

/* section titles */
.st-sectitle { font-family: var(--f-mono); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-text); margin: 40px 0 16px; }

/* region/node list (vertical, grouped by region like the reference) */
.st-grid { display: flex; flex-direction: column; gap: 12px; }
.st-flag { font-size: 20px; line-height: 1; flex: none; }
.st-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent); flex: none; }

/* region section: a header, then a grid of node pills */
.st-rsec { border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.st-rhd { position: relative; display: flex; align-items: center; gap: 12px; padding: 15px 18px; }
.st-rhd__name { flex: 1 1 auto; font-weight: 700; font-size: 16px; min-width: 0; }
.st-rhd__state { display: inline-flex; align-items: center; gap: 7px; font-family: var(--f-mono); font-size: 12px; color: var(--ok); white-space: nowrap; }
.st-rhd[data-state="warn"] .st-rhd__state { color: var(--warn); }
.st-rhd[data-state="bad"] .st-rhd__state { color: var(--bad); }

/* connection speed from this browser to the region */
.st-ping { font-family: var(--f-mono); font-size: 12px; font-weight: 600; white-space: nowrap; padding: 3px 9px; border-radius: 999px; font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, currentColor 14%, transparent); }
.st-ping--good { color: var(--ok); }
.st-ping--ok { color: var(--warn); }
.st-ping--slow { color: var(--bad); }
.st-ping--wait { color: var(--muted); font-weight: 400; }
.st-pop__ping { margin: 8px 0 0; font-family: var(--f-mono); font-size: 12px; }
.st-pop__ping b { font-weight: 700; }
.st-pop__ping--good { color: var(--ok); }
.st-pop__ping--ok { color: var(--warn); }
.st-pop__ping--slow { color: var(--bad); }

/* the "lap line": a light laps along the header underline while the region is healthy */
.st-rhd::after { content: ''; position: absolute; left: 16px; right: 16px; bottom: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ok) 60%, transparent) 25%, var(--mustard) 50%, color-mix(in srgb, var(--ok) 60%, transparent) 75%, transparent);
  background-size: 45% 100%; background-repeat: no-repeat; background-position: -60% 0; animation: st-lap 3.8s linear infinite; }
.st-rhd[data-state="warn"]::after { background: var(--warn); background-size: 100% 100%; background-position: 0 0; opacity: .5; animation: st-breathe 2s ease-in-out infinite; }
.st-rhd[data-state="bad"]::after { background: var(--bad); background-size: 100% 100%; background-position: 0 0; opacity: .7; animation: st-breathe 1.1s ease-in-out infinite; }
.st-grid > .st-rsec:nth-child(2n) .st-rhd::after { animation-delay: -1.9s; }
.st-grid > .st-rsec:nth-child(3n) .st-rhd::after { animation-delay: -1.1s; }
@keyframes st-lap { 0% { background-position: -60% 0; } 100% { background-position: 160% 0; } }
@keyframes st-breathe { 50% { opacity: .2; } }

/* node boxes: a grid of rectangular tiles */
.st-boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; padding: 14px 18px 18px; }
.st-box { position: relative; display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); outline: none; cursor: default; z-index: 0;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.st-box__name { flex: 1 1 auto; min-width: 0; font-family: var(--f-mono); font-weight: 600; font-size: 14px; letter-spacing: .02em; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-box[data-state="ok"] { color: var(--ok); }
.st-box[data-state="warn"] { color: var(--warn); }
.st-box[data-state="bad"] { color: var(--bad); }
.st-box[data-state="ok"] .st-dot { animation: st-pulse-dot 2.4s ease-in-out infinite; }
@keyframes st-pulse-dot { 0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, currentColor 6%, transparent); } }
.st-box:hover, .st-box:focus-visible { transform: translateY(-2px); z-index: 30; /* lift above later rows/sections so the popover isn't covered */
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 55%, var(--line)), 0 10px 24px color-mix(in srgb, var(--char) 14%, transparent); }

/* hover popover: a small plain-words readout */
.st-pop { position: absolute; left: 0; top: calc(100% + 10px); transform: translateY(6px); z-index: 40; width: min(240px, 80vw); padding: 14px;
  border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), 0 16px 36px color-mix(in srgb, var(--char) 26%, transparent);
  opacity: 0; pointer-events: none; transition: opacity .18s var(--ease), transform .18s var(--ease); }
.st-box:hover .st-pop, .st-box:focus-visible .st-pop,
.st-rhd--host:hover .st-pop, .st-rhd--host:focus-visible .st-pop { opacity: 1; transform: translateY(0); }
.st-pop::before { content: ''; position: absolute; left: 22px; top: -6px; width: 12px; height: 12px; transform: rotate(45deg); background: var(--surface); box-shadow: inset 1px 1px 0 var(--line); }
/* boxes in later grid columns open their popover to the right edge so it can't run off-screen */
.st-boxes .st-box:nth-child(3n) .st-pop { left: auto; right: 0; }
.st-boxes .st-box:nth-child(3n) .st-pop::before { left: auto; right: 22px; }
.st-pop__hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.st-pop__name { font-family: var(--f-mono); font-weight: 600; font-size: 13px; }
.st-pop__badge { font-family: var(--f-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; background: color-mix(in srgb, currentColor 15%, transparent); }
.st-pop__now { margin: 12px 0 0; font-family: var(--f-display); font-weight: 800; font-size: 17px; line-height: 1.15; letter-spacing: -.01em; }
.st-pop__sum { margin: 6px 0 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.st-pop__chk { margin: 10px 0 0; font-family: var(--f-mono); font-size: 10px; letter-spacing: .04em; color: var(--muted); }

/* a single-machine region's header is itself the hover host for its popover */
.st-rhd--host { cursor: default; border-radius: 18px; transition: background .2s var(--ease); }
.st-rhd--host:hover, .st-rhd--host:focus-visible { background: var(--surface-2); outline: none; z-index: 30; }
.st-rhd--host[data-state="ok"] .st-pop { color: var(--ok); }
.st-rhd--host[data-state="warn"] .st-pop { color: var(--warn); }
.st-rhd--host[data-state="bad"] .st-pop { color: var(--bad); }

@media (prefers-reduced-motion: reduce) {
  .st-rhd::after, .st-box[data-state="ok"] .st-dot { animation: none; }
  .st-rhd[data-state="ok"]::after { background: var(--ok); background-size: 100% 100%; background-position: 0 0; opacity: .5; }
}

/* empties + incidents */
.st-empty { grid-column: 1 / -1; padding: 24px; border-radius: 16px; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; }
.st-incidents { padding: 20px 24px; }
.st-foot { margin-top: 34px; }

/* past incidents */
#stIncidents { display: flex; flex-direction: column; gap: 12px; }
.st-inc { --ok: #2e9d57; --warn: #c98a00; --bad: #d0453b; --maint: #3a7bd5; padding: 18px 22px; }
:root[data-theme="dark"] .st-inc { --warn: #e0a93b; --bad: #ef9a9a; --maint: #6ea8f0; }
.st-inc[data-state="ok"] { color: var(--ok); } .st-inc[data-state="warn"] { color: var(--warn); }
.st-inc[data-state="bad"] { color: var(--bad); } .st-inc[data-state="maint"] { color: var(--maint); }
.st-inc__hd { display: flex; align-items: center; gap: 10px; }
.st-inc__title { flex: 1 1 auto; min-width: 0; font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.st-inc__live { font-family: var(--f-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px;
  color: currentColor; background: color-mix(in srgb, currentColor 15%, transparent); }
.st-inc__when { font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); margin-top: 7px; }
.st-inc__detail { font-size: 14.5px; color: var(--text); margin-top: 8px; }
.st-inc__log { list-style: none; margin: 13px 0 0; padding: 13px 0 0; display: flex; flex-direction: column; gap: 9px; box-shadow: inset 0 1px 0 var(--line); }
.st-inc__log li { display: flex; gap: 12px; font-size: 13.5px; }
.st-inc__ut { flex: none; width: 108px; font-family: var(--f-mono); font-size: 11px; color: var(--muted); padding-top: 1px; }
.st-inc__un { color: var(--text); } .st-inc__un b { color: currentColor; font-weight: 700; }
.st-attack { margin: 0; padding: 0 18px 14px; font-size: 14px; color: var(--muted, inherit); }
.st-rsec--solo .st-attack { padding-top: 0; }
