@font-face { font-family: 'Lato'; src: url('fonts/Lato-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Lato'; src: url('fonts/Lato-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --text: #222;
  --leise: #6d6d6d;
  --linie: #e2e2df;
  --grund: #ffffff;
  --kachel: #ececea;
  --kachel-hover: #e2e2df;
  --cup: #00c88c;
  --weihnacht: #c8102e;
  --akzent: #222;
  --frei: #00c88c;
  --frei-hell: #e3f8f1;
  --fehler: #c0392b;
  --radius: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--grund); }
body { font-family: 'Lato', Arial, sans-serif; font-size: 16px; line-height: 1.5; color: var(--text); -webkit-text-size-adjust: 100%; }
.app { max-width: 880px; margin: 0 auto; padding: 16px 16px 40px; }
.laden { padding: 40px 0; text-align: center; color: var(--leise); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 .8em; }
button { font-family: inherit; }

/* Kacheln */
.kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.kachel { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 150px; padding: 18px;
  align-items: center; border: 0; border-radius: var(--radius); background: var(--kachel); color: var(--text); text-align: center; cursor: pointer;
  transition: background .15s, transform .15s; }
.kachel:hover, .kachel:focus-visible { background: var(--kachel-hover); transform: translateY(-2px); }
.kachel:focus-visible { outline: 3px solid #999; outline-offset: 2px; }
.kachel strong { font-size: 1.2rem; display: block; margin-bottom: 4px; }
.kachel small { color: var(--leise); font-size: .85rem; white-space: pre-line; }
.kachel.cup { background: var(--cup); color: #fff; animation: puls 2.2s ease-in-out infinite; }
.kachel.cup small { color: rgba(255,255,255,.9); }
@keyframes puls { 0%, 100% { box-shadow: 0 0 0 0 rgba(0,200,140,.55); } 50% { box-shadow: 0 0 0 12px rgba(0,200,140,0); } }
.kachel.weihnacht { background: var(--weihnacht); color: #fff; animation: puls-rot 2.2s ease-in-out infinite; }
.kachel.weihnacht small { color: rgba(255,255,255,.92); }
.kachel.cup:hover, .kachel.cup:focus-visible { background: #00b37d; }
.kachel.weihnacht:hover, .kachel.weihnacht:focus-visible { background: #b00d27; }
@keyframes puls-rot { 0%, 100% { box-shadow: 0 0 0 0 rgba(200,16,46,.5); } 50% { box-shadow: 0 0 0 12px rgba(200,16,46,0); } }
@media (prefers-reduced-motion: reduce) { .kachel.cup, .kachel.weihnacht { animation: none; } }

.kopfzeile { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.zurueck { border: 0; background: none; color: var(--leise); font-size: .95rem; cursor: pointer; padding: 6px 0; }
.zurueck:hover { color: var(--text); }
.schritte { display: flex; gap: 6px; margin: 0 0 18px; }
.schritte span { flex: 1; height: 4px; border-radius: 2px; background: var(--linie); }
.schritte span.an { background: var(--text); }

/* Kalender */
.monatsleiste { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 10px; }
.monatsleiste button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--linie); background: #fff; font-size: 1.2rem; cursor: pointer; }
.monatsleiste button:disabled { opacity: .3; cursor: default; }
.kalender { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.wt { display: flex; justify-content: center; align-items: center; text-align: center; font-size: .78rem; font-weight: 700; color: var(--leise); }
.tag { aspect-ratio: 1 / 1; width: 100%; max-width: 64px; justify-self: center; border-radius: 10px; border: 1px solid var(--linie); background: #f7f7f5; color: #b8b8b4;
  font-size: .95rem; display: grid; place-items: center; cursor: default; padding: 0; }
.tag.leer { border: 0; background: none; }
.tag.frei { background: var(--frei-hell); border-color: var(--frei); color: var(--text); font-weight: 700; cursor: pointer; }
.tag.frei:hover { background: var(--frei); color: #fff; }
.tag.ausserhalb { background: #fff; color: #9a9a96; border-style: dashed; cursor: pointer; transition: background .15s, color .15s; }
.tag.ausserhalb:hover, .tag.ausserhalb:focus-visible { background: #c9c9c5; border-color: #a8a8a4; color: #333; }
.tag.voll { text-decoration: line-through; }
.tag.frei.unpassend { background: #fff; border-color: #cfcfcb; font-weight: 400; }
.tag.frei.passend { box-shadow: inset 0 0 0 2px var(--frei); }
.tag.gewaehlt { background: var(--text) !important; color: #fff !important; border-color: var(--text) !important; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; color: var(--leise); margin: 10px 0 0; }
.legende i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; border: 1px solid var(--linie); }
.legende .l-frei { background: var(--frei-hell); border-color: var(--frei); }
.legende .l-andere { background: #fff; border-color: #cfcfcb; }
.legende .l-nein { background: #f7f7f5; }

.zeiten { margin-top: 20px; }
.zeitliste { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.zeit { padding: 10px 6px; border-radius: 8px; border: 1px solid var(--frei); background: var(--frei-hell); font-weight: 700; font-size: .95rem; cursor: pointer; }
.zeit:hover { background: var(--frei); color: #fff; }
.zeit:disabled { border-color: var(--linie); background: #f7f7f5; color: #b8b8b4; text-decoration: line-through; cursor: default; font-weight: 400; }
.zeit small { display: block; font-weight: 400; font-size: .72rem; }
.anpassen-hinweis { margin: 0 0 10px; font-size: .92rem; }
.zeitliste.anpassen .zeit:not(:disabled) { border-color: #cfcfcb; background: #fff; }
.zeitliste.anpassen .zeit:not(:disabled):hover { background: #ececea; color: inherit; }
.zeitliste.anpassen .zeit.passend { border: 3px solid var(--frei); background: var(--frei-hell); padding: 8px 4px; }
.zeitliste.anpassen .zeit.passend:hover { background: var(--frei); color: #fff; }

/* Cup-Termine */
.cupliste { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cuptermin { text-align: left; border: 2px solid var(--cup); border-radius: var(--radius); background: #fff; padding: 16px; cursor: pointer; }
.cuptermin:hover { background: var(--frei-hell); }
.cuptermin strong { display: block; font-size: 1.05rem; }
.cuptermin .wann { font-size: 1.15rem; margin: 4px 0 8px; white-space: pre-line; }
.plaetze { display: inline-block; padding: 3px 10px; border-radius: 99px; background: var(--cup); color: #fff; font-size: .85rem; font-weight: 700; }
.plaetze.wenig { background: #e8902c; }
.cuptermin:disabled { border-color: var(--linie); cursor: default; background: #f7f7f5; color: #999; }
.cuptermin:disabled .plaetze { background: #bbb; }
.cuptermin.warteliste { border-style: dashed; background: var(--frei-hell); }
.cuptermin.warteliste .wann { font-size: .98rem; }
label.feld input.fehlt, label.feld input.fehlt[required] { border-color: var(--fehler); }

/* Formular */
.formular { display: grid; gap: 14px; }
.formular.gesperrt .sperrbar { opacity: .35; pointer-events: none; filter: grayscale(1); }
.feldgruppe { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.formular h3 { margin: 12px 0 0; font-size: 1.05rem; }
label.feld { display: block; font-size: .88rem; font-weight: 700; }
label.feld input, label.feld select, label.feld textarea {
  display: block; width: 100%; margin-top: 4px; padding: 11px 12px; font: inherit; font-weight: 400; color: var(--text);
  border: 1px solid #cfcfcb; border-radius: 8px; background: #fff; }
label.feld textarea { min-height: 96px; resize: vertical; }
label.feld textarea.teamname { min-height: 0; height: 44px; resize: none; overflow: hidden; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; }
label.feld textarea.teamname.zweizeilig { padding-top: 2px; padding-bottom: 2px; line-height: 1.15; }
/* Pflichtfelder: grüner Rahmen statt Sternchen; fehlende Angaben rot */
label.feld input[required], label.feld select[required], label.feld textarea[required] { border: 2px solid var(--cup); padding: 10px 11px; }
.haken input[required] { outline: 2px solid var(--cup); outline-offset: 2px; border-radius: 3px; }
.fehlt input, .fehlt select, .fehlt textarea { border-color: var(--fehler) !important; box-shadow: 0 0 0 3px rgba(192,57,43,.15); }
.haken.fehlt { color: var(--fehler); }
.haken.fehlt input { outline-color: var(--fehler); }
.pflicht-hinweis { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .85rem; color: var(--leise); }
.pflicht-muster { display: inline-block; width: 22px; height: 14px; border: 2px solid var(--cup); border-radius: 4px; flex: none; }
.rechnungsangaben { display: grid; gap: 6px; }
.rechnungsangaben .info { margin: 0; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid rgba(0,200,140,.45); outline-offset: 1px; }
.haken { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; cursor: pointer; }
.haken input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--text); }
.info { color: var(--leise); font-size: .92rem; white-space: pre-line; }
.formular h3 { white-space: pre-line; }
.haken.bedingt, .info.bedingt, label.feld.sperrbar.bedingt { margin-left: 30px; }
.bedingt.links, .haken.bedingt.links, .info.bedingt.links, label.feld.sperrbar.bedingt.links { margin-left: 0; }
.preis-hinweis { color: var(--leise); font-weight: 400; white-space: nowrap; }
.danke-text { white-space: pre-line; }
label.feld input[type=number] { -moz-appearance: textfield; }
.eckpunkte { background: #f5f5f3; border-radius: var(--radius); padding: 14px 16px; white-space: pre-line; }
.festwert { background: #f5f5f3; border-radius: 8px; padding: 11px 12px; margin-top: 4px; font-weight: 400; }
.uebersicht { border: 1px solid var(--linie); border-radius: var(--radius); padding: 12px 16px; }
.uebersicht div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-variant-numeric: tabular-nums; }
.uebersicht .teil { display: block; padding: 0; }
.uebersicht .teil + .teil { border-top: 1px solid var(--linie); margin-top: 8px; padding-top: 8px; }
.uebersicht .teil:empty { display: none; }
.uebersicht h4 { margin: 0 0 2px; font-size: .95rem; }
.uebersicht .summe > div:first-child { font-weight: 700; }
.uebersicht .fett { font-weight: 700; }
.uebersicht small { color: var(--leise); }
.team { display: grid; grid-template-columns: 1fr 150px 40px; gap: 10px; align-items: end; }
.team .team-hinweis { grid-column: 1 / -1; margin-top: -4px; background: #fbeceb; color: #7b2219; border-radius: 8px; padding: 8px 12px; font-size: .88rem; }
label.feld textarea.teamname.vergeben { border-color: var(--fehler); }
label.feld textarea.teamname:disabled { background: #f4f4f2; }
.team .weg { height: 44px; border: 1px solid var(--linie); border-radius: 8px; background: #fff; cursor: pointer; font-size: 1.1rem; }
.plus { justify-self: start; border: 1px dashed #999; background: #fff; border-radius: 8px; padding: 10px 14px; cursor: pointer; font-weight: 700; }
.plus:disabled { opacity: .4; cursor: default; }
.knopf { display: inline-flex; justify-content: center; align-items: center; padding: 14px 22px; border: 0; border-radius: 10px;
  background: var(--text); color: #fff; font-weight: 700; font-size: 1.02rem; cursor: pointer; }
.knopf:disabled { background: #c9c9c5; cursor: not-allowed; }
.knopf.breit { width: 100%; }
.rechtlich { font-size: .8rem; color: var(--leise); }
.rechtlich a { color: inherit; }
.fehlerbox { background: #fbeceb; color: #7b2219; border-radius: 10px; padding: 12px 16px; }
.fehlerbox ul { margin: 4px 0 0; padding-left: 20px; }
.falle { position: absolute; left: -9999px; }
.danke { text-align: center; padding: 30px 0; }
.danke .ok { width: 64px; height: 64px; border-radius: 50%; background: var(--cup); color: #fff; font-size: 2rem; display: grid; place-items: center; margin: 0 auto 14px; }

/* Popup */
.popup { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 16px; z-index: 10; }
.popup[hidden] { display: none; }
.popup-box { background: #fff; border-radius: 14px; padding: 24px; max-width: 440px; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.popup-box p { margin-bottom: 18px; }

@media (max-width: 560px) {
  .kacheln { gap: 10px; }
  .kachel { min-height: 120px; padding: 14px; }
  .kachel strong { font-size: 1.02rem; }
  .kachel small { display: none; }
  .feldgruppe { grid-template-columns: 1fr; }
  .team { grid-template-columns: 1fr 110px 40px; }
  .tag { font-size: .85rem; border-radius: 8px; }
}

/* Weihnachten: erst Gruppengröße */
.gruppenwahl { display: grid; gap: 16px; max-width: 560px; }
.gruppenwahl .einleitung { margin: 0; font-size: 1.02rem; line-height: 1.6; }
.gruppenwahl label.feld select { max-width: 280px; }
.gruppenwahl > .knopf { justify-self: start; }
.gruppen-hinweis { background: #fbeceb; border-radius: 10px; padding: 12px 14px; display: grid; gap: 10px; }
.gruppen-hinweis p { margin: 0; }
.gruppen-hinweis .knopf { justify-self: start; padding: 10px 16px; }
.knopf.hell { background: #fff; color: var(--text); border: 1px solid var(--text); }
.gruppe-info { margin: -4px 0 12px; color: var(--leise); font-size: .92rem; }
button.link { border: 0; background: none; padding: 0; font: inherit; color: var(--text); text-decoration: underline; cursor: pointer; }
.tag.gruppe { cursor: default; }

/* Gutscheine */
.gutscheine { display: grid; gap: 14px; }
.gutschein { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--linie); border-radius: var(--radius); background: #fafaf8; }
.gs-kopf { display: flex; justify-content: space-between; align-items: center; min-height: 36px; }
.gs-kopf .weg { width: 36px; height: 36px; border: 1px solid var(--linie); border-radius: 8px; background: #fff; cursor: pointer; font-size: 1.1rem; }
.gs-preis { font-weight: 700; text-align: right; min-height: 1.5em; }

/* Gutscheincode im Buchungsformular */
.gutscheincodes { display: grid; gap: 10px; }
.gutscheincodes .info { margin: 0; }
.gc-zeile { display: grid; gap: 6px; }
.gc-zeile label.feld { max-width: 260px; }
.gc-zeile input { letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.gc-meldung { font-size: .9rem; padding: 8px 12px; border-radius: 8px; }
.gc-meldung.ok { background: var(--frei-hell); color: #0b6b4c; }
.gc-meldung.warn { background: #fbeceb; color: var(--fehler); }

/* Mo–Fr: Anfragen und Buchen nebeneinander */
.zwei-knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.weg-wahl { display: grid; gap: 6px; align-content: start; }
.weg-wahl small { color: var(--leise); font-size: .85rem; text-align: center; line-height: 1.35; }
.knopf.hell { background: #fff; color: var(--text); box-shadow: inset 0 0 0 2px var(--text); }
.knopf.hell:hover { background: #f2f2f0; }
@media (max-width: 560px) { .zwei-knoepfe { grid-template-columns: 1fr; } }

/* Auswahlfeld (Dropdown mit einem oder mehreren Einträgen) */
.auswahl { position: relative; display: block; font-size: .88rem; font-weight: 700; }
.aw-feld { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; margin-top: 4px; padding: 11px 12px; font: inherit; font-weight: 400; color: var(--text);
  text-align: left; border: 1px solid #cfcfcb; border-radius: 8px; background: #fff; cursor: pointer; }
.aw-feld::after { content: '▾'; color: var(--leise); flex: none; }
.auswahl.offen .aw-feld::after { content: '▴'; }
.aw-feld.pflicht { border: 2px solid var(--cup); padding: 10px 11px; }
.aw-text { overflow: hidden; text-overflow: ellipsis; }
.aw-text.leer { color: #8a8a8a; }
.aw-liste { position: absolute; z-index: 20; left: 0; right: 0; margin-top: 4px; max-height: 280px; overflow-y: auto; padding: 6px; background: #fff;
  border: 1px solid #cfcfcb; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.aw-eintrag { display: flex; align-items: center; gap: 10px; padding: 9px 8px; font-weight: 400; border-radius: 6px; cursor: pointer; }
.aw-eintrag:hover { background: var(--kachel); }
.aw-eintrag input { width: 18px; height: 18px; margin: 0; accent-color: var(--text); flex: none; }
.auswahl.fehlt .aw-feld { border-color: var(--fehler) !important; box-shadow: 0 0 0 3px rgba(192,57,43,.15); }
.auswahl.fehlt .aw-eintrag input { box-shadow: none; }
/* Version 64: Auswahl als immer geöffnete Liste */
.aw-offen { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.aw-offen .aw-eintrag { padding: 8px 6px; }
.aw-offen.pflicht { border-left: 3px solid var(--cup); padding-left: 6px; }
.auswahl-offen.fehlt .aw-offen { outline: 2px solid var(--fehler); outline-offset: 4px; border-radius: 6px; }

.rechnung-block.steuerbeleg h3 { margin: 12px 0 6px; }

.weg-wahl .buchen-sperre { color: var(--fehler); }
.zwei-knoepfe button:disabled { opacity: .45; cursor: not-allowed; }


/* ---------- Version 86: Hintergrundfarbe per ?hg=RRGGBB ---------- */
/* Heller farbiger Hintergrund (z. B. #F1F1F1): Kacheln und Kästen weiß, damit sie sich abheben */
body.hg-hell { --kachel: #ffffff; --kachel-hover: #f7f7f5; }
body.hg-hell .eckpunkte, body.hg-hell .festwert, body.hg-hell .gutschein { background: #fff; }

/* Dunkler Hintergrund (z. B. #A40C04, #16211B): helle Schrift, Felder und Kästen bleiben hell */
body.hg-dunkel { color: #fff; --leise: rgba(255,255,255,.8); --linie: rgba(255,255,255,.3); }
body.hg-dunkel .eckpunkte, body.hg-dunkel .festwert, body.hg-dunkel .gutschein, body.hg-dunkel .cuptermin,
body.hg-dunkel .gruppen-hinweis, body.hg-dunkel .popup-box, body.hg-dunkel .aw-liste, body.hg-dunkel .aw-feld,
body.hg-dunkel label.feld input, body.hg-dunkel label.feld select, body.hg-dunkel label.feld textarea,
body.hg-dunkel .monatsleiste button, body.hg-dunkel .team .weg, body.hg-dunkel .plus, body.hg-dunkel .gs-kopf .weg {
  --leise: #6d6d6d; --linie: #e2e2df; color: #222; }
body.hg-dunkel .kachel:not(.cup):not(.weihnacht) small { color: #6d6d6d; }
body.hg-dunkel .cuptermin:disabled { color: #999; }
body.hg-dunkel .zurueck:hover, body.hg-dunkel button.link { color: #fff; }
body.hg-dunkel .gruppen-hinweis button.link { color: #222; }
body.hg-dunkel .schritte span.an { background: #fff; }
body.hg-dunkel .knopf { background: #fff; color: #222; }
body.hg-dunkel .knopf:hover { background: #f0f0ee; }
body.hg-dunkel .knopf:disabled { background: rgba(255,255,255,.35); color: rgba(0,0,0,.45); }
body.hg-dunkel .knopf.hell { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px #fff; border-color: #fff; }
body.hg-dunkel .knopf.hell:hover { background: rgba(255,255,255,.12); }
body.hg-dunkel .gruppen-hinweis .knopf.hell { background: #fff; color: #222; box-shadow: inset 0 0 0 2px #222; }
body.hg-dunkel .haken input { accent-color: #fff; }
body.hg-dunkel .aw-offen .aw-eintrag:hover { background: rgba(255,255,255,.12); }
body.hg-dunkel .aw-feld::after { color: #6d6d6d; }
body.hg-dunkel .haken.fehlt, body.hg-dunkel .weg-wahl .buchen-sperre { color: #ffd9d4; }
body.hg-dunkel .auswahl-offen.fehlt .aw-offen { outline-color: #ffd9d4; }
body.hg-dunkel .gruppe-info { color: rgba(255,255,255,.85); }
body.hg-dunkel .fehlt input, body.hg-dunkel .fehlt select, body.hg-dunkel .fehlt textarea, body.hg-dunkel .auswahl.fehlt .aw-feld,
body.hg-dunkel label.feld input.fehlt { border-color: var(--fehler) !important; box-shadow: 0 0 0 3px #ffd9d4; }
body.hg-dunkel .haken.fehlt input { outline-color: #ffd9d4; }
