/* Monica Music Studio — Suno-inspired UI (ace-step-ui + Awesome-Suno patterns) */

.hidden { display: none !important; }

body.ymm-studio-active { overflow: hidden; }

#ymm-studio {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  flex-direction: column;
  background: #030305;
  color: #f4f4f5;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1), transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  --beat: 0.28;
  --beat-phase: 0;
  overflow: hidden;
}

#ymm-studio.open {
  display: flex;
  opacity: 1;
  transform: scale(1);
}

.ymm-ambient-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

.ymm-ambient-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 55% at 50% -5%, rgba(249, 115, 22, 0.16), transparent 58%),
    radial-gradient(ellipse 70% 45% at 92% 20%, rgba(192, 132, 252, 0.14), transparent 52%),
    radial-gradient(ellipse 80% 50% at 8% 85%, rgba(240, 36, 155, 0.1), transparent 55%),
    #030305;
}

.ymm-aurora {
  position: absolute;
  width: 140%;
  height: 60%;
  left: -20%;
  filter: blur(60px);
  opacity: 0.45;
  mix-blend-mode: screen;
  animation: ymm-aurora-drift 14s ease-in-out infinite alternate;
}

.ymm-aurora-a {
  top: -15%;
  background: linear-gradient(105deg, transparent, rgba(249, 115, 22, 0.55), rgba(244, 114, 182, 0.45), transparent);
}

.ymm-aurora-b {
  bottom: 10%;
  animation-delay: -7s;
  background: linear-gradient(285deg, transparent, rgba(167, 139, 250, 0.5), rgba(56, 189, 248, 0.25), transparent);
}

.ymm-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.015) 2px,
    rgba(255, 255, 255, 0.015) 3px
  );
  opacity: calc(0.35 + var(--beat) * 0.25);
  pointer-events: none;
}

@keyframes ymm-aurora-drift {
  0% { transform: translateX(-3%) skewX(-2deg); }
  100% { transform: translateX(4%) skewX(2deg); }
}

.ymm-ambient-bg::before,
.ymm-ambient-bg::after {
  content: "";
  position: absolute;
  width: 55vmax;
  height: 55vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: ymm-ambient-drift 18s ease-in-out infinite alternate;
}

.ymm-ambient-bg::before {
  left: -10%;
  top: 10%;
  background: rgba(249, 115, 22, 0.35);
}

.ymm-ambient-bg::after {
  right: -5%;
  bottom: 5%;
  background: rgba(192, 132, 252, 0.3);
  animation-delay: -9s;
}

@keyframes ymm-ambient-drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(4%, -3%) scale(1.08); }
}

.ymm-layout {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  grid-template-columns: 88px 1fr;
  min-height: 0;
}

.ymm-rail {
  border-right: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 16px 10px;
  gap: 6px;
  background: rgba(6,6,10,.72);
  backdrop-filter: blur(24px);
  box-shadow: inset -1px 0 0 rgba(249,115,22,.08);
}

.ymm-rail-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 14px;
  color: #fb923c;
  opacity: 0.9;
}

.ymm-rail-brand svg {
  width: 28px;
  height: 28px;
}

.ymm-rail-spacer { flex: 1; min-height: 12px; }

