/* Fynn landing — integrated from reference.css (строгий redesign) */

/* ─────────────────────────────────────────────────────────────
FYNN — refined / строгий redesign
Principles:
• Single centered column, max 600px
• No shimmer glows, no heavy backdrop-blur on opaque panels
• 4px spatial grid: 4 8 12 16 20 24 32 48 64 72 80
• Mono for all UI metadata, display only for wordmark + labels
• Panels: dark opaque surface, 1px hairline border, 14px radius
• Colors used sparingly as accents, not floods
───────────────────────────────────────────────────────────── */

:root {
/* Surface stack */
--bg:          #06070e;
--surface:     #0b0c19;
--surface-hi:  #111223;
--surface-hov: #171829;

/* Scrollbars */
--app-scrollbar-track-color: rgba(255,255,255,0.03);
--app-scrollbar-track-gloss: rgba(255,255,255,0.012);
--app-scrollbar-thumb-color: rgba(139,124,248,0.52);
--app-scrollbar-thumb-start: rgba(139,124,248,0.56);
--app-scrollbar-thumb-end: rgba(93,228,244,0.4);
--app-scrollbar-thumb-hover-color: rgba(93,228,244,0.64);
--app-scrollbar-thumb-hover-start: rgba(139,124,248,0.7);
--app-scrollbar-thumb-hover-end: rgba(93,228,244,0.58);
--app-scrollbar-thumb-active-color: rgba(93,228,244,0.78);
--app-scrollbar-thumb-active-start: rgba(139,124,248,0.84);
--app-scrollbar-thumb-active-end: rgba(93,228,244,0.7);

/* Borders */
--b0: rgba(255,255,255,0.05);
--b1: rgba(255,255,255,0.09);
--b2: rgba(255,255,255,0.14);
--b3: rgba(255,255,255,0.22);

/* Accent palette — used sparingly */
--violet:     #8b7cf8;
--violet-a12: rgba(139,124,248,0.12);
--violet-a20: rgba(139,124,248,0.20);
--violet-a30: rgba(139,124,248,0.30);
--cyan:       #5de4f4;
--mint:       #52d9a4;
--mint-a08:   rgba(82,217,164,0.08);
--mint-a22:   rgba(82,217,164,0.22);
--rose:       #f08aab;

/* Text */
--t100: rgba(255,255,255,0.90);
--t60:  rgba(255,255,255,0.55);
--t35:  rgba(255,255,255,0.32);
--t18:  rgba(255,255,255,0.18);

/* Typography */
--mono:    "Space Mono", monospace;
--display: "Unbounded", sans-serif;

/* Radius */
--r-lg:   14px;
--r-md:   10px;
--r-sm:   8px;
--r-pill: 999px;

/* Layout */
--content: 600px;

/* Shadows */
--shadow-panel: 0 1px 0 rgba(255,255,255,0.035) inset,
0 2px 6px rgba(0,0,0,0.28),
0 8px 24px rgba(0,0,0,0.18);
--shadow-float: 0 16px 48px rgba(0,0,0,0.55),
0 4px 12px rgba(0,0,0,0.35);
}

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

html {
color-scheme: dark;
scroll-behavior: smooth;
}

body {
margin: 0;
min-height: 100vh;
/* Single, very restrained ambient gradient — top center violet haze */
background:
radial-gradient(ellipse 70% 36% at 50% 0%, rgba(139,124,248,0.09) 0%, transparent 100%),
var(--bg);
color: var(--t100);
font-family: var(--display);
overflow-x: hidden;
}

body.modal-open { overflow: hidden; }

/* Empty header/footer from base layout */
.site-main > header:empty,
.site-main > footer:empty { display: none; }

.site-main__inner {
  flex: 1 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

button, textarea, input { font: inherit; }
a { color: inherit; text-decoration: none; }

/* ─── App wrapper ─────────────────────────────────────────── */
.fynn-app,
.fynn-page {
  position: relative;
  isolation: isolate;
  flex: 1 0 auto;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  overflow-y: visible;
}

/* Ambient layers — kept in DOM, opacity zeroed out */
.ambient-field,
.noise-overlay {
pointer-events: none;
position: absolute;
inset: 0;
opacity: 0;
}

/* ─── Page column ─────────────────────────────────────────── */
.hero-shell {
position: relative;
z-index: 1;
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
width: 100%;
max-width: calc(var(--content) + 32px);
margin-inline: auto;
padding: 120px 16px 88px;
}

.fynn-page .hero-shell {
justify-content: center;
}

.fynn-page__panel {
width: 100%;
max-width: var(--content);
padding: 28px;
border-radius: var(--r-lg);
text-align: center;
}

.fynn-page__title {
margin: 0;
font-family: var(--display);
font-size: clamp(26px, 5vw, 36px);
font-weight: 500;
letter-spacing: -0.03em;
line-height: 1.05;
color: var(--t100);
}

.fynn-page__copy {
margin: 12px 0 0;
font-family: var(--mono);
font-size: 0.78rem;
letter-spacing: 0.04em;
color: var(--t60);
}

/* ─── Wordmark block ──────────────────────────────────────── */
.hero-intro {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
gap: 10px;
margin-bottom: 14px;
}

.panel-kicker,
.mono-copy,
.track-meta,
.timecode,
.setting-copy p,
.status-detail,
#progress-percent {
font-family: var(--mono);
}

.panel-kicker {
margin: 0;
font-size: 0.60rem;
letter-spacing: 0.24em;
text-transform: uppercase;
color: var(--t35);
}

.hero-wordmark {
margin: 0;
font-family: var(--display);
font-size: clamp(26px, 5vw, 36px);
font-weight: 500;
letter-spacing: -0.03em;
line-height: 1;
background: linear-gradient(110deg, var(--violet) 15%, var(--cyan) 100%);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}

.hero-sub {
margin: 0;
font-family: var(--mono);
font-size: 0.66rem;
letter-spacing: 0.06em;
color: var(--t35);
}

/* ─── Shared panel base ───────────────────────────────────── */
/* Replaces the original .glass-panel — opaque, hairline border */
.glass-panel {
border: 1px solid var(--b1);
background: var(--surface);
box-shadow: var(--shadow-panel);
}

/* Kill every shimmer ::before across the original shared selectors */
.glass-panel::before,
.glass-chip::before,
.glass-action::before,
.generate-button::before,
.track-action::before,
.play-toggle::before {
display: none !important;
}

/* Panel hover: no background change — panels are not interactive */
.glass-panel:hover {
background: var(--surface);
border-color: var(--b1);
}

/* ─── Status / error banner ───────────────────────────────── */
.status-banner {
width: 100%;
padding: 10px 15px;
border-radius: var(--r-sm);
border: 1px solid rgba(240,138,171,0.18);
background: rgba(240,138,171,0.05);
color: rgba(240,138,171,0.85);
font-family: var(--mono);
font-size: 0.73rem;
line-height: 1.5;
}
.status-banner.is-hidden { display: none; }

/* ─── Composer panel ──────────────────────────────────────── */
.composer-panel,
.progress-card,
.track-card,
.settings-dialog {
border-radius: var(--r-lg);
}

.composer-panel {
width: 100%;
padding: 20px 22px 18px;
}

.composer-body {
display: flex;
flex-direction: column;
}

.prompt-input {
width: 100%;
min-height: 88px;
max-height: 220px;
resize: none;
padding: 0;
border: 0;
background: transparent;
color: var(--t100);
font-family: var(--mono);
font-size: 0.80rem;
line-height: 1.80;
outline: none;
}
.prompt-input::placeholder { color: var(--t18); }

.composer-footer {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
padding-top: 14px;
margin-top: 12px;
border-top: 1px solid var(--b0);
flex-wrap: nowrap;
}

.composer-actions {
display: flex;
align-items: center;
gap: 6px;
flex: 1 1 auto;
min-width: 0;
/* visible so .model-panel (absolute) is not clipped by this flex row */
overflow: visible;
}

/* ─── Chip base — model trigger & settings btn share this ─── */
.glass-chip {
display: inline-flex;
align-items: center;
gap: 7px;
height: 32px;
padding: 0 11px;
border-radius: var(--r-sm);
border: 1px solid var(--b1);
background: var(--surface-hi);
white-space: nowrap;
transition: border-color 0.15s, color 0.15s;
}
.glass-chip:hover {
border-color: var(--b2);
background: var(--surface-hi);
}

/* Remove panel-level overrides that made chip taller in the composer */
.composer-panel .glass-chip {
min-height: 32px;
padding: 0 11px;
border-radius: var(--r-sm);
gap: 7px;
}

/* ─── Model select ────────────────────────────────────────── */
.model-select { position: relative; z-index: 6; }

.model-trigger {
display: inline-flex;
align-items: center;
gap: 7px;
min-width: 0;
max-width: 220px;
padding-right: 6px;
cursor: pointer;
color: var(--t60);
appearance: none;
outline: none;
transition: color 0.15s;
}
.model-trigger:hover { color: var(--t100); transform: none; }
.composer-panel .model-trigger { max-width: none; width: max-content; }

.model-trigger-label { display: flex; align-items: center; gap: 6px; min-width: 0; }

.model-trigger-name {
font-family: var(--mono);
font-size: 0.70rem;
font-weight: 400;
letter-spacing: 0.02em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: inherit;
}
.composer-panel .model-trigger-name { font-size: 0.70rem; }

/* Hide subtitle — redundant in the compact composer */
.model-trigger-subtitle { display: none; }

.model-trigger svg {
width: 11px;
height: 11px;
stroke: currentColor;
stroke-width: 2;
fill: none;
flex: 0 0 auto;
}

