/* ClipReact – design tokens, light + dark */
:root {
  /* brand: the logo's violet #7138FF and navy #0B1530 */
  --bg: #f5f4fa;
  --surface: #ffffff;
  --surface-2: #f0eef8;
  --border: #e0dcee;
  --text: #0b1530;
  --muted: #5a6178;
  --accent: #7138ff;
  --accent-hover: #5c22f0;
  --accent-soft: #eee7ff;
  --accent-contrast: #ffffff;
  --ok: #1f8a4c;
  --ok-soft: #e1f4e8;
  --warn: #a86400;
  --warn-soft: #fff1d6;
  --danger: #c0352b;
  --danger-soft: #fbe4e2;
  --info: #2764c4;
  --info-soft: #e3ecfb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --focus: 0 0 0 3px rgba(113, 56, 255, .35);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* brand on dark: the logo's lighter violet #9A78FF on deep navy */
    --bg: #0d1020;
    --surface: #161a2e;
    --surface-2: #1e2340;
    --border: #2c3254;
    --text: #e9ebf5;
    --muted: #9ca3bd;
    --accent: #9a78ff;
    --accent-hover: #b197ff;
    --accent-soft: #2a2152;
    --accent-contrast: #0d0820;
    --ok: #4cc27f;
    --ok-soft: #173424;
    --warn: #f0b04a;
    --warn-soft: #3a2c12;
    --danger: #ff6b60;
    --danger-soft: #3b1a18;
    --info: #6ea2ff;
    --info-soft: #182843;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --focus: 0 0 0 3px rgba(154, 120, 255, .45);
    color-scheme: dark;
  }
}
/* chosen in the header: dark whatever the system says */
:root[data-theme="dark"] {
  /* brand on dark: the logo's lighter violet #9A78FF on deep navy */
  --bg: #0d1020;
  --surface: #161a2e;
  --surface-2: #1e2340;
  --border: #2c3254;
  --text: #e9ebf5;
  --muted: #9ca3bd;
  --accent: #9a78ff;
  --accent-hover: #b197ff;
  --accent-soft: #2a2152;
  --accent-contrast: #0d0820;
  --ok: #4cc27f;
  --ok-soft: #173424;
  --warn: #f0b04a;
  --warn-soft: #3a2c12;
  --danger: #ff6b60;
  --danger-soft: #3b1a18;
  --info: #6ea2ff;
  --info-soft: #182843;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --focus: 0 0 0 3px rgba(154, 120, 255, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- app shell --- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px max(16px, calc((100vw - 1180px) / 2));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; text-decoration: none; color: var(--text); }
.brand .logo { display: block; height: 30px; width: auto; }
/* the logo for the mode: the word "Clip" navy on light, white on dark – bubble, symbols and "React" the same in both */
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none !important; }
  :root:not([data-theme="light"]) .logo-dark { display: block !important; }
}
.theme-toggle { min-width: 36px; padding: 6px 10px; }
.brand b { color: var(--accent); }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  padding: 7px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--accent); background: var(--accent-soft); }
.topbar .spacer { flex: 0; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 1 0; min-width: 0; justify-content: flex-end; }
.pill { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill.ok::before { background: var(--ok); }
.pill.warn::before { background: var(--warn); }

main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 96px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* --- cards & sections --- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 4px; font-size: 17px; }
.section-title .num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-contrast); font-size: 13px; font-weight: 700; flex: none; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.stack > * + * { margin-top: 14px; }

