/* ==========================================================================
   VOICE LAB // TACTILE HARDWARE SYNTH PAD UI
   Touch-locked 100dvh responsive layout for iPad (landscape/portrait) & iPhone
   ========================================================================== */

:root {
  --bg-chassis: #0b0d17;
  --bg-panel: #141829;
  --bg-panel-elevated: #1c2238;
  --bg-recessed: #080a12;
  --border-bezel: #2a3352;
  --border-highlight: rgba(255, 255, 255, 0.09);

  --neon-cyan: #00f0ff;
  --neon-pink: #ff2e93;
  --neon-orange: #ff5500;
  --neon-yellow: #ffd000;
  --neon-green: #00ff9d;
  --neon-lime: #7cff00;
  --neon-purple: #b565ff;
  --danger-red: #ff334b;

  --text-main: #f4f7ff;
  --text-muted: #93a0c6;
  --text-dim: #5e6a8f;

  --font-ui: 'SF Pro Rounded', 'Avenir Next Rounded', 'Trebuchet MS', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'SF Mono', ui-monospace, 'Cascadia Code', Menlo, Monaco, monospace;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* Global iOS Safari Touch Lock: zero text selection, zero callouts, zero bounce */
*,
*::before,
*::after {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background-color: var(--bg-chassis);
  background-image:
    radial-gradient(circle at 18% 12%, rgba(0, 240, 255, 0.08), transparent 38%),
    radial-gradient(circle at 85% 82%, rgba(255, 46, 147, 0.08), transparent 42%);
  color: var(--text-main);
  font-family: var(--font-ui);
  touch-action: manipulation;
  position: fixed;
  inset: 0;
}

button,
input {
  font-family: inherit;
  touch-action: manipulation;
}

[hidden] {
  display: none !important;
}

/* ==========================================================================
   APP SHELL & TOP HARDWARE HEADER
   ========================================================================== */

.app-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  padding: calc(var(--safe-top) + 8px) calc(var(--safe-right) + 10px) calc(var(--safe-bottom) + 8px) calc(var(--safe-left) + 10px);
  gap: 8px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  background: var(--bg-panel);
  border: 1.5px solid var(--border-bezel);
  border-radius: 14px;
  box-shadow: 0 4px 0 #070911, inset 0 1px 0 var(--border-highlight);
  flex-shrink: 0;
}

.brand-plate {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.brand-led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
}

.brand-name {
  font-weight: 900;
  font-size: clamp(0.95rem, 1.8vw, 1.2rem);
  letter-spacing: 0.08em;
  color: var(--text-main);
}

.brand-chip {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 240, 255, 0.14);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 240, 255, 0.35);
}

/* Status Banner Pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 1.3vw, 0.82rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--bg-recessed);
  border: 1.5px solid var(--border-bezel);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green);
}

.status-pill.state-ready {
  color: var(--neon-green);
  border-color: rgba(0, 255, 157, 0.4);
}

.status-pill.state-recording {
  color: #ff8c42;
  border-color: #ff5500;
  background: rgba(255, 85, 0, 0.16);
}

.status-pill.state-recording .status-dot {
  background: var(--danger-red);
  box-shadow: 0 0 12px var(--danger-red);
  animation: blink-fast 0.55s infinite alternate;
}

.status-pill.state-playing {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.14);
}

.status-pill.state-playing .status-dot {
  background: var(--neon-cyan);
  box-shadow: 0 0 12px var(--neon-cyan);
}

.status-pill.state-live {
  color: var(--neon-yellow);
  border-color: var(--neon-yellow);
  background: rgba(255, 208, 0, 0.15);
}

.status-pill.state-live .status-dot {
  background: var(--neon-yellow);
  box-shadow: 0 0 12px var(--neon-yellow);
  animation: blink-fast 0.8s infinite alternate;
}

.status-pill.state-muted {
  color: var(--danger-red);
  border-color: var(--danger-red);
  background: rgba(255, 51, 75, 0.16);
}

.status-pill.state-muted .status-dot {
  background: var(--danger-red);
  box-shadow: none;
}

/* Mode Toggle & Panic Mute */
.mode-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mode-switch {
  display: inline-flex;
  background: var(--bg-recessed);
  padding: 3px;
  border-radius: 11px;
  border: 1px solid var(--border-bezel);
  gap: 3px;
}

.mode-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: clamp(0.68rem, 1.2vw, 0.78rem);
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.mode-btn.active {
  background: var(--bg-panel-elevated);
  color: var(--text-main);
  box-shadow: 0 2px 0 #060810, inset 0 0 0 1.5px var(--neon-cyan);
}

