/* ==========================================================================
   Moki Elternportal – zentrales Stylesheet
   Farben und Maße wie auf der Homepage, ganz oben unter :root steuerbar.
   Aufbau: 1 Variablen · 2 Grundlagen · 3 Kopf & Menü · 4 Inhalt · 5 Boxen
           6 Buttons · 7 Formular · 8 Meldungen · 9 Tabelle · 10 Pillen · 11 Fuß
   Mobile First: Standard = Smartphone (Tab-Leiste unten), ab 56rem Menü oben.
   ========================================================================== */

/* 1 Variablen ------------------------------------------------------------- */
:root {
  --primaer:      #1c1f2e;   /* Kopf, dunkle Flächen */
  --akzent:       #c00000;   /* Buttons, aktive Links */
  --akzent-dunkel:#9a0000;
  --akzent-zart:  #fdeef2;   /* zartes Rosa aus dem Logo, wie auf der Homepage */
  --grund:        #fbf8f5;   /* warmes Off-White wie die Homepage */
  --flaeche:      #ffffff;   /* Boxen, Formularfelder */
  --flaeche-2:    #f8f4f0;
  --text:         #1c1f2e;
  --leise:        #5a6070;
  --linie:        #e6dfd8;

  /* Kopf: hell wie die Homepage (weißes Glas, dunkle Schrift); im dunklen Schema dunkel */
  --kopf-grund:   rgba(255, 255, 255, .88);
  --kopf-text:    #1c1f2e;
  --kopf-linie:   rgba(28, 31, 46, .08);
  --kopf-hover:   #fdeef2;
  --kopf-markiert:rgba(28, 31, 46, .07);
  --verlauf:      linear-gradient(180deg, #fdeef2 0, rgba(253, 238, 242, 0) 22rem);   /* zartes Rosa oben, wie die Seitenköpfe der Homepage */
  --gut:          #1f7a45;
  --gut-zart:     #e5f3eb;
  --warn:         #9a6200;
  --warn-zart:    #fdf1dc;
  --auf-akzent:   #ffffff;
  --daten:        #3b6db3;   /* neutrale Datenfarbe für Diagramme (Status-Farben bleiben Zuständen vorbehalten) */
  --daten-zart:   #e6eef9;
  --logo-farbig:  block;    /* welches Logo im Kopf: farbig auf hellem, hell auf dunklem Kopf */
  --logo-hell:    none;

  --schrift:  system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius:   12px;
  --schatten: 0 1px 2px rgba(28, 31, 46, .06), 0 6px 18px rgba(28, 31, 46, .07);
  --breite:   72rem;
  --kopf:     3.75rem;
}

/* Darstellung (Update 21, im Profil wählbar, data-design am <html>):
   ohne Attribut = automatisch wie das Gerät · "hell" = immer hell · "dunkel" = immer dunkel ·
   "klassisch" = das frühere helle Design mit dunklem Kopf. Die dunklen Werte stehen zweimal (Gerät / Auswahl). */
@media (prefers-color-scheme: dark) {
  :root:not([data-design]) {
    --primaer: #11131c; --akzent: #ff6b6b; --akzent-dunkel: #ff8a8a; --akzent-zart: #3a1c20;
    --grund: #171a24; --flaeche: #20242f; --flaeche-2: #262b37; --text: #e9ecf2; --leise: #a3acbb;
    --linie: #343a48; --gut: #5cc98b; --gut-zart: #1c3328; --warn: #f0b552; --warn-zart: #3a2f1a;
    --auf-akzent: #11131c; --daten: #7fa7e0; --daten-zart: #1f2a3d;
    --schatten: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
    --kopf-grund: #11131c; --kopf-text: #ffffff; --kopf-linie: rgba(255, 255, 255, .08);
    --kopf-hover: rgba(255, 255, 255, .1); --kopf-markiert: rgba(255, 255, 255, .14); --verlauf: none;
    --logo-farbig: none; --logo-hell: block;
    color-scheme: dark;
  }
}
:root[data-design="dunkel"] {
  --primaer: #11131c; --akzent: #ff6b6b; --akzent-dunkel: #ff8a8a; --akzent-zart: #3a1c20;
  --grund: #171a24; --flaeche: #20242f; --flaeche-2: #262b37; --text: #e9ecf2; --leise: #a3acbb;
  --linie: #343a48; --gut: #5cc98b; --gut-zart: #1c3328; --warn: #f0b552; --warn-zart: #3a2f1a;
  --auf-akzent: #11131c; --daten: #7fa7e0; --daten-zart: #1f2a3d;
  --schatten: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  --kopf-grund: #11131c; --kopf-text: #ffffff; --kopf-linie: rgba(255, 255, 255, .08);
  --kopf-hover: rgba(255, 255, 255, .1); --kopf-markiert: rgba(255, 255, 255, .14); --verlauf: none;
  --logo-farbig: none; --logo-hell: block;
  color-scheme: dark;
}
:root[data-design="klassisch"] {
  --akzent-zart: #fbeaea; --grund: #f4f6f9; --flaeche-2: #f7f9fb; --leise: #556070; --linie: #dde3ea;
  --kopf-grund: #1c1f2e; --kopf-text: #ffffff; --kopf-linie: transparent;
  --kopf-hover: rgba(255, 255, 255, .1); --kopf-markiert: rgba(255, 255, 255, .14); --verlauf: none;
  --logo-farbig: none; --logo-hell: block;
}
.kopf__logo img.logo-farbig { display: var(--logo-farbig); }   /* stärker als ".kopf__logo img" weiter unten */
.kopf__logo img.logo-hell   { display: var(--logo-hell); }

/* 2 Grundlagen ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--schrift); font-size: 1rem; line-height: 1.55;
  color: var(--text); background: var(--verlauf) no-repeat, var(--grund);
}
body.mit-tabs { padding-bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 56rem) { body.mit-tabs { padding-bottom: 0; } }

h1, h2, h3 { line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.5rem, 3vw + .6rem, 2.1rem); letter-spacing: -.02em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--akzent); text-underline-offset: .18em; }
a:hover { color: var(--akzent-dunkel); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; border-radius: 6px; }

.nur-vorleser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sprunglink { position: fixed; top: -10rem; left: 1rem; z-index: 200; padding: .6rem 1rem; background: var(--flaeche); border-radius: var(--radius); }
.sprunglink:focus { top: 1rem; }
.leise { color: var(--leise); }
.klein { font-size: .88rem; }
.num { font-variant-numeric: tabular-nums; }

/* 3 Kopf & Menü ----------------------------------------------------------- */
.kopf { position: sticky; top: 0; z-index: 50; color: var(--kopf-text); background: var(--kopf-grund); padding-top: env(safe-area-inset-top, 0px);
        -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
        border-bottom: 1px solid var(--kopf-linie); box-shadow: 0 2px 12px rgba(28, 31, 46, .05); }
.kopf__innen { max-width: var(--breite); margin: 0 auto; padding: 0 1rem; min-height: var(--kopf); display: flex; align-items: center; gap: 1rem; }
.kopf__logo { display: flex; align-items: center; gap: .7rem; color: inherit; text-decoration: none; }
.kopf__logo:hover { color: inherit; }
.kopf__logo img { height: 2.2rem; width: auto; display: block; }
.kopf__logo span { font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .75;
                   border-left: 1px solid currentColor; padding-left: .7rem; }

.navi { display: none; gap: .2rem; margin-left: auto; }
.navi a { color: var(--kopf-text); text-decoration: none; padding: .45rem .8rem; border-radius: 10px; font-weight: 500; opacity: .85; }
.navi a:hover { background: var(--kopf-hover); opacity: 1; color: var(--kopf-text); }
.navi a[aria-current="page"] { background: #c00000; color: #fff; opacity: 1; }

/* Sprachschalter: breit „DE | EN“, schmal Globus mit Auswahlmenü */
.sprachen { margin-left: auto; position: relative; font-size: .78rem; font-weight: 700; letter-spacing: .04em; }
.sprachen__leiste { display: flex; align-items: center; gap: .1rem; }
.sprachen__leiste a, .sprachen__leiste span { padding: .3rem .45rem; border-radius: 8px; color: var(--kopf-text); text-decoration: none; }
.sprachen__leiste a { opacity: .6; }
.sprachen__leiste a:hover { opacity: 1; background: var(--kopf-hover); color: var(--kopf-text); }
.sprachen__leiste span { background: var(--kopf-markiert); }
.sprachen__menue { display: none; }
.sprachen__menue summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .3rem; padding: .35rem .5rem;
                           border-radius: 10px; color: var(--kopf-text); }
.sprachen__menue summary::-webkit-details-marker { display: none; }
.sprachen__menue summary:hover, .sprachen__menue[open] summary { background: var(--kopf-markiert); }
.sprachen__menue ul { position: absolute; right: 0; top: calc(100% + .45rem); z-index: 60; min-width: 10.5rem; margin: 0; padding: .35rem;
                      list-style: none; background: var(--flaeche); color: var(--text); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
                      font-size: .95rem; font-weight: 500; letter-spacing: 0; }
.sprachen__menue li a, .sprachen__menue li span { display: flex; align-items: center; gap: .6rem; padding: .6rem .7rem; border-radius: 8px;
                                                    color: var(--text); text-decoration: none; }
.sprachen__menue li a:hover { background: rgba(0, 0, 0, .06); color: var(--text); }
.sprachen__menue li b { min-width: 1.6rem; font-size: .75rem; letter-spacing: .05em; opacity: .55; }
.sprachen__menue li span { font-weight: 700; }
.sprachen__menue li i { margin-left: auto; font-style: normal; color: #c00000; }
.sprachen + .avatar { margin-left: .5rem; }
.kopf__logo span { white-space: nowrap; }
/* Schmale Handys: Globus mit Menü statt „DE | EN“, etwas weniger Abstand */
@media (max-width: 30rem) {
  .kopf__innen { gap: .6rem; }
  .sprachen__leiste { display: none; }
  .sprachen__menue { display: block; }
  .sprachen__menue summary > span:not(.nur-vorleser) { display: none; }   /* nur der Globus, Auswahl steht im Menü */
  .kopf__logo { gap: .5rem; }
}
/* Sehr kleine Handys (z. B. 320 px): Schriftzug neben dem Logo weglassen */
@media (max-width: 22.5rem) { .kopf__logo span { display: none; } }

.avatar { margin-left: auto; width: 2.2rem; height: 2.2rem; flex: none; display: grid; place-items: center; border-radius: 50%;
          background: #c00000; color: #fff; font-size: .8rem; font-weight: 700; text-decoration: none; }
.avatar:hover { color: #fff; box-shadow: 0 0 0 3px var(--akzent-zart); }
.avatar[aria-current="page"] { box-shadow: 0 0 0 2px var(--kopf-grund), 0 0 0 4px #c00000; }
@media (min-width: 56rem) { .navi { display: flex; } .avatar { margin-left: .5rem; } .navi + .sprachen { margin-left: .5rem; } }

/* Tab-Leiste unten auf dem Smartphone */
.tabs { position: fixed; inset: auto 0 0 0; z-index: 50; display: flex; background: var(--flaeche); border-top: 1px solid var(--linie);
        padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabs a { flex: 1; display: grid; justify-items: center; gap: .15rem; padding: .55rem .2rem .6rem;
          font-size: .72rem; font-weight: 600; color: var(--leise); text-decoration: none; }
.tabs svg { width: 1.35rem; height: 1.35rem; }
.tabs a[aria-current="page"] { color: var(--akzent); }
@media (min-width: 56rem) { .tabs { display: none; } }

/* 4 Inhalt ---------------------------------------------------------------- */
main { flex: 1; width: 100%; max-width: var(--breite); margin: 0 auto; padding: 1.5rem 1rem 3rem; display: grid; gap: 1.5rem; align-content: start; }
main.schmal { max-width: 28rem; padding-top: 3rem; }

.seitenkopf { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .75rem 1.5rem; }
.seitenkopf p { color: var(--leise); margin-top: .35rem; max-width: 40rem; }
.dach { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--akzent); margin-bottom: .3rem; }

.raster { display: grid; gap: 1.25rem; }
/* Auf dem Smartphone nach oben ziehen, z. B. die Aktionen auf der Dienstseite */
@media (max-width: 55.99rem) { .zuerst-schmal { order: -1; } }
@media (min-width: 56rem) {
  .raster--haupt { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
  .raster--zwei  { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}

/* 5 Boxen ----------------------------------------------------------------- */
.box { background: var(--flaeche); border-radius: var(--radius); box-shadow: var(--schatten); padding: 1.25rem; min-width: 0; }
.box > * + * { margin-top: .9rem; }
.box__kopf { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; }
.box--leer { text-align: center; color: var(--leise); padding: 2rem 1.25rem; }
.box__aktionen { display: flex; flex-wrap: wrap; gap: .6rem; }

.aufzaehlung { margin: 0; padding-left: 1.2rem; display: grid; gap: .4rem; }
.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .3rem .8rem;
              padding: .6rem 0; border-top: 1px solid var(--linie); }
.liste > li:first-child { border-top: 0; padding-top: 0; }
.liste > li:last-child { padding-bottom: 0; }
.box > * + .liste { margin-top: .9rem; }   /* sonst setzt .liste den Abstand in Boxen auf 0 – die Liste klebte an der Kopfzeile */

/* 6 Buttons --------------------------------------------------------------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1.1rem; font: inherit; font-weight: 600; font-size: .95rem; text-decoration: none; white-space: nowrap;
  color: var(--auf-akzent); background: var(--akzent); border: 2px solid var(--akzent); border-radius: 10px; cursor: pointer;
}
.knopf:hover { color: var(--auf-akzent); background: var(--akzent-dunkel); border-color: var(--akzent-dunkel); }
.knopf--leer { color: var(--akzent); background: transparent; }
.knopf--leer:hover { color: var(--akzent); background: var(--akzent-zart); }
.knopf--grau { color: var(--text); background: var(--flaeche-2); border-color: var(--linie); }
.knopf--grau:hover { color: var(--text); background: var(--linie); border-color: var(--linie); }
.knopf--klein { padding: .3rem .7rem; font-size: .85rem; border-width: 1.5px; }
.knopf--breit { width: 100%; }
.link-knopf { padding: 0; font: inherit; font-weight: 600; color: var(--akzent); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: .18em; }
.zeile { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }

/* 7 Formular -------------------------------------------------------------- */
.formular { display: grid; gap: 1rem; }
.feld { display: grid; gap: .3rem; align-content: start; }   /* neben einem Feld mit langem Hinweis nicht in die Höhe ziehen */
.feld > label, .feld > .label { font-weight: 600; font-size: .92rem; }
.feld input:not([type="checkbox"]), .feld select, .feld textarea {
  width: 100%; padding: .65rem .8rem; font: inherit; font-size: 1rem;  /* mind. 16px: kein Auto-Zoom auf dem iPhone */
  color: inherit; background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 10px;
}
.feld input:focus, .feld select:focus, .feld textarea:focus { outline: none; border-color: var(--akzent); box-shadow: 0 0 0 3px var(--akzent-zart); }
.feld [aria-invalid="true"] { border-color: var(--akzent); }
.feld__hinweis { font-size: .85rem; color: var(--leise); }
.feld__fehler { font-size: .88rem; color: var(--akzent); font-weight: 600; }
.feld--suche { flex: 1 1 14rem; }
.englisch { border-top: 1px solid var(--linie); padding-top: .8rem; }
.englisch > summary { font-weight: 600; cursor: pointer; }
.englisch[open] { display: grid; gap: 1rem; }
.reihe { display: grid; gap: 1rem; }
@media (min-width: 36rem) { .reihe { grid-template-columns: 1fr 1fr; } }
.haekchen { display: flex; align-items: center; gap: .55rem; font-weight: 400; cursor: pointer; }
.haekchen input { flex: none; width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--akzent); }   /* flex: none – bei langem, umbrechendem Text nicht schmaler werden */
.feld .haekchen input[type="radio"] { width: 1.15rem; padding: 0; border: 0; border-radius: 50%; background: none; }   /* Optionsknöpfe nicht wie Textfelder */

/* 8 Meldungen ------------------------------------------------------------- */
.meldung { padding: .9rem 1.1rem; background: var(--flaeche); border-left: 5px solid var(--gut); border-radius: var(--radius); box-shadow: var(--schatten); font-weight: 600; }
.meldung--fehler { border-left-color: var(--akzent); }
.meldung--hinweis { border-left-color: var(--warn); }
.meldung ul { margin: .4rem 0 0; padding-left: 1.2rem; font-weight: 400; }
.box > .meldung { box-shadow: none; margin: 1rem 0; }

/* 9 Tabelle --------------------------------------------------------------- */
.tab-huelle { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--leise); font-weight: 700;
     padding: 0 .6rem .55rem; border-bottom: 1px solid var(--linie); white-space: nowrap; }
td { padding: .65rem .6rem; border-bottom: 1px solid var(--linie); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
.r { text-align: right; }
td { overflow-wrap: anywhere; }

/* Spalten, die auf dem Smartphone wegfallen, und ihr Ersatz unter dem Namen */
.nur-breit { display: none; }
@media (min-width: 40rem) { .nur-breit { display: table-cell; } .nur-schmal { display: none; } }

/* 10 Pillen --------------------------------------------------------------- */
.pille { display: inline-flex; align-items: center; font-size: .76rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap;
         background: var(--flaeche-2); color: var(--leise); border: 1px solid var(--linie); }
.pille--akzent { background: var(--akzent-zart); color: var(--akzent); border-color: transparent; }
.pille--gut    { background: var(--gut-zart); color: var(--gut); border-color: transparent; }
.pille--warn   { background: var(--warn-zart); color: var(--warn); border-color: transparent; }

/* 11 Filter-Chips --------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .35rem .85rem; border-radius: 999px; font-size: .9rem; font-weight: 500;
        color: var(--text); background: var(--flaeche); border: 1px solid var(--linie); text-decoration: none; }
.chip:hover { color: var(--text); border-color: var(--akzent); }
.chip[aria-current="true"] { color: var(--grund); background: var(--text); border-color: var(--text); }
.chip .zahl { opacity: .65; }

/* 12 Dienste -------------------------------------------------------------- */
.woche { display: grid; gap: .6rem; }
.woche__kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; padding: .25rem .1rem 0; }
.woche__kopf h2 { font-size: 1rem; }

.dienst { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .7rem; align-items: center;
          padding: .9rem 1rem; background: var(--flaeche); border-radius: var(--radius); box-shadow: var(--schatten);
          border-left: 4px solid transparent; }
.dienst--offen  { border-left-color: var(--akzent); }
.dienst--meins  { border-left-color: var(--gut); }
.dienst--tausch { border-left-color: var(--warn); }
.dienst--entfaellt { opacity: .6; }
.dienst__titel { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; }
.dienst__titel a { font-weight: 700; color: var(--text); text-decoration: none; }
.dienst__titel a:hover { color: var(--akzent); text-decoration: underline; }
.dienst__meta { margin-top: .15rem; font-size: .86rem; color: var(--leise); }
.dienst__aktion { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; }
.dienst__aktion form { margin: 0; }
@media (max-width: 34rem) {
  .dienst { grid-template-columns: 1fr; }
  .dienst__aktion { flex-direction: row; align-items: center; justify-content: space-between; }
}

.plaetze { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.platz { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .6rem .18rem .2rem; font-size: .83rem;
         background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 999px; }
.platz i { display: grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; font-style: normal;
           font-size: .64rem; font-weight: 700; color: #fff; background: #5d6b80; }
.platz--frei   { padding-left: .6rem; color: var(--leise); background: transparent; border-style: dashed; }
.platz--ich    { color: var(--gut); background: var(--gut-zart); border-color: var(--gut); font-weight: 600; }
.platz--ich i  { background: var(--gut); color: var(--grund); }
.platz--tausch { color: var(--warn); background: var(--warn-zart); border-color: var(--warn); }

/* Datumsblock in Listen */
.datum { flex: none; width: 3.1rem; padding: .3rem 0; line-height: 1.1; text-align: center;
         background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 10px; }
.datum b { display: block; font-size: 1.1rem; }
.datum small { font-size: .68rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--leise); }
.liste__text { flex: 1; min-width: 0; }
.liste__text strong { display: block; }
.liste__text span { font-size: .86rem; color: var(--leise); }
.liste > li.mit-datum { flex-wrap: nowrap; justify-content: flex-start; gap: .9rem; }

/* Dienst-Details */
.checkliste { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.checkliste li { display: flex; gap: .55rem; }
.checkliste li::before { content: ""; flex: none; width: 1.05rem; height: 1.05rem; margin-top: .2rem; border: 2px solid var(--gut); border-radius: 5px; }
details.faq { padding: .6rem 0; border-top: 1px solid var(--linie); }
details.faq:first-of-type { border-top: 0; padding-top: 0; }
details.faq summary { font-weight: 600; cursor: pointer; }
details.faq p { margin-top: .4rem; color: var(--leise); }
.abfrage { display: grid; gap: .7rem; padding: .9rem 1rem; background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 10px; }

/* Kennzahlen (Verwaltung) */
.kennzahlen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (min-width: 48rem) { .kennzahlen { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kennzahl { padding: 1rem 1.1rem; background: var(--flaeche); border-radius: var(--radius); box-shadow: var(--schatten); }
.kennzahl strong { display: block; font-size: 1.7rem; line-height: 1.1; letter-spacing: -.02em; }
.kennzahl span { font-size: .85rem; color: var(--leise); }
.kennzahl--akzent strong { color: var(--akzent); }

.zeile-entfaellt td { color: var(--leise); text-decoration: line-through; }
.zeile-entfaellt td:last-child { text-decoration: none; }

/* 13 Stunden -------------------------------------------------------------- */
.konto { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.1rem; align-items: center; }
@media (max-width: 24rem) { .konto { grid-template-columns: 1fr; justify-items: start; } }
.ring { position: relative; width: 7.5rem; height: 7.5rem; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring__text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring__text strong { font-size: 1.6rem; line-height: 1; }
.ring__text span { font-size: .75rem; color: var(--leise); }
.zahlen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-top: .6rem; }
.zahlen--zwei { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
.zahlen div { padding: .5rem .6rem; background: var(--flaeche-2); border-radius: 10px; }
.zahlen strong { display: block; font-size: 1.1rem; }
.zahlen span { font-size: .76rem; color: var(--leise); }

.balken { position: relative; min-width: 6rem; height: .55rem; background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 999px; }
.balken span { display: block; height: 100%; background: var(--gut); border-radius: 999px; }
.balken--warn span { background: var(--warn); }
.balken--akzent span { background: var(--akzent); }
.balken em { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .5; }
th.breit-40 { width: 40%; }

.vorschlaege { display: flex; flex-wrap: wrap; gap: .45rem; }
.vorschlaege a { padding: .3rem .75rem; font-size: .86rem; font-weight: 600; color: var(--gut); text-decoration: none;
                 background: var(--gut-zart); border: 1px dashed var(--gut); border-radius: 999px; }
.vorschlaege a:hover { color: var(--gut); border-style: solid; }
.pruef-notiz { color: var(--warn); font-weight: 600; }
.knopf--gut { color: var(--auf-akzent); background: var(--gut); border-color: var(--gut); }
.knopf--gut:hover { color: var(--auf-akzent); background: var(--gut); border-color: var(--gut); filter: brightness(1.12); }
.zeile--rechts { justify-content: flex-end; flex-wrap: nowrap; gap: .4rem; }
.zeile form { margin: 0; }
tr.summe td { font-weight: 700; border-top: 2px solid var(--linie); }
.box h3 { margin-top: 1.2rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--leise); }
input.auswahl { width: 1.15rem; height: 1.15rem; accent-color: var(--gut); }

/* 14 Infos ---------------------------------------------------------------- */
.beitrag + .beitrag { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--linie); }
.beitrag h2, .beitrag .beitrag__titel { margin: .25rem 0 .5rem; font-size: 1.15rem; text-transform: none; letter-spacing: 0; color: var(--text); }
.fliesstext p + p { margin-top: .7rem; }
.fliesstext a { overflow-wrap: anywhere; }
.dateien { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.datei { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .65rem; font-size: .86rem; font-weight: 600;
         color: var(--text); background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 8px; text-decoration: none; }
.datei:hover { color: var(--akzent); border-color: var(--akzent); }
.datei b, .datei-typ { font-size: .66rem; font-weight: 700; letter-spacing: .04em; color: var(--akzent); }
.datei-typ { flex: none; display: grid; place-items: center; width: 3.1rem; padding: .55rem 0; background: var(--akzent-zart); border-radius: 8px; }
.liste__text .block { display: block; margin-top: .15rem; }
li.geschlossen .datum { background: var(--warn-zart); border-color: var(--warn); }
details.archiv { margin-top: .6rem; }
details.archiv summary { cursor: pointer; font-size: .9rem; color: var(--leise); font-weight: 600; }
details.archiv .liste { margin-top: .6rem; }
.kopierfeld { width: 100%; padding: .55rem .7rem; font: inherit; font-size: .85rem; color: var(--text); background: var(--flaeche-2);
              border: 1px dashed var(--linie); border-radius: 8px; }
.auswahlliste { display: grid; gap: .35rem; max-height: 14rem; overflow-y: auto; padding: .6rem .8rem; background: var(--flaeche-2); border-radius: 10px; }
fieldset.feld { margin: 0; padding: 0; border: 0; min-width: 0; }
.haekchen-reihe { display: flex; flex-wrap: wrap; gap: .45rem 1.2rem; }
.liste > li.amt { display: block; }   /* Zuständigkeiten: Amt, Name, Mailadresse je eine Zeile */
li.amt > * { display: block; }
li.amt > * + * { margin-top: .1rem; }
.amt__mail { overflow-wrap: anywhere; }
tr.markiert td { background: var(--akzent-zart); }

/* Zwei-Faktor */
.schritte-liste { margin: 0; padding-left: 1.3rem; display: grid; gap: 1.1rem; }
.schritte-liste > li > * { margin-top: .6rem; }
.qr-bereich { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.qr-bereich .qr { flex: none; max-width: 100%; height: auto; border: 1px solid var(--linie); border-radius: 8px; }
.qr-bereich > div { flex: 1 1 14rem; display: grid; gap: .4rem; }
.schluessel, .codes code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .95rem; letter-spacing: .05em;
                           padding: .35rem .55rem; background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 6px; overflow-wrap: anywhere; }
.codes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .5rem; }
.code-feld { font-size: 1.3rem !important; letter-spacing: .25em; text-align: center; max-width: 12rem; font-variant-numeric: tabular-nums; }
details.aufklapp { border-top: 1px solid var(--linie); padding-top: .7rem; }
details.aufklapp summary { cursor: pointer; font-weight: 600; font-size: .92rem; }
details.aufklapp .formular { margin-top: .8rem; }
/* Aufklappbereich mitten in einem Formular (z. B. „Angaben für die Webseite“): Felder mit demselben Abstand wie sonst */
.formular > details.aufklapp > * + * { margin-top: 1rem; }
.schmal-form { max-width: 28rem; }

.einstellung { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; }
.einstellung > * + * { margin-top: 0; }
.einstellung .breit { flex-basis: 100%; }
.testseite { padding: .35rem 1rem; font-size: .82rem; font-weight: 600; text-align: center; color: var(--warn); background: var(--warn-zart); }
/* Rollen-Vorschau („Ansicht als …“): gut sichtbar, mit Knopf zum Beenden */
.vorschau { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem 1rem; margin: 0;
            padding: .5rem 1rem; font-size: .88rem; text-align: center; color: var(--text); background: var(--akzent-zart); border-bottom: 2px solid var(--akzent); }

/* 15 Fuß ------------------------------------------------------------------ */
.fuss { padding: 1.5rem 1rem 2rem; text-align: center; font-size: .85rem; color: var(--leise); }
.fuss p { margin: 0; }
.fuss .fuss__links { margin-top: .35rem; font-size: .8rem; }   /* Impressum und Datenschutz stehen auf der Webseite */
.fuss__links a { white-space: nowrap; }   /* auf schmalen Handys bricht höchstens zwischen den Links um, nie mitten in „Problem melden“ */

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Hilfe-Seite (Anleitung aus doku/Anleitung-Eltern*.md) */
.anleitung { line-height: 1.6; }
.anleitung > :first-child { margin-top: 0; }
.anleitung h2 { margin: 2rem 0 .7rem; font-size: 1.3rem; scroll-margin-top: calc(var(--kopf) + 1rem); }
.anleitung h3 { margin: 1.4rem 0 .5rem; font-size: 1.05rem; scroll-margin-top: calc(var(--kopf) + 1rem); }
.anleitung p, .anleitung ul, .anleitung ol, .anleitung .tab-huelle, .anleitung blockquote { margin: 0 0 .9rem; }
.anleitung ul, .anleitung ol { padding-left: 1.3rem; }
.anleitung li + li { margin-top: .3rem; }
.anleitung hr { border: 0; border-top: 1px solid var(--linie); margin: 1.6rem 0; }
.anleitung th { white-space: normal; vertical-align: bottom; }
.anleitung td { vertical-align: top; }
.anleitung code { padding: .1rem .35rem; background: var(--flaeche-2); border-radius: 5px; font-size: .9em; }
.anleitung blockquote { padding: .6rem 1rem; background: var(--flaeche-2); border-left: 4px solid var(--akzent); border-radius: 8px; }
.anleitung a { overflow-wrap: anywhere; }
.hilfe__inhalt ol { margin: .6rem 0 0; padding-left: 1.3rem; line-height: 1.7; }
@media (min-width: 56rem) { .hilfe__inhalt { position: sticky; top: calc(var(--kopf) + 1rem); } }
/* Vorschau der Wochenmail (wochenueberblick.php) */
.mailvorschau { white-space: pre-wrap; font: inherit; font-size: .9rem; background: var(--flaeche-2); border-radius: .5rem; padding: 1rem; margin: 0; overflow-wrap: anywhere; }
/* Skript zum Kopieren (hintergrund.php): Schreibmaschinenschrift, Zeilen bleiben, wie sie sind */
.code-kopie { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: .8rem; white-space: pre; overflow-x: auto; resize: vertical; }

/* Passwort der Sicherung (sicherung.php): groß und gut abschreibbar */
.sicherung-passwort { font-family: Consolas, 'Courier New', monospace; font-size: 1.25rem; letter-spacing: .05em; }

/* Einstellungen (einstellungen.php) */
.feld--kurz { max-width: 9rem; }
.einstellungen .box + .box { margin-top: 0; }
.einstellungen__speichern { margin-top: 1rem; }

/* Auswertung (auswertung.php): eine Datenfarbe, zurückhaltendes Raster, Texte in Textfarben */
.diagramm-huelle { overflow-x: auto; margin: .5rem 0 .25rem; }
.diagramm { display: block; width: 100%; min-width: 40rem; height: auto; }
.diagramm__saeule { fill: var(--daten); }
.diagramm__treffer { fill: transparent; }
.diagramm__treffer:hover { fill: var(--daten-zart); fill-opacity: .5; }
.diagramm__raster { stroke: var(--linie); stroke-width: 1; }
.diagramm__grundlinie { stroke: var(--leise); stroke-width: 1; }
.diagramm__achse { fill: var(--leise); font-size: 14px; font-family: var(--schrift); }
.diagramm__wert { fill: var(--text); font-size: 15px; font-weight: 600; font-family: var(--schrift); }
.anteil { height: .6rem; min-width: 4rem; background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 999px; overflow: hidden; }
.anteil span { display: block; height: 100%; background: var(--daten); border-radius: 0 4px 4px 0; }
.auswertung-tabelle { width: 100%; }
.auswertung-tabelle td { vertical-align: middle; }
.auswertung-tabelle .breit { width: 45%; }
@media (forced-colors: active) { .diagramm__saeule, .anteil span { fill: CanvasText; background: CanvasText; } }

/* Jahreswechsel-Checkliste (jahreswechsel.php) */
.jahreswechsel__liste { list-style: none; padding: 0; margin: 0; }
.jahreswechsel__schritt { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; padding: .9rem 0; border-top: 1px solid var(--linie); }
.jahreswechsel__schritt:first-child { border-top: 0; }
.jahreswechsel__text { flex: 1; min-width: 0; }
.jahreswechsel__text p { margin: .25rem 0 0; }
.jahreswechsel__schritt--erledigt .jahreswechsel__text > strong { color: var(--leise); }
.jahreswechsel__schritt--erledigt .jahreswechsel__text > strong::before { content: "✓ "; color: var(--gut); }

/* Wochenpost: Hinweis auf der Startseite (index.php) und Auswahl im Profil */
.wochenpost-hinweis { display: grid; gap: .6rem; font-weight: 400; }
.wochenpost-hinweis form { margin: 0; }
#wochenpost .haekchen { align-items: flex-start; }
#wochenpost .haekchen input { margin-top: .2rem; }
#wochenpost fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: .55rem; }

/* Dienstplan zum Ausdrucken (dienstplan.php): ein Blatt für die Pinnwand */
.plan-steuerung > .zeile:first-child { justify-content: space-between; }
.plan { display: grid; gap: 1.1rem; }
.plan, .plan__abschnitt { grid-template-columns: minmax(0, 1fr); }   /* breite Tabellen scrollen in sich, statt die Seite zu verbreitern */
.box.plan > * + * { margin-top: 0; }
.plan__kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .8rem 1.5rem; padding-bottom: .7rem; border-bottom: 2px solid var(--text); }
.plan__kopf > div:first-child { flex: 1 1 18rem; min-width: 0; }
.plan__eintragen { flex: 0 1 18rem; display: flex; align-items: center; gap: .7rem; font-size: .85rem; }
.plan__eintragen .qr { flex: none; }
.plan__eintragen span { display: block; color: var(--leise); }
.plan__dach { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--leise); }
.plan__titel { font-size: 1.7rem; margin-top: .15rem; }
.plan__unter { font-size: .9rem; color: var(--leise); }
.plan__geschlossen { padding: .5rem .8rem; border: 1px solid var(--warn); border-radius: 8px; background: var(--warn-zart); }
.plan__abschnitt { display: grid; gap: .45rem; }
.box .plan__abschnitt h3 { margin-top: 0; font-size: .85rem; color: var(--text); }
.plan__abschnitt h3 span { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--leise); }
.plan__tabelle { table-layout: fixed; min-width: 32rem; font-size: .9rem; }
.plan__tabelle--wochen { min-width: 38rem; }
.plan__tabelle tr th, .plan__tabelle tr td { padding: .45rem .55rem; border: 1px solid var(--linie); vertical-align: top; overflow-wrap: break-word; }
.plan__tabelle tr th { font-size: .9rem; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--text); white-space: normal; }
.plan__tabelle thead th { font-size: .82rem; background: var(--flaeche-2); }
.plan__tabelle th span { display: block; font-size: .78rem; font-weight: 400; color: var(--leise); }
.plan__tabelle th:first-child { width: 11rem; }
.plan__tabelle--liste th:first-child { width: 9.5rem; }
.plan__tabelle--liste th:last-child { width: 38%; }
.plan__belegung { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.plan__frei { color: var(--akzent); font-weight: 600; }
.plan__ersatz { color: var(--warn); font-weight: 600; }
.plan__entfaellt { color: var(--leise); font-style: italic; }
.plan__notiz { display: block; margin-top: .2rem; font-size: .78rem; color: var(--leise); }
.plan__leer { padding: 1.5rem 0; text-align: center; color: var(--leise); }
.plan__fuss { padding-top: .5rem; border-top: 1px solid var(--linie); font-size: .8rem; color: var(--leise); }

/* Druck: nur der Inhalt, auf weißem Papier – auch wenn das Gerät dunkel eingestellt ist */
@media print {
  :root, :root:not([data-design]), :root[data-design] {   /* Ausdruck immer hell, auch bei Darstellung „Dunkel“ */
    --text: #000; --leise: #4a4a4a; --linie: #9a9a9a; --grund: #fff; --flaeche: #fff; --flaeche-2: #f1f1f1;
    --akzent: #c00000; --warn: #8a5600; --warn-zart: #fff; --gut: #1f7a45; --gut-zart: #fff;
    color-scheme: light;
  }
  @page { margin: 12mm; }
  body, body.mit-tabs { display: block; min-height: 0; padding: 0; color: var(--text); background: #fff; }
  .kopf, .tabs, .fuss, .sprunglink, .nicht-drucken, main > .meldung { display: none !important; }
  main { display: block; max-width: none; padding: 0; }
  .box { padding: 0; background: none; border-radius: 0; box-shadow: none; }
  a { color: inherit; text-decoration: none; }
  .tab-huelle { overflow: visible; }
  .testseite { margin-bottom: .5rem; border: 1px solid var(--warn); }
  .plan { gap: .8rem; }
  .plan__tabelle { font-size: .85rem; }
  .plan__tabelle tr th, .plan__tabelle tr td { padding: .25rem .45rem; }
  .plan__eintragen .qr { width: 23mm; height: 23mm; }
  .plan__tabelle, .plan__tabelle--wochen { min-width: 0; }
  .plan__tabelle thead { display: table-header-group; }   /* Kopfzeile auf jeder Seite wiederholen */
  .plan__tabelle tr, .plan__kopf, .plan__fuss, .plan__geschlossen { break-inside: avoid; }
  .plan__abschnitt h3 { break-after: avoid; }
}
