/* ══ RESET & SOPHISTICATED MINIMAL WHITE DESIGN TOKENS ══ */
html,
body,
*,
*::before,
*::after,
input,
textarea,
button,
select,
a,
label,
.clickable {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  cursor: none !important;
}

@media (hover: none), (pointer: coarse) {
  * {
    cursor: auto !important;
  }
  #shift-cursor, #shift-trail {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    cursor: auto !important;
  }
  #shift-cursor, #shift-trail {
    display: none !important;
  }
}

:root {
  --bg: #fafafa;
  --bg-surface: #ffffff;
  --bg-subtle: #f4f4f5;
  --bg-subtle-hover: #ebebee;
  --border: #e4e4e7;
  --border-subtle: #f1f1f4;
  --border-hover: #d4d4d8;

  --text-main: #09090b;
  --text-muted: #52525b;
  --text-dim: #71717a;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;
  --accent-border: #bfdbfe;

  --danger: #dc2626;
  --danger-light: #fef2f2;
  --danger-border: #fecaca;

  --success: #059669;
  --success-light: #ecfdf5;
  --success-border: #a7f3d0;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 2px 8px -2px rgba(0, 0, 0, 0.04), 0 12px 30px -8px rgba(0, 0, 0, 0.06);
}

html {
  overflow-y: scroll;
}

html,
body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* GPU-Accelerated Custom Cursor & Smooth Trail */
#shift-cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none !important;
  z-index: 99999 !important;
  width: 22px;
  height: 22px;
  transform: translate3d(-100px, -100px, 0);
  will-change: transform;
}

#shift-cursor svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 6px rgba(37, 99, 235, 0.4));
  transition: transform 0.12s ease, filter 0.12s ease;
  transform-origin: 4px 4px;
}

#shift-cursor.hover svg {
  transform: scale(1.15);
  filter: drop-shadow(0 0 10px rgba(37, 99, 235, 0.8));
}

#shift-cursor.click svg {
  transform: scale(0.85);
}

#shift-cursor.typing {
  width: 3px;
  height: 20px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.8);
}

#shift-cursor.typing svg {
  display: none;
}

#shift-trail {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none !important;
  z-index: 99998 !important;
  width: 16px;
  height: 16px;
  opacity: 0.45;
  transform: translate3d(-100px, -100px, 0);
  will-change: transform;
  transition: opacity 0.15s ease;
}

#shift-trail svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 6px rgba(37, 99, 235, 0.35));
}

#shift-trail.typing,
#shift-cursor.typing ~ #shift-trail {
  opacity: 0 !important;
}

/* ══ CUSTOM MODERN FLOATING DROPDOWN COMPONENT ══ */
.custom-dropdown {
  position: relative;
  display: inline-block;
  user-select: none;
}

.custom-dropdown-trigger {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 14px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: none !important;
  transition: all 0.15s ease;
}

.custom-dropdown-trigger:hover,
.custom-dropdown.open .custom-dropdown-trigger {
  border-color: var(--accent);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.custom-dropdown-arrow {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.custom-dropdown.open .custom-dropdown-arrow {
  transform: rotate(180deg);
  color: var(--accent);
}

.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  padding: 6px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.custom-dropdown.open .custom-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.custom-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  cursor: none !important;
  transition: background 0.12s ease, color 0.12s ease;
}

.custom-dropdown-item:hover {
  background: var(--bg-subtle-hover);
  color: var(--accent);
}

.custom-dropdown-item.selected {
  background: var(--accent-light);
  color: var(--accent);
}

.custom-dropdown-check {
  width: 14px;
  height: 14px;
  color: var(--accent);
  opacity: 0;
}

.custom-dropdown-item.selected .custom-dropdown-check {
  opacity: 1;
}

/* Layout Shell */
.shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: var(--text-main);
  color: #ffffff !important;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-logo svg {
  stroke: #ffffff !important;
  color: #ffffff !important;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.privacy-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--success-light);
  border: 1px solid var(--success-border);
  color: var(--success);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
}

