[hidden] { display: none !important; }
html { color-scheme: light; }
body { margin: 0; }
/* Layout: one-screen practice desk. Transport bar on top, the score on a paper sheet, a mixing console docked at the bottom. */
:root {
  --bg: #eef0f3;
  --panel: #ffffff;
  --ink: #1d2433;
  --muted: #5d6678;
  --line: #d5dae3;
  --paper: #fffefb;
  --accent: #2c5a9e;
  --accent-ink: #ffffff;
  --track: #dfe3ea;
  --v-s: #c2415b; --v-a: #c98a12; --v-t: #2f8a5b; --v-b: #3b63b8; --v-x: #7a5cae; --v-m: #6b7385;
  --f-display: "Fraunces", Georgia, "Times New Roman", serif;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #141821; --panel: #1c2230; --ink: #e6e9ef; --muted: #9aa3b5; --line: #2c3446; --paper: #f7f5ef;
  --accent: #7ea6e8; --accent-ink: #0f1420; --track: #2a3243;
  --v-s: #ec7a90; --v-a: #e8b34c; --v-t: #5cc28c; --v-b: #7fa0ef; --v-x: #b097e0; --v-m: #9aa3b5;
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #141821; --panel: #1c2230; --ink: #e6e9ef; --muted: #9aa3b5; --line: #2c3446; --paper: #f7f5ef;
  --accent: #7ea6e8; --accent-ink: #0f1420; --track: #2a3243;
  --v-s: #ec7a90; --v-a: #e8b34c; --v-t: #5cc28c; --v-b: #7fa0ef; --v-x: #b097e0; --v-m: #9aa3b5;
  color-scheme: dark; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; }
