/* pwb-builder editor UI — self-contained, no framework. */
:root {
  --ink: #1b1f27; --muted: #6b7280; --line: #e5e7eb; --bg: #f6f7f9;
  --brand: #2f6df0; --brand-ink: #fff; --danger: #d23f3f; --ok: #1f9d55;
  /* Linktext braucht mehr Kontrast als eine Flaeche. --brand erreicht als SCHRIFT auf --bg
     nur 4.29:1 und auf Weiss 4.60:1 — unter bzw. hauchduenn ueber der AA-Grenze von 4.5:1
     (gemessen 09.08.2026 mit axe, aufgefallen an /konto/datenschutz.php, wo Links direkt auf
     dem Seitenhintergrund stehen statt auf einer weissen Karte). --link ist dieselbe Farbe,
     nur dunkler: 5.11:1 auf --bg, 5.47:1 auf Weiss. Flaechen (Knoepfe) bleiben --brand — dort
     zaehlt der Kontrast der WEISSEN Schrift darauf, und der ist eine andere Rechnung. */
  --link: #2a62d8;
  --radius: 10px;
}
* { box-sizing: border-box; }
/* The UA `[hidden]{display:none}` rule is beaten by ANY author `display:` rule (e.g. .ai-log,
   .gen-overlay) -> elements meant to be hidden stay painted. Enforce hidden globally. */
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.55 ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
input, textarea, select, button { font: inherit; }
a { color: var(--link); }

/* Buttons */
.btn-admin { background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 8px; padding: .6rem 1.1rem; cursor: pointer; font-weight: 600; }
.btn-admin:hover { filter: brightness(1.05); }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }

/* Login */
.auth-body { display: grid; place-items: center; min-height: 100vh; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; width: min(92vw, 360px); display: grid; gap: 1rem; box-shadow: 0 20px 50px -30px rgba(0,0,0,.4); }
.auth-card h1 { margin: 0; font-size: 1.3rem; }
.auth-card label { display: grid; gap: .35rem; font-size: .85rem; color: var(--muted); }
.auth-card input { padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px; }
.auth-error { color: var(--danger); margin: 0; font-size: .9rem; }

