/* ============================================================
   Controller Lab — design system
   Dark repair-bench theme, per-platform accent via body[data-family]
   ============================================================ */

:root {
  --bg: #0b0e14;
  --bg-soft: #0f1420;
  --surface: #131a28;
  --surface-2: #1a2334;
  --border: #232e45;
  --border-soft: #1c2537;
  --text: #e8ecf4;
  --muted: #8b96ab;
  --faint: #5d6b80;
  --accent: #a855f7;            /* Coolshrimp purple */
  --accent-soft: rgba(168, 85, 247, .14);
  --accent-bright: #d8b4fe;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --mono: "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 70% -10%, var(--accent-soft), transparent 60%),
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
  transition: background .6s ease;
}

.wrap { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
/* the tester workspace uses the whole desktop viewport */
#tester .workspace, .workspace { width: 100%; }
main.wrap:has(#workspace) { width: min(1720px, calc(100% - 48px)); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(11, 14, 20, .82);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 12px 0;
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #06121a;
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  box-shadow: 0 0 18px var(--accent-soft), inset 0 1px 0 rgba(255,255,255,.35);
  transition: background .4s ease;
}
.brand-mark svg { width: 26px; height: 26px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 17px; letter-spacing: .2px; }
.brand-text small { color: var(--muted); font-size: 11.5px; }

.site-nav { display: flex; gap: 4px; margin-left: auto; }

.nav-link {
  position: relative;
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}
.nav-link:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav-link.active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.nav-badge {
  font-size: 9px;
  color: var(--warn);
  margin-left: 3px;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.pad-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.pad-status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); }
.pad-status[data-state="connected"] .dot {
  background: var(--ok);
  animation: pulse 1.6s ease infinite;
}
.pad-status[data-state="connected"] .txt { color: var(--text); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .5); }
  55% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
}

/* ---------- generic ui ---------- */

main.wrap { flex: 1; padding: 28px 0 60px; }

.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.card + .card { margin-top: 18px; }

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

