/* Gemeinsame Grundlagen für Planer und Unterseiten: Farben (hell/dunkel), Kopfzeile, Knöpfe.
   Dunkel gilt, wenn das System dunkel ist und nichts anderes gewählt wurde, oder wenn data-theme="dark" gesetzt ist. */
:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --card: #ffffff;
  --card-2: #f0f2f6;
  --text: #1c2330;
  --muted: #586174;
  --border: #e1e4ea;
  --border-strong: #c8cdd7;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --accent-soft: #eef3ff;
  --accent-line: #c9d8fb;
  --good: #15803d;
  --bad: #b42318;
  --warn-bg: #fff7e6;
  --warn-bd: #d98e04;
  --info-bg: #eef3ff;
  --info-bd: #2563eb;
  --err-bg: #fdecea;
  --err-bd: #b42318;
  --shadow: 0 1px 2px rgb(16 24 40 / .06), 0 4px 14px rgb(16 24 40 / .06);
  --radius: 12px;
  --topbar: 56px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f141b; --card: #171d27; --card-2: #1d2531; --text: #e6e9ef; --muted: #a3adbd; --border: #2a3342; --border-strong: #3a4558;
    --accent: #60a5fa; --accent-ink: #0b1220; --accent-soft: #14203a; --accent-line: #27406e;
    --good: #4ade80; --bad: #f97066; --warn-bg: #2a2110; --warn-bd: #d98e04; --info-bg: #14203a; --info-bd: #60a5fa; --err-bg: #2d1613; --err-bd: #f97066;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 4px 14px rgb(0 0 0 / .35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f141b; --card: #171d27; --card-2: #1d2531; --text: #e6e9ef; --muted: #a3adbd; --border: #2a3342; --border-strong: #3a4558;
  --accent: #60a5fa; --accent-ink: #0b1220; --accent-soft: #14203a; --accent-line: #27406e;
  --good: #4ade80; --bad: #f97066; --warn-bg: #2a2110; --warn-bd: #d98e04; --info-bg: #14203a; --info-bd: #60a5fa; --err-bg: #2d1613; --err-bd: #f97066;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 4px 14px rgb(0 0 0 / .35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 12px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
[hidden] { display: none !important; }
button, input, select { touch-action: manipulation; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 200; padding: 10px 14px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; }
.skip:focus { top: 10px; }

/* ---------- Kopfzeile */
.bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  min-height: var(--topbar); padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--card); border-bottom: 1px solid var(--border);
}
.bar .brand { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -.01em; }
.bar .mark { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); }
.bar .mark svg { width: 20px; height: 20px; }
.bar small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: 0; line-height: 1.1; }
.bar .bar-nav { display: flex; gap: 2px; margin-left: 8px; }
.bar .bar-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 600; }
.bar .bar-nav a:hover, .bar .bar-nav a[aria-current] { color: var(--text); background: var(--card-2); }
.bar .spacer { flex: 1; }

/* ---------- Knöpfe */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; font: inherit; font-size: .92rem; font-weight: 600; text-decoration: none; cursor: pointer;
  border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.small { min-height: 44px; padding: 0 14px; font-size: .88rem; background: transparent; color: var(--accent); }
.iconbtn {
  display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0;
  border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer;
}
.iconbtn:hover { color: var(--accent); border-color: var(--accent); }
.iconbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:where(a, button, input, select, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.bar .brand-t { white-space: nowrap; }
@media (max-width: 520px) {
  .bar { gap: 4px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  .bar .brand small { display: none; }
  .bar .bar-nav { margin-left: 0; }
  .bar .bar-nav a { padding: 0 8px; font-size: 14px; }
  .bar .bar-nav a[href="#wissen"] { display: none; }
}
/* Markenname: nur auf dem Rechner (eine Navigationsverknüpfung) ab 360 px, auf Unterseiten bleibt das Symbol */
@media (max-width: 440px) {
  .bar .brand-t { display: none; }
  body.has-sticky .bar .brand-t { display: inline; font-size: 15px; }
  body.has-sticky .bar .bar-nav a { padding: 0 6px; }
}
@media (max-width: 359px) { body.has-sticky .bar .brand-t { display: none; } }
@media print { .bar { display: none; } }
