/* W1 Lesen (Ordnerbaum, Liste, Lesebereich, Druck, Kundenakte „E-Mails“): Klassen „em-le-“. Gehört allein W1.
   Nie Regeln aus oo.css überschreiben – nur unter der eigenen Fläche (.em-le-flaeche) die Maße der Arbeitsfläche anpassen.
   Marken (Farben, Linien, Ecken 3 px) aus oo.css; Blau nur Hauptknopf und Fokus. */

/* ── Arbeitsfläche: Ordner | Liste | Lesebereich (breiter als eine Akte: hier wird gelesen) ─────────────────── */
.af.em-le-flaeche { --leiste: 252px; --akte: clamp(440px, 46vw, 920px); }
.em-le-sym { flex: 0 0 auto; }
.em-le-flaeche .sr, .em-le-kundenreiter .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Ordnerbaum */
.em-le-leiste { padding-top: 6px; }
.em-le-konto { margin-bottom: 6px; }
.em-le-konto-kopf { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 34px; padding: 3px 8px 3px 4px; border: 0; border-radius: 3px; background: transparent;
  color: var(--tinte-1); text-align: left; cursor: pointer; }
.em-le-konto-kopf:hover { background: color-mix(in srgb, var(--tinte-1) 5%, transparent); }
.em-le-konto-kopf > .sym { color: var(--tinte-5); }
.em-le-konto-text { flex: 1 1 auto; min-width: 0; display: grid; }
.em-le-konto-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-le-konto-adresse { color: var(--tinte-4); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-le-ungelesen { flex: 0 0 auto; color: var(--tinte-2); font-size: 12px; font-weight: 600; }
.em-le-verbunden { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--ampel-gruen); }
.em-le-nurlesen { margin: 0 8px 4px 26px; color: var(--tinte-5); font-size: 11.5px; }
.em-le-ordner .em-le-ordnersym { display: inline-flex; flex: 0 0 auto; color: var(--tinte-5); }
.em-le-ordner.gewaehlt .em-le-ordnersym { color: inherit; }
.em-le-ordner.mit-ungelesenen .t { color: var(--tinte-1); font-weight: 600; }
.em-le-ordner.mit-ungelesenen .zahl { color: var(--tinte-2); font-weight: 600; }
a.fl-e.em-le-ordner { text-decoration: none; }
.em-le-bereich { margin: 14px 8px 4px; color: var(--tinte-5); font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.em-le-gruppe { display: flex; align-items: center; }
.em-le-gruppe > .fl-e { flex: 1 1 auto; min-width: 0; }
.em-le-gruppe-mehr { flex: 0 0 22px; height: 22px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 3px; background: transparent;
  color: var(--tinte-5); cursor: pointer; opacity: 0; }
.em-le-gruppe:hover .em-le-gruppe-mehr, .em-le-gruppe-mehr:focus-visible, .em-le-gruppe-mehr[aria-expanded="true"] { opacity: 1; }
.em-le-gruppe-mehr:hover { background: color-mix(in srgb, var(--tinte-1) 8%, transparent); color: var(--tinte-1); }
.em-le-gruppenmenue { right: 4px; top: 26px; }
.em-le-neue-gruppe { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; }
.em-le-fehler { color: var(--alarm); }

/* Kopfleiste der Liste */
.em-le-kopfleiste { position: relative; }
.em-le-kopfleiste .af-suche { flex: 1 1 320px; min-width: 96px; }
/* Die Kopfleiste misst die LISTE (neben dem Lesebereich ist sie schmal): Beschriftungen weichen vor dem Überlaufen. */
.em-le-flaeche > .af-mitte { container-type: inline-size; }
@container (width < 760px) {
  .em-le-kopfleiste .af-aufheben, .em-le-kopfleiste .em-le-neu { flex: 0 0 28px; width: 28px; padding: 0; justify-content: center; }
  .em-le-kopfleiste .af-aufheben span, .em-le-kopfleiste .em-le-neu span { display: none; }
  .em-le-kopfleiste .af-aufheben .sym { display: block; }
}
@container (width < 430px) {
  .em-le-kopfleiste .em-le-neuladen { display: none; }
}
.em-le-ordnerknopf { flex: 0 1 auto; min-width: 28px; max-width: 220px; padding: 0 8px 0 6px; }
.em-le-sichtname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tinte-1); font-weight: 600; }
.em-le-menue { position: relative; flex: 0 0 auto; }
.em-le-menueliste { position: absolute; z-index: 31; top: 32px; right: 0; min-width: 208px; max-width: min(320px, 92vw); max-height: min(420px, 70dvh); overflow-y: auto;
  display: grid; padding: 4px; border: 1px solid var(--linie-stark); border-radius: 3px; background: var(--flaeche); box-shadow: var(--schatten); }
