/* Voice Studio — console-inspired dark theme.
   Palette: slate console body, amber "signal" for primary actions,
   cool cyan for audio/waveforms, red reserved for recording. */
:root {
  --bg: #12161d;
  --panel: #1a2029;
  --panel-2: #212833;
  --line: #2c3442;
  --line-2: #3a4456;
  --text: #e8e4da;
  --muted: #98a0ae;
  --faint: #6b7484;
  --amber: #f0b03c;
  --amber-ink: #241a06;
  --cyan: #79c3e6;
  --cyan-dim: #3b6478;
  --green: #6fcf97;
  --red: #ef5a5a;
  --warn: #e9a23b;
  --r-sm: 5px;
  --r-md: 8px;
  --r-lg: 12px;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --nav-w: 216px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--cyan); }
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 600; }
h1 { font-size: 1.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 0.98rem; }
p { margin: 0 0 .6em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.nav {
  background: #0f1319;
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--amber) 0 5px, transparent 6px),
              conic-gradient(from 0deg, var(--line-2), var(--panel-2), var(--line-2));
  box-shadow: inset 0 0 0 2px #0f1319;
}
.brand b { font-size: 1.02rem; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); text-decoration: none;
  padding: 8px 10px; border-radius: var(--r-sm); font-size: .93rem;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.active { color: var(--text); background: var(--panel-2); box-shadow: inset 3px 0 0 var(--amber); }