/* collapsible card (details/summary) */
details.card.collapse > summary.card-title {
  margin-bottom: 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
details.card.collapse[open] > summary.card-title { margin-bottom: 14px; }
details.card.collapse > summary::-webkit-details-marker { display: none; }
details.card.collapse > summary.card-title::after {
  content: "▾";
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  transition: transform .15s ease;
}
details.card.collapse:not([open]) > summary.card-title::after { transform: rotate(-90deg); }
details.card.collapse > summary.card-title:hover { color: var(--text); }
.card-title::before {
  content: "";
  width: 4px; height: 18px;
  border-radius: 2px;
  background: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: 600 13.5px/1 "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
  transition: all .15s ease;
}
.btn:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; border-color: var(--border); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04121a; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger:hover { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(248, 113, 113, .15); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.chip.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.chip.ok { color: var(--ok); border-color: rgba(52,211,153,.4); }
.chip.warn { color: var(--warn); border-color: rgba(251,191,36,.4); }
.chip.bad { color: var(--bad); border-color: rgba(248,113,113,.4); }

.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }

select.field, input.field {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font: 600 13.5px "Segoe UI", system-ui, sans-serif;
}
select.field:focus, input.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- hero / connect ---------- */

.hero {
  text-align: center;
  padding: 60px 20px 50px;
}
.hero .pad-art {
  width: 130px;
  margin: 0 auto 18px;
  color: var(--accent);
  filter: drop-shadow(0 0 22px var(--accent-soft));
  animation: float 3.4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
.hero h1 { font-size: clamp(26px, 4vw, 38px); }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p.lead { color: var(--muted); max-width: 620px; margin: 0 auto 22px; font-size: 16px; }

.platform-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 720px;
  margin: 0 auto 8px;
}

.hero .hint {
  margin-top: 26px;
  color: var(--muted);
  font-size: 13.5px;
}
.hero .hint kbd {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: 12px;
}

/* ---------- tester layout ---------- */

#tester { display: none; }
body.has-pad #tester { display: block; }
body.has-pad #connect-hero { display: none; }

.pad-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.pad-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
}
.pad-tab.active { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.pad-tab .slot { font-family: var(--mono); font-size: 11px; opacity: .7; }

.detect-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.detect-left { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.detect-right { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.detect-bar .pad-name {
  font-size: 19px;
  font-weight: 700;
}

/* ---------- panel workspace ---------- */

.workspace {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-flow: dense;
  grid-auto-rows: 8px;      /* JS sizes each panel's row-span → tight mosaic packing */
  gap: 14px;
  align-items: start;
}

/* wide desktop: workstation + diagnostics main column, arcade + log side rail */
@media (min-width: 1440px) {
  .panel[data-panel="station"] { grid-column: span 9; }
  .panel[data-panel="arcade"]  { grid-column: span 3; }
  .panel[data-panel="diag"]    { grid-column: span 9; }
  .panel[data-panel="log"]     { grid-column: span 3; }
}

/* integrated workstation card */
.ws-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 6px 24px;
  align-items: center;
}
.ws-side { display: flex; flex-direction: column; gap: 16px; justify-content: center; }
.ws-info {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border-soft);
  margin-top: 14px;
  padding-top: 14px;
}
@media (max-width: 900px) {
  .ws-grid { grid-template-columns: 1fr; }
}
.panel {
  grid-column: span 12;
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  opacity: 0;
  animation: panel-in .45s cubic-bezier(.2, .8, .25, 1) forwards;
  transition: border-color .2s ease, transform .2s ease;
}
.panel:hover { border-color: #2f3c5c; }
.panel:nth-child(1) { animation-delay: .02s; }
.panel:nth-child(2) { animation-delay: .07s; }
.panel:nth-child(3) { animation-delay: .12s; }
.panel:nth-child(4) { animation-delay: .17s; }
.panel:nth-child(5) { animation-delay: .22s; }
.panel:nth-child(6) { animation-delay: .27s; }
.panel:nth-child(7) { animation-delay: .32s; }
.panel:nth-child(8) { animation-delay: .37s; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.col-5 { grid-column: span 5; }
.col-7 { grid-column: span 7; }
.col-12 { grid-column: span 12; }

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, .015);
}
.panel-head h3 {
  flex: 1;
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
}
.ph-icon {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--accent-soft);
  font-size: 15px;
}
.drag-grip {
  color: var(--faint);
  cursor: grab;
  font-size: 15px;
  padding: 2px 6px;
  border-radius: 6px;
  user-select: none;
}
.drag-grip:hover { color: var(--muted); background: var(--surface-2); }
.panel.dragging { opacity: .45; border-style: dashed; }
.ph-collapse {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 6px;
  transition: transform .2s ease;
}
.ph-collapse:hover { background: var(--surface-2); color: var(--text); }
.panel.collapsed .ph-collapse { transform: rotate(-90deg); }
.panel.collapsed .panel-body { display: none; }
.panel-body { padding: 14px 16px 16px; }

.bench-divider { height: 1px; background: var(--border-soft); margin: 14px 0; }
.bench-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}

/* arcade thumbnail cards */
.arcade-cards { display: flex; flex-direction: column; gap: 10px; }
.arcade-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.arcade-card:hover {
  transform: translateX(4px);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.ac-art {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 11px;
  font-size: 22px;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.ac-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ac-meta b { font-size: 14px; }
.ac-meta small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-hi { margin-left: auto; color: var(--muted); font-size: 11px; flex-shrink: 0; }
.ac-hi b { color: var(--accent); }
.ac-go { color: var(--accent); font-weight: 700; font-size: 12.5px; flex-shrink: 0; }

/* fullscreen arcade overlay */
.arcade-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 7, 12, .82);
  backdrop-filter: blur(10px);
  animation: fade-in .18s ease;
}
.arcade-modal[hidden] { display: none; }
.arcade-shell {
  width: min(1100px, 96vw);
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  animation: pop-in .28s cubic-bezier(.2, .9, .3, 1.15);
}
.arcade-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.arcade-top .game-scores { margin-left: auto; }

.arcade-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
}
.arcade-settings[hidden] { display: none; }
.set-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; font-weight: 600; color: var(--muted); }
.set-row input[type="range"] { width: 150px; accent-color: var(--accent); }
.lane-binds { display: flex; gap: 6px; flex-wrap: wrap; }
.lane-bind.binding { border-color: var(--warn); color: var(--warn); animation: pulse 1.2s ease infinite; }
.song-pick.active { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.arcade-hint { text-align: center; font-size: 12.5px; margin: 10px 0 0; }
.arcade-hint kbd {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-family: var(--mono);
  font-size: 11px;
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.92) translateY(14px); } }

