/* ------------------------------------------------------------------
   Global Internet Infrastructure — design tokens
   Deep-ocean NOC console: abyssal navy field, phosphor cyan for
   facilities, cable amber for subsea systems, sea-glass for landings.
------------------------------------------------------------------- */
:root {
  --ink:        #050a12;
  --ink-2:      #081120;
  --panel:      #0b1522;
  --panel-2:    #0e1b2c;
  --line:       #16283a;
  --line-2:     #1f374f;
  --text:       #dce7f2;
  --muted:      #7a8fa6;
  --faint:      #4a5d72;

  --facility:   #3fd0ff;   /* datacenters */
  --cable:      #ffb454;   /* subsea cables */
  --landing:    #7ee8c7;   /* landing stations */
  --cloud:      #a899ff;   /* cloud on-ramps */
  --isp:        #6fb7ff;   /* ISPs / carriers */
  --ixp:        #ffd166;   /* IXPs */

  --display: "Space Grotesk", system-ui, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, monospace;
  --body:    "IBM Plex Sans", system-ui, sans-serif;

  --radius: 10px;
  --topbar-h: 64px;
  --statusbar-h: 28px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 70% -10%, #0a1a30 0%, transparent 60%),
    radial-gradient(900px 600px at 10% 110%, #071426 0%, transparent 55%),
    var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.45;
  overflow: hidden;
}

/* ---------------- top bar ---------------- */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink-2) 82%, transparent);
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--facility);
  position: relative; flex: none;
  box-shadow: 0 0 14px rgba(63, 208, 255, .35), inset 0 0 8px rgba(63, 208, 255, .25);
}
.brand-mark::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--cable);
  box-shadow: 0 0 8px rgba(255, 180, 84, .8);
}
.brand h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand-sub {
  margin: 1px 0 0;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: .04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 46vw;
}
.telemetry { display: flex; gap: 22px; }
.tele-item { display: flex; flex-direction: column; align-items: flex-end; }
.tele-num {
  font-family: var(--mono);
  font-size: 17px; font-weight: 600;
  color: var(--facility);
  font-variant-numeric: tabular-nums;
}
.tele-item:nth-child(4) .tele-num { color: var(--cable); }
.tele-item:nth-child(5) .tele-num { color: var(--landing); }
.tele-label {
  font-family: var(--mono);
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--faint);
}

/* ---------------- layout ---------------- */
.layout {
  display: grid;
  grid-template-columns: 430px 1fr;
  height: calc(100vh - var(--topbar-h) - var(--statusbar-h));
  position: relative;
}
.panel { background: var(--panel); border-right: 1px solid var(--line); }

/* ---------------- search panel ---------------- */
.search-panel { display: flex; flex-direction: column; min-height: 0; }
.search-head { padding: 16px 16px 10px; border-bottom: 1px solid var(--line); }
.search-label {
  display: block;
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); margin-bottom: 8px;
}
.search-box { position: relative; }
.search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--faint); pointer-events: none;
}
#search-input {
  width: 100%;
  background: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono); font-size: 13px;
  padding: 10px 12px 10px 32px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#search-input::placeholder { color: var(--faint); }
