/*
 * Fraktionstool - eigene Schicht ueber Bootstrap 5.3.
 *
 * Bootstrap liefert Grundwerk, Raster, Hilfsklassen und die Bausteine mit
 * Javascript (Seitenblatt, Menues, Hinweise). Hier stehen nur die Dinge, die
 * ein Fraktionsbuero braucht und die es in keinem Rahmenwerk gibt: die
 * Leiste am unteren Bildschirmrand, die Aktenzeile mit Statusschiene, der
 * Lebenslauf einer Drucksache, das Abstimmungsgitter.
 *
 * Reihenfolge: zuerst die Farb- und Groessenwerte (auch die von Bootstrap,
 * damit die Akzentfarbe der Fraktion durchgaengig greift), dann die Bauteile.
 */

:root {
  /* Vom Server gesetzt: --akzent ist die Farbe der Fraktion. */
  --akzent: #1f5c8b;

  --papier: #ffffff;
  --seite: #eef1f4;
  --tinte: #131a21;
  --leise: #5c6a78;
  --linie: #d9dfe5;
  --radius: 12px;
  --radius-klein: 9px;

  --gruen: #1a7a4c;
  --rot: #b3261e;
  --gelb: #9a6400;

  /* Ein einziger Schatten, nur fuer Dinge, die ueber der Seite liegen. */
  --schwebe: 0 6px 24px rgba(19, 26, 33, .14);

  /* Bruecke zu Bootstrap: dessen Bausteine nehmen damit dieselben Werte. */
  --bs-primary: var(--akzent);
  --bs-link-color: var(--akzent);
  --bs-link-hover-color: var(--akzent);
  --bs-body-color: var(--tinte);
  --bs-body-bg: var(--seite);
  --bs-border-color: var(--linie);
  --bs-border-radius: var(--radius-klein);
  --bs-border-radius-lg: var(--radius);
  --bs-secondary-color: var(--leise);
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --bs-body-font-size: 1rem;
  --bs-body-line-height: 1.55;
  --bs-focus-ring-color: color-mix(in srgb, var(--akzent) 35%, transparent);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--seite);
  color: var(--tinte);
  font: 400 1rem/1.55 var(--bs-body-font-family);
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; }

/*
 * Schriftbild. Eine Familie, dafuer ein klarer Stufensprung. Zahlen mit
 * gleicher Laufweite, weil Drucksachennummern und Daten untereinander
 * vergleichbar sein muessen - in einer Akte ist das kein Zierrat.
 */
h1, h2, h3 { font-weight: 600; margin: 0; line-height: 1.25; letter-spacing: -.011em; }
h1 { font-size: 1.3rem; }
h2 { font-size: 1.02rem; }
h3 { font-size: 0.94rem; }
@media (min-width: 40rem) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.08rem; }
}
h2 .sym, h3 .sym { color: var(--leise); margin-right: .45rem; vertical-align: -.1em; }

.sym { flex: 0 0 auto; vertical-align: -.125em; }
.sym.gross { width: 1.35em; height: 1.35em; }
.sym.klein { width: .85em; height: .85em; }

:focus-visible { outline: 2px solid var(--akzent); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------------- Kopf */
.kopf {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--papier);
  border-bottom: 1px solid var(--linie);
}
.kopf .innen {
  display: flex;
  align-items: center;
  gap: .75rem;
  max-width: 68rem;
  margin: 0 auto;
  padding: .6rem .9rem;
}
.marke {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 600;
  font-size: .98rem;
  line-height: 1.2;
  text-decoration: none;
  letter-spacing: -.01em;
}
.marke img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}
.marke small {
  display: block;
  font-weight: 400;
  font-size: .76rem;
  color: var(--leise);
  letter-spacing: 0;
}

/* --------------------------------------------- Leiste am unteren Rand */
/*
 * Auf dem Handy bleibt die Navigation unter dem Daumen, auf dem Schreibtisch
 * wandert dieselbe Leiste in die Kopfzeile. Fuenf Ziele, alles Weitere im
 * Seitenblatt.
 */
.hauptnav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  background: var(--papier);
  border-top: 1px solid var(--linie);
  box-shadow: 0 -2px 14px rgba(19, 26, 33, .06);
  padding-bottom: env(safe-area-inset-bottom);
}
.navpunkt {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  min-height: 3.4rem;
  padding: .4rem .2rem;
  font: inherit;
  font-size: .7rem;
  color: var(--leise);
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
}
.navpunkt .sym { width: 1.4rem; height: 1.4rem; }
.navpunkt[aria-current] { color: var(--akzent); }
.navpunkt[aria-current] .sym { transform: translateY(-1px); }

