/* app.css · Aufgaben-App · iOS-nah, hell und dunkel */

:root {
  --bg: #F5F5F7;
  --karte: #FFFFFF;
  --sheet-bg: #F2F2F7;
  --text: #1D1D1F;
  --text2: #6E6E73;
  --text3: #AEAEB2;
  --trenner: rgba(60, 60, 67, 0.14);
  --fuell: rgba(118, 118, 128, 0.12);
  --fuell2: rgba(118, 118, 128, 0.2);
  --akzent: #0071E3;
  --akzent-weich: rgba(0, 113, 227, 0.12);
  --rot: #FF3B30;
  --rot-weich: rgba(255, 59, 48, 0.10);
  --orange: #FF9500;
  --orange-text: #C93400;
  --orange-weich: rgba(255, 149, 0, 0.14);
  --gruen: #34C759;
  --hubspot: #E8613C;
  --hubspot-weich: rgba(255, 122, 89, 0.14);
  --leiste: rgba(245, 245, 247, 0.92);
  --tableiste: rgba(250, 250, 252, 0.94);
  --schatten: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 10px rgba(0, 0, 0, 0.04);
  --schatten-hoch: 0 8px 30px rgba(0, 0, 0, 0.16);
  --backdrop: rgba(0, 0, 0, 0.30);

  --oben: env(safe-area-inset-top, 0px);
  --unten: env(safe-area-inset-bottom, 0px);
  --links: env(safe-area-inset-left, 0px);
  --rechts: env(safe-area-inset-right, 0px);
  --tabhoehe: 54px;
  --kb: 0px;
  --vvh: 100vh;
  --rand: 16px;
  --radius: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --karte: #1C1C1E;
    --sheet-bg: #1C1C1E;
    --text: #F5F5F7;
    --text2: #98989D;
    --text3: #636366;
    --trenner: rgba(84, 84, 88, 0.55);
    --fuell: rgba(118, 118, 128, 0.24);
    --fuell2: rgba(118, 118, 128, 0.34);
    --akzent: #0A84FF;
    --akzent-weich: rgba(10, 132, 255, 0.18);
    --rot: #FF453A;
    --rot-weich: rgba(255, 69, 58, 0.16);
    --orange: #FF9F0A;
    --orange-text: #FF9F0A;
    --orange-weich: rgba(255, 159, 10, 0.18);
    --gruen: #30D158;
    --hubspot: #FF8A6A;
    --hubspot-weich: rgba(255, 122, 89, 0.18);
    --leiste: rgba(0, 0, 0, 0.88);
    --tableiste: rgba(22, 22, 24, 0.94);
    --schatten: none;
    --schatten-hoch: 0 8px 30px rgba(0, 0, 0, 0.6);
    --backdrop: rgba(0, 0, 0, 0.55);
  }
  .sheet .karte, .sheet .gruppe { background: #2C2C2E; }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
input, textarea { font-size: 17px; } /* >= 16px: kein Zoom beim Fokus auf iOS */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ Start */

.start { position: fixed; inset: 0; display: grid; place-items: center; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--fuell2); border-top-color: var(--text2);
  animation: drehen 0.8s linear infinite;
}
@keyframes drehen { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ Login */

.login {
  position: fixed; inset: 0; overflow-y: auto;
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--oben) + 24px) calc(var(--rand) + var(--rechts)) calc(var(--unten) + 24px) calc(var(--rand) + var(--links));
}
.login-karte { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.login-icon { align-self: center; width: 72px; height: 72px; border-radius: 17px; box-shadow: var(--schatten); }
.login-titel { margin: 4px 0 0; text-align: center; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.login-text { margin: -6px 0 8px; text-align: center; color: var(--text2); font-size: 15px; }
.feldgruppe { background: var(--karte); border-radius: 12px; overflow: hidden; box-shadow: var(--schatten); }
.feld { display: block; }
.feld + .feld { border-top: 0.5px solid var(--trenner); }
.feld input { width: 100%; border: 0; outline: 0; background: transparent; padding: 0 16px; height: 50px; }
.login-fehler { margin: 0; color: var(--rot); font-size: 15px; text-align: center; }
.login-info { margin: 0; color: var(--text2); font-size: 15px; text-align: center; }
.login-demo { margin: 0; color: var(--text3); font-size: 13px; text-align: center; }
/* Konto noch nicht freigeschaltet */
.gesperrt-titel { font-size: 26px; overflow-wrap: anywhere; }
.gesperrt-text { margin: -2px 0 6px; font-size: 16px; line-height: 1.4; color: var(--text2); }
.gesperrt .knopf-breit + .knopf-breit { margin-top: -4px; }

/* ------------------------------------------------------------ Knoepfe */

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 50px; padding: 0 18px; border: 0; border-radius: 12px;
  background: var(--fuell); color: var(--akzent); font-weight: 600; font-size: 17px;
  transition: opacity .15s, transform .1s;
}
.knopf:active { opacity: 0.7; transform: scale(0.99); }
.knopf:disabled { opacity: 0.45; }
.knopf-primaer { background: var(--akzent); color: #fff; }
.knopf-breit { width: 100%; }
.knopf-rot { color: var(--rot); }
.knopf-link { border: 0; background: none; color: var(--akzent); font-size: 15px; min-height: 44px; padding: 0 8px; }
.ikon-knopf {
  width: 44px; height: 44px; border: 0; background: none; color: var(--akzent);
  display: inline-grid; place-items: center; border-radius: 22px; padding: 0;
}
.ikon-knopf:active { background: var(--fuell); }
.ikon-knopf svg { width: 24px; height: 24px; }
.ikon-knopf.dreht svg { animation: drehen 0.8s linear infinite; }

svg { display: block; }
.ik { display: inline-flex; width: 1em; height: 1em; flex: none; }
.ik svg { width: 100%; height: 100%; }

/* ------------------------------------------------------------ Haupt-Layout */

.haupt { position: fixed; inset: 0; }
.scroller {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
  padding-bottom: calc(var(--tabhoehe) + var(--unten) + 96px);
}

.kopf { padding: 0 calc(var(--rand) + var(--rechts)) 6px calc(var(--rand) + var(--links)); }
.kopf-leiste {
  position: sticky; top: 0; z-index: 20;
  margin: 0 calc(-1 * (var(--rand) + var(--rechts))) 0 calc(-1 * (var(--rand) + var(--links)));
  padding: var(--oben) calc(var(--rand) - 8px + var(--rechts)) 0 calc(var(--rand) + var(--links));
  min-height: calc(var(--oben) + 48px);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: transparent;
  transition: background .2s, box-shadow .2s;
}
.kopf-leiste.kompakt {
  background: var(--leiste);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 0.5px 0 var(--trenner);
}
.kopf-links { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; }
.kopf-rechts { display: flex; align-items: center; flex: none; }
.kopf-datum { color: var(--text2); font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf-mini {
  position: absolute; left: 50%; bottom: 13px; transform: translateX(-50%);
  font-size: 17px; font-weight: 600; opacity: 0; transition: opacity .2s; pointer-events: none; white-space: nowrap;
}
.kopf-leiste.kompakt .kopf-mini { opacity: 1; }
.kopf-leiste.kompakt .kopf-datum, .kopf-leiste.kompakt .demo-pille { opacity: 0; }
.kopf-zurueck {
  display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; color: var(--akzent);
  font-size: 17px; min-height: 44px; padding: 0 6px 0 0; margin-left: -6px;
}
.kopf-zurueck svg { width: 22px; height: 22px; }
.demo-pille {
  border: 0; background: var(--fuell); color: var(--text2); font-size: 12px; font-weight: 600;
  letter-spacing: 0.02em; padding: 3px 8px; border-radius: 10px; min-height: 0; transition: opacity .2s;
}
.titel { margin: 2px 0 0; font-size: 34px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.untertitel { margin: 4px 0 0; color: var(--text2); font-size: 15px; min-height: 1.3em; }

.offline {
  margin: 8px calc(var(--rand) + var(--rechts)) 0 calc(var(--rand) + var(--links));
  padding: 10px 14px; border-radius: 12px; background: var(--orange-weich); color: var(--orange-text);
  font-size: 14px; font-weight: 500;
}

.inhalt { padding: 6px calc(var(--rand) + var(--rechts)) 0 calc(var(--rand) + var(--links)); }

/* ------------------------------------------------------------ Pull to refresh */

.ptr {
  position: fixed; left: 50%; top: calc(var(--oben) + 52px); z-index: 30;
  width: 36px; height: 36px; margin-left: -18px; border-radius: 18px;
  background: var(--karte); box-shadow: var(--schatten-hoch);
  display: grid; place-items: center; opacity: 0; transform: translateY(-20px) scale(0.6); pointer-events: none;
}
.ptr-kreis { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--fuell2); border-top-color: var(--akzent); }
.ptr.aktiv .ptr-kreis { animation: drehen 0.7s linear infinite; }

/* ------------------------------------------------------------ Abschnitte und Listen */

.abschnitt { margin-top: 18px; }
.abschnitt:first-child { margin-top: 8px; }
.abschnitt-kopf {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 0 4px 7px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text2);
}
.abschnitt-kopf .anzahl { font-weight: 500; }
.abschnitt-kopf.rot { color: var(--rot); }
.abschnitt-kopf.orange { color: var(--orange-text); }
.abschnitt-kopf.gruen { color: var(--text2); }

.karte { background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten); overflow: hidden; }

.zeile {
  position: relative; display: flex; align-items: flex-start; min-height: 56px;
  background: var(--karte); transition: background .15s;
}
.zeile + .zeile::before {
  content: ""; position: absolute; top: 0; right: 0; left: 52px; height: 0.5px; background: var(--trenner);
}
.zeile.ueberfaellig { box-shadow: inset 3px 0 0 var(--rot); }
.haken {
  flex: none; width: 52px; min-height: 56px; align-self: stretch; border: 0; background: none; padding: 0 0 0 4px;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 16px;
}
.haken-kreis {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--text3);
  display: grid; place-items: center; color: #fff; transition: background .18s, border-color .18s, transform .18s;
}
.haken-kreis svg { width: 14px; height: 14px; opacity: 0; transform: scale(0.5); transition: opacity .15s, transform .2s; }
.zeile.prio1 .haken-kreis { border-color: var(--rot); }
.zeile.prio2 .haken-kreis { border-color: var(--orange); }
.haken:active .haken-kreis { transform: scale(0.88); background: var(--fuell); }
.zeile.abgehakt .haken-kreis, .zeile.ist-erledigt .haken-kreis { background: var(--gruen); border-color: var(--gruen); }
.zeile.abgehakt .haken-kreis svg, .zeile.ist-erledigt .haken-kreis svg { opacity: 1; transform: scale(1); }
.zeile.abgehakt .zeile-titel, .zeile.ist-erledigt .zeile-titel { color: var(--text2); text-decoration: line-through; text-decoration-color: var(--text3); }
.zeile.ist-verworfen .haken-kreis { border-style: dashed; }
.zeile.ist-verworfen .zeile-titel { color: var(--text2); }
.zeile.weg { animation: weg .32s ease forwards; overflow: hidden; }
@keyframes weg { to { opacity: 0; min-height: 0; max-height: 0; padding: 0; transform: translateX(24px); } }
.zeile.neu { animation: neu .35s ease; }
@keyframes neu { from { background: var(--akzent-weich); } }

