:root {
  --ink: #101427;
  --muted: #657086;
  --line: rgba(15, 23, 42, 0.13);
  --paper: #f7fbff;
  --white: #ffffff;
  --coral: #ff486f;
  --aqua: #00c8ff;
  --mint: #34e59b;
  --lemon: #ffe45c;
  --blue: #3157ff;
  --violet: #8a5cff;
  --brand-red: #ff4f8b;
  --brand-blue: #2f6fff;
  --brand-violet: #8b5cf6;
  --brand-cyan: #20bde9;
  --grad-action: linear-gradient(135deg, #ff4f8b 0%, #8b5cf6 48%, #2f6fff 100%);
  --grad-icon: linear-gradient(145deg, #ff6ba7 0%, #8b5cf6 52%, #2f6fff 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 79, 139, 0.18), rgba(139, 92, 246, 0.18), rgba(47, 111, 255, 0.18));
  --grad-line: linear-gradient(135deg, rgba(255, 79, 139, 0.56), rgba(139, 92, 246, 0.58), rgba(47, 111, 255, 0.56));
  --brand-glow: 0 14px 28px rgba(139, 92, 246, 0.18), 0 7px 18px rgba(255, 79, 139, 0.12);
  --shadow: 0 22px 70px rgba(13, 23, 54, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  scroll-padding-top: 0;
}

body {
  margin: 0;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: #f7fbff;
}

body {
  scroll-snap-type: y mandatory;
}

main {
  position: relative;
  z-index: auto;
}

body.player-open .intro-shell,
body.player-open .create-layout,
body.player-open .history-layout,
body.player-open .how-section .content-shell,
body.player-open .qa-layout,
body.player-open .site-footer {
  transform-origin: top center;
  transform: translateY(-6px) scale(0.968);
  transition: transform 0.28s ease;
}

body.player-open .library-dashboard.history-layout {
  transform: none;
}

main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 88% 27%, rgba(255, 72, 111, 0.15), transparent 15%),
    radial-gradient(circle at 12% 33%, rgba(0, 200, 255, 0.22), transparent 18%),
    radial-gradient(circle at 82% 52%, rgba(52, 229, 155, 0.2), transparent 17%),
    radial-gradient(circle at 18% 72%, rgba(138, 92, 255, 0.18), transparent 18%),
    radial-gradient(circle at 72% 88%, rgba(255, 228, 92, 0.22), transparent 17%),
    linear-gradient(
      180deg,
      #f7fbff 0%,
      #fff8f4 24%,
      #f4fbff 42%,
      #f9f7ff 62%,
      #effcff 80%,
      #fff8ee 100%
    );
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.global-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0.38;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.cursor-glow {
  display: none;
}

@media (max-width: 768px) {
  .global-canvas {
    display: none;
  }
}

@media (max-width: 680px) {
  .model-voice-stack {
    justify-items: stretch;
    width: min(100%, 230px);
  }

  .model-select-pill,
  .custom-voice-button {
    width: 100%;
  }

  .custom-voice-button {
    max-width: none;
  }

  .voice-modal-shell {
    align-items: end;
    padding: 10px;
  }

  .voice-modal {
    width: 100%;
    height: calc(100dvh - 20px);
    max-height: calc(100dvh - 20px);
    padding: 24px 18px;
    border-radius: 14px;
  }

  .voice-modal:has(.voice-record-stage) {
    padding: clamp(12px, 2.5dvh, 18px);
  }

  .voice-list-item {
    grid-template-columns: 44px minmax(0, 1fr) 36px 36px;
    gap: 10px;
    height: 112px;
  }

  .voice-record-head {
    grid-template-columns: 1fr;
    justify-items: center;
    padding-inline: 34px;
  }

  .voice-device-field {
    width: min(100%, 220px);
  }

  .voice-panel-controls {
    grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr);
    column-gap: 24px;
    row-gap: 8px;
  }

  .voice-rerecord-button,
  .voice-record-finish {
    padding-inline: 10px;
    font-size: 13px;
  }

  .voice-edit-button {
    grid-column: 3;
    grid-row: 1;
  }

  .voice-delete-button {
    grid-column: 4;
    grid-row: 1;
  }

  .voice-detail-actions {
    grid-template-columns: 1fr;
  }

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

  .voice-tips-grid article {
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    gap: 7px;
    min-height: 92px;
    padding: 9px 7px;
    text-align: left;
  }

  .voice-tips-grid i {
    grid-row: auto;
    width: 30px;
    height: 30px;
    align-self: center;
    justify-self: center;
  }

  .voice-tips-grid strong,
  .voice-tips-grid span {
    grid-column: 2;
    text-align: left;
  }

  .voice-tips-grid strong {
    font-size: 12px;
    line-height: 1.22;
  }

  .voice-tips-grid span {
    display: block;
    font-size: 10px;
    line-height: 1.28;
  }

  .voice-modal:has(.voice-record-stage) .voice-tips-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .voice-modal:has(.voice-record-stage) .voice-tips-grid article {
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    min-height: 82px;
    text-align: left;
  }

  .voice-modal:has(.voice-record-stage) .voice-tips-grid i {
    grid-row: 1 / span 2;
    width: 28px;
    height: 28px;
    align-self: center;
    justify-self: center;
  }

  .voice-modal:has(.voice-record-stage) .voice-tips-grid span {
    display: block;
    grid-column: 2;
    text-align: left;
  }

  .voice-modal:has(.voice-record-stage) .voice-tips-grid strong {
    grid-column: 2;
    text-align: left;
  }

  .voice-choice-actions .solid-button,
  .voice-choice-actions .ghost-button,
  .voice-step-actions .solid-button,
  .voice-step-actions .ghost-button {
    width: min(160px, calc(50% - 8px));
    gap: 6px;
    padding: 0 12px;
    font-size: clamp(12px, 3vw, 14px);
  }

  .voice-language-pill {
    position: static;
    justify-self: center;
  }

  .voice-phrase {
    min-height: 96px;
  }
}

.motif-field {
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
}

.music-motif {
  position: absolute;
  display: flex;
  align-items: end;
  gap: 7px;
  min-height: 76px;
  padding: 15px 18px;
  border: 1px solid rgba(49, 87, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.32);
  box-shadow: 0 16px 36px rgba(13, 23, 54, 0.06);
  backdrop-filter: blur(10px);
  opacity: 0.44;
}

.page-section > .content-shell,
.intro-shell,
.create-layout,
.history-layout,
.qa-layout,
.site-footer {
  position: relative;
  z-index: 4;
  transform-origin: top center;
  transition: transform 0.28s ease;
}

.page-section > .motif-field {
  z-index: 0;
}

.music-motif span {
  width: 8px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--coral), var(--aqua));
  opacity: 0.68;
  transform-origin: bottom;
  animation: cornerBars 1.37s infinite ease-in-out alternate;
}

.music-motif span:nth-child(1) { height: 24px; animation-duration: 1.13s; animation-delay: -0.18s; }
.music-motif span:nth-child(2) { height: 34px; animation-duration: 1.71s; animation-delay: -0.64s; }
.music-motif span:nth-child(3) { height: 52px; animation-duration: 1.29s; animation-delay: -0.36s; }
.music-motif span:nth-child(4) { height: 41px; animation-duration: 1.92s; animation-delay: -0.82s; }
.music-motif span:nth-child(5) { height: 61px; animation-duration: 1.48s; animation-delay: -0.51s; }

.motif-a {
  left: clamp(210px, 26vw, 370px);
  bottom: clamp(30px, 6vh, 72px);
  transform: scale(0.58) rotate(-2deg);
  opacity: 0.22;
}

.motif-b {
  right: clamp(210px, 24vw, 340px);
  top: clamp(92px, 12vh, 122px);
  transform: scale(0.44) rotate(4deg);
  opacity: 0.18;
}

.motif-b span:nth-child(1) { height: 42px; animation-duration: 1.46s; animation-delay: -0.38s; }
.motif-b span:nth-child(2) { height: 25px; animation-duration: 1.08s; animation-delay: -0.74s; }
.motif-b span:nth-child(3) { height: 62px; animation-duration: 1.82s; animation-delay: -0.22s; }
.motif-b span:nth-child(4) { height: 36px; animation-duration: 1.31s; animation-delay: -0.91s; }
.motif-b span:nth-child(5) { height: 49px; animation-duration: 1.63s; animation-delay: -0.57s; }

.motif-c {
  right: clamp(220px, 28vw, 410px);
  bottom: clamp(34px, 7vh, 84px);
  transform: scale(0.46) rotate(2deg);
  opacity: 0.17;
}

.motif-c span:nth-child(1) { height: 31px; animation-duration: 1.76s; animation-delay: -0.52s; }
.motif-c span:nth-child(2) { height: 56px; animation-duration: 1.24s; animation-delay: -0.2s; }
.motif-c span:nth-child(3) { height: 38px; animation-duration: 1.57s; animation-delay: -0.86s; }
.motif-c span:nth-child(4) { height: 64px; animation-duration: 1.11s; animation-delay: -0.43s; }
.motif-c span:nth-child(5) { height: 28px; animation-duration: 1.94s; animation-delay: -0.67s; }

.motif-d {
  left: clamp(22px, 5vw, 70px);
  top: clamp(12px, 4vh, 36px);
  transform: scale(0.62) rotate(-4deg);
  opacity: 0.2;
}

.motif-d span:nth-child(1) { height: 54px; animation-duration: 1.2s; animation-delay: -0.71s; }
.motif-d span:nth-child(2) { height: 39px; animation-duration: 1.88s; animation-delay: -0.31s; }
.motif-d span:nth-child(3) { height: 22px; animation-duration: 1.36s; animation-delay: -0.95s; }
.motif-d span:nth-child(4) { height: 58px; animation-duration: 1.69s; animation-delay: -0.16s; }
.motif-d span:nth-child(5) { height: 45px; animation-duration: 1.07s; animation-delay: -0.48s; }

.motif-e {
  right: clamp(24px, 6vw, 86px);
  top: clamp(18px, 4vh, 36px);
  bottom: auto;
  transform: scale(0.62) rotate(5deg);
  opacity: 0.2;
}

.motif-e span:nth-child(1) { height: 28px; animation-duration: 1.41s; animation-delay: -0.29s; }
.motif-e span:nth-child(2) { height: 47px; animation-duration: 1.18s; animation-delay: -0.63s; }
.motif-e span:nth-child(3) { height: 33px; animation-duration: 1.78s; animation-delay: -0.45s; }

.motif-f {
  left: clamp(18px, 4vw, 64px);
  bottom: clamp(42px, 9vh, 96px);
  transform: scale(0.66) rotate(3deg);
  opacity: 0.26;
}

.motif-g {
  right: clamp(20px, 4vw, 68px);
  top: clamp(96px, 14vh, 140px);
  transform: scale(0.78) rotate(-3deg);
  opacity: 0.24;
}

.motif-h {
  right: clamp(92px, 14vw, 190px);
  bottom: clamp(28px, 7vh, 72px);
  transform: scale(0.52) rotate(7deg);
  opacity: 0.22;
}

.motif-i {
  left: clamp(18px, 4vw, 60px);
  top: clamp(4px, 2vh, 18px);
  transform: scale(0.46) rotate(-5deg);
  opacity: 0.16;
}

.motif-j {
  right: clamp(26px, 6vw, 86px);
  top: clamp(8px, 3vh, 28px);
  transform: scale(0.5) rotate(4deg);
  opacity: 0.16;
}

@keyframes cornerBars {
  0% {
    transform: scaleY(0.5) translateY(2px);
  }
  42% {
    transform: scaleY(1.05) translateY(-3px);
  }
  to {
    transform: scaleY(0.72) translateY(1px);
    opacity: 0.92;
  }
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 12px 34px rgba(13, 23, 54, 0.08);
  backdrop-filter: blur(22px);
}

.brand,
.header-actions,
.main-nav,
.hero-metrics,
.panel-head,
.mode-tabs,
.option-row,
.submit-row,
.section-title-row,
.billing-toggle,
.footer-bottom {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 900;
  font-size: 20px;
  white-space: nowrap;
}

.brand-beta-badge {
  align-self: flex-start;
  margin-left: -4px;
  padding: 3px 7px;
  border: 1px solid rgba(139, 92, 246, 0.24);
  border-radius: 999px;
  color: var(--brand-violet);
  background: rgba(139, 92, 246, 0.1);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  transform: translateY(-3px);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  background: var(--grad-icon);
}

.brand-logo {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 8px;
  box-shadow: var(--brand-glow);
}

.main-nav {
  justify-content: center;
  gap: clamp(14px, 3vw, 36px);
  color: #101427;
  font-weight: 900;
}

.main-nav a {
  padding: 9px 10px;
  border-radius: 8px;
  text-shadow: none;
}

.main-nav a:hover {
  color: var(--blue);
  background: rgba(49, 87, 255, 0.08);
}

.menu-toggle {
  display: none;
  place-items: center;
  justify-self: start;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(139, 84, 255, 0.24);
  border-radius: 8px;
  color: var(--brand-blue);
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    var(--grad-line) border-box;
  box-shadow: var(--brand-glow);
}

.header-actions {
  gap: 10px;
}

.icon-button,
.language-button,
.ghost-button,
.solid-button,
.generate-button,
.mode-tab,
.style-chip,
.play-small,
.billing-toggle button {
  border: 0;
  border-radius: 8px;
  min-height: 40px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  color: #6b5bff;
  background:
    linear-gradient(rgba(255, 255, 255, 0.86), rgba(248, 251, 255, 0.78)) padding-box,
    var(--grad-line) border-box;
  border: 1px solid transparent;
  box-shadow: 0 8px 18px rgba(79, 93, 255, 0.08);
}

.language-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 72px;
  padding: 0 12px;
  border: 1px solid transparent;
  color: #1b2440;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(244, 249, 255, 0.8)) padding-box,
    var(--grad-line) border-box;
  box-shadow: 0 8px 18px rgba(79, 93, 255, 0.08);
}

.language-button span {
  font-size: 13px;
  font-weight: 900;
}

.account-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 12px 4px 5px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.88), rgba(248, 251, 255, 0.82)) padding-box,
    var(--grad-line) border-box;
  box-shadow: 0 10px 24px rgba(79, 93, 255, 0.1);
}

.account-avatar,
.profile-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  color: #fff;
  background: var(--grad-icon);
  font-weight: 950;
}

.account-avatar {
  width: 34px;
  height: 34px;
}

.account-label {
  display: grid;
  gap: 1px;
  line-height: 1.1;
}

.account-label strong {
  max-width: 104px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-label small {
  max-width: 118px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ghost-button,
.solid-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  font-weight: 800;
}

.ghost-button {
  color: #4e46d9;
  background:
    linear-gradient(rgba(255, 255, 255, 0.88), rgba(247, 245, 255, 0.78)) padding-box,
    var(--grad-line) border-box;
  border: 1px solid transparent;
}

.solid-button,
.generate-button {
  color: #fff;
  background: var(--grad-action);
  box-shadow: var(--brand-glow);
}

button:disabled:not(.track-main):not(.record-cover),
button[aria-disabled="true"]:not(.track-main):not(.record-cover),
a[aria-disabled="true"],
.is-disabled {
  cursor: not-allowed !important;
  color: #8790a3 !important;
  border-color: rgba(100, 116, 139, 0.28) !important;
  background:
    linear-gradient(180deg, rgba(244, 247, 251, 0.96), rgba(226, 232, 240, 0.9)) padding-box,
    linear-gradient(135deg, rgba(148, 163, 184, 0.42), rgba(203, 213, 225, 0.34)) border-box !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64) !important;
  filter: grayscale(1) saturate(0.32);
  opacity: 1 !important;
  pointer-events: none;
}

.icon-button:disabled svg,
.record-cover:disabled svg,
.generate-button:disabled svg,
.solid-button[aria-disabled="true"] svg,
.ghost-button[aria-disabled="true"] svg,
.is-disabled svg {
  color: #94a3b8;
  stroke: currentColor;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 28;
  background: rgba(16, 20, 39, 0.18);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 29;
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: min(320px, calc(100vw - 42px));
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 251, 255, 0.92)),
    linear-gradient(135deg, rgba(0, 200, 255, 0.1), rgba(255, 72, 111, 0.08));
  border-right: 1px solid rgba(49, 87, 255, 0.16);
  box-shadow: 24px 0 70px rgba(13, 23, 54, 0.18);
  backdrop-filter: blur(24px);
  transform: translateX(-104%);
  visibility: hidden;
  pointer-events: none;
  transition:
    transform 0.26s ease,
    visibility 0s linear 0.26s;
}

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

.drawer-nav,
.drawer-actions {
  display: grid;
  gap: 10px;
}

.drawer-nav {
  margin-top: 12px;
}

.drawer-nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(49, 87, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  font-weight: 900;
}

.drawer-nav a:hover {
  color: var(--blue);
  background: rgba(49, 87, 255, 0.08);
}

.drawer-actions {
  margin-top: auto;
}

.drawer-actions .ghost-button,
.drawer-actions .solid-button,
.drawer-actions .language-button {
  justify-content: center;
  width: 100%;
}

.drawer-actions .ghost-button {
  min-height: 42px;
  gap: 8px;
}

.drawer-profile-link,
.drawer-logout-link {
  display: none;
}

body.is-authenticated .drawer-profile-link,
body.is-authenticated .drawer-logout-link {
  display: inline-flex;
}

body.is-authenticated .drawer-actions .auth-link {
  display: none;
}

body.has-generated-songs .start-gate-button,
.start-gate-button[hidden] {
  display: none !important;
}

body.drawer-open {
  overflow: hidden;
}

body.drawer-open .drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.drawer-open .mobile-drawer {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  transition:
    transform 0.26s ease,
    visibility 0s linear 0s;
}

.auth-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.auth-modal-shell[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(0, 200, 255, 0.18), transparent 34%),
    radial-gradient(circle at 72% 78%, rgba(255, 72, 111, 0.16), transparent 34%),
    rgba(16, 20, 39, 0.32);
  backdrop-filter: blur(8px);
}

.auth-modal {
  position: relative;
  width: min(430px, 100%);
  padding: 28px;
  border: 1px solid rgba(49, 87, 255, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 251, 255, 0.9)),
    linear-gradient(135deg, rgba(0, 200, 255, 0.12), rgba(255, 72, 111, 0.08));
  box-shadow: 0 28px 90px rgba(13, 23, 54, 0.24);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.24s ease;
}

.auth-modal-shell[aria-hidden="false"] .auth-modal {
  transform: translateY(0) scale(1);
}

.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.auth-modal-mark {
  display: flex;
  margin-bottom: 16px;
}

.auth-modal h2 {
  margin-bottom: 10px;
  font-size: 30px;
}

.auth-modal-copy,
.auth-modal-foot {
  color: var(--muted);
  line-height: 1.7;
}

.auth-modal-copy {
  margin-bottom: 20px;
}

.auth-provider-list {
  display: grid;
  gap: 10px;
}

.auth-provider-reserved[hidden] {
  display: none;
}

.auth-provider {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(49, 87, 255, 0.14);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 900;
  text-align: left;
}

.auth-provider.primary {
  color: #fff;
  background: var(--grad-action);
  box-shadow: var(--brand-glow);
}

.auth-provider:disabled {
  color: rgba(16, 20, 39, 0.45);
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.46);
}

.auth-provider em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.auth-modal-foot {
  margin: 16px 0 0;
  font-size: 12px;
}

body.auth-modal-open {
  overflow: hidden;
}

.app-dialog-shell {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.app-dialog-shell[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.app-dialog-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(0, 200, 255, 0.16), transparent 32%),
    radial-gradient(circle at 72% 78%, rgba(255, 72, 111, 0.14), transparent 34%),
    rgba(16, 20, 39, 0.26);
  backdrop-filter: blur(7px);
}

.app-dialog {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  width: min(380px, 100%);
  padding: 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(245, 250, 255, 0.92)) padding-box,
    var(--grad-line) border-box;
  box-shadow: 0 24px 70px rgba(13, 23, 54, 0.22), 0 12px 34px rgba(139, 84, 255, 0.12);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.22s ease;
}

.app-dialog-shell[aria-hidden="false"] .app-dialog {
  transform: translateY(0) scale(1);
}

.app-dialog-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--grad-icon);
  box-shadow: var(--brand-glow);
}

.app-dialog-mark img {
  width: 26px;
  height: 26px;
}

.app-dialog-copy {
  min-width: 0;
}

.app-dialog-copy .section-kicker {
  margin-bottom: 4px;
}

.app-dialog h2 {
  margin: 0 0 6px;
  font-size: 19px;
}

.app-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.55;
}

.app-dialog-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.app-dialog-actions .ghost-button,
.app-dialog-actions .solid-button {
  min-height: 36px;
  padding: 0 16px;
}

.app-dialog-actions .solid-button {
  min-width: 86px;
}

body.app-dialog-open {
  overflow: hidden;
}

.voice-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.voice-modal-shell[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.voice-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 79, 139, 0.18), transparent 32%),
    radial-gradient(circle at 82% 74%, rgba(47, 111, 255, 0.16), transparent 34%),
    rgba(8, 12, 24, 0.58);
  backdrop-filter: blur(10px);
}

.voice-modal {
  position: relative;
  width: min(780px, 100%);
  height: min(720px, calc(100dvh - 36px));
  max-height: calc(100dvh - 36px);
  overflow: hidden;
  padding: 32px;
  border: 1px solid rgba(216, 227, 255, 0.16);
  border-radius: 12px;
  color: #f8fbff;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 79, 139, 0.13), transparent 32%),
    radial-gradient(circle at 92% 6%, rgba(47, 111, 255, 0.16), transparent 34%),
    #202a39;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.22s ease;
}

.voice-modal-content {
  display: grid;
  height: 100%;
  min-height: 0;
}

.voice-modal-content:has(.voice-list) {
  --voice-row-height: 122px;
  grid-template-rows: auto var(--voice-row-height) minmax(0, 1fr);
  row-gap: 18px;
}

.voice-modal:has(.voice-record-stage) {
  overflow: hidden;
  padding: clamp(14px, 3dvh, 30px);
}

.voice-modal:has(.voice-record-stage) .voice-modal-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  height: 100%;
  min-height: 0;
}

.voice-modal-shell[aria-hidden="false"] .voice-modal {
  transform: translateY(0) scale(1);
}

.voice-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  color: rgba(235, 241, 255, 0.78);
  background: transparent;
}

.voice-modal-back {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  color: rgba(235, 241, 255, 0.78);
  background: rgba(255, 255, 255, 0.06);
}

.voice-modal-back:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.voice-step-head {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 0 auto 22px;
  text-align: center;
}

.voice-step-head h2 {
  margin: 0;
  color: #fff;
  font-size: 25px;
}

.voice-step-head p {
  max-width: 560px;
  margin: 0;
  color: rgba(219, 226, 241, 0.72);
  line-height: 1.5;
}

.voice-create-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  width: 100%;
  height: var(--voice-row-height, 122px);
  margin-bottom: 0;
  padding: 16px 20px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--grad-action);
  text-align: left;
  box-shadow: 0 18px 40px rgba(255, 79, 139, 0.22);
}

.voice-create-card svg {
  width: 30px;
  height: 30px;
}

.voice-create-card strong,
.voice-create-card small {
  display: block;
}

.voice-create-card strong {
  font-size: 18px;
}

.voice-create-card small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.84);
}

.voice-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: 14px;
  padding-right: 4px;
  border-top: 1px dashed rgba(216, 227, 255, 0.2);
}

.voice-list-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto 40px 40px;
  align-items: center;
  gap: 12px;
  height: 122px;
  padding: 13px 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.11);
}

.voice-list-item.is-selected {
  outline: 1px solid rgba(52, 229, 155, 0.64);
  background: rgba(52, 229, 155, 0.12);
}

.voice-list-item.is-expired {
  opacity: 0.68;
}