.ymm-rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 58px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: #a1a1aa;
  cursor: pointer;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .02em;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.ymm-rail-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.ymm-rail-label {
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.ymm-rail-btn.active,
.ymm-rail-btn:hover {
  background: rgba(249,115,22,.15);
  color: #fb923c;
}

.ymm-rail-btn:active { transform: scale(0.96); }

.ymm-rail-exit {
  color: #71717a;
}

.ymm-rail-exit:hover {
  background: rgba(255,255,255,.06);
  color: #e4e4e7;
}

.ymm-main {
  min-height: 0;
  overflow: auto;
  scroll-behavior: smooth;
  padding: 16px 24px 120px;
  -webkit-overflow-scrolling: touch;
}

.ymm-main-inner {
  max-width: 720px;
  margin: 0 auto;
}

.ymm-view-panel {
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.ymm-view-panel.ymm-view-leave {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.ymm-view-panel.ymm-view-enter {
  opacity: 0;
  transform: translateY(12px);
}

.ymm-studio-hero.ymm-hero-compact {
  padding-bottom: 8px;
  margin-bottom: 0;
}

.ymm-studio-hero.ymm-hero-compact .ymm-hero-logo-wrap {
  width: 56px;
  height: 56px;
  margin-bottom: 8px;
}

.ymm-studio-hero.ymm-hero-compact .ymm-hero-logo-icon svg {
  width: 44px;
  height: 44px;
}

.ymm-studio-hero.ymm-hero-compact .ymm-studio-title-main {
  font-size: 1.5rem;
}

.ymm-studio-hero.ymm-hero-compact .ymm-studio-title-sub {
  font-size: .85rem;
}

.ymm-studio-hero.ymm-hero-compact .ymm-studio-tagline,
.ymm-studio-hero.ymm-hero-compact .ymm-notes-field {
  display: none;
}

.ymm-aside {
  border-left: 1px solid rgba(255,255,255,.06);
  background: #08080c;
  padding: 16px;
  overflow: auto;
}

.ymm-aside h3 {
  margin: 0 0 12px;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #71717a;
}

.ymm-trial-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ymm-engine-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: .78rem;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}

.ymm-engine-pill-on {
  border-color: rgba(34,197,94,.25);
  background: rgba(34,197,94,.08);
  color: #86efac;
}

.ymm-engine-pill-off {
  border-color: rgba(251,146,60,.25);
  background: rgba(249,115,22,.08);
  color: #fdba74;
}

.ymm-engine-pill code {
  font-size: .72rem;
  background: rgba(0,0,0,.25);
  padding: 1px 5px;
  border-radius: 4px;
}

.ymm-engine-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #52525b;
  flex-shrink: 0;
}

.ymm-engine-dot.on { background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,.6); }

.ymm-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 4px 0 8px;
  background: linear-gradient(180deg, rgba(5,5,7,.92) 70%, transparent);
  backdrop-filter: blur(8px);
}

.ymm-create-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.ymm-create-head .ymm-section-title { margin: 0; }

.ymm-library-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.ymm-library-header .ymm-section-title { margin: 0; }

.ymm-library-count {
  margin: 0;
  font-size: .82rem;
  color: #71717a;
}

.ymm-trial {
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(249,115,22,.18), rgba(234,88,12,.1));
  border: 1px solid rgba(251,146,60,.25);
  font-size: .84rem;
}

.ymm-trial.expired {
  background: linear-gradient(90deg, rgba(239,68,68,.15), rgba(127,29,29,.12));
  border-color: rgba(248,113,113,.3);
}

.ymm-close {
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  color: #e4e4e7;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
}

.ymm-hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -.03em;
}

.ymm-section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: -.02em;
  color: #fafafa;
}

.ymm-hero-sub {
  color: #71717a;
  margin: 0 0 22px;
  font-size: .92rem;
}

/* ── Monica Ai Music Studio hero (logo + heartbeat + flying notes) ── */
.ymm-studio-hero {
  position: relative;
  text-align: center;
  padding: 8px 12px 22px;
  margin-bottom: 8px;
  overflow: visible;
  animation: ymm-hero-enter 0.65s cubic-bezier(0.18, 1.35, 0.4, 1) both;
}

.ymm-notes-field {
  position: absolute;
  left: 50%;
  top: 38%;
  width: 1px;
  height: 1px;
  pointer-events: none;
  z-index: 0;
}

.ymm-flying-note {
  position: absolute;
  left: 0;
  top: 0;
  font-size: var(--note-size, 1.2rem);
  color: hsl(var(--note-hue, 310) 92% 74%);
  text-shadow:
    0 0 10px rgba(240, 36, 155, 0.95),
    0 0 22px rgba(138, 99, 255, 0.75),
    0 0 36px rgba(249, 115, 22, 0.35);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.2);
  animation: ymm-note-ecstasy var(--note-duration, 3s) cubic-bezier(0.15, 0.85, 0.25, 1) var(--note-delay, 0s) infinite;
  will-change: transform, opacity;
}

