/*
 * Gestaltung nach scripts.weinzierl-it.de (css/style.css): gleiche Farbwerte,
 * 64-px-Kopfleiste, Seitenleiste 280 px, Karten mit linkem Akzentrand,
 * Fußleiste, gleicher Mobil-Umbruch bei 768 px. Ergänzt um Formulare und
 * Tabellen, die scripts nicht braucht. Keine Inline-Stile (CSP style-src 'self').
 */
:root {
  --primary: #009688;
  --primary-dark: #00695c;
  --primary-light: #b2dfdb;
  --bg: #f1f7f6;
  --surface: #ffffff;
  --surface-muted: #e0f2f1;
  --border: #c8e1df;
  --text: #263332;
  --shadow: rgba(0, 105, 92, 0.15);
  --overlay: rgba(38, 51, 50, 0.5);
  --gut: #2e7d32;
  --schlecht: #c62828;
  --warn: #8d6e00;
}

* { box-sizing: border-box; font-family: system-ui, sans-serif; }
a { color: var(--primary-dark); }
a:hover { color: var(--primary); }
body { margin: 0; background: var(--bg); color: var(--text); }

/* ── Kopfleiste ─────────────────────────────────────────────────────── */
header {
  background: var(--primary);
  color: var(--surface);
  padding: 0.5rem 1rem;
  margin: 0;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 1rem;
}
header h1 { margin: 0; font-size: 1.6rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#menuToggle { display: none; font-size: 1.5rem; background: none; border: none; color: var(--surface); cursor: pointer; padding: 0; margin: 0; }
header .wer { font-size: 0.85rem; opacity: 0.9; }

/* ── Grundgerüst ────────────────────────────────────────────────────── */
#app { display: flex; height: calc(100vh - 64px - 48px); }
#sidebar { width: 280px; flex: 0 0 280px; background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; }
#sidebar ul { list-style: none; padding: 0; margin: 0; }
#sidebar .subject {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1rem; font-weight: bold; background: var(--surface-muted); border-bottom: 1px solid var(--border);
}
#sidebar .topic { display: block; padding: 0.5rem 2rem; cursor: pointer; color: var(--text); text-decoration: none; }
#sidebar .topic:hover, #sidebar .topic[aria-current="true"] { background: var(--primary-light); }
#sidebar .feld { padding: 0.5rem 1rem 0.75rem; }
#sidebar .feld select { max-width: 100%; }
#content { flex: 1; padding: 1.5rem; overflow-y: auto; }
#content h2 { margin-top: 0; font-size: 110%; color: var(--primary-dark); }

/* ── Karten (Abschnitte) ────────────────────────────────────────────── */
section {
  border-radius: 6px;
  padding: 0.75rem 1rem 1rem;
  margin-bottom: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 6px solid var(--primary);
  box-shadow: 4px 4px 10px var(--shadow);
  scroll-margin-top: 1rem;
}
.einleitung p { margin: 0 0 0.5rem; }

/* ── Formulare ──────────────────────────────────────────────────────── */
label { display: block; margin: 0.5rem 0 0.25rem; font-size: 0.85rem; color: var(--primary-dark); font-weight: 600; }
label.inline { display: flex; gap: 0.4rem; align-items: center; font-weight: normal; color: var(--text); }
label.inline input { width: auto; }
input, select, textarea {
  width: 100%; max-width: 420px; padding: 0.45rem 0.55rem; font-size: 0.95rem;
  border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-light); border-color: var(--primary); }