.voice-play-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  overflow: hidden;
  border-radius: 14px;
  color: #fff;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.34), transparent 24%),
    var(--grad-icon);
  box-shadow: 0 12px 26px rgba(92, 102, 255, 0.18);
}

.voice-identity-icon::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 50%;
  opacity: 0.72;
}

.voice-identity-ring {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-left-color: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.voice-identity-core {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.voice-identity-core svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.6;
}

.voice-identity-bars {
  position: absolute;
  right: 6px;
  bottom: 7px;
  display: inline-flex;
  align-items: end;
  gap: 2px;
  height: 14px;
}

.voice-identity-bars span {
  width: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
}

.voice-identity-bars span:nth-child(1) {
  height: 6px;
}

.voice-identity-bars span:nth-child(2) {
  height: 11px;
}

.voice-identity-bars span:nth-child(3) {
  height: 8px;
}

.voice-identity-bars span:nth-child(4) {
  height: 13px;
}

.voice-list-item.is-selected .voice-play-button {
  box-shadow: 0 0 0 2px rgba(34, 211, 136, 0.22), 0 12px 26px rgba(92, 102, 255, 0.18);
}

.voice-list-item.is-expired .voice-play-button {
  filter: grayscale(0.35) saturate(0.72);
  opacity: 0.72;
}

.voice-item-main {
  min-width: 0;
}

.voice-item-main strong {
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-expiry {
  display: inline-flex;
  margin-top: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #cbd8f2;
  background: rgba(255, 255, 255, 0.09);
  font-size: 12px;
  font-weight: 900;
}

.voice-expiry.is-error {
  color: #ff6b7d;
  background: rgba(255, 72, 111, 0.12);
}

.voice-use-button,
.voice-edit-button,
.voice-delete-button {
  height: 38px;
  min-height: 38px;
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.voice-saving-card {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: min(420px, 64dvh);
  gap: 10px;
  text-align: center;
}

.voice-saving-card h2 {
  margin: 0;
  color: #fff;
  font-size: 25px;
}

.voice-failed-card > svg {
  width: 54px;
  height: 54px;
  color: #ff5f7c;
}

.voice-failed-card .solid-button {
  min-width: 180px;
  margin-top: 8px;
}

.voice-saving-card p:last-child {
  max-width: 420px;
  margin: 0;
  color: rgba(219, 226, 241, 0.74);
}

.voice-spinner {
  width: 54px;
  height: 54px;
  border: 4px solid rgba(255, 255, 255, 0.16);
  border-top-color: #ff4f8b;
  border-right-color: #2f6fff;
  border-radius: 50%;
  animation: voiceSpin 0.9s linear infinite;
}

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

.voice-detail-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(216, 227, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
}

.voice-detail-field {
  display: grid;
  gap: 7px;
  color: rgba(235, 241, 255, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.voice-detail-field input,
.voice-detail-field textarea,
.voice-detail-field code {
  width: 100%;
  border: 1px solid rgba(216, 227, 255, 0.16);
  border-radius: 9px;
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  font: inherit;
  font-weight: 850;
}

.voice-detail-field input,
.voice-detail-field textarea {
  padding: 12px 13px;
}

.voice-detail-field textarea {
  resize: none;
}

.voice-detail-field code {
  display: block;
  padding: 10px 12px;
  overflow: hidden;
  color: rgba(235, 241, 255, 0.86);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-detail-field small {
  justify-self: end;
  color: rgba(219, 226, 241, 0.52);
}

.voice-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.voice-detail-meta span {
  padding: 5px 9px;
  border-radius: 999px;
  color: rgba(235, 241, 255, 0.76);
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.voice-detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.voice-reverify-button {
  justify-self: start;
}

.voice-empty {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  height: var(--voice-row-height, 122px);
  padding: 22px;
  border: 1px dashed rgba(216, 227, 255, 0.22);
  border-radius: 10px;
  color: rgba(219, 226, 241, 0.72);
  text-align: center;
}

.voice-upload-zone,
.voice-consent-card,
.voice-tips-grid article,
.voice-wave-card,
.voice-record-pad {
  border: 1px solid rgba(216, 227, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.voice-upload-zone {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 30px 20px;
  border-style: dashed;
  text-align: center;
}

.voice-upload-zone h3,
.voice-upload-zone p {
  margin: 0;
}

.voice-upload-zone p,
.voice-recording-status,
.voice-tips-grid span {
  color: rgba(219, 226, 241, 0.7);
}

.voice-choice-actions,
.voice-step-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.voice-step-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 332px);
  margin-inline: auto;
}

.voice-choice-actions .solid-button,
.voice-choice-actions .ghost-button,
.voice-step-actions .solid-button,
.voice-step-actions .ghost-button {
  min-height: 44px;
  padding: 0 22px;
}

.voice-file-label {
  cursor: pointer;
}

.voice-consent-card {
  margin-bottom: 16px;
  padding: 0;
  overflow: hidden;
  border-color: rgba(255, 79, 139, 0.52);
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.12), rgba(47, 111, 255, 0.1));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035), 0 12px 30px rgba(255, 79, 139, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  animation: voiceConsentBreath 2.2s ease-in-out infinite;
}

.voice-consent-card.needs-attention {
  border-color: rgba(255, 79, 139, 0.95);
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.2), rgba(139, 92, 246, 0.16), rgba(47, 111, 255, 0.12));
  box-shadow: 0 0 0 3px rgba(255, 79, 139, 0.14), 0 18px 42px rgba(255, 79, 139, 0.15);
}

.voice-consent-card:has(#voiceConsentInput:checked) {
  border-color: rgba(52, 229, 155, 0.56);
  background:
    linear-gradient(135deg, rgba(52, 229, 155, 0.12), rgba(47, 111, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  animation: none;
}

@keyframes voiceConsentBreath {
  0%,
  100% {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035), 0 0 0 0 rgba(255, 79, 139, 0.14), 0 12px 30px rgba(255, 79, 139, 0.08);
  }
  50% {
    border-color: rgba(255, 79, 139, 0.92);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 0 4px rgba(255, 79, 139, 0.12), 0 18px 46px rgba(255, 79, 139, 0.18);
  }
}

.voice-consent-line {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 14px 16px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 780;
  line-height: 1.55;
}

.voice-consent-line input {
  accent-color: var(--brand-violet);
  transform: translateY(2px);
}

.voice-tips-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 1.6dvh, 12px);
  margin-top: clamp(6px, 1.6dvh, 16px);
}

.voice-tips-grid article {
  display: grid;
  grid-template-columns: clamp(30px, 5.5dvh, 42px) minmax(0, 1fr);
  gap: clamp(7px, 1.3dvh, 10px);
  padding: clamp(8px, 1.6dvh, 14px);
  align-items: center;
}

.voice-tips-grid i {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: clamp(30px, 5dvh, 38px);
  height: clamp(30px, 5dvh, 38px);
  align-self: center;
  justify-self: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.voice-tips-grid strong,
.voice-tips-grid span {
  grid-column: 2;
  min-width: 0;
  margin: 0;
  text-align: left;
  writing-mode: horizontal-tb;
  word-break: normal;
  overflow-wrap: break-word;
}

.voice-tips-grid strong {
  align-self: end;
  color: #fff;
  font-size: clamp(13px, 1.9dvh, 15px);
  line-height: 1.35;
}

.voice-tips-grid span {
  display: block;
  align-self: start;
  font-size: clamp(12px, 1.65dvh, 14px);
  line-height: 1.5;
}

.voice-wave-card {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.voice-trim-time {
  justify-self: center;
  padding: 8px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--grad-action);
  font-weight: 900;
}

.voice-wave-canvas {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 132px;
  border: 1px solid rgba(34, 211, 136, 0.88);
  border-radius: 8px;
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
}

.voice-wave-canvas.is-dragging {
  z-index: 8;
  cursor: grabbing;
}

body.voice-trim-dragging {
  overflow: hidden;
  touch-action: none;
}

.voice-wave-canvas.is-trim-locked {
  cursor: default;
  border-style: dashed;
  opacity: 0.86;
}

.voice-trim-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.voice-trim-play {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(216, 227, 255, 0.2);
  border-radius: 999px;
  color: #172033;
  background: #fff;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}

.voice-trim-play svg {
  width: 20px;
  height: 20px;
}

#voiceTrimPlaybackTime {
  min-width: 48px;
  color: rgba(235, 241, 255, 0.72);
  font-size: 14px;
  font-weight: 900;
}

.voice-record-head {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 150px;
  align-items: start;
  gap: 12px;
  padding-inline: 44px;
  margin-bottom: clamp(6px, 1.5dvh, 18px);
  text-align: center;
}

.voice-record-head h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(20px, 3.1dvh, 25px);
}

.voice-record-subtitle {
  margin: 5px 0 0;
  color: rgba(235, 241, 255, 0.68);
  font-size: 13px;
  font-weight: 820;
}

.voice-record-tools {
  display: grid;
  gap: 8px;
}

.voice-record-left {
  display: grid;
  align-content: start;
}

.voice-device-field {
  display: grid;
  gap: 5px;
  color: rgba(235, 241, 255, 0.72);
  font-size: 12px;
  font-weight: 900;
  text-align: left;
}

.voice-device-field select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid rgba(216, 227, 255, 0.16);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-device-field select option {
  color: #172033;
  background: #fff;
}

.voice-refresh-phrase {
  position: absolute;
  right: 10px;
  bottom: 10px;
  border-color: rgba(139, 92, 246, 0.38);
  color: rgba(255, 255, 255, 0.94);
  min-height: 34px;
  padding-inline: 10px;
  font-size: 12px;
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.22), rgba(139, 92, 246, 0.2), rgba(47, 111, 255, 0.18)),
    rgba(20, 30, 48, 0.72);
  backdrop-filter: blur(10px);
}

.voice-refresh-phrase:disabled {
  border-color: rgba(216, 227, 255, 0.12);
  color: rgba(235, 241, 255, 0.58);
  background: rgba(255, 255, 255, 0.065);
  opacity: 1;
  cursor: not-allowed;
}

.voice-record-stage {
  display: grid;
  justify-items: center;
  gap: clamp(6px, 1.55dvh, 14px);
  min-height: 0;
  padding: clamp(2px, 0.9dvh, 8px) 0 clamp(5px, 1.4dvh, 16px);
}

.voice-record-time {
  color: rgba(235, 241, 255, 0.7);
  font-size: clamp(16px, 2.8dvh, 22px);
  font-weight: 800;
}

.voice-record-stage p {
  margin: 0;
  color: rgba(235, 241, 255, 0.82);
  font-size: clamp(13px, 2.1dvh, 17px);
  font-weight: 760;
  text-align: center;
}

.voice-phrase-wrap {
  position: relative;
  width: min(100%, 620px);
}

.voice-live-canvas {
  width: 100%;
  height: clamp(48px, 14dvh, 112px);
  border-bottom: 1px dashed rgba(216, 227, 255, 0.16);
}

.voice-panel-controls {
  display: grid;
  grid-template-columns: minmax(0, 130px) clamp(68px, 12dvh, 96px) minmax(0, 130px);
  align-items: center;
  justify-content: center;
  column-gap: clamp(20px, 4.2dvh, 32px);
  row-gap: 10px;
  width: 100%;
}

.voice-record-main {
  justify-self: center;
}

.voice-record-main svg {
  width: 30px;
  height: 30px;
  color: rgba(255, 255, 255, 0.94);
  stroke-width: 2.8;
  filter: drop-shadow(0 2px 4px rgba(190, 18, 60, 0.22));
}

.voice-rerecord-button,
.voice-record-play,
.voice-record-finish,
.voice-verify-upload {
  min-height: 46px;
}

.voice-record-finish:disabled,
.voice-record-play:disabled,
.voice-rerecord-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.voice-verify-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 168px));
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.voice-verify-upload {
  justify-self: center;
  margin-top: -2px;
  width: 100%;
}

.voice-phrase-compact {
  min-height: clamp(52px, 10dvh, 78px);
  width: 100%;
  padding: clamp(10px, 2dvh, 18px);
  padding-right: clamp(108px, 22vw, 132px);
  border: 1px solid rgba(216, 227, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  font-size: clamp(18px, 4vw, 30px);
}

.voice-phrase-compact.is-loading {
  color: rgba(235, 241, 255, 0.62);
  font-size: clamp(16px, 3vw, 22px);
}

.voice-step-actions {
  margin-top: 18px;
}

.voice-step-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
}

.voice-step-dots span {
  width: 58px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.32);
}

.voice-step-dots span.active {
  background: rgba(255, 255, 255, 0.86);
}

.voice-validation-head {
  position: relative;
}

.voice-language-pill {
  position: absolute;
  right: 12px;
  top: 0;
  padding: 8px 14px;
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 900;
}

.voice-phrase {
  min-height: 118px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 950;
  text-align: center;
}

.voice-record-pad {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 24px 18px;
  border-style: dashed;
}

.voice-record-pad p {
  margin: 0;
  color: rgba(219, 226, 241, 0.72);
}

.voice-record-button {
  width: clamp(62px, 11dvh, 86px);
  height: clamp(62px, 11dvh, 86px);
  border: clamp(6px, 1dvh, 8px) solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: #ff404b;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22), 0 18px 34px rgba(255, 64, 75, 0.22);
}

.voice-record-button.is-recording,
[data-record-source].is-recording,
[data-record-verify].is-recording {
  animation: voicePulse 1s infinite ease-in-out;
}

@keyframes voicePulse {
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 0 8px rgba(255, 64, 75, 0.14);
  }
}

.voice-modal-backdrop {
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 79, 139, 0.16), transparent 32%),
    radial-gradient(circle at 84% 74%, rgba(47, 111, 255, 0.16), transparent 34%),
    rgba(245, 249, 255, 0.72);
  backdrop-filter: blur(14px);
}

.voice-modal {
  color: var(--ink);
  border-color: rgba(47, 111, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 251, 255, 0.92)),
    radial-gradient(circle at 18% 4%, rgba(255, 79, 139, 0.1), transparent 34%),
    radial-gradient(circle at 92% 10%, rgba(47, 111, 255, 0.1), transparent 36%);
  box-shadow: 0 34px 90px rgba(47, 84, 158, 0.2);
}

.voice-modal-close,
.voice-modal-back {
  color: var(--muted);
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 255, 0.9)) padding-box,
    linear-gradient(135deg, rgba(255, 79, 139, 0.28), rgba(139, 92, 246, 0.24), rgba(47, 111, 255, 0.24)) border-box;
  box-shadow: 0 12px 28px rgba(47, 84, 158, 0.13);
}

.voice-modal-back:hover,
.voice-modal-close:hover {
  color: var(--brand-violet);
  background:
    linear-gradient(180deg, #fff, rgba(247, 250, 255, 0.96)) padding-box,
    var(--grad-line) border-box;
  box-shadow: 0 14px 32px rgba(139, 92, 246, 0.16);
}

.voice-step-head h2,
.voice-saving-card h2,
.voice-record-head h2,
.voice-item-main strong,
.voice-upload-zone h3,
.voice-tips-grid strong,
.voice-phrase {
  color: var(--ink);
}

.voice-step-head p,
.voice-saving-card p:last-child,
.voice-empty,
.voice-upload-zone p,
.voice-recording-status,
.voice-tips-grid span,
.voice-record-subtitle,
.voice-record-time,
.voice-record-stage p,
.voice-record-pad p,
#voiceTrimPlaybackTime {
  color: var(--muted);
}

.voice-list {
  border-top-color: rgba(47, 111, 255, 0.14);
}

.voice-list-item,
.voice-empty,
.voice-upload-zone,
.voice-tips-grid article,
.voice-wave-card,
.voice-record-pad,
.voice-detail-panel,
.voice-phrase-compact {
  border: 1px solid rgba(47, 111, 255, 0.16);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(240, 247, 255, 0.72));
  box-shadow: 0 14px 32px rgba(47, 84, 158, 0.08);
}

.voice-list-item.is-selected {
  outline: 0;
  border: 1px solid rgba(34, 211, 136, 0.58);
  background:
    linear-gradient(135deg, rgba(236, 255, 248, 0.94), rgba(244, 250, 255, 0.86));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), 0 14px 32px rgba(47, 84, 158, 0.08);
}

.voice-list-item.is-expired {
  opacity: 1;
  border-color: rgba(255, 79, 139, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 244, 248, 0.92), rgba(250, 252, 255, 0.82));
}

.voice-play-button {
  color: #fff;
  background: var(--grad-icon);
  box-shadow: 0 12px 26px rgba(92, 102, 255, 0.18);
}

.voice-expiry {
  color: #65728c;
  background: rgba(238, 244, 255, 0.94);
  border: 1px solid rgba(47, 111, 255, 0.13);
}

.voice-expiry.is-error {
  color: #e11d48;
  background: rgba(255, 242, 246, 0.96);
  border-color: rgba(225, 29, 72, 0.2);
}

.voice-use-button,
.voice-edit-button,
.voice-delete-button,
.voice-refresh-phrase,
.voice-language-pill {
  color: var(--ink);
  border-color: rgba(47, 111, 255, 0.16);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(241, 247, 255, 0.84));
  box-shadow: 0 10px 24px rgba(47, 84, 158, 0.08);
}

.voice-use-button:hover,
.voice-edit-button:hover,
.voice-delete-button:hover,
.voice-refresh-phrase:hover {
  color: var(--brand-violet);
  border-color: rgba(139, 92, 246, 0.32);
}

.voice-refresh-phrase:disabled {
  color: #9aa5b8;
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(241, 245, 249, 0.88);
}

.voice-consent-card {
  border-color: rgba(255, 79, 139, 0.48);
  background:
    linear-gradient(135deg, rgba(255, 246, 250, 0.92), rgba(245, 249, 255, 0.88));
  box-shadow: 0 12px 30px rgba(255, 79, 139, 0.08);
}

.voice-consent-card:has(#voiceConsentInput:checked) {
  border-color: rgba(34, 211, 136, 0.5);
  background:
    linear-gradient(135deg, rgba(236, 255, 248, 0.9), rgba(245, 249, 255, 0.86));
}

.voice-consent-line {
  color: var(--ink);
}

.voice-tips-grid i {
  color: var(--brand-violet);
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.12), rgba(47, 111, 255, 0.12));
}

.voice-detail-field {
  color: var(--muted);
}

.voice-detail-field input,
.voice-detail-field textarea,
.voice-detail-field code,
.voice-device-field select {
  color: var(--ink);
  border-color: rgba(47, 111, 255, 0.16);
  background: rgba(255, 255, 255, 0.9);
}

.voice-detail-field code {
  color: var(--muted);
}

.voice-detail-field small,
.voice-detail-meta span,
.voice-device-field {
  color: var(--muted);
}

.voice-detail-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(47, 111, 255, 0.16);
  color: #334155;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(235, 242, 255, 0.9));
  box-shadow: 0 8px 18px rgba(47, 84, 158, 0.08);
}

.voice-spinner {
  border-color: rgba(47, 111, 255, 0.16);
  border-top-color: #ff4f8b;
  border-right-color: #2f6fff;
}

.voice-live-canvas {
  border-bottom-color: rgba(47, 111, 255, 0.16);
}

.voice-wave-canvas {
  background:
    linear-gradient(90deg, rgba(255, 79, 139, 0.08), rgba(47, 111, 255, 0.08));
}

.voice-step-dots span {
  background: rgba(47, 111, 255, 0.16);
}

.voice-step-dots span.active {
  background: var(--grad-action);
}

.voice-modal .icon-button svg,
.voice-modal .ghost-button svg,
.voice-modal .voice-use-button svg,
.voice-modal .voice-edit-button svg,
.voice-modal .voice-delete-button svg,
.voice-modal .voice-modal-close svg,
.voice-modal .voice-modal-back svg {
  color: currentColor;
  stroke: currentColor;
}

.voice-modal-close,
.voice-modal-back,
.voice-edit-button,
.voice-delete-button {
  color: #6b5bff;
}

.voice-tips-grid,
.voice-modal:has(.voice-record-stage) .voice-tips-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.voice-tips-grid article,
.voice-modal:has(.voice-record-stage) .voice-tips-grid article {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: start;
  gap: 4px 12px;
  min-height: 92px;
  padding: 14px 16px;
  text-align: left;
}

.voice-tips-grid i,
.voice-tips-grid svg,
.voice-modal:has(.voice-record-stage) .voice-tips-grid i,
.voice-modal:has(.voice-record-stage) .voice-tips-grid svg {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: center;
  width: 20px;
  height: 20px;
  color: var(--ink);
  stroke: currentColor;
  background: transparent;
}

.voice-tips-grid strong,
.voice-tips-grid span,
.voice-modal:has(.voice-record-stage) .voice-tips-grid strong,
.voice-modal:has(.voice-record-stage) .voice-tips-grid span {
  grid-column: 2;
  min-width: 0;
  text-align: left;
}

.voice-tips-grid strong,
.voice-modal:has(.voice-record-stage) .voice-tips-grid strong {
  align-self: end;
  font-size: 15px;
  line-height: 1.35;
}

.voice-tips-grid span,
.voice-modal:has(.voice-record-stage) .voice-tips-grid span {
  display: block;
  align-self: start;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-height: 720px) {
  .voice-modal:has(.voice-record-stage) {
    padding: 12px 16px;
  }

  .voice-device-field {
    gap: 3px;
    font-size: 11px;
  }

  .voice-device-field select {
    min-height: 34px;
  }

  .voice-live-canvas {
    height: 52px;
  }

  .voice-panel-controls {
    grid-template-columns: minmax(0, 116px) 64px minmax(0, 116px);
    column-gap: 22px;
  }

  .voice-rerecord-button,
  .voice-record-play,
  .voice-record-finish,
  .voice-verify-upload {
    min-height: 38px;
    font-size: 12px;
  }

  .voice-step-dots {
    margin-top: 8px;
  }
}

body.voice-modal-open {
  overflow: hidden;
}

.voice-modal:has(#voiceValidationPhrase) .voice-modal-content {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.voice-modal:has(#voiceValidationPhrase) .voice-record-stage {
  align-content: center;
}

.voice-modal:has(#voiceValidationPhrase) .voice-step-dots {
  align-self: end;
}