@media (min-width: 48rem) {
  .hauptnav {
    position: static;
    margin-left: auto;
    gap: .15rem;
    border-top: 0;
    box-shadow: none;
    padding: 0;
    background: none;
  }
  .navpunkt {
    flex: 0 0 auto;
    flex-direction: row;
    gap: .4rem;
    min-height: 2.3rem;
    padding: .3rem .7rem;
    font-size: .9rem;
    border-radius: 999px;
  }
  .navpunkt .sym { width: 1.1rem; height: 1.1rem; }
  .navpunkt:hover { background: var(--seite); color: var(--tinte); }
  .navpunkt[aria-current] {
    color: var(--akzent);
    background: color-mix(in srgb, var(--akzent) 10%, transparent);
  }
  .navpunkt[aria-current] .sym { transform: none; }
}

/* --------------------------------------------------------- Seitenblatt */
/* Bootstrap-Offcanvas, unten angeschlagen - auf breiten Schirmen rechts. */
.blatt { border-radius: var(--radius) var(--radius) 0 0; }
.blatt .offcanvas-body { padding-top: .25rem; }
.blattliste { display: flex; flex-direction: column; }
.blattliste a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .8rem .25rem;
  border-top: 1px solid var(--linie);
  text-decoration: none;
  color: inherit;
}
.blattliste a .sym { color: var(--leise); width: 1.15rem; height: 1.15rem; }
.blattliste a[aria-current] { color: var(--akzent); font-weight: 500; }
.blattliste a[aria-current] .sym { color: inherit; }
.blattliste a.abmelden { color: var(--leise); }
@media (min-width: 48rem) {
  .blatt {
    top: 0; bottom: 0;
    left: auto; right: 0;
    width: 19rem;
    height: 100%;
    border-radius: 0;
    transform: translateX(100%);
  }
  .blatt.showing, .blatt.show { transform: none; }
}

main {
  max-width: 68rem;
  margin: 0 auto;
  padding: .9rem .9rem calc(4.8rem + env(safe-area-inset-bottom));
}
@media (min-width: 48rem) {
  main { padding: 1.4rem 1rem 4rem; }
}

/* Ladebalken, solange htmx eine Seite holt. */
#fortschritt {
  position: fixed;
  top: 0; left: 0;
  z-index: 40;
  height: 2px;
  width: 0;
  background: var(--akzent);
  opacity: 0;
  transition: width .25s ease, opacity .2s ease;
}
body.laedt #fortschritt { width: 70%; opacity: 1; }