#search-input:focus {
  border-color: var(--facility);
  box-shadow: 0 0 0 3px rgba(63, 208, 255, .12);
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .03em;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all .12s;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.is-active {
  color: var(--ink);
  background: var(--facility);
  border-color: var(--facility);
  font-weight: 600;
}
.results-meta {
  padding: 8px 16px;
  font-family: var(--mono); font-size: 10.5px;
  color: var(--faint);
  border-bottom: 1px solid var(--line);
}
.results { overflow-y: auto; flex: 1; min-height: 0; }
.result-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 9px 16px;
  background: transparent;
  border: 0; border-bottom: 1px solid var(--line);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background .1s;
}
.result-row:hover, .result-row:focus-visible { background: var(--panel-2); }
.type-badge {
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em;
  padding: 3px 0; text-align: center;
  border-radius: 4px;
  border: 1px solid;
}
.type-badge.facility { color: var(--facility); border-color: rgba(63,208,255,.4); }
.type-badge.cable    { color: var(--cable);    border-color: rgba(255,180,84,.4); }
.type-badge.landing  { color: var(--landing);  border-color: rgba(126,232,199,.4); }
.type-badge.ixp      { color: var(--ixp);      border-color: rgba(255,209,102,.4); }
.type-badge.asn      { color: var(--isp);      border-color: rgba(111,183,255,.4); }
.type-badge.onramp   { color: var(--cloud);    border-color: rgba(168,153,255,.4); }
.result-main { min-width: 0; }
.result-name {
  display: block;
  font-size: 12.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result-sub {
  display: block; margin-top: 1px;
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result-metric {
  font-family: var(--mono); font-size: 10px; color: var(--faint);
  white-space: nowrap;
}
.results-empty { padding: 24px 16px; color: var(--muted); font-size: 12.5px; }

/* ---------------- globe stage ---------------- */
.globe-stage { position: relative; min-width: 0; overflow: hidden; }
#globe { position: absolute; inset: 0; }
.legend {
  position: absolute; left: 14px; bottom: 14px;
  display: flex; gap: 8px; z-index: 5;
}
.legend-item {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10.5px;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all .12s;
}
.legend-item:hover { color: var(--text); }
.legend-item.is-on { color: var(--text); border-color: var(--muted); }
.legend-item:not(.is-on) { opacity: .55; }
.legend-item:not(.is-on) .dot { background: var(--faint) !important; box-shadow: none !important; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-facility { background: var(--facility); box-shadow: 0 0 6px var(--facility); }
.dot-cable    { background: var(--cable);    box-shadow: 0 0 6px var(--cable); }
.dot-landing  { background: var(--landing);  box-shadow: 0 0 6px var(--landing); }

.loading {
  position: absolute; inset: 0; z-index: 6;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: var(--ink);
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  transition: opacity .4s;
}
.loading.is-done { opacity: 0; pointer-events: none; }
.loading-ring {
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid var(--line-2);
  border-top-color: var(--facility);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.load-error {
  position: absolute; inset: 0; z-index: 7;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; background: var(--ink);
}
.load-error h2 { font-family: var(--display); font-size: 18px; margin: 0 0 8px; }
.load-error p { color: var(--muted); max-width: 480px; }
.load-error code {
  font-family: var(--mono); color: var(--facility);
  background: var(--panel-2); padding: 1px 6px; border-radius: 4px;
}

/* globe tooltip (globe.gl injects plain divs) */
.gtip {
  font-family: var(--mono); font-size: 11px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  max-width: 260px;
}
.gtip b { color: var(--facility); font-weight: 600; }
.gtip.cable b { color: var(--cable); }
.gtip.landing b { color: var(--landing); }
.gtip small { color: var(--muted); display: block; margin-top: 2px; }

/* ---------------- detail panel ---------------- */
.detail-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 400px; max-width: 92vw;
  border-left: 1px solid var(--line);
  border-right: 0;
  display: flex; flex-direction: column;
  z-index: 8;
  box-shadow: -18px 0 40px rgba(0, 0, 0, .45);
  animation: slide-in .18s ease-out;
}
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.detail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.detail-kind {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted);
}
.icon-btn {
  background: transparent; border: 0; color: var(--muted);
  font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 6px;
  border-radius: 6px;
}
.icon-btn:hover { color: var(--text); background: var(--panel-2); }
.detail-body { overflow-y: auto; padding: 16px; flex: 1; min-height: 0; }
.detail-title {
  font-family: var(--display); font-size: 19px; font-weight: 600;
  margin: 0 0 2px; letter-spacing: .01em;
}
.detail-sub { font-family: var(--mono); font-size: 11px; color: var(--muted); margin: 0 0 14px; }
.stat-row { display: flex; gap: 18px; margin: 0 0 16px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat b { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--text); }
.stat span { font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); }

.group { margin-bottom: 18px; }
.group-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted);
  margin: 0 0 8px;
}
.group-title .count { color: var(--faint); font-weight: 400; }
.group-title::before { content: ""; width: 8px; height: 8px; border-radius: 2px; }
.group.g-onramp .group-title::before { background: var(--cloud); }
.group.g-ixp    .group-title::before { background: var(--ixp); }
.group.g-isp    .group-title::before { background: var(--isp); }
.group.g-asn    .group-title::before { background: var(--facility); }
.group.g-cable  .group-title::before { background: var(--cable); }
.group.g-landing .group-title::before { background: var(--landing); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tagchip {
  font-family: var(--mono); font-size: 11px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 6px; padding: 4px 9px;
  cursor: pointer;
}
.tagchip:hover { border-color: var(--cloud); }
.g-ixp .tagchip:hover { border-color: var(--ixp); }
.empty-note { font-family: var(--mono); font-size: 11px; color: var(--faint); }

.net-filter {
  width: 100%; margin-bottom: 8px;
  background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 6px;
  color: var(--text); font-family: var(--mono); font-size: 11.5px;
  padding: 6px 9px; outline: none;
}
.net-list { display: flex; flex-direction: column; }
.net-row {
  display: grid; grid-template-columns: 84px 1fr auto; gap: 8px;
  align-items: baseline;
  width: 100%;
  padding: 5px 4px;
  background: transparent; border: 0; border-bottom: 1px dashed var(--line);
  color: var(--text); text-align: left; cursor: pointer;
  font-size: 12px;
}
.net-row:hover { background: var(--panel-2); }
.net-asn { font-family: var(--mono); font-size: 11px; color: var(--isp); }
.net-type { font-family: var(--mono); font-size: 9.5px; color: var(--faint); text-transform: uppercase; }
.link-row {
  display: block; width: 100%;
  background: transparent; border: 0; border-bottom: 1px dashed var(--line);
  color: var(--text); text-align: left; cursor: pointer;
  padding: 7px 4px; font-size: 12.5px;
}
.link-row:hover { background: var(--panel-2); }
.link-row small { display: block; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.action-btn {
  font-family: var(--mono); font-size: 11px;
  background: transparent; color: var(--facility);
  border: 1px solid rgba(63,208,255,.45);
  border-radius: 6px; padding: 6px 12px; cursor: pointer;
  margin-bottom: 14px;
}
.action-btn:hover { background: rgba(63,208,255,.1); }

/* ---------------- status bar ---------------- */
.statusbar {
  height: var(--statusbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  background: var(--ink-2);
  font-family: var(--mono); font-size: 10px; color: var(--faint);
  letter-spacing: .05em;
}
.legal-link {
  background: none; border: 0; padding: 0;
  font: inherit; color: var(--muted);
  text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}
.legal-link:hover { color: var(--facility); }

/* ---------------- legal modal ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(3, 7, 12, .72);
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  max-width: 620px; width: 100%;
  max-height: 82vh; overflow-y: auto;
  padding: 22px 26px 26px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.modal h2 {
  font-family: var(--display); font-size: 18px; font-weight: 600;
  letter-spacing: .03em; margin: 0;
}
.modal h3 {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--facility);
  margin: 20px 0 6px;
}
.modal p, .modal li { font-size: 12.5px; color: var(--text); line-height: 1.55; }
.modal p { margin: 0 0 8px; }
.modal ul { margin: 0; padding-left: 18px; }
.modal li { margin-bottom: 5px; }
.modal a { color: var(--facility); text-decoration: none; }
.modal a:hover { text-decoration: underline; }
.modal strong { color: #fff; }

/* ---------------- scrollbars & focus ---------------- */
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--panel); }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }
:focus-visible { outline: 2px solid var(--facility); outline-offset: 1px; }