.ymm-hero-logo-stage {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
  margin: 0 auto 10px;
}

.ymm-spectrum-ring {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ymm-spectrum-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: calc(18px + 42px * var(--bar-h, 0.4));
  margin-left: -1.5px;
  margin-top: calc(-90px - 21px * var(--bar-h, 0.4));
  transform-origin: 50% calc(90px + 21px * var(--bar-h, 0.4));
  transform: rotate(var(--bar-rot, 0deg));
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(251, 146, 60, 0.95), rgba(244, 114, 182, 0.85), rgba(167, 139, 250, 0.5));
  box-shadow: 0 0 calc(8px + var(--beat) * 16px) rgba(244, 114, 182, calc(0.35 + var(--beat) * 0.55));
  opacity: calc(0.45 + var(--beat) * 0.55);
  transition: height 0.05s linear, opacity 0.05s linear;
}

.ymm-orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px solid transparent;
  pointer-events: none;
}

.ymm-orbit-a {
  inset: 8px;
  border-color: rgba(249, 115, 22, calc(0.15 + var(--beat) * 0.45));
  box-shadow: 0 0 calc(20px + var(--beat) * 40px) rgba(249, 115, 22, calc(0.1 + var(--beat) * 0.35));
  animation: ymm-orbit-spin 8s linear infinite;
}

.ymm-orbit-b {
  inset: -6px;
  border-color: rgba(244, 114, 182, calc(0.1 + var(--beat) * 0.35));
  animation: ymm-orbit-spin 12s linear infinite reverse;
}

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

.ymm-hero-logo-wrap {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 112px;
  transform: scale(calc(1 + var(--beat) * 0.38));
  transition: transform 0.04s linear;
  animation: ymm-logo-hue-shift 5s linear infinite;
  will-change: transform;
}

.ymm-hero-logo-wrap::before {
  content: "";
  position: absolute;
  inset: calc(-20px - var(--beat) * 28px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 46, 160, calc(0.55 + var(--beat) * 0.45)), rgba(138, 99, 255, 0.45) 42%, rgba(249, 115, 22, 0.2) 62%, transparent 74%);
  filter: blur(calc(10px + var(--beat) * 14px));
  z-index: 0;
}

.ymm-hero-logo-wrap::after {
  content: "";
  position: absolute;
  inset: calc(-32px - var(--beat) * 24px);
  border-radius: 50%;
  border: 2px solid rgba(255, 110, 199, calc(0.25 + var(--beat) * 0.65));
  box-shadow: 0 0 calc(24px + var(--beat) * 48px) rgba(240, 36, 155, calc(0.25 + var(--beat) * 0.55));
  z-index: 0;
  opacity: calc(0.35 + var(--beat) * 0.65);
}

.ymm-hero-logo-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #e9d5ff;
  filter: drop-shadow(0 0 16px rgba(240, 36, 155, 0.95)) drop-shadow(0 0 32px rgba(138, 99, 255, 0.65));
}

.ymm-hero-logo-icon svg,
.ymm-hero-logo-icon .ymm-logo-svg {
  width: 96px;
  height: 96px;
  display: block;
  filter: drop-shadow(0 0 calc(12px + var(--beat) * 24px) rgba(240, 36, 155, 0.95))
    drop-shadow(0 0 calc(24px + var(--beat) * 36px) rgba(138, 99, 255, 0.65));
}

.ymm-logo-wave {
  animation: ymm-logo-wave 1.1s ease-in-out infinite;
  transform-origin: center;
}

@keyframes ymm-logo-wave {
  0%, 100% { d: path("M22 88 Q34 72 46 88 T70 88 T94 88"); opacity: 0.7; }
  50% { opacity: 1; transform: translateY(calc(-2px - var(--beat) * 4px)); }
}

.ymm-studio-title {
  position: relative;
  z-index: 2;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.05;
}