.zeile { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.rechts { margin-left: auto; }

/* Seitenueberschrift mit Symbol - gleiche Hoehe wie die Zeile darunter. */
.seitenkopf {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .75rem;
}
.seitenkopf .sym { color: var(--leise); width: 1.15em; height: 1.15em; }

/* ------------------------------------------------------------------ Flächen */
.karte {
  background: var(--papier);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 1rem;
}
.karte + .karte { margin-top: .75rem; }
.karte > h2:first-child { margin-bottom: .6rem; }

.abschnitt { margin-top: 2rem; }
.abschnitt > h2 { margin-bottom: 0.6rem; }

/* ------------------------------------------------------------- Bedienelemente */
/*
 * Eingabefelder und Knoepfe. Die Ansichten benutzen schlichtes HTML
 * (<input>, <select>, <button class="knopf">) - die Optik von Bootstrap
 * wird hier einmal zentral darauf gelegt, statt in 30 Ansichten
 * Rahmenklassen zu verteilen.
 */
input[type=text], input[type=search], input[type=email], input[type=password],
input[type=date], input[type=number], input[type=time], select, textarea {
  font: inherit;
  font-size: 16px; /* verhindert das Hineinzoomen von iOS beim Antippen */
  color: inherit;
  background: var(--papier);
  border: 1px solid var(--linie);
  border-radius: var(--radius-klein);
  padding: .55rem .7rem;
  width: 100%;
  min-height: 2.75rem;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--akzent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--akzent) 18%, transparent);
  outline: 0;
}
select {
  appearance: none;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%235c6a78'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  background-size: .7rem;
}
textarea { min-height: 5rem; resize: vertical; line-height: 1.6; }
input[type=checkbox], input[type=radio] { accent-color: var(--akzent); }

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font: inherit;
  font-weight: 500;
  border: 1px solid var(--akzent);
  background: var(--akzent);
  color: #fff;
  border-radius: var(--radius-klein);
  padding: .55rem 1rem;
  min-height: 2.75rem;
  cursor: pointer;
  text-decoration: none;
  transition: filter .12s ease, background-color .12s ease;
}
.knopf:hover { filter: brightness(.93); color: #fff; }
.knopf.leise {
  background: var(--papier);
  color: var(--tinte);
  border-color: var(--linie);
  font-weight: 400;
}
.knopf.leise:hover { background: var(--seite); filter: none; color: var(--tinte); }
.knopf.gefahr { background: var(--papier); color: var(--rot); border-color: var(--linie); }
.knopf.gefahr:hover { background: color-mix(in srgb, var(--rot) 8%, var(--papier)); color: var(--rot); }
.knopf[disabled] { opacity: .55; cursor: progress; }
.knopf .sym { width: 1.05em; height: 1.05em; }

.feld { margin-bottom: .7rem; }
.feld label {
  display: block;
  font-size: .82rem;
  font-weight: 500;
  color: var(--leise);
  margin-bottom: .25rem;
}
.raster { display: grid; gap: 0.7rem; grid-template-columns: 1fr; }
@media (min-width: 34rem) {
  .raster { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
}

.filter { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filter input[type=search] { flex: 1 1 14rem; }
.filter select { flex: 0 1 11rem; }

/* -------------------------------------------------------------- Drucksachen */
.liste { display: flex; flex-direction: column; gap: 0.5rem; }

/*
 * Die Aktenzeile. Links eine farbige Schiene wie der Reiter einer Akte im
 * Registraturschrank: der Stand ist damit schon vor dem Lesen erkennbar,
 * auch auf einem Handy in der Ausschusssitzung. Die Drucksachennummer steht
 * mit gleicher Zahlenbreite, damit Nummern untereinander vergleichbar sind.
 */
.ds {
  display: block;
  position: relative;
  background: var(--papier);
  border: 1px solid var(--linie);
  border-left: 3px solid var(--leise);
  border-radius: var(--radius);
  padding: .75rem .9rem;
  text-decoration: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.ds:hover { box-shadow: 0 2px 10px rgba(19, 26, 33, .07); }
.ds.in_beratung { border-left-color: var(--gelb); }
.ds.beschlossen { border-left-color: var(--gruen); }
.ds.abgelehnt { border-left-color: var(--rot); }
.ds.zurueckgezogen, .ds.erledigt { border-left-color: #a8b2bd; }
.ds .nr { font-size: .8rem; color: var(--leise); }
.ds .az {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--tinte);
  letter-spacing: .01em;
}
.ds .titel { margin: .2rem 0 .45rem; font-size: 1rem; font-weight: 500; }
.ds .meta { font-size: .82rem; color: var(--leise); display: flex; gap: .75rem; flex-wrap: wrap; }

.punkt { display: inline-flex; align-items: center; gap: 0.35rem; }
.punkt::before {
  content: "";
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: var(--leise);
}
.punkt.in_beratung::before { background: var(--gelb); }
.punkt.beschlossen::before { background: var(--gruen); }
.punkt.abgelehnt::before { background: var(--rot); }

.leer { color: var(--leise); padding: 2rem 1rem; text-align: center; }

/* --------------------------------------------------------------- Lebenslauf */
.lebenslauf { list-style: none; margin: 0; padding: 0; }
.lebenslauf li {
  display: grid;
  align-items: start;
}
.lebenslauf .wann { font-size: 0.82rem; color: var(--leise); padding-top: 0.15rem; }
.lebenslauf .schiene { position: relative; justify-self: center; width: 1px; background: var(--linie); }
.lebenslauf li:first-child .schiene { background: linear-gradient(var(--papier) 0.55rem, var(--linie) 0.55rem); }
.lebenslauf li:last-child .schiene { background: linear-gradient(var(--linie) 0.55rem, transparent 0.55rem); }
.lebenslauf .schiene::before {
  content: "";
  position: absolute;
  top: 0.35rem; left: 50%;
  transform: translateX(-50%);
  width: 0.55rem; height: 0.55rem;
  border-radius: 50%;
  background: var(--akzent);
}
.lebenslauf .was { padding: 0 0 1.1rem 0.6rem; }
.lebenslauf .was b { font-weight: 500; }
.lebenslauf .wo { font-size: 0.85rem; color: var(--leise); }
.lebenslauf .vermerk { margin: 0.3rem 0 0; font-size: 0.9rem; }

/* ---------------------------------------------------------------- Kommentare */
.kommentar { border-top: 1px solid var(--linie); padding: 0.75rem 0; }
.kommentar:first-child { border-top: 0; }
.kommentar header { display: flex; gap: 0.6rem; align-items: baseline; font-size: 0.85rem; }
.kommentar header b { font-weight: 500; }
.kommentar time { color: var(--leise); font-size: 0.8rem; }
.kommentar .intern { color: var(--gelb); font-size: 0.78rem; }
.kommentar p { margin: 0.25rem 0 0; }

/* -------------------------------------------------------------------- Reste */
.hinweis { color: var(--rot); font-size: 0.9rem; margin: 0.5rem 0 0; }
.erfolg { color: var(--gruen); font-size: 0.9rem; margin: 0.5rem 0 0; }
.kopfdaten { display: grid; gap: 0.5rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); font-size: 0.9rem; margin-top: 0.9rem; }
.kopfdaten div span { display: block; color: var(--leise); font-size: 0.78rem; }
.zurueck { font-size: 0.85rem; color: var(--leise); text-decoration: none; display: inline-block; margin-bottom: 0.8rem; }

/* ------------------------------------------------- Anmeldung, Registrierung */
body.einstiegsseite { background: var(--seite); }
.anmeldung { max-width: 23rem; margin: 0 auto; padding: 12vh 1rem 3rem; }
.anmeldung.breit { max-width: 30rem; padding-top: 7vh; }
.einstiegsmarke { margin-bottom: 1.25rem; }
.einstiegsbild {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: .75rem;
  box-shadow: 0 2px 12px rgba(19, 26, 33, .12);
}
.einstiegsmarke h1 { font-size: 1.45rem; }
.einstiegsmarke p { color: var(--leise); margin: .35rem 0 0; font-size: .95rem; }
.anmeldung .karte { padding: 1.1rem; }
.einstiegsfuss { font-size: .9rem; margin-top: 1rem; color: var(--leise); }
.einstiegsfuss a { color: var(--akzent); }

details.anlegen summary {
  cursor: pointer;
  color: var(--akzent);
  font-size: 0.95rem;
  padding: 0.45rem 0;
  min-height: 2.4rem;
  display: flex;
  align-items: center;
}
details.anlegen[open] summary { margin-bottom: 0.8rem; border-bottom: 1px solid var(--linie); }
.topaktionen summary, details.fassung summary, .dateiaktionen summary,
details.stationaendern > summary, details.terminaendern > summary, details.aufgabeaendern > summary {
  min-height: 2.2rem;
  display: flex;
  align-items: center;
}

/* Lebenslauf: schmale Datumsspalte auf dem Handy, breiter ab Tablet */
.lebenslauf li { grid-template-columns: 4.2rem 1.2rem 1fr; }
@media (min-width: 32rem) {
  .lebenslauf li { grid-template-columns: 5.2rem 1.5rem 1fr; }
}

/* ------------------------------------------------------------- Dashboard */
.kacheln { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); }
.kacheln .karte + .karte { margin-top: 0; }
.mehr { font-size: .82rem; color: var(--leise); text-decoration: none; }
.mehr:hover { color: var(--akzent); }

ul.schlicht { list-style: none; margin: 0; padding: 0; }
ul.schlicht li {
  display: flex;
  gap: .7rem;
  align-items: baseline;
  padding: .45rem 0;
  border-top: 1px solid var(--linie);
}
ul.schlicht li:first-child { border-top: 0; }
ul.schlicht .wann {
  flex: 0 0 4.6rem;
  font-size: .82rem;
  color: var(--leise);
  font-variant-numeric: tabular-nums;
}
ul.schlicht .wann small { display: block; font-size: .72rem; }
ul.schlicht a { text-decoration: none; }
ul.schlicht a:hover { color: var(--akzent); }
small.wo { display: block; font-size: .78rem; color: var(--leise); }
small.notiz { display: block; font-size: .85rem; margin-top: .2rem; }

/* -------------------------------------------------------------- Aufgaben */
ul.aufgaben { list-style: none; margin: 0; padding: 0; }
ul.aufgaben li { border-top: 1px solid var(--linie); }
ul.aufgaben li:first-child { border-top: 0; }
ul.aufgaben label {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  padding: .5rem 0;
  cursor: pointer;
}
ul.aufgaben input[type=checkbox] {
  width: 1.1rem; height: 1.1rem;
  min-height: 0;
  margin-top: .2rem;
  accent-color: var(--akzent);
  flex: 0 0 auto;
}
ul.aufgaben.gross label { padding: .7rem 0; }
ul.aufgaben li.fertig > label > span { color: var(--leise); text-decoration: line-through; }
ul.aufgaben li.fertig small { text-decoration: none; }
.ueberfaellig { color: var(--rot); }

/* -------------------------------------------------------------- Kalender */
.monatsgitter {
  display: grid;
  /* minmax(0, 1fr) statt 1fr: sonst setzt der Inhalt eine Mindestbreite
     durch und das Gitter schiebt auf schmalen Schirmen die Seite auf. */
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  padding: .6rem;
}
.monatsgitter .spaltenkopf {
  min-width: 0;
  font-size: .72rem;
  color: var(--leise);
  text-align: center;
  padding-bottom: .3rem;
}
.monatsgitter .tag {
  aspect-ratio: 1 / 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  border-radius: 6px;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}
.monatsgitter .tag.leer { visibility: hidden; }
.monatsgitter .tag.heute { background: color-mix(in srgb, var(--akzent) 12%, transparent); font-weight: 500; }
.monatsgitter .ziffer { line-height: 1; }
.monatsgitter .punkte { display: flex; gap: 2px; }
.monatsgitter .punkte i { width: 4px; height: 4px; border-radius: 50%; background: var(--akzent); }
.tagesblock h3 { font-size: .9rem; font-weight: 500; margin-bottom: .3rem; color: var(--leise); }
.blaettern { display: flex; gap: .35rem; }
.blaettern .knopf { padding: .35rem .7rem; min-height: 0; text-decoration: none; }
.blaettern .knopf.aktiv { border-color: var(--akzent); color: var(--akzent); }
.knopf.klein { font-size: .85rem; padding: .3rem .6rem; min-height: 2rem; line-height: 1.4; }

/* ---------------------------------------------------- Tagesordnungspunkte */
.top .topnr {
  flex: 0 0 2.6rem;
  font-size: .82rem;
  color: var(--leise);
  font-variant-numeric: tabular-nums;
}
.topt { font-weight: 500; text-decoration: none; }
a.topt:hover { color: var(--akzent); }
.marker {
  font-size: .72rem;
  color: var(--leise);
  border: 1px solid var(--linie);
  border-radius: 999px;
  padding: .05rem .5rem;
}
.redner { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0 0; }
.chip {
  display: inline-flex;
  align-items: baseline;
  gap: .35rem;
  background: var(--seite);
  border-radius: 999px;
  padding: .2rem .6rem;
  font-size: .85rem;
}
.chip small { color: var(--leise); font-size: .72rem; }
.chipweg { border: 0; background: none; color: var(--leise); cursor: pointer; font-size: .9rem; padding: 0 0 0 .1rem; }
.topkommentare { margin-top: .6rem; border-top: 1px solid var(--linie); }
.topaktionen { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .7rem; }
.topaktionen details { flex: 1 1 100%; }
.topaktionen summary { cursor: pointer; color: var(--akzent); font-size: .85rem; }
.topaktionen details[open] { border-top: 1px solid var(--linie); padding-top: .6rem; }
.topaktionen form { margin-top: .5rem; }

.haken { display: flex; gap: .5rem; align-items: center; font-size: .9rem; }
.haken input { width: auto; min-height: 0; }

ul.schlicht .wann { flex: 0 0 3.6rem; }
@media (min-width: 40rem) {
  ul.schlicht .wann { flex-basis: 4.6rem; }
}

/* ------------------------------------------------------------ Verwaltung */
.unternav {
  display: flex;
  gap: .25rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--linie);
}
.unternav a {
  padding: .45rem .8rem;
  font-size: .9rem;
  color: var(--leise);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.unternav a.aktiv { color: var(--tinte); border-bottom-color: var(--akzent); }

.rechtezeile {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  margin-top: .7rem;
  padding-top: .7rem;
  border-top: 1px solid var(--linie);
}
label.chip { cursor: pointer; border: 1px solid var(--linie); background: var(--papier); }
label.chip input { width: auto; min-height: 0; accent-color: var(--akzent); }
label.chip.an { border-color: var(--akzent); color: var(--akzent); }

.farbtupfer {
  display: inline-block;
  width: .7rem; height: .7rem;
  border-radius: 50%;
  vertical-align: baseline;
  margin-right: .15rem;
}
input[type=color] { padding: .2rem; height: 2.6rem; }
input[readonly] { background: var(--seite); color: var(--leise); }

/* ---------------------------------------------------------------- Dateien */
.bildraster {
  display: grid;
  gap: .5rem;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  margin-bottom: .75rem;
}
.bildraster figure { margin: 0; }
.bildraster img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--linie);
  display: block;
  background: var(--seite);
}
.bildraster figcaption { font-size: .75rem; color: var(--leise); margin-top: .2rem; }
.hochladen { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--linie); }
.hochladen input[type=file] { font: inherit; font-size: .9rem; }
.dateiaktionen { margin-top: .5rem; }
.dateiaktionen summary { cursor: pointer; font-size: .85rem; color: var(--leise); }
.dateiaktionen li form { display: inline; }

