:root {
  --bg: #f6f5f1;
  --karte: #ffffff;
  --text: #1c1f23;
  --gedaempft: #6b7078;
  --linie: #e4e2dc;
  --fl: #efede7;
  --akzent: #0f766e;
  --akzent-dunkel: #0b5f58;
  --akzent-hell: #e3f1ef;
  --auf-akzent: #ffffff;
  --plus: #0f7a4a;
  --minus: #c2410c;
  --gefahr: #b91c1c;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121416;
    --karte: #1b1e21;
    --text: #e9eaec;
    --gedaempft: #9aa0a8;
    --linie: #2b3035;
    --fl: #24282c;
    --akzent: #2bb3a6;
    --akzent-dunkel: #239a8f;
    --akzent-hell: #183531;
    --auf-akzent: #0b1513;
    --plus: #4cc38a;
    --minus: #f59e5b;
    --gefahr: #f0705f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121416; --karte: #1b1e21; --text: #e9eaec; --gedaempft: #9aa0a8; --linie: #2b3035; --fl: #24282c;
  --akzent: #2bb3a6; --akzent-dunkel: #239a8f; --akzent-hell: #183531; --auf-akzent: #0b1513;
  --plus: #4cc38a; --minus: #f59e5b; --gefahr: #f0705f; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--akzent); }
h1, h2, h3 { line-height: 1.2; }
[hidden] { display: none !important; }

/* Kopfzeile */
.kopf {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  min-height: 56px;
  padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--linie);
}
.marke { font-weight: 800; font-size: 22px; letter-spacing: -.02em; color: var(--akzent); text-decoration: none; margin-right: auto; }
.marke img { display: block; height: 36px; width: auto; }
.kopf-zurueck { display: grid; place-items: center; width: 44px; height: 44px; margin-left: -10px; color: var(--text); border-radius: 50%; }
.kopf-zurueck:active { background: var(--fl); }
.kopf-titel { flex: 1; margin: 0; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.link { background: none; border: 0; padding: 12px 8px; font: inherit; font-size: 13px; color: var(--gedaempft); text-decoration: underline; cursor: pointer; }

.inhalt {
  flex: 1;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left));
}
.fuss {
  display: flex; justify-content: center; gap: 20px;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  font-size: 13px;
}
.fuss a { color: var(--gedaempft); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
#recht a[href^="tel:"], #recht a[href^="mailto:"] { display: inline-block; min-height: 44px; line-height: 44px; }

/* Bausteine */
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 18px; margin: 16px 0; }
.karte.mittig { text-align: center; }
.karte h2 { margin: 8px 0; font-size: 20px; }
.seiten-titel { font-size: 28px; margin: 8px 0 16px; letter-spacing: -.02em; }
.abschnitt-titel { font-size: 17px; margin: 28px 0 10px; }
form > input[type=hidden]:first-child + .abschnitt-titel { margin-top: 4px; }
.abschnitt-kopf { display: flex; justify-content: space-between; align-items: baseline; margin: 28px 0 6px; }
.abschnitt-kopf h2 { font-size: 17px; margin: 0; }
.klein { font-size: 14px; }
.gedaempft { color: var(--gedaempft); }
.leer { text-align: center; color: var(--gedaempft); padding: 24px 8px; }
.zeile { display: flex; gap: 10px; align-items: stretch; }
.zeile .feld { flex: 1; min-width: 0; }
.wachsen { flex: 1; }

.meldung { background: var(--fl); border-radius: 10px; padding: 12px 14px; margin: 12px 0; font-size: 15px; }
.meldung.ok { background: var(--akzent-hell); color: var(--text); }
.meldung-aktion { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding-block: 4px; }
.meldung-aktion a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.meldung.fehler { background: color-mix(in srgb, var(--gefahr) 14%, var(--karte)); color: var(--text); }

