/* Wunderliste – Erscheinungsbild „Himmelsstreifen“ (ab 1.1.0)
   Eine Schrift (Bricolage Grotesque, variabel), Listen als leuchtende Farbflächen,
   Einträge als Zettel darauf. Kühner Moment: der Haken mit Funkenkranz. Alles andere bleibt ruhig. */

@font-face {
  font-family: 'Bricolage';
  src: url('fonts/bricolage.woff') format('woff');
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --tinte: #141B2D;
  --tinte-2: #545E76;
  --tinte-3: #8A93A8;
  --nebel: #EEF1F7;
  --nebel-2: #E3E8F1;
  --papier: #FFFFFF;
  --himmel: #3B5BFF;
  --koralle: #FF5B4A;
  --sonne: #FFC53D;
  --gruen: #1F9D63;
  --linie: rgba(20, 27, 45, .08);
  --liste: var(--himmel);
  --zettel: rgba(255, 255, 255, .97);
  --zettel-erl: rgba(255, 255, 255, .62);
  --schatten-zettel: 0 1px 1px rgba(20, 27, 45, .06), 0 8px 22px -14px rgba(20, 27, 45, .45);
  --schatten-hoch: 0 24px 60px -20px rgba(20, 27, 45, .45);
  --r-zettel: 14px;
  --r-gruppe: 20px;
  --r-sheet: 28px;
  --sicher-oben: env(safe-area-inset-top, 0px);
  --sicher-unten: env(safe-area-inset-bottom, 0px);
  --schrift: 'Bricolage', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --feder: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --tinte: #E9EDF5;
    --tinte-2: #A8B1C4;
    --tinte-3: #737D93;
    --nebel: #0D111C;
    --nebel-2: #1A2133;
    --papier: #161C2B;
    --himmel: #7C93FF;
    --koralle: #FF7A6B;
    --linie: rgba(233, 237, 245, .09);
    --zettel: rgba(24, 30, 46, .94);
    --zettel-erl: rgba(24, 30, 46, .6);
    --schatten-zettel: 0 1px 1px rgba(0, 0, 0, .4), 0 10px 24px -14px rgba(0, 0, 0, .8);
    --schatten-hoch: 0 24px 60px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.45;
  font-optical-sizing: auto;
  color: var(--tinte);
  background: var(--nebel);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--himmel); }
