:root {
  color-scheme: dark;
  --bg: #090b10;
  --panel: rgba(20, 25, 34, 0.82);
  --panel-2: rgba(28, 35, 47, 0.74);
  --line: rgba(255, 255, 255, 0.1);
  --text: #eef3ff;
  --muted: #93a0b5;
  --cyan: #4de3ff;
  --lime: #b8ff6a;
  --rose: #ff5f8f;
  --amber: #ffd166;
  /* design tokens */
  --radius-sm: 6px;   --radius: 10px;   --radius-lg: 14px;
  --space-xs: 6px;    --space-sm: 12px;  --space: 18px;   --space-lg: 28px;
  --text-xs: 11px;    --text-sm: 13px;   --text-base: 15px; --text-lg: 18px;   --text-xl: 24px;
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.18);
  --shadow:    0 8px 28px rgba(0,0,0,0.26);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.34);
  --transition: 0.22s ease;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 28% 12%, rgba(77, 227, 255, 0.22), transparent 28%),
    radial-gradient(circle at 88% 20%, rgba(255, 95, 143, 0.18), transparent 30%),
    linear-gradient(135deg, #07080d 0%, #101721 48%, #0a0d12 100%);
}

button, input { font: inherit; }

a {
  color: inherit;
}

.language-switcher {
  position: static;
  z-index: 1;
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  color: var(--text);
  background: rgba(8,11,16,0.78);
  backdrop-filter: blur(14px);
}

.language-switcher label {
  color: var(--muted);
  font-size: 12px;
}

.language-switcher select {
  width: 132px;
  max-width: 100%;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255,255,255,0.08);
  padding: 7px 9px;
  outline: none;
}

.top-actions .language-switcher {
  min-height: 40px;
}

.admin-title .language-switcher {
  justify-self: end;
}

.legal-toc .language-switcher {
  width: 100%;
  grid-template-columns: 1fr;
  gap: 5px;
  margin: 2px 0 8px;
  background: rgba(255,255,255,0.055);
}

.legal-toc .language-switcher select {
  width: 100%;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

.landing-body {
  background:
    radial-gradient(ellipse at 30% 10%, rgba(77,227,255,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 60%, rgba(184,255,106,0.06) 0%, transparent 40%),
    radial-gradient(ellipse at 60% 90%, rgba(255,95,143,0.05) 0%, transparent 30%),
    linear-gradient(180deg, #080b10 0%, #0a0f18 50%, #0c1220 100%);
}

.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 22px;
  padding: 16px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(255,255,255,0.10);
  background: rgba(8,11,16,0.78);
  backdrop-filter: blur(16px);
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.landing-brand span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #051018;
  font-weight: 900;
  background: linear-gradient(135deg, #4de3ff, #b8ff6a);
}

.landing-brand strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.landing-nav nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.landing-nav nav a {
  color: rgba(238,243,255,0.72);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.landing-section {
  scroll-margin-top: 96px;
}

.landing-login,
.landing-primary,
.landing-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
}

.landing-login,
.landing-secondary {
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--text);
  background: rgba(255,255,255,0.07);
}

.landing-primary {
  color: #041018;
  font-weight: 800;
  background: linear-gradient(135deg, #4de3ff, #b8ff6a);
}

.landing-main {
  overflow: hidden;
}

.landing-hero {
  position: relative;
  min-height: 94vh;
  display: grid;
  align-items: center;
  padding: 112px clamp(20px, 6vw, 88px) 64px;
}

.hero-score-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.score-staff {
  position: absolute;
  left: max(24px, 7vw);
  right: max(24px, 7vw);
  top: 24%;
  display: grid;
  gap: 16px;
  transform: rotate(-4deg);
  opacity: 0.5;
}

.score-staff span {
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.72), transparent);
}

.hero-wave {
  position: absolute;
  right: 8vw;
  bottom: 18%;
  display: flex;
  align-items: end;
  gap: 10px;
  height: 140px;
}

.hero-wave i {
  width: 10px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(180deg, #4de3ff, #b8ff6a);
  opacity: 0.72;
}

.hero-wave i:nth-child(2) { height: 84px; }
.hero-wave i:nth-child(3) { height: 118px; }
.hero-wave i:nth-child(4) { height: 64px; }
.hero-wave i:nth-child(5) { height: 132px; }
.hero-wave i:nth-child(6) { height: 92px; }
.hero-wave i:nth-child(7) { height: 54px; }
.hero-wave i:nth-child(8) { height: 108px; }
.hero-wave i:nth-child(9) { height: 72px; }

.hero-output-card {
  position: absolute;
  width: 190px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  background: rgba(9,13,22,0.72);
  box-shadow: 0 22px 70px rgba(0,0,0,0.36);
}

.hero-output-card b,
.hero-output-card span {
  display: block;
}

.hero-output-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.card-a {
  right: 12vw;
  top: 24%;
}

.card-b {
  right: 24vw;
  bottom: 20%;
}

.hero-note {
  position: absolute;
  color: rgba(184,255,106,0.68);
  font-size: clamp(48px, 8vw, 120px);
  line-height: 1;
}

.note-a {
  right: 18%;
  top: 38%;
}

.note-b {
  right: 36%;
  top: 20%;
  color: rgba(77,227,255,0.6);
}

.landing-hero-copy {
  position: relative;
  z-index: 2;
  width: min(760px, 100%);
}

.landing-kicker,
.section-head span,
.landing-cta span {
  margin: 0;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.landing-hero h1 {
  margin: 14px 0;
  font-size: clamp(42px, 8vw, 92px);
  line-height: 0.98;
  letter-spacing: 0;
}

.landing-lead {
  max-width: 680px;
  margin: 0;
  color: rgba(238,243,255,0.78);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.72;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.landing-stats {
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 34px;
}

.landing-stats div,
.workflow-grid article,
.output-list article,
.scene-grid article {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: rgba(9,13,22,0.68);
}

.landing-stats div {
  min-height: 82px;
  padding: 14px;
}

.landing-stats b,
.landing-stats span {
  display: block;
}

.landing-stats b {
  font-size: 20px;
}

.landing-stats span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.landing-section,
.landing-cta {
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 76px 0;
}

.section-head {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.section-head h2,
.landing-cta h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.12;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.workflow-grid article,
.scene-grid article {
  min-height: 210px;
  padding: 20px;
}

.workflow-grid b {
  color: var(--cyan);
}

.workflow-grid h3,
.scene-grid h3 {
  margin: 20px 0 10px;
  font-size: 22px;
}

.workflow-grid p,
.scene-grid p,
.landing-cta p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.section-head p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

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

.subscription-grid {
  margin-top: 14px;
}

.pricing-grid article {
  position: relative;
  min-height: 210px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: rgba(9,13,22,0.68);
}

.pricing-grid article[role="button"] {
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.pricing-grid article[role="button"]::after {
  content: attr(data-action-label);
  position: absolute;
  right: 18px;
  bottom: 18px;
  color: rgba(5,16,24,0.95);
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
}

.pricing-grid article[role="button"]:hover,
.pricing-grid article[role="button"]:focus-visible {
  outline: none;
  transform: translateY(-3px);
  border-color: rgba(77,227,255,0.44);
  background: rgba(12,20,30,0.82);
  box-shadow: 0 18px 45px rgba(0,0,0,0.28);
}

.pricing-grid article[role="button"]:hover::after,
.pricing-grid article[role="button"]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.pricing-grid article.featured-price {
  border-color: rgba(184,255,106,0.34);
  background: linear-gradient(135deg, rgba(77,227,255,0.12), rgba(184,255,106,0.10));
}

.pricing-grid article > span {
  width: fit-content;
  border: 1px solid rgba(77,227,255,0.28);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(77,227,255,0.10);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

.pricing-grid h3 {
  margin: 6px 0 0;
  font-size: 22px;
}

.pricing-grid p {
  margin: 0;
  min-height: 52px;
  color: var(--muted);
  line-height: 1.65;
}

.price-line {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-top: 6px;
}

.price-line strong {
  color: var(--lime);
  font-size: 34px;
  line-height: 1;
}

.price-line del {
  color: rgba(238,243,255,0.42);
  font-size: 15px;
}

.pricing-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.pricing-notes span {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,0.055);
  padding: 8px 12px;
  font-size: 13px;
}

.output-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}

.output-preview {
  display: grid;
  place-items: center;
  min-height: 440px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
}

.sheet-page {
  position: relative;
  width: min(300px, 72vw);
  aspect-ratio: 0.72;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 42px 28px;
  border-radius: 6px;
  color: #12151d;
  background: rgba(245,248,255,0.94);
  box-shadow: 0 26px 80px rgba(0,0,0,0.36);
}

.sheet-title {
  width: 48%;
  height: 12px;
  margin: 0 auto 22px;
  border-radius: 10px;
  background: rgba(18,21,29,0.28);
}

.sheet-page span {
  height: 2px;
  background: rgba(18,21,29,0.34);
}

.note-dot {
  position: absolute;
  width: 14px;
  height: 10px;
  border-radius: 50%;
  background: #11151d;
  transform: rotate(-18deg);
}

.d1 { left: 88px; top: 150px; }
.d2 { left: 158px; top: 190px; }
.d3 { left: 118px; top: 252px; }
.d4 { left: 202px; top: 316px; }

.output-list {
  display: grid;
  gap: 12px;
}

.output-list article {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 76px;
  padding: 16px 18px;
}

.output-list b {
  color: var(--text);
}

.output-list span {
  color: var(--muted);
}

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

.landing-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 48px;
  padding: 34px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(77,227,255,0.12), rgba(184,255,106,0.10));
}

body.auth-required {
  min-height: 100vh;
  display: block;
}

body.auth-required .rail,
body.auth-required .topbar,
body.auth-required .dance-buddy {
  display: none;
}

body.auth-required .shell {
  display: block;
  min-height: 100vh;
}

body.auth-required main {
  min-height: 100vh;
  padding: 0;
}

body.auth-required .page {
  display: none;
}

body.auth-required #accountPage {
  display: grid;
}

.auth-page {
  min-height: auto;
  align-content: stretch;
  padding: 0;
  background: transparent;
}

body.auth-required .auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 16%, rgba(184,255,106,0.22), transparent 28%),
    radial-gradient(circle at 70% 70%, rgba(77,227,255,0.18), transparent 32%),
    #080b10;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
}

