/* MomentAI — Nocturne design system */

:root {
  --bg: #17110c;
  --surface: #211913;
  --surface-alt: #261e16;
  --surface-deep: #0e0a07;
  --border: #2c2620;
  --border-strong: #3a332b;
  --border-dashed: #4a4136;
  --text: #ece5da;
  --text-secondary: #9a8f80;
  --text-muted: #8a7f6e;
  --text-faint: #6b6156;
  --accent: #e9a94f;
  --accent-hover: #f2bd6d;
  --accent-ink: #1d1509;
  --chip-text: #cfc6b8;
  --danger: #c45c4a;
  --spotify: #1db954;

  --font: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-panel: 14px;
  --radius-pill: 999px;

  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 20px;
  --space-5: 28px;
  --space-6: 40px;
  --space-7: 56px;
  --space-8: 72px;

  --max: 1180px;
  --form-max: 720px;

  --z-base: 1;
  --z-sticky: 20;
  --z-modal: 40;

  --motion-fast: 150ms;
  --motion-normal: 200ms;
  --ease-out: ease-out;

  /* Legacy aliases used by existing JS class names */
  --bg-primary: var(--bg);
  --bg-secondary: var(--surface);
  --bg-surface: var(--surface-alt);
  --card-bg: var(--surface);
  --card-border: var(--border);
  --card-border-hover: var(--border-strong);
  --text-main: var(--text);
  --color-mint: var(--accent);
  --color-purple: var(--accent);
  --color-purple-hover: #efb15f;
  --color-cyan: var(--accent);
  --color-spotify: var(--spotify);
  --color-spotify-hover: #1ed760;
  --font-body: var(--font);
  --font-display: var(--font);
  --section-gap: var(--space-5);
  --panel-radius: var(--radius-panel);
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
a {
  font: inherit;
  color: inherit;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn:focus-visible,
.mood-chip:focus-visible,
.btn-text:focus-visible,
.modal-close:focus-visible,
.btn-track-action:focus-visible,
.btn-play-preview:focus-visible,
.drop-zone:focus-visible,
.header-nav-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

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

.mono,
.stat-label,
.eyebrow,
.playlist-section-label,
.drop-text-secondary,
.tracklist-head,
.track-index,
.track-duration,
.user-meta,
.app-footer,
.badge-coming-soon,
.badge-featured {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ---------- Layout shell ---------- */

.app-container {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: var(--space-4) var(--space-6) var(--space-7);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-height: 100dvh;
}

.app-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}

.logo-mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.logo h1 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}

.header-nav {
  display: none;
  align-items: center;
  gap: 28px;
  margin-left: var(--space-3);
}

.header-nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color var(--motion-fast) var(--ease-out);
}

.header-nav-link:hover {
  color: var(--accent);
}

.header-new-analysis {
  margin-left: var(--space-2);
  color: var(--text-secondary);
}

.user-panel {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.token-badge,
.quota-badge,
.premium-badge {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  color: var(--accent);
  background: transparent;
  font-weight: 500;
}

/* ---------- Type ---------- */

.eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title,
.moment-title,
.how-it-works-title,
.aesthetic-title,
.card-header h2,
.modal-content h2 {
  text-wrap: balance;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.hero-subtitle,
.moment-sub,
.step-copy p,
.modal-subtitle,
#playlistStatusText,
.pricing-desc,
.tracklist-placeholder p {
  text-wrap: pretty;
  color: var(--text-secondary);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 13px 24px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition:
    background-color var(--motion-fast) var(--ease-out),
    border-color var(--motion-fast) var(--ease-out),
    color var(--motion-fast) var(--ease-out),
    opacity var(--motion-fast) var(--ease-out),
    transform var(--motion-fast) var(--ease-out);
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary,
.btn-purple,
.btn-success {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled),
.btn-purple:hover:not(:disabled),
.btn-success:hover:not(:disabled) {
  background: #efb15f;
  border-color: #efb15f;
}

.btn-secondary {
  background: transparent;
  color: var(--chip-text);
  border-color: var(--border-strong);
  font-weight: 500;
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-light {
  background: var(--text);
  color: var(--accent-ink);
  font-weight: 500;
  padding: 9px 18px;
  min-height: 40px;
}

.btn-light:hover:not(:disabled) {
  background: #f5efe6;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  min-height: 44px;
  padding: 8px 4px;
  transition: color var(--motion-fast) var(--ease-out);
}

.btn-text:hover {
  color: var(--accent);
  text-decoration: none;
}

.btn-full {
  width: 100%;
}

.btn-sm {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 14px;
}

.btn-google-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--text);
  color: var(--accent-ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--motion-fast) var(--ease-out);
}

.btn-google-signin:hover {
  opacity: 0.9;
}

.btn-google-signin.btn-full {
  width: 100%;
  padding: 14px 16px;
}

.btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(22, 19, 15, 0.25);
  border-top-color: var(--accent-ink);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.btn-secondary.is-loading::after {
  border-color: rgba(236, 229, 218, 0.2);
  border-top-color: var(--text);
}

/* ---------- Dashboard ---------- */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  flex-grow: 1;
}

.dashboard-grid.landing-state {
  max-width: 100%;
  width: 100%;
  margin: 0;
}

.dashboard-grid.landing-state .right-panel {
  display: none !important;
}

.dashboard-grid.landing-state .landing-stack {
  width: 100%;
}

.panel-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
}