/* ─── Badge ───────────────────────────────────────────────── */
.badge {
display: inline-flex;
align-items: center;
padding: 2px 6px;
border-radius: var(--r-pill);
border: 1px solid var(--mint-a22);
background: var(--mint-a08);
color: var(--mint);
font-family: var(--mono);
font-size: 0.57rem;
letter-spacing: 0.1em;
text-transform: uppercase;
line-height: 1.5;
}
.composer-panel .model-trigger .badge { padding: 1px 5px; font-size: 0.55rem; }

/* ─── Settings button ─────────────────────────────────────── */
.composer-settings-btn {
display: inline-flex;
align-items: center;
height: 32px;
padding: 0 11px;
border-radius: var(--r-sm);
border: 1px solid var(--b1);
background: var(--surface-hi);
color: var(--t60);
font-family: var(--mono);
font-size: 0.70rem;
font-weight: 400;
letter-spacing: 0.03em;
cursor: pointer;
transition: color 0.15s, border-color 0.15s;
white-space: nowrap;
appearance: none;
outline: none;
}
.composer-settings-btn:hover { color: var(--t100); border-color: var(--b2); transform: none; }

/* ─── Generate button — pill with label ───────────────────── */
.generate-button {
flex: 0 0 auto;
display: inline-flex;
align-items: center;
gap: 7px;
height: 36px;
padding: 0 18px;
border-radius: var(--r-pill);
border: 1px solid var(--violet-a30);
background: var(--violet-a12);
color: var(--t100);
font-family: var(--display);
font-size: 0.72rem;
font-weight: 500;
letter-spacing: 0.01em;
cursor: pointer;
transition: background 0.18s, border-color 0.18s;
appearance: none;
outline: none;
/* Reset original heavy styles */
box-shadow: none;
backdrop-filter: none;
-webkit-backdrop-filter: none;
width: auto;
}
.generate-button:hover {
background: var(--violet-a20);
border-color: rgba(139,124,248,0.48);
transform: none;
animation: none;
}
.generate-button:disabled { opacity: 0.50; cursor: progress; }

.generate-button .arrow-icon { display: inline-flex; align-items: center; }
.generate-button svg {
width: 13px;
height: 13px;
stroke: currentColor;
stroke-width: 1.8;
fill: none;
stroke-linecap: round;
stroke-linejoin: round;
flex: 0 0 auto;
}

.generate-label { /* text label inside button */ }

.generate-button .spinner {
display: none;
width: 13px;
height: 13px;
border: 1.5px solid rgba(255,255,255,0.18);
border-top-color: rgba(255,255,255,0.85);
border-radius: 50%;
animation: spin 0.7s linear infinite;
}
.generate-button.is-busy .arrow-icon  { display: none; }
.generate-button.is-busy .generate-label { display: none; }
.generate-button.is-busy .spinner    { display: inline-block; }

/* ─── Model panel dropdown ────────────────────────────────── */
.model-panel {
position: absolute;
right: 0;
left: auto;
top: calc(100% + 6px);
z-index: 20;
width: min(300px, calc(100vw - 32px));
padding: 6px;
border-radius: var(--r-lg);
border: 1px solid var(--b2);
background: var(--surface);
box-shadow: var(--shadow-float);
opacity: 0;
transform: translateY(-6px);
max-height: 0;
overflow: hidden;
pointer-events: none;
transition: opacity 0.18s ease, transform 0.18s ease, max-height 0.18s ease;
}
.model-panel.is-open {
opacity: 1;
transform: translateY(0);
max-height: 360px;
pointer-events: auto;
}

.model-option {
display: grid;
gap: 3px;
width: 100%;
padding: 10px 12px;
border: 1px solid transparent;
border-radius: 10px;
background: transparent;
color: var(--t100);
text-align: left;
cursor: pointer;
transition: background 0.12s, border-color 0.12s;
}
.model-option + .model-option { margin-top: 2px; }
.model-option:hover,
.model-option.is-active {
background: var(--surface-hi);
border-color: var(--b1);
}

.model-option-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
}
.model-option-name { font-size: 0.80rem; font-weight: 500; }
.model-option-description {
margin: 2px 0 0;
color: var(--t35);
font-family: var(--mono);
font-size: 0.66rem;
line-height: 1.55;
}

/* ─── Progress card ───────────────────────────────────────── */
.progress-card {
width: 100%;
padding: 16px 20px;
display: grid;
gap: 10px;
opacity: 1;
max-height: 240px;
transform: translateY(0);
transition: opacity 0.22s ease, transform 0.22s ease,
max-height 0.22s ease, margin 0.22s ease,
padding-top 0.22s ease, padding-bottom 0.22s ease;
}
.progress-card.is-hidden {
opacity: 0;
max-height: 0;
margin-top: -4px;
padding-top: 0;
padding-bottom: 0;
overflow: hidden;
pointer-events: none;
transform: translateY(-6px);
}

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

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

.progress-title {
margin: 0;
font-size: 0.78rem;
font-weight: 400;
color: var(--t60);
animation: labelPulse 2.2s ease-in-out infinite;
}

#progress-percent {
font-size: 0.68rem;
color: var(--t35);
letter-spacing: 0.04em;
}

.progress-cancel-btn {
padding: 6px 12px;
font-size: 0.7rem;
line-height: 1;
}

.progress-cancel-btn.is-hidden {
display: none;
}

.progress-cancel-btn:disabled {
opacity: 0.55;
cursor: progress;
}

.progress-rail {
width: 100%;
height: 2px;          /* thin — not chunky */
border-radius: var(--r-pill);
background: rgba(255,255,255,0.06);
overflow: hidden;
border: none;
position: relative;
}
.progress-fill {
position: absolute;
inset: 0 auto 0 0;
width: 0;
border-radius: inherit;
background: linear-gradient(90deg, var(--violet), var(--cyan));
transition: width 0.38s ease;
}

.status-detail {
margin: 0;
color: var(--t35);
font-size: 0.70rem;
line-height: 1.55;
}

/* ─── Tracks stack ────────────────────────────────────────── */
.tracks-stack {
width: 100%;
display: flex;
flex-direction: column;
gap: 10px;
padding-top: 4px;
}

/* ─── Track card ──────────────────────────────────────────── */
.track-card {
width: 100%;
padding: 18px 20px;
opacity: 0;
transform: translateY(8px);
transition: opacity 0.28s ease, transform 0.28s ease;
}
.track-card.is-visible { opacity: 1; transform: translateY(0); }

/* ─── Art-pending loading state ──────────────────────────── */
@keyframes art-cover-pulse {
  0%, 100% { opacity: 0.40; }
  50%       { opacity: 0.80; }
}

.track-cover-placeholder.is-art-pending,
.anon-result__cover--placeholder.is-art-pending {
  animation: art-cover-pulse 1.6s ease-in-out infinite;
}
.studio-track-cover.is-art-pending img {
  animation: art-cover-pulse 1.6s ease-in-out infinite;
}

.art-title-pending {
  color: var(--t35);
  font-style: italic;
  animation: art-cover-pulse 1.6s ease-in-out infinite;
}

/* ─── Track card: Spotify-style inner layout ──────────────── */
.track-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.track-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse 80% 80% at 50% 50%, rgba(139,124,248,0.10), transparent);
}

.track-cover-placeholder svg {
  width: 36px;
  height: 36px;
  opacity: 0.55;
}

.track-card-top {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-bottom: 12px;
}
.track-title-block { min-width: 0; }

.track-card h3 {
margin: 0;
font-size: 0.78rem;
font-weight: 500;
letter-spacing: -0.01em;
color: var(--t60);
}

.track-actions {
display: flex;
align-items: center;
gap: 6px;
}

/* ─── Icon buttons — track-action & play-toggle ───────────── */
.track-action,
.play-toggle {
display: inline-flex;
align-items: center;
justify-content: center;
width: 30px;
height: 30px;
padding: 0;
border-radius: var(--r-sm);
border: 1px solid var(--b1);
background: var(--surface-hi);
color: var(--t60);
cursor: pointer;
transition: color 0.15s, border-color 0.15s, background 0.15s;
appearance: none;
outline: none;
position: relative;
}
.play-toggle { border-radius: 50%; }

.track-action:hover,
.play-toggle:hover {
color: var(--t100);
border-color: var(--b2);
background: var(--surface-hov);
transform: none;
}

.track-action svg,
.play-toggle svg {
width: 13px;
height: 13px;
stroke: currentColor;
stroke-width: 1.8;
fill: none;
stroke-linecap: round;
stroke-linejoin: round;
flex: 0 0 auto;
}

.play-toggle.is-playing .pause-icon { display: block; }
.play-toggle.is-playing .play-icon  { display: none; }
.play-toggle .pause-icon { display: none; }

.track-meta,
.timecode {
font-size: 0.68rem;
color: var(--t35);
letter-spacing: 0.04em;
}

/* ─── Tooltip ─────────────────────────────────────────────── */
.tooltip-wrap { position: relative; display: inline-flex; }
.tooltip {
position: absolute;
top: calc(100% + 7px);
left: 50%;
transform: translate(-50%, -4px);
padding: 4px 9px;
border-radius: var(--r-pill);
border: 1px solid var(--b1);
background: var(--surface-hi);
color: var(--t60);
font-family: var(--mono);
font-size: 0.63rem;
white-space: nowrap;
opacity: 0;
pointer-events: none;
transition: opacity 0.15s ease, transform 0.15s ease;
}
.tooltip-wrap:hover .tooltip,
.tooltip-wrap:focus-within .tooltip {
opacity: 1;
transform: translate(-50%, 0);
}

