/* FamLog - Handy-Oberfläche. Gleiche Farbwelt wie das Logo: Navy, Türkis, warmes Papier. */
:root {
  --navy: #1C3A5B;
  --teal: #22B2A1;
  --teal-dunkel: #188C7F;
  --papier: #F6F4EF;
  --karte: #FFFFFF;
  --text: #1D2733;
  --leise: #6B7684;
  --linie: #E7E2D8;
  --gefahr: #D64545;
  --feiertag: #FFF3D6;
  --feiertag-text: #8A5A00;
  --schatten: 0 1px 2px rgb(28 58 91 / 6%), 0 4px 14px rgb(28 58 91 / 6%);
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --papier: #0F1C2B; --karte: #182A3D; --text: #EEF2F6; --leise: #9AA8B8;
    --linie: #26394E; --feiertag: #3A2F14; --feiertag-text: #F5CD72;
    --schatten: 0 1px 2px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--papier); color: var(--text);
  font: 400 16px/1.45 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal-dunkel); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--leise); margin: 26px 4px 10px; }
.leise { color: var(--leise); }
.klein { font-size: 14px; }

/* Rahmen */
.kopf {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 12px) 18px 12px;
  background: color-mix(in srgb, var(--papier) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.kopf img { width: 34px; height: 34px; }
.kopf .titel { flex: 1; min-width: 0; }
.kopf .titel small { display: block; color: var(--leise); font-size: 13px; font-weight: 600; }
.kopf .titel h1 { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inhalt { max-width: 640px; margin: 0 auto; padding: 4px 16px calc(env(safe-area-inset-bottom) + 110px); }

.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  padding: 6px 8px calc(env(safe-area-inset-bottom) + 6px);
  background: var(--karte); border-top: 1px solid var(--linie);
}
.leiste a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--leise); font-size: 11px; font-weight: 600; }
.leiste a svg { width: 24px; height: 24px; }
.leiste a.aktiv { color: var(--navy); }
@media (prefers-color-scheme: dark) { .leiste a.aktiv { color: var(--teal); } }
.leiste a.plus span {
  display: grid; place-items: center; width: 54px; height: 54px; margin-top: -26px;
  border-radius: 18px; background: var(--teal); color: #fff; box-shadow: 0 6px 16px rgb(34 178 161 / 40%);
}
.leiste a.plus svg { width: 28px; height: 28px; }

/* Karten & Listen */
.karte { background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten); }
.karte + .karte { margin-top: 12px; }
.polster { padding: 16px; }
.liste > * + * { border-top: 1px solid var(--linie); }
.zeile { display: flex; align-items: center; gap: 12px; padding: 13px 16px; color: inherit; min-height: 56px; }
.zeile .mitte { flex: 1; min-width: 0; }
.zeile .mitte b { display: block; font-weight: 700; }
.zeile .mitte small { display: block; color: var(--leise); font-size: 13px; }
.zeile .pfeil { color: var(--leise); font-size: 20px; }

/* Tage & Einträge */
.tag { margin-top: 18px; }
.tag-kopf { display: flex; align-items: baseline; gap: 8px; margin: 0 4px 8px; }
.tag-kopf b { font-size: 17px; font-weight: 800; }
.tag-kopf span { color: var(--leise); font-size: 14px; }
.tag-kopf .heute-marke { background: var(--teal); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .05em; }
.tag-kopf a { margin-left: auto; font-size: 22px; line-height: 1; padding: 0 6px; }
.leer { padding: 14px 16px; color: var(--leise); font-size: 14px; }