.landing-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
  width: 100%;
}

.landing-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  width: 100%;
}

.landing-hero-card,
.landing-upload-card,
.how-it-works-card,
.glass-card,
.surface-panel {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.landing-upload-card.surface-panel,
.analysis-card.surface-panel,
.playlist-card.surface-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: var(--space-5) var(--space-4);
}

.landing-hero {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: var(--space-4) 0;
}

.hero-title {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  max-width: 16ch;
}

.hero-subtitle {
  font-size: 17px;
  max-width: 44ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.btn-upload-trigger {
  display: inline-flex;
}

.feature-pills,
.feature-pill {
  display: none;
}

.landing-drop-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
  min-width: 0;
}

.moment-intro {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.moment-title {
  font-size: clamp(1.5rem, 2.5vw, 2.125rem);
}

.moment-sub {
  font-size: 15px;
}

.drop-zone-outer {
  width: 100%;
}

.drop-zone {
  position: relative;
  height: 220px;
  border: 1.5px dashed var(--border-dashed);
  border-radius: var(--radius-lg);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color var(--motion-fast) var(--ease-out),
    background-color var(--motion-fast) var(--ease-out);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: #221e19;
}

.drop-zone-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: var(--space-4);
  pointer-events: none;
}

.upload-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}

.drop-text-primary {
  font-size: 15px;
  font-weight: 500;
}

.drop-text-secondary {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.upload-preview-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.divider-or {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-faint);
  font-size: 13px;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.custom-prompt-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.prompt-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.prompt-input,
textarea.prompt-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  padding: 16px 20px;
  font-size: 16px;
  line-height: 1.5;
  resize: vertical;
  transition:
    border-color var(--motion-fast) var(--ease-out),
    background-color var(--motion-fast) var(--ease-out);
}

.prompt-textarea {
  min-height: 84px;
}

.prompt-input::placeholder {
  color: #7d7365;
}

.prompt-input:hover {
  border-color: var(--border-strong);
}

.prompt-input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.mood-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.mood-chip {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--chip-text);
  font-size: 13px;
  cursor: pointer;
  transition:
    border-color var(--motion-fast) var(--ease-out),
    color var(--motion-fast) var(--ease-out),
    background-color var(--motion-fast) var(--ease-out);
}

.mood-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mood-chip.is-selected,
.mood-chip[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-generate {
  margin-top: var(--space-2);
  padding: 17px 0;
  font-size: 16px;
}

/* How it works — editorial list, not card tower */

.how-it-works {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}

.how-it-works-title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  width: 100%;
}

.step-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  border-radius: 0;
  min-width: 0;
}

.step-card:last-child {
  border-bottom: none;
}

.step-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  width: auto;
  height: auto;
  background: transparent;
  border-radius: 0;
  padding-top: 4px;
}

.step-copy h4 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 6px;
}

.step-copy p {
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- Analysis ---------- */

.analysis-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.analysis-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  align-items: start;
}

.visual-player-source {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #1e1b18;
  border: 1px solid var(--border);
}

.visual-player-source img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.analysis-overlay {
  position: absolute;
  inset: 0;
  background: rgba(22, 19, 15, 0.72);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
}

.analysis-overlay p {
  font-size: 14px;
  color: var(--text-secondary);
}

