/* ================================================================
   TEAM · Dokumente (Projekte → Reiter „Dokumente“) – Lese- und Bearbeiten-Ansicht im Stil der Claude-Dokumente
   2026-10-16
   - Schriften selbst gehostet (SIL OFL 1.1, assets/fonts/OFL.txt): Überschriften „Source Serif 4“, Text „Figtree“
     (variable Schnitte 400–700, Teilmengen latin + latin-ext – der Browser lädt nur, was die Seite braucht)
   - Alles unter .tdoc / .tdoc-* – der Rest von TEAM bleibt unberührt. Desktop (app.html) und Handy (pwa-mobile.html, .tdoc-m)
   - Dunkelmodus: folgt [data-theme="dark"] der TEAM-Oberfläche (falls gesetzt)
   - 2026-10-16 (Prüfung): Menüs/Link-Feld bleiben im Fenster (team.js rückt sie ein, Bereich scrollt nie seitwärts),
     Konflikt-/Gelöscht-Hinweis sitzt IN der klebenden Leiste, Statustext hängt als Schild darunter (Leiste bleibt einzeilig),
     „Entwurf ohne Dokument“ in der Seitenliste, Anlegen-Feld mit Knopf, fehlendes Bild im Editor wie in der Leseansicht
   - 2026-10-21 (Paket D3) „Dokument-Feinschliff“ (?v=2, Abschnitt am Ende): Bearbeiten = Lesen (Titel-Überschrift), ruhige Leiste,
     „Gespeichert · Uhrzeit“, Checkliste lesen und bearbeiten
   ================================================================ */