.eintrag { display: flex; align-items: stretch; gap: 12px; padding: 12px 14px 12px 12px; color: inherit; position: relative; }
.eintrag .balken { width: 5px; border-radius: 4px; flex: none; background: var(--leise); }
.eintrag .zeit { width: 50px; flex: none; font-weight: 700; font-size: 14px; padding-top: 1px; font-variant-numeric: tabular-nums; }
.eintrag .zeit small { display: block; font-weight: 500; color: var(--leise); }
.eintrag .was { flex: 1; min-width: 0; }
.eintrag .was b { display: block; font-weight: 700; }
.eintrag .was small { display: block; color: var(--leise); font-size: 13px; }
.eintrag.feiertag { background: var(--feiertag); color: var(--feiertag-text); font-weight: 700; font-size: 14px; padding: 9px 14px; }
.eintrag.ferien { background: color-mix(in srgb, #5DBB63 14%, var(--karte)); color: #2F6B33; font-weight: 700; font-size: 14px; padding: 9px 14px; }
.eintrag.geburtstag .was b { font-weight: 700; }

.personen { display: flex; gap: 4px; align-items: center; }
.person { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 800; flex: none; }
.person.gross { width: 44px; height: 44px; font-size: 20px; }

/* Formulare */
.feld { display: block; margin-bottom: 16px; }
.feld > span { display: block; font-size: 14px; font-weight: 700; margin: 0 2px 6px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--karte);
  border: 1.5px solid var(--linie); border-radius: 14px; padding: 13px 14px; min-height: 50px;
  -webkit-appearance: none; appearance: none;
}
input[type=date], input[type=time] { min-width: 0; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgb(34 178 161 / 20%); }
.zweier { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.zweier > * { min-width: 0; }
.fehler { color: var(--gefahr); font-size: 13px; font-weight: 600; margin: 6px 2px 0; }
.fehler-box { background: #FDECEC; color: #8E1F1F; border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px; }

.schalter { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--karte); border: 1.5px solid var(--linie); border-radius: 14px; margin-bottom: 16px; font-weight: 700; }
.schalter input { -webkit-appearance: none; appearance: none; width: 50px; height: 30px; border-radius: 99px; background: var(--linie); position: relative; transition: background .2s; flex: none; margin: 0; }
.schalter input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 25%); transition: transform .2s; }
.schalter input:checked { background: var(--teal); }
.schalter input:checked::after { transform: translateX(20px); }

.wahl { display: flex; flex-wrap: wrap; gap: 8px; }
.wahl label { position: relative; }
.wahl input { position: absolute; opacity: 0; pointer-events: none; }
.wahl label span {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 99px;
  border: 1.5px solid var(--linie); background: var(--karte); font-weight: 700; font-size: 15px; cursor: pointer;
}
.wahl input:checked + span { border-color: var(--c, var(--teal)); background: color-mix(in srgb, var(--c, var(--teal)) 14%, var(--karte)); }
.wahl input:focus-visible + span { box-shadow: 0 0 0 3px rgb(34 178 161 / 30%); }

.farben { display: flex; flex-wrap: wrap; gap: 10px; }
.farben label { position: relative; }
.farben input { position: absolute; opacity: 0; }
.farben span { display: block; width: 40px; height: 40px; border-radius: 50%; background: var(--c); border: 3px solid var(--karte); box-shadow: 0 0 0 1.5px var(--linie); cursor: pointer; }
.farben input:checked + span { box-shadow: 0 0 0 3px var(--c); }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 800; font-size: 16px; border: 0; border-radius: 14px; cursor: pointer;
  padding: 14px 20px; min-height: 52px; background: var(--navy); color: #fff; width: 100%;
}
@media (prefers-color-scheme: dark) { .knopf { background: var(--teal); color: #0F1C2B; } }
.knopf.zweit { background: var(--karte); color: var(--text); border: 1.5px solid var(--linie); }
.knopf.gefahr { background: transparent; color: var(--gefahr); border: 1.5px solid currentColor; }
.knopf.klein { width: auto; min-height: 40px; padding: 8px 14px; font-size: 14px; border-radius: 12px; }
.knoepfe { display: grid; gap: 10px; margin-top: 8px; }

.meldung {
  position: fixed; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 88px); z-index: 30;
  max-width: 560px; margin: 0 auto; background: var(--navy); color: #fff; font-weight: 700;
  padding: 14px 16px; border-radius: 14px; box-shadow: 0 10px 30px rgb(0 0 0 / 25%);
  animation: rein .3s ease-out, raus .4s ease-in 4s forwards;
}
@keyframes rein { from { transform: translateY(20px); opacity: 0; } }
@keyframes raus { to { transform: translateY(20px); opacity: 0; visibility: hidden; } }

.wochen-nav { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; }
.wochen-nav a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--karte); box-shadow: var(--schatten); font-size: 22px; color: var(--text); }
.wochen-nav .mitte { flex: 1; text-align: center; font-weight: 800; }
.wochen-nav .mitte small { display: block; color: var(--leise); font-weight: 600; font-size: 13px; }

.hinweis { background: color-mix(in srgb, var(--teal) 12%, var(--karte)); border-radius: var(--radius); padding: 14px 16px; font-size: 14px; }
.code { font-size: 15px; word-break: break-all; background: var(--papier); padding: 10px 12px; border-radius: 10px; margin: 10px 0; user-select: all; }

/* Gäste-Seiten */
.gast { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 18px; }
.gast .logo { width: 210px; margin-bottom: 26px; }
.gast .karte { width: 100%; max-width: 420px; padding: 24px 20px; }
.gast h1 { margin-bottom: 6px; }
.gast p.leise { margin: 0 0 20px; }
.gast .unten { margin-top: 18px; text-align: center; font-size: 15px; }