/* ------------------------------------------------------------------ Ideen */
.punkt.idee-in_pruefung::before { background: var(--gelb); }
.punkt.idee-uebernommen::before { background: var(--gruen); }
.punkt.idee-abgelehnt::before { background: var(--rot); }
.antwort { border-left: 3px solid var(--akzent); }
.anfragen { border-color: var(--akzent); }
.blaettern { flex-wrap: wrap; }

/* ------------------------------------------------------------------ Suche */
mark {
  background: color-mix(in srgb, var(--akzent) 18%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 .1em;
}
.suchinfo { font-size: .82rem; color: var(--leise); margin: 0 0 .2rem; }
.treffer {
  margin: 0 0 .45rem;
  font-size: .88rem;
  line-height: 1.5;
  color: var(--tinte);
}
.treffer span {
  font-size: .75rem;
  color: var(--leise);
  background: var(--seite);
  border-radius: 5px;
  padding: .05rem .35rem;
  margin-right: .35rem;
}
.antragstext {
  max-height: 26rem;
  overflow-y: auto;
  line-height: 1.65;
}

/* ------------------------------------------------------------------ Karten */
.karte-einzeln, .karte-waehlen, .karte-uebersicht {
  width: 100%;
  border-radius: 8px;
  background: var(--seite);
  z-index: 0;
}
.karte-einzeln { height: 240px; }
.karte-waehlen { height: 280px; margin-top: .5rem; cursor: crosshair; }
.karte-uebersicht.karte-gross { height: min(70vh, 560px); }

.ortswahl {
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: .6rem .8rem .8rem;
  margin: 0 0 .8rem;
}
.ortswahl legend { font-size: .82rem; color: var(--leise); padding: 0 .3rem; }
.ortsvorschlaege { list-style: none; margin: .4rem 0 0; padding: 0; }
.ortsvorschlaege li { font-size: .88rem; }
.ortsvorschlaege li.leise { color: var(--leise); padding: .3rem 0; }
.ortsvorschlaege .vorschlag {
  font: inherit;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-top: 1px solid var(--linie);
  padding: .45rem .2rem;
  cursor: pointer;
  color: var(--tinte);
}
.ortsvorschlaege li:first-child .vorschlag { border-top: 0; }
.ortsvorschlaege .vorschlag:hover { color: var(--akzent); }

/* Markierung ohne Bilddatei */
.ft-nadel {
  background: var(--akzent);
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}

.legende { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .78rem; color: var(--leise); }
.legende span { display: inline-flex; align-items: center; gap: .3rem; }
.legende i {
  width: .65rem; height: .65rem;
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.12);
}