textarea { max-width: 100%; min-height: 70px; }
button {
  background: var(--primary); color: var(--surface); border: none; padding: 0.5rem 1rem;
  cursor: pointer; border-radius: 4px; font-size: 0.95rem; margin: 0.5rem 0.5rem 0 0;
}
button:hover { background: var(--primary-dark); }
button.zweit { background: transparent; color: var(--primary-dark); border: 1px solid var(--primary); }
button.zweit:hover { background: var(--surface-muted); }
button.gefahr { background: transparent; color: var(--schlecht); border: 1px solid var(--schlecht); }
button.gefahr:hover { background: #fdecea; }
button:disabled { opacity: 0.5; cursor: default; }
.zeile { display: flex; flex-wrap: wrap; gap: 0 1rem; align-items: flex-end; }
.zeile > div { flex: 1 1 200px; }

/* Reiter (Anmeldung) */
.tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; margin-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.tabs button { background: none; color: var(--primary-dark); margin: 0; border-radius: 4px 4px 0 0; }
.tabs button:hover { background: var(--surface-muted); }
.tabs button[aria-selected="true"] { background: var(--primary); color: var(--surface); }

/* ── Meldungen, Marken, Tabellen ────────────────────────────────────── */
.verborgen, .hidden { display: none !important; }
.meldung { padding: 0.5rem 0.75rem; border-radius: 4px; margin: 0.5rem 0 1rem; background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--primary); }
.meldung.fehler { border-left-color: var(--schlecht); color: var(--schlecht); }
.meldung.erfolg { border-left-color: var(--gut); color: var(--gut); }
.meldung.warnung { border-left-color: var(--warn); color: #5d4a00; background: #fffbea; font-size: 0.85rem; margin: 0 0 0.4rem; }
#meldung.schwebend:not(:empty) { position: fixed; top: 72px; right: 1rem; left: auto; max-width: min(520px, calc(100vw - 2rem)); z-index: 950; }
#meldung.schwebend .meldung { box-shadow: 4px 4px 10px var(--shadow); margin: 0; }
.code { font-family: ui-monospace, monospace; font-size: 1.15rem; letter-spacing: 1px; padding: 0.5rem; border: 1px dashed var(--warn); background: #fffbea; display: inline-block; }
.tabelle { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-muted); color: var(--primary-dark); font-weight: 600; }
tbody tr:hover { background: var(--bg); }
td button, td select, td input { margin: 0 0.25rem 0.25rem 0; width: auto; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--bg); padding: 0.5rem; border-radius: 4px; max-height: 360px; overflow: auto; margin: 0; font-size: 0.85rem; }
.antworttext { font-family: ui-monospace, monospace; white-space: pre-wrap; max-width: 520px; }
.klein { font-size: 0.85rem; color: #4d5f5d; }
.marke { display: inline-flex; align-items: center; gap: 0.2rem; padding: 0 0.4rem; border-radius: 4px; border: 1px solid var(--border); background: var(--surface-muted); font-size: 0.8rem; margin: 0 0.2rem 0.2rem 0; }
.marke button { margin: 0; padding: 0 0.3rem; line-height: 1.2; }
.marke.gut { color: var(--gut); border-color: var(--gut); background: #e8f5e9; }
.marke.schlecht { color: var(--schlecht); border-color: var(--schlecht); background: #fdecea; }
#live { max-height: 320px; overflow: auto; font-size: 0.9rem; }
.live-zeile { padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--border); border-left: 4px solid transparent; }
.live-zeile .live-zeit { font-family: ui-monospace, monospace; font-size: 0.8rem; color: #4d5f5d; }
.live-zeile.live-richtig { border-left-color: var(--gut); }
.live-zeile.live-falsch { border-left-color: var(--schlecht); }
.live-zeile.live-warnung { border-left-color: var(--warn); background: #fffbea; }

/* ── Fußleiste ──────────────────────────────────────────────────────── */
#footer-nav { background: var(--surface); border-top: 1px solid var(--border); padding: 0.75rem 1rem; text-align: center; height: 48px; }
#footer-nav nav { display: flex; justify-content: center; gap: 1.5rem; }
#footer-nav a { color: var(--primary-dark); text-decoration: none; font-size: 0.9rem; }
#footer-nav a:hover { text-decoration: underline; }
#footer-nav button { background: none; color: var(--primary-dark); padding: 0; margin: 0; font-size: 0.9rem; }
#footer-nav button:hover { text-decoration: underline; background: none; }

/* ── Mobil (wie scripts) ────────────────────────────────────────────── */
@media (max-width: 768px) {
  html { height: 100%; }
  body { display: flex; flex-direction: column; height: 100%; }
  header h1 { font-size: 130%; }
  header .wer { display: none; }
  #menuToggle { display: block; }
  #app { flex-direction: column; flex: 1; height: auto; min-height: 0; }
  #sidebar {
    position: fixed; top: 64px; left: 0; bottom: 0; width: 260px;
    transform: translateX(-100%); transition: transform 0.3s ease; z-index: 900; box-shadow: 2px 0 8px var(--shadow);
  }
  #sidebar.open { transform: translateX(0); }
  #content { padding: 1rem; }
  #sidebar .topic { padding: 1rem; font-size: 1rem; }
  #footer-nav nav { gap: 1rem; flex-wrap: wrap; }
}

/* Kleine Zusatzknöpfe in Tabellen (z. B. „Verlauf“) */
button.klein-knopf { padding: 2px 8px; font-size: 0.8rem; margin-top: 4px; }
/* Einmalig angezeigtes API-Token */
.token-anzeige { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; width: 100%; }
pre.beispiel { background: var(--surface-muted); padding: 8px 10px; border-radius: 6px; overflow-x: auto; font-size: 0.8rem; white-space: pre-wrap; word-break: break-all; }
/* ── Anordnung nach www.fuezsued.de ─────────────────────────────────────
 * Feste Kopfleiste: Titel links, wenige Hauptbereiche rechts als runde
 * Menüpunkte; mobil ☰ mit Menü, das von rechts hereinfährt. Darunter eine
 * Werkzeugleiste (Auswahl + Abschnittssprünge) statt Seitenleiste, dann
 * breite, gestapelte Abschnitte mit wechselndem Hintergrund und großen
 * Überschriften; zentrierte Fußzeile. Farben bleiben (scripts.weinzierl-it.de).
 */
header { position: sticky; top: 0; z-index: 1000; height: 64px; padding: 0 clamp(1rem, 5vw, 100px); box-shadow: 0 2px 8px var(--shadow); }
header h1 { flex: 0 1 auto; font-size: 1.35rem; letter-spacing: 1px; text-transform: uppercase; font-weight: 700; }
header .wer { margin-left: auto; order: 3; }
.hauptmenue { display: flex; gap: 0.25rem; margin-left: auto; order: 2; }
.hauptmenue a {
  color: var(--surface); text-decoration: none; font-weight: 500; padding: 0.3rem 0.9rem; border-radius: 20px;
  transition: background 0.3s, color 0.3s; white-space: nowrap;
}
.hauptmenue a:hover, .hauptmenue a[aria-current="page"] { background: var(--surface); color: var(--primary-dark); }
#menuToggle { order: 4; }

/* Werkzeugleiste (vormals Seitenleiste) */
#app { display: block; height: auto; }
#sidebar {
  width: auto; flex: none; position: sticky; top: 64px; z-index: 900; overflow: visible;
  background: var(--surface); border-right: none; border-bottom: 1px solid var(--border); box-shadow: 0 2px 6px var(--shadow);
  padding: 0.4rem clamp(1rem, 5vw, 100px);
}
#sidebar ul { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.25rem 0.75rem; }
#sidebar .subject { display: none; }
#sidebar .feld { padding: 0; display: flex; flex-direction: column; min-width: 0; }
#sidebar .feld label { margin: 0 0 0.15rem; font-size: 0.75rem; }
#sidebar .feld select, #sidebar .feld input { width: auto; min-width: 11rem; max-width: 22rem; padding: 0.3rem 0.45rem; }
#sidebar .feld button { margin: 0 0.4rem 0 0; padding: 0.35rem 0.8rem; }
#sidebar .feld .klein { align-self: center; }
#sidebar .trenner { flex-basis: 100%; height: 0; }
#sidebar .topic {
  display: inline-block; padding: 0.2rem 0.8rem; border-radius: 20px; font-size: 0.9rem; color: var(--primary-dark);
  border: 1px solid var(--border); transition: background 0.3s;
}
#sidebar .topic:hover, #sidebar .topic[aria-current="true"] { background: var(--primary-light); }
#sidebar .nur-mobil { display: none; }

/* Gestapelte, breite Abschnitte mit wechselndem Hintergrund */
#content { padding: 0; overflow: visible; }
#content > #meldung:not(.schwebend) { padding: 0 clamp(1rem, 5vw, 100px); }
#content > section {
  margin: 0; border: none; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--border);
  padding: 2rem clamp(1rem, 5vw, 100px) 2.5rem; background: var(--surface); scroll-margin-top: 130px;
}
#content > section:nth-of-type(even) { background: var(--bg); }
#content > section > h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.9rem); font-weight: 700; text-transform: uppercase; letter-spacing: 2px;
  color: var(--primary-dark); margin: 0 0 0.75rem;
}
#content > section > h2::after { content: ""; display: block; width: 3rem; height: 3px; background: var(--primary); margin-top: 0.4rem; }
#content > section.einleitung { background: var(--primary-dark); color: var(--surface); }
#content > section.einleitung h2 { color: var(--surface); }
#content > section.einleitung h2::after { background: var(--primary-light); }
#content h3 { color: var(--primary-dark); font-size: 1.05rem; margin: 1.25rem 0 0.5rem; }
fieldset { border: 1px solid var(--border); border-radius: 6px; margin: 0 0 0.75rem; padding: 0.5rem 0.75rem 0.75rem; }
legend { font-weight: 600; color: var(--primary-dark); padding: 0 0.3rem; }
.karte { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 0.6rem 0.8rem; margin: 0 0 0.6rem; }
details > summary { cursor: pointer; font-weight: 600; color: var(--primary-dark); margin: 0.75rem 0 0.25rem; }
input.schmal { max-width: 6rem; }

