/* chrome.css — instrument toolbar, rail, sheets, panels, beat indicator, widgets */

.inst { height: 100%; display: flex; flex-direction: column; position: relative; z-index: 1; }

/* ===== top toolbar ===== */
.inst-top {
  display: flex; align-items: stretch; gap: 12px;
  padding: 12px 14px; background: var(--rail);
  min-height: clamp(72px, 11vh, 120px);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.inst-logo { width: clamp(40px, 6vh, 60px); height: auto; border-radius: 12px; flex-shrink: 0; align-self: center; }
.icon-btn {
  min-width: clamp(60px, 9vh, 96px); min-height: clamp(60px, 9vh, 96px);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; position: relative;
  background: var(--surface-2); color: var(--text); flex-shrink: 0;
  transition: background .15s, transform .1s;
}
/* compact header Arpeggio toggle (icon + tiny label, on-state highlighted) */
.icon-btn.arp-toggle { width: auto; min-width: 0; gap: 7px; padding: 0 16px; border: 1.5px solid var(--border); }
.icon-btn.arp-toggle .arp-mini { font-family: var(--f-head); font-weight: 800; font-size: clamp(14px,1.6vw,17px); }
.icon-btn.arp-toggle.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
[data-theme="paper"] .icon-btn.arp-toggle.on { color: #fff; }
.icon-btn svg { width: 30px; height: 30px; }
.icon-btn.ghost { background: transparent; }
.icon-btn:hover { background: var(--surface-3); }
.icon-btn:active { transform: scale(.93); }
/* Toggle-Aktiv-Zustand (z. B. Arpeggio an) – Akzent-Gold */
.icon-btn.on { background: var(--accent); color: var(--on-accent); }
[data-theme="paper"] .icon-btn.on { color: #fff; }
.icon-btn.on:hover { background: var(--accent); filter: brightness(1.05); }
.dot-badge { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--rail); }

.inst-title { display: flex; flex-direction: column; justify-content: center; line-height: 1.15; gap: clamp(4px, 0.8vh, 9px); margin-right: 6px; }
.inst-name { font-size: clamp(18px, 2.4vw, 24px); }
.inst-chip { font-size: 12px; color: var(--text-muted); font-family: var(--f-mono); letter-spacing: .02em; }

.lo-thumb { width: 60px; height: 46px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--border); flex-shrink: 0; }

/* big hamburger menu button in the toolbar */
.menu-btn {
  margin-left: auto;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 0 22px; min-height: clamp(60px, 9vh, 96px);
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); flex-shrink: 0;
  transition: background .15s, border-color .15s, transform .1s;
}
.menu-btn span { font-family: var(--f-head); font-weight: 700; font-size: clamp(16px, 1.9vw, 21px); white-space: nowrap; }
.menu-btn svg { width: 30px; height: 30px; }
.menu-btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.menu-btn:active { transform: scale(.96); }