.auth-side {
  display: grid;
  align-content: center;
  padding: 48px;
  background: rgba(7, 10, 16, 0.88);
  border-right: 1px solid var(--line);
}

.auth-brand {
  width: 100%;
  margin: 0 0 22px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-brand strong,
.auth-brand span {
  display: block;
}

.auth-brand strong {
  font-size: 26px;
}

.auth-brand span {
  margin-top: 4px;
  color: var(--muted);
}

body:not(.auth-required) .auth-brand {
  display: none;
}

.auth-visual {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(255,255,255,0.04), rgba(77,227,255,0.10)),
    radial-gradient(circle at 38% 30%, rgba(255,95,143,0.16), transparent 30%),
    #0b111b;
}

.auth-visual::before {
  content: "";
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(255,255,255,0.10);
  transform: skew(-10deg);
}

.visual-score-lines {
  position: absolute;
  left: 12%;
  right: 8%;
  top: 38%;
  height: 170px;
}

.visual-score-lines span {
  display: block;
  height: 1px;
  margin-bottom: 32px;
  background: linear-gradient(90deg, transparent, rgba(238,243,255,0.72), transparent);
}

.visual-note {
  position: absolute;
  color: rgba(238,243,255,0.88);
  font-size: 72px;
  text-shadow: 0 0 28px rgba(77,227,255,0.35);
}

.visual-note.n-a { left: 22%; top: 28%; }
.visual-note.n-b { left: 54%; top: 46%; font-size: 96px; color: var(--lime); }
.visual-note.n-c { right: 14%; top: 22%; color: var(--cyan); }

.visual-meter {
  position: absolute;
  left: 12%;
  bottom: 12%;
  padding: 18px 20px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(12px);
}

.visual-wave {
  position: absolute;
  height: 120px;
  border-radius: 999px;
  border: 1px solid rgba(77,227,255,0.24);
  background:
    repeating-linear-gradient(90deg, rgba(77,227,255,0.0) 0 12px, rgba(77,227,255,0.22) 12px 15px),
    rgba(255,255,255,0.035);
  filter: blur(0.2px);
}

.visual-wave.w-a {
  left: 10%;
  right: 18%;
  top: 16%;
  transform: rotate(-7deg);
}

.visual-wave.w-b {
  left: 22%;
  right: 8%;
  bottom: 24%;
  transform: rotate(5deg);
  border-color: rgba(184,255,106,0.22);
}

.visual-card {
  position: absolute;
  min-width: 150px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.13);
  background: rgba(8, 12, 20, 0.48);
  backdrop-filter: blur(12px);
}

.visual-card b,
.visual-card span {
  display: block;
}

.visual-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.visual-card.c-a { right: 12%; top: 36%; }
.visual-card.c-b { left: 18%; top: 58%; }

.visual-meter b,
.visual-meter span {
  display: block;
}

.visual-meter b {
  font-size: 28px;
}

.visual-meter span {
  margin-top: 5px;
  color: var(--muted);
}

.dance-buddy {
  --dance-speed: 1.8s;
  --dance-tilt: 3deg;
  --dance-hop: 3px;
  --dance-glow: 0.18;
  position: fixed;
  z-index: 60;
  width: 220px;
  height: 150px;
  left: calc(100vw - 246px);
  top: calc(100vh - 202px);
  cursor: grab;
  user-select: none;
  touch-action: none;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 20px 28px rgba(0,0,0,0.34));
}

.dance-buddy.dragging {
  cursor: grabbing;
}

.choir-stage {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(77,227,255,0.15), rgba(255,95,143,0.10)),
    rgba(9, 13, 20, 0.70);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 0 34px rgba(77,227,255,var(--dance-glow));
  overflow: hidden;
}

.choir-stage::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.06), transparent 24%, transparent 76%, rgba(255,255,255,0.06)),
    radial-gradient(circle at 50% 12%, rgba(255,255,255,0.16), transparent 34%);
  pointer-events: none;
}

.choir-stage::after {
  content: "";
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 20px;
  height: 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.24);
  filter: blur(5px);
}

.choir-kid,
.choir-note {
  position: absolute;
  display: block;
}

.choir-kid {
  width: 62px;
  height: 104px;
  left: calc(var(--kid-x, 100px) - 31px);
  bottom: 24px;
  transform-origin: 50% 92%;
  transform: scale(var(--kid-scale, 1));
  filter: drop-shadow(0 10px 14px rgba(0,0,0,0.24)) drop-shadow(0 0 14px rgba(77,227,255,var(--dance-glow)));
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.choir-kid:nth-of-type(3n + 2) {
  bottom: 28px;
  z-index: 2;
}

.dance-buddy.solo-mode .choir-kid:not(:first-of-type),
.dance-buddy.single-singer .choir-kid:not(:first-of-type) {
  opacity: 0;
  transform: translateY(16px) scale(0.7);
  pointer-events: none;
}

.dance-buddy.solo-mode .choir-kid:first-of-type,
.dance-buddy.single-singer .choir-kid:first-of-type {
  left: 69px;
  transform: scale(1);
}

.choir-kid img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.choir-kid b {
  position: absolute;
  left: 50%;
  bottom: -13px;
  max-width: 70px;
  transform: translateX(-50%);
  color: rgba(238,243,255,0.82);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 8px rgba(0,0,0,0.45);
}

.choir-note {
  color: rgba(255,255,255,0.84);
  font-weight: 900;
  text-shadow: 0 0 16px rgba(77,227,255,0.45);
  opacity: 0;
}

.choir-note.n1 { left: 25px; top: 20px; }
.choir-note.n2 { right: 32px; top: 25px; }
.choir-note.n3 { left: 100px; top: 10px; }

.dance-buddy.playing .choir-kid {
  animation: choirSway var(--dance-speed) ease-in-out infinite;
}

.dance-buddy.playing .choir-kid {
  animation-delay: var(--kid-delay, -0.2s);
}

.dance-buddy.playing .choir-note {
  animation: choirNote calc(var(--dance-speed) * 2.1) ease-in-out infinite;
}

.dance-buddy.playing .choir-note.n2 {
  animation-delay: calc(var(--dance-speed) * -0.55);
}

.dance-buddy.playing .choir-note.n3 {
  animation-delay: calc(var(--dance-speed) * -1.05);
}

@keyframes choirSway {
  0%, 100% { transform: translateY(0) scale(var(--kid-scale, 1)) rotate(calc(var(--dance-tilt) * -0.25)); }
  38% { transform: translateY(calc(var(--dance-hop) * -1)) scale(calc(var(--kid-scale, 1) * 1.035)) rotate(calc(var(--dance-tilt) * 0.35)); }
  62% { transform: translateY(calc(var(--dance-hop) * -0.35)) scale(var(--kid-scale, 1)) rotate(calc(var(--dance-tilt) * -0.2)); }
}

@keyframes choirNote {
  0%, 100% { transform: translateY(12px) scale(0.8); opacity: 0; }
  35% { transform: translateY(-10px) scale(1); opacity: 0.86; }
}

@keyframes readerGlow {
  0% { transform: translateX(-18%); filter: hue-rotate(0deg); }
  100% { transform: translateX(18%); filter: hue-rotate(80deg); }
}

@keyframes scanSweep {
  0%, 100% { transform: translateX(-70%); opacity: 0; }
  45% { opacity: 1; }
  100% { transform: translateX(70%); opacity: 0; }
}

.shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.rail {
  border-right: 1px solid var(--line);
  padding: 24px;
  background: linear-gradient(180deg, rgba(12,18,30,0.88) 0%, rgba(8,11,18,0.72) 100%);
  backdrop-filter: blur(18px);
  position: relative;
}
.rail::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--lime), transparent);
  opacity: 0.5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  color: #071014;
  font-weight: 900;
  font-size: 24px;
}

.brand span, .system-card small, .eyebrow, .panel-head span, .hero-copy span {
  color: var(--muted);
  font-size: 12px;
}

nav {
  display: grid;
  gap: 8px;
}

