/* Alle Farben als Variablen auf :root; dunkles Set unter :root[data-theme="dark"].
   Ausserhalb dieser Blöcke keine Hex-Farben. */
:root {
  color-scheme: light;
  --bg: #fafafa;            /* Seitenhintergrund */
  --flaeche: #ffffff;       /* Karten, Kopfzeile, Felder */
  --text: #1c1c1c;
  --text-gedaempft: #5f6368;
  --rand: #d0d0d0;
  --akzent: #2a6ebb;        /* Flächen mit weissem Text (Buttons, Termine) */
  --akzent-text: #2a6ebb;   /* Links und Hervorhebungen auf dem Hintergrund */
  --akzent-aktiv: #1d4f8a;
  --auf-akzent: #ffffff;
  --fehler: #b3261e;
  --fehler-bg: #fdecea;
  --heute-bg: #fff8dc;
  --hover-bg: #eef3fa;
  --termin: #2a6ebb;        /* Farbbalken der Termine (Handy-Agenda) */
  --schatten: rgba(0, 0, 0, .4);         /* Hintergrund hinter dem Blatt */
  --schatten-leicht: rgba(0, 0, 0, .12);
  --snack-bg: #2b2f36;
  --snack-text: #f2f2f2;
  --snack-aktion: #8ab8ff;

  --fc-page-bg-color: var(--flaeche);
  --fc-neutral-bg-color: var(--bg);
  --fc-neutral-text-color: var(--text-gedaempft);
  --fc-border-color: var(--rand);
  --fc-event-bg-color: var(--akzent);
  --fc-event-border-color: var(--akzent);
  --fc-event-text-color: var(--auf-akzent);
  --fc-today-bg-color: var(--heute-bg);
  --fc-list-event-hover-bg-color: var(--hover-bg);
  --fc-now-indicator-color: var(--fehler);
  --fc-button-bg-color: var(--akzent);
  --fc-button-border-color: var(--akzent);
  --fc-button-text-color: var(--auf-akzent);
  --fc-button-hover-bg-color: var(--akzent-aktiv);
  --fc-button-hover-border-color: var(--akzent-aktiv);
  --fc-button-active-bg-color: var(--akzent-aktiv);
  --fc-button-active-border-color: var(--akzent-aktiv);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121417;
  --flaeche: #1c1f24;
  --text: #e6e6e6;
  --text-gedaempft: #a3a8b0;
  --rand: #343941;
  --akzent: #2f6ab8;
  --akzent-text: #7fb3ff;
  --akzent-aktiv: #245294;
  --auf-akzent: #ffffff;
  --fehler: #ff8a80;
  --fehler-bg: #3a1d1b;
  --heute-bg: #2a2d1a;
  --hover-bg: #262a31;
  --termin: #5b93e0;
  --schatten: rgba(0, 0, 0, .6);
  --schatten-leicht: rgba(0, 0, 0, .4);
  --snack-bg: #e6e6e6;
  --snack-text: #1c1c1c;
  --snack-aktion: #1d4f8a;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-bottom: 6rem; }
body { margin: 0; font: 16px/1.5 system-ui, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--akzent-text); }

/* Kopfzeile: Laptop mit Bereich-Umschalter, Thema, Benutzer; Handy siehe unten (.kopf-handy) */
.kopf { display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  padding: .6rem 1rem; padding-top: calc(.6rem + env(safe-area-inset-top));
  border-bottom: 1px solid var(--rand); background: var(--flaeche); }
