/* Handy und iPad. Wird nach designs.css geladen und gilt für alle Designs.
   Aufbau: 1. für alle Geräte  2. Finger statt Maus (Handy, iPad)  3. iPad und schmale Fenster  4. Handy */

/* ---------- 1. Für alle Geräte ---------- */

html { -webkit-text-size-adjust: 100%; } /* iPhone vergrößert Text im Querformat sonst selbst */
/* iPhone als Home-Bildschirm-App: Weil die Seite unter die Statusleiste reicht, rechnet iOS die Seitenhöhe um genau
   diese Leiste zu kurz. Auf kurzen Seiten (Start mit wenigen Aufgaben) blieb unten ein Streifen in anderer Farbe.
   Die Seite ist deshalb mindestens um die Statusleiste höher als das Fenster */
@media (display-mode: standalone) {
  html { min-height: calc(100% + env(safe-area-inset-top)); }
}
button, [role="button"], .karte-aufgabe, .block { touch-action: manipulation; -webkit-tap-highlight-color: transparent; } /* kein Warten auf Doppeltipp */
.tab .icon { display: none; } /* Symbole der Tabs nur in der Handy-Leiste */
.fokus { overflow-x: clip; } /* Deko mancher Designs (z. B. Manga-Speedlines) ragt sonst seitlich hinaus */

/* Einstellungen: Jede Gruppe ist eine Karte wie in den Systemeinstellungen. Die Zeilen einer Gruppe bilden zusammen
   die Karte: die erste nach der Überschrift ist oben rund, die letzte unten. Gilt auch für „Darstellung“ auf der Design-Seite */
.einst-raster .abschnitt-titel { margin-bottom: 10px; }
.einst-raster .daten-karte { margin-top: 0 !important; }
.einst-zeile { padding: 13px 16px; background: var(--panel); border: 1px solid var(--line); border-width: 0 1px 1px; }
.abschnitt-titel + .einst-zeile { border-top-width: 1px; border-radius: 14px 14px 0 0; }
.einst-zeile:last-child, .einst-zeile:has(+ .abschnitt-titel) { border-radius: 0 0 14px 14px; }
.abschnitt-titel + .einst-zeile:last-child, .abschnitt-titel + .einst-zeile:has(+ .abschnitt-titel), .design-gruppe + .einst-zeile { border-radius: 14px; }
.design-gruppe + .einst-zeile { margin-bottom: 14px; }

