/* Ads Manager – Gestaltung
   Ruhige Arbeitsfläche in Salbeigrau, dunkelgrüne Navigation,
   Bernstein ausschließlich für Dinge, die Aufmerksamkeit brauchen (Empfehlungen). */

:root {
  --paper: #eef1ec;
  --surface: #ffffff;
  --surface-2: #f6f8f4;
  --ink: #17221f;
  --ink-2: #4b5a55;
  --ink-3: #7b8a84;
  --line: #dbe1d8;
  --forest: #14332c;
  --forest-2: #1d4339;
  --primary: #1e5a4c;
  --primary-ink: #ffffff;
  --amber: #e9a42b;
  --amber-soft: #fbefd6;
  --amber-ink: #6b4300;
  --good: #23784a;
  --good-soft: #e1f1e7;
  --bad: #b3402d;
  --bad-soft: #f8e3df;
  --info: #2f6596;
  --info-soft: #e2ecf6;
  --radius: 10px;
  --radius-s: 6px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1a17;
    --surface: #16231f;
    --surface-2: #1b2a25;
    --ink: #e5ece8;
    --ink-2: #b2c0ba;
    --ink-3: #82938c;
    --line: #2a3b35;
    --forest: #0a1512;
    --forest-2: #15302a;
    --primary: #3d8f78;
    --amber-soft: #3a2c10;
    --amber-ink: #f3c56c;
    --good: #5cc28a;
    --good-soft: #163325;
    --bad: #ef8a77;
    --bad-soft: #3a1c17;
    --info: #86b6e4;
    --info-soft: #172a3c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.07rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: .4em 0; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 4px; font-size: .9em; }
.hidden, [hidden] { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: .86rem; }
.strong { font-weight: 600; color: var(--ink); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.icon { width: 18px; height: 18px; flex: none; }

/* ---------- Grundgerüst ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--forest); color: #cfe0d8; display: flex; flex-direction: column; padding: 1.1rem .8rem; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 700; font-size: 1.05rem; padding: .3rem .5rem 1.2rem; text-decoration: none !important; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--amber); color: var(--forest); display: grid; place-items: center; }
.brand-mark svg { width: 20px; height: 20px; }
.brand.big { font-size: 1.3rem; color: var(--ink); padding: 0 0 .3rem; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a, .sidebar-foot a, .sidebar-foot .linklike { display: flex; align-items: center; gap: .65rem; padding: .55rem .65rem; border-radius: 7px; color: #cfe0d8; font-size: .95rem; text-decoration: none; }
.sidebar nav a:hover, .sidebar-foot a:hover, .sidebar-foot .linklike:hover { background: var(--forest-2); color: #fff; }
.sidebar nav a.active { background: var(--forest-2); color: #fff; box-shadow: inset 3px 0 0 var(--amber); }
.badge-count { margin-left: auto; background: var(--amber); color: var(--forest); font-weight: 700; font-size: .75rem; border-radius: 99px; padding: 0 .5rem; line-height: 1.5rem; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--forest-2); padding-top: .7rem; }
.linklike { background: none; border: 0; width: 100%; font: inherit; cursor: pointer; text-align: left; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: flex-end; gap: 1rem; padding: 1.6rem 2rem .9rem; flex-wrap: wrap; }
.topbar-title { flex: 1; min-width: 200px; }
.crumb { font-size: .85rem; color: var(--ink-3); margin-bottom: .15rem; }
.topbar-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.topbar-actions form { margin: 0; }
.menu-btn { display: none; }
.content { padding: 0 2rem 3rem; display: flex; flex-direction: column; gap: 1.1rem; }

/* ---------- Buttons & Formulare ---------- */
.btn { display: inline-flex; align-items: center; gap: .45rem; font: inherit; font-weight: 600; font-size: .92rem; padding: .5rem .95rem; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.small { padding: .28rem .6rem; font-size: .84rem; }
.btn.wide { width: 100%; justify-content: center; padding: .7rem; }
.btn.icon-only { padding: .35rem; }
.btn[disabled], .btn.busy { opacity: .6; cursor: progress; }
.danger-text { color: var(--bad) !important; }

label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; font-weight: 600; color: var(--ink); }
label small, .hint { font-weight: 400; color: var(--ink-3); font-size: .82rem; }
.opt { font-weight: 400; color: var(--ink-3); font-size: .8rem; }
label { position: relative; }
label > .opt { position: absolute; right: 0; top: .1rem; }
legend .opt { margin-left: .4rem; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: .5rem .65rem; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
input[readonly] { background: var(--surface-2); }
label.check { flex-direction: row; align-items: flex-start; gap: .55rem; font-weight: 500; }
label.check input { width: auto; margin-top: .25rem; }
label.check small { display: block; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .85rem; }
legend { font-weight: 700; font-size: 1rem; padding: 0; margin-bottom: .2rem; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; padding-top: .3rem; }
form.inline { display: inline; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem 2.2rem; }
.form-grid .form-actions { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 1rem; }

/* ---------- Flächen ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.narrow { max-width: 560px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.3rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel:not(.flush) > .panel-head { padding: 0 0 .8rem; margin-bottom: .8rem; }
.empty { text-align: left; }
.empty.pad, .pad { padding: 1.3rem; }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 1.1rem; align-items: start; }
.hint { margin: 0; }

.flash { display: flex; align-items: flex-start; gap: .8rem; margin: 0 2rem 1rem; padding: .75rem 1rem; border-radius: var(--radius-s); border: 1px solid; font-size: .93rem; }
.content .flash, .auth-box .flash { margin: 0; }
.flash.success { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 30%, transparent); color: var(--good); }
.flash.error { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); color: var(--bad); }
.flash.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--info); }
.flash-x { margin-left: auto; background: none; border: 0; font-size: 1.2rem; line-height: 1; cursor: pointer; color: inherit; }

/* ---------- Kennzahlen ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kpi { background: var(--surface); padding: .9rem 1.1rem; display: flex; flex-direction: column; gap: .1rem; color: var(--ink); text-decoration: none !important; }
.kpi-label { font-size: .84rem; color: var(--ink-2); }
.kpi-value { font-size: 1.45rem; white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi-value.good { color: var(--good); }
.kpi-value.bad { color: var(--bad); }
.kpi-attn.has { background: var(--amber-soft); }
.kpi-attn.has .kpi-value { color: var(--amber-ink); }
.kpi-attn.has .delta { color: var(--amber-ink); font-weight: 600; }
.delta { font-size: .8rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }

.period { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 3px; flex-wrap: wrap; }
.seg a { padding: .3rem .7rem; border-radius: 4px; color: var(--ink-2); font-size: .88rem; text-decoration: none; }
.seg a:hover { color: var(--ink); }
.seg a.on { background: var(--forest); color: #fff; }
.seg .n { opacity: .65; font-variant-numeric: tabular-nums; margin-left: .2rem; }
.custom-range { display: flex; gap: .4rem; align-items: center; }
.custom-range input { width: auto; padding: .32rem .5rem; font-size: .88rem; }
.toolbar { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }
.toolbar select { width: auto; min-width: 200px; }

.chart-wrap { position: relative; height: 260px; }

/* ---------- Tabellen ---------- */
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: .8rem; padding: .6rem .8rem; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
table.data td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data .r { text-align: right; }
table.data td.num { white-space: nowrap; }
td.good { color: var(--good); font-weight: 600; }
td.bad { color: var(--bad); font-weight: 600; }
td.warn { color: var(--amber-ink); font-weight: 700; }
tr.dim td { color: var(--ink-3); }
table.data td .small.muted { white-space: nowrap; }
tr.dim .strong { color: var(--ink-2); }
.name-cell { display: flex; align-items: center; gap: .7rem; min-width: 240px; }
.name-cell .sub { font-size: .8rem; color: var(--ink-3); }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); flex: none; }
.st { font-weight: 600; }
.st.ok { color: var(--good); }
.st.bad { color: var(--bad); }
.st.info { color: var(--info); }
.st.muted { color: var(--ink-3); }

.pill { display: inline-block; font-size: .76rem; font-weight: 600; padding: .05rem .5rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); margin-left: .35rem; white-space: nowrap; vertical-align: middle; text-decoration: none !important; }
.pill.attn { background: var(--amber); border-color: var(--amber); color: var(--forest); }
.pill.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.pill.good { background: var(--good-soft); border-color: transparent; color: var(--good); }
.pill.muted { color: var(--ink-3); }