/* Reiter oben (Einkauf | To-dos) */
.reiter { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--linie); border-radius: 14px; padding: 4px; margin: 8px 0 14px; }
.reiter a { text-align: center; padding: 10px 6px; border-radius: 11px; font-weight: 700; color: var(--leise); }
.reiter a.an { background: var(--karte); color: var(--text); box-shadow: var(--schatten); }

/* Kleine Auswahl-Chips (Listen, Personenfilter, Vorschläge) */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px; background: var(--karte); border: 1.5px solid var(--linie); font-weight: 700; font-size: 14px; color: var(--text); cursor: pointer; font-family: inherit; }
.chip.an { border-color: var(--c, var(--teal)); background: color-mix(in srgb, var(--c, var(--teal)) 14%, var(--karte)); }
.chip .person { width: 22px; height: 22px; font-size: 11px; }
.chip.leise { color: var(--leise); }

/* Schnell hinzufügen */
.schnell { display: flex; gap: 8px; margin-bottom: 12px; }
.schnell input { flex: 1; }
.schnell button { width: 52px; flex: none; padding: 0; font-size: 26px; }

/* Abhak-Zeilen */
.haken-zeile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 56px; }
.haken-zeile .mitte { flex: 1; min-width: 0; }
.haken-zeile .mitte b { display: block; font-weight: 700; }
.haken-zeile .mitte small { display: block; color: var(--leise); font-size: 13px; }
.haken-zeile a.mitte { color: inherit; }
.haken {
  flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid var(--linie); background: var(--karte);
  display: grid; place-items: center; cursor: pointer; padding: 0; color: transparent; font-size: 17px; font-weight: 900;
}
.erledigt .haken { background: var(--teal); border-color: var(--teal); color: #fff; }
.erledigt .mitte b { text-decoration: line-through; color: var(--leise); font-weight: 500; }
.menge { color: var(--leise); font-weight: 600; margin-right: 4px; }
.faellig { font-weight: 700; }
.faellig.ueber { color: var(--gefahr); }

/* Fortschritt (Routinen) */
.balken-fortschritt { height: 10px; background: var(--linie); border-radius: 99px; overflow: hidden; }
.balken-fortschritt span { display: block; height: 100%; background: var(--c, var(--teal)); border-radius: 99px; transition: width .3s; }
.sterne { font-weight: 800; color: #B7791F; white-space: nowrap; }

details.aufklapp summary { list-style: none; cursor: pointer; }
details.aufklapp summary::-webkit-details-marker { display: none; }
.kopf .zahnrad { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--leise); }
.kopf .zahnrad svg { width: 24px; height: 24px; }
.knopf-link { background: none; border: 0; padding: 0; font: inherit; color: var(--gefahr); font-weight: 700; cursor: pointer; }

/* Emoji-Auswahl */
.emoji-feld {
  display: grid; place-items: center; width: 100%; height: 50px; font-size: 26px; line-height: 1;
  background: var(--karte); border: 1.5px solid var(--linie); border-radius: 14px; cursor: pointer; padding: 0;
}
.emoji-blatt {
  border: 0; padding: 14px 14px calc(env(safe-area-inset-bottom) + 14px); margin: auto auto 0; width: min(100%, 640px);
  max-height: 72vh; border-radius: 22px 22px 0 0; background: var(--karte); color: var(--text); box-shadow: 0 -10px 40px rgb(0 0 0 / 20%);
}
.emoji-blatt::backdrop { background: rgb(15 28 43 / 45%); }
.emoji-reiter { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 10px; }
.emoji-reiter button { flex: none; padding: 7px 12px; border-radius: 99px; border: 0; background: var(--papier); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; }
.emoji-reiter button.an { background: var(--navy); color: #fff; }
.emoji-gitter { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 4px; max-height: 44vh; overflow-y: auto; }
.emoji-gitter button { height: 48px; font-size: 28px; border: 0; background: none; border-radius: 12px; cursor: pointer; padding: 0; }
.emoji-gitter button:active { background: var(--papier); }
.emoji-unten { display: flex; gap: 10px; justify-content: space-between; margin-top: 12px; }
.umfang { display: grid; gap: 6px; }
.umfang label { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--karte); border: 1.5px solid var(--linie); border-radius: 14px; font-weight: 600; }
.umfang input { width: 20px; height: 20px; accent-color: var(--teal); margin: 0; }
.emoji-feld.leer span { opacity: .35; filter: grayscale(1); }
.unten { margin-top: 18px; text-align: center; font-size: 15px; }
.karte.text { line-height: 1.55; }
.karte.text h3 { font-size: 16px; margin: 20px 0 6px; }
.karte.text p, .karte.text ul { margin: 0 0 10px; }
.karte.text ul { padding-left: 20px; }
.karte.text li { margin-bottom: 6px; }
.gast .karte.text { max-width: 680px; }
