:root {
  --c-page-bg: #f0f2f5;
  --c-header-bg: #005a93;
  --c-header-text: #ffffff;
  --c-box-header-bg: #0071b8;
  --c-box-header-text: #ffffff;
  --c-box-bg: #ffffff;
  --c-box-border: #e5e5e5;
  --c-col-bg: #f4f9fd;
  --c-text: #222222;
  --c-text-muted: #777777;
  --c-accent-soft: #eaf4fb;
  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 16px;
  --s-lg: 24px;
  --r-box: 8px;
  --r-tile: 6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--c-page-bg);
  color: var(--c-text);
  min-height: 100vh;
  padding: var(--s-md);
}
a { color: inherit; }
#app { width: 100%; }
.page-header {
  background: var(--c-header-bg);
  color: var(--c-header-text);
  padding: var(--s-sm) var(--s-md) var(--s-sm) var(--s-lg);
  border-radius: var(--r-box);
  margin-bottom: var(--s-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-md);
}
.page-brand { font-size: 24px; font-weight: 700; letter-spacing: 0.2px; }
.page-nav, .tabs { display: flex; gap: var(--s-xs); flex-wrap: wrap; }
.page-nav a, .tabs a {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  color: inherit;
}
.page-nav a:hover, .tabs a:hover { background: rgba(255,255,255,0.22); }
.page-nav a.active, .tabs a.active { background: #ffffff; color: var(--c-header-bg); }
/* Übertragung ist ein gesonderter Bereich — die Plan-Sidebar entfällt hier
   (sie lebt auf plaene.html). Inhalt nimmt die volle Breite ein. */
.plan-layout { display: block; width: 2000px; max-width: 100%; margin: 0 auto; }
.plan-sidebar { display: none; }
.plan-sidebar, .panel {
  background: var(--c-box-bg);
  border: 1px solid var(--c-box-border);
  border-radius: var(--r-box);
  overflow: hidden;
}
.panel-header, .sidebar-header {
  background: var(--c-box-header-bg);
  color: var(--c-box-header-text);
  padding: var(--s-sm) var(--s-md);
  font-weight: 700;
}
.sidebar-body, .panel-body { padding: var(--s-md); }
.plan-link {
  display: block;
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--c-text);
  margin-bottom: 4px;
}
.plan-link.active { background: var(--c-accent-soft); color: var(--c-header-bg); font-weight: 700; }
.plan-link.muted { color: var(--c-text-muted); }
.content-stack { display: flex; flex-direction: column; gap: var(--s-md); min-width: 0; }
.tabbar {
  background: var(--c-header-bg);
  color: var(--c-header-text);
  border-radius: var(--r-box);
  padding: var(--s-sm);
}
.three-col { display: grid; grid-template-columns: 340px minmax(380px, 0.85fr) minmax(380px, 1.3fr); gap: var(--s-md); align-items: start; }
.outline-list { list-style: none; display: flex; flex-direction: column; gap: 0; }
/* Ebene 1 — Teil (A/B/C, W): kräftige Leiste mit Hintergrund */
.outline-group-btn {
  display: block;
  width: 100%;
  border: none;
  text-align: left;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  color: #ffffff;
  background: var(--c-box-header-bg);
  padding: 7px 10px;
  border-radius: 6px;
  margin-top: 14px;
}
.outline-list > li:first-child .outline-group-btn { margin-top: 0; }
.outline-group-btn:hover, .outline-group-btn.active { background: var(--c-header-bg); }
/* Ebene 2 — Unterteil: hervorgehoben, eingerückt */
.outline-subgroup {
  display: block;
  width: calc(100% - 10px);
  border: none;
  text-align: left;
  cursor: pointer;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--c-header-bg);
  background: var(--c-accent-soft);
  padding: 5px 10px;
  border-radius: 4px;
  margin: 6px 0 2px 10px;
}
.outline-subgroup:hover, .outline-subgroup.active { background: #d6eaf8; }
/* Ebene 3 — Kapitel: schlichte Zeilen mit Trennlinie, weiter eingerückt */
.outline-item {
  display: block;
  width: calc(100% - 18px);
  border: none;
  border-bottom: 1px solid var(--c-box-border);
  background: none;
  text-align: left;
  padding: 5px 10px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--c-text);
  cursor: pointer;
  margin-left: 18px;
}
.outline-item:hover { background: #eaf4fb; }
.outline-item.active { background: #fdf6df; color: var(--c-text); font-weight: 600; border-left: 3px solid #d4a72c; padding-left: 7px; }
.source-item.active { border-color: var(--c-box-header-bg); background: var(--c-accent-soft); }
.chapter-card, .source-card {
  border: 1px solid var(--c-box-border);
  border-radius: var(--r-tile);
  padding: var(--s-md);
  background: #fff;
  margin-bottom: var(--s-md);
}
.chapter-card h2 { color: var(--c-header-bg); margin-bottom: var(--s-sm); }
.meta { color: var(--c-text-muted); font-size: 13px; margin-bottom: var(--s-sm); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.badge { background: var(--c-accent-soft); color: var(--c-header-bg); border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 700; }
.badge.muted-badge { background: #f0f0f0; color: var(--c-text-muted); }
.src-summary { margin-bottom: 4px; }
.src-section { margin-top: 12px; }
.src-section h4 { font-size: 12px; color: var(--c-box-header-bg); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 4px; }
.src-section ul { margin: 0 0 0 16px; }
.src-section li { font-size: 13px; line-height: 1.4; margin-bottom: 4px; }
.used-in { margin-top: 14px; border-top: 1px solid var(--c-box-border); padding-top: 10px; }
.chapter-card p { margin-bottom: 8px; line-height: 1.5; }
.source-item {
  width: 100%;
  border: 1px solid var(--c-box-border);
  background: #fff;
  border-radius: 6px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  margin-bottom: 6px;
}
.note-box { background: #fff8e5; border: 1px solid #f1d18a; border-radius: var(--r-tile); padding: var(--s-md); }
.placeholder-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s-md); }

/* Ernte-Panel: Filter-/Dokument-Toolbar + Mehrspalten-Vergleich */
.ernte-toolbar { display: flex; align-items: center; gap: var(--s-sm); margin-bottom: 10px; flex-wrap: wrap; }
.ernte-tools-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--c-text-muted); font-weight: 700; min-width: 74px; }
.cat-filter, .source-picker { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.cat-pill, .source-chip {
  border: 1px solid var(--c-box-border); background: #fff; color: var(--c-text);
  border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.cat-pill:hover, .source-chip:hover { background: var(--c-accent-soft); }
.cat-pill.active { background: var(--c-box-header-bg); color: #fff; border-color: var(--c-box-header-bg); }
.source-chip.active { background: var(--c-accent-soft); border-color: var(--c-box-header-bg); color: var(--c-header-bg); font-weight: 700; }
.src-link-dot { color: #d4a72c; font-weight: 700; margin-right: 5px; }
.ernte-cols { display: flex; gap: 12px; overflow-x: auto; align-items: start; padding-bottom: 6px; }
.ernte-col { flex: 1 1 300px; min-width: 280px; }
.ernte-col .source-card { position: relative; margin-bottom: 0; }
.ernte-col .source-card strong { display: block; padding-right: 22px; }
.ernte-col-close {
  position: absolute; top: 8px; right: 8px; border: none; background: none; cursor: pointer;
  color: var(--c-text-muted); font-size: 14px; line-height: 1; padding: 2px 4px; border-radius: 4px;
}
.ernte-col-close:hover { background: #f0f0f0; color: var(--c-text); }
@media (max-width: 1200px) {
  .three-col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .plan-layout { grid-template-columns: 1fr; }
}
