:root {
  color-scheme: dark;
  --bg-top: #0a0811;
  --bg-bottom: #121a29;
  --panel: rgba(12, 18, 30, 0.84);
  --panel-strong: rgba(16, 23, 38, 0.96);
  --panel-inner: rgba(255, 255, 255, 0.035);
  --border: rgba(122, 184, 255, 0.12);
  --border-strong: rgba(122, 184, 255, 0.3);
  --text: #f2f8ff;
  --muted: #9fb1c9;
  --accent: #39c5ff;
  --accent-soft: #6a8dff;
  --accent-3: #f4efe1;
  --accent-pale: rgba(57, 197, 255, 0.12);
  --accent-warm: #ffbb7a;
  --accent-warm-pale: rgba(255, 187, 122, 0.1);
  --line: rgba(220, 232, 228, 0.12);
  --line-strong: rgba(160, 231, 211, 0.42);
  --hero-tint-a: rgba(57, 197, 255, 0.18);
  --hero-tint-b: rgba(255, 187, 122, 0.12);
  --hero-orb-a: rgba(40, 195, 255, 0.18);
  --hero-orb-b: rgba(73, 117, 255, 0.12);
  --mode-signal-bg: linear-gradient(135deg, rgba(57, 197, 255, 0.18), rgba(255, 187, 122, 0.1));
  --mode-signal-dot: #39c5ff;
  --mode-signal-shadow: rgba(57, 197, 255, 0.7);
  --mode-tab-active: linear-gradient(135deg, rgba(57, 197, 255, 0.24), rgba(255, 187, 122, 0.08));
  --mode-pill-border: rgba(102, 214, 255, 0.24);
  --scenario-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.038), rgba(255, 255, 255, 0.014));
  --scenario-surface-strong: linear-gradient(135deg, rgba(57, 197, 255, 0.1), rgba(255, 187, 122, 0.04));
  --scenario-card-border: rgba(102, 214, 255, 0.14);
  --scenario-card-shadow: rgba(40, 195, 255, 0.08);
  --scenario-input-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.01));
  --scenario-input-border: rgba(102, 214, 255, 0.16);
  --scenario-focus-ring: rgba(40, 195, 255, 0.12);
  --scenario-soft-text: rgba(220, 236, 255, 0.82);
  --danger: #ff8a8a;
  --success: #7ce8b4;
  --radius-xl: 34px;
  --radius-lg: 28px;
  --radius-md: 20px;
  --shadow-xl: 0 34px 100px rgba(0, 0, 0, 0.48);
  --shadow-card: 0 20px 56px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Manrope", "Inter", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 187, 122, 0.14), transparent 22%),
    radial-gradient(circle at 85% 10%, rgba(57, 197, 255, 0.16), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(88, 101, 255, 0.1), transparent 28%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  overflow-x: hidden;
}

body[data-scenario="GPT_LYRICS"] {
  --hero-tint-a: rgba(64, 190, 255, 0.32);
  --hero-tint-b: rgba(108, 123, 255, 0.2);
  --hero-orb-a: rgba(41, 200, 255, 0.34);
  --hero-orb-b: rgba(90, 107, 255, 0.22);
  --mode-signal-bg: linear-gradient(135deg, rgba(79, 214, 255, 0.28), rgba(110, 126, 255, 0.18));
  --mode-signal-dot: #62d8ff;
  --mode-signal-shadow: rgba(98, 216, 255, 0.72);
  --mode-tab-active: linear-gradient(135deg, rgba(64, 190, 255, 0.32), rgba(120, 128, 255, 0.16));
  --mode-pill-border: rgba(102, 214, 255, 0.28);
  --scenario-surface: linear-gradient(180deg, rgba(84, 208, 255, 0.078), rgba(255, 255, 255, 0.014));
  --scenario-surface-strong: linear-gradient(135deg, rgba(81, 213, 255, 0.13), rgba(113, 122, 255, 0.07));
  --scenario-card-border: rgba(108, 212, 255, 0.18);
  --scenario-card-shadow: rgba(67, 198, 255, 0.12);
  --scenario-input-bg: linear-gradient(180deg, rgba(85, 202, 255, 0.055), rgba(255, 255, 255, 0.01));
  --scenario-input-border: rgba(104, 214, 255, 0.18);
  --scenario-focus-ring: rgba(97, 210, 255, 0.14);
  --scenario-soft-text: rgba(221, 242, 255, 0.84);
}