nav button {
  border: 0;
  text-align: left;
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color var(--transition), background var(--transition), box-shadow var(--transition);
  position: relative;
}
nav button::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--cyan);
  opacity: 0;
  transform: scaleY(0);
  transition: opacity var(--transition), transform var(--transition);
}
nav button:hover {
  color: var(--text);
  background: rgba(77,227,255,0.06);
}
nav button:hover::before {
  opacity: 0.6;
  transform: scaleY(1);
}
nav button.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(77,227,255,0.12), rgba(184,255,106,0.06));
  box-shadow: 0 0 20px rgba(77,227,255,0.06);
}
nav button.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.system-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 36px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
}

.song-brief-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.035));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.song-brief-card b,
.song-brief-card span,
.song-brief-card p {
  display: block;
}

.song-brief-card b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-brief-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.song-brief-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.song-brief-tags em {
  font-style: normal;
  color: #071014;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.song-brief-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.58;
  max-height: 190px;
  overflow: auto;
  padding-right: 2px;
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 18px var(--lime);
}

main { padding: 28px; }

body.reader-mode .rail,
body.reader-mode .topbar {
  display: none;
}

body.reader-mode .shell {
  grid-template-columns: 1fr;
}

body.reader-mode main {
  padding: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: 32px;
  letter-spacing: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0;
  color: var(--cyan);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(440px, 1fr) minmax(280px, 360px);
  gap: 18px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.generate-workspace {
  grid-template-columns: minmax(520px, 1fr) minmax(280px, 360px);
}

.library-page-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(280px, 1fr) minmax(360px, 1.35fr);
  gap: 18px;
}

.panel, .hero-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 70px rgba(0,0,0,0.34);
}

.panel { padding: 18px; }

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

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

.icon-button, .mini-button, .primary, .ghost-button, .score-actions button, .downloads button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255,255,255,0.08);
  padding: 10px 14px;
  cursor: pointer;
}

.mini-button {
  padding: 7px 10px;
  font-size: 12px;
}

.score-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.primary {
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  color: #071014;
  font-weight: 800;
  border: none;
}

.ghost-button {
  position: relative;
  font-weight: 700;
}

.primary:disabled, .downloads button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.search-row input {
  width: 100%;
  color: var(--text);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  outline: none;
}

.path-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 10px 0 12px;
}

.path-row input {
  min-width: 0;
  color: var(--text);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  outline: none;
}

.path-row button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255,255,255,0.08);
  padding: 0 12px;
  cursor: pointer;
}

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

body.auth-required .auth-grid {
  width: 100%;
  margin: 0;
  grid-template-columns: 1fr;
}

.admin-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.auth-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.profile-panel {
  overflow: hidden;
}

body.auth-required .auth-card {
  display: none;
}

body.auth-required .auth-card.active {
  display: grid;
}

body.auth-required .profile-panel {
  display: none;
}

body:not(.auth-required) .auth-card {
  display: none;
}

body:not(.auth-required) .profile-panel {
  width: min(1180px, 100%);
}

body:not(.auth-required) #accountPage {
  justify-items: center;
}

.auth-panel label {
  display: grid;
  gap: 7px;
}

.auth-panel label span {
  color: var(--muted);
  font-size: 12px;
}

.auth-panel input,
.auth-code-row input,
.invite-create input {
  width: 100%;
  min-width: 0;
  color: var(--text);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  outline: none;
}

.auth-code-row,
.invite-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.invite-create {
  grid-template-columns: minmax(0, 1fr) 90px auto;
  margin-bottom: 14px;
}

.order-create {
  grid-template-columns: minmax(0, 1fr) 140px 110px auto;
}

.auth-code-row button,
.auth-panel > button:not(.primary),
.invite-create button,
.admin-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255,255,255,0.08);
  padding: 10px 12px;
  cursor: pointer;
}

.auth-code-row button {
  white-space: nowrap;
}

.admin-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.third-party-login {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.oauth-btn {
  display: block;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.oauth-btn:hover {
  opacity: 0.85;
}

#oauthGoogle {
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #dadce0;
}

#oauthGoogle:hover {
  background: #f8f9fa;
}

#oauthGithub {
  background: #24292f;
  color: #fff;
  border: 1px solid #454c54;
}

#oauthGithub:hover {
  background: #1b1f24;
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-mode-switch button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255,255,255,0.06);
  padding: 10px 12px;
  cursor: pointer;
}

.auth-mode-switch button.active {
  color: var(--text);
  border-color: rgba(77,227,255,0.32);
  background: rgba(77,227,255,0.13);
}

.third-party-login button,
.auth-switch button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255,255,255,0.08);
  padding: 10px 12px;
  cursor: pointer;
}

.auth-switch {
  margin: 2px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.auth-switch button {
  margin-left: 8px;
  padding: 7px 10px;
  color: var(--cyan);
}

.agreement-row {
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr) !important;
  align-items: start;
  gap: 10px !important;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.045);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.auth-panel .agreement-row input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin: 2px 0 0;
  padding: 0;
  border-radius: 4px;
  accent-color: #4de3ff;
  background: transparent;
}

.agreement-row span {
  min-width: 0;
}

.agreement-row button {
  display: inline;
  border: 0;
  padding: 0;
  color: var(--cyan);
  background: transparent;
  cursor: pointer;
  font-size: inherit;
  line-height: inherit;
  white-space: nowrap;
}

.auth-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.agreement-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0,0,0,0.62);
}

.agreement-modal[hidden] {
  display: none;
}

.agreement-dialog {
  width: min(760px, 96vw);
  max-height: min(760px, 86vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13,18,29,0.98);
  box-shadow: 0 24px 80px rgba(0,0,0,0.42);
}

.agreement-content {
  overflow: auto;
  padding: 18px;
  color: var(--muted);
  line-height: 1.68;
  font-size: 13px;
}

.agreement-content h3 {
  margin: 12px 0 6px;
  color: var(--text);
  font-size: 15px;
}

.agreement-summary {
  display: grid;
  gap: 14px;
}

.agreement-summary p {
  margin: 0;
  color: var(--text);
}

.agreement-summary ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
}

.agreement-summary li {
  padding-left: 4px;
}

.agreement-full-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(77,227,255,0.34);
  border-radius: 8px;
  color: var(--text);
  background: rgba(77,227,255,0.12);
  text-decoration: none;
}

.legal-body {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(9,13,22,0.94), rgba(9,13,22,1)),
    var(--bg);
}

.legal-page {
  width: min(1180px, calc(100vw - 32px));
  margin: 28px auto;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  color: var(--muted);
  line-height: 1.75;
}

.legal-toc {
  position: sticky;
  top: 24px;
  align-self: start;
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.055);
}

.legal-toc strong {
  margin: 8px 0 4px;
  color: var(--text);
  font-size: 18px;
}

.legal-toc a {
  min-width: 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.legal-toc a:hover {
  color: var(--cyan);
}

.legal-brand {
  color: var(--text) !important;
  font-weight: 800;
  letter-spacing: 0;
}

.legal-document {
  display: grid;
  gap: 14px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.055);
}

.legal-hero {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.legal-hero span {
  color: var(--cyan);
  font-size: 13px;
}

.legal-page h1,
.legal-page h2 {
  color: var(--text);
}

.legal-page h1 {
  margin: 8px 0 10px;
  font-size: 34px;
  line-height: 1.18;
}

.legal-page h2 {
  margin: 18px 0 8px;
  font-size: 20px;
}

.legal-page p {
  margin: 8px 0;
}

.legal-page section {
  scroll-margin-top: 24px;
}

.profile-summary {
  display: grid;
  gap: 5px;
  min-height: 70px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255,255,255,0.055);
  color: var(--muted);
}

.profile-summary b,
.profile-summary span {
  display: block;
}

.profile-summary b {
  color: var(--text);
}

.admin-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 220px);
  overflow: auto;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-metrics div {
  min-height: 82px;
  display: grid;
  align-content: center;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(77,227,255,0.08), rgba(255,255,255,0.04));
}

.admin-metrics b,
.admin-metrics span,
.admin-row small {
  display: block;
}

.admin-metrics b {
  color: var(--lime);
  font-size: 20px;
}

.admin-metrics span,
.admin-row small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.052);
}

.admin-row b,
.admin-row span,
.admin-row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.admin-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-standalone {
  background: #080b10;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.admin-sidebar {
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(8, 11, 18, 0.78);
}

.admin-sidebar button {
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255,255,255,0.08);
  padding: 11px 12px;
  cursor: pointer;
}

.admin-main {
  padding: 28px;
}

.admin-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.admin-title h1 {
  margin: 4px 0 0;
  font-size: 30px;
}

.purchase-panel {
  grid-column: 1 / -1;
}

.compact-head {
  margin-top: 18px;
}

.compact-head h3 {
  margin: 0;
  font-size: 17px;
}

.account-records {
  margin-top: 14px;
}

.account-billing {
  margin-top: 16px;
  display: grid;
  gap: 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(77,227,255,0.16);
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(77,227,255,0.11), transparent 36%),
    radial-gradient(circle at 92% 8%, rgba(184,255,106,0.18), transparent 30%),
    rgba(255,255,255,0.045);
}

.account-billing::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transform: translateX(-120%);
  animation: billingSweep 5.8s ease-in-out infinite;
}

@keyframes billingSweep {
  0%, 42% { transform: translateX(-120%); }
  62%, 100% { transform: translateX(120%); }
}

