/* ===========================================================
   Opus Studio — hand-authored stylesheet
   (replaces the Tailwind CDN runtime used by the source file)
   =========================================================== */

:root {
  --bg-0: #06080f;
  --bg-1: #0b0f19;
  --bg-2: #111827;
  --bg-3: #1a2233;
  --line: #232c3f;
  --line-soft: #1a2131;

  --txt: #e2e8f0;
  --txt-dim: #94a3b8;
  --txt-faint: #64748b;

  --indigo: #6366f1;
  --indigo-lt: #818cf8;
  --cyan: #22d3ee;
  --pink: #ec4899;
  --pink-lt: #f472b6;
  --emerald: #10b981;
  --emerald-lt: #34d399;
  --amber: #f59e0b;
  --red: #ef4444;
  --violet: #8b5cf6;

  --r-sm: 5px;
  --r-md: 9px;
  --r-lg: 14px;

  --nav-h: 46px;
  --tap: 44px;

  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(1100px 600px at 15% -10%, rgba(99, 102, 241, 0.14), transparent 60%),
    radial-gradient(900px 500px at 105% 10%, rgba(236, 72, 153, 0.10), transparent 60%),
    var(--bg-0);
  color: var(--txt);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
}

h1, h2, h3 { margin: 0; font-weight: 700; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 0 4px;
}

kbd {
  font-family: var(--mono);
  font-size: 0.72rem;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 5px;
  margin: 0 1px;
  color: var(--txt);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------- Navigation chrome ---------------- */

.do-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  height: calc(var(--nav-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  background: rgba(9, 12, 20, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.do-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--txt);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.do-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--indigo), var(--pink));
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
}
.do-brand-text {
  background: linear-gradient(135deg, #7dd3fc, var(--indigo-lt));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 0.95rem;
}
.do-brand:hover .do-brand-text { filter: brightness(1.2); }

.do-nav-sep {
  width: 1px;
  height: 20px;
  background: var(--line);
}

.do-nav-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--txt-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.do-help {
  margin-left: auto;
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--txt-dim);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
.do-help:hover { color: #fff; border-color: var(--indigo); }

/* ---------------- Transport ---------------- */

.transport {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px max(12px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line-soft);
  background: rgba(11, 15, 25, 0.6);
}

.transport-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.transport-group.field,
.transport-group.banks {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 4px 9px;
}

.transport-group.field label,
.field-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--txt-faint);
}

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--txt);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:hover:not(:disabled) { background: var(--bg-3); border-color: #33405a; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible,
.bank-btn:focus-visible,
.do-help:focus-visible,
.rng:focus-visible,
.sel:focus-visible,
.txt:focus-visible,
.seq-cell:focus-visible {
  outline: 2px solid var(--indigo-lt);
  outline-offset: 2px;
}

.btn-transport { min-width: 80px; }
.btn-primary  { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #7176f5; border-color: #7176f5; }
.btn-indigo   { background: rgba(99, 102, 241, 0.16); border-color: rgba(99, 102, 241, 0.5); color: var(--indigo-lt); }
.btn-violet   { background: linear-gradient(135deg, var(--violet), var(--indigo)); border-color: transparent; color: #fff; }
.btn-emerald  { background: rgba(16, 185, 129, 0.18); border-color: rgba(16, 185, 129, 0.5); color: var(--emerald-lt); }
.btn-emerald:hover:not(:disabled) { background: rgba(16, 185, 129, 0.3); }
.btn-pink     { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn-ghost    { background: transparent; color: var(--txt-dim); font-family: var(--mono); font-size: 0.74rem; }
.btn-ghost:hover:not(:disabled) { color: #fff; }
.btn-wide     { width: 100%; }

.btn-chip {
  min-height: 30px;
  padding: 4px 9px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}
.btn-chip[aria-pressed="true"] {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--indigo);
  color: var(--indigo-lt);
}

.btn-icon {
  min-height: 28px;
  width: 28px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}

.btn-rec { background: rgba(127, 29, 29, 0.35); border-color: rgba(239, 68, 68, 0.45); color: #fca5a5; }
.btn-rec[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.rec-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
}
.btn-rec[aria-pressed="true"] .rec-dot { background: #fff; box-shadow: none; animation: pulse 1s ease-in-out infinite; }

@keyframes pulse { 50% { opacity: 0.25; } }

.glyph { font-size: 0.78rem; line-height: 1; }

.bank-btn {
  min-width: 30px;
  min-height: 30px;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--txt-faint);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.bank-btn:hover { background: var(--bg-3); color: var(--txt); }
.bank-btn.is-active { background: var(--indigo); color: #fff; }

/* ---------------- Form controls ---------------- */

.rng {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}
.rng-sm { width: 84px; }

.rng::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 3px;
  background: var(--bg-3);
}
.rng::-moz-range-track {
  height: 5px;
  border-radius: 3px;
  background: var(--bg-3);
}
.rng::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 17px; height: 17px;
  margin-top: -6px;
  border-radius: 50%;
  border: none;
  background: var(--indigo);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
}
.rng::-moz-range-thumb {
  width: 17px; height: 17px;
  border-radius: 50%;
  border: none;
  background: var(--indigo);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
}

.sel, .txt {
  min-height: 36px;
  padding: 7px 9px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--txt);
  font-family: var(--mono);
  font-size: 0.78rem;
}
.sel { cursor: pointer; }
.sel-full { width: 100%; }
.txt {
  font-family: inherit;
  font-size: 0.86rem;
  width: 100%;
  resize: vertical;
}
.txt:focus, .sel:focus { border-color: var(--indigo); outline: none; }

.val {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--txt-dim);
  white-space: nowrap;
}
.val-indigo  { color: var(--indigo-lt); }
.val-cyan    { color: var(--cyan); }
.val-pink    { color: var(--pink-lt); }
.val-amber   { color: var(--amber); }
.val-emerald { color: var(--emerald-lt); }

.inline-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--txt-dim);
}

/* ---------------- Workspace layout ---------------- */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 14px;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 14px max(12px, env(safe-area-inset-left)) 28px max(12px, env(safe-area-inset-right));
}

