/* Layout: sticky header; left a category tree (profiles fold out), right one column of cards per view */
:root {
  --bg: #f3f5f8; --panel: #ffffff; --panel-2: #f7f9fb; --text: #18202c; --muted: #637083; --border: #dde3ea;
  --accent: #1f6feb; --accent-soft: #e6effd; --button: #1f6feb; --error: #c2410c; --warn: #9a5b00;
  --warn-soft: #fbf1df; --lift: #2f9e44; --duty: #8b5cf6; --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141a; --panel: #171d25; --panel-2: #1c2430; --text: #e4e9ef; --muted: #96a1b0; --border: #29323e;
    --accent: #5b9bff; --accent-soft: #19304d; --button: #2a68d6; --warn: #e0a54a; --warn-soft: #3a2c12; --lift: #51cf66; --duty: #b197fc;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-variant-numeric: tabular-nums; }

/* ---- header ---- */
header { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 10px 20px;
         background: var(--panel); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
header h1 { font-size: 17px; margin: 0 6px 0 0; font-weight: 650; letter-spacing: .01em; display: flex; align-items: center; gap: 8px; }
header h1::before { content: ""; width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 45%, var(--lift))); }
#source { font-size: 13px; padding: 2px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); }
.spacer { flex: 1; }
header label.auto { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); cursor: pointer; }
header label.auto input { width: 15px; height: 15px; }
header label.auto select { font-size: 13px; padding: 2px 4px; }
.muted { color: var(--muted); }
.dirty { color: var(--warn); font-weight: 600; font-size: 13px; }
button { font: inherit; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--border);
         background: var(--panel); color: var(--text); cursor: pointer; }
button:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
button.primary { background: var(--button); border-color: var(--button); color: #fff; font-weight: 600; }
button:disabled { opacity: .45; cursor: not-allowed; }
#message { padding: 0 20px; min-height: 0; font-size: 14px; }
#message:not(:empty) { padding: 9px 20px; background: var(--accent-soft); }
#message.error { background: color-mix(in srgb, var(--error) 14%, transparent); color: var(--error); }

/* ---- welcome ---- */
.welcome { max-width: 760px; margin: 48px auto; padding: 0 20px; }
.welcome h2 { font-size: 28px; margin: 0 0 16px; }
.welcome ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.welcome li { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); }

/* ---- editor: tree + content ---- */
.editor { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; padding: 20px; max-width: 1180px; margin: 0 auto; }
@media (max-width: 800px) { .editor { grid-template-columns: 1fr; gap: 14px; padding: 12px; } }
nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 72px; align-self: start; }
@media (max-width: 800px) { nav { position: static; } }
.navitem { text-align: left; display: flex; align-items: center; gap: 10px; border: 0; background: transparent;
           padding: 8px 10px; border-radius: 8px; color: var(--text); width: 100%; }
