/* Einstellungen, Baugruppe texte: Stilregeln, die nur diese Baugruppe braucht. Gemeinsames (es-…) steht in oo.einstellungen.css,
   Allgemeines in oo.css – hier nie etwas davon überschreiben. Eigene Klassen mit der Vorsilbe es-tx-, nur Marken aus oo.css.
   Eingebunden in Dokument.razor nach oo.einstellungen.css. */

/* ── Liste links: Suche, Filter, Gruppen, Einträge (Textbausteine und Konditionsblöcke) ─────────────────────────────── */
.es-tx-zwei { grid-template-columns: 320px minmax(0, 1fr); }
.es-tx-liste { padding: 10px 6px 12px; }
.es-tx-filter { display: grid; gap: 6px; padding: 0 6px 8px; border-bottom: 1px solid var(--linie-fein); margin-bottom: 6px; }
.es-tx-filter .af-suche { flex: none; min-width: 0; }
.es-tx-gruppe { margin-top: 6px; }
.es-tx-gruppe-titel { padding: 6px 8px 3px 10px; color: var(--tinte-5); font-size: 12px; font-weight: 500; }
.es-tx-eintraege { list-style: none; margin: 0; padding: 0; }
.es-tx-e { display: grid; gap: 1px; width: 100%; min-height: 28px; padding: 4px 8px 4px 10px; border: 0; border-left: 2px solid transparent;
  border-radius: 0 3px 3px 0; background: transparent; color: var(--tinte-2); text-align: left; cursor: pointer; }
.es-tx-e:hover { background: var(--grund); }
.es-tx-e.gewaehlt { background: var(--auswahl); border-left-color: var(--tinte-1); color: var(--tinte-1); }
.es-tx-e:focus-visible { outline: 2px solid var(--akzent); outline-offset: -2px; }
.es-tx-e-zeile { display: flex; align-items: center; gap: 6px; min-width: 0; }
.es-tx-e-zeile .t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.es-tx-geaendert { flex: 0 0 auto; color: var(--tinte-4); font-weight: 700; }
.es-tx-warnung { flex: 0 0 auto; display: inline-flex; color: var(--warn); }

/* ── Editor rechts ───────────────────────────────────────────────────────────────────────────────────────────────── */
/* Eine Spalte, so breit wie die Karte: sonst machte der Kopf mit seinen Knöpfen (schmal) Felder und Formatfeld breiter als das Fenster. */
.es-tx-editor { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; }
.es-tx-editor > .es-tx-feld + .es-tx-feld, .es-tx-editor > .es-tx-k-aktiv { margin-top: 12px; }
.es-tx-feld { display: grid; gap: 4px; min-width: 0; }
.es-tx-feld-kopf { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; min-height: 28px; }
.es-tx-feld-titel { font-size: 12.5px; font-weight: 600; color: var(--tinte-3); }
.es-tx-feld-hinweis { flex: 1 1 auto; color: var(--tinte-5); font-size: 12px; }
.es-tx-text { min-height: 120px; }
.es-tx-system { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; margin-bottom: 12px;
  border: 1px solid var(--linie); border-radius: 3px; background: var(--flaeche-2); color: var(--tinte-3); }
.es-tx-neu-hinweis { margin: 0 0 10px; }
.es-tx-laedt { margin: 0 0 10px; color: var(--tinte-5); }
/* Nur ansehen: ruhiger Kasten mit Grund statt des Felds (nur das PC-Programm bearbeitet ihn), darunter der Text ohne Formatierung. */
.es-tx-formatiert { display: flex; flex-wrap: wrap; gap: 2px 6px; padding: 8px 10px; border: 1px dashed var(--linie-stark); border-radius: 3px;
  background: var(--grund); color: var(--tinte-4); }