.col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.85), rgba(11, 15, 25, 0.85));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.panel-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--txt-dim);
}
.panel-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.dot-cyan    { background: var(--cyan);    box-shadow: 0 0 8px var(--cyan); }
.dot-indigo  { background: var(--indigo);  box-shadow: 0 0 8px var(--indigo); }
.dot-pink    { background: var(--pink);    box-shadow: 0 0 8px var(--pink); }
.dot-emerald { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }

.panel-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--txt-faint);
}

.hint {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--txt-faint);
}

.badge {
  padding: 3px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--bg-2);
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--txt-dim);
  white-space: nowrap;
}

/* ---------------- Visualizer ---------------- */

.vis-switch { display: flex; align-items: center; gap: 6px; }
.vis-name {
  min-width: 118px;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
}

.vis-stage {
  position: relative;
  height: clamp(150px, 26vh, 240px);
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  background: #03050a;
  overflow: hidden;
}
#visualizerCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------------- Level meter ---------------- */

.level-meter {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.4);
}
.level-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--txt-faint);
}
.level-track {
  position: relative;
  width: 86px;
  height: 7px;
  border-radius: 4px;
  background: var(--bg-3);
  overflow: hidden;
}
.level-bar {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--emerald) 0%, var(--emerald) 55%, var(--amber) 78%, var(--red) 100%);
  background-size: 86px 100%;
  transition: width 0.06s linear;
}

/* ---------------- Knob grid ---------------- */

.knob-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 9px;
}
.knob {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  background: rgba(17, 24, 39, 0.7);
}
.knob-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--txt-dim);
}

.gen-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

/* ---------------- Sequencer ---------------- */

.seq-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
}
.seq-inner { min-width: 560px; }

