/* Backend-Optik in der Büro-Blanko-Palette.
   Farbwerte übernommen aus dem eigenen Admin-Schema (Buero-Blanko-Basic/includes/bb.css).
   Vollständig eigener Code - es wurde kein Stylesheet aus WordPress übernommen. */

:root {
  --dunkel: #161616;        /* Adminleiste und Seitenmenü */
  --dunkel-hover: #5c5b5b;  /* Hover und aktiver Eintrag */
  --submenu: #040404;
  --schwarz: #000;          /* Primäraktionen */
  --schwarz-hover: #080808;
  --link: #606060;
  --link-hover: #acacac;
  --text: #1d2327;
  --grau: #646970;
  --rahmen: #dcdcde;
  --rahmen-kraeftig: #a7aaad;
  --flaeche: #fff;
  --flaeche-still: #f6f7f7;
  --akzent: #7535e0;
  --rot: #b32d2e;
  --gruen: #00a32a;
}

* { box-sizing: border-box; }

/* Muss die display-Regeln der Schaltflächen schlagen. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--flaeche);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 13px;
  line-height: 1.4em;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

.bb-logo { width: 22px; height: 22px; display: block; fill: currentColor; }

/* ---------- Adminleiste ---------- */

.adminbar {
  position: fixed; inset: 0 0 auto 0; height: 40px; z-index: 100;
  background: var(--dunkel); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; font-size: 13px;
}
.adminbar a { color: #fff; }
.adminbar a:hover { color: var(--link-hover); text-decoration: none; }
.adminbar .marke { display: flex; align-items: center; gap: 18px; }
.adminbar .marke .bb-logo { color: #fff; }

/* Rechts: angemeldetes Konto, Mein Konto, Abmelden */
.konto-leiste { display: flex; align-items: center; gap: 4px; }
.konto-wer { display: flex; align-items: center; gap: 8px; padding-right: 6px; color: #fff; }
.konto-kreis {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: #3a3a3a; color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.konto-name { font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.konto-trenner { width: 1px; height: 18px; background: #3a3a3a; margin: 0 6px; }
.adminbar .leiste-knopf {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: 4px; color: #d8d8d8;
}
.adminbar .leiste-knopf svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.adminbar .leiste-knopf:hover, .adminbar .leiste-knopf.aktiv { background: var(--dunkel-hover); color: #fff; }
.adminbar .leiste-knopf:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
@media (max-width: 700px) {
  .konto-name, .konto-trenner, .adminbar .leiste-knopf span { display: none; }
  .adminbar .leiste-knopf { padding: 0 7px; }
}

/* ---------- Seitenmenü ---------- */

.sidebar {
  position: fixed; top: 40px; bottom: 0; left: 0; width: 172px;
  background: var(--dunkel); overflow-y: auto;
}
.sidebar ul { list-style: none; margin: 10px 0 0; padding: 0; }
.sidebar > ul > li > a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; color: #fff; font-size: 14px; line-height: 20px;
}
.sidebar > ul > li > a:hover { background: var(--dunkel-hover); color: #fff; text-decoration: none; }
.sidebar > ul > li.aktiv > a { background: var(--dunkel-hover); color: #fff; font-weight: 600; }
.sidebar svg { width: 20px; height: 20px; fill: #f3f1f1; flex: none; }
.sidebar > ul > li.aktiv > a svg, .sidebar > ul > li > a:hover svg { fill: #fff; }
.sidebar .untermenue { background: var(--submenu); padding: 5px 0; }
.sidebar .untermenue a { display: block; padding: 6px 12px 6px 42px; color: #b9b9b9; font-size: 13px; }
.sidebar .untermenue a:hover { color: #fff; text-decoration: none; }
.sidebar .untermenue a.aktiv { color: #fff; font-weight: 600; }

/* ---------- Inhaltsbereich ---------- */

.inhalt { margin: 40px 0 0 172px; padding: 14px 24px 60px 26px; min-height: calc(100vh - 40px); }

h1.titel {
  font-size: 23px; font-weight: 400; margin: 0; padding: 9px 0 4px 0;
  line-height: 1.3; display: inline-block;
}
.titel-aktion {
  display: inline-block; margin-left: 6px; padding: 0 12px;
  font-size: 13px; line-height: 28px; height: 30px;
  border: 1px solid var(--schwarz); border-radius: 3px; background: transparent; color: var(--schwarz);
  vertical-align: 4px;
}
.titel-aktion:hover { background: var(--schwarz); color: #fff; text-decoration: none; }
hr.trennlinie { border: 0; border-top: 1px solid var(--rahmen); margin: 20px 0 10px; }

/* ---------- Hinweise ---------- */

.hinweis {
  background: #fff; border: 1px solid var(--rahmen); border-left: 4px solid var(--akzent);
  padding: 10px 12px; margin: 15px 0;
}
.hinweis p { margin: 0; }
.hinweis-erfolg { border-left-color: var(--gruen); }
.hinweis-fehler { border-left-color: var(--rot); }

/* ---------- Schaltflächen ---------- */

.knopf {
  display: inline-block; border: 1px solid var(--schwarz); border-radius: 3px;
  background: transparent; color: var(--schwarz); cursor: pointer;
  padding: 0 12px; height: 32px; line-height: 30px; font-size: 13px;
  text-decoration: none; white-space: nowrap; font-family: inherit;
}
.knopf:hover { background: var(--schwarz); border-color: var(--schwarz); color: #fff; text-decoration: none; }
.knopf-primaer { background: var(--schwarz); border-color: var(--schwarz); color: #fff; }
.knopf-primaer:hover { background: var(--schwarz-hover); border-color: var(--schwarz-hover); color: #fff; }
.knopf-loeschen { border-color: var(--rot); color: var(--rot); }
.knopf-loeschen:hover { background: var(--rot); border-color: var(--rot); color: #fff; }
.knopf-klein { height: 28px; line-height: 26px; font-size: 12px; padding: 0 10px; }

/* ---------- Formularfelder ---------- */

input[type=text], input[type=password], input[type=email], input[type=date], input[type=url], select, textarea {
  border: 1px solid var(--rahmen-kraeftig); border-radius: 3px; background: #fff; color: var(--text);
  padding: 5px 10px; font-size: 14px; line-height: 1.8; font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--dunkel-hover); outline: 2px solid transparent;
  box-shadow: 0 0 0 1px var(--dunkel-hover);
}
.feld-voll { width: 100%; }
label { font-weight: 400; }

table.formulartabelle { border-collapse: collapse; width: 100%; max-width: 780px; margin-top: 10px; }
table.formulartabelle th {
  width: 200px; text-align: left; vertical-align: top; padding: 20px 10px 20px 0;
  font-weight: 600; font-size: 14px;
}
table.formulartabelle td { padding: 15px 10px; vertical-align: top; }
table.formulartabelle .hilfe { color: var(--grau); font-size: 13px; margin: 6px 0 0; }

/* ---------- Listentabelle ---------- */

.tabellen-nav { margin: 14px 0 6px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tabellen-nav .anzahl { color: var(--grau); }
.filter-links { margin: 10px 0; padding: 0; list-style: none; display: flex; gap: 6px; font-size: 13px; }
.filter-links li:not(:last-child)::after { content: " |"; color: var(--rahmen-kraeftig); }
.filter-links a.aktiv { font-weight: 600; color: var(--text); }

table.liste {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: #fff; border: 1px solid var(--rahmen); border-radius: 3px;
}
table.liste th, table.liste td { padding: 11px 12px; text-align: left; vertical-align: top; }
table.liste thead th, table.liste tfoot th {
  border-bottom: 1px solid var(--rahmen); font-size: 14px; font-weight: 600; color: var(--text);
}
table.liste tbody tr:not(:last-child) td { border-bottom: 1px solid #f0f0f1; }
table.liste tbody tr:hover { background: var(--flaeche-still); }
table.liste .spalte-auswahl { width: 30px; }
table.liste .spalte-titel { font-size: 14px; }
table.liste .spalte-titel strong a { font-weight: 600; color: var(--text); }
table.liste .spalte-titel strong a:hover { color: var(--link); }
table.liste .leer { padding: 26px 12px; color: var(--grau); }

.zeilen-aktionen { visibility: hidden; color: var(--grau); font-size: 13px; padding-top: 3px; }
tr:hover .zeilen-aktionen { visibility: visible; }
.zeilen-aktionen span:not(:last-child)::after { content: " | "; color: var(--rahmen); }
.zeilen-aktionen .loeschen a { color: var(--rot); }

.status-kennzeichen { color: var(--grau); font-weight: 600; }

/* ---------- Editor: zweispaltig ---------- */

.editor-raster { display: grid; grid-template-columns: minmax(0, 1fr) 292px; gap: 22px; margin-top: 14px; align-items: start; }
@media (max-width: 900px) { .editor-raster { grid-template-columns: 1fr; } }

#titelfeld, .titel-eingabe { width: 100%; font-size: 1.7em; line-height: 1.4; padding: 8px 10px; }
.permalink { margin: 10px 0 16px; font-size: 13px; color: var(--grau); }
.permalink .slug-anzeige { font-weight: 600; color: var(--text); }
.permalink input { font-size: 13px; padding: 3px 8px; line-height: 1.6; }

.box { background: #fff; border: 1px solid var(--rahmen); border-radius: 3px; margin-bottom: 22px; }
.box > h2 {
  margin: 0; padding: 10px 14px; font-size: 14px; font-weight: 600; line-height: 1.4;
  border-bottom: 1px solid var(--rahmen);
}
.box .box-inhalt { padding: 14px; }

/* Editor-Umschalter */
.editor-tabs { display: flex; justify-content: flex-end; gap: 2px; background: var(--flaeche-still); padding: 6px 6px 0; border-bottom: 1px solid var(--rahmen); }
.editor-tabs button {
  border: 1px solid var(--rahmen); border-bottom: 0; background: transparent; color: var(--grau);
  padding: 6px 14px; font-size: 13px; cursor: pointer; border-radius: 3px 3px 0 0; font-family: inherit;
}
.editor-tabs button.aktiv { background: #fff; color: var(--text); font-weight: 600; }
.editor-werkzeuge { display: flex; gap: 4px; padding: 7px; border-bottom: 1px solid var(--rahmen); flex-wrap: wrap; }
.editor-werkzeuge button {
  border: 1px solid transparent; background: transparent; cursor: pointer; font-family: inherit;
  padding: 4px 9px; font-size: 13px; border-radius: 3px; color: var(--text); min-width: 28px;
}
.editor-werkzeuge button:hover { background: var(--dunkel); border-color: var(--dunkel); color: #fff; }
.editor-werkzeuge .werkzeug-trenner { width: 1px; background: var(--rahmen); margin: 2px 5px; }

#visuell {
  min-height: 380px; padding: 14px 16px; font-size: 15px; line-height: 1.7; outline: none;
  font-family: Georgia, "Times New Roman", serif;
}
#visuell.ist-leer > :first-child::before { content: "Text hier eingeben …"; color: var(--rahmen-kraeftig); }
#visuell p { margin: 0 0 1em; }
#visuell h2 { font-size: 1.4em; margin: 1em 0 .5em; }
#visuell h3 { font-size: 1.2em; margin: 1em 0 .5em; }
#quelltext {
  width: 100%; min-height: 380px; border: 0; padding: 14px 16px; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.7;
}
#quelltext:focus { box-shadow: none; }

.wortanzahl { padding: 8px 14px; border-top: 1px solid var(--rahmen); color: var(--grau); font-size: 12px; }

/* Veröffentlichen-Box */
.veroeffentlichen-zeile { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #f0f0f1; }
.veroeffentlichen-zeile .beschriftung { display: flex; align-items: center; gap: 8px; }
.veroeffentlichen-zeile svg { width: 16px; height: 16px; fill: var(--grau); flex: none; }
.veroeffentlichen-fuss {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px; padding: 12px 14px; background: var(--flaeche-still);
}
.veroeffentlichen-fuss > span { display: flex; align-items: center; gap: 8px; }
.papierkorb-link { color: var(--rot); font-size: 13px; }
.papierkorb-link:hover { color: var(--rot); text-decoration: underline; }

/* Beitragsbild */
.beitragsbild-vorschau img { width: 100%; height: auto; display: block; margin-bottom: 10px; border: 1px solid var(--rahmen); }

/* ---------- Mediathek ---------- */

.medien-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin-top: 18px; }
.medien-kachel { background: #fff; border: 1px solid var(--rahmen); padding: 7px; text-align: center; }
.medien-kachel img { width: 100%; height: 120px; object-fit: cover; display: block; background: var(--flaeche-still); }
.medien-kachel .name { font-size: 11px; color: var(--grau); word-break: break-all; margin: 7px 0 4px; }
.medien-kachel.auswaehlbar { cursor: pointer; }
.medien-kachel.auswaehlbar:hover { border-color: var(--schwarz); box-shadow: 0 0 0 1px var(--schwarz); }

.ablegeflaeche {
  border: 2px dashed var(--rahmen-kraeftig); background: #fff; border-radius: 3px;
  padding: 30px; text-align: center; color: var(--grau); margin-top: 14px;
}
.ablegeflaeche.aktiv { border-color: var(--schwarz); background: var(--flaeche-still); }
.ablegeflaeche label { color: var(--text); font-weight: 600; cursor: pointer; text-decoration: underline; }

/* Modal für die Bildauswahl */
.modal-hintergrund {
  position: fixed; inset: 0; background: rgba(0,0,0,.72); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 40px;
}
.modal-hintergrund[hidden] { display: none !important; }
.modal { background: #fff; border-radius: 3px; width: 100%; max-width: 900px; max-height: 100%; display: flex; flex-direction: column; }
.modal-kopf { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--rahmen); }
.modal-kopf h2 { margin: 0; font-size: 18px; font-weight: 600; }
.modal-koerper { padding: 18px; overflow-y: auto; }
.modal-fuss { padding: 14px 18px; border-top: 1px solid var(--rahmen); text-align: right; }
.schliessen { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--grau); }

/* ---------- Anmeldung ---------- */

.anmeldung {
  background: #fff; min-height: 100vh;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.anmeldung-karte { width: 100%; max-width: 372px; }
.anmeldung-logo { text-align: center; margin-bottom: 26px; }
.anmeldung-logo .bb-logo { width: 54px; height: 54px; margin: 0 auto; color: var(--schwarz); }
.anmeldung form { background: #fff; border: 1px solid var(--rahmen); padding: 26px 24px; }
.anmeldung label { display: block; margin-bottom: 20px; font-size: 14px; }
.anmeldung input[type=text], .anmeldung input[type=password] {
  width: 100%; margin-top: 7px; font-size: 16px; padding: 9px 12px;
}
.anmeldung .knopf-primaer {
  width: 100%; height: 44px; line-height: 42px; text-align: center; font-size: 15px;
}
.anmeldung .fussnoten { text-align: center; margin-top: 22px; font-size: 13px; line-height: 2.1; }
.anmeldung .fussnoten a { display: block; color: var(--link); }
.anmeldung .fehler, .anmeldung .info {
  background: #fff; border: 1px solid var(--rahmen); border-left: 4px solid var(--rot);
  padding: 11px 13px; margin-bottom: 18px;
}
.anmeldung .info { border-left-color: var(--gruen); }
.anmeldung .vergessen { text-align: center; margin: 16px 0 0; font-size: 13px; }

/* ---------- Dashboard ---------- */

.dashboard-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; margin-top: 18px; }
.kennzahl { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid #f0f0f1; font-size: 14px; }
.kennzahl:last-child { border-bottom: 0; }
.kennzahl b { font-size: 21px; font-weight: 400; min-width: 34px; }

.fusszeile { margin: 34px 0 0; padding-top: 14px; border-top: 1px solid var(--rahmen); color: var(--grau); font-size: 12px; }

/* ---------- Sammlungen mit Feld-Schema ---------- */

table.formulartabelle.felder { max-width: none; margin: 0; }
table.formulartabelle.felder th { width: 170px; padding: 14px 10px 10px 0; }
table.formulartabelle.felder td { padding: 10px 0; }
table.formulartabelle.felder tr + tr th, table.formulartabelle.felder tr + tr td { border-top: 1px solid var(--flaeche-still); }
table.formulartabelle.felder textarea { resize: vertical; font-family: inherit; }
table.formulartabelle .pflicht { color: var(--rot); }
.zeile-liste > th { width: auto !important; padding-right: 0 !important; }
.zeile-liste .hilfe { font-weight: 400; }

.listenfeld { margin-top: 10px; font-weight: 400; }
.listenfeld-zeilen { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.listenfeld-zeile {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 10px; align-items: start;
  padding: 10px; border: 1px solid var(--rahmen); background: var(--flaeche-still); border-radius: 3px;
}
.listenfeld-spalte { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--grau); }
.listenfeld-spalte input, .listenfeld-spalte textarea { width: 100%; color: var(--text); }
.listenfeld-aktionen { display: flex; gap: 4px; padding-top: 19px; }
.listenfeld-aktionen .knopf { min-width: 30px; padding: 0 6px; }

.dateifeld { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dateifeld-name em { color: var(--grau); }

.box-hilfe { margin: 0; padding: 8px 14px 0; color: var(--grau); }
#visuell.visuell-klein { min-height: 140px; }

.zustand { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--flaeche-still); color: var(--grau); }
.zustand-kommend { background: #edfaef; color: #006c1c; }
.zustand-entwurf { background: #fcf9e8; color: #8a6d00; }

@media (max-width: 960px) {
  .listenfeld-zeile { grid-template-columns: 1fr; }
  .listenfeld-aktionen { padding-top: 0; }
}

/* ---------- Konfiguration ---------- */

.config-text {
  width: 100%; max-width: 1100px; min-height: 520px; padding: 12px 14px; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.6;
}

/* ---------- Zugriffe (wie in BB Studio) ---------- */

.zugriffe { margin-bottom: 20px; }
.zugriffe h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.zugriffe-hinweis { font-size: 12px; font-weight: 400; color: var(--grau); }
.zugriffe .label { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--grau); }
.zugriffe-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--rahmen); border-bottom: 1px solid var(--rahmen); }
.zugriffe-kpis > div { background: var(--flaeche); padding: 20px 24px; }
.zugriffe-kpis b { display: block; margin-top: 14px; font-size: 44px; font-weight: 300; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.zugriffe-kpis p:last-child { margin: 10px 0 0; font-size: 12px; color: var(--grau); }
.zugriffe-abschnitt { padding: 20px 24px; border-bottom: 1px solid var(--rahmen); }
.zugriffe-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.zugriffe-umschalter { display: flex; gap: 16px; }
.zugriffe-umschalter button { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--grau); }
.zugriffe-umschalter button.aktiv, .zugriffe-umschalter button:hover { color: var(--text); }
.zugriffe-abschnitt[data-zeitraum="30"] .zugriffe-7, .zugriffe-abschnitt[data-zeitraum="7"] .zugriffe-30 { display: none; }
.zugriffe-balken { display: flex; align-items: flex-end; gap: 4px; height: 130px; margin-top: 20px; border-bottom: 1px solid var(--rahmen); }
.zugriffe-7 .zugriffe-balken { gap: 20px; }
.zugriffe-balken span { flex: 1; min-height: 1px; background: var(--dunkel); }
.zugriffe-achse { display: flex; justify-content: space-between; margin-top: 8px; font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--grau); }
.zugriffe-spalten { display: flex; gap: 24px; }
.zugriffe-spalten span, .zugriffe-seiten li > span:not(.seite) { width: 64px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.zugriffe-seiten { list-style: none; margin: 8px 0 0; padding: 0; }
.zugriffe-seiten li { display: flex; align-items: center; gap: 24px; padding: 9px 0; border-bottom: 1px solid var(--flaeche-still); font-size: 14px; }
.zugriffe-seiten li:last-child { border-bottom: 0; }
.zugriffe-seiten .seite { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zugriffe-seiten .leise { color: var(--grau); }
.zugriffe-fuss { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 12px 24px; font-size: 12px; color: var(--grau); }
@media (max-width: 960px) {
  .zugriffe-kpis { grid-template-columns: repeat(2, 1fr); }
  .zugriffe-spalten span:not(:nth-child(2)), .zugriffe-seiten li > span.leise { display: none; }
}

/* ---------- Werkzeuge ---------- */

.werkzeuge h2 + .werkzeug { border-top: 0; }
.werkzeug { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-top: 1px solid var(--flaeche-still); cursor: pointer; }
.werkzeug.geplant { cursor: default; opacity: .6; }
.werkzeug strong { font-size: 14px; }
.werkzeug .hilfe { display: block; margin-top: 3px; color: var(--grau); }
.schalter { position: relative; flex: none; width: 36px; height: 20px; margin-top: 1px; }
.schalter input { position: absolute; opacity: 0; inset: 0; margin: 0; z-index: 1; cursor: pointer; }
.schalter i { position: absolute; inset: 0; border-radius: 10px; background: var(--rahmen-kraeftig); transition: background .15s; }
.schalter i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.schalter input:checked + i { background: var(--akzent); }
.schalter input:checked + i::after { transform: translateX(16px); }
.schalter input:focus-visible + i { box-shadow: 0 0 0 2px var(--dunkel-hover); }

/* ---------- Meta-Daten ---------- */

.zeichen { font-variant-numeric: tabular-nums; }
.zeichen.zu-lang { color: var(--rot); }
.vorschau-google .url { font-size: 12px; color: #4d5156; }
.vorschau-google .titel-g { margin-top: 4px; font-size: 18px; line-height: 1.3; color: #1a0dab; }
.vorschau-google .text-g { margin-top: 4px; font-size: 13px; line-height: 1.5; color: #4d5156; }
.vorschau-og .bild { aspect-ratio: 1200 / 630; background: var(--flaeche-still) center / cover; display: flex; align-items: center; justify-content: center; color: var(--grau); font-size: 12px; }
.vorschau-og .og-t { font-weight: 600; font-size: 14px; }
.vorschau-og .og-b { margin-top: 4px; color: var(--grau); font-size: 12.5px; }

/* ---------- Anleitungen ---------- */

.anleitung { max-width: 780px; }
.anleitung .box-inhalt { font-size: 14px; line-height: 1.65; }
.anleitung h2 { margin: 1.4em 0 .4em; padding: 0; border: 0; font-size: 16px; }
.anleitung .box-inhalt > :first-child { margin-top: 0; }
.anleitung ul { padding-left: 20px; }
.anleitung-nav { display: flex; justify-content: space-between; max-width: 780px; }
.anleitung-text { width: 100%; min-height: 420px; border: 0; padding: 14px 16px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.7; }

/* ---------- Site-Wechsel (Mehr-Site-Betrieb) ---------- */

.site-wechsel { position: relative; }
.site-wechsel summary { cursor: pointer; list-style: none; color: #fff; }
.site-wechsel summary::-webkit-details-marker { display: none; }
.site-wechsel summary::after { content: ' ▾'; }
.site-wechsel-liste {
  position: absolute; top: 28px; left: 0; min-width: 240px; z-index: 110;
  background: var(--dunkel); border: 1px solid var(--dunkel-hover); padding: 6px 0;
}
.site-wechsel-liste a { display: block; padding: 6px 14px; white-space: nowrap; }
.site-wechsel-liste a:hover { background: var(--dunkel-hover); }
.site-wechsel-liste a.alle { border-top: 1px solid var(--dunkel-hover); margin-top: 4px; padding-top: 8px; color: #b9b9b9; }

/* ---------- Verlauf ---------- */
.verlauf td { vertical-align: top; }
.verlauf-details { margin-top: 4px; color: var(--grau); font-size: 13px; }
.verlauf-details summary { cursor: pointer; }
.verlauf-details ul { margin: 6px 0 0; padding-left: 18px; }
.verlauf-details code { font-size: 12px; }
.verlauf-aktion { text-align: right; white-space: nowrap; }
.verlauf-aktion form { margin: 0; }
.verlauf-zurueck strong { color: var(--grau); text-decoration: line-through; }

/* ---------- Veroeffentlichen ---------- */
.lauf-kasten { max-width: 780px; }
.fortschritt { height: 8px; background: var(--rahmen); border-radius: 4px; overflow: hidden; }
.fortschritt i { display: block; height: 100%; background: var(--gruen); }
.datei-liste { margin: 4px 0 12px; padding-left: 18px; max-height: 260px; overflow: auto; font-size: 13px; }
.datei-liste code { font-size: 12px; }
.box h3 { font-size: 14px; margin: 14px 0 4px; }
.unterueberschrift { font-size: 18px; font-weight: 400; margin: 26px 0 8px; }

/* ---------- Menü einklappen ---------- */

.menue-umschalter {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 6px 0 10px; padding: 9px 12px;
  border: 0; background: none; color: #a7aaad; font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.menue-umschalter:hover { color: #fff; }
.menue-umschalter svg { width: 20px; height: 20px; fill: currentColor; flex: none; transition: transform .15s; }
body.menue-klein .sidebar { width: 44px; overflow-x: hidden; }
body.menue-klein .sidebar span, body.menue-klein .sidebar .untermenue { display: none; }
body.menue-klein .menue-umschalter svg { transform: rotate(180deg); }
body.menue-klein .inhalt { margin-left: 44px; }

/* ---------- KI-Editor (Aufbau wie in BB Studio Light) ---------- */

/* Der Editor füllt das Fenster unter der Adminleiste; die Seite selbst scrollt nicht. */
body.ki-modus { overflow: hidden; }
body.ki-modus .inhalt { padding: 0; height: calc(100vh - 40px); min-height: 0; display: flex; }
body.ki-modus .fusszeile { display: none; }
.ki-editor { flex: 1; min-width: 0; min-height: 0; display: flex; background: var(--flaeche); }

.ki-svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Seitenliste */
.ki-seiten { width: 224px; flex: none; border-right: 1px solid var(--rahmen); overflow-y: auto; background: #fff; }
.ki-editor.liste-zu .ki-seiten { display: none; }
.ki-seiten-kopf { padding: 12px; border-bottom: 1px solid var(--rahmen); }
.ki-seiten-kopf strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ki-seiten-kopf span { display: block; margin-top: 2px; font-size: 12px; color: var(--grau); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ki-seiten ul { list-style: none; margin: 0; padding: 0; }
.ki-seiten nav > ul, .ki-gruppe { padding: 8px; }
.ki-gruppe { border-top: 1px solid var(--rahmen); }
.ki-seiten li { position: relative; }
.ki-eintrag {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 0; border-radius: 4px;
  background: none; font: inherit; font-size: 13px; color: var(--text); text-align: left; cursor: pointer;
}
.ki-eintrag span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ki-eintrag .ki-svg { width: 14px; height: 14px; color: var(--grau); }
.ki-eintrag:hover { background: var(--flaeche-still); }
.ki-eintrag.aktiv { background: #ececed; font-weight: 600; }
.ki-eintrag.ki-ordner { color: var(--grau); }
.ki-eintrag.ki-ordner:hover { color: var(--text); }
.ki-eintrag.mit-unterseiten { padding-right: 30px; }
.ki-aufklappen { position: absolute; right: 4px; top: 4px; display: flex; padding: 3px; border: 0; border-radius: 3px; background: none; color: var(--grau); cursor: pointer; }
.ki-aufklappen:hover { background: var(--flaeche-still); color: var(--text); }
.ki-aufklappen .ki-svg { width: 14px; height: 14px; }
.ki-abschnitt {
  width: 100%; display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 0; border-radius: 4px; background: none;
  font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--grau); cursor: pointer;
}
.ki-abschnitt:hover { color: var(--text); }
.ki-abschnitt .ki-svg { width: 14px; height: 14px; }
.ki-abschnitt em { margin-left: auto; font-style: normal; font-weight: 400; letter-spacing: 0; text-transform: none; }

/* Werkzeugleiste */
.ki-haupt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ki-leiste { height: 44px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 10px; border-bottom: 1px solid var(--rahmen); background: #fff; }
.ki-flach {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 32px; height: 32px; padding: 0 8px;
  border: 0; border-radius: 4px; background: none; color: var(--text); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap;
}
a.ki-flach:hover { text-decoration: none; color: var(--text); }
.ki-flach:hover { background: var(--flaeche-still); }
.ki-flach.aktiv, .ki-flach.aktiv:hover { background: var(--schwarz); color: #fff; }
.ki-flach:disabled { opacity: .35; cursor: default; background: none; }
.ki-flach.laedt { opacity: .5; cursor: progress; }
#ki-seite { height: 32px; min-width: 0; flex: 0 1 260px; }
.ki-editor:not(.liste-zu) #ki-seite { display: none; }
.ki-dateiname { min-width: 0; color: var(--grau); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ki-editor.liste-zu .ki-dateiname { display: none; }
.ki-leiste-rechts { margin-left: auto; display: flex; align-items: center; gap: 2px; flex: none; }
.ki-trenner { width: 1px; height: 20px; margin: 0 4px; background: var(--rahmen); }
.ki-breiten { display: inline-flex; gap: 2px; }
#ki-chat-auf-klein { display: none; }
.ki-veroeffentlichen { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }
.ki-veroeffentlichen b { padding: 0 6px; border-radius: 9px; background: rgba(255,255,255,.22); font-size: 12px; font-weight: 400; line-height: 18px; }
.ki-bereich-leiste { flex: none; padding: 6px 12px; border-bottom: 1px solid #f0e2a8; background: #fcf9e8; color: #6b5300; font-size: 12px; }
.ki-bereich-leiste small { display: block; color: #8a6d00; }
.ki-bereich-leiste a { color: inherit; font-weight: 600; text-decoration: underline; }

/* Vorschau und Chat darüber */
.ki-buehne { flex: 1; min-height: 0; position: relative; }
.ki-vorschau { position: absolute; inset: 0; overflow: auto; display: flex; justify-content: center; background: #ececed; }
.ki-vorschau iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.ki-vorschau iframe[style*="max-width"] { border-left: 1px solid var(--rahmen); border-right: 1px solid var(--rahmen); }

.ki-fenster {
  position: absolute; top: 12px; right: 12px; bottom: 12px; z-index: 20; width: 384px; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--rahmen); border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.16); overflow: hidden;
}
.ki-fenster.mit-hoehe { top: auto; height: var(--ki-chat-h); }
.ki-editor.chat-zu .ki-fenster { display: none; }
.ki-griff { height: 12px; flex: none; display: flex; align-items: center; justify-content: center; cursor: ns-resize; touch-action: none; }
.ki-griff span { width: 40px; height: 4px; border-radius: 2px; background: var(--rahmen); }
.ki-griff:hover span { background: var(--rahmen-kraeftig); }
.ki-chat-kopf { height: 40px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 12px; border-bottom: 1px solid var(--rahmen); font-size: 14px; }
.ki-chat-kopf #ki-vorlagen-knopf { margin-left: auto; font-size: 13px; }
#ki-chat-schliessen { display: none; }
.ki-chat-auf { position: absolute; right: 16px; bottom: 16px; z-index: 20; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }

.ki-nachrichten { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.ki-leer { color: var(--grau); line-height: 1.55; }
.ki-leer p { margin: 0 0 8px; }
.ki-leer ul { margin: 0 0 8px; padding-left: 18px; }
.ki-zeile { display: flex; }
.ki-zeile.rechts { justify-content: flex-end; }
.ki-blase { max-width: 88%; padding: 8px 12px; border-radius: 8px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.ki-du { background: var(--schwarz); color: #fff; }
.ki-antwort { background: var(--flaeche-still); }
.ki-antwort.ki-weitergabe { background: #fcf9e8; border: 1px solid #f0e2a8; color: #6b5300; }
.ki-antwort.ki-fehler { background: #fcf0f1; border: 1px solid #f0c6c8; color: #8a1f20; }
.ki-zurueck { opacity: .6; }
.ki-info { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 4px; color: var(--grau); font-size: 12px; }
.ki-info .ki-aktion { margin: 0; }
.ki-info .knopf { height: auto; line-height: inherit; padding: 0; border: 0; background: none; color: var(--grau); text-decoration: underline; font-size: 12px; }
.ki-info .knopf:hover { color: var(--text); background: none; }
.ki-aktion { margin-top: 6px; display: flex; justify-content: flex-end; align-items: center; gap: 6px; white-space: normal; }
.ki-blase .knopf { background: #fff; }
.ki-blase .knopf:hover { background: var(--schwarz); }
.ki-still { color: var(--grau); font-size: 12px; }
.ki-laeuft { border: 1px solid var(--rahmen); border-radius: 8px; padding: 8px 12px; color: var(--grau); font-size: 12px; }
.ki-laeuft > div:first-child { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.ki-status-zeile { padding-left: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ki-kreisel { width: 14px; height: 14px; border: 2px solid var(--rahmen); border-top-color: var(--akzent); border-radius: 50%; animation: ki-dreh .8s linear infinite; }
@keyframes ki-dreh { to { transform: rotate(360deg); } }

.ki-eingabe { flex: none; border-top: 1px solid var(--rahmen); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ki-eingabe > p { margin: 0; }
.ki-eingabe textarea { width: 100%; min-height: 72px; max-height: 192px; resize: vertical; }
.ki-fehlt { color: var(--grau); font-size: 12px; }
.ki-limit { color: var(--rot); font-size: 12px; }
.ki-teil-hinweis { padding: 4px 8px; border: 1px solid #f0e2a8; border-radius: 4px; background: #fcf9e8; color: #6b5300; font-size: 12px; }
.ki-modus-hinweis, .ki-budget { color: var(--grau); font-size: 12px; }
.ki-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ki-chips:empty { display: none; }
.ki-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 1px 4px 1px 9px; border-radius: 10px; font-size: 12px; background: #f4effd; border: 1px solid #ddd0f7; color: #4b1fa0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ki-chip-bild { background: #edfaef; border-color: #b8e6c1; color: #006c1c; }
.ki-chip button { border: 0; background: none; cursor: pointer; font-size: 15px; line-height: 1; color: inherit; padding: 0 3px; }
.ki-umfang { display: flex; align-items: center; gap: 8px; color: var(--grau); font-size: 12px; }
.ki-umfang-knoepfe { display: inline-flex; padding: 2px; border: 1px solid var(--rahmen); border-radius: 6px; }
.ki-umfang button { border: 0; background: none; border-radius: 4px; padding: 2px 8px; font: inherit; color: var(--grau); cursor: pointer; }
.ki-umfang button:hover { color: var(--text); }
.ki-umfang button.aktiv { background: var(--schwarz); color: #fff; }
.ki-knoepfe { display: flex; align-items: center; gap: 2px; }
.ki-senden { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.ki-knoepfe .ki-flach.aktiv { background: var(--akzent); }
.knopf:disabled { opacity: .45; cursor: not-allowed; }

.ki-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 80px); padding: 0; border: 1px solid var(--rahmen); border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.ki-dialog::backdrop { background: rgba(0,0,0,.35); }
.ki-dialog > div { padding: 12px 16px 16px; overflow-y: auto; }
.ki-dialog-kopf { display: flex; justify-content: space-between; align-items: center; margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--rahmen); font-size: 15px; }
.ki-schliessen { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--grau); }
.ki-vorlagen-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ki-vorlagen-liste button { width: 100%; text-align: left; border: 1px solid var(--rahmen); border-radius: 6px; background: #fff; padding: 10px 12px; font: inherit; color: var(--text); cursor: pointer; }
.ki-vorlagen-liste button:hover { border-color: var(--schwarz); }
.ki-vorlagen-liste button > span:last-child { display: block; margin-top: 3px; color: var(--grau); }
.ki-gruendlich { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 9px; background: #f4effd; color: #4b1fa0; font-size: 11px; }
.ki-vorlage-form label { display: block; margin: 0 0 12px; font-weight: 600; }
.ki-vorlage-form input[type=text], .ki-vorlage-form input[type=date], .ki-vorlage-form textarea, .ki-vorlage-form select { width: 100%; margin-top: 4px; font-weight: 400; }
.ki-vorlage-form p { margin: 0 0 12px; }
.ki-zurueck-link { border: 0; background: none; padding: 0; font: inherit; color: var(--link); cursor: pointer; }
.ki-zurueck-link:hover { color: var(--link-hover); text-decoration: underline; }
.ki-bildfeld { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-weight: 400; }

/* Unten in der Mitte: oben rechts lägen die Meldungen über den Knöpfen der Leiste. */
.ki-meldung { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 300; max-width: 420px; padding: 10px 14px; border-radius: 6px; background: var(--dunkel); color: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.ki-meldung-fehler { background: var(--rot); }

/* Protokoll und Agent-Test */
.ki-status { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--flaeche-still); color: var(--grau); white-space: nowrap; }
.ki-status-done { background: #edfaef; color: #006c1c; }
.ki-status-error { background: #fcf0f1; color: var(--rot); }
.ki-status-question { background: #fcf9e8; color: #8a6d00; }
.ki-status-handoff { background: #f4effd; color: #4b1fa0; }
.ki-status-laeuft { background: var(--flaeche-still); color: var(--text); }
.ki-pre { margin: 0; max-height: 260px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5; background: var(--flaeche-still); padding: 8px 10px; border-radius: 3px; }
td.ki-fehler .ki-pre, .ki-pre.ki-fehler { background: #fcf0f1; color: var(--rot); }
table.ki-schritte td:nth-child(3), table.ki-schritte td:nth-child(4) { width: 40%; }
.ki-anfrage { margin: 20px 0; }
.ki-anfrage summary { cursor: pointer; color: var(--link); margin-bottom: 8px; }
.ki-probleme { margin: 6px 0 0; padding-left: 18px; color: var(--rot); font-size: 12px; }

@media (max-width: 1180px) {
  .ki-breiten .ki-flach span { display: none; }
}
/* Schmal: Chat bildschirmfüllend über einen Knopf in der Leiste. */
@media (max-width: 1023px) {
  .ki-fenster { display: none; }
  .ki-editor.chat-offen .ki-fenster { display: flex; position: fixed; inset: 0; z-index: 200; width: auto; height: auto; border: 0; border-radius: 0; }
  .ki-griff, #ki-chat-zu, .ki-chat-auf { display: none !important; }
  #ki-chat-schliessen, #ki-chat-auf-klein { display: inline-flex; }
  .ki-chat-kopf #ki-chat-schliessen { margin-left: 0; }
}
@media (max-width: 767px) {
  .ki-seiten, #ki-liste-knopf, .ki-dateiname, .ki-trenner, .ki-leiste-rechts a.ki-flach { display: none !important; }
  .ki-editor #ki-seite { display: block; }
  .ki-veroeffentlichen span { display: none; }
}

/* Nach einem Konflikt im Formular: nicht gespeicherter Text zum Kopieren */
.eigener-text { padding: 10px 12px; margin-bottom: 16px; }
.eigener-text summary { cursor: pointer; font-weight: 600; }
.eigener-text textarea { display: block; width: 100%; margin-top: 8px; font: inherit; font-size: 13px; }

/* ---------- Mein Konto ---------- */

.konto-raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 980px; align-items: start; }
.konto-raster .box { margin: 0; }
@media (max-width: 900px) { .konto-raster { grid-template-columns: 1fr; } }
.konto-fakten { border-collapse: collapse; width: 100%; }
.konto-fakten th { text-align: left; font-weight: 400; color: var(--grau); padding: 6px 12px 6px 0; vertical-align: top; width: 110px; }
.konto-fakten td { padding: 6px 0; vertical-align: top; }
.konto-fakten tr + tr th, .konto-fakten tr + tr td { border-top: 1px solid var(--flaeche-still); }
.konto-form .feld-hilfe, .konto-fakten .feld-hilfe { display: block; margin-top: 4px; }
.feld-hilfe { color: var(--grau); font-size: 12px; }

/* ---------- Zwei-Faktor ---------- */

.anmeldung .zf { background: #fff; border: 1px solid var(--rahmen); padding: 22px 24px; margin-bottom: 14px; }
.anmeldung .zf p, .anmeldung .zf li { font-size: 14px; line-height: 1.5; }
.anmeldung .zf-titel { font-size: 18px; font-weight: 600; margin: 0 0 10px; }
.anmeldung .zf-aktion h2 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
.anmeldung .zf-aktion .knopf { width: 100%; text-align: center; }
.anmeldung .zf-schritte { padding-left: 20px; margin: 10px 0; }
.anmeldung .zf-qr { text-align: center; margin: 6px 0 10px; }
.anmeldung .zf-qr svg { width: 200px; height: 200px; }
.anmeldung .zf-schluessel { font-size: 13px; margin-bottom: 14px; }
.anmeldung .zf-schluessel summary { cursor: pointer; color: var(--link); }
.anmeldung .zf-schluessel code { display: block; font-size: 15px; letter-spacing: .04em; word-break: break-all; padding: 8px 10px; background: var(--flaeche-still); }
.anmeldung .zf-codes { list-style: none; padding: 0; margin: 14px 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.anmeldung .zf-codes code { display: block; text-align: center; font-size: 16px; padding: 7px 0; background: var(--flaeche-still); }
.anmeldung .zf-klein { font-size: 13px; color: var(--grau); margin: 14px 0 0; }
.anmeldung .zf .knopf-primaer { display: block; }
.stufe-stand { margin: 0; padding: 14px; border-top: 1px solid var(--flaeche-still); }
.stufen .werkzeug input[type=radio] { margin-top: 3px; }
