/* ===========================================================================
   Teilen per Link (teilen.js, Feedback #7, Entwurf C, Marcel 09.11.2026)
   Liegt über stil.css und nimmt nur dessen Variablen (Hell und Dunkel stimmen von selbst, kein Hex). Ziele ab 44 px am Handy,
   Schrift ab 12 px, Rückmeldung beim Drücken wie bei den anderen Glas-Knöpfen (gz-knopf). Genau eine rote Fläche je Ansicht:
   „Teilen …“ im Stapel bzw. „Link anlegen“ im Dialog.
   Präfix tl- (Stapel, Raumzeile, Wahl, Abschnitt, Zeile, Dialog, Seite).
   =========================================================================== */

.tl-ic { width: 16px; height: 16px; flex: none; }
.tl-ic--pw { width: 14px; height: 14px; vertical-align: -2px; margin-right: 5px; }

/* ---- Leiste über dem Raster: Filter links, Teilen-Knöpfe rechts ---- */
.bildfilter-host { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.tl-werkzeuge { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-werkzeuge .gz-knopf, .tl-raum__teilen { display: inline-flex; align-items: center; gap: 6px; }
.tl-werkzeuge .gz-knopf small { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--leise); }
.gz-knopf.tl-an, .gz-knopf.tl-an:hover { background: var(--brand-tint); border-color: var(--brand-light); }
.gz-knopf:disabled, .gz-knopf:disabled:hover { opacity: .55; transform: none; cursor: default; }

/* ---- Stapel oben: was zum Teilen gewählt ist ---- */
.tl-stapel { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 12px; border-radius: 12px;
  background: var(--brand-tint); border: 1px solid var(--brand-light); color: var(--tinte); min-width: 0; }
.tl-stapel__was { flex: 1 1 220px; display: grid; gap: 6px; min-width: 0; }
.tl-stapel__was b { font-variant-numeric: tabular-nums; }
.tl-stapel__knoepfe { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
/* Die Räume im Stapel sind .chip mit .chip__x (stil.css, Entwurf 123 D5) */

/* ---- Raumzeilen ---- */
.tl-raum__kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tl-raum__name { min-width: 0; }
.tl-raum__name span { overflow-wrap: anywhere; }
.tl-raum__teilen small { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--flaeche); border: 1px solid var(--brand-light); }
.gz-knopf.tl-raum__teilen--drin { background: var(--brand-tint); border-color: var(--brand-light); }

/* ---- Einzelne Bilder wählen: Haken auf der Kachel ---- */
.bildraster__bild--wahl { cursor: pointer; }
.bildraster__bild--wahl:hover { transform: none; }
.bildraster__bild--nicht { opacity: .45; cursor: not-allowed; }
.tl-haken { position: absolute; z-index: 1; left: 8px; top: 8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--papier); background: color-mix(in srgb, var(--tinte) 38%, transparent); color: transparent; transition: background .12s; }
.tl-haken__ic { width: 14px; height: 14px; stroke-width: 3; }
.bildraster__bild--gewaehlt img { outline: 3px solid var(--brand); outline-offset: -3px; }
.bildraster__bild--gewaehlt .tl-haken { background: var(--g-red); color: var(--papier); }

/* ---- Abschnitt „Geteilte Links“ in der Akte ---- */
.tl-abschnitt { border: 1px solid var(--linie); border-radius: 12px; background: color-mix(in srgb, var(--flaeche) 62%, transparent); min-width: 0; }
.tl-abschnitt__kopf { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; cursor: pointer; list-style: none; border-radius: 12px;
  font-size: 13px; font-weight: 800; letter-spacing: .04em; color: var(--tinte); transition: background .12s; }
.tl-abschnitt__kopf::-webkit-details-marker { display: none; }
.tl-abschnitt__kopf small { font-size: 12px; font-weight: 700; color: var(--leise); }
.tl-abschnitt__kopf::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--leise); border-bottom: 2px solid var(--leise);
  transform: rotate(45deg); transition: transform .12s; }
