[hidden] { display: none !important; }
/* Layout: Desktop = Seitenleiste + Arbeitsfläche; Handy = Arbeitsfläche + feste Leiste unten. Akzent = Untertitel-Gelb der Clips. */
:root {
  --bg: #f4f3ef; --panel: #ffffff; --panel2: #ebe9e3; --fg: #16161a; --muted: #6b6a73; --line: #dcdad3;
  --accent: #ffd400; --accent-ink: #16161a; --good: #1f9d55; --warn: #c27c0e; --bad: #c2410c;
  --display: "Archivo", system-ui, sans-serif; --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f0f12; --panel: #17171c; --panel2: #202027; --fg: #f2f1ec; --muted: #9b9aa4; --line: #2a2a33;
  --accent: #ffd400; --accent-ink: #16161a; --good: #4ade80; --warn: #fbbf24; --bad: #fb923c; color-scheme: dark } }
:root[data-theme="dark"] { --bg: #0f0f12; --panel: #17171c; --panel2: #202027; --fg: #f2f1ec; --muted: #9b9aa4; --line: #2a2a33;
  --accent: #ffd400; --accent-ink: #16161a; --good: #4ade80; --warn: #fbbf24; --bad: #fb923c; color-scheme: dark }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--display); font-size: 15px; line-height: 1.45; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; }
.side { border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.15rem; letter-spacing: -.01em; padding: 0 6px; }
.logo { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 900; font-size: .9rem; }
.navgrp { display: grid; gap: 2px; }
.navlabel { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 10px 6px; }
.navbtn { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; border: 0; background: none; text-align: left; font-weight: 500; }
.navbtn:hover { background: var(--panel2); }
.navbtn[aria-current="true"] { background: var(--panel2); font-weight: 700; }
.navbtn svg { width: 18px; height: 18px; flex: none; }
.quota { margin-top: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; font-size: .85rem; }
.bar { height: 6px; border-radius: 99px; background: var(--panel2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }

main { padding-block: 24px 96px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); min-width: 0; }
.wrap { max-width: 1180px; margin: 0 auto; display: grid; gap: 22px; }
h1 { font-size: 1.7rem; font-weight: 900; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
h2 { font-size: 1.05rem; font-weight: 800; margin: 0; }
.sub { color: var(--muted); margin: 4px 0 0; }
.head { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }

/* Link-Feld */
.linkbox { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.linkbox input { flex: 1 1 260px; min-width: 0; border: 0; background: var(--panel2); border-radius: 10px; padding: 13px 14px; }
.cta { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 12px 18px; font-weight: 800; white-space: nowrap; }
.ghost { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 13px; font-weight: 600; }

/* Galerie */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 99px; padding: 6px 12px; font-size: .85rem; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); }
.card { display: grid; gap: 8px; min-width: 0; }
.thumb { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 9/16; background: #000; border: 1px solid var(--line); max-width: 100%; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button.open { position: absolute; inset: 0; border: 0; background: none; }
.dur { position: absolute; top: 8px; right: 8px; font-family: var(--mono); font-size: .72rem; background: rgba(0,0,0,.65); color: #fff; padding: 2px 6px; border-radius: 6px; }
.sel { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.35); }
.sel[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.status { position: absolute; bottom: 8px; left: 8px; font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: rgba(0,0,0,.7); color: #fff; }
.status.posted { background: var(--good); color: #062b14; }
.meta-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.score { font-weight: 900; font-size: 1.5rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.score small { font-size: .7rem; color: var(--muted); font-weight: 600; }
.icons { display: flex; gap: 2px; }
.icons button { border: 0; background: none; padding: 5px; border-radius: 7px; color: var(--muted); }
.icons button:hover { background: var(--panel2); color: var(--fg); }
.icons svg { width: 17px; height: 17px; display: block; }
.ctitle { font-weight: 700; font-size: .9rem; line-height: 1.25; }
.cmeta { font-size: .75rem; color: var(--muted); }

.selbar { position: sticky; top: 8px; z-index: 5; background: var(--fg); color: var(--bg); border-radius: 12px; padding: 10px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.selbar button { background: var(--bg); color: var(--fg); border: 0; border-radius: 8px; padding: 6px 10px; font-weight: 700; font-size: .85rem; }

/* Detail */
.detail { display: grid; grid-template-columns: 84px minmax(0, 300px) minmax(0, 1fr) 200px; gap: 18px; align-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.big { font-weight: 900; font-size: 2.2rem; line-height: 1; }
.big small { font-size: .8rem; color: var(--muted); }
.grades { display: grid; gap: 6px; font-size: .85rem; margin-top: 10px; }
.grades div { display: flex; justify-content: space-between; }
.grades b { color: var(--good); }
.detail video { width: 100%; aspect-ratio: 9/16; border-radius: 12px; background: #000; max-width: 100%; }
.actions { display: grid; gap: 8px; }
.actions button { text-align: left; }
.kv { display: grid; gap: 10px; font-size: .9rem; }
.kv span { color: var(--muted); display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.hookedit { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; font-weight: 700; }

/* Neues Video */
.settings { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.field { display: grid; gap: 6px; font-size: .85rem; font-weight: 600; min-width: 0; }
.field select, .field input[type=number] { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; width: 100%; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 14px; min-width: 0; }
.range { display: grid; gap: 6px; }
.range input { width: 100%; accent-color: var(--accent); }
.progress { display: grid; gap: 10px; }
.steps { display: grid; gap: 6px; font-size: .9rem; }
.steps div { display: flex; gap: 10px; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex: none; }
.dot.done { background: var(--good); } .dot.run { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); }
.pct { font-weight: 900; font-size: 2rem; font-variant-numeric: tabular-nums; }

/* Stil */
.stylewrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.tile { border: 2px solid var(--line); background: #1c1c22; border-radius: 12px; aspect-ratio: 1/1; display: grid; place-items: center; padding: 8px; position: relative; }
.tile[aria-pressed="true"] { border-color: var(--accent); }
.tile .lbl { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: .78rem; color: var(--muted); font-weight: 600; }
.tilerow { padding-bottom: 22px; }
.cap { font-weight: 900; text-transform: uppercase; text-align: center; line-height: 1.05; font-size: .95rem; color: #fff; }
.cap.s1 { text-shadow: 0 0 3px #000, 2px 2px 0 #000; } .cap.s1 em { color: #ffd400; font-style: normal; }
.cap.s2 { font-family: Georgia, serif; text-transform: none; font-weight: 700; } .cap.s2 em { background: #7c3aed; padding: 0 4px; border-radius: 4px; font-style: normal; }
.cap.s3 { color: #ffd400; -webkit-text-stroke: 1px #000; font-size: 1.05rem; } .cap.s3 em { color: #fff; font-style: normal; }
.cap.s4 { background: #fff; color: #000; padding: 4px 6px; border-radius: 4px; font-size: .8rem; } .cap.s4 em { color: #e11d48; font-style: normal; }
.cap.s5 { color: #22d3ee; font-style: italic; } .cap.s5 em { color: #fff; }
.toggles { display: grid; gap: 4px; }
.tg { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tg:last-child { border-bottom: 0; }
.tg p { margin: 2px 0 0; color: var(--muted); font-size: .8rem; }
.switch { width: 44px; height: 26px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); position: relative; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: left .15s; }
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"]::after { left: 21px; background: var(--accent-ink); }
.phone { border: 8px solid #222; border-radius: 30px; aspect-ratio: 9/16; overflow: hidden; position: relative; background: #000; max-width: 100%; position: sticky; top: 16px; }
.phone img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.phone .hookbox { position: absolute; top: 9%; left: 10%; right: 10%; background: #fff; color: #000; text-align: center; font-weight: 900; font-size: .78rem; padding: 6px; text-transform: uppercase; }
.phone .live { position: absolute; left: 6%; right: 6%; top: 66%; display: grid; place-items: center; }

/* Autopilot */
.stat { display: grid; gap: 4px; }
.stat b { font-size: 1.8rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .8rem; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 620px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
td.num { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: .82rem; }
.pill { font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--panel2); white-space: nowrap; }
.pill.ok { background: color-mix(in srgb, var(--good) 22%, transparent); color: var(--good); }
.pill.run { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.log { font-family: var(--mono); font-size: .78rem; color: var(--muted); display: grid; gap: 4px; }

.note { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; font-size: .82rem; color: var(--muted); }

/* Handy */
.bottomnav { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--panel); border-top: 1px solid var(--line);
    padding: 6px max(8px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-right, 0px)); justify-content: space-around; }
  .bottomnav .navbtn { flex-direction: column; gap: 2px; font-size: .68rem; padding: 6px 8px; }
  .detail { grid-template-columns: 1fr; }
  .stylewrap { grid-template-columns: 1fr; }
  .phone { position: static; max-width: 260px; margin: 0 auto; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* --- App-Ergänzungen --- */
body { margin: 0; }
:root { padding-top: env(safe-area-inset-top, 0px); }
.login { min-height: 100vh; display: grid; place-items: center; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.loginbox { width: 100%; max-width: 360px; display: grid; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.loginbox input { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; width: 100%; }
.err { color: var(--bad); font-size: .85rem; min-height: 1.2em; margin: 0; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; font-weight: 700; z-index: 50; max-width: calc(100vw - 32px); }
.empty { border: 1px dashed var(--line); border-radius: 14px; padding: 28px; text-align: center; color: var(--muted); }
.job { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.job:last-child { border-bottom: 0; }
.job .meta-row b { font-size: .9rem; }
.pill.err { background: color-mix(in srgb, var(--bad) 22%, transparent); color: var(--bad); }
.detail[hidden] { display: none !important; }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #777; font-size: .8rem; }
.phone .ph { background: linear-gradient(160deg, #2a2a33, #111); width: 100%; height: 100%; }
.row2 { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.small { font-size: .8rem; color: var(--muted); }
td .ghost { padding: 5px 9px; font-size: .8rem; }
.logout { margin-top: 8px; }
.icons a.iconlink { padding: 5px; border-radius: 7px; color: var(--muted); display: block; }
.icons a.iconlink:hover { background: var(--panel2); color: var(--fg); }
.icons a.iconlink svg { width: 17px; height: 17px; display: block; }
.tiles { row-gap: 34px; }
@media (max-width: 900px) { .phone { position: relative; } }
@media (max-width: 900px) { .stylewrap .phone { order: -1; max-width: 200px; } }