.scan-bar {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  animation: scan 2.4s linear infinite;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--surface-alt);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes scan {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

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

.aesthetic-preview {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.aesthetic-title {
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  margin-top: 8px;
}

.stat-grid,
.metric-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 76px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-value,
.metric-pill {
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
}

.color-swatches {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid rgba(236, 229, 218, 0.08);
}

.genre-chip-row,
.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.genre-chip,
.tag.genre-tag,
.tag {
  background: var(--surface-alt);
  border: none;
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font-size: 13px;
  color: var(--chip-text);
}

.curation-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.curation-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

.progress-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 18%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width var(--motion-normal) var(--ease-out);
}

.analysis-card.is-analyzing .progress-fill {
  width: 58%;
}

.analysis-card.is-ready .progress-fill {
  width: 100%;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-4) 0;
}

.section-divider--actions {
  margin-bottom: 0;
}

.card-section--player:not(:has(.spotify-embed-container:not(.hidden))) {
  display: none;
}

.card-section--player:not(:has(.spotify-embed-container:not(.hidden))) + .section-divider {
  display: none;
}

.card-section--actions:not(:has(.btn:not(.hidden))) {
  display: none;
}

.section-divider--actions:has(+ .card-section--actions:not(:has(.btn:not(.hidden)))) {
  display: none;
}

/* ---------- Playlist ---------- */

.playlist-card {
  display: flex;
  flex-direction: column;
  min-height: 480px;
  height: 100%;
}

.card-header h2 {
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  margin: 8px 0 10px;
}

.card-header p,
#playlistStatusText {
  font-size: 15px;
}

.playlist-header-actions {
  margin-bottom: 0;
}

.playlist-editor {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 0;
  flex: 1;
}

.playlist-tracks-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  gap: 4px;
}

.playlist-section-label {
  margin: 0;
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.tracklist-head {
  display: none;
}

.tracklist-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-height: 180px;
  max-height: min(48vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.tracklist-container::-webkit-scrollbar,
.suggestions-list::-webkit-scrollbar {
  width: 6px;
}

.tracklist-container::-webkit-scrollbar-thumb,
.suggestions-list::-webkit-scrollbar-thumb {
  background: var(--surface-alt);
  border-radius: 3px;
}

.tracklist-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  min-height: 280px;
  text-align: center;
  color: var(--text-secondary);
  padding: var(--space-5);
}

.placeholder-icon {
  opacity: 0.35;
  color: var(--text-muted);
}

.placeholder-icon .svg-icon {
  width: 2.5rem;
  height: 2.5rem;
}

.track-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  transition: background-color var(--motion-fast) var(--ease-out);
}

.track-card:hover,
.track-card:focus-within {
  background: #221e19;
}

.track-card.active {
  background: #221e19;
  box-shadow: inset 2px 0 0 var(--accent);
}

