/* ---------- Liquid Glass (matt): durchscheinende Flächen, feine Haarlinien, leichtere Schrift ---------- */
:root{
  --lg-bg:#edf3ef; --lg-tint1:rgba(127,220,174,.35); --lg-tint2:rgba(150,200,230,.22); --lg-tint3:rgba(255,255,255,.9);
  --surface:rgba(255,255,255,.66); --sunk:rgba(16,57,43,.055); --line:rgba(16,57,43,.09);
  --glass:rgba(250,253,251,.58); --glass-strong:rgba(250,253,251,.95);
  --edge:rgba(255,255,255,.75); --edge-in:rgba(255,255,255,.65);
  --lg-shadow:0 1px 1px rgba(16,57,43,.03),0 10px 32px rgba(16,57,43,.06);
  --lg-shadow-float:0 1px 1px rgba(16,57,43,.04),0 12px 40px rgba(16,57,43,.14);
  --r:22px; --r-s:14px; --lg-top:#f3f7f4;
}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){
  --lg-bg:#09110d; --lg-tint1:rgba(63,191,138,.20); --lg-tint2:rgba(57,135,229,.12); --lg-tint3:rgba(255,255,255,.03);
  --surface:rgba(30,40,35,.58); --sunk:rgba(255,255,255,.06); --line:rgba(255,255,255,.09);
  --glass:rgba(18,26,22,.55); --glass-strong:rgba(20,29,25,.95);
  --edge:rgba(255,255,255,.10); --edge-in:rgba(255,255,255,.06);
  --lg-shadow:0 1px 1px rgba(0,0,0,.2),0 10px 32px rgba(0,0,0,.28);
  --lg-shadow-float:0 1px 1px rgba(0,0,0,.25),0 14px 44px rgba(0,0,0,.5); --lg-top:#0b1411;
}}
:root[data-theme="dark"]{
  --lg-bg:#09110d; --lg-tint1:rgba(63,191,138,.20); --lg-tint2:rgba(57,135,229,.12); --lg-tint3:rgba(255,255,255,.03);
  --surface:rgba(30,40,35,.58); --sunk:rgba(255,255,255,.06); --line:rgba(255,255,255,.09);
  --glass:rgba(18,26,22,.55); --glass-strong:rgba(20,29,25,.95);
  --edge:rgba(255,255,255,.10); --edge-in:rgba(255,255,255,.06);
  --lg-shadow:0 1px 1px rgba(0,0,0,.2),0 10px 32px rgba(0,0,0,.28);
  --lg-shadow-float:0 1px 1px rgba(0,0,0,.25),0 14px 44px rgba(0,0,0,.5); --lg-top:#0b1411;
}

/* Hintergrund: ruhiger, matter Farbverlauf, auf dem das Glas liegt.
   Oben beginnt er exakt in der Farbe der Statusleiste und läuft weich ins Grün, damit keine Kante entsteht. */
html{background:var(--lg-top)}
html::before{content:"";position:fixed;inset:-10vmax;z-index:-1;pointer-events:none;
  background:linear-gradient(180deg,var(--lg-top) 10vmax,color-mix(in srgb,var(--lg-top) 70%,transparent) calc(10vmax + 60px),color-mix(in srgb,var(--lg-top) 25%,transparent) calc(10vmax + 170px),transparent calc(10vmax + 300px)),
             radial-gradient(46vmax 38vmax at 14% 16%,var(--lg-tint1),transparent 70%),
             radial-gradient(38vmax 30vmax at 92% 22%,var(--lg-tint2),transparent 70%),
             radial-gradient(50vmax 40vmax at 60% 100%,var(--lg-tint1),transparent 72%),
             linear-gradient(180deg,var(--lg-tint3),transparent 40%) var(--lg-bg)}
body{background:transparent;letter-spacing:-.011em;font-weight:400}
body::before{background:transparent}

/* Leichtere, feinere Schrift */
h1,h2,.hd-big{font-weight:600;letter-spacing:-.03em}
h3{font-weight:600}
b,strong{font-weight:600}
.as-av,.as-ft,.donut-c2,.em-ax,.em-ay,.em-n,.gauge .g1,.gh.today .gn,.mc.today .mn,.ml-row.un .ml-sub,.ml-row.un .ml-top b,.ob-kick,.ob-n,.strip .v{font-weight:600}
.pia-logo{color:var(--brand-ink)}

/* Flächen: mattes Glas mit Haarlinie und Lichtkante */
.panel,section.view>.panel,.grid2>.panel,.ki,.hd-mail,.strip>div,.pr-month-grid{background:var(--surface);border:.5px solid var(--edge);border-radius:var(--r);
  box-shadow:inset 0 1px 0 var(--edge-in),var(--lg-shadow);-webkit-backdrop-filter:blur(18px) saturate(150%);backdrop-filter:blur(18px) saturate(150%)}