/* ── Schriften ─────────────────────────────────────────────────── */
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/figtree-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/figtree-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Figtree'; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/figtree-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Figtree'; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/figtree-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/source-serif-4-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/source-serif-4-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Source Serif 4'; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/source-serif-4-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Source Serif 4'; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/source-serif-4-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ── Werte ─────────────────────────────────────────────────────── */
.tdoc, .tdoc-layout, .tdoc-dialog {
  --tdoc-papier: #ffffff;
  --tdoc-text: #1f1e1c;
  --tdoc-text2: #5c5a54;
  --tdoc-text3: #8a877f;
  --tdoc-rand: #e4e1d9;
  --tdoc-rand2: #cfcbc1;
  --tdoc-kopf: #f2f0eb;            /* Tabellenkopf */
  --tdoc-chip: #efede7;
  --tdoc-link: #1f5fbf;
  --tdoc-link-strich: rgba(31, 95, 191, .38);
  --tdoc-auswahl: rgba(31, 95, 191, .12);
  --tdoc-hover: #f4f2ed;
  --tdoc-akzent: var(--accent, #4e7a64);
  --tdoc-akzent-hell: var(--accent-s, #e8f2ec);
  --tdoc-akzent-dunkel: var(--sage-d, #3a5c4a);
  --tdoc-serif: 'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  --tdoc-sans: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
[data-theme="dark"] .tdoc, [data-theme="dark"] .tdoc-layout, [data-theme="dark"] .tdoc-dialog {
  --tdoc-papier: #1d1d1b;
  --tdoc-text: #ecebe6;
  --tdoc-text2: #b9b7af;
  --tdoc-text3: #8f8c84;
  --tdoc-rand: #3a3935;
  --tdoc-rand2: #4b4a45;
  --tdoc-kopf: #2a2926;
  --tdoc-chip: #2e2d2a;
  --tdoc-link: #7fb0ff;
  --tdoc-link-strich: rgba(127, 176, 255, .45);
  --tdoc-auswahl: rgba(127, 176, 255, .18);
  --tdoc-hover: #2a2926;
}

/* ── Dokument (Lesen + Bearbeiten teilen die Typografie) ─────────── */
.tdoc {
  box-sizing: border-box; max-width: 768px; margin: 0 auto; padding: 36px 32px 112px;
  color: var(--tdoc-text); font-family: var(--tdoc-sans); font-size: 16.5px; line-height: 1.62; font-weight: 400;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  overflow-wrap: break-word; font-kerning: normal;
}
.tdoc *, .tdoc *::before, .tdoc *::after { box-sizing: border-box; }
.tdoc-titel {
  margin: 0 0 14px; padding: 0; font-family: var(--tdoc-serif); font-optical-sizing: auto; font-weight: 600;
  font-size: 40px; line-height: 1.14; letter-spacing: -.012em; color: var(--tdoc-text);
}
.tdoc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 34px; }
.tdoc-chip {
  display: inline-flex; align-items: center; min-height: 24px; padding: 2px 9px; border-radius: 6px;
  background: var(--tdoc-chip); color: var(--tdoc-text2); font-size: 12.5px; font-weight: 500; line-height: 1.3;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tdoc-inhalt > :first-child, .tdoc-pm > :first-child { margin-top: 0; }
.tdoc-inhalt h1, .tdoc-inhalt h2, .tdoc-inhalt h3 {
  font-family: var(--tdoc-serif); font-optical-sizing: auto; font-weight: 600; color: var(--tdoc-text);
}
.tdoc-inhalt h1 { margin: 1.55em 0 .5em; font-size: 31px; line-height: 1.2; letter-spacing: -.01em; }
.tdoc-inhalt h2 { margin: 1.7em 0 .5em; font-size: 25px; line-height: 1.25; letter-spacing: -.006em; }
.tdoc-inhalt h3 { margin: 1.5em 0 .4em; font-size: 19.5px; line-height: 1.32; }
.tdoc-inhalt p { margin: 0 0 1em; }
.tdoc-inhalt p:empty::before { content: '\00a0'; }   /* leere Zeilen/Zellen behalten ihre Höhe (wie im Editor) */
.tdoc-inhalt strong, .tdoc-inhalt b { font-weight: 620; }
.tdoc-inhalt ul, .tdoc-inhalt ol { margin: 0 0 1.1em; padding-left: 1.45em; }
.tdoc-inhalt li { margin: .32em 0; padding-left: .2em; }
.tdoc-inhalt li > p { margin: 0; }
.tdoc-inhalt li > p + p { margin-top: .4em; }
.tdoc-inhalt li::marker { color: var(--tdoc-text3); }
.tdoc-inhalt ul ul, .tdoc-inhalt ol ol, .tdoc-inhalt ul ol, .tdoc-inhalt ol ul { margin: .25em 0 .3em; }
.tdoc-inhalt blockquote { margin: 1.25em 0; padding: .05em 0 .05em 1.1em; border-left: 3px solid var(--tdoc-rand2); color: var(--tdoc-text2); }
.tdoc-inhalt blockquote > :last-child { margin-bottom: 0; }
.tdoc-inhalt hr { height: 0; margin: 2.2em 0; border: 0; border-top: 1px solid var(--tdoc-rand); }
.tdoc-inhalt a { color: var(--tdoc-link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2.5px; text-decoration-color: var(--tdoc-link-strich); }
.tdoc-inhalt a:hover { text-decoration-color: currentColor; }
/* Tabellen: heller Kopf, feine Ränder, Zahlen rechtsbündig (al-r) mit gleich breiten Ziffern */
.tdoc-tabelle, .tdoc-pm .tableWrapper { margin: 1.35em 0 1.6em; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tdoc-inhalt table { width: 100%; margin: 0; border-collapse: collapse; border-spacing: 0; font-size: 14.5px; line-height: 1.45; }
.tdoc-inhalt th, .tdoc-inhalt td { padding: 8px 12px; border: 1px solid var(--tdoc-rand); text-align: left; vertical-align: top; }
.tdoc-inhalt th { background: var(--tdoc-kopf); font-weight: 600; color: var(--tdoc-text); }
.tdoc-inhalt th > p, .tdoc-inhalt td > p { margin: 0; }
.tdoc-inhalt th > p + p, .tdoc-inhalt td > p + p { margin-top: .4em; }
.tdoc-inhalt .al-r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }   /* Beträge nicht umbrechen (Handy: Tabelle wischt) */
.tdoc-inhalt .al-c { text-align: center; }
/* Abbildungen in voller Breite, graue Bildunterschrift */
.tdoc-inhalt figure { margin: 1.8em 0 1.9em; }
.tdoc-inhalt figure img, .tdoc-inhalt img[data-od-path] { display: block; width: 100%; max-width: 100%; height: auto; border-radius: 3px; }
.tdoc-inhalt figcaption { margin-top: .7em; font-size: 13.5px; line-height: 1.45; color: var(--tdoc-text3); }
.tdoc-inhalt figcaption:empty { display: none; }
.tdoc-inhalt img.tdoc-laedt { min-height: 180px; background: var(--tdoc-kopf); }
.tdoc-inhalt img.tdoc-fehlt { min-height: 80px; background: var(--tdoc-kopf); outline: 1px dashed var(--tdoc-rand2); }
.tdoc-bild-fehlt { padding: 26px 16px; border: 1px dashed var(--tdoc-rand2); border-radius: 6px; color: var(--tdoc-text3); font-size: 13.5px; text-align: center; overflow-wrap: anywhere; }
.tdoc-leer { margin: 8px 0 0; color: var(--tdoc-text3); }
.tdoc ::selection { background: var(--tdoc-auswahl); }

/* ── Desktop: Bereich im Reiter (Seitenliste links bleibt wie bisher) ── */
#v-projekte .pj-wiki-main.tdoc-main { display: block; position: relative; padding: 0; overflow-x: hidden; overflow-y: auto; background: var(--tdoc-papier); }
#v-projekte #pjWikiMain.tdoc-main:not(:has(*))::before { content: none; }   /* alter Leer-Text „Noch keine Wiki-Seite“ (team-design.css) */
#v-projekte .pj-wiki-side .tdoc-seiten-titel { text-transform: uppercase; }
.tdoc-neu { margin: 2px 0 8px; padding: 8px; border: 1px solid var(--tdoc-rand2); border-radius: 9px; background: #fff; }
.tdoc-neu[hidden] { display: none; }
.tdoc-neu-in {
  width: 100%; height: 32px; padding: 0 9px; border: 1px solid var(--tdoc-rand2); border-radius: 7px; outline: none;
  font: inherit; font-size: 13.5px; color: var(--tdoc-text); background: #fff;
}
.tdoc-neu-in:focus { border-color: var(--tdoc-akzent); box-shadow: 0 0 0 3px var(--tdoc-akzent-hell); }
.tdoc-neu-tipp { display: block; font-size: 11.5px; line-height: 1.35; color: var(--tdoc-text3); }
.tdoc-neu-zeile { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; }
.tdoc-knopf.tdoc-klein { height: 26px; padding: 0 9px; border-radius: 7px; font-size: 12px; }
/* Entwurf ohne Dokument (das Dokument wurde gelöscht, während bearbeitet wurde) */
.tdoc-waise {
  margin: 10px 4px 4px; padding: 10px 11px; border: 1px solid #ecd9ae; border-radius: 9px; background: #fdf7e8;
  color: #5b4510; font: 400 12.5px/1.45 var(--tdoc-sans);
}
.tdoc-waise b { display: block; margin-bottom: 2px; font-weight: 650; }
.tdoc-waise span { display: block; overflow-wrap: anywhere; }
.tdoc-waise-knoepfe { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* Leiste oben (Lesen: Aktionen · Bearbeiten: Werkzeuge) – bleibt beim Scrollen stehen */
.tdoc-leiste {
  position: sticky; top: 0; z-index: 6; display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  min-height: 52px; padding: 9px 18px; background: color-mix(in srgb, var(--tdoc-papier) 94%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent; font-family: var(--tdoc-sans);
}
.tdoc-main.gescrollt .tdoc-leiste, .tdoc-leiste.tdoc-werkzeug { border-bottom-color: var(--tdoc-rand); }
.tdoc-leiste-l { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; flex: 1 1 auto; }
.tdoc-leiste-r { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: none; }
.tdoc-status { font-size: 12.5px; color: var(--tdoc-text3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tdoc-status:empty { display: none; }
.tdoc-status.ungespeichert { color: #a15c00; }
.tdoc-status.fehler { color: #b3261e; }
.tdoc-knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--tdoc-rand2); border-radius: 8px; background: var(--tdoc-papier); color: var(--tdoc-text);
  font: 500 13px/1 var(--tdoc-sans); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s;
}
.tdoc-knopf[hidden] { display: none; }   /* 2026-10-16 (Abschluss-Check): display:inline-flex überstimmte hidden – „Link entfernen“ stand auch ohne Link da */
.tdoc-knopf:hover { background: var(--tdoc-hover); }
.tdoc-knopf:disabled { opacity: .5; cursor: default; }
.tdoc-knopf svg { width: 15px; height: 15px; flex: none; }
.tdoc-knopf.tdoc-ikon { width: 32px; padding: 0; }
.tdoc-knopf.tdoc-haupt { border-color: var(--tdoc-akzent); background: var(--tdoc-akzent); color: #fff; font-weight: 600; }
.tdoc-knopf.tdoc-haupt:hover { background: var(--tdoc-akzent-dunkel); border-color: var(--tdoc-akzent-dunkel); }
.tdoc-knopf.tdoc-gefahr:hover { border-color: transparent; background: #fbeaea; color: #b3261e; }
/* Speichern-Knopf zeigt den Stand: „Gespeichert“ (still) · „Speichern“ mit Punkt (ungespeichert) */
.tdoc-knopf.tdoc-speichern { min-width: 102px; }
.tdoc-knopf.tdoc-speichern:disabled { opacity: 1; color: var(--tdoc-text3); background: transparent; border-color: transparent; }
.tdoc-knopf.tdoc-speichern.ungespeichert::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #d08a1e; flex: none; }
/* Werkzeugleiste */
.tdoc-wz {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 7px;
  background: transparent; color: var(--tdoc-text2); cursor: pointer; transition: background .1s, color .1s;
}
.tdoc-wz:hover { background: var(--tdoc-hover); color: var(--tdoc-text); }
.tdoc-wz.on { background: var(--tdoc-akzent-hell); color: var(--tdoc-akzent-dunkel); }
.tdoc-wz:disabled { opacity: .35; cursor: default; background: transparent; }
.tdoc-wz svg { width: 17px; height: 17px; }
.tdoc-wz.tdoc-wz-text { width: auto; padding: 0 8px; gap: 4px; display: inline-flex; align-items: center; font: 500 13px/1 var(--tdoc-sans); }
.tdoc-wz.tdoc-wz-text svg { width: 15px; height: 15px; }
.tdoc-trenner { width: 1px; height: 20px; margin: 0 4px; background: var(--tdoc-rand); flex: none; }
.tdoc-block {
  height: 32px; padding: 0 26px 0 9px; border: 1px solid var(--tdoc-rand2); border-radius: 7px; background: var(--tdoc-papier);
  color: var(--tdoc-text); font: 500 13px/1 var(--tdoc-sans); cursor: pointer; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a877f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center; background-size: 14px;
}
.tdoc-wz-wrap { position: relative; display: inline-flex; }
/* Listen/Zitat/Linie: breit als Knöpfe in der Leiste, schmal (Container-Abfrage) als Klappmenü hinter „…“ */
.tdoc-werkzeug { container-type: inline-size; container-name: tdoc-leiste; }
.tdoc-mehr { display: inline-flex; align-items: center; gap: 4px; }
.tdoc-wz.tdoc-mehr-knopf { display: none; }
@container tdoc-leiste (max-width: 820px) {                 /* ab ≈ 1440 px Fensterbreite passt alles in eine Zeile */
  .tdoc-leiste-l { gap: 2px; }
  .tdoc-trenner { margin: 0 2px; }
  .tdoc-knopf.tdoc-speichern { min-width: 0; }
  .tdoc-wz.tdoc-wz-text { width: 32px; padding: 0; }
  .tdoc-wz.tdoc-wz-text svg + svg { display: none; }           /* Pfeilchen bei Tabelle/Bild/„…“ weg */
  .tdoc-wz.tdoc-mehr-knopf { display: inline-flex; }
  .tdoc-mehr {
    display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; padding: 6px; gap: 2px;
    border: 1px solid var(--tdoc-rand2); border-radius: 11px; background: var(--tdoc-papier);
    box-shadow: 0 12px 32px rgba(24, 24, 22, .14), 0 2px 6px rgba(24, 24, 22, .06);
  }
  .tdoc-mehr.offen { display: inline-flex; }
}
.tdoc-menue {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 272px; padding: 6px; border: 1px solid var(--tdoc-rand2);
  border-radius: 11px; background: var(--tdoc-papier); box-shadow: 0 12px 32px rgba(24, 24, 22, .14), 0 2px 6px rgba(24, 24, 22, .06);
  font-family: var(--tdoc-sans);
}
.tdoc-menue[hidden] { display: none; }
.tdoc-menue button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 6px 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--tdoc-text); font: 400 13.5px/1.25 var(--tdoc-sans); text-align: left; cursor: pointer;
}
.tdoc-menue button:hover:not(:disabled) { background: var(--tdoc-hover); }
.tdoc-menue button:disabled { color: var(--tdoc-text3); cursor: default; }
.tdoc-menue button.on::after { content: '✓'; margin-left: auto; color: var(--tdoc-akzent); font-weight: 700; }
.tdoc-menue button svg { width: 16px; height: 16px; flex: none; color: var(--tdoc-text2); }
.tdoc-menue-sep { height: 1px; margin: 5px 4px; background: var(--tdoc-rand); }
.tdoc-menue-kopf { padding: 6px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--tdoc-text3); }
/* Link-Feld */
.tdoc-linkbox {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 31; width: 340px; max-width: calc(100vw - 32px); padding: 10px; border: 1px solid var(--tdoc-rand2);
  border-radius: 11px; background: var(--tdoc-papier); box-shadow: 0 12px 32px rgba(24, 24, 22, .14), 0 2px 6px rgba(24, 24, 22, .06);
  font-family: var(--tdoc-sans);
}
.tdoc-linkbox[hidden] { display: none; }
.tdoc-linkbox label { display: block; margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--tdoc-text2); }
.tdoc-link-in {
  width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--tdoc-rand2); border-radius: 8px; outline: none;
  background: var(--tdoc-papier); color: var(--tdoc-text); font: 400 13.5px/1 var(--tdoc-sans);
}
.tdoc-link-in:focus { border-color: var(--tdoc-akzent); box-shadow: 0 0 0 3px var(--tdoc-akzent-hell); }
.tdoc-link-fehler { margin: 6px 0 0; font-size: 12px; color: #b3261e; }
.tdoc-link-fehler:empty { display: none; }
.tdoc-link-knoepfe { display: flex; gap: 6px; justify-content: flex-end; margin-top: 10px; }
/* Hinweise (Entwurf gefunden, Konflikt, Markdown wird umgewandelt) */
.tdoc-hinweis {
  max-width: 704px; margin: 16px auto 0; padding: 12px 14px; border: 1px solid #ecd9ae; border-radius: 10px; background: #fdf7e8;
  color: #5b4510; font: 400 13.5px/1.5 var(--tdoc-sans);
}
.tdoc-hinweis[hidden] { display: none; }
.tdoc-hinweis.konflikt { border-color: #efc4c0; background: #fdf0ef; color: #7a1f17; }
.tdoc-hinweis.info { border-color: var(--tdoc-rand); background: var(--tdoc-kopf); color: var(--tdoc-text2); }
.tdoc-hinweis b { font-weight: 650; }
.tdoc-hinweis-knoepfe { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tdoc-hinweis-knoepfe:empty { display: none; }
/* Konflikt/gelöscht: hängt an der klebenden Werkzeugleiste (über dem Text, ohne ihn zu verschieben) – immer sichtbar,
   die Schreibstelle bleibt stehen; „Weiter bearbeiten“ blendet ihn aus */
.tdoc-werkzeug > .tdoc-hinweis {
  position: absolute; top: calc(100% + 6px); left: 16px; right: 16px; z-index: 8; max-width: 760px; margin: 0 auto;
  box-shadow: 0 12px 32px rgba(24, 24, 22, .16), 0 2px 6px rgba(24, 24, 22, .06);
}
/* Statustext (lädt hoch, Fehler, kein Entwurf möglich) als kleines Schild unter der Leiste – die Leiste bleibt einzeilig */
.tdoc-werkzeug .tdoc-leiste-r { position: relative; }
.tdoc-werkzeug .tdoc-status {
  position: absolute; top: calc(100% + 13px); right: 0; z-index: 7; max-width: 340px; padding: 4px 10px; overflow: hidden;
  text-overflow: ellipsis; border: 1px solid var(--tdoc-rand); border-radius: 7px; background: var(--tdoc-papier);
  box-shadow: 0 4px 14px rgba(24, 24, 22, .08); pointer-events: none;
}
/* Bearbeiten */
.tdoc-bearbeiten .tdoc-titel-in {
  display: block; width: 100%; min-height: 1.14em; margin: 0 0 14px; padding: 0; overflow: hidden; resize: none;
  border: 0; outline: none; background: transparent; color: var(--tdoc-text);
  font-family: var(--tdoc-serif); font-optical-sizing: auto; font-weight: 600; font-size: 40px; line-height: 1.14; letter-spacing: -.012em;
}
.tdoc-bearbeiten .tdoc-titel-in::placeholder { color: var(--tdoc-text3); opacity: 1; }
.tdoc-bearbeiten .tdoc-titel-in.tdoc-titel-fehlt { box-shadow: inset 0 -2px 0 #d08a1e; }
.tdoc-pm { min-height: 45vh; outline: none; caret-color: var(--tdoc-text); }
.tdoc-pm p.is-editor-empty:first-child::before, .tdoc-pm > p.is-empty::before {
  content: attr(data-placeholder); float: left; height: 0; color: var(--tdoc-text3); pointer-events: none;
}
.tdoc-pm table { table-layout: auto; }
.tdoc-pm th, .tdoc-pm td { position: relative; min-width: 3em; }
.tdoc-pm .selectedCell::after { content: ''; position: absolute; inset: 0; background: var(--tdoc-auswahl); pointer-events: none; }
.tdoc-pm figure.tdoc-fig { position: relative; }
.tdoc-pm figure.tdoc-fig img { cursor: pointer; }
.tdoc-pm figure.ProseMirror-selectednode img, .tdoc-pm figure.ProseMirror-selectednode .tdoc-bild-fehlt { outline: 3px solid var(--tdoc-link); outline-offset: 3px; }
.tdoc-pm figure.tdoc-fig img.tdoc-fehlt { display: none; }       /* fehlendes Bild: Text „Bild nicht verfügbar: …“ statt Bruch-Symbol */
.tdoc-pm figcaption:has(> br.ProseMirror-trailingBreak:only-child)::before {
  content: 'Bildunterschrift (optional)'; float: left; height: 0; color: var(--tdoc-text3); opacity: .8; pointer-events: none;
}
.tdoc-pm a { cursor: text; }
.tdoc-pm .ProseMirror-gapcursor::after { border-top-color: var(--tdoc-text); }
/* Bild-Auswahl aus dem Projektordner */
.tdoc-dialog { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 24px; background: rgba(24, 24, 22, .38); font-family: var(--tdoc-sans); }
.tdoc-dialog[hidden] { display: none; }
.tdoc-dialog-box {
  display: flex; flex-direction: column; width: min(760px, 100%); max-height: min(640px, 100%); overflow: hidden;
  border-radius: 14px; background: var(--tdoc-papier); color: var(--tdoc-text); box-shadow: 0 24px 60px rgba(24, 24, 22, .3);
}
.tdoc-dialog-kopf { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--tdoc-rand); }
.tdoc-dialog-kopf h3 { flex: 1; margin: 0; font: 600 18px/1.3 var(--tdoc-serif); }
.tdoc-pfad { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px 16px; font-size: 12.5px; color: var(--tdoc-text3); border-bottom: 1px solid var(--tdoc-rand); }
.tdoc-pfad button { padding: 2px 6px; border: 0; border-radius: 5px; background: transparent; color: var(--tdoc-link); font: inherit; cursor: pointer; }
.tdoc-pfad button:hover { background: var(--tdoc-hover); }
.tdoc-pfad span { padding: 2px 0; }
.tdoc-raster { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 14px 16px 18px; align-content: start; }
.tdoc-kachel {
  display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--tdoc-rand); border-radius: 10px;
  background: var(--tdoc-papier); color: var(--tdoc-text); font: 500 12.5px/1.3 var(--tdoc-sans); text-align: left; cursor: pointer;
}
.tdoc-kachel:hover { border-color: var(--tdoc-akzent); background: var(--tdoc-hover); }
.tdoc-kachel-bild { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 6px; background: var(--tdoc-kopf); overflow: hidden; color: var(--tdoc-text3); }
.tdoc-kachel-bild img { width: 100%; height: 100%; object-fit: cover; }
.tdoc-kachel-bild svg { width: 34px; height: 34px; }
.tdoc-kachel-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tdoc-raster-leer { grid-column: 1 / -1; padding: 30px 10px; text-align: center; color: var(--tdoc-text3); font-size: 13.5px; }
.tdoc-dialog-fuss { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--tdoc-rand); }
/* Leerer Bereich (noch kein Dokument) */
.tdoc-leer-seite { max-width: 420px; margin: 72px auto; padding: 0 24px; text-align: center; font-family: var(--tdoc-sans); color: var(--tdoc-text2); }
.tdoc-leer-seite h3 { margin: 0 0 8px; font: 600 24px/1.25 var(--tdoc-serif); color: var(--tdoc-text); }
.tdoc-leer-seite p { margin: 0 0 18px; font-size: 14px; line-height: 1.6; }
.tdoc-neu-mitte { display: flex; gap: 8px; max-width: 380px; margin: 0 auto; }
.tdoc-neu-mitte .tdoc-neu-in { flex: 1; min-width: 0; height: 34px; }

/* ── Handy (pwa-mobile.html: Projekte → Dokumente, nur lesen) ── */
.tdoc.tdoc-m { max-width: none; padding: 8px 6px 40px; font-size: 16px; line-height: 1.6; }
.tdoc-m .tdoc-titel { font-size: 29px; line-height: 1.16; margin-bottom: 12px; }
.tdoc-m .tdoc-chips { margin-bottom: 24px; }
.tdoc-m .tdoc-inhalt h1 { font-size: 25px; }
.tdoc-m .tdoc-inhalt h2 { font-size: 22px; margin-top: 1.55em; }
.tdoc-m .tdoc-inhalt h3 { font-size: 18px; }
.tdoc-m .tdoc-tabelle { margin-left: -6px; margin-right: -6px; padding: 0 6px; }
.tdoc-m .tdoc-inhalt table { width: auto; min-width: 100%; font-size: 13.5px; }
.tdoc-m .tdoc-inhalt th, .tdoc-m .tdoc-inhalt td { width: 7.2em; padding: 7px 9px; }
.tdoc-m .tdoc-inhalt figure { margin: 1.5em 0; }

/* ── Mittelbreite Fenster ── */
@media (max-width: 1200px) {
  .tdoc { padding: 28px 24px 96px; }
  .tdoc-titel, .tdoc-bearbeiten .tdoc-titel-in { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .tdoc-knopf, .tdoc-wz { transition: none; }
}
@media print {
  .tdoc-leiste, .tdoc-hinweis, #v-projekte .pj-wiki-side { display: none !important; }
  .tdoc { max-width: none; padding: 0; }
}

/* ================================================================
   2026-10-21 (Paket D3) · Dokument-Feinschliff – abgenommener Entwurf Bild 13–15 (Martin 19./20.10.)
   - Bearbeiten sieht aus wie Lesen: der Titel ist dieselbe Überschrift (h1.tdoc-titel, contenteditable) – im Blatt 0 Pixel Unterschied
   - schmalere, ruhige Leiste (gleich hoch wie die Lese-Leiste, 52 px): Text ▾ · B I U · Listen + Checkliste · Link, Tabelle, Bild · „…“
   - Speicherstand „Gespeichert · 19:40“ statt Speichern-Knopf (automatisch speichern; ⌘S und „Fertig“ bleiben)
   - Checkliste: Lesen (Häkchen-Zeichen, nicht anklickbar) und Bearbeiten (Häkchen setzen) gleich gebaut – Desktop und Handy
   Blase und „/“-Menü kommen vom Editor-Baustein der Notizen (team-desktop-e7.css Abschnitt 14.6, .eb-*).
   ================================================================ */

/* ── Titel: Überschrift statt Textfeld (Maße kommen von .tdoc-titel, genau wie beim Lesen) ── */
.tdoc-bearbeiten h1.tdoc-titel[contenteditable] { outline: none; caret-color: var(--tdoc-text); cursor: text; }
.tdoc-bearbeiten h1.tdoc-titel[contenteditable]:empty::before { content: attr(data-platzhalter); color: var(--tdoc-text3); pointer-events: none; }
.tdoc-bearbeiten h1.tdoc-titel.tdoc-titel-fehlt { box-shadow: inset 0 -2px 0 #d08a1e; }

/* Text im Editor umbrechen wie beim Lesen: ProseMirror setzt white-space: break-spaces (ein Leerzeichen am Zeilenende nimmt Platz ein
   und kann eine Zeile mehr erzwingen, z. B. in schmalen Tabellenspalten) und schaltet Ligaturen ab – hier wie in der Leseansicht
   (pre-wrap: Leerzeichen am Zeilenende hängen über; mehrere Leerzeichen bleiben sichtbar), Ligaturen wie beim Lesen */
.tdoc-inhalt .tdoc-pm.ProseMirror { white-space: pre-wrap; font-variant-ligatures: normal; font-feature-settings: normal; }

/* ── Leiste: ruhig, einzeilig ── */
.tdoc-wz3 { flex-wrap: nowrap; }
.tdoc-wz3 .tdoc-leiste-l { gap: 2px; flex-wrap: nowrap; }
.tdoc-wz3 .tdoc-trenner { margin: 0 5px; }
.tdoc-wz3 .tdoc-wz { color: var(--tdoc-text2); }
.tdoc-wz3 .tdoc-wz.on { color: var(--tdoc-akzent-dunkel); }
.tdoc-wz3 .tdoc-wz:focus-visible, .tdoc-art:focus-visible, .tdoc-wz3 .tdoc-knopf:focus-visible, .tdoc-wz3 .tdoc-menue button:focus-visible,
.tdoc-stand button:focus-visible { outline: 2.5px solid var(--e7-fokus, #1f5fbf); outline-offset: 1px; }
.tdoc-art {
  display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 8px 0 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--tdoc-text); font: 600 13px/1 var(--tdoc-sans); cursor: pointer; white-space: nowrap;
}
.tdoc-art:hover, .tdoc-art[aria-expanded="true"] { background: var(--tdoc-hover); }
.tdoc-art svg { width: 14px; height: 14px; flex: none; color: var(--tdoc-text3); }
.tdoc-art-t { min-width: 6.1em; text-align: left; }        /* Breite bleibt beim Wechsel Text/Überschrift/Zwischentitel gleich */
.tdoc-wz3 .tdoc-menue kbd {
  margin-left: auto; padding: 3px 5px; border-radius: 5px; background: none; box-shadow: inset 0 0 0 1px var(--tdoc-rand);
  font: 500 11px/1 var(--tdoc-sans); color: var(--tdoc-text2); white-space: nowrap;
}
.tdoc-menue-art { min-width: 212px; }
.tdoc-menue-mehr { min-width: 246px; }
.tdoc-menue-art button.on, .tdoc-menue-mehr button.on { background: var(--tdoc-akzent-hell); color: var(--tdoc-akzent-dunkel); font-weight: 600; }
.tdoc-menue-art button.on::after, .tdoc-menue-mehr button.on::after { content: none; }
.tdoc-menue-art button:focus-visible, .tdoc-menue-mehr button:focus-visible { outline-offset: -2px; }

/* ── Speicherstand („Gespeichert · 19:40“) ── */
.tdoc-stand {
  display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; font: 500 12.5px/1 var(--tdoc-sans); color: var(--tdoc-text2);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.tdoc-stand:empty { display: none; }
.tdoc-stand svg { width: 15px; height: 15px; flex: none; color: var(--tdoc-akzent); }
.tdoc-stand-punkt { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--tdoc-akzent); box-shadow: 0 0 0 3px var(--tdoc-akzent-hell); }
.tdoc-stand.fehler { color: #b3261e; font-weight: 600; }
.tdoc-stand.fehler svg { color: #b3261e; }
.tdoc-stand.konflikt { color: #7a5200; font-weight: 600; }
.tdoc-stand.konflikt svg { color: #a86b00; }
.tdoc-stand .tdoc-stand-k {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; margin: 0 -6px; padding: 0 6px; border: 0; border-radius: 7px;
  background: none; color: inherit; font: inherit; cursor: pointer; white-space: nowrap;
}
.tdoc-stand .tdoc-stand-k:hover { background: var(--tdoc-hover); }
.tdoc-stand .tdoc-stand-k u { text-decoration-thickness: 1px; text-underline-offset: 2.5px; }
.tdoc-art-k { display: none; font: 650 12.5px/1 var(--tdoc-serif); }
/* Schmale Bereiche (Container-Abfrage auf die Leiste, Breite ohne Innenabstand) – nichts quetscht sich, nichts ragt hinaus:
   ≤ 900 px (Fenster ≈ 1440 px): „Nicht gespeichert · Erneut“ bzw. „· Anzeigen“ (2026-10-21, Nachbesserung: die Aktion bleibt sichtbar,
   nur „versuchen“/„neuere Fassung“ fallen weg) · ≤ 780 px (Fenster ≈ 1366 px): Stand nur Zeichen + Uhrzeit bzw. „Nicht gespeichert“
   (unterstrichen – der ganze Stand ist der Knopf) · ≤ 700 px (≈ 1280 px): Textart als Kurzform (T/Ü1/Ü2) · ≤ 600 px (≈ 1024 px): nur
   Zeichen, schmalere Knöpfe. Ausgeblendete Wörter bleiben für Vorleseprogramme da (aria-label/title nennen alles). */
@container tdoc-leiste (max-width: 900px) {
  .tdoc-stand-lang { display: none; }
}
@container tdoc-leiste (max-width: 780px) {
  .tdoc-stand-extra { display: none; }
  .tdoc-stand .tdoc-stand-k .tdoc-stand-haupt { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2.5px; }
  .tdoc-stand-wort {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
}
@container tdoc-leiste (max-width: 700px) {
  .tdoc-wz3 .tdoc-trenner { margin: 0 2px; }
  .tdoc-art { padding: 0 6px 0 8px; gap: 4px; }
  .tdoc-art-t {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  .tdoc-art-k { display: inline; min-width: 1.4em; text-align: center; }
  .tdoc-stand { margin-right: 4px; }
}
@container tdoc-leiste (max-width: 600px) {
  .tdoc-wz3 .tdoc-leiste-l { gap: 1px; margin-left: -6px; }
  .tdoc-wz3 .tdoc-leiste-r { margin-right: -6px; }
  .tdoc-wz3 .tdoc-wz { width: 28px; }
  .tdoc-wz3 .tdoc-knopf.tdoc-haupt { padding: 0 10px; }
  .tdoc-stand-haupt, .tdoc-stand-zeit {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  .tdoc-stand .tdoc-stand-k { margin: 0 -4px; padding: 0 4px; }
}

/* ── Checkliste: Lesen und Bearbeiten gleich gebaut (Häkchen links, Text 31 px eingerückt) ── */
.tdoc-inhalt ul[data-type="taskList"] { list-style: none; padding-left: 0; }
.tdoc-inhalt ul[data-type="taskList"] > li { position: relative; padding-left: 31px; }
.tdoc-inhalt ul[data-type="taskList"] > li::marker { content: none; }
.tdoc-haken, .tdoc-pm ul[data-type="taskList"] > li > label {
  position: absolute; left: 0; top: calc((1.62em - 20px) / 2); top: calc((1lh - 20px) / 2); width: 20px; height: 20px; margin: 0;
}
.tdoc-haken, .tdoc-pm ul[data-type="taskList"] > li > label input {
  display: block; width: 20px; height: 20px; margin: 0; border-radius: 50%; background: var(--tdoc-papier) center / 13px no-repeat;
  box-shadow: inset 0 0 0 1.6px #958f83;
}
.tdoc-haken.an, .tdoc-pm ul[data-type="taskList"] > li > label input:checked {
  background-color: var(--tdoc-akzent); box-shadow: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.tdoc-pm ul[data-type="taskList"] > li > label { display: block; cursor: pointer; user-select: none; }
.tdoc-pm ul[data-type="taskList"] > li > label input { appearance: none; -webkit-appearance: none; cursor: pointer; }
.tdoc-pm ul[data-type="taskList"] > li > label input:focus-visible { outline: 2.5px solid var(--e7-fokus, #1f5fbf); outline-offset: 2px; }
.tdoc-pm ul[data-type="taskList"] > li > label > span { display: none; }
.tdoc-pm ul[data-type="taskList"] > li > div { min-width: 0; }
.tdoc-pm ul[data-type="taskList"] > li > div > p { margin: 0; }
.tdoc-pm ul[data-type="taskList"] > li > div > p + p { margin-top: .4em; }
.tdoc-inhalt ul[data-type="taskList"] > li[data-checked="true"] { color: var(--tdoc-text2); }
[data-theme="dark"] .tdoc-haken, [data-theme="dark"] .tdoc-pm ul[data-type="taskList"] > li > label input { box-shadow: inset 0 0 0 1.6px #8f8c84; }
