/* ==========================================================================
   Consent Hub – Oberfläche (heller Modus), Optik des hauseigenen CRM-Hubs (wird dort Modul)
   Tokens und Bausteine des CRM-Design-Systems: Karten Radius 13 mit Haarlinie,
   Buttons Radius 9, Inputs Radius 8, System-Schrift 14px, Akzent sparsam
   (ein Primär-Button je Ansicht, aktiver Nav-Eintrag, Schalter), Status als
   getönte Pille, Feedback per Toast, Werte als Text. Analytik monochrom.
   ========================================================================== */

:root {
	--bg: #f4f5f7; --rail: #ffffff; --surface: #ffffff; --surface2: #f8fafc; --surface3: #f1f3f5;
	--border: #e4e7ec; --border2: #eef1f4;
	--text: #16191d; --text2: #5b6675; --text3: #98a1ad;
	/* AllInOne MEDIA – Corporate Design: Petrol als Primärfarbe, Grün als Akzent. */
	--accent: #023047; --accent2: #012a3f; --accent-rgb: 2,48,71;
	--brand-green: #08c16a; --brand-secondary: #003d68;
	--ok: #16a34a; --warn: #d97706; --danger: #dc2626; --info: #2563eb;
	--shadow: 0 8px 32px rgba(15,23,42,.12); --shadow-sm: 0 1px 2px rgba(0,0,0,.14);
	--font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--w-light: 300; --w-reg: 400; --w-med: 600;
	--ink: #16191d;
	--t-accept: #16191d; --t-custom: #98a1ad; --t-reject: #d8dce2;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
svg.ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
[hidden] { display: none !important; }
.tiny { font-size: 11px; color: var(--text3); }
.muted { color: var(--text2); }
.mono { font-variant-numeric: tabular-nums; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.leer { font-size: 12.5px; color: var(--text3); margin: 10px 0 2px; }
.leer.center { text-align: center; padding: 30px 16px; margin: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.right { margin-left: auto; }
.is-neg { color: var(--danger); }

/* ---------------------------------------------------------------- Schale */
.app { display: grid; grid-template-columns: 240px 1fr; height: 100vh; }
.sidebar { background: var(--rail); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 0 18px; height: 56px; border-bottom: 1px solid var(--border2); }
.sb-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.sb-mark svg.ico { width: 15px; height: 15px; }
.sb-logo { max-height: 24px; max-width: 150px; width: auto; height: auto; display: block; }
.sb-name { font-weight: 700; font-size: 14px; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.sb-crm { font-size: 10px; font-weight: 700; color: var(--text3); letter-spacing: .08em; text-transform: uppercase; }
.sb-scroll { flex: 1 1 auto; overflow-y: auto; padding: 12px 10px; }
.sb-group { margin-bottom: 14px; }
.sb-group-label { font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text3); padding: 4px 10px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--text2); cursor: pointer; font-size: 13.5px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; transition: background .12s, color .12s; width: 100%; background: none; text-align: left; }
.nav-item:hover { background: var(--surface3); color: var(--text); }
.nav-item.active { background: rgba(var(--accent-rgb), .13); color: var(--accent2); border-color: rgba(var(--accent-rgb), .22); }
.nav-item svg.ico { width: 18px; height: 18px; color: var(--text3); }
.nav-item.active svg.ico { color: var(--accent2); }
.nav-label { overflow: hidden; text-overflow: ellipsis; }
.nav-count { margin-left: auto; font-size: 10.5px; font-weight: 600; color: var(--text3); font-variant-numeric: tabular-nums; }
.sb-foot { border-top: 1px solid var(--border2); padding: 10px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { flex: none; height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 20px; background: var(--bg); border-bottom: 1px solid var(--border); }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text3); min-width: 0; }
.crumbs .cur { color: var(--text); font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub { display: flex; align-items: center; gap: 8px; flex: none; }
.pub-state { font-size: 12.5px; color: var(--text3); white-space: nowrap; }
/* Eingebettet (CRM): Zurück-Link über dem Titel, Abschnitte als Reiter-Zeile unter dem Kopf */
.wm-back { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 500; color: var(--text3); text-decoration: none; margin-bottom: 4px; }
.wm-back:hover { color: var(--text); }
.wm-back svg.ico { width: 13px; height: 13px; }
.wm-tabs { margin: -6px 0 16px; flex-wrap: wrap; }
.wm-tabs .seg-btn { text-decoration: none; }
.content { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 22px 24px 60px; }
.maxw { max-width: 1480px; margin: 0 auto; }

/* ---------------------------------------------------------------- Seitenkopf */
.page-head { margin-bottom: 20px; }
.page-head-row { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -.4px; line-height: 1.2; }
.page-sub { font-size: 13.5px; color: var(--text2); margin-top: 3px; }
.ph-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* Typenschild */
.plate { display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; overflow: hidden; margin-bottom: 14px; }
.plate-main { flex: 1; min-width: 0; padding: 14px 18px; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.plate-main h1 { font-size: 21px; font-weight: 700; letter-spacing: -.3px; margin: 0; overflow-wrap: anywhere; }
.plate-m { font-size: 12.5px; color: var(--text2); overflow-wrap: anywhere; }
.plate-s { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 18px; }
.plate-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--text3); margin: 0 5px 1px 0; vertical-align: middle; }
.plate-dot.ok { background: var(--ok); }
.plate-dot.warn { background: var(--warn); }
.plate-m a.plate-link { color: var(--text2); text-decoration: none; display: inline-flex; align-items: center; gap: 3px; }
.plate-m a.plate-link:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.plate-m a.plate-link svg.ico { width: 11px; height: 11px; color: var(--text3); }

/* ---------------------------------------------------------------- Kennzahlen + Verlauf */
.stats { display: flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; margin-bottom: 16px; overflow: hidden; }
.stat { flex: 1 1 160px; min-width: 0; padding: 15px 18px 13px; border-right: 1px solid var(--border2); }
.stat:last-of-type { border-right: 0; }
.stat-l { font-size: 12px; font-weight: 500; color: var(--text2); }
.stat-n { font-size: 28px; font-weight: 600; letter-spacing: -.8px; line-height: 1.1; margin: 5px 0 4px; font-variant-numeric: tabular-nums; color: var(--text); }
.stat-n .suf { font-size: 15px; font-weight: 500; color: var(--text2); margin-left: 2px; letter-spacing: 0; }
.stat-d { font-size: 11.5px; color: var(--text3); font-variant-numeric: tabular-nums; }
.stat-band { flex: 1 1 100%; padding: 2px 18px 14px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--border2); padding-top: 12px; }
.mbar { display: flex; height: 7px; border-radius: 4px; overflow: hidden; background: var(--surface3); flex: 1 1 260px; }
.mbar-seg { display: block; height: 100%; }
.mbar-seg + .mbar-seg { box-shadow: inset 1px 0 0 var(--surface); }
.mlegend { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.mleg { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text3); }
.mleg i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.mleg b { color: var(--text2); font-weight: 600; font-variant-numeric: tabular-nums; }
.tone-accept { background: var(--t-accept); }
.tone-custom { background: var(--t-custom); }
.tone-reject { background: var(--t-reject); }