#mode-live-btn.active {
  box-shadow: 0 2px 0 #060810, inset 0 0 0 1.5px var(--neon-yellow);
  color: var(--neon-yellow);
}

.panic-btn {
  border: 2px solid #ff6b7d;
  background: linear-gradient(180deg, #ff334b 0%, #c8102e 100%);
  color: #ffffff;
  font-weight: 900;
  font-size: clamp(0.72rem, 1.3vw, 0.82rem);
  padding: 6px 12px;
  border-radius: 10px;
  box-shadow: 0 3px 0 #6e0617, 0 0 16px rgba(255, 51, 75, 0.55);
  cursor: pointer;
  white-space: nowrap;
}

.panic-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #6e0617;
}

/* ==========================================================================
   MAIN WORKSTATION GRID
   ========================================================================== */

.workstation {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(300px, 0.92fr);
  gap: 10px;
}

.synth-panel,
.deck-panel {
  background: var(--bg-panel);
  border: 1.5px solid var(--border-bezel);
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 5px 0 #070911, inset 0 1px 0 var(--border-highlight);
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 0;
  overflow: hidden;
}

/* ==========================================================================
   OSCILLOSCOPE / FREQUENCY BAR VISUALIZER SCREEN
   ========================================================================== */

.scope-frame {
  position: relative;
  height: clamp(82px, 14.5dvh, 136px);
  flex-shrink: 0;
  background:
    linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    #060811;
  background-size: 20px 20px, 20px 20px, 100% 100%;
  border-radius: 13px;
  border: 2px solid #232d4b;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.85);
  overflow: hidden;
}

#visualizer-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.scope-hud-top,
.scope-hud-bottom {
  position: absolute;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  font-family: var(--font-mono);
}

.scope-hud-top {
  top: 6px;
}

.scope-hud-bottom {
  bottom: 5px;
}

.hud-preset {
  font-size: clamp(0.68rem, 1.2vw, 0.82rem);
  font-weight: 800;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.65);
  background: rgba(6, 8, 17, 0.72);
  padding: 2px 7px;
  border-radius: 6px;
}

.hud-timer {
  font-size: clamp(0.72rem, 1.3vw, 0.86rem);
  font-weight: 800;
  color: var(--neon-yellow);
  background: rgba(6, 8, 17, 0.72);
  padding: 2px 7px;
  border-radius: 6px;
}

.hud-hint,
.hud-telemetry {
  font-size: clamp(0.58rem, 1vw, 0.68rem);
  color: var(--text-muted);
  background: rgba(6, 8, 17, 0.68);
  padding: 1px 6px;
  border-radius: 5px;
}

/* ==========================================================================
   8 TACTILE 3D VOICE PRESET PADS
   ========================================================================== */

.preset-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.voice-pad {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: 14px;
  background: linear-gradient(180deg, #232b46 0%, #181e33 100%);
  border: 2px solid #2f3a5e;
  box-shadow: 0 5px 0 #0a0d18, inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.1s ease, border-color 0.12s ease, background 0.12s ease;
  min-height: 0;
}

.voice-pad:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #0a0d18;
}

.pad-led {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #333e63;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

.voice-pad.active {
  background:
    radial-gradient(circle at 50% 25%, color-mix(in srgb, var(--pad-color) 26%, #232b46), #181f36 85%);
  border-color: var(--pad-color);
  box-shadow:
    0 4px 0 #0a0d18,
    0 0 18px color-mix(in srgb, var(--pad-color) 42%, transparent),
    inset 0 0 12px color-mix(in srgb, var(--pad-color) 22%, transparent);
}

.voice-pad.active .pad-led {
  background: var(--pad-color);
  box-shadow: 0 0 10px var(--pad-color);
}

.pad-icon {
  font-size: clamp(1.25rem, 2.5dvh, 1.85rem);
  line-height: 1.05;
}

.pad-name {
  font-weight: 900;
  font-size: clamp(0.66rem, 1.15vw, 0.84rem);
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.1;
}

.pad-desc {
  font-size: clamp(0.56rem, 0.95vw, 0.68rem);
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.05;
}

.voice-pad.active .pad-desc {
  color: var(--pad-color);
}

/* ==========================================================================
   4 CHUNKY MUSICAL CHORD BUTTONS (VOCODER INSTRUMENT BAR)
   ========================================================================== */

.chord-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  background: rgba(0, 240, 255, 0.07);
  border: 1.5px solid rgba(0, 240, 255, 0.35);
  border-radius: 12px;
  flex-shrink: 0;
}

.chord-bar-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--neon-cyan);
  white-space: nowrap;
}

