:root {
  --bg: #f6f6f4; --panel: #ffffff; --ink: #16181d; --muted: #6b7079; --line: #e6e6e2;
  --accent: #f59e0b; --accent-ink: #1a1200; --good: #16a34a; --bad: #dc2626; --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(16,24,40,.06);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 28px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
img { display: block; max-width: 100%; }

/* Buttons & Formulare */
button, .btn { font: inherit; font-weight: 600; font-size: 14px; border: 1px solid var(--ink); background: var(--ink); color: #fff;
  padding: 9px 16px; border-radius: 10px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
button:hover, .btn:hover { opacity: .88; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.secondary, .btn.secondary { background: var(--panel); color: var(--ink); border-color: var(--line); }
button.ghost { background: transparent; color: var(--muted); border-color: transparent; }
button.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.good { background: var(--good); border-color: var(--good); }
button.bad { background: var(--panel); color: var(--bad); border-color: #f3c4c4; }
button.sm, .btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
input, select, textarea { font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); width: 100%; }
textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); }
label.check input { width: auto; }

/* Layout */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center;
  padding: 12px 28px; background: rgba(246,246,244,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brandmark { display: flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; font-size: 17px; }
.logo-dot { width: 22px; height: 22px; border-radius: 7px; background: var(--ink); position: relative; }
.logo-dot::after { content: ""; position: absolute; inset: 6px 5px 5px; background: var(--accent); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
main { max-width: 1240px; margin: 0 auto; padding: 28px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.back { color: var(--muted); text-decoration: none; font-size: 14px; display: inline-block; margin-bottom: 14px; }
.back:hover { color: var(--ink); }

/* Login */
.login { max-width: 360px; margin: 14vh auto; }
.login h1 { margin-bottom: 6px; }

/* Markenkarten */
.brand-card { padding: 0; overflow: hidden; text-decoration: none; display: flex; flex-direction: column; transition: transform .15s; }
.brand-card:hover { transform: translateY(-2px); }
.brand-card .shot { aspect-ratio: 16/10; background: #ddd center/cover; position: relative; }
.brand-card .shot .badge-logo { position: absolute; left: 14px; bottom: -20px; width: 52px; height: 52px; border-radius: 12px; background: #1d2330;
  display: grid; place-items: center; padding: 6px; box-shadow: var(--shadow); }
.brand-card .shot .badge-logo img { max-height: 100%; object-fit: contain; }
.brand-card .body { padding: 28px 16px 16px; display: grid; gap: 8px; }
.chips { display: flex; gap: 6px; }
.chip { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: #f0f0ec; color: var(--muted); }
.tag.on { background: #e7f6ec; color: #13723a; }
.tag.warn { background: #fff4dc; color: #8a5a00; }
.new-brand { border-style: dashed; display: grid; align-content: center; gap: 12px; min-height: 260px; }

/* Markenseite */
.brand-head { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; }
.brand-head .big-logo { width: 84px; height: 84px; border-radius: 18px; background: #1d2330; display: grid; place-items: center; padding: 10px; }
.brand-head .big-logo img { max-height: 100%; object-fit: contain; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 26px 0 22px; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-color: var(--ink); }
.idea-form { display: grid; grid-template-columns: 110px 150px 1fr auto; gap: 12px; align-items: end; }
.batch-card { padding: 0; overflow: hidden; text-decoration: none; display: grid; grid-template-columns: 110px 1fr; }
.batch-card .thumb { background: #e9e9e5 center/cover; min-height: 136px; }
.batch-card .body { padding: 14px 16px; display: grid; gap: 6px; align-content: center; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 10px 18px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 600; } .kv dd { margin: 0; }
.swatch { display: inline-flex; align-items: center; gap: 8px; margin-right: 14px; font-family: ui-monospace, monospace; font-size: 13px; }
.swatch i { width: 26px; height: 26px; border-radius: 8px; border: 1px solid rgba(0,0,0,.1); display: inline-block; }
.thumbs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.thumbs img { height: 180px; border-radius: 10px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.analysis { white-space: pre-wrap; font-size: 14px; line-height: 1.6; }

/* Swipe */
.swipe { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 28px; align-items: start; }
.ad-frame { aspect-ratio: 4/5; border-radius: 16px; overflow: hidden; background: #e9e9e5; display: grid; place-items: center; box-shadow: var(--shadow); }
.ad-frame img { width: 100%; height: 100%; object-fit: cover; }
.ad-frame .placeholder { padding: 28px; text-align: center; color: var(--muted); font-size: 14px; display: grid; gap: 8px; }
.ad-frame .placeholder strong { color: var(--ink); font-size: 22px; line-height: 1.2; }
.swipe .text { display: grid; gap: 14px; }
.swipe .hook { font-size: 22px; font-weight: 700; line-height: 1.3; }
.caption { white-space: pre-wrap; line-height: 1.6; font-size: 15px; background: #fafaf8; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; max-height: 300px; overflow: auto; }
.hashtags { color: #2563eb; font-size: 14px; }
.swipe-actions { display: flex; gap: 12px; margin-top: 6px; }
.swipe-actions button { flex: 1; justify-content: center; padding: 14px; font-size: 15px; }
.progress { height: 6px; background: #e6e6e2; border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); }
.kbd { font-family: ui-monospace, monospace; font-size: 11px; border: 1px solid currentColor; border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; color: inherit; opacity: .6; }

/* Übersicht */
.idea-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.idea-card .ad-frame { border-radius: 0; box-shadow: none; }
.idea-card.discarded { opacity: .45; }
.idea-card .body { padding: 14px 16px; display: grid; gap: 10px; flex: 1; align-content: start; }
.idea-card .hook { font-weight: 700; line-height: 1.35; }
.idea-card .actions { padding: 12px 16px 16px; display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.status { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.status.kept { background: #e7f6ec; color: #13723a; } .status.discarded { background: #fde8e8; color: #a11c1c; } .status.new { background: #f0f0ec; color: var(--muted); }
.downloads { display: flex; gap: 6px; flex-wrap: wrap; }
.filter { display: flex; gap: 4px; background: #ecece8; padding: 4px; border-radius: 12px; }
.filter button { background: transparent; border: 0; color: var(--muted); padding: 7px 12px; border-radius: 9px; }
.filter button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* Modal */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(720px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(16,18,24,.45); }
dialog form { padding: 24px; display: grid; gap: 14px; max-height: 88vh; overflow: auto; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Jobs */
.jobs { position: fixed; right: 20px; bottom: 20px; z-index: 30; width: 380px; max-width: calc(100vw - 40px); }
.jobs .pill { margin-left: auto; display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; border-radius: 99px; padding: 10px 16px; cursor: pointer; width: max-content; box-shadow: var(--shadow); font-weight: 600; font-size: 14px; }
.jobs .list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.15); margin-bottom: 10px; max-height: 60vh; overflow: auto; }
.job { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; font-size: 13px; }
.job pre { margin: 0; font-size: 11.5px; background: #f6f6f4; border-radius: 8px; padding: 8px; max-height: 140px; overflow: auto; white-space: pre-wrap; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: currentColor; animation: spin .8s linear infinite; display: inline-block; }
.spinner.dark { border-color: rgba(0,0,0,.15); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; z-index: 40; font-size: 14px; box-shadow: var(--shadow); }
.toast.error { background: var(--bad); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }

@media (max-width: 820px) {
  main { padding: 18px; }
  .swipe, .compare, .two { grid-template-columns: 1fr; }
  .swipe > * { min-width: 0; }
  .swipe-actions { flex-wrap: wrap; } .swipe-actions button { padding: 12px 8px; } .kbd { display: none; }
  .topbar { padding: 10px 18px; }
  .jobs { right: 12px; bottom: 12px; }
  .idea-form { grid-template-columns: 1fr 1fr; }
  .brand-head { grid-template-columns: auto 1fr; }
  .brand-head > :last-child { grid-column: 1 / -1; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 10px; }
}