.zeile-text {
  flex: 1 1 auto; min-width: 0; border: 0; background: none; text-align: left; padding: 10px 0 10px 0;
  display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 56px;
}
.zeile-titel {
  font-size: 17px; line-height: 1.3; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.zeile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--text2); }
.zeile-meta:empty { display: none; }
.meta { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; max-width: 100%; }
.meta .ik { font-size: 13px; }
.meta.rot { color: var(--rot); font-weight: 600; }
.meta.akzent { color: var(--akzent); }
.meta.orange { color: var(--orange-text); }
.meta-text { overflow: hidden; text-overflow: ellipsis; }
.pille { padding: 1px 6px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 1.4; }
.pille.p1 { background: var(--rot-weich); color: var(--rot); }
.pille.p2 { background: var(--orange-weich); color: var(--orange-text); }
.pille.p4 { background: var(--fuell); color: var(--text2); }
.pille.hubspot { background: var(--hubspot-weich); color: var(--hubspot); }
.pille.heute { background: var(--akzent-weich); color: var(--akzent); }
.pille.sync { background: var(--fuell); color: var(--text2); }
.pille.inbox { background: var(--orange-weich); color: var(--orange-text); }
.hutpunkt { width: 8px; height: 8px; border-radius: 50%; background: var(--hut, var(--text3)); flex: none; }