/* Schalter */
.switch { width: 38px; height: 22px; border-radius: 99px; border: 0; background: var(--line); position: relative; cursor: pointer; padding: 0; transition: background .15s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch.on { background: var(--good); }
.switch.on span { transform: translateX(16px); }

.budget-form { display: flex; gap: .3rem; align-items: center; }
.budget-form input { width: 92px; padding: .28rem .45rem; text-align: right; font-variant-numeric: tabular-nums; }

/* Pacing */
.pacing { min-width: 150px; }
.pacing .bar { height: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; position: relative; overflow: visible; }
.pacing .bar span { display: block; height: 100%; border-radius: 99px; background: var(--good); }
.pacing.over .bar span { background: var(--bad); }
.pacing.under .bar span { background: var(--amber); }
.pacing .bar i { position: absolute; top: -3px; width: 2px; height: 10px; background: var(--ink-2); }
.pacing small { color: var(--ink-3); font-size: .78rem; }

/* Tabs */
.tabs-head { padding-top: .4rem; padding-bottom: 0; align-items: flex-end; }
.tabs { display: flex; gap: .2rem; }
.tabs a { padding: .65rem .9rem; color: var(--ink-2); border-bottom: 2px solid transparent; font-weight: 600; font-size: .92rem; text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--amber); }
.filters { display: flex; gap: .6rem; align-items: center; padding-bottom: .6rem; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: .3rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: .15rem .65rem; font-size: .82rem; color: var(--ink); }

