﻿:root {
  --bg-0: #171038;
  --bg-1: #241753;
  --bg-2: #3b2266;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-border: rgba(255, 255, 255, 0.14);
  --txt-main: #f8e9ff;
  --txt-sub: #d6c2ed;
  --gold: #ffcf81;
  --btn-grad: linear-gradient(90deg, #d46cff, #ffc287);
  --hero-glow: linear-gradient(140deg, rgba(255, 188, 132, 0.3), rgba(255, 157, 226, 0));
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --shell-max: 430px;
  --shell-pad: 10px;
  --font-title: "SimSun", "Songti SC", "STSong", serif;
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(218, 204, 238, 0.26) rgba(13, 8, 31, 0.58);
  font-family: var(--font-body);
  color: var(--txt-main);
  background:
    radial-gradient(circle at 86% 8%, rgba(255, 179, 120, 0.2), transparent 24%),
    radial-gradient(circle at 15% 20%, rgba(211, 143, 255, 0.2), transparent 24%),
    linear-gradient(165deg, var(--bg-0), var(--bg-1) 45%, var(--bg-2));
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 7px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: rgba(13, 8, 31, 0.58);
  border-radius: 999px;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: rgba(218, 204, 238, 0.28);
  border: 2px solid rgba(13, 8, 31, 0.58);
  border-radius: 999px;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 220, 170, 0.38);
}

.template-song-list,
.works-card ul {
  scrollbar-width: thin;
  scrollbar-color: rgba(230, 218, 246, 0.22) rgba(20, 12, 43, 0.42);
}

.template-song-list::-webkit-scrollbar,
.works-card ul::-webkit-scrollbar {
  width: 5px;
}

.template-song-list::-webkit-scrollbar-track,
.works-card ul::-webkit-scrollbar-track {
  background: rgba(20, 12, 43, 0.42);
  border-radius: 999px;
}

.template-song-list::-webkit-scrollbar-thumb,
.works-card ul::-webkit-scrollbar-thumb {
  background: rgba(230, 218, 246, 0.24);
  border-radius: 999px;
}

.app-shell {
  width: 100%;
  max-width: min(var(--shell-max), 100vw);
  margin: 0 auto;
  padding: 8px var(--shell-pad) calc(70px + env(safe-area-inset-bottom));
}

.glass {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 34px rgba(9, 2, 27, 0.38);
}

.topbar {
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon img {
  width: 21px;
  height: 21px;
  filter: sepia(0.9) saturate(1.8) hue-rotate(345deg) brightness(1.2);
}

.brand-text {
  font-family: var(--font-title);
  font-size: 20px;
  letter-spacing: 0.5px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar-btn,
.menu-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  padding: 0;
}

.avatar-btn {
  border-radius: 999px;
  overflow: hidden;
}

.avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-btn img {
  width: 19px;
  height: 19px;
}

.main {
  margin-top: 0;
  display: grid;
  gap: 9px;
}

.hero {
  border-radius: var(--radius-xl);
  padding: 8px 14px 7px;
  aspect-ratio: 2.28 / 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  overflow: hidden;
  max-width: 100%;
  isolation: isolate;
  background:
    linear-gradient(90deg, rgba(23, 15, 58, 0.8) 0%, rgba(28, 17, 66, 0.58) 45%, rgba(39, 21, 75, 0.12) 72%, rgba(30, 16, 58, 0.02) 100%),
    image-set(url("./assets/images/hero-mic-banner-sm.jpg") 1x, url("./assets/images/hero-mic-banner-md.jpg") 2x),
    linear-gradient(100deg, rgba(27, 18, 61, 0.95), rgba(42, 24, 86, 0.72));
  background-size: cover, auto 100%, cover;
  background-position: center, right center, center;
  background-repeat: no-repeat;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 40%, rgba(255, 191, 138, 0.1), transparent 28%),
    linear-gradient(110deg, rgba(20, 13, 52, 0.3) 0%, rgba(27, 18, 61, 0.12) 48%, rgba(27, 18, 61, 0.02) 100%);
  z-index: 0;
  pointer-events: none;
}