/* segmented control */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.seg-opt {
  display: flex; align-items: center; gap: 9px; padding: 10px 22px; border-radius: calc(var(--radius-sm) - 2px);
  color: var(--text-dim); font-weight: 600; font-size: clamp(16px, 1.8vw, 19px); min-height: clamp(72px, 11vh, 112px); white-space: nowrap;
}
.seg-opt svg { width: 26px; height: 26px; }
.seg-opt.on { background: var(--accent); color: var(--on-accent); }
[data-theme="paper"] .seg-opt.on { color: #fff; }
.seg-opt:not(.on):hover { background: var(--surface-3); color: var(--text); }

/* ===== main split ===== */
.inst-main { flex: 1; display: flex; min-height: 0; }
.stage-col { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.layout-stage { flex: 1; min-height: 0; }

.mode-hint {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 6;
  display: flex; align-items: center; gap: 7px; padding: 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
  font-size: 12px; font-weight: 600; box-shadow: var(--shadow);
}
.dwell-bar {
  flex-shrink: 0; display: flex; gap: 10px; justify-content: center;
  padding: 8px 12px; margin: 0; width: 100%;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.dwell-toggle { min-height: 72px; padding: 0 30px; border-radius: 999px; font-family: var(--f-head); font-weight: 700; font-size: clamp(16px, 2vw, 21px); color: var(--text-dim); white-space: nowrap; background: var(--surface); border: 1.5px solid var(--border); }
.dwell-toggle.on { background: var(--accent); color: var(--on-accent); }
[data-theme="paper"] .dwell-toggle.on { color: #fff; }
.dwell-toggle:not(.on):hover { background: var(--surface-3); color: var(--text); }

/* accompaniment bar (chord-pad autoplay pattern picker) */
.accomp-bar {
  flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
  padding: 8px 12px; width: 100%;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.accomp-lbl { font-family: var(--f-head); font-weight: 700; color: var(--text-dim); font-size: clamp(14px, 1.6vw, 18px); margin-right: 4px; }
.accomp-opt { min-height: 72px; padding: 0 22px; border-radius: 999px; font-family: var(--f-head); font-weight: 700; font-size: clamp(15px, 1.8vw, 19px); color: var(--text-dim); white-space: nowrap; background: var(--surface); border: 1.5px solid var(--border); }
.accomp-opt.on { background: var(--accent); color: var(--on-accent); }
[data-theme="paper"] .accomp-opt.on { color: #fff; }
.accomp-opt:not(.on):hover { background: var(--surface-3); color: var(--text); }
.accomp-opt { display: inline-flex; align-items: center; gap: 7px; }
.accomp-opt.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); }
.accomp-opt.danger:hover { background: rgba(192,57,43,.12); color: var(--danger); }
.band-bar .accomp-lbl { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); }

/* smart-feature menu items that are currently active */
.menu-item.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }

/* beat bar */
.beat-bar {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 14px;
  height: 40px; margin: 8px auto 0; padding: 0 16px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); width: max-content;
}
.beat-pip { width: 14px; height: 14px; border-radius: 50%; background: var(--surface-3); transition: transform .1s, background .1s; }
.beat-pip.down { box-shadow: 0 0 0 2px var(--border-strong); }
.beat-pip.on { background: var(--accent); transform: scale(1.5); box-shadow: 0 0 16px var(--accent-glow); }
.beat-bpm { font-size: 12px; color: var(--text-muted); margin-left: 6px; }
.beat-bar.style-runner { width: min(420px, 70%); }
.beat-bar .runner { position: absolute; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent-glow); transition: left .08s linear; }

/* ===== rail ===== */
.rail {
  width: clamp(150px, 17vw, 200px); flex-shrink: 0; min-height: 0; height: 100%;
  display: flex; flex-direction: column; gap: 10px; padding: 10px 12px;
  background: var(--rail); border-left: 1px solid var(--border);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  overflow: hidden;            /* never scroll / clip — content is sized to fit */
}
/* the two groups split the rail height; their buttons grow to fill it (≥ ~1 grid cell) */
.rail-group, .rail-vol { flex: 1; min-height: 0; }
.rail-group { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.rail-grouplbl { flex: 0 0 auto; text-align: center; font-family: var(--f-head); text-transform: uppercase; letter-spacing: .1em; font-size: 13px; color: var(--text-muted); display: flex; align-items: center; justify-content: center; gap: 8px; }
.rail-val { font-family: var(--f-mono, monospace); font-size: 20px; font-weight: 800; color: var(--accent); letter-spacing: 0; }
.oct-read, .vol-read { flex: 0 0 auto; text-align: center; font-size: clamp(20px, 2.6vh, 30px); font-weight: 700; color: var(--accent); line-height: 1; }
/* only two groups remain → octave +/- and volume +/- fill the height (≥ ~1 grid cell), no scroll */
.rail-group .rail-btn { flex: 1; min-height: clamp(56px, 9vh, 150px); }
.rail-group .rail-btn svg { width: 32px; height: 32px; }
.rail-group .rail-btn .rail-lbl { font-size: 15px; }
.rail-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 54px; border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text); padding: 5px 4px; transition: transform .1s, background .15s, border-color .15s;
}
.rail-btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.rail-btn:active { transform: scale(.95); }
.rail-btn.active { border-color: var(--accent); background: var(--accent-glow); color: var(--accent); }
.rail-btn.danger.active { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 16%, transparent); color: #ff7a78; }
.rail-btn.big { min-height: 60px; }
.rail-lbl { font-size: 13px; font-weight: 600; }
.rail-sub { font-size: 11px; color: var(--text-muted); }
.rail-vol { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.vol-step { flex: 1; width: 100%; min-height: clamp(56px, 9vh, 150px); border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); display: flex; align-items: center; justify-content: center; }
.vol-step svg { width: 32px; height: 32px; }
.vol-step:hover { border-color: var(--accent); color: var(--accent); }
.vol-step:active { transform: scale(.94); }

