:root {
  /* Sommerabend: Abendblau + Lampion-Gelb */
  --hg: #f3f4f8; --karte: #ffffff; --text: #1c2541; --grau: #687089; --linie: #e2e5ee;
  --akzent: #2d4ba0; --akzent2: #e9edf8; --haupt: #1c2541; --haupt-text: #ffffff;
  --nacht: #1c2541; --lampion: #f4b942; --lampion-hg: #fff3d6;
  --gruen: #23875a; --gruen-hg: #e3f4ec; --gelb: #a8710c; --gelb-hg: #fff3d6;
  --rot: #c8343a; --rot-hg: #fde8e8; --schatten: none;
  --titel: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", -apple-system, "Segoe UI", sans-serif;
  --nav-h: 62px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --hg: #0e1322; --karte: #161d32; --text: #e8ebf4; --grau: #99a2bd; --linie: #26304f;
    --akzent: #9fb4ff; --akzent2: #1f2947; --haupt: #f4b942; --haupt-text: #1c2541;
    --nacht: #1f2a4c; --lampion: #f4b942; --lampion-hg: #3a3015;
    --gruen: #5fd39b; --gruen-hg: #16332a; --gelb: #f4c35c; --gelb-hg: #3a3015;
    --rot: #ff8a8f; --rot-hg: #3d1d24; --schatten: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--hg); color: var(--text); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px); }
body.dlg-offen { overflow: hidden; }
a { color: var(--akzent); text-decoration: none; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-family: var(--titel); font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; margin-top: 1em; }
small { font-size: .82rem; }
code { background: var(--akzent2); padding: 1px 5px; border-radius: 4px; font-size: .85em; }
.umbruch { word-break: break-all; }
.grau { color: var(--grau); } .gruen { color: var(--gruen); } .gelb { color: var(--gelb); } .rot { color: var(--rot); }
.mitte { text-align: center; }

#kopf { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: var(--karte); border-bottom: 1px solid var(--linie); }
#kopf .logo { font-family: var(--titel); font-weight: 800; font-size: 1.15rem; color: var(--text); white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; letter-spacing: -.01em; }
.logo-punkt { width: 11px; height: 11px; border-radius: 50%; background: var(--lampion); box-shadow: 0 0 0 3px var(--lampion-hg); }
#kopf-titel { color: var(--grau); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { max-width: 760px; margin: 0 auto; padding: 14px 16px; }
.laden { color: var(--grau); text-align: center; padding: 40px 0; }

#nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: var(--karte); border-top: 1px solid var(--linie);
  padding-bottom: env(safe-area-inset-bottom); }
#nav[hidden] { display: none; }
#nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; height: var(--nav-h); font-size: .72rem; color: var(--grau); position: relative; }
#nav a svg { width: 24px; height: 24px; margin-bottom: 3px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#nav a.aktiv { color: var(--text); font-weight: 650; }
#nav a.aktiv::after { content: ""; position: absolute; top: 0; left: 50%; width: 28px; height: 3px; margin-left: -14px; border-radius: 0 0 3px 3px; background: var(--lampion); }
#nav b { position: absolute; top: 6px; left: calc(50% + 8px); background: var(--rot); color: #fff; border-radius: 10px; font-size: .7rem; padding: 0 6px; min-width: 18px; text-align: center; }

.karte { display: block; background: var(--karte); border-radius: 14px; padding: 14px 16px; margin: 0 0 12px; box-shadow: var(--schatten); border: 1px solid var(--linie); color: var(--text); }
.fehlerkarte { border-color: var(--rot); color: var(--rot); }
.leer { text-align: center; padding: 30px 16px; }
.hinweis { display: block; background: var(--gelb-hg); color: var(--text); border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; }
.hinweis.gut { background: var(--gruen-hg); }
.hinweis-eingang { background: var(--akzent2); font-size: 1.05rem; }

