/* ansicht-apps.css – Reiter „Apps“ (Teil D, 18.11.2026): Raster wie ein iPhone-Home-Bildschirm und App-Seite.
   Das Raster liegt ohne Karten direkt auf dem Seitengrund, damit die Original-Symbole leuchten (KONZEPT „Gestaltung“).
   Spalten: 4 bei 402/428 pt, 3 unter 360 pt, 6 ab 600 pt. Symbol 64 pt mit iOS-Rundung (bausteine.css), Name einzeilig mit „…“. */
@layer app {
  /* ---------- Suche und Chips ---------- */
  .apps-suche { position: relative; margin-block-end: var(--a3); }
  .apps-suche input[type="search"] { padding-inline-start: 40px; border-radius: 12px; background: var(--fuellung); border-color: transparent; -webkit-appearance: none; appearance: none; }
  .apps-suche input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
  .apps-lupe { position: absolute; inset-inline-start: 12px; inset-block-start: 50%; translate: 0 -50%; inline-size: 18px; block-size: 18px; fill: none; stroke: var(--text-2); stroke-width: 2.2; stroke-linecap: round; pointer-events: none; }
  .apps-chips { margin-block-end: var(--a4); }

  /* ---------- Bereiche: ruhige Zwischenüberschriften ---------- */
  .apps-bereich { margin-block-end: var(--a6); }
  .apps-bereich-titel { font-size: var(--fs-fussnote); font-weight: 600; color: var(--text-2); letter-spacing: .02em; padding-inline: var(--a1); margin-block-end: var(--a3); }

  /* ---------- Raster ---------- */
  .raster { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: var(--a5); column-gap: 0; }
  @media (max-width: 359px) { .raster { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  @media (min-width: 600px) { .raster { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
  .raster > li { display: flex; justify-content: center; min-inline-size: 0; }
  .kachel {
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    inline-size: 100%; min-inline-size: 0; padding: 6px 2px 4px; border-radius: 18px;
    text-decoration: none; color: var(--text); -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
  }
  .kachel .app-symbol { transition: transform 160ms var(--kurve), filter 160ms; }
  .kachel:active .app-symbol { transform: scale(.92); filter: brightness(.85); }
  @media (prefers-reduced-motion: reduce) { .kachel:active .app-symbol { transform: none; } }
  .kachel .app-symbol-bild { box-shadow: 0 1px 2px light-dark(rgb(0 0 0 / .10), rgb(0 0 0 / .45)), 0 3px 10px light-dark(rgb(0 0 0 / .08), rgb(0 0 0 / .30)); }
  .kachel-name {
    max-inline-size: 100%; padding-inline: 2px;
    font-size: 12px; font-weight: 500; line-height: 1.25; letter-spacing: -.005em; text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  /* Marken am Symbol etwas größer, Ring in der Farbe des Seitengrunds (kein Kartenweiß) */
  .kachel .app-symbol-zahl { min-inline-size: 22px; block-size: 22px; line-height: 22px; border-radius: 11px; font-size: 13px; inset-block-start: -7px; inset-inline-end: -8px; box-shadow: 0 0 0 2px var(--hg); }
  .kachel .app-symbol-lauf { inline-size: 14px; block-size: 14px; inset-block-end: -3px; inset-inline-end: -3px; box-shadow: 0 0 0 2.5px var(--hg); }

  /* ---------- Symbol anderswo antippbar (Heute, Offen, Verlauf): Tippfläche ≥ 44 pt ---------- */
  .ansicht:not([data-ansicht="apps"]) .app-symbol[data-app] { cursor: pointer; }
  .ansicht:not([data-ansicht="apps"]) .app-symbol[data-app]::before { content: ""; position: absolute; inset: max(-6px, calc((44px - var(--g)) / -2)); }

  /* ---------- App-Seite: Kopf ---------- */
  .app-kopf { display: grid; gap: var(--a4); margin-block: var(--a2) var(--a8); }
  .app-kopf-oben { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--a4); align-items: start; }
  .app-kopf .app-symbol-bild { box-shadow: 0 2px 4px light-dark(rgb(0 0 0 / .10), rgb(0 0 0 / .45)), 0 8px 20px light-dark(rgb(0 0 0 / .10), rgb(0 0 0 / .35)); }
  .app-kopf-text { display: grid; gap: 4px; min-inline-size: 0; }
  .app-name { font-size: 1.5rem; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; overflow-wrap: anywhere; }
  .app-kurz { font-size: var(--fs-neben); color: var(--text-2); line-height: 1.35; }
  .app-zustand { display: grid; gap: 1px; margin-block-start: 2px; }
  .app-zustand-satz { font-size: var(--fs-fussnote); color: var(--text-2); }
  .app-oeffnen svg { order: 2; }
  .app-links-titel { font-size: var(--fs-fussnote); font-weight: 600; color: var(--text-2); padding-inline: var(--a1); margin-block-end: var(--a2); }
  .link-zeile { display: flex; align-items: center; justify-content: space-between; gap: var(--a3); min-block-size: var(--tipp); padding: var(--a2) var(--a4); color: var(--akzent-text); font-weight: 600; text-decoration: none; }
  .link-zeile:active { background: var(--karte-2); }
  .liste > .link-zeile:first-child { border-start-start-radius: var(--r-karte); border-start-end-radius: var(--r-karte); }
  .liste > .link-zeile:last-child { border-end-start-radius: var(--r-karte); border-end-end-radius: var(--r-karte); }
  .link-name { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .link-pfeil { flex: none; inline-size: 18px; block-size: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
  .app-adresse { display: flex; align-items: center; gap: var(--a2); padding: var(--a3) var(--a4); border-radius: 12px; background: var(--karte-2); border: 1px solid var(--trenner); font-size: var(--fs-neben); color: var(--text-2); }
  .app-adresse svg { flex: none; inline-size: 18px; block-size: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .app-nichts { margin-block-end: var(--a6); }
  .app-zurueck-zeile { margin-block-start: var(--a4); }

  /* Zeilen ohne App-Symbol (auf der App-Seite wäre es überall dasselbe) */
  .zeile.ohne-symbol { grid-template-columns: minmax(0, 1fr) auto; min-block-size: 56px; }
  div.zeile.ohne-symbol { grid-template-columns: minmax(0, 1fr); }
  div.zeile.ohne-symbol > span:last-child:empty { display: none; }

  /* Läuft gerade */
  .app-lauf { display: grid; gap: var(--a2); }
  .app-lauf-name { font-weight: 600; overflow-wrap: anywhere; }
  .app-lauf-titel { overflow-wrap: anywhere; margin-block-start: -4px; }
  .app-lauf-zeit { display: flex; flex-wrap: wrap; align-items: center; gap: var(--a2) var(--a3); }

  /* Ideen: Feld zum Notieren (öffnet das Blatt mit dieser App) */
  .idee-feld {
    display: flex; align-items: center; gap: var(--a2); inline-size: 100%; min-block-size: var(--tipp); margin-block-start: var(--a3);
    padding: 10px var(--a3); border: 1px dashed light-dark(rgb(60 60 67 / .3), rgb(235 235 245 / .25)); border-radius: 12px;
    background: var(--karte); color: var(--text-2); font-size: var(--fs-text); text-align: start;
  }
  .idee-feld:active { background: var(--karte-2); }
  .idee-feld svg { flex: none; inline-size: 20px; block-size: 20px; fill: none; stroke: var(--akzent-text); stroke-width: 2.2; stroke-linecap: round; }
  .karte.liste + .idee-feld { margin-block-start: var(--a3); }

  /* Diese Woche: ruhige Zahlenreihe */
  .zahlenreihe { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--a3) var(--a2); margin: 0; }
  .zahl-posten { display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; }
  .zahl-wert { margin: 0; font-size: var(--fs-abschnitt); font-weight: 700; line-height: 1.15; letter-spacing: -.01em; white-space: nowrap; }
  .zahl-name { font-size: var(--fs-fussnote); color: var(--text-2); }
  .zahl-fuss { margin-block-start: var(--a3); }

  /* Verlauf */
  .verlauf-zeile { display: grid; gap: 2px; padding: var(--a3) var(--a4); }
  .verlauf-oben { display: flex; gap: 6px; font-size: var(--fs-fussnote); font-weight: 600; color: var(--text-2); }
  .verlauf-titel { font-weight: 500; overflow-wrap: anywhere; }
  .verlauf-zahlen { font-size: var(--fs-neben); color: var(--text-2); }
  .verlauf-ergebnisse { display: grid; gap: var(--a1); margin-block-start: var(--a2); }
  .verlauf-ergebnisse li { display: grid; gap: 1px; font-size: var(--fs-neben); overflow-wrap: anywhere; }
  .mehr-knopf { display: block; inline-size: 100%; min-block-size: var(--tipp); padding-inline: var(--a4); text-align: start; color: var(--akzent-text); font-weight: 600; }
  .liste > .mehr-knopf:last-child { border-end-start-radius: var(--r-karte); border-end-end-radius: var(--r-karte); }

  /* Erledigt (eingeklappt) */
  .erledigt-kopf { display: flex; align-items: center; gap: var(--a1); min-block-size: var(--tipp); list-style: none; cursor: pointer; margin-block-end: var(--a2); }
  .erledigt-kopf::-webkit-details-marker { display: none; }
  .erledigt-kopf::after { content: ""; inline-size: 9px; block-size: 9px; margin-inline-start: 6px; border-right: 2.4px solid var(--text-3); border-bottom: 2.4px solid var(--text-3); rotate: -45deg; transition: rotate var(--dauer); }
  .erledigt[open] .erledigt-kopf::after { rotate: 45deg; }
  .erledigt-hinweis { margin-inline-start: auto; order: 3; font-size: var(--fs-fussnote); color: var(--akzent-text); font-weight: 600; }

  /* Ablage */
  .ablage-zeile { display: grid; gap: var(--a1); padding: var(--a3) var(--a4); }
  .ablage-einzeilig { grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: var(--a3); }
  .ablage-einzeilig .nebentext { text-align: end; }
  .ablage-name { font-size: var(--fs-fussnote); font-weight: 600; color: var(--text-2); }
  .ablage-pfad { font-size: var(--fs-neben); overflow-wrap: anywhere; }
  .ablage-pfad + .ablage-pfad, .ablage-bericht + .ablage-bericht { margin-block-start: 6px; }
  .ablage-bericht { display: flex; justify-content: space-between; align-items: baseline; gap: var(--a3); font-size: var(--fs-neben); }
  .ablage-datei { min-inline-size: 0; overflow-wrap: anywhere; }
  .ablage-bericht .fussnote { flex: none; }
}

/* ---------- Nachschliff 18.11.: Jetzt wichtig, Kopfzeile, Platz-Satz, eingeklappte Ergebnisse ---------- */
@layer app {
  .jetzt-wichtig .apps-bereich-titel { color: var(--text); }
  .app-jetzt { display: flex; flex-wrap: wrap; gap: 2px var(--a3); margin-block-start: 4px; }
  .app-jetzt .marke { font-size: var(--fs-neben); }
  .zahl-rang { margin-block-start: var(--a3); font-size: var(--fs-neben); color: var(--text); }
  .ergebnis-knopf {
    display: flex; align-items: center; gap: 6px; min-block-size: 44px; margin-block-start: 2px;
    font-size: var(--fs-neben); font-weight: 600; color: var(--akzent-text); text-align: start;
  }
  .ergebnis-knopf::after { content: ""; inline-size: 7px; block-size: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; rotate: 45deg; translate: 0 -2px; transition: rotate var(--dauer); }
  .ergebnis-knopf[aria-expanded="true"]::after { rotate: -135deg; translate: 0 2px; }
  .verlauf-ergebnisse { margin-block-start: 0; }
}

/* ---------- Simulator-Probe 18.11.: Modell-Schild auf der App-Seite (vorher aus heute.css, dort entfallen) ---------- */
@layer app {
  .app-lauf .modell { font-size: var(--fs-fussnote); font-weight: 600; color: var(--text-2); padding: 2px 8px; border-radius: 6px; background: var(--fuellung); }
}