/* Formulare */
.feld-label { display: block; font-weight: 600; font-size: 15px; margin: 18px 0 6px; }
.feld-label.gross { font-size: 22px; margin-top: 8px; letter-spacing: -.01em; }
.karte > .feld-label:first-child, .karte > input[type=hidden]:first-child + .feld-label { margin-top: 0; }
.feld {
  display: block; width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  font: inherit; font-size: 17px; /* ab 16px kein Zoom auf iOS */
  color: var(--text);
  background: var(--karte);
  border: 1.5px solid var(--linie);
  border-radius: 12px;
  -webkit-appearance: none; appearance: none;
}
select.feld { background-image: linear-gradient(45deg, transparent 50%, var(--gedaempft) 50%), linear-gradient(135deg, var(--gedaempft) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
textarea.feld { resize: vertical; }
.feld:focus { outline: none; border-color: var(--akzent); box-shadow: 0 0 0 3px var(--akzent-hell); }
.code-feld { text-transform: uppercase; letter-spacing: .25em; font-weight: 700; font-family: ui-monospace, Menlo, monospace; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 20px;
  font: inherit; font-size: 16px; font-weight: 700;
  color: var(--text); background: var(--fl);
  border: 0; border-radius: 12px;
  text-decoration: none; cursor: pointer;
  touch-action: manipulation;
}
.knopf:active { transform: scale(.98); }
.knopf.haupt { background: var(--akzent); color: var(--auf-akzent); }
.knopf.haupt:active { background: var(--akzent-dunkel); }
.knopf.gefahr { background: none; color: var(--gefahr); }
.knopf.leise { background: none; color: var(--akzent); }
.knopf.breit { display: flex; width: 100%; margin-top: 16px; }

/* Startseite */
.start-held { padding: 28px 0 4px; }
.start-held h1 { font-size: 34px; letter-spacing: -.03em; margin: 0 0 10px; }
.start-held p { font-size: 18px; color: var(--gedaempft); margin: 0; overflow-wrap: anywhere; }
/* Startseite auf dem iPhone: App im Vordergrund, Anmeldung fährt über "Web-Version benutzen" aus */
.app-karte { text-align: center; }
.app-karte img { display: block; margin: 4px auto 12px; border-radius: 18px; }
.app-karte h2 { margin: 0 0 6px; font-size: 22px; }
.app-karte p { margin: 0 0 16px; }
.web-version { text-align: center; margin: 4px 0 8px; }
.link-knopf { min-height: 44px; padding: 0 12px; background: none; border: 0; font: inherit; font-size: 14px; color: var(--gedaempft); text-decoration: underline; cursor: pointer; }
.ausfahren { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.ausfahren > div { overflow: hidden; }
.ausfahren.offen { grid-template-rows: 1fr; }
.app-hinweis { text-align: center; margin: -4px 0 0; }
@media (prefers-reduced-motion: reduce) { .ausfahren { transition: none; } }
.start-punkte { list-style: none; padding: 0; margin: 24px 0; }
.start-punkte li { padding: 12px 0 12px 32px; border-top: 1px solid var(--linie); position: relative; }
.start-punkte li::before { content: ""; position: absolute; left: 4px; top: 19px; width: 12px; height: 12px; border-radius: 50%; background: var(--akzent); }
.team-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 16px 0 0; }
.team-chips li { padding: 6px 14px; border-radius: 999px; background: var(--akzent-hell); font-weight: 600; font-size: 15px; }
.link-feld { font-size: 15px; color: var(--gedaempft); }
.symbol-gross { width: 56px; height: 56px; color: var(--akzent); }

/* Listen */
.liste { list-style: none; padding: 0; margin: 0 0 16px; background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; }
.liste:empty { display: none; }
.liste > li + li { border-top: 1px solid var(--linie); }
.liste-eintrag { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; color: var(--text); text-decoration: none; }
a.liste-eintrag:active { background: var(--fl); }
.liste-haupt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.liste-haupt strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste-datum { padding: 8px 16px 6px; font-size: 13px; font-weight: 700; color: var(--gedaempft); background: var(--bg); text-transform: uppercase; letter-spacing: .04em; }
.betrag { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.betrag.plus { color: var(--plus); }
.betrag.minus { color: var(--minus); }

/* Gruppenseite */
.gross-knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0 8px; }
.kachel {
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
  min-height: 120px; padding: 16px;
  font-size: 18px; font-weight: 700; line-height: 1.2;
  color: var(--text); background: var(--karte); border: 1px solid var(--linie);
  border-radius: 18px; text-decoration: none;
}
.kachel svg { width: 34px; height: 34px; padding: 6px; border-radius: 50%; background: var(--akzent-hell); color: var(--akzent); }
.kachel.haupt { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); }
.kachel.haupt svg { background: rgba(255, 255, 255, .2); color: var(--auf-akzent); }
.kachel:active { transform: scale(.98); }
.kachel.neutral svg { background: var(--fl); color: var(--text); }
.hinweis-karte { border-color: var(--akzent); }
.sterne { display: flex; gap: 4px; margin-top: 8px; }
.stern { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; padding: 0; background: none; border: 0; cursor: pointer; color: var(--linie); }
.stern svg { fill: currentColor; }
.stern.an { color: var(--akzent); }
.bewertung-dank { margin: 8px 0 0; font-weight: 600; }
.bewertung-rezension p { margin: 8px 0 12px; }
.kachel-info { display: block; margin: 2px 0; font-size: 13px; font-weight: 500; color: var(--gedaempft); line-height: 1.3; font-variant-numeric: tabular-nums; }
.unter-links { display: flex; justify-content: center; gap: 24px; margin: 24px 0 0; }
.unter-links a { padding: 10px 4px; text-decoration: none; font-weight: 600; }

/* Ausgabe */
.betrag-feld { position: relative; }
.betrag-feld .feld { font-size: 34px; font-weight: 700; min-height: 72px; padding-right: 48px; font-variant-numeric: tabular-nums; }
.betrag-feld span { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 26px; color: var(--gedaempft); }
.auswahl { display: flex; flex-wrap: wrap; gap: 8px; }
.auswahl label { position: relative; }
.auswahl input { position: absolute; opacity: 0; inset: 0; }
.auswahl span { display: inline-flex; align-items: center; min-height: 46px; padding: 10px 16px; border: 1.5px solid var(--linie); border-radius: 999px; background: var(--karte); font-weight: 600; cursor: pointer; }
.auswahl input:checked + span { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); }
.auswahl input:focus-visible + span { box-shadow: 0 0 0 3px var(--akzent-hell); }

