:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #eeeee6;
  background: #141715;
  color-scheme: dark;
  --page: #141715;
  --panel: #1b201c;
  --line: #343d33;
  --muted: #a1ada0;
  --ok: #c6ee82;
  --warn: #ebbc75;
  --fail: #f39083;
  --unknown: #9aa49d;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, a { font: inherit; }
button { cursor: pointer; color: inherit; background: none; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--ok); outline-offset: 3px; }
button:disabled { opacity: .55; cursor: progress; }
a { color: var(--ok); }
.shell { width: min(100%, 1100px); padding: max(18px, var(--tg-content-safe-area-inset-top, 0px)) clamp(16px,4vw,56px) max(36px, var(--tg-content-safe-area-inset-bottom, 0px)); margin: auto; }
.masthead, .title, .map-top, .routers header, .sheet header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.masthead { padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; letter-spacing: -.025em; }
.signal { display: inline-flex; align-items: end; gap: 2px; height: 17px; }
.signal i { width: 3px; height: 6px; border-radius: 1px; background: var(--ok); }
.signal i:nth-child(2) { height: 10px; }
.signal i:nth-child(3) { height: 15px; }
.clock, .micro, .map-top span { font: 11px/1.5 var(--mono); letter-spacing: .035em; color: var(--muted); }
.clock { text-align: right; }
.title { margin: clamp(22px,5vw,46px) 0 21px; align-items: flex-start; }
h1,h2,p { margin: 0; }
h1 { font-size: clamp(39px,8vw,76px); font-weight: 750; line-height: 1; letter-spacing: -.07em; }
.title p { color: var(--muted); font-size: 14px; line-height: 1.5; margin-top: 11px; }
.refresh, #close { min-width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; font-size: 22px; }
.refresh:hover, #close:hover { border-color: var(--muted); }
.notice { padding: 15px 17px; color: #dadbcc; background: #242821; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; font-size: 14px; line-height: 1.5; }
.notice a { margin-left: 7px; }
.map-card { border: 1px solid var(--line); border-radius: 18px; background: #191f19; overflow: hidden; }
.map-top { padding: 16px clamp(13px,3vw,22px) 0; }
.map-top h2 { font-size: 17px; letter-spacing: -.025em; }
.map-top span { padding: 2px 7px; border: 1px solid #414d3d; border-radius: 4px; }
.chart { position: relative; height: clamp(202px,38vw,380px); background-image: radial-gradient(circle,#87967d2b 1px,transparent 1px); background-size: 18px 18px; }
canvas { width: 100%; height: 100%; display: block; }
#markers { position: absolute; inset: 0; pointer-events: none; }
.marker { position: absolute; transform: translate(-50%,-50%); min-width: 45px; min-height: 44px; display: grid; justify-items: center; align-content: center; gap: 4px; border: 0; pointer-events: auto; }
.marker span { font: 700 10px/1.1 var(--mono); background: #151b16eb; border-radius: 3px; padding: 2px 4px; white-space: nowrap; }
.marker .dot { width: 10px; height: 10px; outline: 1px solid currentColor; outline-offset: 3px; }
.marker.switch .dot { animation: pulse .85s ease-in-out 2; }
@keyframes pulse { 50% { outline-offset: 8px; } }
.locations { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,94px),1fr)); border-top: 1px solid var(--line); }
.location { min-height: 75px; text-align: left; padding: 11px 10px; border: 0; border-right: 1px solid var(--line); display: grid; align-content: center; gap: 4px; min-width: 0; }
.location:hover, .router:hover { background: #232b22; }
.location strong { font-size: 13px; overflow-wrap: anywhere; }
.location small { color: var(--muted); font: 10px/1.4 var(--mono); }
.location .status { font-size: 10px; }
.legend { padding: 11px 12px; display: flex; flex-wrap: wrap; gap: 6px 15px; border-top: 1px solid var(--line); font: 10px/1.5 var(--mono); color: var(--muted); }
.legend span, .status { display: inline-flex; align-items: center; gap: 5px; }
.dot { display: inline-block; flex: 0 0 auto; width: 7px; height: 7px; background: currentColor; border-radius: 50%; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .fail { color: var(--fail); } .unknown { color: var(--unknown); }
.dot.warn { border-radius: 1px; transform: rotate(45deg); }
.dot.fail { border-radius: 1px; }
.dot.unknown { background: transparent; border: 1px solid currentColor; }
.routers { margin-top: 27px; }
.routers header { margin-bottom: 11px; }
.routers h2 { font-size: 25px; letter-spacing: -.04em; }
.router-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,235px),1fr)); gap: 8px; }
.router { border-radius: 11px; border: 1px solid var(--line); min-width: 0; text-align: left; padding: 12px 13px; background: var(--panel); }
.router h3 { font-size: 15px; margin: 0 0 7px; letter-spacing: -.02em; }
.router p { font-size: 13px; line-height: 1.4; }
.router .ctl { color: var(--muted); font: 10px/1.5 var(--mono); margin-top: 7px; }
.arrow { float: right; color: var(--muted); font-size: 16px; }
.last { color: var(--muted); }
dialog { position: fixed; inset: auto 0 0; width: min(100%,620px); max-width: none; max-height: min(82dvh,760px); padding: 0; border: 1px solid var(--line); border-radius: 20px 20px 0 0; background: #1e241e; color: inherit; }
dialog::backdrop { background: #070a08ba; }
.sheet { padding: 16px clamp(16px,4vw,28px) max(20px, env(safe-area-inset-bottom)); }
.sheet h2 { font-size: 27px; letter-spacing: -.04em; margin-top: 3px; }
.facts { display: grid; gap: 0; margin: 14px 0; }
.fact { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.fact dt { color: var(--muted); } .fact dd { text-align: right; margin: 0; }
.history h3, .events h3 { margin: 17px 0 8px; font-size: 15px; }
.bars { display: grid; grid-template-columns: repeat(24,minmax(0,1fr)); gap: 3px; height: 35px; align-items: end; }
.bar { width: 100%; min-height: 4px; background: currentColor; opacity: .8; border-radius: 2px; }
.bar.unknown { opacity: .23; }
.axis { display: flex; justify-content: space-between; margin: 4px 0 5px; }
.events ul { list-style: none; margin: 0; padding: 0; }
.events li { border-top: 1px solid var(--line); padding: 7px 0; font-size: 13px; line-height: 1.45; }
.events li time { display: block; color: var(--muted); font: 10px/1.4 var(--mono); }
@media (max-width: 420px) { .router-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; } }
