/* Wendora To-do – Aussehen (hell/dunkel automatisch nach Handy-Einstellung) */
:root {
  --bg: #f4f5f8; --flaeche: #ffffff; --text: #1b2130; --leise: #667085; --linie: #e2e5ea;
  --akzent: #5b4bdb; --akzent-hell: #eeebff; --rot: #d63a31; --rot-hell: #fde7e5; --gelb: #f2a900;
  --nav: #1c1a2e;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11131a; --flaeche: #1a1d27; --text: #e8ebf0; --leise: #98a2b3; --linie: #2b303c;
    --akzent: #8f84ff; --akzent-hell: #272348; --rot: #ff6b62; --rot-hell: #3d1a18; --gelb: #f5c242;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; background: var(--bg); color: var(--text);
  padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--akzent); }
.leise { color: var(--leise); }
.klein { font-size: 13px; }
.mitte { text-align: center; }
.rot { color: var(--rot) !important; }
.fehler { color: var(--rot); background: var(--rot-hell); padding: 8px 12px; border-radius: 10px; }

/* Kopf */
.kopf { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); }
.kopf h1 { font-size: 26px; margin: 0; }
.rund { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--linie); background: var(--flaeche); font-size: 18px; }
#filterKnopf::before { content: "🔍"; font-size: 16px; }
#filterKnopf { font-size: 0; }

main { padding: 0 14px 20px; max-width: 760px; margin: 0 auto; }