.seq-ruler {
  display: grid;
  grid-template-columns: 96px repeat(16, minmax(28px, 1fr));
  gap: 4px;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--txt-faint);
  text-align: center;
}
.seq-ruler span:first-child { text-align: left; }
.seq-ruler .beat { color: var(--txt-dim); font-weight: 700; }

.seq-grid { display: flex; flex-direction: column; gap: 5px; }

.seq-row {
  display: grid;
  grid-template-columns: 96px repeat(16, minmax(28px, 1fr));
  gap: 4px;
  align-items: center;
}

.seq-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
}
.seq-name {
  font-family: var(--mono);
  font-size: 0.66rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seq-mute {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--txt-faint);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.seq-mute[aria-pressed="true"] {
  background: #7f1d1d;
  border-color: var(--red);
  color: #fff;
}

.seq-cell {
  height: 30px;
  padding: 0;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-soft);
  background: rgba(31, 41, 61, 0.55);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
.seq-cell:hover { background: rgba(55, 65, 81, 0.8); }
.seq-cell.is-beat { border-color: #2c3852; }
.seq-cell.is-on {
  background: var(--cell-color, var(--indigo));
  border-color: transparent;
  box-shadow: 0 0 10px var(--cell-color, var(--indigo));
}
.seq-cell.is-playhead {
  box-shadow: inset 0 0 0 2px #ffffff, 0 0 10px rgba(255, 255, 255, 0.35);
}

/* ---------------- Synth ---------------- */

.synth-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 9px;
}

.adsr-block {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  background: rgba(11, 15, 25, 0.6);
}
.adsr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--txt-dim);
}
.adsr-svg {
  width: 104px;
  height: 30px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.45);
  color: var(--indigo-lt);
}
.adsr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.kbd-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.kbd-hint { font-size: 0.7rem; color: var(--txt-faint); }
.octave-ctl { display: inline-flex; align-items: center; gap: 6px; }

.kbd-scroll {
  overflow-x: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-1);
}

.keyboard {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 2px;
  min-width: max-content;
  padding: 12px 14px;
  /* The container still scrolls sideways (drag the padding strip above or
     below the keys); individual keys swallow the gesture so a press plays
     a note instead of scrolling the panel. */
  touch-action: pan-x;
  -webkit-tap-highlight-color: transparent;
}