.track-main-info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.track-index {
  color: var(--text-faint);
  font-size: 13px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.track-cover {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.track-cover--fallback {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.track-cover--fallback::after {
  content: "♪";
  color: var(--text-muted);
}

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

.track-title {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-album {
  display: none;
  color: var(--text-secondary);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  flex-shrink: 0;
}

.track-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 0;
  flex-shrink: 0;
}

.track-duration {
  color: var(--text-faint);
  font-size: 13px;
  min-width: 3.25rem;
  text-align: right;
}

.btn-play-preview,
.btn-track-action {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--chip-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    border-color var(--motion-fast) var(--ease-out),
    color var(--motion-fast) var(--ease-out),
    background-color var(--motion-fast) var(--ease-out),
    opacity var(--motion-fast) var(--ease-out);
}

.btn-play-preview:hover,
.btn-track-action:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-remove-track:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.btn-add-track:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.track-card.track-blurred {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
  opacity: 0.5;
}

.blur-signin-banner {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.blur-banner-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.blur-banner-content p {
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 36ch;
}

.blur-banner-icon {
  display: none;
}

.suggestions-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

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

.btn-load-more {
  color: var(--accent);
}

.suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(32vh, 280px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.suggestions-empty {
  color: var(--text-secondary);
  font-size: 14px;
  padding: 8px 0;
}

.preview-ctas {
  display: flex;
  gap: 12px;
  margin-top: 0;
}

.preview-ctas .btn {
  flex: 1;
}

.spotify-embed-container {
  width: 100%;
  min-height: 80px;
  height: auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.spotify-embed-container iframe {
  width: 100%;
  height: 80px;
  border: none;
  display: block;
  background: #000;
}

.custom-audio-player {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(165deg, #2a2118, #17110c);
}

.player-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.player-label {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.player-track-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 180px;
  max-width: 280px;
}

.volume-mute-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px;
  color: var(--text);
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(236, 231, 223, 0.15);
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #1d1509;
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #1d1509;
  cursor: pointer;
}

.volume-pct {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
}

.iframe-player-wrapper {
  background: #000;
}

.iframe-volume-note {
  padding: 8px 12px 10px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(12, 10, 8, 0.78);
  z-index: var(--z-modal);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-4);
  padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
}

.modal-content {
  width: 100%;
  max-width: 720px;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: var(--space-6) var(--space-5);
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  cursor: pointer;
  transition: color var(--motion-fast) var(--ease-out);
}

.modal-close:hover {
  color: var(--text);
}

.modal-content h2 {
  font-size: clamp(1.5rem, 2.5vw, 1.85rem);
  text-align: center;
  margin-bottom: 8px;
}

.modal-subtitle {
  text-align: center;
  margin-bottom: var(--space-5);
  font-size: 15px;
}

.modal-grids {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.pricing-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.pricing-card.featured {
  border-color: var(--border-strong);
}

.badge-coming-soon,
.badge-featured {
  display: inline-block;
  width: fit-content;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border-strong);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.pricing-card h3 {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.price {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
}

.price span {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-muted);
}

.pricing-desc {
  font-size: 14px;
  text-align: center;
  margin-bottom: 8px;
  min-height: 40px;
}

.pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  margin: 8px 0 20px;
  flex-grow: 1;
  color: var(--chip-text);
}

.save-modal-content,
.auth-gate-modal-content,
.success-modal-content,
.error-modal-content {
  max-width: 420px;
}

.save-modal-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-align: left;
}

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

.form-group label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font);
}

.checkbox-label input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.checkbox-group {
  padding-top: 4px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
}

.success-actions,
.error-actions {
  justify-content: center;
}

.success-icon-badge,
.error-icon-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  border: 1px solid var(--border-strong);
  background: var(--bg);
}

.success-icon-badge {
  color: var(--accent);
}

.error-icon-badge {
  color: var(--danger);
  border-color: rgba(196, 92, 74, 0.45);
}

.auth-toggle-row {
  text-align: center;
  margin-top: var(--space-4);
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-toggle-row .btn-text {
  color: var(--accent);
  margin-left: 4px;
  min-height: auto;
  padding: 0;
}

.app-footer {
  text-align: center;
  padding: var(--space-5) 0 calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  margin-top: auto;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-faint);
}

.footer-links {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: center;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--motion-fast) var(--ease-out);
}

.footer-link:hover {
  color: var(--accent);
}

/* ---------- Motion ---------- */

.animate-panel {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition:
    opacity var(--motion-normal) var(--ease-out),
    transform var(--motion-normal) var(--ease-out);
}

.animate-panel.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.animate-modal {
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-normal) var(--ease-out);
}

.animate-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.animate-modal.is-closing {
  opacity: 0;
  pointer-events: none;
}

.animate-modal .modal-content {
  transform: translateY(8px);
  opacity: 0;
  transition:
    transform var(--motion-normal) var(--ease-out),
    opacity var(--motion-normal) var(--ease-out);
}

.animate-modal.is-visible .modal-content {
  transform: translateY(0);
  opacity: 1;
}

.animate-modal.is-closing .modal-content {
  transform: translateY(6px);
  opacity: 0;
}

.stagger-enter {
  opacity: 0;
  transform: translateY(8px);
}

.stagger-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity var(--motion-normal) var(--ease-out),
    transform var(--motion-normal) var(--ease-out);
  transition-delay: var(--stagger-delay, 0ms);
}

.svg-icon {
  width: 1.1rem;
  height: 1.1rem;
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  fill: none;
}

/* Locked preview: quiet, no neon */
.playlist-card.preview-locked {
  position: relative;
}

.playlist-card.preview-locked .playlist-editor {
  filter: blur(6px) brightness(0.7);
  pointer-events: none;
  user-select: none;
}