.ft-popup { font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-width: 12rem; }
.ft-popup small { display: block; color: #5b6470; font-size: .75rem; }
.ft-popup-titel { display: block; font-weight: 500; margin: .1rem 0 .3rem; color: #16191d; }
a.ft-popup-titel { text-decoration: none; }
a.ft-popup-titel:hover { text-decoration: underline; }
.ft-popup-status {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .8rem;
}
.ft-popup-status::before {
  content: ""; width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--farbe, #6b7280);
}
.ft-popup-zeile { font-size: .8rem; color: #5b6470; margin-top: .2rem; }
.leaflet-container { font: inherit; }

/* --------------------------------------------- Stimmen, Fassung, Verlauf */
.stimmen { display: flex; gap: .8rem; flex-wrap: wrap; font-size: .85rem; margin: .3rem 0 0; }
.stimmen .dafuer { color: var(--gruen); }
.stimmen .dagegen { color: var(--rot); }

details.fassung { margin-top: .4rem; }
details.fassung summary { cursor: pointer; font-size: .85rem; color: var(--leise); }
details.fassung .antragstext { margin-top: .4rem; max-height: 18rem; font-size: .92rem; }

details.stationaendern, details.terminaendern, details.aufgabeaendern { margin-top: .4rem; }
details.stationaendern > summary,
details.terminaendern > summary,
details.aufgabeaendern > summary {
  cursor: pointer;
  font-size: .8rem;
  color: var(--leise);
}
details.stationaendern[open], details.terminaendern[open], details.aufgabeaendern[open] {
  border-top: 1px solid var(--linie);
  margin-top: .6rem;
  padding-top: .6rem;
}
details.terminaendern { flex: 1 1 100%; }
ul.aufgaben li details.aufgabeaendern { padding-bottom: .5rem; }

ul.verlauf li { align-items: flex-start; }
ul.verlauf .vorher { text-decoration: line-through; opacity: .75; }

/* --------------------------------------------------- Sitzungsvorbereitung */
.vorbereitung .votumzeile {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-top: .7rem;
  padding-top: .7rem;
  border-top: 1px solid var(--linie);
}
form.votum { display: flex; gap: .3rem; flex-wrap: wrap; }
.stimmknopf {
  font: inherit;
  font-size: .85rem;
  background: var(--papier);
  border: 1px solid var(--linie);
  border-radius: 999px;
  padding: .3rem .8rem;
  cursor: pointer;
  color: var(--leise);
}
.stimmknopf:hover { border-color: #c9ced5; }
.stimmknopf.gewaehlt { color: #fff; border-color: transparent; }
.stimmknopf.dafuer.gewaehlt { background: var(--gruen); }
.stimmknopf.dagegen.gewaehlt { background: var(--rot); }
.stimmknopf.enthaltung.gewaehlt { background: var(--gelb); }
.stimmknopf.unklar.gewaehlt { background: var(--leise); }
.stimmknopf.loeschen { padding: .3rem .6rem; }

.zaehlung { display: flex; gap: .7rem; font-size: .8rem; color: var(--leise); flex-wrap: wrap; }
.zaehlung .dafuer { color: var(--gruen); }
.zaehlung .dagegen { color: var(--rot); }
.zaehlung .enthaltung { color: var(--gelb); }

.votumchip.dafuer { box-shadow: inset 2px 0 0 var(--gruen); }
.votumchip.dagegen { box-shadow: inset 2px 0 0 var(--rot); }
.votumchip.enthaltung { box-shadow: inset 2px 0 0 var(--gelb); }
.votumchip.unklar { box-shadow: inset 2px 0 0 var(--leise); }

.empfehlung {
  font-size: .78rem;
  border-radius: 999px;
  padding: .15rem .6rem;
  border: 1px solid var(--linie);
  color: var(--leise);
  white-space: nowrap;
}
.empfehlung.dafuer { color: var(--gruen); border-color: currentColor; }
.empfehlung.dagegen { color: var(--rot); border-color: currentColor; }
.empfehlung.enthaltung, .empfehlung.aenderung { color: var(--gelb); border-color: currentColor; }

/* --------------------------------------------- Abstimmung nach Fraktionen */
.stimmtabelle { display: flex; flex-direction: column; gap: .3rem; }
.stimmzeile {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  padding: .25rem 0;
  border-top: 1px solid var(--linie);
}
.stimmzeile:first-child { border-top: 0; }
.stimmzeile .fname {
  flex: 0 0 7rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .9rem;
}
.stimmzeile .fname i { width: .6rem; height: .6rem; border-radius: 2px; flex: 0 0 auto; }
.stimmzeile .auswahl { display: flex; gap: .25rem; flex-wrap: wrap; }
.stimmzeile .auswahl label { cursor: pointer; }
.stimmzeile .auswahl input { position: absolute; opacity: 0; width: 0; height: 0; }
.stimmzeile .auswahl span {
  display: inline-block;
  font-size: .8rem;
  padding: .25rem .6rem;
  border: 1px solid var(--linie);
  border-radius: 999px;
  color: var(--leise);
  background: var(--papier);
}
.stimmzeile .auswahl input:focus-visible + span { outline: 2px solid var(--akzent); outline-offset: 1px; }
.stimmzeile .auswahl input:checked + span { color: #fff; border-color: transparent; }
.stimmzeile .dafuer input:checked + span { background: var(--gruen); }
.stimmzeile .dagegen input:checked + span { background: var(--rot); }
.stimmzeile .enthaltung input:checked + span { background: var(--gelb); }
.stimmzeile .nicht_teilgenommen input:checked + span,
.stimmzeile .ohne input:checked + span { background: var(--leise); }

.stimmen .enthaltung { color: var(--gelb); }
.stimmen .nicht_teilgenommen { color: var(--leise); }

/* ------------------------------------------------------------- Auswertung */
ul.balken { list-style: none; margin: 0; padding: 0; }
ul.balken li {
  display: grid;
  grid-template-columns: 1fr 5rem auto;
  align-items: center;
  gap: .5rem;
  padding: .4rem 0;
  border-top: 1px solid var(--linie);
}
ul.balken li:first-child { border-top: 0; }
ul.balken .name { display: inline-flex; align-items: center; gap: .4rem; font-size: .92rem; }
ul.balken .name .tupfer { width: .6rem; height: .6rem; border-radius: 2px; }
ul.balken .balkenzeile { background: var(--seite); border-radius: 999px; height: .5rem; overflow: hidden; }
ul.balken .balkenzeile i { display: block; height: 100%; background: var(--akzent); border-radius: 999px; }
ul.balken .zahl { font-variant-numeric: tabular-nums; font-size: .92rem; text-align: right; }
ul.balken small.wo { grid-column: 1 / -1; margin-top: -.15rem; }
ul.schlicht .zahl { font-variant-numeric: tabular-nums; }

/* ------------------------------------------- Schnelleingabe und Wechsler */
/* Eine Zeile, ein Feld, ein Knopf: das Übliche ohne Formular aufklappen. */
.schnell {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  background: var(--papier);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: .5rem;
  margin-bottom: .75rem;
}
.schnell input[type=text] { flex: 1 1 11rem; min-width: 0; }
.schnell .kurz { flex: 1 1 7rem; min-width: 0; }
.schnell select { flex: 1 1 8rem; min-width: 0; width: auto; }
.schnell .knopf { flex: 0 0 auto; }
.schnell.flach {
  border: 0;
  border-top: 1px solid var(--linie);
  border-radius: 0;
  padding: .5rem 0 .3rem;
  margin: 0 0 .3rem;
}
.schnell .meldung { flex: 1 1 100%; margin: 0; }

.wechsler {
  display: flex;
  gap: .35rem;
  overflow-x: auto;
  margin-bottom: .75rem;
  padding-bottom: .15rem;
}
.wechsler a {
  flex: 0 0 auto;
  font-size: .85rem;
  padding: .4rem .8rem;
  border: 1px solid var(--linie);
  border-radius: 999px;
  background: var(--papier);
  color: var(--leise);
  text-decoration: none;
  white-space: nowrap;
}
.wechsler a[aria-current] { color: #fff; background: var(--akzent); border-color: var(--akzent); }

/* ------------------------------------------------- Feinschliff für Handys */
.filter { gap: .4rem; }
.filter input[type=search] { flex: 1 1 100%; }
.filter select { flex: 1 1 8rem; }
@media (min-width: 40rem) {
  .filter input[type=search] { flex: 1 1 14rem; }
  .filter select { flex: 0 1 11rem; }
}

/* Karten dürfen auf schmalen Schirmen nicht so viel Rand verschenken */
.karte { padding: .8rem; }
@media (min-width: 40rem) { .karte { padding: 1rem; } }

/* Abstimmung und Tagesordnung: Beschriftung und Auswahl untereinander */
@media (max-width: 30rem) {
  .stimmzeile .fname { flex: 1 1 100%; }
  .stimmzeile .auswahl { width: 100%; }
  .stimmzeile .auswahl label { flex: 1 1 0; }
  .stimmzeile .auswahl span { display: block; text-align: center; }
  .top .topnr { flex: 0 0 auto; }
  ul.balken li { grid-template-columns: 1fr 3.5rem auto; }
  .kopfdaten { gap: .5rem 1rem; }
}

/* Kalendergitter bleibt tippbar */
.monatsgitter .tag { font-size: .8rem; }
@media (min-width: 40rem) { .monatsgitter .tag { font-size: .85rem; } }

/* ------------------------------------------------- Zu- und Absagen */
/*
 * Drei Knöpfe in einer Zeile, der gewählte farbig. Ein erneutes Antippen
 * nimmt die Antwort zurück - deshalb sind es Schalter und keine Auswahl.
 */
.zusagen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem;
  margin-top: .45rem;
}
.zusageknopf {
  font: inherit;
  font-size: .8rem;
  line-height: 1;
  padding: .35rem .6rem;
  min-height: 2rem;
  background: var(--papier);
  color: var(--leise);
  border: 1px solid var(--linie);
  border-radius: 999px;
  cursor: pointer;
}
.zusageknopf:hover { background: var(--seite); color: var(--tinte); }
.zusageknopf.an {
  background: color-mix(in srgb, var(--akzent) 12%, var(--papier));
  border-color: var(--akzent);
  color: var(--akzent);
  font-weight: 500;
}
.zusageknopf[disabled] { opacity: .5; cursor: progress; }
.zusagen .zaehler { font-size: .78rem; color: var(--leise); margin-left: .25rem; }

/* ---------------------------------------------------- Merklisten */
.merkliste h2 { margin-bottom: .2rem; }
.hinweiszeile { color: var(--leise); font-size: .88rem; margin: .1rem 0 .6rem; }
/* ----------------------------------------- Verbesserungsvorschläge */
.wunsch h2 { font-size: 1rem; }
.wunschtext { margin: .5rem 0 0; color: var(--tinte); }
.wunschantwort {
  display: flex;
  gap: .45rem;
  margin: .6rem 0 0;
  padding: .55rem .7rem;
  background: var(--seite);
  border-radius: var(--radius-klein);
  font-size: .92rem;
  color: var(--leise);
}
.wunschantwort .sym { color: var(--leise); margin-top: .15rem; }
.wunschfuss { margin-top: .7rem; gap: .75rem; }
.wunschfuss .leise { color: var(--leise); font-size: .82rem; }
.mitstimme .zahl {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  padding-left: .15rem;
}
.mitstimme.an {
  background: color-mix(in srgb, var(--akzent) 12%, var(--papier));
  border-color: var(--akzent);
  color: var(--akzent);
}
.wunsch.umgesetzt { border-left: 3px solid var(--gruen); }
.wunsch.geplant   { border-left: 3px solid var(--gelb); }
.wunsch.abgelehnt { opacity: .72; }
.punkt.neu::before       { background: var(--leise); }
.punkt.geplant::before   { background: var(--gelb); }
.punkt.umgesetzt::before { background: var(--gruen); }
.wunschstand { margin-top: .6rem; }
.wunschstand summary { font-size: .85rem; color: var(--leise); cursor: pointer; }

/* --------------------------------------------------- Seitenende */
.seitenfuss {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 .9rem calc(5.5rem + env(safe-area-inset-bottom));
  text-align: center;
}
.seitenfuss a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .88rem;
  color: var(--leise);
  text-decoration: none;
  padding: .5rem .9rem;
  border: 1px solid var(--linie);
  border-radius: 999px;
  background: var(--papier);
}
.seitenfuss a:hover { color: var(--akzent); border-color: var(--akzent); }
@media (min-width: 48rem) {
  .seitenfuss { padding-bottom: 3rem; }
}

.bildprobe { gap: .75rem; align-items: center; margin: .2rem 0 .8rem; }
.bildprobe img { border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.bildprobe .leise { color: var(--leise); font-size: .84rem; }