:focus-visible { outline: 3px solid color-mix(in oklab, var(--liste) 70%, white); outline-offset: 2px; border-radius: 10px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg { flex: none; }

.laden-start { height: 100vh; display: grid; place-items: center; background: var(--nebel); }
.laden-start img { animation: atmen 1.4s ease-in-out infinite; }
@keyframes atmen { 50% { transform: scale(.92); opacity: .7; } }

/* ===== Grundgerüst ===== */
#app { height: 100%; }
.geruest { display: grid; grid-template-columns: 1fr; height: 100%; }
#seite, #haupt { min-height: 0; height: 100%; }
#detail { display: none; }

@media (max-width: 899px) {
  .geruest.zeige-liste #seite { display: none; }
  .geruest.zeige-seite #haupt { display: none; }
  .geruest.detail-offen #detail { display: flex; position: fixed; inset: 0; z-index: 30; animation: rein-rechts .28s cubic-bezier(.2, .8, .2, 1); }
}
@media (min-width: 900px) {
  .geruest { grid-template-columns: 300px 1fr; }
  .geruest.detail-offen { grid-template-columns: 300px 1fr 400px; }
  .geruest.detail-offen #detail { display: flex; }
  .nur-handy { display: none !important; }
}
@keyframes rein-rechts { from { transform: translateX(24%); opacity: 0; } }
@keyframes rein-unten { from { transform: translateY(100%); } }
@keyframes einblenden { from { opacity: 0; } }

/* ===== Seitenleiste ===== */
#seite { background: var(--nebel); display: flex; flex-direction: column; }
@media (min-width: 900px) { #seite { border-right: 1px solid var(--linie); } }
.seite-kopf { padding: calc(10px + var(--sicher-oben)) 16px 6px 18px; }
.seite-leiste { display: flex; align-items: center; gap: 6px; margin: 0 -8px 10px 0; }
.seite-leiste .ich { display: inline-flex; border-radius: 50%; }
.leiste-luft { flex: 1; }
.gruss {
  margin: 0; font-size: 30px; line-height: 1.05; font-weight: 720; font-stretch: 82%; letter-spacing: -.02em;
  text-wrap: balance;
}
.gruss-datum { margin: 6px 0 14px; color: var(--tinte-2); font-size: 15px; }
.such-pille {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 14px; text-decoration: none;
  background: var(--nebel-2); color: var(--tinte-3); font-size: 16px;
}
.such-pille svg { width: 18px; height: 18px; }
.such-pille:hover { color: var(--tinte-2); }

.kopf-knopf { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; color: inherit; position: relative; }
.kopf-knopf:hover { background: color-mix(in oklab, currentColor 10%, transparent); }
.kopf-knopf svg { width: 22px; height: 22px; }

.seite-listen { flex: 1; overflow-y: auto; padding: 10px 12px 16px; -webkit-overflow-scrolling: touch; }

/* Intelligente Listen als Kacheln */
.kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 20px; }
.kachel {
  position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px 10px;
  align-items: center; padding: 12px 14px; border-radius: 18px; background: var(--papier); color: var(--tinte); text-decoration: none;
  box-shadow: 0 1px 1px rgba(20, 27, 45, .04);
  transition: transform .15s;
}
.kachel:active { transform: scale(.97); }
.kachel .k-sym { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--k); }
.kachel .k-sym svg { width: 17px; height: 17px; }
.kachel .k-zahl { justify-self: end; font-size: 26px; font-weight: 700; font-stretch: 80%; font-variant-numeric: tabular-nums; line-height: 1; }
.kachel .k-zahl.rot { color: var(--koralle); }
.kachel .k-name { grid-column: 1 / -1; font-size: 15px; font-weight: 560; color: var(--tinte-2); margin-top: 6px; }
.kachel.aktiv { box-shadow: 0 0 0 2px var(--k); }
.k-heute { --k: #1F9D63; }
.k-woche { --k: #8463EE; }
.k-markiert { --k: var(--koralle); }
.k-mir { --k: #FF8A1F; }
.k-erledigt { --k: #5B6B82; }
.kachel.k-markiert .k-sym svg { width: 13px; height: 16px; }
.kachel.k-markiert .k-sym svg path:last-child { fill: var(--koralle); }
.kacheln .kachel:last-child:nth-child(odd) { grid-column: 1 / -1; }

.abschnitt { margin: 0 6px 8px; font-size: 20px; font-weight: 700; font-stretch: 85%; letter-spacing: -.01em; }
.listen-gruppe { background: var(--papier); border-radius: var(--r-gruppe); padding: 4px; }
.l-eintrag {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 12px; min-height: 48px;
  color: inherit; text-decoration: none; border-radius: 14px; font-size: 16.5px;
}
.l-eintrag:hover { background: var(--nebel); }
.l-eintrag.aktiv { background: color-mix(in oklab, var(--punkt, var(--himmel)) 13%, var(--papier)); font-weight: 620; }
.l-eintrag .punkt { width: 12px; height: 12px; border-radius: 50%; background: var(--punkt); box-shadow: 0 0 0 4px color-mix(in oklab, var(--punkt) 18%, transparent); margin: 0 4px 0 2px; flex: none; }
.l-eintrag .sym { width: 24px; height: 24px; display: grid; place-items: center; flex: none; color: var(--tinte-3); }
.l-eintrag .sym svg { width: 20px; height: 20px; }
.l-eintrag .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.l-eintrag .zahl { color: var(--tinte-3); font-size: 15px; font-variant-numeric: tabular-nums; }
.l-eintrag .zahl.rot { color: var(--koralle); font-weight: 650; }
.l-eintrag .geteilt { width: 17px; height: 17px; color: var(--tinte-3); }
.ordner-kopf { font-weight: 620; }
.ordner-kopf .pfeil { transition: transform .2s; }
.ordner-kopf.zu .pfeil { transform: rotate(-90deg); }
.ordner-inhalt { padding-left: 18px; }
.ordner-inhalt.zu { display: none; }
.leer-zeile { color: var(--tinte-3); font-size: 14px; }
.cron-hinweis {
  display: block; margin: 14px 2px 0; padding: 12px 14px; border-radius: 16px; text-decoration: none; font-size: 14px;
  background: color-mix(in oklab, var(--sonne) 26%, var(--papier)); color: var(--tinte);
}
.seite-fuss { display: flex; align-items: center; gap: 8px; padding: 10px 14px calc(10px + var(--sicher-unten)); }
.neue-liste {
  flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 999px;
  background: var(--tinte); color: var(--papier); font-weight: 620;
}
.neue-liste svg { width: 20px; height: 20px; }
.seite-fuss .klein { padding: 12px 14px; border-radius: 999px; color: var(--tinte-2); font-weight: 560; }
.seite-fuss .klein:hover { background: var(--nebel-2); }

/* ===== Avatare ===== */
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px; background: var(--himmel); user-select: none; font-stretch: 85%;
}
.avatar.gross { width: 44px; height: 44px; font-size: 19px; }
.avatar.klein { width: 24px; height: 24px; font-size: 11px; }
.seite-leiste .avatar { width: 38px; height: 38px; font-size: 16px; }
.avatare { display: flex; padding: 0 6px; }
.avatare .avatar { margin-left: -7px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }

/* ===== Hauptbereich ===== */
#haupt { position: relative; display: flex; flex-direction: column; overflow: hidden; background: var(--nebel); }
.haupt-kopf {
  position: relative; z-index: 3; display: flex; align-items: center; gap: 4px; flex: none; min-height: 56px;
  padding: calc(6px + var(--sicher-oben)) 8px 6px; color: #fff;
  transition: background .2s, box-shadow .2s;
}
.haupt-kopf .kopf-titel {
  flex: 1; min-width: 0; margin: 0 6px; font-size: 17px; font-weight: 680; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s;
}
.haupt-kopf.eingerollt .kopf-titel { opacity: 1; transform: none; }
.haupt-kopf.eingerollt { background: color-mix(in oklab, var(--liste) 78%, black 10%); box-shadow: 0 8px 20px -14px rgba(0, 0, 0, .6); }
.haupt-kopf.neutral { color: var(--tinte); }
.haupt-kopf.neutral.eingerollt { background: color-mix(in oklab, var(--nebel) 88%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--linie); }
@supports not (color: color-mix(in oklab, red, blue)) { .haupt-kopf.eingerollt { background: rgba(20, 27, 45, .55); } }

.haupt-inhalt { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 14px calc(32px + var(--sicher-unten)); position: relative; z-index: 1; }
#haupt.mit-eingabe .haupt-inhalt { padding-bottom: calc(110px + var(--sicher-unten)); }
.spalte { max-width: 760px; margin: 0 auto; }
.haupt-inhalt.schmal > * { max-width: 720px; margin-left: auto; margin-right: auto; }

.gross-titel { padding: 4px 4px 18px; color: #fff; }
.gross-titel h1 {
  margin: 0; font-size: clamp(34px, 7.5vw, 52px); line-height: .98; font-weight: 760; font-stretch: 78%; letter-spacing: -.025em;
  overflow-wrap: anywhere; text-wrap: balance; text-shadow: 0 2px 18px rgba(0, 0, 0, .14);
}
.gross-titel p { margin: 8px 0 0; font-size: 16px; opacity: .88; }
.seite-text .gross-titel { color: var(--tinte); }
.seite-text .gross-titel h1 { text-shadow: none; font-size: clamp(32px, 6vw, 44px); }

/* Listenflächen: weiche Leuchtfelder statt flacher Verläufe */
.hg { position: absolute; inset: 0; z-index: 0; background:
  linear-gradient(180deg, rgba(10, 14, 30, .16), transparent 220px),
  radial-gradient(90% 55% at 100% 0%, var(--h1) 0%, transparent 62%),
  radial-gradient(90% 60% at 0% 35%, var(--h2) 0%, transparent 62%),
  radial-gradient(120% 80% at 50% 110%, var(--h3) 0%, transparent 65%),
  var(--h0); }
.hg-himmel   { --h0: #3B5BFF; --h1: #7FB2FF; --h2: #6A4DFF; --h3: #1E2FB8; }
.hg-meer     { --h0: #0E9FB5; --h1: #5FE0D2; --h2: #1C7FD6; --h3: #075E7A; }
.hg-wald     { --h0: #2F8A5B; --h1: #8BD48A; --h2: #1F6F6A; --h3: #16402F; }
.hg-wiese    { --h0: #5BAF34; --h1: #D8EF6A; --h2: #2BA36A; --h3: #2E6E1F; }
.hg-abendrot { --h0: #FF6A3D; --h1: #FFC15A; --h2: #FF4F7E; --h3: #B4325B; }
.hg-kirsche  { --h0: #E5396A; --h1: #FF97A8; --h2: #B92FA0; --h3: #7E1440; }
.hg-lavendel { --h0: #8463EE; --h1: #C7B4FF; --h2: #E07BD8; --h3: #4A33A8; }
.hg-sand     { --h0: #C08A3E; --h1: #F5D59A; --h2: #E39A5F; --h3: #7B5426; }
.hg-schiefer { --h0: #5B6B82; --h1: #A9B6C9; --h2: #6F6A92; --h3: #2C3646; }
.hg-nacht    { --h0: #2B2F7A; --h1: #6A5BD6; --h2: #1F6EA8; --h3: #0D0F2B; }
@media (prefers-color-scheme: dark) { .hg { filter: brightness(.6) saturate(.95); } }

/* Eingabe unten, mit dem Daumen erreichbar */
.neu-zeile {
  position: absolute; z-index: 4; left: 50%; bottom: calc(16px + var(--sicher-unten)); transform: translateX(-50%);
  width: min(760px, calc(100% - 28px)); display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 8px;
  border-radius: 999px; background: var(--papier); color: var(--tinte); box-shadow: var(--schatten-hoch), 0 0 0 1px var(--linie);
}
.neu-plus { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--liste); color: #fff; flex: none; transition: transform .25s var(--feder); }
.neu-zeile:focus-within .neu-plus { transform: rotate(90deg); }
.neu-plus svg { width: 20px; height: 20px; }
.neu-zeile input { flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 10px 8px; font-size: 17px; }
.neu-zeile input::placeholder { color: var(--tinte-3); }
.neu-zeile .senden, .neu-ki { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; cursor: pointer; }
.neu-zeile .senden { color: #fff; background: var(--liste); }
.neu-zeile .senden svg, .neu-ki svg { width: 21px; height: 21px; }
.neu-ki { color: var(--tinte-2); }
.neu-ki:hover { background: var(--nebel); color: var(--liste); }
#neu-eingabe:placeholder-shown ~ .senden { display: none; }
#neu-eingabe:not(:placeholder-shown) ~ .neu-ki { display: none; }
.neu-aufnahme { display: none; flex: 1; padding: 10px 8px; font-size: 17px; color: var(--koralle); font-weight: 600; font-variant-numeric: tabular-nums; }
.neu-zeile.nimmt-auf #neu-eingabe, .neu-zeile.nimmt-auf #neu-kamera { display: none; }
.neu-zeile.nimmt-auf .neu-aufnahme { display: block; }
.neu-zeile.nimmt-auf #neu-mikro { display: grid; background: var(--koralle); color: #fff; animation: puls 1.2s ease-in-out infinite; }
@keyframes puls { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--koralle) 50%, transparent); } 50% { box-shadow: 0 0 0 10px transparent; } }
.neu-zeile.arbeitet .neu-plus, .arbeitet > svg:first-child { animation: drehen 1s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }
.neu-erkannt {
  position: absolute; z-index: 4; left: 50%; transform: translateX(-50%); bottom: calc(80px + var(--sicher-unten));
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 999px;
  background: var(--tinte); color: var(--papier); font-size: 14.5px; font-weight: 560; box-shadow: var(--schatten-hoch); white-space: nowrap;
  animation: hoch .25s var(--feder);
}
@keyframes hoch { from { transform: translate(-50%, 10px); opacity: 0; } }
.neu-erkannt svg { width: 16px; height: 16px; color: var(--sonne); }
.neu-erkannt button { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--papier); opacity: .75; }
.neu-erkannt button svg { color: inherit; width: 14px; height: 14px; }

/* KI-Vorschläge zum Abhaken */
.vorschlaege { display: flex; flex-direction: column; gap: 6px; }
.vorschlag { display: flex; align-items: center; gap: 10px; }
.vorschlag input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--himmel); flex: none; }
.vorschlag .feld { flex: 1; background: var(--nebel); border-color: transparent; }
.vorschlag input[type=checkbox]:not(:checked) + .feld { opacity: .45; text-decoration: line-through; }
.v-datum { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--tinte-2); white-space: nowrap; }
.v-datum svg { width: 14px; height: 14px; }
.d-abschnitt-kopf { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.d-abschnitt-kopf h3 { flex: 1; margin: 0 !important; }
.ki-pille {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: var(--liste); background: color-mix(in oklab, var(--liste) 12%, transparent);
}
.ki-pille svg { width: 16px; height: 16px; }
.ki-pille:disabled { opacity: .7; }
.ki-summe { color: var(--tinte) !important; font-size: 17px; }
.balken { height: 10px; border-radius: 999px; background: var(--nebel); overflow: hidden; }
.balken i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gruen), var(--sonne) 70%, var(--koralle)); background-size: 300px 100%; }

/* ===== Zettel (Aufgaben) ===== */
.aufgaben { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gruppe-titel { color: #fff; font-weight: 680; font-size: 17px; font-stretch: 88%; margin: 22px 6px 8px; display: flex; align-items: center; gap: 8px; }
.gruppe-titel:first-child { margin-top: 2px; }
.seite-text .gruppe-titel { color: var(--tinte-2); }
.aufgabe {
  display: flex; align-items: center; gap: 2px; background: var(--zettel); border-radius: var(--r-zettel);
  min-height: 56px; padding: 4px 4px 4px 2px; box-shadow: var(--schatten-zettel); position: relative;
  transition: transform .2s, opacity .3s, background .2s;
}
.aufgabe.gewaehlt { box-shadow: 0 0 0 2.5px var(--liste), var(--schatten-zettel); }
.aufgabe.erledigt { background: var(--zettel-erl); box-shadow: none; }
.aufgabe.erledigt .a-titel { color: var(--tinte-3); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.aufgabe.weg { opacity: 0; transform: translateY(-4px) scale(.98); }
.aufgabe.ziehen { z-index: 5; box-shadow: var(--schatten-hoch); transition: none; }
.haken { width: 48px; height: 48px; flex: none; display: grid; place-items: center; position: relative; }
.haken i {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid color-mix(in oklab, var(--liste) 45%, var(--tinte-3));
  display: grid; place-items: center; transition: background .2s, border-color .2s, transform .35s var(--feder);
}
.haken:hover i { border-color: var(--liste); background: color-mix(in oklab, var(--liste) 10%, transparent); }
.haken svg { width: 15px; height: 15px; color: #fff; stroke-width: 3; opacity: 0; transform: scale(.3) rotate(-20deg); transition: .3s var(--feder); }
.erledigt .haken i, .haken.an i { background: var(--liste); border-color: var(--liste); }
.erledigt .haken svg, .haken.an svg { opacity: 1; transform: none; }
.haken.knall i { animation: knall .45s var(--feder); }
@keyframes knall { 0% { transform: scale(.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.funken { position: absolute; inset: 0; pointer-events: none; }
.funken i {
  position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%;
  background: var(--liste); animation: funke .6s ease-out forwards; transform: rotate(var(--w)) translateY(0);
}
.funken i:nth-child(even) { background: var(--sonne); width: 4px; height: 4px; }
@keyframes funke { to { transform: rotate(var(--w)) translateY(-26px) scale(.4); opacity: 0; } }

.a-text { flex: 1; min-width: 0; padding: 8px 4px; cursor: pointer; }
.a-titel { overflow-wrap: anywhere; font-size: 16.5px; font-weight: 450; }
.a-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 12px; font-size: 13.5px; color: var(--tinte-2); margin-top: 3px; }
.a-meta:empty { display: none; }
.a-meta .rot { color: var(--koralle); font-weight: 650; }
.a-meta .blau { color: var(--liste); font-weight: 600; }
.a-meta .m { display: inline-flex; align-items: center; gap: 4px; }
.a-meta svg { width: 14px; height: 14px; }
.tag { color: var(--liste); font-weight: 620; cursor: pointer; border-radius: 6px; padding: 0 2px; margin: 0 -2px; }
.tag:hover { background: color-mix(in oklab, var(--liste) 12%, transparent); }
.stern-knopf { width: 42px; height: 48px; display: grid; place-items: center; flex: none; color: color-mix(in oklab, var(--tinte-3) 70%, transparent); transition: transform .3s var(--feder); }
.stern-knopf svg { width: 19px; height: 24px; }
.stern-knopf.an { color: var(--koralle); }
.stern-knopf:active { transform: scale(.8); }
.griff { width: 28px; height: 48px; display: grid; place-items: center; color: var(--tinte-3); opacity: .6; cursor: grab; touch-action: none; flex: none; }
.griff svg { width: 16px; height: 16px; }
.aufgabe .avatar { margin: 0 2px; }

.erledigte-knopf {
  margin: 18px 0 10px; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .2); color: #fff;
  font-size: 14.5px; font-weight: 620; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.erledigte-knopf:hover { background: rgba(255, 255, 255, .3); }
.leer { text-align: center; color: #fff; margin: 48px 20px; }
.leer svg { width: 56px; height: 56px; opacity: .8; stroke-width: 1.5; }
.leer p { margin: 10px auto 16px; font-size: 17px; max-width: 32ch; }
.seite-text .leer { color: var(--tinte-2); }

/* ===== Detail ===== */
#detail { flex-direction: column; background: var(--nebel); min-height: 0; height: 100%; }
@media (min-width: 900px) { #detail { border-left: 1px solid var(--linie); } }
.d-kopf { display: flex; align-items: center; gap: 4px; padding: calc(6px + var(--sicher-oben)) 8px 6px; flex: none; }
.d-kopf .d-liste { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--tinte-2); font-size: 15px; font-weight: 560; overflow: hidden; white-space: nowrap; }
.d-kopf .punkt { width: 10px; height: 10px; border-radius: 50%; background: var(--liste); flex: none; }
.d-inhalt { flex: 1; overflow-y: auto; padding: 0 14px calc(28px + var(--sicher-unten)); -webkit-overflow-scrolling: touch; }
.d-titelzeile { display: flex; align-items: flex-start; gap: 2px; padding: 4px 0 14px; }
.d-titelzeile .haken { margin-top: 2px; }
.d-titel {
  flex: 1; border: 0; outline: none; resize: none; background: none; font-size: 24px; font-weight: 700; font-stretch: 85%; letter-spacing: -.01em;
  padding: 9px 2px; line-height: 1.15; min-height: 46px; overflow: hidden;
}
.d-gruppe, .d-abschnitt { background: var(--papier); border-radius: var(--r-gruppe); margin-bottom: 12px; }
.d-zeile { display: flex; align-items: center; gap: 12px; padding: 13px 14px; min-height: 54px; }
.d-zeile + .d-zeile { border-top: 1px solid var(--linie); }
.d-zeile > svg { width: 22px; height: 22px; color: var(--tinte-3); }
.d-zeile.gesetzt > svg { color: var(--liste); }
.d-zeile.rot > svg, .d-zeile.rot .d-wert { color: var(--koralle); }
.d-mitte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.d-wert { font-weight: 640; }
.d-leer { color: var(--tinte-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 7px 13px; border-radius: 999px; background: var(--nebel); font-size: 14.5px; font-weight: 520; white-space: nowrap; }
.chip:hover { background: var(--nebel-2); }
.chip.an { background: var(--liste); color: #fff; }
.chip.person { display: inline-flex; align-items: center; }
.chip .avatar { margin: -3px 7px -3px -7px; }
.x-knopf { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--tinte-3); flex: none; }
.x-knopf:hover { background: var(--nebel); color: var(--tinte); }
.x-knopf svg { width: 16px; height: 16px; }
.feld { border: 1.5px solid var(--linie); background: var(--papier); border-radius: 12px; padding: 10px 12px; outline: none; min-width: 0; }
.feld:focus { border-color: var(--liste); box-shadow: 0 0 0 4px color-mix(in oklab, var(--liste) 18%, transparent); }
.d-mitte .feld { background: var(--nebel); border-color: transparent; }
.d-abschnitt { padding: 14px 14px 6px; }
.d-abschnitt h3 { margin: 0 0 8px; font-size: 16px; font-weight: 680; font-stretch: 88%; }
.unter { list-style: none; margin: 0; padding: 0; }
.unter li { display: flex; align-items: center; gap: 2px; min-height: 42px; }
.unter li .haken { width: 36px; height: 36px; }
.unter li .haken i { width: 20px; height: 20px; border-radius: 7px; }
.unter li .haken svg { width: 12px; height: 12px; }
.unter li input.u-titel { flex: 1; border: 0; background: none; outline: none; padding: 6px 2px; min-width: 0; }
.unter li.ok input.u-titel { text-decoration: line-through; color: var(--tinte-3); }
.unter-neu { display: flex; align-items: center; gap: 8px; padding: 4px 0 8px 8px; color: var(--tinte-3); }
.unter-neu svg { width: 18px; height: 18px; margin: 0 9px 0 1px; }
.unter-neu input { flex: 1; border: 0; outline: none; background: none; padding: 8px 2px; }
.notiz { width: 100%; min-height: 96px; border: 0; outline: none; resize: vertical; background: none; padding: 0 0 8px; line-height: 1.55; }
.anhaenge { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.anhang { display: flex; align-items: center; gap: 10px; }
.anhang .vorschau {
  width: 52px; height: 52px; border-radius: 12px; background: var(--nebel) center/cover no-repeat; flex: none;
  display: grid; place-items: center; color: var(--tinte-2); font-size: 12px; font-weight: 700;
}
.anhang a { flex: 1; min-width: 0; color: var(--tinte); text-decoration: none; }
.anhang a small { display: block; color: var(--tinte-3); }
.anhang a span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knopf-zeile { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.kommentar { display: flex; gap: 10px; margin-bottom: 14px; }
.kommentar .k-text { flex: 1; min-width: 0; }
.kommentar .k-kopf { font-size: 13.5px; color: var(--tinte-3); display: flex; gap: 6px; align-items: center; }
.kommentar .k-kopf b { color: var(--tinte); font-weight: 650; }
.kommentar p { margin: 3px 0 0; padding: 9px 12px; border-radius: 4px 16px 16px 16px; background: var(--nebel); white-space: pre-wrap; overflow-wrap: anywhere; display: inline-block; max-width: 100%; }
.k-neu { display: flex; gap: 8px; padding-bottom: 10px; align-items: flex-end; }
.k-neu textarea { flex: 1; resize: none; min-height: 44px; background: var(--nebel); border-color: transparent; }
.k-neu .knopf.haupt { width: 44px; height: 44px; padding: 0; border-radius: 50%; background: var(--liste); border-color: var(--liste); }
.d-fuss { padding: 6px 6px; color: var(--tinte-3); font-size: 13.5px; display: flex; align-items: center; gap: 10px; }
.d-fuss span { flex: 1; }

/* ===== Knöpfe ===== */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 999px;
  background: var(--nebel-2); border: 0; font-weight: 620; min-height: 44px; color: var(--tinte); text-decoration: none;
  transition: transform .15s, filter .15s;
}
.knopf:hover { filter: brightness(.97); }
.knopf:active { transform: scale(.97); }
.knopf.haupt { background: var(--tinte); color: var(--papier); }
.knopf.gefahr { color: var(--koralle); background: color-mix(in oklab, var(--koralle) 12%, transparent); }
.knopf.gefahr-voll { background: var(--koralle); color: #fff; }
.knopf.voll { width: 100%; }
.knopf.klein { padding: 7px 14px; min-height: 36px; font-size: 14.5px; }
.knopf svg { width: 18px; height: 18px; }
.knopf:disabled { opacity: .5; cursor: default; }
a.knopf { color: var(--tinte); }
a.knopf.haupt { color: var(--papier); }

/* ===== Seiten (Einstellungen usw.): gruppierte Flächen ===== */
.seite-text { background: var(--nebel); }
.karte { background: var(--papier); border-radius: var(--r-gruppe); margin-bottom: 16px; overflow: hidden; }
.karte h2 { font-size: 19px; font-weight: 700; font-stretch: 88%; margin: 0; padding: 16px 16px 2px; }
.karte .k-inhalt { padding: 8px 16px 16px; }
.karte p { margin: 6px 0 12px; color: var(--tinte-2); }
.zeile-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; width: 100%; text-align: left; color: var(--tinte); text-decoration: none; min-height: 54px; }
.zeile-link + .zeile-link { border-top: 1px solid var(--linie); }
.zeile-link:hover { background: color-mix(in oklab, var(--nebel) 60%, transparent); }
.zeile-link svg { width: 22px; height: 22px; color: var(--himmel); }
.zeile-link > span:not(.avatar) { flex: 1; min-width: 0; }
.zeile-link small { color: var(--tinte-3); }
.zeile-link .pfeil { color: var(--tinte-3); width: 16px; height: 16px; }
.schalter-zeile { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--linie); }
.schalter-zeile > span:first-child { flex: 1; min-width: 0; }
.schalter-zeile small { display: block; color: var(--tinte-3); font-size: 13.5px; }
.schalter { position: relative; width: 52px; height: 32px; flex: none; }
.schalter input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.schalter i { position: absolute; inset: 0; border-radius: 999px; background: var(--nebel-2); transition: background .25s; }
.schalter i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(20, 27, 45, .25); transition: transform .3s var(--feder); }
.schalter input:checked + i { background: var(--gruen); }
.schalter input:checked + i::after { transform: translateX(20px); }
.schalter input:focus-visible + i { outline: 3px solid color-mix(in oklab, var(--himmel) 60%, white); outline-offset: 2px; }
.form-feld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-feld label { font-size: 14.5px; font-weight: 620; color: var(--tinte-2); }
.form-feld .feld { width: 100%; }
.hinweis { font-size: 14.5px; color: var(--tinte-2); }
.fehler-text { color: var(--koralle); font-size: 14.5px; min-height: 1em; margin: 4px 0; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tabelle td { padding: 8px 0; border-top: 1px solid var(--linie); vertical-align: top; }
.tabelle td:first-child { color: var(--tinte-3); width: 42%; padding-right: 10px; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; background: var(--nebel); padding: 10px 12px; border-radius: 12px; display: block; }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.status svg { width: 18px; height: 18px; }
.status.ok { color: var(--gruen); }
.status.warn { color: #C77700; }
.status.schlecht { color: var(--koralle); }

.anleitung h2 { font-size: 22px; }
.anleitung p { color: var(--tinte); margin: 9px 0; line-height: 1.55; }
.anleitung ul, .anleitung ol { padding-left: 22px; margin: 6px 0 12px; line-height: 1.5; }
.anleitung li { margin: 5px 0; }
.kapitel-liste a { display: block; padding: 14px 16px; text-decoration: none; color: var(--tinte); }
.kapitel-liste a + a { border-top: 1px solid var(--linie); }
.kapitel-liste a:hover { background: color-mix(in oklab, var(--nebel) 60%, transparent); }

.ordnen-zeile { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-top: 1px solid var(--linie); min-height: 54px; }
.ordnen-zeile > svg { width: 20px; height: 20px; color: var(--tinte-3); }
.ordnen-zeile.ordner { background: color-mix(in oklab, var(--himmel) 8%, var(--papier)); font-weight: 680; }
.ordnen-zeile.ordner > svg { color: var(--himmel); }
.ordnen-zeile.in-ordner { padding-left: 38px; }
.ordnen-zeile > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ordnen-zeile .x-knopf { width: 38px; height: 38px; color: var(--tinte-2); }
.ordnen-zeile .x-knopf svg { width: 18px; height: 18px; }
.ordnen-zeile .x-knopf:disabled { opacity: .25; }

.hg-wahl { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.hg-wahl button { aspect-ratio: 1; border-radius: 18px; position: relative; overflow: hidden; transition: transform .2s var(--feder); }
.hg-wahl button:active { transform: scale(.92); }
.hg-wahl button .hg { border-radius: 18px; }
.hg-wahl button.an { box-shadow: 0 0 0 3px var(--papier), 0 0 0 5.5px var(--tinte); }
.farb-wahl { display: flex; flex-wrap: wrap; gap: 12px; }
.farb-wahl button { width: 40px; height: 40px; border-radius: 50%; }
.farb-wahl button.an { box-shadow: 0 0 0 3px var(--papier), 0 0 0 5.5px var(--tinte); }

/* ===== Sheets & Dialoge ===== */
.sheet-hg { position: fixed; inset: 0; background: rgba(13, 17, 28, .4); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: einblenden .18s; }
.sheet {
  background: var(--papier); width: 100%; max-width: 540px; max-height: 88vh; overflow-y: auto;
  border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: 10px 18px calc(18px + var(--sicher-unten));
  animation: rein-unten .32s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--schatten-hoch);
}
.sheet::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--nebel-2); margin: 0 auto 12px; }
@media (min-width: 700px) {
  .sheet-hg { align-items: center; }
  .sheet { border-radius: var(--r-sheet); padding-bottom: 20px; }
  .sheet::before { display: none; }
}
.sheet h2 { font-size: 22px; font-weight: 720; font-stretch: 85%; letter-spacing: -.01em; margin: 6px 0 14px; }
.sheet .knoepfe { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.menue-liste { display: flex; flex-direction: column; margin: 0 -10px; }
.menue-liste button, .menue-liste a {
  display: flex; align-items: center; gap: 14px; padding: 13px 14px; border-radius: 14px; text-align: left; color: var(--tinte); text-decoration: none; min-height: 52px; font-size: 16.5px;
}
.menue-liste button:hover, .menue-liste a:hover { background: var(--nebel); }
.menue-liste svg { width: 22px; height: 22px; color: var(--tinte-2); }
.menue-liste .gefahr, .menue-liste .gefahr svg { color: var(--koralle); }
.menue-liste hr { border: 0; border-top: 1px solid var(--linie); margin: 6px 14px; }
.person-wahl { display: flex; flex-direction: column; gap: 2px; }
.person-wahl label { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 14px; cursor: pointer; }
.person-wahl label:hover { background: var(--nebel); }
.person-wahl input { width: 22px; height: 22px; accent-color: var(--himmel); }
.person-wahl label > span:not(.avatar) { flex: 1; }
.person-wahl small { color: var(--tinte-3); }

/* ===== Toast ===== */
#toast {
  position: fixed; left: 50%; bottom: calc(136px + var(--sicher-unten)); transform: translateX(-50%) translateY(20px);
  background: var(--tinte); color: var(--papier); padding: 10px 10px 10px 18px; border-radius: 999px; z-index: 80;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--schatten-hoch); max-width: calc(100vw - 24px);
  transition: transform .3s var(--feder), opacity .2s; font-size: 15px; opacity: 0; pointer-events: none;
}
#toast.zeigen { transform: translateX(-50%); opacity: 1; pointer-events: auto; }
#toast button { color: var(--sonne); font-weight: 700; padding: 6px 10px; border-radius: 999px; }

/* ===== Anmeldung ===== */
.anmeldung { position: relative; min-height: 100%; display: grid; place-items: center; padding: 24px 16px; overflow: hidden;
  background: radial-gradient(120% 70% at 0% 0%, #7FB2FF 0%, transparent 60%), radial-gradient(90% 60% at 100% 18%, #6A4DFF 0%, transparent 62%), radial-gradient(120% 80% at 50% 110%, #1E2FB8 0%, transparent 65%), #3B5BFF; }
.anmeldung .karte { width: 100%; max-width: 400px; padding: 28px 24px 24px; border-radius: var(--r-sheet); box-shadow: var(--schatten-hoch); }
.anmeldung .logo { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.anmeldung .logo img { width: 54px; height: 54px; }
.anmeldung .logo b { font-size: 30px; font-weight: 760; font-stretch: 80%; letter-spacing: -.02em; }

/* ===== Suche ===== */
.such-kopf { color: #fff; }
.such-feld { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--papier); color: var(--tinte); border-radius: 14px; padding: 0 12px; margin-right: 6px; }
.such-feld svg { width: 18px; height: 18px; color: var(--tinte-3); }
.such-feld input { flex: 1; min-width: 0; border: 0; outline: none; background: none; padding: 11px 0; font-size: 16.5px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ===== Druck ===== */
@media print {
  body { background: #fff; color: #000; }
  #seite, #detail, .haupt-kopf, .neu-zeile, .stern-knopf, .griff, .erledigte-knopf, #toast, #sheets, .hg, .aufgabe .avatar { display: none !important; }
  .geruest { display: block; }
  #haupt, .haupt-inhalt { overflow: visible; height: auto; background: #fff; padding: 0; }
  .gross-titel { color: #000; padding-bottom: 10px; }
  .gross-titel h1 { text-shadow: none; font-size: 28px; }
  .aufgabe { box-shadow: none; border-bottom: 1px solid #ccc; border-radius: 0; background: #fff; min-height: 0; }
  .haken i { border-radius: 4px; border-color: #555; }
  .gruppe-titel { color: #000; }
  .a-meta, .tag { color: #444; }
}
