/* Umfragetool – Styles */
:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --ink: #1d2422;
  --ink-2: #4a5552;
  --muted: #6f7a77;
  --line: #dfe3df;
  --line-2: #eceeea;
  --accent: #1f6f5c;
  --accent-ink: #ffffff;
  --accent-soft: #e3f0ec;
  --accent-hover: #185a4a;
  --accent-ring: rgba(31, 111, 92, .3);
  --warn-bg: #fff6e0; --warn-line: #f0d48a; --warn-ink: #6b4e00;
  --err-bg: #fdecea;  --err-line: #f1b5ae;  --err-ink: #8a1f14;
  --ok-bg: #e7f4ec;   --ok-line: #a9d8b9;   --ok-ink: #1d5b33;
  --info-bg: #eaf1f8; --info-line: #b6cde4; --info-ink: #1f4466;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 28, .06), 0 2px 8px rgba(20, 30, 28, .04);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; width: 100%; }
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
code, .mono { font-family: var(--mono); font-size: .9em; }
code { background: var(--line-2); padding: .05em .35em; border-radius: 4px; }
[hidden] { display: none !important; }

/* Kopfzeile */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; transition: box-shadow .2s; }
.topbar.scrolled { box-shadow: 0 2px 10px rgba(20, 30, 28, .08); }
:root { --header-h: 0px; }
html { scroll-padding-top: calc(var(--header-h) + 12px); }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: .75rem 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 650; color: var(--ink); text-decoration: none; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 6px 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -2px); width: 10px; height: 5px; }
.mainnav { margin-left: auto; display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; }
.mainnav a, .mainnav .linklike { color: var(--ink-2); text-decoration: none; padding: .4rem .7rem; border-radius: 8px; font-size: .95rem; }
.mainnav a:hover, .mainnav .linklike:hover { background: var(--line-2); }
.mainnav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.container { max-width: 860px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
body.wide .container, body.area-admin .container { max-width: 1200px; }

/* Karten */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.4rem; margin-bottom: 1.25rem; }
.card.flush { padding: 0; overflow-x: auto; }
.card.narrow { max-width: 460px; margin: 3rem auto; }
.card.center { text-align: center; }
.card.empty { text-align: center; padding: 2.5rem 1.5rem; }
.lead { color: var(--ink-2); font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.prose { white-space: normal; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: .3rem 0; }

/* Meldungen */
.alert { border: 1px solid; border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1rem; }
.alert ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.alert-error { background: var(--err-bg); border-color: var(--err-line); color: var(--err-ink); }
.alert-success { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); }
.alert-warning { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.alert-info { background: var(--info-bg); border-color: var(--info-line); color: var(--info-ink); }

/* Formulare */
.form label { display: block; margin-bottom: .9rem; font-weight: 550; font-size: .92rem; color: var(--ink-2); }
.form label > input, .form label > select, .form label > textarea { margin-top: .3rem; }
input, select, textarea {
  font: inherit; color: var(--ink); background: #fff; width: 100%;
  border: 1px solid #c9cfcb; border-radius: 8px; padding: .55rem .7rem;
}
textarea { resize: vertical; min-height: 2.6rem; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 1px; border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
.form label.check, label.check { display: flex; gap: .55rem; align-items: center; font-weight: 450; color: var(--ink); }
.form label.check input { margin: 0; width: 1.05rem; height: 1.05rem; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: .9rem 1rem .4rem; margin: 0 0 1rem; }
legend { font-weight: 650; padding: 0 .35rem; }
.grid-2, .grid-3 { display: grid; gap: 0 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2.align-start { align-items: start; gap: 1.25rem; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.pin-input { font-family: var(--mono); font-size: 1.5rem; letter-spacing: .15em; text-align: center; text-transform: uppercase; padding: .7rem; }
textarea.code, pre.code { font-family: var(--mono); font-size: .82rem; }
pre.code { background: #1f2624; color: #e7ece9; border-radius: 8px; padding: 1rem; overflow-x: auto; line-height: 1.45; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 550; font-size: .95rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  border: 1px solid #c4cbc7; background: #fff; color: var(--ink); border-radius: 8px; padding: .6rem 1rem;
}
.btn:hover { background: var(--line-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); }
.btn-danger { background: #b3261e; border-color: #b3261e; color: #fff; }
.btn-danger:hover { background: #8f1d17; }
.danger { color: #b3261e; }
.btn-small { padding: .35rem .65rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-icon { border: 0; background: none; cursor: pointer; color: var(--muted); padding: .1rem .3rem; font-size: 1rem; border-radius: 4px; }
.btn-icon:hover { background: var(--line-2); color: var(--ink); }
.linklike { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-align: left; }
.btn-row { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; }
form.inline { display: inline; }
.inline-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; padding: .4rem .6rem; }
.inline-edit input { border-color: transparent; background: transparent; padding: .25rem .4rem; min-width: 10rem; }
.inline-edit input:hover { border-color: var(--line); }

/* Tabellen */
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: .6rem .8rem; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #fafbf9; }
.table th.num, .table td.num { text-align: right; }
.table th.center, .table td.center { text-align: center; }
.table tbody tr:hover { background: #fafbf9; }
.table td.right { text-align: right; }

/* Badges & Tags */
.badge, .tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: .12rem .5rem; border-radius: 999px; vertical-align: middle; white-space: nowrap; }
.badge { border: 1px solid transparent; }
.badge-draft { background: #eef0ee; color: #4e5755; }
.badge-active { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-line); }
.badge-closed { background: #f1ecf6; color: #57397a; }
.badge-open { background: #eef0ee; color: #4e5755; }
.badge-in_progress { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }
.badge-completed { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-line); }
.tag { background: var(--line-2); color: var(--ink-2); font-weight: 550; }
.tag-single { background: var(--info-bg); color: var(--info-ink); }
.tag-multiple { background: #f1ecf6; color: #57397a; }
.tag-text { background: var(--warn-bg); color: var(--warn-ink); }
.tag-post { background: var(--accent-soft); color: var(--accent); }

/* Admin-Köpfe */
.page-head, .survey-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1, .survey-head h1 { margin: 0; }
.survey-head h1 { margin-top: .2rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a { padding: .6rem .9rem; text-decoration: none; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 550; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.meta-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .9rem 1.2rem; }
.meta { display: flex; gap: 1.75rem; flex-wrap: wrap; margin: 0; }
.meta dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.meta dd { margin: 0; font-weight: 550; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .8rem 1rem; }
.card.flush .toolbar { border-bottom: 1px solid var(--line-2); }
.toolbar.card { padding: .6rem .8rem; }
.empty-small { padding: 1.5rem; text-align: center; color: var(--muted); }
.pager { display: flex; gap: .25rem; padding: .8rem; flex-wrap: wrap; }
.pager a { padding: .3rem .6rem; border-radius: 6px; text-decoration: none; border: 1px solid var(--line); }
.pager a.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; display: flex; flex-direction: column; }
.card .stat { background: #fafbf9; }
.stat-value { font-size: 1.5rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: .85rem; }

/* Struktur-Editor */
.section-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: .6rem; }
.section-head h2 { margin: .1rem 0 .2rem; }
.eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.qlist { list-style: none; padding: 0; margin: 0 0 1rem; }
.qitem { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-top: 1px solid var(--line-2); }
.qitem-title { font-weight: 550; }
.qitem-title a { color: var(--ink); text-decoration: none; }
.qitem-title a:hover { color: var(--accent); text-decoration: underline; }
.qitem-meta { display: flex; gap: .6rem; align-items: center; margin: .3rem 0; font-size: .82rem; }
.optlist { margin: .2rem 0 0; padding-left: 1.1rem; color: var(--ink-2); font-size: .9rem; }
.optlist li { margin: .1rem 0; }
.q-num { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: .15rem; }
.req { color: #b3261e; font-weight: 700; }
.popover { position: relative; }
.popover > summary { list-style: none; }
.popover > summary::-webkit-details-marker { display: none; }
.popover-body { position: absolute; right: 0; top: calc(100% + .3rem); z-index: 10; width: 320px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); padding: 1rem; display: grid; gap: .6rem; }
.opt-table td { padding: .35rem .4rem; }
.opt-table input:not([type=checkbox]) { padding: .4rem .55rem; }
.opt-ext { width: 6.5rem; }
.opt-row.deleted input:not(.opt-del) { opacity: .45; text-decoration: line-through; }
.drag { white-space: nowrap; width: 1%; }
.danger-zone { border-color: var(--err-line); }
.checklist { display: grid; gap: .3rem; margin-bottom: .6rem; }
.export-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; }
.export-buttons .btn { flex-direction: column; align-items: flex-start; text-align: left; padding: .9rem 1rem; }
.export-buttons .btn span { font-weight: 400; font-size: .82rem; color: var(--muted); }
.key { font-size: 1rem; word-break: break-all; display: inline-block; margin: .4rem 0; padding: .3rem .5rem; background: #fff; }
.link-list { list-style: none; padding: 0; }
.link-list li { padding: .3rem 0; }
.api-table code { font-size: .82rem; }

/* Auswertung */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg a { padding: .4rem .8rem; text-decoration: none; color: var(--ink-2); font-size: .9rem; }
.seg a.active { background: var(--accent); color: var(--accent-ink); }
.result-q { padding: 1rem 0; border-top: 1px solid var(--line-2); }
.result-q:first-of-type { border-top: 0; padding-top: 0; }
.result-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.result-head h3 { margin: 0 0 .5rem; font-weight: 600; }
.bars { width: 100%; border-collapse: collapse; font-size: .92rem; }
.bars th { text-align: left; font-weight: 450; padding: .25rem .8rem .25rem 0; width: 35%; }
.bars td { padding: .25rem .4rem; }
.bar-cell { width: 45%; }
.bar { background: var(--line-2); border-radius: 4px; height: 14px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; min-width: 1px; }
.numstats { font-size: .9rem; background: #fafbf9; border: 1px solid var(--line-2); border-radius: 6px; padding: .45rem .7rem; margin-top: .5rem; }
.texts { margin-top: .5rem; }
.texts summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.texts ul { margin: .5rem 0 0; padding-left: 1.1rem; max-height: 360px; overflow-y: auto; }
.texts li { margin: .3rem 0; }
.answers dt { font-weight: 600; margin-top: 1rem; }
.answers dd { margin: .3rem 0 0 1.4rem; }

/* Teilnehmer-Fragebogen */
.survey-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.survey-title { margin: 0 0 .2rem; font-size: 1.45rem; }
.progress { min-width: 200px; text-align: right; }
.progress-bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: .3rem; }
.progress-bar span { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.steps { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: 1rem; }
.step { display: flex; align-items: center; gap: .45rem; flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: .3rem .8rem .3rem .3rem; font: inherit; font-size: .88rem; color: var(--ink-2); cursor: pointer; }
.step:hover { border-color: var(--accent); }
.step-no { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--line-2); font-weight: 600; font-size: .8rem; }
.step.complete .step-no { background: var(--accent-soft); color: var(--accent); }
.step.current { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.step.current .step-no { background: var(--accent); color: var(--accent-ink); }
.intro { border-left: 4px solid var(--accent); }
.section > h2 { font-size: 1.25rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line-2); }
.question { border: 0; padding: 0; margin: 1.6rem 0 0; min-width: 0; }
.question:first-of-type { margin-top: 1rem; }
.q-title { font-weight: 600; font-size: 1.04rem; padding: 0; margin-bottom: .5rem; }
.q-help { margin: -.2rem 0 .6rem; color: var(--muted); font-size: .92rem; }
.q-hint { margin: -.2rem 0 .5rem; color: var(--muted); font-size: .85rem; }
.choices { display: grid; gap: .45rem; }
.choice { border: 1px solid var(--line); border-radius: 8px; background: #fff; transition: border-color .15s, background .15s; }
.choice:hover { border-color: #b7c2bd; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice > label { display: flex; align-items: flex-start; gap: .7rem; padding: .65rem .8rem; cursor: pointer; }
.choice > label input { margin-top: .22rem; width: 1.1rem; height: 1.1rem; flex: 0 0 auto; }
.choice-text { display: block; width: calc(100% - 3.4rem); margin: 0 .8rem .7rem 2.6rem; }
.clear-choice { margin-top: .4rem; color: var(--muted); }
.fields { display: grid; gap: .7rem; }
.field { display: block; }
.field-label { display: block; font-size: .92rem; color: var(--ink-2); margin-bottom: .25rem; }
input.num { max-width: 16rem; }
.big-check { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1rem; background: var(--accent-soft); color: var(--accent); font-size: 2rem; font-weight: 700; }
.pin { font-family: var(--mono); letter-spacing: .1em; font-size: 1.15rem; }

@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .card { padding: 1rem; }
  .qitem, .section-head { flex-direction: column; }
  .progress { text-align: left; width: 100%; }
  .bars th { width: auto; }
  .form-actions .btn { flex: 1 1 auto; }
  .popover-body { right: auto; left: 0; width: min(320px, 85vw); }
}
@media print {
  .topbar, .tabs, .footer, .btn, .toolbar { display: none !important; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* Mehrfachauswahl Umfragenübersicht */
.check-col { width: 1%; padding-right: 0 !important; }
.check-col input { width: 1.05rem; height: 1.05rem; cursor: pointer; }
.bulk-bar { background: var(--surface); }
#bulk-form tbody tr { cursor: pointer; }
#bulk-form tbody tr.selected { background: var(--accent-soft); }

/* Kopfzeile mit Logo */
.brand.has-logo { gap: .75rem; }
.brand-logo { display: block; width: auto; max-width: 240px; object-fit: contain; }
.brand-title { white-space: nowrap; }

/* Fußzeile */
.footer { background: var(--accent); color: var(--accent-ink); margin-top: 2rem; padding: 1rem 0; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 1rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem 1.5rem; flex-wrap: wrap; }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-links a, .footer-links a:visited { color: var(--accent-ink); text-decoration: none; font-size: .9rem; }
.footer-links a:hover, .footer-links a[aria-current] { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.footer-links a[aria-current] { font-weight: 600; }
.footer a:focus-visible { outline-color: var(--accent-ink); }
.footer-meta { color: var(--accent-ink); opacity: .85; font-size: .85rem; }
.footer-links { margin-left: auto; }

/* Impressum / Datenschutz */
.legal { line-height: 1.65; }
.legal h1 { font-size: 1.6rem; margin-bottom: 1rem; }
.legal h2 { font-size: 1.15rem; margin: 1.6rem 0 .5rem; }
.legal h3 { font-size: 1rem; margin: 1.2rem 0 .4rem; }
.legal p, .legal ul, .legal ol, .legal table { margin: 0 0 .9rem; }
.legal table { border-collapse: collapse; }
.legal th, .legal td { border: 1px solid var(--line); padding: .35rem .6rem; text-align: left; }
.legal a { word-break: break-word; }

/* Admin: Website-Einstellungen */
.logo-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.logo-preview { display: flex; align-items: center; gap: 1rem; min-height: 56px; padding: .75rem 1rem; border: 1px dashed var(--line); border-radius: 8px; background: #fafbf9; }
.logo-preview img { max-width: 240px; object-fit: contain; }

/* Kontaktleiste über der Kopfzeile */
.contact-bar { background: var(--accent); color: var(--accent-ink); font-size: .85rem; }
.contact-inner { max-width: 1200px; margin: 0 auto; padding: .4rem 1rem; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: .35rem 1.5rem; }
.contact-item { display: inline-flex; align-items: center; gap: .4rem; color: inherit; text-decoration: none; white-space: nowrap; }
.contact-item span { white-space: normal; }
a.contact-item:hover span { text-decoration: underline; }
.contact-item .icon { flex: 0 0 auto; opacity: .9; }
.contact-bar a.contact-item, .contact-bar a.contact-item:visited { color: var(--accent-ink); }
.contact-bar .muted { color: inherit; opacity: .75; }
.contact-preview { margin: 0 0 1rem; border-radius: 8px; overflow: hidden; }
.label-icon { display: inline-flex; align-items: center; gap: .35rem; }
.icon { display: inline-block; vertical-align: middle; }
@media (max-width: 720px) { .contact-inner { gap: .25rem 1rem; font-size: .8rem; } }

/* WYSIWYG-Editor */
.wysiwyg { border: 1px solid #c9cfcb; border-radius: 8px; background: #fff; }
.wysiwyg > :first-child { border-radius: 8px 8px 0 0; }
.wysiwyg > :last-child, .wy-area { border-radius: 0 0 8px 8px; }
.wysiwyg:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.wy-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem; padding: .4rem .5rem; border-bottom: 1px solid var(--line); background: #fafbf9; position: sticky; top: var(--header-h); z-index: 1; }
.wy-toolbar button { display: inline-grid; place-items: center; min-width: 2rem; height: 2rem; padding: 0 .45rem; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer; }
.wy-toolbar button:hover:not(:disabled) { background: var(--line-2); }
.wy-toolbar button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.wy-toolbar button:disabled, .wy-toolbar select:disabled { opacity: .4; cursor: default; }
.wy-toolbar select { width: auto; padding: .25rem .5rem; font-size: .88rem; height: 2rem; }
.wy-sep { width: 1px; height: 1.4rem; background: var(--line); margin: 0 .25rem; }
.wy-spacer { flex: 1; }
.wy-source-btn { font-family: var(--mono) !important; font-size: .8rem !important; }
.wy-area { min-height: 360px; max-height: 70vh; overflow-y: auto; padding: 1rem 1.25rem; outline: none; }
.wy-area:empty::before { content: "Text hier eingeben …"; color: var(--muted); }
.wy-source { display: block; width: 100%; min-height: 360px; border: 0; border-radius: 0; font-size: .82rem; line-height: 1.5; padding: 1rem; resize: vertical; }
.wy-source:focus { outline: none; box-shadow: none; }

/* Farbwahl Kontaktleiste */
.color-field { display: flex; align-items: center; gap: .6rem; margin-top: .3rem; }
.color-field input[type=color] { width: 3rem; height: 2.4rem; padding: .15rem; cursor: pointer; }
.contrast-info { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .9rem; }
.badge-good { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-line); }
.badge-bad { background: var(--err-bg); color: var(--err-ink); border-color: var(--err-line); }

/* Öffentliches Menü in der Kopfzeile (rechtsbündig) */
.sitenav { margin-left: auto; }
.nav-toggle { display: none; margin-left: auto; width: 2.6rem; height: 2.4rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (max-width: 640px) {
  .nav-toggle { display: inline-flex; }
  .sitenav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: .15rem; margin: .25rem 0 0; padding-top: .5rem; border-top: 1px solid var(--line-2); }
  .sitenav.open { display: flex; }
  .sitenav a { padding: .65rem .75rem; }
}

/* Farbmuster in den Website-Einstellungen */
.theme-sample { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .75rem 1rem; border: 1px dashed var(--line); border-radius: 8px; margin: 0 0 1rem; background: #fff; }
.contrast-info .badge { align-self: flex-start; }

.tab-preview { display: inline-block; max-width: 100%; padding: .2rem .7rem; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; background: #fff; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.bulk-status { display: inline-flex; gap: .3rem; align-items: center; }
.bulk-status select { width: auto; padding: .3rem .5rem; font-size: .85rem; }
.login-form .pin-input { margin-bottom: 1rem; }

/* Website-Name in der Kopfzeile (öffentliche Seiten; Größe/Position über Website-Einstellungen) */
.area-public .brand-title { font-size: min(var(--site-title-size, 28px), 7vw); line-height: 1.15; white-space: normal; }
.topbar-grid { flex: 1 1 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: 1rem; }
.topbar-grid > .brand, .topbar-grid > .brand-spacer { grid-column: 1; justify-self: start; }
.topbar-grid .site-name { grid-column: 2; text-align: center; font-weight: 700; font-size: min(var(--site-title-size, 28px), 6.5vw); line-height: 1.15; letter-spacing: -.01em; color: var(--ink); text-decoration: none; overflow-wrap: break-word; hyphens: auto; min-width: 0; max-width: min(60vw, 720px); }
.topbar-grid .site-name:hover { color: var(--accent); }
.topbar-grid .sitenav, .topbar-grid .nav-toggle { grid-column: 3; grid-row: 1; justify-self: end; margin-left: 0; }
.topbar-grid .brand-logo { max-width: 100%; }
@media (max-width: 640px) {
  .topbar-grid { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: .75rem; }
  .topbar-grid .site-name { max-width: none; }
  .topbar-grid .brand-logo { max-width: 30vw; max-height: 48px; }
  .topbar-grid .sitenav { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
}
/* Vorschau in den Website-Einstellungen */
.header-preview { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: .75rem 1rem; margin: .25rem 0 1rem; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 1rem; overflow: hidden; }
.header-preview .hp-logo { grid-column: 1; justify-self: start; display: flex; align-items: center; }
.header-preview .hp-logo img { height: 36px; width: auto; max-width: 120px; object-fit: contain; }
.header-preview .hp-name { grid-column: 2; font-weight: 700; line-height: 1.15; color: var(--ink); text-align: center; overflow-wrap: break-word; min-width: 0; }
.header-preview .hp-menu { grid-column: 3; justify-self: end; display: flex; gap: .8rem; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.header-preview.is-left { display: flex; }
.header-preview.is-left .hp-name { text-align: left; font-weight: 650; }
.header-preview.is-left .hp-menu { margin-left: auto; }
.range-row { display: flex; align-items: center; gap: .75rem; }
.range-row input[type=range] { flex: 1; accent-color: var(--accent); padding: 0; border: 0; box-shadow: none; }
.range-row output { min-width: 3.5rem; font-variant-numeric: tabular-nums; }
