/* BLONE — Grundlagen und Rahmen (aus docs/prototyp/blone-prototyp.html, Bedienung nach docs/bedien-grammatik.md Teil 6).
   Schrift, Radien, Logo und Signalfarben nach der Corporate Identity (docs/ci/blone-ci.html, eingebaut mit Slice UI6).
   Flächen bewusst NEUTRAL grau statt der blau getönten Töne aus Blatt 8 (Vorgabe 11.11.: nicht in Blau getaucht, Blau nur
   als Akzent für Hauptaktion und Auswahl), in zwei Darstellungen: Dunkel und Hell (Umschalter oben rechts, thema.js).
   Seiten nehmen Farben nur über Tokens, dann stimmen beide Darstellungen von selbst.
   Seiten nutzen diese Bausteine (auch die geteilten Prototyp-Bausteine am Ende: Kennzahlen, Kurve, Ziele, Pipeline,
   Maßnahmen, Bildkachel, Produktzelle, Konto, Listing-Feldblock, Auflage); nur seitenspezifisches bringt eine Seite über
   ctx.stil(id, css) mit. */
/* Fira vom eigenen Server (erzeugt von v3/ci_dateien.py, kein Google Fonts) */
@font-face { font-family: "Fira Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url(/statisch/fira-sans-400.woff) format("woff"); }
@font-face { font-family: "Fira Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url(/statisch/fira-sans-500.woff) format("woff"); }
@font-face { font-family: "Fira Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url(/statisch/fira-sans-600.woff) format("woff"); }
@font-face { font-family: "Fira Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url(/statisch/fira-sans-700.woff) format("woff"); }
@font-face { font-family: "Fira Sans Condensed"; font-weight: 500; font-style: normal; font-display: swap; src: url(/statisch/fira-sans-condensed-500.woff) format("woff"); }
@font-face { font-family: "Fira Sans Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url(/statisch/fira-sans-condensed-600.woff) format("woff"); }
@font-face { font-family: "Fira Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url(/statisch/fira-mono-400.woff) format("woff"); }
@font-face { font-family: "Fira Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url(/statisch/fira-mono-500.woff) format("woff"); }
:root {            /* Dunkel (auch ohne Skript): neutrales Grau, Blau nur als Signal */
  color-scheme: dark;
  --nav: #171717; --grund: #212121; --flaeche: #2a2a2a; --feld: #2f2f2f; --hover: #3a3a3a;
  --linie: rgba(255,255,255,.10); --linie2: rgba(255,255,255,.18);
  --text: #ececec; --leise: #b4b4b4; --still: #8f8f8f;
  --akzent: #4D7BFF; --akzent-text: #0A0F1C; --akzent-bg: rgba(77,123,255,.16);
  --gruen: #4CC38A; --gruen-bg: rgba(76,195,138,.13); --gelb: #E8B23A; --gelb-bg: rgba(232,178,58,.13);
  --rot: #F07575; --rot-bg: rgba(240,117,117,.12);
  --schleier: rgba(255,255,255,.035); --gitter: rgba(255,255,255,.07); --abdunkeln: rgba(0,0,0,.55); --schatten: rgba(0,0,0,.45); --kurve-flaeche: rgba(77,123,255,.09);
  --reihe-1: #4D7BFF; --reihe-2: #D95926; --reihe-3: #199E70; --reihe-4: #9085E9;   /* Reihen einer Kurve in fester Folge (UI9): Blau, Orange, Grün, Violett */
  --schrift: "Fira Sans", "Helvetica Neue", Arial, sans-serif;
  --schrift-schmal: "Fira Sans Condensed", "Arial Narrow", sans-serif;
  --mono: "Fira Mono", ui-monospace, Menlo, monospace;
  --r: 6px; --r-gross: 10px;
}
:root[data-thema="hell"] {            /* Hell: weiße Karten auf hellgrauem Grund, BLONE-Blau #1F4FFF als Signal */
  color-scheme: light;
  --nav: #FAFAFB; --grund: #F3F3F5; --flaeche: #FFFFFF; --feld: #ECECEF; --hover: #E0E0E4;
  --linie: rgba(0,0,0,.09); --linie2: rgba(0,0,0,.17);
  --text: #18181B; --leise: #52525B; --still: #6B6B74;
  --akzent: #1F4FFF; --akzent-text: #FFFFFF; --akzent-bg: rgba(31,79,255,.10);
  --gruen: #15803D; --gruen-bg: rgba(30,158,90,.14); --gelb: #946200; --gelb-bg: rgba(217,154,0,.17);
  --rot: #C52A2A; --rot-bg: rgba(217,54,54,.11);
  --schleier: rgba(0,0,0,.035); --gitter: rgba(0,0,0,.08); --abdunkeln: rgba(24,24,27,.38); --schatten: rgba(0,0,0,.16); --kurve-flaeche: rgba(31,79,255,.07);
  --reihe-1: #1F4FFF; --reihe-2: #EB6834; --reihe-3: #14996A; --reihe-4: #6250D6;
}
/* Hell: Eingabefelder weiß mit Rand (auf hellgrauem Grund trüge die Feldfarbe allein nicht) */
:root[data-thema="hell"] input, :root[data-thema="hell"] textarea, :root[data-thema="hell"] select { background: var(--flaeche); border-color: var(--linie2); }
html, body { height: 100%; margin: 0; }
body { background: var(--grund); color: var(--text); font-family: var(--schrift); font-size: 14px; line-height: 1.5; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: inherit; padding: 0; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
input, textarea, select { font: inherit; color: var(--text); background: var(--feld); border: 1px solid transparent; border-radius: var(--r); padding: 8px 11px; width: 100%; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--still); }
/* CI Blatt 5: Kennzahlen, ASINs, Preise in Fira Mono (steht von selbst untereinander); Beschriftungen und Tabellenköpfe in
   Fira Sans Condensed, Versalien mit 8 % Laufweite. Mono läuft breit, deshalb etwas kleiner und enger gesetzt. */
.zahl, .mono { font-family: var(--mono); font-size: .93em; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.label { font-family: var(--schrift-schmal); font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--still); }

/* ---------- Rahmen: oben Marke · Land, links Navigation, Mitte, rechts Chat ---------- */
.app { display: grid; height: 100%; grid-template-columns: 216px minmax(0,1fr) var(--chat-breite, 340px); grid-template-rows: 52px minmax(0,1fr);
  grid-template-areas: "oben oben oben" "nav mitte chat"; }   /* --chat-breite: vom Betrachter gezogene Breite des Chats (UI7, chat.js) */
.app.chat-zu, .app.chat-frei { grid-template-columns: 216px minmax(0,1fr) 0; }   /* chat-frei: Chat als Fenster gelöst, die Spalte gibt ihren Platz frei */
.app.chat-zu .chat { display: none; }
.oben { grid-area: oben; background: var(--nav); border-bottom: 1px solid var(--linie); display: flex; align-items: center; gap: 10px; padding: 0 12px; min-width: 0; }
.logo { display: flex; align-items: center; width: 192px; flex: none; padding-left: 8px; }   /* Signet aus docs/ci/logo, nie nachgezeichnet */
.logo img { display: block; height: 26px; width: auto; }
.logo img.hell, :root[data-thema="hell"] .logo img.dunkel { display: none; }   /* je Darstellung die passende Logo-Datei */
:root[data-thema="hell"] .logo img.hell { display: block; }
.rahmen-knopf { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 8px; border-radius: var(--r); background: var(--feld); min-width: 0; }
.rahmen-knopf:hover { background: var(--hover); }
.rahmen-knopf b { font-weight: 600; white-space: nowrap; flex: none; }
.rahmen-knopf > span:not(.farbe):not(.chip) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rahmen-knopf > svg { flex: none; color: var(--still); }
.rahmen-knopf.fest { background: none; color: var(--leise); cursor: default; padding-left: 4px; }
.rahmen-knopf.fest:hover { background: none; }
.rahmen-konto { color: var(--leise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; max-width: 220px; }
.rahmen-trenn { color: var(--still); flex: none; margin: 0 -2px; }
.farbe { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.oben-rechts { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: none; }
/* Suche oben in der Mitte (R12, UI12): ein Feld für das ganze Konto, Treffer als Liste darunter. Unter 761 px ein Knopf. */
.suche { position: relative; flex: 0 1 460px; min-width: 0; margin: 0 auto; }
.suche + .oben-rechts { margin-left: 0; }
.suche .suche-auf { display: none; }
.suche-feld { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 10px; border-radius: var(--r); background: var(--feld); border: 1px solid transparent; color: var(--still); min-width: 0; }
.suche-feld:hover { background: var(--hover); }
.suche-feld:focus-within { background: var(--feld); border-color: var(--akzent); }
.suche-feld > svg { flex: none; }
.suche-feld input { flex: 1 1 auto; min-width: 0; background: none; border: 0; padding: 0; height: 100%; outline: none; text-overflow: ellipsis; }
.suche-feld kbd { flex: none; font-family: var(--mono); font-size: 11px; line-height: 1; color: var(--still); border: 1px solid var(--linie2); border-radius: 4px; padding: 3px 6px; }
.suche-feld:focus-within kbd, .suche .suche-zu { display: none; }
.suche-liste { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; right: 0; min-width: min(360px, calc(100vw - 24px)); max-height: min(70vh, 520px); overflow: auto;
  background: var(--flaeche); border: 1px solid var(--linie2); border-radius: var(--r-gross); padding: 6px; box-shadow: 0 14px 36px var(--schatten); }
.suche-liste .gruppe { font-size: 11.5px; color: var(--still); padding: 8px 10px 4px; }
.suche-liste button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px; border-radius: 8px; min-width: 0; }
.suche-liste button:hover, .suche-liste button.an { background: var(--feld); }
.such-icon { width: 28px; height: 28px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--leise); }
.such-bild { width: 28px; height: 28px; flex: none; object-fit: contain; border-radius: 4px; background: #fff; }
.such-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.such-text b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.such-text small { font-size: 12px; color: var(--still); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.such-fuss { display: flex; align-items: center; gap: 8px; padding: 8px 10px; color: var(--still); font-size: 12.5px; }
button.avatar:hover { filter: brightness(1.15); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #3f5161; color: #dfe9f2; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.nav { grid-area: nav; background: var(--nav); display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; min-width: 0; overflow: hidden auto; scrollbar-width: none; }
.nav-punkt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); color: var(--leise); white-space: nowrap; width: 100%; }
.nav-punkt:hover { background: var(--feld); color: var(--text); text-decoration: none; }
.nav-punkt.aktiv { background: var(--feld); color: var(--text); }
.nav-punkt .zaehler { margin-left: auto; font-size: 11.5px; color: var(--still); background: var(--grund); padding: 0 7px; border-radius: 9px; }
.nav-punkt .zusatz { margin-left: auto; font-size: 11px; color: var(--still); }
/* Unterpunkte (R9, UI2): unter dem aktiven Hauptpunkt, eingerückt an einer Linie auf Höhe des Icons; markiert ist der Unterpunkt */
.nav-punkt.offen { color: var(--text); }
.nav-unter { display: flex; flex-direction: column; gap: 1px; margin: 0 0 6px 18px; padding-left: 9px; border-left: 1px solid var(--linie); }
.nav-unterpunkt { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 8px; color: var(--leise); font-size: 13px; white-space: nowrap; min-width: 0; }
.nav-unterpunkt .txt { overflow: hidden; text-overflow: ellipsis; }
.nav-unterpunkt:hover { background: var(--feld); color: var(--text); text-decoration: none; }
.nav-unterpunkt.aktiv { background: var(--feld); color: var(--text); }
.nav-unterpunkt .zaehler { margin-left: auto; font-size: 11.5px; color: var(--still); background: var(--grund); padding: 0 7px; border-radius: 9px; }
.reiter.unternav { display: none; }     /* dieselben Unterpunkte als Zeile über der Seite, nur bei schmaler Navigation */
.nav-unten { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.mitte { grid-area: mitte; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.kopf { display: flex; align-items: center; gap: 10px; padding: 10px 22px; border-bottom: 1px solid var(--linie); min-height: 54px; flex-wrap: wrap; }
.pfad { display: flex; align-items: center; gap: 4px; color: var(--leise); min-width: 0; flex: 1 1 240px; flex-wrap: wrap; }
.pfad a { color: var(--leise); padding: 2px 5px; border-radius: 6px; white-space: nowrap; }
.pfad a:hover { color: var(--text); background: var(--feld); text-decoration: none; }
.pfad b { color: var(--text); font-weight: 600; padding: 2px 5px; }
.pfad .trenn { color: var(--still); }
.kopf-rechts { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.inhalt { flex: 1; overflow: auto; padding: 24px 22px 48px; }
.chat { grid-area: chat; background: var(--nav); border-left: 1px solid var(--linie); display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; position: relative; }
/* Chat verschiebbar (UI7, AG4): Breite an der linken Kante ziehen; gelöst (.app.chat-frei, setzt chat.js nur über 980 px)
   liegt er als Fenster über der Seite — am Kopf verschieben, an Kanten und Ecken die Größe. Lage in --chat-x/-y/-b/-h. */
.chat-kante { position: absolute; left: 0; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 5; touch-action: none; }
.chat-kante::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--akzent); opacity: 0; transition: opacity .12s; }
.chat-kante:hover::after, .chat-kante:focus-visible::after, .app.chat-zieht .chat-kante::after { opacity: 1; }
.chat-kante:focus-visible { outline: none; }
.chat-zug, #chat-griff { display: none; }
.app.chat-zieht { user-select: none; -webkit-user-select: none; }
.app.chat-zieht iframe { pointer-events: none; }
.app.chat-frei:not(.chat-zu) .chat { position: fixed; left: var(--chat-x, auto); top: var(--chat-y, 64px); width: var(--chat-b, 400px); height: var(--chat-h, 600px); z-index: 40;
  border: 1px solid var(--linie2); border-radius: var(--r-gross); box-shadow: 0 18px 48px var(--schatten); }
.app.chat-frei .chat-kante { display: none; }
.app.chat-frei .chat-kopf { cursor: move; touch-action: none; }
.app.chat-frei .chat-kopf button { cursor: pointer; }
.app.chat-frei #chat-griff { display: inline-flex; cursor: move; }
.app.chat-frei .chat-zug { display: block; position: absolute; z-index: 5; touch-action: none; }
.chat-zug[data-zug="n"] { top: 0; left: 12px; right: 12px; height: 6px; cursor: ns-resize; }
.chat-zug[data-zug="s"] { bottom: 0; left: 12px; right: 12px; height: 6px; cursor: ns-resize; }
.chat-zug[data-zug="w"] { left: 0; top: 12px; bottom: 12px; width: 6px; cursor: ew-resize; }
.chat-zug[data-zug="o"] { right: 0; top: 12px; bottom: 12px; width: 6px; cursor: ew-resize; }
.chat-zug[data-zug="nw"] { left: 0; top: 0; width: 12px; height: 12px; cursor: nwse-resize; }
.chat-zug[data-zug="so"] { right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; }
.chat-zug[data-zug="no"] { right: 0; top: 0; width: 12px; height: 12px; cursor: nesw-resize; }
.chat-zug[data-zug="sw"] { left: 0; bottom: 0; width: 12px; height: 12px; cursor: nesw-resize; }
/* Chat in der Mitte (UI9, AG6): Im Ads-Arbeitsbereich liegt derselbe Chat-Behälter über dem Platz, den die Seite frei hält
   (#app.chat-mitte und die Lage in --chat-x/-y/-b/-h setzt nur chat.js). Rechts steht dann nur die Historie (.chat-seite),
   eingeklappt (#app.seite-zu) als schmale Leiste; bis 980 px bleibt sie im Chat. Mit #app, damit die Regeln für schmalere
   Fenster weiter unten sie nicht überstimmen. */
.chat-seite { display: none; }
#app.chat-mitte .chat { display: flex; position: fixed; left: var(--chat-x, 0); top: var(--chat-y, 52px); right: auto; bottom: auto; width: var(--chat-b, 100%); height: var(--chat-h, 100%);
  z-index: 5; background: var(--grund); border: 0; border-radius: 0; box-shadow: none; }
#app.chat-mitte + .chat-auf { display: none; }
@media (min-width: 981px) {
  #app.chat-mitte { grid-template-columns: 216px minmax(0,1fr) 288px; }
  #app.chat-mitte.seite-zu { grid-template-columns: 216px minmax(0,1fr) 48px; }
  #app.chat-mitte .chat-seite { grid-area: chat; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--nav); border-left: 1px solid var(--linie); }
}
@media (min-width: 981px) and (max-width: 1240px) {
  #app.chat-mitte { grid-template-columns: 64px minmax(0,1fr) 264px; }
  #app.chat-mitte.seite-zu { grid-template-columns: 64px minmax(0,1fr) 48px; }
}
.chat-auf .punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--akzent); }
.chat-auf { position: fixed; right: 16px; bottom: 16px; z-index: 30; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 22px; background: var(--feld); border: 1px solid var(--linie2); box-shadow: 0 8px 24px rgba(0,0,0,.35); }

/* ---------- Bausteine ---------- */
.spalte { max-width: 1040px; margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }
h1 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
h2 { font-size: 16px; font-weight: 600; margin: 0; text-wrap: balance; }
.unter { color: var(--leise); margin: 2px 0 0; }
.klein { font-size: 12.5px; color: var(--still); }
.abschnitt { display: flex; flex-direction: column; gap: 12px; }
.abschnitt-kopf { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.abschnitt-kopf .rechts { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.knopf { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: var(--r); background: var(--feld); color: var(--text); white-space: nowrap; }
.knopf:hover { background: var(--hover); text-decoration: none; }
.knopf.haupt { background: var(--akzent); color: var(--akzent-text); font-weight: 600; }
.knopf.haupt:hover { filter: brightness(1.08); }
.knopf.flach { background: none; color: var(--leise); }
.knopf.flach:hover { background: var(--feld); color: var(--text); }
.knopf.klein { padding: 5px 10px; font-size: 13px; }
.knopf:disabled { opacity: .45; cursor: not-allowed; }
.knopf-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: var(--leise); flex: none; }
.knopf-icon:hover { background: var(--feld); color: var(--text); }
.kosten { font-family: var(--mono); font-size: 12px; letter-spacing: -.02em; color: var(--still); white-space: nowrap; }
.stufe { display: inline-flex; background: var(--feld); border-radius: var(--r); padding: 3px; gap: 2px; flex-wrap: wrap; }
.stufe button { padding: 4px 10px; border-radius: 7px; color: var(--leise); font-size: 13px; white-space: nowrap; }
.stufe button.an { background: var(--hover); color: var(--text); }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 8px; border-radius: 20px; background: var(--feld); color: var(--leise); white-space: nowrap; }
.chip .p { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.gruen { background: var(--gruen-bg); color: var(--gruen); }
.chip.gelb { background: var(--gelb-bg); color: var(--gelb); }
.chip.rot { background: var(--rot-bg); color: var(--rot); }
.chip.blau { background: var(--akzent-bg); color: var(--akzent); }
.chip.grau { color: var(--still); }
.karte { background: var(--flaeche); border-radius: var(--r-gross); padding: 16px; }
.karte.rand { border: 1px solid var(--linie2); }
.hinweis { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r); background: var(--feld); color: var(--leise); font-size: 13px; }
.hinweis > span:not(.rechts) { flex: 1 1 240px; min-width: 0; }
.hinweis.gelb { background: var(--gelb-bg); color: var(--text); }
.hinweis.gelb > .ic { color: var(--gelb); }
.hinweis.gruen { background: var(--gruen-bg); color: var(--text); }
.hinweis.gruen > .ic { color: var(--gruen); }
.hinweis .rechts { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.beispiel { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 1px 8px; border-radius: 6px; background: var(--gelb-bg); color: var(--gelb); }
.reiter { display: flex; gap: 2px; border-bottom: 1px solid var(--linie); overflow-x: auto; scrollbar-width: none; }
.reiter a { padding: 8px 12px; color: var(--leise); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.reiter a:hover { color: var(--text); text-decoration: none; }
.reiter a.an { color: var(--text); border-bottom-color: var(--akzent); }
.tabelle-wrap { overflow-x: auto; border-radius: var(--r-gross); background: var(--flaeche); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th { text-align: left; font-family: var(--schrift-schmal); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--still); font-size: 11.5px; padding: 10px 14px; border-bottom: 1px solid var(--linie); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.klickbar { cursor: pointer; }
tr.klickbar:hover td { background: var(--schleier); }
td.r, th.r { text-align: right; white-space: nowrap; }
td.r { font-family: var(--mono); font-size: .93em; letter-spacing: -.02em; }
td.r .chip, td.r .knopf { font-family: var(--schrift); letter-spacing: 0; }
.anbau:empty { display: none; }
#produkt-anbau, #cr-anbau { display: contents; }   /* Anbau-Stellen: die Boxen selbst sind Teil der Spalte */
.leer { color: var(--still); font-size: 13px; padding: 6px 2px; }
/* Seite auf einen Blick (UI3, R10): die Seite selbst scrollt nicht, eine lange Liste läuft in ihrem eigenen Rahmen.
   .fuellt = dieser Block nimmt die restliche Höhe der Mitte (direkt in .spalte oder direkt in einem .anbau der Spalte);
   darin .liste-rahmen = Rollbereich mit festem Tabellenkopf, .kompakt = flache Zeilen. Auf kleinen Schirmen scrollt die Seite wie bisher. */
.liste-rahmen { overflow-x: auto; border-radius: var(--r-gross); background: var(--flaeche); }
.liste-rahmen.kompakt td { padding: 6px 14px; }
.liste-rahmen.kompakt th { padding: 8px 14px; }
@media (min-width: 761px) and (min-height: 600px) {
  .inhalt:has(.fuellt) { overflow: hidden; display: flex; flex-direction: column; padding-bottom: 20px; }
  .inhalt:has(.fuellt) > .spalte { flex: 1; min-height: 0; width: 100%; }
  .spalte > .anbau:has(> .fuellt), .fuellt { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .fuellt { gap: 12px; }
  .fuellt > * { flex: none; }
  .fuellt > .liste-rahmen { flex: 0 1 auto; min-height: 0; overflow: auto; }   /* so hoch wie die Liste, höchstens der Rest */
  .fuellt.knapp { flex: 0 1 auto; }                                           /* der Block selbst nur so hoch wie nötig (Karte mit Liste) */
  .liste-rahmen thead th { position: sticky; top: 0; z-index: 1; background: var(--flaeche); border-bottom: 0; box-shadow: inset 0 -1px 0 var(--linie); }
}
/* Auflage (UI3c, R10): ein Blatt über der Mitte für Dinge, die man kurz aufschlägt (großes Bild, Versionshistorie, Schritte),
   statt die Seite länger zu machen. Liegt in .mitte: Navigation und Chat bleiben bedienbar. Öffnen nur über ctx.auflage(). */
.mitte { position: relative; }
.auflage { position: absolute; inset: 0; z-index: 20; background: var(--abdunkeln); display: flex; align-items: flex-start; justify-content: center; padding: 28px 22px; }
.auflage-blatt { width: min(720px, 100%); max-height: 100%; display: flex; flex-direction: column; background: var(--grund); border: 1px solid var(--linie2); border-radius: var(--r-gross); box-shadow: 0 24px 60px var(--schatten); outline: 0; }
.auflage-blatt.breit { width: min(1000px, 100%); }
.auflage-kopf { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--linie); flex: none; }
.auflage-kopf h2 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auflage-inhalt { padding: 16px 18px 18px; overflow: auto; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 760px) { .auflage { padding: 12px 10px; } }
.platzhalter { border: 1px dashed var(--linie2); border-radius: var(--r-gross); padding: 30px 20px; text-align: center; color: var(--still); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.platzhalter b { color: var(--leise); }
.laden { color: var(--still); display: flex; gap: 8px; align-items: center; padding: 20px 0; }
.dreh svg { animation: dreh 1s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--hover); color: var(--text); padding: 9px 16px; border-radius: var(--r-gross); z-index: 60; box-shadow: 0 8px 24px var(--schatten); font-size: 13.5px; max-width: calc(100% - 32px); }
.menue { position: fixed; z-index: 50; background: var(--flaeche); border: 1px solid var(--linie2); border-radius: var(--r-gross); padding: 6px; box-shadow: 0 14px 36px var(--schatten); width: 300px; max-width: calc(100vw - 24px); max-height: 70vh; overflow: auto; }
.menue .gruppe { font-size: 11.5px; color: var(--still); padding: 8px 10px 4px; }
.menue button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 8px; }
.menue button:hover, .menue button.an { background: var(--feld); }
.menue button .rechts { margin-left: auto; color: var(--still); font-size: 12px; }
.menue hr { border: 0; border-top: 1px solid var(--linie); margin: 6px 4px; }
.menue input { margin: 2px 0 4px; }
/* Marken-Wahl (R2): Suche und „Neue Marke“ stehen fest, nur die Liste rollt */
.menue.marken-menue { width: 340px; display: flex; flex-direction: column; overflow: hidden; max-height: min(70vh, 560px); }
.marken-menue .stufe { margin: 2px 0 6px; flex: none; align-self: flex-start; }
.marken-menue .stufe button { width: auto; padding: 3px 10px; }
.marken-menue .liste { overflow: auto; min-height: 0; flex: 1 1 auto; }
.marken-menue .zeile { display: flex; align-items: center; border-radius: 8px; }
.marken-menue .zeile:hover, .marken-menue .zeile.an { background: var(--feld); }
.marken-menue .zeile button:hover, .marken-menue .zeile button.an { background: none; }
.marken-menue .wahl { flex: 1 1 auto; min-width: 0; text-align: left; }
.marken-menue .wahl .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.marken-menue .wahl .chip { flex: none; font-size: 11px; padding: 1px 7px; }
.marken-menue .wahl > svg { color: var(--leise); flex: none; }
.marken-menue .pin { width: 30px; flex: none; padding: 7px 0; justify-content: center; color: var(--still); opacity: 0; }
.marken-menue .zeile:hover .pin, .marken-menue .pin.an, .marken-menue .pin:focus-visible { opacity: 1; }
.marken-menue .pin.an { color: var(--akzent); }
.marken-menue .leer { padding: 10px; }
.marken-menue .fuss { flex: none; border-top: 1px solid var(--linie); margin-top: 6px; padding-top: 6px; }
.marken-menue .fuss > button { color: var(--leise); }
.marken-menue form { display: flex; flex-direction: column; gap: 6px; padding: 2px; }
.marken-menue form .reihe { display: flex; gap: 10px; align-items: center; }
.marken-menue form .reihe > span { flex: 1 1 auto; min-width: 0; line-height: 1.35; }
.marken-menue form .knopf { width: auto; flex: none; }
@media (prefers-reduced-motion: reduce) { .dreh svg { animation: none; } * { transition: none !important; } }

/* ---------- schmalere Fenster ---------- */
@media (max-width: 1240px) {
  .app { grid-template-columns: 64px minmax(0,1fr) var(--chat-breite, 320px); }
  .app.chat-zu, .app.chat-frei { grid-template-columns: 64px minmax(0,1fr) 0; }
  .logo { width: auto; padding-right: 6px; }
  .rahmen-konto, .rahmen-konto + .rahmen-trenn { display: none; }
  .nav .txt, .nav .zusatz, .nav .zaehler { display: none; }
  .nav-punkt { justify-content: center; padding: 9px 0; }
  .nav-punkt.offen { background: var(--feld); }
  .nav-unter { display: none; }
  .unternav:not(:empty) { display: flex; flex: none; padding: 0 16px; }
}
@media (max-width: 980px) {
  .app { grid-template-columns: 64px minmax(0,1fr) 0; }
  .app:not(.chat-zu) .chat { position: fixed; top: 52px; right: 0; bottom: 0; width: min(360px, 100%); z-index: 40; box-shadow: -12px 0 32px var(--schatten); border-left: 1px solid var(--linie2); }
  .chat-kante, #chat-los { display: none; }      /* Überlagerung wie bisher: kein Ziehen, kein Lösen (UI7) */
}
@media (max-width: 760px) {
  .app, .app.chat-zu { grid-template-columns: minmax(0,1fr); grid-template-rows: 52px minmax(0,1fr) auto; grid-template-areas: "oben" "mitte" "nav"; }
  .nav { flex-direction: row; justify-content: space-around; padding: 4px 8px; border-top: 1px solid var(--linie); }
  .nav-unten { margin-top: 0; flex-direction: row; }
  .nav-punkt { flex-direction: column; gap: 2px; padding: 6px 10px; font-size: 11px; width: auto; }
  .nav .txt { display: block; }
  .logo { width: auto; padding-left: 2px; }
  .nav { justify-content: space-between; gap: 0; padding: 4px 6px; }   /* UI12: sechs Punkte in einer Reihe, so breit wie ihr Name */
  .nav-unten { display: contents; }
  .nav .nav-punkt { flex: 0 1 auto; min-width: 0; padding: 6px 5px; }
  .nav-punkt .txt { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .nav-punkt .txt[data-kurz] { font-size: 0; }
  .nav-punkt .txt[data-kurz]::after { content: attr(data-kurz); font-size: 11px; }
  .suche { flex: none; margin: 0 0 0 auto; position: static; }
  .suche .suche-auf { display: inline-flex; }
  .suche-feld { display: none; }
  .oben.sucht > :not(.suche) { display: none; }
  .oben.sucht .suche { flex: 1 1 auto; margin: 0; }
  .oben.sucht .suche .suche-auf { display: none; }
  .oben.sucht .suche-feld { display: flex; }
  .oben.sucht .suche .suche-zu { display: inline-flex; width: 26px; height: 26px; }
  .oben.sucht kbd { display: none; }
  .suche-liste { left: 8px; right: 8px; top: 50px; min-width: 0; }
  .kopf { padding: 10px 16px; }
  .unternav:not(:empty) { padding: 0 10px; }
  .inhalt { padding: 18px 16px 40px; }
  .app:not(.chat-zu) .chat { top: 0; width: 100%; z-index: 45; }
  .chat-auf { bottom: 72px; }
}

/* ---------- Bausteine aus dem Prototyp, von mehreren Seiten genutzt (S28; vorher je Seite per ctx.stil) ----------
   Am Ende der Datei, damit sie wie vorher nach den Rahmen-Regeln greifen. */
/* Kennzahlen, Veränderung, Umsatzkurve (Dashboard) */
.kpi-leiste { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.kpi-gruppe { background: var(--flaeche); border-radius: var(--r-gross); padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi-gruppe .titel { font-family: var(--schrift-schmal); font-weight: 600; font-size: 12px; color: var(--still); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.kpi { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; min-width: 0; }
.kpi .name { color: var(--leise); font-size: 13px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .wert { font-family: var(--mono); font-weight: 500; font-size: 14.5px; letter-spacing: -.02em; white-space: nowrap; }
.kpi .wert.fehlt { font-family: var(--schrift); letter-spacing: 0; font-weight: 400; font-size: 12.5px; color: var(--still); }
.kpi:has(.wert.fehlt) .name { flex: none; }   /* „fehlt: …“ kürzt, der Name der Kennzahl bleibt lesbar */
.kpi .wert.fehlt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.kpi.gross { flex-wrap: wrap; row-gap: 0; padding-bottom: 6px; }
.kpi.gross .name { flex-basis: 100%; }
.kpi.gross .wert { font-size: 22px; letter-spacing: -.03em; flex: 1; }
.kpi .delta { font-family: var(--mono); font-size: 11px; letter-spacing: -.03em; white-space: nowrap; min-width: 52px; text-align: right; }
.delta.gut { color: var(--gruen); } .delta.schlecht { color: var(--rot); } .delta.neutral { color: var(--still); }
.kurve-karte { background: var(--flaeche); border-radius: var(--r-gross); padding: 14px 16px 10px; }
.kurve-kopf { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.legende { display: flex; gap: 14px; font-size: 12px; color: var(--still); flex-wrap: wrap; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende .strich { width: 16px; height: 2px; background: var(--akzent); border-radius: 2px; }
.legende .strich.vor { background: none; border-top: 2px dashed var(--still); height: 0; }
.kurve svg { width: 100%; height: auto; display: block; }
.kurve .gitter { stroke: var(--gitter); }
.kurve .achse { font-size: 11px; fill: var(--still); }
.kurve .vor { fill: none; stroke: var(--still); stroke-width: 1.5; stroke-dasharray: 4 4; }
.kurve .flaeche { fill: var(--kurve-flaeche); }   /* leise: Blau ist Signal, keine Fläche */
.kurve .linie { fill: none; stroke: var(--akzent); stroke-width: 2; }
.kurve .punkt { fill: var(--akzent); }
.kurve .tag { fill: transparent; }
.kurve .tag:hover { fill: var(--schleier); }
.kurve .m { cursor: pointer; }
.kurve .m line { stroke: var(--gelb); stroke-opacity: .45; stroke-dasharray: 2 3; }
.kurve .m circle { fill: var(--grund); stroke: var(--gelb); stroke-width: 1.5; }
.kurve .m text { font-size: 9.5px; font-weight: 700; fill: var(--gelb); }
.kurve .m:hover circle, .kurve .m:focus circle { fill: var(--gelb); }
.kurve .m:hover text, .kurve .m:focus text { fill: var(--grund); }
.kurve .m:focus { outline: none; }
.legende .mark { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--gelb); color: var(--gelb); font-size: 9px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-style: normal; }
.kpi .vorl { font-size: 10.5px; color: var(--gelb); border: 1px solid currentColor; border-radius: 6px; padding: 0 5px; margin-left: 4px; opacity: .85; }
@media (max-width: 760px) { .kpi-leiste { grid-template-columns: minmax(0,1fr); } }

/* Ziele (Dashboard) */
.ziele { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.ziel { background: var(--flaeche); border-radius: var(--r-gross); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ziel .zeile { display: flex; align-items: baseline; gap: 8px; }
.ziel .zeile .rechts { margin-left: auto; font-family: var(--mono); letter-spacing: -.02em; color: var(--leise); font-size: 12px; white-space: nowrap; }
.ziel-balken { height: 6px; border-radius: 4px; background: var(--feld); position: relative; overflow: visible; }
.ziel-balken i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--leise); }
.ziel-balken u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); border-radius: 1px; text-decoration: none; }
.ziel input { padding: 4px 8px; width: 110px; text-align: right; }
.ziel .einheit { color: var(--still); font-size: 12.5px; }
@media (max-width: 760px) { .ziele { grid-template-columns: minmax(0,1fr); } }

/* Pipeline (Dashboard) */
.pipeline { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.pipe-spalte { background: var(--flaeche); border-radius: var(--r-gross); padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pipe-spalte .titel { font-size: 12.5px; color: var(--leise); display: flex; gap: 6px; align-items: center; }
.pipe-spalte .titel .zahl { margin-left: auto; color: var(--still); }
.pipe-karte { background: var(--feld); border-radius: 10px; padding: 9px 10px; display: flex; flex-direction: column; gap: 2px; text-align: left; width: 100%; }
.pipe-karte:hover { background: var(--hover); }
.pipe-karte b { font-weight: 500; font-size: 13px; overflow-wrap: anywhere; }
.pipe-karte span { color: var(--still); font-size: 12px; overflow-wrap: anywhere; }
.pipe-mehr { color: var(--still); font-size: 12px; padding: 2px 2px; text-align: left; }
.pipe-mehr:hover { color: var(--text); }
@media (max-width: 980px) { .pipeline { grid-template-columns: minmax(0,1fr); } }

/* Maßnahmen-Karte, Schritte, Sphäre */
.massnahme { background: var(--flaeche); border-radius: var(--r-gross); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.massnahme.aus { opacity: .7; }
.massnahme .kopfzeile { display: flex; gap: 10px; align-items: flex-start; }
.massnahme .kopfzeile > .ic-box { width: 30px; height: 30px; border-radius: 8px; background: var(--feld); display: flex; align-items: center; justify-content: center; flex: none; color: var(--gelb); }
.massnahme .kopfzeile .chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.massnahme b { font-weight: 600; overflow-wrap: anywhere; }
.massnahme .befund { color: var(--leise); font-size: 13px; overflow-wrap: anywhere; }
.massnahme .fuss { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.massnahme .fuss .rechts { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.schritt-liste { display: flex; flex-direction: column; gap: 6px; padding: 8px 0 2px; border-top: 1px solid var(--linie); }
.schritt-zeile { display: flex; align-items: center; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.schritt-zeile .knopf { margin-left: auto; }
.sphaere { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 1px 7px; border-radius: 6px; background: var(--grund); color: var(--leise); border: 1px solid var(--linie); white-space: nowrap; }
.sphaere .ic { width: 12px; height: 12px; }

/* Produktzelle, Markenlogo, Asset-Kacheln (Creative) */
.marken-logo { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: 18px; flex: none; }
.prod-zelle { display: flex; align-items: center; gap: 10px; min-width: 0; }
.prod-zelle .bild { width: 38px; height: 38px; border-radius: 8px; overflow: hidden; flex: none; background: #fff; display: flex; align-items: center; justify-content: center; }
.prod-zelle .bild img { width: 100%; height: 100%; object-fit: contain; display: block; }
.prod-zelle .bild.ohne { background: var(--feld); color: var(--still); }
.prod-zelle b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-zelle small { color: var(--still); font-size: 12px; }
.prod-zelle > span:last-child { min-width: 0; }
.asset-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.asset { background: var(--flaeche); border-radius: var(--r-gross); padding: 13px 14px; display: flex; gap: 11px; align-items: flex-start; text-align: left; border: 1px solid transparent; width: 100%; color: var(--text); }
.asset:hover { border-color: var(--linie2); text-decoration: none; }
.asset .ic-box { width: 32px; height: 32px; border-radius: 9px; background: var(--feld); display: flex; align-items: center; justify-content: center; color: var(--leise); flex: none; }
.asset b { display: block; font-weight: 500; font-size: 13.5px; color: var(--text); }
.asset span { color: var(--still); font-size: 12px; }
.asset .marken-logo { color: #fff; }
@media (max-width: 760px) { .prod-zelle b { white-space: normal; } }

/* Konto-Raster, Prüfzeile (Konto) */
.konto-raster { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; align-items: start; }
.konto-check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 9px; background: var(--feld); }
.konto-check b { font-weight: 500; }
.konto-check small { display: block; color: var(--still); font-size: 12px; }
@media (max-width: 980px) { .konto-raster { grid-template-columns: minmax(0,1fr); } }

/* Bildkachel (Produkt; Raster und große Ansicht bringen die Reiter seit UI3c selbst mit, groß als Auflage) */
.bild-kachel{display:flex;flex-direction:column;gap:6px;text-align:left;width:100%}
.bild-kachel .rahmen-bild{aspect-ratio:1;border-radius:10px;overflow:hidden;position:relative;outline:1px solid var(--linie);max-width:100%;background:#fff;display:flex;align-items:center;justify-content:center}
.bild-kachel:hover .rahmen-bild{outline-color:var(--linie2)}.bild-kachel.an .rahmen-bild{outline:2px solid var(--akzent)}
.bild-kachel img{width:100%;height:100%;object-fit:contain;display:block}
.bild-kachel .rahmen-bild.frei{background:var(--flaeche);outline-style:dashed;color:var(--still)}
.bild-kachel .beschr{display:flex;align-items:center;gap:6px;font-size:12.5px;color:var(--leise)}

/* Listing: Feldblock (Produkt) */
.feld-block{display:flex;flex-direction:column;gap:6px}.feld-block label{font-size:12px;color:var(--still);display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.feld-block .lesen{background:var(--flaeche);border-radius:var(--r);padding:9px 12px;color:var(--text);overflow-wrap:anywhere;white-space:pre-wrap}
.feld-block .lesen.leer-feld{color:var(--still);font-style:italic}
.feld-block ol{margin:0;padding:9px 12px 9px 32px;background:var(--flaeche);border-radius:var(--r);display:flex;flex-direction:column;gap:8px}
.feld-block li{overflow-wrap:anywhere}.feld-block li small{color:var(--still);margin-left:6px;white-space:nowrap}