.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-wrap .grid line { stroke: var(--border2); stroke-width: 1; }
.chart-wrap .axis text { fill: var(--text3); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-wrap .area { fill: var(--ink); fill-opacity: .05; }
.chart-wrap .line { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-wrap .dot { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
.chart-wrap .hair { stroke: var(--text3); stroke-width: 1; stroke-dasharray: 2 3; }
.chart-wrap .hit { fill: transparent; cursor: crosshair; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 9px 12px; font-size: 12px; min-width: 170px; }
.chart-tip b { display: block; font-weight: 700; margin-bottom: 5px; }
.chart-tip .r { display: flex; align-items: center; gap: 8px; padding: 1px 0; color: var(--text2); }
.chart-tip .r i { width: 10px; height: 2px; border-radius: 1px; }
.chart-tip .r span { margin-left: auto; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-tip .r.total { border-top: 1px solid var(--border2); margin-top: 4px; padding-top: 4px; }

.bd-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 10px; font-size: 13px; margin: 0 -10px; border-radius: 7px; overflow: hidden; }
.bd-row + .bd-row { margin-top: 2px; }
.bd-row .bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--surface3); z-index: 0; border-radius: 7px; }
.bd-row .k, .bd-row .v { position: relative; z-index: 1; }
.bd-row .k { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-row .v { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; white-space: nowrap; }
.bd-row .v small { color: var(--text3); font-weight: 500; margin-left: 6px; }
.bd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
@media (max-width: 1100px) { .bd-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Chart-Boxen (12er-Raster) */
.boxes { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.boxes > .card, .boxes > .card + .card { margin: 0; min-width: 0; }   /* höhere Spezifität als .card + .card */
.boxes .span-4 { grid-column: span 4; }
.boxes .span-6 { grid-column: span 6; }
.boxes .span-8 { grid-column: span 8; }
.box-val { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; display: inline-flex; align-items: baseline; gap: 6px; }
.box-val small { font-size: 11.5px; font-weight: 500; color: var(--text3); }
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(70px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.hb-k { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text2); }
.hb-track { display: block; height: 8px; border-radius: 4px; background: var(--surface3); overflow: hidden; }
.hb-track i { display: block; height: 100%; border-radius: 4px; background: var(--ink); min-width: 2px; }
.hb-v { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.hb-v small { color: var(--text3); font-weight: 500; margin-left: 6px; }
.donut-row { display: flex; align-items: center; gap: 18px; }
.donut-wrap { position: relative; width: 132px; height: 132px; flex: none; }
.donut { width: 100%; height: 100%; display: block; }
.donut circle { fill: none; stroke-width: 11; transform: rotate(-90deg); transform-origin: 50% 50%; }
.donut .track { stroke: var(--surface3); }
.donut .tone-accept { stroke: var(--t-accept); background: none; }
.donut .tone-custom { stroke: var(--t-custom); background: none; }
.donut .tone-reject { stroke: var(--t-reject); background: none; }
.donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut-c b { font-size: 20px; font-weight: 600; letter-spacing: -.5px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.donut-c span { font-size: 11px; color: var(--text3); }
.dlegend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.dleg { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text2); }
.dleg i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dleg b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.dleg small { color: var(--text3); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.chk-list { display: flex; flex-direction: column; margin: -6px 0; }
.chk { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border2); color: var(--text); font-size: 13px; }
.chk:last-child { border-bottom: 0; }
.chk:hover .chk-l { color: var(--accent2); }
.chk-ic { width: 20px; height: 20px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.chk.ok .chk-ic { background: rgba(34,197,94,.14); color: var(--ok); }
.chk.warn .chk-ic { background: rgba(245,158,11,.16); color: var(--warn); }
.chk-l { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chk-l small { font-size: 11.5px; color: var(--text3); }
.chk > svg.ico { color: var(--text3); }
/* Konformitäts-Score: Ring mit Zahl (Typenschild klein, Übersichts-Karte groß) */
.ring { position: relative; flex: none; }
.ring svg { display: block; width: 100%; height: 100%; }
.ring circle { fill: none; stroke-width: 3.4; transform: rotate(-90deg); transform-origin: 50% 50%; }
.ring .track { stroke: var(--surface3); }
.ring .val { stroke: var(--ink); stroke-linecap: round; }
.ring .n { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; letter-spacing: -.3px; font-variant-numeric: tabular-nums; color: var(--text); }
.score-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; background: none; border: 1px solid transparent; padding: 6px 10px 6px 8px; border-radius: 10px; cursor: pointer; text-align: left; color: var(--text); font: inherit; }
.score-btn:hover { background: var(--surface3); }
.score-k { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); }
.score-r { display: flex; align-items: center; gap: 10px; }
.score-r b { font-size: 13.5px; font-weight: 600; }
/* Prüfpunkte-Popup */
.modal-card.md { width: 760px; }
.score-modal .score-head { padding-bottom: 14px; border-bottom: 1px solid var(--border2); margin-bottom: 2px; }
.sp-h { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); padding: 14px 0 4px; display: flex; align-items: center; }
.score-modal .chk-list { margin: 0; }
.chk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.chk-grid .chk:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
@media (max-width: 860px) { .chk-grid { grid-template-columns: 1fr; } }
.score-head { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.score-big { font-size: 28px; font-weight: 600; letter-spacing: -.8px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.score-big small { font-size: 13px; color: var(--text3); font-weight: 500; letter-spacing: 0; margin-left: 4px; }
.score-sub { font-size: 12.5px; color: var(--text2); margin-top: 3px; }
.score-head + .chk-list { border-top: 1px solid var(--border2); padding-top: 6px; margin-top: 0; }
@media (max-width: 1100px) { .boxes .span-4, .boxes .span-6, .boxes .span-8 { grid-column: span 12; } }

/* ---------------------------------------------------------------- Karten & Spalten */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; overflow: hidden; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 9px; padding: 13px 16px; border-bottom: 1px solid var(--border2); min-height: 50px; }
.card-title { font-size: 13.5px; font-weight: 600; }
.card-head .ch-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 16px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 10px 16px; border-top: 1px solid var(--border2); }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .state { font-size: 12.5px; color: var(--text3); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.cols-2-1 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; align-items: start; }
.detail-cols { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.design-cols { display: grid; grid-template-columns: 410px 1fr; gap: 16px; align-items: start; }
.cols > *, .cols-2-1 > *, .detail-cols > *, .design-cols > * { min-width: 0; }
.cols .card + .card, .cols-2-1 .card + .card, .detail-cols .card + .card, .design-cols .card + .card { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack .card + .card { margin-top: 0; }
.savebar { position: sticky; bottom: 12px; z-index: 5; margin-top: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 10px 16px; box-shadow: var(--shadow); }
.lang-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.doc-tile { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 16px 18px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; color: var(--text); font: inherit; transition: border-color .12s; }
.doc-tile:hover { border-color: var(--text3); }
.doc-tile.active { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.dt-head { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; }
.dt-head svg.ico { color: var(--text3); width: 18px; height: 18px; }
.doc-tile.active .dt-head svg.ico { color: var(--accent2); }
.dt-sub { font-size: 12.5px; color: var(--text2); }
.dt-state { font-size: 11.5px; color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
code.url { display: inline-block; max-width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; overflow-wrap: anywhere; }
.embed-cols { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
.legal-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.embed-cols > *, .legal-cols > * { min-width: 0; }
.embed-cols .card + .card, .legal-cols .card + .card { margin-top: 0; }
.sticky { position: sticky; top: 0; }
@media (max-width: 1100px) { .cols-2-1, .detail-cols, .design-cols, .embed-cols, .legal-cols { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .doc-tiles { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

.cfg-section { padding: 6px 0 2px; }
.cfg-section + .cfg-section { border-top: 1px solid var(--border2); margin-top: 8px; padding-top: 14px; }
.cfg-h { font-size: 11px; font-weight: 700; letter-spacing: .05em; color: var(--text3); text-transform: uppercase; margin-bottom: 9px; display: flex; align-items: center; gap: 8px; }
.cfg-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13px; }
.cfg-row .k { color: var(--text2); display: flex; align-items: center; gap: 8px; min-width: 0; }
.cfg-row .v { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.cfg-row .v.dim { color: var(--text3); font-weight: 500; }
.cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.cfg-grid .cfg-row { padding: 6px 0; }
.props { display: flex; flex-direction: column; }
.prop { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; font-size: 13px; border-bottom: 1px solid var(--border2); }
.prop:last-child { border-bottom: 0; }
.prop-k { width: 120px; flex: none; color: var(--text2); font-size: 12.5px; padding-top: 1px; }
.prop-v { flex: 1; min-width: 0; }

/* Banner-Builder: Unterkategorien als Akkordeon, Schemata für Layout und Position, Vorschau-Kacheln */
.acc { padding: 6px 16px 4px; }
.acc-h { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 4px; border: 0; border-bottom: 1px solid var(--border2); background: none; color: var(--text); font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left; }
.acc-h svg.ico:first-child { color: var(--text3); }
.acc-h .acc-l { flex: none; }
.acc-h .acc-sum { flex: 1; min-width: 0; font-size: 12px; font-weight: 500; color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.acc-h > svg.ico:last-child { color: var(--text3); transition: transform .15s; }
.acc-h.open > svg.ico:last-child { transform: rotate(90deg); }
.acc-h.open { border-bottom-color: transparent; }
.acc-h.open svg.ico:first-child { color: var(--accent2); }
/* Körper klappen über grid-template-rows animiert auf/zu (0fr -> 1fr), damit beim Wechsel nichts springt. */
.acc-b { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease; border-bottom: 1px solid transparent; }
.acc-b.open { grid-template-rows: 1fr; border-bottom-color: var(--border2); }
.acc-i { overflow: hidden; min-height: 0; }
.acc-p { padding: 2px 4px 12px; opacity: 0; transition: opacity .18s ease .06s; }
.acc-b.open .acc-p { opacity: 1; }
.acc-p .anat:last-child, .acc-p .cfg-row:last-child { border-bottom: 0; }
.lay-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 2px 0 8px; }
.lay-pick.two { grid-template-columns: repeat(2, 1fr); margin: 0; min-width: 190px; }
.lay-pick.two .lay-btn { padding: 6px 6px 5px; font-size: 11px; }
.lay-pick.two .lay-btn svg { width: 40px; height: 28px; }
.ptiles { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.ptile { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface2); color: var(--text2); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: border-color .12s, background .12s, color .12s; }
.ptile svg.ico { width: 15px; height: 15px; color: var(--text3); }
.ptile:hover { background: var(--surface); color: var(--text); }
.ptile.active { border-color: var(--text); background: var(--surface); color: var(--text); }
.ptile.active svg.ico { color: var(--text); }
.preview-note { font-size: 12.5px; color: var(--text2); background: var(--surface2); border: 1px solid var(--border); border-radius: 9px; padding: 8px 12px; margin-bottom: 10px; }
.preview-full { position: fixed; inset: 0; z-index: 250; background: var(--bg); display: flex; flex-direction: column; padding: 12px 16px 16px; gap: 10px; }
.preview-full .pf-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.preview-full .pf-bar .ptiles { margin: 0; }
.preview-full .pf-bar .ch-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.preview-full .preview { flex: 1 1 auto; min-height: 0; }
.preview-full .preview iframe { height: 100%; min-height: 0; }
.preview-full .preview-note { margin: 0; }
.lay-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 8px 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface2); font-size: 12px; font-weight: 600; color: var(--text2); cursor: pointer; transition: border-color .12s, background .12s; }
.lay-btn svg { width: 52px; height: 36px; display: block; }
.lay-btn .pg { fill: var(--surface3); stroke: var(--border); stroke-width: 1; }
.lay-btn .dl { fill: var(--text3); }
.lay-btn:hover { background: var(--surface); color: var(--text); }
.lay-btn.active { border-color: var(--text); background: var(--surface); color: var(--text); }
.lay-btn.active .dl { fill: var(--text); }
.anat { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border2); }
.anat:last-child { border-bottom: 0; }
.anat-k { display: flex; flex-direction: column; min-width: 0; flex: 1 1 120px; font-size: 13px; color: var(--text); }
.anat-k small { font-size: 11.5px; color: var(--text3); line-height: 1.35; }
.anat.sub { padding-left: 14px; border-bottom: 0; margin-top: -4px; }
.anat.sub .anat-k { color: var(--text2); font-size: 12.5px; }
.anat-c { flex: 0 1 auto; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.anat-c select.inp.compact { max-width: 230px; }
.doc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border2); flex-wrap: wrap; }
.doc-row:last-child { border-bottom: 0; }
.doc-k { display: flex; flex-direction: column; min-width: 160px; }
.doc-k small { font-size: 11.5px; color: var(--text3); }
.doc-c { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.steps { display: flex; flex-direction: column; gap: 20px; }
.step { display: flex; gap: 14px; }
.step-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--text); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.step-b { flex: 1; min-width: 0; }
.step-t { font-size: 13.5px; font-weight: 600; margin: 4px 0 10px; }
.step-note { font-size: 12.5px; color: var(--text2); margin-top: 8px; }

/* ---------------------------------------------------------------- Pillen, Tags, Chips */
.pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; line-height: 1.3; }
.pill .pdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.green { background: rgba(34,197,94,.14); color: var(--ok); }
.pill.amber { background: rgba(245,158,11,.14); color: var(--warn); }
.pill.red { background: rgba(239,68,68,.14); color: var(--danger); }
.pill.blue { background: rgba(59,130,246,.14); color: var(--info); }
.pill.gray { background: var(--surface3); color: var(--text2); }
.pill.solid { background: var(--surface3); color: var(--text2); }
.tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--surface3); border: 1px solid var(--border); color: var(--text2); white-space: nowrap; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text2); padding: 6px 11px; min-height: 34px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; }
.filter-chip:hover { color: var(--text); }
.filter-chip.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.filter-chip svg.ico { width: 13px; height: 13px; }
select.filter-chip { appearance: none; -webkit-appearance: none; padding-right: 26px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b6675' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 9px center; }

/* ---------------------------------------------------------------- Buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: all .12s; white-space: nowrap; }
.btn:hover { background: var(--surface3); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg.ico { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger-text { color: var(--danger); }
.icon-btn { width: 32px; height: 32px; flex: none; border: 1px solid var(--border); background: var(--surface); color: var(--text2); border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all .12s; padding: 0; }
.icon-btn:hover { background: var(--surface3); color: var(--text); }
.icon-btn svg.ico { width: 16px; height: 16px; }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm svg.ico { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- Formulare */
/* Feldzustand: geändert (Punkt am Label, dunkler Rahmen), ungültig (rot + Hinweis) */
.fld.is-dirty label::after, .cfg-row.is-dirty .k::after, .doc-row.is-dirty .cell-strong::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 7px; vertical-align: middle; }
.fld.is-dirty input, .fld.is-dirty textarea, .fld.is-dirty select, .cfg-row.is-dirty .inp, .doc-row.is-dirty .inp { border-color: var(--text2); background: var(--surface); }
.fld.is-invalid input, .fld.is-invalid textarea, .fld.is-invalid select, .cfg-row.is-invalid .inp, .doc-row.is-invalid .inp, .inp.is-invalid { border-color: var(--danger) !important; background: rgba(220,38,38,.04); }
.fld-err { font-size: 11.5px; color: var(--danger); margin-top: -1px; }
.toolbar .state.is-err { color: var(--danger); font-weight: 600; }
.edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 16px; }
.edit-grid > * { min-width: 0; }
.fld { display: flex; flex-direction: column; gap: 5px; }
.fld.full { grid-column: 1 / -1; }
.fld label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text3); }
.fld input, .fld textarea, .fld select, .inp { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 8px 10px; font-size: 13px; outline: none; width: 100%; min-width: 0; }
.fld input:focus, .fld textarea:focus, .fld select:focus, .inp:focus { border-color: var(--accent); }
.fld textarea, textarea.inp { min-height: 62px; resize: vertical; line-height: 1.5; }
.inp.compact { width: auto; padding: 5px 8px; font-size: 12px; }
.color-row { display: flex; align-items: center; gap: 8px; }
.color-row input[type="color"] { width: 32px; height: 30px; padding: 2px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface2); cursor: pointer; }
.color-row input[type="text"] { width: 92px; font-variant-numeric: tabular-nums; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 7px 12px; width: 320px; max-width: 100%; color: var(--text3); }
.search input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; width: 100%; }
.search svg.ico { width: 15px; height: 15px; }
.li-search { width: 100%; max-width: 100%; margin: 0 0 12px; }
.keybox { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.keybox code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; letter-spacing: .08em; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; min-width: 200px; }