.mehr-knopf {
  flex: none; width: 44px; min-height: 56px; align-self: stretch; border: 0; background: none; color: var(--text3);
  display: flex; align-items: flex-start; justify-content: center; padding: 16px 0 0;
}
.mehr-knopf svg { width: 22px; height: 22px; }
.mehr-knopf:active { color: var(--text2); }

/* Inbox: Einsortier-Chips */
.einsortieren { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; padding: 0 12px 12px 52px; }
.hut-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 4px 2px;
  border: 0; border-radius: 12px; background: var(--fuell); font-size: 11px; font-weight: 600; color: var(--text2); min-width: 0;
}
.hut-chip .emoji { font-size: 19px; line-height: 1.1; }
.hut-chip-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hut-chip:active { background: var(--fuell2); transform: scale(0.96); }
.inbox-eintrag { position: relative; }
.inbox-eintrag + .inbox-eintrag::before { content: ""; position: absolute; top: 0; left: 52px; right: 0; height: 0.5px; background: var(--trenner); z-index: 1; }
.inbox-eintrag .zeile + .zeile::before { display: none; }
.inbox-eintrag.weg { animation: weg .32s ease forwards; overflow: hidden; }
.karte > .zeile + .inbox-eintrag::before, .karte > .inbox-eintrag + .zeile::before {
  content: ""; position: absolute; top: 0; left: 52px; right: 0; height: 0.5px; background: var(--trenner); z-index: 1;
}

