:root {
  --bg: #14161a; --panel: #1c1f26; --line: #2c313b; --paper: #0e1013;
  --fg: #e6e9ef; --dim: #9aa3b2; --accent: #4d9cff; --warn: #ffb454;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 14px/1.55 -apple-system, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
}
.boot { padding: 48px 24px; color: var(--dim); }
#app { display: flex; flex-direction: column; height: 100%; }

.top {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px 8px; flex: none;
}
h1 { margin: 0; font-size: 19px; font-weight: 600; }
.meta { margin: 2px 0 0; color: var(--dim); font-size: 12.5px; }
.ident { flex: 1; min-width: 0; }

select, input[type=number] {
  background: #12141a; color: var(--fg); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 8px; font: inherit;
}
.num { width: 64px; }
button {
  background: #262b34; color: var(--fg); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 12px; font: inherit; cursor: pointer;
}
button:hover { border-color: var(--accent); }
button.on { background: var(--accent); border-color: var(--accent); color: #06101d; }
.mini { padding: 4px 10px; font-size: 12.5px; }
.play { width: 46px; height: 34px; font-size: 15px; }

.transport {
  padding: 4px 20px 10px; background: var(--panel);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  flex: none;
}
.line { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 8px 0; }
.grow { flex: 1; }
.clock { font-variant-numeric: tabular-nums; font-size: 15px; min-width: 64px; }
.pos { color: var(--accent); font-variant-numeric: tabular-nums; min-width: 180px; }
.loopinfo { color: var(--warn); font-size: 12.5px; }
.ctl, .chk { display: flex; align-items: center; gap: 7px; color: var(--dim); font-size: 12.5px; }
.ctl-label { color: var(--dim); font-size: 12.5px; }
.ctl input[type=range] { width: 120px; }
input[type=range] { accent-color: var(--accent); }
output { font-variant-numeric: tabular-nums; min-width: 42px; font-size: 12px; }

.timeline {
  position: relative; height: 26px; border-radius: 5px;
  background: #12141a; border: 1px solid var(--line);
  cursor: pointer; overflow: hidden;
}
.tl-played { position: absolute; inset: 0 auto 0 0; width: 0;
             background: rgba(77,156,255,.20); pointer-events: none; }
.tl-loop { position: absolute; top: 0; bottom: 0;
           background: rgba(255,180,84,.22);
           border-left: 2px solid var(--warn); border-right: 2px solid var(--warn);
           pointer-events: none; }
.tl-head { position: absolute; top: 0; bottom: 0; width: 2px;
           background: var(--accent); pointer-events: none; }

.sections { gap: 6px; }
.sections button { padding: 4px 9px; font-size: 12px; }

.scroller { position: relative; flex: 1; overflow-y: auto; overflow-x: hidden;
            background: var(--paper); scroll-behavior: smooth; }
.sheet { position: relative; margin: 20px auto 45vh; }
.sheet img.page { display: block; width: 100%; margin: 0 0 20px;
                  border-radius: 6px; background: #fff; }
.cursor { position: absolute; left: 0; top: 0; width: 3px; background: var(--accent);
          border-radius: 2px; box-shadow: 0 0 10px rgba(77,156,255,.9);
          pointer-events: none; will-change: transform, height; }
.hl { position: absolute; left: 0; top: 0; background: rgba(77,156,255,.13);
      border-radius: 4px; pointer-events: none;
      will-change: transform, width, height; }
.loopband { position: absolute; left: 0; top: 0; pointer-events: none;
            border: 2px solid rgba(255,180,84,.75); border-radius: 5px;
            background: rgba(255,180,84,.08); }

.foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
        padding: 8px 20px; background: var(--panel);
        border-top: 1px solid var(--line); flex: none; }
.hint { color: var(--dim); font-size: 11.5px; }

@media (max-width: 720px) {
  .pos { min-width: 0; }
  .hint { display: none; }
  .ctl input[type=range] { width: 90px; }
}