@supports not ((-webkit-backdrop-filter:blur(1px)) or (backdrop-filter:blur(1px))){ .panel{background:var(--glass-strong)} }

/* Kopfzeile */
/* Kopfzeile folgt dem Seitenhintergrund; Kopfzeilen-Effekte werden nur auf das äußere Element angewendet. */
body>header{background:var(--bg);border-bottom:1px solid var(--line);-webkit-backdrop-filter:none;backdrop-filter:none;transition:box-shadow .2s}
html.pia-scrolled body>header{background:var(--bg);-webkit-backdrop-filter:none;backdrop-filter:none}
.themebtn{background:var(--sunk);border:.5px solid var(--edge)}
/* Logo mittig; Speicherstatus steht jetzt zusammen mit Design-Schalter und Konto rechts */
.head{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:12px}
.head>h1{grid-column:2;justify-self:center;margin:0}
.head>.headr{grid-column:3;grid-row:1;justify-self:end}
.headr .sub{order:-1;min-width:0;max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Knöpfe: Pillen, ruhiges Gewicht */
button{border-radius:999px;font-weight:500;letter-spacing:-.005em}
button.primary,.primary{box-shadow:inset 0 1px 0 rgba(255,255,255,.22),0 4px 14px color-mix(in srgb,var(--accent) 22%,transparent)}
button.ghost,.ghost{background:var(--sunk)}
.amp,.as-chip,.chip{background:var(--surface);border:.5px solid var(--edge);box-shadow:inset 0 1px 0 var(--edge-in),0 2px 8px rgba(16,57,43,.04);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);font-weight:500}
.as-chip.on,.chip.on{background:var(--accent);color:var(--accent-ink);border-color:transparent}

/* Eingabefelder */
input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea,.datebtn{background:color-mix(in srgb,var(--surface) 80%,transparent);border:.5px solid var(--line);border-radius:var(--r-s)}
input:focus,select:focus,textarea:focus{border-color:color-mix(in srgb,var(--accent) 55%,transparent)}

/* Blätter und Dialoge: stärkeres Glas */
.cal-sheet,.dp,.tp,.sheet{background:var(--glass-strong);border:.5px solid var(--edge);box-shadow:inset 0 1px 0 var(--edge-in),var(--lg-shadow-float);
  -webkit-backdrop-filter:blur(30px) saturate(170%);backdrop-filter:blur(30px) saturate(170%)}
.sh-head{background:transparent}
.toast{background:color-mix(in srgb,var(--ink) 82%,transparent);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:999px;font-weight:500}

/* Reiter auf dem Desktop: schwebende Glaskapsel, aktiver Reiter zart getönt */
@media (min-width:701px){
  nav{background:var(--glass);border:.5px solid var(--edge);box-shadow:inset 0 1px 0 var(--edge-in),var(--lg-shadow);-webkit-backdrop-filter:blur(24px) saturate(170%);backdrop-filter:blur(24px) saturate(170%);border-radius:999px;padding:4px}
  nav{display:flex;width:fit-content;max-width:100%;margin-inline:auto}
  nav a{border-radius:999px;font-weight:500;padding:8px 18px 8px 14px}
  nav a[aria-current="page"]{background:var(--surface);color:var(--accent);box-shadow:inset 0 1px 0 var(--edge-in),0 2px 10px rgba(16,57,43,.10);font-weight:600}
  nav a[aria-current="page"]:hover{background:var(--surface);color:var(--accent)}
  nav a .ic{width:20px;height:20px}
  .head{padding-block:32px 28px}
}

/* Tab-Leiste auf dem Handy: schwebende Glaskapsel */
@media (max-width:700px){
  body>header,html.pia-scrolled body>header{position:static;background:transparent;box-shadow:none;border-bottom:0;-webkit-backdrop-filter:none;backdrop-filter:none}
  nav{left:max(12px,env(safe-area-inset-left,0px));right:max(12px,env(safe-area-inset-right,0px));bottom:max(8px,calc(env(safe-area-inset-bottom,0px) - 12px));
    padding:4px 5px;border-radius:30px;border:.5px solid var(--edge);border-top:.5px solid var(--edge);
    background:var(--glass);box-shadow:inset 0 1px 0 var(--edge-in),var(--lg-shadow-float);
    -webkit-backdrop-filter:blur(26px) saturate(180%);backdrop-filter:blur(26px) saturate(180%)}
  nav a{border-radius:24px;padding:5px 0 4px;font-weight:500;letter-spacing:0}
  nav a[aria-current="page"]{background:color-mix(in srgb,var(--accent) 13%,transparent)}
  nav a .ic{width:24px;height:24px}
  .headr .sub[data-s="ok"]{font-size:0}
  .headr .sub[data-s="ok"]::before{font-size:.95rem}
  main{padding-bottom:calc(96px + env(safe-area-inset-bottom,0px))}
  /* Kompakter Kopfbereich: mehr Platz für Begrüßung und Inhalte */
  .head{padding-block:34px 2px}
  main{padding-top:20px}
  .head h1{font-size:1.95rem}
  .themebtn{width:32px;height:32px}
  .hd-date{font-size:.74rem;margin:0 0 8px}
  .hd-hello{font-size:clamp(1.4rem,6.6vw,1.8rem);line-height:1.22;margin:0}
  .hd-ask{font-size:1.02rem;margin:10px 0 6px}
}