.client-meta { display: flex; gap: 1.2rem; flex-wrap: wrap; color: var(--ink-3); font-size: .87rem; margin-top: -.6rem; }
.sync-form { display: flex; gap: .35rem; }
.sync-form select { width: auto; padding: .45rem; }
.inline-cta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .2rem .2rem; }

/* ---------- Empfehlungen (das eine auffällige Element) ---------- */
.recs-strip { background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 55%, transparent); border-left: 5px solid var(--amber); border-radius: var(--radius); padding: .9rem 1.1rem; display: flex; flex-direction: column; gap: .6rem; }
.recs-head { display: flex; justify-content: space-between; align-items: baseline; }
.recs-head h2 { color: var(--amber-ink); }
.rec-list { display: flex; flex-direction: column; gap: .7rem; }
.rec { display: flex; gap: 1.2rem; justify-content: space-between; align-items: center; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--ink-3); border-radius: var(--radius); padding: 1rem 1.2rem; }
.rec.k-pause { border-left-color: var(--bad); }
.rec.k-up { border-left-color: var(--good); }
.rec.k-down { border-left-color: var(--amber); }
.rec.k-info { border-left-color: var(--info); }
.rec.compact { padding: .6rem .9rem; border-left-width: 1px; }
.rec.compact p { font-size: .85rem; color: var(--ink-2); margin: .15rem 0 0; }
.rec-top { display: flex; gap: .8rem; align-items: baseline; }
.rec h3 { margin-top: .15rem; font-size: 1.05rem; }
.rec-object { font-weight: 600; color: var(--ink-2); font-size: .9rem; }
.rec-body p { max-width: 75ch; }
.rec-actions { display: flex; gap: .4rem; flex: none; }
.rec-actions form { margin: 0; }

.rule-list { list-style: none; margin: 0; padding: 0; }
.rule-list li { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; padding: .9rem 1.3rem; border-bottom: 1px solid var(--line); }
.rule-list li:last-child { border-bottom: 0; }
.rule-list li.dim { opacity: .55; }
.rule-list .pill:first-of-type { margin-left: .5rem; }
.rule-list p { margin: .25rem 0 0; }
.rule-list li > .nowrap { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; max-width: 260px; }