@media (max-width: 680px) {
  .model-voice-stack {
    justify-items: stretch;
    width: min(100%, 230px);
  }

  .model-select-pill,
  .custom-voice-button {
    width: 100%;
  }

  .style-custom-voice-button {
    width: calc(50% - 4px);
    max-width: calc(50% - 4px);
  }

  .voice-modal-shell {
    align-items: end;
    padding: 10px;
  }

  .voice-modal {
    width: 100%;
    max-height: calc(100dvh - 20px);
    padding: 24px 18px;
    border-radius: 14px;
  }

  .voice-modal-content:has(.voice-list) {
    --voice-row-height: 96px;
    row-gap: 12px;
  }

  .voice-create-card {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    padding: 12px 14px;
  }

  .voice-create-card svg {
    width: 25px;
    height: 25px;
  }

  .voice-create-card strong {
    font-size: 15px;
  }

  .voice-create-card small {
    font-size: 12px;
  }

  .voice-modal:has(.voice-record-stage) {
    padding: clamp(12px, 2.5dvh, 18px);
  }

  .voice-list-item {
    grid-template-columns: 44px minmax(0, 1fr) 36px 36px;
    gap: 10px;
    height: var(--voice-row-height, 96px);
    padding: 10px 12px;
  }

  .voice-empty {
    height: var(--voice-row-height, 96px);
    padding: 12px;
  }

  .voice-empty strong {
    font-size: 14px;
  }

  .voice-empty span {
    font-size: 12px;
  }

  .voice-record-head {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .voice-modal:has(#voiceValidationPhrase) .voice-record-head {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.04fr) minmax(0, 0.92fr);
    align-items: start;
    gap: 8px;
    padding: 30px 34px 0;
    margin-bottom: 4px;
  }

  .voice-modal:has(#voiceValidationPhrase) .voice-record-left,
  .voice-modal:has(#voiceValidationPhrase) .voice-record-tools {
    width: 100%;
  }

  .voice-modal:has(#voiceValidationPhrase) .voice-record-head h2 {
    font-size: clamp(17px, 4.2vw, 21px);
    line-height: 1.08;
  }

  .voice-modal:has(#voiceValidationPhrase) .voice-record-subtitle {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.2;
  }

  .voice-record-tools {
    width: min(100%, 360px);
    justify-content: center;
  }

  .voice-device-field {
    width: 100%;
    min-width: 0;
    gap: 3px;
    font-size: 10px;
  }

  .voice-device-field select {
    min-width: 0;
    min-height: 32px;
    padding-inline: 7px;
    font-size: 11px;
  }

  .voice-refresh-phrase {
    min-width: 72px;
    padding-inline: 8px;
    white-space: nowrap;
  }

  .voice-verify-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .voice-panel-controls {
    grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr);
    column-gap: 24px;
    row-gap: 8px;
  }

  .voice-rerecord-button,
  .voice-record-play,
  .voice-record-finish {
    padding-inline: 10px;
    font-size: 13px;
  }

  .voice-edit-button {
    grid-column: 3;
    grid-row: 1;
  }

  .voice-delete-button {
    grid-column: 4;
    grid-row: 1;
  }

  .voice-detail-actions {
    grid-template-columns: 1fr;
  }

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

  .voice-tips-grid article {
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    gap: 7px;
    min-height: 92px;
    padding: 9px 7px;
    text-align: left;
  }

  .voice-tips-grid i {
    grid-row: 1 / span 2;
    width: 30px;
    height: 30px;
    align-self: center;
    justify-self: center;
  }

  .voice-tips-grid strong,
  .voice-tips-grid span {
    grid-column: 2;
    text-align: left;
  }

  .voice-tips-grid strong {
    font-size: 12px;
    line-height: 1.22;
  }

  .voice-tips-grid span {
    display: block;
    font-size: 10px;
    line-height: 1.28;
  }

  .voice-modal:has(.voice-record-stage) .voice-tips-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .voice-modal:has(.voice-record-stage) .voice-tips-grid article {
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    min-height: 82px;
    text-align: left;
  }

  .voice-modal:has(.voice-record-stage) .voice-tips-grid i {
    grid-row: 1 / span 2;
    width: 28px;
    height: 28px;
    align-self: center;
    justify-self: center;
  }

  .voice-modal:has(.voice-record-stage) .voice-tips-grid span {
    display: block;
    grid-column: 2;
    text-align: left;
  }

  .voice-modal:has(.voice-record-stage) .voice-tips-grid strong {
    grid-column: 2;
    text-align: left;
  }

  .voice-choice-actions .solid-button,
  .voice-choice-actions .ghost-button,
  .voice-step-actions .solid-button,
  .voice-step-actions .ghost-button {
    width: 100%;
  }

  .voice-language-pill {
    position: static;
    justify-self: center;
  }
}

@media (max-height: 680px), (max-width: 420px) {
  .voice-modal:has(.voice-record-stage) .voice-modal-content {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .voice-record-head {
    margin-bottom: 6px;
  }

  .voice-record-head h2 {
    font-size: clamp(18px, 5vw, 22px);
  }

  .voice-record-subtitle {
    margin-top: 2px;
    font-size: 12px;
  }
}

.auth-provider.primary {
  color: #fff;
  background: var(--grad-action);
  box-shadow: var(--brand-glow);
}

.auth-provider:disabled {
  color: rgba(16, 20, 39, 0.45);
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.46);
}

.auth-provider em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.auth-modal-foot {
  margin: 16px 0 0;
  font-size: 12px;
}

body.auth-modal-open {
  overflow: hidden;
}

.app-dialog-shell {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.app-dialog-shell[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.app-dialog-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(0, 200, 255, 0.16), transparent 32%),
    radial-gradient(circle at 72% 78%, rgba(255, 72, 111, 0.14), transparent 34%),
    rgba(16, 20, 39, 0.26);
  backdrop-filter: blur(7px);
}

.app-dialog {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  width: min(380px, 100%);
  padding: 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(245, 250, 255, 0.92)) padding-box,
    var(--grad-line) border-box;
  box-shadow: 0 24px 70px rgba(13, 23, 54, 0.22), 0 12px 34px rgba(139, 84, 255, 0.12);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.22s ease;
}

.app-dialog-shell[aria-hidden="false"] .app-dialog {
  transform: translateY(0) scale(1);
}

.app-dialog-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--grad-icon);
  box-shadow: var(--brand-glow);
}

.app-dialog-mark img {
  width: 26px;
  height: 26px;
}

.app-dialog-copy {
  min-width: 0;
}

.app-dialog-copy .section-kicker {
  margin-bottom: 4px;
}

.app-dialog h2 {
  margin: 0 0 6px;
  font-size: 19px;
}

.app-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.55;
}

.app-dialog-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.app-dialog-actions .ghost-button,
.app-dialog-actions .solid-button {
  min-height: 36px;
  padding: 0 16px;
}

.app-dialog-actions .solid-button {
  min-width: 86px;
}

body.app-dialog-open {
  overflow: hidden;
}

.voice-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.voice-modal-shell[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.voice-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 79, 139, 0.18), transparent 32%),
    radial-gradient(circle at 82% 74%, rgba(47, 111, 255, 0.16), transparent 34%),
    rgba(8, 12, 24, 0.58);
  backdrop-filter: blur(10px);
}

.voice-modal {
  position: relative;
  width: min(780px, 100%);
  height: min(720px, calc(100dvh - 36px));
  max-height: calc(100dvh - 36px);
  overflow: hidden;
  padding: 32px;
  border: 1px solid rgba(216, 227, 255, 0.16);
  border-radius: 12px;
  color: #f8fbff;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 79, 139, 0.13), transparent 32%),
    radial-gradient(circle at 92% 6%, rgba(47, 111, 255, 0.16), transparent 34%),
    #202a39;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.22s ease;
}

.voice-modal-content {
  display: grid;
  height: 100%;
  min-height: 0;
}

.voice-modal-content:has(.voice-list) {
  --voice-row-height: 122px;
  grid-template-rows: auto var(--voice-row-height) minmax(0, 1fr);
  row-gap: 18px;
}

.voice-modal:has(.voice-record-stage) {
  overflow: hidden;
  padding: clamp(14px, 3dvh, 30px);
}

.voice-modal:has(.voice-record-stage) .voice-modal-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  height: 100%;
  min-height: 0;
}

.voice-modal-shell[aria-hidden="false"] .voice-modal {
  transform: translateY(0) scale(1);
}

.voice-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  color: rgba(235, 241, 255, 0.78);
  background: transparent;
}

.voice-modal-back {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  color: rgba(235, 241, 255, 0.78);
  background: rgba(255, 255, 255, 0.06);
}

.voice-modal-back:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.voice-step-head {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 0 auto 22px;
  text-align: center;
}

.voice-step-head h2 {
  margin: 0;
  color: #fff;
  font-size: 25px;
}

.voice-step-head p {
  max-width: 560px;
  margin: 0;
  color: rgba(219, 226, 241, 0.72);
  line-height: 1.5;
}

.voice-create-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  width: 100%;
  height: var(--voice-row-height, 122px);
  margin-bottom: 0;
  padding: 16px 20px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--grad-action);
  text-align: left;
  box-shadow: 0 18px 40px rgba(255, 79, 139, 0.22);
}

.voice-create-card svg {
  width: 30px;
  height: 30px;
}

.voice-create-card strong,
.voice-create-card small {
  display: block;
}

.voice-create-card strong {
  font-size: 18px;
}

.voice-create-card small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.84);
}

.voice-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: 14px;
  padding-right: 4px;
  border-top: 1px dashed rgba(216, 227, 255, 0.2);
}

.voice-list-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto 40px 40px;
  align-items: center;
  gap: 12px;
  height: 122px;
  padding: 13px 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.11);
}

.voice-list-item.is-selected {
  outline: 1px solid rgba(52, 229, 155, 0.64);
  background: rgba(52, 229, 155, 0.12);
}

.voice-list-item.is-expired {
  opacity: 0.68;
}

.voice-play-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  overflow: hidden;
  border-radius: 14px;
  color: #fff;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.34), transparent 24%),
    var(--grad-icon);
  box-shadow: 0 12px 26px rgba(92, 102, 255, 0.18);
}

.voice-identity-icon::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 50%;
  opacity: 0.72;
}

.voice-identity-ring {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-left-color: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.voice-identity-core {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.voice-identity-core svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.6;
}

.voice-identity-bars {
  position: absolute;
  right: 6px;
  bottom: 7px;
  display: inline-flex;
  align-items: end;
  gap: 2px;
  height: 14px;
}

.voice-identity-bars span {
  width: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
}

.voice-identity-bars span:nth-child(1) {
  height: 6px;
}

.voice-identity-bars span:nth-child(2) {
  height: 11px;
}

.voice-identity-bars span:nth-child(3) {
  height: 8px;
}

.voice-identity-bars span:nth-child(4) {
  height: 13px;
}

.voice-list-item.is-selected .voice-play-button {
  box-shadow: 0 0 0 2px rgba(34, 211, 136, 0.22), 0 12px 26px rgba(92, 102, 255, 0.18);
}

.voice-list-item.is-expired .voice-play-button {
  filter: grayscale(0.35) saturate(0.72);
  opacity: 0.72;
}

.voice-item-main {
  min-width: 0;
}

.voice-item-main strong {
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-expiry {
  display: inline-flex;
  margin-top: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #cbd8f2;
  background: rgba(255, 255, 255, 0.09);
  font-size: 12px;
  font-weight: 900;
}

.voice-expiry.is-error {
  color: #ff6b7d;
  background: rgba(255, 72, 111, 0.12);
}

.voice-use-button,
.voice-edit-button,
.voice-delete-button {
  height: 38px;
  min-height: 38px;
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.voice-saving-card {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: min(420px, 64dvh);
  gap: 10px;
  text-align: center;
}

.voice-saving-card h2 {
  margin: 0;
  color: #fff;
  font-size: 25px;
}

.voice-failed-card > svg {
  width: 54px;
  height: 54px;
  color: #ff5f7c;
}

.voice-failed-card .solid-button {
  min-width: 180px;
  margin-top: 8px;
}

.voice-saving-card p:last-child {
  max-width: 420px;
  margin: 0;
  color: rgba(219, 226, 241, 0.74);
}

.voice-spinner {
  width: 54px;
  height: 54px;
  border: 4px solid rgba(255, 255, 255, 0.16);
  border-top-color: #ff4f8b;
  border-right-color: #2f6fff;
  border-radius: 50%;
  animation: voiceSpin 0.9s linear infinite;
}

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

.voice-detail-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(216, 227, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
}

.voice-detail-field {
  display: grid;
  gap: 7px;
  color: rgba(235, 241, 255, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.voice-detail-field input,
.voice-detail-field textarea,
.voice-detail-field code {
  width: 100%;
  border: 1px solid rgba(216, 227, 255, 0.16);
  border-radius: 9px;
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  font: inherit;
  font-weight: 850;
}

.voice-detail-field input,
.voice-detail-field textarea {
  padding: 12px 13px;
}

.voice-detail-field textarea {
  resize: none;
}

.voice-detail-field code {
  display: block;
  padding: 10px 12px;
  overflow: hidden;
  color: rgba(235, 241, 255, 0.86);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-detail-field small {
  justify-self: end;
  color: rgba(219, 226, 241, 0.52);
}

.voice-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.voice-detail-meta span {
  padding: 5px 9px;
  border-radius: 999px;
  color: rgba(235, 241, 255, 0.76);
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.voice-detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.voice-reverify-button {
  justify-self: start;
}

.voice-empty {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  height: var(--voice-row-height, 122px);
  padding: 22px;
  border: 1px dashed rgba(216, 227, 255, 0.22);
  border-radius: 10px;
  color: rgba(219, 226, 241, 0.72);
  text-align: center;
}

.voice-upload-zone,
.voice-consent-card,
.voice-tips-grid article,
.voice-wave-card,
.voice-record-pad {
  border: 1px solid rgba(216, 227, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.voice-upload-zone {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 30px 20px;
  border-style: dashed;
  text-align: center;
}

.voice-upload-zone h3,
.voice-upload-zone p {
  margin: 0;
}

.voice-upload-zone p,
.voice-recording-status,
.voice-tips-grid span {
  color: rgba(219, 226, 241, 0.7);
}

.voice-choice-actions,
.voice-step-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.voice-choice-actions .solid-button,
.voice-choice-actions .ghost-button,
.voice-step-actions .solid-button,
.voice-step-actions .ghost-button {
  width: min(160px, 42vw);
  min-height: 0;
  height: 44px;
  padding: 0 22px;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  line-height: 1;
  overflow: hidden;
  text-overflow: clip;
  font-size: clamp(12px, 2.5vw, 14px);
}

.voice-choice-actions .solid-button svg,
.voice-choice-actions .ghost-button svg,
.voice-step-actions .solid-button svg,
.voice-step-actions .ghost-button svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.voice-file-label {
  cursor: pointer;
}

.voice-consent-card {
  margin-bottom: 16px;
  padding: 0;
  overflow: hidden;
  border-color: rgba(255, 79, 139, 0.52);
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.12), rgba(47, 111, 255, 0.1));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035), 0 12px 30px rgba(255, 79, 139, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  animation: voiceConsentBreath 2.2s ease-in-out infinite;
}

.voice-consent-card.needs-attention {
  border-color: rgba(255, 79, 139, 0.95);
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.2), rgba(139, 92, 246, 0.16), rgba(47, 111, 255, 0.12));
  box-shadow: 0 0 0 3px rgba(255, 79, 139, 0.14), 0 18px 42px rgba(255, 79, 139, 0.15);
}

.voice-consent-card:has(#voiceConsentInput:checked) {
  border-color: rgba(52, 229, 155, 0.56);
  background:
    linear-gradient(135deg, rgba(52, 229, 155, 0.12), rgba(47, 111, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  animation: none;
}

@keyframes voiceConsentBreath {
  0%,
  100% {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035), 0 0 0 0 rgba(255, 79, 139, 0.14), 0 12px 30px rgba(255, 79, 139, 0.08);
  }
  50% {
    border-color: rgba(255, 79, 139, 0.92);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 0 4px rgba(255, 79, 139, 0.12), 0 18px 46px rgba(255, 79, 139, 0.18);
  }
}

.voice-consent-line {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 14px 16px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 780;
  line-height: 1.55;
}

.voice-consent-line input {
  accent-color: var(--brand-violet);
  transform: translateY(2px);
}

.voice-tips-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 1.6dvh, 12px);
  margin-top: clamp(6px, 1.6dvh, 16px);
}

.voice-tips-grid article {
  display: grid;
  grid-template-columns: clamp(30px, 5.5dvh, 42px) minmax(0, 1fr);
  gap: clamp(7px, 1.3dvh, 10px);
  padding: clamp(8px, 1.6dvh, 14px);
  align-items: center;
}

.voice-tips-grid i {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: clamp(30px, 5dvh, 38px);
  height: clamp(30px, 5dvh, 38px);
  align-self: center;
  justify-self: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.voice-tips-grid strong,
.voice-tips-grid span {
  grid-column: 2;
  min-width: 0;
  margin: 0;
  text-align: left;
  writing-mode: horizontal-tb;
  word-break: normal;
  overflow-wrap: break-word;
}

.voice-tips-grid strong {
  align-self: end;
  color: #fff;
  font-size: clamp(13px, 1.9dvh, 15px);
  line-height: 1.35;
}

.voice-tips-grid span {
  display: block;
  align-self: start;
  font-size: clamp(12px, 1.65dvh, 14px);
  line-height: 1.5;
}

.voice-wave-card {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.voice-trim-time {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--grad-action);
  font-weight: 900;
}

.voice-wave-canvas {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 132px;
  border: 1px solid rgba(34, 211, 136, 0.88);
  border-radius: 8px;
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
}

.voice-wave-canvas.is-dragging {
  z-index: 8;
  cursor: grabbing;
}

body.voice-trim-dragging {
  overflow: hidden;
  touch-action: none;
}

.voice-wave-canvas.is-trim-locked {
  cursor: default;
  border-style: dashed;
  opacity: 0.86;
}

.voice-trim-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.voice-trim-play {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(216, 227, 255, 0.2);
  border-radius: 999px;
  color: #172033;
  background: #fff;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}

.voice-trim-play svg {
  width: 20px;
  height: 20px;
}

#voiceTrimPlaybackTime {
  min-width: 48px;
  color: rgba(235, 241, 255, 0.72);
  font-size: 14px;
  font-weight: 900;
}

.voice-record-head {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 150px;
  align-items: start;
  gap: 12px;
  padding-inline: 44px;
  margin-bottom: clamp(6px, 1.5dvh, 18px);
  text-align: center;
}

.voice-record-head h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(20px, 3.1dvh, 25px);
}

.voice-record-subtitle {
  margin: 5px 0 0;
  color: rgba(235, 241, 255, 0.68);
  font-size: 13px;
  font-weight: 820;
}

.voice-record-tools {
  display: grid;
  gap: 8px;
}

.voice-record-left {
  display: grid;
  align-content: start;
}

.voice-device-field {
  display: grid;
  gap: 5px;
  color: rgba(235, 241, 255, 0.72);
  font-size: 12px;
  font-weight: 900;
  text-align: left;
}

.voice-device-field select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid rgba(216, 227, 255, 0.16);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-device-field select option {
  color: #172033;
  background: #fff;
}

.voice-refresh-phrase {
  position: absolute;
  right: 10px;
  bottom: 10px;
  border-color: rgba(139, 92, 246, 0.38);
  color: rgba(255, 255, 255, 0.94);
  min-height: 34px;
  padding-inline: 10px;
  font-size: 12px;
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.22), rgba(139, 92, 246, 0.2), rgba(47, 111, 255, 0.18)),
    rgba(20, 30, 48, 0.72);
  backdrop-filter: blur(10px);
}

.voice-refresh-phrase:disabled {
  border-color: rgba(216, 227, 255, 0.12);
  color: rgba(235, 241, 255, 0.58);
  background: rgba(255, 255, 255, 0.065);
  opacity: 1;
  cursor: not-allowed;
}

.voice-record-stage {
  display: grid;
  justify-items: center;
  gap: clamp(6px, 1.55dvh, 14px);
  min-height: 0;
  padding: clamp(2px, 0.9dvh, 8px) 0 clamp(5px, 1.4dvh, 16px);
}

.voice-record-time {
  color: rgba(235, 241, 255, 0.7);
  font-size: clamp(16px, 2.8dvh, 22px);
  font-weight: 800;
}

.voice-record-stage p {
  margin: 0;
  color: rgba(235, 241, 255, 0.82);
  font-size: clamp(13px, 2.1dvh, 17px);
  font-weight: 760;
  text-align: center;
}

.voice-phrase-wrap {
  position: relative;
  width: min(100%, 620px);
}

.voice-live-canvas {
  width: 100%;
  height: clamp(48px, 14dvh, 112px);
  border-bottom: 1px dashed rgba(216, 227, 255, 0.16);
}

.voice-panel-controls {
  display: grid;
  grid-template-columns: minmax(0, 130px) clamp(68px, 12dvh, 96px) minmax(0, 130px);
  align-items: center;
  justify-content: center;
  column-gap: clamp(20px, 4.2dvh, 32px);
  row-gap: 10px;
  width: 100%;
}

.voice-record-main {
  justify-self: center;
}

.voice-record-main svg {
  width: 30px;
  height: 30px;
  color: rgba(255, 255, 255, 0.94);
  stroke-width: 2.8;
  filter: drop-shadow(0 2px 4px rgba(190, 18, 60, 0.22));
}

.voice-rerecord-button,
.voice-record-play,
.voice-record-finish,
.voice-verify-upload {
  height: 46px;
  min-height: 0;
}

.voice-record-finish:disabled,
.voice-record-play:disabled,
.voice-rerecord-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.voice-verify-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 168px));
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.voice-verify-upload {
  justify-self: center;
  margin-top: -2px;
  width: 100%;
}

.voice-phrase-compact {
  min-height: clamp(52px, 10dvh, 78px);
  width: 100%;
  padding: clamp(10px, 2dvh, 18px);
  padding-right: clamp(108px, 22vw, 132px);
  border: 1px solid rgba(216, 227, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  font-size: clamp(18px, 4vw, 30px);
}

.voice-phrase-compact.is-loading {
  color: rgba(235, 241, 255, 0.62);
  font-size: clamp(16px, 3vw, 22px);
}

.voice-step-actions {
  margin-top: 18px;
}

.voice-step-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
}

.voice-step-dots span {
  width: 58px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.32);
}

.voice-step-dots span.active {
  background: rgba(255, 255, 255, 0.86);
}

.voice-validation-head {
  position: relative;
}

.voice-language-pill {
  position: absolute;
  right: 12px;
  top: 0;
  padding: 8px 14px;
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 900;
}

.voice-phrase {
  min-height: 118px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 950;
  text-align: center;
}

.voice-record-pad {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 24px 18px;
  border-style: dashed;
}

.voice-record-pad p {
  margin: 0;
  color: rgba(219, 226, 241, 0.72);
}

.voice-record-button {
  width: clamp(62px, 11dvh, 86px);
  height: clamp(62px, 11dvh, 86px);
  border: clamp(6px, 1dvh, 8px) solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: #ff404b;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22), 0 18px 34px rgba(255, 64, 75, 0.22);
}

.voice-record-button.is-recording,
[data-record-source].is-recording,
[data-record-verify].is-recording {
  animation: voicePulse 1s infinite ease-in-out;
}

@keyframes voicePulse {
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 0 8px rgba(255, 64, 75, 0.14);
  }
}

.voice-modal-backdrop {
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 79, 139, 0.16), transparent 32%),
    radial-gradient(circle at 84% 74%, rgba(47, 111, 255, 0.16), transparent 34%),
    rgba(245, 249, 255, 0.72);
  backdrop-filter: blur(14px);
}

.voice-modal {
  color: var(--ink);
  border-color: rgba(47, 111, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 251, 255, 0.92)),
    radial-gradient(circle at 18% 4%, rgba(255, 79, 139, 0.1), transparent 34%),
    radial-gradient(circle at 92% 10%, rgba(47, 111, 255, 0.1), transparent 36%);
  box-shadow: 0 34px 90px rgba(47, 84, 158, 0.2);
}

.voice-modal-close,
.voice-modal-back {
  color: var(--muted);
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 255, 0.9)) padding-box,
    linear-gradient(135deg, rgba(255, 79, 139, 0.28), rgba(139, 92, 246, 0.24), rgba(47, 111, 255, 0.24)) border-box;
  box-shadow: 0 12px 28px rgba(47, 84, 158, 0.13);
}

.voice-modal-back:hover,
.voice-modal-close:hover {
  color: var(--brand-violet);
  background:
    linear-gradient(180deg, #fff, rgba(247, 250, 255, 0.96)) padding-box,
    var(--grad-line) border-box;
  box-shadow: 0 14px 32px rgba(139, 92, 246, 0.16);
}

.voice-step-head h2,
.voice-saving-card h2,
.voice-record-head h2,
.voice-item-main strong,
.voice-upload-zone h3,
.voice-tips-grid strong,
.voice-phrase {
  color: var(--ink);
}

.voice-step-head p,
.voice-saving-card p:last-child,
.voice-empty,
.voice-upload-zone p,
.voice-recording-status,
.voice-tips-grid span,
.voice-record-subtitle,
.voice-record-time,
.voice-record-stage p,
.voice-record-pad p,
#voiceTrimPlaybackTime {
  color: var(--muted);
}

.voice-list {
  border-top-color: rgba(47, 111, 255, 0.14);
}

