/* COB Botschafter – Farben aus dem Corporate Design der Gemeinwohlbau
   Blau #1314c5, Violett #9f73fe, Gelb #fde000, Grün #54f48a, Rot #f97863, Hellblau #81c6fd */
:root {
  --blau: #1314c5;
  --blau-dunkel: #0e0fa3;
  --blau-hell: #e8e8fb;
  --violett: #9f73fe;
  --violett-hell: #f1eaff;
  --gelb-hell: #fff8cc;
  --gruen-hell: #dcfce7;
  --gruen-text: #11632f;
  --rot: #c2412d;
  --rot-hell: #fde4df;
  --hellblau-hell: #e3f2ff;
  --text: #1b1b2f;
  --text-2: #5c5c74;
  --linie: #e2e2ec;
  --flaeche: #ffffff;
  --grund: #f6f6fb;
  --radius: 14px;
  --schatten: 0 1px 2px rgba(20, 20, 60, .06), 0 4px 16px rgba(20, 20, 60, .05);
  --tabbar: 0px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--grund); font-size: 16px; line-height: 1.5; }
a { color: var(--blau); }
h1 { font-size: 1.45rem; margin: 0 0 1rem; letter-spacing: -.015em; line-height: 1.25; }
h2 { font-size: 1.08rem; margin: 1.75rem 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .25rem; line-height: 1.3; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- Kopf */
.kopf {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .65rem 1rem; padding-top: max(.65rem, env(safe-area-inset-top));
  background: var(--blau); color: #fff;
}
.marke { color: #fff; text-decoration: none; display: flex; align-items: center; white-space: nowrap; font-size: 1.05rem; }
.marke b { margin-left: .3rem; }
.punkte { width: 12px; height: 12px; border-radius: 50%; background: #fde000; box-shadow: 8px 0 0 #54f48a; margin-right: 18px; }
.kopf-rechts { display: flex; gap: .35rem; align-items: center; }
.kopf-rechts a { color: #fff; text-decoration: none; padding: .35rem .65rem; border-radius: 8px; font-size: .9rem; opacity: .9; }
.kopf-rechts a:hover, .kopf-rechts a.aktiv { background: rgba(255,255,255,.16); opacity: 1; }
.kopf-rechts .initialen { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255,255,255,.18); font-weight: 600; font-size: .85rem; }

/* Bereichs-Navigation: oben auf großen Bildschirmen, unten als Tab-Leiste auf dem Handy */
.bereiche { background: #fff; border-bottom: 1px solid var(--linie); display: flex; justify-content: center; gap: .25rem; padding: 0 .5rem;
  position: sticky; top: 54px; z-index: 25; }
.bereiche a { position: relative; color: var(--text-2); text-decoration: none; padding: .8rem .9rem; font-size: .93rem; font-weight: 500;
  border-bottom: 2px solid transparent; display: flex; align-items: center; gap: .4rem; }
.bereiche a.aktiv { color: var(--blau); border-bottom-color: var(--blau); }
.bereiche a:hover { color: var(--blau); }
.bereiche .symbol { font-size: 1.05rem; line-height: 1; }
.zahl { background: var(--rot); color: #fff; font-size: .7rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
@media (max-width: 720px) {
  :root { --tabbar: calc(62px + env(safe-area-inset-bottom)); }
  .bereiche { position: fixed; top: auto; bottom: 0; left: 0; right: 0; border-bottom: 0; border-top: 1px solid var(--linie);
    justify-content: space-around; padding: 0 0 env(safe-area-inset-bottom); gap: 0; }
  .bereiche a { flex-direction: column; gap: 2px; font-size: .68rem; padding: .5rem .2rem; border-bottom: 0; flex: 1; text-align: center; }
  .bereiche a.aktiv { border-bottom: 0; }
  .bereiche .symbol { font-size: 1.25rem; }
  .bereiche .zahl { position: absolute; top: 4px; left: calc(50% + 6px); }
}

.inhalt { max-width: 960px; margin: 0 auto; padding: 1.25rem 1rem calc(6rem + var(--tabbar)); }
.inhalt.schmal { max-width: 720px; }
.inhalt.breit { max-width: 1200px; }

/* ------------------------------------------------------------ Bausteine */
.karte { background: var(--flaeche); border-radius: var(--radius); box-shadow: var(--schatten); padding: 1.1rem; }
.zeile { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.zeile.ende { justify-content: flex-end; }
.zeile.zwischen { justify-content: space-between; }
.leise { color: var(--text-2); font-size: .9rem; }
.klein { font-size: .85rem; }
.leer { text-align: center; color: var(--text-2); padding: 2.5rem 1rem; }
.absatz { white-space: pre-wrap; word-break: break-word; }
.zurueck { display: inline-block; margin-bottom: .75rem; text-decoration: none; font-size: .92rem; }

button, .knopf {
  font: inherit; font-size: .95rem; cursor: pointer; border: 1px solid var(--linie); background: #fff; color: var(--text);
  padding: .55rem .95rem; border-radius: 10px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem; min-height: 42px; white-space: nowrap;
}
button:hover, .knopf:hover { border-color: #c4c4d8; }
.primaer { background: var(--blau) !important; border-color: var(--blau) !important; color: #fff !important; font-weight: 600; }
.primaer:hover { background: var(--blau-dunkel) !important; }
.gefahr { color: var(--rot) !important; }
button:disabled { opacity: .45; cursor: default; }
.mini { min-height: 34px; padding: .3rem .7rem; font-size: .85rem; }
.ohne-rahmen { border-color: transparent; background: transparent; color: var(--blau); padding-left: .4rem; padding-right: .4rem; }

label { display: block; font-size: .85rem; color: var(--text-2); margin-bottom: .3rem; font-weight: 500; }
input, select, textarea {
  font: inherit; font-size: 16px; /* verhindert Zoom in iOS-Safari */
  width: 100%; padding: .6rem .7rem; border: 1px solid var(--linie); border-radius: 10px; background: #fff; color: var(--text);
}
textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--violett); outline-offset: 0; border-color: var(--violett); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--blau); flex: none; }
.feld { margin-bottom: 1rem; }
.feld.geaendert input, .feld.geaendert select, .feld.geaendert textarea { border-color: var(--violett); background: var(--violett-hell); }
.feld .nurlesen { padding: .6rem .7rem; background: var(--grund); border-radius: 10px; min-height: 42px; white-space: pre-wrap; word-break: break-word; }
.pflicht::after { content: " *"; color: var(--rot); }
.haken { display: flex; align-items: center; gap: .55rem; font-size: .95rem; color: var(--text); margin: 0; cursor: pointer; }
.raster { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.raster .voll { grid-column: 1 / -1; }
@media (max-width: 620px) { .raster { grid-template-columns: 1fr; } }

.marker { font-size: .74rem; padding: .15rem .55rem; border-radius: 999px; background: var(--grund); color: var(--text-2); white-space: nowrap; font-weight: 500; }
.marker.neu { background: var(--rot); color: #fff; }
.marker.gesendet { background: var(--gruen-hell); color: var(--gruen-text); }
.marker.zust { background: var(--hellblau-hell); color: #154a7a; }
.marker.erstellt { background: var(--gelb-hell); color: #6b5800; }
.marker.entwurf { background: var(--gelb-hell); color: #6b5800; }
.marker.typ { background: var(--blau-hell); color: var(--blau); }

.hinweis { padding: .75rem .9rem; border-radius: 10px; background: var(--blau-hell); color: #10106e; margin-bottom: 1rem; font-size: .93rem; }
.hinweis.fehler { background: var(--rot-hell); color: #7a1f10; }
.hinweis.gut { background: var(--gruen-hell); color: var(--gruen-text); }
.hinweis.gelb { background: var(--gelb-hell); color: #5b4b00; }

.reiter { display: flex; gap: .35rem; margin-bottom: 1rem; overflow-x: auto; padding-bottom: 2px; }
.reiter button { border-radius: 999px; min-height: 36px; padding: .3rem .9rem; font-size: .88rem; }
.reiter button.aktiv { background: var(--blau-hell); border-color: var(--blau-hell); color: var(--blau); font-weight: 600; }
.werkzeug { display: flex; gap: .6rem; margin-bottom: .8rem; flex-wrap: wrap; }
.werkzeug input, .werkzeug select { flex: 1; min-width: 180px; }

/* ------------------------------------------------------------- Startseite */
.begruessung { margin-bottom: 1.25rem; }
.begruessung p { margin: .2rem 0 0; color: var(--text-2); }
.kacheln { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1.5rem; }
@media (max-width: 560px) {
  .kacheln { gap: .5rem; }
  .kachel { padding: .7rem .75rem; }
  .kachel .wert { font-size: 1.35rem; }
  .kachel .text { font-size: .78rem; line-height: 1.3; }
}
.kachel { background: #fff; border-radius: var(--radius); box-shadow: var(--schatten); padding: .9rem 1rem; text-decoration: none; color: inherit; display: block; }
.kachel .wert { font-size: 1.6rem; font-weight: 700; color: var(--blau); line-height: 1.2; }
.kachel .text { font-size: .88rem; color: var(--text-2); }
.abschnitt-kopf { display: flex; justify-content: space-between; align-items: baseline; margin: 1.75rem 0 .75rem; }
.abschnitt-kopf h2 { margin: 0; }
.abschnitt-kopf a { font-size: .9rem; text-decoration: none; }

/* --------------------------------------------------------- Beitragskarten */
.beitraege { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
.beitrag { background: #fff; border-radius: var(--radius); box-shadow: var(--schatten); padding: 1rem 1.1rem; display: flex; gap: 1rem; }
.beitrag .rumpf { flex: 1; min-width: 0; }
.beitrag h3 a { color: inherit; text-decoration: none; }
.beitrag h3 a:hover { color: var(--blau); }
.beitrag .vorschau { color: var(--text-2); font-size: .93rem; margin: .35rem 0 .6rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.beitrag .unten { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.beitrag .unten .knoepfe { margin-left: auto; display: flex; gap: .4rem; }
.beitrag .oben { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin-bottom: .2rem; font-size: .82rem; color: var(--text-2); }
.datumsblock { flex: none; width: 60px; text-align: center; background: var(--blau-hell); border-radius: 12px; padding: .5rem 0; align-self: flex-start; color: var(--blau); }
.datumsblock .tag { font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
.datumsblock .monat { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.pdf-symbol { flex: none; width: 44px; height: 54px; border-radius: 8px; background: var(--rot-hell); color: var(--rot); font-weight: 800;
  font-size: .72rem; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; align-self: flex-start; position: relative; }
.pdf-symbol::before { content: ""; position: absolute; top: 0; right: 0; border-width: 0 12px 12px 0; border-style: solid;
  border-color: var(--grund) var(--grund) #f3b7aa #f3b7aa; border-radius: 0 0 0 4px; }
@media (max-width: 560px) {
  .beitrag { padding: .9rem; gap: .8rem; }
  .beitrag .unten .knoepfe { margin-left: 0; width: 100%; gap: .35rem; }
  .beitrag .unten .knoepfe > * { flex: 1 1 0; min-width: 0; padding-left: .3rem; padding-right: .3rem; font-size: .82rem; }
  .beitrag .rumpf { overflow: hidden; }
  .datumsblock { width: 52px; }
}

/* ---------------------------------------------------------- Beitragsseite */
.artikel { background: #fff; border-radius: var(--radius); box-shadow: var(--schatten); padding: 1.4rem; }
.artikel .meta { color: var(--text-2); margin: -.5rem 0 1rem; }
.artikel .text p { margin: 0 0 1em; white-space: pre-wrap; word-break: break-word; }
.aktionen { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.25rem; }

/* ---------------------------------------------------------------- Listen */
.liste { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: var(--radius); box-shadow: var(--schatten); overflow: hidden; }
.liste > li + li { border-top: 1px solid var(--linie); }
.liste a.eintrag, .liste .eintrag { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; color: inherit; text-decoration: none; align-items: center; }
.liste a.eintrag:hover { background: #fafaff; }
.liste .name { font-weight: 600; }
.liste .unter { color: var(--text-2); font-size: .86rem; word-break: break-word; }
.liste .rechts { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }

.verlauf-liste { list-style: none; padding: 0; margin: 0; }
.verlauf-liste li { padding: .75rem 0; border-top: 1px solid var(--linie); }
.verlauf-liste li:first-child { border-top: 0; }
.alt { text-decoration: line-through; color: var(--text-2); }
details.aufklapp summary { cursor: pointer; font-weight: 600; padding: .4rem 0; }

.detailkopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.detailkopf .zust { font-size: .9rem; color: var(--text-2); }
.speicherleiste {
  position: fixed; left: 0; right: 0; bottom: var(--tabbar); z-index: 20;
  background: #fff; border-top: 1px solid var(--linie); padding: .65rem 1rem;
  padding-bottom: max(.65rem, calc(env(safe-area-inset-bottom) - var(--tabbar) + .65rem));
  display: flex; justify-content: flex-end; gap: .6rem; align-items: center;
}
.speicherleiste .leise { margin-right: auto; }

/* Auswahl mehrerer Beiträge */
.waehlen { gap: .45rem; cursor: pointer; font-weight: 500; }
.waehlen input { width: 17px; height: 17px; }
.beitrag.gewaehlt { box-shadow: 0 0 0 2px var(--violett), var(--schatten); }
.beitrag.gewaehlt .waehlen { background: var(--violett-hell); border-color: var(--violett); }
.auswahlleiste {
  position: fixed; left: 0; right: 0; bottom: var(--tabbar); z-index: 22;
  background: var(--text); color: #fff; padding: .65rem 1rem;
  padding-bottom: max(.65rem, calc(env(safe-area-inset-bottom) - var(--tabbar) + .65rem));
  display: flex; gap: .6rem; align-items: center; justify-content: flex-end;
}
.auswahlleiste .was { margin-right: auto; }
.auswahlleiste button:not(.primaer) { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.auswahlleiste .primaer { background: #fff !important; color: var(--blau) !important; border-color: #fff !important; }
@media (max-width: 560px) {
  .beitrag .unten .knoepfe > .waehlen { flex: 0 0 auto; padding: 0 .7rem; }
  .waehl-text { display: none; }
  .auswahlleiste { gap: .4rem; padding-left: .75rem; padding-right: .75rem; }
  .auswahlleiste .lang { display: none; }
  .auswahlleiste button { padding: .4rem .7rem; font-size: .88rem; }
}
body.mit-auswahl .inhalt { padding-bottom: calc(10rem + var(--tabbar)); }
.zusammenfassung { display: flex; flex-direction: column; gap: .35rem; background: var(--grund); border-radius: 10px; padding: .65rem .8rem; font-size: .92rem; }
.dialog .liste { box-shadow: none; border: 1px solid var(--linie); }

/* --------------------------------------------------------------- Tabellen */
.tabelle-huelle { overflow-x: auto; background: #fff; border-radius: var(--radius); box-shadow: var(--schatten); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .55rem .7rem; text-align: left; border-bottom: 1px solid var(--linie); vertical-align: middle; }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); background: #fafafe; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td input:not([type=checkbox]), td select { padding: .35rem .5rem; min-width: 110px; }
td.mitte, th.mitte { text-align: center; }
td.zahl-spalte, th.zahl-spalte { text-align: right; white-space: nowrap; }

/* ------------------------------------------------------------------ Dialog */
.schleier { position: fixed; inset: 0; background: rgba(15, 15, 40, .45); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.dialog { background: #fff; width: 100%; max-width: 640px; max-height: 92vh; display: flex; flex-direction: column; border-radius: 18px 18px 0 0; }
.dialog-kopf { padding: 1rem 1.25rem .5rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.dialog-kopf h2 { margin: 0; }
.dialog-rumpf { padding: .25rem 1.25rem 1rem; overflow-y: auto; flex: 1; }
.dialog-fuss { padding: .75rem 1.25rem; padding-bottom: max(.75rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--linie);
  display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }
.dialog textarea.mailtext { min-height: 300px; font-size: 15px; }
.auswahl-liste { list-style: none; margin: 0; padding: 0; border: 1px solid var(--linie); border-radius: 12px; overflow: hidden; }
.auswahl-liste li + li { border-top: 1px solid var(--linie); }
.auswahl-liste label, .auswahl-liste button.zeile-knopf { display: flex; gap: .75rem; align-items: center; padding: .7rem .85rem; margin: 0;
  color: var(--text); font-size: .95rem; cursor: pointer; width: 100%; border: 0; border-radius: 0; text-align: left; background: #fff; min-height: 0; white-space: normal; justify-content: flex-start; }
.auswahl-liste label:hover, .auswahl-liste button.zeile-knopf:hover { background: #fafaff; }
.auswahl-liste .titel { font-weight: 600; }
.auswahl-liste .gruppe { background: #fafafe; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); padding: .45rem .85rem; font-weight: 600; }
@media (min-width: 720px) { .schleier { align-items: center; } .dialog { border-radius: 18px; } }

/* ---------------------------------------------------------------- Meldung */
.meldung { position: fixed; left: 50%; bottom: calc(84px + var(--tabbar)); transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: var(--text); color: #fff; padding: .7rem 1rem; border-radius: 10px; max-width: calc(100% - 2rem); transition: .2s; z-index: 60; }
.meldung.sichtbar { opacity: 1; transform: translateX(-50%) translateY(0); }
.meldung.fehler { background: var(--rot); }

/* ------------------------------------------------------------------ Login */
.login { max-width: 400px; margin: 10vh auto 0; }
.login .marke-gross { font-size: 1.15rem; margin-bottom: 1.5rem; color: var(--blau); display: flex; align-items: center; }
.login .marke-gross b { font-size: 1.9rem; letter-spacing: -.02em; margin-left: .35rem; }
.login .punkte { margin-right: 20px; }
.linkbox { display: flex; gap: .5rem; align-items: center; background: var(--grund); border-radius: 10px; padding: .5rem .5rem .5rem .8rem; margin-top: .5rem; }
.linkbox code { flex: 1; overflow-x: auto; white-space: nowrap; font-size: .82rem; }