.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); border-radius: var(--radius); padding: 1rem 1.3rem; background: var(--surface); }
.danger-zone p { margin: .2rem 0 0; }

.onboarding .steps, .auth-box .steps { margin: .8rem 0 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: .7rem; max-width: 72ch; }

/* ---------- Kampagnen-Assistent ---------- */
.client-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; margin-top: .9rem; }
.pick { display: block; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-s); font-weight: 600; color: var(--ink); background: var(--surface-2); }
.pick:hover { border-color: var(--primary); text-decoration: none; }

.wizard-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 0; counter-reset: s; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.wizard-steps li { flex: 1; padding: .7rem 1rem; font-size: .9rem; font-weight: 600; color: var(--ink-3); counter-increment: s; border-right: 1px solid var(--line); }
.wizard-steps li:last-child { border-right: 0; }
.wizard-steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid currentColor; font-size: .78rem; margin-right: .5rem; }
.wizard-steps li.on { color: var(--ink); box-shadow: inset 0 -3px 0 var(--amber); }
.wizard-steps li.done { color: var(--good); }
.wizard-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.1rem; margin-top: 1.1rem; align-items: start; }
.wizard-main { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.step { display: none; flex-direction: column; gap: 1rem; }
.step.on { display: flex; }
.wizard-nav { display: flex; justify-content: space-between; margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.wizard-nav [data-next], .wizard-nav [data-submit] { margin-left: auto; }
.objectives { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.objective { flex-direction: row; gap: .7rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-s); cursor: pointer; align-items: flex-start; font-weight: 400; }
.objective input { width: auto; margin-top: .3rem; }
.objective strong { display: block; }
.objective small { color: var(--ink-3); }
.objective:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--surface)); box-shadow: inset 0 0 0 1px var(--primary); }
.budget-block { border-top: 1px solid var(--line); padding-top: 1rem; }
.big-check { padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface-2); }

.interest-box { display: flex; flex-direction: column; gap: .4rem; }
.interest-search { position: relative; }
.interest-results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); list-style: none; margin: 0; padding: .3rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); box-shadow: 0 8px 24px rgba(20, 51, 44, .14); max-height: 280px; overflow: auto; }
.interest-results li { padding: .45rem .6rem; border-radius: 4px; cursor: pointer; font-size: .9rem; }
.interest-results li:hover, .interest-results li.active { background: var(--surface-2); }
.interest-results small { display: block; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips .chip button { background: none; border: 0; cursor: pointer; color: var(--ink-3); font-size: 1rem; line-height: 1; padding: 0 0 0 .2rem; }

.summary { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.2rem; margin: 0; }
.summary dt { color: var(--ink-3); font-size: .9rem; }
.summary dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.preview { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.preview-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: .88rem; }
.pv-head { display: flex; gap: .55rem; align-items: center; padding: .7rem .8rem; }
.pv-head small { display: block; color: var(--ink-3); font-size: .75rem; }
.pv-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--forest); flex: none; }
.pv-text { padding: 0 .8rem .6rem; margin: 0; white-space: pre-wrap; color: var(--ink); }
.pv-img { aspect-ratio: 1 / 1; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-3); background-size: cover; background-position: center; }
.pv-foot { display: flex; gap: .6rem; justify-content: space-between; align-items: center; background: var(--surface-2); padding: .6rem .8rem; }
.pv-foot small { display: block; color: var(--ink-3); font-size: .74rem; }
.pv-foot strong { display: block; }
.pv-cta { background: var(--line); padding: .35rem .7rem; border-radius: 5px; font-weight: 600; white-space: nowrap; font-size: .82rem; }

