/* maxmusic — analog studio */

:root {
  --bg-0: #121110;
  --bg-1: #1a1816;
  --bg-2: #22201c;
  --bg-3: #2c2924;
  --bg-4: #38342e;
  --line: rgba(236, 230, 220, 0.08);
  --line-strong: rgba(236, 230, 220, 0.14);
  --text-1: #ece6dc;
  --text-2: #a8a095;
  --text-3: #6e6a62;
  --text-4: #4a4742;
  --accent: #c17f59;
  --accent-hover: #d4926a;
  --accent-muted: rgba(193, 127, 89, 0.15);
  --accent-2: #5a8f7b;
  --success: #6b9e78;
  --danger: #c45c5c;
  --warning: #c9a227;
  --radius: 6px;
  --radius-lg: 10px;
  --font: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sidebar-w: 220px;
  --brand-mark-w: 5.75rem;
  --preview-w: min(520px, 46vw);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-1);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

a { color: var(--accent-2); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
textarea { resize: vertical; }

.app {
  display: flex;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 14px 10px 28px;
  margin-bottom: 8px;
}
.brand-logo-wrap {
  width: var(--brand-mark-w);
  flex-shrink: 0;
}
.brand-logo {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
}
.brand-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: var(--brand-mark-w);
}
.brand-name {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.03em;
  width: 100%;
}
.brand-sub {
  font-size: 11px;
  color: var(--text-3);
  display: block;
}

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-weight: 500;
  font-size: 13px;
  text-align: left;
  transition: background 0.15s var(--ease), color 0.15s;
}
.nav-btn:hover { background: var(--bg-2); color: var(--text-1); }
.nav-btn.active {
  background: var(--accent-muted);
  color: var(--text-1);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(193, 127, 89, 0.22);
}
.nav-label { flex: 1; }
.nav-badge {
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--text-2);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.nav-btn.active .nav-badge {
  background: rgba(193, 127, 89, 0.18);
  border-color: rgba(193, 127, 89, 0.35);
  color: var(--text-1);
}
.nav-btn svg { opacity: 0.65; flex-shrink: 0; }
.nav-btn.active svg { opacity: 1; color: var(--accent); }

.sidebar-foot {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--text-3);
}
.api-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--bg-2);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.api-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-4);
}
.api-pill.ready .dot { background: var(--success); }
.api-pill.error .dot { background: var(--danger); }

/* Main */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
}
.menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text-1);
  flex-shrink: 0;
}
.topbar-titles { min-width: 0; flex: 1; }
.topbar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.topbar p { margin: 2px 0 0; font-size: 12px; color: var(--text-3); }

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 55;
  backdrop-filter: blur(2px);
}
.sidebar-backdrop[hidden] { display: none !important; }

.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr var(--preview-w);
  gap: 0;
  min-height: 0;
  overflow: hidden;
}
.workspace.single-col { grid-template-columns: 1fr; }

.panel-main {
  padding: 24px 28px 40px;
  min-height: 0;
  overflow-y: hidden;
  overflow-x: hidden;
}

/* Center column scrolls after session starts, or on Covers/Lyrics/Library */
.workspace.has-preview-active .panel-main,
.workspace.main-panel-scroll .panel-main,
.workspace.single-col .panel-main {
  overflow-y: auto;
}

.panel-preview {
  background: var(--bg-1);
  border-left: 1px solid var(--line);
  padding: 24px;
  min-height: 0;
  overflow-y: hidden;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.workspace.has-preview-active .panel-preview:not(.panel-preview--idle) {
  overflow-y: auto;
}
.panel-preview #previewSingle:not([hidden]) {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.view[hidden] { display: none !important; }

/* Fields */
.field { margin-bottom: 18px; }
.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field-hint { font-size: 11px; color: var(--text-3); margin-top: 6px; }

.text-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s;
}
.text-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-muted);
}

.mode-tabs, .seg-control {
  display: flex;
  gap: 4px;
  background: var(--bg-2);
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 20px;
}
.mode-tab, .seg-btn {
  flex: 1;
  padding: 9px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  transition: all 0.15s;
}
.mode-tab:hover, .seg-btn:hover { color: var(--text-1); }
.mode-tab.active, .seg-btn.active {
  background: var(--bg-3);
  color: var(--text-1);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.chip-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.wand-chip-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  box-shadow: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, opacity 0.15s;
}
.wand-chip-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-muted);
}
.wand-chip-btn:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-muted);
}
.wand-chip-btn:disabled {
  opacity: 0.45;
  cursor: wait;
}
.wand-chip-btn .wand-icon {
  display: block;
  width: 18px;
  height: 18px;
  color: var(--text-2);
  transition: color 0.15s;
}
.wand-chip-btn:hover:not(:disabled) .wand-icon {
  color: var(--accent-hover);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.chip {
  padding: 5px 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-2);
}
.chip:hover { border-color: var(--accent); color: var(--text-1); }