/* ─── Audio widget ────────────────────────────────────────── */
.audio-widget {
display: grid;
grid-template-columns: 30px 1fr auto;
align-items: center;
gap: 12px;
padding: 10px 14px;
border-radius: var(--r-sm);
background: rgba(255,255,255,0.022);
border: 1px solid var(--b0);
}

.track-progress {
display: flex;
align-items: center;
min-width: 0;
padding-block: 8px;
cursor: pointer;
}

.scrubber {
position: relative;
width: 100%;
height: 6px;
border-radius: var(--r-pill);
background: rgba(255,255,255,0.08);
overflow: hidden;
box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
.scrubber-progress {
position: absolute;
inset: 0 auto 0 0;
width: 0;
border-radius: inherit;
background: linear-gradient(90deg, var(--violet), var(--cyan));
transition: width 0.08s linear;
}

/* ─── Settings modal ──────────────────────────────────────── */
.settings-modal {
position: fixed;
inset: 0;
z-index: 300;
display: grid;
place-items: center;
padding: 24px;
background: rgba(4,5,10,0.82);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
}
.settings-modal[hidden] { display: none; }

.settings-dialog {
width: min(400px, calc(100vw - 32px));
padding: 22px 22px 18px;
border-color: var(--b2);
background: var(--surface);
box-shadow: var(--shadow-float);
}
/* Stop the glass-panel hover rule from changing the dialog bg */
.settings-dialog.glass-panel:hover {
background: var(--surface);
border-color: var(--b2);
}

.settings-head {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 14px;
margin-bottom: 18px;
}

.settings-head h2 {
margin: 0;
font-size: 0.88rem;
font-weight: 500;
letter-spacing: -0.01em;
}

.settings-close {
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
padding: 0;
border-radius: var(--r-sm);
border: 1px solid var(--b1);
background: transparent;
color: var(--t60);
cursor: pointer;
transition: color 0.15s, border-color 0.15s;
appearance: none;
outline: none;
}
.settings-close:hover { color: var(--t100); border-color: var(--b2); }
.settings-close svg {
width: 13px;
height: 13px;
stroke: currentColor;
stroke-width: 1.8;
fill: none;
flex: 0 0 auto;
}

.settings-list { display: grid; gap: 8px; margin-bottom: 16px; }

.setting-row {
padding: 14px 16px;
border-radius: var(--r-sm);
background: rgba(255,255,255,0.022);
border: 1px solid var(--b0);
}

.setting-copy h3 {
margin: 0;
font-size: 0.80rem;
font-weight: 500;
}
.setting-copy p {
margin: 6px 0 0;
color: var(--t35);
font-size: 0.68rem;
line-height: 1.60;
}

.slider-shell { margin-top: 14px; }

.slider-meta {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-bottom: 8px;
color: var(--t35);
font-size: 0.66rem;
}

.slider-value {
padding: 3px 8px;
border-radius: var(--r-pill);
border: 1px solid var(--b1);
background: var(--surface-hi);
color: var(--t60);
font-size: 0.68rem;
/* Reset original glass treatment */
box-shadow: none;
backdrop-filter: none;
-webkit-backdrop-filter: none;
}

.slider {
width: 100%;
appearance: none;
height: 4px;
border-radius: var(--r-pill);
outline: none;
background: linear-gradient(
90deg,
var(--violet) var(--slider-progress, 90%),
rgba(255,255,255,0.08) var(--slider-progress, 90%)
);
cursor: pointer;
}
.slider::-webkit-slider-thumb {
appearance: none;
width: 14px;
height: 14px;
border-radius: 50%;
border: 1px solid rgba(255,255,255,0.22);
background: #fff;
box-shadow: 0 0 0 3px rgba(139,124,248,0.14);
}
.slider::-moz-range-thumb {
width: 14px;
height: 14px;
border-radius: 50%;
border: 1px solid rgba(255,255,255,0.22);
background: #fff;
box-shadow: 0 0 0 3px rgba(139,124,248,0.14);
}

/* ─── Settings actions ────────────────────────────────────── */
.settings-actions { display: flex; justify-content: flex-end; gap: 8px; }

.glass-action {
display: inline-flex;
align-items: center;
justify-content: center;
height: 34px;
padding: 0 16px;
border-radius: var(--r-pill);
border: 1px solid var(--b1);
background: transparent;
color: var(--t60);
font-family: var(--display);
font-size: 0.72rem;
font-weight: 500;
cursor: pointer;
transition: color 0.15s, border-color 0.15s;
appearance: none;
outline: none;
/* Reset */
backdrop-filter: none;
-webkit-backdrop-filter: none;
box-shadow: none;
min-height: unset;
}
.glass-action:hover { color: var(--t100); border-color: var(--b2); transform: none; }

.glass-action.accent {
border-color: var(--violet-a30);
background: var(--violet-a12);
color: var(--t100);
box-shadow: none;
}
.glass-action.accent:hover {
background: var(--violet-a20);
border-color: rgba(139,124,248,0.48);
}

/* ─── Entrance animations ─────────────────────────────────── */
.reveal {
opacity: 0;
transform: translateY(8px);
animation: revealUp 0.48s cubic-bezier(0.22, 0.8, 0.2, 1) forwards;
}
.reveal-1 { animation-delay: 0.04s; }
.reveal-2 { animation-delay: 0.10s; }
.reveal-3 { animation-delay: 0.17s; }
.reveal-4 { animation-delay: 0.24s; }
.reveal-5 { animation-delay: 0.31s; }

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

@keyframes labelPulse {
0%, 100% { opacity: 0.45; }
50%       { opacity: 0.85; }
}

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

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
.hero-shell { padding-top: 88px; padding-bottom: 64px; }
}

@media (max-width: 520px) {
.composer-footer { flex-wrap: wrap; }
.composer-actions { width: 100%; }
.generate-button { width: 100%; justify-content: center; border-radius: var(--r-md); }
}

@media (max-width: 420px) {
.audio-widget { grid-template-columns: 28px 1fr auto; gap: 10px; }
.settings-actions { flex-direction: column-reverse; }
.glass-action { width: 100%; }
}

/* ─── Template / JS parity (behavior unchanged) ─────────────────── */
.hero-shell {
  min-height: 100%;
  box-sizing: border-box;
}

/* Landing page: hero-shell should hug its content so the feature-info
   section below it appears right after the composer rather than being
   pushed beneath a 100vh spacer. */
.fynn-app > .hero-shell {
  min-height: 0;
  padding-bottom: 32px;
}

.tracks-stack {
  margin-top: auto;
}

/* Template still uses vertical resize + JS auto-height; reference used resize:none */
.prompt-input {
  resize: vertical;
  max-height: 280px;
}

.composer-panel {
  position: relative;
  z-index: 2;
}

/* ─── Feature info section (landing, full-width) ──────────── */
.feature-info {
  position: relative;
  z-index: 1;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 40px 64px;
  margin-top: -24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.feature-info__kicker {
  margin: 0 4px;
  color: var(--t35);
}

.feature-info__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
}

.feature-info__card {
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.22, 0.8, 0.2, 1),
              border-color 0.25s ease;
}

.feature-info__card {
  display: flex;
  flex-direction: column;
}

.feature-info__card:hover {
  transform: translateY(-3px);
  border-color: var(--b2);
}

.feature-info__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-hi);
  border-bottom: 1px solid var(--b1);
}

.feature-info__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6,7,14,0) 55%, rgba(6,7,14,0.55) 100%);
  pointer-events: none;
}

.feature-info__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.22, 0.8, 0.2, 1);
}

.feature-info__card:hover .feature-info__media img {
  transform: scale(1.04);
}

.feature-info__body {
  padding: 22px 26px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.feature-info__title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  background: linear-gradient(110deg, var(--violet) 15%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.feature-info__copy {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: var(--t60);
}

.feature-info__cta {
  align-self: flex-start;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 22px;
  border-radius: var(--r-pill);
  border: 1px solid var(--b2);
  background: linear-gradient(110deg, rgba(139,124,248,0.18) 0%, rgba(93,228,244,0.14) 100%);
  color: var(--t100);
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.22, 0.8, 0.2, 1),
              border-color 0.2s ease,
              background 0.2s ease;
}

.feature-info__cta svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s cubic-bezier(0.22, 0.8, 0.2, 1);
}

.feature-info__cta:hover {
  transform: translateY(-2px);
  border-color: rgba(139,124,248,0.48);
  background: linear-gradient(110deg, rgba(139,124,248,0.28) 0%, rgba(93,228,244,0.22) 100%);
}

.feature-info__cta:hover svg {
  transform: translateX(3px);
}

@media (max-width: 960px) {
  .feature-info {
    padding: 8px 24px 48px;
  }
  .feature-info__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .feature-info__title {
    font-size: 1.2rem;
  }
}

@media (max-width: 520px) {
  .feature-info {
    padding: 8px 16px 40px;
  }
  .feature-info__body {
    padding: 18px 20px 20px;
  }
}

/* ─── Explore library ─────────────────────────────────────── */
.explore-page .hero-shell {
  max-width: min(760px, calc(100% - 32px));
}

.explore-intro {
  text-align: center;
}

.explore-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.explore-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--r-lg);
}

.explore-row__main {
  display: flex;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.explore-cover {
  flex: 0 0 auto;
  width: 88px;
  height: 88px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--b1);
  background: var(--surface-hi);
}

.explore-cover__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.explore-row__body {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.explore-row__title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--t100);
  line-height: 1.25;
}

.explore-row .explore-audio {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.explore-progress {
  min-width: 0;
}

.explore-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.explore-tag {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--b1);
  color: var(--t60);
  background: rgba(255, 255, 255, 0.02);
}