/* Untere Leiste */
.leiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: var(--flaeche); border-top: 1px solid var(--linie); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
.leiste button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; color: var(--leise); padding: 4px 0; }
.leiste button span { font-size: 21px; filter: grayscale(1); opacity: .7; }
.leiste button.an { color: var(--akzent); font-weight: 600; }
.leiste button.an span { filter: none; opacity: 1; }
.leiste .plus { justify-self: center; width: 56px; height: 56px; border-radius: 50%; background: var(--akzent); color: #fff; font-size: 32px; line-height: 1;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--akzent) 45%, transparent); margin-top: -26px; }

/* Filter-Chips */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; border: 1px solid var(--linie); background: var(--flaeche); border-radius: 99px; padding: 6px 12px; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.chip.an { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.punkt { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; margin-right: 2px; }

/* Gruppen + Zeilen */
.gruppe { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; margin-bottom: 12px; overflow: hidden; }
.gruppe > summary { list-style: none; padding: 10px 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.gruppe > summary::-webkit-details-marker { display: none; }
.gruppe > summary .zahl { margin-left: auto; font-weight: 600; font-size: 13px; color: var(--leise); background: var(--bg); border-radius: 99px; padding: 1px 9px; }
.gruppe.sortieren { border-color: color-mix(in srgb, var(--leise) 40%, var(--linie)); }
.gruppe.ueber > summary { color: var(--rot); }
.zeile { display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; border-top: 1px solid var(--linie); transition: opacity .3s, transform .3s; }
body > main > .zeile { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; margin-bottom: 8px; }
.zeile.weg { opacity: .3; transform: translateX(12px); }
.zeile.fertig .zeile-titel { text-decoration: line-through; color: var(--leise); }
.haken { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--leise); background: none; margin-top: 1px; color: #fff; font-size: 14px; font-weight: 700; padding: 0; }
.zeile.wichtig .haken { border-color: var(--gelb); }
.zeile.fertig .haken { background: var(--akzent); border-color: var(--akzent); }
.idee-sym { font-size: 20px; }
.zeile-text { flex: 1; min-width: 0; cursor: pointer; }
.zeile-titel { font-weight: 500; word-break: break-word; }
.zeile-meta { font-size: 13px; color: var(--leise); margin-top: 2px; }
.leer { text-align: center; font-size: 34px; padding: 50px 10px; }
.leer, .leer .leise { font-size: 16px; }
.leer::first-line { font-size: 40px; }

/* Blatt von unten (Eintragen) */
.blatt { position: fixed; inset: 0; z-index: 20; }
.blatt-hg { position: absolute; inset: 0; background: rgba(0,0,0,.4); opacity: 0; transition: opacity .2s; }
.blatt-inhalt { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; background: var(--flaeche);
  border-radius: 18px 18px 0 0; padding: 12px 16px calc(20px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .22s ease-out;
  max-width: 760px; margin: 0 auto; }
.blatt.offen .blatt-hg { opacity: 1; }
.blatt.offen .blatt-inhalt { transform: translateY(0); }
.blatt-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.blatt-fuss { display: flex; gap: 8px; margin-top: 16px; }
.blatt-fuss button { flex: 1; }
.link { border: 0; background: none; color: var(--akzent); padding: 6px 2px; font-size: 16px; }
.link.stark { font-weight: 700; }
.umschalter { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; }
.umschalter button { border: 0; background: none; padding: 5px 14px; border-radius: 8px; font-size: 14px; }
.umschalter button.an { background: var(--flaeche); box-shadow: 0 1px 3px rgba(0,0,0,.15); font-weight: 600; }

textarea, input:not([type=checkbox]):not([type=color]), select {
  width: 100%; border: 1px solid var(--linie); background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 16px; }
#fTitel { font-size: 18px; font-weight: 500; resize: none; }
textarea { resize: vertical; }
label { display: block; font-size: 13px; color: var(--leise); margin: 10px 0 0; }
label > input, label > select, label > textarea { margin-top: 4px; color: var(--text); }
.label { font-size: 13px; color: var(--leise); margin: 12px 0 2px; }
.felder { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.schalter { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 15px; margin: 12px 0 0; }
.schalter input { width: 22px; height: 22px; accent-color: var(--akzent); flex: 0 0 auto; }
.schnell { padding-bottom: 2px; }
.foto { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.foto img { width: 100%; max-height: 280px; object-fit: contain; border-radius: 10px; background: var(--bg); }

button, .knopf { border: 1px solid var(--linie); background: var(--flaeche); border-radius: 10px; padding: 10px 14px; font-size: 15px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: var(--text); }
button.klein { padding: 5px 10px; font-size: 13px; }
.haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; font-weight: 600; }
button:disabled { opacity: .4; }
.knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }

/* Einstellungen */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; }
.karte h2 { font-size: 17px; margin: 0 0 8px; }
.karte summary { cursor: pointer; color: var(--akzent); margin: 6px 0; }
.b-zeile { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.b-zeile input[type=color] { width: 38px; height: 38px; border: 0; padding: 0; background: none; flex: 0 0 auto; border-radius: 8px; }
.b-zeile input:not([type=color]) { flex: 1; }
.p-zeile { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--linie); }
.p-zeile button { margin-left: auto; }
.marke { font-size: 12px; font-weight: 600; background: var(--akzent-hell); color: var(--akzent); border-radius: 99px; padding: 1px 8px; }
.marke.rot { background: var(--rot-hell); }

/* Meldung */
.meldung { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #1b2130; color: #fff; padding: 10px 16px; border-radius: 99px; font-size: 14px; z-index: 30; transition: all .2s; max-width: 90vw; text-align: center; }
.meldung.zeigen { opacity: 1; transform: translate(-50%, 0); }
.meldung.fehler { background: var(--rot); }

/* Anmeldung / Einrichtung */
body.login { padding: 0; display: grid; place-items: center; min-height: 100vh; }
.login-box { width: min(380px, 92vw); background: var(--flaeche); border: 1px solid var(--linie); border-radius: 18px; padding: 24px; }
.login-box h1 { margin: 0 0 10px; font-size: 24px; }
.login-box button { width: 100%; margin-top: 16px; }

@media (min-width: 700px) {
  .felder { grid-template-columns: 1fr 1fr; }
  .blatt-inhalt { border-radius: 18px; bottom: 5vh; }
}
