:root {
  --bg: #06090f;
  --bg-elev: #0b101b;
  --surface: rgba(13, 19, 30, 0.88);
  --surface-solid: #0d131e;
  --surface-well: #070b13;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-gold: rgba(212, 184, 120, 0.34);
  --border-cyan: rgba(112, 197, 212, 0.34);
  --gold: #d4b878;
  --gold-l: #f0d79a;
  --cyan: #70c5d4;
  --cyan-l: #a5e8f2;
  --emerald: #5eead4;
  --text: #eef2f7;
  --text-soft: #cbd5e1;
  --muted: #94a3b8;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input, textarea, select { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold-l);
  outline-offset: 2px;
}

.hidden { display: none !important; }
.native-hidden { display: none !important; }

/* Ambient Obsidian Backdrop */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(640px 420px at 14% 6%, rgba(212, 184, 120, 0.09), transparent 70%),
    radial-gradient(560px 380px at 88% 12%, rgba(112, 197, 212, 0.07), transparent 72%),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 44px 44px, 44px 44px;
}

/* Sidebar */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 262px;
  padding: 22px 18px 18px;
  background: rgba(8, 12, 20, 0.94);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 184, 120, 0.28);
  flex-shrink: 0;
}
.brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f8fafc;
}
.edition {
  margin-left: auto;
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.12em;
  padding: 5px 7px;
  border-radius: 6px;
  color: var(--cyan-l);
  background: rgba(112, 197, 212, 0.12);
  border: 1px solid rgba(112, 197, 212, 0.28);
}

.nav-label {
  font: 700 10.5px/1 var(--mono);
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 4px 10px 10px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  border: 1px solid transparent;
  background: transparent;
  padding: 10px 12px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.nav-ico {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--muted);
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}
.nav-item:hover .nav-ico { color: var(--gold-l); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(212, 184, 120, 0.16), rgba(112, 197, 212, 0.08));
  border-color: var(--border-gold);
  color: #fff;
}
.nav-item.active .nav-ico { color: var(--gold-l); }
.nav-count {
  margin-left: auto;
  font: 700 10.5px/1 var(--mono);
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
}
.nav-item.active .nav-count {
  background: rgba(212, 184, 120, 0.18);
  color: var(--gold-l);
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 14px;
}

.vault-card {
  padding: 15px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(212, 184, 120, 0.11), rgba(11, 16, 27, 0.94));
  border: 1px solid var(--border-gold);
}
.balance-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 700 10.5px/1 var(--mono);
  letter-spacing: 0.12em;
  color: var(--gold-l);
}
.vault-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.8);
}
.sidebar-balance {
  font-family: var(--font);
  font-size: 27px;
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: #fff;
  margin-top: 7px;
}
.vault-card small {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}
.balance-link {
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid rgba(212, 184, 120, 0.4);
  background: rgba(212, 184, 120, 0.14);
  color: var(--gold-l);
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s, border-color 0.2s;
}
.balance-link:hover {
  background: rgba(212, 184, 120, 0.22);
  border-color: var(--gold-l);
}

.sidebar-links {
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.back-home {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  padding: 4px 2px;
  transition: color 0.2s;
}
.back-home:hover { color: var(--cyan-l); }

/* App Shell */
.app {
  position: relative;
  z-index: 1;
  margin-left: 262px;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
weize-eco {
  display: block;
  position: relative;
  z-index: 1;
  margin-left: 262px;
}

.topbar {
  height: 54px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(6, 9, 15, 0.78);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 15;
}
.crumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  min-width: 0;
}
.crumb > span { color: var(--muted); }
.crumb i { font-style: normal; color: rgba(255, 255, 255, 0.22); }
.crumb strong { font-weight: 700; color: #f8fafc; white-space: nowrap; }

.top-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.mobile-balance-chip {
  display: none;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-gold);
  background: rgba(212, 184, 120, 0.1);
  color: var(--text-soft);
  font-size: 12px;
  white-space: nowrap;
}
.mobile-balance-chip strong {
  font-family: var(--font);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
}
.chip-plus {
  font-weight: 700;
  color: var(--gold-l);
}
.audio-account-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--cyan-l);
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid rgba(112, 197, 212, 0.24);
  background: rgba(112, 197, 212, 0.08);
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s;
}
.audio-account-link:hover {
  border-color: var(--cyan-l);
  background: rgba(112, 197, 212, 0.16);
}
.preview-label {
  font: 700 10.5px/1 var(--mono);
  letter-spacing: 0.12em;
  color: var(--gold);
  padding: 6px 9px;
  border-radius: 6px;
  background: rgba(212, 184, 120, 0.08);
  border: 1px solid rgba(212, 184, 120, 0.22);
  white-space: nowrap;
}