/* Als Home-Bildschirm-App liegt die Seite unter der Statusleiste und um die Kamera-Aussparung herum */
.topbar {
  padding-top: env(safe-area-inset-top);
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
  height: calc(64px + env(safe-area-inset-top));
}
body.vollbild .fokus { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
body.vollbild .fokus-ecke-links { top: calc(18px + env(safe-area-inset-top)); }

/* ---------- 2. Finger statt Maus: größere Tippflächen ---------- */

@media (pointer: coarse) {
  /* Schrift in Eingabefeldern ab 16 px, sonst zoomt das iPhone beim Antippen hinein */
  input, select, textarea, .feld, .auswahl, .editor, .titel-feld,
  .eingabe-zeile input, .eingabe-zeile.kompakt input, .suche-zeile input, .einst-wochenziel input { font-size: 16px; }

  .tab { padding: 8px 12px; }
  .knopf { padding: 8px 13px; font-size: 13px; }
  .icon-knopf { width: 34px; height: 34px; }
  .rund-knopf { width: 36px; height: 36px; }
  .such-knopf { height: 36px; }
  .haken, .plan-spalte .haken { width: 24px; height: 24px; }
  .play { padding: 6px; margin: -4px; }
  .segment button { padding: 7px 11px; font-size: 13px; }
  .eingabe-zeile .segment button { padding: 6px 9px; font-size: 12px; }
  .eingabe-zeile.kompakt .icon-knopf { width: 30px; height: 30px; }
  .schalter { width: 44px; height: 26px; border-radius: 13px; }
  .schalter::after { top: 3px; left: 3px; width: 20px; height: 20px; }
  .schalter.an::after { left: 21px; }
  .menue-punkt { padding: 11px 10px; font-size: 14px; }
  .chip { padding: 4px 11px 4px 9px; font-size: 12px; }
  .sonstiges-knopf { padding: 10px 2px; }
  .editor-knopf { width: 34px; height: 34px; }
  .farb-wahl { gap: 10px; }
  .farb-wahl button { width: 28px; height: 28px; }
  .symbol-feld { padding: 10px 2px; }
  .emoji-feld { font-size: 22px; padding: 5px 0; }
  .dialog-zeile { min-height: 50px; }
  .zeit-zeile .feld { padding: 7px 8px; font-size: 16px; }

  .karte-zeile .knopf { padding: 6px 11px; font-size: 12px; }

  /* Kein Darüberfahren mit dem Finger: was sonst erst dann erscheint, ist immer sichtbar */
  .karte-mehr { opacity: 1; width: 32px; height: 32px; margin-right: -8px; }
  .editor-huelle.kompakt .editor-leiste { opacity: 1; }

  /* Wie in einer App: Gedrückthalten markiert keinen Text und öffnet kein Kopieren-Menü, außer in Eingabefeldern.
     Karten und Knöpfe geben beim Antippen sichtbar nach */
  body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  input, textarea, select, [contenteditable] { -webkit-user-select: text; user-select: text; }
  .karte-aufgabe:active, .bereich-kachel:active, .design-karte:active { transform: scale(0.98); }
  .knopf:active, .icon-knopf:active, .rund-knopf:active, .menue-punkt:active { opacity: 0.6; }

  /* Bereiche: gedrückt halten zum Ziehen, ohne dass das iPhone Text markiert */
  .bereich-kachel { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .bereich-kachel.ziehen { opacity: 0.6; transform: scale(0.97); }
}

/* ---------- 3. iPad hochkant und schmale Fenster ---------- */

@media (max-width: 1100px) {
  .einst-raster { grid-template-columns: 1fr 1fr; gap: 28px; }
  .einst-raster > :nth-child(2) { grid-row: span 2; } /* Präferenzen rechts, Daten und Aussehen links untereinander */
}

@media (max-width: 920px) {
  /* Suche nur als Lupe, damit alle Tabs in die Leiste passen */
  .such-knopf { width: 36px; padding: 0; justify-content: center; }
  .such-knopf span, .such-knopf kbd { display: none; }
  .topbar { gap: 12px; }
  main { padding: 22px 18px 40px; }
  .start-spalten { grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr); gap: 20px; }
  .rb-reihe.zwei { grid-template-columns: 1fr; }
  .wochen-box { width: 250px; }
}

/* iPad hochkant: Passt der rechte Teil des Seitenkopfs (z. B. Zeiten im Kalender) nicht daneben, rutscht er als Ganzes
   in die nächste Zeile, statt in drei Zeilen zu umbrechen */
@media (min-width: 701px) and (max-width: 920px) {
  .seiten-kopf { flex-wrap: wrap; row-gap: 12px; }
  .ziel-anzeige, .ziel-anzeige > * { white-space: nowrap; flex-shrink: 0; }
}

/* ---------- 4. Handy (bis 700 px breit) ---------- */

@media (max-width: 700px) {
  body { font-size: 14px; }

  /* Wie eine iPhone-App: oben keine Leiste, nur ein runder Knopf aus Glas (drei Punkte) rechts oben, der über der
     Seite schwebt. Logo und Lupe fallen weg, Suche und Kalender stehen im Menü. Die Überschrift der Seite steht
     groß links daneben. Kein Weichzeichner an der Leiste selbst, sonst hängt die untere Leiste an ihr fest */
  html[data-design] .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: auto;
    padding: calc(8px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 0 0;
    border: 0;
    background: none;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    pointer-events: none;
  }
  .topbar .logo, .such-knopf, .rund-knopf .icon:first-child, .nicht-handy { display: none; }
  .nur-handy { display: flex; }
  .rund-knopf .icon + .icon { display: block; }
  /* Unter der Statusleiste verschwimmt die Seite weich, damit Uhrzeit und Akku lesbar bleiben */
  html[data-design] .topbar::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: calc(env(safe-area-inset-top) + 14px);
    z-index: -1;
    border: 0;
    pointer-events: none;
    background: linear-gradient(color-mix(in srgb, var(--bg) 80%, transparent), color-mix(in srgb, var(--bg) 0%, transparent));
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    -webkit-mask-image: linear-gradient(#000 50%, transparent);
    mask-image: linear-gradient(#000 50%, transparent);
  }
  html[data-design] .topbar .rund-knopf {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
    background: linear-gradient(rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 60%), color-mix(in srgb, var(--bg) 55%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(1.8);
    backdrop-filter: blur(16px) saturate(1.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 6px 16px rgba(0, 0, 0, 0.12);
    color: var(--text);
    pointer-events: auto;
  }
  .topbar .menue { pointer-events: auto; }

  /* Tab-Leiste aus Glas, immer sichtbar, mit vier Tabs. Rechts daneben der Timer-Knopf (app.js: navKnopfZeichnen()).
     --knopf-breite: Breite des Timer-Knopfs, --aktiv: Stelle des aktiven Tabs. Als Home-Bildschirm-App sitzt die
     Leiste wie bei Apple dicht über dem Strich am unteren Rand */
  html[data-design] #tabs, .nav-knopf {
    position: fixed;
    top: auto;
    bottom: max(14px, calc(env(safe-area-inset-bottom) - 10px));
    z-index: 6;
    height: 60px;
    margin: 0;
    border: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
    border-radius: 30px;
    /* Glas: Hintergrund scheint weichgezeichnet durch, oben ein Lichtrand */
    background: linear-gradient(rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 60%), color-mix(in srgb, var(--bg) 60%, transparent);
    -webkit-backdrop-filter: blur(22px) saturate(1.8);
    backdrop-filter: blur(22px) saturate(1.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -1px 0 rgba(0, 0, 0, 0.08), 0 10px 28px rgba(0, 0, 0, 0.18);
  }
  html[data-design] #tabs {
    left: max(12px, env(safe-area-inset-left));
    right: calc(max(12px, env(safe-area-inset-right)) + var(--knopf-breite, 60px) + 8px);
    transform: none;
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 4px;
    overflow: hidden;
    pointer-events: auto; /* die Leiste liegt in .topbar, die keine Tipps annimmt: hier wieder einschalten */
    transition: right 0.35s cubic-bezier(0.3, 0, 0.2, 1);
  }

  /* Eingefahren (app.js setzt "klein" beim Scrollen nach unten): Die Leiste schrumpft zu einem runden Knopf mit dem
     Symbol des aktiven Tabs, so bleibt mehr von der Seite frei. Antippen oder Hochscrollen fährt sie wieder aus.
     Ohne aktiven Tab in der Leiste (Fokus, Kalender, Einstellungen, Design) bleibt sie ausgefahren */
  html[data-design] #tabs.klein:not(.ohne-linse) { right: calc(100% - max(12px, env(safe-area-inset-left)) - 60px); }
  html[data-design] #tabs.klein:not(.ohne-linse)::before { left: 4px; width: calc(100% - 8px); background: none; box-shadow: none; }
  html[data-design] #tabs.klein:not(.ohne-linse) .tab:not(.active) { flex-grow: 0; opacity: 0; }
  html[data-design] #tabs.klein:not(.ohne-linse) .tab span { max-height: 0; opacity: 0; margin-top: -3px; }

  /* Linse aus Glas hinter dem aktiven Tab, gleitet beim Wechsel zum neuen Tab */
  html[data-design] #tabs::before {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: calc(4px + var(--aktiv, 0) * (100% - 8px) / 4);
    width: calc((100% - 8px) / 4);
    border-radius: 26px;
    background: color-mix(in srgb, var(--text) 10%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 0 0 1px color-mix(in srgb, var(--text) 6%, transparent);
    transition: left 0.4s cubic-bezier(0.3, 1.35, 0.4, 1);
  }
  html[data-design] #tabs.ohne-linse::before { display: none; }
  body.ruhig #tabs::before { transition: none; }

  html[data-design] #tabs .tab {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 26px;
    background: none;
    box-shadow: none;
    text-shadow: none;
    color: color-mix(in srgb, var(--text) 62%, transparent);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif; /* Systemschrift: die kleinen Namen passen so in jedem Design */
    font-size: clamp(9px, 2.7vw, 10px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    transition: transform 0.2s ease, color 0.2s ease, flex-grow 0.35s cubic-bezier(0.3, 0, 0.2, 1), opacity 0.2s ease;
  }
  html[data-design] #tabs .tab.nicht-handy { display: none; }
  html[data-design] #tabs .tab.active { background: none; color: var(--text); box-shadow: none; }
  html[data-design] #tabs .tab:active { transform: scale(0.9); }
  .tab .icon { display: block; flex-shrink: 0; }
  .tab span { max-width: 100%; max-height: 14px; overflow: hidden; text-overflow: ellipsis; transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.25s ease; }
  body.ruhig #tabs, body.ruhig #tabs .tab, body.ruhig .tab span { transition: none; }

  /* Timer-Knopf: rund mit Stoppuhr. Läuft ein Timer, wird er zur Kapsel mit pulsierendem Punkt und der Zeit */
  .nav-knopf {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    right: max(12px, env(safe-area-inset-right));
    min-width: 60px;
    padding: 0 17px;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
  }
  .nav-knopf:active { transform: scale(0.92); }
  .nav-knopf.active { background: var(--text); color: var(--bg); }
  .nav-knopf.laeuft .icon { display: none; }
  .nav-knopf.laeuft { padding: 0 12px; font-size: 14px; } /* schmal halten, damit die Tab-Namen auch bei 320 px passen */
  body.vollbild .nav-knopf, html[data-design] body.vollbild #tabs { display: none; }
  .nav-zeit { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
  .nav-zeit::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: nav-puls 2s ease-in-out infinite; }
  .nav-zeit:empty { display: none; }

  /* Oben Platz für die Statusleiste, unten für die Tab-Leiste */
  html[data-design] main {
    padding: calc(12px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  html[data-design] body.vollbild main { padding: 0; }
  .waechter { margin: calc(58px + env(safe-area-inset-top)) 16px 0; }
  .waechter + main { padding-top: 14px; }
  .termin-name { flex-basis: 100%; }
  .termin-zeile { gap: 6px; }
  .termin-zeile .feld { padding: 4px 6px; width: 88px; min-width: 0; }
  .termin-zeile .knopf { padding-left: 10px; padding-right: 10px; }
  .bar-wert.ziel { width: 88px; }

  /* Nur das Nötige: Erklärtexte, Filter, „Oben/Unten“ beim Anlegen (Taste „Fertig“ legt an) und die Tagesleiste
     auf Start (steht im Kalender) fallen auf dem Handy weg */
  .untertitel, .hinweis, .reiter-zeile .label-klein, .filter-knopf, .eingabe-zeile .segment, .eingabe-zeile.kompakt .icon-knopf,
  .start-spalten .tagesleiste, main > .fokus .fokus-ecke-rechts { display: none; }
  .eingabe-zeile, .eingabe-zeile.kompakt { padding: 6px 6px 6px 2px; }

  /* Große Überschrift wie in Apple-Apps, rechts bleibt Platz für den Menü-Knopf */
  html[data-design] .seiten-kopf h1 { font-size: 30px; line-height: 36px; padding-right: 48px; }
  /* Designs mit sehr breiter Schrift: kleiner, damit auch „Wochenrückblick“ neben den Menü-Knopf passt */
  html[data-design="prisma"] .seiten-kopf h1 { font-size: 21px; }
  html[data-design="noir"] .seiten-kopf h1 { font-size: 26px; }
  html[data-design="synthwave"] .seiten-kopf h1 { font-size: 23px; }
  html[data-design="pixel"] .seiten-kopf h1 { font-size: 19px; }
  .seiten-kopf { position: relative; }
  html[data-design] .kopf-datum { display: block; margin-bottom: 2px; padding-top: 4px; color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif; font-size: 13px; line-height: 16px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
  /* Bereiche: „Neuer Bereich“ als rundes Plus neben dem Menü-Knopf */
  html[data-design] .kopf-plus { position: absolute; top: -2px; right: 48px; width: 40px; height: 40px; padding: 0; border-radius: 50%; justify-content: center; gap: 0; }
  .kopf-plus .knopf-text { display: none; }
  html[data-design] .kopf-plus .icon { width: 20px; height: 20px; }
  .seiten-kopf:has(.kopf-plus) h1 { padding-right: 96px; }

  /* Seitenköpfe untereinander statt nebeneinander */
  .seiten-kopf { flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 24px; }
  .kopf-rechts, .kopf-links { flex-wrap: wrap; }
  .start-zahlen { justify-content: space-between; gap: 18px; }
  .wochen-box { width: auto; flex: 1; max-width: 260px; }
  .abschnitt { margin-bottom: 32px; }
  .abschnitt-kopf { margin-bottom: 12px; }
  .karten { gap: 10px; }
  .karte-aufgabe { padding: 12px 14px 12px 13px; }
  .karte-zeile { margin-top: 8px; gap: 10px; }
  .eingabe-zeile { margin-bottom: 10px; padding: 5px 6px 5px 2px; }

  /* Start: nur die Liste */
  .start-spalten { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .karte-aufgabe .titel { font-size: 15px; }
  .eingabe-zeile input { text-overflow: ellipsis; } /* langer Hinweistext endet mit … statt abgeschnitten */

  /* Plan: Tage rasten beim Wischen ein */
  .plan-raster, html[data-design] .plan-raster { min-height: 0; scroll-snap-type: x mandatory; scroll-padding-left: 2px; }
  /* Standard: ein Tag füllt den Bildschirm, der nächste schaut rechts hervor. Kompakt: zwei Tage. Breit: genau ein Tag */
  .plan-spalte { scroll-snap-align: start; min-width: 0; flex-basis: calc(100vw - 100px); }
  .layout-kompakt .plan-spalte { flex-basis: calc((100vw - 60px) / 2); }
  .layout-breit .plan-spalte { flex-basis: calc(100vw - 48px); }
  .plan-spalte .karte-aufgabe .titel { font-size: 13px; }

  /* Kalender: Woche seitlich wischbar, damit die Blöcke lesbar bleiben */
  .kalender { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .kal-kopf, .kal-koerper { min-width: 620px; }
  .kal-koerper { min-height: 320px; }
  .zeitraum { min-width: 0; }

  /* Fokus */
  .fokus { padding-top: 52px; }
  body.vollbild .fokus { padding-top: env(safe-area-inset-top); }
  .fokus-zeit { font-size: clamp(56px, 19vw, 96px); }
  .fokus-ecke-rechts { max-width: calc(100% - 50px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .fokus-knoepfe { flex-wrap: wrap; justify-content: center; }

  /* Bereiche */
  .kennzahlen { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Kennzahlen: ohne Symbol und mit kleiner Schrift, damit auch „Abgeschlossene Bereiche“ ohne Trennstrich passt */
  .kennzahl { padding: 12px 10px; overflow-wrap: break-word; }
  .kennzahl-name { font-size: 11.5px; line-height: 1.3; letter-spacing: 0; }
  .kennzahl-name .icon { display: none; }
  .kennzahl .wert { font-size: 17px; }
  .bereich-raster { grid-template-columns: minmax(0, 1fr); }
  .bereich-kachel { min-height: 0; gap: 20px; } /* keine Lücke wie in der breiten Kachel am Mac */
  .kachel-text { max-width: none; }
  .reiter-zeile { flex-wrap: wrap; gap: 10px; }

  /* Rückblick */
  .rb-reihe.vier { grid-template-columns: 1fr 1fr; }
  .rb-reihe.zwei { grid-template-columns: minmax(0, 1fr); }
  .kachel { padding: 14px; min-width: 0; }
  .kachel .gross { font-size: 21px; }
  .saeulen { gap: 6px; }
  .verlauf, .verlauf-namen { gap: 4px; }
  .bar-name { width: 92px; }
  .bar-wert { width: 54px; }
  .legende { flex-wrap: wrap; gap: 8px 14px; }

  /* Einstellungen: eine Spalte, Karten wie oben unter „Für alle Geräte“, hier nur die Maße fürs Handy */
  .einst-raster { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .einst-raster > :nth-child(2) { grid-row: auto; }
  .einst-raster .abschnitt-titel { padding-left: 14px; margin-bottom: 9px; font-size: 12px; }
  .einst-raster .abschnitt-titel:not(:first-child) { margin-top: 30px !important; }
  .einst-raster .daten-karte { padding: 16px 14px; gap: 10px; }
  .einst-raster .daten-karte .knopf { min-height: 44px; font-size: 15px; border-radius: 12px; }
  .einst-raster .daten-karte .text { font-size: 13px; line-height: 1.45; }
  .einst-zeile { flex-wrap: wrap; gap: 12px 16px; min-height: 56px; padding: 13px 14px; }
  /* Text links nimmt den freien Platz, kleine Schalter und Auswahlen stehen rechts daneben */
  .einst-zeile > :first-child { flex: 1 1 150px; min-width: 0; }
  .einst-zeile .titel { font-size: 15px; line-height: 1.3; }
  .einst-zeile .text { max-width: none; margin-top: 4px; font-size: 12.5px; line-height: 1.45; }
  /* Auswahl-Knöpfe (z. B. 12/24 Stunden) bekommen eine eigene Zeile in voller Breite */
  .einst-zeile .segment { display: flex; flex: 1 1 100%; }
  .einst-zeile .segment button { flex: 1; padding: 9px 4px; font-size: 14px; }
  .einst-zeile .auswahl { max-width: 100%; min-height: 38px; } /* lange Einträge (Zeitzone) nicht breiter als der Bildschirm */
  .einst-zeile .knopf { min-height: 38px; font-size: 14px; }
  .einst-wochenziel, .einst-wochenziel input { font-size: 16px; }

  /* Suche: nur das Feld, Treffer erscheinen beim Tippen. Größere Zeilen für den Finger */
  .suche-zeile { padding: 0 14px; }
  .suche-zeile .icon { width: 18px; height: 18px; }
  .suche-zeile input { padding: 14px 0; }
  .suche-liste .menue-punkt { padding: 12px 10px; font-size: 15px; }
  .suche-liste .leer { padding: 16px 10px; color: var(--muted); font-size: 14px; text-align: center; }

  /* Design-Seite: „Darstellung“ als eigene Karte über den Kacheln, zwei Kacheln nebeneinander, nur Bild und Name */
  .design-gruppe + .einst-zeile { margin-bottom: 12px; }
  .design-raster { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .design-karte { padding: 6px 6px 9px; }
  .design-text { display: none; }
  .design-name { font-size: 12px; margin-top: 7px; }

  /* Fenster: fast volle Breite, sitzen unten am Daumen und fahren von unten herein. Hohe Fenster beginnen unter
     der Statusleiste. Die Suche bleibt oben, damit die Tastatur sie nicht verdeckt */
  .dialog-hintergrund { padding: calc(10px + env(safe-area-inset-top)) 8px calc(10px + env(safe-area-inset-bottom)); }
  .dialog { padding: 14px 14px 16px; border-radius: 14px; }
  .dialog:not(.suche) { margin-top: auto; animation: blatt-auf 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.08); }
  .dialog-hintergrund.zu .dialog:not(.suche) { animation: blatt-zu 0.22s ease-in forwards; }
  /* Griff oben: zeigt, dass man das Fenster nach unten wegwischen kann (ansichten.js: wischenZumSchliessen) */
  .dialog:not(.suche)::before { content: ""; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--line-2); margin: -6px auto 10px; }
  .dialog.bereich-fenster::before { margin-top: 8px; }
  /* Meldungen sitzen über der Tab-Leiste */
  .meldung-stapel { bottom: calc(max(14px, calc(env(safe-area-inset-bottom) - 10px)) + 72px); }
  .dialog-titel { font-size: 18px; }
  .dialog-zeile { flex-wrap: wrap; gap: 6px 12px; padding: 9px 0; }
  .dialog-name { width: 100%; }
  .dialog-fuss { flex-wrap: wrap; }
  .bereich-spalten { grid-template-columns: minmax(0, 1fr); }
  .bereich-rechts { border-left: 0; border-top: 1px solid var(--line); }
  .suche-liste { max-height: 60vh; }

  /* Aufgabenkarte: Timer-Knopf als runde Tippfläche rechts in der Zeile, wie der Abspielknopf in anderen Apps */
  .karte-zeile .play { margin: -7px -4px -7px auto; padding: 0; width: 34px; height: 34px; border-radius: 50%; align-items: center; justify-content: center; background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
  .karte-zeile .play .icon { width: 14px; height: 14px; }
  .karte-aufgabe.laeuft .play { background: var(--accent); color: var(--accent-text); }
  .karte-zeile .zeit { font-size: 13px; }

  /* Editor-Leiste (Fokus, Aufgabenfenster): eine Zeile zum seitlichen Wischen statt zwei halbvoller Zeilen */
  .editor-leiste { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .editor-leiste::-webkit-scrollbar { display: none; }
  .editor-leiste > * { flex-shrink: 0; }

  /* Menüs nie breiter als der Bildschirm */
  .menue { max-width: calc(100vw - 20px); }
  .menue.symbol-wahl { width: min(290px, calc(100vw - 40px)); }
}

@keyframes nav-puls { 50% { opacity: 0.35; transform: scale(0.8); } }
@keyframes blatt-auf { from { opacity: 0; transform: translateY(70px); } }
@keyframes blatt-zu { to { transform: translateY(100%); opacity: 0.6; } }
