/* Meta Ad Generator, in the look of Benefit OS (benefit-os/src/app/globals.css):
   soft grey background, white cards with 14 px radius, brand blue, blurred top bar,
   light / dark / auto via html[data-theme], phone layout below 900 px. */
:root {
  --bg: hsl(220 25% 98.5%);
  --surface: #ffffff;
  --surface-2: hsl(220 20% 96%);
  --border: hsl(220 16% 92%);
  --border-strong: hsl(220 14% 86%);
  --text: hsl(224 30% 14%);
  --muted: hsl(220 10% 46%);
  --accent: hsl(215 98% 34%);
  --accent-ink: #ffffff;
  --accent-soft: hsl(215 70% 96%);
  --accent-soft-ink: hsl(215 98% 34%);
  --danger: hsl(0 72% 52%);
  --ok: hsl(152 60% 34%);
  --warn: hsl(32 90% 46%);
  --s-unaware: #7048e8;
  --s-problem: #e8590c;
  --s-solution: #d98200;
  --s-product: #1c7ed6;
  --s-most: #2b8a3e;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px hsl(220 30% 20% / 0.04), 0 4px 16px hsl(220 30% 20% / 0.05);
  --shadow-pop: 0 2px 4px hsl(220 30% 20% / 0.06), 0 12px 32px hsl(220 30% 20% / 0.1);
  --topbar: 56px;
  --sidebar: 264px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  font-size: 14px;
  color-scheme: light;
}
/* Dark tokens: html[data-theme=dark], or auto (no attribute) on a dark device. */
:root[data-theme='dark'] {
  --bg: hsl(230 25% 7%);
  --surface: hsl(230 22% 10%);
  --surface-2: hsl(230 18% 15%);
  --border: hsl(230 18% 18%);
  --border-strong: hsl(230 16% 26%);
  --text: hsl(220 20% 96%);
  --muted: hsl(220 12% 65%);
  --accent: hsl(215 90% 62%);
  --accent-ink: hsl(230 25% 7%);
  --accent-soft: hsl(215 50% 18%);
  --accent-soft-ink: hsl(215 90% 85%);
  --danger: hsl(0 75% 64%);
  --ok: hsl(152 55% 52%);
  --warn: hsl(38 92% 58%);
  --shadow: 0 1px 2px hsl(230 30% 2% / 0.3), 0 4px 16px hsl(230 30% 2% / 0.4);
  --shadow-pop: 0 2px 4px hsl(230 30% 2% / 0.4), 0 12px 32px hsl(230 30% 2% / 0.55);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: hsl(230 25% 7%);
    --surface: hsl(230 22% 10%);
    --surface-2: hsl(230 18% 15%);
    --border: hsl(230 18% 18%);
    --border-strong: hsl(230 16% 26%);
    --text: hsl(220 20% 96%);
    --muted: hsl(220 12% 65%);
    --accent: hsl(215 90% 62%);
    --accent-ink: hsl(230 25% 7%);
    --accent-soft: hsl(215 50% 18%);
    --accent-soft-ink: hsl(215 90% 85%);
    --danger: hsl(0 75% 64%);
    --ok: hsl(152 55% 52%);
    --warn: hsl(38 92% 58%);
    --shadow: 0 1px 2px hsl(230 30% 2% / 0.3), 0 4px 16px hsl(230 30% 2% / 0.4);
    --shadow-pop: 0 2px 4px hsl(230 30% 2% / 0.4), 0 12px 32px hsl(230 30% 2% / 0.55);
    color-scheme: dark;
  }
}
/* Logo variant per theme: one <img>, the white wordmark on dark surfaces. */
:root[data-theme='dark'] .themed-logo { content: url('/assets/logos/logo-weiss.png'); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .themed-logo { content: url('/assets/logos/logo-weiss.png'); }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 8px; }
textarea, input, select, button { font: inherit; color: inherit; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
[hidden] { display: none !important; }
.only-mobile { display: none !important; }
.spacer { flex: 1; }

/* ---------- shell: sidebar + content ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px; padding: 18px 14px 14px;
  padding-top: max(18px, env(safe-area-inset-top)); padding-bottom: max(14px, env(safe-area-inset-bottom));
  overflow-y: auto;
}
.shell { margin-left: var(--sidebar); min-height: 100dvh; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.brand-logo { height: 34px; width: auto; }
.brand-sub { font-size: 12px; color: var(--muted); padding: 2px 6px 10px; font-weight: 500; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 14px 8px 4px; }
.project-list, .side-nav { display: flex; flex-direction: column; gap: 2px; }
.project-list { max-height: 34vh; overflow-y: auto; }
.project-list a, .side-nav button {
  padding: 9px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 8px;
  cursor: pointer; border: 0; background: none; text-align: left; font-weight: 500; min-height: 38px;
}
.project-list a span { color: var(--muted); font-size: 12px; margin-left: auto; }
.project-list a:hover, .side-nav button:hover { background: var(--surface-2); }
.project-list a.active, .side-nav button.active { background: var(--accent-soft); color: var(--accent-soft-ink); font-weight: 600; }
.side-nav .ico, .side-settings .ico { width: 20px; text-align: center; color: var(--muted); }
.side-nav .count { margin-left: auto; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
.side-settings { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: var(--radius-sm); border: 0; background: none; cursor: pointer; font-weight: 500; text-align: left; }
.side-settings:hover { background: var(--surface-2); }
.auth-pill { font-size: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); line-height: 1.45; }
.auth-pill .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.auth-pill.ok .dot { background: var(--ok); }
.auth-pill.bad .dot { background: var(--danger); }
.auth-pill button { margin-top: 6px; }
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / 0.4); z-index: 35; }

/* top bar, blurred like Benefit OS */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar); display: flex; align-items: center; gap: 12px;
  padding: 0 20px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
}
.title-input { font-size: 18px; font-weight: 700; border: 1px solid transparent; background: transparent; padding: 6px 8px; border-radius: 8px; min-width: 120px; max-width: 420px; flex: 1; }
.title-input:hover, .title-input:focus { background: var(--surface); border-color: var(--border); outline: none; }
.topbar-controls { display: flex; gap: 12px; align-items: center; }
.ctl { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.ctl select { min-width: 0; }
.topbar-logo { height: 26px; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; padding: 6px 8px; border-radius: 8px; line-height: 1; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); }

