@font-face { font-family: "Inter"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  /* true-black-flat, cool ground: elevation by lightness only */
  --ground: #0c0d0f;
  --surface: #15171a;
  --raised: #22252a;
  --rule: #1c1e22;
  --control: #444a52;
  --text: #fff;
  --muted: #b4b4b4;
  --faint: #949494;
  --accent: #4cb3f0;
  --positive: #c6f24e;
  --pill-neutral-bg: #22252a; --pill-neutral-ink: #fff;
  --radius-card: 20px;
  --bezel: 6px;
  --gap: 14px;
  --pad: 22px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --font: "Inter", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--ground); }
body { margin: 0; font: 400 14px/1.5 var(--font); color: var(--text); background: var(--ground); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
h1, h2, p, dl, dd, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: #000; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.meta { font-size: 13px; color: var(--faint); }
.r { text-align: right; }

/* shell: ground is shared by sidebar, top bar and canvas */
.app { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 100dvh; }
.side { padding: 18px 14px; border-right: 1px solid var(--rule); position: sticky; top: 0; height: 100dvh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; font-weight: 600; font-size: 16px; }
.group { font-size: 13px; color: var(--faint); padding: 0 8px 6px; }
.nav { display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 8px; border-radius: 10px; color: #bbb; transition: color .3s var(--ease); }
a.nav:hover { color: #fff; }
.nav.on { color: #fff; }
.nav.off { color: #6b6f76; cursor: default; }

.main { min-width: 0; }
.top { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 29px; border-bottom: 1px solid var(--rule); }
.search { display: flex; align-items: center; gap: 8px; width: min(360px, 100%); height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface); color: var(--faint); transition: background .3s var(--ease); }
.search:focus-within { background: var(--raised); color: #fff; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: 0; color: #fff; }
.search input::placeholder { color: var(--faint); }
.scope { height: 100%; display: flex; align-items: center; padding-left: 20px; border-left: 1px solid var(--rule); font-weight: 500; white-space: nowrap; }

.canvas { padding: 24px 29px 56px; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }

.title { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding-bottom: 8px; }
h1 { font-size: 20px; font-weight: 600; line-height: 1.3; }
.finding { margin-top: 4px; color: var(--muted); max-width: 70ch; }
.finding b { color: #fff; font-weight: 500; }

.btn { display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 6px 0 16px; border: 0; border-radius: 999px; background: #fff; color: #000; font-weight: 500; cursor: pointer; white-space: nowrap; transition: transform .5s var(--ease); }
.btn-dot { width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.08); display: grid; place-items: center; transition: transform .5s var(--ease); }
.btn:hover:not(:disabled) .btn-dot { transform: translate(2px, -1px) scale(1.05); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { background: var(--raised); color: var(--muted); cursor: not-allowed; }
.btn:disabled .btn-dot { background: rgba(255,255,255,.08); }

.card { background: var(--surface); border-radius: var(--radius-card); padding: var(--pad); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.card-head.wrap { flex-wrap: wrap; align-items: center; }
h2 { font-size: 16px; font-weight: 600; }

.pill.ok { background: #222a10; color: #c6f24e; }
.pill.warn { background: #2b2414; color: #e5a93b; }
.pill.bad { background: #2c1a20; color: #e5566f; }
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); }

/* what is live now */
.live { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 24px; align-items: center; }
.live-name { font-size: 28px; font-weight: 600; line-height: 1.2; margin: 6px 0 2px; letter-spacing: -0.01em; }
.facts { display: grid; grid-template-columns: 1fr 1.6fr 1fr 1fr; }
.facts > div { padding: 2px 20px; border-left: 1px solid var(--rule); min-width: 0; }
.facts dt, .kv dt { font-size: 13px; color: var(--faint); }
.facts dd { margin-top: 2px; font-size: 16px; font-weight: 500; overflow-wrap: anywhere; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: var(--pad) 0; }
.kpis > div { padding: 0 var(--pad); border-left: 1px solid var(--rule); }
.kpis > div:first-child { border-left: 0; }
.kpi { font-size: 24px; font-weight: 500; line-height: 1.3; margin: 2px 0; }
.unit { font-size: 14px; color: var(--faint); font-weight: 400; margin-left: 3px; }

.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }

/* double bezel: a tray one step above the ground, a recessed screen inside, concentric radii */
.shell { background: var(--surface); border-radius: var(--radius-card); padding: var(--bezel); }
.core { background: var(--ground); border-radius: calc(var(--radius-card) - var(--bezel)); padding: calc(var(--pad) - var(--bezel)); height: 100%; display: flex; flex-direction: column; }
.map { position: relative; aspect-ratio: 360 / 143; overflow: hidden; border-radius: 12px; touch-action: pan-y pinch-zoom; }
.map.zoomed { touch-action: none; cursor: grab; }
.map.grabbing { cursor: grabbing; }
.map canvas, .map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pin { cursor: pointer; }
.pin .hit { fill: transparent; }
.pin .dot { fill: #e6e6e6; transition: fill .3s var(--ease), opacity .4s var(--ease); }
.pin:hover .dot { fill: #fff; }
.pin.live .dot { fill: var(--positive); }
.pin.sel .dot { fill: var(--accent); }
.pin.dim .dot { opacity: .18; }
.pin.dim { pointer-events: none; }
.pin .halo { fill: none; stroke: var(--accent); stroke-width: 1; opacity: 0; transform-box: fill-box; transform-origin: center; }
.pin.sel .halo { opacity: .6; animation: halo 2.4s var(--ease) infinite; }
.pin text { fill: #fff; font-size: 13px; font-weight: 500; pointer-events: none; paint-order: stroke; stroke: var(--ground); stroke-width: 3px; opacity: 0; transition: opacity .3s var(--ease); }
.pin.sel text, .pin.live text, .pin:hover text { opacity: 1; }
.labels .pin:not(.dim) text { opacity: .85; }
.you-mark { fill: none; stroke: #fff; stroke-width: 1.5; }
.you-core { fill: #fff; }
.tip { position: absolute; transform: translate(-50%, calc(-100% - 12px)); background: var(--raised); border-radius: 10px; padding: 6px 10px; font-size: 12px; white-space: nowrap; pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.k { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.k.you { background: #fff; box-shadow: 0 0 0 2px var(--ground), 0 0 0 3px #fff; }
.k.live { background: var(--positive); }
.k.sel { background: var(--accent); }
.k.edge { background: #e6e6e6; }
.k.dimk { background: #e6e6e6; opacity: .18; }

.sel-name { font-size: 20px; font-weight: 600; margin-top: 4px; }
.kv { margin-top: 14px; background: var(--ground); border-radius: 12px; padding: 4px 14px; }
.kv > div { display: flex; justify-content: space-between; align-items: center; height: 32px; }
.kv dd { font-weight: 500; }
.note { margin-top: 12px; font-size: 13px; color: var(--faint); }

.bars li { display: grid; grid-template-columns: 1fr auto; row-gap: 6px; padding: 8px 0; cursor: pointer; }
.bars li:hover .bn { color: #fff; }
.bn { color: var(--muted); transition: color .3s var(--ease); }
.bd { font-weight: 500; }
.bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--raised); overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 2px; transform-origin: left; transform: scaleX(var(--w, 0)); transition: transform 1s var(--ease); }
.bars .code { color: var(--faint); font-weight: 400; margin-left: 6px; }

/* table: rules and alignment */
.tablecard { padding-bottom: 8px; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; justify-content: flex-end; }
.tab { height: 28px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: #bbb; cursor: pointer; transition: color .3s var(--ease), background .3s var(--ease); }
.tab:hover { color: #fff; }
.tab[aria-pressed="true"] { color: #fff; background: var(--raised); }
.tscroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th { text-align: left; font-size: 13px; font-weight: 400; color: var(--faint); padding: 8px 12px; border-bottom: 1px solid var(--rule); }
th.r { text-align: right; }
td { height: 44px; padding: 0 12px; border-bottom: 1px solid var(--rule); }
td.r { text-align: right; }
tbody tr { cursor: pointer; transition: background .3s var(--ease); }
tbody tr:hover, tbody tr.sel { background: var(--ground); }
tbody tr.sel td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
td.code { color: var(--muted); }
td.dim { color: var(--faint); }
.empty td { color: var(--faint); height: 88px; text-align: center; cursor: default; }
.foot { display: flex; justify-content: center; padding: 10px 0 8px; }
.link { border: 0; background: none; color: var(--muted); cursor: pointer; height: 32px; padding: 0 14px; border-radius: 999px; transition: color .3s var(--ease), background .3s var(--ease); }
.link:hover { color: #fff; background: var(--raised); }
.link[hidden] { display: none; }

.err { color: #e5566f; }

/* entrance: staggered, once; content is visible without script */
.js .reveal { opacity: 0; transform: translateY(16px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity .8s var(--ease) var(--d, 0ms), transform .8s var(--ease) var(--d, 0ms); }
@keyframes halo { from { transform: scale(1); opacity: .6; } to { transform: scale(2.6); opacity: 0; } }

@media (max-width: 1100px) {
  .live { grid-template-columns: minmax(0, 1fr); }
  .facts > div:first-child { border-left: 0; padding-left: 0; }
  .pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; display: flex; align-items: center; gap: 16px; padding: 8px 16px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .side nav { display: flex; align-items: center; gap: 4px; }
  .brand { padding: 0; margin-right: auto; }
  .group { display: none; }
  .top { padding: 0 16px; height: 56px; }
  .scope { display: none; }
  .canvas { padding: 16px 16px 40px; }
  .title { flex-direction: column; align-items: stretch; }
  .btn { justify-content: space-between; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; max-width: 100%; padding-bottom: 4px; }
  .tab { flex: none; }
  .map { aspect-ratio: 360 / 215; }
  .map .ctl { right: 6px; top: auto; bottom: 6px; }
  .map .ctl .txt { display: none; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
  .facts > div:nth-child(odd) { border-left: 0; padding-left: 0; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; }
  .kpis > div:nth-child(odd) { border-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
  .js .reveal.in { transition: none; }
  .pin.sel .halo { animation: none; }
  .bar i { transition: none; }
  * { transition-duration: 0.01ms !important; }
}
.source { padding: 6px 12px 14px; text-align: center; }

/* map controls: a small floating tray (it floats, so it may carry a shadow) */
.ctl { position: absolute; right: 12px; top: 12px; display: flex; gap: 4px; padding: 4px; background: var(--raised); border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.ctl button { min-width: 32px; height: 32px; padding: 0 10px; border: 0; border-radius: 999px; background: none; color: #fff; font-size: 16px; line-height: 1; cursor: pointer; transition: background .3s var(--ease), transform .5s var(--ease); }
.ctl button.txt { font-size: 13px; }
.ctl button:hover { background: rgba(255,255,255,.1); }
.ctl button:active { transform: scale(.94); }

/* rows and list items that select a node are real buttons */
.rowbtn { border: 0; background: none; padding: 0; margin: 0; color: inherit; text-align: left; cursor: pointer; border-radius: 4px; }
.rowbtn:focus-visible { outline-offset: 4px; }

/* loading placeholders: a flat pulse, no gradient shimmer */
[data-load] { color: transparent !important; background: var(--raised); border-radius: 6px; width: 7ch; animation: pulse 1.4s var(--ease) infinite alternate; }
@keyframes pulse { from { opacity: .45; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { [data-load] { animation: none; } }
