:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --ink: #1d1b22;
  --muted: #6b6775;
  --line: #e4e1ea;
  --accent: #5b3df5;
  --accent-ink: #ffffff;
  --ok: #157f4a;
  --warn: #a15c00;
  --bad: #b42318;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131218;
    --surface: #1c1a23;
    --ink: #eeecf3;
    --muted: #a19cad;
    --line: #2e2b38;
    --accent: #8b74ff;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
main { max-width: 1080px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 28px; margin: 6px 0 16px; }
h2 { font-size: 19px; margin: 0 0 10px; }
a { color: var(--accent); text-decoration: none; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { font-weight: 800; font-size: 18px; color: var(--ink); }
nav { display: flex; align-items: center; gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.narrow { max-width: 520px; margin: 40px auto; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
input, select, textarea { font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
textarea.transcript { font-size: 18px; line-height: 1.8; }
.btn { display: inline-block; border: 0; border-radius: 10px; padding: 11px 18px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; cursor: pointer; text-align: center; }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn.secondary { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.muted { color: var(--muted); font-weight: 400; }
.error { color: var(--bad); font-weight: 600; }
.hidden { display: none; }
.lead { font-size: 17px; }
.big { font-size: 34px; font-weight: 800; margin: 4px 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.list { list-style: none; padding: 0; margin: 0; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.list-item a { display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--line); color: var(--ink); white-space: nowrap; }
.pill-working { background: #ece8ff; color: #4328c9; }
.pill-transcript, .pill-concepts, .pill-preview { background: #fff2dc; color: var(--warn); }
.pill-done { background: #ddf3e6; color: var(--ok); }
.pill-failed { background: #fde4e1; color: var(--bad); }
@media (prefers-color-scheme: dark) {
  .pill-working { background: #2c2457; color: #c9bdff; }
  .pill-transcript, .pill-concepts, .pill-preview { background: #3a2c12; color: #ffcf85; }
  .pill-done { background: #12301f; color: #8ce0b0; }
  .pill-failed { background: #3b1714; color: #ffaba3; }
}
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; counter-reset: s; flex-wrap: wrap; }
.steps li { counter-increment: s; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.steps li::before { content: counter(s) ". "; }
.steps li.current { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.concept { display: flex; flex-direction: column; gap: 6px; }
.concept form { margin-top: auto; padding-top: 10px; }
.concept.recommended { border: 2px solid var(--accent); }
.beats { padding-inline-start: 18px; font-size: 14px; }
.beats .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.sheet { display: block; width: 100%; border-radius: 10px; margin-bottom: 12px; }
.player { width: 100%; max-width: 360px; border-radius: 12px; background: #000; }
.small-list { padding-inline-start: 18px; font-size: 14px; }
.spinner { width: 42px; height: 42px; margin: 8px auto 16px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.log { text-align: left; white-space: pre-wrap; font-size: 12px; background: var(--bg); padding: 12px; border-radius: 10px; max-height: 260px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; margin: 6px 0; }
.balance { font-weight: 700; font-variant-numeric: tabular-nums; padding: 5px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.price-note { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.ok-msg { background: #ddf3e6; color: var(--ok); padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.inline { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.inline input { width: 110px; padding: 6px 8px; }
.inline input.wide { width: 180px; }
.btn.tiny { padding: 6px 10px; font-size: 13px; }
.btn.danger { background: var(--bad); }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.suspended { opacity: 0.6; }
@media (prefers-color-scheme: dark) { .ok-msg { background: #12301f; color: #8ce0b0; } }
progress { width: 100%; height: 14px; accent-color: var(--accent); }
.looks { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.looks legend { font-weight: 600; font-size: 14px; padding: 0 6px; }
.look { flex-direction: row; align-items: flex-start; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 400; }
.look:has(input:checked) { border-color: var(--accent); background: var(--bg); }
.look span { display: flex; flex-direction: column; gap: 2px; }
.look small { color: var(--muted); }