.lyrics-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}
.tag-btn {
  padding: 3px 8px;
  font-size: 10px;
  font-family: var(--font-mono);
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text-2);
}
.tag-btn:hover { background: var(--accent); color: var(--bg-0); border-color: var(--accent); }
.lyrics-input {
  border-radius: 0 0 var(--radius) var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  min-height: 160px;
}

.switch {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-2);
}
.switch input { display: none; }
.switch-ui {
  width: 36px;
  height: 20px;
  background: var(--bg-3);
  border-radius: 10px;
  border: 1px solid var(--line);
  position: relative;
  transition: background 0.15s;
}
.switch-ui::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform 0.15s;
}
.switch input:checked + .switch-ui {
  background: var(--accent-muted);
  border-color: var(--accent);
}
.switch input:checked + .switch-ui::after {
  transform: translateX(16px);
  background: var(--accent);
}

.dropzone {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-2);
  transition: border-color 0.15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); }
.dropzone-loaded {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.advanced {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  margin-bottom: 16px;
}
.advanced summary {
  padding: 12px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  list-style: none;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced-body { padding: 0 14px 14px; }
.field-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.primary-btn {
  width: 100%;
  padding: 14px 20px;
  background: var(--accent);
  color: var(--bg-0);
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.primary-btn:hover:not(:disabled) { background: var(--accent-hover); }
.primary-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.secondary-btn {
  padding: 8px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
.secondary-btn:hover { color: var(--text-1); border-color: var(--line-strong); }

.alert {
  padding: 12px 14px;
  background: rgba(196, 92, 92, 0.12);
  border: 1px solid rgba(196, 92, 92, 0.35);
  border-radius: var(--radius);
  color: #e8a8a8;
  font-size: 12px;
  margin-bottom: 14px;
}

/* Preview panel */
.preview-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-3);
}
.preview-empty h2 { font-size: 16px; color: var(--text-2); margin: 16px 0 8px; }

.preview-session {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}
.session-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}
.session-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: -0.02em;
}
.session-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  padding-right: 4px;
}
.preview-session:not([hidden]) .session-list {
  overflow-y: auto;
  min-height: 120px;
  max-height: calc(100vh - 200px);
}
.session-list.suno-clips {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.take-card.in-library {
  border-color: rgba(107, 158, 120, 0.35);
}
.take-saved-badge {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--success);
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(107, 158, 120, 0.12);
}
.take-video-progress {
  margin-top: 8px;
}
.take-video-progress .video-export-bar {
  height: 4px;
}
.take-video-progress .video-export-msg {
  margin: 4px 0 0;
  font-size: 10px;
}
.video-export-panel {
  background: var(--bg-2);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 14px;
  flex-shrink: 0;
}
.video-export-panel.is-done {
  border-color: var(--success);
}
.video-export-panel.is-error {
  border-color: var(--danger);
}
.video-export-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.video-export-head strong {
  font-size: 13px;
  color: var(--text-1);
}
.video-export-msg {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-2);
}
.video-export-bar {
  height: 6px;
  background: var(--bg-3);
  border-radius: 999px;
  overflow: hidden;
}
.video-export-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 999px;
  transition: width 0.25s var(--ease);
}
.preview-dual.suno-clips {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.take-card.suno-row {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.take-card.suno-row .take-main { flex: 1; min-width: 0; }
.take-card.suno-row .take-art {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  margin-bottom: 0;
}
.take-prompt {
  font-size: 12px;
  color: var(--text-3);
  margin: 4px 0 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.take-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.take-card.is-ready {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-muted);
}
.take-card.is-failed { border-color: rgba(196, 92, 92, 0.4); }
.take-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.take-card-head .take-title {
  flex: 1;
  min-width: 0;
}
.take-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.06em;
}
.take-status {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.take-status--creating {
  color: var(--text-2);
  background: var(--bg-3);
  animation: take-pulse 1.4s ease-in-out infinite;
}
.take-status--ready {
  color: var(--success);
  background: rgba(107, 158, 120, 0.15);
}
.take-status--failed {
  color: var(--danger);
  background: rgba(196, 92, 92, 0.12);
}
@keyframes take-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
.take-art {
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: var(--bg-3);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.take-art.is-generating::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(236, 230, 220, 0.06) 50%,
    transparent 60%
  );
  animation: take-shimmer 1.6s ease-in-out infinite;
}
@keyframes take-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.take-art { cursor: default; }
.take-mini-player {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.take-mini-play {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--text-1);
  color: var(--bg-0);
  border: none;
  display: grid;
  place-items: center;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.take-mini-play.is-playing { background: var(--accent); }
.take-mini-transport {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.take-mini-time {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-3);
}
.take-seek {
  width: 100%;
  height: 4px;
  margin: 0;
  padding: 0;
  appearance: none;
  background: var(--bg-3);
  border-radius: 2px;
  cursor: pointer;
  accent-color: var(--accent);
}
.take-seek::-webkit-slider-thumb {
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  margin-top: -3px;
}
.take-seek::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
}
.take-audio {
  display: none;
}
.take-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.take-sub {
  font-size: 11px;
  color: var(--text-3);
  margin: 0;
}
.take-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.take-actions .secondary-btn {
  flex: 1 1 auto;
  min-width: calc(50% - 4px);
  justify-content: center;
  font-size: 10px;
  padding: 7px 6px;
  line-height: 1.25;
  text-align: center;
}
.take-actions .secondary-btn[data-act="lyric-video"] {
  min-width: 100%;
}
.take-error {
  font-size: 11px;
  color: #e8a8a8;
  margin: 0;
  line-height: 1.4;
}
.player-cover {
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  background: var(--bg-3);
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
}
.player-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.player-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.player-sub { font-size: 12px; color: var(--text-3); margin-bottom: 16px; }

.player-controls {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.player-transport { flex: 1; min-width: 0; }

.waveform-wrap {
  position: relative;
  height: 56px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: pointer;
}
.waveform-wrap canvas {
  display: block;
  width: 100%;
  height: 56px;
}
.waveform-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  left: 0;
  pointer-events: none;
  transition: left 0.05s linear;
}
.waveform-wrap.is-loading { opacity: 0.5; }
.ctrl-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--text-1);
  color: var(--bg-0);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.progress-times {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-3);
  margin-top: 6px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.action-row .secondary-btn {
  flex: 1 1 auto;
  min-width: calc(50% - 4px);
  justify-content: center;
  font-size: 11px;
}