.btn-ghost {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

/* Control Panel & Input Tabs */
.control-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 28px;
}

.input-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.tab-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--accent-light);
  border-color: var(--accent-border);
  color: var(--accent);
}

.source-content {
  margin-bottom: 20px;
}

.source-content.hidden {
  display: none !important;
}

/* Dropzone */
.dropzone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  background: var(--bg-subtle);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: #ffffff;
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  box-shadow: var(--shadow-sm);
}

.dropzone-text {
  font-size: 1rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

.dropzone-text span {
  color: var(--accent);
  text-decoration: underline;
}

.dropzone-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Mic & Synth Panels */
.mic-panel,
.synth-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.mic-status {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.synth-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.synth-btn:hover,
.synth-btn.active {
  border-color: var(--accent-border);
  background: var(--accent-light);
  color: var(--accent);
}

/* Transport Bar */
.transport-bar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

.transport-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-icon {
  width: 38px;
  height: 38px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.btn-icon:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-light);
}

.btn-icon.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.time-display-group {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.time-display {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-surface);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.jump-modal {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 320px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.05);
  padding: 18px;
  z-index: 1000;
  animation: jumpModalFade 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes jumpModalFade {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.jump-modal.hidden {
  display: none !important;
}

.jump-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.jump-modal-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: var(--text-muted);
  line-height: 1;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
  cursor: none !important;
}

.btn-close-modal:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.jump-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.jump-hint code {
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  color: var(--accent);
}

.jump-input-row {
  display: flex;
  gap: 8px;
}

.jump-input {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: none !important;
  line-height: 1.4;
}

.jump-input::placeholder {
  color: #a1a1aa;
  opacity: 0.7;
}

.jump-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.jump-error {
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: 8px;
  font-weight: 600;
}

.jump-error.hidden {
  display: none !important;
}

.speed-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: auto;
}

select,
.select-input,
.select-input-sm {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--bg-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 7px 32px 7px 12px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  cursor: none !important;
}

select:hover,
.select-input:hover,
.select-input-sm:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-subtle-hover);
}

select:focus,
.select-input:focus,
.select-input-sm:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background-color: #ffffff;
}

select option {
  background-color: #ffffff;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  padding: 8px 12px;
}

.select-input-sm {
  padding: 5px 28px 5px 10px;
  font-size: 0.8rem;
  background-position: right 8px center;
}

/* Scrubber Slider */
.scrubber-wrap {
  width: 100%;
}

.scrubber-slider {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  outline: none;
  -webkit-appearance: none;
}

.scrubber-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.4);
}

/* Buttons */
.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary-full {
  width: 100%;
  background: var(--accent);
  color: #ffffff;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 12px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transition: background 0.15s ease;
}

.btn-primary-full:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  background: var(--bg-subtle);
}

.btn-freeze {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  cursor: none !important;
}

.btn-freeze:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-light);
}

.btn-freeze.active {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.15);
}

/* Visualizer Workspace & Metrics Layout */
.visualizer-workspace {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.grid-main {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 100%;
}

@media (max-width: 768px) {
  .grid-main {
    grid-template-columns: 1fr;
  }
}

.viz-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.viz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  min-height: 32px;
  gap: 8px;
}

.viz-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.viz-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scale-toggle {
  display: flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2px;
}

.toggle-btn {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.toggle-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.tooltip-readout {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-light);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  display: inline-block;
  line-height: 1.4;
}

.viz-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  display: inline-block;
  line-height: 1.4;
}

.canvas-wrap {
  position: relative;
  width: 100%;
  height: 240px;
  background: #090d16;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid #1e293b;
}

.canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Metrics Panel (Positioned Horizontally Below the 4 Visualizers) */
.sidebar-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  width: 100%;
  margin-top: 8px;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.metric-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 14px;
}

/* Peak Meter Bar */
.meter-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.ch-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 14px;
}

.meter-bar-track {
  flex: 1;
  height: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.meter-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #3b82f6 70%, #f43f5e 100%);
  border-radius: var(--radius-full);
  transition: width 0.08s ease-out;
}