.tl-abschnitt[open] > .tl-abschnitt__kopf::after { transform: rotate(-135deg); }
.tl-abschnitt__kopf:hover { background: var(--g-glass-hover); }
.tl-abschnitt__kopf:active { background: var(--g-glass-press); }
.tl-abschnitt .tl-liste { padding: 0 14px 6px; }
.tl-abschnitt__leer { margin: 0; padding: 0 14px 6px; }
.tl-abschnitt__fuss { margin: 0; padding: 4px 14px 12px; font-size: 13.5px; }
.tl-abschnitt__fuss a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---- Eine Zeile je Link ---- */
.tl-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tl-zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 12px 14px; border-radius: 12px;
  background: var(--g-glass); border: 1px solid var(--g-glass-line); box-shadow: var(--g-glass-shadow); min-width: 0; }
.tl-zeile__text { display: grid; gap: 4px; min-width: 0; }
.tl-zeile__kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.tl-zeile__titel { font-size: 15px; overflow-wrap: anywhere; }
.tl-zeile__zusatz, .tl-zeile__daten { margin: 0; font-size: 13px; line-height: 1.4; color: var(--ink-2); overflow-wrap: anywhere; }
.tl-zeile__seite { font-style: italic; }
.tl-zeile__auftrag { color: var(--tinte); font-weight: 600; }
.tl-zeile__aktionen { display: flex; gap: 8px; align-items: center; }
.tl-zeile__aktionen .gz-knopf { display: inline-flex; align-items: center; gap: 6px; }
.tl-mehr { width: 34px; padding: 0; justify-content: center; font-size: 20px; line-height: 1; }
/* Status eines Links: eine .marke (aktiv grün, gesperrt rot, sonst still) mit Punkt in der Schriftfarbe davor. */
.tl-marke::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tl-marke--gattung::before { content: none; }      /* Gattung des Links („Fotos“, „gemischt“): ein Wort, kein Statuspunkt */
.tl-marke--gemischt { border-style: dashed; }
.ofa-eintrag--weg b { color: var(--rot-dk); }

/* ---- Dialog „Bilder teilen“ und die kleinen Ändern-Dialoge ---- */
.tl-satz { margin: 0 0 12px; line-height: 1.45; }
.tl-summe { display: grid; gap: 2px; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--feld); border: 1px solid var(--linie); }
.tl-summe span { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
/* Passwortfeld mit Vorschlag: Text sichtbar, daneben „Neu würfeln“ und „Kopieren“ (umbrechen am Handy unter das Feld) */
.tl-pwbox { display: grid; gap: 4px; }
.tl-pw { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.tl-pw__feld { flex: 1 1 14ch; min-width: 0; font-weight: 600; letter-spacing: .02em; }
.tl-pw__knopf { flex: none; height: auto; min-height: 38px; }
.tl-pw__hinweis { margin: 0; min-height: 1.4em; }
.tl-pwzeige { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tl-pwzeige__text { font: 600 15px/1.4 var(--mono); padding: 6px 10px; border-radius: 8px; background: var(--feld); border: 1px solid var(--linie);
  overflow-wrap: anywhere; user-select: all; }
/* Felder, die der Empfänger liest, getrennt von denen nur für den Besitzer */
.tl-abschnittstitel { margin: 18px 0 8px; padding-top: 10px; border-top: 1px solid var(--linie); font-size: 12px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--tinte); }
.tl-zaehler { margin: 2px 0 0; text-align: right; font-variant-numeric: tabular-nums; }
.tl-nachricht-zeigen { white-space: pre-line; max-height: 9em; overflow: auto; }
.tl-meta { align-items: flex-start; white-space: normal; font-size: 14px; }
.tl-meta input { margin-top: 2px; }
.tl-vorschau { margin-top: 5px; min-height: 1.4em; }
.tl-fehler { margin: 0; padding: 10px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--tinte);
  background: color-mix(in srgb, var(--weh) 10%, var(--flaeche)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--weh) 40%, transparent); }