/* stepper */
.stepper {
  display: flex; gap: 4px; padding: 12px 20px 0; overflow-x: auto; scrollbar-width: none; position: sticky; top: var(--topbar); z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.stepper::-webkit-scrollbar { display: none; }
.stepper button {
  border: 0; background: none; padding: 8px 12px 12px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent;
  font-weight: 500; white-space: nowrap; display: flex; align-items: center; gap: 8px;
}
.stepper button:hover { color: var(--text); }
.stepper button.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.step-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.stepper button.active .step-n { background: var(--accent); color: var(--accent-ink); }
.stepper button.done .step-n { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.stepper .extra { font-size: 13px; }
.stepper-sep { width: 1px; background: var(--border); margin: 6px 6px 12px; flex-shrink: 0; }
.count { font-size: 11px; background: var(--surface-2); color: var(--muted); border-radius: 10px; padding: 1px 7px; font-weight: 600; }
.count:empty { display: none; }

main { flex: 1; }
.panel { padding: 22px 28px 80px; max-width: 1400px; }
.panel-title { font-size: 17px; margin: 6px 0 12px; }
.parts-ctas { margin-top: 34px; }
.lead { color: var(--muted); margin: 0 0 16px; max-width: 760px; line-height: 1.55; }
.empty { max-width: 560px; margin: 18vh auto 0; text-align: center; padding: 0 20px; }
.empty h1 { font-size: 30px; margin-bottom: 12px; }
.empty p { color: var(--muted); margin-bottom: 24px; font-size: 15px; line-height: 1.5; }
.next-bar { display: flex; align-items: center; gap: 12px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); }

/* controls */
.btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer;
  font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; min-height: 36px;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; }