.voice-list-item,
.voice-empty,
.voice-upload-zone,
.voice-tips-grid article,
.voice-wave-card,
.voice-record-pad,
.voice-detail-panel,
.voice-phrase-compact {
  border: 1px solid rgba(47, 111, 255, 0.16);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(240, 247, 255, 0.72));
  box-shadow: 0 14px 32px rgba(47, 84, 158, 0.08);
}

.voice-list-item.is-selected {
  outline: 0;
  border: 1px solid rgba(34, 211, 136, 0.58);
  background:
    linear-gradient(135deg, rgba(236, 255, 248, 0.94), rgba(244, 250, 255, 0.86));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), 0 14px 32px rgba(47, 84, 158, 0.08);
}

.voice-list-item.is-expired {
  opacity: 1;
  border-color: rgba(255, 79, 139, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 244, 248, 0.92), rgba(250, 252, 255, 0.82));
}

.voice-play-button {
  color: #fff;
  background: var(--grad-icon);
  box-shadow: 0 12px 26px rgba(92, 102, 255, 0.18);
}

.voice-expiry {
  color: #65728c;
  background: rgba(238, 244, 255, 0.94);
  border: 1px solid rgba(47, 111, 255, 0.13);
}

.voice-expiry.is-error {
  color: #e11d48;
  background: rgba(255, 242, 246, 0.96);
  border-color: rgba(225, 29, 72, 0.2);
}

.voice-use-button,
.voice-edit-button,
.voice-delete-button,
.voice-refresh-phrase,
.voice-language-pill {
  color: var(--ink);
  border-color: rgba(47, 111, 255, 0.16);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(241, 247, 255, 0.84));
  box-shadow: 0 10px 24px rgba(47, 84, 158, 0.08);
}

.voice-use-button:hover,
.voice-edit-button:hover,
.voice-delete-button:hover,
.voice-refresh-phrase:hover {
  color: var(--brand-violet);
  border-color: rgba(139, 92, 246, 0.32);
}

.voice-refresh-phrase:disabled {
  color: #9aa5b8;
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(241, 245, 249, 0.88);
}

.voice-consent-card {
  border-color: rgba(255, 79, 139, 0.48);
  background:
    linear-gradient(135deg, rgba(255, 246, 250, 0.92), rgba(245, 249, 255, 0.88));
  box-shadow: 0 12px 30px rgba(255, 79, 139, 0.08);
}

.voice-consent-card:has(#voiceConsentInput:checked) {
  border-color: rgba(34, 211, 136, 0.5);
  background:
    linear-gradient(135deg, rgba(236, 255, 248, 0.9), rgba(245, 249, 255, 0.86));
}

.voice-consent-line {
  color: var(--ink);
}

.voice-tips-grid i {
  color: var(--brand-violet);
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.12), rgba(47, 111, 255, 0.12));
}

.voice-detail-field {
  color: var(--muted);
}

.voice-detail-field input,
.voice-detail-field textarea,
.voice-detail-field code,
.voice-device-field select {
  color: var(--ink);
  border-color: rgba(47, 111, 255, 0.16);
  background: rgba(255, 255, 255, 0.9);
}

.voice-detail-field code {
  color: var(--muted);
}

.voice-detail-field small,
.voice-detail-meta span,
.voice-device-field {
  color: var(--muted);
}

.voice-detail-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(47, 111, 255, 0.16);
  color: #334155;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(235, 242, 255, 0.9));
  box-shadow: 0 8px 18px rgba(47, 84, 158, 0.08);
}

.voice-spinner {
  border-color: rgba(47, 111, 255, 0.16);
  border-top-color: #ff4f8b;
  border-right-color: #2f6fff;
}

.voice-live-canvas {
  border-bottom-color: rgba(47, 111, 255, 0.16);
}

.voice-wave-canvas {
  background:
    linear-gradient(90deg, rgba(255, 79, 139, 0.08), rgba(47, 111, 255, 0.08));
}

.voice-step-dots span {
  background: rgba(47, 111, 255, 0.16);
}

.voice-step-dots span.active {
  background: var(--grad-action);
}

.voice-modal .icon-button svg,
.voice-modal .ghost-button svg,
.voice-modal .voice-use-button svg,
.voice-modal .voice-edit-button svg,
.voice-modal .voice-delete-button svg,
.voice-modal .voice-modal-close svg,
.voice-modal .voice-modal-back svg {
  color: currentColor;
  stroke: currentColor;
}

.voice-modal-close,
.voice-modal-back,
.voice-edit-button,
.voice-delete-button {
  color: #6b5bff;
}

.voice-tips-grid,
.voice-modal:has(.voice-record-stage) .voice-tips-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.voice-tips-grid article,
.voice-modal:has(.voice-record-stage) .voice-tips-grid article {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: start;
  gap: 4px 12px;
  min-height: 92px;
  padding: 14px 16px;
  text-align: left;
}

.voice-tips-grid i,
.voice-tips-grid svg,
.voice-modal:has(.voice-record-stage) .voice-tips-grid i,
.voice-modal:has(.voice-record-stage) .voice-tips-grid svg {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: center;
  width: 20px;
  height: 20px;
  color: var(--ink);
  stroke: currentColor;
  background: transparent;
}

.voice-tips-grid strong,
.voice-tips-grid span,
.voice-modal:has(.voice-record-stage) .voice-tips-grid strong,
.voice-modal:has(.voice-record-stage) .voice-tips-grid span {
  grid-column: 2;
  min-width: 0;
  text-align: left;
}

.voice-tips-grid strong,
.voice-modal:has(.voice-record-stage) .voice-tips-grid strong {
  align-self: end;
  font-size: 15px;
  line-height: 1.35;
}

.voice-tips-grid span,
.voice-modal:has(.voice-record-stage) .voice-tips-grid span {
  display: block;
  align-self: start;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-height: 720px) {
  .voice-modal:has(.voice-record-stage) {
    padding: 12px 16px;
  }

  .voice-device-field {
    gap: 3px;
    font-size: 11px;
  }

  .voice-device-field select {
    min-height: 34px;
  }

  .voice-live-canvas {
    height: 52px;
  }

  .voice-panel-controls {
    grid-template-columns: minmax(0, 116px) 64px minmax(0, 116px);
    column-gap: 22px;
  }

  .voice-rerecord-button,
  .voice-record-play,
  .voice-record-finish,
  .voice-verify-upload {
    height: 38px;
    min-height: 0;
    font-size: 12px;
  }

  .voice-step-dots {
    margin-top: 8px;
  }
}

body.voice-modal-open {
  overflow: hidden;
}

.voice-modal:has(#voiceValidationPhrase) .voice-modal-content {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.voice-modal:has(#voiceValidationPhrase) .voice-record-stage {
  align-content: center;
}

.voice-modal:has(#voiceValidationPhrase) .voice-step-dots {
  align-self: end;
}

@media (max-width: 680px) {
  .model-voice-stack {
    justify-items: stretch;
    width: min(100%, 230px);
  }

  .model-select-pill,
  .custom-voice-button {
    width: 100%;
  }

  .style-custom-voice-button {
    width: calc(50% - 4px);
    max-width: calc(50% - 4px);
  }

  .voice-modal-shell {
    align-items: end;
    padding: 10px;
  }

  .voice-modal {
    width: 100%;
    max-height: calc(100dvh - 20px);
    padding: 24px 18px;
    border-radius: 14px;
  }

  .voice-modal-content:has(.voice-list) {
    --voice-row-height: 96px;
    row-gap: 12px;
  }

  .voice-create-card {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    padding: 12px 14px;
  }

  .voice-create-card svg {
    width: 25px;
    height: 25px;
  }

  .voice-create-card strong {
    font-size: 15px;
  }

  .voice-create-card small {
    font-size: 12px;
  }

  .voice-modal:has(.voice-record-stage) {
    padding: clamp(12px, 2.5dvh, 18px);
  }

  .voice-list-item {
    grid-template-columns: 44px minmax(0, 1fr) 36px 36px;
    gap: 10px;
    height: var(--voice-row-height, 96px);
    padding: 10px 12px;
  }

  .voice-empty {
    height: var(--voice-row-height, 96px);
    padding: 12px;
  }

  .voice-empty strong {
    font-size: 14px;
  }

  .voice-empty span {
    font-size: 12px;
  }

  .voice-record-head {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .voice-modal:has(#voiceValidationPhrase) .voice-record-head {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.04fr) minmax(0, 0.92fr);
    align-items: start;
    gap: 8px;
    padding: 30px 34px 0;
    margin-bottom: 4px;
  }

  .voice-modal:has(#voiceValidationPhrase) .voice-record-left,
  .voice-modal:has(#voiceValidationPhrase) .voice-record-tools {
    width: 100%;
  }

  .voice-modal:has(#voiceValidationPhrase) .voice-record-head h2 {
    font-size: clamp(17px, 4.2vw, 21px);
    line-height: 1.08;
  }

  .voice-modal:has(#voiceValidationPhrase) .voice-record-subtitle {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.2;
  }

  .voice-record-tools {
    width: min(100%, 360px);
    justify-content: center;
  }

  .voice-device-field {
    width: 100%;
    min-width: 0;
    gap: 3px;
    font-size: 10px;
  }

  .voice-device-field select {
    min-width: 0;
    min-height: 32px;
    padding-inline: 7px;
    font-size: 11px;
  }

  .voice-refresh-phrase {
    min-width: 72px;
    padding-inline: 8px;
    white-space: nowrap;
  }

  .voice-verify-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .voice-panel-controls {
    grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr);
    column-gap: 24px;
    row-gap: 8px;
  }

  .voice-rerecord-button,
  .voice-record-play,
  .voice-record-finish {
    padding-inline: 10px;
    font-size: 13px;
  }

  .voice-edit-button {
    grid-column: 3;
    grid-row: 1;
  }

  .voice-delete-button {
    grid-column: 4;
    grid-row: 1;
  }

  .voice-detail-actions {
    grid-template-columns: 1fr;
  }

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

  .voice-tips-grid article {
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    gap: 7px;
    min-height: 92px;
    padding: 9px 7px;
    text-align: left;
  }

  .voice-tips-grid i {
    grid-row: 1 / span 2;
    width: 30px;
    height: 30px;
    align-self: center;
    justify-self: center;
  }

  .voice-tips-grid strong,
  .voice-tips-grid span {
    grid-column: 2;
    text-align: left;
  }

  .voice-tips-grid strong {
    font-size: 12px;
    line-height: 1.22;
  }

  .voice-tips-grid span {
    display: block;
    font-size: 10px;
    line-height: 1.28;
  }

  .voice-modal:has(.voice-record-stage) .voice-tips-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .voice-modal:has(.voice-record-stage) .voice-tips-grid article {
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    min-height: 82px;
    text-align: left;
  }

  .voice-modal:has(.voice-record-stage) .voice-tips-grid i {
    grid-row: 1 / span 2;
    width: 28px;
    height: 28px;
    align-self: center;
    justify-self: center;
  }

  .voice-modal:has(.voice-record-stage) .voice-tips-grid span {
    display: block;
    grid-column: 2;
    text-align: left;
  }

  .voice-modal:has(.voice-record-stage) .voice-tips-grid strong {
    grid-column: 2;
    text-align: left;
  }

  .voice-choice-actions .solid-button,
  .voice-choice-actions .ghost-button,
  .voice-step-actions .solid-button,
  .voice-step-actions .ghost-button {
    width: min(160px, calc(50% - 8px));
    gap: 6px;
    padding: 0 12px;
    font-size: clamp(12px, 3vw, 14px);
  }

  .voice-language-pill {
    position: static;
    justify-self: center;
  }
}

.voice-step-actions .solid-button,
.voice-step-actions .ghost-button {
  width: 100%;
}

@media (max-height: 680px), (max-width: 420px) {
  .voice-modal:has(.voice-record-stage) .voice-modal-content {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .voice-record-head {
    margin-bottom: 6px;
  }

  .voice-record-head h2 {
    font-size: clamp(18px, 5vw, 22px);
  }

  .voice-record-subtitle {
    margin-top: 2px;
    font-size: 12px;
  }

  .voice-record-tools {
    gap: 6px;
  }

  .voice-device-field {
    gap: 2px;
    font-size: 10px;
  }

  .voice-device-field select {
    min-height: 32px;
  }

  .voice-phrase-compact {
    min-height: 48px;
    padding: 9px 92px 9px 10px;
    font-size: clamp(16px, 4.2vw, 24px);
  }

  .voice-record-time {
    font-size: 16px;
  }

  .voice-record-stage p {
    font-size: 12px;
  }

  .voice-live-canvas {
    height: 48px;
  }

  .voice-panel-controls {
    grid-template-columns: minmax(0, 108px) 58px minmax(0, 108px);
    column-gap: 22px;
    row-gap: 7px;
  }

  .voice-record-button {
    width: 58px;
    height: 58px;
  }

  .voice-rerecord-button,
  .voice-record-play,
  .voice-record-finish,
  .voice-verify-upload {
    height: 34px;
    min-height: 0;
    font-size: 11px;
  }
}

.voice-tips-grid,
.voice-modal:has(.voice-record-stage) .voice-tips-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.voice-tips-grid article,
.voice-modal:has(.voice-record-stage) .voice-tips-grid article {
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: start;
  gap: 4px 12px;
  min-height: 92px;
  padding: 14px 16px;
  text-align: left;
}

.voice-tips-grid i,
.voice-tips-grid svg,
.voice-modal:has(.voice-record-stage) .voice-tips-grid i,
.voice-modal:has(.voice-record-stage) .voice-tips-grid svg {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: center;
  width: 20px;
  height: 20px;
  color: var(--ink);
  stroke: currentColor;
  background: transparent;
}

.voice-tips-grid strong,
.voice-tips-grid span,
.voice-modal:has(.voice-record-stage) .voice-tips-grid strong,
.voice-modal:has(.voice-record-stage) .voice-tips-grid span {
  grid-column: 2;
  text-align: left;
}

.voice-tips-grid strong,
.voice-modal:has(.voice-record-stage) .voice-tips-grid strong {
  align-self: end;
  font-size: 15px;
  line-height: 1.35;
}

.voice-tips-grid span,
.voice-modal:has(.voice-record-stage) .voice-tips-grid span {
  align-self: start;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 680px) {
  .voice-tips-grid,
  .voice-modal:has(.voice-record-stage) .voice-tips-grid {
    gap: 8px;
    margin-top: 8px;
  }

  .voice-tips-grid article,
  .voice-modal:has(.voice-record-stage) .voice-tips-grid article {
    grid-template-columns: 30px minmax(0, 1fr);
    min-height: 82px;
    padding: 9px 8px;
    gap: 3px 8px;
  }

  .voice-tips-grid i,
  .voice-tips-grid svg,
  .voice-modal:has(.voice-record-stage) .voice-tips-grid i,
  .voice-modal:has(.voice-record-stage) .voice-tips-grid svg {
    width: 18px;
    height: 18px;
  }

  .voice-tips-grid strong,
  .voice-modal:has(.voice-record-stage) .voice-tips-grid strong {
    font-size: 12px;
    line-height: 1.22;
  }

  .voice-tips-grid span,
  .voice-modal:has(.voice-record-stage) .voice-tips-grid span {
    font-size: 10px;
    line-height: 1.28;
  }
}

.page-section {
  position: relative;
  z-index: auto;
  display: grid;
  align-items: center;
  min-height: 100vh;
  padding: 96px clamp(18px, 4vw, 56px) 42px;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: transparent;
}

body.player-open .page-section {
  padding-bottom: max(42px, 88px);
}

.page-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(49, 87, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 87, 255, 0.07) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.55));
}

.intro-page {
  background: transparent;
}

.intro-page::before {
  background-image:
    linear-gradient(rgba(49, 87, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 87, 255, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.72) 62%, transparent 100%);
}

.intro-shell {
  position: relative;
  z-index: 2;
  width: min(900px, 100%);
  margin: 0 auto;
  text-align: center;
}

.intro-shell .hero-subtitle {
  margin-left: auto;
  margin-right: auto;
}

.intro-actions {
  display: flex;
  justify-content: center;
  margin: 32px 0 24px;
}

.hero-cta {
  min-height: 68px;
  padding: 0 42px;
  border-radius: 10px;
  font-size: 22px;
  letter-spacing: 0;
}

.intro-shell .hero-metrics {
  justify-content: center;
}

.hero {
  position: relative;
  min-height: 91vh;
  overflow: hidden;
  padding: 112px clamp(18px, 4vw, 56px) 36px;
  background:
    linear-gradient(120deg, rgba(0, 200, 255, 0.16), transparent 32%),
    linear-gradient(300deg, rgba(255, 72, 111, 0.16), transparent 34%),
    linear-gradient(180deg, #f7fbff 0%, #ffffff 56%, #fff6ec 100%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(49, 87, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 87, 255, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.7) 54%, transparent 100%);
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22%;
  background: linear-gradient(180deg, transparent, #ffffff);
}

.tech-field {
  position: absolute;
  inset: 82px 0 0;
  pointer-events: none;
  z-index: 0;
}

.signal-panel {
  position: absolute;
  display: flex;
  align-items: end;
  gap: 7px;
  padding: 14px;
  border: 1px solid rgba(49, 87, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 18px 54px rgba(0, 200, 255, 0.13);
  backdrop-filter: blur(12px);
  opacity: 0.56;
}

.signal-panel span {
  width: 9px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--coral), var(--aqua));
  animation: signalPulse 1.2s infinite ease-in-out alternate;
}

.signal-panel span:nth-child(1) { height: 28px; }
.signal-panel span:nth-child(2) { height: 62px; animation-delay: 0.12s; }
.signal-panel span:nth-child(3) { height: 42px; animation-delay: 0.24s; }
.signal-panel span:nth-child(4) { height: 76px; animation-delay: 0.36s; }
.signal-panel span:nth-child(5) { height: 36px; animation-delay: 0.48s; }
.signal-panel span:nth-child(6) { height: 54px; animation-delay: 0.6s; }

.panel-a {
  right: clamp(14px, 3vw, 52px);
  top: clamp(118px, 14vh, 158px);
  transform: scale(0.66) rotate(2deg);
}

.panel-b {
  left: clamp(18px, 4vw, 58px);
  bottom: clamp(42px, 8vh, 96px);
  transform: scale(0.56) rotate(-3deg);
  opacity: 0.34;
}

.sound-rings {
  position: absolute;
  left: clamp(14px, 3vw, 44px);
  top: clamp(8px, 3vh, 30px);
  width: 132px;
  height: 132px;
  opacity: 0.28;
}

.sound-rings span {
  position: absolute;
  border: 1px solid rgba(138, 92, 255, 0.28);
  border-radius: 50%;
  transform: rotateX(68deg) rotateZ(-18deg);
}

.sound-rings span:nth-child(1) {
  inset: 0;
  border-color: rgba(255, 72, 111, 0.28);
}

.sound-rings span:nth-child(2) {
  inset: 30px;
  border-color: rgba(0, 200, 255, 0.34);
}

.sound-rings span:nth-child(3) {
  inset: 56px;
  border-color: rgba(52, 229, 155, 0.36);
}

.album-stack {
  position: absolute;
  right: clamp(12px, 3vw, 44px);
  bottom: clamp(42px, 8vh, 98px);
  width: 126px;
  height: 126px;
  opacity: 0.38;
}

.album-stack span {
  position: absolute;
  width: 84px;
  height: 84px;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(13, 23, 54, 0.16);
}

.album-stack span:nth-child(1) {
  left: 0;
  top: 22px;
  background: linear-gradient(135deg, var(--lemon), var(--coral));
  transform: rotate(-12deg);
}

.album-stack span:nth-child(2) {
  left: 24px;
  top: 4px;
  background: linear-gradient(135deg, var(--aqua), var(--blue));
  transform: rotate(8deg);
}

.album-stack span:nth-child(3) {
  left: 38px;
  top: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.32), transparent),
    linear-gradient(135deg, var(--mint), var(--violet));
  transform: rotate(18deg);
}

@keyframes signalPulse {
  to {
    transform: scaleY(0.48);
    filter: hue-rotate(34deg);
  }
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(390px, 540px);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  max-width: 1220px;
  margin: 0 auto;
}

.hero-copy {
  max-width: 660px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  font-size: clamp(44px, 8vw, 92px);
  line-height: 0.96;
  font-weight: 950;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.04;
}

h3 {
  margin-bottom: 8px;
}

.hero-subtitle {
  max-width: 580px;
  color: #293247;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.7;
}

.hero-metrics {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-metrics span {
  padding: 10px 14px;
  border: 1px solid rgba(16, 20, 38, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(13, 23, 54, 0.08);
}

.hero-metrics strong {
  color: var(--coral);
}

.studio-panel {
  position: relative;
  height: 100%;
  padding: clamp(14px, 2vh, 20px);
  border: 1px solid rgba(49, 87, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.76)),
    linear-gradient(135deg, rgba(0, 200, 255, 0.12), rgba(255, 72, 111, 0.1));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.create-page {
  background: transparent;
}

.create-layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
  align-items: stretch;
  height: min(620px, calc(100vh - 132px));
  min-height: 500px;
  max-height: calc(100vh - 132px);
}

.create-layout > .studio-panel,
.create-layout > .style-lab-panel {
  width: 100%;
  min-width: 0;
  height: 100%;
  max-height: none;
}

.create-layout.no-history {
  grid-template-columns: minmax(420px, 560px);
  justify-content: center;
}

.create-layout.no-history .result-panel {
  display: none;
}

.result-panel,
.style-lab-panel,
.lyrics-stage-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  max-height: calc(100vh - 150px);
  overflow: hidden;
  padding: clamp(14px, 2vh, 18px);
  border: 1px solid rgba(49, 87, 255, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 251, 255, 0.88));
  box-shadow: 0 18px 48px rgba(13, 23, 54, 0.08);
}

.style-lab-panel {
  --right-control-gap: 10px;
  gap: clamp(10px, 1.4vh, 14px);
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 249, 255, 0.82)),
    radial-gradient(circle at 20% 20%, rgba(255, 79, 139, 0.14), transparent 32%),
    radial-gradient(circle at 86% 14%, rgba(47, 111, 255, 0.14), transparent 34%);
}

@media (min-width: 681px) {
  .create-page {
    padding-top: clamp(76px, 10vh, 92px);
    padding-bottom: clamp(18px, 3vh, 28px);
  }

  .create-layout {
    height: min(650px, calc(100svh - 110px));
    min-height: 0;
    max-height: calc(100svh - 110px);
    gap: clamp(18px, 3vw, 42px);
  }

  .create-layout > .studio-panel,
  .create-layout > .style-lab-panel {
    min-height: 0;
    overflow: hidden;
  }

  .style-lab-panel {
    gap: clamp(7px, 1vh, 10px);
    padding: clamp(12px, 1.6vh, 16px);
    overflow: hidden;
  }

  .style-lab-panel h3 {
    margin-bottom: 4px;
    font-size: clamp(21px, 2vw, 24px);
  }

  .style-lab-panel p {
    font-size: 12px;
    line-height: 1.38;
  }

  .style-lab-panel .chips-group {
    gap: 7px;
    margin-bottom: 0;
  }

  .style-lab-panel .style-chip,
  .style-lab-panel .instrument-chip {
    min-height: 28px;
    padding: 0 10px;
    font-size: 12px;
  }

  .style-lab-panel .mood-map {
    min-height: clamp(138px, 22vh, 172px);
  }

  .style-lab-panel .mood-readout {
    gap: 8px;
  }

  .style-lab-panel .mood-readout span {
    padding: 7px 10px;
    font-size: 12px;
  }

  .style-lab-panel .right-control-grid {
    gap: 9px;
  }

  .style-lab-panel .field-block {
    gap: 5px;
    margin-bottom: 0;
  }

  .style-lab-panel select {
    height: 40px;
  }

  .style-submit-row {
    gap: 7px;
  }

  .style-submit-row .generate-button {
    min-height: 40px;
  }

  .style-submit-row .cost-note {
    font-size: 11px;
    line-height: 1.35;
  }
}