/* ---------------- responsive ---------------- */
@media (max-width: 980px) {
  body { overflow: auto; }
  .layout { grid-template-columns: 1fr; height: auto; }
  .search-panel { order: 2; height: 46vh; border-right: 0; border-top: 1px solid var(--line); }
  .globe-stage { order: 1; height: 54vh; }
  .telemetry { display: none; }
  .detail-panel { position: fixed; top: var(--topbar-h); bottom: var(--statusbar-h); }
  .brand-sub { max-width: 70vw; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* ---------------- mapbox chrome ---------------- */
.mapboxgl-popup-content {
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.mapboxgl-popup-content .gtip { border: 0; background: transparent; }
.mapboxgl-popup-tip { display: none; }
.mapboxgl-ctrl-attrib {
  background: rgba(8, 17, 32, .75) !important;
  font-family: var(--mono); font-size: 9px;
}
.mapboxgl-ctrl-attrib a { color: var(--muted) !important; }
.mapboxgl-ctrl-logo { opacity: .55; }
#globe .mapboxgl-canvas:focus { outline: none; }

/* ---------------- view tabs ---------------- */
.tabs { display: flex; gap: 4px; margin-left: 8px; }
.tab {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
  transition: all .12s;
}
.tab:hover { color: var(--text); }
.tab.is-active {
  color: var(--ink);
  background: var(--facility);
  border-color: var(--facility);
}

/* ---------------- BGP live view ---------------- */
.bgp-view {
  height: calc(100vh - var(--topbar-h) - var(--statusbar-h));
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-height: 0;
}
.bgp-controls {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.bgp-controls .action-btn { margin-bottom: 0; }
.action-btn.ghost { color: var(--muted); border-color: var(--line-2); }
.action-btn.ghost:hover { color: var(--text); background: var(--panel-2); }
.bgp-status {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  min-width: 240px;
}
.pulse {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--faint); flex: none;
}
.pulse[data-state="live"] { background: #57e6b4; box-shadow: 0 0 8px #57e6b4; animation: beat 1.6s infinite; }
.pulse[data-state="connecting"] { background: var(--cable); animation: beat .8s infinite; }
.pulse[data-state="error"] { background: #ff6b7a; }
@keyframes beat { 50% { opacity: .35; } }
.bgp-input {
  background: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono); font-size: 11.5px;
  padding: 7px 10px;
  outline: none;
  min-width: 170px;
}
.bgp-input:focus { border-color: var(--facility); }
select.bgp-input { min-width: 190px; }
.bgp-type { margin-top: 0; }

.bgp-stats {
  display: flex; align-items: center; gap: 26px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--ink-2);
}
.bgp-stats .tele-item { align-items: flex-start; }
.bgp-stats .tele-num.down { color: #ff6b7a; }
#bgp-spark { margin-left: auto; opacity: .9; }

.bgp-feed-wrap { overflow-y: auto; min-height: 0; position: relative; }
.bgp-feed { width: 100%; border-collapse: collapse; }
.bgp-feed th {
  position: sticky; top: 0; z-index: 2;
  background: var(--panel);
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .09em;
  color: var(--faint);
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-2);
}
.bgp-feed td {
  font-size: 12px;
  padding: 5px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 320px;
}
.bgp-feed td.mono { font-family: var(--mono); font-size: 11px; }
.bgp-feed td.dim { color: var(--muted); }
.bgp-feed td.path { max-width: 420px; color: var(--muted); }
.bgp-type-announce { color: #57e6b4; font-family: var(--mono); font-weight: 600; font-size: 10.5px; }
.bgp-type-withdraw { color: #ff6b7a; font-family: var(--mono); font-weight: 600; font-size: 10.5px; }
.bgp-row.withdraw td:first-child { border-left: 2px solid rgba(255,107,122,.5); }
.bgp-row.announce td:first-child { border-left: 2px solid rgba(87,230,180,.35); }
.asn-link {
  background: transparent; border: 0; padding: 0;
  font-family: var(--mono); font-size: 11px;
  color: var(--isp); cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.asn-link:hover { color: var(--facility); }
.bgp-hint {
  padding: 28px 20px; text-align: center;
  font-family: var(--mono); font-size: 11.5px; color: var(--faint);
}

@media (max-width: 980px) {
  .tabs { margin-left: 0; }
  .bgp-stats { flex-wrap: wrap; gap: 16px; }
  #bgp-spark { display: none; }
  .bgp-feed td.path { display: none; }
  .bgp-feed th:nth-child(5) { display: none; }
}

/* ---------------- external looking-glass links ---------------- */
.ext-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.tagchip.ext { text-decoration: none; color: var(--facility); border-color: rgba(63,208,255,.35); }
.tagchip.ext:hover { background: rgba(63,208,255,.1); }

/* ---------------- measure tool ---------------- */
.dot-measure { background: #fff; box-shadow: 0 0 6px #fff; }
.legend-item#measure-toggle.is-on { color: var(--ink); background: #fff; border-color: #fff; }
.legend-item#measure-toggle.is-on .dot { background: var(--ink) !important; }
.measure-result {
  position: absolute; left: 14px; bottom: 60px; z-index: 6;
  max-width: 480px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: var(--mono); font-size: 11px; color: var(--text);
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.mr-route { font-weight: 600; margin-bottom: 3px; }
.mr-nums { color: var(--facility); }
.mr-note { color: var(--faint); margin-top: 3px; font-size: 10px; }

/* ---------------- cable timeline ---------------- */
.timeline {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 5;
  display: flex; align-items: center; gap: 10px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 7px 16px;
}
.tl-btn {
  background: transparent; border: 0; color: var(--cable);
  font-size: 12px; cursor: pointer; padding: 0 2px; line-height: 1;
}
.tl-btn:hover { color: #ffe3b3; }
#tl-range { width: 220px; accent-color: var(--cable); cursor: pointer; }
.tl-label {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  min-width: 130px; text-align: left;
}

/* ---------------- statistics view ---------------- */
.stats-view {
  height: calc(100vh - var(--topbar-h) - var(--statusbar-h));
  overflow-y: auto;
  padding: 22px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 18px;
  max-width: 1500px;
  margin: 0 auto;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}
.stat-card h3 {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .11em;
  color: var(--muted);
  margin: 0 0 12px;
}
.bars { display: flex; flex-direction: column; gap: 5px; }
.bar-row {
  display: grid;
  grid-template-columns: 170px 1fr 52px;
  gap: 10px; align-items: center;
  background: transparent; border: 0; padding: 2px 0;
  color: var(--text); text-align: left;
  font-size: 11.5px;
}
.bar-row.clickable { cursor: pointer; border-radius: 6px; }
.bar-row.clickable:hover { background: var(--panel-2); }
.bar-label {
  font-family: var(--mono); font-size: 10.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track { height: 9px; background: var(--ink-2); border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 4px; opacity: .85; }
.bar-value {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  text-align: right; font-variant-numeric: tabular-nums;
}
@media (max-width: 980px) {
  .timeline { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 120px 1fr 48px; }
}