/* instrument breadcrumb (with current instrument image) */
.inst-crumb { display: flex; align-items: center; gap: 8px; }
.crumb-logo { width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0; }
.crumb-thumb { width: 34px; height: 30px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.crumb-thumb svg { width: 28px; height: 26px; }

/* ===== sheets / panels ===== */
/* Panels are FULL PAGES (not popups/drawers): they fill the viewport, no scrim. */
.sheet-scrim { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: flex; flex-direction: column; }
.sheet {
  margin: 0; height: 100%; width: 100%; max-width: none; background: var(--bg);
  border: none; box-shadow: none; display: flex; flex-direction: column;
  animation: pageIn .18s ease;
}
.sheet.wide { width: 100%; }
@keyframes pageIn { from { opacity: .35; } to { opacity: 1; } }
.sheet-hd { display: flex; align-items: center; justify-content: center; padding: clamp(14px,3vh,28px) 18px clamp(10px,2vh,18px); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sheet-hd h3 { font-size: clamp(22px, 3.2vw, 32px); font-family: var(--f-head); font-weight: 800; }
/* centered, readable content column; scroll only as a last-resort safety net */
.sheet-bd { padding: clamp(10px,1.4vh,16px); overflow-y: auto; flex: 1; width: 100%; max-width: 1000px; margin: 0 auto; }
/* close = the standard Zurück button (matches the 10×6 grid cell, bottom-left) */
.sheet-close {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  align-self: flex-start; margin: 10px;
  width: calc(((100vw - 92px) / 10) * 2 + 8px);
  min-height: calc((100dvh - var(--footer-h, 30px) - 60px) / 6);
  border: 1.5px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text);
  font-family: var(--f-head); font-weight: 700; font-size: clamp(18px,2.2vw,22px); flex-shrink: 0;
}
.sheet-close:hover { background: var(--surface-3); }
.sheet-close:active { transform: scale(.98); }

/* ===== hamburger menu sheet ===== */
/* full-page menu: use the width → 2 columns so it never needs to scroll */
.menu-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 12px; align-content: start; }
.menu-list > .menu-group { grid-column: 1 / -1; }
.menu-group { padding-bottom: 2px; }
.menu-group .field-lbl { margin-bottom: 8px; }
.menu-group .seg { flex-wrap: nowrap; }
/* large, tile-like menu buttons (icon on top, label below) */
.menu-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: clamp(104px, 13vh, 122px); padding: 10px 12px; border-radius: var(--radius);
  background: var(--surface-2); border: 1.5px solid var(--border); color: var(--text);
  text-align: center; transition: background .15s, border-color .15s, transform .1s;
}
.menu-item:hover { background: var(--surface-3); border-color: var(--border-strong); }
.menu-item:active { transform: scale(.98); }
.menu-item > svg { flex-shrink: 0; color: var(--accent); width: 34px; height: 34px; }
.menu-item .menu-item-txt { display: flex; flex-direction: column; align-items: center; line-height: 1.2; min-width: 0; gap: 3px; }
.menu-item .menu-item-txt b { font-family: var(--f-head); font-weight: 700; font-size: clamp(18px, 2vw, 22px); }
.menu-item .menu-item-txt small { font-size: 13px; color: var(--text-muted); }
.menu-item.layout-item .lo-thumb { width: 76px; height: 50px; }