.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 2px; }
.set-row + .set-row { border-top: 1px solid var(--border2); }
.set-t { font-size: 13.5px; font-weight: 600; }
.set-s { font-size: 11.5px; color: var(--text3); margin-top: 1px; }
.switch { position: relative; flex: none; width: 46px; height: 28px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface3); cursor: pointer; padding: 0; transition: background .15s, border-color .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.switch:disabled { opacity: .5; cursor: default; }

.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; min-height: 28px; font-size: 12px; font-weight: 600; color: var(--text2); background: transparent; border: 0; border-radius: 7px; cursor: pointer; transition: background .12s, color .12s, box-shadow .12s; }
.seg-btn:not(.active):hover { background: var(--surface3); color: var(--text); }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg-n { font-size: 10.5px; font-weight: 600; color: var(--text3); font-variant-numeric: tabular-nums; }
.seg-btn.active .seg-n { color: var(--text2); }

/* ---------------------------------------------------------------- Tabellen */
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text3); padding: 10px 16px; border-bottom: 1px solid var(--border2); white-space: nowrap; }
.tbl thead th.num { text-align: right; }
.tbl tbody td { padding: 11px 16px; border-bottom: 1px solid var(--border2); font-size: 13px; vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr.click { cursor: pointer; transition: background .1s; }
.tbl tbody tr.click:hover { background: var(--surface2); }
.tbl tr.grp td { padding: 12px 16px 6px; border-bottom: 0; }
.tbl tr.grp + tr td { border-top: 1px solid var(--border2); }
.grp-t { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); }
.grp-n { font-size: 10.5px; font-weight: 700; color: var(--text3); margin-left: 8px; font-variant-numeric: tabular-nums; }
.cell-strong { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 11.5px; color: var(--text3); margin-top: 1px; }
.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions .icon-btn { vertical-align: middle; }
.tbl-wrap { overflow-x: auto; }
.td-tight { width: 1%; white-space: nowrap; }
.tbl a.cell-link { font-weight: 600; color: var(--text); text-decoration: none; }
.tbl a.cell-link:hover { color: var(--accent2); text-decoration: underline; text-underline-offset: 3px; }
/* Dienst hinzufügen: Katalog-Liste im Dialog */
.pick-list { max-height: 52vh; overflow-y: auto; margin: 0 -4px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--border2); }
.pick:last-child { border-bottom: 0; }
/* Unterseite eines Dienstes */
.back { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 500; color: var(--text3); text-decoration: none; margin-bottom: 2px; }
.back:hover { color: var(--text); }
.back svg.ico { width: 13px; height: 13px; }
.mono-list { display: flex; flex-direction: column; gap: 6px; }
.mono-list code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--text2); overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- Code */
.code { position: relative; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; padding-right: 100px; font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); }
.code .copy { position: absolute; top: 8px; right: 8px; }