.nav .spacer { flex: 1; }
.nav .who { padding: 10px; font-size: .85rem; color: var(--faint); border-top: 1px solid var(--line); margin-top: 8px; }
.main { min-width: 0; padding: 26px 32px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 64ch; }
.demo-banner {
  background: repeating-linear-gradient(-45deg, #3a2a0b, #3a2a0b 10px, #33250a 10px, #33250a 20px);
  color: #f6d48d; border: 1px solid #6a4c12; border-radius: var(--r-md);
  padding: 9px 14px; margin-bottom: 18px; font-size: .9rem;
}

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  padding: 8px 14px; border-radius: var(--r-sm); cursor: pointer; font-size: .9rem;
  white-space: nowrap; line-height: 1.2;
}
.btn:hover:not(:disabled) { border-color: var(--faint); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: #f6c160; }
.btn.danger { color: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { color: var(--text); border-color: var(--line); }
.btn.sm { padding: 5px 10px; font-size: .82rem; }
.btn.icon { padding: 7px; }
.btn svg { width: 16px; height: 16px; }
.btn.rec { color: var(--red); border-color: #5a2a2e; }
.btn.rec.on { background: var(--red); color: #fff; border-color: var(--red); }

label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: .83rem; color: var(--muted); margin-bottom: 5px; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; background: #11161d; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 10px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--cyan-dim); }
textarea { resize: vertical; line-height: 1.6; }
.check { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; font-size: .9rem; }
.check input { margin-top: 3px; accent-color: var(--amber); }

/* sliders */
.ctl { margin-bottom: 14px; }
.ctl.disabled { opacity: .4; }
.ctl-head { display: flex; justify-content: space-between; font-size: .84rem; color: var(--muted); margin-bottom: 4px; }
.ctl-head output { font-family: var(--mono); color: var(--text); font-size: .8rem; }
.ctl-ends { display: flex; justify-content: space-between; font-size: .72rem; color: var(--faint); }
input[type=range] { width: 100%; accent-color: var(--amber); height: 18px; margin: 0; }
.tip { border-bottom: 1px dotted var(--faint); cursor: help; }

/* ---------- surfaces ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.panel + .panel { margin-top: 16px; }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 20px; }
.stat { background: var(--panel); padding: 16px 18px; }
.stat b { display: block; font-size: 1.7rem; font-weight: 500; font-family: var(--mono); }
.stat span { color: var(--muted); font-size: .85rem; }

.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.empty h3 { color: var(--text); margin-bottom: 6px; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--green); border-color: #2c5a40; }
.badge.warn { color: var(--warn); border-color: #5e4517; }
.badge.bad { color: var(--red); border-color: #5a2a2e; }
.badge.demo { color: #f6d48d; border-color: #6a4c12; background: #2b2109; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- voice cards ---------- */
.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.voice-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.voice-card .meta { font-size: .84rem; color: var(--muted); display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; }
.voice-card .meta dt { color: var(--faint); }
.voice-card .meta dd { margin: 0; }
.voice-card .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.score { font-family: var(--mono); font-size: .8rem; }
.meter { height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--green); }
.meter.mid i { background: var(--warn); }
.meter.low i { background: var(--red); }

/* ---------- clone flow ---------- */
.steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.steps span { font-size: .85rem; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--faint); }
.steps span.on { color: var(--text); border-color: var(--amber); }
.steps span.done { color: var(--green); border-color: #2c5a40; }
.drop { border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); padding: 28px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--amber); background: #231d10; color: var(--text); }
.recorder { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; background: #141920; }
.rec-canvas { width: 100%; height: 70px; display: block; background: #0f1319; border-radius: var(--r-sm); }
.rec-time { font-family: var(--mono); font-size: 1.3rem; }
.sample { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; background: var(--panel); }
.sample + .sample { margin-top: 10px; }
.mini-wave { height: 34px; display: flex; align-items: center; gap: 1px; }
.mini-wave i { flex: 1; background: var(--cyan-dim); border-radius: 1px; min-height: 2px; }
.qa { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px 16px; font-size: .84rem; margin-top: 10px; }
.qa div span { display: block; color: var(--faint); font-size: .76rem; }
.warnlist { margin: 8px 0 0; padding-left: 18px; font-size: .85rem; color: var(--warn); }
.warnlist.err { color: var(--red); }
.consent { border: 1px solid #5e4517; background: #1f1a0f; border-radius: var(--r-md); padding: 14px; }

/* ---------- studio ---------- */
.studio-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.studio-top .title-input { font-size: 1.25rem; font-weight: 600; background: transparent; border: 1px solid transparent; padding: 4px 8px; width: auto; min-width: 200px; flex: 1; }
.studio-top .title-input:hover, .studio-top .title-input:focus { border-color: var(--line); }
.save-state { font-size: .8rem; color: var(--faint); }
.studio { display: grid; grid-template-columns: minmax(300px, 1.15fr) minmax(320px, 1fr) 300px; gap: 14px; align-items: start; }
.col { min-width: 0; }
.scene-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; max-height: 210px; overflow: auto; }
.scene-tab { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: var(--r-sm); border: 1px solid transparent; cursor: pointer; font-size: .88rem; }
.scene-tab:hover { background: var(--panel-2); }
.scene-tab.on { border-color: var(--line-2); background: var(--panel-2); }
.scene-tab .n { font-family: var(--mono); color: var(--faint); font-size: .78rem; width: 20px; }
.scene-tab .t { flex: 1; min-width: 0; }
.scene-tab .x { display: none; gap: 2px; }
.scene-tab:hover .x, .scene-tab.on .x { display: flex; }
.scene-tab.dragging { opacity: .4; }
.toolbar { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r-md) var(--r-md) 0 0; background: #141920; }
.toolbar .sep { width: 1px; background: var(--line); margin: 2px 4px; }
.editor { border-radius: 0 0 var(--r-md) var(--r-md); min-height: 320px; font-size: 1rem; }
.counts { display: flex; gap: 14px; font-size: .8rem; color: var(--faint); margin-top: 6px; flex-wrap: wrap; }
.counts b { color: var(--muted); font-weight: 500; }

.gen-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gen-actions .btn { width: 100%; }
.estimate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; font-size: .78rem; color: var(--faint); margin: 12px 0 2px; }
.estimate b { display: block; color: var(--text); font-family: var(--mono); font-weight: 500; font-size: .9rem; }
.job { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; margin-top: 12px; background: #141920; }
.bar { height: 4px; background: var(--panel-2); border-radius: 2px; overflow: hidden; margin: 8px 0; }
.bar i { display: block; height: 100%; background: var(--amber); transition: width .3s; }
.job.err { border-color: #5a2a2e; }

/* the transport / waveform: the one bold element */
.transport { background: #0d1117; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.wave-scroll { overflow-x: auto; overflow-y: hidden; position: relative; cursor: text; scrollbar-width: thin; }
.wave-canvas { display: block; height: 120px; }
.wave-empty { height: 120px; display: grid; place-items: center; color: var(--faint); font-size: .88rem; }
.transport-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); background: #11161d; flex-wrap: wrap; }
.transport-bar .time { font-family: var(--mono); font-size: .86rem; color: var(--cyan); min-width: 120px; }
.transport-bar select { width: auto; padding: 4px 6px; font-size: .8rem; }
.transport-bar input[type=range] { width: 80px; accent-color: var(--cyan); }
.transport .now { padding: 8px 12px; font-size: .84rem; color: var(--muted); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; }

.versions { margin-top: 12px; }
.version { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid transparent; }
.version > div:nth-child(2) { flex: 1 1 180px; }
.version .acts { margin-left: auto; }
.version:hover { background: var(--panel-2); }
.version.playing { border-color: var(--cyan-dim); }
.version .v { font-family: var(--mono); font-size: .8rem; width: 34px; height: 26px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--panel-2); }
.version.best .v { background: var(--amber); color: var(--amber-ink); }
.version .acts { display: flex; gap: 2px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -4px -4px 14px; }
.tabs button { background: none; border: 0; padding: 8px 10px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; font-size: .88rem; }
.tabs button.on { color: var(--text); border-color: var(--amber); }
.override { border: 1px dashed var(--line-2); border-radius: var(--r-md); padding: 10px; margin-bottom: 12px; }
.rule { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; margin-bottom: 6px; }
.rule input { padding: 6px 8px; font-size: .85rem; }

/* tables */
table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; color: var(--faint); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: #1c222c; }
.tbl-wrap { overflow-x: auto; }

/* ---------- overlays ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(380px, calc(100vw - 36px)); }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--cyan); border-radius: var(--r-md); padding: 10px 14px; font-size: .9rem; box-shadow: 0 8px 24px #0008; display: flex; gap: 10px; align-items: flex-start; animation: tin .18s ease-out; }
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
.toast .grow { flex: 1; }
@keyframes tin { from { transform: translateY(6px); opacity: 0; } }
.modal-back { position: fixed; inset: 0; background: #05070acc; display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 20px; width: min(460px, 100%); max-height: 90vh; overflow: auto; }
.modal h2 { margin-bottom: 8px; }
.modal .row { justify-content: flex-end; margin-top: 16px; }
.spin { width: 16px; height: 16px; border: 2px solid var(--line-2); border-top-color: var(--amber); border-radius: 50%; animation: sp .8s linear infinite; display: inline-block; }
@keyframes sp { to { transform: rotate(360deg); } }
.loading { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 30px 0; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .panel { width: min(380px, 100%); padding: 26px; }
.login .brand { padding: 0 0 18px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .studio { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .studio .col-right { grid-column: 1 / -1; }
  .studio .col-right .panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 20px; }
  .studio .col-right .tabs, .studio .col-right .panel > .full { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px; z-index: 40; overflow-x: auto; border-right: 0; border-top: 1px solid var(--line); gap: 0; }
  .nav .brand, .nav .spacer, .nav .who { display: none; }
  .nav a { flex-direction: column; gap: 2px; font-size: .68rem; padding: 6px 8px; flex: 1; min-width: 64px; }
  .nav a.active { box-shadow: inset 0 -2px 0 var(--amber); }
  .main { padding: 18px 14px 90px; }
  .studio, .g2, .g3 { grid-template-columns: 1fr; }
  .studio .col-right .panel { display: block; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .estimate { grid-template-columns: repeat(2, 1fr); }
  .editor { min-height: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Generate Audio page ---------- */
.gen-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.gen-main { display: flex; flex-direction: column; min-height: calc(100vh - 120px); }
.gen-editor { flex: 1; min-height: 360px; border: 0; background: transparent; font-size: 1.05rem; line-height: 1.7; padding: 4px 2px; resize: none; }
.gen-editor:focus { border: 0; }
.gen-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; }
.gen-side { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.multi-help { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; margin-bottom: 8px; border: 1px dashed var(--line-2); border-radius: var(--r-md); }
.multi-help code { font-family: var(--mono); font-size: .82rem; background: var(--panel-2); padding: 1px 6px; border-radius: 4px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .88rem; }
.switch input { appearance: none; width: 34px; height: 20px; border-radius: 10px; background: var(--line-2); position: relative; cursor: pointer; margin: 0; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.switch input:checked { background: var(--amber); }
.switch input:checked::after { transform: translateX(14px); background: var(--amber-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.btn.chip { border-radius: 99px; padding: 5px 12px; background: transparent; }
.btn.chip.on { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); }
.btn.chip .n { font-family: var(--mono); font-size: .72rem; color: var(--faint); margin-left: 6px; }
.btn.chip.on .n { color: var(--amber-ink); }
.pill { font-family: var(--mono); font-size: .76rem; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 5px; padding: 0 6px; }
.select-btn { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; background: #11161d; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 10px; cursor: pointer; }
.select-btn:hover:not(:disabled) { border-color: var(--line-2); }
.select-btn:disabled { opacity: .6; cursor: default; }
.select-btn .grow { flex: 1; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 600; font-size: .85rem; flex: none; color: #0e1218; }
.avatar.a0 { background: #f0b03c; } .avatar.a1 { background: #79c3e6; } .avatar.a2 { background: #6fcf97; }
.avatar.a3 { background: #e79fd0; } .avatar.a4 { background: #b9a4f0; } .avatar.a5 { background: #f19072; }
.picker-list { max-height: 50vh; overflow: auto; margin: 10px 0; display: flex; flex-direction: column; gap: 2px; }
.picker-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); border: 1px solid transparent; background: none; cursor: pointer; text-align: left; }
.picker-item:hover { background: var(--panel-2); }
.picker-item.on { border-color: var(--amber); }
.picker-item .grow { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.hist-item { display: flex; align-items: center; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hist-item .grow { flex: 1; }
.sep-line { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.result { margin-top: 12px; }
.filters { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 14px; }
.filter-row { display: grid; grid-template-columns: 90px 1fr; gap: 10px; align-items: start; padding: 6px 0; }
.filter-row > span { font-size: .8rem; color: var(--faint); padding-top: 6px; }
.voice-card .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.voice-card .tags .badge { font-size: .7rem; }
.fav { color: var(--faint); }
.btn.fav.on, .btn.fav.on:hover { color: var(--amber); }
@media (max-width: 1100px) { .gen-layout { grid-template-columns: 1fr; } .gen-side { position: static; max-height: none; } }
@media (max-width: 860px) { .filter-row { grid-template-columns: 1fr; } .gen-main { min-height: 0; } }
.detect { color: var(--cyan); }
.detect.bad { color: var(--red); }

/* Ready-made voices */
.setup-steps { margin: 0 0 16px; padding-left: 20px; line-height: 1.7; }

/* Plans & credits */
.credit-pill { display: block; font-size: .8rem; color: var(--amber); text-decoration: none; border: 1px solid #5e4517; border-radius: 99px; padding: 3px 10px; margin-bottom: 8px; width: fit-content; }
.credit-pill.low { color: var(--red); border-color: #5a2a2e; }
.nav a.brand { text-decoration: none; color: inherit; }
.credit-bar { height: 6px; border-radius: 99px; background: var(--panel-2); overflow: hidden; margin: -8px 0 10px; }
.credit-bar i { display: block; height: 100%; background: var(--amber); border-radius: 99px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.plan-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.plan-card.hl { border-color: var(--amber); }
.plan-card.current { box-shadow: inset 0 0 0 1px var(--green); }
.plan-card .btn { margin-top: auto; }
.plan-price b { font-size: 1.6rem; font-weight: 600; margin-right: 8px; }
.plan-list { margin: 0; padding-left: 18px; color: var(--muted); }
.pay-steps { padding-left: 20px; margin: 14px 0; display: flex; flex-direction: column; gap: 14px; }
.pay-detail { display: flex; gap: 10px; align-items: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; margin-top: 8px; }
.plan-edit { border-top: 1px solid var(--line); padding: 14px 0; }
.plan-edit.off { opacity: .6; }
.plan-edit-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.tbl-wrap { overflow-x: auto; }
@media (max-width: 1100px) { .plan-edit-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Packages: featured Unlimited card */
.feat { display: grid; grid-template-columns: 1.1fr 1fr; border: 1px solid #4a4290; border-radius: 16px; background: linear-gradient(135deg, #1d2140, var(--panel) 60%); overflow: hidden; margin-top: 20px; }
.feat-main { padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.feat-side { padding: 28px; border-left: 1px solid var(--line); background: rgba(10, 13, 20, .35); }
.feat-title { font-size: 1.55rem; letter-spacing: -0.015em; }
.feat-price { display: flex; align-items: baseline; gap: 6px; }
.feat-price b { font-size: 2.8rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.feat-price .cur { font-weight: 600; color: var(--muted); }
.feat-btn { width: 100%; padding: 13px; font-size: 1rem; }
.tag-pill { font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; border: 1px solid; }
.tag-pill.blue { color: #a9c8ff; border-color: #33528a; background: #172540; }
.tag-pill.amber { color: var(--amber); border-color: #5e4517; background: #2b2109; }
.tag-pill.red { color: #ff9b9b; border-color: #5a2a2e; background: #2a1416; }
.seats { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.agree { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; font-size: .9rem; cursor: pointer; }
.agree input { margin-top: 3px; accent-color: var(--amber); }
.feat-sub { font-size: .78rem; letter-spacing: .02em; color: var(--muted); margin-bottom: 14px; font-weight: 600; }
.incl { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; font-size: .92rem; }
.incl li { padding-left: 22px; position: relative; }
.incl li.yes::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.incl li.no::before { content: "✕"; position: absolute; left: 0; color: var(--red); font-weight: 700; }
.warn-box { border: 1px solid #5a2a2e; background: #241315; color: #f3d6d6; border-radius: 10px; padding: 12px 14px; font-size: .88rem; }
.rules { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; color: var(--muted); }
.rules li::marker { color: var(--amber); font-weight: 600; }
.upgrade-btn { display: block; text-align: center; margin-bottom: 10px; }
@media (max-width: 900px) { .feat { grid-template-columns: 1fr; } .feat-side { border-left: 0; border-top: 1px solid var(--line); } .incl { grid-template-columns: 1fr; } }
.seats .credit-bar { background: var(--line); }

/* Sign in with Google */
.google-box { margin: 6px 0 4px; }
.gbtn { min-height: 44px; display: flex; justify-content: center; }
.or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: .8rem; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pw-login { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.pw-login summary { cursor: pointer; }
.pw-login form { margin-top: 12px; }