/* big bottom-left back bar (DigitalPainters 10x6 pattern: >=1 cell, bottom-left) */
/* Bottom-Nav transparent (kein Balken) → der „Zurück"-Button sitzt wie im Hub direkt auf der Seite. */
.bottom-nav { position: relative; display: flex; align-items: flex-end; gap: 8px; padding: 0 10px 10px 10px; flex-shrink: 0; }
/* „Zurück" = EXAKT eine Hub-Grid-Zelle: 2 Spalten × 1 Zeile (gleiche Formel wie .grid10), unten links. */
.nav-back {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  flex: 0 0 auto;
  width: calc(((100vw - 92px) / 10) * 2 + 8px);
  /* ≈ one grid cell, but capped so overlays don't waste a huge 1/6-viewport block (kept >=1x1) */
  min-height: clamp(96px, calc((100dvh - var(--footer-h, 30px) - 60px) / 6), 124px);
  border-radius: var(--radius);
  background: var(--surface-3); border: 2px solid var(--border-strong); color: var(--text);
  font-family: var(--f-head); font-weight: 700; font-size: clamp(20px, 2.6vw, 28px); letter-spacing: .01em;
}
.nav-back svg { width: clamp(30px, 3.4vw, 44px); height: clamp(30px, 3.4vw, 44px); }
.nav-back:hover { border-color: var(--accent); background: var(--accent-glow); color: var(--accent); }
.nav-back:active { transform: scale(.97); }
/* center the breadcrumb on the SCREEN midline (like the SuperHub), not in the
   leftover space beside the Zurück button */
.bottom-nav-mid { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.bottom-nav-mid > * { pointer-events: auto; }
.key-hint { color: var(--text-muted); font-size: 13px; letter-spacing: .06em; }
@media (max-width: 560px) {
  .nav-back span { display: none; }
  .nav-back { min-width: 76px; }
  .key-hint { display: none; }
}

.field-lbl { font-family: var(--f-head); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }
.field-lbl b { color: var(--accent); font-family: var(--f-mono); }
.hint { color: var(--text-muted); font-weight: 400; text-transform: none; letter-spacing: 0; font-family: var(--f-ui); }

.chip-row { display: flex; gap: 8px; }
.chip-row.wrap { flex-wrap: wrap; }
.chip { min-height: 64px; min-width: 72px; padding: 0 20px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1.5px solid var(--border); color: var(--text); font-weight: 600; font-size: 17px; }
.chip:hover { border-color: var(--border-strong); }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
[data-theme="paper"] .chip.on { color: #fff; }

.root-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.root-key { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 72px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1.5px solid var(--border); color: var(--text); font-weight: 700; font-size: 16px; }
.root-key .root-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--bw); }
.root-key.sharp { color: var(--text-dim); }
.root-key.on { border-color: var(--accent); background: var(--accent-glow); color: var(--accent); }
/* generic two-column panel body (used by Scale panel) — keeps pages scroll-free */
.panel-2col { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 10px 32px; align-items: start; }
.scale-group { margin-bottom: 6px; }
.scale-group-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 4px; font-family: var(--f-head); }

.stepper { display: flex; align-items: center; gap: 12px; }
.step-btn { width: 72px; height: 72px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; }
.step-btn:disabled { opacity: .35; }
.step-val { flex: 1; text-align: center; font-size: 18px; font-weight: 700; }

.slider { width: 100%; height: 36px; accent-color: var(--accent); }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-weight: 600; }
.toggle-row small { font-weight: 400; }
.switch { width: 58px; height: 34px; border-radius: 999px; background: var(--surface-3); position: relative; transition: background .18s; flex-shrink: 0; }
.switch.on { background: var(--accent); }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; transition: left .18s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch.on .knob { left: 27px; }

.divider { height: 1px; background: var(--border); margin: 18px 0; }