body[data-scenario="READY_POEM"] {
  --hero-tint-a: rgba(77, 232, 196, 0.3);
  --hero-tint-b: rgba(255, 179, 102, 0.22);
  --hero-orb-a: rgba(66, 227, 184, 0.28);
  --hero-orb-b: rgba(255, 156, 88, 0.22);
  --mode-signal-bg: linear-gradient(135deg, rgba(67, 233, 190, 0.24), rgba(255, 182, 98, 0.18));
  --mode-signal-dot: #57efcb;
  --mode-signal-shadow: rgba(87, 239, 203, 0.72);
  --mode-tab-active: linear-gradient(135deg, rgba(71, 233, 193, 0.26), rgba(255, 185, 110, 0.18));
  --mode-pill-border: rgba(95, 239, 207, 0.28);
  --scenario-surface: linear-gradient(180deg, rgba(74, 235, 194, 0.07), rgba(255, 188, 114, 0.028));
  --scenario-surface-strong: linear-gradient(135deg, rgba(72, 236, 196, 0.12), rgba(255, 188, 110, 0.07));
  --scenario-card-border: rgba(95, 239, 207, 0.18);
  --scenario-card-shadow: rgba(74, 232, 193, 0.1);
  --scenario-input-bg: linear-gradient(180deg, rgba(72, 236, 196, 0.048), rgba(255, 190, 112, 0.012));
  --scenario-input-border: rgba(95, 239, 207, 0.18);
  --scenario-focus-ring: rgba(95, 239, 207, 0.14);
  --scenario-soft-text: rgba(228, 244, 238, 0.84);
}

body[data-scenario="SUNO_LYRICS"] {
  --hero-tint-a: rgba(121, 139, 255, 0.32);
  --hero-tint-b: rgba(62, 217, 255, 0.2);
  --hero-orb-a: rgba(104, 125, 255, 0.3);
  --hero-orb-b: rgba(44, 213, 255, 0.2);
  --mode-signal-bg: linear-gradient(135deg, rgba(121, 139, 255, 0.26), rgba(62, 217, 255, 0.18));
  --mode-signal-dot: #84a6ff;
  --mode-signal-shadow: rgba(132, 166, 255, 0.72);
  --mode-tab-active: linear-gradient(135deg, rgba(121, 139, 255, 0.28), rgba(62, 217, 255, 0.16));
  --mode-pill-border: rgba(124, 162, 255, 0.28);
  --scenario-surface: linear-gradient(180deg, rgba(122, 145, 255, 0.075), rgba(74, 221, 255, 0.02));
  --scenario-surface-strong: linear-gradient(135deg, rgba(122, 145, 255, 0.125), rgba(72, 218, 255, 0.07));
  --scenario-card-border: rgba(124, 162, 255, 0.2);
  --scenario-card-shadow: rgba(103, 136, 255, 0.1);
  --scenario-input-bg: linear-gradient(180deg, rgba(124, 162, 255, 0.048), rgba(72, 218, 255, 0.012));
  --scenario-input-border: rgba(124, 162, 255, 0.18);
  --scenario-focus-ring: rgba(124, 162, 255, 0.14);
  --scenario-soft-text: rgba(227, 236, 255, 0.84);
}