.explore-model {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--t60);
}

.explore-model__label {
  color: var(--t100);
}

.explore-model__version {
  padding: 2px 7px;
  border-radius: var(--r-pill);
  border: 1px solid var(--b1);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  color: var(--t60);
  text-transform: lowercase;
}

.explore-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.explore-dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--b1);
  background: var(--surface-hi);
  color: var(--t60);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}

.explore-dl__icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  opacity: 0.8;
}

.explore-dl:hover {
  color: var(--t100);
  border-color: var(--b2);
}

.explore-row__actions {
  flex: 0 0 auto;
  padding-top: 2px;
}

.explore-kebab-wrap {
  position: relative;
}

.explore-kebab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  border: 1px solid var(--b1);
  background: var(--surface-hi);
  color: var(--t60);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.explore-kebab:hover {
  color: var(--t100);
  border-color: var(--b2);
}

.explore-kebab svg {
  width: 18px;
  height: 18px;
}

.explore-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 140px;
  padding: 6px;
  border-radius: var(--r-md);
  border: 1px solid var(--b2);
  box-shadow: var(--shadow-float);
}

.explore-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--t100);
  font-family: var(--mono);
  font-size: 0.72rem;
  cursor: pointer;
}

.explore-menu__item:hover {
  background: var(--surface-hi);
}

.explore-empty {
  width: 100%;
  padding: 28px 24px;
  text-align: center;
  border-radius: var(--r-lg);
}

.explore-empty__copy {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--t60);
  line-height: 1.6;
}

.explore-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 20px;
}
.explore-modal[hidden] { display: none; }

.explore-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 7, 14, 0.72);
}

.explore-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  padding: 20px 22px;
  border-radius: var(--r-lg);
}

.explore-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.explore-modal__head h2 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--t100);
}

.explore-modal__close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--b1);
  background: var(--surface-hi);
  color: var(--t60);
  cursor: pointer;
}

.explore-modal__close svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.explore-modal__body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--t60);
}

/* ─── Explore discovery redesign ─────────────────────────────── */

.discover-page .discover-shell {
  max-width: min(1240px, calc(100% - 48px));
  align-items: stretch;
  gap: 20px;
  padding: 96px 24px 72px;
}

.discover-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.95fr);
  gap: 24px;
  padding: 32px;
  overflow: hidden;
}

.discover-hero__copy,
.discover-hero__aside {
  position: relative;
  z-index: 1;
}

.discover-hero__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.discover-hero__copy .fynn-page__title {
  max-width: 11ch;
}

.discover-hero__copy .fynn-page__copy {
  margin: 0;
  max-width: 58ch;
  line-height: 1.82;
}

.discover-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.discover-filter-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--b1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--t60);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.discover-filter-pill:hover,
.discover-filter-pill.is-active {
  color: var(--t100);
  border-color: rgba(93, 228, 244, 0.28);
  background: rgba(93, 228, 244, 0.1);
}

.discover-filter-pill.is-static {
  cursor: default;
}

.discover-hero__aside {
  display: grid;
  gap: 16px;
}

.discover-hero__stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.discover-feature-slot {
  display: grid;
  gap: 14px;
}

.discover-feature-slot__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.discover-feature-slot__head h2 {
  margin: 6px 0 0;
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--t100);
}

.discover-feature-slot__copy {
  margin: 0;
  max-width: 30ch;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.7;
  color: var(--t60);
  text-align: right;
}

.discover-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.8fr) repeat(3, minmax(160px, 0.7fr)) auto auto;
  align-items: end;
  gap: 12px;
  padding: 18px 20px;
}

.discover-toolbar__search,
.discover-toolbar__field {
  display: grid;
  gap: 8px;
}

.discover-toolbar__search input,
.discover-toolbar__field select {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid var(--b1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--t100);
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0 14px;
}

.discover-toolbar__search input::placeholder {
  color: var(--t35);
}

.discover-toolbar__search input:focus,
.discover-toolbar__field select:focus {
  outline: 2px solid rgba(93, 228, 244, 0.22);
  outline-offset: 1px;
}

.discover-toolbar__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--b1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--t100);
  font-family: var(--mono);
  font-size: 0.74rem;
}

.discover-toolbar__toggle input {
  accent-color: var(--cyan);
}

.discover-toolbar__reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--b1);
  color: var(--t60);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.72rem;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.discover-toolbar__reset:hover {
  color: var(--t100);
  border-color: var(--b2);
  background: rgba(255, 255, 255, 0.03);
}

.discover-section {
  display: grid;
  gap: 14px;
}

.discover-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px;
}

.discover-section__head h2 {
  margin: 6px 0 0;
  font-size: 1.14rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--t100);
}

.discover-section__copy {
  margin: 0;
  max-width: 36ch;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.8;
  color: var(--t60);
  text-align: right;
}

.discover-section__head--results {
  align-items: flex-start;
}

.discover-results-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.discover-results-meta__count {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t35);
}

.discover-playlist-grid,
.discover-song-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.discover-playlist-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.discover-playlist-card:hover {
  transform: translateY(-2px);
  border-color: rgba(93, 228, 244, 0.24);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

.discover-playlist-card__visual {
  position: relative;
  aspect-ratio: 1.15 / 1;
  overflow: hidden;
  border-bottom: 1px solid var(--b0);
}

.discover-playlist-card__visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 10%, rgba(6, 7, 14, 0.42) 100%),
    linear-gradient(135deg, rgba(139, 124, 248, 0.18), rgba(93, 228, 244, 0.08));
}

.discover-playlist-card__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.discover-playlist-card__body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.discover-playlist-card__eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t35);
}

.discover-playlist-card__body h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--t100);
}

.discover-playlist-card__tracks {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.discover-playlist-card__tracks span {
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.55;
  color: var(--t60);
}

.discover-track-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  overflow: hidden;
  min-width: 0;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.discover-track-card:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 124, 248, 0.26);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
}

.discover-track-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  min-width: 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--b0);
  background:
    linear-gradient(135deg, rgba(139, 124, 248, 0.15), rgba(93, 228, 244, 0.06)),
    rgba(255, 255, 255, 0.03);
}

.discover-track-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 7, 14, 0.02), rgba(6, 7, 14, 0.42));
}

.discover-track-card__cover {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.discover-track-card__genre {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(6, 7, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.discover-track-card__top-actions {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.discover-track-card__play.play-toggle,
.discover-track-card__menu-btn.explore-kebab {
  background: rgba(6, 7, 14, 0.76);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

.discover-track-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.discover-track-card__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.discover-track-card__eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.discover-track-card__mood,
.discover-track-card__author {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t35);
}

.discover-track-card__author {
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.discover-track-card__author:hover {
  color: var(--cyan);
}

.discover-track-card__title {
  margin: 0;
  min-height: 2.3em;
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.18;
  color: var(--t100);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.discover-track-card__audio {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

.discover-track-card__progress {
  min-width: 0;
}

.discover-track-card__stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.discover-track-card .stat-badge {
  background: rgba(255, 255, 255, 0.03);
}

.discover-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 28px;
}

.discover-empty h2 {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--t100);
}

.discover-empty__copy {
  margin: 0;
  max-width: 50ch;
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.8;
  color: var(--t60);
}

@media (max-width: 640px) {
  .explore-row {
    flex-direction: column;
    align-items: stretch;
  }
  .explore-row__actions {
    display: flex;
    justify-content: flex-end;
  }
}

@media (max-width: 1180px) {
  .discover-playlist-grid,
  .discover-song-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .discover-toolbar {
    grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(160px, 1fr));
  }

  .discover-toolbar__field:nth-of-type(3) {
    grid-column: span 1;
  }

  .discover-toolbar__toggle,
  .discover-toolbar__reset {
    justify-self: start;
  }
}

@media (max-width: 980px) {
  .discover-page .discover-shell {
    max-width: calc(100% - 32px);
    padding: 84px 16px 64px;
  }

  .discover-hero {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .discover-feature-slot__head,
  .discover-section__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .discover-feature-slot__copy,
  .discover-section__copy {
    max-width: none;
    text-align: left;
  }

  .discover-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .discover-toolbar__search {
    grid-column: 1 / -1;
  }

  .discover-playlist-grid,
  .discover-song-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .discover-playlist-grid,
  .discover-song-grid {
    grid-template-columns: 1fr;
  }

  .discover-toolbar {
    grid-template-columns: 1fr;
  }

  .discover-toolbar__toggle,
  .discover-toolbar__reset {
    width: 100%;
    justify-content: center;
  }

  .discover-results-meta {
    justify-content: flex-start;
  }
}

/* ─── Projects workspace ───────────────────────────────────────── */

.projects-page .hero-shell {
  max-width: min(1180px, calc(100% - 48px));
  align-items: stretch;
  gap: 18px;
  padding: 96px 24px 72px;
}

.projects-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.95fr);
  gap: 24px;
  padding: 32px;
  overflow: hidden;
}

.projects-hero::before,
.projects-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.projects-hero::before {
  inset: auto -120px -140px auto;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 124, 248, 0.22), transparent 68%);
}

.projects-hero::after {
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent 46%),
    radial-gradient(circle at top left, rgba(93, 228, 244, 0.11), transparent 32%);
  opacity: 0.9;
}

.projects-hero__copy,
.projects-hero__aside {
  position: relative;
  z-index: 1;
}

.projects-hero__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.projects-hero__copy .fynn-page__title {
  max-width: 10ch;
}

.projects-hero__copy .fynn-page__copy {
  margin: 0;
  max-width: 58ch;
  line-height: 1.8;
}

