:root{
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --line: rgba(15,23,42,0.10);
  --shadow: 0 14px 34px rgba(2, 6, 23, 0.08);

  --green: #03932C;
  --pink: #E36068;

  --radius: 18px;

  /* WICHTIG: Höhe eures bestehenden Headers (bei fixed/sticky Header anpassen) */
  --site-header-h: 88px;
  --page-top-gap: 22px;

  /* Sticky-Abstand = Headerhöhe + Luft */
  --sticky-top: calc(var(--site-header-h) + 14px);
}

html{ scroll-behavior:smooth; }
body{ margin:0; background:var(--bg); color:var(--text); font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }

/* Nutzt deutlich mehr Breite (16:10 Feeling auf 16:9) */
.satzung-page{
  width: min(94vw, 1560px);
  margin: 0 auto;
  padding: calc(var(--site-header-h) + var(--page-top-gap)) clamp(16px, 2.2vw, 28px) 48px;
}

/* Intro: kein "Header", nur kompakter Titelblock */
.page-intro{
  margin-bottom: 18px;
}
.page-intro h1{
  margin: 0 0 8px;
  font-size: clamp(28px, 2.7vw, 44px);
  letter-spacing: -0.02em;
}
.page-intro p{
  margin: 0;
  color: var(--muted);
  max-width: 80ch;
  line-height: 1.6;
}

/* 3 Spalten, großzügig */
.satzung-grid{
  display:grid;
  grid-template-columns: 320px minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}

/* Panels (TOC + Download) */
.panel{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sticky-panel{
  position: sticky;
  top: var(--sticky-top);
  align-self: start;
}

.panel-head{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 14px 14px 10px;
}
.panel-head h2{
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.01em;
}
.panel-dot{
  width: 10px; height: 10px;
  border-radius: 999px;
}
.panel-dot--green{ background: var(--green); }
.panel-dot--pink{ background: var(--pink); }

.panel-body{
  padding: 0 14px 14px;
}

.panel-divider{
  height: 1px;
  background: var(--line);
  margin: 12px 0;
}

.panel-subtitle{
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 6px 0 10px;
}

/* TOC links */
.toc-link{
  display:block;
  padding: 10px 10px;
  border-radius: 14px;
  text-decoration:none;
  color: var(--text);
  border: 1px solid transparent;
  background: rgba(3,147,44,0.06);
  transition: transform 120ms ease, background 140ms ease, border-color 140ms ease;
  margin-bottom: 8px;
}
.toc-link:hover{
  transform: translateY(-1px);
  background: rgba(3,147,44,0.10);
  border-color: rgba(3,147,44,0.18);
}
.toc-link.subtle{
  background: rgba(227,96,104,0.06);
}
.toc-link.subtle:hover{
  background: rgba(227,96,104,0.10);
  border-color: rgba(227,96,104,0.18);
}

.toc-chips{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration:none;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  transition: transform 120ms ease, border-color 140ms ease, background 140ms ease;
}
.chip:hover{
  transform: translateY(-1px);
  border-color: rgba(3,147,44,0.25);
  background: rgba(3,147,44,0.06);
  color: var(--text);
}

/* Content Cards */
.content .card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
  position: relative;
}

/* Top accent bar */
.card-accent{
  position:absolute;
  left:0; right:0; top:0;
  height: 6px;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}
.card-accent--green{ background: linear-gradient(90deg, var(--green), rgba(3,147,44,0.30)); }
.card-accent--pink{ background: linear-gradient(90deg, var(--pink), rgba(227,96,104,0.30)); }

.content h2{
  margin: 10px 0 10px;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.content h3{
  margin: 14px 0 8px;
  font-size: 16px;
}

.muted{ color: var(--muted); line-height: 1.65; }
.small{ font-size: 13px; }

/* Regeln Grid */
.rule-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}
.mini-card{
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,1), rgba(255,255,255,0.88));
}

.callout{
  border: 1px solid rgba(3,147,44,0.22);
  background: rgba(3,147,44,0.06);
  border-radius: 16px;
  padding: 12px;
  margin-top: 10px;
}
.callout-title{ font-weight: 800; margin-bottom: 8px; }

.bullets{
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}
.bullets li{ margin: 6px 0; }

/* Gesetz-Listen: 1. 2. 3. + a) b) c) */
.law-ol{
  list-style: none;
  padding: 0;
  margin: 10px 0 12px;
  color: var(--muted);
}
.law-ol > li{
  position: relative;
  padding-left: 34px;
  margin: 8px 0;
  line-height: 1.65;
}
.law-ol--numeric{ counter-reset: n; }
.law-ol--numeric > li{ counter-increment: n; }
.law-ol--numeric > li::before{
  content: counter(n) ".";
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  font-weight: 900;
  color: rgba(15,23,42,0.62);
}