.es-tx-formatiert strong { color: var(--tinte-3); font-weight: 600; }
.es-tx-vorschau-kopf { margin-top: 2px; color: var(--tinte-5); font-size: 12px; }
.es-tx-vorschau { max-height: 240px; overflow: auto; padding: 8px 10px; border: 1px solid var(--linie); border-radius: 3px; background: var(--flaeche-2);
  color: var(--tinte-3); white-space: pre-wrap; overflow-wrap: anywhere; }
.es-tx-formatieren, .es-tx-format-verwerfen { height: 26px; }
.es-tx-wirkung { margin: 10px 0 0; }

/* ── Formatfeld (Bauplan Einstellungen-Erweiterung T9, T10): Leiste und Blatt ────────────────────────────────────────────── */
.es-tx-format { display: grid; min-width: 0; border: 1px solid var(--linie-stark); border-radius: 3px; background: var(--flaeche); }
.es-tx-format:focus-within { border-color: var(--akzent); box-shadow: 0 0 0 2px var(--akzent-schein); }
.es-tx-fl { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; padding: 3px 4px; border-bottom: 1px solid var(--linie);
  border-radius: 3px 3px 0 0; background: var(--flaeche-2); }
.es-tx-fl-gruppe { display: inline-flex; align-items: center; gap: 1px; }
.es-tx-fl-gruppe + .es-tx-fl-gruppe { padding-left: 6px; border-left: 1px solid var(--linie); }
.es-tx-fk { display: inline-flex; align-items: center; justify-content: center; gap: 1px; min-width: 28px; height: 26px; padding: 0 4px;
  border: 1px solid transparent; border-radius: 3px; background: transparent; color: var(--tinte-3); cursor: pointer; }
.es-tx-fk:hover:not(:disabled) { background: var(--auswahl); color: var(--tinte-1); }
.es-tx-fk[aria-pressed="true"], .es-tx-fk[aria-expanded="true"] { background: var(--auswahl); border-color: var(--linie-stark); color: var(--tinte-1); }
.es-tx-fk[aria-disabled="true"] { color: var(--tinte-6); }
.es-tx-fk:disabled { color: var(--tinte-6); cursor: default; }
.es-tx-fk:focus-visible, .es-tx-farbe:focus-visible { outline: 2px solid var(--akzent); outline-offset: -1px; }
.es-tx-fl-groesse { height: 26px; width: 58px; padding: 0 4px; border: 1px solid var(--linie-stark); border-radius: 3px; background: var(--flaeche);
  color: var(--tinte-2); font: inherit; font-size: 12.5px; }
.es-tx-fl-menue { position: relative; display: inline-flex; }
.es-tx-palette { display: none; position: absolute; top: calc(100% + 3px); left: 0; z-index: 30; grid-template-columns: repeat(5, 22px); gap: 4px;
  padding: 6px; border: 1px solid var(--linie-stark); border-radius: 3px; background: var(--flaeche); box-shadow: var(--schatten); }