/* Zentrierte Fußzeile */
#footer-nav { height: auto; padding: 1.25rem 1rem; }
#footer-nav nav { flex-wrap: wrap; gap: 0.5rem 1.5rem; }
#footer-nav a, #footer-nav button { padding: 0.2rem 0.8rem; border-radius: 20px; }
#footer-nav a:hover, #footer-nav button:hover { background: var(--surface-muted); text-decoration: none; }

/* Mobil: ☰ öffnet das Menü von rechts (wie fuezsued.de) */
@media (max-width: 1060px) {
  .hauptmenue { display: none; }
  header .wer { display: none; }
  #menuToggle { display: block; margin-left: auto; }
  #app { flex-direction: column; }
  #sidebar {
    position: fixed; top: 64px; right: 0; left: auto; bottom: 0; width: min(320px, 86vw); padding: 0.5rem 0 2rem;
    overflow-y: auto; transform: translateX(100%); transition: transform 0.4s ease; box-shadow: -2px 0 8px var(--shadow);
    border-left: 1px solid var(--border); border-bottom: none; z-index: 950;
  }
  #sidebar.open { transform: translateX(0); }
  #sidebar ul { display: block; }
  #sidebar .subject { display: flex; }
  #sidebar .nur-mobil { display: block; }
  #sidebar .feld { padding: 0.5rem 1rem; }
  #sidebar .feld select, #sidebar .feld input { width: 100%; max-width: none; }
  #sidebar .topic { display: block; border: none; border-radius: 0; padding: 0.8rem 1.25rem; font-size: 1rem; }
  #content > section { scroll-margin-top: 72px; padding: 1.5rem 1rem 2rem; }
}
@media (max-width: 768px) {
  body { display: block; height: auto; }
  html { height: auto; }
  #app { height: auto; }
}

