:root {
  --bg: #f6f5f2; --panel: #ffffff; --text: #1d1c1a; --muted: #77736c; --line: #e8e5df; --soft: #f1efea;
  --accent: #a87b22; --accent-soft: #f5ecd9; --accent-text: #ffffff;
  --ok: #2d7a4c; --ok-soft: #e3f1e8; --warn: #a8661a; --warn-soft: #f8ecdc; --bad: #b0372d; --bad-soft: #f8e4e1;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141412; --panel: #1d1c1a; --text: #eeebe6; --muted: #9a958c; --line: #2e2c29; --soft: #262522;
    --accent: #d2a54b; --accent-soft: #3a3020; --accent-text: #1d1c1a;
    --ok: #67b987; --ok-soft: #1f3327; --warn: #e0a35a; --warn-soft: #3a2c1b; --bad: #e27268; --bad-soft: #3d2220; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }
h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 0; }
p { margin: 0 0 12px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.err { color: var(--bad); margin: 0; white-space: pre-wrap; }
.err:empty { display: none; }
[hidden] { display: none !important; }

/* Kopf */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--text); color: var(--bg); font-size: 12px; letter-spacing: .5px; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 2px; background: var(--soft); padding: 3px; border-radius: 11px; }
.tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.tabs button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
main { max-width: 1080px; margin: 0 auto; padding: 24px; }