main {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 28px 30px;
  flex: 1;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 700 10.5px/1 var(--mono);
  letter-spacing: 0.14em;
  color: var(--gold);
  margin: 0 0 6px;
}
.eyebrow-line {
  width: 16px;
  height: 1.5px;
  background: var(--gold);
}
h1 {
  font-size: clamp(23px, 2.7vw, 29px);
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f8fafc;
  margin: 0 0 4px;
}
.lede {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}
.format-badge {
  flex-shrink: 0;
  font: 600 11.5px/1 var(--mono);
  color: var(--cyan-l);
  background: rgba(112, 197, 212, 0.08);
  border: 1px solid var(--border-cyan);
  border-radius: 999px;
  padding: 8px 13px;
  white-space: nowrap;
}

/* Main Studio 2-Column Workspace */
.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(300px, 352px);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.85);
  overflow: visible;
}

.composer {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.composer-toolbar {
  min-height: 48px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.toolbar-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.toolbar-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--gold-l);
  background: rgba(212, 184, 120, 0.12);
  border: 1px solid rgba(212, 184, 120, 0.26);
}
.composer-toolbar strong {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
}

.sample-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.sample-btn {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.sample-btn:hover {
  border-color: var(--border-cyan);
  background: rgba(112, 197, 212, 0.1);
  color: #fff;
}
.sample-clear:hover {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.1);
}

.writing-area {
  padding: 14px 18px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.writing-area textarea {
  width: 100%;
  flex: 1;
  min-height: 210px;
  padding: 15px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-well);
  color: #f8fafc;
  font-size: 15px;
  line-height: 1.7;
  resize: none;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.writing-area textarea::placeholder {
  color: #7c8ca1;
}
.writing-area textarea:focus {
  border-color: rgba(212, 184, 120, 0.55);
  box-shadow: 0 0 0 3px rgba(212, 184, 120, 0.12);
}

.editor-bottom {
  padding: 4px 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
.char-meter-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 11.5px/1 var(--mono);
  color: var(--text-soft);
  white-space: nowrap;
}
.char-track {
  width: 84px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
#char-progress {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--gold-l));
  transition: width 0.18s ease;
}

.generation-bar {
  border-top: 1px solid var(--border);
  padding: 13px 18px;
  background: rgba(7, 11, 19, 0.72);
  border-bottom-left-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.cost-readout small {
  display: block;
  font: 600 10.5px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.cost-readout strong {
  font-family: var(--font);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--gold-l);
}

.primary {
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid rgba(240, 215, 154, 0.6);
  background: linear-gradient(180deg, #eed69c, #d4b878 58%, #b3924a);
  color: #141007;
  font-size: 13.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 24px -12px rgba(212, 184, 120, 0.75);
  transition: transform 0.18s var(--ease), filter 0.18s;
}
.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#status:empty { display: none; }
#status {
  margin: 0 18px 14px;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid rgba(112, 197, 212, 0.28);
  background: rgba(112, 197, 212, 0.09);
  color: var(--cyan-l);
  font-size: 12.5px;
  line-height: 1.5;
}
#status.is-error {
  border-color: rgba(248, 113, 113, 0.36);
  background: rgba(248, 113, 113, 0.1);
  color: #fecaca;
}
.auth-cta {
  margin: -4px 18px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Settings Console (Right Column) */
.settings {
  padding: 16px 20px;
  background: rgba(8, 13, 22, 0.74);
  border-left: 1px solid var(--border);
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
  display: flex;
  flex-direction: column;
}
.settings-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.settings-title h2 {
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}
.settings-icon {
  color: var(--cyan);
  display: grid;
  place-items: center;
}

.field-group { margin-bottom: 12px; }
label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 6px;
}

select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-well);
  color: var(--text);
  font-size: 13px;
}