.hauptmenue-mobil a { display: block; padding: 0.8rem 1.25rem; color: var(--text); text-decoration: none; }
.hauptmenue-mobil a[aria-current="page"], .hauptmenue-mobil a:hover { background: var(--primary-light); }
#sidebar.leer:not(.open) { display: none; }
@media (max-width: 1060px) { #sidebar.leer { display: block; } }
/* Knopfgruppen in der Werkzeugleiste nebeneinander */
#sidebar .feld:has(> button) { flex-direction: row; align-items: flex-end; }
@media (max-width: 1060px) { #sidebar .feld:has(> button) { flex-wrap: wrap; } }

/* ── Hauptmenü mit Untermenüs ─────────────────────────────────────────── */
.hauptmenue ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem; align-items: center; }
.hauptmenue .menue-gruppe { position: relative; display: flex; align-items: center; }
.menue-knopf {
  background: transparent; color: var(--surface); border: none; margin: 0 0 0 -0.2rem; padding: 0.3rem 0.45rem;
  border-radius: 20px; font-size: 0.85rem; line-height: 1;
}
.menue-knopf:hover, .menue-knopf[aria-expanded="true"] { background: var(--primary-dark); }
.untermenue {
  position: absolute; top: calc(100% + 0.5rem); left: 0; min-width: 14rem; z-index: 1100; list-style: none; margin: 0; padding: 0.35rem 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 6px 18px var(--shadow);
}
.hauptmenue .untermenue { display: block; }
.hauptmenue .untermenue[hidden] { display: none; }
.untermenue a { display: block; padding: 0.5rem 1rem; color: var(--text); text-decoration: none; border-radius: 0; white-space: nowrap; }
.untermenue a:hover, .untermenue a:focus { background: var(--surface-muted); color: var(--primary-dark); outline: none; }
.hauptmenue-mobil ul { list-style: none; margin: 0; padding: 0; }
.hauptmenue-mobil .untermenue { position: static; box-shadow: none; border: none; padding: 0 0 0.25rem; min-width: 0; }
.hauptmenue-mobil .untermenue a { padding: 0.55rem 1.25rem 0.55rem 2.25rem; font-size: 0.95rem; }
.hauptmenue-mobil .menue-gruppe > a { font-weight: 600; }

/* ── Dialoge ───────────────────────────────────────────────────────────── */
dialog { border: none; border-radius: 8px; padding: 0; width: min(560px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); box-shadow: 0 12px 40px rgba(0,0,0,0.25); color: var(--text); }
dialog.breit { width: min(860px, calc(100vw - 2rem)); }
dialog::backdrop { background: var(--overlay); }
dialog form { padding: 1.25rem 1.5rem 1rem; display: flex; flex-direction: column; max-height: calc(100vh - 2rem); }
dialog h2 { margin: 0 0 0.75rem; color: var(--primary-dark); font-size: 1.25rem; }
.dialog-inhalt { overflow-y: auto; padding-right: 0.25rem; }
.dialog-feld { margin-bottom: 0.6rem; }
.dialog-feld input, .dialog-feld select, .dialog-feld textarea { max-width: 100%; }
.dialog-knoepfe { display: flex; gap: 0.5rem; justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 0.75rem; margin-top: 0.5rem; }
.dialog-knoepfe button { margin: 0; }
.dialog-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 1rem; }