@media (prefers-reduced-motion: reduce) {
  .panel, .arcade-modal, .arcade-shell { animation: none; opacity: 1; }
  .hero .pad-art { animation: none; }
}

.tester-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 18px;
  align-items: start;
}

/* controller visual */
.pad-visual svg { width: 100%; height: auto; display: block; }

.pad-visual .sv-body {
  fill: url(#cl-bodygrad);
  stroke: #2c3650;
  stroke-width: 2.5;
}
.pad-visual .sv-el {
  fill: #222c42;
  stroke: #39466b;
  stroke-width: 1.6;
  transition: fill .08s ease, stroke .08s ease;
}
.pad-visual .sv-el.pressed {
  fill: var(--accent);
  stroke: var(--accent);
  filter: drop-shadow(0 0 7px var(--accent));
}
.pad-visual .sv-trigfill {
  fill: var(--accent);
  pointer-events: none;
  filter: drop-shadow(0 0 6px var(--accent));
}
.pad-visual .sv-glyph { pointer-events: none; }
.pad-visual .sv-el.pressed + .sv-glyph text,
.pad-visual .sv-el.pressed + .sv-glyph { fill: #04121a !important; stroke: #04121a !important; }
.pad-visual .sv-stickbase { fill: #101622; }
.pad-visual .sv-label {
  fill: #5d6b85;
  font: 600 11px "Segoe UI", system-ui, sans-serif;
}

/* right-side panels */
.panel-stack { display: flex; flex-direction: column; gap: 18px; }

.sticks-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.stick-box { text-align: center; position: relative; }
.mute-btn {
  position: absolute;
  top: 4px; right: 4px;
  z-index: 2;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px 7px;
  font-size: 12px;
  cursor: pointer;
  opacity: .75;
  transition: opacity .15s ease, border-color .15s ease;
}
.mute-btn:hover { opacity: 1; border-color: var(--accent); }
.mute-btn.muted { border-color: var(--bad); opacity: 1; }
.mute-btn.inline { position: static; flex-shrink: 0; }
.stick-box canvas {
  width: 100%;
  max-width: 170px;
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}
.stick-box .vals { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 6px; }
.stick-box .vals b { color: var(--text); font-weight: 600; }
.stick-box .vals.range { font-size: 11px; margin-top: 2px; opacity: .8; }

.trigger-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.trig {
  display: flex;
  align-items: center;
  gap: 10px;
}
.trig .bar {
  flex: 1;
  height: 14px;
  border-radius: 7px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  overflow: hidden;
}
.trig .fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  border-radius: 7px;
  transition: width .05s linear;
}
.trig .lab { font-weight: 700; font-size: 13px; width: 26px; }
.trig .val { font-family: var(--mono); font-size: 12px; width: 44px; text-align: right; color: var(--muted); }

/* Break Room Arcade */
.game-wrap { display: flex; flex-direction: column; gap: 10px; }
.game-hud { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.game-scores b { color: var(--accent); }
.game-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.game-tab {
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font: 600 12.5px "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
}
.game-tab:hover { color: var(--text); }
.game-tab.active { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.snd-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.snd-check input { accent-color: var(--accent); }
#game-canvas {
  width: 100%;
  aspect-ratio: 700 / 280;
  border: 1px solid var(--border);
  border-radius: 12px;
  background:
    radial-gradient(400px 130px at 75% 0%, var(--accent-soft), transparent 70%),
    var(--bg-soft);
}

/* input event log */
.event-log {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--mono);
  font-size: 12.5px;
}
.event-log .ev {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 10px;
  border-radius: 7px;
  background: var(--bg-soft);
  color: var(--muted);
}
.event-log .ev b { color: var(--text); min-width: 90px; font-weight: 600; }
.event-log .ev .dir.down { color: var(--accent); }
.event-log .ev .dir.up { color: var(--muted); }
.event-log .ev .dt { margin-left: auto; }
.event-log .ev.chat { background: rgba(248, 113, 113, .08); }
.event-log .ev .chatflag { color: var(--bad); font-weight: 700; font-size: 11px; letter-spacing: .5px; }

/* diagnostics */
.diag-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.diag-result {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: var(--bg-soft);
  font-size: 14px;
  display: none;
}
.diag-result.show { display: block; }
.diag-result .verdict { font-weight: 700; font-size: 15px; }
.diag-result .verdict.ok { color: var(--ok); }
.diag-result .verdict.warn { color: var(--warn); }
.diag-result .verdict.bad { color: var(--bad); }
.diag-result table { margin-top: 8px; border-collapse: collapse; }
.diag-result td { padding: 2px 14px 2px 0; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

progress.diag-prog {
  width: 160px;
  height: 10px;
  accent-color: var(--accent);
}

/* buttons table */
.btn-table-wrap { overflow-x: auto; }
table.btn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.btn-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}
.btn-table td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--border-soft);
}
.btn-table tr.active-row td { background: var(--accent-soft); }
.btn-table .idx { font-family: var(--mono); color: var(--muted); width: 34px; }
.btn-table .val { font-family: var(--mono); width: 60px; }
.btn-table .cnt { font-family: var(--mono); width: 70px; color: var(--muted); }
.btn-table .meter {
  width: 130px;
  height: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  overflow: hidden;
}
.btn-table .meter i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 4px;
}
.btn-table .chatter { color: var(--bad); font-weight: 700; }