.style-lab-panel h3,
.lyrics-stage-panel h3 {
  margin: 0 0 6px;
  font-size: 24px;
}

.style-lab-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.style-lab-chips {
  margin-bottom: 0;
}

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

.text-tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.96), rgba(139, 92, 246, 0.94), rgba(39, 177, 255, 0.96)) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.12)) border-box;
  box-shadow: 0 10px 24px rgba(139, 92, 246, 0.2);
  font-size: 12px;
  font-weight: 900;
}

.text-tool-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(255, 79, 139, 0.18), 0 10px 24px rgba(39, 177, 255, 0.16);
}

.text-tool-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.inspiration-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
}

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

.inspiration-tag {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #2f3654;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(247, 250, 255, 0.84)) padding-box,
    linear-gradient(135deg, rgba(255, 79, 139, 0.55), rgba(139, 92, 246, 0.5), rgba(39, 177, 255, 0.5)) border-box;
  box-shadow: 0 8px 18px rgba(49, 87, 255, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.inspiration-tag:hover {
  color: #ffffff;
  background: var(--grad-action);
  box-shadow: 0 12px 24px rgba(139, 92, 246, 0.18);
}

.mood-map {
  position: relative;
  min-height: 178px;
  isolation: isolate;
  border: 1px solid transparent;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(247, 251, 255, 0.68)) padding-box,
    radial-gradient(circle at 82% 18%, rgba(255, 79, 139, 0.15), transparent 34%) padding-box,
    radial-gradient(circle at 20% 82%, rgba(32, 189, 233, 0.16), transparent 36%) padding-box,
    linear-gradient(135deg, rgba(255, 79, 139, 0.36), rgba(139, 92, 246, 0.34), rgba(47, 111, 255, 0.34)) border-box;
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 12px 28px rgba(49, 87, 255, 0.06);
  touch-action: none;
  user-select: none;
}

.mood-map:focus-visible {
  outline: 3px solid rgba(139, 92, 246, 0.24);
  outline-offset: 3px;
}

.mood-map::before,
.mood-map::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

.mood-map::before {
  inset: 0;
  background:
    linear-gradient(0deg, rgba(47, 111, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 111, 255, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, transparent calc(50% - 0.5px), rgba(139, 92, 246, 0.2) calc(50% - 0.5px), rgba(139, 92, 246, 0.2) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(139, 92, 246, 0.2) calc(50% - 0.5px), rgba(139, 92, 246, 0.2) calc(50% + 0.5px), transparent calc(50% + 0.5px));
  background-size: 28px 28px, 28px 28px, 100% 100%, 100% 100%;
}

.mood-map::after {
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 6px;
  background: linear-gradient(115deg, transparent 28%, rgba(255, 255, 255, 0.18) 50%, transparent 72%);
  opacity: 0.72;
  animation: moodBreath 4.6s ease-in-out infinite;
}

.mood-axis {
  position: absolute;
  z-index: 2;
  color: rgba(39, 49, 74, 0.66);
  font-size: 12px;
  font-weight: 900;
  pointer-events: none;
}

.mood-axis-x {
  left: 50%;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.42);
  transform: translateX(-50%);
  white-space: nowrap;
}

.mood-axis-y {
  left: 10px;
  top: 50%;
  display: grid;
  width: 44px;
  height: 112px;
  grid-template-rows: repeat(4, auto);
  place-items: center;
  align-content: center;
  justify-content: center;
  gap: 5px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.42);
  line-height: 1.05;
  transform: translateY(-50%);
}

.mood-axis-y em {
  display: grid;
  width: 100%;
  color: rgba(39, 49, 74, 0.76);
  font-style: normal;
  text-align: center;
}

.mood-axis-y b {
  display: grid;
  width: 100%;
  font-style: normal;
  text-align: center;
}

.mood-axis-y i {
  display: grid;
  width: 100%;
  font-style: normal;
  justify-items: center;
  text-align: center;
  line-height: 1;
}

.mood-axis-x em {
  color: rgba(39, 49, 74, 0.76);
  font-style: normal;
}

.mood-axis-x b,
.mood-axis-x i {
  font-style: normal;
}

.mood-quadrant {
  position: absolute;
  z-index: 1;
  display: none;
  padding: 0;
  color: rgba(39, 49, 74, 0.3);
  background: transparent;
  font-size: 10px;
  font-weight: 900;
  pointer-events: none;
}

.mood-quadrant.top-left { top: 12px; left: 64px; }
.mood-quadrant.top-right { top: 12px; right: 14px; }
.mood-quadrant.bottom-left { bottom: 42px; left: 64px; }
.mood-quadrant.bottom-right { right: 14px; bottom: 42px; }

.mood-trace {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 1px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 0 0 28px rgba(255, 79, 139, 0.035),
    0 0 0 56px rgba(47, 111, 255, 0.026);
  opacity: 0.78;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: left 0.18s ease, top 0.18s ease;
  animation: moodTraceBreath 3.4s ease-in-out infinite;
}

.mood-dot {
  position: absolute;
  z-index: 3;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  background: var(--grad-action);
  box-shadow:
    0 0 0 5px rgba(139, 92, 246, 0.08),
    0 8px 18px rgba(139, 92, 246, 0.24),
    0 2px 0 rgba(255, 255, 255, 0.7) inset;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: left 0.16s ease, top 0.16s ease, box-shadow 0.16s ease;
  animation: moodPulse 2.4s ease-in-out infinite;
}

.mood-map.is-dragging {
  cursor: grabbing;
}

.mood-map.is-dragging .mood-dot {
  box-shadow:
    0 0 0 8px rgba(255, 79, 139, 0.12),
    0 10px 24px rgba(255, 79, 139, 0.24),
    0 2px 0 rgba(255, 255, 255, 0.7) inset;
  transition: none;
  animation: none;
}

@keyframes moodBreath {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.82; }
}

@keyframes moodTraceBreath {
  0%, 100% { box-shadow: 0 0 0 24px rgba(255, 79, 139, 0.03), 0 0 0 48px rgba(47, 111, 255, 0.02); }
  50% { box-shadow: 0 0 0 34px rgba(255, 79, 139, 0.045), 0 0 0 66px rgba(47, 111, 255, 0.03); }
}

@keyframes moodPulse {
  0%, 100% { box-shadow: 0 0 0 5px rgba(139, 92, 246, 0.08), 0 8px 18px rgba(139, 92, 246, 0.24), 0 2px 0 rgba(255, 255, 255, 0.7) inset; }
  50% { box-shadow: 0 0 0 9px rgba(47, 111, 255, 0.06), 0 10px 22px rgba(255, 79, 139, 0.2), 0 2px 0 rgba(255, 255, 255, 0.7) inset; }
}

.mood-map {
  position: relative;
  isolation: auto;
  min-height: 178px;
  border: 1px solid rgba(49, 87, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(57, 191, 255, 0.09), rgba(255, 79, 139, 0.09)),
    linear-gradient(0deg, rgba(84, 91, 120, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(84, 91, 120, 0.08) 1px, transparent 1px);
  background-size: auto, 36px 36px, 36px 36px;
  box-shadow: none;
  cursor: crosshair;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.mood-map::before,
.mood-map::after {
  content: "";
  position: absolute;
  z-index: auto;
  background: rgba(49, 87, 255, 0.18);
  pointer-events: none;
  animation: none;
}

.mood-map::before {
  left: 50%;
  top: 12px;
  right: auto;
  bottom: 12px;
  width: 1px;
  height: auto;
  border: 0;
  border-radius: 0;
}

.mood-map::after {
  left: 12px;
  right: 12px;
  top: 50%;
  bottom: auto;
  width: auto;
  height: 1px;
  border: 0;
  border-radius: 0;
  opacity: 1;
}

.mood-axis {
  position: absolute;
  z-index: 1;
  color: rgba(39, 49, 74, 0.62);
  font-size: 12px;
  font-weight: 900;
  pointer-events: none;
}

.mood-axis-x {
  left: 14px;
  right: 14px;
  bottom: 10px;
  display: block;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  transform: none;
  white-space: normal;
}

.mood-axis-y {
  left: 12px;
  top: 16px;
  display: grid;
  width: auto;
  min-width: 40px;
  min-height: 0;
  gap: 2px;
  justify-items: stretch;
  padding: 0;
  border-radius: 0;
  background: transparent;
  line-height: 1.05;
  transform: none;
}

.mood-axis-y em {
  display: block;
  width: auto;
  margin-bottom: 2px;
  color: rgba(39, 49, 74, 0.72);
  font-style: normal;
  text-align: left;
}

.mood-axis-y b {
  display: block;
  width: auto;
  font-style: normal;
  text-align: left;
}

.mood-axis-y i {
  display: block;
  width: auto;
  font-style: normal;
  text-align: center;
}

.mood-axis-x em,
.mood-axis-x b,
.mood-axis-x i {
  font-style: normal;
}

.mood-quadrant,
.mood-trace {
  display: none;
}

.mood-dot {
  position: absolute;
  z-index: 2;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  background: var(--grad-action);
  box-shadow: 0 10px 28px rgba(139, 92, 246, 0.3);
  cursor: crosshair;
  transform: translate(-50%, -50%);
  transition: left 0.16s ease, top 0.16s ease, box-shadow 0.16s ease;
  animation: none;
}

.mood-map.is-dragging {
  cursor: crosshair;
}

.mood-map.is-dragging .mood-dot {
  box-shadow: 0 12px 34px rgba(255, 79, 139, 0.28);
  transition: none;
  animation: none;
}

.mood-readout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mood-readout span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(49, 87, 255, 0.12);
  border-radius: 8px;
  color: #33394a;
  background: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 900;
}

.mood-readout b {
  color: var(--blue);
}

.right-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--right-control-gap);
}

.style-submit-row {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.range-field {
  margin-bottom: 0;
}

.range-field span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.range-field b {
  color: var(--blue);
}

.range-field input[type="range"] {
  accent-color: var(--brand-violet);
}

.structure-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.structure-chip {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(139, 92, 246, 0.18);
  color: #33394a;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.structure-chip.active {
  color: #ffffff;
  border-color: transparent;
  background: var(--grad-action);
  box-shadow: 0 10px 22px rgba(139, 92, 246, 0.18);
}

.mood-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mood-suggestions span {
  padding: 6px 9px;
  border: 1px solid rgba(47, 111, 255, 0.14);
  border-radius: 999px;
  color: #27314a;
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 900;
}

.history-page {
  background: transparent;
}

.history-layout {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 48px);
  align-items: stretch;
  height: min(620px, calc(100vh - 132px));
  min-height: 430px;
  max-height: calc(100vh - 132px);
}

.history-layout > .result-panel,
.history-layout > .lyrics-stage-panel {
  width: 100%;
  min-width: 0;
  height: 100%;
  max-height: none;
}

.lyrics-stage-panel {
  gap: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.93), rgba(247, 250, 255, 0.86));
}

.history-prompt-box {
  display: flex;
  min-height: 0;
  flex: 1 1 0;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  padding: 10px;
  border: 1px solid rgba(255, 79, 139, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.07), rgba(139, 92, 246, 0.07), rgba(47, 111, 255, 0.07)),
    rgba(255, 255, 255, 0.66);
}

.history-prompt-box span {
  color: var(--brand-violet);
  font-size: 12px;
  font-weight: 950;
}

.history-prompt-box div {
  min-height: 0;
  overflow-y: auto;
  color: #465168;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.7;
  white-space: pre-wrap;
}

.synced-lyrics {
  display: grid;
  gap: 8px;
  min-height: 0;
  flex: 2 1 0;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid rgba(49, 87, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
}

.synced-lyrics p {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  color: #647086;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.75;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.synced-lyrics p.active {
  color: #111827;
  background:
    linear-gradient(90deg, rgba(255, 79, 139, 0.12), rgba(139, 92, 246, 0.12), rgba(47, 111, 255, 0.12));
  transform: translateX(2px);
}

.result-panel h3 {
  margin-bottom: 14px;
  font-size: 24px;
}

.history-mini {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(49, 87, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.history-mini h3,
.history-mini p {
  margin: 0;
}

.history-mini p {
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px dashed rgba(49, 87, 255, 0.22);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
}

.empty-state p {
  margin: 0;
  line-height: 1.55;
}

.studio-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(0, 200, 255, 0.28), transparent) 0 0 / 100% 1px no-repeat,
    linear-gradient(180deg, transparent, rgba(255, 72, 111, 0.22), transparent) 0 0 / 1px 100% no-repeat;
}

.panel-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(10px, 1.6vh, 16px);
}

.panel-head h2 {
  margin: 0;
  font-size: 28px;
}

.credit-pill,
.model-select-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #7d4100;
  background: #fff0b8;
  font-size: 13px;
  font-weight: 900;
}

.model-select-pill {
  color: #18223a;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, rgba(255, 74, 145, 0.78), rgba(111, 82, 255, 0.82), rgba(32, 198, 255, 0.72)) border-box;
  border: 1px solid transparent;
  box-shadow: 0 14px 28px rgba(94, 89, 255, 0.12);
}

.model-select-pill svg {
  width: 16px;
  height: 16px;
  color: #ff4a91;
}

.model-select-pill span {
  white-space: nowrap;
}

.model-select-pill select {
  width: auto;
  min-width: 104px;
  height: 28px;
  padding: 0 26px 0 8px;
  border: 0;
  border-radius: 7px;
  color: #3154ff;
  background: rgba(246, 248, 255, 0.92);
  font-size: 13px;
  font-weight: 900;
}

.model-select-pill.is-locked select {
  color: #8d95aa;
  background: #f2f4f8;
}

.model-voice-stack {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.custom-voice-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  max-width: 220px;
  padding: 0 12px;
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 999px;
  color: #223052;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 255, 0.88)) padding-box,
    var(--grad-line) border-box;
  box-shadow: 0 12px 24px rgba(94, 89, 255, 0.1);
  font-size: 13px;
  font-weight: 900;
}

.custom-voice-button svg {
  width: 15px;
  height: 15px;
  color: #ff4f8b;
}

.custom-voice-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-voice-button em {
  position: absolute;
  top: -8px;
  right: -8px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #fff;
  background: var(--grad-action);
  box-shadow: 0 8px 18px rgba(139, 92, 246, 0.22);
  font-size: 10px;
  font-style: normal;
  line-height: 1.2;
}

.custom-voice-button.is-locked {
  color: #7a8398;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(238, 242, 248, 0.8)) padding-box,
    linear-gradient(135deg, rgba(148, 163, 184, 0.42), rgba(203, 213, 225, 0.42)) border-box;
}

.custom-voice-button.has-selected-voice {
  color: #3154ff;
}

.style-custom-voice-button {
  justify-self: start;
  width: calc((100% - var(--right-control-gap, 10px)) / 2);
  max-width: calc((100% - var(--right-control-gap, 10px)) / 2);
  min-height: 38px;
  margin-top: -4px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.mode-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  color: #3d4354;
  background: #f2f5f8;
  font-weight: 850;
}

.mode-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
}

.field-block {
  display: grid;
  gap: 7px;
  margin-bottom: clamp(9px, 1.4vh, 14px);
}

.field-block span,
.field-label {
  color: #33394a;
  font-size: 13px;
  font-weight: 900;
}

textarea,
select,
input[type="text"],
input[type="range"] {
  width: 100%;
}

textarea,
select,
input[type="text"] {
  border: 1px solid rgba(49, 87, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

input[type="text"] {
  height: 44px;
  padding: 0 14px;
  font-weight: 750;
}

textarea {
  min-height: clamp(76px, 12vh, 108px);
  padding: 13px 14px;
  resize: vertical;
  line-height: 1.55;
}

.clear-studio-button {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(116, 126, 148, 0.24);
  border-radius: 999px;
  color: #69738b;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(235, 239, 247, 0.76));
  box-shadow: 0 8px 16px rgba(80, 91, 120, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.clear-studio-button:hover {
  color: #3e485f;
  border-color: rgba(116, 126, 148, 0.34);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(226, 232, 242, 0.86));
}

.clear-studio-button svg {
  width: 14px;
  height: 14px;
}

select {
  height: 44px;
  padding: 0 12px;
}

.hidden {
  display: none;
}

.chips-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: clamp(9px, 1.4vh, 14px);
}

.style-chip,
.instrument-chip {
  min-height: 30px;
  padding: 0 10px;
  color: #2f3546;
  background: #eef3f0;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.style-chip.active,
.instrument-chip.active {
  color: #04252b;
  background: linear-gradient(135deg, #bdf4ef, #e8ff87);
  border-color: rgba(32, 197, 216, 0.42);
}

.instrument-chip {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(247, 250, 255, 0.84)) padding-box,
    linear-gradient(135deg, rgba(255, 79, 139, 0.42), rgba(139, 92, 246, 0.38), rgba(39, 177, 255, 0.38)) border-box;
}

.instrument-chip.active {
  color: #ffffff;
  background: var(--grad-action);
  box-shadow: 0 8px 18px rgba(139, 92, 246, 0.14);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.option-row {
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 2px 0 16px;
}

.toggle-line {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: #3b4253;
  font-size: 13px;
  font-weight: 800;
}

.submit-row {
  justify-content: space-between;
  gap: 12px;
}

.generate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 150px;
  padding: 0 18px;
  font-weight: 950;
}

.generate-button:disabled {
  cursor: not-allowed;
}

.cost-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.content-shell {
  position: relative;
  z-index: 3;
  width: min(1140px, calc(100% - 36px));
  margin: 0 auto;
}

@media (min-width: 681px) {
  :root {
    --desktop-tool-panel-height: min(650px, calc(100svh - 110px));
  }

  .split-tool,
  .pricing-page > .content-shell,
  .library-shell {
    height: var(--desktop-tool-panel-height);
    min-height: 0;
    max-height: var(--desktop-tool-panel-height);
  }
}

.queue-band,
.gallery-section,
.pricing-section {
  padding: 72px 0;
}

.queue-band {
  background:
    linear-gradient(180deg, #ffffff, #f5fbff);
}

.result-page {
  min-height: calc(100vh - 72px);
  padding-top: 140px;
}

.back-button {
  margin-top: 18px;
}

.queue-layout {
  display: grid;
  grid-template-columns: 0.72fr 1fr;
  gap: 36px;
  align-items: center;
}

.queue-layout p {
  color: var(--muted);
  line-height: 1.7;
}

.queue-list {
  display: grid;
  flex: 1;
  gap: 12px;
  align-content: start;
  grid-auto-rows: 76px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-color: rgba(49, 87, 255, 0.36) transparent;
}

.queue-list:has(> .empty-state:only-child) {
  display: flex;
  padding-right: 0;
}

.queue-list:has(> .empty-state:only-child) > .empty-state {
  flex: 1;
  justify-content: center;
  min-height: 160px;
}

.track-row {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) minmax(148px, auto);
  gap: 10px;
  align-items: center;
  height: 76px;
  min-height: 76px;
  padding: 10px;
  border: 1px solid rgba(49, 87, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.track-row.has-error {
  border-color: rgba(255, 79, 139, 0.24);
  background:
    linear-gradient(90deg, rgba(255, 79, 139, 0.06), rgba(139, 92, 246, 0.04)),
    rgba(255, 255, 255, 0.82);
}

.track-row.has-error .record-cover,
.track-row.has-error .track-actions {
  align-self: center;
}

.track-row:hover {
  border-color: rgba(49, 87, 255, 0.3);
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.track-row.is-playing {
  border-color: rgba(139, 84, 255, 0.5);
  background:
    linear-gradient(90deg, rgba(255, 76, 125, 0.1), rgba(139, 84, 255, 0.1), rgba(34, 103, 255, 0.1)),
    rgba(255, 255, 255, 0.95);
  box-shadow:
    inset 3px 0 0 rgba(107, 91, 255, 0.88),
    0 12px 30px rgba(49, 87, 255, 0.12);
}

.playing-badge {
  position: absolute;
  top: 6px;
  right: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--grad-action);
  box-shadow: var(--brand-glow);
  font-size: 10px;
  font-weight: 950;
}

.record-cover {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.02)) padding-box,
    var(--grad-icon) border-box;
  background-position: center;
  background-size: cover;
}

.record-cover:disabled,
.track-main:disabled,
.track-save:disabled,
.track-favorite:disabled,
.track-delete:disabled {
  cursor: default;
  opacity: 0.64;
}

.track-main:disabled {
  color: inherit !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  filter: none;
}

.record-cover:disabled {
  color: #8a94a7 !important;
  border-color: rgba(148, 163, 184, 0.38) !important;
  background:
    linear-gradient(180deg, rgba(250, 252, 255, 0.86), rgba(230, 236, 245, 0.78)) padding-box,
    linear-gradient(135deg, rgba(148, 163, 184, 0.32), rgba(203, 213, 225, 0.28)) border-box !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72) !important;
  filter: grayscale(0.55) saturate(0.72);
  opacity: 1;
}

.track-row.is-expired .track-main,
.library-song-row.is-expired .track-main {
  color: #6f7a90;
}

.track-row.is-expired .expiry-pill.is-expired,
.library-song-row.is-expired .expiry-pill.is-expired,
.expiry-pill.is-expired {
  color: #e11d48 !important;
  border-color: rgba(244, 63, 94, 0.34);
  background: rgba(255, 241, 242, 0.92);
}

.queue-error,
.track-error,
.status-label.is-error,
.expiry-pill.is-expired,
.expiry-pill.is-error,
.track-row.has-error .expiry-pill,
.library-song-row.has-error .expiry-pill {
  color: #e11d48 !important;
}

.track-row.has-error .expiry-pill,
.library-song-row.has-error .expiry-pill,
.expiry-pill.is-error {
  border-color: rgba(244, 63, 94, 0.34);
  background: rgba(255, 241, 242, 0.92);
}

.track-row.has-error .expiry-pill svg,
.library-song-row.has-error .expiry-pill svg,
.expiry-pill.is-expired svg,
.expiry-pill.is-error svg {
  color: #e11d48 !important;
  stroke: currentColor;
}

.record-cover svg {
  width: 26px;
  height: 26px;
}

.track-main {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 0;
  border: 0;
  text-align: left;
  color: inherit;
  background: transparent;
}

.track-main strong,
.track-main span,
.track-main small,
.track-main em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-main strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 950;
}

.track-title-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  color: #ffffff !important;
  background: linear-gradient(135deg, #172035, #29324a);
  box-shadow: 0 6px 14px rgba(18, 28, 48, 0.16);
  font-size: 10px !important;
  font-style: normal;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: lowercase;
}

.track-main span,
.track-main small {
  color: var(--muted);
  font-size: 12px;
}

.track-date-line {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  width: fit-content;
  max-width: 100%;
}

.track-date-line time {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expiry-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  padding: 0 8px;
  border: 1px solid rgba(74, 111, 255, 0.18);
  border-radius: 999px;
  color: #3557d8;
  background: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.expiry-pill svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.expiry-pill.is-expired {
  border-color: rgba(255, 79, 139, 0.24);
  color: #c92a4b;
  background: rgba(255, 244, 248, 0.86);
}

.track-main em:not(.track-error) {
  color: #b4233c;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.track-side-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  flex: 1 1 118px;
  max-width: 180px;
  min-width: 0;
  overflow: hidden;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 79, 139, 0.2);
  background: rgba(255, 255, 255, 0.72);
  color: #c92a4b;
  font-size: clamp(10px, 1.8vw, 12px);
  font-style: normal;
  font-weight: 900;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
}

.track-error svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.track-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.track-save,
.track-favorite,
.track-delete {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-color: rgba(49, 87, 255, 0.12);
  color: #667086;
  background: rgba(255, 255, 255, 0.72);
}

.track-save.active {
  border-color: rgba(139, 92, 246, 0.2);
  color: var(--brand-violet);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(255, 79, 139, 0.08), 0 8px 18px rgba(139, 92, 246, 0.08);
}

.track-favorite.active {
  color: #ff2f66;
  background: rgba(255, 72, 111, 0.12);
}

.history-library-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: fit-content;
  min-height: 34px;
  margin: -6px 0 2px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.84), rgba(139, 92, 246, 0.84), rgba(47, 111, 255, 0.84)) padding-box,
    var(--grad-line) border-box;
  box-shadow: 0 10px 22px rgba(139, 92, 246, 0.15);
  font-size: 12px;
  font-weight: 950;
}

