* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  color: var(--text-high);
  background: var(--body-scene);
}

/* Let the main column shrink so tall content can scroll inside the card */
body.d-flex.min-vh-100 {
  min-height: 100dvh;
  min-height: 100svh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.d-flex.min-vh-100 > main.generate-page {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

.generate-page {
  --gen-pad-top: clamp(4.85rem, 4.2vw + 3rem, 6.35rem);
  --gen-pad-bottom: 0.6rem;
  width: 100%;
  padding: var(--gen-pad-top) var(--site-gutter) var(--gen-pad-bottom);
  box-sizing: border-box;
}

.card-wrapper {
  width: 100%;
  max-width: min(72rem, 100%);
  margin-inline: auto;
  border-radius: 22px;
  border: 1px solid var(--stroke-soft);
  padding: 0.85rem 1.1rem 0.95rem;
  background: var(--panel-raised);
  box-shadow: 0 24px 54px rgba(2, 7, 18, 0.5);
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: contain;
}

/* Android / narrow: let the page scroll; nested overflow traps often break touch scrolling */
@media (max-width: 896px) {
  body.d-flex.min-vh-100 > main.generate-page {
    flex: 0 1 auto;
    min-height: auto;
    max-height: none;
  }

  .card-wrapper {
    flex: 0 1 auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
  }

  .content-wrapper {
    flex: 0 1 auto;
    min-height: 0;
    max-height: none;
  }

  .left-panel {
    overflow: visible;
    max-height: none;
    -webkit-overflow-scrolling: touch;
  }

  .right-panel {
    max-height: none;
    overflow: visible;
  }
}

.card-wrapper.happy,
.card-wrapper.sad,
.card-wrapper.angry,
.card-wrapper.relaxed,
.card-wrapper.excited,
.card-wrapper.tired,
.card-wrapper.reflective,
.card-wrapper.burntout,
.card-wrapper.meh,
.card-wrapper.focused,
.card-wrapper.nostalgic,
.card-wrapper.hype,
.card-wrapper.romantic,
.card-wrapper.stressed,
.card-wrapper.cozy,
.card-wrapper.chill,
.card-wrapper.mixed,
.card-wrapper.pumped {
  border-color: rgba(126, 244, 215, 0.4);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.vibe-banner {
  font-size: clamp(1.12rem, 1.85vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.mini-pill {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-low);
}

.hello-user {
  margin: 0.3rem 0 0;
  max-width: 42rem;
  font-size: clamp(0.86rem, 1.1vw, 0.98rem);
  line-height: 1.45;
  color: rgba(232, 238, 245, 0.88);
  font-weight: 500;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.generate-flow-chrome {
  flex-shrink: 0;
  margin-top: 0.55rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.generate-flow-chrome--busy .generate-flow-eyebrow {
  color: var(--accent-warm-soft);
}

.generate-flow-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.generate-flow-eyebrow {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(186, 198, 214, 0.72);
}

.generate-flow-title {
  margin: 0.18rem 0 0;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-high);
  line-height: 1.2;
}

.generate-flow-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.generate-flow-fill {
  height: 100%;
  width: 33.333%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-warm-soft), var(--accent));
  transition: width 360ms cubic-bezier(0.16, 1, 0.3, 1);
}

.step-form-title {
  margin: 0 0 0.28rem;
  font-size: clamp(1.12rem, 2.2vw, 1.38rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.step-form-lead {
  margin: 0 0 0.45rem;
  max-width: 48ch;
  font-size: 0.82rem;
  line-height: 1.42;
  color: var(--text-mid);
}

.field-label {
  display: block;
  margin: 0.55rem 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-low);
}

.field-hint {
  margin: 0.42rem 0 0.28rem;
  font-size: 0.76rem;
  color: var(--text-low);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 0.45rem;
}

.form-actions--end {
  justify-content: flex-end;
}

.btn-next-primary {
  min-width: 9rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.62rem 1.15rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #06100e;
  cursor: pointer;
  background: linear-gradient(145deg, var(--accent), #5de6c5);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-next-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(126, 244, 215, 0.18);
}

.btn-next-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.btn-next-primary:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-back-quiet {
  min-height: 48px;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-mid);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease, background 200ms ease, transform 200ms ease;
}

.btn-back-quiet:hover {
  color: var(--text-high);
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.07);
}

.btn-back-quiet:active {
  transform: scale(0.98);
}

.card-header-row,
.card-wrapper > .hello-user,
.card-wrapper > .generate-flow-chrome {
  flex-shrink: 0;
}

.content-wrapper {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0.55rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14.5rem, 17rem);
  gap: 0.75rem 1.1rem;
  align-items: stretch;
}

.left-panel {
  border-radius: 16px;
  border: 1px solid var(--stroke-soft);
  background: var(--bg-panel);
  padding: 0.75rem 0.9rem 0.85rem;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) rgba(255, 255, 255, 0.04);
  -webkit-overflow-scrolling: touch;
}

/* Step body: fill panel height so primary actions sit on the bottom rail */
.left-panel:not(:has(.generate-loading)) {
  display: flex;
  flex-direction: column;
}

.left-panel:not(:has(.generate-loading)) #step-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.left-panel:not(:has(.generate-loading)) #step-content > .form-actions {
  margin-top: auto;
  padding-top: 0.35rem;
}