.hero::after {
  content: none;
}

.hero-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  color: #fff6ff;
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-shadow: 0 0 14px rgba(255, 211, 252, 0.34);
}

.hero-logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.hero-logo img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(255, 209, 122, 0.55));
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: 60%;
  margin-top: 20px;
}

.hero-copy h1 {
  margin: 0;
  font-family: "SimSun", "Songti SC", "STSong", serif;
  font-size: 28px;
  font-style: italic;
  line-height: 1.06;
  letter-spacing: 0;
  color: #ffd1f4;
  text-shadow: 0 0 20px rgba(245, 162, 230, 0.45);
}

.hero-copy h1 span {
  display: block;
  white-space: nowrap;
}

.hero-copy p {
  margin: 14px 0 0;
  font-size: 14px;
  white-space: nowrap;
  letter-spacing: 0;
  color: var(--txt-sub);
}

.primary-btn {
  width: min(100%, 192px);
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: var(--btn-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-title);
  font-size: 19px;
  padding: 4px 18px;
  box-shadow: 0 10px 26px rgba(236, 130, 248, 0.34);
}

.primary-btn img {
  width: 18px;
  height: 18px;
}

.hero-art {
  display: none;
  position: absolute;
  z-index: 1;
  top: 45px;
  right: 4px;
  bottom: 5px;
  width: 47%;
  pointer-events: none;
}

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right center;
  opacity: 0.96;
  filter: saturate(1.06);
}

.panel {
  border-radius: var(--radius-xl);
  padding: 8px 10px;
  max-width: 100%;
  overflow: hidden;
}

.panel h2 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.h2-icon {
  width: 17px;
  height: 17px;
  object-fit: contain;
  opacity: 0.92;
}

.stage-symbol {
  border-radius: 4px;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.28));
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--txt-sub);
  font-size: 10px;
  padding: 2px 0;
}

.template-grid {
  margin-top: 8px;
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 2px;
  scroll-snap-type: none;
  scroll-behavior: auto;
  scrollbar-width: none;
  max-width: 100%;
}

.template-grid::-webkit-scrollbar {
  display: none;
}

.template-card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.14);
  position: relative;
  overflow: hidden;
  min-width: 0;
  flex: 0 0 calc((min(100vw, var(--shell-max)) - 58px) / 2.5);
  aspect-ratio: 1 / 1;
  height: auto;
  min-height: 0;
  padding: 8px;
}

.template-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
}

.template-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(43, 28, 72, 0.2), rgba(43, 28, 72, 0.46));
  z-index: 0;
}

.template-card.warm::before {
  background-image: url("./assets/images/template-musical-sm.jpg");
  background-image: image-set(url("./assets/images/template-musical-sm.jpg") 1x, url("./assets/images/template-musical-md.jpg") 2x);
}

.template-card.cool::before {
  background-image: url("./assets/images/template-english-sm.jpg");
  background-image: image-set(url("./assets/images/template-english-sm.jpg") 1x, url("./assets/images/template-english-md.jpg") 2x);
}

.template-card.rose::before {
  background-image: url("./assets/images/template-chinese-new-sm.jpg");
  background-image: image-set(url("./assets/images/template-chinese-new-sm.jpg") 1x, url("./assets/images/template-chinese-new-md.jpg") 2x);
}

.template-card.ai::before {
  background-image: url("./assets/images/template-ai-new-sm.jpg");
  background-image: image-set(url("./assets/images/template-ai-new-sm.jpg") 1x, url("./assets/images/template-ai-new-md.jpg") 2x);
}

.template-card.rose {
  padding: 8px 7px;
}

.template-card h3,
.template-card p,
.template-card ul {
  position: relative;
  z-index: 1;
}