.projects-hero__aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: space-between;
}

.projects-hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.projects-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  min-height: 104px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--b0);
  background: rgba(255, 255, 255, 0.025);
}

.projects-stat__value {
  display: block;
  max-width: 100%;
  font-family: var(--display);
  font-size: clamp(0.94rem, 1.7vw, 1.32rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-wrap: balance;
  overflow-wrap: anywhere;
  color: var(--t100);
}

.projects-stat__label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  line-height: 1.7;
  text-transform: uppercase;
  color: var(--t35);
}

.projects-create-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid rgba(139, 124, 248, 0.38);
  background:
    linear-gradient(135deg, rgba(139, 124, 248, 0.2), rgba(93, 228, 244, 0.14)),
    rgba(11, 12, 25, 0.72);
  color: var(--t100);
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  appearance: none;
  outline: none;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.2);
}

.projects-create-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(93, 228, 244, 0.34);
  background:
    linear-gradient(135deg, rgba(139, 124, 248, 0.28), rgba(93, 228, 244, 0.18)),
    rgba(11, 12, 25, 0.76);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

.projects-create-btn:disabled {
  cursor: progress;
  opacity: 0.74;
  transform: none;
  box-shadow: none;
}

.projects-create-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
}

.projects-create-btn.is-loading .projects-create-btn__label {
  opacity: 0.78;
}

.projects-create-btn--inline {
  min-height: 44px;
  padding-inline: 16px;
}

.projects-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 4px;
}

.projects-toolbar__label,
.projects-toolbar__hint {
  margin: 0;
  font-family: var(--mono);
}

.projects-toolbar__label {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--t35);
}

.projects-toolbar__hint {
  font-size: 0.72rem;
  color: var(--t60);
}

.projects-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.projects-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
  animation: projectCardIn 0.5s cubic-bezier(0.22, 0.8, 0.2, 1) both;
}

.projects-card:nth-child(2) { animation-delay: 0.05s; }
.projects-card:nth-child(3) { animation-delay: 0.1s; }
.projects-card:nth-child(4) { animation-delay: 0.15s; }
.projects-card:nth-child(5) { animation-delay: 0.2s; }
.projects-card:nth-child(6) { animation-delay: 0.25s; }

.projects-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 124, 248, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 55%),
    var(--surface);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.035) inset,
    0 16px 40px rgba(0, 0, 0, 0.28),
    0 8px 18px rgba(0, 0, 0, 0.16);
}

.projects-card__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}

.projects-card__visual {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  min-height: 154px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--b0);
  background:
    linear-gradient(135deg, rgba(139, 124, 248, 0.2), rgba(93, 228, 244, 0.04) 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
  overflow: hidden;
}

.projects-card:nth-child(3n + 2) .projects-card__visual {
  background:
    linear-gradient(135deg, rgba(82, 217, 164, 0.18), rgba(93, 228, 244, 0.05) 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
}

.projects-card:nth-child(3n) .projects-card__visual {
  background:
    linear-gradient(135deg, rgba(240, 138, 171, 0.16), rgba(139, 124, 248, 0.06) 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
}

.projects-card__visual::before,
.projects-card__visual::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.projects-card__visual::before {
  inset: auto -48px -98px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.13), transparent 68%);
  transition: transform 0.22s ease;
}

.projects-card__visual::after {
  inset: 0;
  background: linear-gradient(180deg, transparent 10%, rgba(6, 7, 14, 0.2) 100%);
}

.projects-card:hover .projects-card__visual::before {
  transform: translate(-12px, 8px) scale(1.04);
}

.projects-card__symbol,
.projects-card__pattern {
  position: relative;
  z-index: 1;
}

.projects-card__symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(6, 7, 14, 0.28);
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--display);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.projects-card__pattern {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 62px;
}

.projects-card__pattern span {
  display: block;
  width: 14px;
  min-height: 18px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.12));
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.projects-card__pattern span:nth-child(1) { height: 20px; }
.projects-card__pattern span:nth-child(2) { height: 34px; }
.projects-card__pattern span:nth-child(3) { height: 52px; }
.projects-card__pattern span:nth-child(4) { height: 28px; }
.projects-card__pattern span:nth-child(5) { height: 44px; }

.projects-card:hover .projects-card__pattern span {
  transform: translateY(-2px);
  opacity: 0.96;
}

.projects-card__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  flex: 1 1 auto;
  padding: 20px;
}

.projects-card__eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.projects-card__state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(93, 228, 244, 0.24);
  background: rgba(93, 228, 244, 0.08);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.projects-card__state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.88;
}

.projects-card__state--blank {
  border-color: var(--b1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--t60);
}

.projects-card__updated {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--t35);
}

.projects-card__title-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.projects-card__title {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--t100);
}

.projects-card__summary {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.78;
  color: var(--t60);
}

.projects-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.projects-card__metric {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px 12px 11px;
  border-radius: 14px;
  border: 1px solid var(--b0);
  background: rgba(255, 255, 255, 0.022);
  min-width: 0;
}

.projects-card__metric-label {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--t35);
}

.projects-card__metric-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--display);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--t100);
}

.projects-card__metric-value--date {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}

.projects-card__footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--b0);
}

.projects-card__source {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t35);
}

.projects-card__footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.projects-card__open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--violet-a30);
  background: var(--violet-a12);
  color: var(--t100);
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.projects-card__open:hover {
  transform: translateY(-1px);
  background: var(--violet-a20);
  border-color: rgba(139, 124, 248, 0.48);
}

.projects-card__open svg,
.projects-card__delete svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.projects-card__delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--r-pill);
  border: 1px solid var(--b1);
  background: transparent;
  color: var(--t35);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  appearance: none;
  outline: none;
}

.projects-card__delete:hover {
  border-color: rgba(240, 138, 171, 0.3);
  background: rgba(240, 138, 171, 0.08);
  color: var(--rose);
}

.projects-card__delete:disabled {
  cursor: progress;
  opacity: 0.54;
}

.projects-empty {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  grid-column: 1 / -1;
  gap: 28px;
  align-items: center;
  padding: 28px;
  overflow: hidden;
}

.projects-empty::before {
  content: "";
  position: absolute;
  inset: auto -120px -140px auto;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 124, 248, 0.14), transparent 68%);
  pointer-events: none;
}

.projects-empty__visual,
.projects-empty__body {
  position: relative;
  z-index: 1;
}

.projects-empty__visual {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 24px;
  border-radius: 22px;
  border: 1px solid var(--b0);
  background:
    linear-gradient(140deg, rgba(139, 124, 248, 0.18), rgba(93, 228, 244, 0.04) 60%),
    rgba(255, 255, 255, 0.02);
}

.projects-empty__stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(180px, 100%);
}

.projects-empty__stack span {
  display: block;
  height: 20px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 7, 14, 0.28);
}

.projects-empty__stack span:nth-child(1) { width: 62%; }
.projects-empty__stack span:nth-child(2) { width: 100%; }
.projects-empty__stack span:nth-child(3) { width: 82%; }
.projects-empty__stack span:nth-child(4) { width: 70%; }

.projects-empty__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.projects-empty__title {
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--t100);
}

.projects-empty__copy {
  margin: 0;
  max-width: 52ch;
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.8;
  color: var(--t60);
}

.projects-empty__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.projects-empty__hint {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--t35);
}

@keyframes projectCardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 900px) {
  .projects-page .hero-shell {
    max-width: calc(100% - 32px);
    padding: 84px 16px 64px;
  }

  .projects-hero {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .projects-hero__stats {
    grid-template-columns: 1fr;
  }

  .projects-empty {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .projects-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .projects-card__metrics {
    grid-template-columns: 1fr;
  }

  .projects-card__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .projects-card__footer-actions {
    width: 100%;
    margin-left: 0;
  }

  .projects-card__open {
    flex: 1 1 auto;
  }

  .projects-card__source {
    white-space: normal;
  }

  .projects-empty {
    padding: 24px;
  }

  .projects-empty__visual {
    min-height: 180px;
  }
}

/* ─── Generate button: generate-label + login mode ─────────────── */

.generate-label {
  display: none;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.generate-button.is-login-mode .arrow-icon { display: none; }
.generate-button.is-login-mode .generate-label { display: inline; }
.generate-button.is-login-mode { cursor: pointer; }
/* Override busy-state hiding for login mode label */
.generate-button.is-busy .generate-label { display: none; }

/* ─── Anonymous result card ─────────────────────────────────────── */

.anon-result {
  padding: 0;
  overflow: hidden;
}

.anon-result__cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  background: var(--surface-hi);
}

.anon-result__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder artwork (no cover returned) */
.anon-result__cover--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse 80% 80% at 50% 50%, rgba(139,124,248,0.12), transparent),
              var(--surface-hi);
}

.anon-result__cover--placeholder svg {
  width: 56px;
  height: 56px;
  opacity: 0.7;
}

/* Gradient overlay so content below reads clearly */
.anon-result__cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(11,12,25,0.90) 100%);
}

.anon-result__content {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.anon-result__title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--t100);
  line-height: 1.25;
}

/* Two prominent CTA buttons below the audio player */
.anon-result__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 2px;
}

.anon-result__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-md);
  font-family: var(--display);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
  appearance: none;
  outline: none;
  text-decoration: none;
  white-space: nowrap;
}

.anon-result__btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.anon-result__btn--download {
  border: 1px solid var(--b2);
  background: var(--surface-hi);
  color: var(--t100);
}

.anon-result__btn--download:hover {
  background: var(--surface-hov);
  border-color: var(--b3);
}