.quota-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.quota-summary span {
  min-height: 78px;
  display: grid;
  align-content: center;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(8,12,18,.62);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.plan-card {
  position: relative;
  overflow: hidden;
  display: grid;
  min-height: 178px;
  align-content: space-between;
  gap: 16px;
  border: 1px solid rgba(255,255,255,0.13);
  background: rgba(7,11,18,.68);
  border-radius: 8px;
  padding: 16px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.plan-card:hover,
.plan-card.plan-card-highlight {
  transform: translateY(-2px);
  border-color: rgba(184,255,106,0.44);
  box-shadow: 0 18px 45px rgba(0,0,0,0.24), inset 0 0 0 1px rgba(184,255,106,0.08);
}

.plan-card::after {
  content: "";
  position: absolute;
  inset: auto -24px -48px auto;
  width: 118px;
  height: 118px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(77,227,255,0.16), transparent 68%);
  pointer-events: none;
}

.plan-card b,
.plan-card span {
  display: block;
}

.plan-card span,
.plan-price small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.55;
}

.plan-price {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  text-align: left;
}

.plan-price strong {
  display: block;
  color: var(--lime);
  font-size: 30px;
  line-height: 1;
  margin: 2px 0 0;
}

.plan-price button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  color: #071016;
  font-weight: 900;
  cursor: pointer;
}

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

.account-record {
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(77,227,255,0.07), rgba(255,255,255,0.045));
}

.account-record b,
.account-record span {
  display: block;
}

.account-record span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.record-invites,
.order-invites {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.record-invites button,
.order-invites button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(77,227,255,0.38);
  border-radius: 8px;
  background: rgba(77,227,255,0.10);
  color: var(--text);
  cursor: pointer;
}

.record-invites small,
.order-invites small {
  color: var(--muted);
}

.muted-note {
  color: var(--muted);
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.mode-switch button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255,255,255,0.05);
  cursor: pointer;
}

.mode-switch button.active {
  color: #071014;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  border-color: transparent;
  font-weight: 800;
}

.library-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 210px);
  overflow: auto;
  padding-right: 4px;
}

.library-list.large {
  max-height: calc(100vh - 250px);
}

.song-item {
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
}

.song-item.active {
  border-color: rgba(77,227,255,0.58);
  background: rgba(77,227,255,0.12);
}

.song-item b {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.online-library-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  cursor: default;
}

.online-library-item > button:first-child {
  min-width: 0;
  border: 0;
  padding: 2px;
  color: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.online-library-item .mini-button {
  min-height: 34px;
  padding: 0 10px;
  color: #061018;
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  font-weight: 800;
}

.load-more {
  min-height: 42px;
  border: 1px solid rgba(77,227,255,0.34);
  border-radius: 8px;
  color: var(--cyan);
  background: rgba(77,227,255,0.08);
  cursor: pointer;
  font-weight: 800;
}

.task-history {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 210px);
  overflow: auto;
  padding-right: 4px;
}

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255,255,255,0.052);
}

.task-card.done {
  border-color: rgba(184,255,106,0.28);
}

.task-card.error {
  border-color: rgba(255,95,143,0.36);
}

.task-card b,
.task-card span,
.task-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-card b {
  font-size: 13px;
}

.task-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.task-card small {
  margin-top: 4px;
  color: rgba(238,243,255,0.52);
  font-size: 10px;
}

.task-card-actions {
  display: grid;
  gap: 6px;
}

.task-card button,
.task-ops button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #071014;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  padding: 8px 11px;
  cursor: pointer;
  font-weight: 800;
}

.task-card-actions button + button,
.task-ops button {
  color: var(--text);
  background: rgba(255,255,255,0.075);
}

.task-ops {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.task-ops button {
  white-space: nowrap;
  flex: 0 0 auto;
  min-width: 92px;
}

.task-ops button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.center-stage {
  display: grid;
  gap: 14px;
}

.engine-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.engine-grid div {
  min-height: 74px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.05);
}

.engine-grid div.ready {
  border-color: rgba(184,255,106,0.42);
  background: rgba(184,255,106,0.08);
}

.engine-grid div.missing {
  border-color: rgba(255,209,102,0.36);
  background: rgba(255,209,102,0.08);
}

.engine-grid b,
.engine-grid span {
  display: block;
}

.engine-grid b {
  font-size: 13px;
}

.engine-grid span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  min-height: 128px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 18px 20px;
  background:
    linear-gradient(125deg, rgba(77,227,255,0.2), rgba(255,255,255,0.05) 42%, rgba(184,255,106,0.12)),
    var(--panel);
}

.drop-zone {
  cursor: pointer;
  outline: 1px dashed rgba(255,255,255,0.0);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.drop-zone.dragging,
.drop-zone.uploading {
  border-color: rgba(77,227,255,0.72);
  outline-color: rgba(77,227,255,0.54);
  background:
    linear-gradient(125deg, rgba(77,227,255,0.28), rgba(255,255,255,0.08) 42%, rgba(184,255,106,0.18)),
    var(--panel);
}

.hero-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.orbline {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  transform: skew(-8deg);
}

.hero-copy { position: relative; max-width: 68%; }
.hero-copy p { color: var(--lime); margin: 0 0 5px; }
.hero-copy h2 { margin: 0 0 6px; font-size: 25px; letter-spacing: 0; }
.hero-copy span {
  display: block;
  max-height: 38px;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.35;
}
.hero-panel .primary { position: relative; }

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

#progressFill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--lime), var(--amber));
  transition: width 0.35s ease;
}

.steps {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.step {
  min-height: 34px;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  font-size: 12px;
}

.step.active {
  color: #071014;
  background: var(--cyan);
}

.score-actions { display: flex; gap: 8px; }
.score-actions button { padding: 7px 10px; font-size: 12px; }

.score-actions button.active,
.reader-actions button.active {
  color: #071014;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  border-color: transparent;
  font-weight: 800;
}

.score-preview {
  min-height: 420px;
  display: grid;
  gap: 14px;
}

.player-row {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.player-row input {
  width: 100%;
  accent-color: var(--cyan);
}

.score-reader {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  min-height: 390px;
}

.lyrics-column {
  min-height: 390px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.055);
  overflow: hidden;
}

.lyrics-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.lyrics-column-head span {
  color: var(--muted);
  font-size: 12px;
}

.score-canvas {
  min-height: 390px;
  max-height: 72vh;
  border-radius: 8px;
  background: #cdd2da;
  overflow: auto;
  color: #10141c;
  padding: 22px;
}

.pdf-viewer {
  min-height: 68vh;
  height: 68vh;
  border-radius: 6px;
  overflow: hidden;
  background: #e8ebf0;
}

.reader-page {
  height: 100vh;
  background:
    radial-gradient(circle at 78% 12%, rgba(77, 227, 255, 0.16), transparent 28%),
    radial-gradient(circle at 18% 86%, rgba(255, 209, 102, 0.10), transparent 26%),
    #111317;
  overflow: hidden;
}

.reader-toolbar {
  min-height: 58px;
  display: grid;
  grid-template-columns: auto auto auto auto auto minmax(160px, 1fr) minmax(220px, 360px) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.105), rgba(255,255,255,0.035)),
    rgba(8, 11, 16, 0.92);
  box-shadow: 0 16px 42px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.12);
  backdrop-filter: blur(18px);
  position: relative;
  z-index: 14;
}

.reader-toolbar::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--lime), var(--amber), transparent);
  opacity: 0.42;
}

body.is-playing .reader-toolbar::after {
  animation: readerGlow 1.6s linear infinite;
  opacity: 0.9;
}

.reader-toolbar b,
.reader-toolbar span {
  display: block;
}

.reader-toolbar span {
  color: #d8dce6;
  font-size: 13px;
}

.reader-toolbar > span {
  min-width: 48px;
  text-align: center;
  color: #eef3ff;
  font-variant-numeric: tabular-nums;
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  background: rgba(255,255,255,0.055);
}

.reader-toolbar > span:nth-of-type(2) {
  min-width: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(238,243,255,0.48);
}

.reader-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.reader-actions button,
.reader-icon {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.055));
  padding: 8px 11px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.reader-icon {
  min-width: 58px;
  font-weight: 800;
}

#readerPlay {
  min-width: 68px;
  color: #061015;
  border-color: rgba(184,255,106,0.74);
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  box-shadow: 0 10px 28px rgba(77,227,255,0.20);
}

body.is-playing #readerPlay {
  box-shadow: 0 0 0 1px rgba(184,255,106,0.42), 0 0 28px rgba(184,255,106,0.32);
}

.reader-actions button::after,
.reader-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.26), transparent);
  transition: transform 0.36s ease;
}

.reader-actions button:not(:disabled):hover,
.reader-icon:not(:disabled):hover {
  border-color: rgba(77,227,255,0.54);
  background: rgba(77,227,255,0.12);
  transform: translateY(-1px);
}

.reader-actions button:not(:disabled):hover::after,
.reader-icon:not(:disabled):hover::after {
  transform: translateX(120%);
}

.reader-actions button:disabled,
.reader-icon:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.reader-toolbar input[type="range"] {
  width: 100%;
  height: 8px;
  accent-color: var(--cyan);
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
}

