:root {
  --bg: #14110f; --panel: #1f1b18; --panel2: #2a2420; --line: #3a322c; --text: #f3ece6; --muted: #a8998c;
  --accent: #ff8a3d; --ok: #3fbf7f; --bad: #ff5a5a; --warn: #f2c14e; --info: #6fb3ff;
  --radius: 14px; --tap: 52px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
body { padding-bottom: calc(96px + env(safe-area-inset-bottom)); overflow-x: hidden; }
button, input, select { font: inherit; color: inherit; }
button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.top { position: sticky; top: 0; z-index: 5; background: rgba(20,17,15,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: calc(8px + env(safe-area-inset-top)) 16px 0; }
.brand { font-weight: 700; letter-spacing: .04em; display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; }
#buildTag { font-size: 11px; font-weight: 500; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lab-badge { background: var(--accent); color: #1a0f05; font-weight: 800; border-radius: 6px; padding: 2px 7px; font-size: 13px; }
.tabs { display: flex; gap: 4px; margin-top: 8px; }
.tabs a { flex: 1; text-align: center; padding: 10px 4px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; font-weight: 600; font-size: 15px; }
.tabs a.on { color: var(--text); border-color: var(--accent); }
main { max-width: 560px; margin: 0 auto; padding: 12px 16px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 12px 0; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { min-width: 0; }
.grow { flex: 1; }
select, input[type=search], input[type=text], input[type=number] { width: 100%; min-height: 46px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
input[type=number] { font-size: 22px; font-weight: 700; text-align: center; }
.title { font-size: 22px; font-weight: 750; line-height: 1.2; overflow-wrap: anywhere; }
.sub { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--line); background: var(--panel2); border-radius: 999px; padding: 8px 12px; font-size: 14px; min-height: 40px; }
.chip.on { background: #3b2a1c; border-color: var(--accent); color: #ffd9bf; }
.chip.staged { border-style: dashed; }
.chip.pending { outline: 2px solid var(--warn); outline-offset: 1px; }
.pill { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 700; }
.pill.KNOWN_ERROR { background: #4a1717; color: #ffb3b3; } .pill.REVIEW { background: #4a3a12; color: #ffe39a; }
.pill.AUTO { background: #16314a; color: #b5dbff; } .pill.HUMAN_VERIFIED { background: #163a28; color: #aef0cb; }
.pill.CORRECTED { background: #2f1a4a; color: #dcc2ff; } .pill.HUMAN_KNOWN, .pill.NOT_SCANNED, .pill.NO_SHA { background: var(--panel2); color: var(--muted); }
.play { width: 100%; min-height: 64px; border-radius: var(--radius); border: 0; background: var(--text); color: var(--bg); font-size: 20px; font-weight: 800; }
.play.playing { background: var(--accent); }
.scrub { width: 100%; margin: 10px 0 0; accent-color: var(--accent); }
.bpmgrid { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; }
.big { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.big.txt { font-size: 20px; text-align: right; }
.strike { text-decoration: line-through; opacity: .55; }
.verdicts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vbtn { min-height: var(--tap); border-radius: 12px; border: 2px solid var(--line); background: var(--panel2); font-weight: 750; font-size: 15px; }
.vbtn.on.CORRECT { border-color: var(--ok); background: #163a28; } .vbtn.on.WRONG { border-color: var(--bad); background: #4a1717; }
.vbtn.on.NO_FIXED_TEMPO { border-color: var(--info); background: #16314a; } .vbtn.on.NOT_SURE { border-color: var(--muted); background: #333; }
.vbtn:disabled { opacity: .35; }
.tap { width: 100%; min-height: 150px; border-radius: 18px; border: 0; background: var(--accent); color: #1a0f05; font-size: 30px; font-weight: 900; letter-spacing: .06em; user-select: none; -webkit-user-select: none; }
.tap:active { filter: brightness(1.15); transform: scale(.995); }
.tapread { text-align: center; margin: 10px 0; }
.tapread .big { font-size: 44px; }
.tri { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.btn { min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); font-weight: 700; padding: 0 12px; }
.btn.primary { background: var(--text); color: var(--bg); border: 0; }
.btn.accent { background: var(--accent); color: #1a0f05; border: 0; }
.btn.wide { width: 100%; }
a.linkbtn { display: flex; align-items: center; justify-content: center; text-decoration: none; color: var(--text); -webkit-tap-highlight-color: transparent; }
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: rgba(20,17,15,.97); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.bar .inner { max-width: 560px; margin: 0 auto; display: flex; gap: 8px; }
.bar .save { flex: 1; min-height: 56px; border-radius: 14px; border: 0; background: var(--ok); color: #06150d; font-size: 18px; font-weight: 850; }
.bar .save:disabled { opacity: .5; }
.bar .prev { min-height: 56px; width: 64px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel2); font-size: 20px; }
.banner { border-radius: 12px; padding: 10px 12px; margin: 10px 0; font-weight: 600; }
.banner.err { background: #4a1717; color: #ffd0d0; } .banner.ok { background: #163a28; color: #c8f5dc; } .banner.warn { background: #4a3a12; color: #ffeab0; }
details summary { cursor: pointer; color: var(--muted); padding: 6px 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 13px; color: var(--muted); }
.kv b { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.hist { font-size: 14px; border-left: 3px solid var(--line); padding-left: 10px; margin: 6px 0; }
.pair { font-size: 40px; font-weight: 900; letter-spacing: .12em; text-align: center; margin: 16px 0; font-variant-numeric: tabular-nums; }
.diff li { margin: 4px 0; overflow-wrap: anywhere; }
.add { color: var(--ok); } .rem { color: var(--bad); }
h2 { font-size: 18px; margin: 4px 0 8px; } h3 { font-size: 16px; margin: 4px 0; }
.bpmline { display: flex; align-items: baseline; gap: 10px; margin: 2px 0; }
.bpmline .lbl { width: 76px; color: var(--muted); font-weight: 600; }
.bpmline .big { font-size: 40px; }
.tag { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.earlier { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--panel2); font-size: 14px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.abtn { min-height: 54px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel2); font-weight: 800; font-size: 15px; }
.abtn.use { background: #1e3326; border-color: #2f6b47; font-size: 19px; }
.abtn.on { border-color: var(--accent); background: #3b2a1c; color: #ffd9bf; }
.section { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.secbpm { width: 92px !important; flex: none; font-size: 18px !important; }
.tap.small-tap { min-height: 96px; font-size: 24px; }
.stemrow { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.abtn.stembtn { width: 100%; }
.hint { font-size: 13px; font-weight: 700; color: var(--warn); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hint .btn { min-height: 40px; }