/* Auswertung */
.summe-karte { display: flex; flex-direction: column; align-items: center; padding: 20px; background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); }
.summe-karte strong { font-size: 34px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.zahlungen { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.zahlungen li { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--akzent-hell); border-radius: var(--radius); }
.zahlung-wer { flex: 1; min-width: 0; }
.zahlung-wer { overflow-wrap: anywhere; }
.zahlung-wer .etikett { display: block; width: fit-content; margin: 0 0 6px; }
.etikett.signal { background: var(--akzent); color: var(--auf-akzent); font-size: 16px; padding: 3px 10px; }
.zahlungen .betrag { font-size: 19px; }
.zahlungen li { flex-wrap: wrap; }
.zahlung-form { flex-basis: 100%; }
.zahlung-form .knopf { width: 100%; min-height: 44px; padding: 10px 16px; }
.paypal { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.paypal > span { flex-basis: 100%; }
.paypal .knopf { min-height: 44px; padding: 8px 14px; font-size: 15px; }
.paypal .knopf.leise { overflow-wrap: anywhere; text-align: left; }
.ausgleich-eintrag { background: var(--akzent-hell); }
.ausgleich-eintrag .knopf { min-height: 44px; padding: 8px 12px; }
.liste-eintrag.statisch { min-height: 60px; }
.protokoll-eintrag .liste-haupt { gap: 2px; }
.protokoll-eintrag .liste-haupt strong { white-space: normal; overflow-wrap: anywhere; }
.protokoll-eintrag .klein:not(.gedaempft) { overflow-wrap: anywhere; }

/* Wizard */
.schritte { display: flex; gap: 8px; list-style: none; padding: 0; margin: 4px 0 20px; counter-reset: s; }
.schritte li { flex: 1; padding-top: 8px; border-top: 4px solid var(--linie); font-size: 13px; font-weight: 600; color: var(--gedaempft); counter-increment: s; }
.schritte li::before { content: counter(s) ". "; }
.schritte li.aktiv { border-color: var(--akzent); color: var(--text); }
.team-felder { display: grid; gap: 10px; margin: 16px 0 8px; }
.team-feld { display: flex; gap: 10px; align-items: center; }
.team-feld .feld { flex: 1; min-width: 0; }
.mein-team { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--gedaempft); min-height: 44px; white-space: nowrap; }
.mein-team input { width: 20px; height: 20px; accent-color: var(--akzent); }

/* Stepper */
.stepper { display: inline-flex; align-items: center; background: var(--fl); border-radius: 999px; padding: 4px; }
.stepper-knopf { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--karte); color: var(--text); font-size: 24px; line-height: 1; cursor: pointer; touch-action: manipulation; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.stepper-knopf:active { background: var(--akzent-hell); }
.stepper-wert { width: 44px; border: 0; background: none; color: var(--text); text-align: center; font: inherit; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper.gross { display: flex; justify-content: space-between; margin: 12px 0; }
.stepper.gross .stepper-knopf { width: 56px; height: 56px; }
.stepper.gross .stepper-wert { font-size: 30px; width: auto; }

/* Einstellungen */
.team-karte { padding: 16px; }
.team-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.team-kopf h3 { margin: 0; font-size: 18px; min-width: 0; overflow-wrap: anywhere; }
.team-kopf .feld-label { margin-top: 0; }
.team-kopf:has(.feld) { align-items: flex-end; }
.team-entfernen { display: flex; width: 100%; margin-top: 12px; }
.team-neu { padding: 16px; }
.team-neu .feld-label { margin-top: 0; }
.team-neu .knopf { white-space: nowrap; }
.faktor-gross { font-size: 44px; font-weight: 800; line-height: 1; color: var(--akzent); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.segmente { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--fl); border-radius: 12px; padding: 4px; gap: 4px; }
.segmente label { position: relative; }
.segmente input { position: absolute; opacity: 0; inset: 0; }
.segmente span { display: flex; align-items: center; justify-content: center; min-height: 42px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--gedaempft); cursor: pointer; }
.segmente input:checked + span { background: var(--karte); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.segmente input:focus-visible + span { outline: 2px solid var(--akzent); }
.modus-inhalt { padding-top: 12px; }
.modus-inhalt .feld-label { margin-top: 4px; }
.personen-zeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.personen-zeile + .personen-zeile { border-top: 1px solid var(--linie); }
.mitglied { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; }
.mitglied label { overflow-wrap: anywhere; }
.leiste-unten { position: sticky; bottom: 0; padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
.leiste-unten .knopf.breit { margin-top: 8px; }

/* Einladen */
.code-anzeige { font: 800 40px/1.2 ui-monospace, Menlo, monospace; letter-spacing: .18em; color: var(--akzent); margin: 6px 0 4px; user-select: all; }

@media (min-width: 640px) {
  .kachel { min-height: 140px; font-size: 20px; }
  .start-held h1 { font-size: 44px; }
}

/* Gruppenseite: aufklappbare Ausgabenliste */
.ausgaben-klappe { margin: 16px 0 0; }
.ausgaben-klappe summary {
  display: flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 14px 16px;
  background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius);
  list-style: none; cursor: pointer;
}
.ausgaben-klappe summary::-webkit-details-marker { display: none; }
.ausgaben-klappe summary .gedaempft { flex: 1; }
.ausgaben-klappe summary .betrag { font-size: 19px; }
.ausgaben-klappe summary svg { color: var(--gedaempft); transition: transform .2s; }
.ausgaben-klappe[open] summary svg { transform: rotate(180deg); }
.ausgaben-klappe[open] summary { margin-bottom: 10px; }
.statistik { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 0; }
.statistik > div { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); }
.statistik .betrag { font-size: 22px; }

/* Gruppenseite: Verlauf der Gesamtausgaben */
.verlauf { margin-top: 12px; padding: 16px 16px 12px; }
.verlauf-titel { font-size: 15px !important; font-weight: 600; color: var(--gedaempft); margin: 0 0 8px !important; }
.verlauf-grafik { position: relative; touch-action: pan-y; }
.verlauf-grafik svg { display: block; overflow: visible; }
.v-gitter { stroke: var(--linie); stroke-width: 1; }
.v-achse { fill: var(--gedaempft); font-size: 12px; font-variant-numeric: tabular-nums; }
.v-balken { fill: var(--akzent); }
.v-balken.aktiv { fill: var(--akzent-dunkel); }
.v-tipp { position: absolute; top: -6px; display: flex; flex-direction: column; padding: 6px 10px; background: var(--karte); border: 1px solid var(--linie); border-radius: 10px; box-shadow: 0 4px 14px rgba(0, 0, 0, .12); font-size: 13px; line-height: 1.35; white-space: nowrap; pointer-events: none; }
.v-tipp span { color: var(--gedaempft); }
.nur-vorlesen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.v-schnitt { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: .7; }
.verlauf-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.verlauf-kopf .verlauf-titel { margin: 0 !important; }
.v-legende { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Gruppenübersicht: Beitreten aufklappen */
.beitreten-klappe > summary { list-style: none; }
.beitreten-klappe > summary::-webkit-details-marker { display: none; }
.beitreten-klappe[open] > summary { background: none; color: var(--gedaempft); }
.beitreten-klappe .karte { margin-top: 8px; }
.archiv-klappe { margin-top: 12px; }
.archiv-klappe .liste { margin-top: 8px; }
.konfetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 100; }

/* Einladen: Vorschläge aus anderen Gruppen */
.vorschlaege { list-style: none; padding: 0; margin: 0; }
.vorschlaege li { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.vorschlaege li + li { border-top: 1px solid var(--linie); }
.vorschlaege .liste-haupt strong { overflow-wrap: anywhere; white-space: normal; }
.vorschlaege form { margin: 0; }
.vorschlaege .knopf { min-height: 44px; padding: 8px 16px; }

/* Auswertung: Tortendiagramm der Anteile (Kategorienfarben in fester Reihenfolge, geprüft für hell und dunkel) */
:root {
  --serie-1: #2a78d6; --serie-2: #eb6834; --serie-3: #1baf7a; --serie-4: #eda100;
  --serie-5: #e87ba4; --serie-6: #008300; --serie-weitere: #8a8f96;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --serie-1: #3987e5; --serie-2: #d95926; --serie-3: #199e70; --serie-4: #c98500;
    --serie-5: #d55181; --serie-6: #008300; --serie-weitere: #7d838b;
  }
}
:root[data-theme="dark"] {
  --serie-1: #3987e5; --serie-2: #d95926; --serie-3: #199e70; --serie-4: #c98500;
  --serie-5: #d55181; --serie-6: #008300; --serie-weitere: #7d838b;
}
.serie-1 { --farbe: var(--serie-1); } .serie-2 { --farbe: var(--serie-2); } .serie-3 { --farbe: var(--serie-3); }
.serie-4 { --farbe: var(--serie-4); } .serie-5 { --farbe: var(--serie-5); } .serie-6 { --farbe: var(--serie-6); }
.serie-weitere { --farbe: var(--serie-weitere); }
.torte { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.torte-grafik { width: min(220px, 70vw); height: auto; }
.torte-stueck { fill: var(--farbe); stroke: var(--karte); stroke-width: 2; stroke-linejoin: round; }
.torte-ring { fill: none; stroke: var(--farbe); stroke-width: 32; }
.torte-grafik:hover .torte-stueck { opacity: .45; }
.torte-grafik .torte-stueck:hover { opacity: 1; }
.torte-legende { list-style: none; padding: 0; margin: 0; width: 100%; }
.torte-legende li { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.torte-legende li + li { border-top: 1px solid var(--linie); }
.torte-farbe { width: 12px; height: 12px; border-radius: 3px; background: var(--farbe); flex: none; }
.torte-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* Einstellungen: Urlaubsmodus */
.schalter { display: flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 600; cursor: pointer; }
.schalter input { width: 22px; height: 22px; accent-color: var(--akzent); }
.urlaub-felder { margin-top: 4px; }
.urlaub-felder .zeile > div { min-width: 0; }
.waehrung-wahl { grid-template-columns: 1fr 1fr; margin-bottom: 8px; }
.umrechnung { min-height: 1.5em; margin: 6px 0 0; font-weight: 600; color: var(--text); }

/* Ausgabe: erweiterte Einstellungen */
.erweitert { margin: 20px 0 0; padding: 0 16px; background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); }
.erweitert > summary { min-height: 52px; display: flex; align-items: center; font-weight: 600; cursor: pointer; list-style: none; }
.erweitert > summary::-webkit-details-marker { display: none; }
.erweitert > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--gedaempft); border-bottom: 2px solid var(--gedaempft); transform: rotate(45deg); transition: transform .2s; }
.erweitert[open] > summary::after { transform: rotate(-135deg); }
.erweitert[open] { padding-bottom: 12px; }
.gewichte .stepper-wert { width: 52px; }
/* Rundes Profilfoto direkt vor dem Anzeigenamen */
.profilfoto { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; vertical-align: -5px; margin-right: 5px; }
.profilfoto.gross { width: 30px; height: 30px; margin: 0; vertical-align: middle; }