.reader-titlebar {
  min-width: 0;
  text-align: center;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  background: rgba(255,255,255,0.052);
}

.reader-titlebar b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f5f8ff;
  letter-spacing: 0;
}

.reader-titlebar span {
  margin-top: 2px;
  color: rgba(184,255,106,0.84);
}

.reader-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 0;
  height: calc(100vh - 58px);
  overflow: hidden;
}

.reader-lyrics {
  height: calc(100vh - 58px);
  border-radius: 0;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.035)),
    rgba(10, 13, 18, 0.84);
  backdrop-filter: blur(14px);
}

.reader-lyrics .lyrics-list {
  max-height: calc(100vh - 114px);
}

.reader-lyrics .lyrics-list button {
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.reader-lyrics .lyrics-list button.active {
  transform: translateX(8px) scale(1.015);
  border-color: rgba(184,255,106,0.66);
  background: rgba(184,255,106,0.13);
  box-shadow: 0 12px 30px rgba(184,255,106,0.12);
}

.reader-lyrics .lyrics-list button.active span {
  color: #f7ffe9;
  font-weight: 700;
}

.reader-score-canvas {
  height: calc(100vh - 58px);
  position: relative;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,0.026) 1px, transparent 1px),
    #191b20;
  background-size: 42px 42px;
  padding: 28px;
  overflow: auto;
  scroll-behavior: smooth;
}

.reader-score-canvas::before {
  content: "";
  position: sticky;
  top: 0;
  z-index: 8;
  display: block;
  height: 0;
  border-top: 2px solid rgba(77,227,255,0.86);
  box-shadow: 0 0 18px rgba(77,227,255,0.62), 0 12px 34px rgba(77,227,255,0.18);
  opacity: 0;
  pointer-events: none;
}

body.is-playing .reader-score-canvas::before {
  opacity: 1;
}

.reader-score-canvas .pdf-viewer {
  height: calc(100vh - 162px);
  min-height: calc(100vh - 162px);
}

.reader-score-canvas .score-page {
  width: min(980px, 100%);
  min-height: 1260px;
  padding: 54px 64px;
}

.reader-score-canvas .score-page-image {
  width: min(1050px, 100%);
}

.reader-score-canvas .score-page-image {
  border-radius: 6px;
  box-shadow: 0 28px 80px rgba(0,0,0,0.48);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

body.is-playing .reader-score-canvas .score-page-image {
  box-shadow: 0 30px 90px rgba(0,0,0,0.52), 0 0 0 1px rgba(77,227,255,0.12);
}

.reader-score-canvas .score-systems {
  gap: 72px;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 18px;
}

.editor-controls {
  display: grid;
  gap: 16px;
  align-content: start;
}

.editor-controls label,
.transpose-readout {
  display: grid;
  gap: 8px;
}

.editor-controls label span,
.transpose-readout span {
  color: var(--muted);
  font-size: 12px;
}

.editor-controls input[type="range"] {
  width: 100%;
  accent-color: var(--cyan);
}

.editor-toggles {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.editor-toggles label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
}

.reader-score-canvas.compact .score-image-pages,
.reader-score-canvas.compact .score-pages {
  transform: scale(var(--editor-zoom, 1));
  transform-origin: top center;
}

.reader-score-canvas.hide-low-density .measure-hotspot:nth-child(odd),
.reader-score-canvas.hide-low-density [data-time-note]:nth-child(odd) {
  opacity: 0.35;
}

.reader-score-canvas.high-density .measure-hotspot:hover::after {
  background: rgba(77, 227, 255, 0.14);
}

.transpose-readout b {
  font-size: 28px;
}

.part-split-panel,
.sync-editor-panel,
.note-editor-panel {
  display: grid;
  gap: 12px;
  margin-top: 0;
}

.advanced-panel {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.advanced-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.advanced-panel summary::-webkit-details-marker {
  display: none;
}

.advanced-panel summary h3 {
  margin: 0;
}

.advanced-panel summary::after {
  content: "展开";
  color: var(--cyan);
  font-size: 12px;
}

.advanced-panel[open] summary::after {
  content: "收起";
}

.editor-controls .sync-editor-panel,
.editor-controls .note-editor-panel {
  border-top: 1px solid var(--line);
}

.part-source-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.part-source-card {
  display: grid;
  gap: 4px;
  min-height: 68px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  background: rgba(255,255,255,0.052);
}

.part-source-card b,
.part-source-card span {
  display: block;
}

.part-source-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.part-source-card.active,
.part-source-card.ready {
  border-color: rgba(77,227,255,0.34);
  background: rgba(77,227,255,0.10);
}

.part-source-card.locked {
  opacity: 0.55;
}

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

.part-plan span {
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255,255,255,0.045);
  font-size: 12px;
  text-align: center;
}

.part-plan.ready span {
  color: var(--text);
  border-color: rgba(184,255,106,0.26);
  background: rgba(184,255,106,0.08);
}

.part-progress {
  display: grid;
  gap: 8px;
  padding: 10px;
  min-height: 74px;
  border: 1px solid rgba(77,227,255,0.20);
  border-radius: 8px;
  background: rgba(77,227,255,0.075);
}

.part-progress[hidden] {
  display: none;
}

.part-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.part-progress-top b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.part-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
}

.part-progress-track div {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  transition: width 0.35s ease;
}

.part-progress small {
  color: var(--muted);
  font-size: 12px;
}

.part-score-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}

.part-score-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255,255,255,0.052);
}

.part-score-item.ready {
  border-color: rgba(184,255,106,0.24);
  background: rgba(184,255,106,0.065);
}

.part-score-item a,
.part-score-badge {
  display: inline-grid;
  place-items: center;
  min-width: 54px;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(77,227,255,0.28);
  border-radius: 7px;
  color: var(--cyan);
  background: rgba(77,227,255,0.10);
  font-size: 12px;
  text-decoration: none;
}

.part-score-badge {
  border-color: rgba(255,255,255,0.12);
  color: var(--muted);
  background: rgba(255,255,255,0.06);
}

.part-score-children {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.part-score-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.sync-readout {
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255,255,255,0.052);
  font-size: 12px;
}

.sync-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.part-split-panel button,
.sync-editor-panel button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(77,227,255,0.10);
  padding: 10px 12px;
  cursor: pointer;
}

.selected-note-info {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(77,227,255,0.18);
  border-radius: 8px;
  background: rgba(77,227,255,0.08);
}

.selected-note-info b,
.selected-note-info span {
  display: block;
}

.selected-note-info span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.note-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.note-editor-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255,255,255,0.08);
  padding: 9px 10px;
  cursor: pointer;
}

.note-editor-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.note-list {
  display: grid;
  gap: 8px;
  max-height: 310px;
  overflow: auto;
  padding-right: 4px;
}

.note-list button,
.note-list div {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255,255,255,0.052);
  padding: 9px 10px;
}

.note-list button {
  cursor: pointer;
}

.note-list button.active {
  border-color: rgba(184,255,106,0.62);
  background: rgba(184,255,106,0.10);
}

.note-list b,
.note-list span {
  display: block;
}

.note-list span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.reader-score-canvas.compact {
  min-height: 72vh;
  border-radius: 8px;
}

.pdf-viewer object,
.pdf-viewer iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.empty-score {
  min-height: 456px;
  display: grid;
  place-items: center;
  color: #596171;
}

.score-pages {
  display: grid;
  gap: 24px;
  justify-items: center;
}

.score-image-pages {
  display: grid;
  gap: 24px;
  justify-items: center;
}

.score-page-image {
  position: relative;
  width: min(100%, 900px);
  background: #fff;
  box-shadow: 0 18px 54px rgba(0,0,0,0.38);
  cursor: pointer;
  overflow: hidden;
}

.score-page-image img {
  display: block;
  width: 100%;
  height: auto;
}

.score-playhead {
  position: absolute;
  left: 12%;
  right: 8%;
  top: 8%;
  height: 46px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(77,227,255,0.04), rgba(77,227,255,0.18), rgba(184,255,106,0.10));
  border-top: 2px solid rgba(77,227,255,0.82);
  border-bottom: 1px solid rgba(184,255,106,0.42);
  box-shadow: 0 0 24px rgba(77,227,255,0.28);
  opacity: 0;
  pointer-events: none;
  transition: top 0.2s linear, opacity 0.18s ease;
}

.score-playhead.active {
  opacity: 1;
}

body.is-playing .score-playhead.active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
  animation: scanSweep 1.3s ease-in-out infinite;
}

.measure-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.measure-hotspot {
  position: absolute;
  display: block;
  border: 0;
  border-radius: 2px;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
}

.measure-hotspot::after {
  content: "";
  position: absolute;
  inset: -4px -2px;
  border-radius: 2px;
  background: rgba(241, 82, 105, 0);
  border: 1px solid rgba(212, 52, 82, 0);
  transition: background 0.14s linear, border-color 0.14s linear;
}

.measure-hotspot:hover::after {
  background: rgba(241, 82, 105, 0.10);
  border-color: rgba(212, 52, 82, 0.20);
}

.measure-hotspot.active::after {
  background: rgba(241, 82, 105, 0.24);
  border-color: rgba(212, 52, 82, 0.38);
}

