/* Rey UI: design tokens + layout + components (docs/design/rey-final-design.pdf). */

/* ---- tokens -------------------------------------------------------------- */
:root {
  --bg: #f4f7fb; --surface: #ffffff; --surface-2: #f8fafc; --ink: #142235; --muted: #5f6f82; --line: #dfe5ee;
  --navy: #0b2545; --primary: #1f6feb; --primary-ink: #ffffff; --primary-soft: #e6efff;
  --csms: #6b4fd8; --csms-soft: #eeeafd; --sim: #b46a00; --sim-soft: #fff3dc;
  --ok: #12805c; --ok-soft: #e3f5ed; --danger: #c42b3c; --danger-soft: #fde8eb;
  --code-bg: #0f1d2e; --code-ink: #dbe7fb;
  --shadow: 0 6px 18px rgba(11, 37, 69, 0.10);
  --radius-s: 6px; --radius: 8px; --radius-l: 12px; --radius-xl: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --t-ui: 150ms; --t-cockpit: 250ms;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1726; --surface: #14233a; --surface-2: #182a44; --ink: #e3ecfa; --muted: #93a6c2; --line: #263d5f;
    --navy: #0a1a30; --primary: #4c8dff; --primary-soft: #1b3155; --csms: #a68bff; --csms-soft: #2a2550;
    --sim: #ffb547; --sim-soft: #3a2c12; --ok: #3ccf95; --ok-soft: #12342a; --danger: #ff6b7d; --danger-soft: #3d1a22;
    --shadow: 0 6px 18px rgba(0, 0, 0, 0.35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1726; --surface: #14233a; --surface-2: #182a44; --ink: #e3ecfa; --muted: #93a6c2; --line: #263d5f;
  --navy: #0a1a30; --primary: #4c8dff; --primary-soft: #1b3155; --csms: #a68bff; --csms-soft: #2a2550;
  --sim: #ffb547; --sim-soft: #3a2c12; --ok: #3ccf95; --ok-soft: #12342a; --danger: #ff6b7d; --danger-soft: #3d1a22;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.35); color-scheme: dark;
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 13px; color: var(--ink); background: var(--bg); }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); }
code, .mono { font-family: var(--mono); }
a { color: var(--primary); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- shared controls --------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 6px 11px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background var(--t-ui); }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 3px 8px; font-size: 11px; }
.btn.ghost { background: transparent; border-color: transparent; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.sim { background: var(--sim-soft); color: var(--sim); border-color: transparent; }
.chip.csms { background: var(--csms-soft); color: var(--csms); border-color: transparent; }
.chip.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.seg button { border: 0; background: transparent; border-radius: var(--radius-s); padding: 3px 10px; font-size: 11px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.label { font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); }
.field { display: grid; gap: 3px; }
.field input, .field select { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px 8px; font-size: 12px; width: 100%; }
.field input:disabled, .field select:disabled { opacity: .65; }
.light-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #9aa8ba; }
.light-dot.on { background: #12d18e; box-shadow: 0 0 0 3px rgba(18, 209, 142, .2); }
.light-dot.sim { background: #e39a12; }
.kbd { display: inline-block; min-width: 18px; text-align: center; font-size: 11px; font-weight: 700; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--surface); }

/* ---- shell ---------------------------------------------------------------------- */
.app { height: 100%; display: flex; flex-direction: column; }
.app > .topbar, .app > .banner, .app > .foot { flex: none; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 7px 12px; background: var(--navy); color: #fff; }
.topbar .logo-h1 { margin: 0; font: inherit; display: flex; }
.topbar .logo { display: flex; align-items: center; gap: 7px; font-weight: 800; font-size: 15px; color: #fff; text-decoration: none; }
.topbar .logo b { width: 24px; height: 24px; border-radius: 7px; background: #1f6feb; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.topbar .sp { flex: 1; }
.topbar .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; }
.topbar .btn:hover { background: rgba(255, 255, 255, .18); }
.station-btn { display: inline-flex; align-items: center; gap: 7px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .28); color: #fff; border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 700; cursor: pointer; }
.vsw { display: inline-flex; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .28); border-radius: 9px; padding: 2px; gap: 2px; }
.vsw button { border: 0; background: transparent; color: #c6d6f2; font-size: 12px; font-weight: 700; padding: 4px 13px; border-radius: 7px; cursor: pointer; }
.vsw button[aria-pressed="true"] { background: #fff; color: #0b2545; }
.banner { padding: 7px 14px; font-size: 12px; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); }
.banner.wake { background: var(--sim-soft); color: var(--ink); }
.banner .sp { flex: 1; }

.body { flex: 1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; min-height: 0; }
.body > .rail { grid-column: 1; } .body > .main { grid-column: 2; } .body > .inspector { grid-column: 3; }
.show-present { display: none !important; }
.app.present .show-present { display: inline-flex !important; }
.rail { width: 196px; background: var(--surface); border-right: 1px solid var(--line); padding: 8px 6px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; transition: width var(--t-ui); }
.rail .grp { font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 9px 3px; }
.rail button { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; padding: 7px 9px; border-radius: var(--radius); cursor: pointer; text-align: left; font-size: 12.5px; white-space: nowrap; }
.rail button:hover { background: var(--surface-2); }
.rail button[aria-current="page"] { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.rail .ic { width: 18px; text-align: center; flex: none; }
.rail .bottom { margin-top: auto; }
.app.rail-collapsed .rail { width: 52px; }
.app.rail-collapsed .rail .grp, .app.rail-collapsed .rail .txt { display: none; }
.app.rail-collapsed .rail button { justify-content: center; padding: 8px 0; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.foot { display: flex; gap: 12px; justify-content: space-between; padding: 4px 14px; font-size: 11px; color: var(--muted); background: var(--surface); border-top: 1px solid var(--line); }
.foot a, .linkbtn { color: var(--muted); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }

/* ---- cockpit -------------------------------------------------------------------- */
.cockpit { position: relative; flex: none; min-height: var(--cockpit-h, 400px); display: flex; align-items: center; justify-content: center; padding: 34px 16px 0; overflow: hidden; }
.cockpit .scale { display: flex; align-items: center; justify-content: center; transform-origin: center bottom; }
.drive { position: absolute; left: 14px; top: 10px; display: flex; align-items: center; gap: 7px; z-index: 3; }
.session-meta { position: absolute; right: 14px; top: 12px; font-size: 11px; color: var(--muted); z-index: 3; }
.bubble { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); background: #0b2545; color: #fff; font-size: 12px; font-weight: 600; padding: 7px 12px; border-radius: 9px; box-shadow: var(--shadow); white-space: nowrap; z-index: 4; max-width: calc(100% - 420px); overflow: hidden; text-overflow: ellipsis; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; width: 10px; height: 10px; background: #0b2545; transform: rotate(45deg); }
.app.no-bubble .bubble { display: none; }

.ev-card, .csms-card { width: 290px; min-width: 0; flex: none; padding: 11px 13px; display: flex; flex-direction: column; gap: 7px; align-self: center; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-head b { font-size: 13px; }
.ev-top { display: flex; align-items: center; gap: 8px; }
.ev-top .spec { font-size: 11px; line-height: 1.45; }
.car-btn { border: 0; background: transparent; padding: 0; font-weight: 800; font-size: 12px; cursor: pointer; color: var(--ink); }
.battery { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 3px; position: relative; }
.battery > i { display: block; height: 100%; background: #12a874; transition: width var(--t-cockpit); }
.battery > em { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); opacity: .5; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; }
.boxed { border: 1px solid var(--line); border-radius: var(--radius); padding: 5px 8px; }
.cable { width: 100%; display: flex; align-items: center; justify-content: space-between; border: 0; background: var(--surface-2); border-radius: var(--radius); padding: 7px 9px; cursor: pointer; font-size: 12px; font-weight: 700; }
.switch { width: 30px; height: 17px; border-radius: 99px; background: #b8c2cf; position: relative; display: inline-block; transition: background var(--t-ui); }
.switch::after { content: ''; position: absolute; left: 2px; top: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: left var(--t-ui); }
.switch.on { background: var(--ok); }
.switch.on::after { left: 15px; }
.cable:disabled { opacity: .55; cursor: not-allowed; }

.link { width: 70px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 5px; align-self: center; }
.link .ln { width: 100%; height: 2px; background: repeating-linear-gradient(90deg, #b8c2cf 0 5px, transparent 5px 10px); }
.link.live .ln { background: #12a874; }
.link.sim .ln { background: repeating-linear-gradient(90deg, var(--sim) 0 6px, transparent 6px 10px); }
.link .sub { font-size: 9.5px; color: var(--muted); text-align: center; line-height: 1.2; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stat { background: var(--surface-2); border-radius: 7px; padding: 5px 8px; }
.stat b { font-size: 15px; display: block; }
.connect { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
.connect > .seg { justify-self: start; }
.connect .hint { font-size: 10.5px; color: var(--muted); }
.connect-error { border: 1px solid var(--line); border-left: 3px solid var(--danger); border-radius: var(--radius); padding: 7px 9px; font-size: 11.5px; display: grid; gap: 5px; }
.connect-error .ecode { font-family: var(--mono); font-size: 10px; color: var(--muted); }

/* the charger pedestal */
.pedestal { position: relative; width: 262px; height: 330px; flex: none; align-self: flex-end; margin-bottom: 6px; }
.pedestal svg.body { position: absolute; inset: 0; }
.pedestal .screen { position: absolute; left: 82px; top: 64px; width: 134px; height: 140px; color: #fff; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; }
.pedestal .screen .t { font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.pedestal .screen .s { font-size: 9px; color: #9fb3d1; line-height: 1.3; padding: 0 6px; }
.pedestal .screen .metrics { display: grid; grid-template-columns: 1fr 1fr 1fr; width: 100%; gap: 2px; }
.pedestal .screen .metrics small { display: block; font-size: 7.5px; color: #9fb3d1; }
.pedestal .screen .metrics b { font-size: 12px; }
.pedestal .screen .why { font-size: 8px; color: #ffd98a; }
.pedestal .soft { margin-top: auto; width: 100%; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #1d3a63; padding: 2px 4px 0; font-size: 8px; color: #9fb3d1; }
.pedestal .soft button { border: 0; background: transparent; color: #cfe0ff; font-size: 9px; font-weight: 700; cursor: pointer; padding: 1px 3px; }
.pedestal .hit { position: absolute; border: 0; background: transparent; cursor: pointer; border-radius: 9px; }
.pedestal .hit:hover { background: rgba(143, 184, 255, .12); }
.pedestal .hit:disabled { cursor: not-allowed; }
.pedestal .reader { left: 104px; top: 218px; width: 90px; height: 38px; }
.pedestal .stop { left: 134px; top: 260px; width: 30px; height: 30px; border-radius: 50%; }
.pedestal .conn-label { position: absolute; left: 4px; top: 130px; font-size: 9px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.pedestal .card-pick { position: absolute; left: 198px; top: 226px; font-size: 9.5px; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 2px 8px; cursor: pointer; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.led-pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.pending { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--primary-soft); border-top: 1px solid var(--line); font-size: 12px; }
.pending .what { flex: 1; min-width: 0; }
.pending textarea { width: 100%; min-height: 110px; font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; margin-top: 6px; }
.pending pre { margin: 6px 0 0; max-height: 140px; overflow: auto; }

.divider { flex: none; height: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--surface); border-top: 1px solid var(--line); cursor: row-resize; user-select: none; }
.divider i { width: 44px; height: 4px; border-radius: 99px; background: var(--line); }
.divider button { border: 0; background: transparent; font-size: 10px; color: var(--muted); cursor: pointer; }

.strip { flex: none; display: flex; align-items: center; gap: 10px; padding: 7px 12px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 12px; }
.strip .sp { flex: 1; }
.strip .seg-line { width: 30px; height: 2px; }

/* ---- workspace pages ---------------------------------------------------------------- */
.workspace { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 14px 16px; }
.ws-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ws-head h2 { margin: 0; font-size: 17px; }
.ws-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.ws-card { padding: 12px 14px; display: grid; gap: 8px; align-content: start; }
.ws-card h3 { margin: 0; font-size: 13px; }
.list { display: grid; gap: 6px; }
.item { border: 1px solid var(--line); border-left: 3px solid var(--primary); border-radius: var(--radius); padding: 7px 10px; font-size: 12px; background: var(--surface); }
.item.dim { border-left-color: var(--line); opacity: .8; }
.item.cert summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.item.cert summary::-webkit-details-marker { display: none; }
.item.cert summary .label::before { content: '▸ '; }
.item.cert[open] summary .label::before { content: '▾ '; }
.item.cert[open] summary { margin-bottom: 4px; }
.item.cert summary .label { flex-basis: 100%; }
.item.root { border-left-color: var(--primary); } .item.intermediate { border-left-color: var(--sim); } .item.leaf { border-left-color: var(--ok); }
.kv { display: grid; grid-template-columns: 1fr minmax(120px, 220px); gap: 6px 10px; align-items: center; }
.kv > span > input { width: 100%; box-sizing: border-box; }
.kv label .chip { font-family: var(--sans, inherit); font-size: 9.5px; padding: 1px 6px; margin-left: 4px; }
.kv label { font-family: var(--mono); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv input { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 4px 6px; font-size: 12px; text-align: right; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.chart svg { width: 100%; height: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.chart .grid-line { stroke: var(--line); }
.chart .limit { fill: none; stroke: var(--primary); stroke-width: 2; }
.chart .setpoint { fill: none; stroke: #a78bfa; stroke-width: 2; stroke-dasharray: 5 3; }
.chart .area { fill: var(--primary); opacity: .1; }
.chart text { fill: var(--muted); font-size: 9px; }
.code { background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius); padding: 10px; font-family: var(--mono); font-size: 11px; white-space: pre-wrap; word-break: break-word; margin: 0; }

/* ---- conversation dock ----------------------------------------------------------------- */
.dock { flex: 1 1 auto; min-height: 120px; display: flex; flex-direction: column; background: var(--surface); position: relative; }
.app.ws-page .dock { flex: 0 0 34%; border-top: 1px solid var(--line); }
.dock-bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dock-bar b { font-size: 12px; }
.dock-bar .sp { flex: 1; }
.dock-bar input[type="search"] { border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 8px; font-size: 11.5px; width: 180px; }
.log { flex: 1; overflow: auto; font-size: 12px; }
/* An opened capture: a read-only view in place of the live conversation. */
.capture-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 12px; }
.capture-bar .what { flex: 1 1 240px; min-width: 0; }
.pop .hint { font-size: 11.5px; color: var(--muted); max-width: 300px; line-height: 1.4; }
.pop input[type="file"] { font-size: 11.5px; max-width: 280px; }
.lrow { display: grid; grid-template-columns: 64px 112px 1fr auto; gap: 8px; align-items: start; padding: 6px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.lrow:hover { background: var(--surface-2); }
.lrow[aria-selected="true"] { background: var(--primary-soft); }
.lrow .t { font-family: var(--mono); font-size: 10.5px; color: var(--muted); padding-top: 2px; }
.lrow .what .x { color: var(--muted); }
.lrow .tail { font-family: var(--mono); font-size: 10.5px; color: var(--muted); padding-top: 2px; }
.lrow.note { cursor: default; }
.lrow.note.v2g { cursor: pointer; }
.lrow.note .what { color: var(--muted); font-style: italic; }
.lrow.group .what { color: var(--muted); }
.lrow.divider-row { grid-template-columns: 1fr; text-align: center; font-size: 11px; color: var(--muted); cursor: default; background: var(--surface-2); }
.dir { font-size: 9.5px; font-weight: 800; padding: 2px 6px; border-radius: 4px; text-align: center; line-height: 1.25; }
.dir.out { background: var(--primary-soft); color: var(--primary); }
.dir.in { background: var(--csms-soft); color: var(--csms); }
.dir.ev { background: var(--sim-soft); color: var(--sim); }
.dir.err { background: var(--danger-soft); color: var(--danger); }
.raw pre { margin: 6px 0 0; }
.jump { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: #0b2545; color: #fff; border: 0; border-radius: 99px; padding: 6px 14px; font-size: 12px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); }
.empty { padding: 26px; text-align: center; color: var(--muted); font-size: 12.5px; }
.t-key { color: #8fb8ff; } .t-str { color: #a8e6b4; } .t-num { color: #ffd98a; } .t-bool, .t-nul { color: #ff9eb0; }

/* ---- inspector ------------------------------------------------------------------------ */
.inspector { width: 340px; background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; overflow: auto; }
.inspector .checks { display: grid; gap: 4px; font-size: 12px; }

/* ---- views ------------------------------------------------------------------------------ */
.app[data-view="workbench"] .cockpit, .app[data-view="workbench"] .divider { display: none; }
.app[data-view="cockpit"] .strip { display: none; }
.app.ws-page .cockpit, .app.ws-page .divider, .app.ws-page .pending { display: none; }
.app.ws-page .strip { display: flex; }

/* Present: full screen, dark, cockpit + story only, larger type */
.app.present { --cockpit-h: 62vh; }
.app.present .rail, .app.present .inspector, .app.present .foot, .app.present .topbar .hide-present, .app.present .dock-bar .hide-present { display: none !important; }
.app.present .cockpit .scale { zoom: 1.15; }
.app.present .bubble { font-size: 15px; padding: 9px 16px; }
.app.present .log { font-size: 14px; }

/* ---- popovers + dialogs -------------------------------------------------------------- */
.pop { position: fixed; z-index: 50; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow); padding: 6px; display: grid; gap: 2px; max-height: calc(100vh - 16px); overflow-y: auto; }
.pop .label { padding: 6px 8px 2px; }
.pop button.mi { border: 0; background: transparent; text-align: left; padding: 7px 9px; border-radius: var(--radius); cursor: pointer; font-size: 12.5px; display: flex; justify-content: space-between; gap: 12px; }
.pop button.mi:hover { background: var(--surface-2); }
.pop button.mi:disabled { opacity: .45; cursor: not-allowed; }
.pop .body-pad { padding: 6px 8px; display: grid; gap: 8px; }
dialog { border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 18px 20px; background: var(--surface); color: var(--ink); max-width: 520px; width: calc(100% - 32px); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(5, 15, 30, .45); }
dialog h2 { margin: 0 0 10px; font-size: 16px; }
dialog .prose { font-size: 13px; line-height: 1.5; }
dialog .prose p { margin: 0 0 10px; }
.roadmap { list-style: none; padding: 0; margin: 10px 0 14px; display: grid; gap: 6px; font-size: 13px; }
.roadmap li { padding-left: 22px; position: relative; }
.roadmap li::before { content: '○'; position: absolute; left: 2px; color: var(--muted); }
.roadmap li.done::before { content: '✓'; color: var(--ok, #12a26b); font-weight: 700; }
.toasts { position: fixed; right: 16px; bottom: 40px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--danger); border-radius: var(--radius); padding: 8px 12px; box-shadow: var(--shadow); font-size: 12px; max-width: 380px; }
.toast.info { border-left-color: var(--primary); }

/* ---- narrower screens ------------------------------------------------------------------- */
@media (max-width: 1439px) { .cockpit .scale { zoom: .9; } }
@media (max-width: 1279px) {
  .app .rail { width: 52px; } .app .rail .grp, .app .rail .txt { display: none; } .app .rail button { justify-content: center; padding: 8px 0; }
  .inspector { position: absolute; right: 0; top: 0; bottom: 0; z-index: 20; box-shadow: var(--shadow); }
  .cockpit .scale { zoom: .8; }
}
@media (max-width: 1023px) {
  .narrow-note { display: block !important; }
  .cockpit { padding-top: 44px; }
  .cockpit .scale { zoom: 1; flex-direction: column; gap: 10px; }
  .link { transform: rotate(90deg); margin: 14px 0; }
  .bubble { max-width: calc(100% - 20px); }
  .main { overflow: auto; }
}

/* ---- car certificates (Plug & Charge) ---- */
dialog.wide { max-width: 760px; max-height: calc(100vh - 32px); overflow: auto; }
dialog.wide h3 { font-size: 13px; margin: 16px 0 6px; }
.pki-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pki-head h2 { margin: 0; }
.pki-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .pki-grid { grid-template-columns: 1fr; } }
.pki-grid h3 { margin-top: 4px; }
.pki-needs { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 3px; font-size: 12.5px; }
.pki-needs .ok { color: var(--ok); }
.pki-needs .miss { color: var(--danger); }
.pki-needs .opt { color: var(--muted); }
.pki-drop { display: block; position: relative; border: 2px dashed var(--line); border-radius: var(--radius-xl, 12px); padding: 16px; text-align: center; font-size: 13px; cursor: pointer; margin-top: 8px; }
.pki-drop:hover, .pki-drop.over { border-color: var(--primary, #1f6feb); background: var(--primary-soft, #eaf2ff); }
.pki-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pki-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.pki-errors { margin: 6px 0; padding-left: 18px; color: var(--danger); font-size: 12px; }
.pki-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; font-size: 12.5px; }
.pki-row.picked { border-color: var(--primary, #1f6feb); }
.pki-pick { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; min-width: 0; }
.pki-pick > span { min-width: 0; overflow-wrap: anywhere; }
.pki-strict { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; margin-top: 14px; }
.pki-privacy { font-size: 12px; background: var(--sim-soft); color: var(--ink); border-radius: 8px; padding: 8px 10px; margin: 12px 0 0; }
.pki-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.pki-foot form { margin: 0; }
.pki-foot .sp { flex: 1; }
.chip.bad { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.chip.warn { background: var(--sim-soft); color: var(--sim); border-color: transparent; }
.small { font-size: 11.5px; }

/* ---- Sequence view: EV, Charger and CSMS lifelines, one arrow per frame ---- */
.log.seq-view .lrow.seq { grid-template-columns: 64px 1fr 72px; padding-top: 2px; padding-bottom: 2px; border-bottom: 0; }
.lrow.seq .lanes { position: relative; display: grid; grid-template-columns: 1fr 1fr; min-height: 30px; align-items: center;
  background: linear-gradient(var(--line), var(--line)) 0 0 / 1px 100% no-repeat,
              linear-gradient(var(--line), var(--line)) 50% 0 / 1px 100% no-repeat,
              linear-gradient(var(--line), var(--line)) 100% 0 / 1px 100% no-repeat; }
.lrow.seq-head { position: sticky; top: 0; z-index: 1; background: var(--surface); cursor: default; border-bottom: 1px solid var(--line); }
.lrow.seq-head .lanes { grid-template-columns: 1fr 1fr 1fr; background: none; min-height: 0; font-size: 11px; font-weight: 700; color: var(--muted); }
.lrow.seq-head .lane:nth-child(1) { text-align: left; } .lrow.seq-head .lane:nth-child(2) { text-align: center; } .lrow.seq-head .lane:nth-child(3) { text-align: right; }
.lrow.seq .arrow { grid-column: 2; display: grid; gap: 1px; padding: 0 8px; min-width: 0; }
.lrow.seq .arrow .what { font-size: 11.5px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow.seq .arrow i { position: relative; display: block; border-top: 2px solid var(--primary); height: 0; }
.lrow.seq .arrow.left i { border-top-color: var(--csms); }
.lrow.seq .arrow.reply i { border-top-style: dashed; }
.lrow.seq .arrow.error i { border-top-color: var(--danger); }
.lrow.seq .arrow i::after { content: ''; position: absolute; top: -6px; border: 5px solid transparent; }
.lrow.seq .arrow.right i::after { right: -2px; border-left: 7px solid var(--primary); border-right: 0; }
.lrow.seq .arrow.left i::after { left: -2px; border-right: 7px solid var(--csms); border-left: 0; }
.lrow.seq .arrow.error.right i::after { border-left-color: var(--danger); }
.lrow.seq .arrow.error.left i::after { border-right-color: var(--danger); }
.lrow.seq.note { cursor: default; }
.lrow.seq .snote { font-size: 11px; font-style: italic; color: var(--muted); padding: 2px 8px; min-width: 0; }
.lrow.seq .snote.ev { grid-column: 1; margin: 2px 6px; border: 1px solid var(--sim); border-radius: 6px; background: var(--sim-soft); color: var(--ink); font-style: normal; }
.lrow.seq .snote.cp { grid-column: 1 / 3; text-align: center; }
/* A car ↔ charger exchange: the request to the charger, the answer dashed back (EV and Charger lanes). */
.lrow.seq .arrow.ev { grid-column: 1; cursor: pointer; }
.lrow.seq .arrow.ev i { border-top-color: var(--sim); }
.lrow.seq .arrow.ev i.back { border-top-style: dashed; margin-top: 4px; }
.lrow.seq .arrow.ev i.go::after { right: -2px; border-left: 7px solid var(--sim); border-right: 0; }
.lrow.seq .arrow.ev i.back::after { left: -2px; border-right: 7px solid var(--sim); border-left: 0; }

/* EV & contracts: the protocols the car speaks */
label.speaks { display: inline-flex; flex-direction: row; gap: 5px; align-items: center; font-size: 12.5px; white-space: nowrap; width: auto; }
label.speaks input { width: auto; margin: 0; }

/* Explain: every problem's code and what to check (public/js/explain.js) */
.explain-btn { display: inline-flex; align-items: center; justify-content: center; margin-left: 6px; padding: 1px 8px; border: 1px solid var(--danger); border-radius: 999px; background: var(--danger-soft); color: var(--danger); font-size: 10.5px; font-weight: 700; line-height: 1.5; white-space: nowrap; vertical-align: middle; cursor: pointer; }
.explain-btn:hover { background: var(--surface); }
.explain-btn.compact { width: 18px; height: 18px; padding: 0; font-size: 11px; line-height: 1; }
@media (pointer: coarse) { .explain-btn.compact { width: 26px; height: 26px; } }
.toast .explain-btn { margin-left: 8px; }
.pki-errors + .explain-btn { margin: 0 0 8px; }
.pedestal .screen .explain-btn { margin: 3px 0 0; padding: 0 7px; font-size: 9px; background: transparent; color: #ffb3bd; border-color: #ff8a98; }
.connect-error .connect-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.connect-error .connect-actions:empty { display: none; }
.connect-error .connect-actions .explain-btn { margin-left: 0; }
.explain-dialog { max-width: 600px; max-height: calc(100vh - 32px); overflow: auto; }
.explain-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.explain-code { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-s); background: var(--danger-soft); color: var(--danger); user-select: all; }
.explain h3, .explain h4 { margin: 12px 0 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.explain p { margin: 0 0 6px; overflow-wrap: anywhere; }
.explain ul, .explain ol { margin: 0 0 6px; padding-left: 20px; }
.explain li { margin: 3px 0; overflow-wrap: anywhere; }
.explain-side { display: flex; gap: 8px; align-items: baseline; }
.codes-search { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 10px; margin: 2px 0 8px; }
.codes-family { margin: 14px 0 4px; font-size: 12px; color: var(--muted); }
.code-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; margin: 4px 0; background: var(--surface); }
.code-item summary { cursor: pointer; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.code-item summary code { font-weight: 700; color: var(--danger); }
.code-item .explain { margin-top: 6px; }
.battery > em.min { background: #a68bff; opacity: .9; }
.seg [data-flow] { white-space: nowrap; }

/* ---- Test suite (public/js/testsuite.js) ------------------------------------------------------ */
.app[data-view="tests"] .cockpit, .app[data-view="tests"] .divider, .app[data-view="tests"] .strip,
.app[data-view="tests"] .pending, .app[data-view="tests"] .workspace, .app[data-view="tests"] .dock { display: none; }
.testsuite { overflow: auto; flex: 1; min-height: 0; }
.vsw button.running { background: var(--csms); color: #fff; display: inline-flex; align-items: center; gap: 6px; }
.vsw button.running[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff inset; background: var(--csms); color: #fff; }
.spin { width: 10px; height: 10px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: ts-spin 1s linear infinite; }
@keyframes ts-spin { to { transform: rotate(360deg); } }
/* While a run uses the charger, the Cockpit and Workbench only watch. */
.ts-band { display: flex; align-items: center; gap: 10px; background: var(--csms); color: #fff; padding: 7px 14px; font-size: 12.5px; flex-wrap: wrap; }
.ts-band[hidden] { display: none; }
.ts-band .btn { color: var(--ink); }
.ts-band .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .6); background: transparent; }
.ts-band.flash { animation: ts-flash .6s ease 2; }
@keyframes ts-flash { 50% { filter: brightness(1.35); } }
.testing .main::after { content: ''; position: absolute; inset: 0; border: 3px solid var(--csms); pointer-events: none; z-index: 30; }
.app.testing[data-view="tests"] .main::after { border-width: 2px; }
.testing .cockpit .hit::after { content: '🔒'; position: absolute; top: 2px; right: 2px; font-size: 11px; line-height: 1; }
.testing .cockpit .btn, .testing .cockpit button:not(.explain-btn), .testing .workspace button:not(.explain-btn):not([data-ts]), .testing .pending button { opacity: .5; cursor: not-allowed; }
.testing .cockpit .btn::before, .testing .workspace .btn:not(.explain-btn)::before { content: '🔒 '; font-size: .85em; }
.testing .cockpit input, .testing .cockpit select, .testing .workspace input, .testing .workspace select, .testing .workspace textarea { pointer-events: none; opacity: .6; }

.ts-page { padding: 16px 18px 40px; max-width: 1180px; margin: 0 auto; display: grid; gap: 14px; align-content: start; font-size: 13px; }
.ts-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ts-h, .ts-title { font-size: 18px; font-weight: 800; margin: 0; }
.ts-switch select { font-size: 16px; font-weight: 800; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; background: var(--surface); color: var(--ink); max-width: 520px; }
.ts-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.ts-card h3, .ts-setup h3 { margin: 0 0 8px; font-size: 14px; }
.ts-hero { text-align: center; padding: 26px 18px; }
.ts-hero h2 { font-size: 21px; margin: 8px 0; }
.ts-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ts-row.center { justify-content: center; }
.ts-row.small { font-size: 11.5px; }
.ts-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.ts-cols.wide { grid-template-columns: 1.3fr 1fr; }
.ts-big { font-size: 30px; font-weight: 800; line-height: 1; }
.ts-bar { display: flex; height: 8px; border-radius: 5px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); margin: 8px 0 6px; }
.ts-bar i, .ts-legend i, .ts-hist i { display: block; }
.ts-bar .o, .ts-legend .o, .ts-hist .ok { background: var(--ok); }
.ts-bar .f, .ts-legend .f, .ts-hist .fail { background: var(--danger); }
.ts-bar .n, .ts-legend .n, .ts-hist .ns { background: #e6a23c; }
.ts-bar .x, .ts-legend .x, .ts-hist .nr { background: #cfd8e3; }
.ts-legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.ts-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ts-legend i { width: 10px; height: 10px; border-radius: 3px; }
.ts-score { display: grid; grid-template-columns: 1fr 320px; gap: 14px; align-items: start; }
.ts-score > div { display: grid; gap: 12px; }
.ts-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ts-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.ts-tile.dash { border-style: dashed; background: var(--surface-2); color: var(--muted); }
.ts-tile.stale { opacity: .6; }
.ts-tile-btn { background: none; border: 0; padding: 0; text-align: left; color: inherit; cursor: pointer; font: inherit; }
.ts-tile-btn:hover b { text-decoration: underline; }
.ts-fixrow { padding: 8px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.ts-fixrow:last-child { border-bottom: 0; }
.ts-link { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; text-align: left; }
.ts-link.strong { color: var(--ink); font-weight: 800; }
.ts-fixrow .ts-link { color: var(--ink); font-weight: 700; }
.delta { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; }
.delta.up { background: var(--ok-soft); color: var(--ok); }
.delta.down { background: var(--danger-soft); color: var(--danger); }
.chip.c-rey { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.chip.c-both { background: #e2f3fa; color: #0b6a8f; border-color: transparent; }
.chip.c-you { background: var(--csms-soft); color: var(--csms); border-color: transparent; }
.chip.c-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.c-fail { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.chip.c-ns { background: var(--sim-soft); color: var(--sim); border-color: transparent; }
.chip.c-nr { background: var(--surface-2); color: var(--muted); }
.chip.c-run { background: var(--primary); color: #fff; border-color: transparent; }
.ts-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface); border: 2px solid var(--primary); border-radius: 12px; padding: 10px 14px; }
.ts-list { display: grid; gap: 8px; }
.ts-cat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.ts-catrow, .ts-testrow, .ts-trow { display: flex; align-items: center; gap: 9px; padding: 8px 12px; }
.ts-tests { border-top: 1px solid var(--line); }
.ts-testrow { padding-left: 34px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.ts-testrow:last-child { border-bottom: 0; }
.ts-testrow.dim span:first-of-type { color: var(--muted); }
.ts-box { width: 17px; height: 17px; border: 2px solid #9aa9bd; border-radius: 5px; display: inline-grid; place-items: center; font-size: 11px; color: #fff; flex: none; background: var(--surface); cursor: pointer; padding: 0; line-height: 1; }
.ts-box.on, .ts-box.half { background: var(--primary); border-color: var(--primary); }
.ts-info { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #9aa9bd; color: var(--muted); font: italic 700 11px Georgia, serif; display: inline-grid; place-items: center; background: var(--surface); cursor: pointer; padding: 0; flex: none; }
.ts-info:hover, .ts-info:focus-visible { background: var(--navy); color: #fff; border-color: var(--navy); }
.ts-infocard { max-width: 380px; padding: 4px 2px; font-size: 12.5px; display: grid; gap: 4px; }
.ts-infocard dl { display: grid; grid-template-columns: 86px 1fr; gap: 5px 8px; margin: 6px 0 0; }
.ts-infocard dt { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding-top: 1px; }
.ts-infocard dd { margin: 0; }
.ts-infocard ol { margin: 0; padding-left: 16px; }
.ts-setup { display: grid; gap: 8px; align-content: start; }
.ts-set { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: var(--surface); display: grid; gap: 5px; }
.ts-set.done { background: var(--ok-soft); border-color: transparent; }
.ts-set.todo { border: 2px solid #e6a23c; }
.ts-set.skipped { background: var(--surface-2); color: var(--muted); }
.ts-set .label, .ts-page .label { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ts-input { display: flex; gap: 6px; align-items: center; }
.ts-input input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-family: var(--mono); background: var(--surface); color: var(--ink); }
.ts-confirm { display: flex; align-items: center; gap: 6px; }
.ts-warn { background: var(--sim-soft); color: var(--sim); border-radius: 8px; padding: 8px 10px; font-size: 12px; }
.ts-foot { display: flex; align-items: center; gap: 10px; position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; border-top: 1px solid var(--line); }
.ts-progress { height: 7px; width: 220px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.ts-progress i { display: block; height: 100%; background: var(--primary); }
.ts-runlay { display: grid; grid-template-columns: 260px 1fr; gap: 14px; align-items: start; }
.ts-rail { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px; max-height: 70vh; overflow: auto; }
.ts-rg { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 8px 6px 3px; }
.ts-rg.you { color: var(--csms); }
.ts-r { display: flex; gap: 7px; align-items: center; padding: 4px 6px; border-radius: 6px; }
.ts-r.cur { background: var(--csms-soft); font-weight: 700; }
.ts-page .ic { width: 16px; text-align: center; font-weight: 900; flex: none; }
.ts-page .ic.ok { color: var(--ok); } .ts-page .ic.fail { color: var(--danger); } .ts-page .ic.ns { color: var(--sim); } .ts-page .ic.nr, .ts-page .ic.pend { color: #a7b4c6; } .ts-page .ic.cur { color: var(--csms); }
.ts-curtitle { font-size: 19px; margin: 6px 0 4px; }
.ts-live { font-family: var(--mono); font-size: 11.5px; background: #0f1d2e; color: #dbe7fb; border-radius: 8px; padding: 9px 11px; line-height: 1.75; margin: 6px 0 8px; }
.ts-live .a { color: #8fb8ff; } .ts-live .b { color: #c3b2ff; } .ts-live .g { color: #6ee7b7; } .ts-live .r { color: #ff9aa8; }
.ts-turn { background: var(--surface); border: 3px solid var(--csms); border-radius: 14px; padding: 16px 18px; display: grid; gap: 8px; }
.ts-turn.late { border-color: #e6a23c; }
.ts-turn h3 { font-size: 19px; margin: 2px 0; }
.ts-count { font-family: var(--mono); font-size: 24px; font-weight: 800; color: var(--csms); }
.ts-turn.late .ts-count { color: var(--sim); }
.ts-steps { margin: 0; padding-left: 20px; font-size: 14px; display: grid; gap: 4px; }
.ts-checks { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 3px; }
.ts-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ts-choice { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--surface); text-align: left; cursor: pointer; display: grid; gap: 2px; font: inherit; color: inherit; }
.ts-choice:hover { border-color: var(--primary); }
.ts-paused { border: 2px solid var(--danger); display: grid; gap: 8px; }
.ts-catlist { padding: 0; }
.ts-trow { border-bottom: 1px solid var(--line); }
.ts-trow.failed { background: var(--danger-soft); }
.ts-hist { display: inline-flex; gap: 3px; }
.ts-hist i { width: 10px; height: 10px; border-radius: 3px; }
.ts-detail { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; padding: 10px 14px 12px 40px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.ts-connect .csms-card { width: auto; }
@media (max-width: 900px) {
  .ts-cols, .ts-cols.wide, .ts-score, .ts-runlay, .ts-choices { grid-template-columns: 1fr; }
  .ts-detail { grid-template-columns: 1fr; padding-left: 14px; }
}