.loading-block {
  text-align: center;
  padding: 40px 12px;
}
.loading-bar {
  height: 3px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
  margin: 20px 0;
}
.loading-bar span {
  display: block;
  height: 100%;
  width: 30%;
  background: var(--accent);
  animation: load-slide 1.2s ease-in-out infinite;
}
@keyframes load-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* Library */
.library-video-panel { margin-bottom: 16px; }
.library-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.library-view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
}
.view-toggle-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.view-toggle-btn:hover { color: var(--text-1); background: var(--bg-3); }
.view-toggle-btn.active {
  background: var(--accent-muted);
  color: var(--accent);
}
.library-grid--list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.library-grid--tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.library-card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}
.library-card:hover { border-color: var(--line-strong); }
.library-card.is-playing {
  border-color: rgba(193, 127, 89, 0.45);
  background: var(--bg-1);
}
.library-card--list {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.library-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(193, 127, 89, 0.35);
  border-radius: 50%;
  background: rgba(20, 18, 16, 0.82);
  color: var(--accent);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.library-card:hover .library-remove,
.library-card:focus-within .library-remove { opacity: 1; }
.library-remove:hover {
  background: var(--accent-muted);
  color: var(--text-1);
}
.library-art {
  width: 72px;
  min-height: 72px;
  flex-shrink: 0;
  background: var(--bg-3);
  background-size: cover;
  background-position: center;
}
.library-main {
  flex: 1;
  min-width: 0;
  padding: 10px 36px 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.library-head .card-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
.library-mini-player { margin-top: 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.library-play { width: 34px; height: 34px; font-size: 11px; }
.card-sub { font-size: 11px; color: var(--text-3); margin: 0; }
.library-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.library-actions .secondary-btn {
  font-size: 10px;
  padding: 6px 10px;
  line-height: 1.25;
}
.library-actions .secondary-btn[data-act="lyric-video"] {
  flex: 1 1 100%;
  text-align: center;
}
.library-video-progress {
  font-size: 11px;
  color: var(--text-3);
}
.library-video-progress .video-export-bar {
  margin-top: 6px;
  height: 4px;
}
.library-audio { display: none; }

.library-card--tile {
  display: flex;
  flex-direction: column;
}
.library-tile-cover {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-3);
  background-size: cover;
  background-position: center;
}
.library-play--tile {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  opacity: 0.92;
}
.library-card--tile:hover .library-play--tile,
.library-card--tile.is-playing .library-play--tile { opacity: 1; }
.library-tile-body {
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.library-tile-body .card-title {
  font-size: 12px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.library-tile-seek { gap: 4px; }
.library-card--tile .library-remove { top: 6px; right: 6px; }
.library-card--tile .library-actions .secondary-btn[data-act="lyric-video"] {
  flex: 1 1 100%;
}

/* Settings */
.settings-card {
  max-width: 560px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.settings-card h3 { margin: 0 0 10px; font-size: 14px; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  padding: 10px 18px;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 12px;
  opacity: 0;
  transition: all 0.2s;
  z-index: 100;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr; }
  .panel-preview { border-left: none; border-top: 1px solid var(--line); }
}

@media (max-width: 768px) {
  .menu-btn { display: grid; }
  .topbar { padding: 12px 16px; }
  .panel-main { padding: 16px; }
  .panel-preview { padding: 16px; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 60;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.4);
  }
  .sidebar.open { transform: translateX(0); }

  .take-card.suno-row { flex-wrap: wrap; }
  .library-head .field-head { flex-direction: column; align-items: stretch; }
}