/* info strip */
.info-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.info-cell {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 10px 14px;
}
.info-cell .k { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.info-cell .v { font-family: var(--mono); font-size: 13px; margin-top: 2px; word-break: break-all; }

/* contextual tool links */
.tool-links { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- tools page ---------- */

.page-head { padding: 34px 0 8px; }
.page-head h1 { font-size: clamp(24px, 3.4vw, 32px); }
.page-head p { color: var(--muted); max-width: 700px; }

.anchor-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 26px;
}

.tool-section { --brand: var(--accent); --brand-soft: var(--accent-soft); margin-top: 34px; scroll-margin-top: 90px; }
.tool-section > h2 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.tool-section > h2::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 140px; height: 2px;
  background: var(--brand);
}
.tool-section > h2 .plat-dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 10px var(--brand); }

/* brand tinting per platform section */
.tool-section .tool-card { border-top: 3px solid var(--brand); }
.tool-section .tc-tag { color: var(--brand); }
.tool-section details.proc summary::before { color: var(--brand); }
.tool-section .btn:hover { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.brand-chip:hover { border-color: var(--brand); color: var(--text); text-decoration: none; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.tool-card { display: flex; flex-direction: column; gap: 10px; }
.tool-card h3 { font-size: 16px; margin: 0; }
.tool-card .tc-tag { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--accent); font-weight: 700; }
.tool-card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.tool-card .tc-foot { margin-top: auto; padding-top: 8px; }

details.proc {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--bg-soft);
  padding: 0;
  overflow: hidden;
}
details.proc summary {
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
details.proc summary::before { content: "▸"; color: var(--accent); transition: transform .15s; }
details.proc[open] summary::before { transform: rotate(90deg); }
details.proc ol {
  margin: 0;
  padding: 4px 18px 14px 34px;
  color: var(--muted);
  font-size: 13.5px;
}
details.proc ol li { margin: 5px 0; }
details.proc ol li b { color: var(--text); }

/* ---------- guides page ---------- */

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.guide-card { position: relative; overflow: hidden; }
.guide-card .g-icon { font-size: 30px; margin-bottom: 8px; }
.guide-card h3 { font-size: 16px; }
.guide-card p { color: var(--muted); font-size: 13.5px; margin: 0; }
.guide-card .soon {
  position: absolute;
  top: 14px; right: 14px;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border-soft);
  background: var(--bg-soft);
  padding: 22px 0;
  font-size: 13px;
  color: var(--muted);
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; }
.footer-links { display: flex; gap: 16px; }
.footer-credit { margin-left: auto; }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .tester-grid { grid-template-columns: 1fr; }
  .col-5, .col-7 { grid-column: span 12; }
  .header-inner { flex-wrap: wrap; }
  .site-nav { order: 3; width: 100%; justify-content: center; margin-left: 0; }
  .pad-status { margin-left: auto; }
  .footer-credit { margin-left: 0; }
  .detect-right { flex-wrap: wrap; white-space: normal; }
}

@media (max-width: 520px) {
  .sticks-row, .trigger-row { grid-template-columns: 1fr; }
  .brand-text small { display: none; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }
