:root {
  --bg-deep: #05060b;
  --bg-card: rgba(12, 15, 26, 0.88);
  --bg-card-solid: #0c0f1a;
  --bg-input: #080a12;
  --cyan: #00f0ff;
  --magenta: #ff007f;
  --yellow: #fcee0a;
  --text-main: #f3f7ff;
  --text-dim: #8a95b2;
  --border-dim: rgba(0, 240, 255, 0.18);
  --radius-lg: 18px;
  --radius-md: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, select {
  font-family: inherit;
}

.cyber-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.cyber-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 0, 127, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at 50% 25%, #000 35%, transparent 90%);
}

.cyber-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.22;
}

.cyber-glow-cyan {
  width: 280px;
  height: 280px;
  top: -80px;
  left: -60px;
  background: var(--cyan);
}

.cyber-glow-magenta {
  width: 260px;
  height: 260px;
  top: 28%;
  right: -90px;
  background: var(--magenta);
}

.cyber-glow-yellow {
  width: 220px;
  height: 220px;
  bottom: -60px;
  left: 20%;
  background: var(--yellow);
  opacity: 0.12;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(12px + var(--safe-top)) 14px calc(92px + var(--safe-bottom));
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(11, 14, 24, 0.96), rgba(18, 10, 28, 0.92));
  border: 1px solid rgba(0, 240, 255, 0.28);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 11px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-s-wrap {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.4));
}

.logo-s-lg {
  width: 54px;
  height: 54px;
}

.logo-s-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  background: linear-gradient(90deg, var(--cyan), #ffffff 48%, var(--yellow));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.15;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--magenta);
}

.slot-pill {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(252, 238, 10, 0.12);
  border: 1px solid rgba(252, 238, 10, 0.45);
  color: var(--yellow);
}

.app-main,
.app-col-left,
.app-col-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.cyber-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--cyan);
}

.section-sub-hint {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.cyber-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge-cyan {
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.4);
}

.badge-magenta {
  color: #ff5cae;
  background: rgba(255, 0, 127, 0.14);
  border: 1px solid rgba(255, 0, 127, 0.45);
}

.badge-yellow {
  color: var(--yellow);
  background: rgba(252, 238, 10, 0.12);
  border: 1px solid rgba(252, 238, 10, 0.45);
}

.badge-dim {
  color: var(--text-dim);
  background: rgba(138, 149, 178, 0.12);
  border: 1px solid rgba(138, 149, 178, 0.25);
}

.gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 6, 11, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.gate-overlay[hidden] {
  display: none;
}

.gate-card {
  width: 100%;
  max-width: 390px;
  padding: 24px 20px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(13, 17, 30, 0.98), rgba(18, 9, 27, 0.98));
  border: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.16), 0 0 24px rgba(255, 0, 127, 0.14);
}

.gate-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.gate-badge-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.gate-desc {
  margin: 0 0 16px;
  font-size: 0.84rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gate-slot-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--cyan);
  text-transform: uppercase;
}

.gate-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.cyber-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--text-main);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cyber-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15);
}

.gate-eye-btn {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 6px;
  cursor: pointer;
}

.gate-error {
  margin: 0;
  font-size: 0.8rem;
  color: #ff5cae;
  font-weight: 600;
}

.gate-submit {
  margin-top: 4px;
  height: 46px;
}

.shake {
  animation: shakeAnim 0.35s ease;
}

@keyframes shakeAnim {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(7px); }
  75% { transform: translateX(-4px); }
}

.tona-custom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: rgba(252, 238, 10, 0.06);
  border: 1px dashed rgba(252, 238, 10, 0.38);
  transition: all 0.2s ease;
}

.tona-custom-bar[data-state="ready"] {
  background: rgba(252, 238, 10, 0.1);
  border-style: solid;
  border-color: rgba(252, 238, 10, 0.55);
}

.tona-custom-bar[data-state="active"] {
  background: linear-gradient(135deg, rgba(252, 238, 10, 0.18), rgba(255, 0, 127, 0.14));
  border-style: solid;
  border-color: var(--yellow);
  box-shadow: 0 0 18px rgba(252, 238, 10, 0.18);
}

.tona-custom-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tona-custom-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-dim);
}

.tona-custom-bar[data-state="ready"] .tona-custom-dot {
  background: var(--yellow);
}

.tona-custom-bar[data-state="active"] .tona-custom-dot {
  background: var(--yellow);
  box-shadow: 0 0 10px var(--yellow);
}

.tona-custom-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tona-custom-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--yellow);
}

.tona-custom-sub {
  margin: 2px 0 0;
  font-size: 0.68rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-mini-cyber {
  flex-shrink: 0;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid rgba(0, 240, 255, 0.45);
  background: rgba(0, 240, 255, 0.12);
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.btn-mini-cyber:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tona-dropdown-wrap {
  position: relative;
}

.tona-trigger {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tona-trigger[aria-expanded="true"] {
  border-color: var(--magenta);
  box-shadow: 0 0 0 3px rgba(255, 0, 127, 0.18);
}

.tona-trigger-placeholder {
  color: var(--text-dim);
  font-weight: 600;
}

.tona-chevron {
  color: var(--cyan);
  transition: transform 0.2s ease;
}

.tona-trigger[aria-expanded="true"] .tona-chevron {
  transform: rotate(180deg);
}

.tona-panel {
  margin-top: 8px;
  border-radius: var(--radius-md);
  background: #090c16;
  border: 1px solid rgba(255, 0, 127, 0.45);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.tona-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.18);
  color: var(--cyan);
}

.tona-search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 16px;
  outline: none;
}

.tona-search-clear {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

.tona-options-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 245px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tona-option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s;
}

.tona-option-item:hover,
.tona-option-item:active {
  background: rgba(0, 240, 255, 0.1);
}

.tona-option-item.selected {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.16), rgba(255, 0, 127, 0.14));
  border: 1px solid rgba(0, 240, 255, 0.4);
}

.tona-option-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.tona-option-vibe {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.tona-empty-search {
  padding: 16px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.upload-dropzone {
  display: block;
  border-radius: var(--radius-md);
  border: 1.5px dashed rgba(0, 240, 255, 0.4);
  background: rgba(6, 9, 17, 0.72);
  padding: 16px 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.upload-dropzone.dragover {
  border-color: var(--yellow);
  background: rgba(252, 238, 10, 0.08);
}

.upload-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.upload-icon-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.35);
}

.upload-title {
  margin: 2px 0 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.upload-hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.upload-loaded {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.track-meta-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.track-disc {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--yellow);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(255, 0, 127, 0.2));
  border: 1px solid rgba(255, 0, 127, 0.4);
}

.track-text {
  min-width: 0;
}

.track-filename {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-specs {
  margin: 2px 0 0;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.decode-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--cyan);
}

.decode-spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(0, 240, 255, 0.25);
  border-top-color: var(--cyan);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.meter-readout-group {
  display: flex;
  gap: 6px;
}

.meter-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  background: #080b13;
  border: 1px solid rgba(0, 240, 255, 0.22);
  color: var(--cyan);
}

.waveform-wrap {
  position: relative;
  width: 100%;
  height: 92px;
  border-radius: var(--radius-md);
  background: #060810;
  border: 1px solid rgba(0, 240, 255, 0.22);
  overflow: hidden;
  touch-action: none;
}

#waveformCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.waveform-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  color: var(--text-dim);
  pointer-events: none;
}

.time-meter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 12px;
}

.time-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.73rem;
  color: var(--text-dim);
  min-width: 52px;
}

.time-mono:last-child {
  text-align: right;
}

.vu-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vu-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.vu-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  transition: width 0.05s linear;
}

.vu-cyan {
  background: linear-gradient(90deg, var(--cyan), var(--yellow));
}

.vu-magenta {
  background: linear-gradient(90deg, var(--magenta), var(--yellow));
}

.monitor-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
  margin-bottom: 10px;
}

.btn-cyber {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s, box-shadow 0.2s;
}

.btn-cyber:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-cyber:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.btn-cyber-primary {
  background: linear-gradient(135deg, var(--cyan), #00b8ff);
  color: #05070e;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.3);
}

.btn-cyber-magenta {
  background: linear-gradient(135deg, var(--magenta), #d8006c);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(255, 0, 127, 0.28);
}

.btn-cyber-yellow {
  background: linear-gradient(135deg, var(--yellow), #f2b705);
  color: #09090d;
  box-shadow: 0 0 16px rgba(252, 238, 10, 0.26);
}

.btn-cyber-ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-main);
}

.btn-xs {
  height: 34px;
  padding: 0 12px;
  font-size: 0.74rem;
}

.ab-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border-radius: var(--radius-md);
  background: #070912;
  border: 1px solid rgba(255, 0, 127, 0.3);
}

.ab-btn {
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.15s;
}

.ab-btn.active {
  background: linear-gradient(135deg, var(--magenta), #b8005c);
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 0, 127, 0.35);
}

.ab-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.monitor-secondary-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.btn-toggle-cyber,
.btn-action-cyber {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 8px;
  border-radius: var(--radius-md);
  background: #080b14;
  border: 1px solid rgba(0, 240, 255, 0.28);
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-toggle-cyber.active {
  color: var(--cyan);
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.12);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.18);
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.btn-toggle-cyber.active .live-pulse-dot {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: pulseDot 1.4s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

.btn-action-cyber {
  color: var(--text-main);
  border-color: rgba(255, 0, 127, 0.35);
}

.btn-action-cyber:active {
  background: rgba(255, 0, 127, 0.14);
}

.lock-hold-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(252, 238, 10, 0.55);
  background: rgba(252, 238, 10, 0.1);
  color: var(--yellow);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

.lock-hold-btn.unlocked {
  border-color: rgba(0, 240, 255, 0.55);
  background: rgba(0, 240, 255, 0.12);
  color: var(--cyan);
}

.lock-hold-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(252, 238, 10, 0.35), rgba(0, 240, 255, 0.55));
  pointer-events: none;
}

.lock-hold-inner {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.eq-curve-box {
  width: 100%;
  height: 76px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: #060810;
  border: 1px solid rgba(255, 0, 127, 0.24);
  overflow: hidden;
}

#eqCurveCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.sliders-container {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sliders-container.is-locked .dsp-group {
  opacity: 0.42;
  pointer-events: none;
}

.sliders-lock-curtain {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 4;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(6, 7, 13, 0.45);
  backdrop-filter: blur(1.5px);
}

.sliders-container.is-locked .sliders-lock-curtain {
  display: flex;
}

.sliders-lock-curtain span {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(11, 14, 24, 0.95);
  border: 1px solid rgba(252, 238, 10, 0.55);
  color: var(--yellow);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.dsp-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dsp-group-title {
  margin: 0;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--magenta);
}

.slider-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slider-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-main);
}

.slider-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--cyan);
}

.cyber-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.cyber-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cyan);
  border: 2px solid #06070d;
  box-shadow: 0 0 10px var(--cyan);
  cursor: pointer;
}

.slider-magenta::-webkit-slider-thumb {
  background: var(--magenta);
  box-shadow: 0 0 10px var(--magenta);
}

.slider-yellow::-webkit-slider-thumb {
  background: var(--yellow);
  box-shadow: 0 0 10px var(--yellow);
}

.cyber-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.cyber-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cyber-switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: 0.2s;
  cursor: pointer;
}

.cyber-switch-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: 0.2s;
}

.cyber-switch input:checked + .cyber-switch-slider {
  background: rgba(0, 240, 255, 0.22);
  border-color: var(--cyan);
}

.cyber-switch input:checked + .cyber-switch-slider::before {
  transform: translateX(22px);
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.trim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}

.tona-ai-fab {
  position: fixed;
  right: 18px;
  bottom: calc(18px + var(--safe-bottom));
  z-index: 40;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1.5px solid var(--cyan);
  background: linear-gradient(135deg, #090e1a, #1c0920);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.42), 0 0 14px rgba(255, 0, 127, 0.35);
  transition: transform 0.15s ease;
}

.tona-ai-fab[hidden] {
  display: none;
}

.tona-ai-fab:active {
  transform: scale(0.92);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(3, 4, 9, 0.76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
  display: none;
}

.chat-sheet,
.export-sheet {
  width: 100%;
  max-width: 460px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  border-radius: 22px 22px 0 0;
  padding: 16px 16px calc(16px + var(--safe-bottom));
  background: linear-gradient(180deg, #0e1220, #070911);
  border-top: 1.5px solid var(--cyan);
  box-shadow: 0 -10px 40px rgba(0, 240, 255, 0.18);
}

.chat-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-orb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  box-shadow: 0 0 12px var(--cyan);
}

.chat-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--cyan);
}