.chord-buttons {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.chord-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 4px;
  border-radius: 9px;
  background: #1a223b;
  border: 1.5px solid #30406b;
  box-shadow: 0 3px 0 #090d18;
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.06s ease, border-color 0.12s ease, background 0.12s ease;
}

.chord-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #090d18;
}

.chord-btn.active {
  background: linear-gradient(180deg, rgba(0, 240, 255, 0.28), rgba(0, 240, 255, 0.12));
  border-color: var(--neon-cyan);
  box-shadow: 0 3px 0 #090d18, 0 0 12px rgba(0, 240, 255, 0.35);
}

.chord-title {
  font-size: clamp(0.56rem, 0.95vw, 0.7rem);
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1.1;
}

.chord-notes {
  font-family: var(--font-mono);
  font-size: clamp(0.5rem, 0.8vw, 0.6rem);
  color: var(--neon-cyan);
  margin-top: 1px;
}

/* ==========================================================================
   2 LIVE HARDWARE TOUCH SLIDERS
   ========================================================================== */

.sliders-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  flex-shrink: 0;
}

.fader-box {
  background: var(--bg-recessed);
  border: 1.5px solid var(--border-bezel);
  border-radius: 12px;
  padding: 6px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.fader-header label {
  font-size: clamp(0.62rem, 1.05vw, 0.74rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.fader-meta {
  display: flex;
  align-items: center;
  gap: 5px;
}

.fader-val {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-main);
}

.mini-reset-btn {
  border: 1px solid #35426b;
  background: #1b2238;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 5px;
  cursor: pointer;
}

.mini-reset-btn:active {
  background: #2b3658;
  color: var(--text-main);
}

.synth-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #1a2138;
  border: 1px solid #2d385c;
  outline: none;
  margin: 4px 0;
  touch-action: pan-x;
}

.synth-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 24px;
  border-radius: 8px;
  cursor: grab;
  border: 2px solid #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.65);
}

.slider-cyan::-webkit-slider-thumb {
  background: linear-gradient(180deg, #5ff6ff 0%, #00b8d4 100%);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.65);
}

.slider-pink::-webkit-slider-thumb {
  background: linear-gradient(180deg, #ff6eb5 0%, #e01171 100%);
  box-shadow: 0 0 12px rgba(255, 46, 147, 0.65);
}

.synth-slider::-moz-range-thumb {
  width: 28px;
  height: 24px;
  border-radius: 8px;
  cursor: grab;
  border: 2px solid #ffffff;
  background: var(--neon-cyan);
}

/* ==========================================================================
   DECK PANEL: HOLD-TO-TALK PAD, REPLAY, SHARE & LAST 5 CLIPS
   ========================================================================== */

.live-warning-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 208, 0, 0.14);
  border: 1.5px solid var(--neon-yellow);
  color: var(--neon-yellow);
  font-size: 0.72rem;
  flex-shrink: 0;
}

.inline-panic-btn {
  border: none;
  background: var(--danger-red);
  color: #fff;
  font-weight: 900;
  font-size: 0.68rem;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
}

.talk-pad-stage {
  flex: 1;
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(255, 85, 0, 0.08) 0%, rgba(8, 10, 18, 0.9) 72%);
  border-radius: 16px;
  border: 1.5px solid #242d4a;
  padding: 10px;
  position: relative;
}