.score-page {
  width: min(100%, 760px);
  min-height: 980px;
  padding: 38px 42px;
  background: #fff;
  color: #10141c;
  border-radius: 4px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.28);
  font-family: Georgia, "Times New Roman", serif;
}

.score-page header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  margin-bottom: 28px;
  border-bottom: 1px solid #d8dce3;
  color: #1a1d25;
}

.score-page header b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-page header span {
  color: #657085;
}

.score-systems {
  display: grid;
  gap: 54px;
}

.score-system {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
}

.clef {
  font-size: 34px;
  line-height: 1;
  color: #10141c;
}

.staff-lines {
  position: relative;
  height: 120px;
  border-left: 1px solid #111722;
  border-right: 1px solid #111722;
}

.staff-lines > span {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: #111722;
}

.staff-lines > span:nth-child(1) { top: 22%; }
.staff-lines > span:nth-child(2) { top: 34%; }
.staff-lines > span:nth-child(3) { top: 46%; }
.staff-lines > span:nth-child(4) { top: 58%; }
.staff-lines > span:nth-child(5) { top: 70%; }

.score-note {
  position: absolute;
  width: 22px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: #121620;
  color: transparent;
  font-size: 0;
  line-height: 16px;
  padding: 0;
  transform: translate(-50%, -50%) rotate(-16deg);
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
}

.score-note span {
  position: absolute;
  left: 50%;
  top: -14px;
  transform: translateX(-50%) rotate(16deg);
  color: #2b3240;
  font: 10px ui-sans-serif, system-ui, sans-serif;
  line-height: 1;
}

.score-note::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 54px;
  background: #121620;
  transform: rotate(16deg);
}

.score-note.stem-up::after {
  left: 18px;
  bottom: 8px;
}

.score-note.stem-down::after {
  right: 18px;
  top: 8px;
}

.score-note.active {
  background: var(--rose);
  box-shadow: 0 0 0 5px rgba(255,95,143,0.16);
  z-index: 3;
}

.score-note.active::after {
  background: var(--rose);
}

.measure-bar {
  position: absolute;
  top: 22%;
  bottom: 30%;
  width: 1px;
  background: #111722;
}

.measure-bar.strong {
  bottom: 22%;
  background: #0d1118;
  opacity: 0.9;
}

.beat-mark {
  position: absolute;
  top: 22%;
  bottom: 30%;
  width: 1px;
  background: rgba(17, 23, 34, 0.18);
}

.system-cursor {
  position: absolute;
  top: 18%;
  bottom: 24%;
  width: 3px;
  border-radius: 999px;
  background: rgba(255, 95, 143, 0.95);
  box-shadow: 0 0 0 4px rgba(255,95,143,0.13);
  opacity: 0;
  pointer-events: none;
  transition: left 0.12s linear, opacity 0.12s ease;
  z-index: 4;
}

.timed-system.active .system-cursor {
  opacity: 1;
}

#scoreHint {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.lyrics-list {
  display: grid;
  gap: 8px;
  max-height: 442px;
  overflow: auto;
  padding: 12px;
}

.lyrics-list button,
.lyrics-list div {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255,255,255,0.055);
}

.lyrics-list button {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  cursor: pointer;
}

.lyrics-list button.active {
  border-color: rgba(77,227,255,0.56);
  background: rgba(77,227,255,0.12);
}

.lyrics-list b {
  display: inline-block;
  min-width: 48px;
  color: var(--cyan);
  font-size: 12px;
}

.lyrics-list span {
  color: var(--text);
  line-height: 1.45;
}

.lyrics-list i {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  min-height: 26px;
  border: 1px solid rgba(77,227,255,0.26);
  border-radius: 7px;
  color: var(--cyan);
  background: rgba(77,227,255,0.10);
  font-size: 12px;
  font-style: normal;
}

.lyrics-list i:hover {
  border-color: rgba(184,255,106,0.62);
  color: #eaffbf;
  background: rgba(184,255,106,0.12);
}

.lyrics-source {
  color: var(--muted);
  font-size: 12px;
}

.lyrics-missing {
  display: grid;
  gap: 10px;
}

.lyrics-missing b,
.lyrics-missing span {
  display: block;
}

.lyrics-missing span {
  color: var(--muted);
  line-height: 1.45;
}

.lyrics-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.lyrics-tools button,
.lyrics-editor button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255,255,255,0.08);
  padding: 9px 10px;
  cursor: pointer;
}

.lyrics-editor {
  display: grid;
  gap: 8px;
}

.lyrics-editor textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  background: rgba(8, 11, 18, 0.72);
  outline: none;
}

.report-mirror {
  min-height: 420px;
  max-height: calc(100vh - 190px);
  overflow: auto;
  white-space: pre-wrap;
  color: var(--muted);
  border-radius: 8px;
  background: rgba(255,255,255,0.055);
  padding: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.facts div, .metrics div {
  padding: 14px;
  border-radius: 8px;
  background: rgba(255,255,255,0.055);
}

.facts b, .metrics strong {
  display: block;
  font-size: 18px;
}

.facts span, .metrics span {
  color: var(--muted);
  font-size: 12px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.quality {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.quality label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.quality div {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.quality span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--amber), var(--lime));
}

.mode-card {
  margin-top: 18px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,209,102,0.28);
  background: rgba(255,209,102,0.08);
}

.process-card {
  border-color: rgba(77,227,255,0.28);
  background: rgba(77,227,255,0.08);
}

.mode-card b,
.mode-card span {
  display: block;
}

.mode-card span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.downloads h3 {
  font-size: 14px;
  margin: 22px 0 10px;
}

#downloads {
  display: grid;
  gap: 8px;
}

#downloads a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
}

#downloads small { color: var(--muted); }

.pitch-curve-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(22, 217, 255, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(22, 217, 255, 0.10), rgba(124, 255, 107, 0.05)),
    #0a0f17;
  box-shadow: 0 18px 52px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.08);
  overflow: hidden;
}

.pitch-curve-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 12px;
}

.pitch-curve-head b,
.pitch-curve-head span {
  display: block;
}

.pitch-curve-head b {
  font-size: 15px;
}

.pitch-curve-head span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.pitch-curve-head strong {
  color: #071014;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  border-radius: 6px;
  padding: 7px 10px;
  min-width: 86px;
  text-align: center;
  box-shadow: 0 0 24px rgba(22,217,255,0.28);
}

.pitch-curve-stage {
  position: relative;
  height: 260px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.015)),
    radial-gradient(circle at 18% 20%, rgba(22,217,255,0.18), transparent 34%),
    radial-gradient(circle at 82% 30%, rgba(255,207,74,0.15), transparent 34%),
    #071014;
  overflow: hidden;
}

.pitch-curve-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  pointer-events: none;
}

#pitchCurveSvg {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
}

#pitchCurveGrid line {
  stroke: rgba(255,255,255,0.10);
  stroke-width: 1;
}

#pitchCurveGrid text {
  fill: rgba(216,220,230,0.68);
  font-size: 11px;
}

#pitchCurveArea {
  fill: rgba(22, 217, 255, 0.12);
}

#pitchCurveLine {
  fill: none;
  stroke: url(#pitchCurveGradient);
  stroke-width: 4;
  filter: url(#pitchCurveGlow);
}

#pitchCurveNotes circle {
  fill: rgba(255,255,255,0.45);
}

#pitchCurveCursor {
  stroke: rgba(255,255,255,0.78);
  stroke-width: 2;
  stroke-dasharray: 8 8;
}

#pitchCurveDot {
  fill: #fff;
  stroke: var(--cyan);
  stroke-width: 4;
  filter: url(#pitchCurveGlow);
}