.navitem:hover:not(:disabled) { background: var(--panel); border: 0; }
.navitem.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.navitem .navtext { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.navitem small { color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navitem.active small { color: color-mix(in srgb, var(--accent) 70%, var(--muted)); }
.navitem.disabled b { color: var(--muted); }
.navitem.add { color: var(--accent); font-size: 14px; }
.navitem.group { font-weight: 600; }
.navitem.group.within { color: var(--accent); }
.navitem .count { font-size: 12px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--border);
                  border-radius: 999px; padding: 0 7px; }
.navitem .icon-chevron { width: 16px; height: 16px; transition: transform .15s; }
.navitem.group[aria-expanded="true"] .icon-chevron { transform: rotate(90deg); }
.subtree { display: flex; flex-direction: column; gap: 2px; margin: 0 0 6px 19px; padding-left: 10px; border-left: 1px solid var(--border); }
.navitem.sub { padding: 6px 10px; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
main { min-width: 0; max-width: 860px; }

/* ---- view head and cards ---- */
.head { margin: 2px 0 16px; }
.head h2 { font-size: 26px; margin: 0 0 4px; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: 14px; margin: 4px 0 10px; max-width: 68ch; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0; max-width: 72ch; }
.warn-text { color: var(--warn); font-size: 14px; margin: 6px 0 0; }
.warn-text:empty { display: none; }
fieldset { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); margin: 0 0 16px;
           padding: 6px 18px 12px; min-width: 0; box-shadow: var(--shadow); }
legend { font-weight: 650; font-size: 15px; padding: 0 6px; margin-left: -6px; display: inline-flex; align-items: center; gap: 6px; }

/* ---- rows: label (badge, info) | control (unit) ---- */
.row { display: grid; grid-template-columns: minmax(180px, 290px) minmax(0, 1fr); align-items: center; gap: 6px 16px;
       padding: 9px 0; border-top: 1px solid var(--border); }
fieldset > .row:first-of-type, legend + .row { border-top: 0; }
.row .label { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row .label label { cursor: pointer; }
.row .control { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.row .control > input[type=text], .row .control > input[type=number], .row .control > select { max-width: 320px; flex: 1 1 160px; }
.row .unit { color: var(--muted); font-size: 13px; }
.row.off { opacity: .5; }
.row.stock .label label { color: var(--muted); }
.badge { font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted);
         border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; line-height: 17px; }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft);
              text-transform: none; letter-spacing: 0; font-weight: 500; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; gap: 6px; } }

input[type=text], input[type=number], select { font: inherit; padding: 6px 10px; border-radius: 8px;
       border: 1px solid var(--border); background: var(--panel-2); color: var(--text); width: 100%; min-width: 0; }
input[type=number] { font-variant-numeric: tabular-nums; }

/* switches for booleans (the announcement table keeps compact boxes) */
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); justify-self: start; margin: 0; }
.row input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 40px; height: 22px; border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 35%, var(--panel-2)); position: relative; cursor: pointer; transition: background .15s; flex: none; }
.row input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.row input[type=checkbox]:checked { background: var(--accent); }
.row input[type=checkbox]:checked::after { transform: translateX(18px); }
.row input[type=checkbox]:disabled { cursor: not-allowed; }

/* info circle and its popup */
button.info { width: 18px; height: 18px; padding: 0; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--muted) 60%, transparent);
  background: transparent; color: var(--muted); font: 600 11px/16px Georgia, "Times New Roman", serif; font-style: italic;
  display: inline-grid; place-items: center; flex: none; cursor: help; }
button.info:hover, button.info[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.popover { position: absolute; z-index: 50; background: var(--text); color: var(--panel); font-size: 13.5px; line-height: 1.45;
  padding: 10px 12px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .22); pointer-events: none; }