/* Custom Accessible Picker */
.audio-picker { position: relative; min-width: 0; }
.picker-trigger {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-well);
  color: #f1f5f9;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.picker-trigger:hover { border-color: rgba(212, 184, 120, 0.45); }
.picker-trigger[aria-expanded="true"] {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 184, 120, 0.14);
}
.picker-label-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.picker-chevron {
  flex-shrink: 0;
  color: var(--gold-l);
  transition: transform 0.2s var(--ease);
}
.picker-trigger[aria-expanded="true"] .picker-chevron { transform: rotate(180deg); }

.picker-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  background: #0d1422;
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.72);
  max-height: 250px;
  overflow-y: auto;
}
.picker-options[hidden] { display: none; }
.picker-option {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.picker-option:hover, .picker-option:focus {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  outline: none;
}
.picker-option[aria-selected="true"] {
  background: rgba(212, 184, 120, 0.14);
  color: var(--gold-l);
  font-weight: 700;
}

/* Voice Preview Orb Card */
.voice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin: 2px 0 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(112, 197, 212, 0.09), rgba(10, 15, 25, 0.9));
  border: 1px solid var(--border-cyan);
  transition: border-color 0.25s, background 0.25s;
}
.voice-card.is-premium {
  background: linear-gradient(135deg, rgba(212, 184, 120, 0.13), rgba(10, 15, 25, 0.9));
  border-color: var(--border-gold);
}
.voice-art {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  background: rgba(112, 197, 212, 0.14);
  box-shadow: inset 0 0 14px rgba(112, 197, 212, 0.22);
}
.voice-card.is-premium .voice-art {
  background: rgba(212, 184, 120, 0.15);
  box-shadow: inset 0 0 14px rgba(212, 184, 120, 0.25);
}
.voice-dot {
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #e0f9ff, #70c5d4 58%, #1e4e5f);
}
.voice-card.is-premium .voice-dot {
  background: radial-gradient(circle at 32% 28%, #fff4d2, #d4b878 58%, #6d5420);
}
.voice-ring {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1px solid rgba(165, 232, 242, 0.45);
  transform: rotate(-28deg) scaleX(0.68);
}
.voice-ring.second { transform: rotate(38deg) scaleX(0.68); }
.voice-card.is-premium .voice-ring { border-color: rgba(240, 215, 154, 0.48); }

.voice-description {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mini-label {
  font: 700 9.5px/1 var(--mono);
  letter-spacing: 0.12em;
  color: var(--muted);
}
.voice-description strong {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
}
.voice-description > span:last-child {
  font-size: 11.5px;
  color: var(--cyan-l);
}
.voice-card.is-premium .voice-description > span:last-child { color: var(--gold-l); }

.voice-tier-badge {
  margin-left: auto;
  flex-shrink: 0;
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.08em;
  padding: 5px 8px;
  border-radius: 7px;
  color: var(--cyan-l);
  background: rgba(112, 197, 212, 0.12);
  border: 1px solid rgba(112, 197, 212, 0.3);
}
.voice-card.is-premium .voice-tier-badge {
  color: var(--gold-l);
  background: rgba(212, 184, 120, 0.14);
  border-color: rgba(212, 184, 120, 0.36);
}

.setting-divider {
  height: 1px;
  background: var(--border);
  margin: 2px 0 11px;
}
.spec-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  margin-bottom: 8px;
}
.spec-row > span { color: var(--muted); }
.spec-row strong {
  font-weight: 600;
  color: #f1f5f9;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.spec-row strong small {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}
.spec-tag {
  font: 700 9.5px/1 var(--mono);
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(112, 197, 212, 0.12);
  border: 1px solid rgba(112, 197, 212, 0.25);
  color: var(--cyan-l);
  margin-left: 5px;
}

.disclosure {
  margin-top: auto;
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  display: flex;
  gap: 8px;
  color: var(--muted);
}
.disclosure > span { font-size: 12.5px; color: var(--cyan); flex-shrink: 0; }
.disclosure p { font-size: 11px; line-height: 1.5; margin: 0; }

/* Output Audio Panel */
.output-panel {
  margin-top: 16px;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
}
.output-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}
.output-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--cyan-l);
  background: rgba(112, 197, 212, 0.1);
  border: 1px solid rgba(112, 197, 212, 0.24);
  flex-shrink: 0;
}
.output-heading h2 {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 2px;
}
.output-heading p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.output-label {
  margin-left: auto;
  font: 700 10.5px/1 var(--mono);
  letter-spacing: 0.12em;
  color: var(--muted);
}