/* ── Referatsthemen: Reiter, Kacheln, Schritte, Zeitleiste ───────────── */
#arbeitsbereich, .leerzustand { padding: 1.5rem clamp(1rem, 5vw, 100px) 2.5rem; }
.leerzustand { max-width: 760px; }
.leerzustand h2 { color: var(--primary-dark); text-transform: uppercase; letter-spacing: 2px; }
.reiterleiste { display: flex; gap: 0.25rem; overflow-x: auto; border-bottom: 2px solid var(--border); margin-bottom: 1.25rem; scrollbar-width: thin; }
.reiterleiste [role="tab"] {
  background: transparent; color: var(--text); margin: 0; border-radius: 6px 6px 0 0; padding: 0.6rem 1rem; white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -2px; display: inline-flex; gap: 0.4rem; align-items: center;
}
.reiterleiste [role="tab"]:hover { background: var(--surface-muted); }
.reiterleiste [role="tab"][aria-selected="true"] { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 600; }
.reiterleiste [role="tab"]:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.zaehler:not(:empty) { background: var(--primary); color: var(--surface); border-radius: 10px; padding: 0 0.45rem; font-size: 0.75rem; line-height: 1.4; }
[role="tabpanel"] { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem 1.5rem 1.5rem; }
[role="tabpanel"]:focus-visible { outline: 2px solid var(--primary-light); }
[role="tabpanel"] > h2 { margin: 0 0 1rem; color: var(--primary-dark); font-size: 1.4rem; text-transform: uppercase; letter-spacing: 1.5px; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; }
.kachel { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 0.9rem 1rem; text-decoration: none; color: var(--text); }
.kachel h3 { margin-top: 0; }
a.kachel:hover { border-color: var(--primary); box-shadow: 0 2px 8px var(--shadow); }
.kennzahl strong { display: block; font-size: 1.6rem; color: var(--primary-dark); }
.kennzahl span { font-size: 0.85rem; color: #4d5f5d; }
.kennzahl.hinweis { border-left: 4px solid var(--warn); }
.zweispaltig { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem 2rem; align-items: start; }
.schritte { list-style: none; padding: 0; margin: 0; }
.schritte li { display: flex; gap: 0.6rem; align-items: center; padding: 0.45rem 0; border-bottom: 1px solid var(--border); }
.schritte .haken { width: 1.5rem; height: 1.5rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--border); color: var(--border); flex: none; }
.schritte li.fertig .haken { background: var(--gut); border-color: var(--gut); color: var(--surface); }
.schritte li.fertig a { color: #4d5f5d; text-decoration: line-through; }
.eigenschaften { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0 0 0.75rem; }
.eigenschaften dt { font-weight: 600; color: var(--primary-dark); font-size: 0.9rem; }
.eigenschaften dd { margin: 0; white-space: pre-wrap; }
.aktionsleiste { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: flex-end; margin-bottom: 1rem; }
.aktionsleiste button { margin: 0; }
.aktionsleiste label { margin-top: 0; }
.status-chip:not(:empty) { display: inline-block; padding: 0.3rem 0.8rem; border-radius: 20px; background: var(--surface-muted); color: var(--primary-dark); font-size: 0.85rem; font-weight: 600; }
.status-chip[data-zustand="auswahl"] { background: #e8f5e9; color: var(--gut); }
.status-chip[data-zustand="verborgen"] { background: #eceff1; color: #455a64; }
progress { width: 100%; max-width: 8rem; height: 0.5rem; display: block; accent-color: var(--primary); }
progress.voll { accent-color: var(--schlecht); }
tr.kollision td { background: #fffbea; }
.warntext { color: #5d4a00; }
.marke.hinweis { color: #5d4a00; border-color: var(--warn); background: #fffbea; }
table.kompakt th, table.kompakt td { padding: 0.3rem 0.4rem; }
.jetzt-karte { background: var(--surface-muted); border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 0.75rem; }
.jetzt-karte p { margin: 0.25rem 0 0; }
.zeitleiste { list-style: none; padding: 0 0 0 1rem; margin: 0 0 1.25rem; border-left: 3px solid var(--border); }
.zeitleiste li { position: relative; padding: 0 0 0.9rem 0.75rem; }
.zeitleiste li::before { content: ""; position: absolute; left: -1.55rem; top: 0.25rem; width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--border); }
.zeitleiste li[data-zustand="auswahl"]::before { background: var(--gut); }
.zeitleiste li[data-zustand="persoenlich"]::before, .zeitleiste li[data-zustand="zuordnungen"]::before { background: var(--primary); }
.visuell-verborgen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 1060px) { [role="tabpanel"] { padding: 1rem; } #arbeitsbereich, .leerzustand { padding: 1rem; } }

/* ── Logo und Kontomenü ────────────────────────────────────────────────── */
header h1 { text-transform: none; letter-spacing: 0.5px; }
header h1 a.logo { color: var(--surface); text-decoration: none; }
header h1 a.logo:hover, header h1 a.logo:focus-visible { text-decoration: underline; text-underline-offset: 4px; }
header .wer { display: none; }
.konto-bereich { order: 5; margin-left: 0.75rem; }
.konto-gruppe { position: relative; }
.konto-knopf {
  display: inline-flex; align-items: center; gap: 0.45rem; margin: 0; padding: 0.25rem 0.6rem 0.25rem 0.25rem;
  background: transparent; color: var(--surface); border: 1px solid rgba(255,255,255,0.5); border-radius: 22px; font-size: 0.9rem;
}
.konto-knopf:hover, .konto-knopf[aria-expanded="true"] { background: var(--primary-dark); }
.avatar { width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--surface); color: var(--primary-dark); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; }
.konto-name { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.konto-menue { right: 0; left: auto; min-width: 16rem; }
.konto-menue[hidden] { display: none; }
.konto-menue:not([hidden]) { display: block; }
/* Öffnen auch beim Darüberfahren (nur mit Maus); Brücke über den Abstand. */
@media (hover: hover) and (pointer: fine) {
  .konto-gruppe:hover > .konto-menue { display: block; }
  .konto-menue::before { content: ""; position: absolute; top: -0.6rem; left: 0; right: 0; height: 0.6rem; }
}
.konto-kopf { padding: 0.6rem 1rem 0.6rem; border-bottom: 1px solid var(--border); margin-bottom: 0.25rem; }
.konto-kopf strong { display: block; color: var(--primary-dark); }
.untermenue .menue-eintrag, .konto-mobil .menue-eintrag {
  display: block; width: 100%; text-align: left; background: transparent; color: var(--text); margin: 0; border-radius: 0; padding: 0.5rem 1rem; font-size: 0.95rem;
}
.untermenue .menue-eintrag:hover, .untermenue .menue-eintrag:focus-visible { background: var(--surface-muted); color: var(--primary-dark); }
.anmelden-link { color: var(--surface); text-decoration: none; border: 1px solid rgba(255,255,255,0.6); border-radius: 20px; padding: 0.3rem 0.9rem; }
.anmelden-link:hover { background: var(--surface); color: var(--primary-dark); }
.konto-mobil { list-style: none; padding: 0; margin: 0.5rem 0 0; border-top: 1px solid var(--border); }
@media (max-width: 1060px) {
  .konto-bereich { display: none; }
  .konto-mobil .menue-eintrag { padding: 0.8rem 1.25rem; }
}

/* ── Konto-Seite ───────────────────────────────────────────────────────── */
#angemeldet > section, #content > section#gast {
  margin: 0; border: none; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--border);
  padding: 2rem clamp(1rem, 5vw, 100px) 2.5rem; background: var(--surface);
}
#angemeldet > section:nth-of-type(even) { background: var(--bg); }
#angemeldet > section > h2, #gast > h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.9rem); font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--primary-dark); margin: 0 0 0.75rem;
}
#angemeldet > section > h2::after { content: ""; display: block; width: 3rem; height: 3px; background: var(--primary); margin-top: 0.4rem; }
#angemeldet .kachel { background: var(--surface); }
.codeliste { columns: 2; font-size: 1.1rem; padding-left: 1.5rem; }
.codeliste code { letter-spacing: 1px; }
img.qr { display: block; margin: 0.5rem auto; background: #fff; padding: 6px; border: 1px solid var(--border); border-radius: 6px; }
code.geheimnis { font-size: 1rem; letter-spacing: 1px; word-break: break-all; }

/* ── Einzelseiten: Unternavigation, Fußzeile ───────────────────────────── */
.unternavigation { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 clamp(1rem, 5vw, 100px); }
.unternavigation ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem; overflow-x: auto; }
.unternavigation a {
  display: inline-block; padding: 0.7rem 1rem; color: var(--text); text-decoration: none; white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.unternavigation a:hover { background: var(--surface-muted); }
.unternavigation a[aria-current="page"] { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 600; }
#content > section.ansicht { background: var(--surface); min-height: 50vh; }
@media (min-width: 1061px) { body.ohne-auswahl #sidebar { display: none; } }
#footer-nav p { margin: 0; color: #4d5f5d; font-size: 0.85rem; }

/* ── Startseite ────────────────────────────────────────────────────────── */
#content > section.start { background: var(--surface); }
#content > section.start > h2 { text-transform: none; letter-spacing: 0.5px; }
.kurzliste { list-style: none; padding: 0; margin: 0; }
.kurzliste li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.schnell { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.6rem; }
.schnell-link { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.8rem 1rem; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text); background: var(--bg); }
.schnell-link strong { color: var(--primary-dark); }
.schnell-link:hover { border-color: var(--primary); box-shadow: 0 2px 8px var(--shadow); }