body[data-scenario="INSTRUMENTAL"] {
  --hero-tint-a: rgba(255, 172, 92, 0.3);
  --hero-tint-b: rgba(214, 128, 88, 0.2);
  --hero-orb-a: rgba(255, 171, 92, 0.24);
  --hero-orb-b: rgba(220, 122, 76, 0.18);
  --mode-signal-bg: linear-gradient(135deg, rgba(255, 184, 102, 0.26), rgba(227, 134, 84, 0.18));
  --mode-signal-dot: #ffcb8c;
  --mode-signal-shadow: rgba(255, 203, 140, 0.72);
  --mode-tab-active: linear-gradient(135deg, rgba(255, 176, 104, 0.28), rgba(219, 136, 87, 0.16));
  --mode-pill-border: rgba(255, 187, 122, 0.28);
  --scenario-surface: linear-gradient(180deg, rgba(255, 184, 104, 0.07), rgba(225, 139, 86, 0.022));
  --scenario-surface-strong: linear-gradient(135deg, rgba(255, 189, 118, 0.12), rgba(224, 136, 88, 0.07));
  --scenario-card-border: rgba(255, 195, 128, 0.18);
  --scenario-card-shadow: rgba(255, 176, 104, 0.1);
  --scenario-input-bg: linear-gradient(180deg, rgba(255, 188, 118, 0.048), rgba(223, 140, 90, 0.012));
  --scenario-input-border: rgba(255, 194, 126, 0.18);
  --scenario-focus-ring: rgba(255, 190, 120, 0.14);
  --scenario-soft-text: rgba(255, 237, 223, 0.82);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  inset: auto;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.45;
  z-index: 0;
}

.ambient--left {
  top: -120px;
  left: -140px;
  background: rgba(255, 187, 122, 0.18);
}

.ambient--right {
  top: 260px;
  right: -180px;
  background: rgba(57, 197, 255, 0.15);
}

.page {
  position: relative;
  z-index: 1;
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 22px 18px 280px;
}

.card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(24px);
}

.card--inner {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.015)),
    var(--panel-inner);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.hero {
  padding: 24px 24px 22px;
  margin-bottom: 18px;
  background:
    linear-gradient(135deg, var(--hero-tint-a), var(--hero-tint-b)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    var(--panel);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 72% 22%, rgba(255, 255, 255, 0.08), transparent 24%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.03), transparent 36%);
  opacity: 0.7;
  pointer-events: none;
}

.hero__mark {
  position: absolute;
  top: 18px;
  right: -6px;
  width: 360px;
  height: 220px;
  border-radius: 0;
  border: 0;
  background:
    radial-gradient(circle at 48% 38%, rgba(57, 197, 255, 0.14), transparent 34%),
    url("/miniapp/static/logo-no-bg.png") center top / 84% auto no-repeat;
  box-shadow: none;
  opacity: 0.13;
  filter: saturate(1.04);
  pointer-events: none;
  mix-blend-mode: screen;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.94) 0%, rgba(0, 0, 0, 0.92) 56%, rgba(0, 0, 0, 0.08) 72%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.94) 0%, rgba(0, 0, 0, 0.92) 56%, rgba(0, 0, 0, 0.08) 72%, rgba(0, 0, 0, 0) 100%);
}

.hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(30px);
  pointer-events: none;
}

.hero__glow--one {
  width: 260px;
  height: 260px;
  top: -96px;
  right: -56px;
  background: var(--hero-orb-a);
}

.hero__glow--two {
  width: 210px;
  height: 210px;
  bottom: -78px;
  left: -48px;
  background: var(--hero-orb-b);
}

.hero__brand {
  position: relative;
  z-index: 1;
}

.hero__copy {
  max-width: min(100%, 620px);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #98dfff;
}