.em-le-menueliste > button, .em-le-schalter { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 0 10px; border: 0; border-radius: 3px;
  background: transparent; color: var(--tinte-2); text-align: left; white-space: nowrap; cursor: pointer; }
.em-le-menueliste > button:hover, .em-le-schalter:hover { background: var(--flaeche-2); color: var(--tinte-1); }
.em-le-menueliste > button[aria-checked="true"], .em-le-schalter.an { color: var(--tinte-1); font-weight: 600; }
.em-le-menueliste > button.gefahr { color: var(--alarm); }
.em-le-menueliste > button:disabled { opacity: .5; cursor: default; }
.em-le-menuekopf { margin: 8px 10px 2px; color: var(--tinte-5); font-size: 11px; font-weight: 600; letter-spacing: .03em; }
.em-le-menuekopf:first-child { margin-top: 4px; }
.em-le-menuehinweis { margin: 6px 10px; color: var(--tinte-5); font-size: 12px; white-space: normal; }
.em-le-haekchen { display: inline-flex; width: 14px; flex: 0 0 14px; }
.em-le-haken { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 0 10px; color: var(--tinte-2); cursor: pointer; }
.em-le-farbwahl { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 8px 4px; }
.em-le-farbknopf { width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 3px; background: transparent; cursor: pointer; }
.em-le-farbknopf:hover, .em-le-farbknopf.an { border-color: var(--linie-stark); background: var(--flaeche-2); }
.em-le-farbpunkt { display: inline-block; flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; }
.em-le-filtermenue { right: -40px; }
.em-le-band { flex-wrap: wrap; justify-content: flex-start; gap: 6px 12px; background: var(--flaeche-2); color: var(--tinte-2); }
.em-le-band > span:first-child { flex: 1 1 220px; min-width: 0; }
.em-le-band-leise { color: var(--tinte-4); font-size: 12px; }
.em-le-band-knoepfe { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.em-le-pc { color: var(--tinte-5); }
/* B5 der Prüfung vor der Auslieferung: neben dem Lesebereich (Liste 439–526 px) schnitt der Fuß den Hinweis ohne „…“ ab. Der Hinweis gibt
   als Einziger nach und endet mit „…“; den ganzen Satz nennt sein Tooltip-Text daneben (title). */
.af-fuss .stand.em-le-pc { display: block; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Liste: Tage, Zeilen, Spalten (breit) und drei Zeilen (schmal) */
/* ☠️ Der Betreff hat mindestens 220 px: die festen Spalten brauchen zusammen 630 px, darum Spalten erst ab EmailListe.SpaltenAb (Befund U1;
   vorher blieben bei 772 px Liste 20 px für den Betreff). Wächter EmailListeSpaltenTests. */
.em-le-spalten { --raster: 16px minmax(120px, 210px) minmax(220px, 1fr) 150px 112px 76px 56px 100px; --breite: 0px; }
.em-le-karten { --raster: minmax(0, 1fr); --breite: 0px; }
.em-le-z { position: relative; }
.em-le-kante { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.em-le-tag { position: sticky; top: 30px; z-index: 1; display: flex; align-items: center; justify-content: space-between; height: 24px; padding: 0 16px;
  border-bottom: 1px solid var(--linie-fein); background: var(--grund); color: var(--tinte-5); font-size: 11.5px; font-weight: 600; }
.em-le-karten .em-le-tag { top: 0; }
/* Kontrast (B4 der Prüfung vor der Auslieferung): tinte-6 gab hell 2,45:1, dunkel 3,67:1. */
.em-le-tag .zahl { font-weight: 400; color: var(--tinte-4); }
.em-le-punkt { padding: 0; justify-content: center; }
/* Blau nur für die Hauptaktion (Befund U8): der Punkt „ungelesen“ in Tinte. */
.em-le-ungelesen-punkt { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--tinte-2); }
.em-le-von { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tinte-3); }
.em-le-z.ungelesen .em-le-von, .em-le-z.ungelesen .em-le-betreff { color: var(--tinte-1); font-weight: 600; }
.em-le-betreff-zeile { display: flex; gap: 8px; min-width: 0; }
.em-le-betreff { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tinte-2); }
.em-le-vorschau { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tinte-5); }
.em-le-fund { color: var(--tinte-4); }
.em-le-treffer { padding: 0 1px; border-radius: 2px; background: var(--warn-grund); color: inherit; }
.em-le-status { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; max-width: 100%; color: var(--tinte-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.em-le-status::before { content: ""; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--farbe, var(--tinte-5)); }
.em-le-zeichen { display: inline-flex; align-items: center; gap: 4px; color: var(--tinte-5); }
.em-le-stern { color: var(--ampel-gelb); }
.em-le-karte { display: grid; align-content: center; gap: 1px; height: 100%; padding: 4px 10px 4px 12px; white-space: nowrap; }
.em-le-k1, .em-le-k2, .em-le-k3 { display: flex; align-items: center; gap: 6px; min-width: 0; height: 18px; }
.em-le-k1 .em-le-von { flex: 1 1 auto; }
.em-le-zeit { flex: 0 0 auto; color: var(--tinte-5); font-size: 12px; }
.em-le-k2 .em-le-betreff { flex: 1 1 auto; }
.em-le-k3 { font-size: 12px; }
/* ☠️ Nur die Kundenspalte der Liste; der Reiter der Kundenakte heißt em-le-kundenreiter (Befund U2: er bekam 45 % Breite und graue Schrift). */
.em-le-kunde { flex: 0 0 auto; max-width: 45%; overflow: hidden; text-overflow: ellipsis; color: var(--tinte-4); }
.em-le-wer { flex: 0 0 auto; color: var(--tinte-5); font-size: 11.5px; }
.em-le-leer .kn { pointer-events: auto; margin-top: 6px; }
.em-le-z.gewaehlt .em-le-ungelesen-punkt { background: var(--tinte-1); }
/* Kontrast in der gewählten Zeile (Befund U9: tinte-5 auf dem Auswahlgrund 3,2–3,8:1; B4: tinte-4 erreichte dunkel nur 4,29:1). */
.af-z.gewaehlt .em-le-zeit, .af-z.gewaehlt .em-le-vorschau, .af-z.gewaehlt .kurz.blass, .af-z.gewaehlt .em-le-kunde { color: var(--tinte-3); }

/* Lesebereich */
.em-le-akte { min-width: 0; }
.em-le-kopf { gap: 8px; }
.em-le-betreff-gross { font-size: 17px; }
.em-le-absender { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.em-le-kachel { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 3px; background: var(--flaeche-2); color: var(--tinte-3); font-weight: 600; font-size: 12.5px; }
.em-le-absender-text { display: grid; gap: 1px; min-width: 0; }
.em-le-von-knopf { justify-self: start; max-width: 100%; padding: 0; border: 0; background: transparent; color: var(--tinte-1); font-weight: 600; text-align: left;
  overflow-wrap: anywhere; cursor: pointer; }
.em-le-von-knopf:hover { text-decoration: underline; text-underline-offset: 2px; }
.em-le-an, .em-le-datum { color: var(--tinte-4); font-size: 12px; overflow-wrap: anywhere; }
.em-le-felder .abz { background: var(--flaeche-2); color: var(--tinte-3); }
.em-le-farbe { border-left: 3px solid var(--farbe); }
.em-le-chips { gap: 6px; }
.em-le-chip { cursor: default; padding-right: 3px; }
.em-le-chip a { color: var(--tinte-2); text-decoration: none; }
.em-le-chip a:hover { text-decoration: underline; text-underline-offset: 2px; }
.em-le-chip.auto { border-style: dashed; }
.em-le-chip-weg { width: 18px; height: 18px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 3px; background: transparent; color: var(--tinte-5); cursor: pointer; }
.em-le-chip-weg:hover { background: var(--flaeche-2); color: var(--tinte-1); }
.em-le-aktionen { position: relative; }
.em-le-aktionen a.kn { text-decoration: none; }
.em-le-trenner { flex: 0 0 1px; height: 18px; margin: 0 2px; background: var(--linie); }
.em-le-loeschen:hover:not(:disabled) { color: var(--alarm); }
/* Feldmenüs (Farbe, Status, Zuweisen, Gruppe, Verknüpfen) hängen an der Unterkante der Aktionsleiste, rechts wie ihre Knöpfe (U4). */
.em-le-feldmenue { right: 10px; top: 100%; margin-top: 2px; }
.em-le-kopf { position: relative; }
.em-le-anhaenge { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--linie); }
.em-le-anhang { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; height: 28px; padding: 0 10px; border: 1px solid var(--linie-stark); border-radius: 3px;
  background: var(--flaeche); color: var(--tinte-2); cursor: pointer; }
.em-le-anhang:hover:not(:disabled) { background: var(--flaeche-2); }
.em-le-anhang .kurz { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-le-blatt { flex: 1 1 auto; width: 100%; min-height: 0; border: 0; background: #fff; }
.em-le-verweisziel { padding: 6px 8px; border: 1px solid var(--linie); border-radius: 3px; background: var(--flaeche-2); color: var(--tinte-1); overflow-wrap: anywhere;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; }
.em-le-hinweis { color: var(--tinte-5); font-size: 12px; }
.em-le-hinweis a { overflow-wrap: anywhere; }
.em-le-feld { display: grid; gap: 4px; margin-bottom: 12px; }

/* Verknüpfen */
.em-le-verknuepfen { width: min(520px, calc(100vw - 32px)); }
.em-le-vorschlag { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.em-le-treffer-liste { display: grid; max-height: 280px; overflow-y: auto; margin: 8px 0 12px; border: 1px solid var(--linie); border-radius: 3px; }
.em-le-treffer-zeile { display: flex; justify-content: space-between; gap: 12px; min-height: 30px; padding: 0 10px; border: 0; border-bottom: 1px solid var(--linie-fein);
  background: transparent; color: var(--tinte-2); text-align: left; cursor: pointer; }
.em-le-treffer-zeile:hover:not(:disabled) { background: var(--flaeche-2); color: var(--tinte-1); }
.em-le-treffer-zeile .kurz { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Druckseite */
.em-le-druck { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; background: var(--grund); }
.em-le-druckleiste { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--linie); background: var(--flaeche); }
.em-le-druckleiste a.kn { text-decoration: none; }
.em-le-druckblatt { flex: 1 1 auto; width: min(860px, 100%); margin: 12px auto; border: 1px solid var(--linie); background: #fff; }

/* Kundenakte „E-Mails“ */
.em-le-kundenliste { display: grid; margin: 6px 0 0; padding: 0; list-style: none; }
.em-le-kundenliste li { border-bottom: 1px solid var(--linie-fein); }
.em-le-kundenzeile { display: grid; gap: 1px; padding: 6px 2px; color: inherit; text-decoration: none; }
.em-le-kundenzeile:hover { background: var(--flaeche-2); }
.em-le-kundenliste li.ungelesen .em-le-von, .em-le-kundenliste li.ungelesen .em-le-betreff { color: var(--tinte-1); font-weight: 600; }
.em-le-kundenblaettern { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--tinte-4); font-size: 12px; }

/* ── Schmale Fenster: der Lesebereich als Blatt (oo.css), breiter als eine Akte ───────────────────────────── */
@media (max-width: 1240px) {
  .em-le-flaeche .af-akte { width: min(820px, 100vw); }
}
@media (max-width: 700px) {
  .em-le-sichtname { max-width: 110px; }
  .em-le-aktionen .kn .lang { display: none; }
}
@media (max-width: 560px) {
  .em-le-sichtname { display: none; }
  .em-le-kopfleiste .em-le-neu { width: 28px; padding: 0; }
  .em-le-kopfleiste .em-le-neu span { display: none; }
  .af-fuss .em-le-pc { display: none; }
  .em-le-akte .ak-aktionen { gap: 2px; }
}

/* Kundenakte, Reiter „E-Mails“: „Neue E-Mail“ an den Kunden (Zusammenführung mit W3). */
.em-le-kunde-neu { display: flex; justify-content: flex-end; margin: 0 0 8px; }
