:root {
  --bg: #0b0a08; --panel: #17140f; --line: #2e281d; --text: #f3ecdc; --muted: #a2977f;
  --gold: #d9a441; --gold-hi: #f6d58a; --red: #d8402f; --green: #3fae6a;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.45; }
body.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
h1, h2, h3 { margin: 0 0 12px; font-weight: 700; }
h2 { font-size: 1.05rem; letter-spacing: .04em; text-transform: uppercase; color: var(--gold); }
a { color: var(--gold-hi); }
.brand { font-size: 1.6rem; letter-spacing: .12em; color: var(--gold-hi); }
.brand span { color: var(--muted); font-weight: 400; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.login { width: 100%; max-width: 360px; display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: .9rem; color: var(--muted); }
input, select { background: #0f0d0a; color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font: inherit; width: 100%; min-width: 0; }
input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.btn { border: 1px solid var(--line); background: #221d15; color: var(--text); border-radius: 10px; padding: 10px 16px;
  font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover:not(:disabled) { border-color: var(--gold); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.gold { background: linear-gradient(#f0c264, #c58f2c); color: #1b1404; border-color: #f6d58a; }
.btn.red { background: #5a1a13; border-color: var(--red); }
.btn.big { font-size: 1.4rem; padding: 22px; width: 100%; }
.btn.small { padding: 6px 10px; font-size: .85rem; }
.error { color: #ff8b7b; min-height: 1.2em; margin: 0; font-size: .9rem; }
.ok { color: var(--green); }
.muted { color: var(--muted); }

/* console */
header.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
header.top .brand { margin: 0; font-size: 1.15rem; }
header.top .spacer { flex: 1; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
main > *, .live > * { min-width: 0; }
.live { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .live { grid-template-columns: 1.2fr 1fr; } }
.status { text-align: center; padding: 26px 20px; }
.status .state { font-size: .85rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.status .total { font-size: clamp(2.6rem, 9vw, 4.4rem); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--gold-hi); }
.status.bust .total { color: var(--red); }
.status.banked .total { color: var(--green); }
.status .sub { color: var(--muted); min-height: 1.4em; }
.controls { display: grid; gap: 10px; align-content: start; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .btn { flex: 1; }
.seal { font-family: ui-monospace, Consolas, monospace; font-size: .72rem; color: var(--muted); word-break: break-all; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
td.wrap { white-space: normal; min-width: 240px; color: var(--muted); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; text-transform: uppercase; }
.pill.banked { background: #153a24; color: #7fe0a4; } .pill.bust { background: #47160f; color: #ff9a8b; }
.pill.void { background: #2a2a2a; color: #bbb; } .pill.running { background: #4a3608; color: var(--gold-hi); }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.weights { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.clips { display: grid; gap: 8px; }
.clip { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.clip b { min-width: 84px; }
.clip .tag { font-size: .78rem; color: var(--muted); flex: 1; min-width: 110px; }
details > summary { cursor: pointer; font-weight: 700; color: var(--gold); letter-spacing: .04em; text-transform: uppercase; }
details[open] > summary { margin-bottom: 14px; }

label.check { display: flex; gap: 10px; align-items: center; color: var(--text); font-size: .95rem; }
label.check input { width: 20px; height: 20px; flex: none; accent-color: var(--gold); }
#soundState { margin: 0; font-size: .9rem; }