.hero__title {
  margin: 0;
  line-height: 0.96;
  letter-spacing: -0.035em;
  font-size: clamp(30px, 5vw, 46px);
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.hero__title-line {
  display: block;
}

.hero__brand-secondary {
  margin: 10px 0 0;
  color: rgba(220, 236, 255, 0.78);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.45;
}

.hero__subtitle {
  margin: 12px 0 0;
  color: rgba(228, 240, 255, 0.86);
  line-height: 1.62;
  font-size: 15.5px;
  max-width: none;
}

.hero__mode-chip {
  display: inline-flex;
  align-items: center;
  margin-top: 14px;
  padding: 9px 14px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(7, 14, 24, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #eef8ff;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hero__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

.hero__actions .tab-button {
  min-height: 70px;
  padding: 20px 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-weight: 800;
  font-size: 16px;
}

.hero__actions .tab-button.is-active {
  background: var(--mode-tab-active), rgba(255, 255, 255, 0.04);
  border-color: var(--mode-pill-border);
}

.top-tabs {
  position: sticky;
  top: calc(10px + env(safe-area-inset-top));
  z-index: 9;
  margin: 0 0 14px;
  padding: 8px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(9, 15, 26, 0.96), rgba(8, 14, 24, 0.92)),
    rgba(7, 12, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.top-tabs__inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.top-tabs .tab-button {
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.top-tabs .tab-button.is-active {
  background: linear-gradient(135deg, rgba(57, 197, 255, 0.22), rgba(255, 187, 122, 0.08));
  border-color: var(--border-strong);
  box-shadow: 0 16px 36px rgba(57, 197, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.page--web .footer-bar {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: max(12px, env(safe-area-inset-bottom));
  width: min(calc(100vw - 32px), 1120px);
  padding: 0;
  background: none;
  backdrop-filter: none;
  transform: translateX(-50%);
  z-index: 12;
}

.page--web .footer-bar .footer-bar__inner {
  width: 100%;
  gap: 8px;
}

.page--web .footer-bar .scenario-dock {
  padding: 8px;
  gap: 6px;
}

.page--web .footer-bar .scenario-card {
  min-height: 70px;
  padding: 10px 8px 11px;
  border-radius: 20px;
}

.page--web .footer-bar .scenario-dock__icon {
  font-size: 16px;
}

.page--web .footer-bar .scenario-dock__label {
  font-size: 11px;
}

.page--web .footer-bar .footer-bar__meta {
  margin-top: -2px;
}

.page--web .footer-bar .footer-bar__legal {
  font-size: 10px;
}

.page--web .footer-bar .primary-button,
.page--web .footer-bar .secondary-button {
  min-height: 54px;
  padding: 14px 18px;
}

.hero__signal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 11px 15px;
  border-radius: 999px;
  background: var(--mode-signal-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: #dbf5ff;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  width: fit-content;
}

.hero__signal-action {
  min-height: 34px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
}

.hero__signal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mode-signal-dot);
  box-shadow: 0 0 18px var(--mode-signal-shadow);
}

.notice,
.auth-gate,
.section,
.view-header,
.result-panel,
.track-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.016)),
    var(--panel);
  box-shadow: var(--shadow-card);
}

.notice {
  margin-bottom: 14px;
  padding: 14px 16px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 600;
}

.notice.is-error {
  color: #ffd2d2;
  border-color: rgba(255, 107, 107, 0.4);
}

.notice.is-success {
  color: #f3fff8;
  border-color: rgba(126, 224, 161, 0.5);
  background:
    linear-gradient(135deg, rgba(24, 112, 87, 0.38), rgba(9, 23, 29, 0.92)),
    var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 16px 36px rgba(4, 16, 20, 0.22);
}

.auth-gate {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
  padding: 24px;
  border-color: rgba(214, 168, 95, 0.22);
  background:
    linear-gradient(135deg, rgba(57, 197, 255, 0.08), rgba(255, 187, 122, 0.08)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    var(--panel);
}

.auth-gate__widget {
  min-height: 56px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px dashed rgba(57, 197, 255, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01));
}

.auth-gate .primary-button,
.auth-gate .secondary-button {
  width: 100%;
}

.auth-gate__copy h2 {
  margin: 0;
  font-size: clamp(24px, 4vw, 30px);
  line-height: 1.08;
}

.auth-gate__lead,
.auth-gate__note,
.auth-gate__hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-gate__hint {
  font-size: 14px;
}

.auth-gate__email,
.auth-gate__code,
.auth-gate__fallback {
  display: grid;
  gap: 14px;
}

.auth-gate__code,
.auth-gate__fallback {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.012)),
    rgba(10, 17, 28, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.auth-gate__fallback {
  border-style: dashed;
  border-color: rgba(110, 202, 255, 0.22);
  background:
    linear-gradient(135deg, rgba(57, 197, 255, 0.05), rgba(255, 187, 122, 0.04)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01)),
    rgba(9, 15, 26, 0.5);
}

.auth-gate__fallback-title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(214, 231, 255, 0.78);
}