@media (max-width: 1180px) {
  .landing-nav {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
  .landing-nav nav {
    display: none;
  }
  .workflow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .output-layout {
    grid-template-columns: 1fr;
  }
  .card-b {
    right: 14vw;
  }
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .generate-workspace { grid-template-columns: 1fr; }
  .library-page-grid { grid-template-columns: 1fr; }
  .auth-grid,
  .admin-grid { grid-template-columns: 1fr; }
  .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-shell,
  .admin-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-side { min-height: 100vh; border-right: 0; }
  .admin-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .score-reader { grid-template-columns: 1fr; }
  .reader-layout,
  .editor-grid { grid-template-columns: 1fr; }
  .reader-toolbar { grid-template-columns: 1fr; }
  .reader-actions { justify-content: stretch; }
  .reader-actions button { flex: 1; }
  .lyrics-column { min-height: 260px; }
  .score-canvas { max-height: 70vh; }
  .library-list { max-height: 320px; }
  .engine-grid { grid-template-columns: 1fr 1fr; }
  .plan-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .landing-nav {
    gap: 10px;
    padding: 12px;
  }
  .landing-brand span {
    width: 34px;
    height: 34px;
  }
  .landing-brand strong {
    font-size: 15px;
  }
  .landing-login {
    min-height: 38px;
    padding: 0 12px;
    font-size: 13px;
  }
  .language-switcher {
    min-height: 38px;
    grid-template-columns: auto;
    gap: 4px;
    padding: 7px 8px;
  }
  .language-switcher label {
    display: none;
  }
  .language-switcher select {
    width: 112px;
    font-size: 12px;
  }
  .landing-nav .language-switcher {
    order: 2;
  }
  .landing-login {
    order: 3;
  }
  .top-actions .language-switcher {
    width: 100%;
    grid-column: 1 / -1;
  }
  .top-actions .language-switcher select {
    width: 100%;
  }
  .admin-title .language-switcher {
    justify-self: stretch;
  }
  .admin-title .language-switcher select {
    width: 100%;
  }
  .landing-hero {
    min-height: 92vh;
    padding: 92px 18px 38px;
  }
  .landing-hero h1 {
    max-width: 9ch;
  }
  .landing-lead {
    font-size: 16px;
    line-height: 1.65;
  }
  .landing-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .landing-primary,
  .landing-secondary {
    width: 100%;
  }
  .landing-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-output-card,
  .hero-note {
    display: none;
  }
  .hero-wave {
    right: 18px;
    bottom: 10%;
    opacity: 0.42;
  }
  .score-staff {
    left: 18px;
    right: 18px;
    top: 18%;
  }
  .landing-section,
  .landing-cta {
    width: min(100%, calc(100vw - 24px));
    padding: 46px 0;
  }
  .workflow-grid,
  .scene-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .workflow-grid article,
  .scene-grid article {
    min-height: auto;
  }
  .output-preview {
    min-height: 360px;
  }
  .output-list article {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .landing-cta {
    grid-template-columns: 1fr;
    padding: 22px;
  }
  main { padding: 16px; }
  .auth-page { padding: 22px; }
  body.auth-required .auth-page { padding: 0; }
  .auth-side { padding: 22px; }
  .auth-brand { align-items: flex-start; }
  .auth-brand strong { font-size: 22px; }
  .topbar { align-items: stretch; flex-direction: column; gap: 12px; }
  .top-actions { justify-content: stretch; }
  .top-actions button { flex: 1; }
  .topbar h1 { font-size: 24px; }
  .hero-panel { display: grid; gap: 20px; }
  .hero-copy { max-width: none; }
  .hero-copy h2 { font-size: 24px; }
  .hero-actions { justify-content: stretch; }
  .hero-actions button { width: 100%; }
  .task-ops { grid-template-columns: 1fr 1fr; }
  .auth-code-row,
  .invite-create,
  .admin-row,
  .quota-summary { grid-template-columns: 1fr; }
  .admin-metrics { grid-template-columns: 1fr; }
  .plan-list {
    grid-template-columns: 1fr;
  }
  .plan-price {
    text-align: left;
  }
  .admin-actions { justify-content: stretch; }
  .admin-actions button { flex: 1; }
  .score-canvas { padding: 12px; }
  .score-page { min-height: 760px; padding: 28px 22px; }
  .score-systems { gap: 36px; }
  .score-system { grid-template-columns: 28px 1fr; }
  .steps { grid-template-columns: 1fr 1fr 1fr; }
  .engine-grid { grid-template-columns: 1fr; }
  .legal-page {
    width: min(100%, calc(100vw - 24px));
    margin: 12px auto;
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .legal-toc {
    position: static;
  }
  .legal-document {
    padding: 18px;
  }
  .legal-page h1 {
    font-size: 28px;
  }
  .agreement-dialog {
    width: calc(100vw - 24px);
    max-height: 88vh;
  }
  .agreement-content {
    padding: 16px;
  }
}

/* ========================================================
   Dark-Tech Landing Page Enhancements
   ======================================================== */

/* ---- global section label ---- */
.section-kicker {
  display: inline-block;
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border: 1px solid rgba(77,227,255,0.22);
  border-radius: 999px;
  background: rgba(77,227,255,0.08);
}

/* ---- hero glow & float ---- */
.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.28;
  pointer-events: none;
}
.glow-1 {
  width: 500px; height: 500px;
  top: -80px; right: -120px;
  background: radial-gradient(circle, rgba(77,227,255,0.5), transparent);
}
.glow-2 {
  width: 400px; height: 400px;
  bottom: 10%; left: -100px;
  background: radial-gradient(circle, rgba(184,255,106,0.4), transparent);
}

@keyframes floatNote {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33%  { transform: translateY(-14px) rotate(3deg); }
  66%  { transform: translateY(-6px) rotate(-2deg); }
}
.hero-note {
  animation: floatNote 6s ease-in-out infinite;
}
.note-a { animation-delay: 0s; }
.note-b { animation-delay: -2s; }
.note-c {
  position: absolute;
  left: 8%;
  bottom: 18%;
  color: rgba(255,95,143,0.55);
  font-size: clamp(36px, 6vw, 80px);
  animation: floatNote 7s ease-in-out infinite;
  animation-delay: -4s;
}

.hero-output-card {
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.16);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.hero-output-card:hover {
  transform: translateY(-4px);
  border-color: rgba(77,227,255,0.4);
  box-shadow: 0 0 40px rgba(77,227,255,0.12);
}

/* ---- workflow track ---- */
.workflow-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  position: relative;
}
.workflow-track::before {
  content: "";
  position: absolute;
  top: 52px;
  left: 12.5%;
  right: 12.5%;
  height: 2px;
  background: linear-gradient(90deg,
    rgba(77,227,255,0.0),
    rgba(77,227,255,0.4) 20%,
    rgba(184,255,106,0.4) 50%,
    rgba(184,255,106,0.0) 100%
  );
  z-index: 0;
}
.workflow-track article {
  position: relative;
  z-index: 1;
  min-height: 260px;
  padding: 24px 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.025);
  transition: transform .28s ease, border-color .28s ease, box-shadow .28s ease, background .28s ease;
}
.workflow-track article:first-child { border-radius: 8px 0 0 8px; }
.workflow-track article:last-child  { border-radius: 0 8px 8px 0; }
.workflow-track article:hover {
  transform: translateY(-6px);
  border-color: rgba(77,227,255,0.35);
  background: rgba(12,20,32,0.70);
  box-shadow: 0 16px 48px rgba(0,0,0,0.32), 0 0 30px rgba(77,227,255,0.08);
}

.wf-icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  margin: 0 auto 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(77,227,255,0.18), rgba(184,255,106,0.10));
  border: 1px solid rgba(77,227,255,0.20);
  font-size: 24px;
  position: relative;
  z-index: 2;
}
.wf-num {
  text-align: center;
  font-size: 42px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 10px;
}
.workflow-track h3 {
  margin: 0 0 8px;
  font-size: 18px;
  text-align: center;
}
.workflow-track p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

/* ---- output grid ---- */
.output-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
.output-grid article {
  position: relative;
  min-height: 200px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 22px 18px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  transition: transform .26s ease, border-color .26s ease, background .26s ease, box-shadow .26s ease;
}
.output-grid article:hover {
  transform: translateY(-5px);
  border-color: rgba(77,227,255,0.35);
  background: rgba(15,25,38,0.72);
  box-shadow: 0 14px 40px rgba(0,0,0,0.28);
}
.out-icon {
  font-size: 32px;
  margin-bottom: 4px;
}
.output-grid h3 {
  margin: 0;
  font-size: 17px;
  color: var(--text);
}
.output-grid span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.output-grid em {
  display: inline-block;
  width: fit-content;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(77,227,255,0.12);
  border: 1px solid rgba(77,227,255,0.18);
}

/* ---- pricing enhancements ---- */
.pricing-label {
  margin: 28px 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: rgba(238,243,255,0.55);
  letter-spacing: 0.04em;
}
.pricing-label:first-of-type { margin-top: 0; }

.plan-badge {
  display: inline-block;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: var(--cyan);
  background: rgba(77,227,255,0.12);
  border: 1px solid rgba(77,227,255,0.22);
}
.plan-badge.plan-hot {
  color: #051018;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  border-color: transparent;
}

.price-line span {
  color: var(--muted);
  font-size: 14px;
}

.plan-features {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.plan-features li {
  padding-left: 18px;
  color: rgba(238,243,255,0.72);
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}
.plan-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--lime);
  font-weight: 800;
}

.pricing-grid article.featured-price {
  border-color: rgba(77,227,255,0.40);
  background: linear-gradient(180deg, rgba(77,227,255,0.12), rgba(184,255,106,0.06));
  box-shadow: 0 0 40px rgba(77,227,255,0.10), inset 0 1px 0 rgba(255,255,255,0.06);
}
.pricing-grid article.featured-price:hover {
  box-shadow: 0 0 60px rgba(77,227,255,0.20), inset 0 1px 0 rgba(255,255,255,0.08);
}

/* ---- scene cards ---- */
.scene-icon {
  font-size: 40px;
  margin-bottom: 8px;
}
.scene-grid article {
  min-height: 220px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  transition: transform .26s ease, border-color .26s ease, box-shadow .26s ease;
}
.scene-grid article:hover {
  transform: translateY(-5px);
  border-color: rgba(184,255,106,0.30);
  box-shadow: 0 12px 36px rgba(0,0,0,0.26);
}
.scene-grid h3 {
  margin: 10px 0 8px;
  font-size: 22px;
}

/* ---- footer ---- */
.landing-footer {
  margin-top: 60px;
  padding: 56px clamp(20px, 6vw, 88px) 32px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(4,6,10,0.92);
}
.footer-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
}
.footer-col h4 {
  margin: 0 0 14px;
  font-size: 15px;
  color: var(--text);
}
.footer-col a,
.footer-col span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  line-height: 1.6;
}
.footer-col a:hover {
  color: var(--cyan);
}
.footer-bottom {
  width: min(1180px, 100%);
  margin: 32px auto 0;
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,0.06);
  color: rgba(238,243,255,0.35);
  font-size: 13px;
}