/* Bausteine */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.panel > h2 { margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { display: inline; width: auto; margin: 0 8px 0 0; vertical-align: -2px; accent-color: var(--accent); }
input[type=range] { padding: 0; border: 0; background: none; accent-color: var(--accent); }
.check { font-weight: 400; font-size: 14px; }
button { padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; font-weight: 600; font-size: 14px; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
button.wide { width: 100%; }
button.small { padding: 6px 12px; font-size: 13px; }
a.small { padding: 6px 12px; font-size: 13px; font-weight: 600; border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; }
button.link { border: 0; background: none; padding: 4px 0; color: var(--muted); font-weight: 500; text-decoration: underline; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.scroll { overflow-x: auto; }
pre { padding: 12px; background: var(--soft); border-radius: 10px; overflow-x: auto; user-select: all; font-size: 13px; }

/* Anmeldung */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-box { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.gate-box .brand { margin-bottom: 22px; }

/* Formular in Schritten */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.step { padding: 18px 0; border-top: 1px solid var(--line); }
.step:first-of-type { border-top: 0; }
.step-title { font-weight: 700; font-size: 14px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: baseline; }
.step label:last-child { margin-bottom: 0; }

.seg { display: inline-flex; background: var(--soft); padding: 3px; border-radius: 11px; margin-bottom: 14px; flex-wrap: wrap; }
.seg.full { display: flex; }
.seg.full label { flex: 1; }
.seg label { margin: 0; font-weight: 600; font-size: 14px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 14px; border-radius: 8px; color: var(--muted); cursor: pointer; text-align: center; }
.seg input:checked + span { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.seg.small span { padding: 5px 12px; font-size: 13px; }

.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 22px; border: 1.5px dashed var(--line); border-radius: 12px; background: var(--bg); cursor: pointer; text-align: center; margin-bottom: 12px; }
.drop:hover { border-color: var(--accent); }
.drop.slim { padding: 14px; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.drop strong { font-size: 14px; }

.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 84px; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--soft); font-size: 11px; color: var(--muted); }
.thumb > span { display: block; padding: 6px; overflow-wrap: anywhere; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; line-height: 22px; }
.thumb .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); }

#frameBox { margin-bottom: 6px; }
#frameRange { margin: 0 0 4px; }
.more { margin-top: 14px; }
.more summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.more .hint { display: block; margin: 0; }

/* Vorschau */
.preview { position: sticky; top: 84px; width: 300px; }
.phone { position: relative; width: 300px; aspect-ratio: 9 / 16; border-radius: 30px; overflow: hidden; background: #0d0d0d; color: #fff; border: 7px solid #1a1a1a; font-size: 13px; }
.pv-media { position: absolute; inset: 0; display: grid; place-items: center; }
.pv-media video, .pv-media img { width: 100%; height: 100%; object-fit: cover; }
.pv-empty { color: #8a8a8a; text-align: center; font-size: 13px; }
.pv-media .cover-img { position: absolute; inset: 0; pointer-events: none; }
.pv-media .cover-tag { position: absolute; top: 12px; left: 12px; background: rgba(0,0,0,.55); padding: 3px 9px; border-radius: 99px; font-size: 11px; }
.pv-media.playing .cover-img, .pv-media.playing .cover-tag { display: none; }
.pv-sound { position: absolute; top: 10px; right: 10px; z-index: 2; padding: 3px 8px; border: 0; border-radius: 99px; background: rgba(0,0,0,.45); color: #fff; font-size: 12px; }
.pv-side { position: absolute; right: 12px; bottom: 96px; display: flex; flex-direction: column; gap: 18px; font-size: 20px; text-shadow: 0 1px 3px rgba(0,0,0,.6); pointer-events: none; }
.pv-bottom { position: absolute; left: 0; right: 46px; bottom: 0; padding: 48px 12px 14px; background: linear-gradient(transparent, rgba(0,0,0,.6)); pointer-events: none; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.pv-user { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pv-av { width: 26px; height: 26px; border-radius: 50%; background: #777 center / cover; flex: none; }
.pv-av.big { width: 64px; height: 64px; }
.pv-follow { border: 1px solid rgba(255,255,255,.8); border-radius: 7px; padding: 0 7px; font-size: 11px; }
.pv-cap { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.pv-audio { margin-top: 6px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phone.light { background: #fff; color: #111; overflow-y: auto; }
.g-head { display: flex; align-items: center; gap: 14px; padding: 22px 14px 16px; border-bottom: 1px solid #eee; font-size: 14px; }
.g-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.tile { position: relative; aspect-ratio: 3 / 4; background: #e9e9e9; overflow: hidden; }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .ico { position: absolute; top: 4px; right: 5px; color: #fff; font-size: 11px; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
.tile.planned::after, .tile.new::after { content: "geplant"; position: absolute; left: 4px; bottom: 4px; font-size: 9.5px; font-weight: 600; background: rgba(0,0,0,.6); color: #fff; padding: 1px 6px; border-radius: 5px; }
.tile.new { outline: 3px solid var(--accent); outline-offset: -3px; }
.tile.new::after { content: "neu"; background: var(--accent); color: var(--accent-text); }
.g-note { grid-column: 1 / -1; padding: 16px; font-size: 12px; color: #777; text-align: center; }

/* Liste nach Tagen */
.list-head { margin: 32px 0 12px; }
.day { margin-bottom: 20px; }
.day-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin: 0 0 8px 4px; }
.post { display: grid; grid-template-columns: 60px 1fr auto; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; }
.post .thumb { width: 60px; }
.post-meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-bottom: 2px; }
.post-meta b { color: var(--text); font-size: 14px; }
.post-text { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.post-err { margin: 6px 0 0; font-size: 13px; color: var(--bad); }
.post-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.chip { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.s-entwurf { background: var(--soft); color: var(--muted); }
.s-geplant { background: var(--accent-soft); color: var(--accent); }
.s-läuft { background: var(--warn-soft); color: var(--warn); }
.s-veröffentlicht { background: var(--ok-soft); color: var(--ok); }
.s-fehler { background: var(--bad-soft); color: var(--bad); }
.empty { padding: 28px; text-align: center; color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }

/* Accounts, Zahlen */
.acc { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.acc:first-child { border-top: 0; padding-top: 0; }
.acc img, .acc .pv-av { width: 44px; height: 44px; border-radius: 50%; }
.acc div { flex: 1; min-width: 0; }
.howto { margin: 0 0 16px; padding-left: 20px; color: var(--muted); font-size: 14px; }
.howto li { margin-bottom: 4px; }
.howto b { color: var(--text); font-weight: 600; }
.stat { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.stat:first-child { border-top: 0; padding-top: 4px; }
.stat .thumb { width: 64px; }
.stat-body { min-width: 0; }
.stat-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.stat .post-text { color: var(--muted); margin-bottom: 10px; }
.nums { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.nums div { background: var(--soft); border-radius: 10px; padding: 8px 10px; }
.nums b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.nums span { font-size: 11.5px; color: var(--muted); }
@media (max-width: 700px) { .nums { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .stat { grid-template-columns: 48px 1fr; gap: 12px; } .stat .thumb { width: 48px; } }
#tab-settings > .link { margin-left: 4px; }

/* Ideen */
.ideas { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
.idea-tools { display: flex; gap: 8px; margin-bottom: 12px; }
.idea-tools input { margin: 0; }
.idea-tools button { flex: none; }
#ideaFilter { margin-bottom: 12px; }
.idea { display: block; width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; font-weight: 400; }
.idea.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.idea-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 2px; }
.idea-top b { font-size: 14px; }
.idea-top .chip { flex: none; }
.idea-hook { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px; }
.i-idee { background: var(--soft); color: var(--muted); }
.i-skript { background: var(--accent-soft); color: var(--accent); }
.i-gedreht { background: var(--warn-soft); color: var(--warn); }
.i-geplant, .i-online { background: var(--ok-soft); color: var(--ok); }
.title-input { font-size: 20px; font-weight: 700; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; padding: 4px 0 10px; margin: 0 0 18px; }
.title-input:focus { outline: 0; border-bottom-color: var(--accent); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
#ideaForm textarea[name=script] { font-size: 15px; line-height: 1.6; }
.links { display: flex; flex-direction: column; gap: 4px; margin: -6px 0 14px; font-size: 13px; }
.links:empty { display: none; }
.links a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idea-main { min-width: 0; }

/* Testreels */
.chip.s-trial { background: var(--accent-soft); color: var(--accent); }
label.trial { margin-top: 14px; }

/* Kommentare */
.badge { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: var(--accent-text); font-size: 11px; line-height: 18px; text-align: center; }
.c-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.c-head h2 { margin-bottom: 4px; }
.c-head button { white-space: nowrap; }
.cmt { display: grid; grid-template-columns: 64px 1fr; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 10px; }
.cmt .c-thumb { width: 64px; aspect-ratio: 9 / 16; border-radius: 8px; background: var(--soft); overflow: hidden; display: block; }
.cmt .c-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-text { margin: 4px 0 12px; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmt textarea { margin: 0 0 6px; }
.c-by { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.c-sent { margin: 0; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--soft); border-radius: 0 8px 8px 0; font-size: 14px; white-space: pre-wrap; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acc .style { margin-top: 10px; }
.acc .style textarea { font-size: 14px; }

@media (max-width: 860px) {
  .ideas { grid-template-columns: 1fr; }
  .editor { grid-template-columns: 1fr; }
  .preview { position: static; justify-self: center; }
}
@media (max-width: 560px) {
  main { padding: 16px; }
  .top { padding: 10px 16px; }
  .tabs { width: 100%; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs button { flex: 1 0 auto; padding: 7px 8px; font-size: 13px; }
  .cmt { grid-template-columns: 44px 1fr; gap: 12px; padding: 14px; }
  .cmt .c-thumb { width: 44px; }
  .panel { padding: 16px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .post { grid-template-columns: 52px 1fr; }
  .post .thumb { width: 52px; }
  .post-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .preview, .phone { width: 100%; max-width: 300px; }
}
