:root {
  --bg: #0e0f13;
  --panel: #171920;
  --panel2: #1f222b;
  --line: #2a2e3a;
  --text: #eceef3;
  --muted: #9298a8;
  --accent: #ffd400;
  --fact: #4fc3f7;
  --assume: #ffb74d;
  --spec: #ff5a6e;
  --ok: #43d17a;
  --warn: #ffb74d;
  --err: #ff5a6e;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Inter, sans-serif; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; }
.top { position: sticky; top: 0; z-index: 5; display: flex; gap: 20px; align-items: center; padding: 12px 20px; background: rgba(14,15,19,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 900; letter-spacing: .08em; color: var(--text); font-size: 1.1rem; }
.brand span { color: var(--accent); }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { color: var(--muted); padding: 6px 12px; border-radius: 999px; }
nav a.active, nav a:hover { color: var(--text); background: var(--panel2); }
.mode { margin-left: auto; font-size: .8rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--panel2); }
.mode.mock { color: var(--accent); }
.mode.live { color: #fff; background: #b3261e; }
main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 80px; }
.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat { font-size: 2rem; font-weight: 800; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
button, .btn { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: 8px 14px; border-radius: 10px; cursor: pointer; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); color: #111; border-color: var(--accent); }
button.danger { color: var(--err); }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
textarea { width: 100%; min-height: 90px; resize: vertical; }
input[type=text] { min-width: 240px; flex: 1; }
.pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--panel2); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.pill.whatif { background: #3a2a00; color: var(--accent); }
.pill.fact { background: #0d2c3a; color: var(--fact); }
.s-review, .s-approved, .s-published { color: var(--ok); }
.s-failed, .s-failed_permission, .s-blocked_budget, .s-blocked_permission, .s-unclear, .s-publish_attention, .s-blocked { color: var(--err); }
.s-producing, .s-queued, .s-script_review, .s-submitting, .s-unknown, .s-retry_wait, .s-scheduled, .s-publishing { color: var(--warn); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.vlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.vcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--text); display: flex; flex-direction: column; }
.vcard .thumb { aspect-ratio: 9/16; background: var(--panel2) center/cover no-repeat; max-height: 260px; }
.vcard .meta { padding: 10px 12px; display: grid; gap: 4px; }
.vcard .t { font-weight: 700; font-size: .92rem; }
.detail { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; } }
.phone { position: sticky; top: 76px; background: #000; border-radius: 26px; padding: 10px; border: 1px solid var(--line); }
.phone video { width: 100%; border-radius: 18px; display: block; aspect-ratio: 9/16; background: #111; }
.beat { border-left: 4px solid var(--line); padding: 8px 12px; margin: 8px 0; background: var(--panel2); border-radius: 0 10px 10px 0; }
.beat.fact { border-color: var(--fact); }
.beat.assumption { border-color: var(--assume); }
.beat.speculation { border-color: var(--spec); }
.beat.intro, .beat.outro { border-color: var(--accent); }
.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.three > div { background: var(--panel2); border-radius: 10px; padding: 10px 12px; }
.three h3.fact { color: var(--fact); } .three h3.assume { color: var(--assume); } .three h3.spec { color: var(--spec); }
ul.clean { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.check { display: flex; gap: 8px; }
.check .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.error { background: var(--err); } .dot.info { background: var(--fact); }
.scenes { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.scenes figure { margin: 0; }
.scenes img { width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: 8px; border: 2px solid var(--line); }
.scenes img.animated { border-color: var(--accent); }
.scenes figcaption { font-size: .72rem; color: var(--muted); }
.notice { border: 1px solid var(--warn); background: #2b2210; color: #ffe3b0; padding: 10px 14px; border-radius: 10px; }
.notice.err { border-color: var(--err); background: #2b1015; color: #ffd0d6; }
.steps { display: flex; gap: 4px; flex-wrap: wrap; }
.steps span { font-size: .72rem; padding: 2px 7px; border-radius: 6px; background: var(--panel2); color: var(--muted); }
.steps span.done { color: var(--ok); } .steps span.running { color: var(--warn); } .steps span.failed { color: var(--err); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); padding: 10px 18px; border-radius: 12px; max-width: 90vw; z-index: 10; }
.toast.err { border-color: var(--err); }
details summary { cursor: pointer; color: var(--muted); }
code { background: var(--panel2); padding: 1px 5px; border-radius: 5px; font-size: .85em; }
section { margin-bottom: 18px; }

/* ---- Motivation, Optionen, Vergleich, Einstellungen ---- */
.hero { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; padding: 20px; border-radius: var(--radius); background: linear-gradient(120deg, #2a1d12 0%, #1b1f2a 55%, #0b1e2d 100%); border: 1px solid var(--line); }
.hero h1 { font-size: 2rem; margin-bottom: 4px; }
.hero p { margin: 0; }
.level { min-width: 240px; flex: 0 1 320px; display: grid; gap: 6px; }
.lvl-badge { justify-self: start; font-weight: 900; background: var(--accent); color: #111; padding: 4px 12px; border-radius: 999px; }
.lvl-bar, .goal { height: 10px; background: var(--panel2); border-radius: 999px; overflow: hidden; }
.lvl-bar > div, .goal > div { height: 100%; background: linear-gradient(90deg, var(--accent), #ff9f1c); border-radius: 999px; transition: width .6s; }
.goal { margin: 8px 0 6px; }
.stat-card .stat { line-height: 1.1; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; }
.badge { text-align: center; padding: 12px 8px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); opacity: .45; filter: grayscale(1); }
.badge.ok { opacity: 1; filter: none; border-color: var(--accent); box-shadow: 0 0 0 1px rgba(255,212,0,.15) inset; }
.badge .icon { font-size: 1.8rem; }
.tiny { font-size: .72rem; }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 10px; }
.opt { display: grid; gap: 4px; }
.opt select { width: 100%; }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.small-phone { position: static; }
.placeholder { aspect-ratio: 9/16; display: grid; place-items: center; }
.setting { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.setting:last-child { border-bottom: 0; }
.setting input, .setting select { flex: 1; min-width: 200px; }
.sticky-save { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 20; }
@media (max-width: 600px) { .hero h1 { font-size: 1.5rem; } }

/* ---- Produktion & Aufgaben ---- */
.detail.wide { grid-template-columns: 1.2fr 1fr; }
@media (max-width: 860px) { .detail.wide { grid-template-columns: 1fr; } }
.presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.preset { display: grid; gap: 4px; text-align: left; padding: 12px; }
.preset.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
button.big { font-size: 1.1rem; padding: 12px 20px; }
.task { display: grid; gap: 8px; margin-bottom: 10px; color: var(--text); }
.task:hover { border-color: var(--muted); }

/* ---- Mobile ---- */
.tabbar, .sheet { display: none; }
.detail > *, .grid > *, .compare > * { min-width: 0; }
a, td, p, li { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .top { padding: 10px 16px; gap: 10px; flex-wrap: nowrap; }
  .top nav, #logout { display: none; }
  .mode { margin-left: auto; }
  main { padding: 16px 16px 24px; }
  h1 { font-size: 1.35rem; }
  .card { padding: 14px; }
  /* Tab-Leiste unten */
  .tabbar { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: rgba(14,15,19,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 2px; padding: 8px 0 10px; font-size: .7rem; color: var(--muted); background: none; border: 0; border-radius: 0; font-weight: 600; min-height: 56px; }
  .tabbar span { font-size: 1.3rem; line-height: 1; }
  .tabbar .active { color: var(--accent); }
  .sheet:not([hidden]) { display: grid; position: fixed; left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 16; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
  .sheet a, .sheet button { padding: 14px 12px; color: var(--text); font-size: 1rem; text-align: left; background: none; border: 0; border-radius: 10px; }
  .sheet a:active, .sheet button:active { background: var(--panel2); }
  /* Bedienung: große Touch-Ziele, kein Auto-Zoom auf iOS */
  button, .btn { min-height: 44px; }
  input, select, textarea { font-size: 16px; min-height: 44px; }
  input[type=text] { min-width: 0; width: 100%; }
  .row > input[type=text] { flex: 1 1 100%; }
  .row > button.primary { flex: 1 1 auto; }
  /* Layout */
  .detail, .detail.wide { grid-template-columns: 1fr; }
  .phone { position: static; max-width: 300px; margin: 0 auto; border-radius: 22px; padding: 8px; }
  .phone video { max-height: 62vh; }
  .hero { padding: 16px; }
  .level { min-width: 0; flex: 1 1 100%; }
  .grid.cols-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { font-size: 1.6rem; }
  .opts { grid-template-columns: 1fr 1fr; }
  .presets { grid-template-columns: 1fr; }
  .badges { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .badge { padding: 8px 4px; }
  .badge .icon { font-size: 1.4rem; }
  .badge .tiny { display: none; }
  .vlist { grid-template-columns: 1fr 1fr; gap: 10px; }
  .scenes { grid-template-columns: repeat(3, 1fr); }
  .compare { grid-template-columns: 1fr; }
  .sticky-save { bottom: calc(64px + env(safe-area-inset-bottom)); margin: 0 -16px; padding: 10px 16px; }
  .sticky-save .primary { flex: 1; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  /* Tabellen: allgemein horizontal scrollbar, Listen-Tabellen als Karten */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr:first-child:has(th) { display: none; }
  table.stack tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  table.stack td { border: 0; padding: 3px 0; }
  table.stack td.row { padding-top: 8px; }
}
@media (max-width: 380px) { .grid.cols-4, .opts, .vlist { grid-template-columns: 1fr; } }

/* ---- Ablauf in 4 Schritten ---- */
.bigcta { display: block; text-align: center; font-weight: 800; font-size: 1.15rem; padding: 16px; border-radius: var(--radius); background: var(--accent); color: #111; }
.steps-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 960px) { .steps-flow { grid-template-columns: 1fr 1fr; } }
.step { display: flex; gap: 12px; color: var(--text); align-items: flex-start; }
.step:hover { border-color: var(--muted); }
.step-no, .flow-no { font-size: 1.6rem; font-weight: 900; color: var(--accent); line-height: 1; }
.step-body { display: grid; gap: 6px; flex: 1; }
.step .count { min-width: 26px; text-align: center; padding: 2px 8px; border-radius: 999px; background: var(--panel2); font-weight: 800; }
.step .count.hot { background: var(--accent); color: #111; }
.step .cta { color: var(--accent); font-weight: 700; }
.flow-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.flow-head h1 { margin: 0; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.seg button.active { border-color: var(--accent); background: #2b2410; color: var(--accent); }
.ideas { display: grid; gap: 10px; margin-top: 12px; }
.idea { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 10px; background: var(--panel2); border-radius: 12px; flex-wrap: wrap; }
.beat .ost { width: 100%; margin: 6px 0; font-weight: 700; }
.beat textarea.nar { min-height: 70px; }
.review-list { display: grid; gap: 14px; }
.review { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.review-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.review-actions .btn { display: inline-flex; align-items: center; }
@media (max-width: 760px) {
  .steps-flow { grid-template-columns: 1fr; }
  .review { grid-template-columns: 1fr; }
  .review .phone { max-width: 240px; }
  .review-actions > * { flex: 1 1 100%; justify-content: center; }
  .tabbar a, .tabbar button { font-size: .62rem; }
}

/* Posten (halbautomatisch) */
.bigcta.post { background: var(--ok, #43d17a); margin-bottom: 10px; }
.notice.ok { border-color: #43d17a; background: #10261a; color: #c9f5d9; }
.mini-thumb { width: 54px; height: 96px; object-fit: cover; border-radius: 8px; flex: none; }
.post-top { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; margin: 12px 0; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.post-card.done { opacity: .7; }
.post-card h3 { margin: 0; }
.copy-field { display: flex; gap: 8px; align-items: stretch; margin: 4px 0 10px; }
.copy-field textarea { flex: 1; min-width: 0; font-size: .85rem; resize: vertical; }
.copy-field button { flex: none; }
.checklist li { margin: 6px 0; }
.checklist input { width: 20px; height: 20px; vertical-align: middle; margin-right: 6px; }
.row.wrap { flex-wrap: wrap; }
@media (max-width: 760px) {
  .post-top { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr; }
  .copy-field { flex-direction: column; }
}
.s-manual_ready, .s-ready_to_post { color: var(--accent); font-weight: 700; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; margin: 0; line-height: 1.4; font-size: .92rem; }
.checklist input { margin: 1px 0 0; flex: none; }
.checklist input[type=checkbox] { padding: 0; min-height: 0; width: 20px; height: 20px; accent-color: var(--accent); }
[hidden] { display: none !important; }
.today { gap: 10px; }
.today .bigcta { flex: 1 1 240px; border: 0; cursor: pointer; font-family: inherit; }
.bigcta.alt { background: #22d3ee; }
.bigcta:disabled { opacity: .5; cursor: default; }
