/* Eliael als App (PWA) - Zusatz-Stile. Wird nach den Farben, aber VOR dem Inline-Stil der Seite geladen;
   darum tragen die Regeln hier ein vorangestelltes "html", damit sie sich gegen die Seitenstile durchsetzen,
   ohne dass diese geaendert werden muessen. Alles hier ist Zusatz: ohne diese Datei funktionieren die Seiten wie bisher.

   1. Sichere Raender (Notch, Home-Indikator, Querformat) - braucht viewport-fit=cover im Viewport-Meta.
   2. Tippen: kein Doppeltipp-Zoom auf Bedienelementen.
   3. Mitgrosse Handy-Hoehe (dvh) statt vh.
   4. Standalone (installierte App): Zurueck-Knopf.
   5. «Als App installieren»: Hinweis und Konto-Abschnitt. */

/* ---- 1. Sichere Raender ---- */
html header.kopf {
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
html main {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
html .hinweisfeld { right: max(14px, env(safe-area-inset-right, 0px)); }
html .zum-inhalt:focus { top: calc(8px + env(safe-area-inset-top, 0px)); left: calc(8px + env(safe-area-inset-left, 0px)); }
html body:not([data-seite]) {   /* Anmelden, Registrieren, Passwort vergessen: eigene Seiten ohne Kopf */
  padding-top: max(16px, env(safe-area-inset-top, 0px));
  padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (max-width: 700px) {
  html header.kopf {
    padding-left: max(10px, env(safe-area-inset-left, 0px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
  }
  html .hinweisfeld {
    left: max(14px, env(safe-area-inset-left, 0px));
    right: max(14px, env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 599px) {
  html nav.unten {
    padding-left: calc(4px + env(safe-area-inset-left, 0px));
    padding-right: calc(4px + env(safe-area-inset-right, 0px));
  }
  html .hinweisfeld { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}

/* ---- 2. Tippen ---- */
html a, html button, html summary, html label, html select, html input, html textarea {
  touch-action: manipulation;
}

/* ---- 3. Hoehe: dvh beruecksichtigt die ein-/ausfahrende Browserleiste ---- */
@supports (height: 100dvh) {
  html .tabelle-scroll { max-height: calc(100dvh - var(--kopf-hoehe, 74px) - 24px); }
  html .suche-treffer { max-height: 60dvh; }
  html body:not([data-seite]) { min-height: 100dvh; }
}

/* ---- 4. Standalone: Zurueck-Knopf (das Skript setzt html.app-standalone und baut den Knopf ein) ---- */
.app-zurueck { display: none; }
html.app-standalone .app-zurueck {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  min-width: 44px; min-height: 44px; padding: 0 10px 0 6px; margin: 0 4px 0 -6px;
  background: transparent; color: var(--blau-dunkel); border: 1px solid transparent; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
html.app-standalone .app-zurueck:hover { background: var(--hellblau); border-color: transparent; }
html.app-standalone .app-zurueck svg { width: 22px; height: 22px; fill: none; stroke: currentColor;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
@media (max-width: 420px) {
  /* Schmale Handys: Platz fuer Boersenstatus, Suche und Abmelden lassen - Knopf nur als Pfeil (Beschriftung bleibt fuer Vorlese-Geraete). */
  html.app-standalone .app-zurueck { padding: 0; margin-right: 0; justify-content: center; }
  html.app-standalone .app-zurueck .app-zurueck-text { position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; }
}

@media (max-width: 420px) {
  /* Mit Zurueck-Pfeil bleibt vom Boersenstatus nur der Punkt (Text steht im title), sonst wird er abgeschnitten. */
  html.app-standalone header.kopf.app-mit-zurueck .boerse .boerse-kurz { display: none; }
  html.app-standalone header.kopf.app-mit-zurueck .boerse { padding: 6px 9px; }
}

/* ---- 5. «Als App installieren» ---- */
.app-hinweis { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; padding: 10px 6px 10px 14px;
  background: var(--hellblau); border: 1px solid var(--blau); border-radius: 10px; color: var(--tinte);
  font-size: 13.5px; line-height: 1.45; }
.app-hinweis[hidden], .app-karte [hidden] { display: none; }
.app-hinweis .app-hinweis-text { flex: 1; min-width: 0; }
.app-hinweis .app-hinweis-text strong { display: block; margin-bottom: 2px; }
.app-hinweis .app-hinweis-knoepfe { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.app-hinweis .app-zu { flex: none; background: transparent; border: none; color: inherit; font-size: 22px; line-height: 1;
  padding: 0; width: 44px; height: 44px; min-height: 44px; cursor: pointer; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; margin-top: -6px; }
.app-hinweis .app-zu:hover { background: var(--schleier); border: none; }
.app-hinweis a, .app-karte a { color: var(--blau-dunkel); }
.app-karte .app-schritte { margin: 6px 0 10px; padding-left: 22px; line-height: 1.55; }
.app-karte p { margin: 0 0 10px; }
.app-karte .app-status { font-weight: 600; color: var(--gruen-dunkel); }