.es-tx-fl[data-offen="farbe"] .es-tx-palette[data-palette="farbe"],
.es-tx-fl[data-offen="hintergrund"] .es-tx-palette[data-palette="hintergrund"] { display: grid; }
.es-tx-farbe { width: 22px; height: 22px; padding: 0; border: 1px solid var(--linie-stark); border-radius: 3px; cursor: pointer; }
/* „Automatisch“ bzw. „Ohne Hintergrund“: weiß mit Schrägstrich. */
.es-tx-farbe.ohne { background: linear-gradient(135deg, #fff 45%, var(--ampel-rot) 45%, var(--ampel-rot) 55%, #fff 55%); }
/* Das Blatt ist in beiden Designs hell wie Papier (die Farben des Texts sollen stimmen); Schrift, Größe, Farbe und Ausrichtung
   setzt der Bereich aus der Wurzel des Texts. Absätze ohne Abstand wie im Druck des PC-Programms. */
.es-tx-blatt { min-height: 132px; max-height: 60vh; overflow: auto; padding: 10px 12px; border-radius: 0 0 3px 3px; background: #fff;
  white-space: pre-wrap; overflow-wrap: anywhere; line-height: normal; outline: none; cursor: text; }
.es-tx-blatt p { margin: 0; }
.es-tx-blatt [data-verweis] { cursor: text; }
.es-tx-format.gesperrt .es-tx-blatt, .es-tx-blatt[contenteditable="false"] { cursor: default; }
.es-tx-format.gesperrt { opacity: .8; }

/* Platzhalter-Menü am Feld: Anker relativ, Menü rechtsbündig darunter, rollt bei vielen Einträgen. */
.es-tx-anker { position: relative; margin-left: auto; }
.es-tx-platzhalter-menue { left: auto; right: 0; width: 300px; max-height: 360px; overflow-y: auto; }
.es-tx-platzhalter-menue .fuss { padding: 4px 8px 8px; border-bottom: 1px solid var(--linie); margin-bottom: 4px; }
.es-tx-platzhalter-gruppe + .es-tx-platzhalter-gruppe { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--linie-fein); }
.es-tx-platzhalter-titel { display: block; padding: 4px 8px 2px; color: var(--tinte-5); font-size: 12px; }

.es-tx-ohne-wahl .es-leer strong, .es-tx-k-leer .es-leer strong { display: block; margin-bottom: 4px; color: var(--tinte-3); font-weight: 600; }
.es-tx-mitte { justify-content: center; }

/* ── Belegkonditionen ────────────────────────────────────────────────────────────────────────────────────────────── */
.es-tx-k-artzeile { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.es-tx-k-artzeile .aus { flex: 0 0 240px; width: 240px; }
.es-tx-k-druck { white-space: normal; height: auto; min-height: 19px; padding: 2px 6px; }
.es-tx-k-recht { margin-top: 10px; max-width: 90ch; }
.es-tx-k-liste .es-karte-kopf { padding: 0 6px; }
.es-tx-k-aktiv { margin-top: 10px; }
.es-tx-k-platzhalter { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.es-tx-k-marke { height: 24px; padding: 0 6px; font-family: inherit; font-size: 12.5px; }
.es-tx-k-befunde { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.es-tx-k-befunde li { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--tinte-3); }
.es-tx-k-befunde li.warnung { color: var(--warn); }
.es-tx-k-entfernt { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 6px 0; padding: 6px 8px;
  border: 1px solid var(--linie); border-radius: 3px; background: var(--flaeche-2); color: var(--tinte-3); font-size: 12.5px; }

/* ── Nur im PC-Programm ──────────────────────────────────────────────────────────────────────────────────────────── */
.es-tx-pc-tab th[scope="row"] { width: 32%; min-width: 180px; font-weight: 500; color: var(--tinte-2); text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--linie-fein); vertical-align: top; }
.es-tx-pc-tab td { height: auto; padding: 6px 8px; color: var(--tinte-4); vertical-align: top; }

@media (max-width: 860px) {
  .es-tx-zwei { grid-template-columns: minmax(0, 1fr); }
  .es-tx-k-artzeile .aus { flex: 1 1 100%; width: 100%; }
  .es-tx-platzhalter-menue { width: min(300px, calc(100vw - 48px)); }
  .es-tx-pc-tab th[scope="row"] { min-width: 0; }
  .es-tx-editor > .es-karte-kopf { flex-wrap: wrap; }
  .es-tx-editor > .es-karte-kopf .es-karte-aktionen { flex: 1 1 100%; flex-wrap: wrap; }
  .es-tx-fl-gruppe + .es-tx-fl-gruppe { padding-left: 0; border-left: 0; }
  /* Schmal hängt die Farbauswahl an der Leiste (am Knopf ragte sie über den rechten Rand). */
  .es-tx-fl { position: relative; }
  .es-tx-fl-menue { position: static; }
  .es-tx-palette { left: 4px; top: calc(100% + 2px); }
  .es-tx-fk { min-width: 32px; height: 30px; }
  .es-tx-fl-groesse { height: 30px; }
  .es-tx-blatt { max-height: none; }
}