/* Hut-Gruppen */
.hut-gruppe { margin-top: 12px; }
.hut-gruppe:first-child { margin-top: 8px; }
.hut-kopf {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 12px 0 14px;
  border: 0; background: var(--karte); text-align: left; position: relative;
}
.hut-kopf::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 3px 3px 0; background: var(--hut, var(--text3)); }
.hut-emoji { font-size: 22px; width: 30px; text-align: center; line-height: 1; }
.hut-name { flex: 1 1 auto; font-size: 17px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hut-zahlen { display: flex; align-items: center; gap: 6px; color: var(--text2); font-size: 15px; }
.zahl-rot { color: #fff; background: var(--rot); border-radius: 10px; padding: 0 7px; font-size: 13px; font-weight: 600; line-height: 20px; min-width: 20px; text-align: center; }
.chevron { color: var(--text3); transition: transform .2s; width: 18px; height: 18px; }
.hut-gruppe.zu .chevron { transform: rotate(-90deg); }
.hut-gruppe.zu .hut-liste { display: none; }
.hut-liste { border-top: 0.5px solid var(--trenner); }
.unterkopf { padding: 10px 16px 4px 52px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--orange-text); background: var(--karte); border-top: 0.5px solid var(--trenner); }
.unterkopf + .zeile::before { display: none; }
.neu-zeile {
  width: 100%; display: flex; align-items: center; gap: 0; min-height: 48px; border: 0; background: var(--karte);
  color: var(--akzent); font-size: 16px; text-align: left; padding: 0; border-top: 0.5px solid var(--trenner);
}
.neu-zeile .ik { width: 52px; height: 20px; justify-content: center; }
.neu-zeile:active { background: var(--fuell); }

/* Hinweis- und Leerzustaende */
.leer { text-align: center; padding: 36px 20px 28px; color: var(--text2); }
.leer-ikon { width: 52px; height: 52px; margin: 0 auto 12px; color: var(--gruen); }
.leer-ikon svg { width: 52px; height: 52px; }
.leer-titel { color: var(--text); font-size: 20px; font-weight: 600; margin: 0 0 6px; }
.leer-text { margin: 0 0 16px; font-size: 15px; }
.leer-knoepfe { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.leer-knoepfe .knopf { min-height: 44px; font-size: 15px; }

.banner {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px;
  border: 0; border-radius: var(--radius); background: var(--karte); box-shadow: var(--schatten);
  text-align: left; font-size: 15px; color: var(--text); margin-top: 8px;
}
.banner .ik { font-size: 20px; color: var(--akzent); }
.banner .banner-text { flex: 1; }
.banner .chevron { transform: rotate(-90deg); }

.aufklapp-kopf {
  width: 100%; display: flex; align-items: center; justify-content: space-between; border: 0; background: none;
  padding: 0 4px 7px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text2); min-height: 32px;
}
.aufklapp-kopf .chevron { width: 16px; height: 16px; }
.aufklapp-kopf.zu .chevron { transform: rotate(-90deg); }

/* ------------------------------------------------------------ FAB */

.fab {
  position: fixed; z-index: 40;
  right: calc(var(--rand) + var(--rechts)); bottom: calc(var(--tabhoehe) + var(--unten) + 16px);
  width: 56px; height: 56px; border-radius: 28px; border: 0;
  background: var(--akzent); color: #fff; box-shadow: 0 6px 18px rgba(0, 113, 227, 0.35), 0 2px 6px rgba(0, 0, 0, 0.12);
  display: grid; place-items: center; transition: transform .2s ease;
}
.fab svg { width: 28px; height: 28px; }
.fab:active { transform: scale(0.92); }
body.toast-sichtbar .fab { transform: translateY(-62px); }

/* ------------------------------------------------------------ Tab-Leiste */

.tabs {
  position: fixed; z-index: 45; left: 0; right: 0; bottom: 0;
  height: calc(var(--tabhoehe) + var(--unten));
  padding: 0 var(--rechts) var(--unten) var(--links);
  display: flex; background: var(--tableiste);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 -0.5px 0 var(--trenner);
}
.tab {
  position: relative; flex: 1; border: 0; background: none; color: var(--text3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding-top: 4px;
  font-size: 11px; font-weight: 500;
}
.tab-ikon svg { width: 26px; height: 26px; }
.tab.aktiv { color: var(--akzent); }
.tab-badge {
  position: absolute; top: 4px; left: calc(50% + 8px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--rot); color: #fff; font-size: 12px; font-weight: 600; line-height: 18px; text-align: center;
}
.tab-badge.leise { background: var(--text3); }

/* ------------------------------------------------------------ Toast */

.toast {
  position: fixed; z-index: 90;
  left: calc(var(--rand) + var(--links)); right: calc(var(--rand) + var(--rechts));
  bottom: calc(var(--tabhoehe) + var(--unten) + 12px + var(--kb));
  display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 6px 6px 6px 16px;
  border-radius: 14px; background: rgba(40, 40, 42, 0.96); color: #fff; box-shadow: var(--schatten-hoch);
  font-size: 15px; animation: rein .22s ease;
}
@media (prefers-color-scheme: dark) { .toast { background: rgba(58, 58, 60, 0.98); } }
.toast.fehler { background: var(--rot); }
.toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-aktion { border: 0; background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 600; font-size: 15px; min-height: 40px; padding: 0 14px; border-radius: 10px; }
.toast-aktion:active { background: rgba(255, 255, 255, 0.26); }
@keyframes rein { from { opacity: 0; transform: translateY(12px); } }

/* ------------------------------------------------------------ Sheets */

.sheet-huelle { position: fixed; inset: 0; z-index: 100; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--backdrop); opacity: 0; transition: opacity .25s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: var(--kb);
  max-height: calc(var(--vvh) - var(--oben) - 10px);
  display: flex; flex-direction: column;
  background: var(--sheet-bg); border-radius: 14px 14px 0 0; box-shadow: var(--schatten-hoch);
  transform: translateY(100%); transition: transform .32s cubic-bezier(.2, .8, .2, 1), bottom .2s;
  padding-left: var(--links); padding-right: var(--rechts);
}
.sheet-huelle.offen .sheet-backdrop { opacity: 1; }
.sheet-huelle.offen .sheet { transform: translateY(0); }
.sheet-huelle.ziehen .sheet { transition: none; }
.sheet-griff { flex: none; height: 18px; display: grid; place-items: center; touch-action: none; }
.sheet-griff::before { content: ""; width: 36px; height: 5px; border-radius: 3px; background: var(--fuell2); }
.sheet-kopf {
  flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 8px 6px; touch-action: none;
}
.sheet-kopf h2 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.sheet-kopf .links { justify-self: start; }
.sheet-kopf .rechts { justify-self: end; }
.sheet-kopf-knopf { border: 0; background: none; color: var(--akzent); font-size: 17px; min-height: 44px; padding: 0 10px; }
.sheet-kopf-knopf.fett { font-weight: 600; }
.sheet-inhalt {
  flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 4px var(--rand) calc(var(--unten) + 20px);
}
.sheet-huelle.mit-tastatur .sheet-inhalt { padding-bottom: 14px; }

/* Formular im Sheet */
.gruppe { background: var(--karte); border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.gruppe-titel { padding: 0 4px 6px; font-size: 13px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 500; }
.reihe { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 14px; position: relative; }
.reihe + .reihe::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 0.5px; background: var(--trenner); }
.reihe-label { flex: 1 1 auto; font-size: 17px; min-width: 0; }
.reihe-label small { display: block; font-size: 13px; color: var(--text2); }
.reihe-wert { color: var(--text2); font-size: 17px; text-align: right; }
.reihe.spalte { flex-direction: column; align-items: stretch; gap: 8px; padding-top: 12px; padding-bottom: 12px; }
.reihe input[type="text"], .reihe input[type="url"], .reihe input[type="number"], .reihe textarea {
  width: 100%; border: 0; outline: 0; background: transparent; padding: 0; min-height: 36px; font-size: 17px;
}
.reihe textarea { resize: none; line-height: 1.35; min-height: 72px; }
.titel-feld { font-size: 20px !important; font-weight: 600; min-height: 30px !important; }
.reihe input[type="date"] {
  border: 0; outline: 0; background: var(--fuell); border-radius: 8px; padding: 6px 10px; min-height: 36px; font-size: 16px; color: var(--text);
  min-width: 140px; -webkit-appearance: none; appearance: none; text-align: center;
}
.reihe input[type="date"]:invalid, .reihe input[type="date"].leer { color: var(--text3); }
.feld-leeren { width: 36px; height: 36px; border: 0; border-radius: 18px; background: none; color: var(--text3); display: grid; place-items: center; padding: 0; flex: none; }
.feld-leeren svg { width: 20px; height: 20px; }
.nurlesen { color: var(--text); font-size: 17px; white-space: pre-wrap; overflow-wrap: anywhere; }
.nurlesen.leer { color: var(--text3); }
.schloss { color: var(--text3); font-size: 13px; display: inline-flex; gap: 4px; align-items: center; }
.schloss .ik { font-size: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 12px;
  border: 0; border-radius: 18px; background: var(--fuell); color: var(--text); font-size: 15px; font-weight: 500;
}
.chip .emoji { font-size: 16px; line-height: 1; }
.chip.an { background: var(--akzent); color: #fff; }
.chip.an.hutfarbe { background: var(--hut, var(--akzent)); }
.chip:disabled { opacity: 0.5; }

.segment { display: flex; background: var(--fuell); border-radius: 9px; padding: 2px; gap: 2px; }
.segment button {
  flex: 1; border: 0; background: none; border-radius: 7px; min-height: 36px; font-size: 14px; font-weight: 500; color: var(--text); padding: 0 4px;
  white-space: nowrap;
}
.segment button.an { background: var(--karte); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); font-weight: 600; }
@media (prefers-color-scheme: dark) { .segment button.an { background: #636366; } }

.schalter { position: relative; width: 51px; height: 31px; flex: none; }
.schalter input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.schalter span { position: absolute; inset: 0; border-radius: 16px; background: var(--fuell2); transition: background .2s; pointer-events: none; }
.schalter span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); transition: transform .2s; }
.schalter input:checked + span { background: var(--gruen); }
.schalter input:checked + span::after { transform: translateX(20px); }

.hinweis {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px;
  background: var(--hubspot-weich); color: var(--text); font-size: 14px; line-height: 1.35;
}
.hinweis .ik { color: var(--hubspot); font-size: 18px; margin-top: 1px; }
.hinweis-text { flex: 1; }
.hinweis-text strong { display: block; margin-bottom: 2px; }
.meta-liste { font-size: 13px; color: var(--text2); line-height: 1.6; padding: 0 4px 16px; }
.knopf-reihe { display: flex; gap: 10px; }
.gruppe-abstand { margin: -4px 0 16px; }
.knopf-reihe .knopf { flex: 1; }
.knopf-klein { min-height: 36px; padding: 0 12px; font-size: 15px; border-radius: 9px; }

/* Schnell anlegen */
.schnell-zeile { display: flex; align-items: center; gap: 8px; background: var(--karte); border-radius: 12px; padding: 4px 4px 4px 14px; margin-bottom: 12px; }
.schnell-zeile input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; height: 44px; font-size: 17px; }
.senden { width: 40px; height: 40px; border-radius: 20px; border: 0; background: var(--akzent); color: #fff; display: grid; place-items: center; flex: none; padding: 0; }
.senden:disabled { background: var(--fuell2); color: var(--text3); }
.senden svg { width: 22px; height: 22px; }
.schnell-label { font-size: 13px; color: var(--text2); margin: 0 0 6px 4px; }
.schnell-block { margin-bottom: 12px; }
.schnell-info { font-size: 13px; color: var(--text2); margin: 2px 4px 10px; min-height: 1.3em; }
.schnell-info.ok { color: var(--gruen); }
.datum-chip { position: relative; overflow: hidden; }
.datum-chip input[type="date"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; border: 0; }

/* Aktionsliste (Action Sheet) */
.aktionen { background: var(--karte); border-radius: 13px; overflow: hidden; margin-bottom: 10px; }
.aktion {
  width: 100%; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px;
  border: 0; background: none; font-size: 17px; color: var(--text); text-align: left; position: relative;
}
.aktion + .aktion::before { content: ""; position: absolute; top: 0; left: 50px; right: 0; height: 0.5px; background: var(--trenner); }
.aktion .ik { font-size: 22px; color: var(--akzent); width: 22px; }
.aktion .aktion-text { flex: 1; }
.aktion .aktion-wert { color: var(--text2); font-size: 15px; }
.aktion.rot, .aktion.rot .ik { color: var(--rot); }
.aktion:active { background: var(--fuell); }
.aktion-titel { padding: 2px 4px 12px; font-size: 15px; color: var(--text2); text-align: center; overflow-wrap: anywhere; }

@media (min-width: 640px) {
  .inhalt, .kopf > :not(.kopf-leiste) { max-width: 640px; margin-left: auto; margin-right: auto; }
  .sheet { left: 50%; right: auto; width: 560px; margin-left: -280px; }
}

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

/* Hinweis oben im Sheet (z. B. „wird noch gespeichert“) */
.sheet-hinweis {
  margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--orange-weich); color: var(--orange-text);
  font-size: 15px; line-height: 1.35;
}
/* Nicht oeffenbarer Link: nur als Text */
.link-text { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; margin: 0 0 12px; border-radius: 12px; background: var(--karte); font-size: 14px; }
.link-text-label { color: var(--text3); font-size: 12px; font-weight: 600; }
.link-text-wert { color: var(--text2); overflow-wrap: anywhere; word-break: break-all; user-select: text; -webkit-user-select: text; }
.knopf-reihe .link-text { margin: 0; flex: 1; min-width: 0; }
.link-knopf { display: contents; }
.schnell-info.warnung { color: var(--orange-text); }
