/* Quest view (quest.js). Everything is scoped to #questView / .quest-toggle so the sound grid is untouched. */
.quest-toggle {
  background: #d9a441; color: #1b130a; border: 0; border-radius: 8px;
  font: 700 13px -apple-system, system-ui, sans-serif; letter-spacing: 1px;
  padding: 6px 12px; margin-right: 6px; cursor: pointer;
}
html.quest-open, html.quest-open body { overflow: hidden; }
#questView {
  --q-bg:#14110f; --q-panel:#221c18; --q-btn:#3a2f27; --q-on:#d9a441; --q-txt:#f3e9dc; --q-dim:#9c8f80; --q-red:#c0392b;
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10000; background: var(--q-bg); color: var(--q-txt);
  font: 600 15px -apple-system, system-ui, sans-serif; padding: 8px; box-sizing: border-box;
  grid-template-rows: auto 1fr; gap: 8px;
}
#questView.q-open { display: grid; }
#questView * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
#questView button { background: var(--q-btn); color: var(--q-txt); border: 0; border-radius: 10px; font: inherit; padding: 0 6px; min-height: 50px; touch-action: manipulation; }
#questView button:active { filter: brightness(1.5); }
#questView button.q-on { background: var(--q-on); color: #1b130a; }
#questView .q-flash { animation: qfl .35s; }
@keyframes qfl { from { filter: brightness(2.2); } to { filter: none; } }
#questView .q-header { display: flex; align-items: center; gap: 8px; background: var(--q-panel); border-radius: 12px; padding: 8px; }
#questView .q-back { min-width: 96px; }
#questView a.q-map { background: #4f8fc0; color: #0e1a24; border-radius: 10px; min-height: 50px; padding: 0 14px; display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; font-size: 15px; }
#questView .q-title { font-size: 18px; letter-spacing: 1px; color: var(--q-on); }
#questView .q-now { flex: 1; display: flex; gap: 6px; overflow: hidden; }
#questView .q-chip { background: #2b241f; color: var(--q-dim); border-radius: 8px; padding: 6px 9px; font-size: 13px; white-space: nowrap; }
#questView .q-chip b { color: var(--q-txt); }
#questView .q-bpm { font-size: 22px; min-width: 52px; text-align: center; cursor: pointer; padding: 6px 4px; border-radius: 8px; background: #2b241f; }
#questView .q-toast { display: none; position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--q-red); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 5; font-size: 15px; }
#questView .q-toast.q-show { display: block; }
#questView .q-sheet { display: none; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.6); z-index: 4; align-items: center; justify-content: center; }
#questView .q-sheet.q-show { display: flex; }
#questView .q-card { background: var(--q-panel); border-radius: 16px; padding: 14px 16px 16px; width: 320px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
#questView .q-card h3 { margin: 0; font-size: 12px; letter-spacing: 1px; color: var(--q-dim); text-transform: uppercase; }
#questView .q-wheelbox { position: relative; width: 100%; height: 280px; }
#questView .q-band { position: absolute; left: 0; right: 0; top: 112px; height: 56px; border-radius: 12px; background: #3a2f27; pointer-events: none; }
#questView #qTempoWheel { position: relative; height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: y mandatory; touch-action: pan-y; padding: 112px 0; }
#questView #qTempoWheel div { height: 56px; line-height: 56px; text-align: center; font-size: 30px; font-weight: 700; scroll-snap-align: center; color: var(--q-dim); font-variant-numeric: tabular-nums; }
#questView #qTempoWheel div.q-cur { color: var(--q-on); }
#questView .q-row { display: flex; gap: 8px; width: 100%; }
#questView .q-row button { flex: 1; min-height: 46px; }
#questView .q-tap { min-width: 72px; background: #4b3b2c; }
#questView .q-stop { background: var(--q-red); min-width: 100px; }
#questView .q-main { display: grid; grid-template-columns: 1.45fr 1fr; gap: 8px; min-height: 0; }
#questView section { background: var(--q-panel); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 7px; min-height: 0; overflow: hidden; }
#questView h2 { margin: 2px 0 0; font-size: 12px; color: var(--q-dim); letter-spacing: 1px; text-transform: uppercase; display: flex; justify-content: space-between; align-items: center; }
#questView h2 button { min-height: 30px; font-size: 12px; padding: 0 10px; }
#questView .q-grid { display: grid; gap: 6px; }
#questView .q-g3 { grid-template-columns: repeat(3, 1fr); }
#questView .q-g4 { grid-template-columns: repeat(4, 1fr); }
#questView .q-tabs { display: flex; gap: 4px; }
#questView .q-tabs button { flex: 1; min-height: 44px; font-size: 15px; }
#questView .q-sub button { min-height: 36px; font-size: 13px; }
#questView .q-pane { display: none; flex-direction: column; gap: 7px; min-height: 0; }
#questView .q-pane.q-show { display: flex; }
#questView #qPatches button { background: #2e3f5c; min-height: 54px; }
#questView #qStyles button { background: #5c3b2e; min-height: 46px; font-size: 14px; }
#questView #qBuilds button { background: #4a2e4f; min-height: 46px; font-size: 14px; }
#questView #qScenes button, #questView #qLayers button { background: #3b4a2e; }
#questView #qSfx button { background: #5a3a6e; min-height: 52px; }
#questView #qStingers button { background: #2f5e4e; min-height: 44px; font-size: 13px; }
#questView .q-split { display: flex; align-items: center; gap: 8px; background: #2b241f; border-radius: 10px; padding: 6px 8px; font-size: 13px; color: var(--q-dim); }
#questView .q-split b { color: var(--q-txt); }
#questView .q-split button { min-height: 34px; min-width: 40px; }
#questView .q-grow { flex: 1; }
#questView .q-levels { display: grid; gap: 14px; padding: 6px 4px; }
#questView .q-levels label { display: flex; flex-direction: column; color: var(--q-dim); font-size: 13px; gap: 4px; }
#questView input[type=range] { width: 100%; height: 40px; accent-color: var(--q-on); }
#questView .q-help { color: var(--q-dim); font-size: 13px; line-height: 1.45; font-weight: 500; }
#questView .q-banner { display: none; position: absolute; top: 0; left: 0; right: 0; background: var(--q-red); color: #fff; text-align: center; padding: 8px; z-index: 2; }
#questView.q-offline .q-banner { display: block; }
#questView.q-offline main button, #questView.q-offline main input { opacity: .35; pointer-events: none; }
#questView #qPatches button.q-on, #questView #qStyles button.q-on, #questView #qBuilds button.q-on, #questView #qScenes button.q-on,
#questView #qLayers button.q-on { background: var(--q-on); color: #1b130a; }