.template-card h3 {
  min-width: 0;
  margin: 0 0 4px;
  font-family: var(--font-title);
  font-size: 14px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.template-card.rose h3 {
  margin-bottom: 5px;
}

.template-card p {
  display: none;
  margin: 6px 0 0;
  font-size: 10px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.play-clip-btn,
.mini-play-btn {
  border: 1px solid rgba(255, 255, 255, 0.56);
  background: rgba(255, 255, 255, 0.11);
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
}

.play-clip-btn {
  display: none;
  width: 32px;
  height: 32px;
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
}

.play-clip-btn img {
  width: 13px;
  height: 13px;
}

.template-card ul {
  min-width: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.template-card.rose ul {
  margin-top: 0;
}

.template-card li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  padding-bottom: 4px;
}

.template-card li:last-child {
  border-bottom: 0;
}

.singer-avatar {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(145deg, rgba(255, 215, 164, 0.65), rgba(165, 123, 236, 0.6));
}

.song-line {
  font-size: 9px;
  line-height: 1.2;
  display: block;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.template-song-list {
  max-height: calc(100% - 22px);
  overflow: hidden;
  padding-right: 2px;
}

.template-song-list .template-work-item {
  display: block;
  min-width: 0;
  grid-template-columns: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0 0 2px;
  overflow: hidden;
}

.template-song-list .template-work-item a,
.template-song-list .template-work-item.empty {
  display: block;
  width: 100%;
  color: #f9efff;
  font-size: 9.5px;
  line-height: 1.24;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.template-song-list .template-work-item a.latin-title {
  font-size: 10.5px;
}

.template-song-list .template-work-item a:hover {
  color: #ffe0a8;
}

.template-panel.is-expanded .template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: visible;
  scroll-snap-type: none;
}

.template-panel.is-expanded .template-card {
  flex-basis: auto;
  height: auto;
  min-height: 0;
  aspect-ratio: 1 / 1;
}

.template-panel.is-expanded .template-song-list {
  max-height: calc(100% - 28px);
  overflow: auto;
}

.mini-play-btn {
  width: 22px;
  height: 22px;
  z-index: 2;
}

.mini-play-btn img {
  width: 10px;
  height: 10px;
}

.works-meta {
  color: var(--txt-sub);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 400;
  margin-left: 6px;
  opacity: 0.86;
}

.works-panel {
  order: 10;
}

.works-panel:not(.is-expanded) .works-grid {
  display: none;
}

.works-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.works-card {
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  background: rgba(33, 20, 61, 0.45);
  padding: 8px;
}

.works-card h3 {
  margin: 0 0 6px;
  font-family: var(--font-title);
  font-size: 14px;
}

.works-card ul {
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
  max-height: 112px;
  overflow: auto;
}

.work-item a {
  min-width: 0;
  display: block;
  width: 100%;
  color: #f2e6ff;
  font-size: 10px;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.work-item a.latin-title {
  font-size: 11px;
}

.work-item a:hover {
  color: #ffd7a4;
  text-decoration: underline;
}

.work-item.empty {
  color: #b9a8d3;
  font-size: 10px;
}

.workbench {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr;
  align-items: start;
  gap: 8px;
  margin-top: 8px;
}

.dropzone {
  min-width: 0;
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
  cursor: pointer;
  color: #fff;
}

.dropzone input {
  display: none;
}

.drop-icon {
  width: 15px;
  height: 15px;
  margin: 0;
}

.drop-title {
  font-size: 13px;
  white-space: nowrap;
}

.drop-hint {
  display: none;
  color: var(--txt-sub);
}

.work-actions {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
}

.ghost-btn,
.token-input,
.synth-btn {
  min-width: 0;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 14px;
}

.ghost-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 3px 12px;
}

.synth-btn {
  background: linear-gradient(90deg, rgba(212, 108, 255, 0.9), rgba(255, 194, 135, 0.9));
  border-color: rgba(255, 230, 190, 0.58);
  color: #fff;
  font-family: var(--font-title);
  font-size: 14px;
  letter-spacing: 0.5px;
  box-shadow: 0 7px 20px rgba(214, 108, 255, 0.22);
}

.ghost-btn img {
  width: 15px;
  height: 15px;
}

.token-wrap {
  position: relative;
}

.token-input {
  width: 100%;
  padding: 0 36px 0 12px;
}

.token-wrap img {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  opacity: 0.85;
}

.meta-text {
  margin: 0;
  color: var(--txt-sub);
  font-size: 10px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-wrap {
  min-width: 0;
  margin-top: 0;
  min-height: 102px;
  padding: 0;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-rows: 30px 1fr 7px;
  align-content: start;
  gap: 6px;
}

.progress-title {
  display: none;
  margin-bottom: 8px;
  font-family: var(--font-title);
  font-size: 13px;
  color: #fff1ce;
}

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

.progress-wrap .synth-btn {
  width: 88%;
  justify-self: center;
}

.step {
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #c3b1de;
  font-size: 10px;
  min-width: 0;
  text-align: center;
}

.step span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.step em {
  color: #fff3c8;
  font-style: normal;
  font-family: var(--font-title);
  font-size: 12px;
  text-shadow: 0 0 9px rgba(255, 207, 129, 0.62);
}

.step img {
  width: 18px;
  height: 18px;
  opacity: 0.82;
}

.step.active {
  color: #ffe3af;
}

.step.active img {
  opacity: 1;
  filter: drop-shadow(0 0 7px rgba(255, 198, 126, 0.65));
}

.track {
  width: 88%;
  justify-self: center;
  height: 7px;
  margin-top: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.track-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ffcd7f, #ef8dff);
  transition: width 0.32s ease;
}

.stage-toolbar {
  display: flex;
  gap: 6px;
}

.gender-btn,
.play-mode-btn {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #e8d7ff;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.play-mode-btn {
  padding-inline: 8px;
  font-size: 11px;
}

.gender-btn.active,
.play-mode-btn.active {
  border-color: rgba(255, 208, 140, 0.78);
  color: #fff0cf;
  background: linear-gradient(120deg, rgba(219, 123, 255, 0.4), rgba(255, 187, 124, 0.36));
  box-shadow: 0 0 16px rgba(255, 189, 126, 0.28);
}

.preview {
  margin-top: 10px;
}

.preview:fullscreen {
  width: 100vw;
  min-height: 100vh;
  padding: 18px;
  background: #130c2f;
  display: grid;
  align-content: center;
}

.preview:fullscreen .preview-cover {
  min-height: 72vh;
}

.preview-cover {
  border-radius: var(--radius-lg);
  min-height: 176px;
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.preview-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(90deg, rgba(20, 14, 37, 0.48), rgba(20, 14, 37, 0.15));
  pointer-events: none;
}

.stage-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.8s ease;
  background: linear-gradient(120deg, rgba(20, 11, 43, 0.9), rgba(45, 25, 80, 0.72));
}

.stage-slide.is-visible {
  opacity: 1;
}

.preview-text {
  position: relative;
  z-index: 3;
}

.preview-text h3 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 22px;
}

.preview-text p {
  margin: 8px 0 0;
  color: #f4daf6;
}

.player {
  margin-top: 9px;
  display: grid;
  grid-template-columns: 36px auto 1fr auto auto auto;
  grid-template-rows: auto auto;
  gap: 8px;
  align-items: center;
}

.play-main-btn,
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  padding: 0;
  position: relative;
}

.play-main-btn img,
.icon-btn img {
  width: 14px;
  height: 14px;
}

.icon-btn.is-muted::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #ffd08a;
  transform: rotate(-42deg);
  box-shadow: 0 0 8px rgba(255, 208, 138, 0.72);
}