.ymm-studio-title-main {
  font-size: clamp(2.1rem, 5.5vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(100deg, #fb923c, #f472b6, #c084fc, #38bdf8, #fb923c);
  background-size: 280% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: ymm-title-shimmer 3.5s linear infinite;
  transform: scale(calc(1 + var(--beat) * 0.04));
  filter: drop-shadow(0 0 calc(16px + var(--beat) * 32px) rgba(244, 114, 182, calc(0.35 + var(--beat) * 0.5)));
  transition: transform 0.04s linear, filter 0.04s linear;
}

.ymm-studio-title-sub {
  font-size: clamp(1.05rem, 2.8vw, 1.35rem);
  font-weight: 800;
  letter-spacing: calc(0.12em + var(--beat) * 0.08em);
  text-transform: uppercase;
  color: rgba(251, 146, 60, 0.95);
  text-shadow: 0 0 calc(20px + var(--beat) * 28px) rgba(249, 115, 22, calc(0.35 + var(--beat) * 0.55));
  transition: letter-spacing 0.04s linear, text-shadow 0.04s linear;
}

.ymm-studio-tagline {
  position: relative;
  z-index: 2;
  margin: 12px 0 0;
  font-size: 0.95rem;
  color: rgba(228, 228, 231, 0.78);
}

@keyframes ymm-hero-enter {
  0% { opacity: 0; transform: scale(0.88); filter: blur(6px); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes ymm-studio-heartbeat-icon {
  0%, 32%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 16px rgba(240, 36, 155, 0.85));
  }
  6% {
    transform: scale(1.2);
    filter: drop-shadow(0 0 32px rgba(255, 46, 160, 1)) drop-shadow(0 0 56px rgba(138, 99, 255, 0.9));
  }
  11% {
    transform: scale(1.06);
    filter: drop-shadow(0 0 20px rgba(240, 36, 155, 0.7));
  }
  18% {
    transform: scale(1.28);
    filter: drop-shadow(0 0 40px rgba(255, 110, 199, 1)) drop-shadow(0 0 72px rgba(56, 189, 248, 0.75));
  }
  26% {
    transform: scale(1.04);
    filter: drop-shadow(0 0 22px rgba(249, 115, 22, 0.65));
  }
}

@keyframes ymm-studio-heartbeat-glow {
  0%, 32%, 100% { transform: scale(0.78); opacity: 0.38; }
  6% { transform: scale(1.28); opacity: 1; }
  11% { transform: scale(0.94); opacity: 0.52; }
  18% { transform: scale(1.45); opacity: 1; }
  26% { transform: scale(0.86); opacity: 0.45; }
}

@keyframes ymm-studio-heartbeat-ring {
  0% { transform: scale(0.5); opacity: 0; }
  5% { opacity: 0.85; }
  16% { transform: scale(1.5); opacity: 0.35; }
  28% { transform: scale(2.4); opacity: 0; }
  100% { transform: scale(2.4); opacity: 0; }
}

@keyframes ymm-studio-heartbeat-text {
  0%, 32%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 20px rgba(244, 114, 182, 0.45));
  }
  6% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 36px rgba(240, 36, 155, 0.95)) drop-shadow(0 0 64px rgba(192, 132, 252, 0.55));
  }
  18% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 48px rgba(255, 110, 199, 1)) drop-shadow(0 0 80px rgba(249, 115, 22, 0.45));
  }
  26% { transform: scale(1.02); }
}

@keyframes ymm-studio-heartbeat-sub {
  0%, 32%, 100% { opacity: 0.85; letter-spacing: 0.14em; }
  6% { opacity: 1; letter-spacing: 0.18em; }
  18% { opacity: 1; letter-spacing: 0.22em; text-shadow: 0 0 32px rgba(249, 115, 22, 0.85); }
  26% { opacity: 0.9; letter-spacing: 0.15em; }
}

