/*
 * Beschlussportal Schwerzenbach – visuelle Auffrischung, Version 1.0
 * Reines CSS; keine Abhängigkeiten, keine Webfonts, keine Inline-Stile.
 * Achtung: Die produktive Konfiguration liefert --accent und
 * --accent-contrast über die separat geladene theme.css.
 *
 * SYSTEM / TOKENS
 * Breakpoints: 70rem (1120px), 62rem (992px), 48rem (768px),
 * 36rem (576px), 25rem (400px); ausschliesslich in Media Queries.
 */
:root {
  /* Marke: aus theme.css überschreibbar */
  --accent: #005a8c;
  --accent-contrast: #ffffff;
  /* Dunkle, aus dem Accent abgeleitete Linkfarbe: für Textkontrast. */
  --accent-ink: color-mix(in srgb, var(--accent) 56%, #061824 44%);
  --accent-wash: color-mix(in srgb, var(--accent) 8%, white 92%);
  --accent-line: color-mix(in srgb, var(--accent) 31%, #ffffff 69%);

  /* Neutrale Farben */
  --ink: #182a36;
  --ink-soft: #314654;
  --muted: #4b5e6b;
  --bg: #ffffff;
  --canvas: #f5f8fa;
  --surface: #ffffff;
  --surface-alt: #f8fafb;
  --surface-deep: #eaf1f5;
  --border: #d1dde3;
  --border-strong: #687f8e;
  --focus: #8b4d00;

  /* Statusfarben; Farbe nie als einzige Information */
  --ok: #176345;
  --ok-bg: #e4f4eb;
  --warn: #75500f;
  --warn-bg: #fff2da;
  --err: #982b2e;
  --err-bg: #fff0ef;
  --info: #18577d;
  --info-bg: #eaf3f9;

  /* Typografie */
  --font: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  --text-xs: .8125rem;
  --text-sm: .9rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: clamp(1.75rem, 2.8vw, 2.35rem);
  --text-3xl: clamp(2.05rem, 3.5vw, 2.85rem);
  --leading: 1.58;

  /* Abstände */
  --s1: .25rem;
  --s2: .5rem;
  --s3: .75rem;
  --s4: 1rem;
  --s5: 1.25rem;
  --s6: 1.5rem;
  --s8: 2rem;
  --s10: 2.5rem;
  --s12: 3rem;
  /* Ecken, Schatten und maximale Inhaltsbreite */
  --r-xs: .375rem;
  --r-sm: .55rem;
  --r-md: .8rem;
  --r-lg: 1rem;
  --r-pill: 100rem;
  --shadow-sm: 0 1px 2px rgb(23 42 56 / 6%), 0 4px 14px rgb(23 42 56 / 3%);
  --shadow-md: 0 6px 22px rgb(24 42 54 / 7%), 0 1px 5px rgb(24 42 54 / 4%);
  --maxw: 75rem;
}

/* ================= 01. Basis, Typografie, Fokus ================= */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; scroll-padding-top: 1.5rem; }
body { margin: 0; min-width: 0; font: 400 var(--text-base)/var(--leading) var(--font); color: var(--ink); background: var(--bg); overflow-wrap: anywhere; }
img, svg, video { max-width: 100%; height: auto; }
svg { vertical-align: middle; }
a { color: var(--accent-ink); text-decoration-color: var(--accent-line); text-underline-offset: .18em; text-decoration-thickness: 1.25px; }
a:hover { text-decoration-thickness: 2px; text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; box-shadow: 0 0 0 2px var(--surface); }
:focus:not(:focus-visible) { outline: none; }
h1, h2, h3, h4 { color: var(--ink); letter-spacing: -.025em; line-height: 1.24; margin: 1.5em 0 .57em; font-weight: 720; }
h1 { font-size: var(--text-2xl); margin-top: .25em; }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-base); }
p, ul, ol, dl, figure, table { margin: 0 0 var(--s4); }
li + li { margin-top: .15rem; }
strong, b { font-weight: 680; }
small, .small { font-size: var(--text-sm); }
.muted, .source { color: var(--muted); }
.nowrap { white-space: nowrap; }
code, kbd, pre { font-family: var(--mono); font-size: .88em; }
code { overflow-wrap: anywhere; }
pre { margin: 0 0 var(--s4); padding: var(--s4); border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-alt); white-space: pre-wrap; word-break: break-word; overflow: auto; }
hr { margin: var(--s8) 0; border: 0; border-top: 1px solid var(--border); }
summary { cursor: pointer; }
summary:hover { color: var(--accent-ink); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip { position: absolute; z-index: 1000; left: var(--s4); top: -10rem; display: inline-block; padding: .65rem 1rem; border-radius: var(--r-sm); background: var(--accent); color: var(--accent-contrast); font-weight: 700; }
.skip:focus { top: .5rem; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 2.5vw, 1.5rem); }
.stack > * + * { margin-top: var(--s3); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem .85rem; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1 1 auto; }
.grid-2, .grid-3 { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.mt-1 { margin-top: var(--s4); }

/* ================= 02. Öffentlicher Kopf und Fuss ================= */
.site-header { background: var(--accent); color: var(--accent-contrast); border-bottom: 1px solid color-mix(in srgb, var(--accent) 80%, black 20%); }
.site-header .wrap { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .8rem 2rem; padding-block: 1rem; }
.site-header .brand { flex: 0 0 auto; }
.brand { display: inline-flex; align-items: center; gap: .7rem; max-width: 100%; font-size: 1.2rem; font-weight: 750; letter-spacing: -.025em; text-decoration: none; line-height: 1.18; }
.brand small { display: block; margin-top: .22rem; font-size: var(--text-xs); font-weight: 500; letter-spacing: .012em; }
.brand img { max-height: 2.8rem; width: auto; border-radius: var(--r-xs); background: #ffffff; padding: .2rem; }
.site-header a { color: var(--accent-contrast); text-decoration-color: color-mix(in srgb, var(--accent-contrast), transparent 55%); }
.site-nav ul { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; padding: 0; margin: 0; list-style: none; }
.site-nav li { margin: 0; }
.site-nav a { display: inline-block; padding: .5rem .75rem; border: 1px solid transparent; border-radius: var(--r-sm); text-decoration: none; font-size: var(--text-sm); font-weight: 550; }
.site-nav a:hover, .site-nav a[aria-current="page"] { border-color: color-mix(in srgb, var(--accent-contrast), transparent 70%); background: color-mix(in srgb, var(--accent-contrast), transparent 87%); }
.site-header :focus-visible, .admin-header :focus-visible { outline-color: var(--accent-contrast); box-shadow: 0 0 0 2px var(--ink); }
.embed-nav { border-bottom: 1px solid var(--border); background: var(--surface-alt); }
.embed-nav .wrap { padding-block: .45rem; }
.embed-nav ul { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.embed-nav li { margin: 0; }
.embed-nav a { display: block; padding: .42rem .7rem; font-size: var(--text-sm); border-radius: var(--r-sm); text-decoration: none; font-weight: 580; }
.embed-nav a:hover, .embed-nav a[aria-current="page"] { background: var(--accent-wash); color: var(--accent-ink); }
body.public main { padding-block: var(--s10) var(--s12); }
.site-footer { margin-top: var(--s10); padding: var(--s8) 0; background: var(--canvas); color: var(--muted); border-top: 1px solid var(--border); font-size: var(--text-sm); }
.site-footer .wrap { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: .25rem var(--s6); }
.site-footer p { margin-bottom: .15rem; }
.site-footer a { color: var(--accent-ink); }

/* ================= 03. Eingaben, Checkboxen, Knöpfe ================= */
label, .label { display: block; margin-bottom: .32rem; font-weight: 650; font-size: var(--text-sm); color: var(--ink-soft); }
.hint { display: block; margin-top: .3rem; font-size: var(--text-sm); font-weight: 400; color: var(--muted); line-height: 1.45; }
input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], input[type="url"], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: .6rem .75rem; min-height: 2.65rem; width: 100%; max-width: 100%; box-shadow: inset 0 1px 2px rgb(0 0 0 / 2%); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--accent-ink); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent-ink); }
input[type="file"] { font: inherit; font-size: var(--text-sm); max-width: 100%; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 1.2rem; height: 1.2rem; vertical-align: -.19em; flex: 0 0 auto; }
textarea { resize: vertical; min-height: 7rem; }
select[multiple] { min-height: 5.5rem; }
fieldset { padding: var(--s4) var(--s5) var(--s5); border: 1px solid var(--border); border-radius: var(--r-md); margin: 0 0 var(--s5); min-width: 0; background: var(--surface); }
legend { padding: 0 .4rem; font-weight: 700; color: var(--ink); }
.field { margin-bottom: var(--s4); min-width: 0; }
.check { display: flex; align-items: flex-start; gap: .55rem; font-weight: 400; margin-bottom: .55rem; }
.check label { margin: 0; font-weight: 450; color: var(--ink); font-size: inherit; cursor: pointer; }
.check input { margin-top: .19rem; }
.checklist { max-height: 18rem; overflow-y: auto; min-width: 0; padding: .8rem; background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--r-sm); }
.checklist.short { max-height: 12rem; }
.inline-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.5rem), 1fr)); gap: .2rem var(--s4); }
.field-error input, .field-error select, .field-error textarea { border: 2px solid var(--err); background: var(--err-bg); }
.req::after { content: " *"; color: var(--err); }
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; border: 1px solid var(--accent); border-radius: var(--r-sm); padding: .59rem 1rem; min-height: 2.65rem; max-width: 100%; background: var(--accent); color: var(--accent-contrast); font: 650 var(--text-sm)/1.3 var(--font); text-decoration: none; cursor: pointer; text-align: center; transition: box-shadow .12s ease, transform .12s ease; }
.btn:hover, button:hover { box-shadow: 0 2px 9px rgb(0 0 0 / 12%); text-decoration: none; }
.btn:active, button:active { transform: translateY(1px); }
.btn.secondary, button.secondary { background: var(--surface); border-color: var(--accent); color: var(--accent-ink); }
.btn.secondary:hover, button.secondary:hover { background: var(--accent-wash); }
.btn.danger, button.danger { background: var(--err); border-color: var(--err); color: #ffffff; }
.btn.small, button.small { padding: .3rem .68rem; min-height: 2rem; font-size: var(--text-xs); }
.btn.link, button.link { border: 0; padding: .15rem .2rem; min-width: 1.6rem; min-height: 1.6rem; background: transparent; color: var(--accent-ink); font-weight: 600; text-decoration: underline; box-shadow: none; }
.btn[aria-disabled="true"], button[disabled] { cursor: not-allowed; background: var(--surface-deep); color: var(--muted); border-color: var(--border-strong); }
form.inline { display: inline; }

/* ================= 04. Hinweise, Badges, Zustände ================= */
.notice { margin: 0 0 var(--s5); padding: .85rem 1rem; background: var(--info-bg); border: 1px solid var(--border); border-left: 4px solid var(--info); border-radius: var(--r-sm); }
.notice.success { border-left-color: var(--ok); background: var(--ok-bg); }
.notice.warning { border-left-color: var(--warn); background: var(--warn-bg); }
.notice.error { border-left-color: var(--err); background: var(--err-bg); }
.notice > :last-child { margin-bottom: 0; }
.badge { display: inline-flex; align-items: center; padding: .13rem .52rem; min-height: 1.5rem; vertical-align: baseline; border: 1px solid var(--border-strong); border-radius: var(--r-pill); background: var(--surface-alt); color: var(--ink-soft); font-size: var(--text-xs); font-weight: 680; line-height: 1.3; white-space: normal; }
.badge.ok { border-color: color-mix(in srgb, var(--ok), white 35%); color: var(--ok); background: var(--ok-bg); }
.badge.warn { border-color: color-mix(in srgb, var(--warn), white 35%); color: var(--warn); background: var(--warn-bg); }
.badge.err { border-color: color-mix(in srgb, var(--err), white 35%); color: var(--err); background: var(--err-bg); }
.badge.info { border-color: color-mix(in srgb, var(--info), white 35%); color: var(--info); background: var(--info-bg); }
.status-ok { color: var(--ok); font-weight: 700; }
.status-warn { color: var(--warn); font-weight: 700; }
.status-fail { color: var(--err); font-weight: 700; }
.status-info { color: var(--info); font-weight: 700; }

/* ================= 05. Tabellen und Listen ================= */
.table-wrap { margin-bottom: var(--s5); max-width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th, td { padding: .72rem .82rem; border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
th { background: var(--surface-deep); font-weight: 700; color: var(--ink-soft); }
thead th { border-bottom: 1px solid var(--border-strong); }
tbody tr:hover { background: var(--accent-wash); }
tbody tr:nth-child(even) { background: var(--surface-alt); }
tbody tr:nth-child(even):hover { background: var(--accent-wash); }
tbody tr:last-child td { border-bottom: 0; }
table caption { padding: .7rem .85rem; font-weight: 680; text-align: left; color: var(--ink); }
td.filename { max-width: 26rem; min-width: 13rem; overflow-wrap: anywhere; }
.sort-link { white-space: nowrap; }
.pagination { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: var(--s6) 0; list-style: none; }
.pagination li { margin: 0; }
.pagination a, .pagination span { display: inline-flex; justify-content: center; align-items: center; min-width: 2.5rem; min-height: 2.5rem; padding: .3rem .7rem; border: 1px solid var(--border-strong); border-radius: var(--r-sm); text-decoration: none; background: #fff; }
.pagination [aria-current="page"] { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }

/* ================= 06. Öffentliche Suche und Treffer ================= */
.public main > .wrap > h1 { margin: 0 0 1.5rem; font-size: var(--text-3xl); }
.search-box { position: relative; margin: 0 0 2rem; padding: clamp(1.1rem, 2.4vw, 1.7rem); background: linear-gradient(125deg, var(--accent-wash), var(--surface) 84%); border: 1px solid var(--border); border-top: 4px solid var(--accent); border-radius: var(--r-lg); box-shadow: var(--shadow-md); }
.search-main { display: flex; flex-wrap: wrap; gap: .65rem; align-items: flex-end; }
.search-main .field { flex: 1 1 20rem; margin-bottom: 0; }
.search-main input[type="search"] { min-height: 3.1rem; font-size: 1.075rem; border-color: var(--border-strong); }
.search-main button { min-height: 3.1rem; min-width: 7rem; }
.fulltext-option { margin: .95rem 0 .75rem; }
.filters { padding-top: .6rem; border-top: 1px solid var(--border); }
.filters summary { font-weight: 680; display: list-item; width: fit-content; min-height: 1.65rem; }
.filters[open] summary { margin-bottom: .9rem; }
.filters .inline-fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.6rem), 1fr)); }
.active-filters { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; margin: var(--s3) 0 var(--s4); }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .33rem .75rem; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface-alt); font-size: var(--text-sm); }
.chip a { display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; text-decoration: none; font-weight: 700; min-width: 1.5rem; min-height: 1.5rem; }
.results-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s3); margin-bottom: .85rem; color: var(--muted); font-size: var(--text-sm); }
.results-meta p { margin: 0; }
.results-meta strong { color: var(--ink); }
.decision-list { display: grid; gap: .85rem; padding: 0; margin: 0 0 var(--s10); list-style: none; }
.decision-item { min-width: 0; padding: 1.15rem 1.3rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.decision-item:hover { border-color: var(--accent-line); box-shadow: var(--shadow-md); }
.decision-item h2, .decision-item h3 { margin: 0 0 .5rem; font-size: 1.22rem; line-height: 1.37; letter-spacing: -.018em; }
.decision-item h2 a, .decision-item h3 a { text-decoration: none; }
.decision-item h2 a:hover, .decision-item h3 a:hover { text-decoration: underline; }
.decision-item p:last-child { margin-bottom: 0; }
.decision-item p { color: var(--ink-soft); }
.meta { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; margin: 0 0 .6rem; color: var(--muted); font-size: var(--text-sm); }
.meta div { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.meta dt { font-weight: 640; color: var(--ink-soft); }
.meta dd { margin: 0; }
.snippet { margin: .65rem 0 0; padding: .6rem .85rem; border-left: 3px solid var(--accent-line); border-radius: 0 var(--r-xs) var(--r-xs) 0; background: var(--surface-alt); font-size: var(--text-sm); }
.multiline { white-space: pre-line; }
.empty { padding: var(--s10) var(--s6); text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface-alt); }
.news-item time { color: var(--accent-ink); font-weight: 680; }

/* ================= 07. Beschlussdetail und verwandte Seiten ================= */
.public article { max-width: 64rem; }
.public article > section { margin-top: var(--s8); }
.detail-head { padding: 0 0 var(--s8); margin-bottom: var(--s6); border-bottom: 1px solid var(--border); }
.detail-head h1 { margin: .3rem 0 1.1rem; font-size: var(--text-3xl); }
.detail-head .lead-text { padding-left: 1.25rem; border-left: 4px solid var(--accent); margin: 0 0 var(--s6); font-size: var(--text-lg); line-height: 1.62; color: var(--ink-soft); }
.facts { display: grid; grid-template-columns: minmax(8rem, max-content) minmax(0,1fr); gap: .35rem var(--s6); max-width: 44rem; margin: 0 0 var(--s4); padding: var(--s5); border-radius: var(--r-md); background: var(--surface-alt); }
.facts dt { color: var(--muted); font-weight: 680; }
.facts dd { margin: 0; }
.box { margin-bottom: var(--s4); padding: var(--s6); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.box > h2:first-child, .box > h3:first-child { margin-top: 0; }
.taglist { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; list-style: none; }
.taglist li { margin: 0; }
.taglist a { display: inline-flex; align-items: center; min-height: 2rem; border: 1px solid var(--accent-line); border-radius: var(--r-pill); padding: .28rem .85rem; background: var(--accent-wash); font-size: var(--text-sm); text-decoration: none; }
.taglist a:hover { border-color: var(--accent); }
.download { display: inline-flex; align-items: center; gap: .5rem; }
.copyline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.copyline input { flex: 1 1 15rem; min-width: 0; font: var(--text-sm) var(--mono); }
.official-note { color: var(--muted); font-size: var(--text-sm); }

/* ================= 08. Administration – Rahmen, Navigation ================= */
body.admin { background: var(--canvas); }
.admin-header { background: var(--accent); color: var(--accent-contrast); }
.admin-header .wrap { max-width: none; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.4rem; padding-block: .7rem; padding-inline: var(--s6); }
.admin-header .brand { margin-right: .5rem; font-size: 1.05rem; }
.admin-header a, .admin-header button.link { color: var(--accent-contrast); text-decoration-color: color-mix(in srgb,var(--accent-contrast),transparent 60%); }
.admin-header button.link { padding: .3rem .4rem; }
.admin-shell { display: grid; grid-template-columns: 15.25rem minmax(0,1fr); min-height: calc(100vh - 4rem); }
.admin-side { z-index: 3; position: sticky; top: 0; align-self: start; max-height: 100vh; overflow: auto; padding: 1rem .6rem 1.5rem; background: var(--surface); border-right: 1px solid var(--border); }
.admin-side ul { margin: 0; padding: 0; list-style: none; }
.admin-side li { margin: 0; }
.admin-side .group { padding: .9rem .65rem .35rem; font-size: .735rem; font-weight: 780; letter-spacing: .085em; text-transform: uppercase; color: var(--muted); }
.admin-side li a { display: block; padding: .53rem .8rem; border-radius: var(--r-sm); border-left: 3px solid transparent; color: var(--ink-soft); font-size: var(--text-sm); text-decoration: none; line-height: 1.36; }
.admin-side li a:hover { background: var(--surface-alt); color: var(--accent-ink); }
.admin-side li a[aria-current="page"] { background: var(--accent-wash); border-left-color: var(--accent); color: var(--accent-ink); font-weight: 750; }
.admin-main { min-width: 0; padding: clamp(1.1rem, 2.3vw, 2rem) clamp(1rem, 2.4vw, 2.2rem) var(--s12); }
.admin-main > h1:first-child { margin: 0 0 var(--s6); }
.admin-main > p:first-child + h1 { margin-top: .4rem; }
.admin-main h1 { font-size: var(--text-2xl); }
.admin-main > .row:first-child { margin-bottom: var(--s5); }
.admin-main .card + .card { margin-top: var(--s4); }
.card { min-width: 0; padding: var(--s5); margin-bottom: var(--s4); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.stat { margin: .32rem 0; color: var(--ink); font-size: 2.25rem; font-weight: 750; letter-spacing: -.045em; line-height: 1.05; }
.grid-3 > .card { border-top: 3px solid var(--accent-line); }
.tabs { display: flex; align-items: end; flex-wrap: wrap; gap: .22rem; padding: 0 0 .05rem; margin: 0 0 var(--s5); border-bottom: 2px solid var(--border); list-style: none; }
.tabs li { margin: 0; }
.tabs a { display: block; padding: .63rem .8rem; border-bottom: 3px solid transparent; border-radius: var(--r-sm) var(--r-sm) 0 0; color: var(--muted); font-size: var(--text-sm); text-decoration: none; }
.tabs a:hover { color: var(--accent-ink); background: var(--surface-alt); }
.tabs a[aria-current="true"], .tabs a[aria-selected="true"], .tabs a[aria-current="page"] { border-bottom-color: var(--accent); background: var(--surface); color: var(--accent-ink); font-weight: 740; }

/* ================= 09. Erfassung: PDF und Felder ================= */
.editor { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: var(--s4); align-items: start; }
.editor .pdf-pane { position: sticky; top: var(--s4); display: flex; flex-direction: column; height: min(82vh, 67rem); min-height: 32rem; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.editor .pdf-pane iframe { width: 100%; height: 100%; flex: 1; border: 0; background: var(--surface-alt); }
.editor .fields-pane { min-width: 0; }
.pane-head { margin: 0; padding: .8rem .9rem; background: var(--surface-alt); border-bottom: 1px solid var(--border); font-size: var(--text-sm); }
.pane-switch { display: none; gap: .5rem; margin-bottom: var(--s4); }
.source { font-size: var(--text-xs); margin-top: .3rem; line-height: 1.5; }
.source .badge { font-size: .75rem; }
.issue { margin-bottom: .75rem; padding: .75rem .95rem; border: 1px solid var(--border); border-left: 4px solid var(--warn); border-radius: var(--r-sm); background: var(--warn-bg); }
.issue.blocking { background: var(--err-bg); border-left-color: var(--err); }
.issue.done { background: var(--ok-bg); border-left-color: var(--ok); }
.suggestion { margin-bottom: var(--s3); padding: .75rem .9rem; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-alt); }
.suggestion.invalid { border-style: dashed; background: var(--err-bg); }
.kv { display: grid; grid-template-columns: minmax(8.5rem, max-content) minmax(0,1fr); gap: .55rem 1rem; }
.kv dt { font-weight: 650; color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.log { max-height: 24rem; overflow: auto; padding: 1rem; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-alt); white-space: pre-wrap; font: var(--text-sm)/1.55 var(--mono); }
.pre-text { max-height: 30rem; overflow: auto; padding: var(--s4); background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--r-sm); white-space: pre-wrap; font: .88rem/1.55 var(--mono); }
.code-block { display: inline-block; max-width: 100%; padding: .8rem 1.1rem; border: 2px dashed var(--border-strong); border-radius: var(--r-sm); background: var(--surface-alt); font: 1.05rem var(--mono); letter-spacing: .08em; word-break: break-all; }
.danger-zone { padding: var(--s5); background: var(--err-bg); border: 1px solid var(--err); border-radius: var(--r-md); }
details.card > summary { cursor: pointer; font-weight: 700; }
.preview-banner { padding: .55rem 0; background: var(--warn-bg); border-bottom: 3px solid var(--warn); font-weight: 700; }
.install { max-width: 47rem; margin: var(--s10) auto; padding-inline: var(--s4); }
.install .card { padding: var(--s8); }
.logo-preview { max-height: 5rem; width: auto; padding: .3rem; border: 1px solid var(--border); border-radius: var(--r-xs); background: #fff; }

/* ================= 10. Upload, KI-Vorschläge und Hilfen ================= */
.dropzone { padding: 1rem; background: var(--surface-alt); border: 2px dashed var(--border-strong); border-radius: var(--r-md); }
.dropzone.is-dragover { background: var(--accent-wash); border-color: var(--accent); }
.dropzone-hint { margin: 0 0 .5rem; color: var(--muted); }
.dropzone-list { padding-left: 1.25rem; margin: .6rem 0 0; overflow-wrap: anywhere; }
.dropzone-list:empty, .dropzone-status:empty { display: none; }
.dropzone-status { margin: .3rem 0; }
.dropzone-too-big { color: var(--err); }
.ai-badge { display: inline-flex; align-items: center; padding: .16rem .47rem; border: 1px solid var(--warn); border-radius: var(--r-pill); background: var(--warn-bg); color: var(--warn); font-size: var(--text-xs); font-weight: 720; }
.ai-sugg { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .6rem; margin-top: .5rem; padding: .7rem .82rem; border-left: 4px solid var(--warn); border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--warn-bg); }
.ai-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.ai-sugg .ai-value { flex: 1 1 13rem; min-width: 0; overflow-wrap: anywhere; }
.ai-sugg .ai-value.multiline { white-space: pre-line; }
.ai-sugg.stale { background: var(--surface-alt); border-left-color: var(--border-strong); }
.ai-sugg.decided .ai-actions { display: none; }
.ai-sugg.accepted { background: var(--ok-bg); border-left-color: var(--ok); }
.ai-sugg.rejected { background: var(--surface-alt); border-left-color: var(--border-strong); }
.ai-sugg.rejected .ai-value { text-decoration: line-through; }
.ai-state { flex-basis: 100%; color: var(--ink-soft); font-size: var(--text-sm); }
.ai-state:empty { display: none; }
.ai-legend { margin: 0 0 var(--s3); }
label.check.ai-suggested { outline: 2px dashed var(--warn); outline-offset: 2px; border-radius: var(--r-xs); }
.ai-flash { box-shadow: 0 0 0 3px var(--ok); transition: box-shadow .25s; }
.tip { display: inline-flex; align-items: center; position: relative; max-width: 100%; }
.tip-btn { display: inline-flex; min-width: 1.7rem; min-height: 1.7rem; padding: .2rem; border: 1px solid var(--info); border-radius: var(--r-pill); font: italic 700 var(--text-xs) var(--font); color: var(--info); background: var(--surface); cursor: help; box-shadow: none; }
.tip-body { display: none; position: absolute; z-index: 60; right: 0; top: calc(100% + .3rem); width: min(28rem, 75vw); max-width: calc(100vw - 2rem); padding: .75rem .85rem; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow-md); color: var(--ink); font: 400 var(--text-sm)/1.5 var(--font); text-align: left; }
.tip-row { display: block; margin: .25rem 0; }
.tip:hover .tip-body, .tip:focus-within .tip-body { display: block; }
.tip.tip-closed .tip-body { display: none; }
.ai-sugg .tip-body { top: auto; bottom: calc(100% + .3rem); }
details.inline-detail { margin-top: .4rem; }
details.inline-detail > summary { font-size: var(--text-sm); font-weight: 620; color: var(--accent-ink); }
details.inline-detail[open] > summary { margin-bottom: .5rem; }

/* ================= 11. Responsive / Reflow ================= */
@media (max-width: 70rem) {
  .site-header .wrap { gap: .5rem 1rem; }
  .site-nav { flex: 1 1 32rem; }
  .site-nav ul { justify-content: flex-start; }
  .admin-shell { grid-template-columns: 13.5rem minmax(0,1fr); }
  .admin-main { padding-inline: 1.25rem; }
}
@media (max-width: 62rem) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; max-height: none; overflow: visible; padding: .6rem .85rem; border-right: 0; border-bottom: 1px solid var(--border); }
  .admin-side ul { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .1rem .4rem; }
  .admin-side .group { grid-column: 1/-1; padding: .6rem .5rem .16rem; }
  .admin-side li a { border-left: 0; border-bottom: 3px solid transparent; padding: .48rem .5rem; }
  .admin-side li a[aria-current="page"] { border-bottom-color: var(--accent); }
  .editor { grid-template-columns: 1fr; }
  .editor .pdf-pane { position: static; height: min(67vh, 46rem); min-height: 20rem; }
  .pane-switch { display: flex; }
  .editor[data-pane="fields"] .pdf-pane { display: none; }
  .editor[data-pane="pdf"] .fields-pane { display: none; }
}
@media (max-width: 48rem) {
  .site-header .wrap { padding-block: .85rem; }
  .site-nav { flex-basis: 100%; }
  .site-nav ul { gap: .2rem; }
  .site-nav a { padding: .4rem .56rem; }
  .admin-side ul { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .admin-header .wrap { padding-inline: 1rem; gap: .35rem .8rem; }
  .admin-main { padding: 1rem; }
  .card { padding: var(--s4); }
  .public main { padding-top: var(--s8); }
  .facts { grid-template-columns: 1fr; gap: .08rem; }
  .facts dt:not(:first-child) { margin-top: .45rem; }
  .kv { grid-template-columns: 1fr; gap: .1rem; }
  .kv dt:not(:first-child) { margin-top: .5rem; }
  .editor .pdf-pane { min-height: 18rem; }
}
@media (max-width: 36rem) {
  .public main > .wrap > h1 { margin-bottom: 1rem; }
  .search-box { padding: var(--s4); }
  .search-main .field { flex-basis: 100%; }
  .search-main button { width: 100%; }
  .decision-item { padding: 1rem; }
  .decision-item h2, .decision-item h3 { font-size: 1.1rem; }
  .meta { gap: .2rem .65rem; }
  .admin-side ul { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .admin-main { padding: .85rem; }
  .site-footer .wrap { display: block; }
  .tabs { gap: 0; }
  .tabs a { padding: .48rem .55rem; }
  .install .card { padding: var(--s5); }
  .tip-body, .ai-sugg .tip-body { position: fixed; left: 1rem; right: 1rem; top: auto; bottom: 1rem; width: auto; max-width: none; max-height: 45vh; overflow-y: auto; }
  .inline-fields { grid-template-columns: 1fr; }
  .copyline input { flex-basis: 100%; }
}
@media (max-width: 25rem) {
  .site-nav a, .embed-nav a { padding-inline: .4rem; }
  .site-nav ul, .embed-nav ul { gap: .1rem; }
  .admin-side li a { font-size: var(--text-xs); }
  .taglist a { font-size: var(--text-xs); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto; transition-duration: 0s; animation-duration: 0s; animation-iteration-count: 1; }
}
@media print {
  body, body.admin { background: #fff; color: #000; }
  .site-header, .site-nav, .site-footer, .embed-nav, .search-box, .pagination, .admin-side, .admin-header, .no-print { display: none !important; }
  a { color: #000; }
  .box, .decision-item, .card { box-shadow: none; border-color: #bbb; }
  .wrap { max-width: none; }
}

/* ==========================================================================
   Ergänzungen der Anwendung (nach dem Design-Briefing hinzugekommen)
   ========================================================================== */

/* Zusammenstellung für ein Newsletter-Werkzeug (Verwaltung, ab 1.0.7) */
.compilation { margin-top: var(--s4); padding: var(--s4) var(--s5); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.compilation h3 { margin: var(--s5) 0 var(--s1); font-size: var(--text-lg); }
.compilation h3:first-child { margin-top: 0; }
.compilation p { margin: var(--s1) 0; }
textarea.code { width: 100%; font-family: var(--mono); font-size: var(--text-xs); }

/* Mindest-Zielgrösse 24 × 24 px (WCAG 2.5.8) für alleinstehende kleine Links und Dateifelder */
p.small > a:only-child, .install p.small a, .card > p > a:only-child { display: inline-block; min-height: 24px; line-height: 24px; }
input[type="file"] { min-height: 1.75rem; }
.checklist.readonly-list { max-height: none; overflow: visible; }

/* Browser ohne color-mix(): sichere Ersatzwerte statt ungültiger Farben */
@supports not (color: color-mix(in srgb, red, blue)) {
  :root { --accent-ink: var(--ink); --accent-wash: var(--surface-alt); --accent-line: var(--border); }
  .site-header { border-bottom-color: rgba(0, 0, 0, .2); }
  .site-header a, .admin-header a, .admin-header button.link { text-decoration-color: currentColor; }
  .site-nav a:hover, .site-nav a[aria-current="page"] { border-color: currentColor; background: rgba(255, 255, 255, .13); }
  .badge.ok, .badge.warn, .badge.err, .badge.info { border-color: currentColor; }
}
