/* Frame: same dimensions, typography, and inset lines as the root homepage. */
:root {
  color-scheme: dark;
  --background: #000;
  --text: #f0f0f0;
  --muted: #888;
  --subtle: #626262;
  --line: #242424;
  --secondary: #c2c2c2;
  --green: #49e19a;
  --green-bar: #49e19a;
  --maintenance: #ff8a3d;
  --degraded: #ffbe55;
  --red: #ff5e70;
  --inactive: #8b8494;
  --history-empty: #292929;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; background: var(--background); }
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
.container { width: min(1120px, calc(100% - 96px)); margin-inline: auto; }
a { color: inherit; }
.header .container, .footer-inner { position: relative; }
.header .container::after, .footer-inner::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, #202020 9%, #202020 91%, transparent);
}
.header .container::after { bottom: 0; }
.footer-inner::before { top: 0; }
.header .container { display: flex; align-items: center; height: 78px; justify-content: space-between; gap: 24px; }
.wordmark {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.025em;
}
.wordmark:hover { color: #fff; }
.header-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  transition: color .16s ease;
}
.header-nav a:hover { color: var(--text); }
.main { flex: 1; font-size: 15px; line-height: 1.5; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 74px;
  gap: 24px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 400;
}
::selection { background: #eaeaea; color: #000; }

/* Only the extra page identity and privacy navigation differ from homepage. */
.header-identity { display: flex; align-items: center; min-width: 0; gap: 12px; }
.header-separator { color: #626262; font-size: 13px; user-select: none; }
.header-page { font-size: 13px; font-weight: 400; color: #aaa; white-space: nowrap; }
.footer-meta { display: flex; align-items: center; gap: 24px; }
.footer-meta a { color: var(--subtle); text-decoration: none; transition: color .16s ease; }
.footer-meta a:hover { color: var(--muted); }
button, a { font: inherit; }
button:focus-visible, a:focus-visible, .history:focus-visible {
  outline: 1px solid #e6e6e6;
  outline-offset: 5px;
}
/* Main body metadata remains readable; header/footer retain root's muted values. */
.shell { --muted: #a3a3a3; }

/* No oversized title. The health summary leads the actual status page. */
.shell { width: min(100%, 820px); margin-inline: auto; padding: 70px 0 100px; }
h1, h2, h3, p { margin-top: 0; }
.overall-panel {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: start;
  gap: 15px;
}
.live-dot, .state-dot, .overall-icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--subtle);
}
.overall-icon { width: 11px; height: 11px; margin-top: 9px; }
.live-dot.operational, .state-dot.operational, .overall-panel.operational .overall-icon { background: var(--green); }
.live-dot.maintenance, .state-dot.maintenance, .overall-panel.maintenance .overall-icon { background: var(--maintenance); }
.live-dot.degraded, .state-dot.degraded, .overall-panel.degraded .overall-icon { background: var(--degraded); }
.live-dot.outage, .state-dot.outage, .overall-panel.outage .overall-icon { background: var(--red); }
.state-dot.inactive, .overall-panel.inactive .overall-icon { background: var(--inactive); }
.overall-panel h1 {
  margin: 0 0 7px;
  font-size: clamp(20px, 3vw, 24px);
  line-height: 1.28;
  font-weight: 630;
  letter-spacing: -.02em;
}
.overall-panel p { margin: 0; color: var(--secondary); font-size: 14px; line-height: 1.6; }
.live-stamp {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.live-dot { width: 7px; height: 7px; }

.systems-section { margin-top: 76px; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 33px;
}
.section-heading h2 { margin: 0; font-size: 21px; font-weight: 650; letter-spacing: -.025em; line-height: 1.3; }
.section-heading p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.section-heading > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.range-switch { display: flex; gap: 3px; align-items: center; }
.range-switch button {
  appearance: none;
  min-width: 49px;
  min-height: 37px;
  padding: 7px 11px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background-color .16s ease, color .16s ease;
}
.range-switch button:hover { background: #151515; color: #fff; }
.range-switch button.active { background: #202020; color: #fff; font-weight: 650; }

.component-groups { min-height: 260px; }
.component-group + .component-group { margin-top: 40px; }
.group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}
.group-heading h3 { margin: 0; color: var(--secondary); font-size: 14px; font-weight: 600; }
.group-state { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.component { padding: 17px 0 20px; }
.component + .component { margin-top: 7px; }
.component-top { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.component-name { font-size: 15px; font-weight: 600; letter-spacing: -.008em; }
.component-state { display: inline-flex; align-items: center; gap: 8px; color: var(--secondary); font-size: 12px; white-space: nowrap; }
.component-state strong { font-weight: 550; }
.history-line { display: grid; grid-template-columns: minmax(0, 1fr) 77px; gap: 19px; align-items: center; }
.history-wrap { position: relative; min-width: 0; }
.history { display: flex; gap: 3px; height: 23px; cursor: pointer; touch-action: manipulation; }
.history i {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 0;
  background: var(--history-empty);
  transition: filter .15s ease, transform .15s ease;
}
.history i.operational { background: var(--green-bar); opacity: .82; }
.history i.maintenance { background: var(--maintenance); }
.history i.degraded { background: var(--degraded); }
.history i.outage { background: var(--red); }
.history i.inactive { background: #303030; }
.history i:hover, .history i.active { filter: brightness(1.08); transform: translateY(-1px); }
.uptime { text-align: right; font-variant-numeric: tabular-nums; }
.uptime strong { display: block; color: var(--text); font-size: 14px; font-weight: 600; }
.uptime span { display: block; color: var(--muted); font-size: 12px; }
.component-meta { display: flex; justify-content: space-between; gap: 10px 18px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.component-meta span:last-child { text-align: right; }
.component.inactive .component-name, .component.inactive .component-state strong, .component.inactive .uptime strong { color: var(--inactive); }
.component.inactive .component-meta, .component.inactive .uptime span { color: #909090; }

/* History detail remains an overlay; component rows are unboxed. */
.history-tooltip {
  position: absolute;
  z-index: 20;
  bottom: calc(100% + 12px);
  width: min(280px, calc(100vw - 48px));
  padding: 14px 15px;
  background: #121212;
  border: 1px solid #424242;
  border-radius: 0;
  box-shadow: 0 12px 26px rgba(0,0,0,.75);
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.5;
  pointer-events: none;
}
.history-tooltip[hidden] { display: none; }
.history-tooltip > div { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.history-tooltip strong { color: var(--text); font-size: 13px; font-weight: 600; }
.history-tooltip time, .history-tooltip > span { display: block; }
.history-tooltip time { color: var(--text); font-variant-numeric: tabular-nums; }
.history-tooltip [data-coverage] { margin-top: 3px; color: var(--muted); font-variant-numeric: tabular-nums; }
.history-tooltip [data-summary] { margin-top: 8px; }
.history-tooltip [data-breakdown] { margin-top: 3px; color: var(--text); }
.history-tooltip [data-meta] { margin-top: 3px; color: var(--muted); }
.history-tooltip.operational .state-dot { background: var(--green); }
.history-tooltip.maintenance .state-dot { background: var(--maintenance); }
.history-tooltip.degraded .state-dot { background: var(--degraded); }
.history-tooltip.outage .state-dot { background: var(--red); }
.history-tooltip.inactive .state-dot { background: var(--inactive); }

.history-key { display: flex; flex-wrap: wrap; gap: 10px 19px; margin-top: 20px; color: var(--muted); font-size: 12px; }
.history-key span { display: inline-flex; align-items: center; gap: 8px; }
.history-key i { width: 8px; height: 8px; border-radius: 0; background: var(--history-empty); }
.history-key i.operational { background: var(--green-bar); }
.history-key i.maintenance { background: var(--maintenance); }
.history-key i.degraded { background: var(--degraded); }
.history-key i.outage { background: var(--red); }
.history-key i.inactive { background: #3f3f3f; }

.incidents-section { margin-top: 76px; }
.incident-heading { margin-bottom: 12px; }
.incident-list { min-height: 56px; }
.incident { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 17px 0; }
.incident + .incident { margin-top: 5px; }
.incident .state-dot { margin-top: 6px; }
.incident h3 { margin: 0; font-size: 15px; font-weight: 600; }
.incident p { margin: 5px 0 0; color: var(--secondary); font-size: 13px; }
.incident time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.empty { margin: 0; padding: 20px 0; color: var(--secondary); font-size: 14px; }
.loading-row { display: grid; grid-template-columns: 1fr 2fr 80px; gap: 20px; padding: 25px 0; }
.loading-row span { height: 11px; background: #292929; opacity: .8; animation: breathe 1.4s ease-in-out infinite alternate; }
.loading-row span:nth-child(2) { animation-delay: .2s; }
.loading-row span:nth-child(3) { animation-delay: .4s; }
.noscript { padding: 22px 0; color: var(--red); }
@keyframes breathe { to { opacity: .25; } }

@media (max-width: 640px) {
  .container { width: calc(100% - 44px); }
  .header .container { height: 66px; }
  .header-identity { gap: 9px; }
  .header-page { font-size: 13px; }
  .footer-inner { min-height: 64px; }
  .footer-meta { gap: 18px; }
  .shell { padding: 53px 0 75px; }
  .overall-panel { grid-template-columns: 11px minmax(0, 1fr); gap: 13px; }
  .overall-panel h1 { font-size: 20px; }
  .live-stamp { grid-column: 2; margin-top: 0; }
  .systems-section { margin-top: 60px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 15px; margin-bottom: 25px; }
  .range-switch { gap: 5px; }
  .range-switch button { min-width: 54px; min-height: 39px; }
  .component-group + .component-group { margin-top: 36px; }
  .component { padding: 17px 0 18px; }
  .component-top { align-items: flex-start; }
  .component-state { justify-content: flex-end; }
  .history-line { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .uptime { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; text-align: left; }
  .uptime span { order: -1; }
  .component-meta { flex-wrap: wrap; }
  .component-meta span:last-child { text-align: left; }
  .incidents-section { margin-top: 61px; }
  .incident { grid-template-columns: 8px minmax(0, 1fr); gap: 8px 12px; }
  .incident time { grid-column: 2; }
}
@media (max-width: 360px) {
  .header .container { gap: 10px; }
  .header-identity { gap: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* Hide legacy Nginx sub_filter injected link, since footer already contains Privacy */
.local-privacy-link { display: none !important; }