.auth-gate__actions {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-gate__actions--code {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

.auth-gate__actions--fallback {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.auth-gate__link {
  color: var(--accent);
  font-weight: 800;
  width: fit-content;
  text-decoration: none;
}

.auth-gate__link:hover,
.auth-gate__link:focus-visible {
  color: #8fdcff;
  text-decoration: underline;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
  padding: 10px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(9, 15, 26, 0.96), rgba(8, 14, 24, 0.92)),
    var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
}

.mode-story {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 16px 18px;
  background:
    linear-gradient(135deg, rgba(57, 197, 255, 0.08), rgba(255, 187, 122, 0.07)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
    rgba(12, 18, 30, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.mode-story__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.mode-story__head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
}

.mode-story__copy {
  margin: 0;
  color: rgba(228, 240, 255, 0.84);
  line-height: 1.58;
}

.mode-story__chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--mode-pill-border);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  color: #eef8ff;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.mode-tab {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 18px;
  font-weight: 800;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.03);
}

.mode-tab.is-active {
  background: var(--mode-tab-active);
  border-color: var(--mode-pill-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 14px 28px rgba(0, 0, 0, 0.18);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.section {
  padding: 24px;
}

.section__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section__header h2,
.view-header h2 {
  margin: 0;
  color: var(--accent-3);
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.06;
}

.section__pill {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--mode-pill-border);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  color: #eef8ff;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section__copy {
  margin: 0 0 18px;
  color: var(--scenario-soft-text);
  line-height: 1.6;
}

.template-strip {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.014)),
    rgba(255, 255, 255, 0.018);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 12px 30px rgba(0, 0, 0, 0.14);
}

.template-strip__header {
  display: grid;
  gap: 5px;
}

.template-strip__header strong {
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
  color: var(--scenario-soft-text);
}

.template-strip__header p,
.field-group__header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  max-width: none;
}

.grid {
  display: grid;
  gap: 14px;
}

.field-group {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.01)),
    var(--scenario-surface);
  border: 1px solid var(--scenario-card-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.025),
    0 14px 34px var(--scenario-card-shadow);
}

.field-group__header {
  margin-bottom: 14px;
}

.field-group__header h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 14px;
  color: #dff0ff;
}

.field input,
.field select,
.field textarea,
.lyrics-editor {
  width: 100%;
  padding: 16px 17px;
  border-radius: 18px;
  border: 1px solid var(--scenario-input-border);
  background:
    var(--scenario-input-bg),
    rgba(8, 13, 23, 0.78);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  scroll-margin-top: 180px;
  scroll-margin-bottom: 210px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #7590a8;
}

.field textarea,
.lyrics-editor {
  min-height: 120px;
  resize: vertical;
  line-height: 1.48;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.lyrics-editor:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px var(--scenario-focus-ring);
}

.inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
}