.law-ol--alpha{ counter-reset: a; margin-top: 8px; }
.law-ol--alpha > li{ counter-increment: a; }
.law-ol--alpha > li::before{
  content: counter(a, lower-alpha) ")";
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  font-weight: 900;
  color: rgba(15,23,42,0.62);
}

/* Paragraph Sections + Anchor offset (damit Header nix verdeckt) */
.para{
  padding-top: 10px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  scroll-margin-top: var(--sticky-top);
}
.para h3{
  margin: 14px 0 10px;
  font-size: 18px;
}
.para-title{
  color: var(--muted);
  font-weight: 700;
}

/* Approval line */
.approval{
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
}

/* Button */
.btn{
  display:flex;
  align-items:center;
  justify-content:center;
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  text-decoration:none;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: #fff;
  background: linear-gradient(135deg, var(--green), rgba(3,147,44,0.86));
  border: 1px solid rgba(3,147,44,0.20);
  transition: transform 120ms ease, filter 140ms ease;
}
.btn:hover{ transform: translateY(-1px); filter: brightness(1.03); }
.btn:active{ transform: translateY(0px); filter: brightness(0.98); }

.meta{
  margin-top: 12px;
  display:grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}
.meta-dot{
  display:inline-block;
  width: 10px; height: 10px;
  border-radius: 999px;
  margin-right: 8px;
  transform: translateY(1px);
}
.meta-dot--green{ background: var(--green); }
.meta-dot--pink{ background: var(--pink); }

/* Responsive */
@media (max-width: 1200px){
  .satzung-grid{
    grid-template-columns: 300px minmax(0, 1fr);
  }
  .satzung-grid > aside{
    grid-column: 1 / -1;
  }
  .satzung-grid > aside.sticky-panel{
    position: static;
  }
}

@media (max-width: 900px){
  .satzung-page{
    width: min(96vw, 900px);
  }
  .satzung-grid{
    grid-template-columns: 1fr;
  }
  .sticky-panel{
    position: static;
  }
  .rule-grid{
    grid-template-columns: 1fr;
  }
}

/* Höhe des sticky TOC begrenzen */
.toc-panel{
  max-height: calc(100vh - var(--sticky-top));
}

/* Scroll-Bereich im TOC */
.toc-scroll{
  max-height: calc(100vh - var(--sticky-top) - 56px); /* 56px ~ panel-head */
  overflow: hidden;              /* Standard: nicht scrollen */
  overflow-x: hidden;
  overscroll-behavior: contain;  /* verhindert Scroll-Weitergabe an Seite */
  scrollbar-gutter: stable;      /* verhindert Layout-Sprung durch Scrollbar */
  padding-right: 6px;            /* etwas Platz für Scrollbar */
}

/* NUR wenn Maus drüber (oder Fokus per Tastatur) => TOC wird scrollbar */
.toc-panel:hover .toc-scroll,
.toc-panel:focus-within .toc-scroll{
  overflow-y: auto;
}

/* TOC: Head genauso wie Download */
.toc-panel .panel-head{
  display: flex;
  align-items: center;
  justify-content: flex-start; /* so wie Download */
  padding: 14px 14px 10px;
  gap: 10px;
}

.toc-panel .panel-head h2{
  margin: 0;
  font-size: 15px;
  line-height: 1.1;
}

/* FIX: globales nav{display:flex} überschreiben -> TOC wieder vertikal */
.satzung-page .toc-panel{
  display: flex;
  flex-direction: column;
}

/* sicherstellen, dass Head/Body volle Breite haben */
.satzung-page .toc-panel > .panel-head,
.satzung-page .toc-panel > .panel-body{
  width: 100%;
}

/* wichtig für scrollbaren Bereich in Flex-Containern */
.satzung-page .toc-panel > .panel-body{
  min-height: 0;
}

/* Satzung: einheitliche Schriftfarbe (muted) – außer dem H2 "Satzung" */
#satzung{
  color: var(--muted);
}

/* "Satzung" Überschrift bleibt normal/dunkel */
#satzung > h2{
  color: var(--text);
}

/* Paragraph-Überschriften und Titel ebenfalls in muted */
#satzung .para h3,
#satzung .para-title{
  color: var(--muted);
}

/* Optional: §-Nummer nicht stärker/dunkler als der Rest */
#satzung .para h3{
  font-weight: 800; /* kannst du auch 700 machen */
}

/* Karten sauber clippen, damit der Balken nie übersteht */
.content .card{
  overflow: hidden;
}

/* Balken etwas schlanker */
.card-accent{
  height: 4px;            /* statt 6px */
}

@media (max-width: 900px) {
  .toc-scroll {
    touch-action: pan-y;
    overscroll-behavior-x: auto;
    overscroll-behavior-y: auto;
  }
}