:root {
  color-scheme: dark;
  --bg: #12141a;
  --panel: #1a1d26;
  --line: #2a2f3d;
  --ink: #e6e8ef;
  --muted: #8d93a5;
  --accent: #6ea8ff;
  --ok: #4ec98a;
  --warn: #e0b24c;
  --bad: #ef6d6d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; color: var(--ink); }
.topbar nav { display: flex; align-items: center; gap: 16px; }
.who { color: var(--muted); }

main { max-width: 1040px; margin: 0 auto; padding: 24px; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 20px 22px; margin-bottom: 18px;
}
.card.narrow { max-width: 420px; margin: 48px auto; }
/* Anything wide lives inside the card, not across the page. */
.card img, .card video { max-width: 100%; height: auto; }
.result-video {
  display: block; width: 100%; max-width: 100%; height: auto;
  aspect-ratio: 16 / 9; background: #000; border-radius: 8px;
}

h1 { font-size: 21px; margin: 0 0 14px; }
h2 { font-size: 16px; margin: 22px 0 10px; font-weight: 600; }
h2 a { font-size: 13px; font-weight: 400; margin-left: 8px; }

label { display: block; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
input, select {
  display: block; width: 100%; margin-top: 4px; padding: 9px 11px;
  background: #10121a; border: 1px solid var(--line); border-radius: 7px;
  color: var(--ink); font: inherit;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }

button {
  padding: 9px 16px; border: 1px solid var(--line); border-radius: 7px;
  background: #262b38; color: var(--ink); font: inherit; cursor: pointer;
}
button:hover { border-color: var(--accent); }
button.link {
  background: none; border: none; padding: 0; color: var(--accent); cursor: pointer;
}
form.inline { display: inline; }
form.row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
form.row label { margin-bottom: 0; }
form.row .grow { flex: 1 1 260px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.pos { color: var(--ok); }
td.neg { color: var(--bad); }
td.mismatch { color: var(--bad); font-weight: 600; }

.muted { color: var(--muted); }
.notice { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; }
.notice.error { background: #34181c; border: 1px solid #6b2b31; color: #ffc9c9; }
.notice.ok { background: #14291f; border: 1px solid #2f5c46; color: #b6f0cf; }
.notice ul { margin: 0; padding-left: 18px; }

.progress { margin: 14px 0 6px; }
.progress-track {
  height: 8px; border-radius: 6px; background: #1b2330;
  border: 1px solid var(--line); overflow: hidden; position: relative;
}
.progress-fill {
  height: 100%; width: 0; border-radius: 6px; background: var(--accent, #4c8dff);
  transition: width .4s ease;
}
/* No number to show: a stripe that keeps moving, so the page reads as alive
   rather than as a percentage somebody made up. */
.progress-track.indeterminate .progress-fill {
  width: 35%; animation: progress-slide 1.4s ease-in-out infinite;
}
@keyframes progress-slide {
  0%   { margin-left: -35%; }
  100% { margin-left: 100%; }
}

.tag {
  display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 12px;
  border: 1px solid var(--line); color: var(--muted); margin-right: 4px;
}
.tag.ok { color: var(--ok); border-color: #2f5c46; }
.tag.wait { color: var(--warn); border-color: #5c4d2f; }

.balances { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.balance {
  flex: 1 1 160px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px;
}
.balance .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.balance .amount { font-size: 20px; font-variant-numeric: tabular-nums; margin-top: 4px; }

.projects { list-style: none; padding: 0; margin: 0; }
.projects li { padding: 8px 0; border-bottom: 1px solid var(--line); }

.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 6px 0; }
code { font-size: 12px; color: var(--muted); }

.voice-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px; margin-bottom: 16px;
}
.voice {
  display: block; margin: 0; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: #10121a; color: var(--ink); font-size: 14px;
}
.voice:has(input:checked) { border-color: var(--accent); }
.voice input { display: inline; width: auto; margin-right: 8px; }
.voice-name { font-weight: 600; }
.voice audio { width: 100%; margin-top: 8px; height: 32px; }

.avatar-grid { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 0; }
.avatar-card {
  margin: 0; width: 170px; background: #10121a;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.avatar-card img { display: block; width: 100%; height: 170px; object-fit: cover; }
.avatar-placeholder {
  height: 170px; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px;
}
.avatar-card figcaption { padding: 10px 12px; font-size: 14px; }
.avatar-card figcaption form { margin-top: 8px; }
.avatar-card figcaption button { padding: 4px 10px; font-size: 13px; }

.steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.step {
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 20px;
  font-size: 13px; color: var(--muted); background: var(--panel);
}
.step.done { color: var(--ok); border-color: #2f5c46; }
.step.current { color: var(--ink); border-color: var(--accent); }

.choice { display: block; margin-bottom: 10px; color: var(--ink); font-size: 15px; }
.choice input { display: inline; width: auto; margin-right: 8px; }

textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px;
  background: #10121a; border: 1px solid var(--line); border-radius: 7px;
  color: var(--ink); font: inherit; resize: vertical;
}
textarea:focus { outline: none; border-color: var(--accent); }

.avatar-card input { display: inline; width: auto; margin: 10px 0 0 12px; }

.notice.warn { background: #322a16; border: 1px solid #6b5a2b; color: #ffe7b0; }
.tag.bad { color: var(--bad); border-color: #6b2b31; }
button[disabled] { opacity: .5; cursor: not-allowed; }
.steps-list { margin: 0 0 12px; padding-left: 20px; }
.steps-list li { margin-bottom: 4px; }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.card-head h1 { margin: 0; }

a.button {
  display: inline-block; padding: 9px 16px; border: 1px solid var(--line);
  border-radius: 7px; background: #262b38; color: var(--ink);
  font: inherit; text-decoration: none; cursor: pointer;
}
a.button:hover { border-color: var(--accent); text-decoration: none; }
.button.primary, button.primary {
  background: var(--accent); border-color: var(--accent); color: #0d1117; font-weight: 600;
}
.button.primary:hover, button.primary:hover { filter: brightness(1.08); }
.topbar nav .button.primary { padding: 6px 12px; }