#questView .q-levels label { display: grid; grid-template-columns: 118px 1fr 58px; align-items: center; gap: 8px; }
#questView .q-db { color: var(--q-dim, #aaa); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
#questView .q-bal { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; font-size: 13px; color: var(--q-dim, #aaa); }
#questView .q-stylectl button { min-height: 40px; font-size: 14px; }
#questView .q-keypick { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--q-dim, #aaa); }
#questView .q-keypick select { font-size: 15px; min-height: 34px; border-radius: 8px; }
#questView { grid-template-columns: minmax(0, 1fr); }
#questView .q-header { flex-wrap: wrap; }
#questView .q-stylectl button:disabled { opacity: .35; }

/* v3 (2026-10-16): panels scroll, tighter buttons, vertical faders with large handles */
#questView { height: 100vh; height: 100dvh; }
#questView button { min-height: 42px; }
#questView .q-header button { min-height: 38px; }
#questView .q-main { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
#questView section { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
#questView .q-pane { flex: none; }
#questView .q-tabs button { min-height: 38px; }
#questView .q-sub button { min-height: 32px; }
#questView #qPatches button { min-height: 44px; }
#questView #qStyles button, #questView #qBuilds button { min-height: 40px; }
#questView #qSfx button { min-height: 44px; }
#questView #qStingers button { min-height: 40px; }
#questView .q-stylectl button { min-height: 36px; }
#questView .q-levels { display: grid; grid-template-columns: repeat(var(--q-n, 8), 1fr); gap: 6px; height: min(62vh, 430px); padding: 4px 0; }
#questView .q-strip { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
#questView .q-strip .q-db { font-size: 12px; height: 16px; text-align: center; }
#questView .q-strip .q-name { font-size: 12px; color: var(--q-txt); text-align: center; line-height: 1.15; height: 30px; overflow: hidden; }
#questView .q-ftrack { position: relative; flex: 1; width: 100%; max-width: 74px; border-radius: 12px; background: #17120f; touch-action: none; }
#questView .q-ftrack::before { content: ""; position: absolute; left: 50%; top: 22px; bottom: 22px; width: 6px; margin-left: -3px; border-radius: 3px; background: #3a2f27; }
#questView .q-ffill { position: absolute; left: 50%; bottom: 22px; width: 6px; margin-left: -3px; border-radius: 3px; background: var(--q-on); opacity: .55; }
#questView .q-fthumb { position: absolute; left: 4px; right: 4px; height: 40px; margin-top: -20px; border-radius: 10px; background: #e8dccb; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
#questView .q-fthumb::after { content: ""; position: absolute; left: 18%; right: 18%; top: 50%; height: 3px; margin-top: -1.5px; background: #5a4a3c; border-radius: 2px; }
#questView .q-ftrack.q-drag .q-fthumb { background: var(--q-on); }
#questView input[type=range] { height: 44px; -webkit-appearance: none; appearance: none; background: transparent; }
#questView input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: #3a2f27; }
#questView input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 42px; height: 34px; margin-top: -13px; border-radius: 10px; background: #e8dccb; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
#questView.q-offline .q-ftrack { opacity: .35; pointer-events: none; }
#questView #qFxTabs { overflow-x: auto; flex-wrap: nowrap; flex-shrink: 0; }
#questView #qFxTabs button { flex: 0 0 auto; padding: 0 10px; }

/* v4 (2026-10-18): big centred A/B/Fill/End, left/right-hand boxes, chord map with next-chord hints and modes & colours */
#questView .q-stylectl { display: flex; justify-content: center; gap: 10px; padding: 4px 0; }
#questView .q-stylectl button { flex: 0 1 150px; min-height: 84px; font-size: 30px; font-weight: 700; border-radius: 14px; background: #2f3a2a; }
#questView .q-stylectl button.q-on { background: var(--q-on); color: #111; }
#questView .q-hand { display: flex; align-items: center; gap: 8px; background: #2b241f; border-radius: 10px; padding: 8px 10px; font-size: 14px; color: var(--q-dim); flex: none; }
#questView .q-hand .q-lbl { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--q-dim); display: block; }
#questView .q-hand .q-val { font-size: 18px; color: var(--q-txt); display: block; line-height: 1.25; }
#questView .q-hand button { min-height: 40px; min-width: 44px; font-size: 18px; }
#questView .q-modesw { display: flex; flex: none; }
#questView .q-modesw button { min-height: 40px; font-size: 13px; padding: 0 10px; border-radius: 0; }
#questView .q-modesw button:first-child { border-radius: 10px 0 0 10px; } #questView .q-modesw button:last-child { border-radius: 0 10px 10px 0; }