.chip,
.template-chip,
.tab-button,
.primary-button,
.secondary-button,
.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.04);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.chip {
  position: relative;
  padding: 12px 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.chip:hover,
.template-chip:hover,
.tab-button:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.chip:active,
.template-chip:active,
.tab-button:active,
.primary-button:active,
.secondary-button:active,
.ghost-button:active {
  transform: translateY(1px) scale(0.99);
}

.chip.is-active,
.template-chip.is-active {
  background: var(--mode-tab-active);
  border-color: color-mix(in srgb, var(--mode-pill-border) 88%, white 12%);
  box-shadow: 0 12px 28px var(--scenario-card-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.chip.is-active {
  padding-right: 36px;
}

.chip.is-active::after,
.template-chip.is-active::after {
  content: "✓";
  position: absolute;
  top: 50%;
  right: 12px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border-radius: 50%;
  background: linear-gradient(135deg, #f4fbff, #d6f1ff);
  color: #06111f;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(57, 197, 255, 0.18);
}

.chips--compact {
  gap: 8px;
}

.template-chip {
  position: relative;
  font-size: 14px;
  padding: 12px 16px;
}

.template-chip.is-active {
  padding-right: 34px;
}

.sound-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
    rgba(7, 12, 21, 0.4);
}

.sound-panel__summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.sound-panel__summary strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.sound-panel__summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.sound-panel__controls {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.sound-panel__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.sound-panel__badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(57, 197, 255, 0.14), rgba(255, 187, 122, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #eef8ff;
  font-size: 12px;
}

.sound-panel__toggle {
  min-height: 40px;
}

.sound-panel__body {
  display: grid;
  gap: 14px;
}

.muted {
  margin: 0;
  color: var(--muted);
}

.form-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 42px;
  padding: 0 14px;
  font-weight: 800;
}

.primary-button {
  border-color: rgba(214, 168, 95, 0.6);
  background: linear-gradient(135deg, #f1d087, #9ee7d4);
  color: #101512;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22);
}

.secondary-button {
  border-color: rgba(158, 231, 212, 0.32);
}

.ghost-button {
  background: transparent;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.result-panel {
  margin-top: 18px;
  padding: 16px;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.lyrics-editor {
  min-height: 280px;
  margin-bottom: 12px;
}

.storage-note {
  margin: -6px 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 187, 122, 0.18);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 187, 122, 0.105), rgba(57, 197, 255, 0.045));
  color: rgba(245, 251, 255, 0.86);
  font-size: 14px;
  line-height: 1.45;
}

.storage-note span {
  display: inline-block;
  margin: 0 2px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 90, 90, 0.16);
  color: #ff6b6b;
  font-weight: 900;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px 20px;
}

.tracks-list {
  display: grid;
  gap: 12px;
}

.track-card {
  padding: 14px;
}

.track-card__top {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.cover {
  width: 74px;
  height: 74px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  object-fit: cover;
  background: #101820;
}

.cover--empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
}

.track-title {
  margin: 0 0 4px;
  font-size: 17px;
}

.track-meta {
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.track-meta__subtitle {
  color: #b8c7d9;
  font-size: 14px;
}

.track-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(147, 172, 203, 0.26);
  background: rgba(134, 154, 182, 0.12);
  color: #eef6ff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.track-status-badge.is-live {
  border-color: rgba(115, 237, 197, 0.52);
  background:
    linear-gradient(135deg, rgba(36, 163, 124, 0.34), rgba(9, 25, 31, 0.9)),
    rgba(18, 40, 45, 0.9);
  color: #f4fffb;
  box-shadow:
    0 0 0 1px rgba(98, 240, 183, 0.08),
    0 10px 24px rgba(8, 26, 24, 0.22);
}

.track-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.track-actions button {
  min-height: 34px;
}

audio {
  width: 100%;
  margin-top: 10px;
}

@media (max-width: 860px) {
  .page {
    width: 100%;
    padding: 16px 14px 250px;
  }

  .hero__actions {
    grid-template-columns: 1fr;
  }

  .auth-gate__actions,
  .mode-tabs,
  .inline-grid {
    grid-template-columns: 1fr;
  }

  .mode-story__head {
    flex-direction: column;
  }

  .section__header,
  .view-header,
  .result-header,
  .sound-panel__summary {
    align-items: stretch;
    flex-direction: column;
  }

  .sound-panel__controls {
    justify-items: start;
  }

  .sound-panel__badges {
    justify-content: flex-start;
  }

  .track-card__top {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .track-card__top > .ghost-button {
    grid-column: 1 / -1;
  }

  .cover {
    width: 58px;
    height: 58px;
  }
}

/* Web layout uses the miniapp window flow instead of the older inline actions. */
.mode-tabs {
  display: none;
}

#track-form > .form-actions,
#track-form > .result-panel {
  display: none !important;
}

#status-box {
  margin-top: 8px;
}

@media (max-width: 860px) {
  .top-tabs {
    top: calc(8px + env(safe-area-inset-top));
    margin-bottom: 12px;
    padding: 7px;
    border-radius: 18px;
  }

  .top-tabs__inner {
    gap: 8px;
  }

  .top-tabs .tab-button {
    min-height: 42px;
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 15px;
  }

  .auth-gate__actions {
    grid-template-columns: 1fr;
  }

  .page--web .footer-bar {
    width: calc(100vw - 20px);
    bottom: max(8px, env(safe-area-inset-bottom));
  }

  .page--web .footer-bar .scenario-dock {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page--web .footer-bar .scenario-card {
    min-height: 60px;
    padding: 9px 6px 10px;
  }
}