.anon-result__btn--edit {
  border: 1px solid var(--violet-a30);
  background: var(--violet-a12);
  color: var(--t100);
}

.anon-result__btn--edit:hover {
  background: var(--violet-a20);
  border-color: rgba(139,124,248,0.48);
}

/* Single-button layout when no download URL */
.anon-result__actions:has(.anon-result__btn:only-child) {
  grid-template-columns: 1fr;
}

.anon-result__midi {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.track-public-hint {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted, rgba(230, 235, 255, 0.72));
}

.track-public-hint a {
  color: var(--accent, #8b7cf8);
  text-decoration: none;
}

.track-public-hint a:hover {
  text-decoration: underline;
}

/* ─── Register / signup prompt modal ────────────────────────────── */

.register-dialog {
  position: relative;
  width: min(380px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
  border-color: var(--b2);
}

.register-dialog.glass-panel:hover {
  background: var(--surface);
  border-color: var(--b2);
}

.register-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}

.register-dialog__body {
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.register-dialog__icon {
  flex: 0 0 auto;
}

.register-dialog__icon svg {
  display: block;
  width: 48px;
  height: 48px;
}

.register-dialog__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--t100);
  line-height: 1.2;
}

.register-dialog__copy {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.65;
  color: var(--t60);
}

.register-dialog__actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.register-dialog__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 42px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  border: 1px solid var(--violet-a30);
  background: var(--violet-a12);
  color: var(--t100);
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s;
}

.register-dialog__cta:hover {
  background: var(--violet-a20);
  border-color: rgba(139,124,248,0.48);
}

.register-dialog__login-row {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--t35);
}

.register-dialog__login-link {
  color: var(--violet);
  text-decoration: none;
  transition: opacity 0.15s;
}

.register-dialog__login-link:hover {
  opacity: 0.75;
}

@media (max-width: 420px) {
  .anon-result__actions {
    grid-template-columns: 1fr;
  }
}

/* ─── Authorship & engagement ───────────────────────────────────── */

.explore-author {
  display: inline-block;
  margin-top: 2px;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  color: var(--t60);
  text-decoration: none;
  transition: color 0.15s;
}

.explore-author:hover {
  color: var(--violet);
}

/* Row that holds downloads + stats side by side */
.explore-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.explore-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid var(--b1);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--t60);
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.stat-badge svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  opacity: 0.7;
}

.stat-badge--like {
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--t60);
  appearance: none;
}

.stat-badge--like:hover {
  color: var(--rose);
}

.stat-badge--like.is-liked {
  color: var(--rose);
}

.stat-badge--like.is-liked svg {
  fill: var(--rose);
  stroke: var(--rose);
}

.stat-badge--dislike {
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--t60);
  appearance: none;
}

.stat-badge--dislike:hover {
  color: var(--cyan);
}

.stat-badge--dislike.is-disliked {
  color: var(--cyan);
}

.stat-badge--dislike.is-disliked svg {
  stroke: var(--cyan);
}

/* ─── Visibility badge ──────────────────────────────────────────── */

.visibility-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--b1);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  font-weight: 400;
  margin-bottom: 6px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.visibility-badge.is-public {
  background: var(--mint-a08);
  border-color: var(--mint-a22);
  color: var(--mint);
}

.visibility-badge.is-private {
  background: rgba(255,255,255,0.03);
  border-color: var(--b1);
  color: var(--t35);
}

/* ─── My Studio layout ──────────────────────────────────────────── */

.studio-page .hero-shell {
  padding-bottom: 0;
}

.studio-shell {
  padding-bottom: 32px;
}

.studio-title {
  font-size: 1.4rem;
}

.studio-composer {
  margin-top: 0;
}

.studio-tracks-section {
  width: 100%;
  max-width: calc(var(--content, 600px) + 32px);
  margin: 0 auto;
  padding: 0 16px 48px;
}

.studio-tracks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 0 16px;
  border-top: 1px solid var(--b1);
}

.studio-tracks-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t60);
  margin: 0;
}

.studio-list .explore-row {
  position: relative;
}

.studio-row__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  padding-left: 12px;
}

.studio-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  padding: 4px 10px;
  cursor: pointer;
  border: 1px solid var(--b1);
  background: var(--surface);
  color: var(--t60);
  border-radius: var(--r-sm);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  appearance: none;
  font-family: var(--mono);
}

.studio-toggle:hover {
  color: var(--t100);
  border-color: var(--b2);
  background: var(--surface-hi);
}

.studio-toggle.is-off {
  color: var(--t35);
}

.studio-toggle svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.studio-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border: 1px solid var(--b1);
  background: var(--surface);
  color: var(--t35);
  border-radius: var(--r-sm);
  cursor: not-allowed;
  font-family: var(--mono);
  opacity: 0.55;
}

.studio-empty {
  margin-top: 0;
  padding: 24px;
  text-align: center;
}

/* ─── Author page ───────────────────────────────────────────────── */

.author-page .explore-intro {
  margin-bottom: 0;
}

/* ─── Studio redesign additions ─────────────────────────────────── */

/* Tab strip */
.studio-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.studio-tab {
  background: none;
  border: 1px solid var(--b1);
  border-radius: var(--r-sm);
  color: var(--t60);
  cursor: pointer;
  font-family: var(--mono);
  font-size: .75rem;
  padding: 6px 14px;
  transition: background .15s, color .15s, border-color .15s;
}

.studio-tab:hover {
  background: var(--surface-hi);
  color: var(--t100);
}

.studio-tab.is-active {
  background: var(--violet-a12);
  border-color: var(--violet-a30);
  color: var(--t100);
}

.studio-soon {
  background: var(--surface-hi);
  border-radius: 4px;
  color: var(--t35);
  font-size: .65rem;
  margin-left: 4px;
  padding: 1px 4px;
}

/* Tab panels */
.studio-tab-panel { display: block; }
.studio-tab-panel.is-hidden { display: none; }

/* Studio controls (soundpack + creativity) */
.studio-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.studio-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.studio-control-label {
  color: var(--t60);
  font-family: var(--mono);
  font-size: .72rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.creativity-slider-row { gap: 6px; }

.studio-select {
  appearance: none;
  background: var(--surface-hi);
  border: 1px solid var(--b1);
  border-radius: var(--r-sm);
  color: var(--t100);
  font-family: var(--mono);
  font-size: .8rem;
  padding: 6px 10px;
  width: 100%;
  cursor: pointer;
}

.studio-select:focus {
  outline: 2px solid var(--violet-a30);
  outline-offset: 1px;
}

/* Studio filters row */
.studio-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}

.studio-tracks-search {
  background: var(--surface-hi);
  border: 1px solid var(--b1);
  border-radius: var(--r-sm);
  color: var(--t100);
  font-family: var(--mono);
  font-size: .8rem;
  padding: 6px 10px;
  flex: 1;
  min-width: 0;
}

.studio-tracks-search:focus {
  outline: 2px solid var(--violet-a30);
  outline-offset: 1px;
}

.studio-tracks-search::placeholder { color: var(--t35); }

.studio-filters .studio-select { width: auto; flex-shrink: 0; }

.studio-source-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.studio-source-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  height: 34px;
  border-radius: var(--r-sm);
  border: 1px solid var(--b1);
  background: var(--surface-hi);
  color: var(--t60);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.studio-source-btn:hover {
  color: var(--t100);
  border-color: var(--b2);
  background: var(--surface-hov);
}

.studio-source-btn__icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.studio-source-btn:hover .studio-source-btn__icon {
  opacity: 1;
}

.studio-source-btn--audio {
  border-color: rgba(93,228,244,0.18);
  color: var(--cyan);
}

.studio-source-btn--audio:hover {
  border-color: rgba(93,228,244,0.35);
  background: rgba(93,228,244,0.06);
  color: var(--cyan);
}

.studio-source-btn--midi {
  border-color: rgba(139,124,248,0.22);
  color: var(--violet);
}

.studio-source-btn--midi:hover {
  border-color: rgba(139,124,248,0.38);
  background: var(--violet-a12);
  color: var(--violet);
}

/* Info modal prompt block */
.studio-info-label {
  margin: 0 0 8px;
  color: var(--t35);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.studio-info-prompt {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--t100);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--b1);
  border-radius: var(--r-md);
  padding: 14px 16px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow-y: auto;
}

/* Kebab menu */
.kebab-wrap {
  position: relative;
}

.kebab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: var(--r-sm);
  border: 1px solid var(--b1);
  background: var(--surface-hi);
  color: var(--t60);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  appearance: none;
  outline: none;
}

.kebab-btn:hover {
  color: var(--t100);
  border-color: var(--b2);
  background: var(--surface-hov);
  transform: none;
}

.kebab-btn svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.kebab-menu {
  background: var(--surface-hi);
  border: 1px solid var(--b2);
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  min-width: 160px;
  padding: 4px 0;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 200;
}

.kebab-menu-item {
  background: none;
  border: none;
  color: var(--t100);
  cursor: pointer;
  display: block;
  font-family: var(--mono);
  font-size: .8rem;
  padding: 8px 16px;
  text-align: left;
  width: 100%;
}

.kebab-menu-item:hover {
  background: var(--violet-a12);
  color: var(--t100);
}

/* ─── Studio composer surface polish ───────────────────────────── */

.studio-prompt-shell {
  border-radius: var(--r-md);
  border: 1px solid var(--b0);
  background: rgba(255,255,255,0.022);
  padding: 10px 10px;
}

.studio-upload-summary {
  align-items: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--b1);
  border-radius: var(--r-md);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 14px;
}

.studio-upload-summary__meta {
  min-width: 0;
}