.tl-link__feld { display: block; width: 100%; resize: none; min-height: 0; font: 13px/1.45 var(--mono); overflow-wrap: anywhere; word-break: break-all; }
.tl-daten { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 14px 0 0; }
.tl-daten dt { font-size: 13px; color: var(--leise); }
.tl-daten dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* ---- Dialog „Link per Mail senden“: Adressen aus dem Auftrag als auswählbare Zeilen (je mindestens 44 px) ---- */
.tl-maildlg .tl-mail__summe { overflow-wrap: anywhere; font-size: 13.5px; }
.tl-adressen { display: grid; gap: 6px; margin: 0 0 14px; }
.tl-adr { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 12px; border-radius: 12px; cursor: pointer; min-width: 0;
  background: var(--g-glass); border: 1px solid var(--g-glass-line); transition: background .12s;
  text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--tinte); }      /* ein <label>: die Großschrift der Feldnamen gilt hier nicht */
.tl-adr:hover { background: var(--g-glass-hover); }
.tl-adr:has(input:checked) { background: var(--brand-tint); border-color: var(--brand-light); }
.tl-adr input { width: 20px; height: 20px; min-height: 0; margin: 0; padding: 0; flex: 0 0 20px; accent-color: var(--ziegel); }
.tl-adr__text { display: grid; gap: 1px; min-width: 0; }
.tl-adr__rolle { font-size: 12.5px; font-weight: 700; color: var(--ink-2); overflow-wrap: anywhere; }
.tl-adr__mail { font-size: 14px; font-weight: 600; color: var(--tinte); overflow-wrap: anywhere; }
.tl-mail__text { display: block; width: 100%; min-height: 11em; resize: vertical; line-height: 1.45; }
.tl-mail__zurueck { margin-top: 8px; min-height: 38px; }
.tl-mail__pw { margin-top: 4px; }
.tl-mail__pw .tl-fehler { margin: 6px 0; }

/* ---- Hub-Seite „Geteilte Links“ ---- */
.tl-seite { max-width: 980px; margin: 0 auto; padding: 18px 16px 60px; }
.tl-seite__kopf h2 { font-size: 22px; }
.tl-seite__unter { margin: 4px 0 0; color: var(--ink-2); }
.tl-seite__leiste { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 16px 0; }
.tl-seite__leer { margin: 18px 0; max-width: 62ch; }
.tl-aus { margin-top: 16px; padding: 16px; border-radius: 12px; border: 1px solid var(--linie); background: color-mix(in srgb, var(--flaeche) 62%, transparent); }

/* ---- Einstieg in den Einstellungen (Tafel „Teilen per Link“) ---- */
.tl-einstieg { margin-bottom: 16px; }

/* ---- Touch und schmal ---- */
@media (pointer: coarse), (max-width: 700px) {
  .tl-werkzeuge .gz-knopf, .tl-raum__teilen, .tl-stapel .gz-knopf, .tl-zeile__aktionen .gz-knopf, .tl-pw__knopf { min-height: 44px; height: auto; }
  .tl-mehr { width: 44px; }
  .tl-mail__zurueck, .tl-mail-knopf { min-height: 44px; }
  .tl-haken { width: 30px; height: 30px; }
}
@media (max-width: 600px) {
  .tl-pw__feld { flex: 1 1 100%; }
  .tl-pw__knopf { flex: 1 1 0; }
  .tl-zeile { grid-template-columns: minmax(0, 1fr); }
  .tl-zeile__aktionen .tl-kopieren { flex: 1 1 auto; justify-content: center; }
  .tl-werkzeuge { width: 100%; }
  .tl-werkzeuge .gz-knopf { flex: 1 1 auto; justify-content: center; }
  .tl-stapel__knoepfe { width: 100%; }
  .tl-stapel__knoepfe .gz-knopf { flex: 1 1 0; justify-content: center; }
  .tl-daten { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .tl-daten dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .tl-abschnitt__kopf, .tl-abschnitt__kopf::after, .tl-haken { transition: none; }
}