.key {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 7px;
  border: none;
  border-radius: 0 0 5px 5px;
  font-family: var(--mono);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.key-white {
  width: 44px;
  height: 132px;
  background: linear-gradient(180deg, #ffffff 0%, #dbe2ec 100%);
  color: #0f172a;
  font-size: 0.62rem;
  z-index: 1;
}
.key-black {
  width: 28px;
  height: 82px;
  margin: 0 -14px;
  background: linear-gradient(180deg, #334155 0%, #0b1120 100%);
  color: #cbd5e1;
  font-size: 0.55rem;
  z-index: 2;
}
.key-white.is-down { background: #a5b4fc; }
.key-black.is-down { background: var(--indigo); color: #fff; }

/* ---------------- Modals ---------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  overflow-y: auto;
}
.modal[hidden] { display: none; }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(99, 102, 241, 0.4);
  background: var(--bg-1);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.modal-x {
  position: absolute;
  top: 10px; right: 10px;
  width: var(--tap); height: var(--tap);
  border: none;
  background: transparent;
  color: var(--txt-dim);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.modal-x:hover { color: #fff; }

.modal-head { padding-right: 40px; border-bottom: 1px solid var(--line-soft); padding-bottom: 12px; }
.modal-head h2 { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 1.05rem; }
.modal-head p { margin: 7px 0 0; font-size: 0.78rem; color: var(--txt-dim); }

.tag {
  padding: 2px 7px;
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tag-emerald {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: var(--emerald-lt);
}

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-soft); }
.tab {
  min-height: 38px;
  padding: 8px 13px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--txt-faint);
  font-family: var(--mono);
  font-size: 0.74rem;
  cursor: pointer;
}
.tab.is-active { color: var(--indigo-lt); border-bottom-color: var(--indigo); font-weight: 700; }

.pane { display: flex; flex-direction: column; gap: 11px; }
.pane[hidden] { display: none; }

.prompt-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.prompt-row .txt { flex: 1 1 220px; width: auto; }

.quick-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.quick-label {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--txt-faint);
}

.log {
  margin: 0;
  padding: 9px 11px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.45);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--emerald-lt);
}
.log[hidden] { display: none; }
.log-quiet { color: var(--txt-dim); }
.log-error { color: #fca5a5; }

.export-block {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  background: rgba(17, 24, 39, 0.6);
}
.export-block h3 { font-size: 0.85rem; color: var(--emerald-lt); }

.help-body { display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; color: var(--txt-dim); }
.help-body h3 { margin-top: 8px; font-size: 0.8rem; color: var(--indigo-lt); }
.help-body p { margin: 0; }
.help-body ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }

/* ---------------- Responsive ---------------- */

@media (max-width: 1024px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  body { font-size: 14px; }
  .transport { gap: 7px; padding: 9px 10px; }
  .btn { font-size: 0.78rem; padding: 7px 10px; }
  .workspace { padding: 11px 10px 24px; gap: 11px; }
  .panel { padding: 11px; gap: 10px; }
  .vis-name { min-width: 96px; }
  .seq-inner { min-width: 620px; }
  .key-white { width: 40px; height: 118px; }
  .key-black { width: 26px; height: 74px; margin: 0 -13px; }
  .keyboard { justify-content: flex-start; }
}

@media (max-width: 420px) {
  .hide-xs { display: none; }
  .do-nav-title { font-size: 0.85rem; }
  .btn-transport { min-width: 0; }
  .kbd-hint { display: none; }
  .level-track { width: 60px; }
  .knob-grid { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
}

/* Landscape phones: keep the visualizer from eating the viewport */
@media (max-height: 500px) and (orientation: landscape) {
  .vis-stage { height: 132px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}


/* ---------------- Deep-review touch/layout hardening ---------------- */
.do-brand { min-height: 44px; }
.do-brand-mark { width: 32px; height: 32px; }
.do-help { width: 44px; height: 44px; }
.btn { min-height: 44px; }
.btn-chip { min-height: 44px; }
.btn-icon { min-height: 44px; width: 44px; }
.bank-btn { min-width: 44px; min-height: 44px; }
.rng { min-height: 44px; height: 44px; }
.sel, .txt { min-height: 44px; }
.seq-mute { width: 44px; height: 44px; }
.modal-x, .tab { min-width: 44px; min-height: 44px; }

@media (pointer: coarse) {
  .seq-inner { min-width: 880px; }
  .seq-ruler, .seq-row { grid-template-columns: 112px repeat(16, 44px); }
  .seq-cell { height: 44px; touch-action: pan-x pan-y; }
  .seq-label { min-height: 44px; }
  .key-white { width: 52px; min-width: 52px; height: 128px; }
  .key-black { width: 44px; min-width: 44px; height: 84px; margin: 0 -22px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .do-nav { position: static; height: 46px; min-height: 46px; }
  .transport { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding: 4px 8px; min-height: 54px; }
  .transport-group { flex-wrap: nowrap; flex: 0 0 auto; }
  .workspace { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 8px; gap: 8px; }
  .panel { padding: 9px; gap: 8px; }
  .vis-stage { height: 112px; }
  .hint { font-size: .68rem; }
}

/* Final exact touch-target / short-landscape containment correction */
.btn { min-width: 44px; }
.btn-chip { min-width: 44px; }
@media (max-height: 500px) and (orientation: landscape) {
  .transport { flex-wrap: wrap; overflow-x: visible; overflow-y: visible; }
  .transport-group { flex-wrap: wrap; }
}