/* Step 3: let the genre list use extra height so Back / Generate stay on the bottom rail */
.left-panel:not(:has(.generate-loading)) #step-content > .genre-scroll {
  flex: 1 1 auto;
  min-height: 5rem;
  max-height: none;
  overflow-y: auto;
}

.left-panel::-webkit-scrollbar {
  width: 6px;
}

.left-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

/* Loading step: one surface with the panel, not a nested promo card */
.left-panel:has(.generate-loading) {
  padding: 0;
  border: none;
  background: transparent;
}

.right-panel {
  display: flex;
  align-items: flex-start;
  justify-content: stretch;
  min-height: 0;
  max-width: 100%;
  overflow: visible;
}

@media (min-width: 981px) {
  .right-panel {
    position: sticky;
    top: 0;
    align-self: start;
    max-height: calc(100dvh - 9rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
}

.preview-card {
  flex: 0 0 auto;
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--stroke-soft);
  border-left: 3px solid rgba(126, 244, 215, 0.45);
  background: linear-gradient(165deg, rgba(28, 26, 44, 0.98), rgba(18, 16, 32, 0.99));
  padding: 0.65rem 0.8rem 0.75rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-pill,
.preview-chip {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-mid);
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
}

.preview-kicker {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(186, 220, 210, 0.92);
  line-height: 1.35;
}

.preview-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(126, 244, 215, 0.6);
}

.preview-title {
  margin: 0.28rem 0 0.32rem;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.28;
  color: rgba(248, 250, 252, 0.96);
}

.preview-sub {
  margin: 0;
  color: rgba(186, 198, 214, 0.88);
  font-size: 0.75rem;
  line-height: 1.45;
}

.preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
  min-height: 1.35rem;
  align-content: flex-start;
}

.preview-tags:empty {
  display: none;
}

.preview-description {
  margin: 0.45rem 0 0;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(186, 198, 214, 0.9);
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-line;
}

.emoji-grid,
.suggestions,
.genre-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.emoji-btn,
.suggestion-btn,
.genre-btn {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-high);
  transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.emoji-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(44px, 9vw, 52px);
  height: clamp(44px, 9vw, 52px);
  font-size: clamp(1.2rem, 3.2vw, 1.45rem);
}

@media (min-width: 640px) {
  .emoji-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.35rem;
    max-width: min(100%, 17.5rem);
  }

  .emoji-grid .emoji-btn {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.05rem, 2.1vw, 1.28rem);
  }
}

.emoji-btn.selected,
.genre-btn.active {
  border-color: rgba(126, 244, 215, 0.48);
  background: rgba(126, 244, 215, 0.16);
  box-shadow: 0 10px 20px rgba(3, 7, 14, 0.35);
}

.suggestion-btn,
.genre-btn {
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.58rem 1.12rem;
}

.mood-quick.selected {
  border-color: rgba(126, 244, 215, 0.55);
  background: rgba(126, 244, 215, 0.18);
}

.genre-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.preset-btn {
  border-radius: 12px;
  border: 1px solid rgba(255, 182, 120, 0.35);
  background: rgba(255, 140, 80, 0.08);
  color: var(--text-high);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease, transform 200ms ease;
}

.preset-btn:hover {
  border-color: rgba(255, 182, 120, 0.55);
  background: rgba(255, 140, 80, 0.12);
  transform: translateY(-1px);
}