/* ---- CTA section ---- */
.landing-cta {
  margin-bottom: 0;
  padding: 40px;
  border: 1px solid rgba(77,227,255,0.22);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(77,227,255,0.10), rgba(184,255,106,0.06));
  box-shadow: 0 0 60px rgba(77,227,255,0.05);
}

/* ---- responsive ---- */
@media (max-width: 1024px) {
  .output-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .workflow-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .workflow-track::before { display: none; }
  .workflow-track article:first-child { border-radius: 8px 0 0 0; }
  .workflow-track article:nth-child(2) { border-radius: 0 8px 0 0; }
  .workflow-track article:nth-child(3) { border-radius: 0 0 0 8px; }
  .workflow-track article:last-child  { border-radius: 0 0 8px 0; }
}

@media (max-width: 768px) {
  .workflow-track,
  .output-grid,
  .pricing-grid,
  .scene-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .workflow-track article,
  .workflow-track article:first-child,
  .workflow-track article:last-child,
  .workflow-track article:nth-child(2),
  .workflow-track article:nth-child(3) {
    border-radius: 8px;
  }
  .output-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .landing-hero { min-height: auto; padding: 120px 20px 48px; }
  .landing-stats { grid-template-columns: repeat(2, 1fr); }
  .landing-cta { grid-template-columns: 1fr; text-align: center; }
}

/* ========================================================
   Internal App UI Enhancements
   ======================================================== */

/* ---- drop zone ---- */
.drop-zone {
  min-height: 180px;
  border: 2px dashed rgba(255,255,255,0.18);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.drop-zone.dragging,
.drop-zone:hover {
  border-color: rgba(77,227,255,0.45);
  background: rgba(77,227,255,0.06);
  box-shadow: 0 0 32px rgba(77,227,255,0.08), inset 0 0 40px rgba(77,227,255,0.03);
}

/* ---- progress bar ---- */
.progress-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  box-shadow: 0 0 10px rgba(77,227,255,0.3);
  transition: width 0.5s ease;
}

/* ---- form inputs ---- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
textarea,
select {
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  background: rgba(255,255,255,0.05);
  font-size: var(--text-base);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
}
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(77,227,255,0.5);
  box-shadow: 0 0 0 3px rgba(77,227,255,0.10), 0 0 18px rgba(77,227,255,0.06);
  background: rgba(255,255,255,0.08);
}

/* ---- buttons ---- */
.btn, button {
  border-radius: var(--radius);
  transition: all var(--transition);
}
.btn-primary,
button.primary {
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  color: #051018;
  font-weight: 700;
  border: 0;
  box-shadow: 0 4px 16px rgba(77,227,255,0.18);
}
.btn-primary:hover,
button.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(77,227,255,0.28);
}

/* ---- range sliders ---- */
input[type="range"] {
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.12);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(77,227,255,0.35);
  cursor: pointer;
  transition: transform var(--transition);
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* ---- library list items ---- */
.library-list .list-item {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}
.library-list .list-item:hover {
  background: rgba(77,227,255,0.05);
  border-color: rgba(77,227,255,0.15);
}

/* ---- reader toolbar ---- */
.reader-toolbar {
  background: rgba(12,18,28,0.90);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.reader-toolbar button {
  transition: color var(--transition), background var(--transition);
}
.reader-toolbar button:hover {
  color: var(--cyan);
  background: rgba(77,227,255,0.08);
}

/* ---- editor panels ---- */
.editor-controls details {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  margin-bottom: var(--space-sm);
  overflow: hidden;
  transition: border-color var(--transition);
}
.editor-controls details[open] {
  border-color: rgba(77,227,255,0.25);
}
.editor-controls summary {
  padding: 12px 14px;
  cursor: pointer;
  background: rgba(255,255,255,0.03);
  transition: background var(--transition);
}
.editor-controls summary:hover {
  background: rgba(77,227,255,0.06);
}

/* ---- auth forms ---- */
.auth-panel input:focus {
  border-color: rgba(77,227,255,0.55);
  box-shadow: 0 0 20px rgba(77,227,255,0.12);
}
.auth-panel .plan-card {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: var(--space);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.auth-panel .plan-card:hover {
  border-color: rgba(77,227,255,0.30);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* ---- admin dashboard ---- */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: var(--space-lg);
}
.admin-stat-card {
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
}
.admin-stat-card .stat-value {
  font-size: 32px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.admin-stat-card .stat-label {
  margin-top: 6px;
  color: var(--muted);
  font-size: var(--text-sm);
}

/* ---- scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ---- panel consistency ---- */
.panel {
  border-radius: var(--radius);
  padding: 20px;
}

/* ---- task status badges ---- */
.task-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
}
.task-status.queued  { color: var(--amber); background: rgba(255,209,102,0.12); }
.task-status.running { color: var(--cyan);  background: rgba(77,227,255,0.12); }
.task-status.done    { color: var(--lime);  background: rgba(184,255,106,0.12); }
.task-status.error   { color: var(--rose);  background: rgba(255,95,143,0.12); }

/* ---- responsive admin ---- */
@media (max-width: 1024px) {
  .admin-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .admin-stats-grid { grid-template-columns: 1fr; }
}

/* ---- admin header + user list ---- */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}
.admin-header h2 { margin: 0; }
.admin-user-list {
  display: grid;
  gap: 8px;
  max-height: 480px;
  overflow: auto;
}
.admin-user-list .user-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  transition: background var(--transition);
}
.admin-user-list .user-row:hover {
  background: rgba(77,227,255,0.04);
}

/* ========================================================
   Landing Page: Animations + Typography + Mobile
   ======================================================== */

/* ---- section title decoration ---- */
.section-head h2 {
  position: relative;
  padding-bottom: 16px;
}
.section-head h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 60px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
}

/* ---- typography refinements ---- */
.landing-lead { line-height: 1.8; }
.landing-section,
.landing-cta {
  padding: 88px 0;
}
.workflow-track p { font-size: 14px; }

/* ---- hero breathe animation ---- */
@keyframes breathe {
  0%, 100% { opacity: 0.28; transform: scale(1); }
  50%      { opacity: 0.42; transform: scale(1.12); }
}
.hero-glow {
  animation: breathe 5s ease-in-out infinite;
}
.glow-1 { animation-delay: 0s; }
.glow-2 { animation-delay: -2.5s; }

/* ---- scroll fade-up ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.landing-section {
  animation: fadeUp 0.7s ease-out both;
  animation-timeline: view();
  animation-range: entry 0% entry 90%;
}

/* ---- plan badge pulse on card hover ---- */
.pricing-grid article:hover .plan-badge {
  animation: badgePulse 0.6s ease;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(77,227,255,0); }
  50%      { box-shadow: 0 0 0 6px rgba(77,227,255,0.12); }
}

/* ---- mobile nav: < 768px ---- */
@media (max-width: 768px) {
  .landing-nav {
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 12px 18px;
  }
  .landing-nav nav {
    display: none;
  }
  .landing-hero {
    min-height: auto;
    padding: 100px 20px 40px;
  }
  .landing-hero h1 {
    font-size: 36px;
  }
  .landing-lead {
    font-size: 16px;
  }
  .landing-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .landing-section,
  .landing-cta {
    padding: 48px 0;
    width: calc(100vw - 32px);
  }
  .workflow-track {
    grid-template-columns: 1fr;
  }
  .workflow-track::before {
    display: none;
  }
  .workflow-track article {
    border-radius: 8px;
    min-height: auto;
  }
  .output-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .scene-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .landing-footer {
    padding: 40px 18px 24px;
  }
  .landing-cta {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-output-card { display: none; }
  .hero-glow { display: none; }
}

/* ---- mobile: < 480px ---- */
@media (max-width: 480px) {
  .landing-hero h1 { font-size: 28px; }
  .landing-stats { grid-template-columns: 1fr; }
  .output-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---- payment modal ---- */
.payment-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
}
.payment-modal[hidden] { display: none; }
.payment-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
}
.payment-dialog {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  max-height: 88vh;
  overflow-y: auto;
  padding: 32px;
  border: 1px solid rgba(77,227,255,0.25);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(20,28,42,0.96), rgba(12,16,26,0.98));
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 40px rgba(77,227,255,0.08);
}
.payment-dialog h2 {
  margin: 0 0 12px;
  font-size: var(--text-xl);
}
.payment-dialog p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.6;
}
.payment-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.payment-plan-grid .plan-card {
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  text-align: center;
}
.payment-plan-grid .plan-card:hover,
.payment-plan-grid .plan-card.selected {
  border-color: rgba(77,227,255,0.45);
  background: rgba(77,227,255,0.08);
}
.payment-plan-grid .plan-name { font-weight: 700; font-size: var(--text-sm); }
.payment-plan-grid .plan-price { margin-top: 6px; color: var(--lime); font-size: 20px; font-weight: 900; }
.payment-plan-grid .plan-desc { margin-top: 4px; color: var(--muted); font-size: var(--text-xs); }
.payment-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
