/* NeXtMail Web – am Handy und Tablet wie eine App (nm-web-handy, webhandy.js). © 2026 by Sebastian Hirtreiter */

/* ---------------------------------------------------------------- Wischen auf einer Mail */
.nachricht.wh-wischt { overflow: hidden; touch-action: pan-y; background: var(--bg); }
.nachricht.wh-wischt::before { content: ""; position: absolute; inset: 0; background: var(--panel); transform: translateX(var(--wh-x, 0)); z-index: 0; }
.nachricht.wh-wischt.an::before { background: var(--sel); }
.nachricht.wh-wischt > :not(.wh-aktionen) { position: relative; z-index: 1; transform: translateX(var(--wh-x, 0)); }
.nachricht.wh-weich::before, .nachricht.wh-weich > :not(.wh-aktionen) { transition: transform .18s ease; }
.nachricht.wh-weich > .wh-aktionen { transition: width .18s ease; }
.wh-aktionen { position: absolute; top: 0; bottom: 0; z-index: 2; display: flex; align-items: stretch; overflow: hidden; width: 0; }
.wh-aktionen.links { left: 0; }
.wh-aktionen.rechts { right: 0; flex-direction: row-reverse; }
.wh-akt { flex: 0 0 72px; min-height: 44px; border: 0; margin: 0; padding: 0 2px; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; color: var(--muted); font: 600 11.5px/1.2 var(--schrift); }
.wh-pille { width: 56px; height: 36px; border-radius: 18px; background: var(--wh-f, #6c727f); color: #fff; display: flex; align-items: center; justify-content: center; }
.wh-pille svg.ic { width: 20px; height: 20px; color: #fff; }
.wh-beschr { max-width: 76px; overflow: hidden; text-align: center; line-height: 1.15; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }   /* nm-gleich: zweizeilig statt abgeschnitten */
.wh-akt:focus-visible .wh-pille { outline: 2px solid var(--text); outline-offset: 2px; }
.wh-akt.wh-nurlang { display: none; }
.wh-aktionen.wh-lang .wh-akt:not(.wh-langziel) { display: none; }
.wh-aktionen.wh-lang .wh-langziel { display: flex; flex: 1 1 auto; }
.wh-aktionen.links.wh-lang .wh-langziel { align-items: flex-end; padding-right: 10px; }
.wh-aktionen.rechts.wh-lang .wh-langziel { align-items: flex-start; padding-left: 10px; }
.wh-aktionen.wh-lang .wh-pille { transform: scale(1.08); transition: transform .12s; }

/* ---------------------------------------------------------------- „Mehr“-Blatt */
.dialog.wh-blatt { width: 420px; max-width: 100%; background: var(--bg); }
.wh-blatt .dialog-kopf { display: flex; align-items: center; gap: 12px; }
.wh-blatt .wh-blatt-bild { width: 40px; height: 40px; flex: none; font-size: 14px; }
.wh-blatt-titel { flex: 1; min-width: 0; }
.wh-blatt-titel h2 { margin: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wh-blatt-titel p { margin: 2px 0 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wh-blatt .dialog-inhalt { padding: 12px 14px calc(16px + env(safe-area-inset-bottom)); }
.wh-kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wh-kachel { min-height: 68px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; font: 14px/1.2 var(--schrift); padding: 8px; }
.wh-kachel svg.ic { width: 22px; height: 22px; }
.wh-kachel.gefahr { color: var(--gefahr); }
.wh-bgruppe { margin-top: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.wh-bz { width: 100%; min-height: 48px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; padding: 0 16px; font: 15px/1.3 var(--schrift); text-align: left; }
.wh-bz:first-child { border-top: 0; }
.wh-bz svg.ic { width: 22px; height: 22px; color: var(--muted); }
.wh-bz.gefahr, .wh-bz.gefahr svg.ic { color: var(--gefahr); }
.wh-kachel:hover, .wh-bz:hover { background: var(--hover); }
.wh-kachel:focus-visible, .wh-bz:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (max-width: 760px) {
  .schleier.wh-blatt-schleier { padding: 0; align-items: flex-end; }
  .dialog.wh-blatt { width: 100%; max-height: calc(100% - 24px); border-radius: 16px 16px 0 0; border-left: 0; border-right: 0; border-bottom: 0; transition: transform .15s ease; }
}

/* ---------------------------------------------------------------- Ziehen zum Aktualisieren */
.wh-ziehen { height: 0; flex: none; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 13px; }
.wh-ziehen.los { transition: height .2s ease; }
.wh-ziehen.bereit, .wh-ziehen.laeuft { color: var(--akzent-text); }
.wh-kreis { display: inline-flex; }
.wh-kreis svg.ic { width: 20px; height: 20px; }
.wh-ziehen.laeuft .wh-kreis { animation: wh-dreh .8s linear infinite; }
@keyframes wh-dreh { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wh-ziehen.laeuft .wh-kreis { animation: none; } .nachricht.wh-weich::before, .nachricht.wh-weich > * { transition: none; } }

/* ---------------------------------------------------------------- Ordnerleiste: Handy-Schublade */
.wh-ol-schleier { display: none; }
@media (max-width: 760px) {
  .mail.wh-schublade .spalten > .sp-ordner { display: flex !important; inset: 0 auto 0 0; width: min(86vw, 340px); z-index: 31; background: var(--panel);
    box-shadow: var(--schatten); transform: translateX(var(--wh-ol, -100%)); border-right: 1px solid var(--line); }
  .mail.wh-schublade .wh-ol-schleier { display: block; position: absolute; inset: 0; z-index: 30; background: rgba(10, 16, 28, .45); opacity: 0; }
  .mail.wh-weich .spalten > .sp-ordner, .mail.wh-weich .wh-ol-schleier { transition: transform .2s ease, opacity .2s ease; }
}
/* Tablet und PC: Ordnerleiste aus (NMW.ordnerleiste, je Gerät) */
@media (min-width: 761px) {
  html.nm-ol-aus .mail .spalten { grid-template-columns: 0 0 var(--sp2, 380px) 4px minmax(0, 1fr); }
  html.nm-ol-aus .mail.lese-aus .spalten, html.nm-ol-aus .mail.lese-unten .spalten { grid-template-columns: 0 0 minmax(0, 1fr); }
  html.nm-ol-aus .mail .spalten > .sp-ordner, html.nm-ol-aus .mail .spalten > .tr1 { visibility: hidden; overflow: hidden; min-width: 0; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  html.nm-ol-aus .mail .spalten { grid-template-columns: 0 0 var(--sp2, 320px) 4px minmax(0, 1fr); }
  html.nm-ol-aus .mail.lese-aus .spalten, html.nm-ol-aus .mail.lese-unten .spalten { grid-template-columns: 0 0 minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- Verfassen am Handy */
.wh-vf-mehr { display: none; }
@media (max-width: 760px) {
  .verfassen.wh-vf .verfassen-fuss { flex-wrap: nowrap; }
  .verfassen.wh-vf .verfassen-fuss > .wh-vf-selten { display: none; }
  .verfassen.wh-vf .wh-vf-mehr { display: inline-flex; }
  .verfassen.wh-vf:not(.wh-von-offen) .vf.wh-von { display: none; }
  .verfassen.wh-vf:not(.wh-von-offen) .wh-ccbcc { font-size: 0; }
  .verfassen.wh-vf:not(.wh-von-offen) .wh-ccbcc::after { content: attr(data-wh-text); font-size: 13px; }
  html.wh-tastatur .verfassen { top: var(--wh-vv-top, 0); bottom: auto; height: var(--wh-vv-h, 100%); }
  /* Tastatur offen: untere Leiste weg, der Inhalt bekommt ihre Zeile (Reihen der .app bleiben, auch mit Menüband) */
  html.wh-tastatur .app > .navleiste { display: none; }
  html.wh-tastatur .app > .inhalt { grid-row-end: -1; }
}

/* ---------------------------------------------------------------- Kontakte: Anrufen · SMS · E-Mail */
.wh-kontakt-reihe { display: none; }
@media (max-width: 1100px) {
  .wh-kontakt-reihe { display: flex; gap: 10px; margin: 14px 0 6px; }
  .wh-kontakt-kn { flex: 1 1 0; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; border-radius: 12px;
    background: var(--accent-soft); color: var(--akzent-text); text-decoration: none; font: 600 12.5px/1.2 var(--schrift); cursor: pointer; }
  .wh-kontakt-kn svg.ic { width: 20px; height: 20px; }
  .spalte-kopf > .kn.wh-doppelt { display: none; }
}

/* ---------------------------------------------------------------- Einstellungen › Wischgesten */
.wh-richtung h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 2px; }
.wh-vorschau { display: flex; gap: 0; padding: 8px 4px; margin: 4px 0 6px; border-radius: var(--radius); background: var(--panel2); border: 1px solid var(--line); min-height: 64px; align-items: center; }
.wh-vorschau.rechts { flex-direction: row-reverse; }
.wh-vorschau .wh-akt { cursor: default; height: 56px; }
.wh-vorschau .wh-langziel .wh-pille { box-shadow: 0 0 0 2px var(--panel2), 0 0 0 4px var(--wh-f); }
@media (min-width: 761px) { .wh-felder { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; } .wh-felder .zeile { display: block; } }

/* ---------------------------------------------------------------- Handy: Tippflächen mindestens 44 px (sichtbare Größe bleibt) */
@media (max-width: 760px) {
  /* html davor: schlägt die Dichte-Stufen (dichte.css lädt danach, :where = gleiche Gewichtung) nur am Handy */
  html .ik { min-width: 44px; min-height: 44px; }
  html .kn, html .kn.klein { min-height: 44px; }
  html .segment > button, html .segmente button { min-height: 44px; }
  html .lese-leiste .leiste-kn { min-width: 44px; min-height: 44px; justify-content: center; }
  html .wa-art.wa-art { min-height: 44px; }
  html .anhang, html .anhang-laden { min-height: 44px; }
  html .anhang-laden { min-width: 44px; }
  html .wa-absender { min-width: 44px; min-height: 44px; }
  html .suchfeld .feld.feld, html .feld.feld:not(textarea) { min-height: 44px; }
  html .konto-kn.konto-kn { min-width: 44px; min-height: 44px; }
  html .band.schmal .band-kn { min-width: 44px; min-height: 44px; }
}

/* ---------------------------------------------------------------- nm-web-handy22: eine Kopfleiste am Handy (bis 600 px, html.wh-einkopf aus webhandy.js)
   Links Zurück/Ordner + Titel (Ordner, darunter das Postfach), rechts Suche + „…“ (+ Konto); Menüband, gespiegelter Spaltenkopf und
   großer „Neu …“-Knopf aus, „Neu“ schwebt unten rechts wie im Kalender. Ab 601 px und ohne das Skript bleibt alles wie vorher. */
.wh-k-links, .wh-k-titel, .wh-k-an, .wh-k-suche, .wh-k-mehr, .wh-k-abbr, .wh-fab { display: none; }
html.wh-einkopf .app > .band { display: none; }
html.wh-einkopf .spalte-kopf.wh-gespiegelt { display: none !important; }
html.wh-einkopf .neu-kn.wh-fab-quelle { display: none; }
html.wh-einkopf .suchzeile.wh-sz:not(.wh-sz-auf):not(:focus-within):not(:has(input:not(:placeholder-shown))) { display: none; }
html.wh-einkopf .app > .kopf { padding: 0 6px 0 4px; gap: 0; }
html.wh-einkopf .kopf .titel-mobil { display: none; }
html.wh-einkopf .kopf > .ik:not(.wh-k-links):not(.wh-k-suche):not(.wh-k-mehr) { display: none; }   /* Farbschema steht im „…“ */
html.wh-einkopf .kopf > .wh-k-links:not([hidden]), html.wh-einkopf .kopf > .wh-k-suche:not([hidden]), html.wh-einkopf .kopf > .wh-k-mehr { display: inline-flex; align-items: center; justify-content: center; flex: none; }
html.wh-einkopf .kopf > .wh-k-titel { display: flex; flex-direction: column; justify-content: center; flex: 1 1 auto; min-width: 0; padding: 0 4px; line-height: 1.2; }
html.wh-einkopf .kopf > .wh-k-links[hidden] + .wh-k-titel { padding-left: 10px; }
.wh-k-titel b { font-weight: 600; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh-k-titel span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.wh-einkopf .kopf > .konto-kn { margin-left: 4px; }
/* Suche im Kopf (Bereiche ohne eigene Suchzeile: Kalender, Aufgaben, Lesen, Einstellungen) */
html.wh-einkopf.wh-kopfsuche .app > .kopf > :not(.nms-leiste):not(.wh-k-abbr) { display: none !important; }
html.wh-einkopf.wh-kopfsuche .app > .kopf { padding-left: 10px; gap: 6px; }
html.wh-einkopf.wh-kopfsuche .kopf .nms-leiste { display: flex; margin: 0; max-width: none; }
html.wh-einkopf.wh-kopfsuche .kopf .nms-bereich { display: none; }
html.wh-einkopf.wh-kopfsuche .kopf > .wh-k-abbr { display: inline-flex; flex: none; }
/* „Neu“ schwebt unten rechts (gleicher Knopf wie „Neuer Termin“ im Kalender) */
html.wh-einkopf .wh-fab { position: absolute; right: 14px; bottom: 14px; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--fuell1); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 3px 12px rgba(0, 0, 0, .25); z-index: 6; cursor: pointer; padding: 0; }
.wh-fab svg.ic { width: 24px; height: 24px; color: #fff; }
.wh-fab:hover { background: var(--fuell2); }
.wh-fab:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
html.wh-einkopf .spalte.wh-mit-fab > .rolle { padding-bottom: 84px; }
html.wh-einkopf.wh-tastatur .wh-fab { display: none; }
@media print { .wh-fab { display: none !important; } }
html.wh-einkopf .kopf > .wh-k-an { display: inline-flex; flex: none; }
