/* Sound tool — page styles on top of tools.css */
[hidden] { display: none !important; }
.sbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px var(--g) 0; }
.sbar .tabs button { font-size: 13.5px; padding: 8px 16px; }
.sbar-r { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sbar-r #trackName { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bpm-badge { padding: 7px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); white-space: nowrap; }
.bpm-badge b { font-weight: 400; color: var(--accent); }
.pane .split { padding-top: 16px; }
.col { display: grid; gap: 18px; min-width: 0; }
.tag { font-size: 10px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 99px; letter-spacing: .08em; color: var(--muted); }
.tag.gold { color: var(--accent); border-color: rgba(15,154,150,.4); }
.fl { white-space: nowrap; }

/* ---------- tempo: empty, loading, viewer ---------- */
.wavepanel { position: relative; overflow: hidden; min-height: 420px; display: grid; }
.empty { position: relative; display: grid; grid-template-rows: 1fr auto; gap: 14px; padding: 18px; }
.idle-wave { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .9; }
.empty .drop { position: relative; min-height: 300px; background: radial-gradient(120% 90% at 50% 50%, rgba(20, 19, 18,.2), rgba(20, 19, 18,.82) 70%); backdrop-filter: blur(1.5px); }
.empty .drop b { font-size: clamp(34px, 4.4vw, 58px); line-height: 1; }
.empty .drop .mono { color: var(--accent); }
.empty-cta { position: relative; justify-content: center; }
.loading { display: grid; place-content: center; justify-items: center; gap: 16px; padding: 40px; color: var(--soft); }
.loading .bar { width: min(320px, 70vw); height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.loading .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s var(--ease); box-shadow: 0 0 10px var(--accent); }
.spin { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line2); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.viewer { display: grid; grid-template-rows: auto auto auto auto; min-width: 0; }
.vtop { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.vtop .row { gap: 6px; }
.clock { font-size: 15px; color: var(--ink); letter-spacing: .04em; margin-left: 8px; min-width: 92px; font-variant-numeric: tabular-nums; }
.vsep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.btn.tog.on { color: #141312; background: var(--accent); border-color: var(--accent); }
.btn .i-pause, .btn.on .i-play { display: none; }
.btn.on .i-pause { display: block; }
#playBtn.on { background: var(--accent); border-color: var(--accent); }
.wave-wrap { position: relative; height: 300px; background: linear-gradient(180deg, rgba(250, 248, 243,.015), rgba(20, 19, 18,0) 40%), var(--bg); touch-action: none; }
#wave { width: 100%; height: 100%; outline: none; touch-action: none; }
.hover-time { position: absolute; top: 34px; padding: 3px 7px; background: rgba(20, 19, 18,.85); border: 1px solid var(--line); border-radius: 6px; color: var(--soft); font-size: 10px; pointer-events: none; white-space: nowrap; }
#overview { width: 100%; height: 40px; border-top: 1px solid var(--line); cursor: pointer; background: var(--bg2); touch-action: none; }
.vfoot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px 8px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.vfoot .kbd { font-size: 9.5px; }
.info-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.info-strip > div { padding: 14px 16px; border-right: 1px solid var(--line); display: grid; gap: 4px; min-width: 0; }
.info-strip > div:last-child { border-right: 0; }
.info-strip b { font-weight: 300; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* side: tempo */
.bpm-big { display: flex; align-items: baseline; gap: 10px; margin: -4px 0 12px; }
.bpm-big .display { font-size: 92px; line-height: .85; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.bpm-big .display em { color: var(--muted); font-size: .5em; letter-spacing: 0; }
.bpm-big .mono { color: var(--accent); }
.conf { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.conf-bar { flex: 1; height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.conf-bar i { display: block; height: 100%; background: linear-gradient(90deg, rgba(15,154,150,.5), var(--accent)); border-radius: 3px; transition: width .8s var(--ease); }
.conf .mono { font-size: 10px; color: var(--soft); white-space: nowrap; }
.alts { margin-bottom: 12px; }
.alts .chip span { color: var(--faint); font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; margin-left: 3px; }
.alts .chip.on span { color: #57544e; }
.bpm-edit { gap: 6px; flex-wrap: nowrap; }
.bpm-edit .inp { width: 88px; text-align: center; padding: 7px 8px; font-size: 13px; -moz-appearance: textfield; }
.bpm-edit .inp::-webkit-inner-spin-button { -webkit-appearance: none; }
.reset { margin-top: 10px; }
.tap { width: 100%; display: grid; place-items: center; gap: 4px; padding: 20px 10px 16px; border: 1px solid var(--line2); border-radius: var(--r); background: radial-gradient(80% 120% at 50% 100%, rgba(15,154,150,.06), transparent 70%); transition: border-color .3s, transform .15s var(--ease); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.tap:hover { border-color: var(--muted); }
.tap .display { font-size: 52px; line-height: .9; font-variant-numeric: tabular-nums; }
.tap .display em { color: var(--muted); font-size: .5em; }
.tap .mono { font-size: 10px; color: var(--muted); }
.tap.hit { animation: taphit .35s var(--ease); }
@keyframes taphit { 0% { border-color: var(--accent); box-shadow: 0 0 0 0 rgba(15,154,150,.35); transform: scale(.985); } 100% { box-shadow: 0 0 0 14px rgba(15,154,150,0); transform: none; } }
.tap-row { margin-top: 10px; justify-content: space-between; }
.db-row { margin-top: 12px; gap: 6px; }
.db-row .fl { margin-right: auto; }
.nudge { gap: 6px; margin: 8px 0 10px; }
.nudge .hint { margin-left: auto; font-size: 11px; }
#offOut { font-size: 10.5px; color: var(--soft); }

/* ---------- cut sheet ---------- */
.cut-viz { overflow: hidden; }
.cv-head { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.cv-head > div { padding: 16px 18px 14px; border-right: 1px solid var(--line); display: grid; gap: 6px; min-width: 0; }
.cv-head > div:last-child { border-right: 0; }
.cv-head .display { font-size: clamp(34px, 3.6vw, 52px); line-height: .9; font-weight: 400; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cv-head .display em { color: var(--muted); font-size: .5em; }
#cutStrip { width: 100%; height: 110px; }
.no-track { padding: 12px 18px; border-top: 1px solid var(--line); }
.no-track a { color: var(--accent); }
.table-panel { overflow: hidden; }
.tp-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--line); }
.tp-head h3 { font-size: 10.5px; font-weight: 400; letter-spacing: .1em; }
.table-wrap { max-height: 560px; overflow: auto; scrollbar-width: thin; }
table.cuts { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
table.cuts th { position: sticky; top: 0; background: var(--bg2); text-align: left; font-weight: 400; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.cuts td { padding: 8px 14px; border-bottom: 1px solid rgba(250, 248, 243,.05); color: var(--soft); white-space: nowrap; }
table.cuts tr.down td:nth-child(2) { color: var(--accent); }
table.cuts td.tc { color: var(--ink); }
table.cuts td span { color: var(--faint); }
table.cuts tr:hover td { background: rgba(250, 248, 243,.025); }
table.cuts td.none { text-align: center; color: var(--muted); padding: 30px; }
.tc-row { margin-top: 14px; justify-content: space-between; }
.tc-row .seg button { font-family: var(--mono); font-size: 11px; }
.side .hint { margin-top: 10px; }
.plan-row { align-items: flex-end; flex-wrap: nowrap; }
.plan-row .field { margin: 0; width: 84px; }
.plan-row .btn { flex: 1; }
.plan-out { margin-top: 12px; }
.plan-strip { display: flex; gap: 2px; height: 30px; border-radius: 8px; overflow: hidden; }
.plan-strip i { min-width: 3px; background: rgba(15,154,150,.22); display: grid; place-items: center; font-style: normal; }
.plan-strip i:nth-child(2n) { background: rgba(250, 248, 243,.1); }
.plan-strip b { font-family: var(--mono); font-weight: 400; font-size: 10px; color: var(--soft); overflow: hidden; }
.exp { display: grid; gap: 6px; }
.exp .btn { justify-content: space-between; border-radius: 12px; padding: 11px 14px; }
.exp .btn b { font-weight: 400; color: var(--ink); }
.exp .btn .mono { font-size: 9.5px; color: var(--muted); }
.exp .btn:hover { border-color: var(--accent); }
.exp .btn:hover .mono { color: var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--accent); margin-top: 3px; }
.howto h4 { font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 18px 0 6px; }
.howto h4:first-child { margin-top: 0; }
.howto p { color: var(--soft); font-size: 14px; }
.howto b { font-weight: 500; color: var(--ink); }

/* ---------- SFX ---------- */
.sfx-stage { overflow: hidden; }
.stage-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; padding: 18px 18px 14px; flex-wrap: wrap; }
.stage-head .display { font-size: clamp(40px, 4.6vw, 68px); margin-top: 8px; }
.stage-head .display em { color: var(--accent); }
.stage-head .fl { color: var(--muted); }
.btn.icon.big { width: 56px; height: 56px; }
.btn.icon.big svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
#sfxPlay.on { background: var(--accent); border-color: var(--accent); }
.stage-wrap { position: relative; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg); }
#sfxCanvas { width: 100%; height: 340px; }
.rendering { position: absolute; top: 12px; right: 14px; font-size: 10px; color: var(--accent); opacity: 0; transition: opacity .3s; display: flex; align-items: center; gap: 8px; }
.rendering::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse .8s ease-in-out infinite alternate; }
.rendering.on { opacity: 1; }
@keyframes pulse { from { opacity: .3; } to { opacity: 1; } }
.stage-foot { display: flex; gap: 20px; flex-wrap: wrap; padding: 12px 18px; color: var(--muted); font-size: 10px; }
.stage-foot span:first-child { color: var(--ink); }
.presets-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 6px; }
.presets-head h3 { font-size: 10.5px; font-weight: 400; letter-spacing: .1em; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.preset { text-align: left; display: grid; gap: 4px; padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg2); transition: border-color .3s, background .3s, transform .4s var(--ease); }
.preset:hover { border-color: var(--faint); transform: translateY(-2px); }
.preset.on { border-color: var(--accent); background: linear-gradient(180deg, rgba(15,154,150,.08), var(--bg2)); }
.preset canvas { width: 100%; height: 44px; margin-bottom: 8px; opacity: 0; transition: opacity .6s; }
.preset.ready canvas { opacity: 1; }
.preset .mono { font-size: 9.5px; color: var(--muted); }
.preset b { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.05; }
.preset.on .mono { color: var(--accent); }
.types { display: flex; flex-wrap: wrap; gap: 6px; }
.knobs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 6px; margin-bottom: 4px; }
.knob { display: grid; justify-items: center; gap: 2px; cursor: ns-resize; touch-action: none; user-select: none; -webkit-user-select: none; outline: none; border-radius: 12px; padding: 4px 0 6px; transition: background .3s; }
.knob:focus-visible { background: rgba(250, 248, 243,.04); box-shadow: inset 0 0 0 1px var(--faint); }
.knob svg { width: 64px; height: 64px; overflow: visible; }
.knob .trk { fill: none; stroke: var(--line2); stroke-width: 2.5; stroke-linecap: round; }
.knob .val { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(15,154,150,.45)); }
.knob .ptr { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.knob:hover .trk, .knob.drag .trk { stroke: var(--faint); }
.knob.drag .ptr { stroke: var(--accent); }
.knob .kl { font-size: 9.5px; color: var(--muted); margin-top: -4px; }
.knob .kv { font-family: var(--mono); font-size: 11px; color: var(--ink); font-variant-numeric: tabular-nums; }
.sync { margin-top: 12px; display: grid; gap: 8px; }
.sync .chips { align-items: center; }
.sync .chip { font-size: 11.5px; padding: 5px 10px; }
.sync .hint { margin: 0 0 0 4px; font-size: 11px; }
.btn.wide { width: 100%; margin-top: 12px; padding: 12px 16px; }
.pack-row { gap: 8px; flex-wrap: nowrap; }
.pack-row .fl { margin-right: auto; }
.pack-row .btn { padding: 8px 13px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .sbar-r #trackName { display: none; }
  .info-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .info-strip > div:nth-child(3) { border-right: 0; }
  .info-strip > div:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .sbar { padding-top: 14px; }
  .sbar .tabs { width: 100%; display: grid; grid-template-columns: 1fr 1fr 1fr; }
  .sbar .tabs button { padding: 8px 6px; font-size: 12.5px; }
  .sbar-r { width: 100%; justify-content: flex-end; }
  .wavepanel { min-height: 360px; }
  .empty .drop { min-height: 250px; }
  .wave-wrap { height: 230px; }
  .vtop { padding: 10px; }
  .vtop > .row:last-child { width: 100%; justify-content: space-between; }
  .vsep { display: none; }
  .vfoot .hint, #followBtn, .nudge .hint, .vtop .vsep { display: none; }
  .vtop > .row:last-child { gap: 4px; flex-wrap: nowrap; }
  .vtop .btn.sm { padding: 6px 10px; }
  .vtop .btn.icon.sm { width: 32px; height: 32px; }
  .info-strip > div:nth-child(5) { grid-column: span 2; }
  .bpm-big .display { font-size: 76px; }
  .cv-head > div { padding: 12px; }
  .cv-head .display { font-size: 30px; }
  table.cuts th, table.cuts td { padding: 8px 9px; }
  #sfxCanvas { height: 250px; }
  .presets { grid-template-columns: 1fr 1fr; }
  .preset b { font-size: 19px; }
  .stage-foot { gap: 12px; }
}