/* Hamburger-Menü in der Gruppenübersicht (wie das Menü in der App) */
.menue { position: relative; margin-left: auto; }
.menue summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; min-width: 44px; justify-content: flex-end; color: var(--text); cursor: pointer; }
.menue summary::-webkit-details-marker { display: none; }
.menue-inhalt { position: absolute; right: 0; top: calc(100% + 4px); min-width: 240px; background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 6px 0; }
.menue-info { margin: 0; padding: 10px 16px; font-size: 13px; color: var(--gedaempft); border-bottom: 1px solid var(--linie); overflow-wrap: anywhere; }
.menue-inhalt form { margin: 0; }
.menue-punkt { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 16px; background: none; border: 0; font: inherit; font-size: 16px; color: var(--text); text-align: left; cursor: pointer; }
.menue-punkt:active { background: var(--fl); }
a.menue-punkt { text-decoration: none; }
.ueber p { margin: 0 0 12px; line-height: 1.55; }
.ueber p:last-child { margin-bottom: 0; }
.menue-punkt.gefahr { color: var(--gefahr); border-top: 1px solid var(--linie); }
.name-dialog { width: min(420px, calc(100% - 32px)); border: 1px solid var(--linie); border-radius: var(--radius); background: var(--karte); color: var(--text); padding: 18px; }
.name-dialog::backdrop { background: rgba(0,0,0,.4); }
.name-dialog .feld-label { margin-top: 0; }
.name-dialog .zeile .knopf { flex: 1; }