.playlist-card.preview-locked::after {
  content: "Sign in to unlock recommendations";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  text-align: center;
  z-index: var(--z-sticky);
  width: min(85%, 320px);
  pointer-events: none;
}

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

@media (min-width: 600px) {
  .modal-grids {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 768px) {
  .steps-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
  }

  .step-card {
    border-bottom: none;
    padding: 0;
    gap: 12px;
  }

  .track-album {
    display: block;
  }
}

@media (min-width: 1024px) {
  .app-container {
    padding: var(--space-5) var(--space-6) var(--space-8);
  }

  .header-nav {
    display: flex;
  }

  .btn-upload-trigger {
    display: none;
  }

  .landing-layout {
    grid-template-columns: 1.1fr 1fr;
    gap: 48px;
    align-items: start;
    padding: 48px 0 24px;
  }

  .landing-hero {
    padding: 0;
    min-height: 100%;
  }

  .landing-upload-card.surface-panel {
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
  }

  .landing-drop-card {
    gap: var(--space-4);
  }

  .dashboard-grid.preview-state {
    grid-template-columns: minmax(380px, 460px) minmax(0, 1fr);
    gap: 36px;
  }

  .analysis-layout {
    grid-template-columns: 1fr;
  }

  body.is-preview .app-container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }

  .dashboard-grid.preview-state .right-panel.animate-panel {
    transform: translateY(10px);
  }

  .dashboard-grid.preview-state .right-panel.animate-panel.is-visible {
    transform: translateY(0);
  }

  .dashboard-grid.preview-state .landing-stack,
  .dashboard-grid.preview-state .how-it-works-card {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .app-container {
    padding: 16px 16px 32px;
  }

  .app-header {
    flex-wrap: wrap;
    row-gap: 8px;
    padding: 16px 0;
    gap: 8px 12px;
  }

  .header-nav {
    display: none !important;
  }

  .landing-upload-card.surface-panel,
  .analysis-card.surface-panel,
  .playlist-card.surface-panel {
    padding: 20px 16px;
  }

  .user-panel {
    margin-left: auto;
  }

  .user-name {
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .visual-player-source {
    aspect-ratio: 4 / 3;
    max-height: 280px;
  }

  .stat-grid,
  .metric-row {
    gap: 10px;
  }

  .track-card {
    gap: 8px;
    padding: 8px;
  }

  .track-duration {
    display: none;
  }

  .dashboard-grid.preview-state .preview-ctas {
    position: sticky;
    bottom: 0;
    z-index: var(--z-sticky);
    display: flex;
    gap: 8px;
    width: 100%;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
    margin-top: 8px;
    background: linear-gradient(to top, var(--surface) 78%, transparent);
  }

  .dashboard-grid.preview-state .preview-ctas .btn {
    flex: 1;
    min-height: 44px;
  }

  .animate-modal {
    align-items: flex-end;
    padding: 0;
  }

  .animate-modal .modal-content {
    max-width: 100%;
    width: 100%;
    border-radius: 14px 14px 0 0;
    transform: translateY(100%);
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .animate-modal.is-visible .modal-content {
    transform: translateY(0);
  }

  .animate-modal.is-closing .modal-content {
    transform: translateY(100%);
    opacity: 1;
  }

  body.is-preview .app-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand account"
      "nav nav";
    align-items: center;
  }

  body.is-preview .logo {
    grid-area: brand;
  }

  body.is-preview .user-panel {
    grid-area: account;
    margin-left: 0;
  }

  body.is-preview .header-new-analysis.preview-only:not(.hidden) {
    grid-area: nav;
    margin-left: 0;
  }
}

@media (hover: none) {
  .btn:active:not(:disabled) {
    transform: scale(0.98);
  }
}

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

  .animate-panel,
  .animate-modal,
  .animate-modal .modal-content,
  .stagger-enter,
  .stagger-visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .scan-bar,
  .spinner,
  .loading-ring,
  .loading-blob,
  .loading-frame-beam,
  .live-dot {
    animation: none !important;
  }
}