.meter-val {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  width: 58px;
  text-align: right;
}

/* Pitch Display */
.pitch-display {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  min-height: 42px;
}

.pitch-note {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-mono);
  line-height: 1;
  min-width: 60px;
  display: inline-block;
}

.pitch-freq {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

.pitch-cents-track {
  position: relative;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.pitch-cents-needle {
  position: absolute;
  top: 0;
  width: 6px;
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transform: translateX(-50%);
  transition: left 0.1s ease-out;
}

/* Stat Rows */
.stat-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stat-row strong {
  font-family: var(--font-mono);
  color: var(--text-main);
  font-size: 0.9rem;
}

/* Config Form */
.config-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.range-slider {
  width: 100%;
  accent-color: var(--accent);
}

/* SEO Content Section */
.seo-section {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

.seo-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 38px 34px;
  margin-bottom: 44px;
  box-shadow: var(--shadow-card);
}

.seo-heading {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
  margin-bottom: 16px;
}

.seo-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 18px;
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 28px;
}

.seo-feature-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.seo-feature-box:hover {
  border-color: var(--accent-border);
  background: #ffffff;
}

.seo-feature-title {
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.seo-feature-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Beginner Guide Banner */
.guide-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.guide-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: none !important;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  list-style: none;
}

.guide-banner-header::-webkit-details-marker {
  display: none;
}

.guide-banner-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.guide-banner-toggle {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}

.guide-banner-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

@media (max-width: 900px) {
  .guide-banner-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 550px) {
  .guide-banner-grid {
    grid-template-columns: 1fr;
  }
}

.guide-col {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
}

.guide-col-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.guide-col p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* FAQ Accordion Section */
.faq-section {
  margin-top: 48px;
  margin-bottom: 64px;
}

.faq-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 10px;
}

.faq-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 620px;
  margin: 0 auto 36px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 860px;
  margin: 0 auto;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.faq-item[open] {
  border-color: var(--accent-border);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
}

.faq-question {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  padding: 18px 22px;
  cursor: none !important;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-dim);
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
}

.faq-item[open] .faq-question::after {
  transform: rotate(45deg);
  color: var(--accent);
  font-weight: 600;
}

.faq-answer {
  padding: 0 22px 20px;
  font-size: 0.885rem;
  color: var(--text-muted);
  line-height: 1.65;
  border-top: 1px solid transparent;
  animation: faqExpand 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes faqExpand {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding-top: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 16px;
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 16px;
  transition: color 0.15s ease;
}

footer a:hover {
  color: var(--text-main);
}

/* ══ RESPONSIVE BREAKPOINTS (TABLET & MOBILE OPTIMIZATIONS) ══ */
@media (max-width: 1180px) {
  .sidebar-metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .viz-header {
    flex-wrap: wrap;
    align-items: flex-start;
    row-gap: 8px;
  }
}

@media (max-width: 768px) {
  .shell {
    padding: 0 16px 48px;
  }
  .topbar {
    padding: 16px 0;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .topbar-actions {
    gap: 10px;
  }
  .privacy-badge {
    padding: 5px 10px;
    font-size: 0.75rem;
  }
  .control-panel {
    padding: 16px;
  }
  .input-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .tab-btn {
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 7px 12px;
  }
  .transport-bar {
    padding: 14px;
  }
  .transport-controls {
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
  }
  .speed-select-wrap {
    margin-left: 0;
  }
  .btn-freeze {
    flex: 1 1 auto;
    justify-content: center;
  }
  .grid-main {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .viz-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
  .tooltip-readout {
    max-width: 100%;
  }
  .sidebar-metrics {
    grid-template-columns: 1fr;
  }
  .seo-card {
    padding: 24px 18px;
  }
}

@media (max-width: 480px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }
  .brand-title {
    font-size: 1.05rem;
  }
  .dropzone {
    padding: 24px 14px;
  }
  .canvas-wrap {
    height: 200px;
  }
  .pitch-note {
    font-size: 1.8rem;
  }
  .btn-primary-full {
    font-size: 0.85rem;
    padding: 10px;
  }
}