@media (prefers-color-scheme: dark) { .popover { background: #e9eef4; color: #121820; } }

/* tables */
table { border-collapse: collapse; width: 100%; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; }
th { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
th button.info { margin-left: 4px; vertical-align: -3px; }
.scroll-x { overflow-x: auto; max-width: 100%; margin-top: 8px; }

/* ---- announcements: one section per trigger (a rule between them), its settings, the pool and the list ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.trigger { padding: 14px 0 16px; border-top: 1px solid var(--border); }
.trigger:first-of-type { border-top: 0; padding-top: 6px; }
.trigger-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.trigger-head h3 { font-size: 15px; font-weight: 650; margin: 0; }
.trigger-head .when { color: var(--muted); font-size: 13px; }
.trigger-head button.info { align-self: center; }
.trigger-head .trigger-play { margin-left: auto; align-self: center; }
.trigger-head input[type=checkbox] { align-self: center; appearance: none; -webkit-appearance: none; width: 34px; height: 18px; border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 35%, var(--panel-2)); position: relative; cursor: pointer; transition: background .15s; flex: none; }
.trigger-head input[type=checkbox]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.trigger-head input[type=checkbox]:checked { background: var(--accent); }
.trigger-head input[type=checkbox]:checked::after { transform: translateX(16px); }
.trigger-body { margin: 6px 0 0 44px; }
.trigger.off .trigger-body { opacity: .5; }
/* the trigger's own settings: a compact group with a rule on the left */
.trigger-settings { margin: 2px 0 10px; padding: 2px 0 2px 12px; border-left: 2px solid var(--border); }
.trigger-settings .row { padding: 4px 0; border-top: 0; grid-template-columns: minmax(160px, 250px) minmax(0, 1fr); }
.trigger-settings .row .control > input[type=number] { max-width: 110px; flex: 0 1 110px; }
.trigger-settings .row input[type=checkbox] { width: 34px; height: 18px; }
.trigger-settings .row input[type=checkbox]::after { width: 14px; height: 14px; top: 2px; left: 2px; }
.trigger-settings .row input[type=checkbox]:checked::after { transform: translateX(16px); }
/* the pool: plain text buttons */
.pool { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; margin: 0 0 4px; font-size: 13.5px; }
.pool-label { color: var(--muted); }
.chip { padding: 1px 0; border: 0; border-radius: 0; background: transparent; color: var(--accent); font-size: 13.5px;
        touch-action: none; user-select: none; -webkit-user-select: none; }
.chip:hover { text-decoration: underline; border: 0; }
/* the ordered list: a table with hairlines, the grip and the remove button muted */
table.blocks { margin: 2px 0 0; }
.blocks th { font-size: 12px; font-weight: 500; color: var(--muted); padding: 4px 6px 5px; border-bottom: 1px solid var(--border); }
.blocks td { padding: 3px 6px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); font-size: 14px; vertical-align: middle; }
.blocks tr:last-child td { border-bottom: 1px solid var(--border); }
.blocks .col-grip { width: 30px; padding-left: 0; padding-right: 0; }
.blocks .col-ble { width: 120px; text-align: center; white-space: nowrap; }
.blocks .col-ble button.info { margin-left: 4px; vertical-align: -3px; }
.blocks .col-remove { width: 32px; text-align: right; padding-right: 0; }
.blocks td.col-name button.info { margin-left: 6px; vertical-align: -3px; }
.blocks td.col-ble input[type=checkbox] { width: 15px; height: 15px; vertical-align: middle; }
.block.dragging { position: relative; z-index: 3; background: var(--panel-2); box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.blocks tbody.sorting { user-select: none; -webkit-user-select: none; }
.grip { padding: 2px; border: 0; background: transparent; color: var(--muted); cursor: grab; touch-action: none; display: inline-grid; place-items: center; }
.grip:hover, .grip:focus-visible { color: var(--accent); background: transparent; border: 0; }
.block.dragging .grip { cursor: grabbing; }
.icon-grip { width: 18px; height: 18px; stroke-width: 2.6; }
.block .remove { padding: 0 4px; line-height: 20px; border: 0; background: transparent; color: var(--muted); font-size: 17px; }
.block .remove:hover { color: var(--error); background: transparent; border: 0; }
.blocks-empty { margin: 4px 0 0; }
.blocks-empty:empty { display: none; }
@media (max-width: 640px) { .trigger-body { margin-left: 0; } .blocks .col-ble { width: 70px; } }
.tracks { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.tracks td:first-child { font-family: ui-monospace, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
.tracks td:nth-child(2) { white-space: nowrap; color: var(--muted); }
.tracks td:last-child { white-space: nowrap; text-align: right; }
.tracks button { padding: 4px 10px; margin-left: 6px; }
.error { color: var(--error); }
pre.file { white-space: pre-wrap; word-break: break-word; font: 12px/1.45 ui-monospace, Consolas, monospace;
           max-height: 60vh; overflow: auto; margin: 6px 0 0; }

/* calibration */
.subcard { margin: 10px 0 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); }
.subcard-head { display: flex; align-items: center; gap: 8px; }
.faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0; }
.face { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; text-align: left; background: var(--panel); }
.face .face-label { font-size: 13px; font-weight: 600; }
.face .face-hint { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.face .face-state { font-size: 12px; color: var(--muted); margin-top: 2px; }
.face.current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.face.done { border-color: color-mix(in srgb, var(--lift) 60%, var(--border)); }
.face.done .face-state { color: var(--text); font-weight: 700; }
.cal-live { font-size: 13px; color: var(--muted); min-height: 1.4em; margin: 4px 0; }

/* firmware update */
progress { width: 100%; height: 10px; accent-color: var(--accent); margin: 6px 0; }
.row .control > input[type=file] { font-size: 14px; }

/* voice view: clip lists and the band-pass row */
table.cliplist td { padding: 3px 8px; font-size: 13.5px; }
table.cliplist td.actions { white-space: nowrap; text-align: right; }
table.cliplist td.actions button { margin-left: 4px; }
table.cliplist tr.done td:first-child { color: var(--lift); }
table.cliplist tr.group td { background: var(--panel-2); font-weight: 600; }
table.cliplist tr.group td:nth-child(2) { font-weight: 400; color: var(--muted); }
button.fold { padding: 0 6px; border: 0; background: transparent; color: var(--accent); font-size: 14px; }
button.play.danger:hover { color: var(--error); border-color: var(--error); }
.band { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.band input[type=number] { width: 90px; }
.band select { width: auto; }
.pack { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--border); }

/* voice line (custom profile name) */
.voice .row { border-top: 0; padding: 6px 0; }
.voice-service { margin: 4px 0 2px; }
.voice-service summary { cursor: pointer; font-size: 14px; color: var(--muted); padding: 4px 0; }
.voice-service[open] summary { color: var(--text); }
.voice-service .row { padding-left: 12px; border-left: 2px solid var(--border); margin-left: 2px; }
.voice-status { margin: 2px 0 0; }

/* sliders: perceived loudness in percent, optional play button */
.slider { display: flex; align-items: center; gap: 10px; min-width: 0; }
.slider input[type=range], .tone-test input[type=range], fieldset input[type=range] { flex: 1; min-width: 80px; accent-color: var(--accent); }
.slider output, .row output { min-width: 4.5em; font-variant-numeric: tabular-nums; color: var(--text); }
.slider output.steps { min-width: 6.5em; }
button.play { padding: 3px 10px; line-height: 1.2; }
button:disabled { opacity: .45; cursor: not-allowed; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }

/* tone curve editor */
.tone-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 2px 0 8px; }
.tone-toolbar .check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.tone-toolbar button, .segmented button { padding: 5px 11px; font-size: 14px; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.legend .key { display: inline-block; width: 10px; height: 10px; margin-left: 6px; }
.legend .key.freq { border-radius: 50%; background: var(--accent); }
.legend .key.rate { background: var(--warn); transform: rotate(45deg) scale(.85); }
.legend .key.duty { border-radius: 50%; background: var(--duty); }
.tone-editor { width: 100%; min-width: 0; overflow: hidden; user-select: none; -webkit-user-select: none; }
.tone-svg { display: block; overflow: visible; font-family: inherit; }
.tone-svg .plot { fill: color-mix(in srgb, var(--bg) 55%, var(--panel)); }
.tone-svg .grid { stroke: var(--border); stroke-width: 1; }
.tone-svg .grid.zero { stroke: color-mix(in srgb, var(--muted) 60%, transparent); }
.tone-svg .silent { fill: color-mix(in srgb, var(--muted) 16%, transparent); }
.tone-svg .tick, .tone-svg .axis-label { fill: var(--muted); font-size: 11px; }
.tone-svg .freq { fill: var(--accent); }
.tone-svg .rate { fill: var(--warn); }
.tone-svg .axis-label.duty { fill: var(--duty); }
.tone-svg .curve-all { fill: none; stroke-width: 1.5; stroke-dasharray: 2 4; opacity: .55; }
.tone-svg .curve-all.freq { stroke: var(--accent); }
.tone-svg .curve-all.rate { stroke: var(--warn); }
.tone-svg .curve-on { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.tone-svg .curve-on.freq { stroke: var(--accent); stroke-width: 2.6; }
.tone-svg .curve-on.rate { stroke: var(--warn); stroke-width: 1.8; stroke-dasharray: 6 4; }
.tone-svg .curve-on.duty { stroke: var(--duty); stroke-width: 1.8; }
.tone-svg .handle { stroke: var(--panel); stroke-width: 2; cursor: grab; outline: none; transition: r .1s; }
.tone-svg .handle.freq { fill: var(--accent); cursor: move; }
.tone-svg .handle.rate { fill: var(--warn); cursor: ns-resize; }
.tone-svg .handle.duty { fill: var(--duty); cursor: ns-resize; }
.tone-svg .handle.freq:hover, .tone-svg .handle.freq.selected, .tone-svg .handle.freq:focus-visible { r: 9; }
.tone-svg .handle.duty:hover, .tone-svg .handle.duty.selected, .tone-svg .handle.duty:focus-visible { r: 7; }
.tone-svg .handle.selected { stroke: var(--text); }
.tone-svg .handle:focus-visible { stroke: var(--text); stroke-width: 3; }
.tone-svg .flag { cursor: ew-resize; outline: none; }
.tone-svg .flag-line { stroke-width: 1.5; stroke-dasharray: 4 3; }
.tone-svg .flag-pill { stroke: none; }
.tone-svg .flag-text { fill: #fff; font-size: 12px; font-weight: 600; }
.tone-svg .flag.lift .flag-line { stroke: var(--lift); }
.tone-svg .flag.lift .flag-pill { fill: var(--lift); }
.tone-svg .flag.sink .flag-line { stroke: var(--error); }
.tone-svg .flag.sink .flag-pill { fill: var(--error); }
.tone-svg .flag:focus-visible .flag-pill { stroke: var(--text); stroke-width: 2; }
.tone-svg .hover-area { fill: transparent; pointer-events: none; }
.tone-editor.testing .hover-area { pointer-events: all; cursor: col-resize; touch-action: none; }
.tone-editor.testing .handle, .tone-editor.testing .flag { pointer-events: none; opacity: .45; }
.tone-editor .handle, .tone-editor .flag { touch-action: none; }
.tone-editor.dragging, .tone-editor.dragging * { cursor: grabbing; }
.tone-svg .marker line { stroke: var(--text); stroke-width: 2; }
.tone-svg .marker rect { fill: var(--text); }
.tone-svg .marker text { fill: var(--panel); font-size: 12px; font-weight: 600; }
.tone-footer { min-height: 22px; margin-top: 4px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tone-test { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; border-top: 1px solid var(--border);
             padding-top: 10px; margin-top: 8px; }
.tone-test .label { font-size: 14px; }
.tone-test .slider { min-width: 220px; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.segmented button { border: 0; border-radius: 0; border-right: 1px solid var(--border); background: var(--panel); }
.segmented button:last-child { border-right: 0; }
.segmented button.on { background: var(--accent); color: #fff; }
.json-panel { margin: 0 0 10px; }
textarea.json { width: 100%; font: 12px/1.45 ui-monospace, Consolas, monospace; padding: 8px; border-radius: 8px;
                border: 1px solid var(--border); background: var(--bg); color: var(--text); resize: vertical; }

/* live values */
.hwstrip { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; font-size: 13px; }
.hwstrip .badge.ok { color: var(--ok, #3a9d5d); border-color: color-mix(in srgb, var(--ok, #3a9d5d) 45%, transparent); }
.live { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.live-cell { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; background: var(--bg); }
.live-cell > span { font-size: 12px; display: block; }
.live-cell b { font-variant-numeric: tabular-nums; font-size: 17px; }
.live-cell.big b { font-size: 26px; }
.live-cell small { color: var(--muted); }
.live-cell b.lift { color: var(--lift); }
.live-cell b.sink { color: var(--error); }

@media (max-width: 640px) {
  .row { grid-template-columns: 1fr; gap: 4px; }
}