/* ---------------------------------------------------------------- Vorschau */
.preview { background: #e9ebef; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; display: flex; justify-content: center; }
.preview iframe { display: block; width: 100%; height: 640px; border: 0; background: #fff; transition: width .2s, opacity .2s; }
.preview.loading iframe { opacity: .55; }
.preview.loading iframe { opacity: .5; }
.preview.mobile iframe { width: 390px; }
.preview.doc iframe { height: 760px; background: #fff; }

/* ---------------------------------------------------------------- Modal / Toast / Auth */
.modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0,0,0,.5); backdrop-filter: blur(2px); }
.modal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow); width: 600px; max-width: 94vw; max-height: 88vh; display: flex; flex-direction: column; }
.modal-card.sm { width: 400px; }
.modal-head { padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.modal-body { padding: 16px; overflow: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border2); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(10px); z-index: 9999; max-width: 440px; display: flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 10px; background: var(--surface2); color: var(--text); border: 1px solid var(--border); font-size: 13px; line-height: 1.4; box-shadow: 0 10px 34px rgba(0,0,0,.34); opacity: 0; pointer-events: none; transition: opacity .26s ease, transform .26s ease; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast-err { border-color: rgba(239,68,68,.55); }
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 380px; max-width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 26px; }
.auth-logo { height: 30px; width: auto; max-width: 200px; display: block; }
.auth-card h1 { font-size: 19px; letter-spacing: -.3px; margin: 18px 0 16px; }
.auth-card .fld + .fld { margin-top: 12px; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 16px; padding: 9px 13px; }
.auth-err { color: var(--danger); font-size: 12.5px; margin-top: 10px; }