.history-panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}

.history-panel-head h3 {
  margin-bottom: 0;
}

.history-panel-head .history-library-link {
  flex: 0 0 auto;
  margin: 0 0 4px;
}

.history-library-link svg {
  width: 15px;
  height: 15px;
}

.track-delete:hover {
  color: #b4233c;
  background: rgba(255, 72, 111, 0.1);
}

.track-wave {
  width: 40px;
  justify-content: center;
}

.track-progress {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: min(190px, 100%);
  margin-top: 2px;
}

.track-progress span {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.13);
}

.track-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--grad-action);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.26);
  transition: width 0.24s ease;
}

.track-progress b {
  color: var(--blue);
  font-size: 11px;
  font-weight: 950;
}

.track-progress-inline {
  align-self: center;
}

.queue-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(239, 250, 255, 0.96));
  box-shadow: 0 12px 34px rgba(13, 23, 54, 0.06);
}

.queue-item h3,
.queue-item p {
  margin: 0;
}

.queue-item p {
  color: var(--muted);
  font-size: 14px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--mint);
}

.status-dot.working {
  background: var(--brand-red);
  box-shadow: 0 0 0 6px rgba(255, 95, 104, 0.14);
}

.status-dot.complete {
  background: var(--mint);
  box-shadow: 0 0 0 6px rgba(52, 229, 155, 0.14);
}

.status-dot.error {
  background: #ff3055;
  box-shadow: 0 0 0 6px rgba(255, 48, 85, 0.13);
}

.status-label {
  color: var(--blue);
  font-weight: 900;
}

.song-player,
.queue-error {
  grid-column: 2 / -1;
}

.song-player {
  width: 100%;
  height: 40px;
}

.global-player {
  position: fixed;
  right: 18px;
  bottom: 16px;
  left: 18px;
  z-index: 60;
  display: grid;
  grid-template-columns: 54px minmax(170px, 0.55fr) minmax(280px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(239, 246, 255, 0.97)) padding-box,
    var(--grad-line) border-box;
  box-shadow: 0 18px 60px rgba(13, 23, 54, 0.16), 0 12px 34px rgba(139, 84, 255, 0.12);
  backdrop-filter: blur(18px);
  overflow: visible;
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(100% + 22px));
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.global-player.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.player-cover {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--grad-icon);
  background-position: center;
  background-size: cover;
  overflow: hidden;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.58), 0 8px 18px rgba(49, 87, 255, 0.14);
  animation: playerDiscSpin 18s linear infinite;
  animation-play-state: paused;
}

.player-cover::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 3px rgba(16, 20, 39, 0.08);
  transform: translate(-50%, -50%);
}

.global-player.is-playing .player-cover {
  animation-play-state: running;
}

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

.player-track {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.player-track strong,
.player-track span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-track strong {
  font-size: 14px;
  font-weight: 950;
}

.player-track span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.player-play {
  width: 42px;
  height: 42px;
  color: #ffffff;
  background: var(--grad-action);
  box-shadow: var(--brand-glow);
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.player-skip,
.player-mode {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.76), rgba(139, 92, 246, 0.78), rgba(47, 111, 255, 0.76));
  box-shadow: 0 9px 18px rgba(139, 92, 246, 0.14);
}

.player-mode.active {
  color: #ffffff;
  border-color: transparent;
  background: var(--grad-action);
  box-shadow: 0 12px 24px rgba(139, 92, 246, 0.2), 0 7px 16px rgba(255, 79, 139, 0.14);
}

.player-progress-wrap {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  gap: 10px;
  align-items: center;
  justify-self: center;
  width: min(100%, 620px);
  color: #657086;
  font-size: 12px;
  font-weight: 850;
}

.player-progress-wrap input[type="range"] {
  accent-color: var(--brand-violet);
}

.player-queue-panel {
  position: absolute;
  right: 14px;
  bottom: calc(100% + 10px);
  width: min(420px, calc(100vw - 36px));
  max-height: 360px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(245, 247, 255, 0.92)) padding-box,
    var(--grad-line) border-box;
  box-shadow: 0 18px 54px rgba(13, 23, 54, 0.18);
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.player-queue-panel[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.player-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.player-queue-head strong {
  font-size: 14px;
  font-weight: 950;
}

.player-queue-head span,
.player-queue-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.player-queue-list {
  display: grid;
  gap: 8px;
  max-height: 292px;
  overflow-y: auto;
  padding-right: 3px;
}

.player-queue-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(139, 92, 246, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.player-queue-row.active {
  border-color: rgba(139, 92, 246, 0.46);
  background: var(--grad-soft);
}

.player-queue-row > button:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 0;
  border: 0;
  text-align: left;
  color: inherit;
  background: transparent;
}

.player-queue-row strong,
.player-queue-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-queue-row strong {
  font-size: 13px;
  font-weight: 950;
}

.player-queue-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.player-queue-row .icon-button {
  width: 32px;
  height: 32px;
}

.queue-error {
  margin: -4px 0 0;
  color: #b4233c;
  font-size: 13px;
  font-weight: 800;
}

.mini-wave {
  display: flex;
  align-items: end;
  gap: 3px;
  width: 54px;
  height: 24px;
}

.mini-wave span {
  width: 6px;
  border-radius: 6px;
  background: var(--aqua);
  animation: wave 0.9s infinite ease-in-out alternate;
}

.mini-wave span:nth-child(1) { height: 8px; }
.mini-wave span:nth-child(2) { height: 16px; animation-delay: 0.1s; }
.mini-wave span:nth-child(3) { height: 22px; animation-delay: 0.2s; }
.mini-wave span:nth-child(4) { height: 13px; animation-delay: 0.3s; }
.mini-wave span:nth-child(5) { height: 19px; animation-delay: 0.4s; }

@keyframes wave {
  to { transform: scaleY(0.45); }
}

.section-title-row {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

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

.song-card,
.price-card {
  position: relative;
  min-height: 210px;
  padding: 20px;
  border-radius: 8px;
  overflow: hidden;
}

.song-card {
  color: #101426;
}

.gallery-section {
  background:
    linear-gradient(120deg, rgba(255, 72, 111, 0.09), transparent 38%),
    linear-gradient(300deg, rgba(0, 200, 255, 0.1), transparent 42%),
    #ffffff;
}

.song-card.coral { background: #ffd5d3; }
.song-card.aqua { background: #c8f3f5; }
.song-card.yellow { background: #ffeca8; }

.song-card::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(16, 20, 39, 0.13);
  border-radius: 8px;
}

.cover-art {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  margin-bottom: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

.cover-art svg {
  width: 38px;
  height: 38px;
}

.song-card p {
  color: #3d4354;
}

.play-small {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: grid;
  place-items: center;
  width: 44px;
  color: #fff;
  background: var(--grad-action);
}

.pricing-section {
  background:
    radial-gradient(circle at 12% 24%, rgba(255, 79, 139, 0.12), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(47, 111, 255, 0.13), transparent 30%),
    linear-gradient(180deg, rgba(255, 250, 255, 0.92), rgba(244, 249, 255, 0.94));
}

.pricing-page {
  position: relative;
  z-index: 2;
  display: grid;
  align-items: center;
  min-height: 100vh;
  padding: clamp(76px, 10vh, 92px) 0 clamp(18px, 3vh, 28px);
}

.pricing-page > .content-shell {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(12px, 1.8vh, 16px);
}

.pricing-hero {
  max-width: 760px;
  margin-bottom: clamp(12px, 2.4vh, 22px);
}

.pricing-hero h1 {
  margin-bottom: 8px;
  font-size: clamp(30px, 4.2vw, 50px);
}

.pricing-hero p {
  color: var(--muted);
  font-size: clamp(14px, 1.35vw, 17px);
  line-height: 1.55;
}

.pricing-title-row {
  justify-content: flex-end;
  margin: 0;
}

.pricing-title-row h2 {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 34px);
}

.billing-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.9), rgba(249, 247, 255, 0.84)) padding-box,
    var(--grad-line) border-box;
  border: 1px solid transparent;
}

.billing-toggle button {
  min-height: 34px;
  padding: 0 13px;
  color: #5d6380;
  background: transparent;
  font-weight: 850;
}

.billing-toggle button span {
  color: inherit;
  font-size: 11px;
  font-weight: 950;
}

.billing-toggle button.active {
  color: #fff;
  background: var(--grad-action);
}

.pricing-selector {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: clamp(14px, 2vh, 20px);
}

.price-option {
  display: grid;
  gap: 8px;
  justify-items: start;
  min-height: 128px;
  padding: 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: left;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(247, 250, 255, 0.82)) padding-box,
    linear-gradient(135deg, rgba(255, 79, 139, 0.2), rgba(139, 92, 246, 0.24), rgba(47, 111, 255, 0.22)) border-box;
  box-shadow: 0 12px 30px rgba(13, 23, 54, 0.07);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.price-option:hover,
.price-option.active {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(139, 92, 246, 0.14), 0 12px 28px rgba(255, 79, 139, 0.08);
}

.price-option.active {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(250, 246, 255, 0.88)) padding-box,
    var(--grad-line) border-box;
}

.price-option strong {
  font-size: 19px;
  font-weight: 950;
}

.option-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.option-price b {
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 1000;
  line-height: 0.95;
  letter-spacing: 0;
}

.option-price small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.pricing-detail-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.74fr);
  gap: clamp(16px, 2.4vw, 28px);
  min-height: clamp(250px, 34vh, 330px);
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid transparent;
  border-radius: 10px;
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 79, 139, 0.12), transparent 28%),
    radial-gradient(circle at 92% 0%, rgba(47, 111, 255, 0.12), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(246, 250, 255, 0.9)) padding-box,
    var(--grad-line) border-box;
  box-shadow: 0 18px 54px rgba(13, 23, 54, 0.1);
}

.pricing-detail-copy {
  display: grid;
  align-content: start;
  gap: 10px;
}

.pricing-detail-copy h3,
.payment-box h3 {
  margin: 0;
  font-size: clamp(23px, 2.2vw, 32px);
}

.detail-price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 2px 0 0;
}

.detail-price span {
  color: #15192d;
  font-size: clamp(52px, 6vw, 78px);
  font-weight: 1000;
  line-height: 0.95;
}

.detail-price small {
  color: var(--muted);
  font-size: 17px;
  font-weight: 950;
}

.pricing-detail-copy p,
.payment-box p,
.payment-box small {
  color: var(--muted);
  line-height: 1.6;
}

.detail-feature-list {
  display: grid;
  gap: 7px;
  margin: 2px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-weight: 820;
}

.payment-box {
  display: grid;
  align-content: end;
  padding: 16px;
  border: 1px solid rgba(139, 92, 246, 0.16);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.07), rgba(139, 92, 246, 0.08), rgba(47, 111, 255, 0.08)),
    rgba(255, 255, 255, 0.72);
}

.payment-box .solid-button {
  min-height: 42px;
  width: 100%;
}

.price-card {
  display: grid;
  grid-template-rows: auto auto auto auto 1fr auto;
  align-content: start;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: clamp(16px, 2.2vw, 22px);
  border: 1px solid transparent;
  color: var(--ink);
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    var(--grad-line) border-box;
  box-shadow: 0 16px 42px rgba(13, 23, 54, 0.08);
}

.price-card.is-disabled,
.price-card[aria-disabled="true"],
.disabled-panel,
.disabled-card {
  color: #7d8798;
  border-color: rgba(100, 116, 139, 0.3);
  background:
    repeating-linear-gradient(135deg, rgba(148, 163, 184, 0.08) 0 8px, rgba(255, 255, 255, 0.18) 8px 16px),
    linear-gradient(180deg, rgba(248, 250, 252, 0.92), rgba(226, 232, 240, 0.72)) padding-box,
    linear-gradient(135deg, rgba(148, 163, 184, 0.5), rgba(203, 213, 225, 0.44)) border-box;
  box-shadow: 0 10px 26px rgba(100, 116, 139, 0.08);
  filter: grayscale(0.85) saturate(0.45);
}

.price-card.is-disabled::before,
.price-card[aria-disabled="true"]::before,
.disabled-panel::before,
.disabled-card::before {
  opacity: 0.22;
}

.price-card.is-disabled .plan-tag,
.price-card[aria-disabled="true"] .plan-tag,
.disabled-panel .plan-tag,
.disabled-card .plan-tag {
  color: #64748b;
  background: rgba(226, 232, 240, 0.82);
}

.price-card.is-disabled p,
.price-card.is-disabled li,
.price-card[aria-disabled="true"] p,
.price-card[aria-disabled="true"] li,
.disabled-panel p,
.disabled-card p {
  color: #8790a3;
}

.price-card.is-disabled li::before,
.price-card[aria-disabled="true"] li::before,
.disabled-panel li::before,
.disabled-card li::before {
  color: #94a3b8;
}

.pricing-grid {
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

.price-card h3 {
  margin: 12px 0 4px;
  font-size: clamp(23px, 2.2vw, 30px);
}

.price-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.72;
}

.price-card > * {
  position: relative;
  z-index: 1;
}

.plan-free::before {
  background:
    radial-gradient(circle at 82% 12%, rgba(47, 111, 255, 0.13), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(239, 246, 255, 0.8));
}

.price-card.featured {
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(250, 244, 255, 0.9)) padding-box,
    var(--grad-line) border-box;
  box-shadow: 0 18px 48px rgba(139, 92, 246, 0.16);
}

.plan-creator::before {
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 79, 139, 0.13), transparent 32%),
    radial-gradient(circle at 92% 0%, rgba(139, 92, 246, 0.15), transparent 34%);
}

.plan-studio::before {
  background:
    radial-gradient(circle at 84% 14%, rgba(139, 92, 246, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(247, 242, 255, 0.85));
}

.price-card p,
.price-card li {
  color: var(--muted);
  line-height: 1.5;
}

.price-card.featured p,
.price-card.featured li {
  color: var(--muted);
}

.price {
  margin: 16px 0 8px;
  font-size: clamp(42px, 4.8vw, 64px);
  font-weight: 950;
}

.price span {
  letter-spacing: 0;
}

.price small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

.price-card ul {
  display: grid;
  align-self: start;
  gap: 10px;
  margin: 16px 0 20px;
  padding-left: 0;
  list-style: none;
  min-height: 0;
  overflow-y: auto;
}

.price-card li {
  position: relative;
  padding-left: 23px;
}

.price-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #10b981;
  font-weight: 950;
}

.price-card .ghost-button,
.price-card .solid-button {
  align-self: end;
  min-height: 42px;
  width: 100%;
}

.pricing-carousel {
  position: relative;
}

.pricing-page-button,
.pricing-dots {
  display: none;
}

.plan-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: #5a4ad8;
  background: rgba(139, 92, 246, 0.1);
  font-size: 12px;
  font-weight: 950;
}

.how-section {
  background: transparent;
}

.how-head {
  max-width: 780px;
  margin: 0 auto 34px;
  text-align: center;
}

.how-head h2 {
  margin-bottom: 14px;
}

.how-head p {
  margin: 0 auto;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

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

.how-steps article {
  display: grid;
  justify-items: center;
  align-content: start;
  min-height: 260px;
  padding: 40px 28px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 255, 0.95)) padding-box,
    linear-gradient(135deg, rgba(255, 76, 125, 0.2), rgba(139, 84, 255, 0.26), rgba(34, 103, 255, 0.2)) border-box;
  border: 1px solid transparent;
  box-shadow: 0 16px 44px rgba(13, 23, 54, 0.07);
  text-align: center;
}

.how-steps span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 22px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #26344e, var(--blue));
  font-size: 20px;
  font-weight: 950;
}

.how-steps h3 {
  margin-bottom: 16px;
  font-size: 21px;
}

.how-steps p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.qa-page {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 0;
  color: var(--ink);
  background: transparent;
}

.tool-page,
.library-page {
  background:
    linear-gradient(120deg, rgba(0, 200, 255, 0.12), transparent 34%),
    linear-gradient(300deg, rgba(255, 72, 111, 0.11), transparent 36%),
    rgba(255, 255, 255, 0.78);
}

.library-page {
  align-items: stretch;
  height: 100vh;
  min-height: 100vh;
  padding-top: clamp(84px, 11vh, 106px);
  padding-bottom: clamp(18px, 3vh, 28px);
  overflow: hidden;
}

.profile-page {
  min-height: 100vh;
  padding: 122px clamp(18px, 4vw, 56px) 56px;
}

.profile-shell {
  width: min(1160px, 100%);
  margin: 0 auto;
}

.profile-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.profile-hero h1 {
  margin-bottom: 12px;
  font-size: clamp(38px, 5vw, 64px);
}

.profile-hero p {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.profile-root {
  display: grid;
  gap: 22px;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1.15fr) repeat(2, minmax(180px, 0.7fr));
  gap: 16px;
}

.profile-card,
.profile-section,
.profile-loading,
.profile-empty,
.payment-empty {
  border: 1px solid rgba(49, 87, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 48px rgba(13, 23, 54, 0.08);
  backdrop-filter: blur(18px);
}

.profile-card {
  display: grid;
  align-content: space-between;
  min-height: 180px;
  padding: 22px;
}

.account-card {
  grid-row: span 2;
}

.profile-person {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  box-shadow: 0 16px 34px rgba(49, 87, 255, 0.18);
}

.profile-person h2,
.profile-person p {
  margin: 0;
}

.profile-person h2 {
  font-size: 24px;
}

.profile-person p,
.profile-card p,
.payment-empty p,
.profile-empty p {
  color: var(--muted);
  line-height: 1.65;
}

.profile-meta {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
}

.profile-meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(49, 87, 255, 0.1);
}

.profile-meta dt,
.profile-meta dd {
  margin: 0;
}

.profile-meta dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.profile-meta dd {
  font-weight: 950;
}

.profile-card-head,
.metric-card span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-weight: 900;
}

.vip-card.active {
  color: #fff;
  background:
    radial-gradient(circle at 18% 18%, rgba(0, 200, 255, 0.28), transparent 30%),
    linear-gradient(145deg, #101427, #182660 52%, #532fb2);
}

.vip-card.active p,
.vip-card.active .profile-meta dt {
  color: rgba(255, 255, 255, 0.76);
}

.metric-card strong {
  display: block;
  margin: 18px 0 8px;
  font-size: 46px;
  line-height: 1;
}

.profile-section {
  padding: 24px;
}

.profile-loading,
.profile-empty,
.payment-empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 42px 24px;
  text-align: center;
}

.profile-loading svg,
.profile-empty svg,
.payment-empty svg {
  width: 38px;
  height: 38px;
  color: var(--blue);
}

.payment-table {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(49, 87, 255, 0.12);
  border-radius: 8px;
}

.payment-row {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1fr 0.7fr 0.9fr;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 0 16px;
  border-top: 1px solid rgba(49, 87, 255, 0.1);
  background: rgba(255, 255, 255, 0.62);
  font-size: 14px;
}

.payment-row:first-child {
  border-top: 0;
}

.payment-head {
  color: var(--muted);
  background: rgba(244, 251, 255, 0.82);
  font-size: 13px;
  font-weight: 900;
}

.split-tool {
  display: grid;
  grid-template-columns: minmax(380px, 520px) minmax(360px, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: stretch;
}

.lyrics-output-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  max-height: none;
}

.split-tool > .studio-panel,
.split-tool > .lyrics-output-panel {
  height: 100%;
  max-height: none;
}

.lyrics-output-panel .lyrics-create-button {
  width: auto;
  min-width: 168px;
  align-self: center;
  margin-top: 16px;
  padding: 0 28px;
}

#lyricsInspirationTags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 4px;
}

.lyrics-output {
  flex: 1;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(49, 87, 255, 0.14);
  border-radius: 8px;
  color: #26344e;
  background: rgba(255, 255, 255, 0.74);
  overflow: auto;
  resize: none;
  white-space: pre-wrap;
  line-height: 1.75;
}

.library-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: clamp(12px, 2vh, 18px);
  width: min(1180px, 100%);
  height: 100%;
  min-height: 0;
  margin: 0 auto;
}

.library-head {
  max-width: 760px;
}

.library-head h1 {
  margin-bottom: 6px;
}

.library-head p {
  color: var(--muted);
  font-size: clamp(13px, 1.25vw, 15px);
  line-height: 1.48;
}

.library-grid {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.library-grid > .library-dashboard {
  height: 100%;
  min-height: 0;
  max-height: 100%;
}

.library-empty {
  padding: 18px;
  border: 1px solid rgba(49, 87, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 16px 42px rgba(13, 23, 54, 0.08);
}

.library-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  gap: clamp(12px, 2vh, 16px);
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.library-dashboard > .library-collection-panel,
.library-dashboard > .library-detail-panel {
  height: 100%;
  min-height: 0;
  max-height: 100%;
}

.library-dashboard.is-single {
  grid-template-columns: minmax(0, min(760px, 100%));
  justify-content: center;
}

.library-empty h3,
.library-empty p {
  margin: 0;
}

.library-empty p {
  color: var(--muted);
  line-height: 1.65;
}

.library-empty {
  grid-column: 1 / -1;
  display: grid;
  justify-items: start;
  gap: 14px;
}

.album-panel,
.library-song-panel,
.library-detail-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: clamp(14px, 2vh, 18px);
  border: 1px solid rgba(49, 87, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 42px rgba(13, 23, 54, 0.08);
  backdrop-filter: blur(14px);
}

.album-panel,
.library-song-panel {
  overflow: hidden;
}

.library-collection-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: clamp(12px, 2vh, 16px);
}

.album-panel {
  flex: 0 0 clamp(174px, 24vh, 196px);
  max-height: clamp(174px, 24vh, 196px);
}

.library-song-panel {
  flex: 1 1 auto;
}

.library-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(12px, 2vw, 16px);
  min-height: 0;
}

.library-bottom-grid.has-detail {
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.72fr);
}

.library-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.library-section-head h2 {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 28px);
}

.album-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  width: min(260px, 42vw);
  margin-bottom: 0;
}

.album-create input {
  height: 40px;
}

.album-create .icon-button {
  width: 40px;
  height: 40px;
  color: #ffffff;
  background: var(--grad-icon);
}

.album-grid {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  min-height: 74px;
  overflow-y: auto;
  padding-right: 3px;
}

.album-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: repeat(2, auto);
  gap: 8px;
  align-items: center;
  min-height: 72px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 76, 125, 0.16), transparent 34%) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(246, 249, 255, 0.78)) padding-box,
    var(--grad-line) border-box;
}

.album-card.active {
  border-color: rgba(139, 84, 255, 0.55);
  box-shadow: inset 3px 0 0 rgba(107, 91, 255, 0.86), 0 12px 26px rgba(49, 87, 255, 0.12);
}

.album-cover {
  display: grid;
  grid-row: 1 / 3;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--grad-icon);
}

