:root {
  --bg: #fbf9f4;
  --surface: #ffffff;
  --surface-2: #f3efe5;
  --text: #1f2a24;
  --muted: #5b675f;
  --line: #e3ddd0;
  --accent: #2f6b4f;
  --accent-ink: #ffffff;
  --accent-soft: #e4efe7;
  --warn: #9a3b1f;
  --warn-soft: #fbeae3;
  --evidence: #2d4f7c;
  --evidence-soft: #e7eef8;
  --tip-soft: #f4f0dc;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(30 40 30 / 6%), 0 6px 24px rgb(30 40 30 / 6%);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141a17; --surface: #1b2420; --surface-2: #222c27; --text: #e8ece8; --muted: #a3b0a8;
    --line: #2f3a34; --accent: #7cc39c; --accent-ink: #10201a; --accent-soft: #1f3529;
    --warn: #f0a58a; --warn-soft: #3a2219; --evidence: #9cbbe8; --evidence-soft: #1d2a3d; --tip-soft: #2e2b1b;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141a17; --surface: #1b2420; --surface-2: #222c27; --text: #e8ece8; --muted: #a3b0a8;
  --line: #2f3a34; --accent: #7cc39c; --accent-ink: #10201a; --accent-soft: #1f3529;
  --warn: #f0a58a; --warn-soft: #3a2219; --evidence: #9cbbe8; --evidence-soft: #1d2a3d; --tip-soft: #2e2b1b;
  --shadow: none; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1.0625rem/1.65 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); margin: 0 0 .5rem; }
h2 { font-size: clamp(1.45rem, 3vw, 1.8rem); margin: 2.4rem 0 .8rem; }
h3 { font-size: 1.2rem; margin: 1.8rem 0 .5rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 99; background: var(--surface); padding: 8px 12px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 1.15rem; }
.logo svg { width: 30px; height: 30px; fill: var(--accent); }
.main-nav { display: flex; gap: 18px; flex: 1; overflow-x: auto; }
.main-nav a { color: var(--text); text-decoration: none; white-space: nowrap; font-size: .95rem; }
.main-nav a:hover { color: var(--accent); }
.search input { width: 190px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: .95rem; }
@media (max-width: 760px) {
  .header-inner { gap: 8px 16px; padding: 8px 16px; }
  .main-nav { order: 3; flex-basis: 100%; padding-bottom: 6px; }
  .search { margin-left: auto; }
  .search input { width: 140px; }
}

/* Hero */
.hero { background: linear-gradient(180deg, var(--accent-soft), var(--bg)); padding: 56px 0 40px; }
.hero h1 { max-width: 18ch; }
.hero-text { max-width: 62ch; font-size: 1.1rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 10px 20px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.btn:disabled { opacity: .6; cursor: wait; }

/* Karten */
.home-sec { margin: 40px 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.sec-head h2 { margin-top: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s; }
.card:hover { transform: translateY(-2px); }
.card a { color: inherit; text-decoration: none; display: block; height: 100%; }
.card-img img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.card-body { padding: 14px 16px 18px; }
.card-cat { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 600; }
.card h3 { margin: .3rem 0 .4rem; font-size: 1.15rem; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Brotkrumen */
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 20px 0; font-size: .9rem; color: var(--muted); }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; }
.breadcrumb a { color: var(--muted); }

/* Artikel */
.article-wrap { max-width: 800px; }
.article-head .lead { font-size: 1.2rem; color: var(--muted); margin: .4rem 0 1rem; }
.meta { font-size: .9rem; color: var(--muted); }
.hero-img img { border-radius: var(--radius); aspect-ratio: 16 / 9; object-fit: cover; width: 100%; margin: 20px 0; }
.toc { background: var(--surface-2); border-radius: var(--radius); padding: 16px 22px; margin: 24px 0; }
.toc p { margin: 0 0 6px; font-weight: 700; }
.toc ol { margin: 0; padding-left: 20px; }
.prose p, .prose li { max-width: 72ch; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: .3rem 0; }
.prose blockquote { margin: 1.5rem 0; padding: 4px 20px; border-left: 4px solid var(--line); color: var(--muted); }
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; background: var(--surface); }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; }

.callout { border-radius: var(--radius); padding: 14px 20px; margin: 1.6rem 0; border-left: 5px solid; }
.callout > :last-child { margin-bottom: 0; }
.callout p { margin: .5rem 0; }
.callout-title { font-weight: 700; margin-top: 0 !important; }
.callout-evidence { background: var(--evidence-soft); border-color: var(--evidence); }
.callout-evidence .callout-title { color: var(--evidence); }
.callout-warn { background: var(--warn-soft); border-color: var(--warn); }
.callout-warn .callout-title { color: var(--warn); }
.callout-tip { background: var(--tip-soft); border-color: #b39b2f; }
.callout-summary, .callout-info { background: var(--accent-soft); border-color: var(--accent); }

.ask-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 40px 0; box-shadow: var(--shadow); }
.ask-box p { margin: 0; flex: 1 1 300px; }
.related { margin: 48px 0; }

/* Kategorie */
.cat-head { margin-bottom: 24px; }
.az { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 8px; position: sticky; top: 64px; background: var(--bg); padding: 8px 0; z-index: 5; }
.az a { min-width: 34px; text-align: center; padding: 4px 8px; border-radius: 8px; background: var(--surface-2); text-decoration: none; font-weight: 600; }

.search-big input { width: 100%; padding: 14px 18px; font-size: 1.1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); margin: 16px 0 24px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 64px; padding: 32px 0 96px; font-size: .9rem; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; margin: 12px 0; }
.site-footer a { color: var(--muted); }
.disclaimer { max-width: 80ch; }

/* Chat */
.chat-fab { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 12px 18px; font: inherit; font-weight: 600; box-shadow: 0 8px 24px rgb(0 0 0 / 20%); cursor: pointer; }
.chat-fab svg { width: 20px; height: 20px; fill: currentColor; }
.chat-panel { position: fixed; right: 20px; bottom: 84px; z-index: 50; width: min(400px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 16px 48px rgb(0 0 0 / 22%); overflow: hidden; }
.chat-panel[hidden] { display: none; }
.chat-panel header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--accent); color: var(--accent-ink); }
.chat-close { background: none; border: 0; color: inherit; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; font-size: .95rem; }
.msg p { margin: 0 0 .5rem; }
.msg p:last-child { margin: 0; }
.msg.bot { background: var(--surface-2); align-self: flex-start; }
.msg.user { background: var(--accent); color: var(--accent-ink); align-self: flex-end; }
.msg.error { background: var(--warn-soft); }
.msg.wait { opacity: .6; }
.msg .quellen { font-size: .85rem; margin-top: .5rem; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.chat-note { margin: 0; padding: 0 12px 10px; font-size: .75rem; color: var(--muted); }
@media (max-width: 760px) {
  .chat-fab span { display: none; }
  .chat-panel { right: 16px; bottom: 80px; }
}

/* Werbung */
.ad { margin: 2rem 0; min-height: 280px; text-align: center; }
.ad-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.ad ins { display: block; }
.related + .ad { margin-top: 0; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* Hinweisleiste für neue Besucher */
.site-notice { background: var(--accent-soft); border-bottom: 1px solid var(--line); font-size: .92rem; }
.notice-inner { display: flex; align-items: center; gap: 12px 20px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.notice-inner p { margin: 0; flex: 1 1 420px; }
.notice-ok { padding: 6px 16px; font-size: .9rem; }
.hinweis-ok .site-notice { display: none; }
