:root {
  --bg: #16181d; --panel: #1f2229; --panel2: #262a33; --line: #353a45;
  --text: #e6e8ec; --mut: #9aa0aa; --acc: #4fc3f7; --danger: #ef5350;
  --st: env(safe-area-inset-top); --sb: env(safe-area-inset-bottom);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; }
.hidden { display: none !important; }
.view { position: fixed; inset: 0; display: flex; flex-direction: column; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 16px calc(24px + var(--sb)); }
.top { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--st)) 12px 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 38px; height: 38px; border-radius: 9px; }
.brand b, .ttl b { display: block; font-size: 17px; }
.brand small, .ttl small { color: var(--mut); font-size: 12px; }
.ttl { flex: 1; min-width: 0; text-align: center; }
.ttl b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon { background: none; border: 0; color: var(--text); font-size: 24px; min-width: 44px; height: 44px; border-radius: 10px; }
.icon:active { background: var(--panel2); }
.btn { display: flex; align-items: center; justify-content: center; text-align: center; background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 15px; font-weight: 600; min-height: 46px; flex: 1; }
.btn:active { opacity: .7; }
.btn.primary { background: var(--acc); color: #0d1117; border-color: var(--acc); }
.btn.big { min-height: 56px; font-size: 16px; }
.btn.danger { color: var(--danger); }
.actions { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 10px; }
.hint { color: var(--mut); font-size: 13px; margin: 6px 2px; }
.hint.small { font-size: 12px; }
.sec { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); margin: 18px 2px 8px; }
.song { display: flex; align-items: center; gap: 12px; background: var(--panel); border-radius: 14px; padding: 12px; margin-bottom: 8px; }
.song:active { background: var(--panel2); }
.song .dots { display: flex; gap: 3px; align-items: flex-end; height: 34px; }
.song .dots i { width: 5px; border-radius: 3px; }
.song .info { flex: 1; min-width: 0; }
.song .info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song .info small { color: var(--mut); font-size: 12px; }
.empty { text-align: center; color: var(--mut); padding: 30px 10px; background: var(--panel); border-radius: 14px; }

