:root {
  color-scheme: dark;
  --bg: #03080b;
  --text: #eaf4f6;
  --quiet: #83a9ad;
  --line: rgba(117, 184, 193, .22);
  --cyan: #56dce7;
  --accent: #f4aa42;
  font-family: Bahnschrift, Aptos, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  overflow-x: clip;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  background:
    radial-gradient(ellipse at 51% 18%, rgba(27, 78, 91, .13), transparent 43%),
    radial-gradient(ellipse at 52% 64%, rgba(9, 36, 45, .08), transparent 62%),
    var(--bg);
}
body[data-status="nominal"] { --accent: #a5d3d7; }
body[data-status="watch"] { --accent: #e2c47a; }
body[data-status="high"] { --accent: #ed985e; }
body[data-status="critical"] { --accent: #e87870; }
.shell { max-width: 1720px; margin: 0 auto; padding: 0 clamp(20px, 3.4vw, 58px); overflow-x: clip; }

.topbar { height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { --logo-scale: 1; flex: none; display: flex; align-items: center; gap: calc(12px * var(--logo-scale)); }
.brand-symbol, .brand-lockup { display: block; flex: none; background-repeat: no-repeat; background-size: contain; background-position: center; }
.brand-symbol { width: calc(55px * var(--logo-scale)); height: calc(60px * var(--logo-scale)); background-image: url('./assets/sibyl-symbol-dark.png?v=ebe1d4939fb247a0'); }
.brand-lockup { width: calc(180px * var(--logo-scale)); height: calc(42px * var(--logo-scale)); background-image: url('./assets/sibyl-wordmark-dark.png?v=ebe1d4939fb247a0'); }
.brand--light .brand-symbol { background-image: url('./assets/sibyl-symbol-light.png?v=ebe1d4939fb247a0'); }
.brand--light .brand-lockup { background-image: url('./assets/sibyl-wordmark-light.png?v=ebe1d4939fb247a0'); }
.brand--dark .brand-symbol, .brand--dark .brand-lockup { mix-blend-mode: screen; }
.brand--light .brand-symbol, .brand--light .brand-lockup { mix-blend-mode: multiply; }
.topbar-status { display: flex; align-items: center; gap: 10px; color: #b6cdd0; font-size: 10px; font-weight: 550; letter-spacing: .12em; white-space: nowrap; }
.live-label { color: #78a7ad; font-size: 9px; letter-spacing: .2em; }
.live-dot { width: 4px; height: 4px; flex: none; border-radius: 50%; background: #74cdd4; box-shadow: 0 0 5px rgba(90, 199, 209, .35); }

.monitor-stage {
  display: grid;
  grid-template-columns: minmax(215px, .73fr) minmax(450px, 1.65fr) minmax(215px, .73fr);
  gap: clamp(16px, 2vw, 36px);
  min-height: 755px;
  align-items: start;
  position: relative;
}
.system-rail, .field-rail { position: relative; z-index: 3; padding-top: clamp(190px, 21vh, 250px); }
.system-rail h2, .field-rail h2 { margin: 0 0 31px; font-size: 10px; font-weight: 600; letter-spacing: .23em; color: #a9c8cb; }
.system-list { display: grid; gap: 15px; }
.system-row { display: grid; grid-template-columns: minmax(74px, 1fr) 31px minmax(60px, 1.15fr); gap: 11px; align-items: center; min-width: 0; }
.system-name { color: #809fa4; font-size: 10px; font-weight: 550; letter-spacing: .14em; }
.system-value { color: #bfd2d4; font-size: 15px; text-align: right; }
.system-row.hot .system-value { color: var(--accent); }
.meter { position: relative; height: 1px; background: rgba(70, 133, 145, .2); }
.meter::after { content: ""; position: absolute; width: var(--width); height: 1px; background: #8caeb2; }
.system-row.hot .meter::after { background: var(--accent); opacity: .7; }

.center-stage { min-width: 0; display: flex; flex-direction: column; align-items: center; position: relative; z-index: 2; }
.globe-stage {
  --globe-size: min(45vw, calc(100svh - 310px), 570px);
  width: min(100%, var(--globe-size));
  aspect-ratio: 1;
  min-width: 360px;
  position: relative;
  z-index: 5;
  margin-top: 2px;
  isolation: isolate;
}
.globe-ambient { position: absolute; z-index: -1; inset: 5%; border-radius: 50%; background: radial-gradient(circle, rgba(24, 118, 136, .12), transparent 68%); filter: blur(19px); }
#earth-canvas { position: absolute; z-index: 2; inset: 0; display: block; width: 100%; height: 100%; }
#earth-canvas:focus-visible { outline: 1px solid rgba(143, 205, 212, .48); outline-offset: -8px; border-radius: 50%; }
.orbit { position: absolute; z-index: 1; top: 50%; left: 50%; border: 1px solid rgba(126, 205, 213, .08); border-radius: 50%; pointer-events: none; }
.orbit-a { width: 109%; height: 54%; border-top-color: rgba(159, 227, 231, .26); border-bottom-color: rgba(89, 166, 179, .15); transform: translate(-50%, -50%) rotate(-24deg); }
.hotspot-detail { position: absolute; z-index: 8; width: min(224px, calc(100% - 12px)); padding: 9px 10px 8px; color: #d7e7e9; background: rgba(4, 15, 19, .94); border: 1px solid rgba(120, 174, 182, .26); box-shadow: 0 7px 22px rgba(0, 0, 0, .28); font-size: 10px; line-height: 1.4; letter-spacing: .01em; }
.hotspot-detail-top { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.hotspot-detail strong { color: #e5f1f2; font-size: 10px; font-weight: 650; letter-spacing: .075em; }
.hotspot-close { border: 0; padding: 0 1px; margin: -3px -2px 0 0; background: none; color: #8caeb2; font-size: 16px; line-height: 1; cursor: pointer; }
.hotspot-detail p { margin: 5px 0 6px; color: #aec7ca; }
.hotspot-detail small { display: block; margin-top: 3px; color: #789da2; font-size: 8px; letter-spacing: .07em; }
.hotspot-links { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 7px; }
.hotspot-links a { color: #a6cbd0; font-size: 9px; text-decoration-color: rgba(157, 206, 212, .44); text-underline-offset: 2px; }
.hotspot-links a:hover, .hotspot-links a:focus-visible { color: #e8f5f6; }

.score-cluster { width: min(100%, 420px); margin-top: -32px; position: relative; z-index: 4; }
.preview-mark { margin-bottom: 9px; color: #759a9e; font-size: 8px; font-weight: 600; letter-spacing: .15em; }
.score-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.score-heading span { padding-bottom: 16px; color: #bad6d9; font-size: 10px; font-weight: 600; letter-spacing: .22em; white-space: nowrap; }
.score-heading strong { color: #f1f8f8; font-size: 102px; font-weight: 300; line-height: .95; letter-spacing: -.07em; }
.score-condition { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-top: 3px; }
.global-status { color: var(--accent); font-size: 18px; font-weight: 600; letter-spacing: .23em; }
.trend { color: var(--accent); font-size: 10px; font-weight: 600; letter-spacing: .1em; white-space: nowrap; }
.stress-trace { display: block; width: 100%; height: 58px; margin-top: 12px; overflow: visible; }
.trace-threshold { stroke: rgba(127, 182, 189, .07); stroke-width: .55; stroke-dasharray: 2 9; }
.trace-line { fill: none; stroke: rgba(113, 208, 218, .38); stroke-width: .9; vector-effect: non-scaling-stroke; }
.trace-connector { stroke: rgba(132, 219, 226, .14); stroke-width: .6; }
.trace-halo { fill: var(--cyan); opacity: .08; filter: drop-shadow(0 0 4px var(--cyan)); }
.trace-endpoint { fill: #bfe0e2; filter: drop-shadow(0 0 3px var(--cyan)); }
.trace-caption { color: #52797e; font-size: 8px; font-weight: 600; letter-spacing: .15em; }
body[data-preview="field"] .stress-trace, body[data-preview="field"] .trace-caption, body[data-preview="field"] .trend { display: none; }

.field-intro { margin-bottom: 19px; color: #7caaaf; font-size: 9px; font-weight: 600; letter-spacing: .15em; }
.hotspot-list { padding: 0; margin: 0; list-style: none; display: grid; gap: 11px; }
.hotspot-list li { display: flex; align-items: baseline; gap: 10px; color: #829fa3; font-size: 9px; font-weight: 550; line-height: 1.45; letter-spacing: .11em; overflow-wrap: anywhere; }
.hotspot-list li::before { content: ""; width: 3px; height: 3px; flex: none; border-radius: 50%; background: #8eafb2; }
.hotspot-list li.hot::before { background: #f6a843; }
.hotspot-list li.critical::before { background: #e87870; }
.field-propagation { margin-top: 82px; }
.field-propagation h2, .field-alert h2 { line-height: 1.5; margin-bottom: 17px; }
.field-block strong { color: #8fb9bd; font-size: 17px; font-weight: 450; letter-spacing: .22em; }
.field-alert { margin-top: 70px; }
body[data-alert="none"] .field-alert strong { color: #6d9196; }
body[data-alert="watch"] .field-alert strong, body[data-alert="alert"] .field-alert strong { color: var(--accent); }
body[data-alert="critical"] .field-alert strong { color: #e87870; }
.wide-stress { max-width: 680px; margin: 55px auto 70px; color: #78989d; }
.wide-stress h2 { margin: 0 0 18px; color: #90b0b4; font-size: 9px; font-weight: 600; letter-spacing: .18em; }
.wide-stress-row { display: flex; justify-content: space-between; gap: 28px; padding: 9px 0; border-top: 1px solid rgba(107, 157, 166, .1); font-size: 9px; letter-spacing: .09em; }
.wide-stress-row span:first-child { color: #b0c4c7; }
.wide-stress-row span:last-child { text-align: right; }


@media (prefers-reduced-motion: no-preference) {
  .orbit-a { animation: orbital-drift 110s ease-in-out infinite alternate; }
  .live-dot { animation: indicator-breathe 7s ease-in-out infinite; }
  @keyframes orbital-drift { to { transform: translate(-50%, -50%) rotate(-20deg); opacity: .72; } }
  @keyframes indicator-breathe { 50% { opacity: .58; box-shadow: 0 0 7px rgba(90, 199, 209, .48); } }
}

@media (max-width: 1190px) {
  .monitor-stage { grid-template-columns: minmax(165px, .7fr) minmax(390px, 1.7fr) minmax(165px, .7fr); gap: 12px; }
  .system-row { grid-template-columns: minmax(62px, 1fr) 27px minmax(42px, 1fr); gap: 7px; }
  .system-name { font-size: 9px; }
  .system-value { font-size: 14px; }
  .field-rail h2, .system-rail h2 { font-size: 10px; }
}

@media (max-width: 850px) {
  .shell { padding: 0 20px; }
  .topbar { height: 78px; }
  .brand { --logo-scale: .72; }
  .topbar-status { font-size: 8px; }
  .monitor-stage { display: flex; flex-direction: column; align-items: stretch; gap: 0; min-height: 0; }
  .center-stage { order: 0; }
  .globe-stage { --globe-size: min(92vw, 410px); min-width: 0; margin-top: 0; }
  .score-cluster { width: min(100%, 420px); margin-top: -25px; padding: 0 5px 30px; }
  .score-heading strong { font-size: 85px; }
  .system-rail { order: 1; padding: 70px 2px 50px; width: min(100%, 620px); margin: auto; }
  .system-row { grid-template-columns: minmax(80px, 1fr) 39px minmax(90px, 1.5fr); gap: 16px; min-height: 31px; }
  .system-name { font-size: 10px; }
  .system-value { font-size: 16px; }
  .field-rail { order: 2; width: min(100%, 620px); margin: auto; padding: 20px 2px 60px; }
  .field-propagation, .field-alert { margin-top: 48px; }
  .hotspot-list { gap: 12px; }
  .wide-stress { margin: 10px auto 50px; }
}

@media (max-width: 480px) {
  .shell { padding: 0 16px; }
  .brand { --logo-scale: .6; }
  .topbar-status { gap: 6px; font-size: 8px; letter-spacing: .04em; }
  .live-label { font-size: 7px; letter-spacing: .1em; }
  .globe-stage { --globe-size: min(94vw, 360px); }
  .score-cluster { margin-top: -18px; max-width: 340px; padding-bottom: 22px; }
  .score-heading span { padding-bottom: 12px; font-size: 8px; letter-spacing: .18em; }
  .score-heading strong { font-size: 72px; }
  .stress-trace { height: 50px; }
  .global-status { font-size: 15px; }.trend { font-size: 9px; }
  .score-condition { margin-top: 4px; }
  .system-rail { padding-top: 63px; }
  .system-rail h2, .field-rail h2 { font-size: 10px; }
  .system-row { grid-template-columns: minmax(80px, 1fr) 33px minmax(80px, 1.2fr); gap: 11px; }
  .system-name { font-size: 9px; }
  .hotspot-detail { width: min(208px, calc(100% - 12px)); }
  .wide-stress-row { display: block; }
  .wide-stress-row span { display: block; }
  .wide-stress-row span:last-child { margin-top: 3px; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