.studio-upload-summary__label {
  margin: 0 0 4px;
  color: var(--t35);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.studio-upload-summary__name {
  margin: 0;
  color: var(--t100);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-upload-summary__remove {
  align-items: center;
  background: transparent;
  border: 1px solid var(--b1);
  border-radius: var(--r-pill);
  color: var(--t60);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  height: 34px;
  justify-content: center;
  padding: 0;
  transition: color .15s, border-color .15s, background .15s;
  width: 34px;
}

.studio-upload-summary__remove:hover {
  background: var(--surface-hi);
  border-color: var(--b2);
  color: var(--t100);
}

.studio-upload-summary__remove svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.studio-prompt-shell .studio-prompt {
  min-height: 110px;
  height: auto;
  padding: 0;
}

/* Studio: generate should be a labeled button (no arrow-only) */
.studio-page .generate-button .generate-label {
  display: inline;
}

.studio-page .generate-button .arrow-icon {
  display: none;
}

/* Keep login mode readable too */
.studio-page .generate-button.is-login-mode .generate-label {
  display: inline;
}

/* ─── Studio: structured left column blocks ─────────────────────── */

.studio-block {
  border-radius: var(--r-lg);
  padding: 12px;
}

.studio-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.studio-block-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.studio-block-body--right {
  align-items: flex-end;
}

.studio-block--model .model-select {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

.studio-scratch-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
}

.studio-composer-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 2px;
}

/* Keep tracks-stack (anonymous-only) from taking space in Studio layout */
.studio-page #tracks-stack:empty {
  display: none;
}

/* ─── Studio topbar (model selector + divider) ─────────────────── */

.studio-topbar {
  width: 100%;
  max-width: 500px;
  align-self: center;
}

.studio-model-top {
  display: flex;
  justify-content: flex-end;
}

.studio-divider {
  border: none;
  height: 1px;
  margin: 12px 0 0;
  background: var(--b1);
}

/* Compact right-aligned model button for Studio */
.studio-page .studio-model-top .model-trigger {
  height: 28px;
  padding: 0 9px;
  border-radius: 9px;
  gap: 6px;
  max-width: 220px;
}

.studio-page .studio-model-top .model-trigger-name {
  font-size: 0.66rem;
}

.studio-page .studio-model-top .model-trigger .badge {
  padding: 1px 5px;
  font-size: 0.52rem;
}

.studio-page .studio-model-top .model-trigger svg {
  width: 10px;
  height: 10px;
}

/* Standalone centered tabs */
.studio-page .studio-tabs {
  justify-content: center;
}

/* Widen left composer column to match topbar width */
.studio-grid {
  grid-template-columns: 500px 1fr;
}

@media (max-width: 900px) {
  .studio-topbar {
    max-width: 100%;
  }
  .studio-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Download modal tiles ─────────────────────────────────────── */

.download-tiles {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
  justify-content: center;
}

.download-tile {
  width: 120px;
  height: 120px;
  border-radius: var(--r-md);
  border: 1px solid var(--b1);
  background: var(--surface-hi);
  color: var(--t100);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.15s, color 0.15s;
  gap: 8px;
}

.download-tile:hover {
  border-color: var(--b2);
  background: var(--surface-hov);
  transform: translateY(-1px);
}

.download-tile__icon {
  width: 28px;
  height: 28px;
  display: block;
  opacity: 0.9;
}

.download-tile__format {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 0.95rem;
  line-height: 1;
  text-align: center;
}

.download-tile__subtitle {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--t35);
  line-height: 1;
  margin-top: -2px;
  display: block;
  text-align: center;
}

@media (max-width: 520px) {
  .download-tiles {
    flex-wrap: wrap;
  }
  .download-tile {
    width: 100%;
    height: 88px;
    flex-direction: row;
    justify-content: flex-start;
    padding: 0 14px;
  }
  .download-tile__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }
}

/* Studio modal overlay */
.studio-modal {
  align-items: center;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 24px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 500;
}

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

.studio-dialog {
  max-height: 90vh;
  max-width: 520px;
  overflow-y: auto;
  padding: 0;
  width: 100%;
}

.studio-dialog-head {
  align-items: center;
  border-bottom: 1px solid var(--b1);
  display: flex;
  justify-content: space-between;
  padding: 16px 20px;
}

.studio-dialog-head h2 {
  font-family: var(--mono);
  font-size: .95rem;
  margin: 0;
}

.studio-dialog-close {
  background: none;
  border: none;
  color: var(--t60);
  cursor: pointer;
  font-size: .85rem;
  font-family: var(--mono);
  padding: 4px 8px;
}

.studio-dialog-close:hover { color: var(--t100); }

.studio-dialog-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.studio-dialog-actions {
  border-top: 1px solid var(--b1);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 20px;
}

.studio-audio-dialog {
  max-width: 680px;
}

.studio-audio-dialog__body {
  gap: 14px;
}

.studio-audio-dialog__copy {
  color: var(--t60);
  margin: 0;
}

.studio-audio-upload-stage {
  min-height: 312px;
}

.studio-audio-upload-stage[data-mode="upload"] .studio-audio-fragment {
  display: none !important;
}

.studio-audio-upload-stage[data-mode="fragment"] .studio-upload-dropzone {
  display: none !important;
}

.studio-upload-dropzone {
  align-items: center;
  background:
    radial-gradient(circle at top, rgba(139,124,248,0.14), transparent 58%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)),
    var(--surface-hi);
  border: 1px dashed rgba(139,124,248,0.34);
  border-radius: var(--r-lg);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 16px 32px rgba(0,0,0,0.22);
  color: var(--t100);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 312px;
  justify-content: center;
  padding: 28px;
  text-align: center;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .15s;
}

.studio-upload-dropzone:hover,
.studio-upload-dropzone.is-dragover {
  border-color: var(--violet-a30);
  background:
    radial-gradient(circle at top, rgba(139,124,248,0.2), transparent 58%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)),
    var(--surface-hov);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 18px 36px rgba(0,0,0,0.28);
}

.studio-upload-dropzone.is-dragover {
  transform: translateY(-1px);
}

.studio-upload-dropzone__eyebrow {
  color: var(--t35);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.studio-upload-dropzone__title {
  color: var(--t100);
  font-family: var(--display);
  font-size: 1.2rem;
  line-height: 1.2;
  max-width: 16ch;
}

.studio-upload-dropzone__copy {
  color: var(--t60);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.6;
  max-width: 34ch;
}

.studio-audio-fragment {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012)),
    var(--surface);
  border: 1px solid var(--b1);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-panel);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 312px;
  padding: 16px;
}

.studio-audio-fragment__head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.studio-audio-fragment__title-wrap {
  align-self: stretch;
  min-width: 0;
}

.studio-audio-fragment__meta {
  align-items: center;
  display: flex;
  gap: 8px;
}

.studio-audio-fragment__duration {
  background: var(--violet-a12);
  border: 1px solid var(--violet-a30);
  border-radius: var(--r-pill);
  color: var(--t100);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  padding: 6px 10px;
}

.studio-audio-fragment__replace {
  cursor: pointer;
}

.studio-audio-fragment__play {
  width: 34px;
  height: 34px;
}

.studio-audio-preview {
  height: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 0;
}

.studio-waveform-shell {
  background:
    radial-gradient(circle at top, rgba(139,124,248,0.12), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)),
    var(--surface);
  border: 1px solid var(--b1);
  border-radius: var(--r-md);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 10px 24px rgba(0,0,0,0.22);
  cursor: grab;
  min-height: 188px;
  overflow: hidden;
  padding: 16px;
  position: relative;
  touch-action: none;
  user-select: none;
}

.studio-waveform-shell:focus-visible {
  outline: 2px solid var(--violet-a30);
  outline-offset: 2px;
}

.studio-waveform-shell:active {
  cursor: grabbing;
}

.studio-waveform-shell.is-disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.studio-waveform-canvas {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0)),
    rgba(5, 7, 14, 0.96);
  border-radius: calc(var(--r-md) - 2px);
  display: block;
  height: 150px;
  width: 100%;
}

.studio-waveform-selection {
  background: linear-gradient(90deg, rgba(139,124,248,0.2), rgba(93,228,244,0.14));
  border: 1px solid rgba(93,228,244,0.42);
  border-radius: calc(var(--r-md) - 2px);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.06),
    0 0 0 1px rgba(139,124,248,0.12),
    0 0 20px rgba(139,124,248,0.12);
  bottom: 16px;
  cursor: grab;
  left: 16px;
  pointer-events: auto;
  position: absolute;
  top: 16px;
}

.studio-waveform-selection__handle {
  background: linear-gradient(180deg, var(--violet), var(--cyan));
  border: 2px solid rgba(5, 7, 14, 0.96);
  border-radius: 999px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 8px 16px rgba(0,0,0,0.28);
  bottom: 18px;
  cursor: ew-resize;
  position: absolute;
  top: 18px;
  width: 14px;
}

.studio-waveform-selection__handle--start {
  left: -7px;
}

.studio-waveform-selection__handle--end {
  right: -7px;
}

.studio-waveform-playhead {
  background: linear-gradient(180deg, rgba(240,138,171,0.92), rgba(240,138,171,0.72));
  border-radius: 999px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 0 14px rgba(240,138,171,0.28);
  bottom: 18px;
  pointer-events: none;
  position: absolute;
  top: 18px;
  transform: translateX(-50%);
  width: 3px;
}

.studio-audio-fragment__card {
  background: var(--surface-hi);
  border: 1px solid var(--b0);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}

