/* ScoutMap — a map-table palette: deep teal slate, amber signal, cyan for shields. */
/* Barlow & Barlow Condensed by Jeremy Tribby, SIL Open Font License 1.1 (fonts/OFL.txt). */
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url("/fonts/barlow-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("/fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("/fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("/fonts/barlow-latin-600-normal.woff2") format("woff2"); }

:root {
  --bg: #12202A;
  --bg-2: #172934;
  --panel: #1B303C;
  --panel-2: #213946;
  --rule: #2B4553;
  --rule-2: #36566A;
  --text: #E6EEF0;
  --muted: #8FA8B3;
  --faint: #5F7A87;
  --amber: #FFB347;
  --amber-ink: #2A1A00;
  --cyan: #6FD3E8;
  --coral: #FF6F5E;
  --green: #84DA97;
  --focus: #FFD08A;
  --r-s: 6px;
  --r-m: 10px;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rail: 76px;
  --top: 60px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--body);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
svg { stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  grid-template-rows: var(--top) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}
.rail {
  grid-row: 1 / 3;
  display: flex; flex-direction: column; align-items: stretch; gap: 2px;
  background: var(--bg-2);
  border-right: 1px solid var(--rule);
  padding: 10px 8px;
}
.rail .brand { color: var(--amber); display: grid; place-items: center; height: 46px; margin-bottom: 10px; }
.rail a:not(.brand) {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 7px; border-radius: var(--r-m);
  text-decoration: none; color: var(--muted);
  font: 600 12.5px/1 var(--display); letter-spacing: .02em;
}
.rail a svg { width: 22px; height: 22px; }
.rail a:hover { color: var(--text); background: var(--panel); }
.rail a.on { color: var(--amber); background: var(--panel); }
.rail a.on::before { content: ""; position: absolute; left: -8px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--amber); }
.rail-dot { position: absolute; top: 7px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 0 var(--amber); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,179,71,.6); } 100% { box-shadow: 0 0 0 9px rgba(255,179,71,0); } }

.m-only { display: none !important; }
.top {
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.scope { display: flex; align-items: center; gap: 8px; }
.scope label { color: var(--muted); font-size: 13px; }
select, .input {
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-s);
  padding: 7px 10px; min-height: 36px;
}
select { padding-right: 28px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%238FA8B3' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 12px; }
.input::placeholder { color: var(--faint); }
.input:focus, select:focus { border-color: var(--rule-2); outline: none; box-shadow: 0 0 0 2px rgba(255,208,138,.35); }
.search-trigger {
  flex: 0 1 420px; display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 999px;
  padding: 7px 8px 7px 14px; color: var(--faint); cursor: pointer; text-align: left;
}
.search-trigger svg { width: 17px; height: 17px; }
.search-trigger span { flex: 1; }
.search-trigger:hover { border-color: var(--rule-2); color: var(--muted); }
kbd { font: 600 12px var(--body); border: 1px solid var(--rule-2); border-radius: 5px; padding: 1px 7px; color: var(--muted); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; position: relative; }
.btn.icon { padding: 7px; width: 38px; }
.btn.icon svg { width: 19px; height: 19px; }
.settings { position: absolute; right: 0; top: 46px; width: 300px; z-index: 50; box-shadow: 0 20px 50px rgba(0,0,0,.4); }
.settings .input { width: 100%; }
.demo-badge { font: 600 13px var(--display); color: var(--cyan); border: 1px dashed rgba(111,211,232,.5); border-radius: 999px; padding: 3px 11px; }
.job-pill {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--rule-2); border-radius: 999px;
  padding: 5px 14px 5px 6px; cursor: pointer; font-size: 13.5px;
}
.job-pill .ring { width: 26px; height: 26px; }
.job-pill b { font: 600 15px var(--display); }

main { overflow: auto; position: relative; min-width: 0; }
main:focus { outline: none; }

/* ---------- common ---------- */
.h1 { font: 600 30px/1.05 var(--display); letter-spacing: .005em; margin: 0; }
.sub { color: var(--muted); margin: 4px 0 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--rule-2); background: var(--panel-2); border-radius: var(--r-s);
  padding: 7px 14px; min-height: 36px; cursor: pointer; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--panel); }