.album-card strong,
.album-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-card small,
.library-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.library-song-list {
  display: grid;
  flex: 1;
  grid-auto-rows: 76px;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.library-song-list:has(> .library-empty.compact:only-child) {
  display: flex;
  padding-right: 0;
}

.library-song-list:has(> .library-empty.compact:only-child) > .library-empty.compact {
  flex: 1;
  width: 100%;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.library-detail-panel {
  gap: 12px;
}

.mobile-library-head {
  display: none;
}

.library-detail-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.library-detail-head h3 {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 28px);
}

.library-detail-head .icon-button {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}

.library-detail-lyrics p {
  margin: 0;
  color: #465168;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.7;
}

.library-song-row {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) minmax(120px, 160px) auto auto;
  gap: 10px;
  align-items: center;
  height: 76px;
  min-height: 76px;
  padding: 10px;
  border: 1px solid rgba(49, 87, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.library-song-row.is-playing {
  border-color: rgba(139, 84, 255, 0.52);
  background:
    linear-gradient(90deg, rgba(255, 76, 125, 0.1), rgba(139, 84, 255, 0.1), rgba(34, 103, 255, 0.1)),
    rgba(255, 255, 255, 0.95);
  box-shadow: inset 3px 0 0 rgba(107, 91, 255, 0.9), 0 12px 30px rgba(49, 87, 255, 0.12);
}

.library-song-row.has-error {
  border-color: rgba(255, 79, 139, 0.24);
  background:
    linear-gradient(90deg, rgba(255, 79, 139, 0.06), rgba(139, 92, 246, 0.04)),
    rgba(255, 255, 255, 0.82);
}

.library-album-select {
  height: 34px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 850;
}

.library-empty.compact {
  align-content: center;
  min-height: 180px;
}

.qa-layout {
  display: grid;
  position: relative;
  z-index: 2;
  grid-template-columns: minmax(260px, 0.7fr) minmax(420px, 1fr);
  gap: clamp(24px, 5vw, 60px);
  align-items: start;
  width: min(1140px, calc(100% - 36px));
  margin: 0 auto;
  padding-top: 22px;
}

.qa-copy p {
  color: var(--muted);
  line-height: 1.75;
}

.qa-list {
  display: grid;
  gap: 12px;
}

.qa-list article {
  padding: 18px;
  border: 1px solid rgba(49, 87, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 38px rgba(13, 23, 54, 0.07);
}

.qa-list h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 18px;
}

.qa-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.site-footer {
  color: var(--ink);
  background: transparent;
}

.footer-shell {
  display: grid;
  position: relative;
  z-index: 2;
  grid-template-columns: minmax(240px, 1.5fr) repeat(3, minmax(130px, 1fr));
  gap: 32px;
  width: min(1140px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 22px;
}

.footer-brand .brand {
  margin-bottom: 16px;
}

.footer-brand p {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.footer-column {
  display: grid;
  gap: 10px;
  align-content: start;
}

.footer-column h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 15px;
}

.footer-column a {
  color: var(--muted);
  font-size: 14px;
}

.footer-column a:hover {
  color: var(--blue);
}

.footer-bottom {
  justify-content: space-between;
  gap: 18px;
  width: min(1140px, calc(100% - 36px));
  margin: 0 auto;
  padding: 18px 0 24px;
  border-top: 1px solid rgba(49, 87, 255, 0.12);
  color: var(--muted);
  font-size: 13px;
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.3;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
  }

  .site-header > .brand {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
  }

  .main-nav {
    display: none;
  }

  .menu-toggle {
    display: grid;
    grid-column: 1;
    grid-row: 1;
  }

  .header-actions {
    grid-column: 3;
    grid-row: 1;
  }

  .hero-grid,
  .queue-layout,
  .split-tool,
  .song-grid,
  .library-grid,
  .profile-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .library-dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    max-height: none;
  }

  .album-grid {
    grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
    max-height: none;
  }

  .library-song-list {
    max-height: none;
  }

  .library-bottom-grid.has-detail {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.84fr);
  }

  .account-card {
    grid-row: auto;
  }

  .payment-row {
    grid-template-columns: 1.2fr 0.8fr 0.9fr;
  }

  .payment-row span:nth-child(3),
  .payment-row span:nth-child(5) {
    display: none;
  }

  .how-steps {
    gap: 14px;
  }

  .how-steps article {
    min-height: 250px;
    padding: 32px 18px;
  }

  .hero {
    min-height: auto;
  }

  .tech-field {
    opacity: 0.42;
  }

  .hero-copy {
    padding-top: 18px;
  }
}

@media (max-height: 760px) and (min-width: 681px) {
  .page-section {
    padding-top: 78px;
    padding-bottom: 24px;
  }

  .create-layout {
    max-height: calc(100vh - 102px);
    gap: 20px;
  }

  .history-layout {
    height: calc(100vh - 102px);
    min-height: 360px;
    max-height: calc(100vh - 102px);
    gap: 20px;
  }

  .mood-map {
    min-height: 138px;
  }

  .panel-head h2 {
    font-size: 23px;
  }

  .section-kicker {
    margin-bottom: 6px;
    font-size: 12px;
  }

  textarea {
    min-height: 66px;
    padding: 10px 12px;
    line-height: 1.45;
  }

  select {
    height: 38px;
  }

  input[type="text"] {
    height: 38px;
  }

  .style-chip,
  .instrument-chip {
    min-height: 28px;
    padding: 0 9px;
  }

  .credit-pill,
  .cost-note {
    font-size: 12px;
  }

  .generate-button {
    min-height: 38px;
  }

  .pricing-page {
    padding-top: 78px;
    padding-bottom: 18px;
  }

  .pricing-hero {
    margin-bottom: 12px;
  }

  .pricing-hero h1 {
    font-size: clamp(28px, 4.2vw, 42px);
  }

  .pricing-hero p {
    font-size: 14px;
    line-height: 1.45;
  }

  .pricing-title-row {
    margin-bottom: 10px;
  }

  .price-card {
    min-height: 268px;
    padding: 16px;
  }

  .price {
    margin: 4px 0;
    font-size: 30px;
  }

  .price-card p,
  .price-card li {
    line-height: 1.35;
    font-size: 13px;
  }

  .price-card ul {
    gap: 4px;
    margin: 8px 0 12px;
  }

  .plan-tag {
    min-height: 22px;
    font-size: 11px;
  }
}