/* ─── Camera-first v2 screens ─── */
.mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.eyebrow-amber { color: var(--accent); }
.link-amber { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.photo-placeholder { background: repeating-linear-gradient(45deg, #241c15 0 10px, #1f1710 10px 20px); }

.app-header { position: sticky; top: 0; z-index: var(--z-sticky); display: flex; align-items: center; gap: 16px; min-height: 72px; padding: 0 16px; background: rgba(23,17,12,0.92); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(236,231,223,0.06); }
.logo-mark { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); display: inline-block; }
.logo h1 { font-size: 19px; font-weight: 700; color: var(--text); text-decoration: none; }
.header-nav { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.header-nav-link { color: var(--text-secondary); text-decoration: none; font-size: 14px; }
.btn-nav-plus { background: transparent; border: 1px solid rgba(233,169,79,0.45); color: var(--accent); border-radius: 999px; padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-nav-spotify { background: var(--text); color: var(--accent-ink); border: none; border-radius: 999px; padding: 10px 18px; font-weight: 600; font-size: 14px; cursor: pointer; }

.app-main { position: relative; min-height: calc(100vh - 72px); }
.screen { display: none; padding: 24px 16px 100px; }
.screen--active { display: block; }
.screen-inner { max-width: 600px; margin: 0 auto; }
.screen-inner--playlist { max-width: 680px; }
.screen-inner--paywall { max-width: 760px; }

.capture-hero-card { border-radius: 26px; overflow: hidden; border: 1px solid rgba(233,169,79,0.25); box-shadow: 0 24px 60px rgba(0,0,0,0.45); background: var(--surface); }
.capture-hero-preview { height: 200px; }
.capture-hero-panel { padding: 20px; background: linear-gradient(180deg, transparent, rgba(0,0,0,0.85)); margin-top: -80px; position: relative; }
.hero-headline { font-size: clamp(28px, 5vw, 36px); font-weight: 700; letter-spacing: -0.02em; margin: 8px 0; }
.hero-sub { color: var(--text-secondary); font-size: 15px; margin-bottom: 16px; }
.hero-footnote { margin-top: 12px; color: var(--text-muted); font-size: 11px; }

.moments-section { margin-top: 32px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.section-count { color: var(--text-muted); }
.moments-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.moment-card {
  position: relative;
  text-align: left;
  background: var(--surface);
  border: 1px solid rgba(236,231,223,0.06);
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  color: inherit;
}
.moment-card-open {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.moment-card-photo { height: 130px; background-size: cover; background-position: center; background-color: #241c15; }
.moment-card-photo--empty {
  background-image: linear-gradient(145deg, #2a2118, #17110c) !important;
}
.moment-card-title { padding: 10px 12px 4px; font-size: 15px; font-weight: 700; }
.moment-card-meta { padding: 0 12px 12px; color: var(--text-muted); font-size: 11px; }
.moment-card-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(14, 10, 7, 0.72);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}
.moment-card-delete:hover {
  background: #8a3f32;
  opacity: 1;
}
.moment-nudge-card { grid-column: 1 / -1; background: var(--surface); border: 1px dashed rgba(233,169,79,0.35); border-radius: 18px; padding: 24px; cursor: pointer; color: inherit; text-align: left; }
.moments-empty { color: var(--text-muted); grid-column: 1 / -1; }

.ticker-section { margin-top: 28px; opacity: 0.85; }
.ticker-label { color: var(--text-muted); margin-bottom: 8px; }
.ticker-demo-inline { opacity: 0.7; }
.ticker-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid rgba(236,231,223,0.06);
  pointer-events: none;
}
.ticker-cover {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.ticker-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ticker-demo-label { color: var(--text-muted); flex-shrink: 0; font-size: 11px; }
.ticker-play { color: var(--accent); }
.ticker-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker-meta { color: var(--text-muted); font-size: 11px; }

.home-prompt-section {
  margin: 22px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.home-prompt-section .prompt-hint {
  color: var(--text-muted);
  font-size: 11px;
}

.legal-page .legal-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}
.legal-title {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  margin: 8px 0 6px;
}
.legal-updated {
  color: var(--text-muted);
  margin-bottom: 28px;
}
.legal-section {
  margin-bottom: 24px;
}
.legal-section h3 {
  font-size: 18px;
  margin-bottom: 8px;
}
.legal-section p,
.legal-section li {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 15px;
}
.legal-section ul {
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.legal-back {
  margin-top: 36px;
}

.viewfinder-wrap { position: relative; border-radius: 26px; overflow: hidden; min-height: min(62vh, 560px); background: var(--surface-deep); }
.viewfinder-video, .viewfinder-upload { width: 100%; height: min(62vh, 560px); object-fit: cover; display: block; }
.viewfinder-upload { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.btn-back-circle { position: absolute; top: 14px; left: 14px; width: 38px; height: 38px; border-radius: 50%; border: none; background: rgba(14,10,7,0.6); color: var(--text); font-size: 24px; cursor: pointer; z-index: 2; }
.selfie-pip { position: absolute; top: 14px; right: 14px; width: 88px; height: 116px; border-radius: 14px; border: 2px solid rgba(236,231,223,0.35); overflow: hidden; z-index: 2; }
.selfie-pip video { width: 100%; height: 100%; object-fit: cover; }
.selfie-label { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--text); }
.viewfinder-caption { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; color: var(--accent); font-size: 11px; }
.mood-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px 0; }
.mood-chip { font-family: var(--font-mono); font-size: 11px; text-transform: lowercase; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(236,231,223,0.12); background: transparent; color: var(--text-secondary); cursor: pointer; }
.mood-chip.is-selected { border-color: var(--accent); color: var(--accent); background: rgba(233,169,79,0.13); }
.btn-shutter { display: block; margin: 8px auto; width: 78px; height: 78px; border-radius: 50%; border: 4px solid var(--text); background: transparent; cursor: pointer; padding: 0; }
.btn-shutter-core { display: block; width: 58px; height: 58px; margin: 7px auto; border-radius: 50%; background: var(--accent); }
.capture-footnote { text-align: center; color: var(--text-muted); margin-top: 8px; }
.upload-fallback-link { display: block; text-align: center; margin-top: 8px; width: 100%; }

/* Full-bleed loading: no padded “card” box that clips the aura hard */
body[data-screen="loading"] .app-container {
  width: 100%;
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}
body[data-screen="loading"] .app-header {
  padding-left: 16px;
  padding-right: 16px;
  margin-left: 16px;
  margin-right: 16px;
}
body[data-screen="loading"] .screen[data-screen="loading"] {
  padding: 0;
}

.loading-stage {
  position: relative;
  min-height: calc(100dvh - 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  padding: 28px 16px 48px;
  box-sizing: border-box;
}

/* Soft-mask the glow layer so clipped blobs fade into --bg (no hard rectangle) */
.loading-aura {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  -webkit-mask-image: radial-gradient(ellipse 78% 72% at 50% 48%, #000 28%, transparent 78%);
  mask-image: radial-gradient(ellipse 78% 72% at 50% 48%, #000 28%, transparent 78%);
}

.loading-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  pointer-events: none;
  opacity: 0.95;
}
.loading-blob--blue {
  width: 58vmin;
  height: 58vmin;
  background: rgba(96, 124, 168, 0.42);
  left: -8%;
  top: 18%;
}
.loading-blob--amber {
  width: 52vmin;
  height: 52vmin;
  background: rgba(233, 169, 79, 0.36);
  right: -6%;
  top: 8%;
}
.loading-blob--brown {
  width: 48vmin;
  height: 48vmin;
  background: rgba(160, 110, 70, 0.32);
  bottom: 4%;
  left: 22%;
}

/* Traveling amber highlight along a soft rounded frame (SVG stroke) */
.loading-frame {
  position: absolute;
  inset: clamp(8px, 2vw, 20px);
  pointer-events: none;
  z-index: 0;
}
.loading-frame-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.loading-frame-track {
  stroke: rgba(233, 169, 79, 0.1);
  stroke-width: 1.25;
}
.loading-frame-beam {
  stroke: #f6d28a;
  stroke-width: 2.5;
  stroke-linecap: round;
  /* Short bead so it reads as a moving light, not a partial box edge */
  stroke-dasharray: 7 93;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 6px rgba(233, 169, 79, 0.9));
  animation: loading-beam-travel 2.2s linear infinite;
}
@keyframes loading-beam-travel {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -100; }
}

.loading-copy,
.loading-ring,
.loading-status {
  position: relative;
  z-index: 1;
}

.loading-title {
  font-size: clamp(24px, 4.2vh, 38px);
  font-weight: 700;
}
.loading-sub {
  color: #746a5a;
  font-size: clamp(24px, 4.2vh, 38px);
  font-weight: 700;
  margin-bottom: clamp(12px, 2vh, 24px);
}
.loading-ring {
  width: min(170px, 34vh, 46vw);
  height: min(170px, 34vh, 46vw);
  flex-shrink: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 6%, var(--accent) 68%, transparent 70%);
  mask: radial-gradient(farthest-side, transparent calc(100% - 14%), #000 calc(100% - 13%));
  animation: spin 1.5s linear infinite;
  margin: clamp(8px, 1.5vh, 16px) 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-pill { background: rgba(236,231,223,0.08); border-radius: 999px; padding: 10px 18px; font-size: 16px; }
.loading-pct { color: var(--text-muted); margin-top: 8px; }
#analysisLoader { position: relative; background: transparent; }

.playlist-header-row { display: flex; gap: 16px; margin: 16px 0; }
.playlist-cover { width: 108px; height: 108px; border-radius: 16px; flex-shrink: 0; background-size: cover; background-position: center; }
.playlist-title { font-size: clamp(26px, 4vw, 34px); font-weight: 700; }
.playlist-meta { color: var(--text-muted); margin: 6px 0; }
.playlist-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.btn-back-text { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 15px; margin-bottom: 8px; }

.plan-cards { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px; }
.plan-card { flex: 1 1 280px; background: var(--surface); border: 1px solid rgba(236,231,223,0.06); border-radius: 22px; padding: 24px; }
.plan-card--plus { background: linear-gradient(165deg, #2c1e10, var(--surface)); border-color: rgba(233,169,79,0.55); }
.plan-badge { display: inline-block; background: var(--accent); color: var(--accent-ink); padding: 4px 10px; border-radius: 999px; margin-bottom: 12px; font-size: 10px; }
.plan-price { font-size: 28px; font-weight: 700; margin: 8px 0 16px; }
.plan-price span { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.plan-features { list-style: none; margin-bottom: 20px; color: var(--text-secondary); font-size: 14px; }
.plan-features li { margin-bottom: 8px; }

.share-card-export {
  width: min(360px, 86vw);
  margin: 0 auto 20px;
  border-radius: 24px;
  background: linear-gradient(165deg, #2c1e10, #17110c);
  border: 1px solid rgba(233,169,79,0.25);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  overflow: hidden;
}
.share-card-inner { padding: 26px; box-sizing: border-box; width: 100%; }
.share-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--accent);
  margin-bottom: 12px;
  font-size: 11px;
}
.share-card-brand { flex-shrink: 0; }
.share-card-meta-dim {
  color: var(--text-muted);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.share-card-photo {
  height: 170px;
  border-radius: 16px;
  background-size: cover;
  background-position: center;
  margin-bottom: 12px;
  background-color: #241c15;
}
.share-card-title {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.share-card-mood {
  color: var(--text-muted);
  margin-bottom: 16px;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  line-height: 1.4;
}
.share-equalizer { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-bottom: 16px; }
.share-eq-bar { flex: 1; min-width: 0; background: rgba(233,169,79,0.35); border-radius: 2px; }
.share-eq-bar--solid { background: var(--accent); }
.share-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(236,231,223,0.08);
  padding-top: 12px;
  font-size: 11px;
}
.share-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 6px; }
.share-palette-dots { display: flex; gap: 6px; flex-shrink: 0; }
.share-palette-dot { width: 10px; height: 10px; border-radius: 50%; }
.share-actions { display: flex; flex-direction: column; gap: 10px; }

.floating-shutter { position: fixed; right: 20px; bottom: 24px; width: 66px; height: 66px; border-radius: 50%; border: 3px solid var(--text); background: rgba(14,10,7,0.75); backdrop-filter: blur(8px); cursor: pointer; z-index: 15; padding: 0; }
.floating-shutter-core { display: block; width: 46px; height: 46px; margin: 7px auto; border-radius: 50%; background: var(--accent); }
body[data-screen="capture"] .floating-shutter,
body[data-screen="loading"] .floating-shutter { display: none; }

.genre-tag { display: inline-block; padding: 4px 10px; margin: 2px; border-radius: 999px; background: var(--surface-alt); font-size: 12px; }
.color-tag { display: inline-block; padding: 4px 10px; margin: 2px; border-radius: 999px; font-size: 12px; border-left: 3px solid var(--accent); }

@media (max-width: 640px) {
  .header-nav-link { display: none; }
}