.btn.danger { color: var(--coral); border-color: rgba(255,111,94,.45); background: transparent; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--rule); border-radius: var(--r-s); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--muted); border-radius: 4px; padding: 5px 11px; cursor: pointer; font-size: 13.5px; }
.seg button.on { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--rule-2); }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 14px/1 var(--display); letter-spacing: .03em;
}
.tag i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.tag.none { color: var(--faint); font: 400 13.5px var(--body); }
.lvl {
  display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 6px;
  font: 700 16px/1 var(--display); border-radius: 5px;
  background: color-mix(in srgb, var(--lc) 18%, transparent); color: var(--lc);
}
.shield { display: inline-flex; align-items: center; gap: 5px; color: var(--cyan); font-size: 13.5px; }
.shield svg { width: 15px; height: 15px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.coord { font: 600 14.5px var(--display); letter-spacing: .02em; color: var(--muted); cursor: copy; }
.coord:hover { color: var(--amber); }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty h3 { font: 600 22px var(--display); color: var(--text); margin: 0 0 6px; }
.empty p { margin: 0 auto 16px; max-width: 46ch; }
.flag { font-size: 13px; color: var(--muted); font-weight: 500; }
.star { border: 0; background: none; padding: 4px; cursor: pointer; color: var(--faint); line-height: 0; }
.star svg { width: 16px; height: 16px; }
.star.on { color: var(--amber); }
.star.on svg { fill: var(--amber); }

/* ---------- players ---------- */
.players { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 100%; }
.filters {
  border-right: 1px solid var(--rule); padding: 18px 18px 40px; background: var(--bg);
  display: flex; flex-direction: column; gap: 20px;
  position: sticky; top: 0; align-self: start; max-height: calc(100vh - var(--top)); overflow: auto;
}
.f-group { display: flex; flex-direction: column; gap: 8px; }
.f-head { display: flex; align-items: baseline; justify-content: space-between; }
.f-head h4 { margin: 0; font: 600 16px var(--display); letter-spacing: .01em; }
.f-head button { border: 0; background: none; color: var(--faint); font-size: 12.5px; cursor: pointer; padding: 0; }
.f-head button:hover { color: var(--amber); }
.f-val { color: var(--amber); font: 600 15px var(--display); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--rule); background: var(--bg-2); color: var(--muted);
  border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer;
}
.chip i { width: 8px; height: 8px; border-radius: 2px; }
.chip small { color: var(--faint); font-size: 11.5px; }
.chip:hover { color: var(--text); border-color: var(--rule-2); }
.chip.on { background: color-mix(in srgb, var(--amber) 14%, var(--bg-2)); border-color: rgba(255,179,71,.6); color: var(--text); }
.chip.on small { color: var(--muted); }
.al-list { max-height: 210px; overflow: auto; display: flex; flex-direction: column; gap: 1px; margin: 0 -6px; padding: 0 2px; }
.al-row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 5px; cursor: pointer; font-size: 14px; border: 0; background: none; text-align: left; }
.al-row:hover { background: var(--panel); }
.al-row .box { width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid var(--rule-2); display: grid; place-items: center; flex: none; }
.al-row.on .box { background: var(--amber); border-color: var(--amber); }
.al-row.on .box::after { content: ""; width: 7px; height: 4px; border: 2px solid var(--amber-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.al-row span.n { margin-left: auto; color: var(--faint); font-size: 12.5px; }

/* level histogram + range */
.histo { position: relative; height: 92px; }
.histo .bars { position: absolute; inset: 0 0 26px; display: flex; align-items: flex-end; gap: 1px; }
.histo .bars i { flex: 1; background: var(--rule-2); border-radius: 2px 2px 0 0; min-height: 1px; transition: background .15s; }
.histo .bars i.in { background: rgba(255,179,71,.72); }
.histo input[type=range] { position: absolute; left: -2px; right: -2px; width: calc(100% + 4px); bottom: 8px; margin: 0; pointer-events: none; appearance: none; background: none; height: 18px; }
.histo input[type=range]::-webkit-slider-thumb { pointer-events: auto; appearance: none; width: 16px; height: 18px; border-radius: 4px; background: var(--text); border: 2px solid var(--bg); cursor: ew-resize; }
.histo input[type=range]::-moz-range-thumb { pointer-events: auto; width: 13px; height: 15px; border-radius: 4px; background: var(--text); border: 2px solid var(--bg); cursor: ew-resize; }
.histo .track { position: absolute; left: 0; right: 0; bottom: 16px; height: 2px; background: var(--rule); }
.histo .track b { position: absolute; top: 0; bottom: 0; background: var(--amber); }
.near { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.near .input { min-width: 0; width: 100%; text-align: center; }

.results { min-width: 0; display: flex; flex-direction: column; }
.summary {
  display: flex; align-items: flex-end; gap: 34px; flex-wrap: wrap;
  padding: 20px 26px 16px; border-bottom: 1px solid var(--rule);
}
.summary .big { font: 700 46px/0.9 var(--display); letter-spacing: -.01em; }
.summary .big small { font: 500 17px var(--display); color: var(--muted); margin-left: 6px; letter-spacing: .01em; }
.stat { display: flex; flex-direction: column; }
.stat b { font: 600 22px/1 var(--display); }
.stat span { color: var(--muted); font-size: 13px; margin-top: 3px; }
.summary .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 26px 0; }
.active-filters .chip { color: var(--text); }
.active-filters .chip svg { width: 12px; height: 12px; }

table.grid { width: 100%; border-collapse: collapse; }
.grid th {
  position: sticky; top: 0; z-index: 2; background: var(--bg);
  text-align: left; font: 600 14px var(--display); letter-spacing: .02em; color: var(--muted);
  padding: 12px 12px 9px; border-bottom: 1px solid var(--rule); white-space: nowrap; user-select: none;
}
.grid th[data-sort] { cursor: pointer; }
.grid th[data-sort]:hover { color: var(--text); }
.grid th.sorted { color: var(--amber); }
.grid th.sorted::after { content: " ↓"; }
.grid th.sorted.asc::after { content: " ↑"; }
.grid td { padding: 8px 12px; border-bottom: 1px solid rgba(43,69,83,.55); white-space: nowrap; }
.grid tbody tr { cursor: pointer; }
.grid tbody tr:hover td { background: var(--bg-2); }
.grid tbody tr.sel td { background: var(--panel); }
.grid td.name { font-weight: 600; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.grid td.name .transfer { font-weight: 400; color: var(--faint); font-size: 12.5px; margin-left: 6px; }
.grid .num { text-align: right; }
.grid th:first-child, .grid td:first-child { padding-left: 26px; }
.grid th:last-child, .grid td:last-child { padding-right: 26px; }
.more { padding: 18px; text-align: center; color: var(--faint); }

/* ---------- drawer ---------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); z-index: 40;
  background: var(--bg-2); border-left: 1px solid var(--rule-2);
  transform: translateX(102%); transition: transform .26s cubic-bezier(.2,.8,.2,1);
  overflow: auto; box-shadow: -24px 0 60px rgba(4,10,14,.45);
}
.drawer.open { transform: none; }
.scrim { position: fixed; inset: 0; z-index: 39; background: rgba(5,12,16,.4); opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer-close { position: absolute; top: 14px; right: 14px; z-index: 2; border: 0; background: var(--panel); border-radius: 50%; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.drawer-close svg { width: 16px; height: 16px; }
.drawer-close:hover { color: var(--text); }
.d-hero { padding: 26px 24px 18px; border-bottom: 1px solid var(--rule); position: relative; overflow: hidden; }
.d-hero .lvlbig { position: absolute; right: 64px; top: -10px; font: 700 118px/1 var(--display); color: var(--lc); opacity: .13; letter-spacing: -.04em; pointer-events: none; }
.d-hero h2 { margin: 6px 0 4px; font: 700 36px/1 var(--display); letter-spacing: .005em; padding-right: 120px; word-break: break-word; }
.d-hero .line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); }
.d-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; position: relative; }
.d-sec { padding: 18px 24px; border-bottom: 1px solid var(--rule); }
.d-sec h3 { margin: 0 0 10px; font: 600 17px var(--display); letter-spacing: .01em; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 7px 12px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.near-list { display: flex; flex-direction: column; }
.near-list button { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; text-align: left; border: 0; background: none; padding: 7px 8px; margin: 0 -8px; border-radius: 6px; cursor: pointer; }
.near-list button:hover { background: var(--panel); }
.near-list .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.near-list .who em { font-style: normal; color: var(--faint); font-size: 13px; margin-left: 6px; }
details.raw summary { cursor: pointer; color: var(--muted); font: 600 15px var(--display); }
details.raw pre { margin: 10px 0 0; max-height: 360px; overflow: auto; background: var(--bg); border: 1px solid var(--rule); border-radius: var(--r-s); padding: 10px 12px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }

/* ---------- map ---------- */
.mapview { position: absolute; inset: 0; overflow: hidden; background: #0E1A22; }
.mapview canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.mapview canvas.drag { cursor: grabbing; }
.mapview canvas.picking { cursor: crosshair; }
.map-ui { position: absolute; top: 14px; left: 14px; display: flex; flex-direction: column; gap: 10px; width: 260px; max-height: calc(100% - 28px); pointer-events: none; }
.map-ui > * { pointer-events: auto; }
.card {
  background: rgba(23,41,52,.92); backdrop-filter: blur(8px);
  border: 1px solid var(--rule); border-radius: var(--r-m); padding: 12px 14px;
}
.card h4 { margin: 0 0 8px; font: 600 16px var(--display); display: flex; align-items: center; justify-content: space-between; }
.legend { overflow: auto; min-height: 0; flex: 1 1 auto; }
.legend .al-row { font-size: 13.5px; padding: 4px 6px; width: 100%; }
.legend .al-row i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .al-row.dim { opacity: .4; }
.layer { display: flex; align-items: center; justify-content: space-between; font-size: 14px; padding: 3px 0; }
.switch { position: relative; display: inline-block; vertical-align: middle; width: 34px; height: 20px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--rule); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + span { background: rgba(255,179,71,.35); }
.switch input:checked + span::after { transform: translateX(14px); background: var(--amber); }
.switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.map-tools { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; }
.map-zoom { position: absolute; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 4px; }
.map-zoom button { width: 38px; height: 38px; border-radius: var(--r-s); border: 1px solid var(--rule); background: rgba(23,41,52,.92); cursor: pointer; font: 600 20px var(--display); }
.map-hud { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); font: 600 15px var(--display); color: var(--muted); background: rgba(14,26,34,.8); border-radius: 999px; padding: 5px 14px; pointer-events: none; letter-spacing: .02em; }
.pick-panel { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; }
.pick-panel .input { width: 64px; text-align: center; }
.age-key { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.age-key b { flex: 1; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(132,218,151,.55), rgba(255,179,71,.45), rgba(255,111,94,.5)); }

.tip {
  position: fixed; z-index: 60; pointer-events: none; opacity: 0;
  background: #0A141A; border: 1px solid var(--rule-2); border-radius: var(--r-s);
  padding: 8px 11px; font-size: 13.5px; max-width: 260px; transition: opacity .08s;
}
.tip.on { opacity: 1; }
.tip b { font: 600 16px var(--display); }

/* ---------- alliances / servers ---------- */
.page { padding: 24px 26px 60px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.rank { font: 700 20px var(--display); color: var(--faint); width: 34px; display: inline-block; }
tr:nth-child(-n+3) .rank { color: var(--amber); }
.spark { display: inline-flex; align-items: flex-end; gap: 1px; height: 22px; vertical-align: middle; }
.spark i { width: 3px; background: var(--rule-2); border-radius: 1px 1px 0 0; }
.spark i.hi { background: var(--amber); }
.bar { display: inline-block; height: 6px; border-radius: 3px; background: var(--amber); vertical-align: middle; margin-right: 8px; opacity: .85; }

.servers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.srv { background: var(--bg-2); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 14px; }
.srv.home { border-color: rgba(255,179,71,.55); }
.srv-top { display: flex; align-items: flex-start; justify-content: space-between; }
.srv-num { font: 700 54px/0.85 var(--display); letter-spacing: -.02em; }
.srv-num small { display: block; font: 500 14px var(--body); color: var(--muted); letter-spacing: 0; margin-top: 8px; }
.fresh { font-size: 13px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.fresh i { width: 8px; height: 8px; border-radius: 50%; }
.srv-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.srv-hist { display: flex; align-items: flex-end; gap: 1px; height: 46px; }
.srv-hist i { flex: 1; background: var(--rule-2); border-radius: 1px 1px 0 0; }
.srv-hist i.hi { background: var(--amber); }
.srv-top5 { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; }
.srv-actions { display: flex; gap: 8px; margin-top: auto; }

/* ---------- scans ---------- */
.scans { display: grid; grid-template-columns: minmax(320px, 400px) 1fr; gap: 22px; align-items: start; }
.launch { background: var(--bg-2); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 20px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; }
.launch h2 { margin: 0; font: 600 24px var(--display); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .lbl { font-size: 13.5px; color: var(--muted); }
.srv-input { font: 700 30px var(--display) !important; letter-spacing: .02em; padding: 4px 12px !important; width: 100%; }
.centres { display: flex; flex-direction: column; gap: 6px; }
.centre-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; }
.centre-row .input { width: 100%; min-width: 0; }
.radius-row { display: flex; align-items: center; gap: 12px; }
.radius-row input[type=range] { flex: 1; accent-color: var(--amber); }
.radius-row b { font: 600 18px var(--display); min-width: 74px; text-align: right; }
.estimate { font-size: 14px; color: var(--muted); background: var(--bg); border-radius: var(--r-s); padding: 10px 12px; border: 1px solid var(--rule); }
.estimate b { color: var(--text); font-weight: 600; }
.warn { font-size: 13.5px; color: #FFD7A1; background: rgba(255,179,71,.08); border: 1px solid rgba(255,179,71,.3); border-radius: var(--r-s); padding: 10px 12px; }
.warn.err { color: #FFC2BA; background: rgba(255,111,94,.08); border-color: rgba(255,111,94,.35); }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { accent-color: var(--amber); margin-top: 3px; }

.live { background: var(--bg-2); border: 1px solid var(--rule); border-radius: var(--r-m); overflow: hidden; }
.live-head { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.live-head h2 { margin: 0; font: 600 24px var(--display); }
.live-head .status { font: 600 14px var(--display); letter-spacing: .03em; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.status.running, .status.starting { color: var(--amber); background: rgba(255,179,71,.12); }
.status.done { color: var(--green); background: rgba(132,218,151,.12); }
.status.failed { color: var(--coral); background: rgba(255,111,94,.12); }
.status.queued { color: var(--cyan); background: rgba(111,211,232,.1); }
.live-body { display: grid; grid-template-columns: auto 1fr; gap: 20px; padding: 20px; }
.blockgrid { width: 300px; height: 300px; border-radius: 6px; background: #0B161C; image-rendering: pixelated; display: block; }
.live-stats { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pct { font: 700 64px/0.85 var(--display); letter-spacing: -.02em; }
.pct small { font-size: 26px; color: var(--muted); }
.progress { height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.progress b { display: block; height: 100%; background: var(--amber); width: 0; transition: width .4s; }
.console { background: #0A1419; border-top: 1px solid var(--rule); height: 220px; overflow: auto; padding: 10px 16px; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: #9FB6C0; }
.console .WARN { color: #FFD08A; }
.console .ERROR { color: var(--coral); }
.console time { color: var(--faint); margin-right: 10px; }
.history { margin-top: 22px; }
.history h3 { font: 600 20px var(--display); margin: 0 0 6px; }

/* ---------- palette / toast ---------- */
.palette { position: fixed; inset: 0; z-index: 70; background: rgba(5,12,16,.55); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.palette-box { width: min(620px, calc(100vw - 32px)); background: var(--bg-2); border: 1px solid var(--rule-2); border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--rule); background: transparent; padding: 18px 20px; font: 500 20px var(--body); outline: none; }
.palette-results { max-height: 50vh; overflow: auto; padding: 6px; }
.palette-results button { width: 100%; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.palette-results button.on, .palette-results button:hover { background: var(--panel); }
.palette-results .grp { color: var(--faint); font-size: 12.5px; padding: 8px 12px 4px; }
.palette-results .hint { padding: 14px; color: var(--faint); font-size: 14px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 30px); opacity: 0; z-index: 80; background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 999px; font-weight: 500; transition: .2s; pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
/* ---------- actions ---------- */
.actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 430px); gap: 22px; align-items: start; }
.act-run { position: sticky; top: 0; background: var(--bg-2); border: 1px solid var(--rule); border-radius: var(--r-m); overflow: hidden; }
.act-run .console { height: 300px; }
.trun-body { padding: 14px 20px; display: flex; flex-direction: column; gap: 12px; }
.trun-body .kv { grid-template-columns: 110px 1fr; }
.trun-body:has(.kv:empty):has(#tmsg:empty) { display: none; }
.recent { border-top: 1px solid var(--rule); padding: 10px 10px 12px; }
.recent h4 { margin: 2px 10px 6px; font: 600 15px var(--display); color: var(--muted); }
.recent button { width: 100%; display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.recent button:hover, .recent button.on { background: var(--panel); }
.recent b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .status { font: 600 12.5px var(--display); letter-spacing: .03em; padding: 1px 8px; border-radius: 999px; justify-self: start; }
.status.cancelled { color: var(--muted); background: var(--panel-2); }
.collect { display: flex; gap: 24px; align-items: center; padding: 22px 24px; border-radius: var(--r-m); border: 1px solid rgba(255,179,71,.4);
  background: linear-gradient(100deg, rgba(255,179,71,.10), rgba(255,179,71,.02) 60%), var(--bg-2); }
.collect-text { flex: 1; min-width: 0; }
.collect h2 { margin: 0 0 4px; font: 700 34px/1 var(--display); }
.collect p { margin: 0 0 12px; color: var(--muted); max-width: 70ch; }
.routine { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13.5px; }
.rchip { font: 600 13.5px var(--display); letter-spacing: .02em; padding: 2px 9px; border-radius: 4px; background: var(--panel-2); color: var(--text); }
.btn.big { padding: 12px 22px; font-size: 16.5px; flex: none; }
.btn.big svg { width: 19px; height: 19px; }
.cfg-note { font-size: 13px; margin: 8px 2px 0; }
.cfg-note code { font-size: 12.5px; color: var(--muted); }
.act-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 22px 0 6px; }
.act-tools .input { flex: 1 1 220px; max-width: 360px; }
.fgroup { margin-top: 20px; }
.fgroup h3 { margin: 0 0 4px; font: 600 20px var(--display); padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
.frow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 18px; align-items: center; padding: 12px 4px; border-bottom: 1px solid rgba(43,69,83,.55); }
.frow:hover { background: linear-gradient(90deg, var(--bg-2), transparent); }
.fname { font: 600 17px var(--display); letter-spacing: .01em; }
.ftext { color: var(--muted); font-size: 14px; max-width: 78ch; }
.ftags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ftag { font-size: 12px; padding: 1px 7px; border-radius: 4px; border: 1px solid currentColor; line-height: 1.5; cursor: help; }
.ftag.coral { color: #FF9C90; }
.ftag.cyan { color: var(--cyan); }
.ftag.green { color: var(--green); }
.ftag.amber { color: #FFD08A; }
.ftag.faint { color: var(--faint); }
.fsw { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.fsw .lbl { font-size: 12.5px; color: var(--faint); }
.fsw:has(input:checked) .lbl { color: var(--amber); }
.fsw:has(input:disabled) { cursor: not-allowed; opacity: .5; }
.fbtns { display: flex; gap: 6px; justify-content: flex-end; min-width: 190px; }
.fbtns .btn { min-width: 76px; justify-content: center; }
.btn.armed { border-color: var(--coral); color: #FFC2BA; background: rgba(255,111,94,.1); }
.job-pill .ring.spin { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- stats ---------- */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.res-tile { background: var(--bg-2); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 16px 18px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.res-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; }
.res-name { font: 600 17px var(--display); letter-spacing: .01em; color: var(--muted); }
.res-total { font: 700 44px/1 var(--display); letter-spacing: -.01em; margin-top: 2px; }
.res-meta { font-size: 13px; color: var(--faint); }
.res-bars { display: flex; align-items: flex-end; gap: 2px; height: 54px; margin-top: 12px; border-bottom: 1px solid var(--rule); }
.res-bars i { flex: 1; background: var(--amber); opacity: .8; border-radius: 3px 3px 0 0; min-width: 2px; }
.res-bars i:hover { opacity: 1; }
.res-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.st-cols { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 26px; margin-top: 28px; }
.st-cols h3, .st-runs h3 { font: 600 20px var(--display); margin: 0 0 8px; }
.grid.compact td, .grid.compact th { padding-top: 6px; padding-bottom: 6px; }
.grid.compact th:first-child, .grid.compact td:first-child { padding-left: 4px; }
.grid.compact th:last-child, .grid.compact td:last-child { padding-right: 4px; }
.grid.compact tbody tr { cursor: default; }
.grid td.gave { color: var(--muted); white-space: normal; }
.feed { display: flex; flex-direction: column; max-height: 360px; overflow: auto; font-size: 14px; }
.feed div { flex: none; padding: 5px 0; border-bottom: 1px solid rgba(43,69,83,.55); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed time { color: var(--faint); font-size: 12.5px; margin-right: 10px; }
.feed b { color: var(--green); font-weight: 600; }
.st-runs { margin-top: 30px; }
.st-runs .status { font: 600 12.5px var(--display); letter-spacing: .03em; padding: 1px 8px; border-radius: 999px; }
.st-runs .btn.ghost { min-height: 28px; padding: 3px 10px; }
.console .GAIN { color: var(--green); }
dd.gained { display: flex; flex-wrap: wrap; gap: 4px 12px; }
dd.gained b { color: var(--green); font-weight: 600; }

/* ---------- sign-in ---------- */
.signin { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 50% 110%, rgba(255,179,71,.10), transparent 60%), var(--bg); }
.signin-box { width: min(460px, 100%); display: flex; flex-direction: column; gap: 10px; }
.signin-mark { color: var(--amber); margin-bottom: 4px; }
.signin h1 { font: 700 40px/1 var(--display); margin: 0 0 22px; letter-spacing: .01em; }
.signin label { font-size: 13.5px; color: var(--muted); }
.keyfield { width: 100%; background: var(--bg-2); border: 1px solid var(--rule-2); border-radius: var(--r-m); color: var(--text);
  font: 600 27px/1 var(--display); letter-spacing: .09em; padding: 16px 16px; text-transform: uppercase; }
.keyfield::placeholder { color: var(--rule-2); }
.keyfield:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255,179,71,.18); }
.signin-err { min-height: 20px; margin: 0; color: #FFB3A8; font-size: 14px; }
.signin .btn.big { align-self: flex-start; }
.signin-help { color: var(--faint); font-size: 13.5px; margin: 14px 0 0; }
.whoami { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--rule); }
.whoami div { display: flex; flex-direction: column; }
.whoami span { font-size: 12.5px; }

/* ---------- accounts ---------- */
.acct-cols { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: 26px; align-items: start; }
.acct { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; padding: 14px 4px; border-bottom: 1px solid var(--rule); }
.acct-name { font: 600 20px var(--display); }
.acct-meta { font-size: 13.5px; color: var(--muted); }
.acct-meta .ok { color: var(--green); }
.acct-meta .bad { color: var(--coral); }
.amber { color: var(--amber); }
.acct-err { font-size: 13px; color: #FFB3A8; margin-top: 4px; overflow-wrap: anywhere; }
.acct-btns { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.acct-replace { grid-column: 1 / -1; }
.pool-note { font-size: 13px; margin: 12px 4px 0; max-width: 70ch; }
.acct-add { background: var(--bg-2); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 18px 20px; }
.acct-add h3, .keys h3 { font: 600 20px var(--display); margin: 0 0 12px; }
.acct-add form { display: flex; flex-direction: column; gap: 12px; }
.acct-add .btn { align-self: flex-start; }
textarea.input { width: 100%; resize: vertical; line-height: 1.45; }
.mono { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important; }
.linkish { color: var(--amber); text-decoration: underline; cursor: pointer; }
.keys { margin-top: 34px; }
.keys-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 8px; }
.keys-head h3 { margin: 0; }
.key-new { display: flex; gap: 8px; }
.key-new .input { width: 220px; }
.reveal { display: flex; align-items: center; gap: 16px; justify-content: space-between; padding: 14px 16px; margin-bottom: 12px;
  border: 1px solid rgba(255,179,71,.55); border-radius: var(--r-m); background: rgba(255,179,71,.07); }
.reveal div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.reveal code { font: 700 24px var(--display); letter-spacing: .08em; color: var(--text); overflow-wrap: anywhere; }
.reveal .faint, .reveal .muted { font-size: 13px; }
.keys-table tr.revoked td { opacity: .5; }
.keys-table code { color: var(--muted); }
.acct-seg button { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- scans: pool and parts ---------- */
.pool { font-size: 13px; color: var(--faint); margin-top: -6px; }
.pool:empty { display: none; }
.parts { display: flex; flex-direction: column; gap: 7px; }
.part { display: grid; grid-template-columns: minmax(0, 250px) 1fr auto 74px; gap: 10px; align-items: center; font-size: 13.5px; }
.part > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.part .status { font: 600 12px var(--display); letter-spacing: .03em; padding: 1px 8px; border-radius: 999px; justify-self: end; background: var(--panel-2); color: var(--muted); }
.progress.thin { height: 4px; }
.retried { margin-left: 8px; font-size: 11.5px; color: #FFD08A; border: 1px solid rgba(255,208,138,.5); border-radius: 4px; padding: 0 5px; cursor: help; }
.parts { max-height: 260px; overflow: auto; padding-right: 4px; }

/* ---------- email sign-in ---------- */
.add-how { margin-bottom: 14px; }
.email-form { display: flex; flex-direction: column; gap: 12px; }
.email-form .btn.primary { align-self: flex-start; }
.em-more summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
.em-more[open] summary { margin-bottom: 8px; }
.em-note { font-size: 13px; margin: 0; max-width: 60ch; }
.em-step { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0 14px; }
.em-step > div, .em-sent { display: flex; flex-direction: column; gap: 2px; }
.em-step b, .em-sent b { font-weight: 600; }
.em-step .faint, .em-sent .faint { font-size: 13.5px; }
.em-step .ring.spin { animation: spin 1.1s linear infinite; flex: none; margin-top: 1px; }
.code-field { letter-spacing: .4em; text-align: center; max-width: 280px; font-size: 32px; }

@media (max-width: 980px) {
  .players { grid-template-columns: minmax(0, 1fr); }
  .filters { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--rule); display: none; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .players.show-filters .filters { display: grid; }
  .m-only { display: inline-flex !important; }
  .scans { grid-template-columns: minmax(0, 1fr); }
  .launch { position: static; }
  .actions { grid-template-columns: minmax(0, 1fr); }
  .acct-cols { grid-template-columns: minmax(0, 1fr); }
  .st-cols { grid-template-columns: minmax(0, 1fr); }
  .act-run { position: static; order: -1; }
  .act-run:has(.empty) { display: none; }
  .grid .hide-m { display: none; }
}
@media (max-width: 640px) {
  :root { --rail: 0px; --top: 56px; }
  body { font-size: 14.5px; }
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--top) minmax(0, 1fr) 62px; }
  .demo-badge, .job-pill .label { display: none; }
  .job-pill { padding: 5px; }
  .summary { gap: 18px; }
  .summary .big { font-size: 38px; }
  .live-head .btn.ghost { display: none; }
  .pick-panel { flex-wrap: wrap; width: calc(100% - 28px); top: auto; bottom: 64px; }
  .rail { grid-row: 3; grid-column: 1; flex-direction: row; padding: 4px 6px; border-right: 0; border-top: 1px solid var(--rule); justify-content: space-around; }
  .rail .brand { display: none; }
  .rail a:not(.brand) { flex: 1; }
  .rail a.on::before { display: none; }
  .m-only { display: none !important; }
.top { grid-row: 1; padding: 0 16px; gap: 10px; }
  main { grid-row: 2; }
  .scope label, .search-trigger span, .search-trigger kbd { display: none; }
  .search-trigger { flex: 0 0 auto; padding: 8px 10px; }
  .summary, .page { padding-left: 16px; padding-right: 16px; }
  .grid th:first-child, .grid td:first-child { padding-left: 16px; }
  .grid th:last-child, .grid td:last-child { padding-right: 16px; }
  .grid .hide-s { display: none; }
  .map-ui { width: calc(100% - 28px); }
  .map-ui .legend { display: none; }
  .live-body { grid-template-columns: 1fr; }
  .blockgrid { width: 100%; height: auto; aspect-ratio: 1; }
  .servers-grid { grid-template-columns: 1fr; }
  .collect { flex-direction: column; align-items: stretch; padding: 18px; }
  .frow { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; }
  .frow .fmain { grid-column: 1 / -1; }
  .fbtns { min-width: 0; }
  .fsw .lbl { display: none; }
  .acct .fsw .lbl { display: inline; }
  .keyfield { font-size: 21px; letter-spacing: .06em; }
  .key-new .input { width: 100%; }
  .key-new { width: 100%; }
  .part { grid-template-columns: minmax(0, 1fr) auto 64px; }
  .part .progress { grid-column: 1 / -1; grid-row: 2; }
  .reveal { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.em-guest { display: grid; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--rule); }
.em-guest .btn { justify-self: start; }

.msg-set { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--rule); max-width: 560px; }
.msg-form { display: grid; gap: 10px; }
.msg-form .btn { justify-self: start; }
.msg-test { display: flex; gap: 8px; margin-top: 14px; }
.msg-test .input { flex: 1; min-width: 0; }

.wordmark { letter-spacing: -.01em; margin-bottom: 0; }
.wordmark span { color: var(--amber); }
.signin-tag { margin: -16px 0 14px; color: var(--muted); font-size: 14px; }
.console .log-note { font-style: italic; margin-bottom: 4px; }