/* Aufgabe oder Schuld anlegen/bearbeiten: als Pop-up über der Seite statt weiter unten im Inhalt */
:is(#todoEditor,#debtEditor):has(.editor){position:fixed;inset:0;z-index:35;display:grid;place-items:center;padding:16px;background:rgba(5,15,11,.32);animation:edFade .2s ease}
:is(#todoEditor,#debtEditor) .editor{width:min(640px,100%);max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain;
  background:var(--glass-strong);border:.5px solid var(--edge);border-radius:26px;box-shadow:inset 0 1px 0 var(--edge-in),var(--lg-shadow-float);
  -webkit-backdrop-filter:blur(30px) saturate(170%);backdrop-filter:blur(30px) saturate(170%);animation:edIn .3s cubic-bezier(.25,.1,.25,1)}
html:has(:is(#todoEditor,#debtEditor) .editor),html:has(:is(#todoEditor,#debtEditor) .editor) body{overflow:hidden}
/* Knöpfe bleiben unten im Fenster sichtbar, auch wenn man durch die Felder scrollt */
#todoEditor .editor>p.note:last-child{order:9;margin:-8px 0 0}
:is(#todoEditor,#debtEditor) .editor>.spread:has(#t-cancel,#d-cancel){order:10;position:sticky;bottom:-22px;z-index:2;margin:0 -22px -22px;padding:12px 22px 18px;
  background:var(--glass-strong);border-top:.5px solid var(--line);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px)}
.toast{z-index:60}
@keyframes edFade{from{opacity:0}to{opacity:1}}
@keyframes edIn{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:none}}
@media (max-width:700px){
  :is(#todoEditor,#debtEditor):has(.editor){place-items:end stretch;padding:0}
  :is(#todoEditor,#debtEditor) .editor{width:100%;max-height:92dvh;border-radius:26px 26px 0 0;border-bottom:0;padding-bottom:calc(22px + env(safe-area-inset-bottom,0px));animation:edUp .32s cubic-bezier(.25,.1,.25,1)}
  :is(#todoEditor,#debtEditor) .editor>.spread:has(#t-cancel,#d-cancel){bottom:calc(-22px - env(safe-area-inset-bottom,0px));margin-bottom:calc(-22px - env(safe-area-inset-bottom,0px));padding-bottom:calc(14px + env(safe-area-inset-bottom,0px))}
  @keyframes edUp{from{transform:translateY(100%)}to{transform:none}}
}
@media (prefers-reduced-motion:reduce){ :is(#todoEditor,#debtEditor):has(.editor),:is(#todoEditor,#debtEditor) .editor{animation:none} }

/* Mehrzeilige Eingaben in Blättern (z. B. Feedback, Notizen): ruhiges Glasfeld mit weichen Ecken */
.cal-sheet .sg:has(textarea){border:.5px solid var(--edge);border-radius:18px;box-shadow:inset 0 1px 0 var(--edge-in);transition:box-shadow .2s}
.cal-sheet .sg:has(textarea:focus){box-shadow:inset 0 1px 0 var(--edge-in),0 0 0 3px color-mix(in srgb,var(--accent) 28%,transparent)}
.cal-sheet .sg textarea{display:block;width:100%;min-height:160px;border:0;border-radius:inherit;background:transparent;box-shadow:none;outline:none;resize:none;
  padding:14px 16px;font-size:16px;line-height:1.5;color:var(--ink)}
.cal-sheet .sg textarea::placeholder{color:var(--muted)}
.cal-sheet .sh-note{margin:2px 4px 12px;line-height:1.45}

/* Konto-Menü oben rechts: fast deckend mit starkem Weichzeichner, damit nichts durchscheint */
.acct .menu{z-index:50;min-width:250px;background:color-mix(in srgb,var(--lg-top) 94%,transparent);border:.5px solid var(--edge);border-radius:22px;
  box-shadow:inset 0 1px 0 var(--edge-in),var(--lg-shadow-float);-webkit-backdrop-filter:blur(30px) saturate(170%);backdrop-filter:blur(30px) saturate(170%)}
.acct .menu .note{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal}