.empty-output {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 0 4px;
  text-align: center;
}
.empty-output > span {
  font-size: 12.5px;
  color: var(--muted);
}
.empty-output strong { color: var(--gold-l); }
.waveform {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  opacity: 0.65;
}
.waveform i {
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold-l), var(--cyan));
  height: 8px;
}
.waveform i:nth-child(3n) { height: 18px; }
.waveform i:nth-child(4n) { height: 24px; }
.waveform i:nth-child(5n) { height: 12px; }
.waveform i:nth-child(7n) { height: 20px; }

.result-card {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-cyan);
  background: var(--surface-well);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.result-card audio {
  width: 100%;
  height: 42px;
  color-scheme: dark;
}
.result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.result-meta {
  font: 600 12px/1.4 var(--mono);
  color: var(--emerald);
}
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 9px;
  border: 1px solid var(--border-cyan);
  background: rgba(112, 197, 212, 0.14);
  color: var(--cyan-l);
  font-size: 12.5px;
  font-weight: 700;
  transition: background 0.2s, border-color 0.2s;
}
.download-btn:hover {
  background: rgba(112, 197, 212, 0.24);
  border-color: var(--cyan-l);
}

.studio-footer {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
}
.studio-footer > span:first-child { font: 700 11px/1 var(--mono); letter-spacing: 0.12em; }
.studio-footer b { color: var(--gold); padding: 0 4px; }

/* Secondary Panels (Library, Billing, Developer) */
.surface {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 24px;
}
.surface h2 {
  font-size: 17px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 8px;
}
.empty-muted { color: var(--muted); margin: 0; font-size: 13.5px; }