.preset-btn:active {
  transform: scale(0.98);
}

.preset-btn.preset-active {
  border-color: rgba(126, 244, 215, 0.55);
  background: rgba(126, 244, 215, 0.14);
  color: var(--text-high);
}

.genre-scroll {
  max-height: min(220px, 26vh);
  overflow-y: auto;
  padding-right: 0.35rem;
  margin-top: 0.35rem;
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.04);
}

.genre-scroll::-webkit-scrollbar {
  width: 6px;
}

.genre-scroll::-webkit-scrollbar-track {
  margin: 3px 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.genre-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  background-color: rgba(255, 255, 255, 0.16);
}

.genre-scroll::-webkit-scrollbar-thumb:hover {
  background-color: rgba(126, 244, 215, 0.32);
}

.emoji-btn:hover,
.suggestion-btn:hover,
.genre-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(126, 168, 255, 0.58);
}

.input-field {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-high);
  padding: 0.62rem 0.8rem;
  margin-top: 0.28rem;
  font-size: 0.9rem;
}

.input-field:focus {
  outline: none;
  border-color: rgba(126, 244, 215, 0.48);
  box-shadow: 0 0 0 3px rgba(126, 244, 215, 0.12);
}

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

.error-message {
  margin-top: 0.7rem;
  color: #ffa2b8;
  font-size: 0.9rem;
  display: none;
}

/* --- Final step: generating playlist (refined / editorial) --- */
.generate-loading {
  --gl-pad-x: clamp(1.15rem, 2.5vw, 1.65rem);
  position: relative;
  border-radius: 22px;
  padding: clamp(1.35rem, 3vw, 1.85rem) var(--gl-pad-x) clamp(1.5rem, 3vw, 2rem);
  overflow: hidden;
  text-align: left;
  border: 1px solid var(--stroke-soft);
  background:
    radial-gradient(ellipse 95% 70% at 0% 0%, rgba(126, 244, 215, 0.07), transparent 52%),
    radial-gradient(ellipse 70% 55% at 100% 0%, rgba(184, 148, 255, 0.06), transparent 48%),
    linear-gradient(168deg, rgba(24, 20, 40, 0.97), rgba(16, 14, 30, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
}

.generate-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.038;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.generate-loading::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 22px 0 0 22px;
  background: linear-gradient(180deg, rgba(126, 244, 215, 0.55), rgba(184, 148, 255, 0.35), rgba(255, 110, 180, 0.25));
  opacity: 0.85;
  pointer-events: none;
}

.generate-loading-inner {
  position: relative;
  z-index: 1;
  max-width: 36rem;
  padding-left: 0.35rem;
}

.generate-loading-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.65rem 1rem;
  margin-bottom: 0.5rem;
}

.generate-loading-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-low);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

.generate-loading-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.85;
  box-shadow: 0 0 0 1px rgba(126, 244, 215, 0.35);
  animation: generateLoadingPulse 2s ease-in-out infinite;
}

@keyframes generateLoadingPulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

.generate-loading-title {
  margin: 0;
  flex: 1 1 12rem;
  min-width: 0;
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--text-high);
  text-wrap: balance;
}

.generate-loading-lead {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.62;
  color: var(--text-mid);
  max-width: 44ch;
}

.generate-loading-recap {
  margin-top: 1.15rem;
  padding: 0.75rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
}

.generate-loading-recap-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-low);
  margin-bottom: 0.35rem;
}

.generate-loading-recap-text {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-mid);
}

.generate-loading-visual {
  margin: 1.5rem 0 1.25rem;
}

.generate-loading-spectrum {
  position: relative;
  padding: 0.65rem 0 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.generate-loading-spectrum::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.06) 20%,
    rgba(126, 244, 215, 0.12) 50%,
    rgba(255, 255, 255, 0.06) 80%,
    transparent
  );
  transform: translateY(-50%);
  pointer-events: none;
}

.eq-bars {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 3px;
  height: 40px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.eq-bar {
  flex: 0 0 2px;
  width: 2px;
  height: 100%;
  max-height: 36px;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    rgba(248, 244, 255, 0.22) 0%,
    rgba(138, 122, 160, 0.42) 38%,
    rgba(126, 244, 215, 0.28) 100%
  );
  transform-origin: bottom center;
  opacity: 0.88;
  animation: eqBarDrift 1.35s ease-in-out infinite;
  animation-delay: calc(var(--eq-i, 0) * 0.045s);
}

