/* WOW Studios — Session room additions: Tools tab (Tune, Stretch, Vocal-focus split, instruments, notes),
   automation lanes, cross-track clip drag, Master v1 bounce, Dspaid Vocal Engine presets.
   Phone-first: everything fits 390 px with no horizontal page overflow. Uses the tokens from styles.css. */

/* phone tab: Tools */
@media (max-width: 767px) {
  .ses[data-tab="tools"] .pane:not([data-pane="tools"]) { display: none; }
}
@media (max-width: 420px) { .ses-tabs button { font-size: 13px; padding: 0 2px; } }
@media (min-width: 768px) { .ses-grid .tools { grid-column: 1 / -1; } }

/* tools pane */
.tool { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); min-width: 0; }
.tool:first-of-type { border-top: 0; padding-top: 4px; }
.tool p { margin: 0; }
.tool-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.tool-head h3 { margin: 0; font: 650 16px/1.3 var(--sans); color: var(--gold-hi); }
.tool-head .small { overflow-wrap: anywhere; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 14px; align-items: end; min-width: 0; }
.tool-grid > * { min-width: 0; }
.tool-grid label.mini { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 650; }
.tool-grid label.mini select, .tool-grid label.mini input { width: 100%; min-height: 44px; font-family: var(--sans); }
.tool .btn { justify-self: start; max-width: 100%; }
.tool-seg { max-width: 420px; }
.tool-seg button { min-height: 40px; font-size: 13.5px; }
.warn-line { color: var(--warn) !important; }
.ses .tbtns .tkind, .tkind { color: var(--gold); }