.secondary {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.secondary:hover:not(:disabled) {
  border-color: var(--border-gold);
  background: rgba(212, 184, 120, 0.12);
  color: #fff;
}

/* History List */
.history-list { display: grid; gap: 12px; }
.job-row {
  padding: 15px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-well);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.job-info { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.job-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.job-model {
  font: 700 12px/1 var(--mono);
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--cyan-l);
  background: rgba(112, 197, 212, 0.12);
  border: 1px solid rgba(112, 197, 212, 0.26);
}
.job-model.is-premium {
  color: var(--gold-l);
  background: rgba(212, 184, 120, 0.12);
  border-color: rgba(212, 184, 120, 0.28);
}
.job-status {
  font: 700 11px/1 var(--mono);
  padding: 4px 8px;
  border-radius: 999px;
}
.job-status.ok { background: rgba(74, 222, 128, 0.14); color: #86efac; }
.job-status.pending { background: rgba(251, 191, 36, 0.14); color: #fde68a; }
.job-status.fail { background: rgba(248, 113, 113, 0.14); color: #fca5a5; }
.job-meta { font-size: 12.5px; color: var(--muted); }
.job-actions { display: flex; align-items: center; gap: 8px; }

/* Billing */
.billing-layout {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  align-items: start;
}
.billing-balance-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-gold);
  background: rgba(212, 184, 120, 0.08);
  margin-bottom: 18px;
}
.billing-balance-banner span { font-size: 13px; color: var(--text-soft); font-weight: 600; }
.billing-balance-banner strong {
  font-family: var(--font);
  font-size: 23px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--gold-l);
}

#topups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 18px;
}
.topup-card {
  padding: 14px 15px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-well);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.2s, transform 0.18s var(--ease), background 0.2s;
}
.topup-card:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--gold);
  background: rgba(212, 184, 120, 0.1);
}
.topup-card strong {
  font-family: var(--font);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.topup-card span { font-size: 11.5px; color: var(--muted); }

.orders-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-bottom: 10px;
}
.orders-head h3 { font-size: 14px; font-weight: 700; color: #f1f5f9; margin: 0; }
.order-row {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-well);
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.order-row-actions { display: flex; align-items: center; gap: 8px; }

.billing-rules {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.billing-rules li {
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
  padding-left: 14px;
  border-left: 2px solid var(--border-gold);
}
.billing-rules strong { color: #f1f5f9; }

/* Developer API Panel */
.endpoint-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.endpoint { display: flex; align-items: center; gap: 10px; min-width: 0; }
.method-badge {
  font: 700 11px/1 var(--mono);
  padding: 6px 9px;
  border-radius: 7px;
  background: rgba(74, 222, 128, 0.14);
  border: 1px solid rgba(74, 222, 128, 0.34);
  color: #86efac;
}
.endpoint code {
  font: 600 13.5px/1.4 var(--mono);
  color: #fff;
  overflow-wrap: anywhere;
}
.code-card {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-well);
  overflow: hidden;
  margin-bottom: 16px;
}
.code-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 600 12px/1 var(--mono);
  color: var(--muted);
}
pre {
  margin: 0;
  padding: 16px;
  font: 12.5px/1.7 var(--mono);
  color: #dbeafe;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.api-notes p { font-size: 13px; line-height: 1.65; color: var(--muted); margin: 8px 0 0; }
.api-notes code {
  font: 600 12px/1 var(--mono);
  color: var(--cyan-l);
  background: rgba(112, 197, 212, 0.08);
  padding: 2px 6px;
  border-radius: 5px;
}

/* Responsive Breakpoints */
@media (max-width: 1120px) {
  .sidebar { width: 224px; padding: 18px 14px; }
  .app, weize-eco { margin-left: 224px; }
  main { padding: 16px 20px 28px; }
  .topbar { padding: 0 20px; }
  .studio-layout { grid-template-columns: minmax(0, 1.3fr) minmax(270px, 315px); }
}

@media (max-width: 960px) {
  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    inset: auto;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }
  .brand { padding: 0; margin: 0; border: 0; }
  .nav-label, .sidebar-bottom { display: none; }
  .sidebar nav {
    margin-left: auto;
    display: grid;
    grid-template-columns: repeat(4, auto);
    gap: 6px;
  }
  .nav-item {
    width: auto;
    min-height: 40px;
    padding: 8px 11px;
    white-space: nowrap;
    font-size: 12.5px;
  }
  .nav-count { display: none; }
  .app, weize-eco { margin-left: 0; }
  .topbar { position: relative; top: auto; height: auto; min-height: 50px; padding: 9px 16px; flex-wrap: wrap; }
  .mobile-balance-chip { display: inline-flex; }
  .preview-label { display: none; }
  main { padding: 16px 16px 26px; }
  .studio-layout { grid-template-columns: 1fr; }
  .settings {
    border-left: 0;
    border-top: 1px solid var(--border);
    border-radius: 0 0 16px 16px;
  }
  .generation-bar { border-bottom-left-radius: 0; }
  .billing-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .sidebar { padding: 10px 12px; gap: 8px; }
  .brand-name { font-size: 14.5px; }
  .edition { font-size: 9px; padding: 4px 5px; }
  .sidebar nav {
    width: 100%;
    margin-left: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .nav-item {
    justify-content: flex-start;
    padding: 8px 11px;
    font-size: 12px;
    gap: 8px;
    min-height: 40px;
    background: rgba(255, 255, 255, 0.025);
    border-color: var(--border);
  }
  .topbar { padding: 9px 14px; }
  .crumb { font-size: 12px; }
  .audio-account-link { font-size: 11.5px; padding: 6px 10px; }
  .page-heading { flex-direction: column; align-items: flex-start; gap: 10px; }
  h1 { letter-spacing: -0.015em; }
  .format-badge { font-size: 11px; padding: 7px 11px; }
  .composer-toolbar { padding: 11px 14px; }
  .writing-area { padding: 12px 14px 6px; }
  .writing-area textarea { min-height: 155px; font-size: 16px; padding: 13px 14px; }
  .editor-bottom { padding: 6px 14px 12px; flex-direction: column; align-items: stretch; gap: 8px; }
  .char-meter-wrap { width: 100%; }
  .char-track { flex: 1; width: auto; }
  .generation-bar { padding: 13px 14px; flex-wrap: wrap; }
  .primary { flex: 1 1 150px; }
  #status, .auth-cta { margin-inline: 14px; }
  .settings { padding: 16px 14px; }
  .picker-trigger { min-height: 48px; font-size: 13.5px; }
  .picker-option { min-height: 48px; font-size: 13.5px; }
  .output-panel { padding: 16px 14px; }
  .surface { padding: 18px 14px; }
  #topups { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
