/* ============================================================
   comunoo – Basis-Styles & kleines Komponenten-System.
   Ergänzt das (self-hosted) Tailwind. Zurückhaltend: neutrale
   Grautöne + ein Akzent, viel Weißraum, weiche Ränder.
   (Design-Sprache übernommen von gemeinde-newsletter.de.)
   ============================================================ */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e7eaf0;
  --text: #1e293b;
  --muted: #64748b;
  --heading: #0f172a;
  --accent: #2563eb;
  --accent-weak: #eff4ff;
  --primary: #0f172a;
  --primary-hover: #334155;
  --danger: #dc2626;
  --radius: 10px;
  --ring: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
}

a:focus-visible, button:focus-visible {
  outline: none; box-shadow: var(--ring); border-color: var(--accent);
}
::selection { background: var(--accent-weak); }

.page-title { font-size: 1.5rem; line-height: 1.2; font-weight: 600; color: var(--heading); }
.muted { color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 1.5rem;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: 8px; padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 500;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.25rem;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-secondary { background: #f1f5f9; color: #334155; border-color: var(--border); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-ghost { background: none; border-color: transparent; color: #64748b; }
.btn-ghost:hover { background: #fef2f2; color: #b91c1c; }

.badge { display: inline-block; font-size: 0.72rem; font-weight: 500; padding: 0.15rem 0.5rem; border-radius: 999px; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-blue { background: var(--accent-weak); color: #1e40af; }

.nav-link { color: var(--muted); padding: 0.35rem 0.1rem; font-size: 0.9rem; text-decoration: none; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.nav-link:hover { color: var(--heading); }
.nav-link--active { color: var(--heading); border-bottom-color: var(--primary); font-weight: 500; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
a.link, .prose-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
a.link:hover { text-decoration: none; }

/* ---- Rich-Text lesbar ---- */
.prose-content h1, .prose-content h2, .prose-content h3, .prose-content h4 { font-weight: 600; color: var(--heading); margin: 0.8em 0 0.35em; }
.prose-content p { margin: 0.55em 0; }
/* Hervorgehoben (Block-Ebene): fett + zentriert — Leseansicht wie Editor. */
.prose-content p.emphasis, .ProseMirror p.emphasis { font-weight: 700; text-align: center; }

/* ---- Autoren-Startseite: warme, einladende Begrüßung ---- */
.author-greeting { margin: 0 0 1.2rem; }
.author-greeting h1 { font-size: 1.7rem; line-height: 1.15; font-weight: 700; color: var(--heading); margin: 0 0 0.2rem; }
.author-greeting p { margin: 0; color: var(--muted); }

.author-hero { display: flex; align-items: stretch; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--accent-weak), var(--surface) 70%);
  border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.author-hero-main { min-width: 12rem; }
.author-hero-eyebrow { display: block; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.author-hero-title { font-size: 1.5rem; font-weight: 700; color: var(--heading); margin: 0.15rem 0 0.1rem; line-height: 1.1; }
.author-hero-sub { margin: 0; color: var(--muted); font-size: 0.9rem; }

.deadline-box { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-width: 8.5rem; padding: 0.55rem 0.95rem; border-radius: 12px; border: 1px solid; }
.deadline-box .d-num { font-size: 1.85rem; font-weight: 800; line-height: 1; }
.deadline-box .d-label { font-size: 0.78rem; font-weight: 600; margin-top: 0.15rem; }
.deadline-box .d-date { font-size: 0.72rem; opacity: 0.85; margin-top: 0.25rem; }
.deadline-box.is-ok   { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.deadline-box.is-soon { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.deadline-box.is-late { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.deadline-box.is-past { background: #f8fafc; border-color: var(--border); color: #64748b; }

.switch-inline { display: inline-flex; align-items: center; gap: 0.45rem; margin-top: 0.7rem; }
.switch-inline label { font-size: 0.82rem; color: var(--muted); margin: 0; }
.switch-inline select { padding: 0.25rem 0.5rem; font-size: 0.85rem; }

/* Schreib-/Beitrags-Reihen (Rubriken zum Bestücken, eigene Beiträge) */
.write-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.6rem 0.85rem; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 0.5rem;
  transition: border-color 0.12s, background 0.12s; }
.write-row:last-child { margin-bottom: 0; }
.write-row-title { font-weight: 600; color: var(--heading); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.write-row-title a { font-weight: 600; }
.write-row .btn { white-space: nowrap; }

/* Öffentliche Termin-Liste (Landingpage): darf umbrechen — auf schmalen Screens
   rutscht der Redaktionsschluss unter den Ausgaben-Namen statt ihn zu quetschen. */
.termin-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.1rem 0.9rem; padding: 0.55rem 0.85rem; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 0.5rem; }
.termin-row:last-child { margin-bottom: 0; }
.termin-row-name { font-weight: 600; color: var(--heading); }

/* Gestyltes Datei-Feld (Editor-Bilder, Wappen, …) — nativer Input unsichtbar, aber im Formular. */
.file-field { display: inline-flex; align-items: center; gap: 0.55rem; cursor: pointer; }
.file-field input[type='file'] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.file-field input[type='file']:focus-visible + .btn { box-shadow: var(--ring); }
.file-field .file-name { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card > .write-row:first-of-type { margin-top: 0.2rem; }
.prose-content ul { list-style: disc; padding-left: 1.4em; margin: 0.55em 0; }
.prose-content ol { list-style: decimal; padding-left: 1.4em; margin: 0.55em 0; }
.prose-content table { border-collapse: collapse; width: 100%; }
.prose-content th, .prose-content td { border: 1px solid var(--border); padding: 0.35rem 0.55rem; text-align: left; }
.prose-content img { max-width: 100%; height: auto; border-radius: 8px; }

/* ---- Rubrikbaum ---- */
.rubric-tree { font-size: 0.925rem; }
.rubric-branch { margin-left: 0.75rem; padding-left: 0.85rem; border-left: 1px solid var(--border); }
.rubric-row { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.12rem 0; }
.rubric-marker { width: 1rem; text-align: center; font-size: 0.7rem; line-height: 1.4; flex: 0 0 auto; }
.rubric-empty { color: #94a3b8; }
.rubric-filled { color: var(--heading); font-weight: 500; }
.rubric-articles { list-style: none; margin: 0.15rem 0 0.35rem 1.5rem; padding: 0; }
.rubric-articles li { padding: 0.12rem 0; }

/* Regieanweisung an den Verlag (Kommentar) */
.editor-note {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px;
  padding: 0.7rem 0.9rem; color: #92400e; font-size: 0.875rem; margin: 0.75rem 0;
}

/* Bild-Platzhalter (Bytes liegen noch in Cross-7 / Objektspeicher folgt) */
.asset-ph {
  display: flex; align-items: center; gap: 0.6rem;
  border: 1px dashed var(--border); border-radius: 8px; padding: 0.7rem 0.9rem;
  color: var(--muted); font-size: 0.875rem; background: #fcfdff;
}
.asset-ph .glyph { font-size: 1.1rem; }

/* ---- Buttons/Formular (Editor) ---- */
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary[disabled] { opacity: 0.55; cursor: default; }
.label { display: block; font-size: 0.8rem; font-weight: 500; color: #334155; margin-bottom: 0.3rem; }
.input {
  width: 100%; border: 1px solid #94a3b8; border-radius: 8px;
  padding: 0.55rem 0.7rem; font-size: 1rem; background: #fff; color: var(--text);
}
.input::placeholder { color: #94a3b8; }
.input:hover { border-color: #64748b; }
.input:focus, .input:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--accent); }

/* ---- Editor-Werkzeugleiste ---- */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem;
  margin: 0.85rem 0 0.5rem; padding: 0.35rem;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
  position: sticky; top: 3.5rem; z-index: 10;
}
.tb-btn {
  min-width: 2rem; height: 2rem; padding: 0 0.5rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 6px; background: transparent;
  color: #334155; font-size: 0.9rem; cursor: pointer; line-height: 1;
}
.tb-btn:hover { background: #f1f5f9; }
.tb-btn.is-active { background: var(--accent-weak); color: #1e40af; border-color: #c7d7fe; }
/* Blocktyp-Dropdown in der Toolbar (Fließtext ↔ Zwischentitel) */
.tb-select { height: 2rem; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: #334155; font-size: 0.85rem; padding: 0 1.4rem 0 0.5rem; cursor: pointer; }
.tb-select:hover { border-color: #94a3b8; }
.tb-sep { width: 1px; align-self: stretch; margin: 0.15rem 0.3rem; background: var(--border); }

/* ---- Editier-Fläche (ProseMirror) ---- */
/* min-height/padding aufs ProseMirror SELBST (nicht den Wrapper): sonst ist die
   editierbare Fläche nur eine Zeile hoch und Klicks in den weißen Bereich
   fokussieren nichts („kann nix eingeben"). */
.editor-doc { padding: 0; }
.editor-doc .ProseMirror { min-height: 22rem; padding: 1.1rem 1.25rem; }
.editor-doc:focus, .editor-doc .ProseMirror:focus { outline: none; }
.ProseMirror:focus { outline: none; }
.ProseMirror p.is-editor-empty:first-child::before {
  content: 'Text eingeben…'; color: #94a3b8; float: left; height: 0; pointer-events: none;
}
.ProseMirror table, .prose-content table { border-collapse: collapse; margin: 0.85em 0; width: 100%; table-layout: fixed; }
.ProseMirror th, .ProseMirror td, .prose-content th, .prose-content td {
  border: 1px solid #94a3b8; padding: 0.5rem 0.65rem; vertical-align: top; min-width: 3rem; position: relative;
}
.ProseMirror th, .prose-content th { background: #eef2f7; font-weight: 600; text-align: left; }
.ProseMirror td > p, .ProseMirror th > p, .prose-content td > p, .prose-content th > p { margin: 0; }
.ProseMirror .selectedCell { background: var(--accent-weak); }
.ProseMirror .selectedCell::after {
  content: ''; position: absolute; inset: 0; background: rgba(37, 99, 235, 0.12); pointer-events: none;
}

.editor-actions { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.9rem; }

/* ---- Bildergalerie / Upload ---- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; margin-top: 1.25rem; }
.asset-fig { margin: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.asset-fig img { display: block; width: 100%; height: 150px; object-fit: cover; background: #f1f5f9; }
.asset-fig figcaption { padding: 0.4rem 0.6rem; font-size: 0.78rem; color: var(--muted); }
.asset-doc {
  display: flex; align-items: center; gap: 0.6rem; text-decoration: none;
  border: 1px solid var(--border); border-radius: 8px; padding: 0.7rem 0.9rem;
  color: var(--text); font-size: 0.85rem; background: #fcfdff;
}
.asset-doc:hover { background: #f1f5f9; }
.asset-doc .glyph { font-size: 1.4rem; }
.upload-form { display: flex; flex-direction: column; align-items: flex-start; gap: 0.7rem; }
.upload-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.upload-form input[type='file'] { font-size: 0.85rem; max-width: 15rem; }
.rights-check {
  display: flex; align-items: flex-start; gap: 0.5rem; max-width: 46rem;
  font-size: 0.82rem; color: var(--muted); line-height: 1.45; cursor: pointer;
}
.rights-check input { margin-top: 0.2rem; flex: 0 0 auto; }

/* ---- Kopfzeile: Blatt-Umschalter ---- */
.tenant-switch { display: flex; align-items: center; gap: 0.35rem; margin: 0; }

/* ---- Nutzerverwaltung: Rubrik-Zuweisung ---- */
.rubric-picker {
  max-height: 18rem; overflow-y: auto; margin-top: 0.5rem;
  border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.8rem;
}
.rubric-check { display: flex; align-items: center; gap: 0.45rem; padding: 0.14rem 0; font-size: 0.9rem; cursor: pointer; }
.rubric-check input { flex: 0 0 auto; }

/* ---- Artikel anlegen / löschen ---- */
.add-article { display: inline; margin-left: .35rem; }
.add-article button {
  background: none; border: 0; padding: .05rem .3rem; cursor: pointer;
  color: var(--accent); font-size: .78rem; border-radius: 5px;
}
.add-article button:hover { background: var(--accent-weak); }
.btn-danger { background: #fff; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }

/* ---- Rubrik-Verwaltung (/rubriken) ---- */
.rubrik-list { list-style: none; margin: 0; padding: 0; }
.rubrik-children { margin-left: 1.6rem; }
/* Read-only-Baum (Kommune): gleiche Einrückung wie die Verwaltungsansicht. */
.rubrik-branch { margin-left: 1.6rem; }
.rubrik-row { display: flex; align-items: flex-start; gap: 0.4rem; padding: 0.25rem 0; border-top: 1px solid #f1f5f9; }
.rubrik-root > .rubrik-item:first-child > .rubrik-row { border-top: 0; }
.rubrik-item.dragging { opacity: 0.5; }
.rubrik-details { flex: 1; min-width: 0; }
.rubrik-details > summary { cursor: pointer; padding: 0.2rem 0; display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
/* Sichtbare Affordanz: Rubrik-Zeilen sind aufklappbar/bearbeitbar — nicht nur ziehbar. */
.rubrik-details > summary::after { content: 'bearbeiten ▾'; margin-left: auto; font-size: 0.72rem; color: var(--accent); opacity: 0; transition: opacity 0.12s; white-space: nowrap; }
.rubrik-row:hover .rubrik-details > summary::after { opacity: 0.9; }
.rubrik-details[open] > summary::after { content: 'schließen ▴'; opacity: 0.9; }
.rubrik-title { font-weight: 500; color: var(--heading); }
.rubrik-inactive > .rubrik-row .rubrik-title { color: #94a3b8; font-weight: 400; }
.rubrik-edit {
  margin: 0.6rem 0 0.9rem; padding: 0.9rem 1rem;
  border: 1px solid var(--border); border-radius: 8px; background: #fcfdff;
  display: flex; flex-direction: column; gap: 0.9rem;
}
.rubrik-form { display: flex; flex-direction: column; gap: 0.7rem; }
.rubrik-flags { display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; }
.rubrik-limits { display: flex; flex-wrap: wrap; gap: 0.7rem 0.9rem; }
.rubrik-limits label { font-size: 0.8rem; font-weight: 500; color: #475569; display: flex; flex-direction: column; gap: 0.25rem; }
.rubrik-limits .input { width: 8.5rem; }
.rubrik-signet { border-top: 1px dashed var(--border); padding-top: 0.8rem; }
.signet-current { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; margin: 0.3rem 0 0.7rem; }
.signet-thumb {
  height: 56px; width: 56px; object-fit: contain;
  border: 1px solid var(--border); border-radius: 6px; background: #fff; padding: 2px;
}
.rubrik-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; border-top: 1px dashed var(--border); padding-top: 0.8rem; }
.rubrik-actions form { margin: 0; }
.drag-handle {
  cursor: grab; border: 0; background: none; color: #94a3b8;
  font-size: 1rem; line-height: 1; padding: 0.3rem 0.3rem; border-radius: 6px; flex: 0 0 auto;
}
.drag-handle:hover { color: #334155; background: #f1f5f9; }
.drag-handle:active { cursor: grabbing; }
.drag-handle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; box-shadow: none; }
/* Während des Ziehens: leere Kinderlisten als Drop-Zone sichtbar machen. */
body.dnd-active .rubrik-list:empty {
  min-height: 1.3rem; margin: 0.15rem 0 0.35rem;
  outline: 2px dashed #cbd5e1; outline-offset: -2px; border-radius: 6px;
}

/* Stilllegen: bewusst gefährlich (voll rot) — nur Verlag sieht den Knopf */
.btn-danger-solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger-solid:hover { background: #b91c1c; border-color: #b91c1c; }

/* ---- Freigabe / Prüf-Übersicht ---- */
.btn-success { background: #15803d; color: #fff; border-color: #15803d; }
.btn-success:hover { background: #166534; border-color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }
.status-bar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.review-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.3rem 0; flex-wrap: wrap; }
.review-main { flex: 1 1 18rem; }
.review-act { flex: 0 0 auto; display: flex; gap: 0.35rem; }

/* Nutzerliste: ganze Zeile ist ein Link auf die Detailseite */
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.55rem; text-decoration: none; color: inherit; transition: border-color 0.12s, background 0.12s, box-shadow 0.12s; }
/* Nur die verlinkten Karten (Nutzerliste) sind anklickbar — deutliche Affordanz. */
a.user-row { cursor: pointer; }
a.user-row:hover { border-color: var(--accent); background: var(--accent-weak); box-shadow: 0 2px 10px rgba(37, 99, 235, 0.10); }
a.user-row:hover .user-row-chevron { color: var(--accent); transform: translateX(3px); }
.user-row-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row-meta { flex: 0 0 auto; display: flex; align-items: center; gap: 0.5rem; }
.user-row-chevron { color: var(--accent); font-size: 1.35rem; line-height: 1; transition: color 0.12s, transform 0.12s; }

/* Icon-Button (z. B. Abmelden = Tür-Icon in der Kopfzeile) */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: 8px; padding: 0.3rem; color: #64748b; cursor: pointer; transition: background 0.12s, color 0.12s; }
.icon-btn:hover { background: #f1f5f9; color: #0f172a; }
/* Gemeindewappen in der Kopfzeile: feste Box, SVG skaliert rein (browserrobust,
   auch Safari — kein Verlass auf die Intrinsic-Size eines viewBox-only-SVGs). */
.brand-wappen { display: inline-block; width: 28px; height: 28px; flex-shrink: 0; background-size: contain; background-position: center; background-repeat: no-repeat; border-radius: 4px; }
/* „Mein Konto" in der Kopfzeile — beschriftet & klickbar, im selben Stil wie die Nav-Links. */
.acct-link { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.1rem; color: var(--muted); text-decoration: none; font-size: 0.9rem; transition: color 0.15s; }
.acct-link:hover { color: var(--heading); }
.acct-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 11rem; }
.acct-role { color: var(--muted); font-weight: 400; }

/* Gefahrenzone (z. B. Nutzer entfernen) */
.card-danger { border-color: #fecaca; background: #fff5f5; }

/* Sonderverteilungs-Umschalter in der Ausgabenliste (klar als Toggle erkennbar) */
.sv-toggle { display: inline-flex; align-items: center; gap: 0.3rem; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: #94a3b8; padding: 0.1rem 0.45rem; font-size: 0.68rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background 0.12s, border-color 0.12s, color 0.12s; }
.sv-toggle::before { content: ''; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: #cbd5e1; flex: 0 0 auto; }
.sv-toggle:hover { border-color: #94a3b8; background: #f8fafc; }
.sv-toggle.sv-on { border-color: #f59e0b; background: #fffbeb; color: #92400e; }
.sv-toggle.sv-on::before { background: #f59e0b; }

/* Globaler Systemhinweis (Banner unter der Kopfzeile) */
.sysnotice { border-bottom: 1px solid transparent; }
.sysnotice-inner { display: flex; align-items: baseline; gap: 0.6rem; padding-top: 0.55rem; padding-bottom: 0.55rem; font-size: 0.875rem; line-height: 1.35; }
.sysnotice-tag { flex: 0 0 auto; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 999px; }
.sysnotice-info { background: #eff6ff; color: #1e3a8a; border-bottom-color: #bfdbfe; }
.sysnotice-info .sysnotice-tag { background: #dbeafe; color: #1e40af; }
.sysnotice-warn { background: #fffbeb; color: #7c2d12; border-bottom-color: #fde68a; }
.sysnotice-warn .sysnotice-tag { background: #fef3c7; color: #92400e; }

/* Masquerade („als Nutzer ansehen") — Umschalter im Header + deutlicher Banner */
.masq-switch { display: inline-flex; align-items: center; gap: 0.3rem; }
.masq-banner { background: #eef2ff; border-bottom: 1px solid #c7d2fe; color: #3730a3; }
.masq-banner .sysnotice-inner { display: flex; align-items: center; gap: 0.6rem; padding-top: 0.5rem; padding-bottom: 0.5rem; font-size: 0.875rem; }
.masq-tag { flex: 0 0 auto; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 999px; background: #e0e7ff; color: #4338ca; }

/* Termine: zwei nebeneinanderliegende Panels (Urlaub / geblockte Tage) */
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1.1rem; }
.subpanel { border: 1px solid var(--border); border-radius: 12px; padding: 0.9rem 1rem; background: #f8fafc; }
.subpanel-title { font-weight: 600; color: #0f172a; margin: 0 0 0.15rem; }
.day-list { list-style: none; padding: 0; margin: 0; }
.day-item { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.35rem 0.35rem 0.35rem 0.6rem; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 0.4rem; background: #fff; }

/* Toolbar: Tabellen-Werkzeuge nur im Tabellen-Kontext */
.tb-table-ops { display: none; }
.tb-table-ops.show {
  display: inline-flex; align-items: center; gap: 0.15rem;
  background: var(--accent-weak); border: 1px solid #c7d7fe; border-radius: 8px;
  padding: 0.15rem 0.3rem;
}
.tb-table-label {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: #1e40af; padding: 0 0.35rem 0 0.15rem; white-space: nowrap;
}
.tb-table-ops .tb-btn { font-size: 0.82rem; height: 1.75rem; }
.tb-btn.tb-danger { color: var(--danger); }
.tb-btn.tb-danger:hover { background: #fef2f2; }
.tb-btn svg { display: block; }

/* Kopfzeile: Nav inline (Desktop) bzw. hinter einem Burger-Knopf (mobil).
   Konto + Abmelden (.app-right) bleiben immer sichtbar; reiner CSS-Toggle. */
.app-right { display: inline-flex; align-items: center; gap: 0.35rem; order: 2; }
.nav-toggle { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.nav-burger { order: 3; }
@media (min-width: 640px) {
  .nav-burger { display: none; }
  .app-nav { order: 1; }
}
@media (max-width: 639px) {
  .has-menu .nav-burger { display: inline-flex; }
  .has-menu .app-nav {
    order: 4; flex-basis: 100%; display: none;
    flex-direction: column; align-items: stretch; gap: 0.1rem;
    margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border);
  }
  .has-menu .nav-toggle:checked ~ .app-nav { display: flex; }
  .has-menu .app-nav .nav-link { padding: 0.6rem 0.25rem; border-bottom: 0; }
  .has-menu .app-nav .nav-link--active { color: var(--accent); font-weight: 600; }
  .has-menu .app-nav .tenant-switch,
  .has-menu .app-nav .masq-switch { width: 100%; margin: 0.35rem 0 0.15rem; }
  .has-menu .app-nav .tenant-switch select,
  .has-menu .app-nav .masq-switch select { flex: 1; max-width: none; width: auto; }
}

/* ---- Editierbare Bild-Kacheln (Editor: Löschen + Bildunterschrift) ---- */
.asset-edit { display: flex; flex-direction: column; }
.asset-edit img { height: 130px; }
.asset-doc-preview {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem;
  height: 130px; padding: 0.5rem; text-align: center; text-decoration: none; color: var(--text); background: #fcfdff;
}
.asset-doc-preview .glyph { font-size: 1.9rem; }
.asset-doc-preview .fn { font-size: 0.74rem; word-break: break-word; }
.asset-cap-row { display: flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.5rem; }
.asset-cap {
  flex: 1 1 auto; min-width: 0; font-size: 0.78rem; padding: 0.3rem 0.45rem;
  border: 1px solid #94a3b8; border-radius: 6px; background: #fff; color: var(--text);
}
.asset-cap:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37,99,235,.25); }
/* Feedback nach automatischem Speichern der Bildunterschrift */
.asset-cap.cap-saved { border-color: #86efac; background: #f0fdf4 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") right 0.4rem center/0.85rem no-repeat; transition: border-color 0.2s, background 0.2s; }
.asset-cap.cap-error { border-color: #fca5a5; background-color: #fef2f2; }
.asset-del {
  flex: 0 0 auto; width: 1.7rem; height: 1.7rem; border: 0; border-radius: 6px;
  background: #fef2f2; color: var(--danger); cursor: pointer; font-size: 0.8rem; line-height: 1;
}
.asset-del:hover { background: #fee2e2; }

/* ---- Artikel-Zeilen-Indikatoren (Bild-Zähler · Regie-Notiz · Freigabe-Status) ----
   Ruhiger Slate/Blau-Look: dezente Icon-Chips rechts neben dem Titel, ohne die
   Zeile zu überladen. An allen drei Stellen (Editionsbaum, Prüf-Queue, Autoren-
   Start) identisch aufgebaut über articleIndicators(). */
.art-meta {
  display: inline-flex; align-items: center; gap: 0.4rem;
  flex: 0 0 auto; vertical-align: baseline; margin-left: 0.4rem;
}
.art-badge {
  display: inline-flex; align-items: center; gap: 0.18rem;
  color: var(--muted); font-size: 0.72rem; font-weight: 500; line-height: 1;
}
.art-ico { display: block; opacity: 0.8; }
.art-count { color: #475569; font-variant-numeric: tabular-nums; }
/* Regie-Notiz: gedämpftes Amber — spiegelt die gelbe Notiz-Blase in InDesign/Leseansicht. */
.art-note { color: #b45309; }

/* In der flexbasierten Autoren-/Prüf-Zeile mittig statt an der Grundlinie sitzen. */
.rubric-row .art-meta, .review-main .art-meta { align-self: center; vertical-align: middle; }
/* Die Artikelzeile im Editionsbaum bündig halten (Titel · Meta · Indikatoren). */
.art-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.1rem; }
.art-row .art-meta { align-self: center; }