/* Topbar */
.admin-topbar { display: flex; align-items: center; gap: 1rem; padding: .7rem 1.2rem; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.admin-topbar strong { font-weight: 600; }
.topbar-link { margin-left: 0; text-decoration: none; color: var(--muted); font-size: .9rem; }
.topbar-link:last-child { margin-left: auto; }
.admin-topbar strong + .locale-tabs { margin-left: auto; }

/* Seitenwechsler (partials/seitenwechsler.php) — «welche Seite bearbeite ich gerade».
   Staendig sichtbar in der Kopfzeile, in BEIDEN Editoren derselbe. Vorher gab es ihn im
   Inhalts-Editor gar nicht und im Stil-Editor nur versteckt hinter «Erweitert»; wer die Seite
   wechseln wollte, klickte sie deshalb in der Vorschau an — und Editor und Vorschau liefen
   auseinander. Markt-Vorbild: Wix (Klappliste oben links), Shopify («template menu»). */
.seitenwahl { display: inline-flex; align-items: center; gap: .4rem; }
.seitenwahl-wort { color: var(--muted); font-size: .78rem; }
.seitenwahl select {
  font: inherit; font-size: .9rem; padding: .3rem 1.5rem .3rem .6rem;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  max-width: 15rem; cursor: pointer;
}
.seitenwahl select:hover { border-color: var(--muted); }
.seitenwahl select:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
/* Der Wechsler steht zwischen Marke und Sprachtabs — die bisherige Regel «strong + .locale-tabs»
   greift dann nicht mehr, und ohne diese Zeile klebte alles links zusammen. */
.admin-topbar .seitenwahl + .locale-tabs { margin-left: auto; }

/* Dashboard */
.admin-main { padding: 1.5rem; max-width: 760px; margin-inline: auto; }
.dash-site { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin-bottom: 1rem; }
.dash-site h2 { margin: 0 0 .6rem; font-size: 1.1rem; }
.dash-key { color: var(--muted); font-weight: 400; font-size: .8rem; }
.dash-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .2rem 0 1.1rem; }
.dash-actions .btn-admin { text-decoration: none; display: inline-flex; align-items: center; font-size: .88rem; padding: .5rem .9rem; }
.dash-del { margin: 0; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.dash-pageshint { font-size: .8rem; color: var(--muted); margin: 0 0 .4rem; }
.dash-pages { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.dash-pages a { display: inline-block; padding: .45rem .8rem; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; text-decoration: none; }

/* ---- Overview (P3 redesign): scannable site list, one primary action, rest as icons ---- */
.admin-main.ov { max-width: 940px; }
.ov-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: .3rem 0 1.4rem; }
.ov-title { margin: 0; font-size: 1.55rem; letter-spacing: -.015em; }
.ov-sub { margin: .25rem 0 0; color: var(--muted); font-size: .9rem; }
.btn-lg { text-decoration: none; display: inline-flex; align-items: center; padding: .7rem 1.2rem; font-size: .95rem; }
.ov-head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.ov-search { width: 100%; padding: .65rem .85rem; border: 1px solid var(--line); border-radius: 9px; margin: 0 0 1.1rem; background: #fff; font-size: .95rem; }
.ov-grid { display: grid; gap: .75rem; }
.ov-empty { color: var(--muted); }

.site-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; transition: box-shadow .15s ease, border-color .15s ease; }
.site-card:hover { border-color: #cdd5e0; box-shadow: 0 8px 24px -18px rgba(0,0,0,.4); }
.site-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-id { display: flex; align-items: baseline; gap: .55rem; min-width: 0; }
.site-id h2 { margin: 0; font-size: 1.08rem; }
.site-id h2 a { color: var(--ink); text-decoration: none; }
.site-id h2 a:hover { color: var(--brand); }
.site-key { color: var(--muted); font-size: .76rem; }
.site-meta { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: .25rem; padding: .22rem .55rem; border-radius: 999px; font-size: .73rem; font-weight: 600; background: var(--bg); color: var(--muted); border: 1px solid var(--line); text-decoration: none; }
.chip-lead { background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 30%, #fff); }
.chip-qa { color: var(--qa); border-color: color-mix(in srgb, var(--qa) 38%, var(--line)); background: color-mix(in srgb, var(--qa) 8%, #fff); }

.site-actions { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-top: .75rem; }
.site-actions form { margin: 0; display: inline-flex; }
.site-actions .btn-admin { text-decoration: none; display: inline-flex; align-items: center; padding: .5rem 1rem; margin-right: .25rem; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; text-decoration: none; font-size: .95rem; color: var(--ink); transition: border-color .12s ease, background .12s ease; }
.icon-btn:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, #fff); }
.icon-danger:hover { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, #fff); }

.site-pages { margin-top: .8rem; border-top: 1px solid var(--line); }
.site-pages > summary { cursor: pointer; font-size: .82rem; color: var(--muted); padding: .6rem 0 .2rem; list-style: none; user-select: none; }
.site-pages > summary::-webkit-details-marker { display: none; }
.site-pages > summary::before { content: "▸ "; }
.site-pages[open] > summary::before { content: "▾ "; }
.site-pages-body { padding: .4rem 0 .3rem; display: grid; gap: .8rem; }
.dash-pages li { display: inline-flex; align-items: center; }
.dash-pages li form { margin: 0; display: inline-flex; }
.add-page-form { display: flex; gap: .5rem; max-width: 460px; margin: 0; }
.add-page-form input[type=text] { flex: 1; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 8px; }
.page-del { border: none; background: none; color: var(--danger); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .2rem; }
.golive-hint { font-size: .75rem; color: #94a3b8; margin: 0; }
.golive-hint code { background: var(--bg); padding: .1rem .35rem; border-radius: 4px; }

/* Editor advisory panels (P3): fold the long notes/QA lists into a quiet summary so the
   KI-Assistent + block editing lead the pane. IDs/JS inside the lists are unchanged. */
.notes-fold > summary, .qa-fold > summary { cursor: pointer; font-size: .84rem; font-weight: 700; color: var(--ink); list-style: none; padding: .1rem 0 .3rem; user-select: none; }
.notes-fold > summary::-webkit-details-marker, .qa-fold > summary::-webkit-details-marker { display: none; }
.notes-fold > summary::before, .qa-fold > summary::before { content: '▸ '; color: var(--brand); }
.notes-fold[open] > summary::before, .qa-fold[open] > summary::before { content: '▾ '; }

/* Locale tabs */
.locale-tabs { display: flex; gap: .25rem; }
.locale-tab { text-decoration: none; padding: .3rem .55rem; border-radius: 6px; color: var(--muted); font-size: .8rem; font-weight: 600; }
.locale-tab.is-active { background: var(--brand); color: var(--brand-ink); }

/* Editor split */
.editor-split { display: grid; grid-template-columns: 1fr; gap: 0; height: calc(100vh - 53px); }
@media (min-width: 64rem) { .editor-split { grid-template-columns: minmax(360px, 460px) 1fr; } }
.editor-pane { overflow-y: auto; padding: 1.2rem; border-right: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; }
/* P3c: the KI-Prompt is the primary action -> it leads the pane (above notes/QA/blocks). Pure CSS
   reorder (order:-1) so no fragile markup move; every other child keeps source order (default 0). */
.editor-pane > .pwb-ai-panel { order: -1; margin-top: 0; }
/* keep each panel at its natural height + let the pane scroll (flex default would shrink them to fit). */
.editor-pane > * { flex-shrink: 0; }
.preview-pane { background: #fff; min-height: 50vh; }
.preview-pane iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 64rem) { .preview-pane { height: 60vh; } }

/* Telefon: die Kopfzeile ist ein flex ohne wrap. Auf 390 lief sie aus dem Bild hinaus und zog die
   ganze Seite auf 526 px Breite — "Abmelden" war nicht erreichbar, und der Body scrollte quer.
   Gemessen am 2026-08-01 im Hintergrund-Editor. Rein additiv unter einer max-width-Abfrage: am
   Desktop aendert sich nichts, und auf dem Telefon war der Zustand ohnehin unbedienbar.
   Der Hinweis "Aenderungen werden automatisch gespeichert" weicht — er kostet eine ganze Zeile
   und sagt nichts, was ein Klick nicht auch zeigt. */
@media (max-width: 40rem) {
  .admin-topbar { flex-wrap: wrap; gap: .45rem .9rem; padding: .55rem .8rem; }
  .admin-topbar > strong { width: 100%; order: -1; font-size: .95rem; }
  .admin-topbar .edit-hint { display: none; }
  .admin-topbar span { margin-left: 0 !important; flex-wrap: wrap; gap: .9rem !important; }
  /* Der Seitenwechsler ist auf dem Telefon das WICHTIGSTE Bedienelement der Kopfzeile: ohne ihn
     bleibt nur der Umweg ueber die Uebersicht. Er bekommt deshalb eine eigene Zeile statt sich
     auf 4rem zusammenquetschen zu lassen — er darf nicht in .admin-topbar span verschwinden. */
  .seitenwahl { width: 100%; order: -1; }
  .seitenwahl select { flex: 1; max-width: none; }
}

.edit-hint { font-size: .82rem; color: var(--muted); margin: 0 0 1rem; }
.editor-savebar { position: sticky; bottom: 0; padding: .9rem 0 .2rem; background: linear-gradient(transparent, var(--bg) 35%); }

/* Block cards */
.block-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; overflow: hidden; }
.block-head { display: flex; align-items: center; justify-content: space-between; padding: .6rem .8rem; background: #fafbfc; border-bottom: 1px solid var(--line); }
.block-type { font-weight: 600; font-size: .9rem; }
.block-actions { display: flex; gap: .25rem; }
.ic { border: 1px solid var(--line); background: #fff; border-radius: 6px; width: 28px; height: 28px; cursor: pointer; color: var(--muted); }
.ic:hover { color: var(--ink); }
.ic-del:hover { color: var(--danger); border-color: var(--danger); }
.block-fields { padding: .9rem; display: grid; gap: .8rem; }

/* Fields */
.fld { display: grid; gap: .3rem; }
.fld-label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.fld input, .fld textarea { width: 100%; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.fld textarea { resize: vertical; }
.fld-group { border: 1px solid var(--line); border-radius: 8px; padding: .7rem; display: grid; gap: .7rem; }
.fld-group legend { font-size: .78rem; color: var(--muted); font-weight: 600; padding: 0 .3rem; }
.fld-list { display: grid; gap: .6rem; }
.item-card { border: 1px dashed var(--line); border-radius: 8px; padding: .7rem; display: grid; gap: .6rem; position: relative; }
.item-no { font-size: .7rem; color: var(--muted); }

.add-block { display: flex; gap: .5rem; margin: .5rem 0 1rem; }
.add-block select { flex: 1; padding: .5rem; border: 1px solid var(--line); border-radius: 7px; background: #fff; }

/* Background gallery */
.bg-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
@media (min-width: 30rem) { .bg-gallery { grid-template-columns: repeat(3, 1fr); } }
.bg-tile { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 0; cursor: pointer; overflow: hidden; text-align: left; transition: border-color .15s ease, transform .15s ease; }
.bg-tile:hover { transform: translateY(-2px); }
.bg-tile.is-active { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.bg-thumb { display: block; height: 84px; }
.bg-label { display: block; padding: .5rem .7rem; font-size: .85rem; font-weight: 600; }
.thumb-none   { background: linear-gradient(135deg,#f4f5f7,#e6e9f0); }
.thumb-aurora { background: radial-gradient(45% 60% at 25% 30%,#9bd0ff,transparent 70%),radial-gradient(45% 60% at 78% 28%,#7aa2ff,transparent 70%),radial-gradient(55% 65% at 55% 85%,#4f6cf0,transparent 75%),#0e1320; }
.thumb-mesh   { background: radial-gradient(45% 55% at 30% 35%,#d8b878,transparent 60%),radial-gradient(45% 55% at 75% 30%,#8a6a3a,transparent 60%),#16120c; }
.thumb-field  { background-color:#0e1320; background-image: radial-gradient(circle,#9ab8ff 1px,transparent 1.5px); background-size: 11px 11px; }
.thumb-silk   { background: linear-gradient(120deg,#9aa6c8,#1a2030 45%,#828fb6); }
.thumb-rays   { background: radial-gradient(60% 95% at 50% -12%,#cfe6ff,transparent 60%),#0e1320; }

/* Drag-drop uploader */
.pwb-uploader { display: grid; gap: .6rem; }
.uz-zone { border: 2px dashed var(--line); border-radius: 10px; padding: 1.3rem; text-align: center; color: var(--muted); cursor: pointer; font-size: .85rem; background: #fff; transition: border-color .15s, background .15s; }
.uz-zone.over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, #fff); color: var(--ink); }
.uz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: .5rem; }
.uz-tile { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f2f4f7; aspect-ratio: 1; }
.uz-tile img { width: 100%; height: 68%; object-fit: cover; display: block; }
.uz-tile input { width: 100%; border: 0; border-top: 1px solid var(--line); font-size: .7rem; padding: .25rem .35rem; }
.uz-del { position: absolute; top: .25rem; right: .25rem; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: .7rem; line-height: 1; padding: 0; }
.uz-loading { display: grid; place-items: center; }
.uz-spin { width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: uzspin .7s linear infinite; }
@keyframes uzspin { to { transform: rotate(360deg); } }

/* Toast */
.toast { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); background: var(--ok); color: #fff; padding: .5rem 1rem; border-radius: 999px; font-size: .85rem; z-index: 10; box-shadow: 0 10px 30px -12px rgba(0,0,0,.4); animation: toastIn .2s ease; }
.toast-err { background: var(--danger); top: 104px; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -6px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* Gallery manager (editor) */
.gm-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .7rem; }
.gm-layout-label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.gm-select { padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 7px; font: inherit; background: #fff; color: var(--ink); }
.gm-count { margin-left: auto; font-size: .78rem; color: var(--muted); }
.gm-count.full { color: var(--danger); font-weight: 600; }
.gm-radio { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; }
.gm-list { display: grid; gap: .5rem; margin-bottom: .7rem; }
.gm-empty { color: var(--muted); font-size: .85rem; margin: .2rem 0; }
.gm-row { display: grid; grid-template-columns: auto 56px 1fr auto; align-items: center; gap: .6rem;
  border: 1px solid var(--line); border-radius: 9px; padding: .45rem .55rem; background: #fff; }
.gm-row.over { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 22%, transparent); }
.gm-row.dragging { opacity: .5; }
.gm-handle { cursor: grab; color: var(--muted); font-size: 1.1rem; line-height: 1; padding: 0 .15rem; user-select: none; }
.gm-handle:active { cursor: grabbing; }
.gm-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: #f2f4f7; display: block; }
.gm-fields { display: grid; gap: .35rem; min-width: 0; }
.gm-fields input { width: 100%; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 6px; font-size: .82rem; }
.gm-del { width: 28px; height: 28px; border: 1px solid var(--line); background: #fff; border-radius: 6px; color: var(--muted); cursor: pointer; }
.gm-del:hover { color: var(--danger); border-color: var(--danger); }
.gm-loading { grid-template-columns: auto 1fr; color: var(--muted); font-size: .82rem; }
.gm-zone { border: 2px dashed var(--line); border-radius: 10px; padding: 1.1rem; text-align: center; color: var(--muted); cursor: pointer; font-size: .85rem; background: #fff; transition: border-color .15s, background .15s; }
.gm-zone.over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, #fff); color: var(--ink); }

/* +Bereich image panel (areas.js) */
.pwb-areas { display: grid; gap: .8rem; }
.ar-list { display: grid; gap: .8rem; }
.ar-card { border: 1px solid var(--line); border-radius: 10px; padding: .9rem; background: #fff; display: grid; gap: .7rem; }
.ar-head { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem; }
.ar-fld { display: grid; gap: .25rem; font-size: .72rem; color: var(--muted); }
.ar-fld select, .ar-fld input { padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 7px; font: inherit; background: #fff; color: var(--ink); }
.ar-head .ar-delarea { margin-left: auto; width: 30px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 7px; color: var(--muted); cursor: pointer; align-self: center; }
.ar-head .ar-delarea:hover { color: var(--danger); border-color: var(--danger); }
.ar-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .5rem; }
.ar-imgs:empty { display: none; }
.ar-thumb { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f2f4f7; aspect-ratio: 1; display: grid; }
.ar-thumb img { width: 100%; height: 66%; object-fit: cover; display: block; }
.ar-thumb input { width: 100%; border: 0; border-top: 1px solid var(--line); font-size: .68rem; padding: .22rem .3rem; }
.ar-delimg { position: absolute; top: .22rem; right: .22rem; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: .68rem; line-height: 1; padding: 0; }
.ar-thumb .uz-spin { place-self: center; }
.ar-zone { border: 2px dashed var(--line); border-radius: 9px; padding: .9rem; text-align: center; color: var(--muted); cursor: pointer; font-size: .82rem; background: #fff; transition: border-color .15s, background .15s; }
.ar-zone.over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, #fff); color: var(--ink); }
.ar-add { justify-self: start; }

/* inline photo slot (photo-slot.js) — hero & card images */
.pwb-photo { gap: .45rem; }
.pwb-photo .photo-prev { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f2f4f7; max-width: 220px; }
.pwb-photo .photo-prev img { width: 100%; max-height: 150px; object-fit: cover; display: block; }
.pwb-photo .photo-empty { font-size: .78rem; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; padding: .6rem .7rem; background: #fff; }
.photo-acts { display: flex; flex-wrap: wrap; gap: .4rem; }
.btn-mini { padding: .35rem .6rem; font-size: .78rem; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 7px; cursor: pointer; }
.btn-mini:hover { border-color: var(--brand); color: var(--brand); }
.btn-mini:disabled { opacity: .55; cursor: default; }
.btn-mini-del:hover { border-color: var(--danger); color: var(--danger); }

/* click-to-edit: flash the form card when its block is clicked in the preview */
.block-card.pwb-flash { animation: pwbflash 1.4s ease; }
@keyframes pwbflash { 0%, 35% { box-shadow: 0 0 0 3px #2f6df0; } 100% { box-shadow: 0 0 0 0 rgba(47,109,240,0); } }

/* conversational AI panel — the primary editing action, visually the hero of the pane (P3c) */
.pwb-ai-panel { border: 2px solid #2f6df0; box-shadow: 0 10px 30px -16px rgba(47,109,240,.55); }
.pwb-ai-panel .block-head { background: linear-gradient(90deg, color-mix(in srgb, #2f6df0 16%, #fff), #fff); padding-block: .75rem; }
.pwb-ai-panel .block-type { font-size: 1rem; font-weight: 700; }
.pwb-ai-panel textarea { min-height: 84px; border: 2px solid color-mix(in srgb, #2f6df0 38%, #fff); }
.pwb-ai-panel textarea::placeholder { color: #94a3b8; }
.pwb-ai-panel textarea:focus { border-color: #2f6df0; outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, #2f6df0 18%, transparent); }
.pwb-ai-panel #aiSend { font-size: .95rem; padding: .6rem 1.3rem; }
.ai-credits { font-size: .78rem; font-weight: 700; color: #2f6df0; text-decoration: none; }
.ai-credits:hover { text-decoration: underline; }
/* Echte API-Kosten des letzten Aufrufs. Bewusst ruhig gesetzt: eine Information, keine Warnung. */
.ai-kosten { font-size: .72rem; color: #667085; margin-right: .55rem; font-variant-numeric: tabular-nums; }
.pwb-ai-panel textarea { width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 9px; font: inherit; resize: vertical; }
.ai-row { display: flex; gap: .6rem; align-items: center; margin-top: .55rem; }
.ai-log { display: grid; gap: .4rem; margin-bottom: .6rem; max-height: 220px; overflow-y: auto; }
.ai-msg { padding: .45rem .6rem; border-radius: 9px; font-size: .82rem; line-height: 1.4; white-space: pre-wrap; }
.ai-you { background: var(--bg); color: var(--ink); justify-self: end; max-width: 90%; border: 1px solid var(--line); }
.ai-ai { background: color-mix(in srgb, #2f6df0 8%, #fff); color: var(--ink); border: 1px solid color-mix(in srgb, #2f6df0 30%, #fff); max-width: 92%; }