.proc { margin: auto; padding: 24px; text-align: center; max-width: 420px; width: 100%; }
.proc h2 { font-size: 18px; margin: 18px 0 14px; word-break: break-word; }
.bar { height: 10px; background: var(--panel2); border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--acc); transition: width .3s; }
.spinner { width: 46px; height: 46px; margin: 0 auto; border: 4px solid var(--panel2); border-top-color: var(--acc); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.proc .btn { margin-top: 18px; flex: none; width: 100%; }

.chordbox { display: flex; align-items: center; gap: 12px; background: var(--panel); border-radius: 14px; padding: 10px 14px; }
.chordbox .now small { display: block; color: var(--mut); font-size: 11px; }
.chordbox .now b { font-size: 38px; line-height: 1.1; color: var(--acc); min-width: 90px; display: inline-block; }
.chordbox .next { flex: 1; display: flex; gap: 8px; overflow: hidden; color: var(--mut); font-size: 20px; font-weight: 600; }
.chordbox .next span { white-space: nowrap; }
.chordline { position: relative; height: 34px; margin: 8px 0 4px; overflow: hidden; border-radius: 8px; background: var(--panel); }
.chordline span { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding-left: 4px; font-size: 12px; font-weight: 600;
  border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; color: var(--mut); }
.chordline span.on { color: #0d1117; background: var(--acc); }
#wave { width: 100%; height: 90px; display: block; background: var(--panel); border-radius: 12px; touch-action: none; }
.times { display: flex; justify-content: space-between; font: 13px/1 ui-monospace, Menlo, monospace; color: var(--mut); margin: 6px 2px; }
.transport { display: flex; align-items: center; justify-content: center; gap: 26px; margin: 6px 0; }
.transport .icon { font-size: 18px; width: 56px; height: 56px; background: var(--panel); border-radius: 50%; }
.play { width: 72px; height: 72px; border-radius: 50%; background: var(--acc); color: #0d1117; border: 0; font-size: 28px; }
.play:active { opacity: .8; }
.looprow { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 6px 0; }
.chip { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 8px 14px; font-size: 14px; font-weight: 600; min-height: 38px; }
.chip.on { background: var(--acc); color: #0d1117; border-color: var(--acc); }

.presets { background: var(--panel); border-radius: 12px; padding: 8px 10px; margin-bottom: 8px; }
.prow { display: flex; align-items: flex-start; gap: 8px; margin: 4px 0; }
.prow > span { width: 38px; flex: none; color: var(--mut); font-size: 13px; font-weight: 700; padding-top: 9px; }
.prow > div { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.chip.mini { padding: 6px 11px; min-height: 34px; font-size: 13px; border-color: var(--c, var(--line)); touch-action: manipulation; }
.chip.mini.on { background: var(--c, var(--acc)); border-color: var(--c, var(--acc)); color: #0d1117; }
.trk { background: var(--panel); border-radius: 12px; padding: 8px 12px 10px; margin-bottom: 8px; border-left: 5px solid var(--c); }
.trow { display: flex; align-items: center; gap: 8px; }
.trk .nm { flex: 1; font-weight: 700; font-size: 15px; }
.trk .pct { min-width: 46px; text-align: right; font: 600 13px/1 ui-monospace, Menlo, monospace; color: var(--mut); }
.trk .tb { width: 44px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-weight: 700; touch-action: manipulation; }
.trk .tb.m.on { background: var(--danger); border-color: var(--danger); color: #fff; }
.trk .tb.s.on { background: #fdd835; border-color: #fdd835; color: #111; }
.trk.off .nm, .trk.off .fader { opacity: .4; }
.fader { --p: .85; position: relative; height: 40px; margin-top: 4px; touch-action: pan-y; cursor: pointer; -webkit-user-select: none; user-select: none; }
.fader::before { content: ""; position: absolute; left: 0; right: 0; top: 17px; height: 6px; border-radius: 3px; background: var(--line); }
.fader .fill { position: absolute; left: 0; top: 17px; height: 6px; width: calc(14px + (100% - 28px) * var(--p)); border-radius: 3px; background: var(--c); }
.fader .knob { position: absolute; top: 6px; left: calc((100% - 28px) * var(--p)); width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 3px solid #0d1117; box-shadow: 0 1px 4px #0008; transition: transform .1s; }
.fader.act .knob { transform: scale(1.2); }
.trk.master { margin-top: 4px; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 30px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 5px; background: var(--line); border-radius: 3px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -10px; border-radius: 50%; background: var(--acc); }
.panel { background: var(--panel); border-radius: 14px; padding: 8px 12px; }
.row { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.row > span { width: 56px; color: var(--mut); }
.row input { flex: 1; }
.row b { min-width: 48px; text-align: right; }
.row b.mid { flex: 1; text-align: center; font-size: 20px; }
.step { width: 48px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 22px; }

.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; z-index: 20; }
.sheet-in { width: 100%; background: var(--panel); border-radius: 18px 18px 0 0; padding: 14px 16px calc(16px + var(--sb)); display: flex; flex-direction: column; gap: 10px; max-height: 85vh; overflow-y: auto; }
.sheet-in h3 { margin: 4px 0; font-size: 16px; }
.sheet-in input[type=text] { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 16px; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(20px + var(--sb)); background: #2d3340; color: var(--text); padding: 12px 14px; border-radius: 12px; z-index: 30; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.install { position: fixed; inset: 0; background: var(--bg); z-index: 40; display: flex; }
.install-in { margin: auto; padding: 24px; max-width: 380px; text-align: center; }
.install-in img { width: 96px; height: 96px; border-radius: 22px; }
.install-in ol { text-align: left; line-height: 1.9; }
.shr { display: inline-block; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }
@media (min-width: 761px) { .scroll, .top { padding-left: calc(50vw - 360px); padding-right: calc(50vw - 360px); } }
