:root {
  /* Design tokens (#18): spacing, type scale, radii, one accent. */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --fs-12: 12px; --fs-14: 14px; --fs-16: 16px; --fs-20: 20px; --fs-28: 28px; --fs-36: 36px;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  --bg: #0b0c0e; --panel: #14161a; --panel2: #101216; --grid: #2a2e36; --text: #f2f0ea; --muted: #c8c6c0; --dim: #9a988f;
  --accent: #9fd4ee; --ok: #8ef0b0; --warn: #ffd166; --err: #ff7a7a; --border: #2a2e36;
  --vs: #b07cf5; --nc: #4f9df5; --tr: #ef5a5f; --neutral: #3a3e46; --wg: #6b6f78;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: "Segoe UI", system-ui, -apple-system, sans-serif; }
/* Main-site background accents (Dayset 2026-10-18): flat dark gray body like
 * ps2-elite-kd, plus the same PC-only artwork on html. */
body { background-color: rgb(32, 32, 32); }
@media (hover: hover) and (pointer: fine) {
  html {
    background-image: url(../assets/site-bg.webp);
    background-size: 100%;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
  }
  body { background-color: transparent; }
  /* 🖼️ toggle off (same key as the main page): back to the flat gray. */
  html.no-bg-image { background-image: none; }
  html.no-bg-image body { background-color: rgb(32, 32, 32); }
}
a { color: var(--accent); }
/* Page width = the main site page (#29): token from ../site-layout.css. */
.wrap { box-sizing: border-box; max-width: var(--page-w); margin: 0 auto; padding: var(--s-4) var(--page-gutter); }
header { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-4); }
header h1 { font-size: var(--fs-20); margin: 0; letter-spacing: .02em; }
header h1 span { color: var(--accent); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dim); display: inline-block; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); } .dot.bad { background: var(--err); }
.dot.info { background: #7aaaff; animation: dotBreathe 4s ease-in-out infinite; }
@keyframes dotBreathe { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .dot.info { animation: none; } }
.status { font-size: var(--fs-14); color: var(--muted); display: flex; align-items: center; gap: var(--s-2); }
.spacer { flex: 1; }
.back { width: 2.75rem; height: 2.75rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; padding: 0; background: var(--ctrl-btn-bg, var(--panel)); border: 1px solid var(--border); border-radius: 0; color: var(--text); text-decoration: none; }
.back:hover { border-color: var(--accent); }
.tabs { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-bottom: var(--s-4); }
.tab { background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: 0; padding: var(--s-2) var(--s-3); cursor: pointer; font: inherit; font-size: var(--fs-14); text-align: left; }
.tab small { display: block; color: var(--dim); font-size: var(--fs-12); margin-top: 2px; }
.tab.on { border-color: var(--accent); background: #1a2230; }
.tab .bar { display: flex; height: 4px; border-radius: 0; overflow: hidden; margin-top: var(--s-2); min-width: 120px; }
.empty { color: var(--muted); background: var(--panel); border: 1px solid var(--border); border-radius: 0; padding: var(--s-5); }
.grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s-4); }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 0; padding: var(--s-4); min-width: 0; }
/* Section headers in the main site style (#30, same as build-log .st-card h2): normal case, bold, accent. */
.card h2 { font-size: 0.95rem; text-transform: none; letter-spacing: normal; color: var(--accent); margin: 0 0 var(--s-3); font-weight: 600; }
.title { display: flex; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-3); }
.title b { font-size: var(--fs-20); }
.badge { font-size: var(--fs-12); padding: 2px var(--s-2); border-radius: 0; border: 1px solid var(--border); color: var(--muted); }
.badge.live { color: var(--ok); border-color: rgba(142,240,176,.5); }
.badge.settling, .badge.sudden_death, .badge.interrupted { color: var(--warn); border-color: rgba(255,209,102,.5); }
.map svg { width: 100%; height: auto; display: block; background: var(--panel2); border-radius: 0; }
.map .legend { display: flex; gap: var(--s-3); font-size: var(--fs-12); color: var(--muted); margin-top: var(--s-2); flex-wrap: wrap; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 0; margin-right: 4px; vertical-align: -1px; }
.odds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.fac { border-radius: 0; padding: var(--s-3); background: var(--panel2); border: 1px solid var(--border); text-align: center; }
.fac .n { font-size: clamp(20px, 6vw, 30px); font-weight: 700; font-variant-numeric: tabular-nums; }
.fac .l { font-size: var(--fs-14); font-weight: 600; letter-spacing: .08em; }
.fac .stars { color: var(--warn); letter-spacing: 1px; font-size: var(--fs-14); min-height: 16px; }
.fac.lead { border-color: currentColor; }
.rows { margin-top: var(--s-3); font-size: var(--fs-14); }
.row { display: grid; grid-template-columns: 92px 1fr 64px; gap: var(--s-2); align-items: center; margin: var(--s-1) 0; }
.row .note { margin-top: 0; }
.row .lbl { color: var(--muted); }
.row .v { text-align: right; font-variant-numeric: tabular-nums; }
.track span, .tab .bar span { display: block; height: 100%; }
.track { height: 8px; background: var(--panel2); border-radius: 0; overflow: hidden; display: flex; }
.calls { margin: var(--s-3) 0 0; padding: 0; list-style: none; font-size: var(--fs-14); }
.calls li { padding: var(--s-2) var(--s-2); border-left: 3px solid var(--warn); background: rgba(255,209,102,.06); margin: var(--s-1) 0; border-radius: 0; }
.chart svg { width: 100%; height: auto; display: block; }
.second { margin-top: var(--s-3); font-size: var(--fs-14); color: var(--muted); }
.note { font-size: var(--fs-12); color: var(--dim); margin-top: var(--s-2); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-14); }
th, td { text-align: left; padding: var(--s-2) var(--s-2); border-bottom: 1px solid #1e222a; white-space: nowrap; }
th { color: var(--dim); font-weight: 600; font-size: var(--fs-12); }
td.num { font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
.flag { color: var(--warn); font-size: var(--fs-12); }
.cmd { font-size: var(--fs-14); }
.cmdgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
@media (max-width: 860px) { .cmdgrid { grid-template-columns: 1fr; } }
.cmd ul { margin: 0; padding-left: var(--s-5); }
.cmd h3 { font-size: var(--fs-14); margin: var(--s-3) 0 var(--s-1); }
.cmd ol { margin: 0; padding-left: var(--s-5); }
.cmd li { margin: 2px 0; }
.cmd .focus { border: 1px solid var(--border); border-radius: 0; padding: var(--s-2, 6px) var(--s-3, 8px); margin: var(--s-2, 6px) 0; background: rgba(255,255,255,0.03); }
/* OBS block capture (owner 2026-10-25): the All-forces box is one exact
   rectangle — header, two facility lines, values + info — no matter the
   base names or the base count. Longer text clips inside; the box never moves. */
.cmd .focus { height: 132px; overflow: hidden; line-height: 1.35; }
.cmd .focus .fhead .fbase { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd .focus .fhead { line-height: 1.35; }
.cmd .focus .fodds { margin-top: 2px; font-size: var(--fs-16, 16px); }
.cmd .focus.hold { border-color: rgba(255, 170, 60, 0.45); }
.cmd .focus.take, .cmd .focus.plan { border-color: rgba(90, 200, 120, 0.45); }
.cmd .focus.quiet { opacity: 0.75; }
.cmd ul.fback { margin: 0 0 var(--s-2, 6px); }
.cmd details.allmoves { margin-top: var(--s-2, 6px); }
.bench { display: flex; gap: var(--s-3); flex-wrap: wrap; font-size: var(--fs-14); }
.bench div { background: var(--panel2); border: 1px solid var(--border); border-radius: 0; padding: var(--s-2) var(--s-3); }
.bench b { font-variant-numeric: tabular-nums; }
.who { font-size: var(--fs-14); color: var(--muted); display: flex; gap: var(--s-2); align-items: center; }
.btn { background: #1e2a3a; border: 1px solid var(--accent); color: var(--text); border-radius: 0; padding: var(--s-2) var(--s-3); font: inherit; font-size: var(--fs-14); cursor: pointer; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.big { font-size: var(--fs-20); padding: var(--s-3) var(--s-5); font-weight: 700; letter-spacing: .06em; }
.link { background: none; border: 0; color: var(--accent); font: inherit; font-size: var(--fs-14); cursor: pointer; text-decoration: underline; padding: 0; }
dialog.auth { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 0; padding: var(--s-5); width: min(440px, calc(100vw - 32px)); }
dialog.auth::backdrop { background: rgba(0,0,0,.6); }
.auth .x { position: absolute; top: 8px; right: 8px; } .auth .x button { background: none; border: 0; color: var(--dim); font-size: var(--fs-20); cursor: pointer; }
.auth h3 { margin: 0 0 var(--s-3); font-size: var(--fs-20); }
.auth ol { padding-left: 20px; margin: var(--s-2) 0; font-size: var(--fs-14); } .auth li { margin: var(--s-1) 0; }
.auth input { width: 100%; background: #0f1114; border: 1px solid var(--border); color: var(--text); border-radius: 0; padding: var(--s-2) var(--s-3); font: inherit; margin: var(--s-2) 0; }
.auth .row2 { display: flex; gap: var(--s-3); align-items: center; margin-top: var(--s-3); flex-wrap: wrap; }
.auth .err { color: var(--err); font-size: var(--fs-14); margin-top: var(--s-2); } .auth .ok { color: var(--ok); }
.auth .count { font-size: var(--fs-36); font-weight: 700; font-variant-numeric: tabular-nums; }
.auth .qr { background: #fff; border-radius: 0; width: min(260px, 70vw); margin: var(--s-3) auto; } /* #82: QR stays black on white in both themes */
.auth .qr svg { display: block; width: 100%; height: auto; }
.auth .bar { height: 6px; background: var(--panel2); border-radius: 0; overflow: hidden; margin-top: var(--s-2); } .auth .bar span { display: block; height: 100%; background: var(--accent); }
footer { color: var(--dim); font-size: var(--fs-12); margin-top: var(--s-5); background: var(--panel); border: 1px solid var(--border); padding: var(--s-3) var(--s-4); }
/* 📍 Locate one character (hidden in ⓘ About): same quiet form language as the auth dialog. */
.locate { margin-top: var(--s-3); max-width: 560px; }
.locate label { display: block; font-weight: 700; color: var(--text); font-size: var(--fs-14); margin-bottom: var(--s-2); }
.locaterow { display: flex; gap: var(--s-2); }
.locaterow input { flex: 1; min-width: 0; background: #0f1114; border: 1px solid var(--border); color: var(--text); border-radius: 0; padding: var(--s-2) var(--s-3); font: inherit; min-height: 44px; }
.locaterow button { min-height: 44px; padding: 0 var(--s-3); background: var(--panel2); border: 1px solid var(--border); color: var(--text); border-radius: 0; font: inherit; font-weight: 700; cursor: pointer; }
.locaterow button:disabled { opacity: .5; cursor: default; }
.locate .note { margin-top: var(--s-2); }
.locate #locateOut:empty { display: none; }
.hoverline { min-height: 18px; font-size: var(--fs-14); color: var(--muted); margin-top: var(--s-2); font-variant-numeric: tabular-nums; }
.chart svg { touch-action: pan-y; }
.more { margin-top: var(--s-3); background: var(--panel2); border: 1px solid var(--border); color: var(--text); border-radius: 0; padding: var(--s-2) var(--s-3); cursor: pointer; font: inherit; font-size: var(--fs-14); }
#hist tbody tr[data-k] { cursor: pointer; }
#hist tbody tr[data-k]:hover, #hist tbody tr[data-k]:focus { background: #1a2230; outline: none; }
.myvote { font-size: var(--fs-12); color: var(--dim); margin-left: 6px; white-space: nowrap; }
.backlive { margin-left: auto; }
.slices td { white-space: nowrap; }
.melt { color: var(--warn); font-size: var(--fs-12); margin-left: 4px; }
.map svg polygon { cursor: pointer; }
.VS { color: var(--vs); } .NC { color: var(--nc); } .TR { color: var(--tr); }

/* ---------------------------------------------------------------- phone-first (#16)
   Collapsibles (<details class="det">) are forced open on wider screens with the
   summary hidden, so the desktop layout is unchanged; phone-only bits are hidden there. */
.det > summary { cursor: pointer; color: var(--muted); font-size: var(--fs-14); list-style: none; }
.det > summary::-webkit-details-marker { display: none; }
/* Unfold indicator for user-toggleable collapsibles (e.g. Win chance Details). */
.det.keep > summary::before { content: "▸"; color: var(--dim); margin-right: var(--s-1); }
.det.keep[open] > summary::before { content: "▾"; }
.seg, .oddline, .tab .tl { display: none; }
/* Pinned top bar (owner 2026-11-01): row 1 = alert name + win %, row 2 = ⚖️ skill (label left,
   numbers right). Fixed at the viewport top; miniSync slides it down once the alert title scrolls
   away, and it stays there while scrolling (all widths — was phone-only). */
.mini { display: flex; flex-direction: column; position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  gap: var(--s-1); padding: var(--s-2) var(--s-3); background: rgba(16,18,22,.96); border-bottom: 1px solid var(--border);
  font-size: var(--fs-14); transform: translateY(-100%); transition: transform .15s; }
.mini.show { transform: none; }
.mini-main { display: flex; gap: var(--s-3); align-items: center; justify-content: space-between; }
.mini-main > span { display: flex; gap: var(--s-2); font-variant-numeric: tabular-nums; font-weight: 700; }
.mini-skill { display: flex; gap: var(--s-2); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.mini-skill[hidden] { display: none; }
.mini-skill-label { flex: none; }
.mini-skill-values { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
@media (min-width: 601px) {
  .det:not(.keep) > summary { display: none; }
  .det.keep > summary { display: block; }
}
@media (max-width: 600px) {
  .wrap { padding: var(--s-3); }
  header { gap: var(--s-2); margin-bottom: var(--s-3); }
  .btn, .more, .link { min-height: 44px; }
  .link { padding: 0 var(--s-2); }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 calc(-1 * var(--s-3)) var(--s-3); padding: 0 var(--s-3); }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; scroll-snap-align: start; min-height: 44px; padding: var(--s-2) var(--s-3); border-radius: 0; }
  .tab .tl0 { display: none; } .tab .tl { display: block; font-size: var(--fs-14); }
  .tab .bar { min-width: 0; margin-top: var(--s-1); }
  .grid { gap: var(--s-3); }
  .row .note { margin-top: 0; }
  .card { padding: var(--s-3); }
  .title { gap: var(--s-2); }
  .title b { font-size: var(--fs-20); }
  .title .note, .note, .second, .rows, .calls, .cmd, table, .bench, footer, .hoverline { font-size: var(--fs-14); }
  .odds { gap: var(--s-2); }
  .fac { padding: var(--s-2) var(--s-1); }
  .fac .stars { display: none; }
  .oddline { display: block; margin-top: var(--s-2); font-size: var(--fs-14); color: var(--muted); }
  .oddline .stars { color: var(--warn); font-size: var(--fs-12); }
  .oddline .note { margin: 0; }
  .det > summary { min-height: 44px; display: flex; align-items: center; gap: var(--s-2); }
  .det.wdet > summary::after, .det.why > summary::after { content: "▾"; color: var(--dim); }
  .det.wdet[open] > summary::after, .det.why[open] > summary::after { content: "▴"; }
  .det.info > summary { min-height: 44px; color: var(--dim); }
  .row { grid-template-columns: 96px 1fr 56px; }
  /* AI Commander: one faction at a time */
  .seg { display: flex; gap: var(--s-2); margin-bottom: var(--s-1); }
  .seg button { flex: 1; min-height: 44px; background: var(--panel2); border: 1px solid var(--border); border-radius: 0; font: inherit; font-weight: 700; letter-spacing: .06em; cursor: pointer; }
  .seg button.on { border-color: currentColor; background: #1a2230; }
  .cmdgrid > .cf:not(.on) { display: none; }
  .cmd ol, .cmd ul { padding-left: 20px; }
  .cmd li { margin: var(--s-2) 0; }
  /* Tables become card lists */
  table.cards thead { display: none; }
  table.cards, table.cards tbody { display: block; }
  table.cards tr { display: flex; flex-wrap: wrap; gap: 2px var(--s-3); padding: var(--s-3) var(--s-1); border-bottom: 1px solid #1e222a; min-height: 44px; }
  table.cards td { border: 0; padding: 0; white-space: normal; }
  table.cards td[data-l]:not([data-l=""])::before { content: attr(data-l) " "; color: var(--dim); }
  table.cards td:empty { display: none; }
  #hist.cards td.hzone { font-weight: 600; } #hist.cards td.hsrv { order: -1; font-weight: 600; }
  #hist.cards td.hend { order: 5; width: 100%; color: var(--dim); }
  #hist.cards td.hfin::before { content: "VS/NC/TR "; color: var(--dim); }
  #hist.cards td.hbas { color: var(--dim); }
  #hist.cards td.flag { width: 100%; }
  .ptable.cards td.pn { font-weight: 600; flex: 1 1 60%; }
  .ptable.cards td.rad, .ptable.cards td:last-child { width: 100%; }
  .scroll { overflow-x: visible; }
  .slices { display: table; }
  .card .scroll:has(.slices) { overflow-x: auto; }
  dialog.auth { padding: var(--s-4); }
  .auth .x button { min-width: 44px; min-height: 44px; }
  .auth input { min-height: 44px; font-size: var(--fs-16); }
}
@media (prefers-reduced-motion: reduce) { .mini { transition: none; } }
@media (max-width: 600px) {
  .grid > .side { order: -1; }
  .map svg { max-height: 38vh; width: auto; max-width: 100%; margin: 0 auto; }
  .card.map h2 { display: none; }
}

/* ---------------------------------------------------------------- desktop (#17) */
#map { position: relative; }
.map .tip { position: absolute; z-index: 5; pointer-events: none; background: rgba(16,18,22,.96); border: 1px solid var(--border); border-radius: 0; padding: var(--s-1) var(--s-2); font-size: var(--fs-14); white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.clegend { display: flex; gap: var(--s-3); font-size: var(--fs-12); color: var(--muted); margin: -4px 0 var(--s-2); }
/* ⏱ live timer + lock-probability card (next to the Voting panel).
 * The svg has a viewBox and height:auto, so the aspect ratio is always
 * preserved — it can never come out stretched or squished. */
#lockHere svg { width: 100%; height: auto; display: block; }
/* Time row (2026-11-02 layout pass): win chance over time + ⏱ live timer side by side, on the same
 * columns as the map row above, so the right-hand cards line up in one column down the page. */
.timerow { display: grid; gap: var(--s-4); align-items: stretch; }
/* One vertical rhythm between the page's blocks (was a mix of inline 14 px and 16 px gaps). */
#main > .grid ~ *, .wrap > section.card { margin-top: var(--s-4); }
#lockHere:empty { display: none; }
#lockHere > .card { height: 100%; }
@media (min-width: 861px) {
  .timerow { grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); }
  .timerow:has(> #lockHere:empty) { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) { .timerow { gap: var(--s-3); } #main > .grid ~ *, .wrap > section.card { margin-top: var(--s-3); } }
.locktimer { font-size: var(--fs-28); font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: var(--s-2); }
.locktimer .note { font-size: var(--fs-14); font-weight: 400; }
.cmd li[data-base] { cursor: default; border-radius: 0; }
.cmd li[data-base]:hover { background: #1a2230; }
@media (min-width: 861px) {
  .grid { grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); align-items: start; }
  /* Right column is one flex stack: the tall map no longer stretches the grid
   * rows and scatters the cards with dead space between them. */
  .grid > .side { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
  .map svg { max-height: calc(100vh - 360px); min-height: 300px; width: auto; max-width: 100%; margin: 0 auto; }
  /* ⓘ notes: small popovers instead of long text */
  .det.info { position: relative; display: inline-block; }
  .det.info > summary { display: inline-flex; align-items: center; gap: var(--s-1); color: var(--dim); font-size: var(--fs-14); margin-top: var(--s-2); }
  .det.info > summary:hover { color: var(--muted); }
  .det.info[open] > :not(summary) { position: absolute; z-index: 10; left: 0; bottom: calc(100% + 6px); width: min(440px, 80vw); background: var(--panel2); border: 1px solid var(--border); border-radius: 0; padding: var(--s-3) var(--s-3); box-shadow: 0 8px 24px rgba(0,0,0,.55); margin: 0; }
  .det.info[open] > :not(summary) .note, .det.info[open] > .note { margin: 0; }
  footer .det.info[open] > :not(summary) { bottom: calc(100% + 6px); }
/* About popup: one panel holding locate + the original text below it (2026-11-14).
   The popup rule above positions every non-summary child absolutely, so two
   children stacked on the same spot — locate painted over the text. */
.det.info .aboutpop > .locate { margin-top: 0; }
.det.info .aboutpop > * + * { margin-top: var(--s-3); }
}

/* ---------------------------------------------------------------- states + a11y (#18) */
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 0; }
.odds, .rows, .tab small, .status, .mini, table, .hoverline, .second, .oddline, .bench, .who { font-variant-numeric: tabular-nums; }
.banner { display: flex; gap: var(--s-2); align-items: center; background: rgba(255,122,122,.1); border: 1px solid rgba(255,122,122,.45); color: var(--text); border-radius: 0; padding: var(--s-2) var(--s-3); margin-bottom: var(--s-3); font-size: var(--fs-14); }
.banner.warn { background: rgba(255,209,102,.08); border-color: rgba(255,209,102,.45); }
.banner[hidden] { display: none; }
/* Maintenance notice (t721u): calm info, not a warning. */
.banner.info { background: rgba(122,170,255,.08); border-color: rgba(122,170,255,.45); }
.banner.info { flex-wrap: wrap; }
.banner a { white-space: nowrap; color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.sk { position: relative; overflow: hidden; background: var(--panel2); border-radius: 0; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.05), transparent); animation: sk 1.4s infinite; }
@keyframes sk { to { transform: translateX(100%); } }
.sk-map { aspect-ratio: 1 / 1; max-height: 60vh; width: 100%; }
.sk-odds { height: 84px; }
.sk-line { height: 12px; margin-top: var(--s-2); }
.sk-chart { height: 200px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- map zoom/pan, sheet (#19) */
.map svg { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.map svg.zoomed { touch-action: none; cursor: grab; }
.map svg.zoomed:active { cursor: grabbing; }
.map svg .vp { will-change: transform; }
.sw.hatch { background: repeating-linear-gradient(45deg, var(--neutral) 0 3px, #5a5f69 3px 5px); }
.sw.wgs { background: var(--wg); outline: 1px dashed #e8e6df; outline-offset: -1px; }
.map .legend .hint { color: var(--dim); }
.map .sheet { position: absolute; z-index: 6; left: var(--s-2); right: var(--s-2); bottom: var(--s-2); background: rgba(16,18,22,.97); border: 1px solid var(--border); border-radius: 0; padding: var(--s-3); font-size: var(--fs-14); box-shadow: 0 8px 24px rgba(0,0,0,.55); max-height: 60%; overflow: auto; }
.map .sheet[hidden] { display: none; }
.map .sheet ul { margin: var(--s-2) 0 0; padding-left: var(--s-4); }
.map .sheet li { margin: var(--s-1) 0; }
.map .sheet .x { position: absolute; top: 2px; right: 2px; min-width: 44px; min-height: 44px; background: none; border: 0; color: var(--dim); font-size: var(--fs-16); cursor: pointer; }
@media (min-width: 861px) { .map .sheet { left: auto; width: 320px; } }
@media (max-width: 600px) { .map .legend .hint { display: none; } }

/* ---------------------------------------------------------------- collapsible sections */
.card > h2:has(> button.ch) { margin: 0; }
.card > h2 > button.ch { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: var(--s-2); width: 100%; min-height: 32px; margin: 0 0 var(--s-3); cursor: pointer; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; border-radius: 0; }
.card > h2 > button.ch:focus-visible { box-shadow: var(--focus); }
.card > h2 > button.ch:hover { opacity: .85; }
/* Chevron on the left with the main site's ▾ / ▸ glyphs (build-log .st-sec summary::before). */
.card > h2 > button.ch { gap: 0; }
.ch .chev { order: -1; flex: none; display: inline-block; width: 1.1em; color: var(--dim); }
.ch .chev::before { content: "▾"; }
.card.collapsed > h2 > button.ch { margin-bottom: 0; }
.card.collapsed .ch .chev::before { content: "▸"; }
.card.collapsed > :not(h2) { display: none !important; }
.card.opening > :not(h2) { animation: secOpen .16s ease-out; }
@keyframes secOpen { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
/* Idle panels (no live alert): visible but dimmed, so users see what's available. */
.card.idle { opacity: .55; }
.card.idle:hover { opacity: .8; }
/* Collapsed-card summary: one-line top-priority info under the header, click-to-copy. */
.ch-sum { display: none; }
.card.collapsed .ch-sum { all: unset; display: block; margin-top: var(--s-1); font-size: var(--fs-14); color: var(--muted); cursor: pointer; }
.card.collapsed .ch-sum:hover, .card.collapsed .ch-sum:focus-visible { color: var(--text); }
.card.collapsed .ch-sum:focus-visible { box-shadow: var(--focus); border-radius: 0; }
@media (max-width: 600px) {
  .card.map h2 { display: block; }
  .card > h2 > button.ch { min-height: 44px; margin-bottom: var(--s-2); }
}

/* Timeline scrub (map replay of a past minute) */
/* Floating badge over the map's top-right corner: never takes layout space, so the map block
   does not move when a replay starts or ends. */
.card.map { position: relative; }
.replaytag { position: absolute; top: var(--s-3); right: var(--s-3); z-index: 6; font-size: 13px; color: var(--accent);
  background: rgba(16,18,22,.92); border: 1px solid var(--border); border-radius: 0; padding: 4px 10px;
  display: flex; align-items: center; gap: 10px; pointer-events: auto; }
.replaytag[hidden] { display: none; }
#map svg.replay .marks { display: none; }
#chart svg { cursor: crosshair; }

/* 🔊 Commander voice (#65) */
.voicebtn { margin-left: var(--s-2, 8px); padding: 2px 8px; min-height: 32px; background: var(--panel2); border: 1px solid var(--border); border-radius: 0; font: inherit; cursor: pointer; vertical-align: middle; }
.voicebtn.on { border-color: currentColor; }

/* Commander orders on the map + base names as links (owner 2026-10-24) */
#map svg.replay .ords { display: none; }
#map .ords .ob { fill: #ffd54a; stroke: #0b0c0e; }
#map .ords .on { fill: #111; font-weight: 700; }
#map .ords .ot { fill: #fff; font-weight: 500; letter-spacing: .02em; stroke: rgba(11, 12, 14, .85); paint-order: stroke; }
.cmd .blink { color: var(--link, #7cc4ff); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; cursor: pointer; }
.cmd .blink:hover, .cmd .blink:focus-visible, .cmd .blink.hl { text-decoration-style: solid; outline: none; }
.cmd .onum { display: inline-block; min-width: 1.35em; padding: 0 .3em; border-radius: 0; background: #ffd54a; color: #111; font-weight: 800; font-size: .85em; text-align: center; line-height: 1.35em; }
.cmd ul.olist { list-style: none; padding-left: 0; margin: 0; }
.cmd ul.olist li { margin: 2px 0; }
#map .ordseg { display: flex; align-items: center; gap: 6px; margin: 8px 0 2px; font-size: 13px; color: var(--muted, #9aa3ad); }
#map .ordseg button { min-height: 32px; min-width: 44px; padding: 0 10px; background: var(--panel2); border: 1px solid var(--border); border-radius: 0; font: inherit; font-weight: 700; cursor: pointer; }
#map .ordseg button.on { border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }
#map svg.replay .ords { display: none; }
.legend .sw.poi { background: #fff; border-radius: 50%; width: 8px; height: 8px; border: 2px solid #0b0c0e; }
@media (min-width: 601px) { .cmdgrid > .cf.on { outline: 1px solid rgba(255, 213, 74, .45); outline-offset: 4px; border-radius: 0; } }
.legend .sw.poi.big { width: 12px; height: 12px; }
.legend .sw.poi.ring { background: transparent; border: 3px solid #fff; box-shadow: 0 0 0 1px #0b0c0e; width: 10px; height: 10px; }
.legend .sw.poi.cons { border-radius: 0; transform: rotate(45deg); }

/* 🗳️ All my votes (owner 2026-10-24) */
.vote details.mylist { margin-top: 8px; }
.vote details.mylist > summary { cursor: pointer; }
.vote .vlist { margin-top: 6px; font-size: 13px; }
.vote .vrow { padding: 5px 0; border-bottom: 1px solid var(--border); }
.vote .vrow .mvst.won { color: #5ac878; } .vote .vrow .mvst.lost { color: #ff7a7a; } .vote .vrow .mvst.open { color: #ffd54a; }

/* 🥶 pockets (owner 2026-10-24) */
#map .pockets line { vector-effect: non-scaling-stroke; }
#map .pockets .cpring { stroke-dasharray: none; stroke-width: 3; vector-effect: non-scaling-stroke; }
#map svg.replay .pockets { display: none; }
.legend .sw.pkring { background: transparent; border: 2px solid #9fe3ff; border-radius: 50%; width: 10px; height: 10px; }
.cmd .pockets { margin: 6px 0; }
.cmd .pocket { padding: 4px 8px; margin: 3px 0; border: 1px dashed rgba(159, 227, 255, .55); border-radius: 0; background: rgba(159, 227, 255, .06); }
/* ⚙️ voice list (owner t650u): replaces the always-visible .voicesel dropdown (huge on Edge).
   Fixed under the ⚙️, never wider than the screen, long names cut with "…", scrolls when long. Static. */
.voicegear { margin-left: 4px; padding: 2px 6px; min-height: 32px; min-width: 32px; background: var(--panel2); border: 1px solid var(--border); border-radius: 0; font: inherit; font-size: 15px; line-height: 1; cursor: pointer; vertical-align: middle; }
.voicegear[aria-expanded="true"] { border-color: currentColor; }
.voicemenu { position: fixed; z-index: 1000; box-sizing: border-box; width: min(20rem, calc(100vw - 16px)); max-height: min(50vh, 22rem); overflow-y: auto; overscroll-behavior: contain; padding: 4px; background: var(--panel, #16181c); color: var(--text, #e6e6e6); border: 1px solid var(--border); border-radius: 0; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); }
.voicemenu[hidden] { display: none; }
.voicemenu .vopt { display: block; box-sizing: border-box; width: 100%; min-height: 36px; padding: 6px 10px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: none; color: inherit; border: 0; border-radius: 0; font: inherit; font-size: 13px; cursor: pointer; }
.voicemenu .vopt:hover, .voicemenu .vopt:focus-visible { background: var(--panel2); outline: none; }
.voicemenu .vopt.on { font-weight: 700; }
@media (pointer: coarse) { .voicegear { min-height: 40px; min-width: 40px; } .voicemenu .vopt { min-height: 44px; } }

/* Commander orders mode (Solo / Big squad): static, no animation. */
.cmode { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-1); }
.cmode button { min-height: 36px; padding: 0 var(--s-3, 12px); background: var(--panel2); border: 1px solid var(--border); border-radius: 0; font: inherit; font-weight: 700; cursor: pointer; transition: none; }
.cmode button.on { border-color: currentColor; background: #1a2230; }
.cmodenote { margin-bottom: var(--s-2); }
/* Pulsing target rings (owner t688u): Solo #1, Big squad #1-#3, faction colour. Overlay on
   the map; the pulse animates transform + opacity only (compositor, no SVG repaint).
   prefers-reduced-motion: the global rule above stops it and the static ring stays. */
#map .pulses { position: absolute; pointer-events: none; overflow: hidden; }
#map .pulses .pw { position: absolute; transform: translate(-50%, -50%); }
#map .pulses .ps, #map .pulses .pp { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--pc, #ffd54a); box-sizing: border-box; }
#map .pulses .ps { box-shadow: 0 0 0 2px rgba(11, 12, 14, .9), inset 0 0 0 2px rgba(11, 12, 14, .9); }
#map .pulses .pp { opacity: 0; will-change: transform, opacity; animation: orPulse 1.4s ease-out infinite; }
@keyframes orPulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
/* 🔥 Heat toggle (owner t692u): grey when off, like the muted speaker. */
.heatbtn:not(.on) { filter: grayscale(1); opacity: .65; }
.heatbtn.on { border-color: #ff7a2f; background: #2a1a10; }
.conduitbtn:not(.on) { filter: grayscale(1); opacity: .65; }
.conduitbtn.on { border-color: #ff7a2f; background: #2a1a10; }
/* Terrain image + territory colour sliders under the map (owner 2026-10-27). */
#map .mapctl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 6px; font-size: var(--fs-12, 12px); color: var(--muted, #9aa3ad); }
#map .mapctl label { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
#map .mapctl input[type="range"] { width: 120px; accent-color: #ffd54a; }
#map .mapctl output { min-width: 3.2em; font-variant-numeric: tabular-nums; color: var(--text, #e8e6df); }
#map .mapctl .credit { color: var(--dim, #6b7280); font-size: 11px; }

/* ⚔️ Live fights (#78 step 1, paid plan 2026-10-29; js/fights.js): crowd per faction at each base. */
.fightcard { margin-top: var(--s-3); }
.fights { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.fights li { min-width: 0; }
.fights .fhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s-2); font-size: var(--fs-14); }
.fights .blink { font-weight: 700; color: var(--link, #7cc4ff); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; cursor: pointer; }
.fights .blink:hover, .fights .blink:focus-visible { text-decoration-style: solid; outline: none; }
.fights .fown { font-size: 0.75em; font-weight: 700; border: 1px solid currentColor; border-radius: 0; padding: 0 0.25em; }
.fights .fcap { font-size: 0.85em; color: var(--muted); }
.fights .fbar { margin: 3px 0 2px; height: 10px; justify-content: flex-start; }
.fights .fnum { font-size: var(--fs-14); font-variant-numeric: tabular-nums; }
/* 🏴 Capture tags (owner 2026-10-30; js/fights.js capLine): leading outfit per base capture. */
.capt { font-size: 0.85em; display: inline-block; }
.capt b { color: var(--text, #e8e8e8); }
.capt .capcred { color: var(--muted); }
.fights .fcapt { font-size: 0.85em; white-space: nowrap; }
.caph { font-size: var(--fs-14); margin: var(--s-3) 0 var(--s-2); }
.fights.caps { gap: var(--s-2); }
.fights.caps li { font-size: var(--fs-14); }
.capt.capnew { animation: capPop 0.9s ease-out 1, capGlow 2.4s ease-in-out 2; transform-origin: left center; }
@keyframes capPop { 0% { opacity: 0; transform: scale(0.6) rotate(-6deg); } 60% { opacity: 1; transform: scale(1.12) rotate(2deg); } 100% { transform: none; } }
@keyframes capGlow { 50% { text-shadow: 0 0 8px rgba(255, 210, 90, 0.9); } }
@media (prefers-reduced-motion: reduce) { .capt.capnew { animation: none; } }
/* 🚐 Forward spawns (owner 2026-10-30; forward-spawns.mjs): spawn points per side at a base, last 10 min. */
.fsp { margin-top: 1px; }
/* 👥 Folded scoreboard under a fight (owner 2026-10-30): top 3 players, kills/deaths · iVi. */
.fsb { margin-top: 1px; font-size: var(--fs-13, 13px); }
.fsb > summary { cursor: pointer; color: var(--muted); list-style: none; width: max-content; }
.fsb > summary::-webkit-details-marker { display: none; }
.fsb > summary::after { content: " ▸"; color: var(--dim); }
.fsb[open] > summary::after { content: " ▾"; }
.fsb > ol { margin: 1px 0 0; padding-left: 1.4em; }
.fsb > ol > li { margin: 0; overflow-wrap: anywhere; }
.fspawn { font-size: 0.85em; color: var(--muted); display: inline-block; }
.fspawn.fspnew { animation: fspIn 0.8s ease-out 1; }
@keyframes fspIn { 0% { opacity: 0; transform: translateY(-3px); } 100% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fspawn.fspnew { animation: none; } }
/* 🚐 short line: "3 Sunderer·40 (2 lost) | NC 2 beacon·9"; full words in the hover hint */
.fspn { font-variant-numeric: tabular-nums; }
.fspawn .fspx { opacity: 0.8; }
.fspawn .fspsep { opacity: 0.5; padding: 0 2px; }
@media (max-width: 600px) { .fspawn { font-size: 0.8em; } }