@media (max-width: 680px) {
  :root {
    --mobile-header-space: 88px;
    --mobile-page-gap: 14px;
    --mobile-page-bottom: 32px;
    --mobile-player-reserve: 104px;
    --keyboard-cover-height: 0px;
  }

  .site-header {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: 12px 14px;
  }

  .brand {
    min-width: 0;
    font-size: 22px;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }

  .header-actions .ghost-button,
  .header-actions .icon-button,
  .header-actions .language-button {
    display: none;
  }

  .hero {
    padding: 92px 14px 28px;
  }

  .page-section {
    height: 100svh;
    min-height: 100svh;
    max-height: 100svh;
    overflow: hidden;
    padding: var(--mobile-header-space) 22px var(--mobile-page-bottom);
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .create-page,
  .history-page {
    height: auto;
    min-height: 100svh;
    max-height: none;
    overflow: visible;
  }

  .intro-page {
    align-items: start;
    padding-top: calc(var(--mobile-header-space) + 68px);
  }

  .intro-shell {
    width: min(100%, 460px);
    text-align: left;
  }

  .intro-actions,
  .intro-shell .hero-metrics {
    justify-content: flex-start;
  }

  .intro-actions {
    margin-top: 38px;
  }

  .hero-cta {
    width: auto;
    min-width: 168px;
    min-height: 54px;
    padding: 0 28px;
    border-radius: 11px;
    font-size: 20px;
  }

  .intro-shell .eyebrow {
    margin-bottom: 12px;
    font-size: 13px;
  }

  .intro-shell .hero-subtitle {
    margin-top: 18px;
    line-height: 1.75;
  }

  .panel-a,
  .panel-b,
  .sound-rings,
  .album-stack {
    display: none;
  }

  h1 {
    max-width: 9.5em;
    font-size: 40px;
    line-height: 1.08;
  }

  .studio-panel {
    height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom));
    min-height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom));
    max-height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom));
    overflow-y: auto;
    padding: 12px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .create-layout {
    height: auto;
    min-height: 0;
    gap: var(--mobile-page-gap);
    max-height: none;
    align-items: start;
    overflow: visible;
  }

  .history-layout {
    height: auto;
    min-height: 0;
    max-height: none;
    gap: var(--mobile-page-gap);
    align-items: start;
    overflow: visible;
    overscroll-behavior: auto;
  }

  .qa-page {
    padding-bottom: 0;
  }

  .qa-layout {
    align-content: center;
    min-height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom));
    width: min(100%, calc(100% - 28px));
    padding-top: 0;
  }

  .qa-copy {
    display: grid;
    gap: 6px;
  }

  .qa-copy h2 {
    margin: 0;
    font-size: 26px;
  }

  .qa-copy p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
  }

  .qa-list {
    gap: 10px;
  }

  .qa-list article {
    padding: 13px 14px;
  }

  .qa-list h3 {
    margin-bottom: 5px;
    font-size: 16px;
  }

  .qa-list p {
    font-size: 13px;
    line-height: 1.45;
  }

  .site-footer {
    display: none;
  }

  .music-motif {
    opacity: 0.18;
  }

  .mode-tabs,
  .control-grid {
    grid-template-columns: 1fr;
  }

  .create-layout,
  .history-layout,
  .qa-layout,
  .footer-shell,
  .profile-hero {
    grid-template-columns: 1fr;
  }

  .library-page {
    height: auto;
    min-height: 0;
    max-height: none;
    padding: var(--mobile-header-space) 12px 0;
    overflow: visible;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .library-shell {
    height: auto;
    min-height: 0;
    gap: 0;
  }

  .library-head {
    display: grid;
    gap: 3px;
    flex: 0 0 auto;
    padding: 0 0 8px;
  }

  .library-head h1 {
    margin: 0;
    font-size: 23px;
    line-height: 1.1;
  }

  .library-head p {
    display: none;
  }

  .library-dashboard {
    grid-template-rows: auto auto;
    grid-template-columns: 1fr;
    gap: 0;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .album-panel,
  .library-song-panel,
  .library-detail-panel {
    padding: 10px;
  }

  .library-collection-panel,
  .library-detail-panel {
    height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom) - 34px);
    min-height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom) - 34px);
    max-height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom) - 34px);
    margin: 0;
    scroll-margin-top: var(--mobile-header-space);
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .library-collection-panel {
    overflow: hidden;
    scroll-snap-align: none;
    scroll-snap-stop: normal;
  }

  .album-panel {
    flex: 0 0 auto;
    max-height: 166px;
    min-height: 150px;
  }

  .library-detail-panel {
    margin-top: var(--mobile-page-bottom);
    overflow: hidden;
  }

  .style-lab-panel,
  .lyrics-stage-panel,
  .result-panel {
    position: relative;
    z-index: 5;
    height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom));
    min-height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom));
    max-height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom));
    overflow: hidden;
    scroll-margin-top: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .studio-panel,
  .style-lab-panel,
  .result-panel,
  .lyrics-stage-panel {
    margin-bottom: var(--mobile-page-gap);
  }

  .style-lab-panel {
    overflow-y: auto;
  }

  .style-lab-panel,
  .lyrics-stage-panel,
  .result-panel {
    padding: 12px;
  }

  .studio-panel .panel-head {
    gap: 8px;
    margin-bottom: 8px;
  }

  .studio-panel .panel-head h2,
  .style-lab-panel h3,
  .lyrics-stage-panel h3,
  .result-panel h3 {
    font-size: 21px;
  }

  .field-block {
    gap: 5px;
    margin-bottom: 8px;
  }

  .field-block span,
  .field-label {
    font-size: 12px;
  }

  .field-line {
    gap: 8px;
  }

  .text-tool-button {
    min-height: 28px;
    padding: 0 9px;
    font-size: 11px;
  }

  .credit-pill,
  .model-select-pill {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
  }

  .model-select-pill select {
    min-width: 92px;
    height: 26px;
    font-size: 12px;
  }

  input[type="text"],
  select {
    height: 38px;
    padding-inline: 11px;
  }

  textarea {
    min-height: 72px;
    max-height: 18svh;
    padding: 10px 11px;
    line-height: 1.45;
  }

  .lyrics-field textarea {
    min-height: 88px;
    max-height: 20svh;
  }

  .inspiration-tags {
    gap: 6px;
  }

  .inspiration-tag {
    min-height: 26px;
    padding: 0 8px;
    font-size: 11px;
  }

  .clear-studio-button {
    min-height: 28px;
    padding: 0 9px;
    font-size: 11px;
  }

  .mood-map {
    min-height: 142px;
  }

  .mood-quadrant {
    display: none;
  }

  .mood-axis-y {
    left: 8px;
    top: 8px;
    display: inline-flex;
    width: auto;
    height: 24px;
    min-height: 0;
    grid-template-rows: none;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 8px;
    line-height: 1;
    transform: none;
    white-space: nowrap;
  }

  .mood-axis-y em,
  .mood-axis-y b,
  .mood-axis-y i {
    display: inline-flex;
    width: auto;
    align-items: center;
    justify-content: center;
    line-height: 1;
    white-space: nowrap;
  }

  .mood-axis-x {
    bottom: 8px;
  }

  .mood-readout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .mood-readout span {
    padding: 7px 8px;
    font-size: 11px;
  }

  .right-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .how-section .content-shell {
    display: flex;
    min-height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom));
    flex-direction: column;
    justify-content: center;
  }

  .how-head {
    margin-bottom: 14px;
  }

  .how-head h2 {
    margin: 0 0 8px;
    font-size: 26px;
    line-height: 1.18;
  }

  .how-head p {
    font-size: 14px;
    line-height: 1.5;
  }

  .how-steps {
    gap: 10px;
  }

  .how-steps article {
    grid-template-columns: auto 1fr;
    justify-items: stretch;
    align-items: center;
    align-content: center;
    min-height: 0;
    padding: 14px 16px;
    text-align: left;
  }

  .how-steps span {
    width: 34px;
    height: 34px;
    margin: 0 12px 0 0;
    font-size: 16px;
  }

  .how-steps h3 {
    margin: 0;
    font-size: 18px;
  }

  .how-steps p {
    grid-column: 1 / -1;
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
  }

  .profile-hero {
    display: grid;
    align-items: start;
  }

  .page-section {
    min-height: 100svh;
    height: auto;
    overflow: visible;
  }

  .submit-row,
  .section-title-row,
  .footer-bottom {
    align-items: stretch;
    flex-direction: column;
  }

  .generate-button {
    width: 100%;
  }

  .queue-item {
    grid-template-columns: auto 1fr;
  }

  .track-row {
    grid-template-columns: 48px minmax(0, 1fr) minmax(122px, auto);
  }

  .track-actions {
    gap: 7px;
  }

  .track-side-status {
    flex-basis: 88px;
    max-width: 132px;
    padding: 4px 6px;
  }

  .library-song-row {
    grid-template-columns: 48px minmax(0, 1fr) 34px 34px;
    grid-template-rows: minmax(0, 42px) 26px;
    gap: 5px 7px;
    height: 92px;
    min-height: 92px;
    align-items: center;
    padding: 8px 9px;
  }

  .library-song-list {
    grid-auto-rows: 92px;
  }

  .library-song-row .record-cover {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: center;
  }

  .library-song-row .track-main {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    gap: 2px;
  }

  .library-song-row .track-favorite {
    grid-column: auto;
    grid-row: auto;
    align-self: center;
  }

  .library-song-row .track-delete {
    grid-column: auto;
    grid-row: auto;
    align-self: center;
  }

  .library-song-row .track-actions {
    grid-column: 3 / 5;
    grid-row: 1 / 3;
    align-self: center;
    justify-self: end;
    display: grid;
    grid-template-columns: repeat(2, 34px);
    gap: 7px;
  }

  .library-song-row .track-side-status {
    grid-column: 1 / -1;
    order: 3;
    justify-self: end;
    max-width: 104px;
    padding: 3px 6px;
    font-size: 10px;
    line-height: 1.1;
  }

  .library-song-row .track-main span,
  .library-song-row .track-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.28;
  }

  .library-song-row .track-main span {
    color: #536078;
  }

  .library-album-select {
    grid-column: 2 / 4;
    grid-row: 2;
    align-self: center;
    width: min(100%, 210px);
    height: 24px;
    padding: 0 24px 0 10px;
    border-radius: 999px;
    font-size: 11px;
    background-color: rgba(255, 255, 255, 0.72);
  }

  .library-song-row .expiry-pill {
    min-height: 24px;
    padding: 0 10px;
    font-size: 11px;
  }

  .album-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(142px, 46vw);
    grid-template-columns: none;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 2px 4px 0;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
  }

  .album-grid::-webkit-scrollbar {
    height: 4px;
  }

  .album-card {
    scroll-snap-align: start;
    min-height: 66px;
    padding: 8px;
  }

  .record-cover {
    width: 48px;
    height: 48px;
  }

  .track-wave,
  .track-row > .status-dot {
    display: none;
  }

  .global-player {
    right: 0;
    bottom: 0;
    left: 0;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    grid-template-areas: "cover track controls";
    gap: 9px;
    min-height: 62px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -10px 34px rgba(13, 23, 54, 0.13), 0 -4px 18px rgba(139, 84, 255, 0.1);
  }

  .player-queue-panel {
    right: 10px;
    bottom: calc(100% + 8px);
    left: 10px;
    width: auto;
    max-height: min(46svh, 320px);
    z-index: 2;
  }

  .player-queue-list {
    max-height: min(34svh, 242px);
  }

  body.player-open .intro-shell,
  body.player-open .create-layout,
  body.player-open .history-layout,
  body.player-open .how-section .content-shell,
  body.player-open .qa-layout,
  body.player-open .site-footer {
    transform: none;
  }

  body.player-open .page-section {
    padding-bottom: var(--mobile-page-bottom);
  }

  body.player-open .studio-panel,
  body.player-open .style-lab-panel,
  body.player-open .library-collection-panel,
  body.player-open .lyrics-stage-panel,
  body.player-open .result-panel {
    height: calc(100svh - var(--mobile-header-space) - var(--mobile-player-reserve));
    min-height: calc(100svh - var(--mobile-header-space) - var(--mobile-player-reserve));
    max-height: calc(100svh - var(--mobile-header-space) - var(--mobile-player-reserve));
  }

  .player-cover {
    grid-area: cover;
    width: 42px;
    height: 42px;
    border-radius: 50%;
  }

  .player-track {
    grid-area: track;
    gap: 2px;
  }

  .player-track strong {
    font-size: 13px;
  }

  .player-track span {
    font-size: 11px;
  }

  .player-progress-wrap {
    position: absolute;
    top: 6px;
    right: 12px;
    left: 12px;
    display: block;
    width: auto;
    height: 3px;
    font-size: 0;
    pointer-events: none;
  }

  .player-progress-wrap span {
    display: inline;
    font-size: 0;
  }

  .player-progress-wrap input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 3px;
    margin: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 79, 139, 0.78), rgba(139, 92, 246, 0.76), rgba(47, 111, 255, 0.74));
    pointer-events: none;
  }

  .player-progress-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 0;
    height: 0;
    border: 0;
  }

  .player-progress-wrap input[type="range"]::-moz-range-thumb {
    width: 0;
    height: 0;
    border: 0;
  }

  .player-progress-wrap input[type="range"]::-moz-range-track {
    height: 3px;
    border: 0;
    border-radius: 999px;
    background: transparent;
  }

  .player-controls {
    grid-area: controls;
    justify-content: end;
    gap: 6px;
  }

  #globalPlayerLoop,
  #globalPlayerVolume,
  #globalPlayerPrev {
    display: none;
  }

  .player-skip,
  .player-mode {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .player-play {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .player-queue-panel {
    right: 8px;
    bottom: calc(100% + 8px);
    left: 8px;
    width: auto;
    max-height: min(420px, 46svh);
  }

  .player-queue-list {
    max-height: min(340px, 36svh);
  }

  .how-steps {
    grid-template-columns: 1fr;
  }

  .pricing-page {
    align-items: start;
    height: 100svh;
    min-height: 100svh;
    max-height: 100svh;
    overflow: hidden;
    padding: 86px 16px 18px;
  }

  .pricing-page .content-shell {
    display: flex;
    height: 100%;
    min-height: 0;
    flex-direction: column;
  }

  .pricing-hero {
    margin-bottom: 8px;
  }

  .pricing-hero h1 {
    margin-bottom: 5px;
    font-size: 25px;
    line-height: 1.18;
  }

  .pricing-hero p {
    font-size: 12px;
    line-height: 1.42;
  }

  .pricing-title-row {
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
  }

  .pricing-title-row h2 {
    font-size: 19px;
  }

  .billing-toggle {
    justify-content: stretch;
  }

  .billing-toggle button {
    flex: 1;
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
  }

  .pricing-selector {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 9px;
  }

  .price-option {
    min-height: 86px;
    gap: 4px;
    padding: 10px 8px;
    border-radius: 9px;
  }

  .price-option .plan-tag {
    min-height: 19px;
    padding: 0 7px;
    font-size: 10px;
  }

  .price-option strong {
    font-size: 14px;
  }

  .option-price b {
    font-size: 25px;
  }

  .option-price small {
    font-size: 11px;
  }

  .pricing-detail-card {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px;
    border-radius: 10px;
  }

  .pricing-detail-copy {
    gap: 6px;
  }

  .pricing-detail-copy h3,
  .payment-box h3 {
    font-size: 20px;
  }

  .detail-price span {
    font-size: 42px;
  }

  .detail-price small {
    font-size: 13px;
  }

  .pricing-detail-copy p,
  .payment-box p,
  .detail-feature-list,
  .payment-box small {
    font-size: 12px;
    line-height: 1.38;
  }

  .detail-feature-list {
    gap: 3px;
    margin: 0;
  }

  .payment-box {
    padding: 12px;
  }

  .payment-box .solid-button {
    min-height: 36px;
  }

  .pricing-carousel {
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
    padding: 0 2px 34px;
  }

  .pricing-grid {
    display: flex;
    height: 100%;
    gap: 0;
    transition: transform 0.28s ease;
    will-change: transform;
  }

  .price-card {
    flex: 0 0 100%;
    min-height: 0;
    height: 100%;
    padding: 15px 16px;
    grid-template-rows: auto auto auto auto 1fr auto;
  }

  .price-card h3 {
    margin: 4px 0 0;
    font-size: 19px;
  }

  .price {
    margin: 8px 0 4px;
    font-size: 31px;
  }

  .price-card p,
  .price-card li {
    font-size: 13px;
    line-height: 1.4;
  }

  .price-card ul {
    gap: 4px;
    margin: 8px 0 12px;
  }

  .pricing-page-button {
    display: grid;
    position: absolute;
    z-index: 3;
    top: 50%;
    width: 34px;
    height: 34px;
    color: #ffffff;
    border-color: transparent;
    background: var(--grad-action);
    box-shadow: var(--brand-glow);
    transform: translateY(-50%);
  }

  .pricing-prev {
    left: 8px;
  }

  .pricing-next {
    right: 8px;
  }

  .pricing-dots {
    position: absolute;
    right: 0;
    bottom: 8px;
    left: 0;
    display: flex;
    justify-content: center;
    gap: 7px;
  }

  .pricing-dots button {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.22);
  }

  .pricing-dots button.active {
    width: 22px;
    background: var(--grad-action);
  }

  .profile-page {
    padding: 96px 14px 36px;
  }

  .profile-card,
  .profile-section {
    padding: 18px;
  }

  .account-button {
    padding-right: 5px;
  }

  .account-label {
    display: none;
  }

  .mini-wave,
  .status-label {
    grid-column: 2;
  }

  .create-page,
  .history-page {
    display: block;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    padding: var(--mobile-header-space) 22px var(--mobile-page-bottom);
    scroll-snap-align: none;
    scroll-snap-stop: normal;
  }

  .create-layout,
  .history-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--mobile-page-gap);
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    align-items: start;
  }

  .studio-panel,
  .style-lab-panel,
  .result-panel,
  .lyrics-stage-panel {
    height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom));
    min-height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom));
    max-height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom));
    margin: 0 0 var(--mobile-page-gap);
    scroll-margin-top: var(--mobile-header-space);
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .create-layout > .studio-panel,
  .create-layout > .style-lab-panel,
  .history-layout > .result-panel,
  .history-layout > .lyrics-stage-panel {
    height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom));
    min-height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom));
    max-height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom));
  }

  .studio-panel,
  .style-lab-panel {
    overflow-y: auto;
  }

  .result-panel,
  .lyrics-stage-panel {
    overflow: hidden;
  }

  .queue-list {
    min-height: 0;
    overflow-y: auto;
  }

  .synced-lyrics,
  .history-prompt-box div {
    min-height: 0;
    overflow-y: auto;
  }

  body.player-open .studio-panel,
  body.player-open .style-lab-panel,
  body.player-open .library-collection-panel,
  body.player-open .result-panel,
  body.player-open .lyrics-stage-panel {
    height: calc(100svh - var(--mobile-header-space) - var(--mobile-player-reserve));
    min-height: calc(100svh - var(--mobile-header-space) - var(--mobile-player-reserve));
    max-height: calc(100svh - var(--mobile-header-space) - var(--mobile-player-reserve));
  }

  body.player-open .create-layout > .studio-panel,
  body.player-open .create-layout > .style-lab-panel,
  body.player-open .history-layout > .result-panel,
  body.player-open .history-layout > .lyrics-stage-panel {
    height: calc(100svh - var(--mobile-header-space) - var(--mobile-player-reserve));
    min-height: calc(100svh - var(--mobile-header-space) - var(--mobile-player-reserve));
    max-height: calc(100svh - var(--mobile-header-space) - var(--mobile-player-reserve));
  }

  html.mobile-keyboard-open,
  body.mobile-keyboard-open {
    scroll-snap-type: none;
  }

  body.mobile-keyboard-open .create-layout > :not(.keyboard-focus-panel),
  body.mobile-keyboard-open .history-layout > :not(.keyboard-focus-panel) {
    visibility: hidden;
    pointer-events: none;
  }

  body.mobile-keyboard-open .keyboard-focus-panel {
    overflow-y: auto;
    padding-bottom: calc(12px + var(--keyboard-cover-height));
    scroll-padding-bottom: var(--keyboard-cover-height);
    overscroll-behavior: contain;
  }

  body.mobile-keyboard-open .keyboard-focus-section::after {
    content: "";
    display: block;
    height: var(--keyboard-cover-height);
  }

  .library-page .library-dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
    overflow: visible;
  }

  .library-page .library-collection-panel,
  .library-page .library-detail-panel {
    height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom) - 58px);
    min-height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom) - 58px);
    max-height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom) - 58px);
    margin: 0 0 var(--mobile-page-gap);
    scroll-margin-top: var(--mobile-header-space);
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .library-page .library-collection-panel {
    scroll-snap-align: none;
    scroll-snap-stop: normal;
  }

  body.player-open .library-page .library-collection-panel,
  body.player-open .library-page .library-detail-panel {
    height: calc(100svh - var(--mobile-header-space) - var(--mobile-player-reserve) - 58px);
    min-height: calc(100svh - var(--mobile-header-space) - var(--mobile-player-reserve) - 58px);
    max-height: calc(100svh - var(--mobile-header-space) - var(--mobile-player-reserve) - 58px);
  }

  .library-page .library-detail-panel {
    overflow: hidden;
  }

  .library-page {
    display: block;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    padding: var(--mobile-header-space) 22px var(--mobile-page-bottom);
    scroll-snap-align: none;
    scroll-snap-stop: normal;
  }

  .library-shell {
    width: 100%;
    height: auto;
    min-height: 0;
    gap: 0;
  }

  .library-head {
    display: none;
  }

  .mobile-library-head {
    display: grid;
    flex: 0 0 auto;
    gap: 3px;
    margin-bottom: 8px;
  }

  .mobile-library-head h3 {
    margin: 0;
    font-size: 21px;
    line-height: 1.1;
  }

  .library-page .library-dashboard {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: var(--mobile-page-gap);
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    align-items: start;
  }

  .library-page .library-dashboard.is-single {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    justify-content: stretch;
  }

  .library-page .library-collection-panel,
  .library-page .library-detail-panel {
    height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom));
    min-height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom));
    max-height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom));
    margin: 0 0 var(--mobile-page-gap);
    padding: 12px;
    scroll-margin-top: var(--mobile-header-space);
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .library-page .library-collection-panel {
    gap: 8px;
    overflow: hidden;
  }

  .library-page .library-detail-panel {
    overflow: hidden;
  }

  body.player-open .library-page .library-collection-panel,
  body.player-open .library-page .library-detail-panel {
    height: calc(100svh - var(--mobile-header-space) - var(--mobile-player-reserve));
    min-height: calc(100svh - var(--mobile-header-space) - var(--mobile-player-reserve));
    max-height: calc(100svh - var(--mobile-header-space) - var(--mobile-player-reserve));
  }

  /* Mobile page contract: every tool/history/library panel uses the same snap page geometry. */
  :root {
    --mobile-panel-height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom));
  }

  body.player-open {
    --mobile-panel-height: calc(100svh - var(--mobile-header-space) - var(--mobile-player-reserve));
  }

  .create-page,
  .history-page,
  .library-page {
    display: block;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    padding: var(--mobile-header-space) 22px calc(var(--mobile-page-bottom) + var(--mobile-header-space));
    scroll-snap-align: none;
    scroll-snap-stop: normal;
  }

  body.player-open .create-page,
  body.player-open .history-page,
  body.player-open .library-page {
    padding-bottom: calc(var(--mobile-player-reserve) + var(--mobile-header-space));
  }

  .create-layout,
  .history-layout,
  .library-dashboard {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: var(--mobile-page-gap);
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    align-items: start;
  }

  .create-layout > .studio-panel,
  .create-layout > .style-lab-panel,
  .history-layout > .result-panel,
  .history-layout > .lyrics-stage-panel,
  .library-dashboard > .library-collection-panel,
  .library-dashboard > .library-detail-panel {
    height: var(--mobile-panel-height);
    min-height: var(--mobile-panel-height);
    max-height: var(--mobile-panel-height);
    margin: 0 0 var(--mobile-page-gap);
    scroll-margin-top: var(--mobile-header-space);
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .library-page {
    padding-inline: 12px;
  }

  .library-dashboard.is-single {
    grid-template-rows: auto;
  }

  .library-dashboard > .library-collection-panel {
    gap: 8px;
    overflow: hidden;
  }

  .library-dashboard > .library-detail-panel,
  .history-layout > .lyrics-stage-panel,
  .history-layout > .result-panel {
    overflow: hidden;
  }

  /* Mobile fit contract: outer panels must stay one viewport tall.
     Only history/library item lists scroll inside their own list areas. */
  .style-lab-panel,
  .studio-panel,
  .lyrics-output-panel,
  .profile-card,
  .profile-section,
  .pricing-grid .price-card {
    min-height: 0;
    overflow: hidden;
  }

  .style-lab-panel {
    display: grid;
    grid-template-rows: auto minmax(118px, 0.9fr) auto auto auto auto;
    align-content: stretch;
    gap: clamp(6px, 1.35svh, 10px);
  }

  .style-lab-panel > div:first-child {
    min-height: 0;
  }

  .style-lab-panel .section-kicker,
  .style-lab-panel h3,
  .style-lab-panel p {
    margin-block: 0;
  }

  .style-lab-panel p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .style-lab-panel .mood-map {
    width: 100%;
    min-height: 0;
    height: clamp(112px, 25svh, 156px);
  }

  .style-lab-panel .chips-group {
    min-height: 0;
    gap: 6px;
    overflow: hidden;
  }

  .style-lab-panel .style-chip,
  .style-lab-panel .instrument-chip {
    min-height: 25px;
    padding: 0 9px;
    font-size: 11px;
  }

  .style-lab-panel .mood-readout span {
    min-height: 28px;
  }

  .style-lab-panel .right-control-grid {
    min-height: 0;
  }

  .style-lab-panel .field-block {
    min-height: 0;
    margin-bottom: 0;
  }

  .style-lab-panel select {
    height: 34px;
  }

  .style-submit-row {
    min-height: 0;
    gap: 5px;
  }

  .style-submit-row .generate-button {
    min-height: 40px;
  }

  .style-submit-row .cost-note {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .record-list,
  .library-song-list {
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (max-width: 680px) {
  /* HARD RULE: mobile outer panels must fit one viewport.
     Do not make outer panels scroll; compress controls at low heights instead.
     Approved internal scrollers are repeated item lists only. See docs/MOBILE_LAYOUT_RULES.md. */
  :root {
    --mobile-panel-height: calc(100svh - var(--mobile-header-space) - var(--mobile-page-bottom));
  }

  body.player-open {
    --mobile-panel-height: calc(100svh - var(--mobile-header-space) - var(--mobile-player-reserve));
  }

  .page-section,
  .pricing-page,
  .profile-page {
    max-height: 100svh;
    overflow: hidden;
  }

  .create-page,
  .history-page,
  .tool-page,
  .library-page {
    display: block;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    padding: var(--mobile-header-space) 22px calc(var(--mobile-page-bottom) + var(--mobile-header-space));
    scroll-snap-align: none;
    scroll-snap-stop: normal;
  }

  body.player-open .create-page,
  body.player-open .history-page,
  body.player-open .tool-page,
  body.player-open .library-page {
    padding-bottom: calc(var(--mobile-player-reserve) + var(--mobile-header-space));
  }

  .create-layout,
  .history-layout,
  .split-tool,
  .library-dashboard {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: var(--mobile-page-gap);
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    align-items: start;
  }

  .create-layout > .studio-panel,
  .create-layout > .style-lab-panel,
  .history-layout > .result-panel,
  .history-layout > .lyrics-stage-panel,
  .split-tool > .studio-panel,
  .split-tool > .lyrics-output-panel,
  .library-dashboard > .library-collection-panel,
  .library-dashboard > .library-detail-panel {
    height: var(--mobile-panel-height);
    min-height: var(--mobile-panel-height);
    max-height: var(--mobile-panel-height);
    margin: 0 0 var(--mobile-page-gap);
    scroll-margin-top: var(--mobile-header-space);
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .studio-panel,
  .style-lab-panel,
  .result-panel,
  .lyrics-stage-panel,
  .lyrics-output-panel,
  .library-collection-panel,
  .library-detail-panel,
  .profile-card,
  .profile-section,
  .pricing-grid .price-card {
    min-height: 0;
    overflow: hidden;
  }

  .queue-list,
  .record-list,
  .library-song-list,
  .player-queue-list,
  textarea {
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .tool-page .split-tool {
    width: min(100%, 520px);
    margin-inline: auto;
  }

  .lyrics-output-panel {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  .lyrics-output-panel .section-kicker,
  .lyrics-output-panel h3 {
    margin: 0;
  }

  .lyrics-output {
    min-height: 0;
    max-height: none;
    resize: none;
  }

  .lyrics-output-panel .lyrics-create-button {
    min-height: 38px;
    margin-top: 0;
  }

  .profile-page {
    display: block;
    height: 100svh;
    min-height: 100svh;
    max-height: 100svh;
    padding: var(--mobile-header-space) 14px var(--mobile-page-bottom);
    overflow: hidden;
  }

  .profile-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
    height: 100%;
    min-height: 0;
  }

  .profile-hero {
    align-items: center;
    gap: 8px;
    margin: 0;
  }

  .profile-hero h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.05;
  }

  .profile-hero p {
    display: none;
  }

  .profile-hero .ghost-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .profile-root {
    gap: 8px;
    min-height: 0;
    overflow: hidden;
  }

  .profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-height: 0;
  }

  .profile-card {
    min-height: 0;
    padding: 10px;
  }

  .account-card {
    grid-row: auto;
    grid-column: 1 / -1;
  }

  .profile-person {
    gap: 10px;
  }

  .profile-avatar {
    width: 42px;
    height: 42px;
  }

  .profile-person h2 {
    font-size: 16px;
  }

  .profile-person p,
  .profile-card p {
    font-size: 11px;
    line-height: 1.25;
  }

  .profile-meta {
    gap: 6px;
    margin-top: 8px;
  }

  .profile-meta div {
    gap: 8px;
    padding-top: 6px;
  }

  .profile-meta dt,
  .profile-meta dd {
    font-size: 11px;
  }

  .metric-card strong {
    margin: 8px 0 4px;
    font-size: 28px;
  }

  .profile-card-head,
  .metric-card span {
    font-size: 11px;
  }

  .profile-section {
    min-height: 0;
    padding: 10px;
    overflow: hidden;
  }

  .profile-section .section-title-row {
    margin-bottom: 8px;
  }

  .profile-section .section-title-row h2 {
    font-size: 18px;
  }

  .payment-empty {
    min-height: 0;
    padding: 14px 10px;
  }

  .payment-empty p {
    font-size: 12px;
    line-height: 1.35;
  }

  .payment-table {
    max-height: 30svh;
    overflow: hidden;
  }

  .payment-row {
    grid-template-columns: 1fr 0.72fr 0.82fr;
    min-height: 34px;
    padding: 0 8px;
    font-size: 11px;
  }

  .payment-row span:nth-child(4),
  .payment-row span:nth-child(5) {
    display: none;
  }

  .pricing-page {
    display: block;
    height: 100svh;
    min-height: 100svh;
    max-height: 100svh;
    padding: 78px 14px 16px;
  }

  .pricing-page .content-shell {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 8px;
    height: 100%;
    min-height: 0;
  }

  .pricing-hero {
    display: grid;
    gap: 4px;
    margin: 0;
  }

  .pricing-hero .section-kicker {
    margin: 0;
    font-size: 11px;
  }

  .pricing-hero h1 {
    max-width: 100%;
    margin: 0;
    font-size: clamp(22px, 6vw, 25px);
    line-height: 1.12;
  }

  .pricing-hero p {
    display: -webkit-box;
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    color: #5d6680;
    font-size: 12px;
    line-height: 1.38;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .pricing-title-row {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 6px;
    margin: 0 0 2px;
    text-align: center;
  }

  .pricing-title-row > div:first-child {
    min-width: 0;
  }

  .pricing-title-row .section-kicker {
    margin: 0 0 2px;
    font-size: 11px;
  }

  .pricing-title-row h2 {
    margin: 0;
    white-space: nowrap;
    font-size: 18px;
    line-height: 1.12;
  }

  .billing-toggle {
    justify-self: center;
    width: min(210px, 100%);
    padding: 3px;
    border-radius: 9px;
  }

  .billing-toggle button {
    min-height: 32px;
    padding: 0 12px;
    border-radius: 7px;
    font-size: 12px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .billing-toggle button span {
    display: inline;
    margin-left: 2px;
    font-size: 10px;
  }

  .pricing-selector {
    display: grid;
    gap: 6px;
    margin-bottom: 8px;
  }

  .pricing-grid {
    display: block;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .pricing-grid .price-card {
    display: none;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .pricing-grid .price-card.active {
    display: grid;
  }

  .pricing-grid .price-card h3 {
    margin-top: 4px;
    font-size: 20px;
  }

  .pricing-grid .price {
    margin: 8px 0 4px;
    font-size: 42px;
  }

  .pricing-grid .price-card p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .pricing-grid .price-card ul {
    gap: 6px;
    margin: 10px 0 14px;
  }

  .pricing-grid .price-card li {
    font-size: 12px;
    line-height: 1.28;
  }
}

@media (max-width: 680px) and (max-height: 740px) {
  :root {
    --mobile-header-space: 76px;
    --mobile-page-gap: 10px;
    --mobile-page-bottom: 18px;
    --mobile-player-reserve: 86px;
  }

  .site-header {
    padding: 9px 12px;
  }

  .brand {
    font-size: 18px;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
  }

  .header-actions .solid-button {
    min-height: 36px;
    padding: 0 14px;
    font-size: 13px;
  }

  .mobile-menu-button,
  .account-button {
    width: 38px;
    height: 38px;
  }

  .studio-panel,
  .style-lab-panel,
  .result-panel,
  .lyrics-stage-panel,
  .library-collection-panel,
  .library-detail-panel,
  .lyrics-output-panel,
  .price-card {
    padding: 10px;
  }

  .studio-panel .panel-head h2,
  .style-lab-panel h3,
  .lyrics-stage-panel h3,
  .result-panel h3 {
    font-size: 19px;
    line-height: 1.08;
  }

  .section-kicker {
    font-size: 11px;
  }

  .field-block span,
  .field-label {
    font-size: 11px;
  }

  input[type="text"],
  select {
    height: 34px;
    font-size: 13px;
  }

  textarea {
    min-height: 58px;
    max-height: 15svh;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.36;
  }

  .lyrics-field textarea {
    min-height: 68px;
    max-height: 16svh;
  }

  .inspiration-tags {
    gap: 5px;
  }

  .inspiration-tag,
  .style-lab-panel .style-chip,
  .style-lab-panel .instrument-chip {
    min-height: 22px;
    padding: 0 7px;
    font-size: 10px;
  }

  .style-lab-panel {
    grid-template-rows: auto minmax(92px, 0.78fr) auto auto auto auto;
    gap: 5px;
  }

  .style-lab-panel p {
    font-size: 11px;
    line-height: 1.28;
    -webkit-line-clamp: 1;
  }

  .style-lab-panel .mood-map {
    height: clamp(92px, 22svh, 126px);
  }

  .mood-axis-x,
  .mood-axis-y {
    font-size: 10px;
  }

  .mood-axis-y {
    height: 21px;
    padding: 0 6px;
  }

  .mood-axis-x {
    min-height: 20px;
    bottom: 6px;
  }

  .mood-dot {
    width: 14px;
    height: 14px;
  }

  .style-lab-panel .mood-readout span {
    min-height: 24px;
    padding: 5px 6px;
    font-size: 10px;
  }

  .right-control-grid {
    gap: 6px;
  }

  .style-lab-panel select {
    height: 30px;
    font-size: 12px;
  }

  .style-submit-row .generate-button {
    min-height: 34px;
    font-size: 14px;
  }

  .style-submit-row .cost-note {
    font-size: 10px;
    line-height: 1.18;
    -webkit-line-clamp: 1;
  }

  .how-head h2 {
    font-size: 22px;
  }

  .how-head p,
  .qa-copy p,
  .qa-list p {
    font-size: 12px;
    line-height: 1.36;
  }

  .how-steps article,
  .qa-list article {
    padding: 10px 12px;
  }

  .profile-hero {
    gap: 8px;
  }

  .pricing-page {
    padding-top: 70px;
  }

  .pricing-grid .price {
    font-size: 36px;
  }
}

@media (max-width: 680px) and (max-height: 660px) {
  :root {
    --mobile-header-space: 68px;
    --mobile-page-gap: 8px;
    --mobile-page-bottom: 12px;
    --mobile-player-reserve: 78px;
  }

  .brand {
    font-size: 16px;
  }

  .brand-logo {
    width: 30px;
    height: 30px;
  }

  .header-actions .solid-button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  .mobile-menu-button,
  .account-button {
    width: 34px;
    height: 34px;
  }

  .studio-panel,
  .style-lab-panel,
  .result-panel,
  .lyrics-stage-panel,
  .library-collection-panel,
  .library-detail-panel,
  .lyrics-output-panel,
  .price-card {
    padding: 8px;
  }

  .studio-panel .panel-head h2,
  .style-lab-panel h3,
  .lyrics-stage-panel h3,
  .result-panel h3 {
    font-size: 17px;
  }

  .style-lab-panel {
    grid-template-rows: auto minmax(78px, 0.7fr) auto auto auto auto;
    gap: 4px;
  }

  .style-lab-panel > div:first-child p {
    display: none;
  }

  .style-lab-panel .mood-map {
    height: clamp(78px, 19svh, 106px);
  }

  .style-lab-panel .chips-group {
    gap: 4px;
  }

  .inspiration-tag,
  .style-lab-panel .style-chip,
  .style-lab-panel .instrument-chip {
    min-height: 20px;
    padding: 0 6px;
    font-size: 9.5px;
  }

  .style-lab-panel .mood-readout span {
    min-height: 22px;
    padding: 4px 5px;
  }

  input[type="text"],
  select,
  .style-lab-panel select {
    height: 28px;
    font-size: 12px;
  }

  textarea {
    min-height: 48px;
    max-height: 13svh;
    font-size: 12px;
  }

  .lyrics-field textarea {
    min-height: 58px;
    max-height: 14svh;
  }

  .style-submit-row .generate-button {
    min-height: 30px;
    font-size: 13px;
  }

  .style-submit-row .cost-note {
    display: none;
  }
}

@media (min-width: 681px) {
  .library-page .library-dashboard.history-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(24px, 4vw, 48px);
    align-items: stretch;
    height: min(620px, calc(100vh - 132px));
    min-height: 430px;
    max-height: calc(100vh - 132px);
    overflow: visible;
    transform: none;
  }

  body.player-open .library-page .library-dashboard.history-layout {
    height: min(576px, calc(100vh - 166px));
    min-height: 390px;
    max-height: calc(100vh - 166px);
    transform: none;
  }

  .library-page .library-dashboard.history-layout > .library-collection-panel,
  .library-page .library-dashboard.history-layout > .library-detail-panel {
    height: 100%;
    min-height: 0;
    max-height: none;
    margin: 0;
  }

  .library-page .library-dashboard.history-layout.is-single {
    grid-template-columns: minmax(0, min(760px, 100%));
    justify-content: center;
  }

  .library-page .library-collection-panel {
    display: grid;
    grid-template-rows: clamp(176px, 24vh, 198px) minmax(0, 1fr);
    gap: clamp(12px, 2vh, 16px);
    overflow: hidden;
  }

  .library-page .album-panel {
    min-height: 0;
    max-height: none;
  }

  .library-page .library-song-panel {
    min-height: 0;
    overflow: hidden;
  }

  .mood-axis-y {
    left: 12px;
    top: 50%;
    display: grid;
    width: 44px;
    height: 112px;
    min-width: 0;
    min-height: 0;
    grid-template-rows: repeat(4, auto);
    align-content: center;
    justify-content: center;
    justify-items: center;
    gap: 5px;
    padding: 0 6px;
    text-align: center;
    transform: translateY(-50%);
  }

  .mood-axis-y em,
  .mood-axis-y b,
  .mood-axis-y i {
    display: grid;
    width: 100%;
    justify-items: center;
    text-align: center;
    line-height: 1;
  }
}

@media (max-width: 680px) {
  .library-page .library-dashboard.history-layout {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: var(--mobile-page-gap);
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    transform: none;
  }

  .library-page .library-dashboard.history-layout > .library-collection-panel,
  .library-page .library-dashboard.history-layout > .library-detail-panel {
    height: var(--mobile-panel-height);
    min-height: var(--mobile-panel-height);
    max-height: var(--mobile-panel-height);
    margin: 0 0 var(--mobile-page-gap);
    scroll-margin-top: calc(var(--mobile-header-space) + 1px);
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .library-page .library-collection-panel {
    display: grid;
    grid-template-rows: auto 154px minmax(0, 1fr);
    gap: 9px;
    overflow: hidden;
  }

  .library-page .mobile-library-head {
    min-height: 0;
    margin-bottom: 0;
  }

  .library-page .album-panel {
    min-height: 0;
    max-height: none;
    padding: 10px;
    overflow: hidden;
  }

  .library-page .album-grid {
    min-height: 68px;
  }

  .library-page .library-song-panel {
    min-height: 0;
    padding: 10px;
    overflow: hidden;
  }

  .library-page .library-song-list {
    min-height: 0;
  }
}

@media (max-width: 380px) {
  .brand {
    gap: 8px;
    font-size: 16px;
  }

  .brand-logo {
    width: 30px;
    height: 30px;
  }

  .header-actions .solid-button {
    padding: 0 12px;
    font-size: 13px;
  }

  .right-control-grid,
  .mood-readout {
    gap: 6px;
  }

  .mood-readout span {
    padding: 7px 6px;
    font-size: 10px;
  }

  select {
    padding-inline: 8px;
    font-size: 12px;
  }
}
