:root {
  --bg: #0b0d10;
  --panel: #12161b;
  --line: #232a33;
  --line2: #2f3843;
  --fg: #d6dbe1;
  --dim: #8a94a1;
  --faint: #5d6672;
  --accent: #5fb4d8;
  --wh: #9a8fc0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}
html { color-scheme: dark; }
/* overlay: a dark colour scheme would make the browser paint an opaque canvas behind the page */
html.part { color-scheme: normal; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font-variant-numeric: tabular-nums; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 600; margin: 0; display: inline-block; }
h2 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); margin: 0 0 6px; }
p { margin: 0 0 8px; }
time { white-space: nowrap; }
[hidden] { display: none !important; }

#top { display: flex; align-items: center; gap: 18px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: .04em; color: var(--fg); }
#top nav { display: flex; gap: 14px; }
#top nav a { color: var(--dim); }
#top nav a:hover { color: var(--fg); text-decoration: none; }
#topsearch { margin-left: auto; width: 240px; max-width: 100%; }
#view { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 16px; }
#foot { border-top: 1px solid var(--line); padding: 10px 16px; color: var(--faint); font-size: 12px; }
#foot p { margin: 0 0 2px; max-width: 1240px; margin-inline: auto; }
html[data-stale] .brand::after { content: " \00b7  not updating"; color: #c9a24a; font-weight: 400; font-size: 12px; }

section { margin: 0 0 20px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 0 24px; }
.head { margin-bottom: 16px; }
.head .sub { color: var(--dim); margin-top: 2px; }
.head .sub > * + *::before { content: "\00b7"; margin: 0 7px; color: var(--faint); }
.empty { color: var(--dim); margin: 0; }
.dim { color: var(--dim); }
.small { font-size: .85em; color: var(--faint); }
.num { text-align: right; }

.sec { font-weight: 600; }
.badge { display: inline-block; min-width: 2.4em; text-align: center; padding: 0 5px; border: 1px solid currentColor; border-radius: 3px; font-size: .8em; font-weight: 600; vertical-align: 2px; margin-left: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.chip { border: 1px solid var(--line2); border-radius: 3px; padding: 1px 7px; white-space: nowrap; background: var(--panel); }
.chip .sec { margin-left: 5px; font-size: .85em; }

.tw { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 4px 10px 4px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
th { color: var(--dim); font-weight: 500; font-size: .85em; white-space: nowrap; }
th.num, td.num { text-align: right; }
th:last-child, td:last-child { padding-right: 0; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--fg); }
th[aria-sort="ascending"]::after { content: " \25B4"; color: var(--accent); }
th[aria-sort="descending"]::after { content: " \25BE"; color: var(--accent); }
td:first-child { white-space: nowrap; }
td.wrap, td.wrap:first-child { overflow-wrap: anywhere; white-space: normal; min-width: 9em; }

.stats { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.stat b { display: block; font-size: 20px; font-weight: 600; }
.stat span { color: var(--dim); font-size: 12px; }
.cols { columns: 190px auto; column-gap: 20px; }
.cols > div { break-inside: avoid; padding: 1px 0; }

.search { position: relative; }
.search input, .tform input { width: 100%; background: var(--bg); color: var(--fg); border: 1px solid var(--line2); border-radius: 3px; padding: 6px 9px; font: inherit; }
.search input:focus, .tform input:focus { outline: none; border-color: var(--accent); }
.search.big { max-width: 520px; margin-bottom: 20px; }
.search.big input { padding: 9px 12px; font-size: 16px; }
.search ul { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 2px 0; list-style: none; background: var(--panel); border: 1px solid var(--line2); border-radius: 3px; max-height: 320px; overflow-y: auto; }
.search li { padding: 4px 9px; cursor: pointer; display: flex; gap: 8px; justify-content: space-between; }
.search li[aria-selected="true"] { background: #1c232c; }
.search li span:last-child { color: var(--dim); white-space: nowrap; }
.tform { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 16px; }
.tform label { color: var(--dim); font-size: 12px; display: block; width: 200px; max-width: 100%; }
.tform button { background: var(--panel); color: var(--fg); border: 1px solid var(--line2); border-radius: 3px; padding: 6px 14px; font: inherit; cursor: pointer; }
.tform button:hover { border-color: var(--accent); }
.via { margin: 0 0 6px; }
.via b { font-weight: 600; }

.mapwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 3px; background: #090b0d; }
.mapwrap svg { display: block; width: 100%; min-width: 900px; height: auto; }
svg.map text { fill: var(--fg); paint-order: stroke; stroke: rgba(5, 7, 9, .85); stroke-linejoin: round; }
svg.map a { cursor: pointer; text-decoration: none; }
svg.map a:hover text { fill: #fff; }
svg.map .edge { stroke: #3a4552; }
svg.map .edge.out { stroke-dasharray: 3 3; }
svg.map .ghost rect { fill: none; stroke: var(--dim); }
svg.map .ghost text { fill: var(--dim); }
svg.map .ring { fill: none; stroke: var(--fg); opacity: .75; }
svg.map .focus { fill: none; stroke: var(--accent); }
svg.map .mark { fill: var(--fg); }
svg.map .cnt { font-weight: 700; }
.legend { color: var(--faint); font-size: 12px; margin-top: 5px; }

/* overlay parts: one panel, laid over the game by the desktop client */
html.part, html.part body { background: transparent; }
html.part { font-size: 11.5px; line-height: 1.3; }
html.part body { min-height: 0; display: block; overflow: auto; scrollbar-width: thin; scrollbar-color: #3a4552 transparent; }
html.part #top, html.part #foot { display: none; }
html.part #view { padding: 5px 7px; max-width: none; }
html.part h1 { font-size: 13px; display: inline; }
html.part h2 { font-size: 10px; margin: 0 0 2px; }
html.part section { margin: 0 0 5px; }
html.part .head { margin-bottom: 4px; }
html.part th, html.part td { padding: 1px 6px 1px 0; border-bottom-color: rgba(255, 255, 255, .07); }
html.part th { font-size: 10px; }
html.part td, html.part td.wrap, html.part td.wrap:first-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
html.part .chip { padding: 0 4px; background: none; border-color: rgba(255, 255, 255, .15); }
html.part .chips { gap: 2px 3px; }
html.part .badge { margin-left: 5px; vertical-align: 1px; }
html.part .via { margin-bottom: 3px; }
html.part .mapwrap { border: 0; background: none; overflow: hidden; }
html.part .mapwrap svg { min-width: 0; height: calc(100vh - 12px); }
html.part ::-webkit-scrollbar { width: 5px; height: 5px; }
html.part ::-webkit-scrollbar-thumb { background: #3a4552; }
html.part[data-stale] #view::after { content: "not updating"; position: fixed; right: 6px; bottom: 3px; color: #c9a24a; font-size: 10px; }

@media (max-width: 600px) {
  #view { padding: 12px 16px; }
  #topsearch { width: 100%; margin-left: 0; }
}

/* round 2: wormholes, chain map, last-hour strip, map controls */
.amber { color: #e0a63c; }
.kvs { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.kv > span { color: var(--dim); font-size: .9em; }
.kv b { font-weight: 600; }
h2 time { letter-spacing: 0; }
a.chips:hover { text-decoration: none; }
a.chips .chip { color: var(--fg); }
a.chips:hover .chip { border-color: var(--accent); }
.mapctl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-bottom: 6px; color: var(--dim); font-size: 13px; }
.mapctl select, .mapctl button { background: var(--panel); color: var(--fg); border: 1px solid var(--line2); border-radius: 3px; padding: 3px 8px; font: inherit; }
.mapctl button { cursor: pointer; min-width: 30px; }
.mapctl button:hover, .mapctl select:hover { border-color: var(--accent); }
.mapctl .zoom { margin-left: auto; display: flex; gap: 4px; }
.mapwrap { overflow: hidden; }
.mapwrap svg { min-width: 0; touch-action: none; cursor: grab; user-select: none; }
.mapwrap svg.drag { cursor: grabbing; }
svg.map .halo { fill-opacity: .2; stroke-opacity: .55; }
svg.map .hid { display: none; }
svg.map a:hover .hid { display: inline; }
.chainwrap { overflow-x: auto; padding-bottom: 2px; }
svg.chain { display: block; max-width: none; }
svg.chain text { fill: var(--fg); }
svg.chain .nm { font-weight: 600; }
svg.chain .ln, svg.chain .lk { fill: var(--dim); }
svg.chain .lk { font-size: .9em; }
svg.chain .amber { fill: #e0a63c; }
svg.chain .links path, svg.chain .links line { fill: none; stroke: #46525f; }
svg.chain .links .extra { stroke-dasharray: 3 3; }
svg.chain .box > rect:first-of-type { fill: var(--panel); stroke: var(--line2); }
svg.chain .box.root > rect:first-of-type { stroke: var(--accent); }
svg.chain a { cursor: pointer; text-decoration: none; }
svg.chain a:hover .box > rect:first-of-type { stroke: var(--fg); }
html.part svg.chain .box > rect:first-of-type { fill: rgba(18, 22, 27, .55); stroke: rgba(255, 255, 255, .16); }
html.part svg.chain .box.root > rect:first-of-type { stroke: var(--accent); }
html.part h2.gap { margin-top: 5px; }
html.part .chainwrap { overflow: visible; }

/* round 3: POCO-map style region map */
svg.map { font-variant-numeric: tabular-nums; }
svg.map .edges line { stroke: #37424f; }
svg.map .stubs line { stroke: #3a4552; }
svg.map .stubs text { fill: #6f7a87; stroke: none; }
svg.map .stubs a:hover text { fill: var(--fg); }
svg.map .rings circle { fill-opacity: .06; stroke-opacity: .6; }
svg.map text.name { fill: var(--fg); opacity: .8; }
svg.map text.name.on { opacity: 1; font-weight: 600; }
svg.map text.secn { font-weight: 600; }
svg.map .poco { fill: #0b0d10; }
svg.map .poco.none { fill: none; stroke: #0b0d10; }
svg.map .pill { fill: #0b0d10; stroke: var(--accent); }
svg.map text.pilln { fill: #f2f5f8; font-weight: 700; stroke: none; }
svg.map .focus { fill: none; stroke: var(--accent); }

/* round 4: flat schematic region map */
svg.map.sch text { stroke: none; }
svg.map.sch .gates line { stroke: #4a5461; stroke-width: 1; }
svg.map.sch .gates line.inter { stroke: #76828f; }
svg.map.sch .gates line.out { stroke: #4a5461; stroke-dasharray: 3 3; }
svg.map.sch .conlab text { letter-spacing: .06em; opacity: .8; }
svg.map.sch .box { fill: #10151b; stroke-width: 1.5; }
svg.map.sch a:hover .box { stroke-width: 2.6; fill: #18202a; }
svg.map.sch .bar { opacity: .4; }
svg.map.sch text.name { fill: var(--fg); opacity: 1; }
svg.map.sch .sysbox.on text.name { font-weight: 700; }
svg.map.sch text.val { fill: var(--dim); }
svg.map.sch text.val.zero { fill: var(--faint); }
svg.map.sch .poco { fill: var(--fg); }
svg.map.sch .poco.none { fill: none; stroke: var(--fg); stroke-width: 1; }
svg.map.sch .pill { stroke-width: 1; }
svg.map.sch .ghostbox rect { fill: #0d1115; stroke: #5d6672; stroke-width: 1; stroke-dasharray: 3 2; }
svg.map.sch .ghostbox .gn { fill: var(--dim); }
svg.map.sch .ghostbox .gr { fill: var(--faint); }
svg.map.sch a:hover .ghostbox rect { stroke: var(--fg); }

/* round 5: scanner signature ids */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: .93em; white-space: nowrap; }
svg.chain .sig { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; fill: var(--fg); }

/* round 6: scanned sites */
.note { color: var(--dim); max-width: 980px; margin: 4px 0 0; font-size: 13px; }
.tag { display: inline-block; border: 1px solid var(--line2); border-radius: 3px; padding: 0 6px; font-size: .85em; color: var(--dim); white-space: nowrap; }
.tag.hot { border-color: var(--accent); color: var(--fg); font-weight: 600; }
a:hover .tag { border-color: var(--fg); }
.ctl { margin-bottom: 10px; }
.ctl .fromsys { display: flex; align-items: center; gap: 6px; }
.ctl .fromsys .search { width: 170px; }
.ctl .fromsys .search input { padding: 3px 8px; }
.ctl .tick { color: var(--fg); cursor: pointer; white-space: nowrap; }
.ctl .tick input { accent-color: var(--accent); vertical-align: -2px; margin: 0; }

/* round 7: wormhole info-window state */
.warn { display: inline-block; color: #e0a63c; border: 1px solid currentColor; border-radius: 3px; padding: 0 4px; font-size: .78em; font-weight: 700; letter-spacing: .03em; white-space: nowrap; vertical-align: 1px; }
.warn.crit { color: #ef5b50; }
.state .small { color: var(--dim); }
svg.chain .links path.eol { stroke-dasharray: 5 4; stroke: #e0a63c; }
svg.chain .links path.crit { stroke: #ef5b50; stroke-width: 1.6; }
svg.chain tspan.warn { fill: #e0a63c; font-weight: 700; }
svg.chain tspan.warn.crit { fill: #ef5b50; }
html.part .warn { padding: 0 2px; }

/* round 8: about page, claims, EVE-Scout hubs */
.prose section { max-width: 780px; margin-bottom: 18px; }
.prose p { line-height: 1.55; margin: 0 0 8px; }
.prose p.after { margin-top: 8px; }
.prose td { vertical-align: top; }
.claim a { color: inherit; text-decoration: underline; text-decoration-color: var(--line2); }
svg.chain .box.hub > rect:first-of-type { fill: #1b1a2e; stroke: #4a4670; }
html.part svg.chain .box.hub > rect:first-of-type { fill: rgba(60, 54, 110, .5); }
.claim { overflow: hidden; text-overflow: ellipsis; }