/* layout picker grid — large, grid-like tiles (~2×2 cells), filling the page */
.lo-pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-content: start; }
.lo-card { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 12px 12px 11px; border-radius: var(--radius); background: var(--surface-flat); border: 2px solid var(--border); min-height: clamp(104px, 14vh, 150px); }
.lo-card:hover { border-color: var(--border-strong); }
.lo-card.on { border-color: var(--accent); background: var(--accent-glow); }
.lo-card .lo-thumb { width: clamp(82px, 12vw, 120px); height: clamp(54px, 8vw, 80px); }
.lo-card-name { font-family: var(--f-head); font-weight: 700; font-size: clamp(16px, 1.8vw, 20px); line-height: 1.1; text-align: center; }
.lo-card-desc { font-size: clamp(12px, 1.3vw, 14px); color: var(--text-muted); text-align: center; line-height: 1.2; }
.lo-card.on .lo-thumb { background: var(--bg-2); }
.lo-card-tick { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; }
.sub-opt { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.sub-opt-lbl { display: block; font-family: var(--f-head); text-transform: uppercase; letter-spacing: .1em; font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }

/* record panel */
.rec-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.big-action { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 96px; border-radius: var(--radius); background: var(--surface-2); border: 1.5px solid var(--border); color: var(--text); font-weight: 700; font-size: 15px; }
.big-action:disabled { opacity: .4; }
.big-action.rec-on { background: color-mix(in srgb, var(--danger) 18%, transparent); border-color: var(--danger); color: #ff7a78; }
.rec-status { margin: 16px 0; min-height: 28px; }
.rec-pill { display: inline-flex; padding: 6px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 600; font-size: 14px; }
.rec-pill.live { background: color-mix(in srgb, var(--danger) 16%, transparent); border-color: var(--danger); color: #ff7a78; }
.rec-timeline { display: flex; flex-wrap: wrap; gap: 5px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: 16px; }
.rec-dot { width: 16px; height: 16px; border-radius: 4px; }
.io-row { display: flex; gap: 12px; }
.io-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 72px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1.5px solid var(--border); color: var(--text); font-weight: 600; }
.io-btn:disabled { opacity: .4; }
.io-btn:hover:not(:disabled) { border-color: var(--accent); }

/* key highlight on playback / follow-along */
.key.hl .key-face, .k-scan.hl .key-face { box-shadow: inset 0 0 0 4px #fff, 0 0 30px color-mix(in srgb, var(--bw) 80%, transparent); filter: brightness(1.3); }
.sector.hl .sector-fill { filter: brightness(1.5); }

/* ===== Notenband (score ribbon) + target key ===== */
.score-ribbon-wrap { margin: 8px 10px 0; padding: 8px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.score-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.score-title { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-head); font-weight: 600; font-size: 14px; }
.score-title svg { color: var(--accent); }
.score-hint { font-size: 12px; color: var(--text-muted); }
.score-stop { display: inline-flex; align-items: center; gap: 8px; padding: 0 20px; border-radius: 999px; background: var(--surface-3); color: var(--text); font-weight: 700; font-size: 16px; min-height: var(--tap); }
.score-ribbon { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 8px 2px; align-items: center; }
.score-note { position: relative; flex-shrink: 0; min-width: calc(30px + var(--dur, 1) * 9px); height: 46px; border-radius: 8px; background: var(--bw); display: flex; align-items: center; justify-content: center; font-family: var(--f-head); font-weight: 700; font-size: 16px; opacity: .92; transition: transform .15s, box-shadow .15s, opacity .15s; }
/* duration bar — wider note cell + longer bar = longer note value (rhythm cue) */
.score-dur { position: absolute; bottom: 3px; left: 16%; right: 16%; height: 3px; border-radius: 2px; background: currentColor; opacity: .4; }
.score-note sub { font-size: .55em; opacity: .7; }
.score-note.done { opacity: .28; }
.score-note.now { transform: scale(1.2); box-shadow: 0 0 0 3px #fff, 0 0 18px var(--bw); opacity: 1; }
/* lyrics under the note name */
.score-note.with-lyric { flex-direction: column; gap: 1px; height: auto; min-height: 46px; padding: 5px 7px 9px; min-width: calc(34px + var(--dur, 1) * 9px); }
.score-note.with-lyric .score-dur { left: 22%; right: 22%; bottom: 4px; }
.score-note-name { display: inline-flex; align-items: baseline; }
.score-syl { font-family: var(--f-body, inherit); font-weight: 700; font-size: 12px; color: inherit; opacity: .96; white-space: nowrap; line-height: 1; }
.staff-lyric { font-size: 13px; fill: var(--text-dim); font-family: var(--f-body, sans-serif); }
.staff-lyric.now { fill: var(--accent); font-weight: 700; }
.target .key-face, .sector.target .sector-fill, .k-scan.target .key-face {
  box-shadow: 0 0 0 4px #fff, 0 0 0 9px var(--bw), 0 0 28px var(--bw) !important;
  animation: targetPulse .8s ease-in-out infinite alternate;
}
@keyframes targetPulse { from { filter: brightness(1); } to { filter: brightness(1.32); } }

/* ===== real staff notation (Notenblatt) ===== */
.sheet-wrap { margin: 8px 10px 0; padding: 8px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.sheet-scroll { overflow-x: auto; padding: 2px 0; }
.staff-svg { display: block; }
.staff-line { stroke: var(--text-dim); stroke-width: 1.2; }
.clef { font-size: 54px; fill: var(--text); font-family: serif; }
.note-head { fill: var(--text); }
.note-stem { stroke: var(--text); stroke-width: 1.6; }
.accidental { font-size: 20px; fill: var(--text); }
.sheet-note.done .note-head { fill: var(--text-muted); opacity: .5; }
.sheet-note.done .note-stem { stroke: var(--text-muted); opacity: .5; }
.sheet-note.now .note-head { fill: var(--accent); }
.sheet-note.now .note-stem { stroke: var(--accent); }
.sheet-now-bg { fill: var(--accent-glow); }

/* ===== responsive: phone & narrow ===== */
@media (max-width: 720px) {
  .inst-top { flex-wrap: wrap; gap: 8px; }
  .seg-opt { flex: 1; justify-content: center; }
  .menu-btn { margin-left: auto; }
  .inst-main { flex-direction: column-reverse; }
  .rail { width: 100%; flex-direction: row; flex-wrap: wrap; border-left: none; border-top: 1px solid var(--border); align-items: center; justify-content: center; gap: 12px; }
  .rail-group { flex-direction: row; align-items: center; }
  .rail-group .rail-btn { min-height: var(--tap); min-width: 76px; }
  .rail-vol { flex-direction: row; }
  .vslider { writing-mode: horizontal-tb; direction: ltr; width: 120px; height: 34px; }
  .vol-step { min-height: var(--tap); }
}
@media (max-width: 480px) {
  .lo-pick-grid { grid-template-columns: 1fr; }
  .inst-name { font-size: 18px; }
}

/* ===== StepRange (slider + big +/-), BigToggle, rail vol +/- ===== */
.steprange { display: flex; align-items: stretch; gap: 12px; }
.sr-btn { width: 72px; min-height: 72px; flex-shrink: 0; border-radius: var(--radius-sm); background: var(--surface-2); border: 1.5px solid var(--border-strong); color: var(--text); display: flex; align-items: center; justify-content: center; }
.sr-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-glow); color: var(--accent); }
.sr-btn:active:not(:disabled) { transform: scale(.94); }
.sr-btn:disabled { opacity: .35; }
.sr-mid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.sr-mid .slider { width: 100%; }
.sr-val { font-size: 17px; font-weight: 700; color: var(--accent); }

.big-toggle { display: inline-flex; align-items: center; gap: 12px; min-height: 64px; padding: 0 16px 0 8px; border-radius: var(--radius); background: var(--surface-2); border: 1.5px solid var(--border); }
.big-toggle .bt-track { width: 72px; height: 40px; border-radius: 999px; background: var(--surface-3); position: relative; transition: background .18s; flex-shrink: 0; }
.big-toggle .bt-knob { position: absolute; top: 4px; left: 4px; width: 32px; height: 32px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); transition: left .18s; }
.big-toggle.on { border-color: var(--accent); background: var(--accent-glow); }
.big-toggle.on .bt-track { background: var(--accent); }
.big-toggle.on .bt-knob { left: 36px; }
.big-toggle .bt-state { font-family: var(--f-head); font-weight: 700; font-size: 15px; min-width: 34px; }

/* keep legacy small switch sized up too */
.switch { width: 64px; height: 38px; }
.switch .knob { width: 30px; height: 30px; }
.switch.on .knob { left: 30px; }

/* ===== global dwell ring ===== */
#gdwell { position: fixed; z-index: 9000; pointer-events: none; display: none; }
#gdwell.on { display: block; }
#gdwell svg { width: 100%; height: 100%; overflow: visible; }
#gdwell .gd-t { fill: none; stroke: color-mix(in srgb, var(--text) 28%, transparent); stroke-width: 5; }
#gdwell .gd-p { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; }

/* ===== microphone device picker ===== */
.mic-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 8px; }
.mic-dev { display: inline-flex; align-items: center; gap: 10px; min-height: 72px; padding: 0 16px; border-radius: 12px; background: var(--surface-2); border: 1.5px solid var(--border); color: var(--text); font-weight: 600; text-align: left; }
.mic-dev:hover { border-color: var(--accent); }
.mic-dev.on { border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* ===== MIDI-Learn / key-mapping panel ===== */
.map-sec { grid-column: 1 / -1; }
.map-hint { font-size: 13px; color: var(--text-muted); line-height: 1.4; margin: 0 0 10px; }
.map-grouph { font-family: var(--f-head); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--text-muted); margin: 10px 0 6px; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 16px; }
.map-row { display: flex; align-items: center; gap: 8px; }
.map-lbl { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.map-bind { flex: 0 0 auto; min-width: 92px; text-align: center; font-family: var(--f-mono, monospace); font-size: 13px; color: var(--text-muted); padding: 4px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); }
.map-bind.set { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.map-bind.learning { color: var(--accent); border-color: var(--accent); animation: mapPulse 1s ease-in-out infinite; }
@keyframes mapPulse { 50% { background: var(--accent-glow); } }
.map-learn { flex: 0 0 auto; min-height: 60px; padding: 0 18px; border-radius: 999px; font-family: var(--f-head); font-weight: 700; font-size: 15px; background: var(--surface-2); border: 1.5px solid var(--border); color: var(--text); }
.map-learn:hover { border-color: var(--accent); color: var(--accent); }
.map-clear { flex: 0 0 auto; min-width: 60px; min-height: 60px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); font-size: 16px; }
.map-clear:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); }