@media (max-width: 720px) {
	.app { grid-template-columns: 1fr; }
	.sidebar { display: none; }
	.content { padding: 16px 16px 60px; }
	.plate { flex-wrap: wrap; }
	.plate-s { width: 100%; border-top: 1px solid var(--border2); }
	.cfg-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- Extensions */
.ext-row { display: flex; align-items: flex-start; gap: 14px; padding: 16px; border-bottom: 1px solid var(--border2); }
.ext-row:last-child { border-bottom: 0; }
.ext-row.is-soon { opacity: .72; }
.ext-ic { flex: none; width: 38px; height: 38px; border-radius: 10px; background: rgba(var(--accent-rgb), .12); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.ext-ic svg.ico { width: 19px; height: 19px; }
.ext-main { flex: 1 1 auto; min-width: 0; }
.ext-name { font-size: 14px; font-weight: 600; }
.ext-desc { font-size: 12.5px; color: var(--text2); margin-top: 3px; line-height: 1.45; }
.ext-ctl { flex: none; display: flex; align-items: center; padding-top: 4px; }
.ext-soon { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-green); background: rgba(8, 193, 106, .12); border: 1px solid rgba(8, 193, 106, .28); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }

/* ---------------------------------------------------------------- Reframe: Extensions-Navigation */
.nav-item.nav-sub { padding-left: 32px; font-size: 13px; font-weight: 500; }
.nav-item.nav-sub svg.ico { width: 16px; height: 16px; }
.sb-ext-head { display: flex; align-items: center; gap: 11px; padding: 10px 10px 5px; font-size: 12.5px; font-weight: 700; color: var(--text2); }
.sb-ext-head svg.ico { width: 17px; height: 17px; color: var(--accent); }
.nav-soon { margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--brand-green); background: rgba(8, 193, 106, .12); border-radius: 999px; padding: 2px 7px; }

/* Coming-Soon-Ansicht (Extension-Platzhalter) */
.soon-wrap { text-align: center; padding: 44px 20px; }
.soon-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--brand-green); background: rgba(8, 193, 106, .12); border: 1px solid rgba(8, 193, 106, .28); border-radius: 999px; padding: 5px 12px; margin-bottom: 14px; }
.soon-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.soon-text { font-size: 13.5px; color: var(--text2); max-width: 460px; margin: 0 auto; line-height: 1.55; }

/* ---------------------------------------------------------------- Einbindung: WordPress-Verbindung */
.wp-connect { display: flex; flex-direction: column; gap: 16px; }
.wp-dl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wp-data { display: flex; flex-direction: column; gap: 12px; }
.wp-data .fld label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 5px; }