.marke { font-weight: 700; text-decoration: none; color: var(--text); font-size: 1.1rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.kopf nav { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.kopf .heute { color: var(--akzent-text); text-decoration: none; font-weight: 600; }
.kopf .knopf { padding: .5rem 1rem; min-height: 2.75rem; }
.kopf .benutzer { color: var(--text-gedaempft); font-size: .9rem; max-width: 14rem; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.logout { display: inline; margin: 0; }
.logout .knopf { padding: .5rem .9rem; min-height: 2.75rem; }

.inhalt { max-width: 40rem; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.5rem; margin: .5rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.hinweis { color: var(--text-gedaempft); }
.fehler { background: var(--fehler-bg); border: 1px solid var(--fehler); color: var(--fehler);
  padding: .75rem 1rem; border-radius: .4rem; }

/* Thema-Umschalter: System / Hell / Dunkel */
.thema { display: inline-flex; border: 1px solid var(--rand); border-radius: .5rem; overflow: hidden; }
.thema button { font: inherit; font-size: .85rem; padding: .35rem .6rem; border: 0; background: var(--flaeche);
  color: var(--text-gedaempft); cursor: pointer; min-height: 2.75rem; }
.thema button + button { border-left: 1px solid var(--rand); }
.thema button[aria-pressed="true"] { background: var(--akzent); color: var(--auf-akzent); }

.formular label { display: block; margin-bottom: 1rem; font-weight: 600; }
.formular label small { font-weight: 400; color: var(--text-gedaempft); }
.formular input[type=text], .formular input[type=datetime-local], .formular input[type=date],
.formular textarea {
  display: block; width: 100%; margin-top: .25rem; padding: .7rem .8rem; font: inherit;
  border: 1px solid var(--rand); border-radius: .4rem; background: var(--flaeche); color: var(--text);
}
.formular fieldset { border: 1px solid var(--rand); border-radius: .4rem; padding: .75rem 1rem; margin: 0 0 1rem; }
.formular legend { font-weight: 600; padding: 0 .3rem; }
label.zeile { display: flex; align-items: center; gap: .6rem; font-weight: 400; margin-bottom: .6rem; min-height: 2.75rem; }
label.zeile input { width: 1.3rem; height: 1.3rem; accent-color: var(--akzent); }

.knopf { display: inline-block; padding: .8rem 1.2rem; min-height: 3rem; border-radius: .5rem;
  border: 1px solid var(--rand); background: var(--flaeche); color: var(--text); text-decoration: none;
  font: inherit; font-weight: 600; cursor: pointer; text-align: center; }
.knopf.primaer { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); }
.knopf.gefahr { background: var(--fehler); border-color: var(--fehler); color: var(--bg); }
.knopf:active, .thema button:active {
  filter: brightness(.85); transform: translateY(1px); }
.aktionen { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.5rem 0; }
.aktionen .knopf { flex: 1 1 10rem; }

.details { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; }
.details dt { font-weight: 600; }
.details dd { margin: 0; }
.notiz { white-space: pre-wrap; }
.erinnerungen { list-style: none; padding: 0; margin: 0; }
.erinnerungen li { padding: .5rem 0; border-bottom: 1px solid var(--rand); display: flex;
  justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.erinnerungen .status { color: var(--text-gedaempft); }
.loeschen { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--rand); }
.loeschen .knopf { width: 100%; margin-top: .5rem; }

/* Kalenderansicht */
.kalenderseite { max-width: 87.5rem; }
#kalender { background: var(--flaeche); padding: .5rem; border: 1px solid var(--rand); border-radius: .5rem; }
.fc .fc-toolbar-title { font-size: 1.2rem; }
.fc .fc-button { text-transform: none; }
.fc a { color: inherit; }
.fc .fc-list-day-cushion { background: var(--bg); }
/* Glocke bei offener Erinnerung: SVG als Maske, Farbe = Textfarbe (kein Unicode-Symbol) */
.mit-erinnerung .fc-event-title::before,
.mit-erinnerung .fc-list-event-title a::before {
  content: ""; display: inline-block; width: .85em; height: .85em; margin-right: .25em; vertical-align: -.05em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 16.5V11a6 6 0 0 1 12 0v5.5l1.5 1.5h-15z'/><path d='M10 20.5a2 2 0 0 0 4 0'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 16.5V11a6 6 0 0 1 12 0v5.5l1.5 1.5h-15z'/><path d='M10 20.5a2 2 0 0 0 4 0'/></svg>") center / contain no-repeat;
}
.icon { display: block; flex-shrink: 0; }

/* ICS-Seite */
.kopierfeld { display: flex; gap: .5rem; margin: 1rem 0 .5rem; }
.kopierfeld input { flex: 1 1 auto; min-width: 0; min-height: 2.75rem; padding: .5rem .7rem; font: inherit;
  font-size: .9rem; border: 1px solid var(--rand); border-radius: .4rem; background: var(--flaeche); color: var(--text); }
.kopierfeld .knopf { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.75rem; padding: .5rem 1rem; }

/* Login */
.login { text-align: center; padding-top: 15vh; }
.login .knopf { width: 100%; max-width: 20rem; }

/* Umschalter Kalender | Listen (Kopfzeile) */
.bereich { display: inline-flex; border: 1px solid var(--rand); border-radius: .5rem; overflow: hidden;
  flex-shrink: 0; }
.bereich a { display: flex; align-items: center; padding: .35rem .9rem; min-height: 2.75rem;
  text-decoration: none; color: var(--text-gedaempft); background: var(--flaeche); font-weight: 600; }
.bereich a + a { border-left: 1px solid var(--rand); }
.bereich a[aria-current="page"] { background: var(--akzent); color: var(--auf-akzent); }

/* Listen */
.listenseite { max-width: 43.75rem; }
.listen { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.listen a { display: flex; align-items: center; min-height: 3.5rem; padding: .5rem .25rem;
  border-bottom: 1px solid var(--rand); color: var(--text); text-decoration: none; font-size: 1.15rem; }
.hinzufuegen { display: flex; gap: .5rem; margin: 0 0 1rem; }
.hinzufuegen input, .hinzufuegen textarea { flex: 1 1 auto; min-width: 0; min-height: 3rem;
  padding: .7rem .8rem; font: inherit; font-size: 1.125rem; border: 1px solid var(--rand);
  border-radius: .5rem; background: var(--flaeche); color: var(--text); }
.hinzufuegen textarea { resize: none; overflow: hidden; line-height: 1.4; }
.hinzufuegen .knopf { flex: 0 0 auto; min-width: 3rem; font-size: 1.25rem; padding: .5rem 1rem; }

.eintraege { list-style: none; padding: 0; margin: 0; }
.eintrag { display: grid; grid-template-columns: 1fr auto; align-items: center;
  border-bottom: 1px solid var(--rand); }
.eintrag form.umschalten { margin: 0; min-width: 0; }
.eintrag-knopf { display: flex; align-items: center; gap: .85rem; width: 100%; min-height: 3rem;
  padding: .6rem .25rem; border: 0; background: none; color: var(--text); font: inherit;
  font-size: 1.15rem; text-align: left; cursor: pointer; }
.eintrag-text { overflow-wrap: anywhere; }
.box { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: 1.5rem;
  height: 1.5rem; border: 2px solid var(--text-gedaempft); border-radius: .3rem; color: transparent; }
.erledigt .box { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); }
.erledigt .eintrag-text { text-decoration: line-through; color: var(--text-gedaempft); }
.werkzeug { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem;
  min-height: 2.75rem; padding: 0 .6rem; border: 1px solid transparent; border-radius: .4rem;
  background: none; color: var(--text-gedaempft); font: inherit; font-size: 1.15rem;
  text-decoration: none; cursor: pointer; }
.eintrag-werkzeug .werkzeug { border-color: var(--rand); background: var(--flaeche); color: var(--text); }
.werkzeug.gefahr { color: var(--fehler); }
.eintrag-werkzeug { display: none; grid-column: 1 / -1; padding: 0 0 .75rem; }
.eintrag.bearbeiten .eintrag-werkzeug { display: block; }
.eintrag.bearbeiten .stift { color: var(--akzent-text); }
.bearbeiten-form { display: flex; gap: .5rem; margin: 0 0 .5rem; }
.bearbeiten-form input { flex: 1 1 auto; min-width: 0; min-height: 2.75rem; padding: .5rem .7rem; font: inherit;
  font-size: 1.1rem; border: 1px solid var(--rand); border-radius: .4rem; background: var(--flaeche);
  color: var(--text); }
.werkzeug-reihe { display: flex; gap: .5rem; flex-wrap: wrap; }
.werkzeug-reihe form { margin: 0; }
.werkzeug-reihe form:last-child { margin-left: auto; }

.erledigt-block, .listen-aktionen { margin-top: 1.5rem; }
.erledigt-block > summary, .listen-aktionen > summary { min-height: 3rem; display: flex; align-items: center;
  cursor: pointer; color: var(--text-gedaempft); font-weight: 600; }
.erledigt-block > form { margin-top: 1rem; }
.listen-aktionen { border-top: 1px solid var(--rand); padding-top: .5rem; }
.listen-aktionen .hinzufuegen { margin-top: .5rem; }
.knopf.breit { width: 100%; }
.eintrag-knopf:active, .werkzeug:active, .bereich a:active { filter: brightness(.85); }
@media (hover: hover) {
  .eintrag-knopf:hover, .listen a:hover { background: var(--hover-bg); }
}

.hinzufuegen .knopf .icon { margin: auto; }
.wisch { display: none; }

/* Listen-Chips (Handy und Laptop): rund, horizontal scrollbar, am Ende «+» */
.chips { display: flex; align-items: center; gap: .5rem; overflow-x: auto; padding: .5rem 0; margin: 0 0 .75rem;
  scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; gap: .4rem; height: 34px;
  padding: 0 14px; border-radius: 17px; background: var(--hover-bg); color: var(--text); text-decoration: none;
  font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.chip::after { content: ""; position: absolute; inset: -5px 0; }  /* Tippfläche 44 px hoch */
.chip-n { color: var(--text-gedaempft); font-weight: 500; font-variant-numeric: tabular-nums; }
.chip[aria-current="page"] { background: var(--text); color: var(--bg); }
.chip[aria-current="page"] .chip-n { color: inherit; opacity: .7; }
.chip-neu { flex: 0 0 auto; display: flex; align-items: center; gap: .5rem; }
.chip-neu > summary { list-style: none; }
.chip-neu > summary::-webkit-details-marker { display: none; }
.chip-plus { width: 34px; padding: 0; justify-content: center; background: none;
  border: 1.5px dashed var(--text-gedaempft); color: var(--text-gedaempft); }
.chip-form { margin: 0; }
.chip-form input { height: 34px; width: 11rem; padding: 0 12px; border-radius: 17px; border: 1px solid var(--rand);
  background: var(--flaeche); color: var(--text); font: inherit; font-size: 14px; }

/* Blatt von unten (Menü) und Snackbar */
.blatt-huelle { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end;
  background: var(--schatten); opacity: 0; transition: opacity .15s; }
.blatt-huelle[hidden] { display: none; }
.blatt-huelle.offen { opacity: 1; }
.blatt { width: 100%; max-width: 40rem; max-height: 85vh; overflow-y: auto; margin: 0 auto;
  padding: 6px 16px calc(12px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0;
  background: var(--flaeche); transform: translateY(24px); transition: transform .18s ease-out; }
.blatt-huelle.offen .blatt { transform: none; }
.blatt-griff { width: 36px; height: 4px; margin: 4px auto 8px; border-radius: 2px; background: var(--rand); }
.blatt-abschnitt { padding: 8px 0 14px; border-bottom: 1px solid var(--rand); }
.blatt-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text-gedaempft); }
.blatt-hinweis { margin: 8px 0 0; font-size: 13px; color: var(--text-gedaempft); }
.blatt-kopf { padding: 4px 0 10px; font-size: 13px; color: var(--text-gedaempft); border-bottom: 1px solid var(--rand); }
.blatt-frage { margin: 8px 0 4px; font-size: 17px; font-weight: 650; }
.blatt .segment { display: flex; gap: 3px; padding: 3px; border: 0; border-radius: 10px; background: var(--bg); }
.blatt .segment button { flex: 1 1 0; min-height: 44px; padding: 0 .5rem; border: 0; border-radius: 8px;
  background: none; color: var(--text-gedaempft); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.blatt .segment button + button { border-left: 0; }
.blatt .segment button[aria-pressed="true"] { background: var(--flaeche); color: var(--text);
  box-shadow: 0 1px 3px var(--schatten-leicht); }
.blatt-form { margin: 0; }
.blatt-zeile { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0;
  border: 0; border-bottom: 1px solid var(--rand); background: none; color: var(--text); font: inherit;
  font-size: 15px; text-align: left; text-decoration: none; cursor: pointer; }
.blatt-zeile > span:first-of-type { flex: 1 1 auto; }
.blatt-zeile > .icon:last-child { color: var(--text-gedaempft); }
.blatt-zeile .gedaempft { flex: 0 1 auto; max-width: 60%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 13px; color: var(--text-gedaempft); }
.blatt-zeile.gefahr { color: var(--fehler); }
.blatt-seite > :last-child, .blatt-seite > :last-child .blatt-zeile,
.blatt > .blatt-form:last-child .blatt-zeile { border-bottom: 0; }
.blatt-eingabe { margin: 8px 0 0; }
.blatt-eingabe input { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--rand);
  border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 15px; }
.blatt-knoepfe { display: flex; gap: 8px; margin-top: 16px; }
.blatt-knoepfe .knopf { flex: 1 1 0; min-height: 44px; padding: .5rem 1rem; }
.snackbar { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40;
  display: flex; align-items: center; gap: 12px; max-width: 30rem; min-height: 48px; margin: 0 auto;
  padding: 0 6px 0 16px; border-radius: 10px; background: var(--snack-bg); color: var(--snack-text);
  font-size: 15px; box-shadow: 0 2px 10px var(--schatten-leicht); }
.snackbar[hidden] { display: none; }
.snackbar-text { flex: 1 1 auto; }
.snackbar-aktion { min-height: 44px; padding: 0 10px; border: 0; background: none; color: var(--snack-aktion);
  font: inherit; font-weight: 700; cursor: pointer; }
.snackbar-aktion[hidden] { display: none; }

/* Notizen: Textfeld ohne Rahmen über die restliche Höhe, Speicherstatus, Konflikthinweis */
.notizseite { max-width: 900px; display: flex; flex-direction: column; height: calc(100vh - 4.1rem); padding-bottom: 1rem; }
.notizseite .chips { flex: 0 0 auto; margin-bottom: .25rem; }
.notiz-form { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; margin: 0; }
.notiz-form textarea { flex: 1 1 auto; display: block; width: 100%; min-height: 8rem; margin: 0; padding: 16px;
  border: 0; border-radius: .5rem; outline: none; resize: none; background: var(--flaeche); color: var(--text);
  font: inherit; font-size: 15px; line-height: 1.5; }
.notiz-form textarea:focus-visible { box-shadow: 0 0 0 2px var(--hover-bg); }
.notiz-ohne-js { padding-top: .75rem; }
.speicherstatus { font-size: 13px; color: var(--text-gedaempft); white-space: nowrap; }
.speicherstatus[data-art="warnung"] { color: var(--fehler); }
.konflikt { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  margin: 0 0 .5rem; padding: .6rem .75rem; border-radius: .5rem; background: var(--fehler-bg); color: var(--text); }
.konflikt[hidden] { display: none; }
.konflikt-text { flex: 1 1 12rem; font-weight: 600; }
.konflikt-knoepfe { display: flex; gap: .5rem; flex-wrap: wrap; }
.konflikt .knopf { display: inline-flex; align-items: center; min-height: 44px; padding: .4rem .9rem;
  font-size: 14px; line-height: 1.2; }
.hinweis.klein { font-size: 13px; }

/* Handy-Bausteine: auf dem Laptop aus */
.kopf-handy, .tabs, .fab, .nur-handy { display: none; }

/* ============================================================================
   Handy (< 700 px): eine Kopfzeile, eine Tab-Leiste unten, Inhalt ohne Kästen
   ============================================================================ */
@media (max-width: 699px) {
  body { font-size: 15px; }
  .nur-laptop, .kopf .marke, .kopf .bereich { display: none; }
  .kopf .nav-laptop { display: none; }  /* .kopf nav wäre sonst spezifischer */
  .kopf { position: sticky; top: 0; z-index: 20; height: calc(52px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 4px 0 16px; border-bottom: 0; background: var(--bg); }
  .kopf-handy { display: flex; align-items: center; justify-content: space-between; gap: 8px;
    width: 100%; height: 52px; min-width: 0; }
  .handy-titel { display: inline-flex; align-items: center; gap: 4px; min-width: 0; min-height: 44px; padding: 0;
    border: 0; background: none; color: var(--text); font: inherit; font-size: 19px; font-weight: 650;
    text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
  .monat-knopf .icon { color: var(--text-gedaempft); transition: transform .2s; }
  .monat-knopf[aria-expanded="true"] .icon { transform: rotate(180deg); }
  .handy-aktionen { display: flex; flex-shrink: 0; }
  .icon-knopf { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
    padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text); cursor: pointer; }
  .icon-knopf:active { background: var(--hover-bg); }

  .inhalt { padding: 0 16px 16px; }
  body.mit-tabs { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  h1 { font-size: 19px; margin: 12px 0; }
  h2 { font-size: 15px; }
  .aktionen .knopf { flex-basis: 100%; }

  /* Tab-Leiste */
  .tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--rand); background: var(--flaeche); }
  .tabs a { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; color: var(--text-gedaempft); font-size: 11px; font-weight: 600; text-decoration: none; }
  .tabs a[aria-current="page"] { color: var(--akzent-text); }
  .tabs a:active { background: var(--hover-bg); }
  .snackbar { bottom: calc(60px + 12px + env(safe-area-inset-bottom)); }

  /* +-Button, schwebend über der Tab-Leiste */
  .fab { display: flex; position: fixed; right: 16px; bottom: calc(60px + 16px + env(safe-area-inset-bottom));
    z-index: 25; width: 52px; height: 52px; align-items: center; justify-content: center; border-radius: 50%;
    background: var(--akzent); color: var(--auf-akzent); box-shadow: 0 2px 8px var(--schatten-leicht); }
  .fab:active { filter: brightness(.9); transform: scale(.96); }

  /* Kalender: Wochenstreifen bzw. Monat */
  .nur-handy { display: block; }
  .kalenderseite { padding: 0; }
  .streifen { position: sticky; top: calc(52px + env(safe-area-inset-top)); z-index: 10; padding: 0 8px 4px;
    border-bottom: 1px solid var(--rand); background: var(--bg); touch-action: pan-y; }
  .wochentage, .tage { display: grid; grid-template-columns: repeat(7, 1fr); }
  .wochentage span { font-size: 12px; line-height: 18px; text-align: center; color: var(--text-gedaempft); }
  .tag { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 44px; padding: 2px 0;
    border: 0; background: none; color: var(--text); font: inherit; cursor: pointer;
    -webkit-tap-highlight-color: transparent; }
  .kreis { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px;
    border: 1.5px solid transparent; border-radius: 50%; font-size: 15px; font-variant-numeric: tabular-nums; }
  .tag.heute .kreis { border-color: var(--akzent-text); color: var(--akzent-text); font-weight: 650; }
  .tag.gewaehlt .kreis { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); font-weight: 650; }
  .tag.anderer-monat { color: var(--text-gedaempft); opacity: .6; }
  .punkt { width: 5px; height: 5px; border-radius: 50%; }
  .punkt.hat { background: var(--text-gedaempft); }
  .tag.gewaehlt .punkt.hat { background: var(--akzent-text); }
  .tage[data-wisch="links"] { animation: wisch-links .2s ease-out; }
  .tage[data-wisch="rechts"] { animation: wisch-rechts .2s ease-out; }

  /* Agenda */
  .agenda { padding: 0 16px; }
  .agenda .fehler { margin: 12px 0 0; }
  .agenda-tag { padding: 12px 0 6px; border-bottom: 1px solid var(--rand); }
  .tageskopf { display: flex; align-items: baseline; gap: 8px; margin: 0 0 4px; font-size: 15px; font-weight: 700; }
  .agenda-tag.gewaehlt .tk-name { color: var(--akzent-text); }
  .tk-datum { font-size: 13px; font-weight: 400; color: var(--text-gedaempft); }
  .termin { display: grid; grid-template-columns: 48px 3px minmax(0, 1fr); column-gap: 10px; min-height: 44px;
    padding: 5px 0; color: var(--text); text-decoration: none; -webkit-tap-highlight-color: transparent; }
  .termin:active { background: var(--hover-bg); }
  .t-zeit { padding-top: 1px; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text-gedaempft); }
  .t-balken { border-radius: 2px; background: var(--termin); }
  .t-titel { display: block; font-size: 15px; font-weight: 550; line-height: 1.35; overflow-wrap: anywhere; }
  .glocke { display: inline-block; vertical-align: -1px; color: var(--text-gedaempft); }
  .t-zusatz { display: block; overflow: hidden; font-size: 13px; line-height: 1.35; white-space: nowrap;
    text-overflow: ellipsis; color: var(--text-gedaempft); }
  .keine { margin: 0 0 6px; font-size: 13px; color: var(--text-gedaempft); }
  .agenda-ende { margin: 0; padding: 16px 0 88px; font-size: 13px; text-align: center; color: var(--text-gedaempft); }
  .zeitraster { padding: 0 4px; }
  .zeitraster[hidden], .agenda[hidden] { display: none; }

  /* Listen */
  .listenseite { padding-top: 0; }
  .chips { margin: 0 -16px; padding: 6px 16px 8px; }
  .listenseite > .hinzufuegen { gap: 0; align-items: center; margin: 0 -16px; padding: 0 16px;
    border-bottom: 1px solid var(--rand); }
  .listenseite > .hinzufuegen textarea { min-height: 44px; padding: 11px 0; border: 0; border-radius: 0;
    background: none; font-size: 15px; }
  .listenseite > .hinzufuegen .knopf { order: -1; display: inline-flex; min-width: 44px; min-height: 44px;
    margin-left: -11px; padding: 0; border: 0; background: none; color: var(--text-gedaempft); }
  .listenseite > .fehler { margin: 8px 0; }
  .eintraege { margin: 0 -16px; }
  .eintrag { position: relative; grid-template-columns: minmax(0, 1fr); overflow: hidden; touch-action: pan-y; }
  .eintrag .stift { display: none; }
  .eintrag form.umschalten { position: relative; z-index: 1; padding: 0 16px; background: var(--bg);
    transition: transform .18s ease-out; }
  .eintrag.wischt form.umschalten { transition: none; }
  .eintrag.wisch-offen form.umschalten { transform: translateX(-176px); }
  .eintrag.erledigt.wisch-offen form.umschalten { transform: translateX(-88px); }
  .eintrag-knopf { gap: 12px; min-height: 44px; padding: 0; font-size: 15px; line-height: 1.35;
    -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
  .box { width: 20px; height: 20px; border: 1.5px solid var(--text-gedaempft); border-radius: 50%; }
  .box .icon { width: 12px; height: 12px; }
  .wisch { display: flex; position: absolute; top: 0; right: 0; bottom: 0; visibility: hidden; }
  .eintrag.wisch-offen .wisch, .eintrag.wischt .wisch { visibility: visible; }
  .wisch form { display: flex; margin: 0; }
  .wisch-knopf { display: flex; align-items: center; justify-content: center; width: 44px; min-height: 44px;
    padding: 0; border: 0; background: var(--hover-bg); color: var(--text); cursor: pointer; }
  .wisch-knopf.gefahr { background: var(--fehler); color: var(--bg); }
  .eintrag.bearbeiten form.umschalten { display: none; }
  .eintrag-werkzeug { padding: 4px 16px; }
  .eintrag.bearbeiten .eintrag-werkzeug { display: flex; align-items: center; gap: 8px; }
  .eintrag-werkzeug .bearbeiten-form { flex: 1 1 auto; margin: 0; }
  .bearbeiten-form input { font-size: 15px; }
  .werkzeug-reihe form { display: none; }
  .listenseite > .hinweis { margin: 12px 0; font-size: 13px; }
  .erledigt-block { margin-top: 16px; }
  .erledigt-block > summary { min-height: 44px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
  .erledigt .eintrag-text { color: var(--text-gedaempft); }

  /* Notizen: Höhe setzt notizen.js (visualViewport); bei offener Tastatur keine Tab-Leiste */
  .notizseite { display: block; height: auto; padding-bottom: 0; }
  .notizseite .chips { margin-bottom: 0; }
  .notiz-form { display: block; margin: 0 -16px; border-top: 1px solid var(--rand); }
  .notiz-form textarea { height: calc(100dvh - 52px - 50px - 60px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: 120px; border-radius: 0; background: none; }
  .notiz-form textarea:focus-visible { box-shadow: none; }
  .konflikt { margin: 0 0 8px; }
  .handy-aktionen .speicherstatus { align-self: center; margin-right: 2px; }
  body.tastatur .tabs { display: none; }
  body.mit-tabs.tastatur { padding-bottom: 0; }
}

@keyframes wisch-links { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes wisch-rechts { from { transform: translateX(-24px); opacity: .4; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .blatt, .blatt-huelle, .eintrag form.umschalten, .monat-knopf .icon { transition: none; }
  .tage[data-wisch] { animation: none; }
}