@keyframes ymm-note-ecstasy {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.15) rotate(0deg);
  }
  7% {
    opacity: 1;
    transform: translate(calc(-50% + var(--note-x)), calc(-50% + var(--note-y))) scale(1.35) rotate(18deg);
  }
  14% {
    opacity: 0.95;
    transform: translate(calc(-50% + calc(var(--note-x) * 0.7)), calc(-50% + calc(var(--note-y) * 0.6))) scale(1.05) rotate(-10deg);
  }
  22% {
    opacity: 1;
    transform: translate(calc(-50% + calc(var(--note-x) * 1.15)), calc(-50% + calc(var(--note-y) * 1.1))) scale(1.25) rotate(24deg);
  }
  40% {
    opacity: 0.7;
    transform: translate(calc(-50% + var(--note-x2)), calc(-50% + var(--note-y2))) scale(0.9) rotate(-6deg);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + calc(var(--note-x2) * 1.3)), calc(-50% + calc(var(--note-y2) * 1.5))) scale(0.25) rotate(42deg);
  }
}

@keyframes ymm-title-shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 280% center; }
}

@keyframes ymm-logo-hue-shift {
  0% { color: #fbcfe8; }
  33% { color: #e9d5ff; }
  66% { color: #fed7aa; }
  100% { color: #fbcfe8; }
}

@keyframes ymm-logo-sparkle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  40% { transform: scale(1.1) rotate(10deg); }
  70% { transform: scale(0.96) rotate(-8deg); }
}

@media (prefers-reduced-motion: reduce) {
  .ymm-studio-hero,
  .ymm-hero-logo-wrap,
  .ymm-hero-logo-wrap::before,
  .ymm-hero-logo-wrap::after,
  .ymm-hero-logo-icon svg,
  .ymm-studio-title-main,
  .ymm-studio-title-sub,
  .ymm-flying-note,
  .ymm-orbit-a,
  .ymm-orbit-b,
  .ymm-aurora,
  .ymm-cover,
  .ymm-generate {
    animation: none !important;
  }
  .ymm-hero-logo-wrap,
  .ymm-studio-title-main {
    transform: none !important;
  }
}

.ymm-mode-toggle {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.ymm-mode-toggle button {
  border: none;
  background: transparent;
  color: #a1a1aa;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-size: .86rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.ymm-mode-toggle button.active {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  box-shadow: 0 4px 16px rgba(249,115,22,.35);
}

.ymm-card {
  background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.04);
  position: relative;
  overflow: hidden;
}

.ymm-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(249,115,22,calc(0.15 + var(--beat) * 0.25)), rgba(244,114,182,0.12), rgba(167,139,250,0.08));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.85;
}

.ymm-card:focus-within {
  border-color: rgba(249,115,22,.35);
  box-shadow: 0 0 0 1px rgba(249,115,22,.15);
}

.ymm-card label {
  display: block;
  font-size: .72rem;
  color: #71717a;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.ymm-card textarea,
.ymm-card input,
.ymm-card select {
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.1);
  background: #0c0c10;
  color: #fafafa;
  padding: 12px 14px;
  font-size: .95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ymm-card textarea:focus,
.ymm-card input:focus,
.ymm-card select:focus {
  outline: none;
  border-color: rgba(249,115,22,.45);
  box-shadow: 0 0 0 3px rgba(249,115,22,.12);
}

.ymm-card textarea { min-height: 88px; resize: none; overflow: hidden; }

.ymm-hero-input textarea {
  min-height: 96px;
  font-size: 1.08rem;
  line-height: 1.45;
  border-color: rgba(249,115,22,.25);
  background: rgba(12,12,16,.85);
}

.ymm-lyrics-label { margin-top: 12px; }

.ymm-row-gap { margin-top: 12px; }

.ymm-advanced-wrap { margin-bottom: 8px; }

.ymm-advanced-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  color: #d4d4d8;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.ymm-advanced-toggle:hover {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.12);
}

.ymm-advanced-toggle.open {
  border-color: rgba(249,115,22,.25);
  background: rgba(249,115,22,.08);
  color: #fdba74;
}

.ymm-chevron {
  transition: transform 0.25s ease;
  font-size: .9rem;
}

.ymm-advanced-toggle.open .ymm-chevron { transform: rotate(180deg); }

.ymm-advanced-body {
  overflow: hidden;
  animation: ymm-advanced-open 0.28s ease;
}

.ymm-advanced-body.hidden { display: none; }

.ymm-advanced-card { margin-top: 10px; margin-bottom: 0; }

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

.ymm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.ymm-tags, .ymm-meta-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.ymm-tag, .ymm-meta {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: #d4d4d8;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .78rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.ymm-tag:active, .ymm-meta:active { transform: scale(0.96); }

.ymm-tag.on { background: rgba(249,115,22,.25); border-color: rgba(251,146,60,.45); color: #fff; }

.ymm-meta:hover { border-color: rgba(251,146,60,.4); color: #fb923c; }

.ymm-check { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: .88rem; color: #d4d4d8; }

.ymm-generate {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #f97316, #ea580c 40%, #f472b6 120%);
  background-size: 200% auto;
  box-shadow: 0 10px 40px rgba(249,115,22,.4), 0 0 calc(20px + var(--beat) * 30px) rgba(244,114,182,calc(0.15 + var(--beat) * 0.35));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.08s linear, background-position 0.3s ease;
  animation: ymm-generate-shimmer 4s linear infinite;
  letter-spacing: 0.02em;
}

@keyframes ymm-generate-shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.ymm-generate:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 48px rgba(249,115,22,.45);
}

.ymm-generate:active:not(:disabled) { transform: translateY(0); }

.ymm-generate-hint {
  font-size: .72rem;
  font-weight: 600;
  opacity: 0.65;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0,0,0,.2);
}

#ymm-studio.ymm-generating .ymm-generate-label::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 10px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: -2px;
  animation: ymm-spin 0.7s linear infinite;
}

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

.ymm-create-dock {
  position: sticky;
  bottom: 8px;
  z-index: 6;
  padding: 12px 0 4px;
  margin-top: 8px;
  background: linear-gradient(180deg, transparent, rgba(5,5,7,.88) 24%, rgba(5,5,7,.96));
}

.ymm-status {
  font-size: .84rem;
  color: #fb923c;
  min-height: 1.2em;
}

.ymm-status-inline { margin-top: 4px; display: none; }

.ymm-status-dock { margin-top: 8px; text-align: center; }

.ymm-generate:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

.ymm-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.ymm-song-card {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  background: #0c0c10;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.ymm-song-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(249,115,22,.35);
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
}

.ymm-song-card.playing { border-color: rgba(249,115,22,.55); }

.ymm-song-card.playing {
  border-color: rgba(249,115,22,.65);
  box-shadow: 0 0 calc(24px + var(--beat) * 20px) rgba(249,115,22,.25);
}

.ymm-song-card.playing .ymm-cover {
  animation: ymm-cover-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes ymm-cover-pulse {
  from { filter: brightness(1); }
  to { filter: brightness(calc(1 + var(--beat) * 0.35)); }
}

.ymm-cover {
  aspect-ratio: 1;
  background: linear-gradient(145deg, #431407 0%, #7c2d12 35%, #581c87 70%, #18181b 100%);
  background-size: 200% 200%;
  animation: ymm-cover-gradient 6s ease infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

@keyframes ymm-cover-gradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.ymm-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 40%, rgba(0,0,0,.55));
}

.ymm-cover-icon { font-size: 2rem; z-index: 1; }

.ymm-engine-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  font-size: .65rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  color: #fdba74;
  text-transform: uppercase;
}

.ymm-song-meta { padding: 10px 12px; }
.ymm-song-meta h4 { margin: 0 0 4px; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ymm-song-meta p { margin: 0; font-size: .75rem; color: #71717a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ymm-empty { text-align: center; color: #52525b; padding: 48px 16px; }

.ymm-player {
  position: relative;
  z-index: 2;
  height: 88px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(8,8,12,.95);
  backdrop-filter: blur(12px);
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  flex-shrink: 0;
}

.ymm-player-cover {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(145deg, #431407, #581c87, #18181b);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 calc(12px + var(--beat) * 16px) rgba(249,115,22,calc(0.2 + var(--beat) * 0.3));
}

.ymm-player-cover-icon {
  position: relative;
  z-index: 2;
  font-size: 1.25rem;
}

.ymm-player-eq {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding: 6px 8px;
  z-index: 1;
  opacity: 0.55;
}

.ymm-eq-bar {
  flex: 1;
  max-width: 3px;
  height: calc(8px + 36px * var(--eq-h, 0.3));
  border-radius: 999px;
  background: linear-gradient(180deg, #fb923c, #f472b6);
  transform-origin: bottom;
  transition: height 0.06s linear;
}

#ymm-studio.ymm-audio-live .ymm-player-eq {
  opacity: 0.95;
}

#ymm-studio.ymm-generating .ymm-hero-logo-stage {
  filter: saturate(calc(1 + var(--beat) * 0.5));
}

.ymm-player-info strong { display: block; font-size: .92rem; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ymm-player-info span { font-size: .76rem; color: #71717a; }

.ymm-progress-wrap { flex: 1; min-width: 120px; }
.ymm-progress { height: 4px; background: rgba(255,255,255,.1); border-radius: 999px; cursor: pointer; }
.ymm-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #f97316, #f472b6, #a78bfa);
  border-radius: 999px;
  box-shadow: 0 0 calc(8px + var(--beat) * 12px) rgba(244,114,182,0.5);
}
.ymm-time { font-size: .72rem; color: #71717a; margin-top: 4px; }

.ymm-player-actions { display: flex; gap: 8px; align-items: center; }
.ymm-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.08);
  color: #fafafa;
  cursor: pointer;
  font-size: 1rem;
}
.ymm-icon-btn.play { background: #f97316; color: #fff; width: 44px; height: 44px; }

.ymm-paywall {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.78);
  padding: 20px;
}
.ymm-paywall.open { display: flex; }
.ymm-paywall-card {
  max-width: 440px;
  width: 100%;
  border-radius: 18px;
  padding: 24px;
  background: #111;
  border: 1px solid rgba(255,255,255,.1);
}
.ymm-paywall-actions { display: flex; gap: 10px; margin-top: 18px; }
.ymm-paywall-actions button { flex: 1; border-radius: 12px; padding: 12px; border: none; cursor: pointer; font-weight: 600; }
.ymm-btn-primary { background: #f97316; color: #fff; }
.ymm-btn-ghost { background: rgba(255,255,255,.06); color: #e4e4e7; }

.ymm-sources {
  margin-top: 16px;
  font-size: .72rem;
  color: #52525b;
  line-height: 1.5;
}

@media (max-width: 960px) {
  .ymm-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  .ymm-rail {
    order: 2;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0));
    gap: 8px;
    justify-content: space-around;
  }

  .ymm-rail-brand,
  .ymm-rail-spacer { display: none; }

  .ymm-rail-btn {
    flex: 1;
    min-height: 52px;
    max-width: 100px;
  }

  .ymm-main {
    order: 1;
    padding: 12px 16px 240px;
  }

  .ymm-create-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(140px + env(safe-area-inset-bottom, 0));
    z-index: 10051;
    padding: 10px 16px 8px;
    margin-top: 0;
    border-top: 1px solid rgba(255,255,255,.08);
    background: rgba(8,8,12,.94);
    backdrop-filter: blur(16px);
    box-shadow: 0 -8px 32px rgba(0,0,0,.4);
  }

  .ymm-create-dock .ymm-generate,
  .ymm-create-dock .ymm-status-dock {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }

  .ymm-generate-hint { display: none; }

  .ymm-status-inline { display: block; }

  .ymm-status-dock:not(:empty) { display: none; }

  .ymm-row { grid-template-columns: 1fr; }

  .ymm-player {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    height: auto;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0));
    gap: 8px 12px;
  }

  .ymm-progress-wrap { grid-column: 1 / -1; }

  .ymm-player-info strong { max-width: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  #ymm-studio,
  .ymm-view-panel,
  .ymm-ambient-bg::before,
  .ymm-ambient-bg::after,
  .ymm-rail-btn,
  .ymm-card,
  .ymm-song-card,
  .ymm-generate {
    transition: none !important;
    animation: none !important;
  }
}