.chat-sub {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.icon-btn-sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-size: 1.1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chat-messages {
  flex: 1;
  min-height: 220px;
  max-height: 46vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 2px;
  -webkit-overflow-scrolling: touch;
}

.chat-bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.84rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.chat-bubble p {
  margin: 0;
}

.chat-bubble.ai {
  align-self: flex-start;
  background: rgba(0, 240, 255, 0.09);
  border: 1px solid rgba(0, 240, 255, 0.28);
  color: var(--text-main);
}

.chat-bubble.user {
  align-self: flex-end;
  background: rgba(255, 0, 127, 0.16);
  border: 1px solid rgba(255, 0, 127, 0.4);
  color: #fff;
}

.ai-apply-card {
  margin: 6px 0 10px;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(252, 238, 10, 0.12), rgba(0, 240, 255, 0.1));
  border: 1px solid rgba(252, 238, 10, 0.55);
}

.ai-apply-title {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--yellow);
}

.ai-apply-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-input-bar {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-input {
  flex: 1;
}

.chat-send-btn {
  width: 48px;
  padding: 0;
}

.export-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.export-option-card {
  text-align: left;
  padding: 12px;
  border-radius: var(--radius-md);
  background: #080b14;
  border: 1px solid rgba(0, 240, 255, 0.28);
  color: var(--text-main);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}

.export-option-card:active {
  transform: scale(0.97);
}

.export-option-all {
  border-color: rgba(252, 238, 10, 0.45);
  background: linear-gradient(135deg, rgba(252, 238, 10, 0.08), rgba(255, 0, 127, 0.08));
}

.export-opt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.export-opt-title {
  font-size: 0.88rem;
  font-weight: 800;
}

.export-opt-desc {
  margin: 0;
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.35;
}

.export-progress-box {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: #080b14;
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.export-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.export-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--magenta), var(--yellow));
  transition: width 0.2s ease;
}

.export-progress-text {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--cyan);
}

.export-done-box {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.export-done-banner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.export-done-summary {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-main);
}

.export-files-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}

.export-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #080b14;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.export-file-name {
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.export-file-meta {
  font-size: 0.66rem;
  color: var(--text-dim);
}

.export-done-actions {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 10px;
}

/* Track & Monitoring Play + Tona Copy Row & TONA LIVE Panel */
.monitor-play-copy-row {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 10px;
}

.monitor-copy-btn {
  height: 44px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.ab-switch-full {
  height: 38px;
  margin-bottom: 10px;
}

.monitor-secondary-2col {
  grid-template-columns: 1fr 1fr;
}

.tona-live-log {
  margin: 0 0 12px;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  background: #060810;
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: #d7f8ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.69rem;
  line-height: 1.48;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

.tona-live-actions {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 10px;
}

.btn-live-action {
  height: 42px;
  font-size: 0.76rem;
}

.preview-controls-row {
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 10px;
  margin-top: 4px;
}

.cyber-toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 95;
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(8, 11, 20, 0.96);
  border: 1px solid var(--cyan);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.35);
  max-width: 90vw;
  text-align: center;
}

/* ======================================================
   RESPONSIVE BREAKPOINTS (Tablet 768-1024px, Desktop >1024px)
   ====================================================== */
@media (min-width: 768px) {
  .modal-backdrop {
    align-items: center;
    padding: 24px;
  }

  .chat-sheet,
  .export-sheet {
    max-width: 560px;
    border-radius: 22px;
    border: 1.5px solid var(--cyan);
    padding: 20px;
  }

  .tona-ai-fab {
    right: 26px;
    bottom: 26px;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .app-shell {
    max-width: 900px;
    padding: 20px 24px 96px;
  }

  .app-main,
  .app-col-left,
  .app-col-right {
    gap: 16px;
  }

  .sliders-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }
}

@media (min-width: 1025px) {
  .app-shell {
    max-width: 1200px;
    padding: 22px 28px 96px;
  }

  .app-header {
    padding: 12px 18px;
    margin-bottom: 18px;
  }

  .app-main {
    display: grid;
    grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }

  .app-col-left,
  .app-col-right {
    gap: 18px;
  }

  .tona-options-list {
    max-height: 320px;
  }

  .sliders-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
}