.app { height: 100%; display: flex; flex-direction: column; gap: 12px; padding-inline: 16px; padding-block: 12px; box-sizing: border-box; max-width: 1200px; margin: 0 auto; }
header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.title { display: flex; flex-direction: column; min-width: 0; flex: 1 1 220px; }
.title h1 { font-family: var(--f-display); font-weight: 650; font-size: 1.45rem; margin: 0; line-height: 1.15; text-wrap: balance; }
.title .sub { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.files { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { font: inherit; font-size: .88rem; font-weight: 500; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 7px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--accent); }
.btn:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.song { display: flex; align-items: center; gap: 8px; }
.song span { color: var(--muted); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.song select { font: inherit; font-weight: 500; max-width: min(70vw, 360px); border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 7px 10px; }

.transport { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.play { width: 46px; height: 46px; border-radius: 50%; border: none; background: var(--accent); color: var(--accent-ink); cursor: pointer; display: grid; place-items: center; flex: none; }
.play svg { width: 20px; height: 20px; fill: currentColor; }
.stop { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.stop svg { width: 14px; height: 14px; fill: currentColor; }
.pos { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: .95rem; min-width: 7.5em; }
.pos small { display: block; color: var(--muted); font-family: var(--f-body); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.ctl { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.ctl label { color: var(--muted); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.ctl output { font-family: var(--f-mono); font-variant-numeric: tabular-nums; min-width: 3.4em; }
.num { width: 3.6em; font: inherit; font-family: var(--f-mono); padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
input[type=range] { accent-color: var(--accent); }

.sheetBox { flex: 1 1 auto; min-height: 220px; position: relative; display: flex; }
#centerLine { position: absolute; top: 8px; bottom: 8px; left: 50%; width: 3px; margin-left: -1.5px; border-radius: 2px; background: color-mix(in srgb, var(--accent) 55%, transparent); pointer-events: none; }
.scrollview #osmdWrap { width: max-content; }
.scrollview #osmd { width: max-content; }
.scrollview #osmd img[id^="cursorImg"] { opacity: 0; }
.mini { font: inherit; font-family: var(--f-mono); width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
.view output { min-width: 3.2em; text-align: center; }
.btn.toggle[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.sheet { flex: 1 1 auto; min-width: 0; min-height: 220px; overflow: auto; background: var(--paper); border-radius: 12px; border: 1px solid var(--line); position: relative; color: #000; }
#osmdWrap { position: relative; }
#mrBadge { position: absolute; transform: translate(-50%, -140%); background: var(--accent); color: var(--accent-ink); font-family: var(--f-mono); font-size: .8rem; font-variant-numeric: tabular-nums; padding: 3px 8px; border-radius: 6px; pointer-events: none; white-space: nowrap; }
#osmd { padding: 4px 0 24px; cursor: pointer; }
.sheet .msg[hidden] { display: none; }
.sheet .msg { position: absolute; inset: 0; display: grid; place-items: center; color: #555; font-size: .95rem; padding: 16px; text-align: center; }

.console { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 12px; }
.strip { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; align-items: center; gap: 4px 8px; padding: 6px 8px; border-radius: 8px; border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 7%, transparent); }
.strip.off { opacity: .5; }
.strip .nm { grid-column: 1 / 3; font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.strip .ms { grid-column: 3; display: flex; gap: 4px; }
.strip .ms button { font: inherit; font-family: var(--f-mono); font-size: .72rem; width: 26px; height: 24px; border-radius: 5px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
.strip .ms button.m { width: 30px; display: grid; place-items: center; padding: 0; color: var(--ink); }
.strip .ms button.m svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.strip .ms button.m .spk { fill: currentColor; }
.strip .ms button.m .off { display: none; }
.strip .ms button[aria-pressed=true].m { color: var(--muted); }
.strip .ms button[aria-pressed=true].m .on { display: none; }
.strip .ms button[aria-pressed=true].m .off { display: inline; }
.strip .ms button[aria-pressed=true].me { background: var(--c); color: #fff; border-color: var(--c); }
.strip.pick { cursor: pointer; }
.strip.pick:hover { background: color-mix(in srgb, var(--c) 14%, transparent); }
.strip.mine { box-shadow: inset 0 0 0 2px var(--c); }
#osmd .dim { opacity: .3; }
#osmd .hl path, #osmd .hl rect { fill: var(--hl) !important; stroke: var(--hl) !important; }
#osmd text.hl, #osmd .hl text { fill: var(--hl) !important; font-weight: 700; }
.strip .ms button[aria-pressed=true].s { background: var(--c); color: #fff; border-color: var(--c); }
.strip input[type=range] { grid-column: 1 / 3; width: 100%; accent-color: var(--c); margin: 0; }
.strip .vol { grid-column: 3; font-family: var(--f-mono); font-size: .75rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-size: .78rem; }
/* Phone: extra transport controls and the full mixer fold away; a compact "my part" picker stays at the bottom. */
.extra { display: contents; }
.more, .mixbar { display: none; }
.mixer { display: contents; }
.more svg, .mixbar .chev { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.more svg circle { fill: var(--panel); }
@media (max-width: 640px) {
  .app { gap: 8px; padding-block: 8px; }
  .title h1 { font-size: 1.2rem; }
  .transport { gap: 8px 12px; padding: 8px 10px; }
  .files { flex: 1 1 100%; flex-wrap: nowrap; }
  .song { flex: 1 1 auto; min-width: 0; }
  .song select { flex: 1 1 auto; min-width: 0; max-width: none; }
  .title { display: none; }
  .app.open .title { display: flex; order: 2; }
  .more { display: inline-flex; flex: none; padding: 7px 10px; }
  .more svg { width: 20px; height: 20px; }
  .more[aria-expanded=true] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
  .extra { display: none; }
  .app.open .extra { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; width: 100%; border-top: 1px solid var(--line); padding-top: 8px; }
  .mixer { display: flex; flex-direction: column; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
  .mixbar { display: flex; align-items: center; gap: 8px; }
  .mixbar label { color: var(--muted); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
  .mixbar select { flex: 1 1 auto; min-width: 0; font: inherit; font-weight: 500; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 8px; padding: 7px 8px; }
  .mixbar .chev { transform: rotate(180deg); transition: transform .15s; }
  .mixer.open .mixbar .chev { transform: none; }
  .mixer .console { display: none; background: none; border: 0; padding: 0; max-height: 42vh; overflow: auto; }
  .mixer.open .console { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