select, input[type='number'], input[type='text'], input[type='email'], input[type='password'], textarea {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 10px; min-height: 36px;
}
input[type='number'] { width: 76px; }
textarea { width: 100%; resize: vertical; line-height: 1.5; }
textarea:focus, select:focus, input:focus { outline: 3px solid color-mix(in srgb, var(--accent) 22%, transparent); border-color: var(--accent); }
.row { display: flex; gap: 12px; align-items: center; margin-top: 16px; }
.row.end { justify-content: flex-end; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.gen-bar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; box-shadow: var(--shadow); }
.gen-bar label { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); border-radius: 20px; padding: 5px 11px; font-size: 12px; cursor: pointer; user-select: none; background: var(--surface); font-weight: 500; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-soft-ink); }
.filters { display: flex; gap: 10px; align-items: center; margin: 12px 0; flex-wrap: wrap; }

.target-line { margin: -8px 2px 14px; }
.target-line a { word-break: break-all; }

/* overview + autopilot */
.hero-card { background: linear-gradient(135deg, var(--accent-soft), var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr auto; gap: 18px 28px; align-items: center; }
.hero-card h2 { font-size: 20px; margin-bottom: 6px; }
.hero-card p { margin: 0; max-width: 620px; line-height: 1.55; }
.auto-form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.auto-form label { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.auto-steps { grid-column: 1 / -1; margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.auto-steps li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.auto-steps li .st { width: 18px; text-align: center; }
.auto-steps li.run { border-color: var(--accent); }
.auto-steps li.done .st { color: var(--ok); }
.auto-steps li.err { border-color: var(--danger); color: var(--danger); }
.step-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.step-card { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; cursor: pointer; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.step-card:hover { border-color: var(--accent); }
.step-card .sc-head { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.step-card .sc-val { font-size: 13px; color: var(--muted); line-height: 1.45; }
.step-card.done .step-n { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.step-card.next { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }

/* settings */
.settings-card { width: min(520px, 100%); }
.setting { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--border); }
.setting:last-child { border-bottom: 0; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 3px; gap: 2px; flex-shrink: 0; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }

/* funnel */
.funnel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 8px; }
.funnel-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; border-top: 3px solid var(--c); cursor: pointer; }
.funnel-step.on { background: var(--accent-soft); }
.funnel-step .n { font-size: 22px; font-weight: 700; }
.funnel-step .lbl { font-weight: 600; font-size: 12px; }

/* stage tags */
.stage { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 4px; padding: 1px 6px; color: #fff; background: var(--c); white-space: nowrap; }
.tag { display: inline-block; font-size: 11px; border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; color: var(--muted); white-space: nowrap; }

/* hooks */
.stage-group { margin-bottom: 20px; }
.stage-group h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.hook { display: grid; grid-template-columns: 28px 52px 1fr auto; gap: 10px; align-items: start; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 6px; }
.hook .id { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); padding-top: 2px; }
.hook .text { font-size: 15px; font-weight: 500; line-height: 1.4; outline: none; border-radius: 4px; }
.hook .text:focus { background: var(--surface-2); }
.hook .meta { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.hook .meta b { color: var(--text); font-weight: 600; }
.hook .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.star { background: none; border: 0; font-size: 18px; cursor: pointer; color: var(--border); padding: 0; line-height: 1; }
.star.on { color: #f59f00; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 2px 4px; }
.icon-btn:hover { color: var(--danger); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; gap: 8px; align-items: start; margin-bottom: 10px; }
.card h4 { font-size: 15px; line-height: 1.3; }
.card .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.beats { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.beats li { line-height: 1.45; }
.beats .v { display: block; font-size: 12px; color: var(--muted); font-style: italic; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 13px; line-height: 1.45; }
.kv dt { color: var(--muted); font-size: 12px; }
.kv dd { margin: 0; }
.cta-text { font-size: 15px; font-weight: 500; line-height: 1.45; margin-bottom: 12px; }

/* assemble */
.assemble-pick { display: grid; grid-template-columns: 1fr 1.4fr 1.4fr auto; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.pick { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto; }
.pick label { display: flex; gap: 6px; align-items: start; font-size: 13px; line-height: 1.35; }
.assemble-go { text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; min-width: 140px; }
.big-number { font-size: 36px; font-weight: 800; color: var(--accent); }
.ads-layout { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table.ads { width: 100%; border-collapse: collapse; font-size: 13px; }
table.ads th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
table.ads td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.4; }
table.ads tr { cursor: pointer; }
table.ads tr:hover td { background: var(--surface-2); }
table.ads tr.sel td { background: var(--accent-soft); }
table.ads td.mono { font-family: ui-monospace, monospace; font-size: 11px; white-space: nowrap; }
table.ads td.clip { max-width: 280px; }
.ok { color: var(--ok); }

/* meta preview */
.preview { position: sticky; top: 130px; }
.fb { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.fb-head { display: flex; gap: 8px; align-items: center; padding: 10px 12px; }
.fb-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); }
.fb-name { font-weight: 600; font-size: 13px; }
.fb-sp { font-size: 11px; color: var(--muted); }
.fb-text { padding: 0 12px 10px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.fb-text .more { color: var(--muted); }
.fb-creative { aspect-ratio: 4 / 5; background: linear-gradient(160deg, #132b4c, #0b1f3a); color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 18px; }
.fb-creative .ost { font-size: 22px; font-weight: 800; line-height: 1.15; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.fb-creative .vis { font-size: 12px; opacity: 0.7; font-style: italic; }
.fb-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-2); }
.fb-foot .h { font-weight: 700; font-size: 14px; }
.fb-foot .d { font-size: 12px; color: var(--muted); }
.fb-btn { background: var(--border); border-radius: 6px; padding: 7px 12px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.char { font-size: 11px; color: var(--muted); margin-top: 8px; }
.char .over { color: var(--danger); font-weight: 600; }

/* machine / brand */
.mm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-bottom: 20px; }
.mm-node .prio { font-size: 11px; font-weight: 700; color: var(--accent); }
.mm-node ul, .list { margin: 8px 0 0; padding-left: 18px; line-height: 1.5; font-size: 13px; }
.mm-node li input { margin-right: 6px; }
.section-title { margin: 24px 0 10px; font-size: 16px; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-list span { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 4px 10px; font-size: 13px; }

/* status */
.busy { position: fixed; bottom: max(20px, env(safe-area-inset-bottom)); right: 20px; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; display: flex; gap: 10px; align-items: center; z-index: 50; font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border); padding: 10px 16px; border-radius: 10px; z-index: 50; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); max-width: 600px; }
.toast.err { border-color: var(--danger); color: var(--danger); }
.placeholder { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); }



/* brief Q&A */
.brief-head { display: flex; gap: 24px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 8px; }
.brief-head .lead { margin-bottom: 10px; }
.brief-tools { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.brief-tools label { display: flex; gap: 6px; align-items: center; }
.progress { height: 6px; background: var(--surface-2); border-radius: 3px; max-width: 760px; overflow: hidden; margin-bottom: 6px; }
.progress div { height: 100%; background: var(--accent); width: 0; transition: width 0.3s; }
.qa { max-width: 860px; }
.qa-group { margin-top: 28px; }
.qa-group h2 { font-size: 18px; margin-bottom: 4px; }
.qa-group > p { margin: 0 0 14px; line-height: 1.5; }
.qa-item { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; }
.qa-num { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--muted); }
.qa-item.answered .qa-num { background: var(--accent); color: var(--accent-ink); }
.qa-q { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.qa-why { color: var(--muted); font-size: 13px; line-height: 1.5; margin-bottom: 10px; }
.qa-body select { min-width: 280px; }
.qa-ex { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; font-size: 13px; line-height: 1.45; }
.qa-ex-text { flex: 1; white-space: pre-line; color: var(--muted); }
.qa-ex-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); padding-top: 2px; white-space: nowrap; }
.small-btn { padding: 2px 8px; font-size: 12px; }

/* step guides */
.guide { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); margin-bottom: 16px; }
.guide summary { cursor: pointer; padding: 12px 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; list-style: none; }
.guide summary::-webkit-details-marker { display: none; }
.guide-icon { width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.guide-toggle { margin-left: auto; }
.guide-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; padding: 0 16px 16px; }
.guide-grid p { margin: 0 0 10px; line-height: 1.55; font-size: 13px; }
.guide-tips { margin: 0; padding-left: 18px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.guide-example { background: var(--surface-2); border-radius: 8px; padding: 12px 14px; font-size: 13px; }
.guide-example .qa-ex-label { display: block; margin-bottom: 8px; }
.guide-example .beats { padding-left: 18px; gap: 6px; }
.ex-hook { font-size: 14px; font-weight: 500; line-height: 1.5; margin-bottom: 10px; }
.ex-hook u { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
@media (max-width: 1000px) { .guide-grid { grid-template-columns: 1fr; } }

/* presets */
.preset-badge { font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent); border-radius: 20px; padding: 3px 10px; white-space: nowrap; }
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; width: min(720px, 100%); max-height: 85vh; overflow-y: auto; padding: 20px 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
.modal-card h2 { font-size: 20px; }
.preset-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.preset-card { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; font: inherit; color: inherit; }
.preset-card:hover { border-color: var(--accent); }
.preset-card h4 { font-size: 15px; margin-bottom: 4px; }
.preset-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.preset-card .tags { margin-top: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.rules-box { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 16px; margin-top: 16px; max-width: 860px; }
.rules-box textarea { font-size: 13px; }

/* policy */
.flags { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.flag { font-size: 12px; line-height: 1.45; padding: 6px 8px; border-radius: 6px; border-left: 3px solid; }
.flag.high { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.flag.medium { border-color: #f08c00; background: color-mix(in srgb, #f08c00 10%, transparent); }
.flag.low { border-color: var(--border); background: var(--surface-2); color: var(--muted); }
.dot-high { color: var(--danger); } .dot-medium { color: #f08c00; } .dot-low { color: var(--muted); }
.ok-tag { color: var(--ok); border-color: var(--ok); }

/* angles */
.ve-grid { display: inline-flex; flex-direction: column; gap: 2px; margin-bottom: 14px; font-size: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.ve-row { display: grid; grid-template-columns: 110px repeat(3, 64px); gap: 4px; align-items: center; }
.ve-head span { color: var(--muted); text-align: center; font-size: 11px; }
.ve-head span:first-child { text-align: left; }
.ve-cell { height: 22px; border-radius: 4px; background: var(--surface-2); display: grid; place-items: center; font-weight: 600; }
.ve-cell.on { background: var(--accent-soft); color: var(--accent); }
.score { display: inline-block; font-weight: 700; padding: 0 6px; border-radius: 4px; margin-right: 4px; }
.score.s0, .score.s1 { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.score.s2 { background: color-mix(in srgb, #f08c00 15%, transparent); color: #c76a00; }
.score.s3 { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }

/* images (7 · Bilder) */
.img-bar label.grow { flex: 1; min-width: 260px; }
.img-bar label.grow input { flex: 1; }
.img-bar select { max-width: 340px; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.img-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.img-card.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.img-head { display: flex; gap: 8px; align-items: center; font-size: 12px; cursor: pointer; }
.img-thumb { background: var(--surface-2); border-radius: 8px; min-height: 180px; display: grid; place-items: center; overflow: hidden; }
.img-thumb img { width: 100%; display: block; }
.img-links { display: flex; gap: 6px; flex-wrap: wrap; }

/* library (Assets) */
.lib-section { margin-bottom: 30px; }
.lib-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.lib-head h2 { font-size: 17px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.swatch { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px; cursor: pointer; color: var(--text); font: inherit; font-size: 12px; }
.swatch span { grid-row: span 2; width: 34px; height: 34px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, 0.1); }
.swatch code { color: var(--muted); font-size: 11px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tiles.receipts { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.tile img, .tile video { width: 100%; max-height: 260px; object-fit: contain; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 50% / 16px 16px; border-radius: 6px; }
.tile.dark img { background: #0b1f3a; }

/* knowledge (Wissen & Fallstudien) */
.k-layout { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 16px; align-items: start; }
.k-list { display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 260px); overflow-y: auto; }
.k-item { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.k-item.open { border-color: var(--accent); background: var(--accent-soft); }
.k-item .check { font-size: 11px; white-space: nowrap; padding-top: 2px; }
.k-title { flex: 1; min-width: 0; }
.k-view { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; position: sticky; top: 130px; max-height: calc(100vh - 160px); overflow-y: auto; }
.k-text { white-space: pre-wrap; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 12px 0 0; }
.k-receipts { display: flex; gap: 6px; overflow-x: auto; margin-top: 12px; }
.k-receipts img { height: 110px; border-radius: 4px; border: 1px solid var(--border); }
#kSearch { min-width: 240px; }
@media (max-width: 1000px) { .k-layout { grid-template-columns: 1fr; } .k-view { position: static; max-height: none; } }


/* ---------- tablet ---------- */
@media (max-width: 1150px) {
  .ads-layout { grid-template-columns: 1fr; }
  .preview { position: static; }
  .assemble-pick { grid-template-columns: 1fr 1fr; }
  .funnel { grid-template-columns: repeat(3, 1fr); }
  .hero-card { grid-template-columns: 1fr; }
  .auto-form { justify-content: flex-start; }
}

/* ---------- phone (iPhone) ---------- */
@media (max-width: 900px) {
  :root { --sidebar: 0px; }
  .only-mobile { display: initial !important; }
  .hide-sm { display: none !important; }
  .sidebar { width: min(86vw, 320px); transform: translateX(-102%); transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: var(--shadow-pop); }
  body.nav-open .sidebar { transform: none; }
  .shell { margin-left: 0; }
  .topbar { padding: 0 8px; padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); padding-top: env(safe-area-inset-top); height: calc(var(--topbar) + env(safe-area-inset-top)); gap: 6px; }
  .topbar .title-input:not(.mobile-title) { display: none; }
  .topbar-logo.only-mobile { display: block !important; height: 24px; }
  .topbar #language { min-height: 36px; padding: 4px 6px; max-width: 120px; }
  .preset-badge { display: none !important; }
  .ctl-label { display: none; }
  .ctl select { max-width: 112px; }
  .mobile-title { display: block !important; width: calc(100% - 32px); max-width: none; margin: 12px 16px 0; font-size: 20px; }
  .stepper { top: calc(var(--topbar) + env(safe-area-inset-top)); padding: 8px 12px 0; }
  .stepper button { padding: 8px 10px 10px; }
  .panel { padding: 16px 16px calc(90px + env(safe-area-inset-bottom)); }
  .gen-bar { padding: 12px; gap: 10px; }
  .gen-bar .muted.small { flex-basis: 100%; }
  .funnel { grid-template-columns: repeat(2, 1fr); }
  .funnel-step .sub { display: none; }
  .hook { grid-template-columns: 26px 1fr auto; }
  .hook .id { display: none; }
  .cards, .mm-grid { grid-template-columns: 1fr; }
  .assemble-pick { grid-template-columns: 1fr; }
  .assemble-go { flex-direction: row; justify-content: space-between; }
  .brief-tools { align-items: stretch; width: 100%; }
  .qa-item { grid-template-columns: 1fr; padding: 14px; }
  .qa-num { display: none; }
  .qa-body select { min-width: 0; width: 100%; }
  .qa-ex { flex-wrap: wrap; }
  .guide-grid { grid-template-columns: 1fr; }
  .img-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  /* Label left, field fills the rest, nothing runs past the card edge. */
  .gen-bar label:not(.check) { flex: 1 1 100%; display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; }
  .gen-bar label:not(.check) > select, .gen-bar label:not(.check) > input { width: 100%; min-width: 0; max-width: none; }
  .gen-bar .chips { flex: 1 1 100%; }
  .gen-bar > .btn { flex: 1 1 auto; }
  .filters select, .filters input[type='text'] { flex: 1 1 140px; min-width: 0; }
  .auto-form label { flex: 1 1 100%; justify-content: space-between; }
  .auto-form label.check { justify-content: flex-start; }
  .auto-form .btn { flex: 1 1 100%; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .swatches { grid-template-columns: repeat(2, 1fr); }
  .k-layout { grid-template-columns: 1fr; }
  .k-list { max-height: none; }
  .k-view { position: static; max-height: none; }
  .setting { flex-direction: column; align-items: stretch; }
  .modal { align-items: end; padding: 0; }
  .modal-card { width: 100%; border-radius: 18px 18px 0 0; max-height: 90dvh; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .step-cards { grid-template-columns: 1fr; }
  .next-bar { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); margin: 24px -16px 0; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); }
  .next-bar .btn.primary { flex: 1; }
  table.ads td.clip { max-width: 180px; }
  /* iOS zooms into inputs under 16 px, and fingers need 44 px. */
  input, select, textarea { font-size: 16px !important; }
  .btn, select, input[type='text'], input[type='number'], input[type='email'], input[type='password'] { min-height: 44px; }
  .busy { left: 16px; right: 16px; }
}