button, .knopf { font: inherit; border: 1px solid var(--linie); background: var(--karte); color: var(--text); border-radius: 10px; padding: 9px 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; text-align: center; }
button:disabled { opacity: .55; cursor: default; }
.haupt { background: var(--haupt); border-color: var(--haupt); color: var(--haupt-text); font-weight: 650; }
button:focus-visible, .knopf:focus-visible, a:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.breit { width: 100%; margin-top: 8px; }
.link { background: none; border: none; color: var(--akzent); padding: 4px 6px; min-height: 0; }
.link.rot, button.rot { color: var(--rot); }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; align-items: center; }
.knoepfe { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.knoepfe .link.rot:first-child { margin-right: auto; }
.hilfe { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--linie); align-items: center; justify-content: center; font-size: .85rem; color: var(--grau); flex-shrink: 0; }
.kopfzeile { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.kopfzeile h2 { margin: 0; margin-right: auto; }
.kopfzeile .zurueck { margin-right: auto; font-weight: 600; }

/* Formular */
.feld { display: block; margin: 0 0 12px; }
.feld > span { display: block; font-size: .85rem; color: var(--grau); margin-bottom: 4px; }
.feld small { display: block; color: var(--grau); margin-top: 3px; }
input, select, textarea { font: inherit; width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--linie); background: var(--karte); color: var(--text); min-height: 44px; }
textarea { resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--akzent); outline-offset: -1px; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--akzent); }
input[type=search] { margin-bottom: 10px; }
.zeile2 { display: flex; gap: 10px; align-items: flex-start; }
.zeile2 > * { flex: 1; min-width: 0; }
.zeile2 > .schmal, .feld.schmal { flex: 0 0 100px; }
input.schmal { width: 90px; }
.schalter { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.schalter input { margin-top: 4px; width: 20px; height: 20px; flex-shrink: 0; }
.schalter small { display: block; color: var(--grau); }
details { margin: 10px 0; }
summary { cursor: pointer; color: var(--akzent); padding: 6px 0; }
pre.beispiel { background: var(--hg); border: 1px solid var(--linie); border-radius: 8px; padding: 8px; font-size: .78rem; white-space: pre-wrap; }

.art-wahl, .status-wahl { display: flex; gap: 6px; margin: 0 0 12px; flex-wrap: wrap; }
.art-wahl label, .status-wahl label { flex: 1; min-width: 90px; }
.art-wahl input, .status-wahl input { position: absolute; opacity: 0; pointer-events: none; }
.art-wahl span, .status-wahl span { display: block; text-align: center; padding: 10px 6px; border: 1px solid var(--linie); border-radius: 10px; cursor: pointer; font-size: .92rem; }
.art-wahl input:checked + span { border-color: var(--akzent); background: var(--akzent2); font-weight: 600; }
.status-wahl .s-zusage input:checked + span { background: var(--gruen-hg); border-color: var(--gruen); font-weight: 600; }
.status-wahl .s-absage input:checked + span { background: var(--rot-hg); border-color: var(--rot); font-weight: 600; }
.status-wahl .s-vielleicht input:checked + span, .status-wahl .s-offen input:checked + span { background: var(--gelb-hg); border-color: var(--gelb); font-weight: 600; }

.zaehler { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.zaehler span { flex: 1; }
.zaehler button { width: 44px; padding: 0; font-size: 1.3rem; }
.zaehler input { width: 64px; text-align: center; }

/* Übersicht */
.fest-kopf { display: block; color: var(--text); }
.fest-kopf h2 { margin-bottom: 2px; }
.fest-kopf p { margin: 0 0 12px; color: var(--grau); }
.bis { color: var(--akzent); margin-left: 6px; }
.kacheln { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kachel { background: var(--hg); border-radius: 12px; padding: 10px 6px; text-align: center; color: var(--text); border: 1px solid var(--linie); }
.kachel b { display: block; font-size: 1.6rem; line-height: 1.1; }
.kachel span { display: block; font-size: .8rem; font-weight: 600; }
.kachel small { display: block; color: var(--grau); font-size: .7rem; }
.kachel.gruen { background: var(--gruen-hg); } .kachel.gelb { background: var(--gelb-hg); } .kachel.rot { background: var(--rot-hg); }
@media (max-width: 380px) { .kacheln { grid-template-columns: repeat(2, 1fr); } }
.mehr { float: right; font-size: .85rem; font-weight: 400; }

.fest-titel h2 { margin-bottom: 2px; }
.fest-titel p { margin: 0 0 6px; color: var(--grau); font-size: .9rem; }
.zahlenzeile { display: flex; gap: 12px; flex-wrap: wrap; font-weight: 600; }
.fest-zeile { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.fest-zeile.archiv { opacity: .65; }
.mini { display: flex; gap: 8px; font-size: .85rem; font-weight: 600; white-space: nowrap; }

.tabs { display: flex; gap: 4px; overflow-x: auto; margin: 10px 0 12px; border-bottom: 1px solid var(--linie); scrollbar-width: none; }
.tabs a, .tabs button { padding: 8px 12px; color: var(--grau); white-space: nowrap; border: none; border-bottom: 3px solid transparent; border-radius: 0; background: none; min-height: 0; }
.tabs .aktiv { color: var(--akzent); border-bottom-color: var(--akzent); font-weight: 600; }
.tabs.klein { margin-top: 0; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.chips button { min-height: 32px; padding: 4px 11px; border-radius: 16px; font-size: .88rem; }
.chips button.aktiv { background: var(--akzent); color: #fff; border-color: var(--akzent); }
.chips small { opacity: .75; }

.liste { list-style: none; padding: 0; margin: 0; }
.liste li { display: flex; gap: 10px; align-items: center; padding: 11px 4px; border-bottom: 1px solid var(--linie); cursor: pointer; }
.liste li:last-child { border-bottom: none; }
.liste li.inaktiv { opacity: .5; }
.liste .st { font-size: 1.15rem; width: 26px; text-align: center; flex-shrink: 0; }
.li-haupt { flex: 1; min-width: 0; }
.li-haupt small { display: block; color: var(--grau); overflow: hidden; text-overflow: ellipsis; }
.li-haupt small.bringt { color: var(--text); white-space: normal; }
.li-rechts { flex-shrink: 0; display: flex; gap: 4px; align-items: center; }
#liste, .liste.eingang { background: var(--karte); border-radius: 14px; border: 1px solid var(--linie); padding: 0 10px; }
.einfach { padding-left: 18px; margin: 6px 0; }
.einfach li { margin: 4px 0; }
.verlauf { list-style: none; padding: 0; margin: 0; }
.verlauf li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--linie); cursor: pointer; }
.verlauf li:last-child { border: none; }
.verlauf.klein li { cursor: default; font-size: .9rem; }
.verlauf small { color: var(--grau); }
.zeile-link { display: flex; gap: 12px; align-items: center; padding: 11px 2px; border-bottom: 1px solid var(--linie); color: var(--text); }
.zeile-link:last-child { border-bottom: none; }
.zeile-link > span { font-size: 1.3rem; width: 30px; text-align: center; }
.zeile-link small { display: block; color: var(--grau); }
.marke { background: var(--akzent2); color: var(--akzent); border-radius: 6px; padding: 0 6px; }

.balken { height: 8px; background: var(--linie); border-radius: 4px; overflow: hidden; margin: 4px 0; }
.balken i { display: block; height: 100%; background: var(--akzent); border-radius: 4px; }
.balken.voll i { background: var(--gruen); }
.balken.gelb i { background: var(--gelb); } .balken.rot i { background: var(--rot); }

/* Dialog */
.dlg-hg { position: fixed; inset: 0; background: rgba(20, 10, 5, .45); z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.dlg { background: var(--karte); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); position: relative; -webkit-overflow-scrolling: touch; }
.dlg.breit { max-width: 720px; }
@media (min-width: 700px) { .dlg-hg { align-items: center; } .dlg { border-radius: 18px; } }
.dlg h2 { padding-right: 36px; }
.dlg-zu { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: 50%; }
.frage { font-size: 1.05rem; margin: 10px 0 0; padding-right: 30px; }
.auswahl { list-style: none; padding: 0; margin: 8px 0; max-height: 50vh; overflow-y: auto; border: 1px solid var(--linie); border-radius: 10px; }
.auswahl li { border-bottom: 1px solid var(--linie); }
.auswahl li:last-child { border: none; }
.auswahl label { display: flex; gap: 10px; align-items: center; padding: 9px 10px; cursor: pointer; }
.auswahl input { width: 20px; height: 20px; }
.auswahl small { color: var(--grau); }
.nachricht { white-space: pre-wrap; background: var(--hg); border: 1px solid var(--linie); border-radius: 10px; padding: 10px; max-height: 240px; overflow-y: auto; font-size: .92rem; }
.ki-zus { background: var(--akzent2); border-radius: 10px; padding: 8px 10px; }
.mb-zeile { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.mb-zeile select { flex: 1 1 140px; } .mb-zeile input[name=mb_titel] { flex: 1 1 140px; } .mb-zeile input.schmal { width: 64px; flex: 0 0 64px; }
.mini-check { display: flex; gap: 4px; align-items: center; font-size: .82rem; }
.mb-neu { margin: 6px 0; } .mb-neu button { flex: 0 0 auto; }
iframe.vorschau { width: 100%; height: 55vh; border: 1px solid var(--linie); border-radius: 10px; background: #fff; }

.tabelle { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { color: var(--grau); font-weight: 600; }
tr.rot td { color: var(--rot); }
.gross { text-align: right; } .gross b { display: block; font-size: 1.6rem; } .gross small { color: var(--grau); }
.tagbalken { display: flex; gap: 3px; align-items: flex-end; height: 120px; }
.tagbalken div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.tagbalken i { display: block; width: 100%; background: var(--akzent); border-radius: 3px 3px 0 0; }
.tagbalken small { font-size: .62rem; color: var(--grau); }

.anleitung p, .anleitung li { line-height: 1.55; }
.anleitung.markiert { outline: 2px solid var(--akzent); }
.inhalt { columns: 2; padding-left: 18px; }
@media (max-width: 500px) { .inhalt { columns: 1; } }

.anmelden { max-width: 380px; margin: 40px auto; text-align: center; }
.anmelden form { text-align: left; }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px); background: #2b2622; color: #fff;
  padding: 10px 16px; border-radius: 10px; z-index: 200; max-width: 92vw; box-shadow: 0 4px 14px rgba(0,0,0,.25); white-space: pre-line; }
#toast.fehler { background: var(--rot); }

/* 1.1.0: Einkauf, Import, Druck */
.chip { display: inline-block; background: var(--akzent2); border-radius: 14px; padding: 3px 10px; font-size: .88rem; }
.gross-zeile { font-size: 1.1rem; margin: 4px 0; }
.liste .mini-check { flex-shrink: 0; }
.liste .mini-check input { width: 20px; height: 20px; }
b.text { color: var(--text); }
table.zuordnung td { vertical-align: middle; }
table.zuordnung select { min-width: 150px; }
body.druck #kopf, body.druck #nav { display: none; }
body.druck { padding-bottom: 20px; background: #fff; color: #111; }
.druckseite { background: #fff; color: #111; padding: 4px; }
.druckseite h2 { font-size: 1.1rem; margin-top: 14px; }
.druck-leiste { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.druck-titel { font-size: 1.5rem; margin: 0; }
.druck-unter { margin: 2px 0 10px; color: #555; }
.druck-tab { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: .92rem; }
.druck-tab th, .druck-tab td { border-bottom: 1px solid #ccc; padding: 6px 6px; text-align: left; vertical-align: top; color: #111; }
.druck-tab .kaestchen { width: 24px; font-size: 1.2rem; }
.druck-tab .zahl { white-space: nowrap; }
.druck-klein { font-size: .9rem; }
@media print {
  .druck-leiste, #toast { display: none !important; }
  main { max-width: none; padding: 0; }
  .druck-tab tr { break-inside: avoid; }
  @page { margin: 14mm; }
}


/* ───── Sommerabend: Blickfang Fest-Karte mit Lichterkette ───── */
.lichterkette, .fest-karte { position: relative; }
.fest-karte { background: var(--nacht); border: none; color: #fff; padding: 34px 18px 18px; overflow: hidden; }
.fest-karte::before, .lichterkette::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 26px; background-repeat: repeat-x; background-size: 120px 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='26'%3E%3Cpath d='M0 3 Q30 19 60 3 T120 3' fill='none' stroke='rgba(255,255,255,0.35)' stroke-width='1.2'/%3E%3Cg%3E%3Cline x1='15' y1='10.5' x2='15' y2='14' stroke='rgba(255,255,255,0.35)'/%3E%3Ccircle cx='15' cy='17' r='4' fill='%23F4B942'/%3E%3Cline x1='45' y1='10.5' x2='45' y2='14' stroke='rgba(255,255,255,0.35)'/%3E%3Ccircle cx='45' cy='17' r='4' fill='%23FF8A7A'/%3E%3Cline x1='75' y1='10.5' x2='75' y2='14' stroke='rgba(255,255,255,0.35)'/%3E%3Ccircle cx='75' cy='17' r='4' fill='%236FD3B0'/%3E%3Cline x1='105' y1='10.5' x2='105' y2='14' stroke='rgba(255,255,255,0.35)'/%3E%3Ccircle cx='105' cy='17' r='4' fill='%239FB8FF'/%3E%3C/g%3E%3C/svg%3E"); }
.fest-karte .fest-kopf { color: #fff; }
.fest-karte .fest-kopf h2 { font-size: 1.75rem; margin-bottom: 4px; }
.fest-karte .fest-kopf p { color: rgba(255,255,255,.72); }
.fest-karte .bis { color: var(--lampion); font-weight: 700; }
.fest-karte .kachel { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); color: #fff; border-top: 3px solid rgba(255,255,255,.3); }
.fest-karte .kachel small { color: rgba(255,255,255,.62); }
.fest-karte .kachel.gruen { background: rgba(255,255,255,.07); border-top-color: #5fd39b; }
.fest-karte .kachel.gelb { background: rgba(255,255,255,.07); border-top-color: var(--lampion); }
.fest-karte .kachel.rot { background: rgba(255,255,255,.07); border-top-color: #ff8a8f; }
.fest-karte .kachel b { font-family: var(--titel); font-size: 1.9rem; }
.fest-karte button { background: transparent; border-color: rgba(255,255,255,.28); color: #fff; }
.fest-karte button.haupt { background: var(--lampion); border-color: var(--lampion); color: #1c2541; }
.kachel b { font-family: var(--titel); }

/* ruhigere Flächen */
.hinweis-eingang { background: var(--lampion-hg); border-color: transparent; }
.chips button.aktiv { background: var(--haupt); color: var(--haupt-text); border-color: var(--haupt); }
.tabs .aktiv { color: var(--text); border-bottom-color: var(--lampion); }
.balken i { background: var(--akzent); }
.art-wahl input:checked + span { border-color: var(--haupt); background: var(--akzent2); }
.marke { background: var(--lampion-hg); color: var(--gelb); }
.chip { background: var(--akzent2); }
code { background: var(--akzent2); }
.fest-titel h2 { font-size: 1.5rem; }
#liste, .liste.eingang { border-color: var(--linie); }