/* ===== DP-style settings ===== */
/* Responsive 2-column grid so all four sections fit on one screen (no scroll) on
   wide displays; gracefully stacks to one column on narrow/portrait screens. */
.settings-pane { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 4px 32px; align-content: start; }
.set-sec { padding: 14px 0; border-bottom: 1px solid var(--border); }
.set-sec:last-child { border-bottom: none; }
/* in 2-col layout, drop the divider on the last item of each column visually */
@media (min-width: 760px) { .set-sec { border-bottom: none; } }
.set-sec-hd { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.set-sec-hd svg { color: var(--accent); }
.set-sec-hd h3 { font-size: 16px; font-family: var(--f-head); text-transform: uppercase; letter-spacing: .08em; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; font-weight: 600; }
.set-row:last-child { margin-bottom: 0; }
.set-col { display: flex; flex-direction: column; gap: 8px; }
.set-lbl { font-weight: 600; }
.set-row .seg { flex-wrap: wrap; justify-content: flex-end; }

.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.lang-pick { display: flex; align-items: center; gap: 10px; min-height: 72px; padding: 0 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1.5px solid var(--border); color: var(--text); }
.lang-pick:hover { border-color: var(--border-strong); }
.lang-pick.on { border-color: var(--accent); background: var(--accent-glow); }
.lang-code { font-size: 18px; font-weight: 700; color: var(--accent); }
.lang-name { font-size: 14px; }

/* ===== Paged settings (Tabs → je Seite ohne Scrollen) ===== */
.settings-paged { display: flex; flex-direction: column; gap: clamp(10px,1.6vh,18px); height: 100%; }
.set-tabs { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; flex-shrink: 0; }
.set-tab { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: clamp(60px,8.5vh,76px); min-width: 110px; padding: 0 16px; border-radius: var(--radius-sm); background: var(--surface-2);
  border: 2px solid var(--border); color: var(--text-dim); font-family: var(--f-head); font-weight: 700; font-size: clamp(14px,1.6vw,17px); }
.set-tab svg { color: var(--accent); }
.set-tab:hover { border-color: var(--border-strong); color: var(--text); }
.set-tab.on { border-color: var(--accent); background: var(--accent-glow); color: var(--accent); }
.set-page { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-start; max-width: 820px; width: 100%; margin: 0 auto; }
.set-page .set-sec { border-bottom: none; padding: 0; }
.set-page .set-row { margin-bottom: clamp(10px,1.6vh,18px); }
.set-page .set-col { margin-bottom: clamp(10px,1.6vh,18px); gap: clamp(6px,1vh,10px); }
.set-sub-hd { margin: 6px 0 10px; font-family: var(--f-head); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 14px; color: var(--text-muted); }
.seg-wrap { flex-wrap: wrap; }

/* MIDI-Learn: rows must never break the grid; learning shows a banner instead of overflowing the cell */
.map-grid { grid-template-columns: repeat(auto-fill, minmax(284px, 1fr)); gap: 4px 16px; }
.map-grouph { margin: 6px 0 4px; }
.map-row { margin: 2px 0; }
.map-learn { min-height: 54px; }
.map-clear { min-width: 54px; min-height: 54px; }
.map-pane .map-hint { margin: 0 0 8px; }
.map-row { min-width: 0; }
.map-bind { flex: 0 0 88px; width: 88px; max-width: 88px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.map-learning-banner { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--accent-glow); border: 1.5px solid var(--accent); color: var(--accent); font-weight: 700; }
.map-learning-banner svg { color: var(--accent); }
.map-learning-banner small { font-weight: 600; color: var(--text-muted); }
.map-row.is-learning .map-bind.learning { background: var(--accent-glow); }

/* ===== font-size scaling (Darstellung) ===== */
[data-fontsize="small"] { font-size: 14px; }
[data-fontsize="large"] .cat-name, [data-fontsize="large"] .inst-name, [data-fontsize="large"] .seg-opt,
[data-fontsize="large"] .rail-lbl, [data-fontsize="large"] .chip, [data-fontsize="large"] .crumb-pill,
[data-fontsize="large"] .modal-bd p, [data-fontsize="large"] .set-row, [data-fontsize="large"] .song-row,
[data-fontsize="large"] .lang-name, [data-fontsize="large"] .nav-back, [data-fontsize="large"] .sheet-close { font-size: 1.18em; }
[data-fontsize="large"] .key-label.big, [data-fontsize="large"] .sector-label { font-size: clamp(26px, 5vw, 56px); }
[data-fontsize="large"] .cat-desc, [data-fontsize="large"] .hint { font-size: 14px; }
[data-fontsize="small"] .cat-desc, [data-fontsize="small"] .hint { font-size: 11px; }

/* ===== reduce motion (Darstellung) ===== */
.reduce-anim *, .reduce-anim *::before, .reduce-anim *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }

/* ===== RTL ===== */
[dir="rtl"] .seg-opt, [dir="rtl"] .rail-btn, [dir="rtl"] .big-action { direction: rtl; }
[dir="rtl"] .nav-back svg, [dir="rtl"] .sheet-close svg, [dir="rtl"] .icon-btn svg { transform: scaleX(-1); }