.studio-audio-fragment__row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.studio-audio-fragment__selection {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.studio-audio-fragment__row strong {
  color: var(--t100);
  font-family: var(--mono);
  font-size: 0.82rem;
}

.studio-audio-fragment__pill {
  background: rgba(93,228,244,0.08);
  border: 1px solid rgba(93,228,244,0.22);
  border-radius: var(--r-pill);
  color: rgba(93,228,244,0.9);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  text-transform: uppercase;
}

.studio-audio-fragment__times {
  color: var(--t60);
  display: grid;
  font-family: var(--mono);
  font-size: 0.72rem;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
}

.studio-audio-fragment__times span:nth-child(2) {
  text-align: center;
}

@media (max-width: 700px) {
  .studio-upload-dropzone,
  .studio-audio-fragment {
    min-height: 280px;
  }

  .studio-audio-upload-stage {
    min-height: 280px;
  }

  .studio-audio-fragment__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .studio-audio-fragment__meta {
    width: 100%;
    justify-content: space-between;
  }

  .studio-waveform-shell {
    min-height: 150px;
    padding: 14px;
  }

  .studio-waveform-canvas {
    height: 118px;
  }

  .studio-audio-fragment__times {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .studio-audio-fragment__times span:nth-child(2) {
    text-align: left;
  }
}

/* Studio form fields */
.studio-field-label {
  color: var(--t60);
  display: flex;
  flex-direction: column;
  font-family: var(--mono);
  font-size: .75rem;
  gap: 4px;
}

.studio-text-input {
  background: var(--surface-hi);
  border: 1px solid var(--b1);
  border-radius: var(--r-sm);
  color: var(--t100);
  font-family: var(--mono);
  font-size: .85rem;
  padding: 8px 10px;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
}

.studio-text-input:focus {
  outline: 2px solid var(--violet-a30);
  outline-offset: 1px;
}

/* Studio checkbox */
.studio-checkbox {
  align-items: center;
  color: var(--t60);
  cursor: pointer;
  display: flex;
  font-family: var(--mono);
  font-size: .8rem;
  gap: 8px;
}

.studio-checkbox input[type="checkbox"] {
  accent-color: var(--violet);
  cursor: pointer;
  height: 14px;
  width: 14px;
}

/* Cover preview in publish modal */
.publish-cover-wrap {
  align-items: center;
  display: flex;
  gap: 12px;
}

/* Analytics rows */
.analytics-stat-row {
  align-items: center;
  border-bottom: 1px solid var(--b0);
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.analytics-stat-row:last-child { border-bottom: none; }

.analytics-stat-row span {
  color: var(--t60);
  font-family: var(--mono);
  font-size: .8rem;
}

.analytics-stat-row strong {
  color: var(--t100);
  font-family: var(--mono);
  font-size: .9rem;
}

/* Danger button variant */
.glass-action.is-danger {
  background: rgba(220, 38, 38, .15);
  border-color: rgba(220, 38, 38, .35);
  color: #f87171;
}

.glass-action.is-danger:hover {
  background: rgba(220, 38, 38, .25);
  border-color: rgba(220, 38, 38, .5);
}

/* Skeleton shimmer for in-progress rows */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton-block {
  animation: shimmer 1.4s linear infinite;
  background: linear-gradient(90deg, var(--surface-hi) 25%, var(--surface-hov) 50%, var(--surface-hi) 75%);
  background-size: 800px 100%;
  border-radius: 4px;
}

.studio-skeleton .explore-cover .skeleton-block {
  border-radius: 8px;
}


/* ─── Studio two-column layout ──────────────────────────────── */

/* Make studio page fill full width of site-main */
.studio-page {
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  align-self: stretch;
  align-items: stretch; /* override .fynn-app's align-items:center */
  overflow: hidden;
  /* No position:relative needed — ambient-field/noise-overlay are fixed */
}

body:has(.studio-page) {
  overflow-y: hidden;
}

.site-main:has(.studio-page) {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}

.site-main:has(.studio-page) .site-main__inner {
  flex: 1 1 auto;
  height: 100%;
  overflow: hidden;
  align-items: stretch;
}

.site-main:has(.studio-page) .site-footer {
  display: none;
}

/* Grid: fixed-width composer column + fluid tracks column */
.studio-grid {
  display: grid;
  grid-template-columns: 500px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  min-height: 0;
  height: 100%;
  align-items: stretch;
  overflow: hidden;
}

/* ── Left: composer column ──────────────────────────────────── */

.studio-composer-col {
  position: relative;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  border-right: 1px solid var(--b1);
  padding: 24px 18px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
  min-height: 0;
}

/* Prompt textarea stretched in column */
.studio-prompt {
  width: 100%;
  box-sizing: border-box;
  min-height: 110px;
  resize: vertical;
  flex-shrink: 0;
}

/* Composer tab panel fills column */
.studio-scratch-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
}

/* Generate button full-width, pinned to bottom of composer column */
.studio-generate-btn {
  width: 100%;
  justify-content: center;
  flex-shrink: 0;
  margin-top: auto;
}

/* Additional settings toggle */
.studio-adv-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.70rem;
  color: var(--t60);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--b1);
  background: transparent;
  transition: color .15s, border-color .15s, background .15s;
  appearance: none;
  letter-spacing: .03em;
  flex-shrink: 0;
  text-align: left;
}

.studio-adv-toggle:hover {
  color: var(--t100);
  border-color: var(--b2);
  background: var(--surface-hi);
}

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

.adv-toggle-chevron {
  flex-shrink: 0;
  transition: transform .2s;
}

/* Collapsible additional settings panel */
.studio-adv-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--surface-hi);
  border: 1px solid var(--b1);
  flex-shrink: 0;
}

.studio-adv-panel[hidden] { display: none; }

.studio-adv-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.studio-adv-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--t60);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

/* Composer column: push progress card / tracks-stack to bottom */
.studio-composer-col .progress-card {
  margin-top: 4px;
  flex-shrink: 0;
}

.studio-composer-col .tracks-stack {
  flex-shrink: 0;
}

/* "Soon" panel content in Continue tab */
.studio-soon-panel {
  padding: 32px 0 16px;
  text-align: center;
  color: var(--t35);
  font-family: var(--mono);
  font-size: .8rem;
  line-height: 1.6;
}

/* ── Right: tracks column ────────────────────────────────────── */

.studio-tracks-col {
  padding: 0 20px 48px;
  box-sizing: border-box;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Override existing studio-tracks-header for right column */
.studio-tracks-col .studio-tracks-header {
  padding: 16px 0 12px;
  border-top: none;
  border-bottom: 1px solid var(--b1);
  margin-bottom: 12px;
}

/* Studio empty state */
.studio-empty {
  margin-top: 16px;
  padding: 24px;
  text-align: center;
}

/* ── Track row (compact two-line format) ────────────────────── */

.studio-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.studio-list li {
  margin-bottom: 8px;
}

.studio-track-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
}

.studio-track-cover {
  flex-shrink: 0;
}

.studio-track-cover img {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-hi);
}

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

/* Header row: title + badge + kebab */
.studio-track-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.studio-track-title {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.80rem;
  font-weight: 400;
  color: var(--t100);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Visibility badge inline (remove bottom margin from default) */
.studio-track-header .visibility-badge {
  margin-bottom: 0;
  flex-shrink: 0;
}

/* Kebab at end of header */
.studio-track-header .kebab-wrap {
  flex-shrink: 0;
  margin-left: 2px;
}

/* Audio widget spans track content width */
.studio-track-audio {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* ── Responsive: stack columns on narrow viewport ─────────────── */

@media (max-width: 900px) {
  body:has(.studio-page) {
    overflow-y: auto;
  }

  .site-main:has(.studio-page) {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .site-main:has(.studio-page) .site-main__inner {
    height: auto;
    overflow: visible;
    align-items: center;
  }

  .site-main:has(.studio-page) .site-footer {
    display: block;
  }

  .studio-page {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .studio-grid {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .studio-composer-col {
    position: static;
    height: auto;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--b1);
  }

  .studio-tracks-col {
    padding: 0 16px 48px;
    min-height: auto;
    height: auto;
    overflow: visible;
  }
}

/* ── Melody Piano Roll Modal ─────────────────────────────────── */

.studio-draw-melody-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px 16px;
  background: rgba(139, 124, 248, 0.07);
  border: 1px dashed rgba(139, 124, 248, 0.28);
  border-radius: var(--r-md, 10px);
  color: var(--violet, #8b7cf8);
  font-family: var(--mono, monospace);
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  text-align: center;
}

.studio-draw-melody-btn:hover {
  background: rgba(139, 124, 248, 0.13);
  border-color: rgba(139, 124, 248, 0.45);
}

.studio-dialog--melody {
  display: flex;
  flex-direction: column;
  max-width: min(920px, 96vw);
  width: min(920px, 96vw);
  height: min(680px, 90vh);
  max-height: min(680px, 90vh);
  overflow: hidden;
}

.studio-melody-roll-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.studio-melody-subtitle {
  font-family: var(--mono, monospace);
  font-size: 0.70rem;
  color: var(--t35, rgba(255,255,255,0.32));
  margin-left: 8px;
  flex-shrink: 0;
  align-self: center;
}

.studio-melody-timer {
  font-family: var(--mono, monospace);
  font-size: 0.72rem;
  color: var(--t60, rgba(255,255,255,0.55));
  align-self: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.studio-melody-spacer {
  flex: 1;
}

.melody-roll-pause-icon { display: none; }
#melody-roll-play-btn.is-playing .melody-roll-play-icon { display: none; }
#melody-roll-play-btn.is-playing .melody-roll-pause-icon { display: inline; }