@keyframes eqBarDrift {
  0%,
  100% {
    transform: scaleY(0.42);
    opacity: 0.55;
  }
  50% {
    transform: scaleY(0.92);
    opacity: 0.95;
  }
}

.generate-loading-track {
  position: relative;
  width: 100%;
  max-width: 22rem;
  height: 5px;
  margin: 0;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
}

.generate-loading-track::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  left: -38%;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.35;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  animation: generateLoadingShimmer 2.75s ease-in-out infinite;
  mix-blend-mode: soft-light;
}

@keyframes generateLoadingShimmer {
  0% {
    left: -38%;
  }
  100% {
    left: 100%;
  }
}

.generate-loading-fill {
  position: relative;
  z-index: 1;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(248, 244, 255, 0.88) 0%, rgba(200, 184, 230, 0.95) 32%, rgba(126, 244, 215, 0.92) 100%);
  box-shadow: 0 0 14px rgba(126, 244, 215, 0.18);
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.generate-loading-status {
  margin: 1rem 0 0;
  min-height: 1.4em;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-low);
  font-variant-numeric: tabular-nums;
}

@media (min-width: 640px) {
  .generate-loading-inner {
    padding-left: 0.5rem;
  }
}

/* Legacy class names kept for any other pages / reduced-motion hooks */
.loading-container {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
}

.progress-wrap {
  width: min(420px, 100%);
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #5de6c5);
  transition: width 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.status-text {
  color: var(--text-mid);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--accent);
  border-radius: 999px;
  display: inline-block;
  animation: spin 0.9s linear infinite;
}

.waveform {
  display: flex;
  gap: 0.3rem;
}

.wave-bar {
  width: 6px;
  height: 20px;
  border-radius: 8px;
  background: rgba(126, 244, 215, 0.55);
  animation: wave 0.8s ease-in-out infinite;
}

.wave-bar:nth-child(2) {
  animation-delay: 0.14s;
}

.wave-bar:nth-child(3) {
  animation-delay: 0.28s;
}

.wave-bar:nth-child(4) {
  animation-delay: 0.42s;
}

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

@keyframes wave {
  0%,
  100% {
    transform: scaleY(0.55);
  }
  50% {
    transform: scaleY(1.15);
  }
}

@media (max-width: 1024px) {
  .content-wrapper {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .right-panel {
    order: -1;
    position: static;
    max-height: none;
    overflow: visible;
  }

  .preview-card {
    border-left-width: 1px;
    border-left-color: var(--stroke-soft);
    border-top: 3px solid rgba(126, 244, 215, 0.38);
  }
}

@media (max-width: 640px) {
  .generate-page {
    --gen-pad-top: clamp(4.35rem, 7vw + 2.75rem, 5.65rem);
    --gen-pad-bottom: 0.35rem;
    padding: var(--gen-pad-top) clamp(0.45rem, 2vw, 0.75rem) var(--gen-pad-bottom);
  }

  .card-wrapper {
    padding: 0.85rem 0.65rem 0.95rem;
    border-radius: 18px;
    min-height: calc(100dvh - var(--gen-pad-top) - var(--gen-pad-bottom) - 2.5rem);
  }

  .hello-user {
    -webkit-line-clamp: 3;
  }

  .content-wrapper {
    gap: 1.35rem;
  }

  .left-panel {
    padding: 0.85rem 0.75rem 0.95rem;
  }

  .suggestion-btn,
  .genre-btn {
    padding: 0.62rem 1.05rem;
    font-size: 0.94rem;
  }

  .emoji-btn {
    width: clamp(48px, 11vw, 56px);
    height: clamp(48px, 11vw, 56px);
    font-size: clamp(1.25rem, 3.6vw, 1.55rem);
  }

  .step-form-title {
    font-size: clamp(1.18rem, 4.2vw, 1.42rem);
  }

  .step-form-lead {
    font-size: 0.86rem;
    margin-bottom: 0.55rem;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .form-actions--end {
    flex-direction: column;
  }

  .btn-next-primary {
    width: 100%;
    min-width: 0;
    padding: 0.72rem 1.2rem;
    min-height: 3rem;
  }

  .preview-card {
    padding: 0.75rem 0.85rem 0.9rem;
  }

  .preview-sub {
    font-size: 0.8rem;
  }
}