/* ---------- Login / Installation ---------- */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; background: var(--forest); }
.auth-box { background: var(--surface); border-radius: 14px; padding: 2rem; width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: .9rem; }
.auth-box.wide { max-width: 620px; }
.auth-box .brand-mark { background: var(--forest); color: var(--amber); }
.checks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .8rem; font-size: .88rem; }
.checks .ok { color: var(--good); }
.checks .bad { color: var(--bad); font-weight: 700; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .split, .wizard-body { grid-template-columns: 1fr; }
  .preview { position: static; max-width: 380px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .menu-btn { display: inline-block; background: none; border: 1px solid var(--line); border-radius: var(--radius-s); font-size: 1.1rem; padding: .25rem .6rem; color: var(--ink); cursor: pointer; align-self: center; }
  .topbar { padding: 1rem; }
  .content { padding: 0 1rem 2rem; }
  .flash { margin: 0 1rem 1rem; }
  .row2, .row3, .objectives { grid-template-columns: 1fr; }
  .rec { flex-direction: column; align-items: stretch; }
  .wizard-steps li { font-size: 0; padding: .6rem; text-align: center; }
  .wizard-steps li::before { font-size: .78rem; margin: 0; }
  .period { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- KI-Analyse ---------- */
.mt { margin-top: .8rem; }
.row-actions { display: flex; gap: .3rem; justify-content: flex-end; }
.row-actions form { margin: 0; }
.row-actions .icon { width: 15px; height: 15px; }
.btn.big { padding: .8rem 1.3rem; font-size: 1rem; }
.start-analysis { display: flex; gap: 2rem; align-items: center; justify-content: space-between; }
.start-analysis p { max-width: 75ch; }
.pick-campaign { display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; }
.pick-campaign label { flex: 1; min-width: 260px; }

.analysis-progress { display: flex; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--amber); border-radius: var(--radius); padding: 1rem 1.2rem; }
.analysis-progress p { margin: .1rem 0 0; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--amber); animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.verdict { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.6rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.6rem; }
.score { --c: var(--good); width: 118px; height: 118px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--surface) 80%, transparent 81%), conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0); }
.score.mid { --c: var(--amber); }
.score.bad { --c: var(--bad); }
.score span { font-size: 2.4rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.score small { color: var(--ink-3); font-size: .78rem; }
.verdict-text h2 { font-size: 1.3rem; margin-bottom: .3rem; }
.verdict-text p { max-width: 78ch; }
.verdict-stats { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .6rem 1.4rem; border-left: 1px solid var(--line); padding-left: 1.4rem; }
.verdict-stats dt { font-size: .78rem; color: var(--ink-3); }
.verdict-stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.findings { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
ul.plain { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
ul.plain li { padding-left: 1.3rem; position: relative; }
ul.plain li::before { position: absolute; left: 0; top: 0; font-weight: 800; }
.good-list li::before { content: "+"; color: var(--good); }
.bad-list li::before { content: "–"; color: var(--bad); }

.section-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: .7rem; flex-wrap: wrap; }
.suggestions { display: flex; flex-direction: column; gap: .7rem; }
.suggestions .section-head { margin-bottom: 0; }
.sugg { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; }
.sugg.done { opacity: .62; grid-template-columns: 1fr; }
.sugg h3 { font-size: 1.08rem; margin: .35rem 0 .2rem; }
.sugg p { max-width: 80ch; }
.sugg-tags { display: flex; gap: .35rem; flex-wrap: wrap; }
.tag { font-size: .75rem; font-weight: 600; padding: .05rem .5rem; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.prio-hoch .tag.prio { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.prio-mittel .tag.prio { background: var(--amber-soft); color: var(--amber-ink); border-color: transparent; }
.tag.auto { background: var(--good-soft); color: var(--good); border-color: transparent; }
.impact { font-size: .9rem; color: var(--ink-2); }
.sugg-actions { display: flex; flex-direction: column; gap: .45rem; justify-content: center; border-left: 1px solid var(--line); padding-left: 1.2rem; }
.sugg-actions form { margin: 0; }
.sugg-actions .what { margin: 0 0 .2rem; color: var(--ink-2); }
.sugg-result { font-size: .88rem; font-weight: 600; margin-top: .5rem; }
.sugg-result.applied { color: var(--good); }
.sugg-result.failed { color: var(--bad); }
.variant { margin-top: .7rem; border: 1px dashed var(--line); border-radius: var(--radius-s); padding: .7rem .9rem; background: var(--surface-2); }
.variant-text { white-space: normal; margin: .3rem 0; }
.variant-head { font-weight: 700; margin: .2rem 0 0; }
details.manual { margin-top: .6rem; border-top: 1px solid var(--line); padding-top: .5rem; }
details summary { cursor: pointer; font-weight: 600; color: var(--primary); }

.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .9rem; }
.ad-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.ad-media { position: relative; aspect-ratio: 1 / 1; background: var(--surface-2); }
.ad-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-format { position: absolute; left: .5rem; bottom: .5rem; background: rgba(20, 51, 44, .82); color: #fff; font-size: .74rem; padding: .1rem .45rem; border-radius: 4px; }
.rating { position: absolute; right: .5rem; top: .5rem; font-size: .76rem; font-weight: 700; padding: .12rem .55rem; border-radius: 99px; }
.rating.stark { background: var(--good); color: #fff; }
.rating.solide { background: var(--amber); color: var(--forest); }
.rating.schwach { background: var(--bad); color: #fff; }
.ad-body { padding: .8rem .9rem 1rem; display: flex; flex-direction: column; gap: .35rem; }
.ad-body h3 { font-size: .95rem; overflow-wrap: anywhere; }
.ad-body p { margin: 0; }
dl.mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; margin: .2rem 0; }
dl.mini dt { font-size: .7rem; color: var(--ink-3); }
dl.mini dd { margin: 0; font-size: .82rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.retention { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; height: 54px; align-items: end; }
.retention div { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; text-align: center; }
.retention span { background: var(--primary); border-radius: 3px 3px 0 0; min-height: 2px; }
.retention small { font-size: .68rem; color: var(--ink-3); }

.history { list-style: none; margin: 0; padding: 0; }
.history li a { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; padding: .75rem 1.3rem; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.history li:last-child a { border-bottom: 0; }
.history li a:hover { background: var(--surface-2); }
.score-chip { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-variant-numeric: tabular-nums; border: 3px solid; }
.score-chip.sgood { border-color: var(--good); color: var(--good); }
.score-chip.smid { border-color: var(--amber); color: var(--amber-ink); }
.score-chip.sbad { border-color: var(--bad); color: var(--bad); }

@media (max-width: 1000px) {
  .verdict { grid-template-columns: auto 1fr; }
  .verdict-stats { grid-column: 1 / -1; border-left: 0; padding-left: 0; grid-template-columns: repeat(4, 1fr); }
  .sugg { grid-template-columns: 1fr; }
  .sugg-actions { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: .8rem; }
  .start-analysis { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 700px) {
  .findings { grid-template-columns: 1fr; }
  .verdict { grid-template-columns: 1fr; }
  .verdict-stats { grid-template-columns: 1fr 1fr; }
}

/* Ergebnisse */
.res-cell { line-height: 1.25; }
.res-label { display: block; font-size: .72rem; color: var(--ink-3); font-weight: 400; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; margin-left: auto; }
.flash.resync { align-items: center; justify-content: space-between; flex-wrap: wrap; }
.flash.resync span { flex: 1; min-width: 260px; }
.inline-edit { font-size: .8rem; margin-bottom: .45rem; }
.inline-edit input { padding: .35rem .5rem; text-align: right; font-variant-numeric: tabular-nums; }
.variant label { margin-top: .5rem; font-size: .82rem; }
.variant textarea, .variant input { background: var(--surface); }
.inline-check { margin: 0 0 .5rem; font-weight: 500; }
.push-right { margin-left: auto; }
.sugg-actions .ask { margin: .1rem 0 .1rem; font-weight: 600; color: var(--ink); }
.sugg-actions form .btn + .btn { margin-top: .4rem; }
.activate-created { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-top: .5rem; padding: .55rem .8rem; border-radius: var(--radius-s); background: var(--amber-soft); color: var(--amber-ink); font-size: .88rem; font-weight: 600; }
.sugg.done:has(.activate-created) { opacity: 1; }