/* Signalfarbe einer Gruppe (Einstellungen) */
.farbwahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 12px 8px; }
.farbwahl label { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.farbwahl input { position: absolute; opacity: 0; inset: 0; }
.farbwahl span { width: 44px; height: 44px; border-radius: 50%; background: var(--hell); box-shadow: 0 0 0 2px var(--karte), 0 0 0 2px transparent; }
.farbwahl input:checked + span { box-shadow: 0 0 0 3px var(--karte), 0 0 0 5px var(--text); }
.farbwahl input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 4px; }
.farbwahl small { font-size: 13px; color: var(--gedaempft); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .farbwahl span { background: var(--dunkel); } }
:root[data-theme="dark"] .farbwahl span { background: var(--dunkel); }

/* Signalfarbe als Streifen links in der Gruppenübersicht */
.liste-eintrag.gruppen-streifen { box-shadow: inset 5px 0 0 var(--streifen-hell); padding-left: 21px; }
/* Gruppenübersicht: jede Gruppe als eigene Karte */
.gruppen-karten { display: grid; gap: 12px; background: none; border: 0; border-radius: 0; overflow: visible; }
.gruppen-karten > li, .gruppen-karten > li + li { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; }
/* Gruppe mit Foto: Foto über dem Eintrag, gehört zur Schaltfläche */
.liste-eintrag.mit-foto { flex-wrap: wrap; padding-top: 0; }
.gruppen-bild { display: block; flex: 0 0 calc(100% + 37px); width: calc(100% + 37px); height: 160px; margin: 0 -16px 0 -21px; object-fit: cover; }
/* Gruppenfoto auf der Gruppenseite, Beschreibung klein und weiß unten auf dem Foto */
.gruppenfoto { position: relative; margin: 0 0 16px; border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; background: var(--karte); }
.gruppenfoto img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gruppenfoto figcaption { position: absolute; left: 0; right: 0; bottom: 0; max-height: 100%; overflow-y: auto; padding: 36px 16px 12px; font-size: 13px; line-height: 1.4; color: #fff; text-align: left; white-space: pre-line; overflow-wrap: anywhere; background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.65)); }
.gruppenfoto-vorschau { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 12px; border-radius: 12px; }
.foto-karte .schalter { margin-top: 12px; }
.foto-karte .feld-label { margin-top: 16px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .liste-eintrag.gruppen-streifen { box-shadow: inset 5px 0 0 var(--streifen-dunkel); } }
:root[data-theme="dark"] .liste-eintrag.gruppen-streifen { box-shadow: inset 5px 0 0 var(--streifen-dunkel); }

/* Kleines Etikett, z.B. "Urlaub beendet" in der Gruppenübersicht */
.etikett { align-self: flex-start; margin: 3px 0 2px; padding: 2px 8px; border-radius: 999px; background: var(--fl); color: var(--gedaempft); font-size: 12px; font-weight: 600; }