#seekBar {
  grid-column: 3;
  grid-row: 2;
  width: 100%;
  accent-color: #ffc67b;
}

#currentTime,
#duration {
  font-size: 12px;
}

.result-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action-btn {
  border: 0;
  border-radius: 999px;
  min-height: 30px;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-title);
  font-size: 14px;
  letter-spacing: 0.5px;
  padding: 4px 12px;
}

.action-btn img {
  width: 16px;
  height: 16px;
}

.download-icon {
  transform: rotate(180deg);
}

.action-btn.secondary {
  background: linear-gradient(120deg, rgba(211, 160, 255, 0.88), rgba(138, 154, 255, 0.84));
}

.action-btn.primary {
  background: var(--btn-grad);
}

.is-unavailable {
  position: relative;
  filter: grayscale(0.75) brightness(0.68);
  opacity: 0.62;
  cursor: not-allowed;
}

.is-unavailable::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 50%;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 67, 88, 0.9);
  box-shadow: 0 0 8px rgba(255, 67, 88, 0.55);
  transform: rotate(-18deg);
  pointer-events: none;
}

.action-btn.is-unavailable {
  pointer-events: none;
}

.bottom-nav {
  position: fixed;
  left: max(var(--shell-pad), calc((100vw - var(--shell-max)) / 2 + var(--shell-pad)));
  right: max(var(--shell-pad), calc((100vw - var(--shell-max)) / 2 + var(--shell-pad)));
  transform: translateY(0);
  bottom: 0;
  width: auto;
  max-width: calc(var(--shell-max) - (var(--shell-pad) * 2));
  border-radius: 18px 18px 0 0;
  padding: 5px 8px max(5px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  opacity: 1;
  transition: transform 0.34s ease, opacity 0.28s ease;
  will-change: transform, opacity;
  z-index: 20;
}

.bottom-nav.is-hidden {
  transform: translateY(calc(100% + 10px));
  opacity: 0;
  pointer-events: none;
}

.bottom-nav.is-at-page-bottom {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.now-playing-caption {
  grid-column: 3;
  grid-row: 1;
  align-self: end;
  justify-self: center;
  width: 100%;
  max-width: 100%;
  display: block;
  color: rgba(255, 238, 213, 0.86);
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.now-playing-caption.is-visible {
  opacity: 1;
  transform: translateY(0);
  animation: captionBreath 2.6s ease-in-out infinite;
}

@keyframes captionBreath {
  0%, 100% {
    opacity: 0.58;
    text-shadow: 0 0 6px rgba(255, 203, 129, 0.16);
  }
  50% {
    opacity: 1;
    text-shadow: 0 0 12px rgba(255, 203, 129, 0.45);
  }
}

.nav-item {
  border: 0;
  background: transparent;
  color: #fff;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 2px 2px;
  font-size: 12px;
}

.nav-item img {
  width: 21px;
  height: 21px;
  opacity: 0.85;
  filter: brightness(0) invert(1);
}

.nav-item img.home-nav-icon {
  width: 27px;
  height: 27px;
  margin-bottom: -3px;
  opacity: 0.95;
  filter: brightness(0) invert(1);
}

.nav-item.active {
  color: var(--gold);
  text-shadow: 0 0 9px rgba(255, 207, 129, 0.75), 0 0 18px rgba(255, 166, 96, 0.35);
}

.nav-item.active img {
  opacity: 1;
  filter: sepia(1) saturate(2.4) hue-rotate(345deg) brightness(1.25) drop-shadow(0 0 8px rgba(255, 207, 129, 0.75));
}

.nav-item.active img.home-nav-icon {
  filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.55));
}

.is-running .primary-btn {
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0% { box-shadow: 0 8px 24px rgba(241, 125, 255, 0.2); }
  50% { box-shadow: 0 8px 30px rgba(241, 125, 255, 0.52); }
  100% { box-shadow: 0 8px 24px rgba(241, 125, 255, 0.2); }
}

@media (max-width: 380px) {
  .brand-text {
    font-size: 17px;
  }

  .hero {
    aspect-ratio: 2.28 / 1;
  }

  .hero-copy {
    width: 64%;
    margin-top: 17px;
  }

  .hero-copy h1 {
    font-size: 24px;
  }

  .workbench {
    grid-template-columns: 1.2fr 1.8fr;
    gap: 7px;
  }

  .dropzone,
  .ghost-btn,
  .token-input,
  .synth-btn {
    min-height: 28px;
    font-size: 12px;
  }

  .progress-wrap {
    min-height: 96px;
    grid-template-rows: 28px 1fr 7px;
  }
}