/* --- form controls --- */
.field { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=search], input[type=email], input[type=date], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .15s;
}
input[type=text]:focus, input[type=search]:focus, input[type=email]:focus, input[type=date]:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: var(--focus); outline: none; }
textarea { resize: vertical; min-height: 70px; line-height: 1.45; }
.input-wrap { position: relative; }
.input-wrap .state { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 13px; font-weight: 700; }
.input-wrap .state.ok { color: var(--ok); }
.input-wrap .state.bad { color: var(--danger); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.style-grid { display: grid; grid-template-columns: minmax(170px, .8fr) minmax(0, 1.6fr) minmax(0, 1.2fr); gap: 14px; }
.tone-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 900px) { .grid-3, .style-grid, .tone-grid { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--accent); color: var(--accent-contrast); font-weight: 700; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .15s, opacity .15s;
}
.btn:hover { background: var(--accent-hover); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--muted); border-color: transparent; padding: 6px 10px; }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--border); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.large { padding: 13px 24px; font-size: 16px; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn:disabled, .btn[aria-disabled=true] { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* segmented control / tabs */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--border); }
.segmented button { border: none; background: transparent; padding: 7px 12px; white-space: nowrap; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
.segmented button[aria-pressed=true], .segmented button[aria-selected=true] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented.full { display: flex; }
.segmented.full button { flex: 1; }

/* preset cards */
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.preset { display: flex; flex-direction: column; justify-content: flex-start;
  text-align: left; padding: 12px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s;
}
.preset:hover { border-color: var(--muted); }
.preset[aria-checked=true] { border-color: var(--accent); background: var(--accent-soft); }
.preset strong { display: block; font-size: 14px; }
.preset span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; cursor: pointer;
  background: var(--surface); user-select: none;
}
.chip:hover { border-color: var(--muted); }
.chip[aria-pressed=true] { background: var(--info-soft); border-color: var(--info); color: var(--info); font-weight: 600; }
.chip.avoid[aria-pressed=true] { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

details.disclose { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 16px; }
details.disclose > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
details.disclose > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
details.disclose[open] > summary::before { transform: rotate(90deg); }
details.disclose > summary .meta { color: var(--muted); font-weight: 500; font-size: 13px; }
details.disclose > .body { margin-top: 12px; }
/* "Neu analysieren" on the job page: a card that folds open, without the divider line */
details.card.disclose { border-top: 1px solid var(--border); margin-top: 0; padding: 16px 20px; }
.settings-line { color: var(--muted); }

/* dropzone */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 26px; text-align: center;
  background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .big { font-size: 28px; }
.files { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.files li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 14px; }
.files li .kind { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); width: 44px; }
.files li .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.progress.indeterminate > div { width: 35%; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

.cta-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { width: 38px; height: 22px; appearance: none; background: var(--border); border-radius: 999px; position: relative; cursor: pointer; transition: background .15s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:disabled { opacity: .5; cursor: not-allowed; }

/* banners */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid transparent; }
.banner.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.banner.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.banner.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.banner .grow { flex: 1; }
.banner strong { display: block; }

/* status badge */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.busy::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* stepper */
.stepper { display: flex; gap: 0; margin: 4px 0 20px; counter-reset: step; }
.stepper li { flex: 1; list-style: none; position: relative; padding-top: 30px; text-align: center; font-size: 13px; color: var(--muted); font-weight: 600; }
.stepper li::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); border: 2px solid var(--border); font-size: 12px; z-index: 1;
}
.stepper li::after { content: ""; position: absolute; top: 11px; left: calc(-50% + 14px); right: calc(50% + 14px); height: 2px; background: var(--border); }
.stepper li:first-child::after { display: none; }
.stepper li.done { color: var(--text); }
.stepper li.done::before { content: "✓"; background: var(--ok); border-color: var(--ok); color: #fff; }
.stepper li.done::after, .stepper li.current::after { background: var(--ok); }
.stepper li.current { color: var(--accent); }
.stepper li.current::before { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.stepper { padding: 0; }

/* progress panel */
.busy-panel { text-align: center; padding: 42px 20px; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--surface-2); border-top-color: var(--accent); animation: spin .9s linear infinite; margin: 0 auto 16px; }
.busy-panel h2 { margin: 0 0 6px; font-size: 20px; }
.busy-panel p { margin: 0; color: var(--muted); }
.steps { list-style: none; margin: 18px auto 0; padding: 0; max-width: 460px; text-align: left; }
.steps .step { display: flex; align-items: baseline; gap: 10px; padding: 5px 0; color: var(--muted); font-size: 14px; }
.steps .step .mark { width: 16px; text-align: center; flex: none; }
.steps .step .label { flex: 1; }
.steps .step .detail { font-variant-numeric: tabular-nums; font-size: 13px; }
.steps .step.done { color: var(--text); }
.steps .step.done .mark { color: var(--ok, #2e9d5b); }
.steps .step.current { color: var(--text); font-weight: 600; }
.steps .step.current .mark { color: var(--accent); }
.busy-panel .helper-line { margin-top: 14px; font-size: 13px; }
.busy-panel .helper-line.ok { color: var(--ok, #2e9d5b); }
.busy-panel .helper-line.warn { color: var(--warn, #b7791f); font-weight: 600; }
.busy-panel .busy-message { margin-top: 10px; font-weight: 600; }
.busy-panel .busy-leave { margin-top: 18px; }
.busy-panel .notify-btn { margin-top: 12px; }
.busy-ring { display: none; }

/* progress ring (job page, video list) */
.ring { position: relative; flex: none; }
.ring svg { display: block; overflow: visible; }
.ring-track { stroke: var(--border); }
.ring-arc { stroke: var(--accent); }
.ring.smooth .ring-arc { transition: stroke-dashoffset .9s ease-out; }
.ring.waiting .ring-arc { stroke: var(--muted); }
.ring.waiting svg { animation: ring-pulse 1.8s ease-in-out infinite; }
@keyframes ring-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.15; pointer-events: none; }
.ring-pct { font-size: 32px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.ring-pct:empty, .ring-eta:empty { display: none; }
.ring-eta { margin-top: 4px; max-width: 104px; font-size: 12px; color: var(--muted); }
.pulse-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); vertical-align: middle; animation: dot-pulse 1.2s ease-in-out infinite; }
@keyframes dot-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.6); opacity: .5; } }

/* the busy panel with a ring: ring left, text and steps right */
.busy-panel.ringed { display: flex; gap: 32px; align-items: flex-start; text-align: left; padding: 32px 28px; }
.busy-panel.ringed .busy-ring { display: block; flex: none; }
.busy-panel.ringed .spinner, .busy-panel.ringed .progress { display: none; }
.busy-panel.ringed .busy-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.busy-panel.ringed .busy-body > * { max-width: 100%; }
.busy-panel.ringed h2 { order: -2; margin: 0 0 2px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.busy-panel.ringed .busy-message { order: -1; margin: 0 0 8px; font-size: 20px; font-weight: 700; line-height: 1.3; color: var(--text); }
.busy-panel.ringed .steps { margin: 16px 0 0; max-width: 520px; width: 100%; }
.steps .step.todo .detail { opacity: .8; }

/* video list: a small ring next to the status of a running job */
.mini-progress { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .busy-panel.ringed { flex-direction: column; align-items: center; gap: 18px; text-align: center; padding: 24px 14px; }
  .busy-panel.ringed .busy-body { align-items: center; width: 100%; }
  .busy-panel.ringed .steps { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .ring.waiting svg, .pulse-dot { animation: none; }
  .ring.waiting svg { opacity: .6; }
  .ring.smooth .ring-arc { transition: none; }
}

/* job list */
.job-list { display: grid; gap: 10px; }
.job-list > * { min-width: 0; } /* a long title is cut with "…" instead of widening the card */
.job-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; }
.job-row .title { font-weight: 700; text-decoration: none; color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-row .title:hover { color: var(--accent); }
.job-row .sub { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; margin-top: 4px; }
.job-row .actions { display: flex; gap: 6px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .big { font-size: 40px; }

/* editor */
.editor { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .editor { grid-template-columns: 1fr; } }
.player-col { position: sticky; top: 72px; }
@media (max-width: 960px) { .player-col { position: static; } }
.player { width: 100%; border-radius: var(--radius-sm); background: #000; aspect-ratio: 16 / 9; display: block; }
.player-missing { aspect-ratio: 16 / 9; border-radius: var(--radius-sm); background: var(--surface-2); display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; font-size: 14px; }
.player-tools { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.player-tools .time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }

.list-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.list-head h2 { margin: 0; font-size: 17px; }
.list-head .meta { color: var(--muted); font-size: 13px; }
.topics { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.topics .badge { font-weight: 600; }

.comment { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; background: var(--surface); transition: border-color .15s, opacity .15s; }
.comment + .comment { margin-top: 10px; }
.comment.off { opacity: .55; }
.comment.near { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.comment .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comment .time-input { width: 76px; padding: 5px 8px; font-variant-numeric: tabular-nums; text-align: center; }
.comment .stars { color: var(--warn); letter-spacing: 1px; font-size: 13px; }
.comment .clip { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.comment .moment-title { font-weight: 700; font-size: 14px; }
.comment.frame { background: var(--surface-2); }
.comment .kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.comment .quote { margin: 8px 0; padding-left: 10px; border-left: 3px solid var(--border); color: var(--muted); font-size: 13px; font-style: italic; }
.comment .why { margin-top: 6px; font-size: 12px; color: var(--muted); }
.comment .why > summary { cursor: pointer; width: fit-content; color: var(--muted); font-weight: 600; }
.comment .why > summary:hover { color: var(--text); }
.comment .why[open] > summary { margin-bottom: 4px; }
.comment .rewrite { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.comment .rewrite input { flex: 1; min-width: 160px; }
.comment .counter { font-size: 12px; color: var(--muted); text-align: right; margin-top: 4px; font-variant-numeric: tabular-nums; }
.comment .counter.long { color: var(--warn); }
.comment .grow { flex: 1; }
.comment textarea { margin-top: 2px; }

.transcript-search { margin-bottom: 8px; }
.scrollbox { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.line { display: flex; gap: 10px; align-items: baseline; padding: 6px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
.line:last-child { border-bottom: none; }
.line:hover { background: var(--surface-2); }
.line .t { font-variant-numeric: tabular-nums; color: var(--accent); background: none; border: none; cursor: pointer; font-weight: 700; font-size: 13px; padding: 0; }
.line .txt { flex: 1; }
.line .add { opacity: 0; }
.line:hover .add, .line:focus-within .add { opacity: 1; }
mark { background: var(--warn-soft); color: inherit; border-radius: 3px; padding: 0 2px; }

/* sticky action bar */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
}
.actionbar .inner { max-width: 1180px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.actionbar .status { flex: 1; color: var(--muted); font-size: 14px; }
.actionbar .status.dirty { color: var(--warn); font-weight: 600; }
.kbd { font-size: 11px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--muted); }

/* result */
.result-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px; }
@media (max-width: 960px) { .result-grid { grid-template-columns: 1fr; } }

/* toasts */
.toasts { position: fixed; right: 16px; bottom: 84px; z-index: 50; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 11px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: 14px; animation: toast-in .2s ease-out; }
.toast.error { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* --- medium screens: the status pills get their own row (longer in Spanish) ----------- */
@media (max-width: 1120px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar .spacer { display: block; flex: 1; }
  .pills { order: 3; flex-basis: 100%; justify-content: flex-start; }
}

/* --- small screens ------------------------------------------------------------------ */
@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 8px 12px; flex-wrap: wrap; }
  .brand .logo { height: 26px; }
  .nav { margin-left: 0; }
  .nav a { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
  .topbar .spacer { display: none; }
  .pills { order: 3; width: 100%; flex-basis: 100%; justify-content: flex-start; }
  .pill { font-size: 11px; padding: 2px 8px; }
  main { padding: 16px 12px 120px; }
  .page-head h1 { font-size: 22px; }
  .card { padding: 14px; }
  .stepper li { font-size: 11px; }
  .banner { flex-direction: column; gap: 6px; }
  .actionbar .inner { padding: 10px 12px; gap: 8px; }
  .actionbar .status { flex-basis: 100%; font-size: 13px; }
  .actionbar .hint { display: none; }
  .actionbar .btn { flex: 1; padding: 10px 12px; }
  .job-row { grid-template-columns: 1fr; }
  .job-row .actions { flex-wrap: wrap; }
  .cta-row .btn.large { width: 100%; }
  .segmented.full button { padding: 7px 8px; font-size: 13px; }
  .style-grid .segmented.full { flex-wrap: wrap; }
  .toasts { bottom: 140px; }
}

/* --- accounts ----------------------------------------------------------------------- */
.usermenu { display: flex; align-items: center; gap: 6px; flex: none; white-space: nowrap; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; text-decoration: none; color: var(--text); border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600; }
.user-chip:hover { border-color: var(--muted); }
.user-chip .avatar { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-contrast); font-size: 12px; font-weight: 800; }
.user-chip .name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login-wrap { min-height: calc(100vh - 220px); display: grid; place-items: center; padding: 24px 0; }
.login-card { width: min(400px, 100%); padding: 28px; }
.login-brand { text-align: center; margin-bottom: 4px; }
.login-brand img { height: 48px; width: auto; margin: 0 auto; }
.empty .big-logo { display: block; margin: 0 auto 8px; }
.login-brand b { color: var(--accent); }
input[type=password] { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
input[type=password]:focus { border-color: var(--accent); box-shadow: var(--focus); outline: none; }
.credentials { margin: 8px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-all; user-select: all; }
.row-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-form input { flex: 1; min-width: 180px; padding: 7px 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
@media (max-width: 640px) {
  .usermenu { margin-left: auto; }
  .user-chip .name { display: none; }
}
.sys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 16px; }
.sys-item { display: flex; align-items: center; gap: 10px; font-size: 14px; }

/* job list: picture quality of a job */
.quality-tag { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); }
.quality-tag.test { color: var(--warn); border-color: currentColor; }

/* fact checks under a comment */
.comment .facts { margin-top: 6px; font-size: 12px; }
.comment .facts > summary { cursor: pointer; width: fit-content; color: var(--muted); font-weight: 600; }
.comment .facts ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.comment .facts li { display: grid; gap: 2px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); }
.comment .facts .verdict { font-weight: 700; }
.comment .facts .verdict.ok { color: var(--ok, #2f8f4e); }
.comment .facts .verdict.bad { color: var(--danger, #c0392b); }
.comment .facts .verdict.warn { color: var(--warn); }
.comment .facts .claim { color: var(--muted); font-style: italic; }
.comment .facts .src { color: var(--muted); }
.fact-switch { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 14px; }

/* "Alle Videos": one card per video, its versions indented */
.video-card { padding: 14px 16px; }
.video-card .video-head .title { font-weight: 700; font-size: 16px; text-decoration: none; color: var(--text); display: block;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-card .video-head .title:hover { color: var(--accent); }
.video-card .video-head .sub { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 2px; }
.video-card .versions { margin: 10px 0 0 6px; padding-left: 14px; border-left: 2px solid var(--border); display: grid; gap: 4px; }
.version-row { padding: 8px 0; }
.version-row + .version-row { border-top: 1px solid var(--border); }
.version-row .title { font-weight: 600; font-size: 14px; }
.version-row .vnum { font-weight: 700; margin-right: 8px; }
.version-row .vsettings { color: var(--muted); font-weight: 500; }
.video-card.flash { animation: flash 1.6s ease-out 1; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 3px transparent; } }

/* which code the server runs – changes with every update */
.appfoot { text-align: center; color: var(--muted); font-size: 12px; padding: 18px 16px 90px; }

/* credits */
.credit-balance { display: flex; gap: 28px; flex-wrap: wrap; }
.credit-balance > div { display: grid; }
.credit-balance strong { font-size: 20px; }
table.ledger { width: 100%; border-collapse: collapse; font-size: 13px; }
table.ledger th, table.ledger td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
table.ledger .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.ledger .minus { color: var(--danger); }
table.ledger .plus { color: var(--ok); }
.pill.credits { text-decoration: none; }
.estimate { display: grid; gap: 4px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); margin-top: 14px; }
.estimate .amount { font-size: 18px; font-weight: 700; }
.estimate.warn { outline: 2px solid var(--warn); }

/* the hook for the next clip under a comment */
.comment .teaser { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.comment .teaser-label { font-size: 12px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.comment .teaser-input { flex: 1; font-size: 13px; font-style: italic; }

.length-hint.warn { color: var(--warn); font-weight: 600; }

/* viewer comments: a card from under the original video, right above the host comment that answers it */
.hint.warn-text { color: var(--warn); }
.comment.viewer { margin-left: 18px; border-left: 3px solid var(--info); background: var(--surface-2); }
.comment.viewer + .comment { margin-top: 4px; }
.comment.viewer .kind { color: var(--info); }
.comment.viewer.skipped { opacity: .6; border-left-style: dashed; }
.yt-preview { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 6px; }
.yt-avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--info-soft); color: var(--info); font-weight: 800; font-size: 14px; }
.yt-meta { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; font-size: 13px; }
.yt-author { font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.yt-age, .yt-likes { color: var(--muted); white-space: nowrap; }
.yt-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.yt-badges:empty { display: none; }
.comment.viewer .viewer-tools { margin-top: 6px; }
.comment.viewer .viewer-tools .check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.comment.viewer .viewer-swap { flex: 1; min-width: 0; width: auto; max-width: 100%; font-size: 13px; padding: 5px 8px; }
.comment.viewer .viewer-voice { width: auto; font-size: 13px; padding: 5px 8px; }
.comment.viewer.reply { margin-left: 44px; border-left-style: dotted; }
.comment.viewer .viewer-original { margin-top: 4px; white-space: pre-wrap; font-style: italic; }
.comment.viewer .viewer-hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.comment.viewer .viewer-skip { margin: 6px 0 0; font-size: 12px; font-weight: 600; color: var(--warn); }
@media (max-width: 640px) {
  .comment.viewer { margin-left: 8px; }
  .comment.viewer .viewer-swap { flex-basis: 100%; }
}

/* --- voice comparison (admins) ---------------------------------------------------------- */
.voice-grid { display: grid; gap: 16px; }
.voice-card .row { flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.voice-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 4px 12px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--border); }
.voice-row audio { width: 100%; height: 36px; }
.voice-who { display: flex; flex-direction: column; }
.voice-text { grid-column: 2; margin: 0; font-size: 13px; color: var(--muted); }
@media (max-width: 640px) {
  .voice-row { grid-template-columns: minmax(0, 1fr); }
  .voice-text { grid-column: 1; }
}

/* --- avatar (account) ------------------------------------------------------------------- */
.avatar-photo { width: 140px; height: 140px; object-fit: cover; border-radius: 50%; border: 2px solid var(--border); }
.avatar-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 12px; }
.avatar-result { display: flex; flex-direction: column; gap: 6px; }
.avatar-result video { width: 100%; border-radius: var(--radius-sm); background: #000; }
hr.sep { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* --- tabs (setup of a new video, settings of a new version) ----------------------------- */
.tabs-list { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 0 0 16px; }
.tabs-list [role=tab] {
  flex: none; border: none; background: transparent; padding: 10px 14px; margin-bottom: -1px; cursor: pointer;
  font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap;
  border-bottom: 2px solid transparent; border-radius: var(--radius-sm) var(--radius-sm) 0 0; scroll-margin: 80px 16px;
}
.tabs-list [role=tab]:hover { color: var(--text); background: var(--surface-2); }
.tabs-list [role=tab][aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel:focus-visible { box-shadow: none; outline: none; }
.reanalyze .tabs { margin-top: 4px; }

/* --- setup: head line, the AI's first look, proposals, the bar ------------------------- */
.setup-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 10px 14px; margin: 4px 0 16px;
  border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; }
.setup-title { flex-basis: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setup-facts { color: var(--muted); }
.setup-download { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-variant-numeric: tabular-nums; }
.setup-download.ok { color: var(--ok); font-weight: 600; }
.progress.mini { display: inline-block; width: 90px; height: 6px; }
.note-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.briefing { border-top: 1px solid var(--border); padding-top: 14px; }
.briefing-wait { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.brief-summary { margin: 0; }
.brief-verdict { margin: 0; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.brief-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.brief-lists:empty { display: none; }
.brief-list { padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 14px; }
.brief-list ul { margin: 6px 0 0; padding-left: 18px; }
.brief-list li + li { margin-top: 4px; }
.brief-list.strong strong { color: var(--ok); }
.brief-list.weak strong { color: var(--danger); }
.brief-list.disputed strong { color: var(--warn); }
.brief-note { display: block; }
.brief-heading { font-size: 15px; margin: 0 0 10px; }
.proposals { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.proposal { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.proposal.recommended { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.proposal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.proposal-text { margin: 0; font-size: 14px; }
.brief-potential { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.brief-potential ul { margin: 6px 0 0; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.brief-potential .badge { margin-right: 4px; }
.brief-angle { margin: 8px 0 0; }
.proposal-angle { margin: 0; font-size: 13px; font-style: italic; }
.angle-box { margin-bottom: 12px; }
.angle-box strong { display: inline; }
.proposal-chips { margin: 0; font-size: 12px; color: var(--muted); }
.proposal > div:last-child { margin-top: auto; }

.setup-bar {
  position: sticky; bottom: 0; z-index: 10; margin: 18px -20px -20px; padding: 12px 20px;
  display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px);
  border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
}
.setup-bar-cost { flex: 1; min-width: 0; display: grid; gap: 2px; }
.setup-cost { font-weight: 700; font-variant-numeric: tabular-nums; }
.setup-warnings { list-style: none; margin: 2px 0 0; padding: 0; font-size: 12px; color: var(--warn); }
.setup-warnings:empty { display: none; }
.setup-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .tabs-list { overflow-x: auto; scrollbar-width: none; margin-left: -14px; margin-right: -14px; padding: 0 14px; }
  .tabs-list::-webkit-scrollbar { display: none; }
  .tabs-list [role=tab] { padding: 9px 11px; font-size: 13px; }
  .setup-bar { margin: 14px -14px -14px; padding: 10px 14px; flex-direction: column; align-items: stretch; }
  .setup-bar-actions .btn { flex: 1; white-space: normal; }
  .setup-bar-actions .btn:last-child { flex: 2; }
  .brief-lists, .proposals { grid-template-columns: 1fr; }
}

/* --- characters: who comments (page "Charaktere", picker in the setup) ------------------- */
/* The orb: a glowing ball in the character's colour (--orb is set per element). */
.char-visual { flex: none; display: inline-block; position: relative; border-radius: 50%; width: 56px; height: 56px; }
.char-visual.orb {
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, #fff 70%, var(--orb)) 0%, var(--orb) 48%,
    color-mix(in srgb, var(--orb) 55%, #000) 100%);
  box-shadow: 0 0 16px 2px color-mix(in srgb, var(--orb) 50%, transparent), inset 0 0 8px rgba(255, 255, 255, .25);
}
.char-visual.photo { background: var(--surface-2); box-shadow: 0 0 0 2px var(--orb), 0 0 14px color-mix(in srgb, var(--orb) 40%, transparent); }
.char-visual.photo img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.char-visual.large { width: 88px; height: 88px; }

.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 14px; }
.char-grid > .card { margin-top: 0; }
.char-grid > .hint, .char-grid > .banner { grid-column: 1 / -1; }
.char-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; min-width: 0; }
.char-card.editing { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.char-card-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.char-card-title { display: grid; gap: 1px; min-width: 0; }
.char-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.char-name { font-size: 16px; overflow-wrap: anywhere; }
.char-sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.char-persona { margin: 0; font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.char-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.char-actions .grow { flex: 1; }
.btn.preview-btn { min-width: 36px; padding: 5px 10px; border-color: var(--border); color: var(--text); }
.btn.preview-btn[aria-pressed=true] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* the editor */
.char-editor-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.char-look { display: flex; gap: 18px; align-items: flex-start; }
.char-look-preview { flex: none; width: 96px; display: flex; justify-content: center; padding-top: 4px; }
.char-look-controls { flex: 1; min-width: 0; }
.char-look .segmented.full { flex-wrap: wrap; }
.char-look .segmented button { white-space: normal; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid var(--surface); background: var(--orb);
  box-shadow: 0 0 0 1px var(--border); cursor: pointer; }
.swatch[aria-checked=true] { box-shadow: 0 0 0 2px var(--text); }
.swatch:focus-visible { box-shadow: var(--focus); }
.char-photo-box { margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.char-photo-box input[type=file] { max-width: 100%; font-size: 13px; }
.char-photo-box .check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; cursor: pointer; }
.char-photo-box .check input { margin-top: 4px; flex: none; }
.char-photo-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.char-tone-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; }

/* the voice picker */
.voice-current { margin: 0 0 10px; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.voice-picker { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 14px 14px; min-width: 0; }
.voice-picker > .hint, .voice-picker > .banner { margin-top: 10px; }
.voice-list { display: grid; gap: 6px; max-height: 340px; overflow-y: auto; padding: 2px; }
.voice-list:empty { display: none; }
.voice-option { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 4px 6px 4px 4px; min-width: 0;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.voice-option.selected { border-color: var(--accent); background: var(--accent-soft); }
.voice-pick { flex: 1; min-width: 0; display: grid; gap: 1px; padding: 6px 8px; border: none; border-radius: 6px;
  background: transparent; text-align: left; cursor: pointer; }
.voice-pick strong { font-size: 14px; }
.voice-pick span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.voice-pick:disabled { cursor: default; }
.voice-option.locked .voice-pick strong { color: var(--muted); }
.voice-extra { flex-basis: 100%; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 8px 6px; }
.voice-extra .voice-note { margin: 0; }
.voice-search { display: flex; gap: 8px; }
.voice-search input { flex: 1; min-width: 0; }

/* the picker at the top of "Ton & Haltung" */
.char-picker { margin-bottom: 16px; }
.char-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.char-pick { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: thin; }
.char-chip { flex: none; display: flex; align-items: center; gap: 10px; max-width: 230px; padding: 6px 14px 6px 6px; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: 999px; background: var(--surface); text-align: left; transition: border-color .15s, background .15s; }
.char-chip:hover { border-color: var(--muted); }
.char-chip[aria-checked=true] { border-color: var(--accent); background: var(--accent-soft); }
.char-chip-text { display: grid; min-width: 0; line-height: 1.25; }
.char-chip-text strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.char-chip-text span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 640px) {
  .char-look { flex-direction: column; gap: 10px; }
  .char-look-preview { width: auto; justify-content: flex-start; }
  .char-card { padding: 14px; }
  .voice-picker { padding: 4px 14px 12px; }
  .voice-list { max-height: 300px; }
  /* the main navigation gets its own scrollable row instead of widening the page */
  .nav { order: 2; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
}

/* Credits kaufen */
.offer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.offer { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.offer .hint { margin: 0; }
.offer-price { font-size: 20px; font-weight: 800; color: var(--accent); }
.buy-consent { margin-top: 8px; }
.buy-consent .check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.buy-consent .check input { margin-top: 3px; }

/* legal pages */
.legal { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }
.legal h2 { font-size: 17px; margin: 22px 0 6px; }
.legal p, .legal li { line-height: 1.6; }
.legal-nav { margin-top: 28px; font-size: 14px; }
.legal form.cancel { display: grid; gap: 14px; max-width: 520px; margin-top: 16px; }
.legal form.cancel .choice { display: flex; gap: 18px; flex-wrap: wrap; }
.legal form.cancel .choice label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.legal .receipt { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; background: var(--surface); }

/* confirmation dialog (credits, deletions) */
.confirm-dialog { border: 1px solid var(--border); border-radius: var(--radius, 14px); padding: 22px; width: min(480px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .45); }
.confirm-dialog::backdrop { background: rgba(8, 12, 30, .55); }
.confirm-dialog .value-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.confirm-dialog .value-table td { padding: 5px 0; border-bottom: 1px solid var(--border); }
.confirm-dialog .value-table td:last-child { text-align: right; font-weight: 650; }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }

/* admin overview */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); margin-bottom: 16px; }
.kpi { padding: 14px 16px; margin: 0 !important; }
.admin-grid > .card { margin: 0 !important; }
.kpi .label { font-size: 12.5px; color: var(--muted); display: block; }
.kpi .value { font-size: 22px; font-weight: 800; display: block; margin-top: 2px; line-height: 1.25; }
.kpi .sub { font-size: 12.5px; color: var(--muted); }
.kpi .value.plus { color: var(--ok, #1a9a5c); }
.kpi .value.minus { color: var(--danger); }
.admin-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 8px 6px 0; }
.admin-table td { padding: 6px 8px 6px 0; border-top: 1px solid var(--border); vertical-align: top; }
.admin-table td.num, .admin-table th.num { text-align: right; }
.owner-filter { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.owner-filter select { width: auto; }