.talk-pad {
  position: relative;
  width: min(100%, 290px);
  height: min(100%, 205px);
  min-height: 104px;
  border-radius: 28px;
  border: 3px solid #ff7b3a;
  background: linear-gradient(180deg, #ff6a2b 0%, #d93800 100%);
  box-shadow:
    0 9px 0 #7a1c00,
    0 14px 28px rgba(0, 0, 0, 0.6),
    inset 0 2px 0 rgba(255, 255, 255, 0.35);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  transition: transform 0.07s ease, box-shadow 0.1s ease, background 0.15s ease;
  touch-action: none;
}

.talk-pad-ring {
  position: absolute;
  inset: -9px;
  border-radius: 34px;
  border: 3px solid transparent;
  pointer-events: none;
}

.talk-pad-core {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  pointer-events: none;
}

.talk-pad-icon {
  font-size: clamp(1.7rem, 3.6dvh, 2.5rem);
  line-height: 1;
}

.talk-pad-title {
  font-weight: 900;
  font-size: clamp(1rem, 2vw, 1.35rem);
  letter-spacing: 0.06em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.talk-pad-sub {
  font-size: clamp(0.68rem, 1.15vw, 0.8rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

/* Active Holding / Recording State */
.talk-pad.is-recording {
  transform: translateY(6px) scale(0.985);
  background: linear-gradient(180deg, #ff2a4b 0%, #c9002b 100%);
  border-color: #ff99aa;
  box-shadow:
    0 3px 0 #6b0016,
    0 0 36px rgba(255, 51, 75, 0.85),
    inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.talk-pad.is-recording .talk-pad-ring {
  border-color: #ff5500;
  animation: pulse-ring 0.85s infinite ease-out;
}

/* Playing Back State */
.talk-pad.is-playing {
  background: linear-gradient(180deg, #00c8e0 0%, #0078a8 100%);
  border-color: var(--neon-cyan);
  box-shadow:
    0 8px 0 #00425c,
    0 0 26px rgba(0, 240, 255, 0.55),
    inset 0 2px 0 rgba(255, 255, 255, 0.35);
}

/* Action Buttons (Replay + Save/Share WAV) */
.action-row {
  display: grid;
  grid-template-columns: 1fr 1.18fr;
  gap: 8px;
  flex-shrink: 0;
}

.deck-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 8px;
  border-radius: 13px;
  font-weight: 900;
  font-size: clamp(0.7rem, 1.2vw, 0.82rem);
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.06s ease, opacity 0.15s ease;
}

.deck-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none !important;
}

.deck-btn:not(:disabled):active {
  transform: translateY(3px);
}

.deck-btn-replay {
  background: linear-gradient(180deg, #273254 0%, #1b233c 100%);
  border: 2px solid var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 4px 0 #0a0e1a;
}

.deck-btn-save {
  background: linear-gradient(180deg, #00d984 0%, #009e5c 100%);
  border: 2px solid #7affc6;
  color: #041f13;
  box-shadow: 0 4px 0 #005230, 0 0 16px rgba(0, 255, 157, 0.28);
}

/* Last 5 Clips Tray */
.clips-tray {
  background: var(--bg-recessed);
  border: 1.5px solid var(--border-bezel);
  border-radius: 13px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 34%;
  min-height: 82px;
  flex-shrink: 0;
}

.clips-tray-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 800;
  color: var(--text-muted);
}

.clips-count {
  color: var(--neon-cyan);
}

.clips-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
  padding-right: 2px;
}

.clips-empty {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
  padding: 10px 6px;
}

.clip-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 9px;
  background: var(--bg-panel-elevated);
  border: 1px solid #2d385c;
  flex-shrink: 0;
}

.clip-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.clip-emoji {
  font-size: 1rem;
  flex-shrink: 0;
}

.clip-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clip-dur {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.clip-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.clip-mini-btn {
  border: 1px solid #3c4c7a;
  background: #253052;
  color: var(--text-main);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 7px;
  cursor: pointer;
}

.clip-mini-btn.play-clip-btn {
  border-color: rgba(0, 240, 255, 0.5);
  color: var(--neon-cyan);
}

.clip-mini-btn.save-clip-btn {
  border-color: rgba(0, 255, 157, 0.5);
  color: var(--neon-green);
}

.clip-mini-btn:active {
  transform: scale(0.95);
}

/* ==========================================================================
   MODALS, STARTUP OVERLAY & TOAST
   ========================================================================== */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 8, 16, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.startup-card,
.modal-card {
  width: min(100%, 500px);
  background: linear-gradient(180deg, #192038 0%, #111627 100%);
  border: 2px solid #33426e;
  border-radius: 24px;
  padding: 24px 22px;
  box-shadow: 0 12px 0 #070911, 0 24px 60px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.hardware-screws {
  width: 100%;
  display: flex;
  justify-content: space-between;
}

.hardware-screws span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2a3456;
  border: 1px solid #425180;
}

.model-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--neon-cyan);
  letter-spacing: 0.08em;
}

.brand-hero h1 {
  margin: 4px 0 6px;
  font-size: clamp(2rem, 6vw, 2.85rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, #00f0ff, #ffffff, #ff2e93);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.startup-subtitle {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.alert-box {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.82rem;
  line-height: 1.42;
}

.alert-box strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.88rem;
}

.alert-box p {
  margin: 0;
}

.alert-box code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 5px;
  border-radius: 4px;
}

.alert-warn {
  background: rgba(255, 208, 0, 0.14);
  border: 1.5px solid var(--neon-yellow);
  color: #ffe680;
}

.alert-error {
  background: rgba(255, 51, 75, 0.16);
  border: 1.5px solid var(--danger-red);
  color: #ffb3bd;
}

.power-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 3px solid #7affd4;
  background: linear-gradient(180deg, #00f5a0 0%, #00b874 100%);
  box-shadow: 0 8px 0 #00663f, 0 0 32px rgba(0, 245, 160, 0.45);
  color: #042115;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.1s ease;
}

.power-btn:active {
  transform: translateY(5px);
  box-shadow: 0 3px 0 #00663f;
}

.power-btn-icon {
  font-size: 2.1rem;
}

.power-btn-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.power-btn-main {
  font-size: 1.32rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.power-btn-sub {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.85;
}

.startup-tips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.startup-tips span {
  background: var(--bg-recessed);
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-bezel);
}

/* Modal */
.modal-icon {
  font-size: 2.8rem;
}

.modal-card h2 {
  margin: 0;
  font-size: 1.4rem;
  color: var(--neon-yellow);
}

.modal-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.modal-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-btn {
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  font-weight: 900;
  font-size: 0.88rem;
  cursor: pointer;
}

.modal-btn-go {
  background: linear-gradient(180deg, #ffd000 0%, #e09f00 100%);
  border: 2px solid #fff099;
  color: #241800;
  box-shadow: 0 5px 0 #7a5200;
}

.modal-btn-cancel {
  background: #232c48;
  border: 1.5px solid #3b4975;
  color: var(--text-main);
}

/* Floating Wake Banner */
.resume-banner {
  position: fixed;
  top: calc(var(--safe-top) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid #fff099;
  background: linear-gradient(180deg, #ffd000, #ff8800);
  color: #1c1000;
  font-weight: 900;
  font-size: 0.84rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7);
  cursor: pointer;
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  background: #1c2542;
  border: 1.5px solid var(--neon-cyan);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes pulse-ring {
  0% {
    transform: scale(0.98);
    opacity: 1;
  }
  100% {
    transform: scale(1.09);
    opacity: 0;
  }
}

@keyframes blink-fast {
  0% {
    opacity: 0.35;
  }
  100% {
    opacity: 1;
  }
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS: iPAD PORTRAIT & iPHONE PORTRAIT
   ========================================================================== */

@media (max-width: 900px) {
  .workstation {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1.25fr) minmax(0, 0.95fr);
    gap: 8px;
  }

  .scope-frame {
    height: clamp(64px, 10.5dvh, 96px);
  }

  .talk-pad-stage {
    min-height: 82px;
    padding: 6px;
  }

  .talk-pad {
    width: min(100%, 340px);
    height: 100%;
    min-height: 76px;
    border-radius: 20px;
  }

  .talk-pad-core {
    flex-direction: row;
    gap: 10px;
    text-align: left;
  }

  .clips-tray {
    max-height: none;
    min-height: 68px;
  }

  .clips-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    touch-action: pan-x;
    padding-bottom: 2px;
  }

  .clip-item {
    min-width: 205px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: calc(var(--safe-top) + 4px) 6px calc(var(--safe-bottom) + 4px) 6px;
    gap: 5px;
  }

  .topbar {
    flex-wrap: wrap;
    padding: 5px 8px;
    gap: 5px;
  }

  .brand-chip {
    display: none;
  }

  .status-pill {
    order: 3;
    width: 100%;
    max-width: 100%;
    justify-content: center;
    padding: 3px 8px;
    font-size: 0.66rem;
  }

  .synth-panel,
  .deck-panel {
    padding: 7px;
    gap: 6px;
    border-radius: 14px;
  }

  .scope-frame {
    height: clamp(50px, 8dvh, 72px);
  }

  .preset-grid {
    gap: 5px;
  }

  .voice-pad {
    padding: 4px 2px;
    border-radius: 10px;
    box-shadow: 0 3px 0 #0a0d18;
  }

  .pad-icon {
    font-size: 1.15rem;
  }

  .pad-name {
    font-size: 0.6rem;
  }

  .pad-desc {
    display: none;
  }

  .chord-bar {
    padding: 4px 6px;
    gap: 4px;
  }

  .chord-bar-label {
    display: none;
  }

  .chord-btn {
    padding: 4px 2px;
  }

  .fader-box {
    padding: 4px 7px 5px;
    gap: 2px;
  }

  .synth-slider::-webkit-slider-thumb {
    width: 22px;
    height: 19px;
  }

  .deck-btn {
    padding: 8px 6px;
    font-size: 0.68rem;
  }

  .clips-tray {
    min-height: 60px;
    padding: 5px 7px;
  }
}