/* automation lanes */
.autosvg { position: absolute; top: 0; left: 0; z-index: 4; overflow: visible; pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.autosvg.on { pointer-events: auto; touch-action: pan-x pan-y; cursor: crosshair; background: rgba(6, 6, 8, 0.35); }
.autosvg .zero { stroke: rgba(243, 220, 148, 0.18); stroke-dasharray: 4 6; }
.autosvg .curve { fill: none; stroke: var(--gold-hi); stroke-width: 2; }
.autosvg.ghost .curve { stroke: rgba(243, 220, 148, 0.45); stroke-width: 1.5; }
.autosvg .curve.empty { stroke-dasharray: 2 6; opacity: 0.6; }
.autosvg .apt { fill: var(--gold-hi); stroke: #1a1406; stroke-width: 2; pointer-events: none; }
.autosvg .apt-hit { fill: transparent; touch-action: none; cursor: grab; }
.autosvg text { fill: var(--gold); font: 700 10px var(--sans); letter-spacing: 0.06em; text-transform: uppercase; pointer-events: none; }
.arr.auto-on .clip { opacity: 0.6; }
.auto-note { margin: 0 0 10px; }
.clip.xtrack { z-index: 6; opacity: 0.9; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6), 0 0 0 2px var(--gold-hi); }

/* instruments: on-screen keys + drum pads */
.piano { position: relative; display: flex; height: 132px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; min-width: 0; }
.piano .wk { flex: 1 1 0; min-width: 0; border: 0; border-right: 1px solid #2a2a32; background: linear-gradient(180deg, #f4efe2, #d9d2bf); display: flex; align-items: flex-end; justify-content: center; padding: 0 0 6px; touch-action: none; }
.piano .wk:last-of-type { border-right: 0; }
.piano .wk small { font: 700 10px var(--mono); color: #4a4434; }
.piano .bk { position: absolute; top: 0; height: 60%; border: 0; border-radius: 0 0 6px 6px; background: linear-gradient(180deg, #1b1b22, #0b0b0f); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); z-index: 2; padding: 0; touch-action: none; }
.piano .wk.on { background: linear-gradient(180deg, #f7e7ad, #d4af37); }
.piano .bk.on { background: linear-gradient(180deg, #a47c24, #6b5016); }
.pads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
@media (min-width: 768px) { .pads { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pad { min-height: 84px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); display: grid; place-content: center; gap: 2px; touch-action: none; }
.pad b { font-size: 15px; }
.pad small { font: 600 11px var(--mono); color: var(--muted); }
.pad.on { background: var(--gold-grad); color: #1a1406; }
.pad.on small { color: #1a1406; }
.octave { display: flex; align-items: center; gap: 6px; }
.octave output { font: 600 14px var(--mono); color: var(--gold-hi); min-width: 34px; text-align: center; }
.octave .btn.sm { width: 44px; padding: 0; font-size: 18px; }
.inst-row { gap: 8px; }
.btn.rec-on { background: var(--rec); color: #fff; border-color: transparent; }

/* note editor */
.roll { width: 100%; height: 120px; display: block; border-radius: 10px; background:
  repeating-linear-gradient(180deg, rgba(212, 175, 55, 0.05) 0 10px, transparent 10px 20px), var(--bg); border: 1px solid var(--line); }
.roll rect { fill: color-mix(in srgb, var(--gold) 70%, transparent); stroke: #1a1406; stroke-width: 0.5; cursor: pointer; }
.roll rect.sel { fill: var(--gold-hi); }
.nlist { display: grid; gap: 6px; max-height: 340px; overflow-y: auto; overscroll-behavior: contain; min-width: 0; }
.nrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 4px 4px 4px 8px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); min-width: 0; }
.nrow.sel { border-color: var(--gold); }
.nrow .nt { display: grid; text-align: left; gap: 1px; border: 0; background: transparent; color: var(--text); padding: 4px 0; min-width: 0; }
.nrow .nt b { font: 650 14px var(--mono); color: var(--gold-hi); }
.nrow .nt span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbtns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nbtns .btn.sm { min-height: 38px; min-width: 38px; padding: 0 6px; font-size: 13px; }
@media (max-width: 420px) {
  .nrow { grid-template-columns: 1fr; }
  .nbtns { justify-content: flex-start; }
  .nbtns .btn.sm { flex: 1 1 0; min-width: 0; }
}

/* bounce: Master v1 */
.mtargets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 1100px) { .mtargets { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mtarget { display: grid; gap: 2px; text-align: left; min-height: 56px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); min-width: 0; }
.mtarget b { font-size: 14px; }
.mtarget small { font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.mtarget[aria-checked="true"] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; background: rgba(212, 175, 55, 0.08); }
.mtarget[aria-checked="true"] b { color: var(--gold-hi); }
.facts3 .fact .v { font-size: 20px; }
@media (min-width: 1100px) { .facts3 { grid-template-columns: repeat(4, 1fr); } }
.floor { margin-top: 12px; padding: 12px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.floor .between { flex-wrap: wrap; }
.floor ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.floor li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; align-items: start; font-size: 13.5px; overflow-wrap: anywhere; }
.floor .tick { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.floor li.pass .tick { background: var(--ok); color: #04170c; }
.floor li.fail .tick { background: var(--warn); color: #1a1406; }
.floor .ok { color: var(--ok); margin-left: 6px; }
.floor .no { color: var(--warn); margin-left: 6px; }

/* Dspaid Vocal Engine presets */
.vengine { display: grid; gap: 6px; margin: 0 0 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(212, 175, 55, 0.04); min-width: 0; }
.vengine p { margin: 0; }
.ve-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; min-width: 0; }
.ve-pick { display: grid; gap: 4px; flex: 1 1 200px; min-width: 0; font-size: 12.5px; color: var(--muted); font-weight: 650; }
.vengine label.mini.ve-pick select { width: 100%; min-height: 44px; font-family: var(--sans); }
.chain { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 3px; font-size: 13px; }
.chain b { color: var(--gold-hi); font-weight: 650; }

/* arrange tool row: the extra buttons wrap instead of pushing the page wider on a phone */
.arr-tools .tg { flex-wrap: wrap; min-width: 0; }
