/* PCS CRM – Oberfläche
   Ebenen (ab 0.351, Plan „Neue Oberfläche“): tokens < legacy < components. Eine spätere Ebene gewinnt immer,
   gleich wie genau ihre Selektoren sind; Farben aus Administration → Design und Stile auf einzelnen Seiten
   (<style> ohne Ebene) gewinnen über alle Ebenen. Neue Bausteine gehören nach components, Werte nach tokens.
   Beschreibung mit Beispielen: Entwicklerhandbuch → „Bausteine der Oberfläche“. */
@layer tokens, legacy, components;

/* ---------- Ebene tokens: Werte in drei Stufen ----------
   1. Grundwerte (--p-…): feste Farben, Abstände, Radien. Nur hier und in Stufe 2 verwenden.
   2. Bedeutung (--bg, --surface, --text, --muted, --line, --accent, --danger, --ok …): hell und dunkel über
      light-dark(); der Modus folgt color-scheme (Betriebssystem oder data-theme am <html>).
   3. Bauteil (--ui-…): Werte einzelner Bausteine, aus Stufe 2 abgeleitet. Stile ([data-style=…]) dürfen
      Stufe 2 und 3 überschreiben. */
@layer tokens {
:root {
  /* Stufe 1: Grundwerte */
  --p-white: #fff;
  --p-gray-50: #f6f7f9; --p-gray-150: #e3e6eb; --p-gray-500: #667085; --p-gray-900: #1d2330;
  --p-night-100: #e7e9ee; --p-night-400: #9aa3b2; --p-night-700: #2e3440; --p-night-850: #1d2129; --p-night-900: #14171c; --p-night-950: #0d0f13;
  --p-blue-600: #2563eb; --p-blue-400: #5b8cff;
  --p-red-600: #c0352b; --p-red-400: #ff6b5e;
  --p-green-700: #1f7a43; --p-green-500: #3fae6c; --p-green-950: #0b1a10;
  --p-amber-50: #fff4e5; --p-amber-900: #3a2c15;
  --p-space-1: .25rem; --p-space-2: .5rem; --p-space-3: .75rem; --p-space-4: 1rem; --p-space-5: 1.5rem; --p-space-6: 2rem;
  --p-radius-s: 6px; --p-radius-m: 8px; --p-radius-l: 12px; --p-radius-full: 999px;

  /* Stufe 2: Bedeutung (Namen wie bis 0.350, Werte unverändert) */
  --bg: light-dark(var(--p-gray-50), var(--p-night-900));
  --surface: light-dark(var(--p-white), var(--p-night-850));
  --text: light-dark(var(--p-gray-900), var(--p-night-100));
  --muted: light-dark(var(--p-gray-500), var(--p-night-400));
  --line: light-dark(var(--p-gray-150), var(--p-night-700));
  --accent: light-dark(var(--p-blue-600), var(--p-blue-400)); --accent-text: light-dark(var(--p-white), var(--p-night-900));
  --danger: light-dark(var(--p-red-600), var(--p-red-400)); --reject: var(--p-red-600);
  --warn-bg: light-dark(var(--p-amber-50), var(--p-amber-900));
  --ok: light-dark(var(--p-green-700), var(--p-green-500)); --ok-text: light-dark(var(--p-white), var(--p-green-950));
  /* Schrift auf kräftigen Farbflächen (Rot, Grün, Farben der Aktivitätsarten) */
  --on-color: var(--p-white);
  /* Weiß, das auch im dunklen Modus weiß bleibt: QR-Codes, Mail-Ansicht, Bilder mit Transparenz */
  --white: var(--p-white);
  /* Aufgaben in der Zeitleiste, KI-Vorschläge in Formularen */
  --task-line: light-dark(#f3d9b1, #6b5226); --overdue-bg: light-dark(#fdecea, #3b1d1a); --overdue-line: light-dark(#e8a29c, #7a3a33);
  --ai-bg: light-dark(#fff8db, #3a3315); --ai-line: light-dark(#e7c96a, #8a7224);
  /* Farben reihum für Firmen und Gruppen (Kachel, Punkt, Balken) */
  --hue-1: light-dark(#4f6bed, #7b93ff); --hue-2: light-dark(#0f9d8a, #2cc2ab); --hue-3: light-dark(#8b5cf6, #a98bff);
  --hue-4: light-dark(#e8772e, #ff9a55); --hue-5: light-dark(#d14d72, #f07a9b); --hue-6: light-dark(#5b8c2a, #8cc152);
  --radius: var(--p-radius-m);
  font-family: var(--font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);

  /* Stufe 3: Bauteile */
  --ui-gap: var(--p-space-4);
  --ui-card-bg: var(--surface); --ui-card-line: var(--card-line, var(--line)); --ui-card-shadow: var(--card-shadow, none);
  --ui-card-radius: var(--radius); --ui-card-pad: var(--p-space-4);
  --ui-chip-bg: color-mix(in srgb, var(--muted) 12%, transparent); --ui-chip-on-bg: color-mix(in srgb, var(--accent) 14%, transparent);
  --ui-chip-on-text: var(--accent); --ui-chip-radius: var(--p-radius-full);
  --ui-target: 24px;
  --ui-focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
  /* Gerüst „Arbeitsfläche“: Leiste mit den Bereichen, Kontextleiste daneben */
  --ui-rail-w: 56px; --ui-ctx-w: 220px; --ui-preview-w: 340px;
  --ui-rail-bg: light-dark(var(--p-gray-900), var(--p-night-950)); --ui-rail-text: var(--p-night-400);
  --ui-rail-on-bg: rgba(255,255,255,.12); --ui-rail-on-text: var(--p-white); --ui-rail-line: light-dark(transparent, var(--p-night-700));
}
/* Dunkler Modus: wie im Betriebssystem, oder fest über die Darstellung des Benutzers (data-theme am <html>) */
:root { color-scheme: light dark; }
:root[data-theme=light] { color-scheme: light; }
:root[data-theme=dark] { color-scheme: dark; }
} /* Ende @layer tokens */

/* ---------- Ebene legacy: Regeln bis 0.350 (Seiten, Bereiche, Stile) ---------- */
@layer legacy {
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: .9375rem; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }
.topbar { display: flex; gap: 1.25rem; align-items: center; padding: .75rem 1.5rem;
          background: var(--header-bg, var(--surface)); color: var(--header-text, var(--text));
          border-bottom: 1px solid var(--line);
          /* eigene Ebene über der mitlaufenden Suchleiste der Listen, damit das Benutzermenü davor liegt */
          position: relative; z-index: 40; }
.topbar a, .topbar button.link { color: var(--header-link, var(--accent)); }
.topbar .brand { font-weight: 700; font-size: 1.1rem; color: var(--header-text, var(--text));
                 display: flex; align-items: center; gap: .6rem; }
.brand .logo { height: 32px; max-width: 200px; object-fit: contain; display: block; }
/* Auf der Anmeldeseite steht das Logo auf der Kopfzeilenfarbe, damit helle Logos lesbar bleiben. */
.auth .brand { justify-content: center; background: var(--header-bg, transparent); color: var(--header-text, var(--text));
               padding: .75rem 1rem; border-radius: var(--radius); }
.auth .brand .logo { height: 56px; max-width: 260px; }
.topbar nav { display: flex; gap: .4rem 1rem; flex-wrap: wrap; }
.usermenu summary { white-space: nowrap; }
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
/* Persönliche Einstellung „Seitenbreite: Volle Bildschirmbreite“ */
.container.wide { max-width: none; padding-left: 2rem; padding-right: 2rem; }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
/* Knöpfe ohne eigene Gruppe stehen zusammen rechts statt über die Breite verteilt */
.pagehead > h1:first-child { margin-right: auto; }
.sub { color: var(--muted); margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; margin: 1rem 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin: 1rem 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem;
        display: flex; flex-direction: column; color: var(--text); }
.stat strong { font-size: 1.5rem; }
.stat span { color: var(--muted); }
.badge { display: inline-block; padding: 0 .5rem; border-radius: 999px; background: var(--bg);
         border: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
input, select, textarea, button, .button { font: inherit; }
input, select, textarea { width: 100%; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 6px;
                          background: var(--surface); color: var(--text); }
input[type=search] { margin: 1rem 0; }
/* Knöpfe (0.182): zwei Größen für alle Stile, normal 32 px und klein (.small) 26 px hoch */
button, .button { display: inline-block; padding: .3rem .8rem; border-radius: 6px; border: 1px solid var(--accent);
                  background: var(--accent); color: var(--accent-text); cursor: pointer; }
:where(button, .button):not(.link, .linklike, .tab-btn, .nav-btn, .nav-sec, .icon-btn, .ic-btn, .tb-btn, .swatch, .chip, .seg, .qc-person-btn, .stamp-btn) { font-size: .875rem; }
.button.secondary { background: transparent; color: var(--accent); }
/* KI-Knopf ausgegraut, solange die KI nicht nutzbar ist; der Grund steht im title */
.button.disabled, .link-disabled { opacity: .5; cursor: not-allowed; }
.link-disabled { color: var(--muted); }
button.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
button.link { background: none; border: none; color: var(--accent); padding: 0; font-size: inherit; }
/* Varianten: ok (grün, Bestätigen/Freigeben/Erledigt), reject (rot, Ablehnen), ghost (dezent, Nebenaktionen) */
button.ok, .button.ok { background: var(--ok); border-color: var(--ok); color: var(--ok-text); }
button.reject, .button.reject { background: var(--reject); border-color: var(--reject); color: var(--on-color); }
button.ghost, .button.ghost { background: transparent; border-color: var(--line); color: var(--text); }
button.ghost:hover, .button.ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
button.ok:hover, button.reject:hover, .button.ok:hover, .button.reject:hover { filter: brightness(1.08); text-decoration: none; }
/* Aktionen wie Löschen, Entfernen, Verwerfen: kleiner Knopf mit rotem Rahmen statt Textlink */
button.danger-link { display: inline-block; background: transparent; border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent);
                     color: var(--danger); padding: .15rem .55rem; font-size: .8125rem; line-height: 1.45; border-radius: var(--r-btn, 6px); }
button.danger-link:hover { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }
form.inline { display: inline; }
.form .fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem 1rem; margin-bottom: .75rem; }
.form label { display: flex; flex-direction: column; gap: .25rem; color: var(--muted); font-size: .9rem; }
.actions { display: flex; gap: .75rem; align-items: center; margin-top: .75rem; }
table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.list th, table.list td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid var(--line); }
table.list th { color: var(--muted); font-weight: 600; font-size: .85rem; }
dl { display: grid; grid-template-columns: 9rem 1fr; gap: .35rem 1rem; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; }
.notes { white-space: pre-wrap; border-top: 1px solid var(--line); padding-top: .75rem; }
ul.plain { list-style: none; padding: 0; margin: 0 0 1rem; }
ul.plain li { padding: .3rem 0; border-bottom: 1px solid var(--line); }
/* Knöpfe hinter einem Namen (Mitglieder, Anträge) mit Abstand statt direkt am Text */
ul.plain li > form.inline { margin-left: .5rem; }
ul.plain li > form.inline + form.inline { margin-left: .3rem; }
table.list .badge { white-space: nowrap; }
/* Bestätigungsseite: Hinweis unter den Knöpfen mit Abstand */
.confirm-card form > .sub { margin-top: 1rem; }
.timeline { list-style: none; padding: 0; margin: 1rem 0; }
.activity { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .9rem; margin-bottom: .5rem; }
.activity .meta { color: var(--muted); font-size: .85rem; display: flex; gap: .4rem; align-items: center; white-space: nowrap; overflow: hidden; }
.activity .act-who { overflow: hidden; text-overflow: ellipsis; min-width: 4rem; }
.activity .act-who .sep { font-style: normal; margin: 0 .3rem; }
.activity .act-who > .sep:first-child { display: none; }
.activity .act-who:not(:empty)::before { content: "·"; margin-right: .4rem; }
.activity .act-due { margin-left: auto; flex-shrink: 0; }
.activity .act-due.late { color: var(--danger); font-weight: 600; }
.activity .subject { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: .1rem; }
.activity .act-teaser, .act .act-teaser { font-size: .9rem; }
.activity .act-foot { display: flex; gap: .9rem; align-items: baseline; justify-content: flex-end; margin-top: .25rem; font-size: .85rem; }
.activity .act-foot .more-btn { margin-right: auto; }
.activity .act-foot .link, .activity .act-foot button.link { font-size: .85rem; padding: 0; }
.activity.done .subject { text-decoration: line-through; color: var(--muted); }
.activity.overdue { background: var(--warn-bg); }
@media (max-width: 600px) {
  /* Handy: Uhrzeit weg; bei Aufgaben zählt die Fälligkeit, nicht das Anlagedatum */
  .activity .act-time { display: none; }
  .activity.task:has(.act-due) .act-when { display: none; }
  .activity.task:has(.act-due) .act-who::before { content: none; }
}
.activity-form .row { display: grid; grid-template-columns: 9rem 1fr 14rem; gap: .5rem; margin-bottom: .5rem; }
.activity-form textarea { margin-bottom: .5rem; }
.empty { color: var(--muted); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: .75rem; overflow-x: auto; }
.column h2 { font-size: 1rem; }
.card.deal { display: flex; flex-direction: column; gap: .15rem; margin-bottom: .5rem; color: var(--text); padding: .6rem .8rem; }
/* Kandidaten-Board am Projekt (Reiter „Kandidaten“) */
.pc-board .column { background: var(--bg); border-radius: var(--radius); padding: .5rem; min-height: 6rem; }
.pc-board .column h3 { font-size: .95rem; margin: .1rem 0 .5rem; display: flex; align-items: center; gap: .35rem; }
.pc-board .column.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.pc-card[draggable=true] { cursor: grab; }
.pc-card.dragging { opacity: .5; }
.pc-card a { color: inherit; text-decoration: none; }
.pc-more summary { font-size: .8rem; color: var(--muted); cursor: pointer; margin-top: .2rem; }
.pc-more form { margin-top: .4rem; }
.pc-more label { font-size: .8rem; }
/* Aufgaben-Board über alle Projekte (/tasks/board, 0.290.4) */
.task-board { grid-auto-columns: minmax(220px, 1fr); }
.task-board .column.no-drop { opacity: .55; }
.tb-card[draggable=true] { cursor: grab; }
.tb-card.dragging { opacity: .5; }
.tb-card a { color: inherit; text-decoration: none; }
.tb-card a.sub:hover { text-decoration: underline; }
.tb-meta { display: flex; flex-wrap: wrap; gap: .2rem .6rem; font-size: .8rem; color: var(--muted); }
.tb-card.overdue .tb-due { color: var(--danger); font-weight: 600; }
.tb-move { display: flex; flex-wrap: wrap; gap: .3rem; }
.tb-move + .tb-move { margin-top: .3rem; }
.tb-bar { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; }
.tb-manual { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; margin-left: auto; }
.task-board-filter select { max-width: 14rem; }
/* Meine Woche (/tasks/week, 0.290.5) */
.wk-settings { margin: .4rem 0 .8rem; }
.wk-settings summary { cursor: pointer; color: var(--muted); }
.wk-cal-form { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; margin-top: .4rem; }
.wk-cal-form input[type=number] { width: 5.5rem; }
.week-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.week-layout { display: grid; grid-template-columns: 230px 1fr; gap: .75rem; align-items: start; }
.week-days { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: .75rem; overflow-x: auto; align-items: start; }
.week-days > .card.week-day, .week-layout > .card.week-backlog { margin: 0; }
.week-day h3 { font-size: .95rem; margin: 0 0 .4rem; }
.week-day.today { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.week-day h4, .week-backlog h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin: .6rem 0 .25rem; }
.week-backlog h2 { margin-top: 0; }
[data-week-drop].drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.wk-task { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .4rem; padding: .35rem .5rem; margin-bottom: .3rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: .9rem; }
.wk-task[draggable=true] { cursor: grab; }
.wk-task.dragging { opacity: .5; }
.wk-task > a { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; hyphens: auto; color: inherit; text-decoration: none; }
.wk-task > .sub { flex-basis: 100%; font-size: .78rem; }
.wk-task.done > a { color: var(--muted); text-decoration: line-through; }
.wk-task.overdue { border-color: var(--danger); }
.wk-plan { display: flex; gap: .3rem; flex-basis: 100%; }
.wk-plan input[type=date] { flex: 1 1 0; min-width: 0; font-size: .8rem; padding: .15rem .3rem; }
.wk-unplan { margin: 0; }
.wk-item { margin: .15rem 0; font-size: .88rem; }
.wk-item.overdue a { color: var(--danger); font-weight: 600; }
.wk-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .8rem; }
@media (max-width: 900px) { .week-layout { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .activity-form .row { grid-template-columns: 1fr; }
  .board { grid-auto-columns: 220px; }
  dl { grid-template-columns: 1fr; }
}
.card > h2:first-child, .card > .pagehead:first-child h2 { margin-top: 0; }
.usermenu { margin-left: auto; position: relative; }
.usermenu summary { list-style: none; cursor: pointer; color: var(--header-link, var(--accent)); display: flex; align-items: center; gap: .35rem; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary::after { content: ""; border: 5px solid transparent; border-top-color: currentColor; margin-top: 5px; }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + .6rem); z-index: 20; width: 280px; background: var(--surface);
                  color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem;
                  box-shadow: 0 8px 24px rgba(0,0,0,.12); display: flex; flex-direction: column; gap: .6rem; }
.usermenu .menu a, .usermenu .menu button.link { color: var(--accent); }
.usermenu .who { margin: 0; font-weight: 600; display: flex; flex-direction: column; }
.usermenu .who .sub { font-weight: 400; font-size: .85rem; }
.usermenu .version { font-size: .8rem; }
.usermenu .form label { display: flex; flex-direction: column; gap: .25rem; color: var(--muted); font-size: .85rem; margin-bottom: .4rem; }
.usermenu form { margin: 0; }
.usermenu .menu > a, .usermenu .menu > form:last-child { border-top: 1px solid var(--line); padding-top: .6rem; }
.auth { max-width: 400px; margin: 10vh auto; padding: 0 16px; }
.auth .brand { font-weight: 700; font-size: 1.3rem; text-align: center; display: flex; align-items: center; gap: .6rem; }
.auth .form label, .form.narrow label { margin-bottom: .75rem; }
.form.narrow { max-width: 480px; }
.alert { background: var(--warn-bg); border: 1px solid var(--danger); color: var(--text); padding: .5rem .75rem; border-radius: 6px; }
.success { border: 1px solid var(--line); background: var(--bg); padding: .5rem .75rem; border-radius: 6px; }
/* Gelber Hinweis auf einen Vorschlag (z. B. Gewerk zur Eingangsrechnung) */
.hint { background: var(--warn-bg); border: 1px solid var(--ds-amber); color: var(--text); padding: .5rem .75rem; border-radius: 6px; margin-bottom: .75rem; }
.hint ul { margin: .25rem 0 0; padding-left: 1.25rem; }
.checks { display: flex; gap: 1.5rem; margin: .5rem 0 1rem; }
.checks label { flex-direction: row; align-items: center; gap: .4rem; color: var(--text); }
.checks input { width: auto; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: .75rem 0 1rem; flex-wrap: wrap; }
.tabs a { padding: .5rem .9rem; border-bottom: 2px solid transparent; color: var(--muted); }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.badge.ok { border-color: var(--accent); color: var(--accent); }
.inline-form { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { flex: 1 1 220px; display: flex; flex-direction: column; gap: .25rem; color: var(--muted); font-size: .9rem; }
/* Feld mit Einheit (%, €, h) in einer Zeile neben dem Feld (Bug 19, 0.300.1) */
.input-unit { display: inline-flex; align-items: center; gap: .35rem; }
.inline-form label:has(.input-unit) { flex: 0 0 auto; }
/* Checkbox in einer Zeile auf Höhe der Eingabefelder (Bug 19, 0.300.1) */
.inline-form label.check { flex: 0 0 auto; flex-direction: row; align-items: center; min-height: 2.1rem; }
.card + .card, .card + form, form + .card { margin-top: 1rem; }
.modules td { vertical-align: middle; }
.modules .switch { display: flex; align-items: center; gap: .4rem; }
.modules .switch input, .checks input { width: auto; }
.planned { opacity: .65; }
.mfa-setup ol { padding-left: 1.25rem; }
.mfa-setup li { margin-bottom: 1rem; }
.qr { background: var(--white); display: inline-block; padding: 8px; border-radius: 6px; margin: .5rem 0; }
.codes { columns: 2; list-style: none; padding: 0; font-size: 1.1rem; }
.codes li { padding: .25rem 0; }
.langs { text-align: center; display: flex; gap: 1rem; justify-content: center; }
.langs a.active { font-weight: 600; color: var(--text); }
button.secondary { background: transparent; color: var(--accent); }
.modules .switch { white-space: nowrap; flex-direction: row; color: var(--text); }
.mfa-setup .qr { display: block; width: fit-content; }
.mfa-setup .inline-form label { max-width: 240px; }
.design-logo .logo-row { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.logo-preview { min-width: 200px; min-height: 80px; padding: 1rem; border: 1px dashed var(--line); border-radius: var(--radius);
                display: flex; align-items: center; justify-content: center; background: var(--header-bg, var(--surface)); }
.logo-preview img { max-height: 64px; max-width: 240px; }
.colors input[type=color] { width: 100%; height: 2.4rem; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.design-logo form.inline { display: inline-block; margin-top: .5rem; }
.form label.switch { flex-direction: row; align-items: center; gap: .5rem; color: var(--text); margin: .25rem 0 .5rem; }
.form label.switch { justify-content: flex-start; } .form label.switch input { width: auto; flex: none; margin: 0; }
.rights td:not(:first-child), .rights th:not(:first-child) { text-align: center; }
fieldset.groups { border: 1px solid var(--line); border-radius: var(--radius); margin: .75rem 0; padding: .5rem 1rem .75rem; }
fieldset.groups legend { color: var(--muted); font-size: .9rem; padding: 0 .3rem; }
/* Dashboards: Raster mit vier Spalten, Kacheln 1, 2 oder 4 Spalten breit */
.dash { margin: .5rem 0 1.5rem; }
.dash-bar { display: flex; justify-content: flex-end; margin-bottom: .25rem; }
.dash-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; min-width: 0; }
.widget.size-s { grid-column: span 1; }
.widget.size-m { grid-column: span 2; }
.widget.size-l { grid-column: 1 / -1; }
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .widget.size-m { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .widget.size-s { grid-column: 1 / -1; }
}
.widget header { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.widget h2 { margin: 0 0 .5rem; font-size: 1rem; }
.widget.size-s h2 { font-size: .85rem; color: var(--muted); font-weight: 600; }
.widget-body { max-height: 28rem; overflow: auto; }
.widget .timeline { margin: 0; }
.widget .activity { margin-bottom: .4rem; }
.widget-tools, .dash-editor, .dash.editing [data-dash=edit] { display: none; }
.dash.editing .widget-tools { display: flex; gap: .25rem; align-items: center; flex-shrink: 0; }
.dash.editing .dash-editor { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-top: 1rem; }
.dash-editor label { display: flex; flex-direction: column; gap: .25rem; color: var(--muted); font-size: .9rem; min-width: 14rem; }
.dash-editor .grow { flex: 1; }
.dash-editor .hint { flex-basis: 100%; }
.dash.editing .widget { cursor: grab; outline: 2px dashed var(--line); outline-offset: 2px; }
.widget.dragging { opacity: .4; }
.widget-tools button { background: none; border: 1px solid var(--line); color: var(--text); padding: 0 .4rem; line-height: 1.6; }
.widget-tools select { width: auto; padding: .1rem .3rem; font-size: .85rem; }
.kpi { display: flex; flex-direction: column; color: var(--text); }
.kpi:hover { text-decoration: none; }
.kpi strong { font-size: 1.6rem; }
.kpi span { color: var(--muted); font-size: .85rem; }
.bars, .rows { list-style: none; padding: 0; margin: 0; }
.bars a { display: grid; grid-template-columns: minmax(6rem, 9rem) 1fr auto; gap: .6rem; align-items: center; color: var(--text); padding: .25rem 0; }
.bar-track { background: var(--bg); border-radius: 4px; height: .75rem; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 4px; min-width: 2px; }
.bar-num { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.rows li { display: flex; justify-content: space-between; gap: .75rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows .detail { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.rows li.highlight .detail { color: var(--danger); font-weight: 600; }
.bars .empty, .rows .empty { color: var(--muted); }
p.filter { margin: 0 0 .75rem; }

/* Eigene Felder im Formular und auf der Detailseite */
.cf-section { border: 1px solid var(--line); border-radius: var(--radius); margin: .75rem 0; padding: .5rem 1rem .75rem; }
.cf-section legend { color: var(--muted); font-size: .9rem; padding: 0 .3rem; }
.cf-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .75rem 1rem; }
.cf-grid .cf, .cf-grid .fe-field { grid-column: span 3; display: flex; flex-direction: column; gap: .25rem; }
.cf-grid.cols-1 .cf, .cf-grid.cols-1 .fe-field, .cf-grid .w-full { grid-column: 1 / -1; }
.cf-grid.cols-3 .w-third { grid-column: span 2; }
.cf-grid.cols-3 .w-half, .cf-grid.cols-2 .w-third { grid-column: span 3; }
.cf-deco h3 { margin: .5rem 0 0; }
.cf-deco hr { border: 0; border-top: 1px solid var(--line); width: 100%; }
.cf-note { margin: 0; color: var(--muted); }
.cf-label { color: var(--muted); font-size: .9rem; }
.cf-checks { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.cf-checks label, label.check { flex-direction: row; align-items: center; gap: .4rem; color: var(--text); }
label.check input { width: auto; }
.cf-social { display: grid; grid-template-columns: 9rem 1fr; gap: .5rem; }
.cf-unit { display: flex; align-items: center; gap: .4rem; }
.cf-unit input { flex: 1; }
.cf-full { grid-column: 1 / -1; }
.cf-show h3 { margin: .25rem 0; font-size: 1rem; }
.notes-inline { white-space: pre-wrap; }
dt[data-field] { cursor: pointer; }
dt[data-field]:hover { text-decoration: underline dotted; }
fieldset.privacy { border: 1px solid var(--line); border-radius: var(--radius); margin: .75rem 0; padding: .5rem 1rem .75rem; display: flex; flex-direction: column; gap: .4rem; }
fieldset.privacy legend { color: var(--muted); font-size: .9rem; padding: 0 .3rem; }
.lock { font-size: .9em; }
.checks.column { flex-direction: column; gap: .4rem; }
@media (max-width: 720px) {
  .cf-grid .cf, .cf-grid .fe-field { grid-column: 1 / -1 !important; }
  .cf-social { grid-template-columns: 1fr; }
}

/* Verlauf */
.history-filter { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: .75rem; }
.history-filter label { min-width: 12rem; }
table.history .old { color: var(--muted); text-decoration: line-through; }
table.history td { vertical-align: top; }

/* Formular-Editor */
.subtabs { margin-top: -.5rem; }
.fe { display: grid; grid-template-columns: 13rem 1fr 22rem; gap: 1rem; align-items: start; margin: 1rem 0; }
.fe-palette ul { display: flex; flex-direction: column; gap: .25rem; }
.fe-type { display: block; padding: .3rem .5rem; border: 1px dashed var(--line); border-radius: var(--radius); cursor: grab; text-decoration: none; }
.fe-section { margin-bottom: 1rem; }
.fe-section-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.fe-section-form { display: flex; flex-wrap: wrap; gap: .4rem; flex: 1; }
.fe-section-form input { flex: 1; min-width: 8rem; }
.fe-section-form select { width: auto; }
.fe-field { border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .6rem; background: var(--bg, transparent); cursor: grab; flex-direction: row !important; justify-content: space-between; align-items: flex-start; }
.fe-field a { text-decoration: none; display: flex; flex-direction: column; color: inherit; }
.fe-field.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.fe-field.dragging { opacity: .5; }
.fe-move { display: inline-flex; gap: .2rem; }
.fe-drop { grid-column: 1 / -1; border: 1px dashed var(--line); border-radius: var(--radius); padding: .4rem; text-align: center; color: var(--muted); text-decoration: none; }
.fe-props-form h4 { margin: 1rem 0 .25rem; }
.fe-props { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
button.small, .button.small { padding: .15rem .55rem; font-size: .8125rem; }
button.linklike { background: none; border: 0; color: var(--accent); padding: 0; cursor: pointer; text-decoration: underline; }
.social-net .pagehead { margin-bottom: .5rem; }
@media (max-width: 1100px) { .fe { grid-template-columns: 1fr; } .fe-props { position: static; max-height: none; } }

/* Formatierte Felder (rich.js) */
.rich { white-space: normal; overflow-wrap: anywhere; }
.rich img, .rich-area img { max-width: 100%; height: auto; border-radius: 4px; }
.rich p, .rich div { margin: 0 0 .4rem; }
.rich blockquote { margin: .5rem 0; padding-left: .75rem; border-left: 3px solid var(--line); color: var(--muted); }
.rich ul, .rich ol, .rich-area ul, .rich-area ol { margin: .25rem 0 .5rem; padding-left: 1.4rem; }
.rich-label { display: flex; flex-direction: column; gap: .25rem; }
.rich-editor { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rich-editor:focus-within { border-color: var(--accent); }
.rich-toolbar { display: flex; gap: .15rem; flex-wrap: wrap; padding: .25rem; border-bottom: 1px solid var(--line); }
.rich-btn { min-width: 2rem; padding: .2rem .45rem; background: transparent; color: var(--text); border: 1px solid transparent;
            border-radius: 4px; cursor: pointer; font: inherit; }
.rich-btn:hover { border-color: var(--line); background: var(--bg); }
.rich-area { min-height: 5.5rem; max-height: 32rem; overflow: auto; padding: .5rem .65rem; outline: none; }
.rich-area.rich-invalid { box-shadow: inset 0 0 0 2px var(--danger, #c0392b); }
.rich-note .rich-area { min-height: 11rem; max-height: 70vh; resize: vertical; }
.rich-expand { margin-left: auto; width: auto; color: var(--accent); border-color: var(--accent); }
.rich-full { position: fixed; inset: 4vh 4vw; z-index: 1000; display: flex; flex-direction: column; padding: .75rem;
  background: var(--surface); box-shadow: 0 12px 48px rgba(0, 0, 0, .45); }
.rich-full .rich-area { flex: 1; max-height: none; height: auto !important; resize: none; }
.rich-full-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.rich-full-head[hidden] { display: none; }
.rich-backdrop { position: fixed; inset: 0; z-index: 999; background: rgba(0, 0, 0, .45); }
.rich-area:empty::before { content: attr(data-placeholder); color: var(--muted); }
.rich-area.busy, .photo-field.busy { opacity: .6; cursor: progress; }
.rich-editor.readonly { background: var(--bg); }
/* Mail-Editor und Signaturen (0.70) */
.rich-sep { width: 1px; align-self: stretch; background: var(--line); margin: .15rem .3rem; }
.rich-format { width: auto; padding: .15rem .35rem; font-size: .88rem; margin-right: .2rem; }
.rich-color { border-bottom: 3px solid #e8590c; padding: 0 .1rem; }
.rich-mark { background: #ffe066; color: #222; padding: 0 .2rem; border-radius: 2px; }
.rich-area h1, .rich-area h2, .rich-area h3, .rich h1, .rich h2, .rich h3 { margin: .4rem 0 .3rem; line-height: 1.25; }
.rich-area blockquote, .rich blockquote { border-left: 3px solid var(--accent); margin: .4rem 0; padding: .1rem .8rem; color: var(--muted); }
.rich-area .mail-sig { margin-top: .4rem; padding-top: .5rem; border-top: 1px dashed var(--line); }
.send-mail .rich-area { min-height: 260px; }
.sig-pick { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sig-pick select { width: auto; }
.sig-chips { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: .4rem 0 .8rem; }
.sig-chips .chip { border: 1px solid var(--line); border-radius: 999px; padding: .1rem .6rem; font-size: .82rem; background: var(--surface); color: var(--text); cursor: pointer; }
.sig-chips .chip:hover { border-color: var(--accent); }
.sig-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .sig-grid { grid-template-columns: 1fr; } }
.sig-preview { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; background: var(--bg); overflow: auto; }
.sig-preview img { max-width: 100%; height: auto; }
.sig-preview.small { font-size: .85rem; padding: .4rem .6rem; max-height: 9rem; }
.sig-values { grid-template-columns: 7rem 1fr; font-size: .9rem; }
.sig-list td { vertical-align: middle; }

/* Kontaktfoto */
.avatar { border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center;
          background: var(--bg); border: 1px solid var(--line); color: var(--muted); flex: none; }
.avatar.large { width: 96px; height: 96px; font-size: 2.5rem; }
.avatar.small { width: 28px; height: 28px; font-size: .9rem; vertical-align: middle; margin-right: .45rem; }
.avatar[hidden] { display: none; }
.photo-field { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.photo-field label.button { cursor: pointer; }
.pagehead .grow { flex: 1; }

/* Suche und Aktivitäten */
.globalsearch { margin-left: auto; }
.globalsearch input { width: 14rem; max-width: 40vw; }
.search-page { margin-bottom: 1rem; }
.search-row { display: flex; gap: .5rem; }
.search-row input { flex: 1; }
.search-group .hits { list-style: none; padding: 0; margin: 0 0 .5rem; }
.search-group .hits li { padding: .3rem 0; border-bottom: 1px solid var(--line); }
.search-group .count { color: var(--muted); font-weight: normal; font-size: .9rem; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters input[type=search] { flex: 1; min-width: 12rem; }
.edited { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.edited:hover { color: var(--accent); }
table.activities tr.done td { color: var(--muted); }
h2.small { font-size: 1rem; }
@media (max-width: 720px) { .globalsearch { margin-left: 0; width: 100%; } .globalsearch input { width: 100%; max-width: none; } }
.globalsearch + .usermenu { margin-left: 0; }
/* Kopfzeile: aktueller Menüpunkt; auf schmalen Bildschirmen Menü als Schublade (☰), auf dem Handy Suche hinter der Lupe */
.topbar nav a.on { font-weight: 600; }
.nav-btn, .nav-shade, .nav-head, .nav-extra { display: none; }
@media (max-width: 1000px) {
  .topbar { gap: .6rem; }
  .topbar .brand { margin-right: auto; min-width: 0; }
  .nav-btn svg { width: 20px; height: 20px; }
  .nav-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; flex: 0 0 auto;
             background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--header-link, var(--accent)); font-size: 1.25rem; line-height: 1; }
  .nav-search { display: none; }
  .nav-menu { order: 3; }
  .globalsearch { margin-left: 0; }
  .tb-tools { margin-left: 0; order: 2; }
  .um-name { display: none; }
  .usermenu summary { width: 38px; height: 38px; justify-content: center; }
  .usermenu summary::after { display: none; }
  #mainnav { position: fixed; top: 0; right: 0; bottom: 0; width: min(84vw, 320px); z-index: 60; display: flex; flex-direction: column;
             flex-wrap: nowrap; gap: 0; padding: .75rem .9rem 1.5rem; overflow-y: auto; background: var(--surface); color: var(--text);
             box-shadow: -8px 0 24px rgba(0,0,0,.18); transform: translateX(105%); transition: transform .2s ease; visibility: hidden; }
  .topbar.nav-open #mainnav { transform: none; visibility: visible; }
  .topbar #mainnav a { padding: .65rem .7rem; border-radius: 8px; color: var(--text); font-size: 1.05rem; }
  .topbar #mainnav a:hover { background: var(--bg); text-decoration: none; }
  .topbar #mainnav a.on { background: var(--bg); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
  .nav-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .1rem .2rem .7rem .7rem;
              margin-bottom: .4rem; border-bottom: 1px solid var(--line); }
  .nav-head .nav-btn { color: var(--text); }
  .nav-extra { display: block; }
  .nav-extra.sep { border-top: 1px solid var(--line); margin-top: .4rem; }
  .nav-shade { position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.4); }
  .topbar.nav-open .nav-shade { display: block; }
}
@media (max-width: 720px) {
  .topbar { padding: .5rem .75rem; flex-wrap: wrap; }
  .brand .logo { height: 28px; max-width: 150px; }
  .nav-search { display: inline-flex; order: 1; }
  .globalsearch { display: none; order: 4; flex: 1 1 100%; }
  .topbar.search-open .globalsearch { display: block; }
  .globalsearch input { margin: .15rem 0 .1rem; }
}
.filters select, .filters input[type=search] { width: auto; margin: 0; }
.filters select { flex: 0 1 auto; }
.photo-field label.button { display: inline-block; width: auto; margin: 0 0 .25rem; }

/* Kategorien */
.cat-chip { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .78rem; line-height: 1.4;
            font-weight: 600; margin: 0 .2rem .15rem 0; white-space: nowrap; vertical-align: middle; }
h1 + .cats, .cats { margin: -.25rem 0 .75rem; }
.cat-filter { display: flex; flex-wrap: wrap; gap: .25rem; margin: .5rem 0 0; }
.cat-option { display: inline-flex; align-items: center; gap: .2rem; cursor: pointer; border-radius: 999px;
              padding: .1rem .25rem; border: 1px solid transparent; opacity: .55; }
.cat-option input { width: auto; margin: 0; }
.cat-option.on, .cat-option:has(input:checked) { opacity: 1; border-color: var(--line); }
.cat-option .cat-chip { margin: 0; }
.cat-select { border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .75rem; margin: .75rem 0;
              display: flex; flex-wrap: wrap; gap: .3rem; }
.cat-select legend { color: var(--muted); font-size: .9rem; padding: 0 .25rem; }
.cat-select .cat-option { opacity: .6; }
.cat-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.cat-row input[name=name] { flex: 1 1 14rem; width: auto; }
.cat-row input[type=color] { width: 3rem; height: 2.1rem; padding: .1rem; flex: 0 0 auto; }
.cat-row input[type=file] { flex: 1 1 14rem; width: auto; }
.cat-row button, .cat-row .button { width: auto; }
/* .list-filter: siehe „Listen“ unten */
.export, .more { color: var(--muted); font-size: .9rem; margin: .5rem 0 0; }
.form label.cat-option { flex-direction: row; color: inherit; font-size: inherit; gap: .2rem; }

/* Reiter mit zuletzt geöffneten Datensätzen */
.tabbar { display: flex; gap: .3rem; align-items: center; padding: .35rem 0 0 1.5rem; overflow-x: auto;
          background: var(--surface); border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.tabbar[hidden] { display: none; }
.tabbar .tab { display: flex; align-items: center; flex: 0 0 auto; max-width: 15rem; border: 1px solid var(--line);
               border-bottom: none; border-radius: 6px 6px 0 0; background: var(--bg); font-size: .85rem; }
.tabbar .tab.current { background: var(--surface); border-color: var(--accent); box-shadow: inset 0 2px 0 var(--accent); }
.tabbar .tab a { display: flex; align-items: center; gap: .35rem; padding: .3rem .2rem .3rem .55rem; min-width: 0;
                 color: var(--text); text-decoration: none; }
.tabbar .tab.current a { font-weight: 600; }
.tabbar .tab-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar .tab-icon { display: inline-flex; color: var(--muted); }
.tabbar .tab-icon .ic { display: block; width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.tabbar .avatar.tiny { width: 18px; height: 18px; flex: 0 0 auto; }
.tabbar form { display: contents; }
.tabbar .tab-btn { background: none; border: none; padding: .25rem .3rem; color: var(--muted); cursor: pointer;
                   line-height: 1; font-size: .85rem; width: auto; }
.tabbar .tab-btn:hover { color: var(--text); }
.tabbar .tab-btn.pin { filter: grayscale(1); opacity: .35; font-size: .7rem; }
.tabbar .tab-btn.pin:hover, .tabbar .tab.pinned .tab-btn.pin { filter: none; opacity: 1; }
.tabbar .tab.pinned { border-top: 2px solid var(--accent); }
.tabbar .tab-all { display: block; margin-left: auto; flex: 0 0 auto; padding: .2rem 1.5rem .2rem .75rem;
                   position: sticky; right: 0; background: linear-gradient(to right, transparent, var(--surface) .6rem); }
.tabbar .tab-all button { font-size: .8rem; white-space: nowrap; }
@media (max-width: 720px) { .tabbar { padding: .35rem 0 0 .75rem; } .tabbar .tab-all { padding-right: .75rem; } .tabbar .tab { max-width: 11rem; } }

/* Listen: Suche oben, zuklappbares Dashboard, Ergebnisse als Kachel */
.list-filter { position: sticky; top: 0; z-index: 20; background: var(--bg); margin: 0 -1.5rem .75rem; padding: .6rem 1.5rem;
               border-bottom: 1px solid var(--line); }
.list-filter .search-row { display: flex; gap: .5rem; align-items: center; }
.list-filter .search-row input[type=search] { margin: 0; }
.list-filter .cat-filter:empty { display: none; }
.icon { display: block; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; padding: 0;
            border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); cursor: pointer;
            text-decoration: none; flex: 0 0 auto; }
.icon-btn:hover { color: var(--text); border-color: var(--muted); text-decoration: none; }
.icon-btn.active { color: var(--accent); border-color: var(--accent); background: var(--bg); }
.view-switch, .export-icons { display: inline-flex; gap: .3rem; align-items: center; }
.more .export-icons { vertical-align: middle; margin-left: .3rem; }
.more .icon-btn { width: 1.9rem; height: 1.9rem; }
.dash-wrap { margin: 0 0 1rem; }
.dash-wrap > summary { cursor: pointer; padding: .45rem .75rem; border: 1px solid var(--line); border-radius: var(--radius);
                       background: var(--surface); color: var(--muted); font-size: .92rem; user-select: none; }
.dash-wrap > summary:hover { color: var(--text); }
.dash-wrap > summary .dash-label { font-weight: 600; color: var(--text); }
.dash-wrap[open] > summary { margin-bottom: .75rem; }
#list-count { font-variant-numeric: tabular-nums; }
.list-tile { padding-top: .6rem; }
.tile-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.tile-head h2 { margin: 0; font-size: 1rem; }
.tile-head .grow { flex: 1; }
.table-wrap { overflow-x: auto; }
.more-cell { text-align: center; padding: .75rem 0; }
.vcards .more-cell { grid-column: 1 / -1; }
.col-editor { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; margin-bottom: .75rem; background: var(--bg); }
.col-list { list-style: none; padding: 0; margin: .5rem 0; max-width: 28rem; }
.col-list li { display: flex; align-items: center; gap: .3rem; padding: .25rem .4rem; border: 1px solid var(--line);
               border-radius: 6px; background: var(--surface); margin-bottom: .25rem; cursor: grab; }
.col-list li.dragging { opacity: .5; }
.col-list label { display: flex; align-items: center; gap: .4rem; cursor: pointer; }
.col-list input[type=checkbox] { width: auto; margin: 0; }
.col-list .grow { flex: 1; }
.col-list .tab-btn { background: none; border: none; padding: .2rem .35rem; color: var(--muted); cursor: pointer; width: auto; font-size: .8rem; }
.col-list .tab-btn:hover { color: var(--text); }
.col-editor .actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.list-tile table.list th, .list-tile table.list td a[href^="tel:"] { white-space: nowrap; }
/* Lange Werte (E-Mail, Webseite) dürfen umbrechen, statt die Tabelle zu verbreitern */
.list-tile table.list td a[href^="http"] { overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .list-filter { padding-top: .5rem; padding-bottom: .5rem; }
  /* Auf dem Handy bleiben die Kategorien eine wischbare Zeile, damit die feste Suche wenig Platz braucht. */
  .list-filter .cat-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .list-filter .cat-option { flex: 0 0 auto; }
}

/* Kontakte: A–Z-Leiste und Visitenkarten */
.az { display: flex; flex-wrap: wrap; gap: .15rem; margin: 0 0 .75rem; font-size: .88rem; }
.az a, .az span { min-width: 1.7rem; text-align: center; padding: .15rem .3rem; border-radius: 5px; }
.az a:hover { background: var(--surface); text-decoration: none; }
.az a.active { background: var(--accent); color: var(--accent-text); }
.az .off { color: var(--muted); opacity: .4; }
.vcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: .75rem; }
.vcard { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .9rem; background: var(--surface);
         display: flex; flex-direction: column; gap: .2rem; min-width: 0; border-top: 3px solid var(--accent); }
.vcard-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .3rem; }
.vcard-head .avatar { width: 44px; height: 44px; font-size: 1.3rem; }
.vcard-name { font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.vline { display: flex; gap: .4rem; align-items: baseline; font-size: .9rem; min-width: 0; overflow-wrap: anywhere; }
.vicon { color: var(--muted); font-size: .85rem; width: 1rem; flex: 0 0 auto; }
.cat-dots { display: flex; gap: .3rem; margin-top: .35rem; flex-wrap: wrap; }
.cat-dot { position: relative; display: inline-block; width: .8rem; height: .8rem; border-radius: 50%;
           border: 1px solid rgba(0,0,0,.15); cursor: help; }
.cat-dot:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.cat-dot:focus::after { content: attr(data-name); position: absolute; left: 50%; bottom: 140%; transform: translateX(-50%);
                        background: var(--text); color: var(--surface); padding: .15rem .45rem; border-radius: 4px;
                        font-size: .75rem; white-space: nowrap; z-index: 5; }
.card-admin { display: grid; grid-template-columns: minmax(16rem, 26rem) 1fr; gap: 1rem; align-items: start; }
.card-admin .card + .card { margin-top: 0; }
.card-admin h2 { margin-top: 0; }
.pill { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line); border-radius: 999px;
  padding: 0 .5rem; margin: .1rem .25rem .1rem 0; font-size: .82rem; white-space: nowrap; color: var(--text);
  background: var(--surface); text-decoration: none; }
.pill:hover { border-color: var(--muted); }
.pill .dot { width: .5rem; height: .5rem; border-radius: 50%; flex: none; }
.vline.pills { display: flex; flex-wrap: wrap; }
@media (max-width: 720px) { .vcards { grid-template-columns: 1fr; } .card-admin { grid-template-columns: 1fr; } }

/* Aktivitätsarten: Icon als farbiges Quadrat */
.kind-ic { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px;
           color: var(--on-color); flex: 0 0 auto; vertical-align: middle; }
.kind-ic svg { width: 17px; height: 17px; }
.kind-ic.small, .activity .meta .kind-ic { width: 22px; height: 22px; border-radius: 6px; }
.kind-ic.small svg, .activity .meta .kind-ic svg { width: 13px; height: 13px; }
.kind-cell { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.kind-title { display: flex; align-items: center; gap: .5rem; }

/* Detailseiten: Kopfkarte mit den wichtigsten Angaben und Reitern darunter; rechts die Timeline */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1rem; align-items: start; }
.detail:not(:has(> .dside)) { grid-template-columns: minmax(0, 1fr); }
.detail:has(> .dside.is-closed) { grid-template-columns: minmax(0, 1fr) 46px; }
.detail-main { min-width: 0; }
.chead { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; }
.chead > .ch-top { display: flex; gap: .9rem; align-items: center; padding: .8rem 1rem; flex-wrap: wrap; }
.chead h1 { margin: 0; font-size: 1.45rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.ch-main { flex: 1 1 18rem; min-width: 0; }
.ch-line span + span::before { content: " · "; color: var(--muted); }
.chead > .ch-top .actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin: 0; }
.chead > .transfer-box { border: none; border-top: 1px solid var(--line); border-radius: 0; background: none; padding: .45rem 1rem;
                         margin: 0; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.chead > .transfer-box p { margin: 0; }
.avatar.head { width: 56px; height: 56px; font-size: 1.6rem; }
/* Reiter brechen in eine zweite Zeile um, statt rechts abgeschnitten zu werden; nur „Aufgeräumt“ fasst den Rest unter
   „Mehr ▾“ zusammen (dt-fit) */
.dtabs { display: flex; flex-wrap: wrap; gap: .15rem; border-top: 1px solid var(--line); padding: 0 .5rem; }
.dtabs::-webkit-scrollbar { display: none; }
.dtabs button { background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted);
                padding: .6rem .75rem .5rem; white-space: nowrap; flex: 0 0 auto; }
.dtabs button:hover { color: var(--text); }
.dtabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.dtabs .cnt { display: inline-block; min-width: 1.3rem; padding: 0 .35rem; margin-left: .2rem; border-radius: 999px; background: var(--bg);
              font-size: .75rem; font-weight: 600; text-align: center; color: var(--muted); }
.dtabs button.on .cnt { color: var(--accent); }
.dtab { display: none; }
.dtab.on { display: block; }
/* Reiter im Formular (Personal): Leiste über den Abschnitten statt in der Kopfkarte */
.form > .dtabs.form-tabs { border-top: none; border-bottom: 1px solid var(--line); padding: 0; margin: 0 0 .75rem; }
.dtab > .card + .card, .dtab > .card + .ds-bar, .dtab > .ds-bar + .card { margin-top: 1rem; }
.dtab > .ds-bar:first-child { margin-top: 0; }
.ch-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 0 1.25rem; padding-top: 0; }
.ch-body > .card, .ch-body > .card + .card { border: none; padding: 0; background: none; margin: 0; }
.ch-body h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: .9rem 0 .4rem; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; padding: 0; border: 0; }
.cat-dots.inline { display: inline-flex; margin: 0; vertical-align: middle; }

/* Reiter Aktivitäten: einzeiliges Formular (mit „groß“ aufklappbar) und Einträge */
.act-tab .qform { padding: .55rem .7rem; margin-bottom: .8rem; }
.qf-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.qf-row input[name=subject] { flex: 1 1 12rem; width: auto; margin: 0; }
.qf-row .due-field { flex: 0 0 auto; margin: 0; }
.qf-row .due-field[hidden] { display: none; }
.qf-row .due-field input { width: auto; }
.qf-row > button { flex: 0 0 auto; }
.qf-row .qf-toggle { white-space: nowrap; font-size: .88rem; }
.qform .kind-pick { margin: 0; flex-wrap: nowrap; }
.qform .kind-name { display: none; }
.qf-more { display: none; padding-top: .6rem; }
.qform.big .qf-more { display: grid; grid-template-columns: 1fr; gap: .2rem; }
.qform.big .rich-area, .qform.big textarea { min-height: 220px; }
.qf-more label { max-width: 20rem; }
.qf-more label:first-child { max-width: none; }
.act-tab .pane-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; }
.act-tab h3, .dside h3 { margin: 0 0 .6rem; font-size: 1rem; display: flex; align-items: center; gap: .35rem; }
.act-form label { display: flex; flex-direction: column; gap: .2rem; color: var(--muted); font-size: .88rem; margin-bottom: .5rem; }
.act-form input, .act-form textarea { margin: 0; }
/* Timeline rechts: bleibt beim Scrollen stehen */
.dside { position: sticky; top: .75rem; max-height: calc(100vh - 1.5rem); display: flex; flex-direction: column; min-width: 0;
         background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.dside > .pane-body { padding: .8rem 1rem; display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.dside .tl-wrap { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.dside .tl { max-height: none; flex: 1 1 auto; min-height: 6rem; }
.dside .quick { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .6rem; }
.dside .quick .chip { font-size: .82rem; padding: .15rem .6rem; }
.dside .fold { border: 1px solid var(--line); background: var(--bg); color: var(--muted); border-radius: 6px; width: 28px; height: 28px;
               padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }
.dside .fold:hover { color: var(--text); }
.dside h3 .fold { margin-left: auto; }
.pane-strip { display: none; flex-direction: column; align-items: center; gap: .5rem; padding: .6rem .3rem; min-height: 14rem; }
.pane-strip .vert { writing-mode: vertical-rl; transform: rotate(180deg); color: var(--muted); font-size: .85rem; white-space: nowrap; }
.dside.is-closed .pane-strip { display: flex; }
.dside.is-closed .pane-body { display: none; }
.kind-pick { border: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.kind-pick legend { color: var(--muted); font-size: .88rem; padding: 0; margin-bottom: .25rem; }
.kind-pick label { display: inline-flex; margin: 0; cursor: pointer; border-radius: 9px; padding: 2px; border: 2px solid transparent; }
.kind-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.kind-pick label .kind-ic { opacity: .45; filter: saturate(.6); }
.kind-pick label:hover .kind-ic { opacity: .8; }
.kind-pick label:has(input:checked) { border-color: var(--accent); }
.kind-pick label:has(input:checked) .kind-ic { opacity: 1; filter: none; }
.kind-pick label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.kind-name { font-size: .85rem; color: var(--text); margin-left: .3rem; }
.feed-filter { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .4rem; }
.feed-filter input[type=search] { flex: 1 1 12rem; width: auto; margin: 0; }
.kind-chips { display: flex; flex-wrap: wrap; gap: .25rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line); border-radius: 999px; padding: .1rem .55rem;
        font-size: .8rem; background: var(--bg); color: var(--text); cursor: pointer; text-decoration: none; }
.chip:hover { text-decoration: none; border-color: var(--muted); }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip.on, .chip:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chip-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; }
.related-chk { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; color: var(--muted); cursor: pointer; }
.related-chk input { width: auto; margin: 0; }
.feed .sect { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: .7rem 0 .25rem; }
.act { display: grid; grid-template-columns: auto 1fr auto; gap: .65rem; align-items: start; padding: .6rem .4rem;
       border-bottom: 1px solid var(--line); }
.act:last-child { border-bottom: none; }
.act.task { background: var(--warn-bg); border: 1px solid var(--task-line); border-radius: 6px; margin-bottom: .35rem; }
.act.task.overdue { background: var(--overdue-bg); border-color: var(--overdue-line); }
.act.hl { outline: 2px solid var(--accent); border-radius: 6px; }
.act.done .act-subj a { text-decoration: line-through; color: var(--muted); }
.act-main { min-width: 0; }
.act-subj { font-weight: 600; overflow-wrap: anywhere; }
.act-subj a { color: var(--text); }
.act .meta { color: var(--muted); font-size: .8rem; display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.act .overdue-label { color: var(--danger); }
.act .tag { border: 1px solid var(--line); border-radius: 999px; padding: 0 .45rem; font-size: .72rem; background: var(--bg); }
.act .body { font-size: .9rem; margin-top: .25rem; overflow-wrap: anywhere; }
.act .more-btn { font-size: .82rem; padding: 0; }
.more-btn[hidden] { display: none; }
/* Aktivitäten in Listen (activities/_body.html): Vorschau mit zwei Zeilen Fließtext, „mehr …“ zeigt den ganzen
   Text. Mit data-activities="lines" am <html> eine Zeile je Aktivität: Betreff und Textanfang. */
.act-teaser { color: var(--muted); line-height: 1.4; margin-top: .2rem; overflow-wrap: anywhere;
              display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.act-full { display: none; }
.open > .act-full, .open > .act-main > .act-full { display: block; }
.open > .act-teaser, .open > .act-main > .act-teaser { display: none; }
.activity .act-full { margin-top: .35rem; padding-top: .35rem; border-top: 1px dashed var(--line); }
.act-inline { display: none; }
[data-activities=lines] .act-inline { display: inline; font-weight: 400; color: var(--muted); }
[data-activities=lines] .act-teaser, [data-activities=lines] :not(.open) > .act-foot .more-btn,
[data-activities=lines] .act:not(.open) .more-btn { display: none; }
[data-activities=lines] .act-subj { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-activities=lines] .act .meta { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
[data-activities=lines] .act { padding-top: .4rem; padding-bottom: .4rem; }
[data-activities=lines] .act .body.act-full { margin-top: .3rem; }
/* Kachel der Startseite kompakt: Symbol | Betreff – Text | Datum, darunter der Bezug */
[data-activities=lines] .widget .timeline.acts { border-top: 1px solid var(--line); }
[data-activities=lines] .widget .activity { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto;
  grid-template-areas: "ic subj when" ". who who"; gap: .1rem .6rem; align-items: center; margin: 0;
  border: none; border-bottom: 1px solid var(--line); border-radius: 0; padding: .45rem .1rem; background: none; }
[data-activities=lines] .widget .activity.overdue { background: var(--warn-bg); }
[data-activities=lines] .widget .activity .meta { display: contents; }
[data-activities=lines] .widget .activity .kind-ic { grid-area: ic; }
[data-activities=lines] .widget .activity .subject { grid-area: subj; margin: 0; }
[data-activities=lines] .widget .activity .subject a { color: var(--text); }
[data-activities=lines] .widget .activity .act-when, [data-activities=lines] .widget .activity .act-due { grid-area: when; font-size: .8rem; white-space: nowrap; }
[data-activities=lines] .widget .activity .act-time { display: none; }
[data-activities=lines] .widget .activity:has(.act-due) .act-when { display: none; }
[data-activities=lines] .widget .activity .act-who { grid-area: who; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: -.1rem; }
[data-activities=lines] .widget .activity .act-who::before { content: none; }
[data-activities=lines] .widget .activity .act-who a { color: inherit; }
[data-activities=lines] .widget .activity .act-foot { display: none; }
.act-actions { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; font-size: .88rem; white-space: nowrap; }
.act-actions .link, .act-actions button.link { font-size: .88rem; }
.tl-wrap .kind-chips { margin-bottom: .4rem; }
.tl { max-height: 34rem; overflow-y: auto; padding-right: .3rem; scrollbar-width: thin; }
.tl-month { font-weight: 700; font-size: .82rem; margin: .6rem 0 .3rem; position: sticky; top: 0; background: var(--surface); padding: .15rem 0; z-index: 1; }
.tl ul { list-style: none; margin: 0 0 0 .55rem; padding: 0 0 0 .9rem; border-left: 2px solid var(--line); }
.tl li { position: relative; margin: 0 0 .1rem; }
.tl li a { display: block; padding: .2rem .35rem; border-radius: 5px; color: var(--text); font-size: .82rem; line-height: 1.25; }
.tl li a:hover { background: var(--bg); text-decoration: none; }
.tl li.cur a { background: var(--bg); box-shadow: inset 2px 0 0 var(--accent); }
.tl li.done .tl-subj { color: var(--muted); text-decoration: line-through; }
.tl li small { display: block; color: var(--muted); font-size: .74rem; }
.tl .tl-dot { position: absolute; left: -1.38rem; top: .3rem; width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--surface); }
.tl .tl-dot svg { width: 8px; height: 8px; }
@media (max-width: 900px) {
  /* Handy und Tablet: Timeline unter dem Inhalt, immer offen */
  .detail, .detail:has(> .dside.is-closed) { grid-template-columns: minmax(0, 1fr); }
  .dside, .dside.is-closed { position: static; max-height: none; }
  .dside.is-closed .pane-body { display: flex; }
  .dside .pane-strip, .dside h3 .fold { display: none !important; }
  .dside .tl { max-height: 26rem; }
  .chead > .ch-top { padding: .7rem .8rem; gap: .6rem; }
  .chead h1 { font-size: 1.25rem; }
  .avatar.head { width: 44px; height: 44px; font-size: 1.3rem; }
  .dtabs button { padding: .55rem .6rem .45rem; }
  .qform .kind-pick { flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .qf-row input[name=subject] { flex: 1 1 8rem; }
}
@media (max-width: 560px) {
  .chead > .ch-top .ch-main { flex: 1 1 0; }
  .chead > .ch-top .actions { flex: 1 1 100%; }
  .chead > .ch-top .actions .button, .chead > .ch-top .actions button { padding: .35rem .7rem; font-size: .9rem; }
}

/* Adminpunkt Aktivitätsarten */
/* Abläufe (0.108): Reiter über dem Board, Stufenfarbe, Adminseite mit Stufen zum Ziehen */
.flow-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .75rem; }
.flow-tabs a { padding: .2rem .7rem; border: 1px solid var(--line); border-radius: 999px; color: var(--text); }
.flow-tabs a.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.flow-tabs .cnt { color: var(--muted); font-weight: 400; }
.type-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 .1rem; }
.type-filter label { display: inline-flex; align-items: center; gap: .3rem; margin: 0; padding: .2rem .75rem;
  border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-size: .88rem; cursor: pointer; }
.type-filter label:has(input:checked) { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.type-filter input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.type-filter label:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.type-chosen { margin: 0; align-self: end; padding-bottom: .4rem; }
.stage-dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; margin-right: .4rem; vertical-align: 0; }
.stage-badge { display: inline-flex; align-items: center; }
.flows-admin { display: grid; grid-template-columns: minmax(12rem, .7fr) 1.2fr 1.3fr; gap: 1rem; align-items: start; }
.flows-admin .card + .card { margin-top: 0; }
.flow-list { list-style: none; padding: 0; margin: 0; }
.flow-list a { display: block; padding: .35rem .5rem; border-radius: .4rem; color: var(--text); }
.flow-list a.on { background: var(--bg); color: var(--accent); font-weight: 600; }
.stage-list { list-style: none; padding: 0; margin: .5rem 0; }
.stage-list li { display: flex; align-items: center; gap: .4rem; padding: .4rem .5rem; border: 1px solid var(--line);
  border-radius: .4rem; margin-bottom: .35rem; background: var(--surface); }
.stage-list li.sel { border-color: var(--accent); }
.stage-list li.dragging { opacity: .5; }
.stage-list .handle { cursor: grab; color: var(--muted); letter-spacing: -2px; user-select: none; }
.stage-list .grow { flex: 1; min-width: 0; }
.stage-list .tab-btn { background: none; border: none; padding: .2rem .35rem; color: var(--muted); cursor: pointer; width: auto; font-size: .8rem; }
.stage-req { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
/* Frei geplante Abläufe (0.123): Baum der Schritte mit Einrückung je Ebene */
.flow-tree { list-style: none; padding: 0; margin: .5rem 0; }
.flow-tree li { display: flex; align-items: center; gap: .4rem; padding: .35rem .5rem; margin-left: calc(var(--depth, 0) * .9rem);
  border: 1px solid var(--line); border-radius: .4rem; margin-bottom: .3rem; background: var(--surface); }
.flow-tree li[hidden] { display: none; }
.flow-tree .flow-start { border-style: dashed; color: var(--muted); }
.flow-tree .flow-branch { border: none; border-left: 3px solid var(--accent); border-radius: 0; padding: .2rem .5rem; background: none; }
.flow-tree .flow-add { border: 1px dashed var(--line); background: none; padding: .15rem .5rem; font-size: .85rem; }
.flow-tree li.sel { border-color: var(--accent); }
.flow-tree li.dragging { opacity: .5; }
.flow-tree li.drop-here { outline: 2px solid var(--accent); }
.flow-tree .handle { cursor: grab; color: var(--muted); letter-spacing: -2px; user-select: none; }
.flow-tree .grow { flex: 1; min-width: 0; }
.flow-tree .tab-btn { background: none; border: none; padding: .2rem .35rem; color: var(--muted); cursor: pointer; width: auto; font-size: .8rem; }
.flow-tree .step-branch, .flow-tree .step-parallel { font-weight: 600; }
.flow-tree .step-end { color: var(--muted); }
.flow-path li { display: block; }
.flow-kinds { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .5rem; }
.flow-runs { list-style: none; padding: 0; margin: .5rem 0; }
.flow-runs li { padding: .4rem 0; border-top: 1px solid var(--line); }
.flow-records { list-style: none; padding: 0; columns: 2 18rem; }
.flow-start-form { margin-top: .5rem; }
@media (max-width: 1100px) { .flows-admin { grid-template-columns: 1fr; } }
.kinds-admin { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.kinds-admin .card + .card { margin-top: 0; }
.kinds-admin h2 { margin-top: 0; }
.kinds-table tr.sel td { background: var(--bg); }
.kinds-table tr.off td { color: var(--muted); }
.kinds-table tr.off .kind-ic { opacity: .45; }
.kinds-table .tab-btn { background: none; border: none; padding: .15rem .3rem; color: var(--muted); cursor: pointer; width: auto; font-size: .78rem; }
.kinds-table .nowrap, .nowrap { white-space: nowrap; }
.small { font-size: .8rem; }
.icon-pick, .color-pick { border: none; padding: 0; margin: .5rem 0; }
.icon-pick legend, .color-pick legend { color: var(--muted); font-size: .9rem; padding: 0; margin-bottom: .3rem; }
.icon-pick { display: grid; grid-template-columns: repeat(8, 1fr); gap: .35rem; }
.icon-pick label { display: flex; align-items: center; justify-content: center; height: 40px; border: 1px solid var(--line);
                   border-radius: 7px; background: var(--bg); cursor: pointer; color: var(--text); }
.icon-pick label svg { width: 20px; height: 20px; }
.icon-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.icon-pick label:has(input:checked) { border: 2px solid var(--accent); color: var(--accent); }
.color-pick { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.color-pick .swatch { width: 28px; height: 28px; border-radius: 50%; padding: 0; border: 2px solid var(--surface); cursor: pointer; }
.color-pick .swatch.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.color-pick input[type=color] { width: 3rem; height: 30px; padding: 1px; margin: 0; }
.kind-preview { display: flex; align-items: center; gap: .6rem; background: var(--bg); border-radius: 8px; padding: .55rem .8rem; margin: .6rem 0; }
.kind-form .actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.kind-form .actions .grow { flex: 1; }
@media (max-width: 900px) { .kinds-admin { grid-template-columns: 1fr; } .icon-pick { grid-template-columns: repeat(6, 1fr); } }

/* ---------- Datenschutz ---------- */
:root { --ds-green: #1f8a4c; --ds-amber: #9a5b00; --ds-red: #c0352b; --ds-info: #667085; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) { --ds-green: #4cc27e; --ds-amber: #f0a43a; --ds-red: #ff6b5e; } }
:root[data-theme=dark] { --ds-green: #4cc27e; --ds-amber: #f0a43a; --ds-red: #ff6b5e; }
.ds-amber { color: var(--ds-amber); }
.ds-red { color: var(--ds-red); }
.ds-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .35rem;
          background: var(--ds-info); vertical-align: middle; }
.ds-dot.ds-green, .ds-dot.ds-ok { background: var(--ds-green); }
.ds-dot.ds-amber, .ds-dot.ds-warn { background: var(--ds-amber); }
.ds-dot.ds-red { background: var(--ds-red); }
.ds-dot.ds-info { background: var(--ds-info); }
.badge.warn { border-color: var(--ds-amber); color: var(--ds-amber); }
.badge.ds-status-new { border-color: var(--accent); color: var(--accent); }
.badge.ds-status-in_progress { border-color: var(--ds-amber); color: var(--ds-amber); }
.badge.ds-status-done { border-color: var(--ds-green); color: var(--ds-green); }
.badge.ds-status-rejected { color: var(--muted); }
.secondary-btn { background: transparent; color: var(--accent); }
.danger-solid { background: var(--danger); border-color: var(--danger); color: var(--on-color); }
.danger-solid:disabled { opacity: .5; cursor: not-allowed; }
a.danger-link { color: var(--danger); }
.danger-card { border-color: var(--danger); }
.erase-dialog { border-color: var(--danger); max-width: 720px; }
.filter-chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.filter-chips a { padding: .15rem .7rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.filter-chips a.active { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.pre { white-space: pre-wrap; }
/* Druckseite (Datenauskunft, Berichte): bewusst feste Farben wie auf Papier, unabhängig von Design und Modus */
.paper { background: #fff; color: #1d2330; max-width: 820px; margin: 1rem auto; padding: 2rem 2.5rem;
         border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.paper a { color: #2563eb; }
.paper .sub { color: #667085; }
.paper-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid #1d2330;
              padding-bottom: .5rem; margin-bottom: 1rem; }
.paper table { width: 100%; border-collapse: collapse; }
.paper th, .paper td { text-align: left; border-bottom: 1px solid #e3e6eb; padding: .3rem .4rem; vertical-align: top; }
.ds-bar { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; margin: .75rem 0; padding: .5rem .9rem;
          border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); font-size: .9rem; }
.consent-add { margin-top: .75rem; }
.consent-add summary { cursor: pointer; color: var(--accent); }
.objection-form { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: .3rem 0; }
.export-purpose { position: relative; display: inline-block; }
.export-purpose summary { list-style: none; cursor: pointer; }
.export-purpose summary::-webkit-details-marker { display: none; }
.export-purpose .menu-items { position: absolute; right: 0; top: calc(100% + .3rem); z-index: 20; width: 260px;
                              display: flex; flex-direction: column; gap: .4rem; padding: .75rem; background: var(--surface);
                              border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
/* ---------- Administration → Systeminformation ---------- */
.sysinfo { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1rem; }
.sys-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.sys-head h2 { margin: 0; }
.sys-head .actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.sys-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.sys-tiles .card, .sys-cards .card, .sysinfo > .card { margin: 0; }
.sys-tile { display: flex; flex-direction: column; gap: .2rem; min-height: 150px; }
.sys-tile .big { font-size: 1.7rem; font-weight: 700; margin: 0; }
.sys-tile .bar { margin-top: auto; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.sys-tile .bar span { display: block; height: 100%; background: var(--accent); }
.sys-tile .bar.high span { background: var(--ds-amber); }
.sys-tile .bar.full span { background: var(--ds-red); }
.spark { width: 100%; height: 40px; margin-top: auto; display: block; }
.spark polyline { stroke: var(--accent); stroke-width: 2; }
.spark-req { margin-top: auto; }
.spark-req .spark polyline { stroke: var(--ds-green); }
.sys-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.sys-cards h2, .sysinfo > .card h2 { margin-top: 0; }
.sys-dl { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; }
.sys-dl dt { color: var(--muted); }
.sys-dl dd { margin: 0; }
.sys-data { width: 100%; border-collapse: collapse; }
.sys-data th, .sys-data td { padding: .45rem .4rem; border-bottom: 1px solid var(--line); text-align: left; }
.sys-data th { color: var(--muted); font-weight: 500; }
.sys-data .num { text-align: right; font-variant-numeric: tabular-nums; }
.sys-data .total td { font-weight: 700; }
#slow-queries { margin-top: 1.25rem; }
#slow-queries h2 { margin-top: 0; }
#slow-queries code { white-space: pre-wrap; word-break: break-word; font-size: .8rem; }
.sys-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.sys-tasks .detail { display: block; margin-left: 1.1rem; }
.dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; background: var(--line); vertical-align: baseline; }
.dot.ok { background: var(--ds-green); }
.dot.warn { background: var(--ds-amber); }
.dot.crit { background: var(--danger); }
.mon-checks td.num { white-space: nowrap; }
.mon-limits input[type=text] { width: 6rem; }
.mon-metrics { max-height: 28rem; overflow: auto; }
.logrows { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; padding: .25rem 0;
           overflow-x: auto; }
.card.logrows { padding: .25rem 0; max-height: 70vh; overflow-y: auto; }
.logrow { display: grid; grid-template-columns: 9.5rem 4.5rem 1fr; gap: .75rem; padding: .35rem 1.25rem;
          border-bottom: 1px solid var(--line); }
.logrow:last-child { border-bottom: 0; }
.logrow .time { color: var(--muted); white-space: nowrap; }
.logrow .level { font-weight: 700; color: var(--ds-green); }
.logrow.warn .level { color: var(--ds-amber); }
.logrow.error .level { color: var(--ds-red); }
.logrow.debug .level { color: var(--muted); }
.logrow .msg { white-space: pre-wrap; word-break: break-word; }
.logrows .empty { padding: .5rem 1.25rem; }
.sys-logbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin: 1rem 0; }
.sys-logbar .chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.sys-logbar input[type=search] { flex: 1 1 240px; min-width: 200px; }
.sys-logbar .check { display: flex; align-items: center; gap: .35rem; white-space: nowrap; }
.note { border-left: 3px solid var(--accent); background: var(--surface); padding: .75rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; }
@media (max-width: 640px) {
  .logrow { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- Einrichtungsassistent ---------- */
.wizard-page { padding: 2rem 1rem; }
.wizard { max-width: 860px; margin: 0 auto; padding: 1.6rem 2rem; border-radius: 12px; }
.wz-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.wz-head img { height: 64px; max-width: 160px; object-fit: contain; }
.wz-head h1 { font-size: 1.35rem; margin: 0; }
.wz-logout { margin-left: auto; }
.wz-steps { list-style: none; display: flex; padding: 0; margin: 0 0 1.4rem; }
.wz-steps li { flex: 1; text-align: center; font-size: .8rem; color: var(--muted); position: relative; padding-top: 2.1rem; }
.wz-steps li a { color: inherit; }
.wz-steps .n { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%;
               background: var(--line); display: flex; align-items: center; justify-content: center; font-weight: 700; z-index: 1; }
.wz-steps li + li::after { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.wz-steps li.done, .wz-steps li.cur { color: var(--text); }
.wz-steps li.cur { font-weight: 600; }
.wz-steps li.done .n { background: var(--ds-green); color: var(--on-color); }
.wz-steps li.cur .n { background: var(--accent); color: var(--accent-text); }
.wz-steps li.done::after, .wz-steps li.cur::after { background: var(--ds-green); }
.wizard h2 { margin-top: 0; font-size: 1.2rem; }
.wizard > .sub { margin-bottom: 1rem; }
.wz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1rem; }
.wz-grid.one { grid-template-columns: 1fr; align-content: start; }
.wz-grid .wide { grid-column: 1 / -1; margin-top: -.4rem; font-size: .88rem; }
.wz-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.wz-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
           margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.wz-mfa { display: flex; gap: 1.6rem; align-items: flex-start; flex-wrap: wrap; }
.wz-mfa img { border: 1px solid var(--line); border-radius: 6px; background: var(--white); }
.wz-mfa form { flex: 1; min-width: 240px; }
.wz-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .3rem 1rem; background: var(--bg); border-radius: 6px;
            padding: .7rem 1rem; margin-bottom: .6rem; }
.wz-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.wz-option { border: 1.5px solid var(--line); border-radius: 10px; padding: 1rem; display: flex; flex-direction: column; gap: .4rem; }
.wz-option.on { border-color: var(--accent); }
.wz-option.off { opacity: .6; }
.wz-option .badge { align-self: flex-start; }
.wz-two { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.wz-two h3 { margin-top: 0; }
.wz-checks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; font-size: .92rem; }
.wz-checks li::before { content: "ℹ "; color: var(--muted); }
.wz-checks li.ok::before { content: "✓ "; color: var(--ds-green); font-weight: 700; }
.wz-checks li.warn::before { content: "! "; color: var(--ds-amber); font-weight: 700; }
.wz-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: .8rem; margin: 1rem 0; }
.wz-section { border: 1px solid var(--line); border-radius: 8px; padding: .7rem 1rem; }
.wz-section h3 { margin: 0 0 .5rem; font-size: .98rem; display: flex; justify-content: space-between; }
.wz-section h3 a { font-weight: 400; font-size: .85rem; }
.wz-section dl { display: grid; grid-template-columns: minmax(7rem, 42%) 1fr; gap: .3rem 1rem; margin: 0; font-size: .92rem; }
.wz-section dt { color: var(--muted); }
.wz-section dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .wizard { padding: 1rem; }
  .wz-grid, .wz-two { grid-template-columns: 1fr; }
  .wz-steps li { font-size: 0; }
}
@media print {
  .noprint, .wz-steps, .wz-logout { display: none !important; }
  .wizard-page { padding: 0; }
}

@media print {
  .topbar, .tabs, .noprint, .ds-bar, nav, .look-panel, .look-shade { display: none !important; }
  body { background: #fff; padding-left: 0 !important; }
  .container { padding: 0; max-width: none; }
  .paper { border: 0; box-shadow: none; margin: 0; padding: 0; max-width: none; }
}

/* Active Directory (0.20) */
.wz-option:has(input:checked) { border-color: var(--accent); }
.wz-checks li.bad::before { content: "✗ "; color: var(--danger); font-weight: 700; }
.ad-test { margin-top: .8rem; }
.ad-test li { overflow-wrap: anywhere; }
.ad-map input, .ad-map select { width: 100%; }
.ad-map td { padding: .3rem .4rem; }
textarea.mono { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }
details summary { cursor: pointer; margin: .6rem 0; }

/* Knopf „Kategorien“ neben der Suche einer Liste (seit 0.182, vorher Karte rechts daneben): die Auswahl klappt
   über der Seite auf, mit Suchfeld und den gewählten Kategorien oben. Die Liste nutzt die ganze Seitenbreite. */
.list-layout { display: block; }
.search-row { position: relative; }
.cat-pick { position: static; flex: none; }
.cat-pick > summary { list-style: none; margin: 0; }
.cat-pick > summary::-webkit-details-marker { display: none; }
.cat-btn { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; height: 2.35rem; padding: 0 .75rem;
           border: 1px solid var(--line); border-radius: var(--r-input, 6px); background: var(--surface); color: var(--text);
           font-size: .875rem; cursor: pointer; user-select: none; }
.cat-btn::after { content: "▾"; font-size: .75rem; color: var(--muted); }
.cat-pick[open] > .cat-btn::after { content: "▴"; }
.cat-btn:hover, .cat-pick[open] > .cat-btn { border-color: var(--accent); }
.cat-btn.on { border-color: var(--accent); color: var(--accent); }
.cat-btn .ic { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.cat-btn .n { background: var(--accent); color: var(--accent-text); border-radius: 999px; padding: 0 .4rem; font-size: .75rem; font-weight: 700; line-height: 1.35; }
.cat-btn .n.empty { display: none; }
.cat-drop { position: absolute; right: 0; top: calc(100% + 6px); width: min(24rem, calc(100vw - 2rem)); z-index: 60; display: flex;
            flex-direction: column; max-height: min(32rem, 70vh); background: var(--surface); border: 1px solid var(--line);
            border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0, 0, 0, .18); }
.cat-drop .cd-head { padding: .6rem .7rem .5rem; border-bottom: 1px solid var(--line); }
.cat-drop .cd-head input { margin: 0; padding: .35rem .55rem; font-size: .875rem; }
.cat-drop .cd-meta { display: flex; justify-content: space-between; align-items: center; margin-top: .45rem; font-size: .8rem; color: var(--muted); }
.cat-drop .cd-list { overflow-y: auto; padding: .3rem 0; flex: 1; min-height: 0; }
.cat-drop .cd-grp { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: .45rem .8rem .2rem; }
.cat-drop .cd-opt { display: flex; flex-direction: row; justify-content: flex-start; align-items: center; gap: .55rem; padding: .3rem .8rem;
                    margin: 0; font-size: .875rem; color: var(--text); cursor: pointer; }
.cat-drop .cd-opt:hover { background: var(--bg); }
.cat-drop .cd-opt input { width: auto; flex: none; margin: 0; accent-color: var(--accent); }
.cat-drop .cd-opt .cat-dot { flex: none; }
.cat-drop .cd-opt[hidden], .cat-drop .cd-grp[hidden] { display: none; }
.cat-drop .cd-nohit { padding: .4rem .8rem; margin: 0; }
.cat-drop .cd-foot { border-top: 1px solid var(--line); padding: .55rem .7rem; display: flex; gap: .4rem; align-items: center; font-size: .8rem; color: var(--muted); }
.cat-drop .cd-foot button { white-space: nowrap; }
.cat-drop .cd-foot .grow { flex: 1; }
@media (max-width: 600px) {
  .search-row:has(.cat-pick) { flex-wrap: wrap; }
  .search-row:has(.cat-pick) input[type=search] { flex: 1 1 100%; }
  .cat-pick { margin-left: auto; }
}
/* Befund-Seite im Gutachten (0.194, templates/appraisals/finding_mobile.html): Grunddaten, Einordnung zweispaltig,
   Texte nebeneinander; Messwerte rechts; Fotos einklappbar unter den Feldern (.fx-below) oder rechts (.fx-side).
   Auswahlfenster mit Suche (static/field-pick.js) im Stil des Kategorie-Filters (.cat-drop). */
.fx-head .actions { align-items: center; }
.fx-layout { display: inline-flex; align-items: center; gap: .3rem; margin: 0; }
.fx-layout .sub { font-size: .85rem; }
.fx-switch { position: relative; }
.fx-switch .cat-drop { width: min(28rem, calc(100vw - 2rem)); }
.fx-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-top: .75rem; align-items: start; }
.fx-grid > .card + .card { margin-top: 0; }
.fx-grp { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 1rem 0 .4rem; }
.fx-grp:first-child { margin-top: 0; }
.fx-row { display: grid; gap: .6rem .9rem; }
.fx-row2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fx-row3 { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.3fr); }
.fx-row .fx-wide { grid-column: 1 / -1; }
.fx-form textarea { min-height: 6.5rem; resize: vertical; }
.fx-foot { display: flex; align-items: flex-end; gap: .9rem; margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.fx-foot .grow { flex: 1; }
.fx-cost { width: 12rem; }
.fx-measure h2, .fx-photos h2 { margin: 0; font-size: 1.05rem; }
.fx-mlist { margin: .5rem 0 .25rem; }
.fx-mlist li { display: flex; align-items: center; gap: .5rem; padding: .4rem 0; }
.fx-mlist li > span { flex: 1; }
.fx-mform { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, .8fr); gap: .5rem .6rem; margin-top: .75rem; align-items: end; }
.fx-mform .fx-mdevice { grid-column: 1 / -1; }
.fx-mform .fx-madd { grid-column: 1 / -1; justify-self: start; white-space: nowrap; }
.pk .cd-list, .pk-in .cd-list, .fx-switch .cd-list { position: relative; }
.fx-photos-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.fx-fold { display: inline-flex; align-items: center; gap: .45rem; background: none; border: 0; padding: 0; color: var(--text); cursor: pointer; }
.fx-chev::before { content: "▾"; display: inline-block; color: var(--muted); transition: transform .15s; }
.fx-photos.folded .fx-chev::before { transform: rotate(-90deg); }
.fx-minis { display: none; gap: .3rem; }
.fx-photos.folded .fx-minis { display: inline-flex; }
.fx-minis img { width: 2.6rem; height: 2rem; object-fit: cover; border-radius: 4px; background: var(--line); }
.fx-upload { margin: 0 0 0 auto; display: flex; align-items: center; gap: .6rem; }
.fx-upload .field-actions { margin: 0; flex-wrap: nowrap; }
@media (pointer: fine) and (min-width: 1001px) { .fx-upload .field-actions .button { min-height: 0; } }
.fx-photos-body { margin-top: .6rem; }
.fx-photos.folded .fx-photos-body { display: none; }
.fx-photos .photo-grid { margin: 0; }
@media (min-width: 900px) {
  .fx-below .fx-grid { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
  .fx-below .fx-main { grid-column: 1; grid-row: 1; }
  .fx-below .fx-measure { grid-column: 2; grid-row: 1; }
  .fx-below .fx-photos { grid-column: 1 / -1; grid-row: 2; }
  .fx-below .fx-photos .photo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .fx-side .fx-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .fx-side .fx-main { grid-column: 1; grid-row: 1 / span 2; }
  .fx-side .fx-photos { grid-column: 2; grid-row: 1; }
  .fx-side .fx-measure { grid-column: 2; grid-row: 2; }
  .fx-side .fx-photos .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  .fx-layout { display: none; }
}
@media (max-width: 640px) {
  .fx-row2, .fx-row3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fx-row3 > label:first-child, .fx-row2 > label:has(textarea) { grid-column: 1 / -1; }
  .fx-head h1 { font-size: 1.3rem; }
  .fx-mform { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fx-mform .fx-mlabel, .fx-mform .fx-mdevice, .fx-mform .fx-madd { grid-column: 1 / -1; }
  .fx-upload { margin-left: 0; width: 100%; }
  .fx-upload .field-actions { width: 100%; }
  .fx-upload .field-actions .button { flex: 1; justify-content: center; }
}
/* Auswahlfeld mit Fenster: Knopf statt <select>, Liste wie der Kategorie-Filter */
.pk { position: relative; }
.pk > select { display: none; }
.pk-btn { display: flex; align-items: center; width: 100%; min-height: 2.35rem; padding: .4rem .6rem; border: 1px solid var(--line);
          border-radius: 6px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; font-size: inherit; }
.pk-btn::after { content: "▾"; margin-left: auto; padding-left: .5rem; color: var(--muted); font-size: .75rem; }
.pk-btn:hover, .pk.open > .pk-btn, .pk-btn:focus-visible { border-color: var(--accent); background: var(--surface); color: var(--text); }
.pk-btn .pk-empty { color: var(--muted); }
.pk-btn .pk-path { color: var(--muted); margin-right: .25rem; }
.pk-btn > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk .cat-drop, .pk-in .cat-drop { left: 0; right: auto; top: calc(100% + 4px); width: max(100%, min(24rem, calc(100vw - 2rem))); }
.pk-in { position: relative; }
.pk .cat-drop[hidden], .pk-in .cat-drop[hidden] { display: none; }
.cat-drop .cd-opt.act, .cat-drop .cd-opt:focus-visible { background: var(--bg); outline: none; }
.cat-drop .cd-opt.on { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.cat-drop a.cd-opt { color: var(--text); text-decoration: none; }
.pk-radio { flex: none; width: .95rem; height: .95rem; border-radius: 50%; border: 1.5px solid var(--muted); }
.cd-opt.on .pk-radio { border: .3rem solid var(--accent); }
.cd-opt .pk-path { color: var(--muted); }
.cd-opt .cd-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-opt .pk-meta { margin-left: auto; padding-left: .6rem; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.cd-opt.pk-take { color: var(--accent); }
@media (max-width: 640px), (pointer: coarse) {
  .pk .cat-drop, .fx-switch .cat-drop { position: fixed; left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 75vh;
    border-radius: var(--radius) var(--radius) 0 0; z-index: 80; }
  .cat-drop .cd-opt { min-height: 44px; }
  .pk .cd-foot > span:first-child, .fx-switch .cd-foot > span:first-child { visibility: hidden; }
}
.cat-active { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .5rem; font-size: .85rem; color: var(--muted); }
.cat-active[hidden] { display: none; }
.cat-active .cat-chip { display: inline-flex; align-items: center; gap: .3rem; padding-right: .25rem; font-weight: 600; }
.cat-active .cat-off { background: rgba(0, 0, 0, .2); color: inherit; border: 0; border-radius: 50%; width: 1.1rem; height: 1.1rem;
                       padding: 0; font-size: .7rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
/* E-Mail-Adressen in Listen nicht Zeichen für Zeichen umbrechen, sondern kürzen (ganze Adresse im title) */
table.list a.cell-mail { display: inline-block; max-width: 15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; word-break: normal; overflow-wrap: normal; }

/* E-Mail: Posteingang, Mail mit Formular „Ablegen“, Dateien an Aktivitäten */
.mail-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); gap: 1rem; align-items: start; }
.mail-layout > .card { margin-top: 0; }
@media (max-width: 900px) { .mail-layout { grid-template-columns: 1fr; } }
.mail-body .notes { margin-top: .75rem; }
/* Empfänger der Mail eingeklappt: nur „Von“ ist sichtbar, An und Kopie beim Aufklappen */
.mail-recipients { margin: .35rem 0 0; }
.mail-recipients > summary { margin: 0; color: var(--muted); font-size: .92rem; width: fit-content; }
.mail-recipients > summary:hover { color: var(--text); }
.mail-recipients > dl { margin-top: .35rem; }
.mail-file .checks label { align-items: flex-start; }
.mail-list td.nowrap, .list td.nowrap { white-space: nowrap; }
.mail-filter { flex-wrap: wrap; }
ul.files { list-style: none; padding: 0; margin: .4rem 0 0; display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .85rem; }
ul.files li { overflow-wrap: anywhere; }
.mail-side { display: flex; flex-direction: column; gap: 1rem; }
.mail-side > .card { margin: 0; }

/* Seitenbereich des Outlook-Add-ins */
body.taskpane { padding: .75rem; font-size: 14px; }
.tp-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.tp-head .logo { max-height: 24px; }
.tp-user { margin: 0 0 .5rem; }
.tp-subject { margin: .25rem 0 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.tp-toggle { display: flex; margin: .75rem 0; }
.tp-toggle button { flex: 1; border-radius: 0; }
.tp-toggle button:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.tp-toggle button:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.tp-option { display: flex; gap: .5rem; align-items: flex-start; padding: .45rem .5rem; margin: .35rem 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.tp-option.active { border-color: var(--accent); }
.tp-option span { display: flex; flex-direction: column; min-width: 0; }
.tp-option small { color: var(--muted); overflow-wrap: anywhere; }
.tp-new { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .25rem 0 .5rem; }
.tp-new label { display: flex; flex-direction: column; gap: .2rem; }
.tp-new .tp-company { grid-column: 1 / -1; margin: 0; }
body.taskpane h3 { font-size: .9rem; margin: 1rem 0 .25rem; color: var(--muted); font-weight: 600; }
body.taskpane #file { width: 100%; }
.key-value { width: 100%; font-family: ui-monospace, monospace; }
.tp-option input { width: auto; flex: none; margin: .2rem 0 0; }

/* Lebenslauf der Kandidaten */
.card.cv { margin-top: 1rem; }
.cv-block + .cv-block { margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.cv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cv-head h3 { margin: 0 0 .4rem; font-size: 1rem; }
.cv-entry { display: flex; gap: .75rem; padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.cv-dot { width: .7rem; height: .7rem; border-radius: 50%; border: 2px solid var(--muted); margin-top: .35rem; flex: none; }
.cv-dot.on { background: var(--ds-green); border-color: var(--ds-green); }
.cv-main { flex: 1; min-width: 0; }
.cv-pill { display: inline-block; font-size: .78rem; padding: 0 .5rem; border-radius: 999px; background: color-mix(in srgb, var(--ds-green) 15%, transparent); color: var(--ds-green); }
.cv-desc { margin-top: .2rem; white-space: pre-line; }
.cv-edit summary, .cv-add summary { color: var(--accent); font-size: .9rem; margin: .3rem 0; }
.cv-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .5rem .75rem; margin: .4rem 0 .6rem; max-width: 760px; }
.cv-form label { display: flex; flex-direction: column; gap: .2rem; color: var(--muted); font-size: .88rem; }
.cv-form label.check { flex-direction: row; align-items: center; gap: .4rem; }
.cv-form .w, .cv-form .cv-actions { grid-column: 1 / -1; }
.cv-skills { display: flex; flex-wrap: wrap; gap: .35rem; margin: .2rem 0 .6rem; }
.cv-skill { display: inline-flex; align-items: center; gap: .25rem; border: 1px solid var(--line); border-radius: 999px; padding: .1rem .6rem; font-size: .9rem; }
.cv-x { background: none; border: 0; padding: 0 .1rem; color: var(--muted); cursor: pointer; line-height: 1; }
.cv-x:hover { color: var(--danger); }
.cv-skill-add { max-width: 560px; }
.cv-filter { margin-top: .5rem; }
.assign-filter { display: flex; flex-wrap: wrap; gap: .5rem .9rem; margin: .4rem 0 .2rem; }
.assign-filter label { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .88rem; margin: 0; }
.assign-filter select { width: auto; max-width: 18rem; }
.cv-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .5rem .75rem; margin-top: .4rem; }
.cv-filter-grid label { display: flex; flex-direction: column; gap: .2rem; color: var(--muted); font-size: .88rem; }
/* 0.25.1: Originalansicht abgelegter Mails (HTML ohne Bilder und Links) */
.mail-tabs { display: flex; border-bottom: 1px solid var(--line); margin: .75rem 0 .5rem; }
.mail-tabs button { background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0;
                    color: var(--muted); padding: .35rem .9rem; }
.mail-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.mail-note { font-size: .85rem; margin: .25rem 0 .5rem; }
.mail-frame { display: block; width: 100%; min-height: 12rem; border: 1px solid var(--line); border-radius: 6px;
              background: var(--white); }
.mail-views .notes { border-top: none; padding-top: 0; }

/* Modul „Dokumente“ */
.documents .doc-list { list-style: none; padding: 0; margin: .5rem 0; }
.documents .doc-list li { display: flex; align-items: flex-start; gap: .6rem; padding: .4rem 0; border-top: 1px solid var(--line); }
.documents .doc-list li:first-child { border-top: none; }
.documents .doc-icon { font-size: 1.2rem; line-height: 1.3; }
.documents .doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.documents .doc-status { font-style: italic; }
.documents .doc-kind { display: inline-block; margin-top: .15rem; font-size: .85em; }
.documents .doc-kind.doc-suggested { color: #8a6d00; }
.documents .doc-kind.doc-recognized { color: #1a5fb4; }
.documents .doc-kind.doc-confirmed { color: #1a7f37; }
.documents .doc-kind.doc-pending { color: var(--muted, #666); font-style: italic; }
.documents .kind-edit { display: inline-block; margin-top: .15rem; }
.documents .kind-edit summary { cursor: pointer; }
.documents .doc-filter { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .3rem 0; }
.modules .module-extra { font-size: .85em; font-style: italic; }
.documents .doc-upload { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .6rem; }
.documents .doc-upload input[type=file] { max-width: 100%; }
.documents .doc-upload .sub { flex-basis: 100%; }
.documents .count { color: var(--muted); font-weight: normal; font-size: .9rem; }
.doc-hits .doc-snippet { font-size: .85rem; color: var(--muted); margin: .15rem 0 .2rem; overflow-wrap: anywhere; }
.doc-hits mark { background: var(--warn-bg); color: var(--text); padding: 0 .1rem; border-radius: 2px; }

/* Vorlagen */
.documents .doc-generate { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .75rem 0 .25rem; }
.documents .doc-generate label { margin: 0; }
.documents .doc-generate select { width: auto; min-width: 12rem; max-width: 100%; }
.documents .doc-generate button { margin: 0; }
code.ph { cursor: copy; }
.ph-syntax code { white-space: nowrap; }
.templates .actions-cell { white-space: nowrap; }
.templates .inline-edit form { margin-top: .5rem; min-width: 18rem; }

/* Outlook-Import: Optionen untereinander, Hinweise unter der Auswahl, breite Aktionsauswahl */
.import-job .checks { display: flex; flex-direction: column; gap: .4rem; margin: .75rem 0 1rem; }
.import-job label small { display: block; margin-top: .25rem; }
.import-job td select { min-width: 15rem; }
.import-job td details summary { cursor: pointer; }

/* KI: Probeanfrage und Download */
.ai-output { white-space: pre-wrap; word-break: break-word; max-height: 24rem; overflow: auto; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.ai-pull progress { width: 100%; max-width: 28rem; }
.ai-models table td.sub { min-width: 18rem; }
/* KI: wohin die Daten gehen (Administration → KI, Protokoll) */
.ai-where { display: inline-block; padding: 0 .5rem; border-radius: 999px; font-size: .8rem; font-weight: 600; border: 1px solid; white-space: nowrap; }
.ai-where.local { color: #1f7a3a; background: #e8f5ec; border-color: #9fd3b0; }
.ai-where.external { color: #2346a8; background: #e8efff; border-color: #a9bdf2; }
.ai-where.blocked { color: var(--danger); background: var(--overdue-bg); border-color: var(--overdue-line); }
/* KI: extern nur anonymisiert (Zuordnung, Vorschau) und Antwortentwurf für Mails */
.ai-anon-opts { display: flex; flex-direction: column; gap: .1rem; margin-top: .35rem; font-size: .85rem; }
.anon-preview { border: 1px solid var(--line, #ccd); border-radius: 8px; padding: .75rem; margin: .5rem 0; }
.anon-preview .anon-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.anon-text { white-space: pre-wrap; word-break: break-word; max-height: 22rem; overflow: auto; font: inherit; font-size: .9rem;
  background: var(--subtle-bg, rgba(127,127,127,.08)); padding: .6rem; border-radius: 6px; }
.anon-text mark { background: #e8efff; color: #2346a8; border-radius: 4px; padding: 0 .15rem; cursor: help; }
:root[data-theme=dark] .anon-text mark { background: #1b2a52; color: #a9bdf2; }
.mail-draft [hidden], .anon-preview [hidden] { display: none !important; }
.mail-draft-out { white-space: pre-wrap; border-left: 3px solid #a9bdf2; padding: .4rem .7rem; margin: .5rem 0; }
:root[data-theme=dark] .ai-where.local { color: #8fdca8; background: #17311f; border-color: #2f6a41; }
:root[data-theme=dark] .ai-where.external { color: #a9c1ff; background: #1a2442; border-color: #34508f; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) .ai-where.local { color: #8fdca8; background: #17311f; border-color: #2f6a41; }
  :root:not([data-theme=light]) .ai-where.external { color: #a9c1ff; background: #1a2442; border-color: #34508f; }
}
tr.ai-blocked td { background: var(--overdue-bg); }
.ai-log-scroll { overflow-x: auto; }
[data-ai-cancel][hidden] { display: none; }
.pagehead .actions { margin: 0; display: flex; gap: .5rem; flex-wrap: wrap; }
.research-log { margin: 0; padding-left: 1.2rem; }
.research-log li { margin: .2rem 0; }

/* Dokumente bearbeiten (Collabora): Editor über die ganze Seite */
.office-page { margin: 0; height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.office-bar { display: flex; align-items: center; gap: .75rem; padding: .4rem .75rem; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.office-bar .button { margin: 0; }
.office-name { overflow-wrap: anywhere; }
.office-hint { margin-left: auto; }
.office-frame { flex: 1; width: 100%; border: 0; }
.documents .doc-actions { display: flex; flex-wrap: wrap; gap: .1rem .6rem; align-items: center; font-size: .9rem; }
.documents .doc-actions form { margin: 0; }
.documents .doc-lock { color: var(--ds-amber); }
.documents .doc-versions { margin: .4rem 0 .2rem; }
.documents .doc-versions td.actions { white-space: nowrap; display: flex; gap: .6rem; }
.documents .doc-generate .doc-output { display: inline-flex; gap: .6rem; align-items: center; }
.documents .doc-generate .doc-output label { display: inline-flex; gap: .25rem; align-items: center; font-weight: normal; }
.merge .counts { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.merge .pages { display: flex; gap: 1rem; flex-wrap: wrap; }

/* KI: Aus Text übernehmen (0.37) */
/* Formular mit rechter Spalte für „Signatur erkennen“ und „Lebenslauf einlesen“ (seit 0.249.10) */
.page-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.page-head > h1 { flex: 1; margin-right: auto; }
.page-head .head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.page-head .head-actions button.on { border-color: var(--accent); color: var(--accent); }
.form-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.form-split.side-open { grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); }
.form-side { position: sticky; top: 1rem; display: grid; gap: 1rem; }
.side-panel-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.side-panel-head h2 { margin: 0; font-size: 1.05rem; }
@media (max-width: 900px) { .form-split.side-open { grid-template-columns: 1fr; } .form-side { position: static; order: -1; } }
.ai-text summary { cursor: pointer; display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.ai-text textarea { width: 100%; margin: .5rem 0; }
.ai-text .actions { align-items: center; }
.ai-filled { background: var(--ai-bg); border-color: var(--ai-line); }
.ai-suggest { font-size: .85rem; color: var(--ds-amber); margin-top: .15rem; }
.ai-suggest-head { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.ai-suggest-head .note { flex: 1; margin: 0; }
.ai-result { display: grid; gap: .5rem; margin-bottom: .75rem; }
.ai-result .note, .ai-result .alert { margin: 0; }
.ai-company { font-size: .85rem; margin-top: .15rem; }
.ai-company-new { color: var(--ds-amber); }
.ai-people { border: 1px dashed var(--ds-amber); border-radius: var(--radius, 6px); padding: .5rem .75rem; }
.ai-people h3 { margin: 0 0 .25rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ai-people p { margin: .25rem 0; }
.alert-text { color: var(--danger); }
.success-text { color: var(--ds-green); font-size: .95rem; font-weight: 400; }

/* KI: Lebenslauf einlesen (0.37) */
.cv-title { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.cv-read-choice { display: grid; gap: .5rem; }
.cv-read-option { display: flex; gap: .5rem; align-items: baseline; }
.cv-read-choice textarea { width: 100%; }
.cv-read-docs tr.muted, .cv-read-table tr.muted { opacity: .55; }
.cv-read-steps { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; }
.cv-read-step { border: 1px solid var(--line); border-radius: 999px; padding: .1rem .7rem; color: var(--muted); }
.cv-read-step.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.cv-read-step.done { border-color: var(--ds-green); color: var(--ds-green); }
.ai-bar { height: .5rem; background: var(--line); border-radius: 999px; overflow: hidden; }
.ai-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s; }
.cv-read-meta { display: flex; justify-content: space-between; }
.cv-read-table input { width: 100%; min-width: 6rem; }
.cv-read-table input.month { min-width: 5.5rem; width: 6.5rem; }
.cv-read-table input.short { min-width: 5rem; }
.cv-read-table input.strong { font-weight: 600; }
.cv-read-tags { white-space: nowrap; }
.cv-read-skills { display: flex; gap: .4rem; flex-wrap: wrap; }
.cv-read-skills .cv-skill.muted { opacity: .55; }
.cv-read-skills label.cv-skill { display: inline-flex; flex-direction: row; align-items: center; gap: .35rem; margin: 0; font-weight: 400; }
.cv-read-skills label.cv-skill input { width: auto; margin: 0; }

/* KI: Kontakt aus E-Mail-Signatur (0.38) */
.ai-sig-text { white-space: pre-wrap; font: inherit; font-size: .9rem; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: .5rem .75rem; margin: .5rem 0; max-height: 14rem; overflow: auto; }
.ai-sig-changes { width: 100%; table-layout: fixed; min-width: 0; }
.ai-sig-changes th, .ai-sig-changes td { padding: .3rem .35rem; overflow-wrap: anywhere; }
.ai-sig-changes th:first-child, .ai-sig-changes td:first-child { width: 2.4rem; }
.ai-sig-changes th:nth-child(2) { width: 6.5rem; }
.ai-sig-changes th:last-child { width: 45%; }
.ai-sig-changes input[type=checkbox] { width: auto; margin: 0; }
.ai-sig-changes input:not([type=checkbox]) { width: 100%; min-width: 0; }
.ai-sig-old { color: var(--muted); text-decoration: line-through; }
.ai-sig-form { display: grid; gap: .5rem; }

/* Bereiche (0.39) */
.org-member-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.org-member-form select, .org-member-form input { width: auto; margin: 0; }
.org-member-form input { flex: 1 1 10rem; min-width: 8rem; }
.org-tree td { white-space: nowrap; }
.org-attrs input { margin: 0; }
#org form.inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; }
#org form.inline select, #org form.inline input { width: auto; margin: 0; }
/* Benachrichtigungen: Glocke in der Kopfzeile, Hinweis unten rechts, Liste und Einstellungen */
.bell { margin-left: auto; position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
        color: var(--header-link, var(--accent)); flex: 0 0 auto; }
.bell svg { width: 20px; height: 20px; }
.bell:hover { text-decoration: none; opacity: .85; }
.globalsearch + .bell { margin-left: .6rem; }
.bell + .usermenu { margin-left: .6rem; }
.bell-count { position: absolute; top: -2px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger);
              color: var(--on-color); font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; }
.bell-count[hidden] { display: none; }
@media (max-width: 1000px) {
  .bell { order: 2; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; margin-left: 0; }
  .bell + .usermenu { margin-left: 0; }
}
.notify-toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 80; display: flex; flex-direction: column; gap: .5rem; max-width: min(360px, calc(100vw - 2rem)); }
.notify-toast { display: block; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-left: 4px solid var(--accent);
                border-radius: var(--radius); padding: .65rem .9rem; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.notify-toast:hover { text-decoration: none; background: var(--bg); }
.notify-list { list-style: none; margin: 0; padding: 0; }
.notify-list li { padding: .55rem .2rem; border-bottom: 1px solid var(--line); }
.notify-list li:last-child { border-bottom: 0; }
.notify-list li.unread a { font-weight: 600; }
.notify-list li.unread::before { content: "●"; color: var(--accent); margin-right: .45rem; font-size: .7rem; vertical-align: middle; }
.notify-prefs td:not(:first-child), .notify-prefs th:not(:first-child) { text-align: center; width: 5.5rem; }
.notify-quiet { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Aufgaben (0.41) */
.tasks-list td.prio, .tasks-list th.prio { width: 1.2rem; padding-right: 0; }
.prio-high { color: var(--danger); }
.tasks-list tr.overdue td { background: var(--warn-bg); }
.tasks-list tr.overdue td:nth-child(2) { color: var(--danger); font-weight: 600; }
.tasks-list tr.done td { color: var(--muted); }
.tasks-list tr.done a { color: var(--muted); }
.badge.task-open { border-color: var(--accent); color: var(--accent); }
.badge.task-in_progress { border-color: var(--ds-amber); color: var(--ds-amber); }
.badge.task-returned { border-color: var(--danger); color: var(--danger); }
.badge.task-done { border-color: var(--ds-green); color: var(--ds-green); }
.task-detail { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.task-main, .task-side { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.task-main > .card, .task-side > .card { margin: 0; }
.task-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.task-events { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .6rem; }
.task-events q { display: block; margin-top: .2rem; color: var(--muted); quotes: none; }
table.list.task-overview td, table.list.task-overview th { text-align: right; }
table.list.task-overview td:first-child, table.list.task-overview th:first-child { text-align: left; }
table.list.task-overview tr.unit-row td { background: var(--bg); }
@media (max-width: 900px) { .task-detail { grid-template-columns: 1fr; } }
fieldset.prio-pick { border: 0; margin: 0; padding: 0; }
fieldset.prio-pick legend { color: var(--muted); font-size: .9rem; padding: 0; margin-bottom: .3rem; }
.form fieldset.prio-pick label { display: inline-flex; flex-direction: row; align-items: center; gap: .35rem; margin-right: 1.2rem; color: var(--text); }

/* Vertretung (0.57) */
.absent { color: var(--ds-amber); font-size: .85rem; font-weight: normal; margin-left: .3rem; }
fieldset.deputy-rules { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
fieldset.deputy-rules legend { color: var(--muted); font-size: .9rem; padding: 0; margin-bottom: .3rem; }
table.list.absences td { vertical-align: middle; }
ul.absence-list { list-style: none; margin: .5rem 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.absence-list li { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .75rem; display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
/* Release Notes (0.42): Seite im Benutzermenü und Fenster nach einem Update */
.release-notes ul { margin: .25rem 0 .5rem; padding-left: 1.25rem; }
.release-notes li { margin: .15rem 0; }
.release-notes p { margin: .4rem 0; }
.release-notes h2 .sub, .release-notes h3 .sub { font-weight: normal; margin-left: .35rem; }
.release-dialog { width: max(50vw, min(560px, calc(100vw - 2rem))); max-width: calc(100vw - 2rem); margin: auto; max-height: calc(100vh - 3rem); padding: 0;
                  background: var(--surface); color: var(--text); border: 1px solid var(--line);
                  border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.release-dialog::backdrop { background: rgba(15, 20, 30, .45); }
.release-dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 3rem); }
.release-dialog-head { padding: 1rem 1.25rem .5rem; border-bottom: 1px solid var(--line); }
.release-dialog-head h2 { margin: 0 0 .2rem; }
.release-dialog-body { padding: .25rem 1.25rem; overflow-y: auto; }
.release-dialog-body h3 { font-size: 1rem; margin: .9rem 0 .3rem; }
.release-dialog .actions { padding: .75rem 1.25rem 1rem; margin: 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.release-dialog .actions a { margin-left: auto; }
.release-dialog .release-hide { display: flex; flex-direction: row; align-items: center; gap: .4rem; margin: 0; color: var(--text); font-weight: normal; cursor: pointer; }
.release-dialog .release-hide input { width: auto; margin: 0; }

/* ---------- Adminbereich: Leiste oben mit Aufklappmenüs (admin/_tabs.html, seit 0.253.0) und Startseite (admin/index.html) ---------- */
.admin-bar { position: sticky; top: .5rem; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .35rem;
             background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .45rem .55rem;
             margin-bottom: 1rem; }
.admin-filter { width: 100%; }
.admin-bar .admin-filter { width: 15rem; flex: 0 0 15rem; margin: 0 .25rem 0 0; }
.admin-bar-sep { width: 1px; align-self: stretch; background: var(--line); margin: .2rem .3rem; }
.admin-bar-sep[hidden], .admin-menu[hidden] { display: none; }
.admin-menu { position: relative; }
.admin-menu > summary { list-style: none; cursor: pointer; padding: .4rem .65rem; border-radius: 8px; white-space: nowrap;
                        color: var(--text); user-select: none; }
.admin-menu > summary::-webkit-details-marker { display: none; }
.admin-menu > summary::after { content: ""; display: inline-block; width: .4em; height: .4em; margin-left: .45em;
                               border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-.15em) rotate(45deg); opacity: .6; }
.admin-menu > summary:hover, .admin-menu[open] > summary { background: var(--bg); }
.admin-menu.current > summary { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: 600; }
.admin-menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.admin-menu-list, .admin-results { position: absolute; top: calc(100% + .35rem); left: 0; min-width: 15rem; max-height: 70vh; overflow-y: auto;
                   background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
                   box-shadow: 0 10px 30px rgba(0, 0, 0, .12); padding: .4rem; z-index: 40; }
.admin-more .admin-menu-list { left: auto; right: 0; }
.admin-results { left: .55rem; top: calc(100% + .1rem); min-width: 20rem; }
.admin-menu-list a, .admin-results a { display: block; padding: .4rem .65rem; border-radius: 6px; color: var(--text); white-space: nowrap; }
.admin-menu-list a:hover, .admin-results a:hover, .admin-results a:first-child { background: var(--bg); text-decoration: none; }
.admin-menu-list a.active { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent);
                            font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.admin-menu-head { margin: .55rem .65rem .2rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.admin-menu-head:first-child { margin-top: .2rem; }
.admin-results[hidden] { display: none; }
.admin-none { margin: .5rem .45rem; }
.admin-head { margin-bottom: .75rem; }
.admin-head .crumbs { margin: 0 0 .1rem; color: var(--muted); font-size: .88rem; }
.admin-head .crumbs a { color: var(--muted); }
.admin-pick { display: none; }
/* Startseite */
.admin-start-head { margin-bottom: 1rem; }
.admin-start-head .admin-filter { max-width: 340px; }
.admin-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.admin-tiles .card { margin: 0; }
.admin-tile h2 { margin: 0 0 .4rem; display: flex; gap: .5rem; align-items: center; }
.admin-tile a { display: block; padding: .45rem 0; border-top: 1px solid var(--line); }
.admin-tile a:hover { text-decoration: none; }
.admin-tile a:hover strong { text-decoration: underline; }
.admin-tile a .sub { display: block; font-size: .87rem; }
.admin-tile a[hidden], [data-admin-group][hidden] { display: none; }
/* Handy und schmale Fenster: Auswahlfeld statt Seitenleiste */
@media (max-width: 860px) {
  .admin-bar { display: none; }
  .admin-pick { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .75rem; color: var(--muted); font-size: .9rem; }
  .admin-start-head .admin-filter { max-width: none; }
}
@media print { .admin-bar, .admin-pick { display: none; } }
/* Auf dem Handy kein Menüpunkt Administration; die Seiten bleiben per Link erreichbar */
@media (max-width: 720px) { .nav-admin { display: none !important; } }

/* ---------- Layout und Darstellung pro Benutzer (0.46) ----------
   Am <html> stehen data-menu (side, top, mini), data-theme, data-font, data-density und data-width.
   Ohne data-menu (andere Anwendungen auf pcs_ui) bleibt das Menü oben. */
:root { --side-w: 248px; --top-h: 60px; }
[data-menu=mini] { --side-w: 68px; }
[data-font=large] { font-size: 112.5%; }
[data-font=xlarge] { font-size: 125%; }
[data-density=compact] body { line-height: 1.3; }
[data-density=compact] table.list th, [data-density=compact] table.list td { padding: .3rem .6rem; }
[data-density=compact] .card:not(.deal) { padding: .7rem 1rem; }
[data-density=compact] .container { padding-top: 1rem; padding-bottom: 1rem; }
[data-density=airy] body { line-height: 1.65; }
[data-density=airy] table.list th, [data-density=airy] table.list td { padding: .75rem .9rem; }
[data-density=airy] .card:not(.deal) { padding: 1.25rem 1.5rem; }

.ic { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#mainnav .ic, .nav-sec, .tb-btn.nav-collapse { display: none; }

/* Werkzeuge oben rechts: Sprache, (Chat), Benachrichtigungen, Darstellung, Benutzer */
.tb-tools { display: flex; align-items: center; gap: .3rem; margin-left: auto; flex: 0 0 auto; }
.globalsearch + .tb-tools { margin-left: .6rem; }
.tb-tools > *, .tb-tools .bell, .tb-tools .bell + .usermenu { margin-left: 0; }
.tb-btn { display: inline-flex; align-items: center; justify-content: center; gap: .2rem; min-width: 38px; height: 38px; padding: 0 .4rem;
          border: 0; border-radius: 8px; background: none; color: var(--header-link, var(--accent)); cursor: pointer; font-size: 1rem; line-height: 1; }
.tb-btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); text-decoration: none; opacity: 1; }
.tb-tools .bell { width: auto; border: 0; }
.tb-code { font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.tb-pop { position: relative; }
.tb-pop summary { list-style: none; }
.tb-pop summary::-webkit-details-marker { display: none; }
.tb-pop .menu { position: absolute; right: 0; top: calc(100% + .6rem); z-index: 20; min-width: 200px; background: var(--surface); color: var(--text);
                border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem; box-shadow: 0 8px 24px rgba(0,0,0,.12);
                display: flex; flex-direction: column; margin: 0; }
.tb-pop .menu button.link { display: block; width: 100%; text-align: left; padding: .45rem .6rem; border-radius: 6px; color: var(--text); }
.tb-pop .menu button.link:hover { background: var(--bg); }
.tb-pop .menu button.link.on { color: var(--accent); font-weight: 600; }
.um-av { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto;
         background: var(--accent); color: var(--accent-text); font-size: .78rem; font-weight: 700; letter-spacing: .02em; }
.usermenu summary { gap: .5rem; }

/* Hauptmenü als Seitenleiste (breit oder schmal), nur auf großen Bildschirmen */
@media (min-width: 1001px) {
  :is([data-menu=side], [data-menu=mini]) body:not(.auth-page) { padding-left: var(--side-w); }
  :is([data-menu=side], [data-menu=mini]) .topbar { position: sticky; top: 0; height: var(--top-h); padding: 0 1.25rem 0 .75rem; gap: .6rem; }
  :is([data-menu=side], [data-menu=mini]) .topbar .brand { position: fixed; left: 0; top: 0; width: var(--side-w); height: var(--top-h); z-index: 2;
      padding: 0 1rem; overflow: hidden; white-space: nowrap; background: var(--brand-bg, var(--header-bg, var(--surface)));
      color: var(--brand-text, var(--header-text, var(--text)));
      border-right: 1px solid var(--side-line, var(--line)); border-bottom: 1px solid var(--side-line, var(--line)); }
  :is([data-menu=side], [data-menu=mini]) .tb-btn.nav-collapse { display: inline-flex; }
  :is([data-menu=side], [data-menu=mini]) #mainnav a.nav-extra { display: none; }
  :is([data-menu=side], [data-menu=mini]) .globalsearch { margin-left: 0; }
  :is([data-menu=side], [data-menu=mini]) .globalsearch input { width: 20rem; margin: 0; }
  :is([data-menu=side], [data-menu=mini]) .tb-tools { margin-left: auto; }
  :is([data-menu=side], [data-menu=mini]) #mainnav { position: fixed; top: var(--top-h); left: 0; bottom: 0; width: var(--side-w); z-index: 1;
      display: flex; flex-direction: column; flex-wrap: nowrap; gap: 2px; padding: .75rem .6rem 1.5rem; overflow-y: auto;
      background: var(--side-bg, var(--surface)); border-right: 1px solid var(--side-line, var(--line)); }
  :is([data-menu=side], [data-menu=mini]) #mainnav a { display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem;
      border-radius: var(--side-item-radius, 8px); color: var(--side-text, var(--text)); white-space: nowrap; }
  :is([data-menu=side], [data-menu=mini]) #mainnav a:hover { background: var(--side-hover, var(--bg)); text-decoration: none; }
  :is([data-menu=side], [data-menu=mini]) #mainnav a.on { background: var(--side-active-bg, color-mix(in srgb, var(--accent) 12%, transparent));
      color: var(--side-active-text, var(--accent)); box-shadow: var(--side-active-mark, none); }
  :is([data-menu=side], [data-menu=mini]) #mainnav .ic { display: block; }
  :is([data-menu=side], [data-menu=mini]) .nav-sec { display: block; padding: 1rem .75rem .35rem; font-size: .72rem; font-weight: 600;
      letter-spacing: var(--side-sec-spacing, .06em); text-transform: var(--side-sec-case, uppercase); color: var(--side-muted, var(--muted)); white-space: nowrap; }
  [data-menu=mini] #mainnav { padding-left: .5rem; padding-right: .5rem; }
  [data-menu=mini] #mainnav a { justify-content: center; padding: .6rem 0; }
  [data-menu=mini] #mainnav a span, [data-menu=mini] .topbar .brand span { display: none; }
  [data-menu=mini] .nav-sec { font-size: 0; padding: 0; margin: .5rem .35rem; border-top: 1px solid var(--line); }
  [data-menu=mini] .topbar .brand { padding: 0 .5rem; justify-content: center; }
  [data-menu=mini] .brand .logo { max-width: 100%; }
}

/* Auf dem Handy: Symbole und Abschnitte in der Schublade, Darstellung über die Schublade */
@media (max-width: 1000px) {
  .topbar #mainnav a { display: flex; align-items: center; gap: .7rem; }
  #mainnav .ic { display: block; }
  .nav-sec { display: block; padding: .8rem .7rem .25rem; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .tb-tools .bell { order: 0; width: 38px; border: 0; }
}
@media (max-width: 720px) {
  .tb-look, .tb-lang { display: none; }
}

/* Darstellungs-Panel von rechts */
.look-shade { display: none; position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.3); }
.look-open .look-shade { display: block; }
.look-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 71; width: min(92vw, 360px); overflow-y: auto; padding: 0 1.25rem 1.5rem;
              background: var(--surface); color: var(--text); box-shadow: -8px 0 24px rgba(0,0,0,.18);
              transform: translateX(105%); visibility: hidden; transition: transform .2s ease, visibility .2s; }
.look-panel.open { transform: none; visibility: visible; }
.look-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
             padding: 1rem 0 .75rem; margin-bottom: .25rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.look-head strong { font-size: 1.05rem; }
.look-head .tb-btn { color: var(--text); }
.look-form { margin: 0; }
.look-group { border: 0; padding: 0; margin: 1rem 0 0; min-width: 0; }
.look-group legend { padding: 0; margin-bottom: .5rem; font-weight: 600; font-size: .9rem; }
.look-group .sub { font-size: .8rem; margin-top: .4rem; }
.look-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
label.look-choice { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .35rem;
               padding: .55rem .35rem; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
               font-size: .82rem; text-align: center; color: var(--text); }
.look-choice:hover { border-color: var(--muted); }
.look-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.look-choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); color: var(--accent); font-weight: 600; }
.look-choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.look-row:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.look-note { margin-top: 1.25rem; font-size: .8rem; }
/* Bildchen: helle und dunkle Seite, deshalb feste Farben */
.look-pic { position: relative; display: block; width: 64px; height: 42px; overflow: hidden; border: 1px solid #d5dae2; border-radius: 6px; background: #fff; }
.look-pic i, .look-pic b, .look-pic s { position: absolute; display: block; text-decoration: none; }
.look-pic s { left: 26px; right: 8px; top: 17px; height: 4px; border-radius: 2px; background: var(--accent); box-shadow: 0 8px 0 #dde1e8, 0 16px 0 #dde1e8; }
.look-pic-side i { left: 0; top: 0; bottom: 0; width: 18px; background: #c9d1dd; }
.look-pic-side b { left: 18px; right: 0; top: 0; height: 8px; background: #f1f3f7; }
.look-pic-mini i { left: 0; top: 0; bottom: 0; width: 7px; background: #c9d1dd; }
.look-pic-mini b { left: 7px; right: 0; top: 0; height: 8px; background: #f1f3f7; }
.look-pic-mini s { left: 14px; }
.look-pic-top i { left: 0; right: 0; top: 0; height: 9px; background: #c9d1dd; }
.look-pic-top s { left: 8px; }
.look-pic-work i { left: 0; top: 0; bottom: 0; width: 6px; background: #1d2330; }
.look-pic-work b { left: 6px; top: 0; bottom: 0; width: 14px; background: #e3e6eb; }
.look-pic-work s { left: 26px; }
.look-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 46px; height: 32px; }
.look-lists i { display: block; border-radius: 2px; background: color-mix(in srgb, var(--muted) 35%, transparent); }
.look-lists-table { grid-template-columns: 1fr; }
.look-lists-table i { height: 4px; }
.look-pic-system { background: linear-gradient(135deg, #fff 50%, #1d2129 50%); }
.look-pic-dark { background: #1d2129; border-color: #2e3440; }
.look-pic-system i, .look-pic-light i, .look-pic-dark i { left: 0; right: 0; top: 0; height: 9px; background: rgba(127,127,127,.25); }
.look-pic-system b, .look-pic-light b, .look-pic-dark b { left: 8px; top: 17px; width: 30px; height: 4px; border-radius: 2px; background: var(--accent); }
.look-aa { display: flex; align-items: flex-end; height: 1.7rem; font-weight: 600; line-height: 1; }
.look-aa-normal { font-size: 1rem; }
.look-aa-large { font-size: 1.25rem; }
.look-aa-xlarge { font-size: 1.55rem; }
.look-lines { display: flex; flex-direction: column; justify-content: center; width: 34px; height: 1.7rem; }
.look-lines i { display: block; height: 2px; background: currentColor; opacity: .55; border-radius: 1px; }
.look-lines-compact { gap: 3px; }
.look-lines-normal { gap: 5px; }
.look-lines-airy { gap: 8px; }
.look-acts { display: flex; flex-direction: column; justify-content: center; gap: 3px; width: 34px; height: 1.7rem; }
.look-acts i { display: block; height: 2px; background: currentColor; opacity: .55; border-radius: 1px; }
.look-acts-preview i:first-child { height: 3px; opacity: .9; width: 70%; }
.look-acts-preview i:nth-child(3) { width: 60%; }
.look-acts-lines { gap: 6px; }
.look-acts-lines i { height: 3px; opacity: .75; }
.card .look-group:first-of-type { margin-top: 0; }

/* ---------- Stil der Oberfläche (0.47, seit 0.393 nur noch „Standard“ = data-style=modern) ----------
   Farben kommen aus der Vorlage (Administration → Design); data-radius und data-typeface überschreiben Ecken und
   Schrift. */
button, .button { border-radius: var(--r-btn, 6px); }
input, select, textarea { border-radius: var(--r-input, 6px); }
.card, .stat, table.list { box-shadow: var(--card-shadow, none); border-color: var(--card-line, var(--line)); }
table.list th { text-transform: var(--th-case, none); letter-spacing: var(--th-spacing, normal); background: var(--th-bg, transparent); }
h1 { font-weight: var(--h-weight, 700); letter-spacing: var(--h-spacing, normal); }

/* ---------- Bausteine für Kennzahlen und Kartenköpfe (0.297) ----------
   In jedem Stil nutzbar; der Stil „Standard“ (modern) gibt ihnen Schatten und Farbe. Farben hue-1 … hue-6
   kennzeichnen Firmen oder Gruppen reihum, gleich in Kachel, Punkt und Balken. */
/* Farben hue-1 … hue-6 stehen in der Ebene tokens (oben). */
.hue-1 { --hue: var(--hue-1); } .hue-2 { --hue: var(--hue-2); } .hue-3 { --hue: var(--hue-3); }
.hue-4 { --hue: var(--hue-4); } .hue-5 { --hue: var(--hue-5); } .hue-6 { --hue: var(--hue-6); }
.metric-v { font-size: 1.45rem; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.metric-bar { display: flex; gap: 3px; height: 6px; margin-top: .45rem; }
.metric-bar i { display: block; min-width: 4px; border-radius: 3px; background: var(--hue, var(--accent)); }
.metric-bar i.rest { min-width: 0; background: color-mix(in srgb, var(--muted) 22%, transparent); }
.metric-v .stage-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; vertical-align: middle; }
.meter { display: inline-block; vertical-align: middle; width: 4rem; height: 6px; margin-right: .6rem;
         border-radius: 3px; background: color-mix(in srgb, var(--muted) 22%, transparent); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--hue, var(--accent)); }
.co-dot { display: inline-block; width: .55rem; height: .55rem; margin-right: .5rem; border-radius: 2px; background: var(--hue, var(--muted)); }
.tag { display: inline-block; padding: .05rem .45rem; border-radius: 6px; font-size: .8rem; white-space: nowrap;
       background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--text); }
/* Symbol im Kartenkopf; sichtbar im Stil „Standard“ (unten) */
.h-ic { display: none; }
.h-ic .ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Stil „Standard“ (Schlüssel modern, Vorgabe seit 0.297): weiche Schatten, Kartenköpfe mit Symbol und Anzahl,
   ruhige Tabellen, Plaketten statt Rahmen. Der frühere Standard heißt „Klassisch“. */
[data-style=modern] {
  --font: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 12px; --r-btn: 8px; --r-input: 8px;
  --card-line: color-mix(in srgb, var(--line) 80%, transparent);
  --card-shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.04);
  --side-item-radius: 8px; --side-active-bg: color-mix(in srgb, var(--accent) 13%, transparent);
  --h-weight: 650; --h-spacing: -.01em;
}
[data-style=modern] h1 { font-size: 1.55rem; }
[data-style=modern] .pagehead + .sub { margin-bottom: .25rem; }
[data-style=modern] #mainnav a.on { font-weight: 600; }
[data-style=modern] .h-ic { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 2rem; height: 2rem; border-radius: 8px; color: var(--hue, var(--accent));
  background: color-mix(in srgb, var(--hue, var(--accent)) 14%, transparent); }
[data-style=modern] .h-ic.ic-alert { --hue: var(--danger); }
[data-style=modern] .h-ic.ic-ok, [data-style=modern] .h-ic.ic-inspection { --hue: var(--ds-green); }
[data-style=modern] .h-ic.ic-delivery { --hue: var(--hue-2); }
[data-style=modern] .h-ic.ic-visit { --hue: var(--hue-3); }
[data-style=modern] .h-ic.ic-photo { --hue: var(--hue-4); }
/* Kartenkopf: Symbol, Titel, Anzahl; durch eine Linie vom Inhalt getrennt */
[data-style=modern] .card > h2:first-child { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap;
  margin: -1rem -1.25rem 1rem; padding: .75rem 1.25rem; border-bottom: 1px solid var(--card-line); font-size: 1.05rem; }
[data-style=modern] .card > h2 .cnt { display: inline-block; min-width: 1.4rem; padding: 0 .4rem; border-radius: 999px; text-align: center;
  font-size: .78rem; font-weight: 500; color: var(--muted); background: color-mix(in srgb, var(--muted) 14%, transparent); }
[data-style=modern] .card > h2 > .sub { margin-left: auto; font-size: .85rem; font-weight: 500; }
[data-style=modern] main .card + .card, [data-style=modern] .diary-day > .card { margin-top: 1rem; }
[data-style=modern] table.list th { font-weight: 500; font-size: .82rem; }
[data-style=modern] table.list td { padding-top: .6rem; padding-bottom: .6rem; }
[data-style=modern] .card table.list { border: 0; box-shadow: none; border-radius: 0; }
[data-style=modern] .badge { border-color: transparent; background: color-mix(in srgb, var(--muted) 14%, transparent); padding: .05rem .55rem; }
[data-style=modern] .badge.diary-open { background: color-mix(in srgb, var(--ds-amber) 16%, transparent); color: var(--ds-amber); }
[data-style=modern] .badge.kind-hindrance { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
[data-style=modern] .badge.kind-concern { background: color-mix(in srgb, var(--ds-amber) 16%, transparent); color: var(--ds-amber); }
[data-style=modern] .badge.kind-order { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
/* Startseite: Kopf der Kacheln wie Kartenköpfe */
[data-style=modern] .widget { padding: 0; }
[data-style=modern] .widget > header { padding: .65rem 1rem; border-bottom: 1px solid var(--card-line); align-items: center; }
[data-style=modern] .widget > header h2 { margin: 0; }
[data-style=modern] .widget.size-s > header { border-bottom: 0; padding-bottom: 0; }
[data-style=modern] .widget > :not(header) { padding-left: 1rem; padding-right: 1rem; }
[data-style=modern] .widget > :last-child { padding-bottom: .85rem; }
[data-style=modern] .widget > header + * { padding-top: .75rem; }
/* Vorhandene Kacheln der Module (Faktura, Bautagebuch-Auswertung, Vermittlung, Honorare, Systeminfo) wie .metric */
[data-style=modern] :is(.report-tiles .tile, .kpi-tiles .kpi, .stats .stat, .project-fees .kpi, .sys-tile) {
  border-color: var(--card-line); border-radius: var(--radius); box-shadow: var(--card-shadow); background: var(--surface); padding: .8rem 1rem; }
[data-style=modern] :is(.report-tiles .tile, .kpi-tiles .kpi, .stats .stat, .project-fees .kpi) > span:first-child { font-size: .85rem; color: var(--muted); }
[data-style=modern] :is(.report-tiles .tile, .kpi-tiles .kpi, .stats .stat, .project-fees .kpi) strong {
  font-size: 1.45rem; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
[data-style=modern] :is(.report-tiles .tile, .kpi-tiles .kpi, .stats .stat, .project-fees .kpi) small { font-size: .8rem; }
[data-style=modern] :is(.report-tiles, .kpi-tiles) { gap: 1rem; }
[data-style=modern] .sys-tile .bar { height: 6px; }
/* Reiterleiste: flache Reiter, der aktive mit Linie unten */
[data-style=modern] .tabbar { gap: .15rem; padding-top: 0; }
[data-style=modern] .tabbar .tab { border: 0; border-radius: 0; background: none; box-shadow: inset 0 -2px 0 transparent; }
[data-style=modern] .tabbar .tab a { padding: .55rem .2rem .55rem .65rem; color: var(--muted); }
[data-style=modern] .tabbar .tab.current { background: none; box-shadow: inset 0 -2px 0 var(--accent); }
[data-style=modern] .tabbar .tab.current a { color: var(--text); }
[data-style=modern] .tabbar .tab.pinned { border-top: 0; }
/* Bautagebuch: Wetter als Kacheln, Abschluss hervorgehoben */
[data-style=modern] .diary-weather { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); }
[data-style=modern] .diary-weather label { align-items: center; text-align: center; padding: .55rem .5rem; font-size: .8rem;
  border: 1px solid var(--card-line); border-radius: 10px; background: color-mix(in srgb, var(--bg) 60%, var(--surface)); }
[data-style=modern] .diary-weather input, [data-style=modern] .diary-weather select { max-width: none; text-align: center; font-size: 1.15rem;
  font-weight: 650; border-color: transparent; background: transparent; padding: .1rem .2rem; }
[data-style=modern] .diary-weather select { font-size: 1rem; text-align-last: center; }
[data-style=modern] .diary-weather input:focus, [data-style=modern] .diary-weather select:focus { border-color: var(--accent); }
[data-style=modern] .diary-entries li { padding: .5rem 0; }
[data-style=modern] .diary-photos img { border-radius: 10px; }
[data-style=modern] .diary-closing-open { border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }

/* Ecken und Schrift aus Administration → Design (nach den Stilen, damit sie gewinnen) */
[data-radius=square] { --radius: 3px; --r-btn: 3px; --r-input: 3px; --side-item-radius: 3px; }
[data-radius=round] { --radius: 18px; --r-btn: 999px; --r-input: 12px; --side-item-radius: 999px; }
[data-typeface=system] { --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[data-typeface=sans] { --font: Arial, Helvetica, "Liberation Sans", sans-serif; }
[data-typeface=serif] { --font: Georgia, Cambria, "Times New Roman", serif; }

/* Auswahl der Vorlage unter Administration → Design */
.pick-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; margin: .5rem 0 1.25rem; }
label.pick-card { position: relative; display: flex; flex-direction: column; gap: .2rem; padding: .7rem; margin: 0; cursor: pointer;
                  border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); }
label.pick-card:hover { border-color: var(--muted); }
.pick-card input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pick-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pick-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pick-card strong { margin-top: .35rem; }
.pick-card .sub { font-size: .82rem; }
/* Bildchen, feste Farben, weil sie die Vorlage zeigen und nicht der aktuellen Darstellung folgen */
.pick-pic { position: relative; display: block; height: 64px; border-radius: 6px; overflow: hidden; border: 1px solid #d5dae2; background: #f6f7f9; }
.pick-pic i, .pick-pic b, .pick-pic s { position: absolute; display: block; text-decoration: none; }
.pick-pic i { left: 0; top: 0; bottom: 0; width: 22%; background: #fff; border-right: 1px solid #e3e6eb; }
.pick-pic b { left: 30%; right: 8%; top: 16px; height: 26px; background: #fff; border-radius: 4px; border: 1px solid #e3e6eb; }
.pick-pic s { right: 8%; top: 46px; width: 18%; height: 8px; border-radius: 3px; background: #c2410c; }
.pick-tpl-dark { background: #14171c; border-color: #2e3440; }
.pick-tpl-dark i, .pick-tpl-dark b { background: #1d2129; border-color: #2e3440; }
.pick-tpl-dark s { background: #da8d6d; }
.pick-tpl-custom s { background: linear-gradient(90deg, #0f6e74, #2563eb, #c2410c); }
.pick-tpl-custom i { background: #12343b; border-color: #12343b; }

/* ---------- Übersicht und Anmeldeseite (0.48) ---------- */
/* Begrüßung oben auf der Übersicht, Farbverlauf aus der Akzentfarbe */
/* Kennzahlen mit Zuwachs und kleinem Diagramm */
.kpi .kpi-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; color: var(--text); font-size: inherit; }
.kpi .kpi-trend { font-style: normal; font-size: .78rem; font-weight: 600; padding: .05rem .4rem; border-radius: 6px;
                  color: var(--ds-green); border: 1px solid color-mix(in srgb, var(--ds-green) 45%, transparent);
                  background: color-mix(in srgb, var(--ds-green) 10%, transparent); }
.kpi .spark { display: block; width: 100%; height: 40px; margin-top: .5rem; color: var(--accent); }
.spark polyline { fill: none; stroke: currentColor; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark polygon { fill: currentColor; opacity: .12; stroke: none; }

/* Anmeldeseite, schlicht (0.71): Logo mittig über der Karte, kein Bild an der Seite, Sprachen als Flaggen */
.auth-page { min-height: 100vh; background: var(--bg); }
.auth-page .auth { max-width: 400px; margin: 0 auto; padding: 12vh 16px 2rem; }
.auth-page .auth > .brand { margin: 0 0 1.5rem; }
.auth-page .auth-hello { text-align: center; color: var(--muted); margin: -.75rem 0 1.25rem; }
.auth-page .auth .card { padding: 1.75rem; box-shadow: var(--card-shadow, 0 8px 30px rgba(0,0,0,.06)); }
.auth-page .auth h1 { font-size: 1.4rem; margin: 0 0 1.25rem; }
.auth-page .entra-login { display: flex; width: 100%; justify-content: center; align-items: center; gap: .6rem; padding: .7rem 1rem;
  font-weight: 600; background: var(--surface); color: var(--text); border: 1px solid var(--line); box-sizing: border-box; }
.auth-or { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .85rem; margin: 1rem 0; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.auth-page .auth .actions { flex-direction: column; align-items: stretch; text-align: center; }
.auth-page .auth .actions button { width: 100%; }
.flags { display: flex; justify-content: center; gap: .9rem; margin-top: 1.25rem; }
.flags a { display: inline-flex; padding: 3px; border-radius: 5px; border: 2px solid transparent; opacity: .55; }
.flags a:hover, .flags a:focus-visible { opacity: 1; }
.flags a.active { border-color: var(--accent); opacity: 1; }
.flags .flag { display: block; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
@media (max-width: 600px) { .auth-page .auth { padding-top: 6vh; } }

/* ---------- Menügruppen und Suche mit Treffern (0.49) ---------- */
/* Gruppen (Daten, Arbeit, Weiteres): in Seitenleiste und Schublade nur Abschnittsüberschriften */
.nav-group, .nav-items { display: contents; }
button.nav-sec { background: none; border: 0; margin: 0; width: 100%; text-align: left; font-family: inherit; line-height: inherit;
                 color: inherit; cursor: default; pointer-events: none; border-radius: 0; box-shadow: none; }
#mainnav .ic.nav-chev, #mainnav .nav-cur { display: none; }
/* Suche: Treffer beim Tippen unter dem Feld */
.globalsearch { position: relative; }
.gs-sugg { position: absolute; top: calc(100% + .4rem); left: 0; width: max(100%, min(30rem, calc(100vw - 2rem))); max-height: 70vh; overflow-y: auto;
           z-index: 46; padding: .35rem; background: var(--surface); color: var(--text); border: 1px solid var(--line);
           border-radius: var(--radius); box-shadow: 0 14px 34px rgba(0,0,0,.16); text-align: left; }
.gs-sugg[hidden] { display: none; }
.gs-sec { padding: .55rem .6rem .2rem; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.topbar .gs-hit { display: flex; align-items: center; gap: .7rem; padding: .45rem .6rem; border-radius: 7px; color: var(--text); min-width: 0; }
.topbar .gs-hit:hover, .topbar .gs-hit.hl { background: var(--bg); text-decoration: none; }
.gs-hit .ic { color: var(--muted); }
.gs-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-hit small { margin-left: auto; padding-left: 1rem; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.gs-sugg mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.gs-empty { margin: 0; padding: .55rem .6rem; color: var(--muted); }
.gs-foot { display: flex; align-items: center; gap: 1rem; margin-top: .35rem; padding: .5rem .6rem .25rem; border-top: 1px solid var(--line);
           font-size: .8rem; color: var(--muted); }
.gs-foot a { margin-left: auto; }
.gs-foot kbd { font: .72rem system-ui, sans-serif; border: 1px solid var(--line); border-radius: 4px; padding: 0 .3rem; }
@media (max-width: 720px) { .gs-foot span { display: none; } }

/* Menü oben: Übersicht und Gruppen mit aufklappender Liste, rechts Sprache, Suche und Werkzeuge */
@media (min-width: 1001px) {
  [data-menu=top] .topbar { gap: .5rem; flex-wrap: nowrap; }
  [data-menu=top] .topbar .brand { margin-right: 1rem; flex: 0 0 auto; }
  [data-menu=top] #mainnav { display: flex; flex-wrap: nowrap; align-items: center; gap: .15rem; flex: 0 0 auto; }
  [data-menu=top] #mainnav > a, [data-menu=top] #mainnav .nav-sec {
      display: inline-flex; align-items: center; gap: .4rem; width: auto; padding: .45rem .75rem; border-radius: var(--r-btn, 8px);
      color: var(--header-text, var(--text)); white-space: nowrap; font-size: inherit; font-weight: 500; text-transform: none;
      letter-spacing: normal; pointer-events: auto; cursor: pointer; line-height: 1.4; }
  [data-menu=top] #mainnav > a:hover, [data-menu=top] #mainnav .nav-sec:hover { background: color-mix(in srgb, currentColor 8%, transparent); text-decoration: none; }
  [data-menu=top] #mainnav > a.on, [data-menu=top] #mainnav .nav-group.has-on > .nav-sec {
      background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--header-link, var(--accent)); font-weight: 600; }
  [data-menu=top] #mainnav > a .ic { display: block; }
  [data-menu=top] #mainnav .nav-cur { display: inline; }
  [data-menu=top] #mainnav .ic.nav-chev { display: block; width: 16px; height: 16px; margin-left: -.1rem; transition: transform .15s; }
  [data-menu=top] #mainnav .nav-group.open > .nav-sec .nav-chev { transform: rotate(180deg); }
  [data-menu=top] .nav-group { display: block; position: relative; }
  [data-menu=top] .nav-items { display: none; }
  [data-menu=top] .nav-group.open > .nav-items {
      display: flex; flex-direction: column; position: absolute; top: calc(100% + .5rem); left: 0; z-index: 45; min-width: 230px; padding: .35rem;
      background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 30px rgba(0,0,0,.14); }
  [data-menu=top] .topbar .nav-items a { display: flex; align-items: center; gap: .7rem; padding: .5rem .7rem; border-radius: 7px; color: var(--text); white-space: nowrap; }
  [data-menu=top] .topbar .nav-items a:hover, [data-menu=top] .topbar .nav-items a:focus-visible { background: var(--bg); text-decoration: none; outline: none; }
  [data-menu=top] .topbar .nav-items a.on { color: var(--accent); font-weight: 600; }
  [data-menu=top] #mainnav .nav-items a .ic { display: block; }
  [data-menu=top] .nav-items a.nav-extra { display: none; }
  /* Sehr große Schrift: Name des aktuellen Bereichs und eigener Name entfallen, damit die Zeile passt */
  [data-menu=top][data-font=xlarge] #mainnav .nav-cur, [data-menu=top][data-font=xlarge] .um-name { display: none; }
  /* Werkzeuge rechts: Sprache, Suche, dann Benachrichtigungen, Darstellung und Benutzermenü */
  [data-menu=top] .tb-tools { display: contents; }
  [data-menu=top] .tb-tools > * { order: 3; }
  [data-menu=top] .tb-tools > .tb-lang { order: 1; margin-left: auto; }
  [data-menu=top] .globalsearch { order: 2; margin-left: auto; flex: 0 1 200px; width: 200px; min-width: 8rem; }
  [data-menu=top] .topbar:has(.tb-lang) .globalsearch { margin-left: 0; }
  /* Lupe im Feld; !important, weil die Stile (z. B. Material) den Hintergrund der Felder setzen */
  [data-menu=top] .topbar .globalsearch input[type=search] { width: 100%; max-width: none; margin: 0; padding-left: 2.1rem !important; background-repeat: no-repeat !important;
      background-position: .7rem 50% !important; background-size: 16px !important;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") !important; }
  /* Aufgeklappt: Feld und Treffer reichen vom Logo bis vor die Benachrichtigungen; der Platz bleibt frei, damit nichts springt */
  [data-menu=top] .globalsearch.wide { position: static; }
  [data-menu=top] .topbar .globalsearch.wide input[type=search] { position: absolute; left: var(--gs-left); right: var(--gs-right); top: 50%; transform: translateY(-50%);
      width: auto; z-index: 46; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); outline: none; }
  [data-menu=top] .globalsearch.wide .gs-sugg { left: var(--gs-left); right: var(--gs-right); width: auto; top: calc(50% + 1.6rem); }
}
/* Menü oben auf kleineren Bildschirmen: erst Bereichsname und eigener Name, dann Texte von Logo und Übersicht weglassen */
@media (min-width: 1001px) and (max-width: 1399px) {
  [data-menu=top] #mainnav .nav-cur, [data-menu=top] .um-name { display: none; }
  [data-menu=top] .usermenu summary::after { display: none; }
}
@media (min-width: 1001px) and (max-width: 1150px) {
  [data-menu=top] #mainnav > a:not([data-group]) span, [data-menu=top] .topbar .brand span { display: none; }
  [data-menu=top] .topbar .brand { margin-right: .25rem; }
}

/* ---------- Hauptmenü nach Bereichen (0.61) ---------- */
/* Abschnittsüberschrift „Daten“ nur in Seitenleiste und Schublade */
#mainnav .nav-hd { pointer-events: none; }
/* Bereich mit Unterpunkten (Firmen › Alle Firmen, Kontakte): Kopf wie ein Menüpunkt, Unterpunkte eingerückt */
@media (min-width: 1001px) {
  [data-menu=top] #mainnav .nav-hd { display: none; }
  [data-menu=top] #mainnav > a[data-group] .ic, [data-menu=top] #mainnav .nav-tree > .nav-sec .ic:not(.nav-chev) { display: none; }
  [data-menu=side] #mainnav .nav-tree > .nav-sec { display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem; margin-top: .15rem;
      font-size: inherit; font-weight: 600; letter-spacing: normal; text-transform: none; color: var(--side-text, var(--text)); }
  [data-menu=side] #mainnav .nav-tree > .nav-sec .ic:not(.nav-chev) { display: block; }
  [data-menu=side] #mainnav .nav-tree.has-on > .nav-sec { color: var(--side-active-text, var(--accent)); }
  [data-menu=side] #mainnav .nav-tree .nav-items a { position: relative; margin-left: 1.6rem; padding-top: .4rem; padding-bottom: .4rem; }
  [data-menu=side] #mainnav .nav-tree .nav-items a::before { content: ""; position: absolute; left: -.55rem; top: 0; bottom: 0;
      border-left: 1px solid var(--side-line, var(--line)); }
  [data-menu=side] #mainnav .nav-tree .nav-items a .ic { display: none; }
  /* Schmal: Kopf als Trennlinie, Unterpunkte mit Symbol */
  [data-menu=mini] #mainnav .nav-hd, [data-menu=mini] #mainnav .nav-sec .ic { display: none; }
}
@media (max-width: 1000px) {
  .topbar #mainnav .nav-tree > .nav-sec { display: flex; align-items: center; gap: .7rem; padding: .65rem .7rem; font-size: 1.05rem; font-weight: 600;
      letter-spacing: normal; text-transform: none; color: var(--text); }
  .topbar #mainnav .nav-tree > .nav-sec .ic:not(.nav-chev) { display: block; }
  .topbar #mainnav .nav-tree .nav-items a { position: relative; margin-left: 1.5rem; }
  .topbar #mainnav .nav-tree .nav-items a::before { content: ""; position: absolute; left: -.5rem; top: 0; bottom: 0; border-left: 1px solid var(--line); }
  .topbar #mainnav .nav-tree .nav-items a .ic { display: none; }
}
/* Administration → Design → Hauptmenü */
.menu-editor .menu-list { max-width: 40rem; }
.menu-editor .menu-list > li.menu-grp { display: block; padding: .4rem .5rem; }
.menu-editor .menu-row, .menu-editor .menu-items li { display: flex; align-items: center; gap: .5rem; }
.menu-editor .menu-row .muted { font-size: .85rem; color: var(--muted); }
.menu-editor .menu-items { margin: .35rem 0 .1rem 1.6rem; max-width: none; }
.menu-editor .menu-items:empty { display: none; }
.menu-editor .menu-items select { width: auto; margin: 0; padding: .2rem .4rem; font-size: .85rem; }
/* Grundeinstellungen → Menü: Editor links, Vorschau der Seitenleiste rechts */
.menu-page { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 1rem; align-items: start; }
.menu-page .menu-editor .menu-list { max-width: none; }
.menu-page .menu-row { flex-wrap: wrap; }
.menu-page .menu-grip { cursor: grab; color: var(--muted); letter-spacing: -.15em; padding: 0 .2rem; user-select: none; }
.menu-page .menu-ic { display: inline-flex; width: 1.1rem; color: var(--muted); }
.menu-page .menu-ic svg { width: 1.1rem; height: 1.1rem; }
.menu-page .menu-name { width: 14rem; max-width: 100%; margin: 0; padding: .2rem .45rem; font-weight: 600; }
.menu-page .form label.menu-show, .menu-page label.menu-show { display: inline-flex; flex-direction: row; align-items: center; gap: .3rem; font-size: .85rem; color: var(--muted); margin: 0; white-space: nowrap; }
.menu-page .menu-show input { width: auto; margin: 0; }
.menu-page li.menu-grp.drop-on { outline: 2px dashed var(--accent); outline-offset: 2px; }
.menu-page li.dragging { opacity: .5; }
.menu-page [data-menu-remove]:disabled { opacity: .35; cursor: not-allowed; }
.menu-page .menu-more { border: 1px solid var(--line); border-radius: var(--radius, 6px); padding: .5rem; margin-top: .5rem; max-width: none; }
.menu-page .menu-more .menu-row { display: flex; align-items: center; gap: .5rem; }
.menu-page .menu-more .menu-items li { display: flex; align-items: center; gap: .5rem; }
.menu-page .menu-more .sub { margin: .4rem 0 0; }
.menu-preview { position: sticky; top: 1rem; }
.menu-preview h2 { margin-top: 0; }
.mp-nav { display: flex; flex-direction: column; gap: .1rem; font-size: .875rem; }
.mp-item, .mp-head { display: flex; align-items: center; gap: .5rem; padding: .25rem .4rem; border-radius: 4px; }
.mp-item svg, .mp-head svg { width: 1rem; height: 1rem; flex: none; color: var(--muted); }
.mp-head.mp-sec { margin-top: .6rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.mp-head.mp-tree { font-weight: 600; }
.mp-item.mp-sub { padding-left: 1.9rem; }
@media (max-width: 900px) {
  .menu-page { grid-template-columns: minmax(0, 1fr); }
  .menu-preview { position: static; }
  .menu-page .menu-items li { flex-wrap: wrap; }
  .menu-page .menu-items { margin-left: .5rem; }
  .menu-page .menu-name { width: 10rem; }
}

/* Kalender (0.66): Monat, Woche, Arbeitswoche, Tag, Liste */
.cal-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cal-head h1 { margin: 0; flex: 1; font-size: 1.4rem; min-width: 12rem; }
.cal-head h1 .sub { font-size: .95rem; font-weight: 500; }
.cal-step { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem;
            border-radius: var(--radius); font-size: 1.4rem; }
.cal-step:hover { background: var(--surface); }
.cal-views { display: flex; flex-wrap: wrap; border: 1px solid var(--accent); border-radius: var(--radius); overflow: hidden; }
.cal-views a { padding: .4rem .8rem; color: var(--text); }
.cal-views a + a { border-left: 1px solid var(--line); }
.cal-views a.active { background: var(--accent); color: var(--accent-text); }
.cal-chip { display: block; width: 100%; text-align: left; font: inherit; font-size: .8rem; line-height: 1.3; cursor: pointer;
            padding: .1rem .4rem; border: 0; border-radius: 4px; background: transparent; color: var(--text);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip::before { content: ""; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%;
                    background: var(--accent); margin-right: .3rem; vertical-align: middle; }
.cal-chip:hover { background: var(--bg); }
.cal-chip.allday { background: var(--accent); color: var(--accent-text); }
.cal-chip.allday::before { display: none; }
.cal-chip.cancelled, .cal-ev.cancelled { text-decoration: line-through; opacity: .6; }
.cal-time { color: var(--muted); }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line);
             border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.cal-month-head { background: var(--surface); padding: .4rem .5rem; font-size: .8rem; color: var(--muted); font-weight: 600; }
.cal-cell { background: var(--surface); min-height: 6.5rem; padding: .3rem; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-cell.out { background: var(--bg); }
.cal-cell.out .cal-num { color: var(--muted); }
.cal-num { align-self: flex-start; font-size: .85rem; font-weight: 600; color: var(--text); padding: 0 .35rem; border-radius: 999px; }
.cal-cell.today .cal-num { background: var(--accent); color: var(--accent-text); }
.cal-more { font-size: .78rem; padding: 0 .4rem; }
.cal-grid { --hour: 3rem; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal-grid-head, .cal-body { display: grid; grid-template-columns: 4rem repeat(var(--days), minmax(0, 1fr)); }
.cal-grid-head { border-bottom: 1px solid var(--line); }
.cal-allday-label { font-size: .7rem; color: var(--muted); align-self: end; padding: .4rem .3rem; }
.cal-colhead { border-left: 1px solid var(--line); padding: .4rem; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-colhead > a { font-weight: 600; color: var(--text); font-size: .9rem; }
.cal-colhead.today > a { color: var(--accent); }
.cal-scroll { max-height: 70vh; overflow-y: auto; }
.cal-body { height: calc(24 * var(--hour)); position: relative; }
.cal-hours { position: relative; }
.cal-hours span { position: absolute; right: .4rem; font-size: .7rem; color: var(--muted); transform: translateY(-50%); }
.cal-hours span:first-child { display: none; }
.cal-col { position: relative; border-left: 1px solid var(--line);
           background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) - 1px), var(--line) calc(var(--hour) - 1px), var(--line) var(--hour)); }
.cal-col.weekend { background-color: var(--bg); }
.cal-ev { position: absolute; box-sizing: border-box; padding: .15rem .35rem; border: 1px solid var(--surface); border-radius: 5px;
          background: var(--accent); color: var(--accent-text); font: inherit; font-size: .75rem; line-height: 1.3;
          text-align: left; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.cal-ev > * { flex-shrink: 0; }
.cal-ev span { opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.filed strong::after { content: " ✓"; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); pointer-events: none; }
.cal-pop { max-width: min(32rem, calc(100vw - 2rem)); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.cal-pop::backdrop { background: rgba(0,0,0,.2); }
.cal-pop h2 { margin-top: 0; }
.cal-close { display: block; margin-top: .75rem; }
.cal-list + .sub, .cal-month + .sub, .cal-grid + .sub, .cal-pop ~ .sub { margin-top: .75rem; }
/* Kalender von Kollegen: eine Farbe je Person (p0 = ich) */
.p0 { --pc: var(--accent); } .p1 { --pc: #0f9d76; } .p2 { --pc: #9c36b5; } .p3 { --pc: #c2255c; } .p4 { --pc: #1098ad; }
.p5 { --pc: #a16207; } .p6 { --pc: #5f3dc4; } .p7 { --pc: #2b8a3e; } .p8 { --pc: #868e96; }
.cal-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--pc, var(--accent));
           vertical-align: middle; margin-right: .3rem; }
.cal-chip::before { background: var(--pc, var(--accent)); }
.cal-chip.allday { background: var(--pc, var(--accent)); }
.cal-ev { background: var(--pc, var(--accent)); }
.cal-chip.busy { font-style: italic; color: var(--muted); }
.cal-ev.busy { background: repeating-linear-gradient(135deg, var(--surface) 0 6px, var(--bg) 6px 12px);
               color: var(--text); border: 1px solid var(--pc, var(--accent)); border-left-width: 4px; }
.cal-people { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; margin: -.4rem 0 1rem; font-size: .9rem; }
.cal-person { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.cal-person .sub { font-size: .8rem; }
.cal-person[data-access=none], .cal-person[data-access=failed] { opacity: .75; }
.cal-toggle { white-space: nowrap; }
.cal-find { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-left: auto; }
.cal-find label { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-weight: 500; }
.cal-find select { width: auto; }
.cal-slots { margin-bottom: 1rem; }
.cal-slots h2 { margin-top: 0; font-size: 1.05rem; }
.cal-slots ul { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0 0 .5rem; }
.cal-slots li a { display: inline-block; padding: .3rem .7rem; border: 1px solid var(--accent); border-radius: 999px; }
.cal-slots li a:hover { background: var(--accent); color: var(--accent-text); }
.cal-colhead .cal-person { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; }
/* Teams-Besprechungen (0.78): Kamerasymbol, eigene Termine in Teams-Lila */
.cal-ev.teams.p0, .cal-chip.teams.p0 { --pc: #5b5fc7; }
.cal-teams-icon { vertical-align: -2px; margin-right: .25rem; flex-shrink: 0; }
.cal-chip.teams::before { display: none; }
.cal-chip.teams:not(.allday) .cal-teams-icon { color: var(--pc, var(--accent)); }
.cal-teams-badge { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .6rem; border-radius: 999px;
                   background: color-mix(in srgb, #5b5fc7 15%, var(--surface)); color: var(--text); font-size: .8rem; font-weight: 600; }
.cal-pop.teams { border-top: 4px solid #5b5fc7; }
.button.cal-join { background: #5b5fc7; border-color: #5b5fc7; color: #fff; display: inline-flex; align-items: center; gap: .3rem; }
/* Verschieben per Ziehen (0.78) */
.cal-ev.movable, .cal-chip[data-move] { cursor: grab; touch-action: none; }
.cal-ev.movable::after { content: ""; position: absolute; left: 30%; right: 30%; bottom: 2px; height: 3px; border-radius: 2px;
                         background: currentColor; opacity: 0; }
.cal-ev.movable:hover::after { opacity: .5; }
.cal-ev.dragging, .cal-chip.dragging { opacity: .35; outline: 2px dashed var(--pc, var(--accent)); outline-offset: -2px; }
.cal-ghost { position: absolute; left: 2px; right: 2px; z-index: 5; border-radius: 5px; padding: .15rem .35rem; pointer-events: none;
             background: var(--pc, var(--accent)); color: var(--accent-text); font-size: .75rem; line-height: 1.3; overflow: visible;
             box-shadow: 0 8px 20px rgba(0,0,0,.3); }
.cal-ghost-label { position: absolute; left: 0; top: -1.5rem; padding: .1rem .5rem; border-radius: 999px; background: #111827;
                   color: #fff; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.cal-cell.drop { outline: 2px dashed var(--accent); outline-offset: -3px; }
body.cal-dragging, body.cal-dragging * { cursor: grabbing !important; user-select: none; }
body.cal-resizing, body.cal-resizing * { cursor: ns-resize !important; user-select: none; }
.cal-notice { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .75rem; margin-bottom: 1rem; }
.cal-undo { margin: 0; }
dialog.cal-pop { padding: 1.25rem 1.5rem; color: var(--text); }
dialog.cal-pop::backdrop { background: rgba(0,0,0,.25); }
@media (max-width: 700px) {
  .cal-cell { min-height: 4.5rem; }
  .cal-chip .cal-time { display: none; }
  .cal-grid { --hour: 2.5rem; }
  .cal-views { width: 100%; }
  .cal-views a { flex: 1; text-align: center; padding: .4rem .25rem; font-size: .85rem; }
  .cal-allday-label { font-size: .6rem; }
  .cal-grid-head, .cal-body { grid-template-columns: 2.5rem repeat(var(--days), minmax(0, 1fr)); }
}

/* Termin anlegen mit Terminplanungs-Assistent (0.78) */
.cal-new-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.cal-new-head h1 { flex: 1; margin: 0; }
.cal-new-form { margin-top: 1rem; }
.cal-new-when, .cal-new-opts { align-items: end; }
.cal-teams-check .cal-teams-icon { color: #5b5fc7; }
.cal-plan { margin-top: 1rem; }
.cal-plan-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.cal-plan-head h2 { flex: 1; margin: 0; font-size: 1.05rem; }
.cal-plan-grid { display: grid; grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr); margin-top: .8rem;
                 border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cal-plan-names > *, .cal-plan-lanes > .cal-plan-lane, .cal-plan-hours { height: 2rem; box-sizing: border-box;
                 border-bottom: 1px solid var(--line); }
.cal-plan-names > *:last-child, .cal-plan-lanes > .cal-plan-lane:last-of-type { border-bottom: 0; }
.cal-plan-name { display: flex; align-items: center; gap: .3rem; padding: 0 .6rem; overflow: hidden; white-space: nowrap;
                 text-overflow: ellipsis; font-size: .85rem; border-right: 1px solid var(--line); }
.cal-plan-name.head, .cal-plan-hours { height: 1.6rem; }
.cal-plan-name.all { font-weight: 600; }
.cal-plan-name.opt strong { font-weight: 500; font-style: italic; }
.cal-plan-lanes { position: relative; touch-action: none; cursor: pointer; user-select: none; }
.cal-plan-hours { position: relative; font-size: .72rem; color: var(--muted); }
.cal-plan-hours span { position: absolute; top: .3rem; transform: translateX(-50%); }
.cal-plan-hours span:first-child { transform: none; padding-left: .2rem; }
.cal-plan-lane { position: relative; background:
                 repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / var(--hours, 12) - 1px), var(--line) calc(100% / var(--hours, 12) - 1px), var(--line) calc(100% / var(--hours, 12))); }
.cal-plan-lane.all { background-color: color-mix(in srgb, var(--bg) 60%, transparent); }
.cal-plan-busy { position: absolute; top: .25rem; bottom: .25rem; border-radius: 4px; background: #3b6fd8; color: #fff;
                 font-size: .72rem; padding: 0 .3rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
                 line-height: 1.5rem; box-sizing: border-box; }
.cal-plan-busy.all { background: #6b7280; }
.cal-plan-busy.allday { background: repeating-linear-gradient(45deg, #9db4e8 0 6px, #b8cbf0 6px 12px); color: #1d2330; }
.cal-plan-lane.opt .cal-plan-busy { opacity: .6; }
.cal-plan-info { position: absolute; inset: .25rem; display: block; line-height: 1.5rem; padding: 0 .5rem; font-size: .78rem;
                 white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
                 color: var(--muted); border-radius: 4px;
                 background: repeating-linear-gradient(45deg, transparent 0 6px, color-mix(in srgb, var(--line) 70%, transparent) 6px 12px); }
.cal-plan-sel { position: absolute; top: 1.6rem; bottom: 0; border: 2px solid #0f9d76; border-radius: 4px;
                background: color-mix(in srgb, #0f9d76 14%, transparent); box-sizing: border-box; cursor: grab; }
.cal-plan-grip { position: absolute; right: -5px; top: 0; bottom: 0; width: 10px; cursor: ew-resize; }
.cal-plan-grip::after { content: ""; position: absolute; left: 3px; top: 40%; height: 20%; width: 4px; border-radius: 2px; background: #0f9d76; }
.cal-plan-status { margin: .7rem 0 .3rem; }
.cal-plan-status .busy { color: var(--danger); }
.cal-plan-status .ok { color: #0f7a5c; }
.cal-plan-status a { margin-right: .5rem; }
@media (max-width: 640px) { .cal-plan-grid { grid-template-columns: 7rem minmax(0, 1fr); } }

/* Teilnehmer als Chips mit Live-Suche (0.78) */
.cal-chips { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; padding: .3rem .4rem;
             border: 1px solid var(--line); border-radius: 6px; background: var(--surface); margin-top: .25rem; cursor: text; }
.cal-chips:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.cal-chip-list { display: contents; }
.cal-pchip { display: inline-flex; align-items: center; border-radius: 999px; background: var(--bg); border: 1px solid var(--line);
             font-size: .85rem; max-width: 100%; }
.cal-pchip button { background: none; border: 0; color: var(--text); padding: .15rem .5rem; cursor: pointer; font: inherit; }
.cal-pchip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 16rem; padding-right: .2rem !important; }
.cal-pchip-x { color: var(--muted) !important; padding-left: .1rem !important; }
.cal-pchip-x:hover { color: var(--danger) !important; }
.form .cal-chips-input, .cal-chips-input { flex: 1; min-width: 10rem; border: 0 !important; outline: none; box-shadow: none !important;
             background: transparent; padding: .25rem; margin: 0; font: inherit; color: var(--text); }
.cal-suggest { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 22rem; overflow: auto;
               background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 28px rgba(0,0,0,.18);
               font-size: .9rem; }
.cal-suggest-head { margin: 0; padding: .35rem .8rem; font-size: .75rem; font-weight: 600; color: var(--muted); background: var(--bg); }
.cal-suggest-item { padding: .45rem .8rem; cursor: pointer; line-height: 1.35; }
.cal-suggest-item.active, .cal-suggest-item[data-i]:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.cal-suggest-item.off { cursor: default; color: var(--muted); }
.cal-suggest-item.take { border-top: 1px solid var(--line); color: var(--muted); }
.cal-invitees { display: flex; flex-direction: column; gap: .6rem; }
.cal-invitees > label { width: 100%; }

/* Kontaktliste: mehrere zu einem Termin einladen (0.78) */
.cal-pick-bar { position: sticky; top: .5rem; z-index: 20; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
                margin: .5rem 0 1rem; padding: .6rem 1rem; border-radius: 8px; border: 1px solid var(--line);
                background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.cal-pick-bar strong { flex: 1; }
input.cal-pick { margin: 0 .5rem 0 0; width: 1.05rem; height: 1.05rem; vertical-align: -3px; cursor: pointer; }
.cal-teams-button .cal-teams-icon { color: #5b5fc7; }
.cal-with { margin: .4rem 0 0; font-size: .9rem; }
.cal-with:empty { display: none; }
.cal-with .sub { display: inline; margin-left: .6rem; }

/* Benutzer wechseln: Balken unter der Kopfzeile, solange ein Administrator als anderer Benutzer arbeitet */
.switch-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem 1rem; padding: .45rem 1rem; background: var(--warn-bg); border-bottom: 2px solid var(--danger); font-weight: 600; }
.switch-bar form { margin: 0; }

/* E-Mail-Liste (0.83): Status, Ablage je Bereich, Bild des Absenders, Vorschau beim Überfahren */
:root { --area-co: #1971c2; --area-deal: #2f9e44; --area-rec: #9c36b5; --area-hr: #e8590c; --area-proj: #0c8599; --mail-flag: #e8590c; --mail-red: #e03131; --mail-ok: #2f9e44; }
:root[data-theme=dark] { --area-co: #4dabf7; --area-deal: #51cf66; --area-rec: #da77f2; --area-hr: #ff922b; --area-proj: #3bc9db; --mail-flag: #ff922b; --mail-red: #ff6b6b; --mail-ok: #51cf66; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) { --area-co: #4dabf7; --area-deal: #51cf66; --area-rec: #da77f2; --area-hr: #ff922b; --area-proj: #3bc9db; --mail-flag: #ff922b; --mail-red: #ff6b6b; --mail-ok: #51cf66; }
}
.area-co { --area: var(--area-co); } .area-deal { --area: var(--area-deal); }
.area-rec { --area: var(--area-rec); } .area-hr { --area: var(--area-hr); } .area-proj { --area: var(--area-proj); }
.mail-filters { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .2rem 0 .8rem; }
.mail-filters .grow { flex: 1; }
.mail-filters .mf { border: 1px solid var(--line); border-radius: 999px; padding: .2rem .75rem; font-size: .88rem; color: var(--text); background: var(--surface); }
.mail-filters .mf.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.mail-filters .mf b { margin-left: .3rem; font-weight: 700; }
.mail-filters .mf-view { display: inline-flex; align-items: center; gap: .3rem; font-size: .88rem; }
.mail-filters .mf-view svg, .mail-card .ic svg, .ic-btn svg, .chip svg, .mail-peek .att svg {
  width: 1rem; height: 1rem; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mail-card .ic { display: inline-flex; align-items: center; justify-content: center; width: 1.3rem; height: 1.3rem; color: var(--muted); }
.mail-card .ic[hidden] { display: none; }
.mail-card .ic.red { color: var(--mail-red); }
.mail-card .ic.flag { color: var(--mail-flag); }
.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 500; border-radius: 999px; padding: .05rem .55rem;
        border: 1px solid var(--area, var(--line)); color: var(--area, var(--muted)); background: var(--surface); white-space: nowrap;
        max-width: 18rem; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; }
.chip svg { width: .85rem; height: .85rem; }
.chip b { font-weight: 700; }
button.chip { cursor: pointer; font: inherit; font-size: .78rem; }
.chip.sug { border-style: dashed; }
.chip.sug:hover { background: var(--bg); }
.mail-card .chips { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; }
.mail-card .chips form.inline { display: inline-flex; }
.av { width: 2.3rem; height: 2.3rem; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
      font-size: .85rem; font-weight: 600; color: #fff; background: hsl(var(--hue, 210) 45% 46%); position: relative; }
.av img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.av.logo { border-radius: .45rem; background: var(--surface); border: 1px solid var(--line); }
.av.logo img { object-fit: contain; padding: 2px; }
.av .crm { position: absolute; right: -2px; bottom: -2px; width: .8rem; height: .8rem; border-radius: 50%; background: var(--mail-ok); border: 2px solid var(--surface); }
.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); }
/* zweizeilig */
.mail-rows { list-style: none; margin: 0; padding: 0; }
.mail-rows .mrow { display: grid; grid-template-columns: 4px 2.3rem minmax(0, 1fr) auto; gap: .7rem; align-items: center;
                   padding: .55rem .6rem .55rem 0; border-bottom: 1px solid var(--line); position: relative; }
.mail-rows .mrow:last-child { border-bottom: 0; }
.mail-rows .mrow:hover { background: var(--bg); }
.mail-rows .bar { align-self: stretch; border-radius: 2px; }
.mail-rows .mrow.unread .bar { background: var(--accent); }
.mail-rows .mid, .mail-rows .mid:hover { display: flex; flex-direction: column; min-width: 0; color: var(--text); text-decoration: none; }
.mail-rows .l1 { display: flex; gap: .5rem; align-items: baseline; min-width: 0; }
.mail-rows .from, .mail-rows .subj, .mail-rows .prev, .mail-rows .detail { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-rows .detail { color: var(--muted); font-size: .85rem; }
.mail-rows .prev { color: var(--muted); font-size: .86rem; }
.mail-rows .mrow.unread .from, .mail-rows .mrow.unread .subj { font-weight: 700; }
.mail-rows .right { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; }
.mail-rows .when { font-size: .84rem; color: var(--muted); white-space: nowrap; }
.mail-rows .mrow.unread .when { color: var(--accent); font-weight: 600; }
.mail-rows .icons { display: flex; }
.mail-rows .row-actions { position: absolute; right: .5rem; top: .45rem; display: none; gap: .3rem; background: var(--bg); padding-left: .4rem; }
.mail-rows .mrow:hover .row-actions, .mail-rows .mrow:focus-within .row-actions { display: flex; }
.mail-rows .mrow:hover .when { visibility: hidden; }
.ic-btn { display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; padding: 0; border: 1px solid var(--line);
          border-radius: 6px; background: var(--surface); color: var(--muted); cursor: pointer; }
.ic-btn:hover { color: var(--accent); border-color: var(--accent); }
.ic-btn.on { color: var(--mail-flag); }
/* kompakt */
.mail-list.compact td { vertical-align: middle; }
.mail-list.compact td.st { width: 1.2rem; text-align: center; }
.mail-list.compact tr.unread td { font-weight: 600; }
.mail-list.compact tr.unread td.st { box-shadow: inset 3px 0 0 var(--accent); }
.mail-list.compact td.who { display: flex; align-items: center; gap: .5rem; white-space: nowrap; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; }
.mail-list.compact .av { width: 1.6rem; height: 1.6rem; font-size: .65rem; }
.mail-list.compact .av .crm { width: .6rem; height: .6rem; }
.mail-list.compact td.icons { white-space: nowrap; }
/* Vorschau beim Überfahren */
.mail-peek { position: absolute; z-index: 40; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
             box-shadow: 0 12px 32px rgba(0, 0, 0, .25); padding: .9rem 1rem; }
.mail-peek h4 { margin: .1rem 0 .3rem; font-size: 1rem; }
.mail-peek .meta { color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.mail-peek .txt { font-size: .9rem; line-height: 1.45; border-left: 3px solid var(--line); padding-left: .7rem; margin: .6rem 0; max-height: 12rem; overflow: hidden; }
.mail-peek .att { display: flex; gap: .4rem; flex-wrap: wrap; margin: .5rem 0; }
.mail-peek .att span { display: inline-flex; gap: .25rem; align-items: center; font-size: .8rem; border: 1px solid var(--line); border-radius: 6px; padding: .1rem .5rem; }
.mail-peek .crmbox { background: var(--bg); border-left: 3px solid var(--area, var(--line)); border-radius: 6px; padding: .45rem .6rem; font-size: .86rem; margin: .5rem 0; }
.mail-peek .chips { display: flex; flex-wrap: wrap; gap: .3rem; margin: .4rem 0; }
.mail-peek .acts { display: flex; gap: .4rem; margin-top: .6rem; }
.company-logo { border-radius: .45rem; object-fit: contain; background: var(--surface); border: 1px solid var(--line); }
@media (max-width: 700px) {
  .mail-rows .mrow { grid-template-columns: 4px 2.1rem minmax(0, 1fr) auto; gap: .5rem; }
  .mail-rows .chips, .mail-rows .detail { display: none; }
  .mail-list.compact td.chips, .mail-list.compact td.icons { display: none; }
}
@media (hover: none) { .mail-rows .row-actions { display: none !important; } .mail-rows .mrow:hover .when { visibility: visible; } }

/* Einblendungen für Rückmeldungen (static/toast.js), oben mittig über dem Inhalt */
.toasts { position: fixed; z-index: 1100; top: calc(var(--top-h, 60px) + .75rem); left: 50%; transform: translateX(-50%);
          width: min(520px, calc(100vw - 2rem)); display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.toasts:empty { display: none; }
@media (min-width: 1001px) {
  :is([data-menu=side], [data-menu=mini]) .toasts { left: calc(var(--side-w) + (100vw - var(--side-w)) / 2); }
}
@media (max-width: 1000px) { .toasts { top: 5rem; } }
@media (max-width: 600px) { .toasts { width: calc(100vw - 1.25rem); } }
.toast { --t: var(--ds-green, #15803d); pointer-events: auto; position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: .7rem;
         background: var(--surface); color: var(--text); border: 1px solid var(--line); border-left: 4px solid var(--t);
         border-radius: var(--radius, 10px); padding: .7rem .6rem .8rem .85rem; box-shadow: 0 10px 30px rgba(16,24,40,.16), 0 2px 6px rgba(16,24,40,.08);
         animation: toast-in .18s ease-out; }
.toast-err { --t: var(--danger); }
/* Feld mit Fehler (static/toast.js, field=<name>): deutlich rot, bis es geändert wird */
.field-error, input.field-error, select.field-error, textarea.field-error { border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent) !important; }
button.field-error { outline: 3px solid color-mix(in srgb, var(--danger) 45%, transparent); outline-offset: 2px; }
.toast-info { --t: var(--accent); }
.toast-icon { flex: 0 0 auto; width: 1.4rem; height: 1.4rem; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700;
              color: var(--t); background: color-mix(in srgb, var(--t) 14%, transparent); margin-top: .05rem; }
.toast-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-body form { display: inline; margin: 0 0 0 .5rem; }
.toast-body button.link, .toast-body .cal-undo button { font-weight: 600; border: 1px solid var(--accent); border-radius: 6px; padding: .1rem .55rem; }
.toast-close { flex: 0 0 auto; background: none; border: 0; color: var(--muted); font-size: 1.2rem; line-height: 1; padding: .1rem .35rem; cursor: pointer; border-radius: 6px; }
.toast-close:hover { color: var(--text); background: var(--bg); }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--t); opacity: .55; transform-origin: left;
             animation: toast-bar linear forwards; }
.toast.paused .toast-bar { animation-play-state: paused; }
.toast.out { opacity: 0; transform: translateY(-6px); transition: opacity .2s, transform .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } .toast.out { transition: none; } }
@media print { .toasts { display: none; } }
/* Vervollständigung mit Vorschau (0.85, static/complete.js) */
.cmp-wrap { display: block; position: relative; }
.cmp-wrap .cmp-input { width: 100%; }
.cmp-list { position: fixed; z-index: 80; overflow-y: auto; background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 14px 36px rgba(0,0,0,.22); padding: .3rem; font-size: .92rem; text-align: left; }
.cmp-sec { padding: .5rem .55rem .2rem; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--area, var(--muted)); }
.cmp-hit { display: flex; align-items: center; gap: .65rem; padding: .4rem .55rem; border-radius: 7px; cursor: pointer; min-width: 0; }
.cmp-hit.on { background: var(--bg); box-shadow: inset 3px 0 0 var(--accent); }
.cmp-hit .av { width: 2rem; height: 2rem; font-size: .72rem; position: relative; }
.cmp-txt { display: flex; flex-direction: column; min-width: 0; }
.cmp-name, .cmp-txt small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-txt small { color: var(--muted); font-size: .8rem; }
.cmp-area { font-weight: 600; color: var(--area, var(--muted)); }
.cmp-list mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.cmp-empty { margin: 0; padding: .55rem; color: var(--muted); }
.cmp-new { border-top: 1px solid var(--line); margin-top: .25rem; border-radius: 0 0 7px 7px; color: var(--accent); font-weight: 600; }
.cmp-new .cmp-plus { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: 1.1rem; }
.cmp-foot { display: flex; gap: 1rem; margin-top: .3rem; padding: .4rem .55rem .15rem; border-top: 1px solid var(--line); font-size: .75rem; color: var(--muted); }
.cmp-foot kbd { font: .72rem system-ui, sans-serif; border: 1px solid var(--line); border-radius: 4px; padding: 0 .3rem; }
.cmp-prev { position: fixed; z-index: 81; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 14px 36px rgba(0,0,0,.22); padding: .8rem .9rem; font-size: .86rem; text-align: left; }
.cmp-prev[hidden] { display: none; }
.cmp-prev-head { display: flex; gap: .6rem; align-items: center; margin-bottom: .4rem; }
.cmp-prev-head > div { display: flex; flex-direction: column; min-width: 0; }
.cmp-prev-head .sub { font-size: .8rem; }
.cmp-prev .chip { display: inline-block; font-size: .72rem; border: 1px solid var(--area, var(--line)); color: var(--area, var(--muted)); border-radius: 999px; padding: 0 .45rem; }
.cmp-prev dl { display: grid; grid-template-columns: 6.5rem 1fr; gap: .2rem .5rem; margin: .55rem 0 0; }
.cmp-prev dt { color: var(--muted); } .cmp-prev dd { margin: 0; overflow-wrap: anywhere; }
.cmp-last { background: var(--bg); border-radius: 6px; padding: .35rem .5rem; margin: .55rem 0 0; }
.cmp-list-title { margin: .55rem 0 .1rem; }
.cmp-prev ul { margin: 0; padding-left: 1.1rem; }
dialog.cmp-dialog { width: min(440px, calc(100vw - 2rem)); padding: 1rem 1.2rem; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
dialog.cmp-dialog::backdrop { background: rgba(0,0,0,.3); }
dialog.cmp-dialog h2 { margin-top: 0; }
@media (max-width: 720px) { .cmp-foot { display: none; } .cmp-hit { padding: .55rem; } }
.gs-av { width: 1.7rem; height: 1.7rem; flex: none; }
.gs-ic { display: inline-flex; align-items: center; justify-content: center; }

/* Neu anlegen aus einer Mail (0.85) */
.mail-new > summary { cursor: pointer; font-weight: 600; color: var(--accent); list-style: none; }
.mail-new > summary::-webkit-details-marker { display: none; }
.mail-new[open] > summary { margin-bottom: .6rem; }
.mail-new-plus { display: inline-flex; width: 1.4rem; height: 1.4rem; align-items: center; justify-content: center; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, transparent); margin-right: .3rem; }
.mail-new-form .fields.two { grid-template-columns: 1fr 1fr; gap: .5rem .7rem; }
.mail-new-form .fields.two .wide { grid-column: 1 / -1; }
.mail-new-form .seg { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .6rem; }
.mail-new-form .seg label { cursor: pointer; }
.mail-new-form .seg input { position: absolute; opacity: 0; pointer-events: none; }
.mail-new-form .seg span { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: .15rem .7rem; font-size: .85rem; }
.mail-new-form .seg input:checked + span { background: var(--accent); color: var(--accent-text, #fff); border-color: var(--accent); }
.mail-new-form .seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.mail-new-co { margin: -.2rem 0 0; }
.mail-new-warn { border-left: 3px solid var(--mail-flag); background: var(--bg); padding: .35rem .55rem; border-radius: 6px; font-size: .88rem; }
.mail-new-form input.ai-filled, .mail-new-form .ai-filled { box-shadow: inset 3px 0 0 #9c36b5; }
dialog.mail-new-dialog { width: min(560px, calc(100vw - 2rem)); }
.chip.sug.new { border-style: dashed; color: var(--muted); background: none; cursor: pointer; }
@media (max-width: 520px) { .mail-new-form .fields.two { grid-template-columns: 1fr; } }

/* 0.90: Administration nach Modulen, überblendete Felder */
.admin-part-title { margin: 1.2rem 0 .2rem; font-size: 1.05rem; }
.masked { display: inline-block; width: 7.5rem; max-width: 100%; height: .9em; vertical-align: middle;
          border-radius: 4px; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--muted) 45%, transparent), color-mix(in srgb, var(--muted) 45%, transparent) 6px,
          transparent 6px, transparent 9px); opacity: .9; cursor: not-allowed; }
label .masked { display: block; width: 100%; height: 2.2rem; margin-top: .25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.protected-row td:first-child { font-weight: 600; }
.inline-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-top: .6rem; }
/* Neue Mails in der Kopfleiste (0.89): Symbol mit Zahl, Klappliste mit den neuesten ungelesenen Mails */
.mail-check[hidden] { display: none; }
.mail-check > summary { position: relative; cursor: pointer; color: var(--header-link, var(--accent)); }
.mail-check > summary svg { width: 20px; height: 20px; }
.mail-check .mc-count { position: absolute; top: 0; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
                        background: var(--danger); color: var(--on-color); font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; }
.mail-check .mc-count[hidden] { display: none; }
.mail-check.mc-error > summary::after { content: ""; position: absolute; right: 4px; bottom: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.mail-check .mc-menu { width: min(420px, calc(100vw - 2rem)); padding: 0; overflow: hidden; }
.mc-head, .mc-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .6rem .9rem; }
.mc-head { border-bottom: 1px solid var(--line); }
.mc-head .link { width: auto !important; padding: 0 !important; color: var(--accent) !important; font-size: .85rem; }
.mc-foot { border-top: 1px solid var(--line); font-size: .85rem; }
.mc-foot .sub { margin: 0; }
.mc-rows { list-style: none; margin: 0; padding: 0; max-height: min(60vh, 460px); overflow-y: auto; }
.mc-row { display: grid; grid-template-columns: 2.3rem minmax(0, 1fr); gap: .2rem .7rem; padding: .6rem .9rem; border-bottom: 1px solid var(--line); }
.mc-row:last-child { border-bottom: 0; }
.mc-row:hover { background: var(--bg); }
.mc-row .mid { display: flex; flex-direction: column; min-width: 0; color: var(--text); }
.mc-row .mid:hover { text-decoration: none; }
.mc-row .l1 { display: flex; justify-content: space-between; gap: .5rem; }
.mc-row .from { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-row .when { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.mc-row .subj, .mc-row .prev { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-row .prev { color: var(--muted); font-size: .85rem; }
.mc-row .chip { grid-column: 2; justify-self: start; margin-top: .2rem; }
.mc-empty { margin: 0; padding: .9rem; color: var(--muted); }
.stale-mailbox p { margin: 0 0 .5rem; }
@media (max-width: 1000px) {
  .mail-check .mc-menu { position: fixed; left: .5rem; right: .5rem; top: 3.6rem; width: auto; }
}

/* Benutzerliste: Mehrfachauswahl */
.bulk-bar { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem 1rem; margin: 0 0 .75rem; }
.bulk-bar .bulk-count { align-self: center; font-weight: 600; min-width: 10rem; }
.bulk-bar .bulk-field { display: flex; flex-direction: column; gap: .2rem; font-size: .9rem; }
.bulk-bar .bulk-field[hidden] { display: none; }
.list .check-col { width: 2.25rem; text-align: center; }
.list .check-col input { margin: 0; }

/* Personal-Stammdaten (0.95): Stichtag, geplante Werte, Historie und Editor der Standardfelder */
.master-valid { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem 1rem; }
.master-valid label { max-width: 14rem; }
.hist-mark { font-size: .8em; color: var(--muted); cursor: help; }
.planned { display: block; font-size: .85rem; color: var(--muted); }
.master-history tr.planned td { color: var(--muted); }
.std-fields .menu-list { max-width: 56rem; }
.std-fields .menu-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.std-fields .std-name { min-width: 12rem; }
.std-fields input[name^="label:"] { max-width: 16rem; }

/* Personalakte (0.99): Ordner links, Dokumente in der Mitte, Bescheinigungen und Fristen rechts */
.akte-grid { display: grid; grid-template-columns: minmax(11rem, 14rem) minmax(0, 1fr) minmax(12rem, 17rem); gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .akte-grid { grid-template-columns: minmax(0, 1fr); } }
.akte-folders { display: flex; flex-direction: column; gap: .15rem; }
.akte-folders a { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem .5rem; border-radius: 6px; color: inherit; }
.akte-folders a:hover { background: var(--hover, rgba(127, 127, 127, .1)); }
.akte-folders a.on { background: var(--warn-bg); color: var(--accent); font-weight: 600; }
.akte-folders .cnt { color: var(--muted); font-weight: normal; }
.akte-search { display: flex; gap: .5rem; margin-bottom: .6rem; }
.akte-search input[type=search] { flex: 1; min-width: 0; }
.akte-docs td { vertical-align: top; }
.akte-docs .sub { display: block; }
.akte-docs .doc-actions { display: flex; flex-wrap: wrap; gap: .2rem .6rem; }
.akte-meta form { display: grid; gap: .3rem; margin-top: .3rem; min-width: 14rem; }
.akte-upload label { display: inline-flex; align-items: center; gap: .3rem; }
.valid { padding: .05rem .35rem; border-radius: 4px; white-space: nowrap; }
.valid-soon { background: var(--warn-bg); }
.valid-overdue { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.akte-side { display: flex; flex-direction: column; gap: 1rem; }
.akte-box { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; }
.akte-box h3 { margin: 0 0 .4rem; font-size: 1rem; }
.akte-certs { list-style: none; padding: 0; margin: .3rem 0; }
.akte-certs li { border-top: 1px solid var(--line); padding: .25rem 0; }
.akte-certs li:first-child { border-top: none; }
.deadline { margin: .3rem 0; padding: .4rem .6rem; border-radius: 6px; border: 1px solid var(--line); }
.deadline-overdue { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.deadline-soon { background: var(--warn-bg); }
table.deadlines tr.deadline-overdue td:first-child { color: var(--danger); font-weight: 600; }
.folder-editor .menu-list li { flex-wrap: wrap; }
.folder-editor input.short { width: 5rem; }
.folder-new { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.request { border-top: 1px solid var(--line); padding: .5rem 0; }
.request:first-of-type { border-top: none; }
.request-decide { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .profile-grid { grid-template-columns: minmax(0, 1fr); } }
/* Zeiterfassung (0.102/0.103) */
.time-admin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.time-models { grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr); }
@media (max-width: 900px) { .time-admin, .time-models { grid-template-columns: minmax(0, 1fr); } }
.time-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; margin-bottom: .75rem; }
.time-head h1 { margin: 0; }
.time-tabs { margin-bottom: 1rem; }
.time-today { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
.time-month { display: grid; grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .time-today, .time-month { grid-template-columns: minmax(0, 1fr); } }
/* Abwesenheiten: Formular links, Liste rechts; schmal untereinander, Formular oben */
.absence-layout { display: grid; grid-template-columns: minmax(16rem, 20rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
.absence-layout > .card + .card { margin-top: 0; }
@media (max-width: 900px) { .absence-layout { grid-template-columns: minmax(0, 1fr); } }
/* Stempelkarte (0.140): Uhr, Zustand und Knöpfe in einer Kopfzeile, Knöpfe in normaler Größe
   auf dem Handy breit und unten fest */
.clock-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.1rem; }
.clock-big { font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.clock-meta { display: flex; flex-direction: column; gap: .2rem; min-width: 0; flex: 0 1 auto; }
.clock-state { display: inline-flex; align-items: center; gap: .4rem; align-self: flex-start; padding: .1rem .65rem;
               border-radius: 999px; font-size: .85rem; font-weight: 600; background: var(--bg); color: var(--muted); }
.clock-state .dot { width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; flex: none; }
.clock-state.in { background: color-mix(in srgb, #1a7f37 12%, transparent); color: #1a7f37; }
.clock-state.break { background: var(--warn-bg); color: var(--text); }
.clock-buttons { display: flex; gap: .5rem; margin-left: auto; }
.clock-buttons form, .stamp-dock form { margin: 0; }
.stamp-btn { font-size: .95rem; font-weight: 600; padding: .5rem 1.1rem; min-width: 6.5rem; border-radius: 6px; }
.stamp-btn.secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.stamp-btn.secondary:hover { background: var(--bg); }
.stamp-bar { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: flex-end; margin: .9rem 0 0; padding-top: .9rem;
             border-top: 1px solid var(--line); }
.stamp-bar label { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; color: var(--muted); margin: 0; }
.stamp-bar select { width: auto; min-width: 9rem; max-width: 100%; }
.stamp-bar .project select { min-width: 13rem; }
.stamp-bar .stamp-dock { margin-left: auto; }
.rest-box { margin: .75rem 0 0; border: 1px solid color-mix(in srgb, #bf8700 45%, transparent); }
.rest-box p { margin: 0 0 .5rem; }
.rest-box .reason { display: block; margin: 0; }
.time-clock > .time-warn, .time-clock > .alert { margin: .75rem 0 0; }
.time-entries-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.time-entries-head h2 { margin-bottom: .4rem; }
.add-link { font-weight: 600; white-space: nowrap; }
/* Tagesleiste: Arbeit, Pausen, jetzt und voraussichtliches Soll-Ende */
.day-line { margin: 1rem 0 .25rem; }
.day-line .track { position: relative; height: .7rem; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.day-line .seg { position: absolute; top: 0; bottom: 0; background: #1a7f37; }
.day-line .seg.break { background: #e0a43a; }
.day-line .now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); }
.day-line .target-end { position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--muted); }
.day-line .ticks { position: relative; height: 1rem; font-size: .72rem; color: var(--muted); }
.day-line .ticks span { position: absolute; transform: translateX(-50%); }
.day-line .ticks span:first-child { transform: none; }
.day-line .ticks span:last-child { transform: translateX(-100%); }
@media (max-width: 600px) {
  .clock-head { flex-direction: column; align-items: center; text-align: center; }
  .clock-big { font-size: 3.2rem; }
  .clock-meta { align-items: center; flex-basis: auto; }
  .clock-state { align-self: center; }
  .stamp-bar label, .stamp-bar select, .stamp-bar .project select { width: 100%; min-width: 0; }
  .stamp-bar label { flex: 1 1 100%; }
  /* Daumenknöpfe unten fest */
  .stamp-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; gap: .6rem; margin: 0;
                padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); background: var(--surface);
                border-top: 1px solid var(--line); box-shadow: 0 -2px 8px rgba(0,0,0,.06); }
  .stamp-dock form { flex: 1; display: flex; }
  .stamp-dock .stamp-btn { flex: 1; width: 100%; font-size: 1.05rem; padding: .85rem 1rem; border-radius: 10px; }
  .stamp-bar .stamp-dock { margin: 0; }
  .time-today { padding-bottom: 5rem; }
  /* Quelle steht auf dem Handy nicht in der Tabelle, damit sie in die Breite passt */
  table.time-entries th:nth-child(5), table.time-entries td:nth-child(5) { display: none; }
}
.time-side { display: flex; flex-direction: column; gap: 1rem; }
/* Wochentabelle scrollt in ihrer Karte statt die Seite zu verbreitern */
.time-side .card { overflow-x: auto; }
.time-stats { margin: 0; }
.stat .neg, td.neg, dd.neg { color: var(--danger); }
.stat .pos, td.pos, dd.pos { color: #1a7f37; }
table.time-week tr.today td, table.time-days tr.today td { background: var(--warn-bg); }
.badge.holiday { background: color-mix(in srgb, #8250df 15%, transparent); }
.badge.pending { background: var(--warn-bg); }
.badge.amended { background: color-mix(in srgb, #bf8700 15%, transparent); }
.time-dl { display: grid; grid-template-columns: auto auto; gap: .3rem 1rem; margin: 0 0 .6rem; }
.time-dl dt { color: var(--muted); }
.time-dl dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.time-who { margin-bottom: .75rem; }
.time-rule { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 6px; padding: .5rem .75rem; }
.time-rule.late { background: var(--warn-bg); }
.badge.violation { background: color-mix(in srgb, var(--danger) 16%, transparent); text-decoration: none; }
.badge.hint { background: color-mix(in srgb, var(--accent) 12%, transparent); text-decoration: none; }
.badge.explained { opacity: .7; }
.time-warn { background: var(--warn-bg); border-radius: 6px; padding: .5rem .75rem; }
.time-warn.confirm { outline: 2px solid #bf8700; }
.time-rules { margin: .75rem 0; }
.time-finding { border-left: 3px solid var(--accent); padding: .25rem .75rem; margin: .5rem 0; }
.time-finding.violation { border-left-color: var(--danger); }
.time-finding p { margin: .25rem 0; }
.time-statement { font-style: italic; }
.statement-form input[name=text] { flex: 1; min-width: 12rem; }
.time-open li { margin: .25rem 0; }
.project-time td.over { color: var(--danger); font-weight: 600; }
.project-time tr.closed td { opacity: .7; }
.project-time .phase-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.project-time .phase-row input.short, .project-time input.short { width: 6rem; }
.project-costs .table-wrap { overflow-x: auto; }
.project-costs td.num, .project-costs th.num { text-align: right; white-space: nowrap; }
.project-costs input.short { width: 8rem; }
.project-costs input.num { text-align: right; }
.project-costs tr.level-1 td { font-weight: 600; }
.project-costs tr.changed td { font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.project-costs td.indent-2 { padding-left: 1.25rem; }
.project-costs td.indent-3 { padding-left: 2.5rem; }
.project-costs td.indent-4, .project-costs td.indent-5 { padding-left: 3.75rem; }
.project-costs tr.sum td { border-top: 2px solid var(--line); }
.project-costs .costs-tools { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.project-costs .costs-tools form, .project-costs .group-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.project-costs .costs-tools label { display: flex; flex-direction: row; gap: .5rem; align-items: center; margin: 0; }
.project-costs .group-row input[name=name] { min-width: 14rem; }
/* Reiter „Honorar“ (HOAI) */
.project-fees .pagehead { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.project-fees .table-wrap { overflow-x: auto; }
.project-fees td.num, .project-fees th.num { text-align: right; white-space: nowrap; }
.project-fees input.short { width: 6rem; }
.project-fees input.num { text-align: right; }
.project-fees tr.sum td { border-top: 2px solid var(--line); }
.project-fees .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin: .5rem 0 1rem; }
.project-fees .kpi { border: 1px solid var(--line); border-radius: 8px; padding: .75rem 1rem; }
.project-fees .fee-contract { border-top: 1px solid var(--line); padding-top: .75rem; margin-top: .75rem; }
.project-fees .fee-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.project-fees .fee-head h3 { margin: 0; }
.project-fees .fee-head .spacer { flex: 1; }
.project-fees .fee-progress { white-space: nowrap; }
.project-fees .bar { display: inline-block; width: 6rem; height: .5rem; background: var(--line); border-radius: 4px; vertical-align: middle; overflow: hidden; }
.project-fees .bar span { display: block; height: 100%; background: var(--accent); }
.project-fees .fee-grid { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: flex-end; }
.project-fees .fee-grid label { display: flex; flex-direction: column; gap: .25rem; margin: 0; }
.project-fees .fee-grid label.check { flex-direction: row; align-items: center; }
.project-fees .fee-form h3 { margin-top: 1.25rem; }
.project-fees .badge[data-economy="ok"] { border-color: var(--accent); color: var(--accent); }
.project-fees .badge[data-economy="over"] { border-color: var(--ds-amber); color: var(--ds-amber); }
.project-fees .fee-grid .unit { display: flex; gap: .35rem; align-items: center; }
.project-fees .fee-table input.short { width: 4.5rem; }
.project-fees .fee-table select { min-width: 9rem; max-width: 13rem; }
.project-fees .fee-table td { padding-top: .3rem; padding-bottom: .3rem; }
.project-fees [data-fee-invoices] td:first-child { white-space: nowrap; }
.project-fees .fee-contract h4 { margin: 1rem 0 .25rem; }
.fee-invoice textarea { width: 100%; }
.time-entry, .time-pending { border-top: 1px solid var(--line); padding: .5rem 0; }
.entry-form { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: flex-end; }
.entry-form label { display: flex; flex-direction: column; gap: .15rem; font-size: .9rem; }
.entry-form label.reason { flex: 1 1 14rem; }
.entry-form input.short { width: 5rem; }
.entry-remove { margin-top: .3rem; display: flex; gap: .5rem; align-items: center; }
.time-history tr.st-replaced .range, .time-history tr.st-rejected .range { text-decoration: line-through; color: var(--muted); }
.tb-clock { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .6rem; border-radius: 999px; font-size: .85rem;
            background: color-mix(in srgb, #1a7f37 12%, transparent); color: #1a7f37; white-space: nowrap; }
.tb-clock .dot { width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.tb-clock.on-break { background: var(--warn-bg); color: var(--text); }
summary.tb-clock { cursor: pointer; list-style: none; }
summary.tb-clock::after { content: ""; border: 4px solid transparent; border-top-color: currentColor; margin-top: 4px; }
.tb-pop .clock-menu { min-width: 270px; padding: .75rem; }
.clock-menu .who { margin: 0 0 .6rem; font-weight: 600; }
.clock-menu-buttons { display: flex; gap: .5rem; }
.clock-menu-buttons form { flex: 1; display: flex; margin: 0; }
.clock-menu-buttons button { flex: 1; border-radius: 6px; white-space: nowrap; }
.clock-menu-buttons button.secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.clock-menu-foot { display: flex; flex-direction: column; gap: .2rem; margin-top: .6rem; font-size: .8rem; }
@media (max-width: 600px) { .tb-clock { padding: .35rem; } .tb-clock .tb-clock-text { display: none; } summary.tb-clock::after { display: none; }
  .tb-clock .dot { width: .6rem; height: .6rem; } }

/* Paralleles Bearbeiten: „bearbeitet gerade“, „inzwischen gespeichert“, Symbol in Listen, Nachfrage */
.editing-who:empty, .editing-note:empty { display: none; }
.editing-who, .editing-note { flex-basis: 100%; }
.editing-alert { background: var(--warn-bg); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 6px; padding: .4rem .75rem; margin: .25rem 0 .5rem; font-size: .92em; }
.editing-alert p { margin: .15rem 0; }
.editing-mark { color: var(--accent); margin-right: .35rem; cursor: help; }
.vcard > .editing-mark { position: absolute; top: .4rem; right: .5rem; }
.editing-conflict td, .editing-conflict th[scope=row] { vertical-align: top; }
.editing-choice label.switch { margin: .1rem 0; white-space: nowrap; color: var(--text); }

/* Abläufe 2 (0.110): Aktionen an der Stufe, Protokoll, Bestätigungsfenster */
.flow-actions { margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.action-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .35rem; }
.action-list li { padding: .35rem .5rem; border-radius: 6px; }
.action-list li.sel { background: var(--bg); }
.action-list li.off { opacity: .6; }
.cond-row { display: grid; grid-template-columns: 1fr; gap: .5rem; }
.runs .run-error .run-badge { border-color: var(--danger); color: var(--danger); }
.runs .run-ok .run-badge { border-color: var(--accent); color: var(--accent); }
dialog.flow-confirm { max-width: 40rem; width: calc(100% - 2rem); border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem; background: var(--surface); color: var(--text); }
dialog.flow-confirm::backdrop { background: rgba(0,0,0,.35); }
.confirm-actions { list-style: none; padding: 0; display: grid; gap: .75rem; }
.confirm-actions li { display: grid; gap: .25rem; }
.confirm-actions input[type=date] { max-width: 12rem; margin-left: .5rem; }

/* 0.112: Mails der Abläufe – Hinweis am Datensatz, Vorschau, Vorlagen */
.flow-mail-banner { border-left: 4px solid var(--ds-amber); }
.flow-mail-banner .flow-mail-row + .flow-mail-row { border-top: 1px solid var(--line); padding-top: .5rem; margin-top: .5rem; }
.flow-mail-banner p { margin: 0 0 .4rem; }
.flow-mail-banner form.inline { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.flow-mail .actions { flex-wrap: wrap; gap: .5rem; }
.mail-templates .placeholders code.ph { cursor: copy; }
.flow-mail-banner { margin-bottom: 1rem; }
.flow-mail button:disabled { opacity: .5; cursor: not-allowed; }
.flow-doc-links { list-style: none; margin: 0; padding: 0; }
.flow-doc-links li + li { margin-top: .4rem; }
.flow-doc-link { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .2rem; }
.flow-doc-link input { flex: 1 1 18rem; min-width: 0; font-size: .85em; }
/* Abwesenheiten (0.111) */
.badge.absence { background: color-mix(in srgb, var(--absence, #6b7280) 22%, transparent); }
.badge.absence.requested { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--absence, #6b7280) 25%, transparent) 0 4px, transparent 4px 8px);
                          border: 1px dashed var(--absence, #6b7280); color: var(--text); }
.absence-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; vertical-align: middle; }
.absence-list tr.st-cancelled td, .absence-list tr.st-rejected td { color: var(--muted, #888); text-decoration: line-through; }
.absence-list tr.st-cancelled td:last-child, .absence-list tr.st-cancelled td:nth-child(3) { text-decoration: none; }
.absence-types input[name=name] { min-width: 10rem; }
.vacation-sums { border-collapse: collapse; margin: .25rem 0 .5rem; }
.vacation-sums th { text-align: left; font-weight: normal; padding: .2rem 1rem .2rem 0; }
.vacation-sums td { padding: .2rem .75rem .2rem 0; }
.vacation-sums td:nth-child(2) { text-align: right; font-variant-numeric: tabular-nums; }
.vacation-sums tr.total th, .vacation-sums tr.total td:nth-child(2) { font-weight: 600; border-top: 1px solid var(--line); }
.vacation-account { margin-bottom: 1rem; }
.vacation-edit summary { cursor: pointer; margin: .5rem 0; }
table.vacation-accounts td.num, table.vacation-accounts th.num, .absence-list td.num { text-align: right; font-variant-numeric: tabular-nums; }
.absence-decide button { margin-left: .25rem; }
.team-calendar-wrap { overflow-x: auto; }
.team-calendar { border-collapse: collapse; font-size: .85rem; }
.team-calendar th, .team-calendar td { border: 1px solid var(--line); padding: .15rem; text-align: center; min-width: 1.6rem; }
.team-calendar tbody th { text-align: left; white-space: nowrap; padding: .2rem .5rem; position: sticky; left: 0; background: var(--bg, #fff); }
.team-calendar th.today { outline: 2px solid var(--accent, #2563eb); }
.team-calendar td.off { background: color-mix(in srgb, var(--muted, #888) 15%, transparent); }
.team-calendar .cal-mark { display: block; height: 1rem; border-radius: 3px; background: var(--absence, #6b7280); }
.team-calendar td.half .cal-mark { width: 50%; }
.team-calendar td.requested .cal-mark { background: repeating-linear-gradient(45deg, var(--absence, #6b7280) 0 3px, transparent 3px 6px); border: 1px solid var(--absence, #6b7280); }
.team-calendar tr.staffing td { font-variant-numeric: tabular-nums; color: var(--muted); }
.team-calendar tr.staffing td.below { background: color-mix(in srgb, #dc2626 25%, transparent); color: inherit; font-weight: 600; }
.vacation-notice { border-left: 4px solid var(--accent, #2563eb); }

/* Quickchat (0.125): Sprechblase mit Zähler, Panel unter der Kopfzeile, Vollbildseite /chat */
.qc-btn { position: relative; }
.qc-btn .qc-badge { position: absolute; top: 0; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
                    background: var(--danger); color: var(--on-color, #fff); font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; }
.qc-btn .qc-badge[hidden] { display: none; }
.qc-btn.dnd::after { content: ""; position: absolute; left: 2px; bottom: 2px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
                     border: 2px solid var(--header-bg, var(--surface)); }
.qc-pop { position: fixed; top: 3.6rem; right: 1rem; z-index: 70; width: min(760px, calc(100vw - 2rem)); height: min(560px, calc(100vh - 5rem));
          background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0,0,0,.18); overflow: hidden; }
.qc-pop[hidden] { display: none; }
.qc { display: grid; grid-template-columns: 240px 1fr; height: 100%; min-height: 0; }
.qc-page { height: calc(100vh - 9rem); min-height: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.qc-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.qc-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .8rem .4rem; }
.qc-status select { width: auto; margin: 0; padding: .15rem .3rem; font-size: .8rem; }
.qc-search { margin: .2rem .8rem .5rem; width: auto; box-sizing: border-box; }
.qc-people { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.qc-people li[hidden] { display: none; }
.qc-open { margin: 0; }
.qc-person-btn { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .5rem .8rem; border: 0; border-radius: 0; background: none;
                 color: var(--text); text-align: left; }
.qc-person-btn:hover, .qc-person.active .qc-person-btn { background: var(--bg); }
.qc-person.unread strong { font-weight: 700; }
.qc-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.qc-who > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-av { position: relative; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
         background: var(--bg); border: 1px solid var(--line); color: var(--muted); font-size: .75rem; font-weight: 600; }
.qc-dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--surface); background: #9aa3b2; }
.qc-dot.online { background: #22a35a; }
.qc-dot.away { background: #e0a100; }
.qc-dot.dnd { background: var(--danger); }
.qc-dot.busy, .qc-dot.meeting { background: #c4314b; }
.qc-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-text); font-size: .7rem;
            font-weight: 700; line-height: 18px; text-align: center; }
.qc-count[hidden] { display: none; }
.qc-foot { display: flex; flex-direction: column; gap: .2rem; padding: .5rem .8rem; border-top: 1px solid var(--line); }
.qc-foot .link { text-align: left; }
.qc-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.qc-empty { margin: auto; padding: 1rem; text-align: center; }
.qc-conv { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.qc-conv-head { display: flex; align-items: center; gap: .6rem; padding: .6rem .9rem; border-bottom: 1px solid var(--line); }
.qc-back { display: none; font-size: 1.2rem; padding: 0 .3rem; }
.qc-log { flex: 1; overflow-y: auto; padding: .8rem .9rem; display: flex; flex-direction: column; gap: .35rem; }
.qc-more { text-align: center; }
.qc-day { text-align: center; margin: .5rem 0; color: var(--muted); font-size: .75rem; }
.qc-day span { background: var(--bg); border-radius: 999px; padding: .1rem .6rem; }
.qc-msg { position: relative; display: flex; flex-direction: column; align-items: flex-start; max-width: 80%; }
.qc-msg.mine { align-self: flex-end; align-items: flex-end; }
.qc-from { color: var(--muted); margin: 0 .3rem .1rem; }
.qc-bubble { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: .45rem .7rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.qc-msg.mine .qc-bubble { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.qc-msg.deleted .qc-bubble { background: none; color: var(--muted); }
.qc-rec { display: inline; padding: .05rem .4rem; border-radius: 6px; background: var(--surface); border: 1px solid var(--line);
          color: var(--accent); font-weight: 600; -webkit-box-decoration-break: clone; box-decoration-break: clone; line-height: 1.7; }
.qc-rec-area { font-weight: 400; color: var(--muted); }
.qc-rec.hidden { color: var(--muted); font-weight: 400; font-style: italic; }
.qc-meta { color: var(--muted); margin: .1rem .3rem 0; }
.qc-menu { position: absolute; top: 1.1rem; right: -1.5rem; }
.qc-msg.mine .qc-menu { right: auto; left: -1.5rem; }
.qc-menu summary { list-style: none; cursor: pointer; color: var(--muted); padding: 0 .3rem; opacity: 0; }
.qc-menu summary::-webkit-details-marker { display: none; }
.qc-msg:hover .qc-menu summary, .qc-menu[open] summary, .qc-menu summary:focus-visible { opacity: 1; }
.qc-menu .menu { position: absolute; z-index: 5; top: 1.4rem; left: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--line);
                 border-radius: 8px; padding: .4rem .6rem; box-shadow: 0 8px 24px rgba(0,0,0,.15); display: flex; flex-direction: column; gap: .3rem; }
.qc-msg.mine .qc-menu .menu { left: auto; right: -1.5rem; }
.qc-menu form { margin: 0; }
.qc-editing { width: 100%; max-width: 100%; }
.qc-editing textarea { width: 100%; }
.qc-compose { position: relative; display: flex; gap: .4rem; align-items: flex-end; padding: .6rem .9rem; border-top: 1px solid var(--line); margin: 0; }
.qc-compose textarea { flex: 1; resize: none; margin: 0; min-height: 2.3rem; max-height: 160px; }
.qc-compose.busy { opacity: .6; }
.qc-hash[hidden] { display: none; }
.qc-picker { position: absolute; left: .9rem; right: .9rem; bottom: calc(100% - .3rem); max-height: 240px; overflow-y: auto; background: var(--surface);
             border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: .3rem; }
.qc-picker[hidden] { display: none; }
.qc-pick { display: flex; flex-direction: column; align-items: flex-start; width: 100%; background: none; border: 0; color: var(--text); padding: .35rem .5rem;
           border-radius: 6px; text-align: left; }
.qc-pick.on, .qc-pick:hover { background: var(--bg); }
.qc-mentions ul li { margin-bottom: .4rem; }
/* Gruppen und Bereichs-Kanäle (0.126) */
.qc-section { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; padding: .6rem .8rem .2rem; color: var(--muted);
              font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.qc-section a { text-transform: none; letter-spacing: 0; font-size: .8rem; }
.qc-open-conv { margin: 0; }
.qc-av-group { border-radius: 8px; background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.qc-muted { font-size: .75rem; }
.qc-busy { color: var(--danger); }
.qc-busy[hidden] { display: none; }
.qc-teams { flex: 0 0 auto; margin-left: auto; }
.qc-conv-menu { position: relative; top: auto; right: auto; flex: 0 0 auto; }
.qc-teams + .qc-conv-menu { margin-left: 0; }
.qc-conv-head > .qc-who + .qc-conv-menu { margin-left: auto; }
.qc-conv-menu summary { opacity: 1; font-size: 1.1rem; }
.qc-conv-menu .menu { left: auto; right: 0; top: 1.8rem; min-width: 260px; max-height: 60vh; overflow-y: auto; }
.qc-members { list-style: none; margin: 0 0 .3rem; padding: 0; display: flex; flex-direction: column; gap: .2rem; }
.qc-members li { display: flex; align-items: center; gap: .4rem; }
.qc-members form { margin-left: auto; }
.qc-dot.inline { position: static; flex: 0 0 auto; border-width: 0; width: 8px; height: 8px; }
.qc-inline { display: flex; gap: .3rem; align-items: center; }
.qc-inline select, .qc-inline input { flex: 1; min-width: 0; margin: 0; }
.qc-group-form { display: flex; flex-direction: column; gap: .5rem; padding: .8rem .9rem; overflow-y: auto; flex: 1; min-height: 0; }
.qc-group-form .qc-search { margin: 0; }
.qc-pick-people { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 120px; border: 1px solid var(--line); border-radius: 8px; }
.qc-pick-people li { padding: .3rem .6rem; }
.qc-pick-people li[hidden] { display: none; }
.qc-pick-people label { margin: 0; }
@media (max-width: 720px) {
  .qc-pop { display: none; }
  .qc-page { height: calc(100vh - 9.5rem); height: calc(100dvh - 9.5rem); min-height: 360px; }
  .qc { grid-template-columns: 1fr; }
  .qc-side { border-right: 0; }
  .qc.qc-has-open .qc-side { display: none; }
  .qc:not(.qc-has-open) .qc-main { display: none; }
  .qc-back { display: inline-block; }
  .qc-msg { max-width: 92%; }
  .qc-menu summary { opacity: 1; }
}

/* Abläufe aus E-Mails (0.124) */
.badge.flow-mark { border-color: var(--accent); color: var(--accent); white-space: nowrap; }
.flow-offer { margin: .75rem 0; padding: .5rem .75rem; border-left: 3px solid var(--accent); background: var(--bg); }
.flow-offer p { margin: .25rem 0; }

/* Gruppen-Editor mit Reitern (pcs_ui::groups, static/group-tabs.js). Ohne JavaScript stehen alle Abschnitte
   untereinander; mit JavaScript ist immer nur der gewählte Reiter sichtbar. */
.gtab-bar, .gtab-sub { display: none; }
.gtabs-js .gtab-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem; margin: 1rem 0 0;
  border-bottom: 1px solid var(--line); }
.gtab-bar button { position: relative; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted);
  padding: .55rem .7rem; font: inherit; font-size: .92rem; white-space: nowrap; cursor: pointer; }
.gtab-bar button:hover { color: var(--text); }
.gtab-bar button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.gtab-bar button.dirty::after, .gtab-sub button.dirty::after { content: "*"; color: var(--accent); }
.gtab-bar button[hidden], .gtab-sub button[hidden] { display: none; }
.gtab-sep { flex: none; width: 1px; height: 1.3rem; background: var(--line); margin: 0 .3rem; }
.gtab-count { font-style: normal; font-size: .72rem; font-weight: 600; margin-left: .4rem; padding: 0 .4rem; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.gtab-count.off { background: var(--bg); color: var(--muted); }
.gtab-count:empty { display: none; }
.gtabs-js .gtab-sub { display: block; margin: 0 0 .75rem; }
.gtab-subrow { display: none; flex-wrap: wrap; gap: .35rem; padding: .55rem .25rem; border-bottom: 1px solid var(--line); }
.gtab-subrow.active { display: flex; }
.gtab-sub button { background: none; border: 1px solid transparent; border-radius: 999px; color: var(--muted); padding: .3rem .8rem;
  font: inherit; font-size: .88rem; white-space: nowrap; cursor: pointer; }
.gtab-sub button:hover { color: var(--text); }
.gtab-sub button.active { color: var(--accent); font-weight: 600; border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent); }
.gtab-dot { display: inline-block; width: .45rem; height: .45rem; border-radius: 50%; background: var(--line); margin-left: .35rem; vertical-align: .1rem; }
.gtab-dot.on { background: var(--accent); }
.gtabs-js .gtab-panel:not(.active) { display: none; }
.gtabs-js .gtab-title { display: none; }
.gtab-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: .6rem; }
.gtab-tools > p, .gtab-tools > h4 { margin: 0; flex: 1 1 18rem; }
.gtab-preset { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; max-width: 100%; }
.group-form .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); flex: none; }
.group-form .seg > button, .group-form .seg > label > span { display: inline-block; border: 0; border-left: 1px solid var(--line); background: none;
  color: var(--text); font: inherit; font-size: .8rem; padding: .2rem .5rem; cursor: pointer; white-space: nowrap; }
.group-form .seg > :first-child, .group-form .seg > label:first-child > span { border-left: 0; }
.group-form .seg > label { display: inline-flex; flex-direction: row; margin: 0; gap: 0; }
.group-form .seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.group-form .seg > button.on, .group-form .seg input:checked + span { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.group-form .seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.group-form .seg input:disabled + span { cursor: default; opacity: .6; }
.group-form .seg input:disabled:checked + span { opacity: 1; background: var(--muted); }
.gtab-overview tbody tr { cursor: pointer; }
.gtab-overview tbody tr:hover td { background: var(--bg); }
.gtab-overview .badge { margin: 0 .15rem .1rem 0; font-size: .75rem; }
.gtab-overview .badge.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.gtab-overview .badge.off { opacity: .45; }
.gtab-boxes { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.gtab-box { flex: 1 1 16rem; border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .85rem; background: var(--bg); }
.gtab-box h4 { margin: 0 0 .5rem; }
.gtab-box .sub { margin: 0 0 .4rem; }
.gtab-data { flex: 2 1 30rem; }
.group-form .lvl { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .5rem; }
.group-form .lvl button { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 6px;
  padding: .3rem .6rem; font: inherit; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.group-form .lvl button.in { border-color: var(--accent); color: var(--accent); }
.group-form .lvl button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.gtab-fine { display: flex; flex-wrap: wrap; gap: .2rem .8rem; align-items: center; font-size: .85rem; margin-bottom: .3rem; }
.group-form .gtab-fine label, .group-form .gtab-extra label { display: inline-flex; flex-direction: row; gap: .25rem; align-items: center;
  margin: 0; font-weight: 400; color: var(--text); font-size: .85rem; }
.group-form .gtab-fine input, .group-form .gtab-extra input { width: auto; margin: 0; }
.gtab-extra { display: flex; flex-wrap: wrap; gap: .2rem .7rem; align-items: center; font-size: .85rem; padding: .3rem 0; border-top: 1px solid var(--line); }
.gtab-extra > span { flex: 1 1 100%; font-weight: 600; }
.group-form label.gchip { display: inline-flex; flex-direction: row; width: auto; max-width: 100%; color: var(--text); white-space: normal; text-align: left; overflow: visible; }
.group-form .gchip { position: relative; margin: 0 .35rem .4rem 0; padding: .2rem .7rem; font-size: .85rem; cursor: pointer; font-weight: 400; }
.group-form .gchip:has(input:disabled) { cursor: default; opacity: .7; }
.gfield-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: 0 1.25rem; }
.gfield { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .3rem .25rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
.gfield[hidden] { display: none; }
.gfield.diff { background: var(--warn-bg); }
.gfield-search { width: 12rem; padding: .25rem .5rem; }
.gtab-save { position: sticky; bottom: 0; z-index: 5; background: var(--bg); padding: .6rem 0; border-top: 1px solid var(--line); align-items: center; }
.gtab-unsaved:empty { display: none; }
@media (max-width: 640px) {
  .gtabs-js .gtab-bar, .gtab-subrow.active { flex-wrap: nowrap; overflow-x: auto; }
  .gfield-grid { grid-template-columns: 1fr; }
  .gfield { flex-wrap: wrap; }
  .gtab-overview th:nth-child(4), .gtab-overview td:nth-child(4), .gtab-overview th:nth-child(5), .gtab-overview td:nth-child(5) { display: none; }
}

/* Assistent für neue Gruppen (static/group-wizard.js): ohne JavaScript steht alles untereinander. */
.gwiz-steps { display: none; }
.gwiz-js .gwiz-steps { display: flex; list-style: none; margin: 0 0 1rem; padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; }
.gwiz-steps li { flex: 1; display: flex; align-items: center; gap: .45rem; padding: .55rem .7rem; font-size: .88rem; color: var(--muted);
  border-left: 1px solid var(--line); white-space: nowrap; }
.gwiz-steps li:first-child { border-left: 0; }
.gwiz-steps li b { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--bg);
  font-size: .75rem; flex: none; }
.gwiz-steps li.reachable { cursor: pointer; color: var(--text); }
.gwiz-steps li.done b { background: var(--accent); color: var(--accent-text); }
.gwiz-steps li.active { color: var(--accent); font-weight: 600; background: var(--bg); }
.gwiz-steps li.active b { background: var(--accent); color: var(--accent-text); }
.gwiz-js .gwiz-step:not(.active) { display: none; }
.group-form.gwiz-js .gtab-save { display: none; }
.gwiz-step > h3 { margin-top: 0; }
.gwiz-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .6rem; margin-bottom: .75rem; align-items: start; }
.group-form label.gwiz-opt { display: block; border: 1.5px solid var(--line); border-radius: var(--radius); padding: .7rem .85rem;
  color: var(--text); cursor: pointer; background: var(--surface); }
.group-form label.gwiz-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.gwiz-opt input[type=radio] { width: auto; margin: 0 .35rem 0 0; }
.gwiz-opt .sub { display: block; margin: .25rem 0 0 1.4rem; }
.gwiz-opt select { margin: .5rem 0 0 1.4rem; width: calc(100% - 1.4rem); }
.gwiz-hint { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); padding: .6rem .8rem; }
.gwiz-hint a { margin-left: .2rem; }
.gwiz-area { margin: .8rem 0 .4rem; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.gwiz-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .5rem; }
.group-form label.gwiz-module, .gwiz-module.off { display: flex; flex-direction: row; align-items: center; gap: .5rem; border: 1px solid var(--line);
  border-radius: var(--radius); padding: .55rem .7rem; color: var(--text); background: var(--surface); cursor: pointer; }
.group-form label.gwiz-module:has(input:checked) { border-color: var(--accent); }
.gwiz-module input { width: auto; margin: 0; }
.gwiz-module.off { cursor: default; opacity: .7; flex-wrap: wrap; }
.gwiz-intro { margin: 0 0 .5rem; }
.gwiz-member-search { max-width: 20rem; margin-bottom: .6rem; }
.gwiz-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .2rem 1rem; max-height: 22rem; overflow-y: auto; }
.group-form .gwiz-members label { display: flex; flex-direction: row; gap: .4rem; align-items: center; color: var(--text); padding: .2rem 0; }
.gwiz-members label[hidden] { display: none; }
.gwiz-members input { width: auto; margin: 0; }
.gwiz-summary th { text-align: left; white-space: nowrap; width: 12rem; }
.gwiz-nav { display: none; }
.gwiz-js .gwiz-nav { display: flex; align-items: center; gap: .75rem; margin-top: 1rem; }
.gwiz-js .gwiz-nav [data-wiz=back] { margin-right: auto; }
.gwiz-nav [hidden] { display: none; }
@media (max-width: 640px) {
  .gwiz-steps li { font-size: 0; gap: 0; justify-content: center; }
  .gwiz-steps li.active { font-size: .85rem; gap: .4rem; }
}

/* Projektcontrolling (0.141): Stundensätze mit Probe daneben */
.controlling-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.controlling-grid > * { min-width: 0; }
.controlling-grid .table-scroll { overflow-x: auto; }
@media (max-width: 1100px) { .controlling-grid { grid-template-columns: 1fr; } }
.controlling-grid tr.rate-planned td { color: var(--muted); }
.controlling-grid td.num { white-space: nowrap; }
.controlling-grid .probe-result dl { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; margin: .5rem 0 1rem; }
.controlling-grid .probe-result dd { margin: 0; }
.controlling-grid .rate-order { margin: .25rem 0 .5rem 1.25rem; padding: 0; }
.controlling-grid .rate-order li { padding: .15rem 0; }
.controlling-grid .form .wide { grid-column: 1 / -1; }

/* Anforderungsprofil am Suchauftrag (0.145) */
.search-profile .sp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem 2rem; }
.search-profile .sp-grid h3 { margin-top: 0; }
.search-profile .chip.sp-must { font-weight: 600; }
.search-profile details { margin-top: 1rem; }
.search-profile .fields .wide { grid-column: 1 / -1; }
.search-profile .pre { white-space: pre-line; }
/* Projektcontrolling S2 (0.143): Kosten und Budget im Reiter „Zeiten und Kosten“ */
.economics-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.economics-stats .stat b { font-weight: 600; }
.project-economics .table-scroll { overflow-x: auto; }
.economics-table td.num, .economics-table th.num { text-align: right; white-space: nowrap; }
.economics-table tr.person-line td { background: var(--bg); font-size: .9rem; padding-top: .3rem; padding-bottom: .3rem; }
.economics-table td.indent { padding-left: 1.75rem; }
.economics-table td.rate { min-width: 14rem; }
.economics-table tfoot td { font-weight: 600; border-top: 2px solid var(--line); }
.economics-table td.consumption { white-space: nowrap; min-width: 9rem; }
.economics-table .eco-status { white-space: nowrap; }
.profitability-filter label { flex: 0 1 auto; min-width: 9rem; }
.profitability-filter label.check { flex-direction: row; align-items: center; min-width: 0; align-self: center; }
.profitability-filter [data-export] { margin-left: auto; }
.profitability-filter { margin-bottom: 1rem; }
.utilization-layout { display: grid; grid-template-columns: minmax(0, 1fr) 26rem; gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .utilization-layout { grid-template-columns: minmax(0, 1fr); } }
.utilization-side { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.utilization-detail td.share { width: 6.5rem; }
.utilization-detail td.num { white-space: nowrap; text-align: right; }
.utilization-detail .eco-bar { width: 100%; }
.utilization-detail tr.internal td { color: var(--muted); }
.economics-table tr.selected td { background: var(--accent-soft, var(--bg)); }
.eco-bar.util-ok .eco-fill { background: var(--success, #2e9e4f); }
.eco-bar.util-tight .eco-fill { background: #c98a00; }
.eco-bar.util-low .eco-fill { background: var(--danger); }
.eco-status.util-ok { background: #e3f5e8; color: #1f7a3a; }
.eco-status.util-tight { background: #fff3d6; color: #8a5a00; }
.eco-status.util-low { background: #fde4e4; color: var(--danger); }
.eco-bar { position: relative; display: inline-block; width: 6rem; height: .6rem; background: var(--line); border-radius: 3px; vertical-align: middle; }
.eco-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: #1a7f37; }
.eco-bar.status-tight .eco-fill { background: #c98a00; }
.eco-bar.status-over_plan .eco-fill, .eco-bar.status-over_budget .eco-fill { background: var(--danger); }
.eco-bar.status-no_progress .eco-fill, .eco-bar.status-no_budget .eco-fill { background: var(--muted); }
.eco-mark { position: absolute; top: -.2rem; bottom: -.2rem; width: 2px; margin-left: -1px; background: var(--text); }
.badge.eco-status.status-ok { background: #dcfce7; color: #166534; }
.badge.eco-status.status-tight { background: #fef3c7; color: #92400e; }
.badge.eco-status.status-over_plan, .badge.eco-status.status-over_budget { background: #fee2e2; color: #991b1b; }
.economics-edit { margin-top: 1rem; }
.economics-edit summary { cursor: pointer; color: var(--accent); }

/* Auswertung Vermittlung (0.149) */
.kpi-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.kpi-tiles .kpi { display: flex; flex-direction: column; gap: .25rem; margin: 0; }
.kpi-tiles .kpi strong { font-size: 1.4rem; }

/* Matching (0.151) */
.matching .match-score { display: inline-block; min-width: 2.6rem; padding: .2rem .45rem; border-radius: 999px; text-align: center; font-weight: 700;
  background: color-mix(in srgb, var(--accent, #c2410c) calc(var(--s) * .35%), transparent); }
.match-reasons { list-style: none; margin: 0; padding: 0; }
.match-reasons li::before { content: "✓ "; color: var(--ok, #15803d); }
.match-reasons li.no::before { content: "✗ "; color: var(--muted, #6b7280); }
.matching .error.small { font-size: .85em; margin: .2rem 0 0; }
/* Vorschläge im Reiter Kandidaten (0.224) */
.project-candidates .pagehead .count { display: inline-block; min-width: 1.3rem; padding: 0 .35rem; margin-left: .2rem; border-radius: 999px;
  background: var(--accent, #c2410c); color: #fff; font-size: .8em; text-align: center; }
.match-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(34rem, 100vw); z-index: 60; margin: 0; overflow-y: auto;
  border-radius: 0; box-shadow: -8px 0 32px rgb(0 0 0 / .18); }
.match-panel-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.match-panel-head h2 { margin: 0 0 .3rem; }
.match-panel .icon-button { background: none; border: 0; font-size: 1.2rem; cursor: pointer; color: inherit; padding: .2rem .4rem; }
.match-card { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: start; padding: .7rem; margin: .6rem 0;
  border: 1px solid var(--border, #e5e7eb); border-radius: .6rem; }
.match-card .match-score { display: inline-flex; align-items: center; justify-content: center; width: 2.8rem; height: 2.8rem; border-radius: 50%;
  font-weight: 700; background: color-mix(in srgb, var(--accent, #c2410c) calc(var(--s) * .35%), transparent); }
.match-reasons.inline li { display: inline; font-size: .9em; }
.match-reasons.inline li + li::after { content: ""; }
.match-reasons.inline li:not(:last-child) { margin-right: .5rem; }
.match-card .error.small { font-size: .85em; margin: .2rem 0 0; }
.place-hint { display: block; margin-top: .2rem; color: var(--warn, #b45309); }
/* Faktura (0.158) */
.billing-items td.num, .billing-items th.num, .billing-totals td.num { white-space: nowrap; }
.billing-items td:nth-child(2) { min-width: 18rem; width: 100%; }
.billing-items textarea { width: 100%; min-height: 2.4rem; resize: vertical; }
.billing-article-pick { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.billing-article-pick input { width: 18rem; max-width: 100%; }
.billing-items input.short { width: 5.5rem; }
.billing-items td:last-child { white-space: nowrap; }
.billing-items td.pre:last-child { white-space: pre-line; }
.billing-totals { max-width: 32rem; margin-left: auto; }
.billing-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .5rem 1.25rem; margin: 0 0 1rem; }
.billing-facts dt { color: var(--muted); font-size: .85rem; }
.billing-facts dd { margin: 0; }
.billing .overdue, .billing-doc .overdue { color: var(--ds-red, #b91c1c); font-weight: 600; }
.badge[data-billing-state="paid"] { border-color: var(--accent); color: var(--accent); }
.badge[data-billing-state="cancelled"], .badge[data-billing-state="cancel"] { opacity: .7; }
.billing-doc .pre, .billing-items .pre { white-space: pre-line; }
.billing-log { margin-top: 1rem; }
.billing-customer { margin-top: 1rem; }
.billing-filter label { display: flex; flex-direction: column; gap: .25rem; }
.billing-filter { margin-bottom: .75rem; }
[data-billing-list] td:first-child, [data-billing-list] td.num, [data-billing-list] th.num, [data-billing-list] .badge { white-space: nowrap; }
[data-bank-rows] td.num, [data-bank-rows] td:first-child, [data-open-items] td.num, [data-open-items] td:first-child { white-space: nowrap; }
[data-billing-list] .num, .billing-items .num, .billing-totals .num { text-align: right; }

/* Administration › Benutzer: Spalte „Module mit Zugriff“ und Reiter „Rechte“ (0.170) */
.user-filter input[type=search] { min-width: 16rem; }
a.chips { display: flex; flex-wrap: wrap; gap: .25rem; text-decoration: none; color: inherit; }
.rights-list .levels { display: inline-flex; gap: 2px; vertical-align: middle; margin-right: .3rem; }
.rights-list .levels i { width: .8rem; height: .8rem; border-radius: 3px; background: var(--line); }
.rights-list .levels i.on { background: #16a34a; }
.rights-list select { min-width: 11rem; }
.rights-list tr.sub-row td:first-child { padding-left: 1.6rem; color: var(--muted); }
.rights-list details summary { cursor: pointer; }
.rights-list ul.plain { margin: .3rem 0 0; padding-left: 1rem; }
/* Assistent „Neues Projekt“ (0.173, static/project-wizard.js): ohne JavaScript steht alles untereinander. */
.pwiz-steps { display: none; }
.pwiz-js .pwiz-steps { display: flex; list-style: none; margin: 0 0 1.2rem; padding: 0; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.pwiz-steps li { flex: 1; display: flex; align-items: center; gap: .45rem; padding: .55rem .7rem; font-size: .88rem;
  color: var(--muted); border-left: 1px solid var(--line); white-space: nowrap; }
.pwiz-steps li:first-child { border-left: 0; }
.pwiz-steps li b { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: var(--bg); font-size: .75rem; flex: none; }
.pwiz-steps li.reachable { cursor: pointer; color: var(--text); }
.pwiz-steps li.done b, .pwiz-steps li.active b { background: var(--accent); color: var(--accent-text); }
.pwiz-steps li.active { color: var(--accent); font-weight: 600; background: var(--bg); }
.pwiz-js .pwiz-step:not(.active) { display: none; }
.pwiz-step + .pwiz-step { margin-top: 1.2rem; }
.pwiz-js .pwiz-step + .pwiz-step { margin-top: 0; }
.pwiz-step h2 { margin-top: 0; font-size: 1.1rem; }
.pwiz-step .pagehead h2 { margin: 0; }
.pwiz-step .fields .wide { grid-column: 1 / -1; }
.pwiz-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .75rem; margin-bottom: .75rem; }
.form label.pwiz-type { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr; gap: .2rem .6rem;
  align-items: start; margin: 0; min-width: 0; overflow-wrap: anywhere; hyphens: auto;
  border: 1.5px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; color: var(--text); cursor: pointer;
  background: var(--surface); }
.form label.pwiz-type:has(input:checked) { border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.form label.pwiz-type:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.pwiz-type input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pwiz-type .pwiz-icon { grid-row: span 2; align-self: center; font-size: 1.8rem; line-height: 1; }
.pwiz-type .sub { font-size: .85rem; }
.pwiz-ai { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); padding: .75rem .9rem; margin-bottom: 1rem; }
.pwiz-ai[hidden], .pwiz label[hidden] { display: none; }
.pwiz-lps { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; border: 0; padding: 0; margin: 1rem 0 .5rem; }
.pwiz-lps legend { font-weight: 600; margin-bottom: .4rem; padding: 0; }
.pwiz-lps label.check { flex-direction: row; align-items: center; gap: .35rem; color: var(--text); }
.pwiz-lps input { width: auto; margin: 0; }
.pwiz-fee { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); padding: .75rem .9rem; margin: .5rem 0; }
.pwiz-fee p { margin: 0 0 .4rem; }
.pwiz-fee table { width: auto; min-width: 60%; }
.pwiz-summary th { text-align: left; white-space: nowrap; width: 14rem; vertical-align: top; color: var(--muted); font-weight: 500; }
.pwiz-summary td, .pwiz-summary th { padding: .3rem .5rem .3rem 0; }
.pwiz-nav { display: none; }
.pwiz-js .pwiz-nav { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1.2rem; }
.pwiz-nav [hidden], .pwiz-create[hidden] { display: none; }
.pwiz-js .pwiz-nav [data-pwiz=next] { margin-left: auto; }
@media (max-width: 640px) {
  .pwiz-steps li { font-size: 0; gap: 0; justify-content: center; }
  .pwiz-steps li.active { font-size: .85rem; gap: .4rem; }
}

/* Aufgaben: Meine, Team, Alle (0.179) */
.task-views { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 0 0 .75rem; }
.view-switch { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.view-switch a { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; color: var(--muted);
  text-decoration: none; border-right: 1px solid var(--line); white-space: nowrap; }
.view-switch a:last-child { border-right: 0; }
.view-switch a:hover { color: var(--text); background: var(--bg); }
.view-switch a.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 600; }
.view-switch .count { font-size: .8rem; padding: 0 .4rem; border-radius: 999px; background: var(--bg); color: inherit; }
.view-link { color: var(--muted); white-space: nowrap; font-size: .92rem; }
.view-link.active { color: var(--accent); font-weight: 600; }
.view-switch.compact a { padding: .15rem .45rem; gap: 0; }
/* Umschalter der Listenansicht (Liste, Karten, Tafel) als Symbolknöpfe in der Leiste: ohne die Polsterung der
   Textreiter, sonst blieben für das Symbol nur wenige Pixel (0.191.2) */
.view-switch a.icon-btn { width: 2.2rem; height: 2.1rem; padding: 0; border: 0; border-right: 1px solid var(--line); border-radius: 0;
  justify-content: center; }
.view-switch a.icon-btn:last-child { border-right: 0; }
.view-switch a.icon-btn .icon { flex: 0 0 auto; width: 18px; height: 18px; }
.view-switch.compact .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.act-owner { display: none; color: var(--muted); white-space: nowrap; }
.show-owner .act-owner { display: inline; }
.widget-switch { display: flex; width: max-content; margin: 0 0 .5rem auto; }

/* Modul an, Benutzer nicht freigegeben: gesperrt mit Hinweis „Lizenz nicht aktiviert“ (0.179) */
.dtabs .dtab-locked { opacity: .45; cursor: not-allowed; background: none; border: 0; color: var(--muted); }
.form label.pwiz-type.pwiz-locked { opacity: .5; cursor: not-allowed; }
.pwiz-locked .lock-reason { color: var(--warn, #b7791f); }

/* Gutachten (0.178): Fristen-Ampel und Konfliktprüfung */
.badge.appraisal-due.ok { border-color: var(--ds-green); color: var(--ds-green); }
.badge.appraisal-due.warn { border-color: var(--ds-amber); color: var(--ds-amber); }
.badge.appraisal-due.due { border-color: var(--danger); color: var(--danger); }
.appraisal-case dl + .appraisal-edit, .appraisal-conflicts { margin-top: 1rem; }
/* Gutachten: Ortstermine, Befunde und Fotos (seit 0.185) */
.appraisal-findings .pagehead { margin-top: 1.25rem; }
.appraisal-findings .pagehead:first-of-type { margin-top: 0; }
.visit-list { list-style: none; padding: 0; margin: 0 0 .75rem; display: grid; gap: .5rem; }
.visit-list .visit { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .75rem; }
.visit-list .visit.done { opacity: .75; }
.visit-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; }
.appraisal-findings .row-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .4rem; }
.appraisal-findings .finding { border-top: 1px solid var(--line); padding: .75rem 0; }
.appraisal-findings .finding h3 { margin: 0; display: inline; font-size: inherit; }
.appraisal-findings details.finding > summary { cursor: pointer; font-size: 1.1em; font-weight: 600; padding: .2rem 0; }
.appraisal-findings details.finding[open] > summary { margin-bottom: .4rem; }
.appraisal-findings .finding-count { font-weight: normal; font-size: .75em; }
.appraisal-findings .finding-toggle-all { display: inline-flex; gap: .4rem; flex-wrap: wrap; }
.finding-no { display: inline-block; min-width: 1.8em; text-align: center; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.finding-values { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .9rem; margin: 0; }
.finding-values dt { color: var(--muted); }
.finding-values dd { margin: 0; }
/* Befund-Arten (F2): Abschnitte der eigenen Felder, Knöpfe „+ Art“ nebeneinander */
.finding-values dt.kind-section-title { grid-column: 1 / -1; color: var(--text); font-weight: 600; margin-top: .4rem; }
.finding-values dt.kind-section-title + dd { display: none; }
fieldset.kind-section { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .9rem .8rem; margin: .8rem 0 0; }
fieldset.kind-section legend { font-weight: 600; padding: 0 .3rem; }
.kind-multi, .kind-tristate { display: flex; flex-wrap: wrap; gap: .2rem .9rem; align-items: center; }
.kind-multi .label, .kind-tristate .label { flex-basis: 100%; }
details.finding-new { display: inline-block; vertical-align: top; margin-right: .4rem; }
details.finding-new[open] { display: block; }
/* Fachbereich und Fachpakete (F4): Kästchenlisten für Fachbereiche und Befund-Arten im Gutachten */
.check-list { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; }
fieldset.kind-disciplines, .kind-disciplines fieldset, .appraisal-scope fieldset { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .9rem .8rem; margin: .8rem 0 0; }
.kind-disciplines legend, .appraisal-scope legend { font-weight: 600; padding: 0 .3rem; }
.appraisal-findings ul.plain { list-style: none; padding: 0; margin: 0; }
.appraisal-findings details > summary { cursor: pointer; margin-top: .5rem; }
.appraisal-findings h4 { margin: 1rem 0 .4rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 1rem; margin: .6rem 0; }
.photo-grid .photo { margin: 0; }
.photo-grid .photo img { width: 100%; height: 130px; object-fit: cover; border-radius: 6px; display: block; background: var(--line); }
.photo-grid figcaption { font-size: .85em; margin-top: .2rem; overflow-wrap: anywhere; }
.photo-grid .photo-edit .form label { display: block; }
.photo-grid .photo-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.photo-grid .photo-actions > *, .photo-grid .photo-actions button { margin: 0; }
.photo-grid .photo-actions form.inline { display: contents; }
@media (max-width: 640px) {
  .finding-values { grid-template-columns: 1fr; }
  .finding-values dt { margin-top: .3rem; }
}

/* Kataloge der Gutachten (Administration): auf dem Handy ohne Spalte „Unterpunkte“ */
@media (max-width: 640px) {
  .catalog .catalog-sub { display: none; }
}

/* Gutachten unterwegs (0.188): Heute, Projektakte, untere Leiste auf Handy und Tablet */
.field-day { margin: 1.1rem 0 .4rem; font-size: 1.05rem; color: var(--muted); }
.field-visit { margin-bottom: .6rem; }
.field-visit-head { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.field-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.field-title { font-weight: 600; }
.field-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; align-items: center; }
.field-actions .button, .field-actions button { display: inline-flex; align-items: center; }
.field-grid { display: grid; gap: 1rem; }
.field-tile h2 .cnt { font-size: .8em; color: var(--muted); font-weight: 400; }
.field-list { list-style: none; padding: 0; margin: 0; }
.field-list li { padding: .5rem 0; border-top: 1px solid var(--line); }
.field-list li:first-child { border-top: 0; }
.field-upload label:not(.button) { display: block; margin-bottom: .4rem; }
.field-photos a { display: block; text-decoration: none; color: inherit; }
.field-photos span { display: block; font-size: .85em; margin-top: .2rem; }
.field-photos img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; display: block; background: var(--line); }
.fieldbar { display: none; }
.field-upload.photo-busy [data-photo-status]::before { content: ""; display: inline-block; width: .8em; height: .8em; margin-right: .4em;
  border: 2px solid var(--accent, #c2410c); border-right-color: transparent; border-radius: 50%; animation: field-spin .8s linear infinite; vertical-align: -.1em; }
@keyframes field-spin { to { transform: rotate(360deg); } }
.field-camera { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; color: #fff; }
.field-camera[open] { display: flex; flex-direction: column; }
.field-camera::backdrop { background: #000; }
.field-camera video { flex: 1; min-height: 0; width: 100%; object-fit: contain; background: #000; }
.field-camera.flash video { opacity: .4; }
.field-camera-bar { display: grid; grid-template-columns: auto 1fr auto auto; gap: .6rem; align-items: center;
  padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); background: #111; }
.field-camera-last { position: relative; width: 52px; height: 52px; border-radius: 6px; background: #333; display: grid; place-items: center; }
.field-camera-last img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.field-camera-last span { position: relative; font-weight: 700; text-shadow: 0 0 3px #000; }
.field-camera-place { min-width: 0; }
.field-shutter { width: 68px; height: 68px; border-radius: 50%; border: 4px solid #fff; background: #fff; box-shadow: inset 0 0 0 3px #111; padding: 0; }
.field-shutter:active { transform: scale(.94); }
.field-camera .error { margin: .5rem 1rem; }
.field-camera-error[hidden] { display: none; }
.field-camera [hidden] { display: none !important; }
.field-camera.single .field-camera-last { visibility: hidden; }
.field-camera-error { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.field-camera-error p { margin: 0; flex: 1 1 14rem; }
.field-markup [hidden] { display: none !important; }
/* Unterwegs ohne Netz (seit 0.191) */
.field-offline [hidden] { display: none !important; }
.field-offline figure { margin: 0; }
.field-offline .field-visit-line + .field-visit-line { margin-top: .5rem; }
.field-offline .badge + .badge { margin-left: .25rem; }
.markup-stage img, .markup-stage canvas { display: block; width: 100%; height: auto; border-radius: 6px; background: var(--line); }
.markup-stage canvas { touch-action: none; cursor: crosshair; }
.markup-tools .seg { display: flex; flex-wrap: wrap; gap: .35rem; margin: .6rem 0 .3rem; }
.markup-tools .seg button[aria-pressed="false"]:not(.swatch) { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.markup-tools .swatch { width: 32px; height: 32px; padding: 0; border-radius: 50%; background: var(--swatch); border: 2px solid var(--line); }
.markup-tools .swatch[aria-pressed="true"] { outline: 3px solid var(--text); outline-offset: 2px; }
.markup-label { display: block; margin: .4rem 0; }
.markup-label input { width: 100%; }
.field-photo form.inline { display: block; margin-top: 1rem; }
.field-photo .field-tile textarea, .field-photo .field-tile input, .field-photo .field-tile select { width: 100%; }
.signature-view img { display: block; max-width: 260px; width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; margin: .4rem 0 .2rem; }
.field-protocol .warn { color: var(--warn, #b45309); font-size: .9em; }
.signature-dialog { width: min(96vw, 900px); max-width: none; padding: 1rem; }
.signature-pad { display: block; width: 100%; height: auto; aspect-ratio: 900 / 320; background: #fff; border: 2px dashed var(--line); border-radius: 8px; touch-action: none; }
.field-form label, .field-attendee label, .field-generate label { display: block; margin-bottom: .5rem; }
.field-form input, .field-form select, .field-form textarea, .field-attendee input, .field-generate select { width: 100%; }
.field-two { display: grid; grid-template-columns: 2fr 1fr; gap: .6rem; }
.photo-upload input[type=file] { padding: 1rem; border: 2px dashed var(--line); border-radius: 8px; width: 100%; }
@media (min-width: 760px) {
  .field-file .field-grid { grid-template-columns: 1fr 1fr; }
  .field-file .field-tile[data-field-tile="findings"] { grid-column: 2; grid-row: 1 / span 2; }
  .field-photo .field-grid { grid-template-columns: 3fr 2fr; align-items: start; }
  .field-protocol .field-grid, .field-finding .field-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}
/* Große Touch-Knöpfe nur auf Handy und Tablet (Finger), am Desktop normale Knopfgröße wie im übrigen CRM */
@media (pointer: coarse), (max-width: 1000px) {
  .field-actions .button, .field-actions button, .markup-tools .seg button { min-height: 44px; }
  .markup-tools .swatch { width: 44px; height: 44px; }
}
@media (max-width: 1000px) {
  .field-page { padding-bottom: 4.5rem; }
  .fieldbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .fieldbar a, .fieldbar button { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .45rem 0;
    font-size: .78rem; color: var(--text); text-decoration: none; background: none; border: 0; min-height: 52px; }
  .fieldbar span { font-size: 1.25rem; line-height: 1; }
}

/* Tablet quer und hoch (bis 1200 px): Name im Benutzermenü ausblenden, sonst ragt die Kopfzeile über den Rand */
@media (max-width: 1200px) {
  .um-name { display: none; }
}
.field-offline .field-queue-item { border-top: 1px solid var(--line); padding: .5rem 0; }
.field-offline .field-queue-item:first-of-type { border-top: 0; }
.field-offline .field-queue-thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; margin-top: .25rem; }
.field-offline .badge.warn { background: #fff3cd; color: #7a5a00; }
.field-offline .field-diff th { text-align: left; vertical-align: top; }
.field-offline fieldset { border: 1px solid var(--line); border-radius: 6px; padding: .5rem .75rem; }
.field-offline-bg { padding: .6rem .8rem; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); margin: .5rem 0 1rem; }
.field-offline-bg.warn { border-color: var(--warn, #c98a1a); }
.field-offline-bg[hidden] { display: none; }

/* Aufklapp-Aktionen als Knopf mit Symbol (Gutachten: „Ortstermin planen“, „Befund erfassen“, „Bearbeiten“) */
summary.act-toggle { display: inline-flex; align-items: center; gap: .4rem; list-style: none; cursor: pointer; margin: .25rem 0; }
summary.act-toggle::-webkit-details-marker { display: none; }
summary.act-toggle .act-ic { font-weight: 700; line-height: 1; }
details[open] > summary.act-toggle { margin-bottom: .75rem; }
.field-camera-bar:has(.field-camera-place[hidden]) { grid-template-columns: auto 1fr auto; }
.field-camera-bar:has(.field-camera-place[hidden]) .field-shutter { justify-self: center; }

/* Berichte eines Gutachtens: Fassungen mit Prüfung und Freigabe (0.196) */
.appraisal-reports .report { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .75rem; margin: 0 0 .6rem; }
.appraisal-reports .report-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.appraisal-reports .report-files { margin: .4rem 0; }
.appraisal-reports .report-files .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8em; }
.appraisal-reports .report-steps { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .75rem; margin: .4rem 0; }
.appraisal-reports .report-steps dd { margin: 0; }
.appraisal-reports .report-link { width: 100%; max-width: 34rem; }
.appraisal-reports .report-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; margin-top: .5rem; }
.appraisal-reports .report-actions details[open] { flex-basis: 100%; }
.appraisal-reports .report-sent, .appraisal-reports .report-approved { border-left: 3px solid #16a34a; }
.appraisal-reports .report-review { border-left: 3px solid #d97706; }
@media (max-width: 600px) { .appraisal-reports .report-steps { grid-template-columns: 1fr; } }

/* Abrechnung eines Gutachtens (0.197) */
.appraisal-billing .billing-advance { border-radius: 8px; padding: .5rem .75rem; margin: 0 0 .75rem; border: 1px solid var(--line); }
.appraisal-billing .billing-advance p { margin: .25rem 0 0; }
.appraisal-billing .billing-advance.warn { border-color: #d97706; background: color-mix(in srgb, #d97706 10%, transparent); }
.appraisal-billing .billing-advance.over { border-color: #dc2626; background: color-mix(in srgb, #dc2626 10%, transparent); }
.appraisal-billing .billing-sum { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .75rem; margin: 0 0 .75rem; }
.appraisal-billing .billing-sum dd { margin: 0; }
.appraisal-billing tr.billed { opacity: .7; }
.appraisal-billing .billing-invoice { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .75rem; }
.appraisal-billing td.num, .appraisal-billing th.num { text-align: right; white-space: nowrap; }

/* Gebäude, Ebenen, Räume (0.198, Gutachten F1) */
.places-tree .place-kind { color: var(--muted); display: inline-block; width: 1.2rem; text-align: center; }
.places-tree .place-actions { white-space: nowrap; text-align: right; }
.places-tree .place-actions form.inline, .places-tree .place-edit { display: inline-block; vertical-align: middle; }
.places-tree .place-edit[open] { display: block; text-align: left; margin-top: .4rem; }
.place-panel { display: grid; gap: .5rem; padding: .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); white-space: normal; }
.place-merge { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.place-new { margin-top: .6rem; }
.place-field { display: flex; gap: .35rem; align-items: center; position: relative; }
.place-field > input { flex: 1 1 12rem; min-width: 0; }
.place-pick { position: absolute; top: calc(100% + .3rem); left: 0; z-index: 60; width: min(28rem, 92vw); max-height: 70vh; overflow: auto;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: .6rem; display: grid; gap: .45rem; box-shadow: 0 8px 28px rgba(0,0,0,.18); }
.place-pick[hidden] { display: none; }
@media (max-width: 700px) {
  .place-pick { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 85vh; z-index: 1000;
    border-radius: 14px 14px 0 0; padding: .8rem .9rem calc(.9rem + env(safe-area-inset-bottom)); }
}
.place-head { display: flex; gap: .4rem; align-items: center; }
.place-head .place-find { flex: 1; min-width: 0; }
.place-label { font-size: .8rem; color: var(--muted); margin-top: .2rem; }
.place-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.place-chips .chip { min-height: 2rem; padding: .2rem .75rem; font-size: .9rem; cursor: pointer; background: var(--bg); color: var(--text); }
.place-chips .chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.place-chips .place-add, .place-rooms .place-add { border-style: dashed; color: var(--muted); }
.place-new-field { display: inline-flex; gap: .3rem; align-items: center; }
.place-new-field .place-new-input { width: 10rem; }
.place-rooms { display: grid; }
.place-rooms .place-room { text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: .55rem .3rem; color: var(--text); min-height: 2.4rem; cursor: pointer; }
.place-rooms .place-room.on { color: var(--accent); font-weight: 600; }
.place-rooms .place-room.on::before { content: "✓ "; }
.place-rooms .place-new-field { padding: .45rem .3rem; }
.place-rooms .place-new-field .place-add { background: none; border: 0; color: var(--accent); padding: 0; cursor: pointer; }

/* Raumplan (seit 0.199): Plan mit Nadeln, Liste, Formular „Befund setzen“, Ausschnitt auf der Befund-Seite */
.appraisal-plans .plan-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; justify-content: space-between; margin-bottom: .6rem; }
.plan-chips { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.plan-chips .chip { font-size: .85rem; padding: .2rem .7rem; cursor: pointer; background: var(--surface); color: var(--text); }
.plan-chips .chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.plan-add { position: relative; }
.plan-add > summary { list-style: none; cursor: pointer; }
.plan-add > summary::-webkit-details-marker { display: none; }
.plan-add[open] > .plan-upload { position: absolute; z-index: 40; top: calc(100% + .3rem); left: 0; width: min(30rem, 90vw); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: .8rem; box-shadow: 0 8px 28px rgba(0,0,0,.18); }
.plan-tools { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.plan-tools [aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.plan-zoom { display: inline-flex; gap: .2rem; align-items: center; }
.plan-zoom [data-plan-scale] { min-width: 3.4rem; text-align: center; font-size: .85rem; color: var(--muted); }
.plan-grid { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: 1rem; align-items: start; }
.plans-page .plan-grid { grid-template-columns: minmax(0, 1fr) 20rem; }
.plan-stage { position: relative; user-select: none; }
.plan-clip { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; touch-action: none; }
.plan-stage.placing .plan-clip { cursor: crosshair; outline: 2px solid var(--accent); }
.plan-canvas { position: relative; width: 100%; transform-origin: 0 0; --inv: 1; }
.plan-canvas img { display: block; width: 100%; height: 100%; pointer-events: none; }
.plan-pin { position: absolute; width: 1.8rem; height: 1.8rem; margin: 0; padding: 0; border: 2px solid #fff; border-radius: 50%;
  transform: translate(-50%, calc(-100% - .45rem)) scale(var(--inv)); transform-origin: 50% calc(100% + .45rem);
  background: var(--pin, #d33); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); cursor: pointer; display: grid; place-items: center; }
.plan-pin::after { content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); border: .4rem solid transparent;
  border-top: .55rem solid var(--pin, #d33); border-bottom: 0; }
.plan-pin > span { font-size: .78rem; font-weight: 700; line-height: 1; }
.plan-pin.focus { outline: 3px solid var(--accent); outline-offset: 2px; z-index: 2; }
.plan-pin.done::before { content: "✓"; position: absolute; top: -.5rem; right: -.55rem; width: 1rem; height: 1rem; border-radius: 50%;
  background: #2e7d32; color: #fff; border: 2px solid #fff; font-size: .62rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.finding-done-badge { border-color: #2e7d32; color: #2e7d32; }
.plan-ghost { position: absolute; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--accent); border: 2px solid #fff;
  transform: translate(-50%, -50%) scale(var(--inv)); box-shadow: 0 0 0 6px rgba(234, 120, 40, .3); pointer-events: none; }
.pin-c0, .pin-b0 { --pin: #d32f2f; } .pin-c1, .pin-b1 { --pin: #1e63d6; } .pin-c2, .pin-b2 { --pin: #ef7d00; }
.pin-c3, .pin-b3 { --pin: #7b3fc4; } .pin-c4, .pin-b4 { --pin: #0e9384; } .pin-c5, .pin-b5 { --pin: #c2185b; } .pin-c6, .pin-b6 { --pin: #6b7280; }
.badge[class*="pin-b"], .plan-num { background: var(--pin); color: #fff; border-color: transparent; }
.plan-mode { margin: .4rem .6rem; }
.plan-pop { position: absolute; z-index: 30; width: min(20rem, calc(100% - 16px)); background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: .6rem; box-shadow: 0 8px 28px rgba(0,0,0,.22); }
.plan-pop-head { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .45rem; }
.plan-pop-head img { width: 4.2rem; height: 4.2rem; object-fit: cover; border-radius: 6px; flex: none; }
.plan-pop-head .sub { font-size: .82rem; }
.plan-pop-tags { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .25rem; }
.plan-pop .actions { display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; }
.plan-new { margin-top: .6rem; padding: .7rem; border-top: 1px solid var(--line); background: var(--surface); }
.plan-new h3 { margin: 0 0 .4rem; font-size: 1rem; }
.plan-side h3 { font-size: 1rem; margin: .2rem 0 .4rem; }
.plan-list { list-style: none; margin: 0 0 .8rem; padding: 0; display: grid; gap: .15rem; }
.plan-row { display: flex; gap: .55rem; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px;
  padding: .35rem .45rem; color: var(--text); cursor: pointer; }
.plan-row:hover, .plan-row.focus { background: var(--hover, rgba(0,0,0,.05)); }
.plan-row .sub { display: block; font-size: .8rem; }
.plan-row.unplaced { cursor: grab; }
.plan-num { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 700; }
.plan-legend { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .82rem; margin-bottom: .8rem; }
.plan-legend .sub { flex-basis: 100%; }
.plan-legend .dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; background: var(--pin); margin-right: .3rem; }
.plan-crop { --inv: 1; position: relative; display: block; width: 100%; max-width: 26rem; border: 1px solid var(--line); border-radius: 8px; background-color: #fff;
  background-repeat: no-repeat; overflow: hidden; }
.plan-crop .plan-pin { cursor: pointer; }
@media (max-width: 900px) {
  .plan-grid, .plans-page .plan-grid { grid-template-columns: 1fr; }
  .plan-clip { max-height: 72vh; }
  .plan-pop { position: fixed; left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; border-radius: 14px 14px 0 0;
    padding: .9rem .9rem calc(.9rem + env(safe-area-inset-bottom)); z-index: 1000; }
}

/* Baum der Befunde (Gutachten F5) */
.finding-tree-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin: .5rem 0 1rem; }
.finding-tree { width: 100%; border-collapse: collapse; }
.finding-tree th { text-align: left; font-size: .75rem; text-transform: uppercase; color: var(--muted); padding: .3rem .5rem; }
.finding-tree td { padding: .35rem .5rem; border-top: 1px solid var(--border); vertical-align: middle; }
.finding-tree tr.depth-0 td { background: var(--surface-2, rgba(127, 127, 127, .06)); }
.finding-tree tr.depth-1 .tree-ident { padding-left: 1.6rem; }
.finding-tree tr.linked .tree-ident a { color: #2e7d32; }
.finding-tree .tree-ident { white-space: nowrap; font-weight: 600; }
.finding-tree .tree-photo img { width: 2.6rem; height: 2rem; object-fit: cover; border-radius: 4px; display: block; }
.badge.rating.bad { border-color: #c62828; color: #c62828; }
.badge.rating.good { border-color: #2e7d32; color: #2e7d32; }
.badge.rating.warn { border-color: #b7791f; color: #b7791f; }
.finding-unassigned h3 { margin-top: 0; }
.finding-unassigned ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0 1rem; }
.finding-unassigned li { padding: .4rem 0; border-top: 1px solid var(--border); }
.finding-unassigned .link-form { display: flex; gap: .3rem; margin-top: .3rem; }
.finding-unassigned .link-form select { min-width: 0; flex: 1; }
.kind-inherited { padding: .3rem 0; }
.kind-inherited .label { display: block; font-size: .85rem; color: var(--muted); }
.finding-parent { display: block; margin-bottom: .6rem; }
.badge.rating { white-space: nowrap; }

/* Schadstoffkataster (Gutachten F6) */
.cataster-gaps { border: 1px solid #b7791f; background: rgba(183, 121, 31, .1); color: inherit; border-radius: 8px; padding: .5rem .8rem; margin: .5rem 0 .8rem; }
.cataster-complete { color: #2e7d32; }
.appraisal-cataster .chip-row { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.appraisal-cataster .chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.cataster tfoot th, .cataster tfoot td { border-top: 2px solid var(--border); }
.cataster-results input[name=result] { min-width: 12rem; width: 100%; }
.cataster-results tr.saved td { background: rgba(46, 125, 50, .08); }
.cataster-results td:first-child, .cataster-results td:first-child a, .cataster td a { white-space: nowrap; }
.cataster-results select { min-width: 11rem; }
.cataster-results .lab-ref { display: block; font-size: .8rem; }
.lab-review { margin: .5rem 0 1rem; }
.lab-hits td { vertical-align: top; }
.lab-hits input[name^=result_] { width: 100%; min-width: 22rem; }
.lab-hits select { min-width: 11rem; }
.lab-upload { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: flex-end; margin: .5rem 0; }
.lab-upload label { display: flex; flex-direction: column; gap: .2rem; flex: 1 1 12rem; }
.lab-upload label:first-child { flex-basis: 18rem; }
.lab-upload button { flex: 0 0 auto; }
.appraisal-cataster .warn-text { color: #b7791f; }
.appraisal-cataster .export-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.export-form fieldset { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; border: 1px solid var(--border); border-radius: 8px; padding: .5rem .8rem; margin: .5rem 0; }
.export-form fieldset label { display: inline-flex; flex-direction: row; align-items: center; gap: .35rem; flex: 0 0 auto; white-space: nowrap; width: auto; margin: 0; }
.export-form fieldset input[type=checkbox] { width: auto; margin: 0; flex: 0 0 auto; }
.export-form legend { padding: 0 .3rem; }
.export-form > button { margin-top: .5rem; }

/* Textbausteine (0.208) */
.blocks-bar { display: flex; gap: .8rem; justify-content: flex-end; margin: -.1rem 0 .15rem; font-weight: normal; }
.blocks-bar .link { font-size: .85rem; padding: 0; }
.blocks-saved { display: block; margin-top: .2rem; }
.blocks-dlg { width: min(46rem, calc(100vw - 2rem)); max-height: calc(100vh - 3rem); padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: inherit; }
.blocks-dlg::backdrop { background: rgba(0, 0, 0, .35); }
.blocks-dlg input[type=search] { width: 100%; margin: .3rem 0 .5rem; }
.blocks-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.blocks-x { font-size: 1.1rem; }
.blocks-list { list-style: none; margin: 0; padding: 0; max-height: 40vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.blocks-list li + li { border-top: 1px solid var(--line); }
.blocks-list .empty { padding: .6rem; }
.blocks-opt { display: grid; grid-template-columns: 1fr auto; gap: .15rem .5rem; width: 100%; text-align: left; padding: .5rem .7rem; background: none; border: 0; border-radius: 0; color: inherit; cursor: pointer; }
.blocks-opt:hover, .blocks-opt.act { background: var(--hover, rgba(0, 0, 0, .05)); }
.blocks-opt.act { box-shadow: inset 3px 0 0 var(--accent); }
.blocks-opt-title { font-weight: 600; }
.blocks-opt .badge { align-self: start; white-space: nowrap; }
.blocks-opt-body { grid-column: 1 / -1; white-space: pre-line; }
.blocks-prev { margin-top: .7rem; padding: .7rem; border-radius: 8px; background: var(--hover, rgba(0, 0, 0, .04)); }
.blocks-choices { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0; }
.blocks-choices select { width: auto; }
.blocks-text { white-space: pre-line; margin: .4rem 0; }
.block-filter { margin: 0 0 .6rem; max-width: 24rem; }
.block-list { list-style: none; margin: 0; padding: 0; }
.block-item { padding: .6rem 0; }
.block-item + .block-item { border-top: 1px solid var(--line); }
.block-item summary { cursor: pointer; display: grid; gap: .15rem; }
.block-meta { font-size: .85rem; }
.block-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.block-body { white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.block-item details[open] .block-body { display: none; }
.block-edit { margin-top: .6rem; }
.block-delete { display: block; margin-top: .4rem; }
@media (max-width: 700px) {
  .blocks-dlg { width: 100vw; max-width: 100vw; max-height: 85vh; margin: auto 0 0; border-radius: 14px 14px 0 0; }
}

/* Wissensbasis (0.209) */
.kb-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1rem; }
.kb-object { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; }
.kb-object dt { color: var(--muted); }
.kb-object dd { margin: 0; }
.kb-finding { border-top: 1px solid var(--line); padding: .6rem 0; }
.kb-finding summary { display: flex; gap: .6rem; align-items: baseline; cursor: pointer; }
.kb-finding summary .check { margin: 0; }
.kb-replaced { margin: .4rem 0; }
.kb-photos { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .4rem; }
.kb-photo { position: relative; display: block; margin: 0; cursor: pointer; }
.kb-photo img { width: 7.5rem; height: 5.6rem; object-fit: cover; border-radius: 6px; border: 2px solid transparent; display: block; }
.kb-photo input { position: absolute; top: .3rem; left: .3rem; width: auto; margin: 0; }
.kb-photo input:checked + img { border-color: var(--accent); }
.kb-photo input:not(:checked) + img { opacity: .55; }
.kb-actions { margin: 1rem 0 .4rem; }
.kb-skip { display: block; }
.kb-kinds { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.kb-case-findings { list-style: none; padding: 0; margin: .6rem 0; display: grid; gap: .6rem; }
.kb-text { white-space: pre-line; margin: .2rem 0; }
@media (max-width: 900px) { .kb-grid { grid-template-columns: 1fr; } }
.legacy-table td { vertical-align: top; }
.legacy-actions { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; }
.legacy-actions form { margin: 0; }
.legacy-error { color: var(--danger, #b42318); }
.legacy-progress { display: block; }
.legacy-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .4rem 1rem; margin: .4rem 0; }
.legacy-catalog label { margin: 0; }
.legacy-cost { max-width: 12rem; }

/* Bautagebuch (0.214): Monatskalender, Baustelle, Tag mit Wetter, Firmen, Einträgen und Fotos */
.diary-top { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-start; margin: .5rem 0 1rem; }
.diary-cal { flex: 0 1 22rem; }
.diary-cal-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .3rem; }
.diary-month { border-collapse: collapse; width: 100%; table-layout: fixed; }
.diary-month th { font-weight: 600; font-size: .75rem; color: var(--muted); padding: .2rem 0; text-align: center; }
.diary-month td { text-align: center; padding: .12rem; }
.diary-month td.out { opacity: .4; }
.diary-month td.we .diary-none, .diary-month td.we .diary-empty { color: var(--muted); }
.diary-month td.today > * { outline: 2px solid var(--accent); outline-offset: 1px; }
.diary-month form { margin: 0; }
.diary-dot, .diary-empty, .diary-none { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem;
  border-radius: 50%; font-size: .85rem; line-height: 1; }
.diary-dot { color: var(--on-color); font-weight: 600; }
.diary-dot.open { background: var(--ds-amber); }
.diary-dot.closed { background: var(--ds-green); }
.diary-empty { background: transparent; border: 1px dashed var(--line); color: var(--text); padding: 0; cursor: pointer; }
.diary-empty:hover { border-color: var(--accent); color: var(--accent); }
.diary-none { color: var(--muted); }
.diary-legend { display: flex; align-items: center; gap: .4rem; margin-top: .3rem; font-size: .8rem; }
.diary-legend .diary-dot { width: 1.1rem; height: 1.1rem; font-size: 0; }
.diary-site { flex: 1 1 18rem; }
.diary-site form, .diary-new form, .diary-crew-new form { margin-top: .6rem; }
.badge.diary-open { border-color: var(--ds-amber); color: var(--ds-amber); }
.diary-weather input { max-width: 8rem; }
.diary-entries { list-style: none; padding: 0; margin: 0 0 .6rem; }
.diary-entries li { display: flex; gap: .5rem; align-items: baseline; padding: .35rem 0;
  border-bottom: 1px solid var(--line); }
.diary-entries li:last-child { border-bottom: 0; }
.diary-entries li form { flex: none; }
.diary-entries li > .pre { flex: 1; }
.diary-photos > p { grid-column: 1 / -1; }
.diary-entry-add .wide { flex: 1 1 24rem; }
.diary-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .8rem; margin-bottom: .8rem; }
.diary-photos figure { margin: 0; }
.diary-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.diary-photos figcaption { font-size: .85rem; margin: .2rem 0; }
.diary-photos form input { width: 100%; margin-bottom: .2rem; }
.diary-dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
.diary-dl dt { color: var(--muted); }
.diary-dl dd { margin: 0; }
/* Bautagebuch: Unterschriften beim Tagesabschluss */
.diary-signatures { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin: .75rem 0; }
.diary-signatures figure { margin: 0; }
.diary-signatures img { display: block; max-width: 100%; max-height: 90px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.diary-signatures figcaption { font-size: .85rem; margin-top: .25rem; }
.diary-report { margin: .5rem 0 1rem; }
/* Bautagebuch unterwegs (0.216): Heute auf der Baustelle */
.diary-today [hidden] { display: none !important; }
.diary-today .card { margin-bottom: .9rem; }
.diary-net { display: inline-block; margin: 0; padding: .15rem .6rem; border-radius: 999px; font-size: .85rem; }
.diary-net.on { background: #e6f4ea; color: #1e6b34; }
.diary-net.off { background: #fff3cd; color: #7a5a00; }
.diary-crew-list li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.diary-crew-name { min-width: 0; }
.diary-stepper { display: inline-flex; align-items: center; gap: .4rem; flex: none; }
.diary-stepper button { min-width: 44px; min-height: 44px; font-size: 1.2rem; justify-content: center; }
.diary-stepper output { min-width: 2.2rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.diary-kinds { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.diary-kind { display: inline-flex !important; align-items: center; gap: .3rem; padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; margin: 0 !important; }
.diary-kind input { width: auto !important; margin: 0; }
.diary-kind:has(input:checked) { border-color: var(--accent, #c2410c); background: var(--bg); font-weight: 600; }
.diary-pending .error { margin-top: .3rem; }
.diary-site-list a.diary-site-link { display: flex; flex-direction: column; gap: .15rem; padding: .35rem 0; text-decoration: none; color: inherit; }
.diary-site-list a.diary-site-link strong { color: var(--accent, #c2410c); }

/* Mängel im Bautagebuch (0.217): Ampel zur Frist, Raster der Mangel-Seite, Filter, Mängelrüge */
.defect-light { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.defect-light::before { content: ""; width: .65rem; height: .65rem; border-radius: 50%; background: var(--light, #0e9384); flex: none; }
.light-red { --light: #d32f2f; } .light-yellow { --light: #ef7d00; } .light-green { --light: #0e9384; } .light-done { --light: #6b7280; }
.badge.light-red { background: #d32f2f; color: #fff; border-color: transparent; }
.badge.light-red::before { display: none; }
.diary-defect-filter { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem 1rem; margin: .8rem 0; }
.diary-defect-filter .chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.diary-defect-filter label { display: flex; flex-direction: column; gap: .2rem; }
.diary-defect-new, .diary-defect-group, .diary-plans { margin-bottom: 1rem; }
.diary-defect-list td:nth-child(2) a { font-weight: 600; }
.diary-notice { margin-top: .6rem; }
.defect-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.defect-grid .card { margin-bottom: 0; }
.diary-defect .card { margin-bottom: 1rem; }
.diary-defect .facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; }
.diary-defect .facts dt { color: var(--muted); }
@media (max-width: 820px) { .defect-grid { grid-template-columns: 1fr; } }

/* Firmen ohne Lizenz (0.218): Seite der Firma, Links, Kommentare, Meldung */
.portal-page { background: var(--bg); }
.portal { max-width: 52rem; margin: 0 auto; padding: 1rem; }
.portal .card { margin-bottom: 1rem; }
.portal .facts, .diary-defect .facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; }
.portal .facts dt { color: var(--muted); }
.portal .plan-crop { margin: .6rem 0; }
.portal details { margin-top: .5rem; }
.portal .done-photo img { outline: 3px solid #0e9384; }
.portal-done { list-style: none; padding: 0; }
.diary-links { list-style: none; padding: 0; display: grid; gap: .4rem; }
.diary-links li { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.diary-access { margin-top: .6rem; }
.diary-comments { list-style: none; padding: 0; display: grid; gap: .5rem; }
.diary-comments li { border-left: 3px solid var(--line); padding: .2rem .7rem; }
.diary-comments li.from-company { border-left-color: var(--accent, #c2410c); }
.diary-comments p { margin: .2rem 0 0; white-space: pre-wrap; }
.diary-reported { border: 1px solid var(--accent, #c2410c); border-radius: 8px; padding: .6rem .9rem; margin-bottom: .8rem; }
.portal .diary-photos { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0; }
.portal .diary-photos img { width: 8rem; height: 6rem; object-fit: cover; border-radius: 6px; display: block; }
/* Bautagebuch: Behinderung, Bedenken, Anordnung und Auswertungen (seit 0.219) */
.diary-notice-new, .diary-notices .card, .diary-report .card { margin-bottom: 1rem; }
.diary-notice-filter { align-items: center; gap: 1rem; }
.diary-kind-pick { border: 0; padding: 0; margin: 0 0 .3rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.diary-kind-pick legend { padding: 0; margin-right: .4rem; font-size: .9rem; }
.diary-kind-pick .chip input { margin: 0 .3rem 0 0; }
.badge.kind-hindrance { background: #fdecea; color: #b42318; border-color: #f5c2bd; }
.badge.kind-concern { background: #fff4e5; color: #9a4a00; border-color: #f6d3a4; }
.badge.kind-order { background: #e8f1fb; color: #1d4f91; border-color: #bcd3ef; }
.diary-notice-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
.diary-notice-grid > * { min-width: 0; }
.diary-notice-grid .card { margin-bottom: 1rem; }
.diary-notice-word { margin-top: 1rem; border-top: 1px solid var(--line, #e5e7eb); padding-top: .6rem; }
.diary-notice-page .pre, .diary-notice-close .pre { white-space: pre-wrap; }
@media (max-width: 900px) { .diary-notice-grid { grid-template-columns: 1fr; } }
.diary-report .filters { align-items: flex-end; }
.diary-report .filters button { align-self: flex-end; }
.report-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.report-tiles .tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; display: flex; flex-direction: column; gap: .2rem; }
.report-tiles .tile strong { font-size: 1.5rem; line-height: 1.2; }
.diary-report td.num, .diary-report th.num { text-align: right; }
.diary-report ul.plain li { padding: .25rem 0; }

/* Bautagebuch: Checklisten und Besprechungen (0.220) */
.diary-forms .card, .diary-meetings .card, .diary-form-page .card, .diary-form-templates .card { margin-bottom: 1rem; }
.diary-form-fields .form-heading { font-size: 1.05rem; margin: 1.2rem 0 .3rem; padding-bottom: .3rem; border-bottom: 1px solid var(--line, #e5e7eb); }
.diary-form-fields .form-field { padding: .55rem 0; border-bottom: 1px solid var(--line, #e5e7eb); display: grid; gap: .35rem; }
.diary-form-fields .form-field:last-of-type { border-bottom: 0; }
.diary-form-fields .form-field.deviation { border-left: 3px solid #dc2626; padding-left: .7rem; }
.diary-form-fields .form-label .req { color: #dc2626; }
.check-choice { display: flex; flex-wrap: wrap; gap: .4rem; }
.check-choice label { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem; cursor: pointer; min-height: 2.2rem; }
.check-choice input { margin: 0; }
.check-choice label.check-ok:has(input:checked) { background: #dcfce7; border-color: #16a34a; }
.check-choice label.check-defect:has(input:checked) { background: #fee2e2; border-color: #dc2626; }
.check-choice label.check-na:has(input:checked) { background: #f3f4f6; border-color: #9ca3af; }
.diary-form-fields .form-note { max-width: 40rem; }
.with-unit { display: inline-flex; align-items: center; gap: .4rem; }
.with-unit input { max-width: 10rem; }
.diary-photos { display: flex; flex-wrap: wrap; gap: .5rem; }
.diary-photos figure { margin: 0; position: relative; }
.diary-photos img { width: 8rem; height: 6rem; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.diary-photos form { position: absolute; top: .2rem; right: .2rem; }
.inline-upload { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.form-signature { margin: 0; }
.form-signature img { max-width: 18rem; max-height: 7rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; display: block; }
.form-signature figcaption { font-size: .9rem; margin-top: .2rem; }
.form-save, .diary-form-page .card > form + form, .diary-meeting-page .item-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.diary-form-page .card .inline, .diary-meeting-page #protocol .inline { display: inline-block; margin: .4rem .4rem 0 0; }
.diary-tpl-rows input, .diary-tpl-rows select { width: 100%; min-width: 0; }
.diary-tpl-rows td:first-child { width: 5rem; }
.diary-tpl-rows td:last-child { text-align: center; width: 6rem; }
.diary-tpl-list .archived a { color: var(--muted); text-decoration: line-through; }
.meeting-items { padding-left: 1.4rem; display: grid; gap: .6rem; }
.meeting-items li { padding: .4rem 0 .6rem; border-bottom: 1px solid var(--line, #e5e7eb); }
.meeting-items li.done .pre { color: var(--muted); text-decoration: line-through; }
.meeting-items .item-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.meeting-items .pre { white-space: pre-wrap; margin: .3rem 0; }
.meeting-items .badge.kind-decision { background: #dbeafe; color: #1e40af; }
.meeting-items .badge.kind-info { background: #f3f4f6; color: #374151; }
.meeting-items .inline-edit { width: 100%; }
.meeting-items .inline-edit > summary { list-style: none; display: inline-block; }
.meeting-items .inline-edit[open] > summary { margin-bottom: .5rem; }
.diary-item-new { margin-top: 1rem; border-top: 1px solid var(--line, #e5e7eb); padding-top: .6rem; }
.meeting-attendees { list-style: none; padding: 0; margin: 0 0 .8rem; }
.meeting-attendees li { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .35rem 0; border-bottom: 1px solid var(--line, #e5e7eb); }
.meeting-attendees li > form:last-child { margin-left: auto; }
.present-toggle { font-size: 1.1rem; line-height: 1; }
.present-toggle.on { color: #16a34a; }
@media (max-width: 700px) {
  .diary-tpl-rows thead { display: none; }
  .diary-tpl-rows tr { display: grid; grid-template-columns: 4rem 1fr; gap: .3rem; padding: .4rem 0; }
  .diary-tpl-rows td:first-child, .diary-tpl-rows td:last-child { width: auto; }
}
.diary-tpl-rows td:nth-child(3) { width: 40%; }
.check-choice label { white-space: nowrap; }
.diary-form-fields .form-field > button, .diary-form-fields .form-field > .form-defect { justify-self: start; }
.diary-form-fields .form-field > .form-note { width: 100%; }

/* Faktura-Editor (0.221): deutliche Felder, großes Fenster, Live-Summen */
.billing-doc #doc-form input:not([type=checkbox]):not([type=hidden]),
.billing-doc #doc-form select, .billing-doc #doc-form textarea {
  border: 1.5px solid color-mix(in srgb, var(--text) 28%, var(--surface)); background: var(--surface); border-radius: 6px; }
.billing-doc #doc-form input:not([type=checkbox]):focus, .billing-doc #doc-form select:focus,
.billing-doc #doc-form textarea:focus { border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.billing-doc #doc-form [aria-invalid=true] { border-color: var(--danger); }
.billing-doc #doc-form label { font-weight: 600; font-size: .9rem; }
.billing-items td { vertical-align: top; }
.billing-items [data-amount] { font-weight: 600; padding-top: .7rem; }
.billing-items [data-no] { display: inline-block; min-width: 1.4rem; font-weight: 700; padding-top: .55rem; }
.billing-items tr.billing-removed { opacity: .45; }
.billing-items tr.billing-removed textarea, .billing-items tr.billing-removed input:not([type=checkbox]) { text-decoration: line-through; }
/* Vorschläge in der Faktura (0.329.0) */
.billing-suggest-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin: 2px 0 0; padding: 4px 0; list-style: none;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.15); max-height: 320px; overflow: auto; min-width: 22rem; }
.billing-suggest-list li { padding: 6px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.billing-suggest-list li[aria-selected=true], .billing-suggest-list li:hover { background: var(--side-active-bg, rgba(127,127,127,.12)); }
.billing-suggest-list li.old { opacity: .7; }
.billing-items input.billing-suggested { background: var(--ai-bg); border-color: var(--ai-line); }
.billing-box { margin: 1rem 0; }
.billing-box summary { cursor: pointer; }
.billing-box tr.billing-new-item td { background: var(--ai-bg); }

.billing-editor-bar { display: flex; align-items: center; gap: 1rem; justify-content: flex-end; margin: -.25rem 0 .5rem; }
.billing-editor-title, .billing-editor-close { display: none; }
.billing-large { position: fixed; inset: 2.5vh 2.5vw; z-index: 900; overflow: auto; margin: 0; padding: 0 1.5rem 0;
  box-shadow: 0 0 0 100vmax rgba(15, 23, 42, .45), 0 20px 50px rgba(0, 0, 0, .3); overscroll-behavior: contain; }
body:has(.billing-large) { overflow: hidden; }
.billing-large .billing-editor-bar { position: sticky; top: 0; z-index: 2; background: var(--surface); margin: 0 -1.5rem .75rem;
  padding: .8rem 1.5rem; border-bottom: 1px solid var(--line); justify-content: flex-start; }
.billing-large .billing-editor-title { display: block; font-size: 1.2rem; flex: 1; }
.billing-large .billing-editor-close { display: inline; font-size: 1.3rem; color: var(--muted); text-decoration: none; }
.billing-large .billing-actions { position: sticky; bottom: 0; z-index: 2; background: var(--surface); margin: 1rem -1.5rem 0;
  padding: .8rem 1.5rem; border-top: 1px solid var(--line); justify-content: flex-end; }
.billing-large .billing-items input.short { width: 7rem; }
.billing-large .billing-totals { font-size: 1.05rem; }
.billing-large .billing-totals tr.sum td { font-size: 1.2rem; }
/* Vorschau und Abschluss (0.225) */
.billing-steps { margin-left: 1rem; font-size: .9rem; font-weight: 600; }
.billing-steps .step { display: inline-block; padding: .15rem .6rem; border-radius: 999px; background: var(--surface-2, #f1f5f9); text-decoration: none; }
.billing-steps .step.done { color: var(--ok, #15803d); }
.billing-steps .step.current { color: var(--accent, #c2410c); background: color-mix(in srgb, var(--accent, #c2410c) 12%, transparent); }
.billing-preview-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(16rem, 1fr); gap: 1.25rem; align-items: start; }
.billing-preview-pdf iframe { width: 100%; height: calc(95vh - 11rem); min-height: 24rem; border: 1px solid var(--line); border-radius: .5rem; background: #e5e7eb; }
.billing-preview-side .card { margin: 0 0 1rem; }
.billing-preview-side h2 { font-size: 1.05rem; margin-top: 0; }
.billing-checks { list-style: none; margin: 0; padding: 0; }
.billing-checks li { display: flex; gap: .5rem; align-items: baseline; padding: .3rem 0; }
.billing-checks li > span:nth-child(2) { flex: 1; }
.billing-checks .mark { width: 1rem; font-weight: 700; }
.billing-checks li.ok .mark { color: var(--ok, #15803d); }
.billing-checks li.warn .mark { color: var(--warn, #b45309); }
.billing-checks li.block { color: var(--danger, #b91c1c); }
.billing-preview-sum { width: 100%; }
.billing-preview-sum td.num { text-align: right; }
.billing-preview-sum tr.sum td { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--line); }
.billing-preview .billing-actions .billing-back { margin-right: auto; }
@media (max-width: 900px) { .billing-preview-grid { grid-template-columns: 1fr; } .billing-preview-pdf iframe { height: 70vh; } }
@media (max-width: 700px) { .billing-large { inset: 0; padding: 0 .75rem; } .billing-large .billing-editor-bar,
  .billing-large .billing-actions { margin-left: -.75rem; margin-right: -.75rem; padding-left: .75rem; padding-right: .75rem; } }

/* KI fragen: Vorschaubild eines Gutachten-Fotos in den Quellen, Abschnitt „Fotos für KI fragen“ (0.233) */
.kbq-thumb { display: block; max-width: 160px; max-height: 120px; margin-top: .3rem; border-radius: 4px; border: 1px solid var(--line); }
.kbq-photos h3 { margin-top: 0; }

/* Bautagebuch per Link mit Lesebestätigung (I22, 0.234) und Punkte im Firmen-Link (I16) */
.diary-share-list tr.inactive td { opacity: .55; }
.diary-share-list td[data-seen] { white-space: nowrap; }
.portal-points { list-style: none; padding: 0; margin: 0 0 1rem; }
.portal-points li { border: 1px solid var(--line, #ddd); border-radius: 8px; padding: .5rem .75rem; margin-bottom: .5rem; }
.portal-points li.late { border-color: var(--ds-red, #b00000); }
.portal-points li p { margin: 0; }

/* Quickchat: Dialog „Neuer Chat“ mit Fotos, Hinzufügen und gewählten Personen (I7, 0.234) */
.qc-av img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.qc-chosen { display: flex; flex-wrap: wrap; gap: .35rem; min-height: 1.8rem; align-items: center; margin-bottom: .5rem; }
.qc-chip { border: 1px solid var(--accent); color: var(--accent); background: var(--surface); border-radius: 999px; padding: .1rem .6rem; font-size: .85rem; cursor: pointer; }
.qc-pick { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; }
.qc-pick .qc-who { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.qc-add { flex: 0 0 auto; white-space: nowrap; }
.qc-add input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.qc-add .qc-add-on { display: none; }
.qc-add:has(input:checked) { border-color: var(--accent); color: var(--accent); }
.qc-add:has(input:checked) .qc-add-on { display: inline; }
.qc-add:has(input:checked) .qc-add-off { display: none; }
.qc-add:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-when-mode][hidden], [data-when-external][hidden] { display: none; }

/* Gewerke (seit 0.237) */
.trade-dot { display: inline-block; width: .75rem; height: .75rem; border-radius: 50%; vertical-align: middle; border: 1px solid var(--line); }
.trade-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .25rem .75rem; margin: .5rem 0 1rem; }
.trade-pick label.check { font-weight: normal; }
table.trades .row-actions { white-space: nowrap; }
.project-trades .trade-edit { margin: 1rem 0; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.project-trades .trade-edit h3 { margin-top: 0; }
.trades-admin .trade-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.trades-admin .trade-row input { width: auto; flex: 0 0 auto; }
.trades-admin .trade-row input[name="atv"] { width: 5.5rem; }
.trades-admin .trade-row input[name="name_de"], .trades-admin .trade-row input[name="name_en"] { width: 15rem; flex: 1 1 12rem; }
.trades-admin .trade-row input[name="cost_group"] { width: 5rem; }
.trades-admin .trade-row input[name="sort"] { width: 4.5rem; }
.trades-admin .trade-row input[type="color"] { width: 2.75rem; padding: 2px; }
.trades-admin tr.inactive { opacity: .55; }
.project-trades input[type="color"], .trades-admin form.form input[type="color"] { width: 3.5rem; height: 2.4rem; padding: 2px; }

/* Mehr- und Minderkosten (seit 0.238) */
.trade-change-sums { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .5rem; margin: 1rem 0 .25rem; }
.trade-change-sums > div { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .75rem; display: flex; flex-direction: column; gap: .15rem; }
.trade-change-filter { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: end; margin: .75rem 0; }
.trade-change-filter label { display: flex; flex-direction: column; font-size: .85rem; }

/* Zeitplan (Gantt) am Projekt */
.gantt { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); margin: .5rem 0; }
.gantt-side { flex: 0 0 auto; border-right: 1px solid var(--line); background: var(--surface); z-index: 2; font-size: .85rem; }
.gantt-line { display: flex; align-items: center; height: 30px; box-sizing: border-box; border-bottom: 1px solid var(--line); white-space: nowrap; }
.gantt-line.head { height: 44px; font-weight: 600; color: var(--muted); font-size: .78rem; align-items: flex-end; padding-bottom: 4px; }
.gantt-line > span { padding: 0 .35rem; overflow: hidden; text-overflow: ellipsis; }
.gantt-line .g-n { width: 2rem; text-align: right; color: var(--muted); }
.gantt-line .g-name { width: 13rem; display: flex; align-items: center; gap: .35rem; }
.gantt-line .g-name a { color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.gantt-line .g-name a:hover { text-decoration: underline; }
.gantt-line .g-d { width: 5.6rem; font-variant-numeric: tabular-nums; }
.gantt-line .g-days { width: 2.6rem; text-align: right; font-variant-numeric: tabular-nums; }
.gantt-line .g-pred { width: 4rem; color: var(--muted); }
.gantt-line.section { font-weight: 700; background: color-mix(in srgb, var(--line) 45%, transparent); }
.gantt-line.nested .g-name { padding-left: 1.1rem; }
.gantt-line.on { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.gantt-line.late .g-d:nth-of-type(4) { color: var(--danger); }
.gantt-chart { flex: 1 1 auto; overflow-x: auto; overflow-y: hidden; position: relative; }
.gantt-canvas { position: relative; }
.g-head { position: absolute; left: 0; right: 0; height: 22px; border-bottom: 1px solid var(--line); background: var(--surface); }
.g-head.top { top: 0; }
.g-head.low { top: 22px; }
.g-head span { position: absolute; top: 0; height: 22px; line-height: 22px; font-size: .72rem; color: var(--muted); border-left: 1px solid var(--line); box-sizing: border-box; padding-left: 3px; overflow: hidden; white-space: nowrap; }
.g-head.low.zoom-day span { text-align: center; padding-left: 0; }
.g-off { position: absolute; top: 44px; bottom: 0; background: color-mix(in srgb, var(--muted) 10%, transparent); }
.g-off.hol { background: color-mix(in srgb, #e8590c 13%, transparent); }
.g-rowline { position: absolute; left: 0; right: 0; height: 30px; box-sizing: border-box; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); pointer-events: none; }
.g-rowline.section { background: color-mix(in srgb, var(--line) 30%, transparent); }
.g-today { position: absolute; top: 22px; bottom: 0; width: 0; border-left: 2px solid var(--danger); z-index: 1; pointer-events: none; }
.g-links { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 1; overflow: visible; }
.g-links path { fill: none; stroke: var(--muted); stroke-width: 1.2; }
.g-links marker path { fill: var(--muted); stroke: none; }
.g-bar { position: absolute; height: 16px; border-radius: 3px; box-sizing: border-box; z-index: 2; overflow: hidden; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15); }
.g-bar.late { box-shadow: inset 0 0 0 2px var(--danger); }
.g-bar .g-prog { position: absolute; left: 0; top: 0; bottom: 0; background: rgb(0 0 0 / .28); }
.gantt[data-edit] .g-bar, .gantt[data-edit] .g-ms { cursor: grab; touch-action: pan-y; }
.gantt[data-edit] .g-bar.dragging, .gantt[data-edit] .g-ms.dragging { cursor: grabbing; opacity: .8; outline: 2px dashed var(--accent); }
.g-grip { position: absolute; right: 0; top: 0; bottom: 0; width: 7px; cursor: ew-resize; background: rgb(255 255 255 / .35); }
.g-sec { position: absolute; height: 8px; background: #334155; z-index: 2; }
:root[data-theme=dark] .g-sec { background: #cbd5e1; }
.g-sec::before, .g-sec::after { content: ""; position: absolute; top: 8px; width: 0; height: 0; border-top: 6px solid #334155; }
.g-sec::before { left: 0; border-right: 6px solid transparent; }
.g-sec::after { right: 0; border-left: 6px solid transparent; }
:root[data-theme=dark] .g-sec::before, :root[data-theme=dark] .g-sec::after { border-top-color: #cbd5e1; }
.g-sec .g-prog { position: absolute; left: 0; top: 2px; height: 4px; background: #3fae6c; }
.g-ms { position: absolute; width: 14px; height: 14px; background: #1d2330; transform: rotate(45deg); z-index: 2; border-radius: 2px; }
:root[data-theme=dark] .g-ms { background: #e7e9ee; }
.g-ms.g-deadline { background: var(--danger); }
.g-ms.late { outline: 2px solid var(--danger); }
.g-label { position: absolute; height: 30px; line-height: 30px; font-size: .74rem; color: var(--muted); white-space: nowrap; z-index: 2; pointer-events: none; }
.gantt-legend { font-size: .8rem; }
.g-key { display: inline-block; width: 12px; height: 10px; vertical-align: middle; border-radius: 2px; }
.g-key.today { width: 2px; background: var(--danger); }
.g-key.off { background: color-mix(in srgb, #e8590c 20%, transparent); }
.g-key.late { box-shadow: inset 0 0 0 2px var(--danger); }
.schedule-add { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .6rem 0; }
.schedule-add input, .schedule-add select { width: auto; }
.schedule-add input[name="name"] { flex: 1 1 14rem; min-width: 10rem; }
.schedule-add input.short { width: 5rem; }
.schedule-add label { display: inline-flex; gap: .3rem; align-items: center; font-size: .85rem; }
.schedule-import { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.schedule-edit { border: 1px solid var(--line); border-radius: 6px; padding: .8rem; margin: .6rem 0; }
.schedule-edit h3 { margin: 0 0 .4rem; font-size: 1rem; }
.schedule-edit .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .5rem .8rem; }
.schedule-edit .grid label.wide { grid-column: span 2; }
.schedule-edit .inline-fields { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: flex-end; border: 1px solid var(--line); border-radius: 6px; padding: .4rem .7rem .6rem; margin: .6rem 0; }
.schedule-edit .inline-fields input[type="number"] { width: 6rem; }
.schedule-edit input[type="color"] { width: 3rem; padding: 2px; height: 2.2rem; }
.schedule-calendar { margin-top: .6rem; }
.schedule-calendar summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.schedule-calendar .inline-fields { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: flex-end; margin: .5rem 0; }
.schedule-calendar .inline-fields input, .schedule-calendar .inline-fields select { width: auto; }
.schedule-free { margin: .3rem 0; padding-left: 1.2rem; font-size: .9rem; }
.project-schedule .seg { display: inline-flex; gap: 2px; }
.project-schedule { container-type: inline-size; }
@container (max-width: 1000px) {
  .gantt-line .g-d, .gantt-line .g-pred { display: none; }
  .gantt-line .g-name { width: 11rem; }
}
.g-ms-icon { font-size: .8rem; line-height: 1; flex: 0 0 auto; }
.g-ms-icon::before { content: "◆"; }
.g-ms-icon.g-deadline { color: var(--danger); }
@media (max-width: 700px) {
  .gantt-line .g-d, .gantt-line .g-pred, .gantt-line .g-days { display: none; }
  .gantt-line .g-name { width: 8.5rem; }
  .gantt-line .g-n { width: 1.6rem; }
  .schedule-edit .grid label.wide { grid-column: auto; }
}
@media print {
  .gantt { border: 0; overflow: visible; }
  .gantt-chart { overflow: visible; }
}
.g-hind { position: absolute; height: 30px; background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--danger) 22%, transparent) 0 4px, transparent 4px 8px); z-index: 1; }
.g-hind.all { top: 44px; bottom: 0; height: auto; background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--danger) 10%, transparent) 0 4px, transparent 4px 8px); }
.g-ist { position: absolute; height: 4px; background: #2f9e44; border-radius: 2px; z-index: 2; }
.g-ist.delay { background: #e8590c; }
.g-key.ist { height: 4px; background: #2f9e44; }
.g-key.hind { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--danger) 35%, transparent) 0 3px, transparent 3px 6px); }
.schedule-filter { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; margin: .3rem 0 .5rem; font-size: .88rem; }
.schedule-filter select, .schedule-filter input { width: auto; }
.schedule-filter label { display: inline-flex; gap: .3rem; align-items: center; }
.schedule-out { display: inline-flex; gap: .3rem; align-items: center; margin-left: auto; }
.schedule-out select { width: auto; }
.schedule-weeks h2, .schedule-weeks h3 { font-size: 1rem; margin: .8rem 0 .3rem; }
.schedule-week { list-style: none; margin: 0; padding: 0; }
.schedule-week li { display: flex; gap: .6rem; align-items: flex-start; padding: .5rem .2rem; border-bottom: 1px solid var(--line); }
.schedule-week li .trade-dot, .schedule-week li .g-ms-icon { margin-top: .3rem; }
.schedule-week li .w-main { flex: 1 1 auto; }
.schedule-week li .w-dates { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.schedule-week li.late .w-dates { color: var(--danger); }
.schedule-week .ist { color: #2f9e44; }
.schedule-week .hind { color: var(--danger); }
.schedule-share { margin-top: .6rem; }
.schedule-share summary, .schedule-mspdi summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.schedule-share-trades { display: flex; flex-wrap: wrap; gap: .3rem 1rem; border: 1px solid var(--line); border-radius: 6px; padding: .4rem .7rem; }
.schedule-share input.short { width: 5rem; }
.schedule-shares tr.inactive { opacity: .55; }
.schedule-links { border: 1px solid var(--accent); border-radius: 6px; padding: .5rem .8rem; margin: .5rem 0; }
.schedule-links ul { list-style: none; padding: 0; margin: 0; }
.schedule-links li { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .3rem 0; }
.schedule-links li input { flex: 1 1 18rem; min-width: 12rem; font-size: .82rem; }
.schedule-public main { max-width: 60rem; }
.schedule-public tr.section td { background: color-mix(in srgb, var(--line) 45%, transparent); }
/* Zeitplan: offene Protokollpunkte aus Baubesprechungen */
.g-pt-icon { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #7048e8; flex: 0 0 auto; margin-right: .3rem; vertical-align: -1px; }
.gantt-line.points .g-name { color: var(--muted); font-style: italic; }
.g-pt { position: absolute; z-index: 3; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: #7048e8; color: #fff;
  font-size: .65rem; line-height: 16px; text-align: center; text-decoration: none; box-sizing: border-box; }
.g-pt.late { background: var(--danger); }
.g-pt:hover, .g-pt:focus-visible { outline: 2px solid var(--text); text-decoration: none; }
.schedule-week.points li.late .w-dates { color: var(--danger); }
.schedule-week li .g-pt-icon { margin-top: .3rem; }
@media print { .g-pt { print-color-adjust: exact; -webkit-print-color-adjust: exact; } }
.schedule-copy, .schedule-mspdi { margin-top: .75rem; }
.schedule-copy .hint { flex-basis: 100%; margin: 0; }
.schedule-mspdi form { margin-top: .5rem; }

/* Ressourcenplanung (Wochenraster und Reiter am Projekt) */
.resources-filter .resources-nav { display: inline-flex; gap: .25rem; margin-left: auto; flex-wrap: wrap; }
.resources-grid { font-variant-numeric: tabular-nums; }
.resources-grid th.res-name, .resources-grid td.res-name { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 12rem; text-align: left; }
.resources-grid th.res-now { box-shadow: inset 0 -3px 0 var(--accent); }
.resources-grid td.res-cell { white-space: nowrap; }
.resources-grid tr.res-sub td { font-size: .9em; color: var(--muted); }
.resources-grid tr.res-sub td.res-name { padding-left: 1.6rem; }
.res-ok { background: color-mix(in srgb, #2e9e4f 14%, transparent); }
.res-high { background: color-mix(in srgb, #c98a00 22%, transparent); }
.res-over { background: color-mix(in srgb, var(--danger) 22%, transparent); }
.resources-grid td.res-over strong, .badge.res-over { color: var(--danger); }
.res-key { display: inline-block; width: .9em; height: .9em; border-radius: 2px; vertical-align: -.1em; margin-left: .5em; }
.resources-add { margin-top: 1rem; }
.resources-add > summary { cursor: pointer; font-weight: 600; }
.project-resources, [data-resources], .dtab[data-tab=resources] { min-width: 0; max-width: 100%; }
.project-resources .table-wrap, .project-resources .table-scroll, [data-resources] .table-scroll { overflow-x: auto; max-width: 100%; }

/* GAEB-Import (0.242): LV-Seite und Liste im Reiter „Gewerke“ */
.trades-gaeb { margin-top: 1.25rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.trades-gaeb h3 { margin: 0 0 .5rem; }
.gaeb-import form { margin-top: .5rem; }
.badge.boq-booked { border-color: #0e9384; color: #0e9384; }
.badge.boq-applied { border-color: #2563eb; color: #2563eb; }
.badge.boq-type { font-size: .75em; margin-left: .25rem; }
.boq-warn { border-left: 3px solid var(--ds-amber, #d97706); padding: .35rem .6rem; background: color-mix(in srgb, #d97706 8%, transparent); border-radius: 4px; }
.boq-panels { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; margin: 1rem 0; }
.boq-page fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.boq-panels .card { margin: 0; }
.boq-items tr.boq-title td { background: var(--surface); }
.boq-items tr.boq-not-counted td { color: var(--muted, #6b7280); }
.boq-items details summary { cursor: pointer; }
.boq-long { white-space: pre-wrap; font-size: .9em; color: var(--muted, #4b5563); margin: .35rem 0 .25rem; max-width: 60rem; }
@media (max-width: 900px) { .boq-panels { grid-template-columns: 1fr; } }

/* Dateiablage am Projekt */
.ablage-folders a { align-items: flex-start; }
.ablage-folders .ablage-members { font-size: .8em; }
.ablage-folders .drop-on, .ablage.drop-on { outline: 2px dashed var(--accent); outline-offset: -2px; }
.ablage-head { display: flex; gap: .75rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .5rem; }
.ablage-head details.inline-details { display: inline-block; }
.ablage-move select { max-width: 14rem; font-size: .85em; padding: .1rem .3rem; }
.ablage-new { margin-top: .5rem; }
.ablage li[draggable="true"] { cursor: grab; }
.ablage.uploading { opacity: .6; }
.ablage-grid { grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr); }
@media (max-width: 800px) { .ablage-grid { grid-template-columns: minmax(0, 1fr); } }
.ablage .doc-list li .doc-main { flex: 1 1 14rem; min-width: 0; overflow-wrap: anywhere; }
.ablage .doc-list li .doc-main .sub { display: block; }
.ablage .doc-list li .doc-actions { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; justify-content: flex-end; flex: 0 1 18rem; }
.ablage .doc-list li { flex-wrap: wrap; }
.ablage .akte-search { display: flex; gap: .5rem; align-items: center; }
.ablage .akte-search input { flex: 1; }
/* Ordnervorlage (Administration) */
.folder-templates .folder-template-row { display: grid; grid-template-columns: minmax(10rem, 2fr) minmax(8rem, 1fr) minmax(8rem, 1fr) 4.5rem; gap: .4rem; align-items: center; }
.folder-templates .folder-template-row > button { justify-self: start; }
.folder-templates .folder-template-row > label.check { grid-column: 1 / 3; }
.folder-templates td label.check { font-size: .9em; }
.folder-templates .folder-template-row > * { margin: 0; min-width: 0; }
.folder-templates td label.check { display: block; white-space: nowrap; }
@media (max-width: 1100px) { .folder-templates .folder-template-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
/* Planverwaltung (Reiter „Pläne“) */
.drawings-filter { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .25rem 0 .75rem; }
.drawings-filter input[type=search] { flex: 1 1 14rem; }
.badge.drawing-index { font-weight: 600; font-variant-numeric: tabular-nums; }
.badge.muted { opacity: .65; }
.drawings-list tr.drawing-revisions td { border-top: none; padding-top: 0; }
.drawings-list tr.drawing-revisions ul.plain { list-style: none; padding: 0; margin: .3rem 0; }
.drawings-list tr.drawing-revisions li { padding: .15rem 0; }
.drawings-list tr.drawing-form > td { background: var(--surface-2, transparent); }
.drawing-new { margin-top: .75rem; }
.drawings-filter select { width: auto; flex: 0 1 13rem; margin: 0; }
.drawings-filter input, .drawings-filter button { margin: 0; }
.drawings-list td.row-actions { min-width: 7rem; }
/* Auswahlkästchen in Listen nicht auf volle Breite ziehen (globale Regel input { width: 100% }). */
.list td input[type=checkbox], .list td input[type=radio] { width: auto; margin: 0 .3rem 0 0; vertical-align: middle; }

/* Prüflauf für Pläne (0.249) */
.badge.review-approved { border-color: var(--accent); color: var(--accent); }
.badge.review-comments, .badge.review-running { border-color: var(--ds-amber); color: var(--ds-amber); }
.badge.review-rejected { border-color: var(--danger, #b42318); color: var(--danger, #b42318); }
.badge.review-cancelled { opacity: .7; }
.review-steps, .review-tasks { margin: .3rem 0 .6rem; padding-left: 1.4rem; }
.review-steps li, .review-tasks li { padding: .2rem 0; }
.review-tasks li.active { font-weight: 500; }
.review-tasks li.overdue .badge.warn { border-color: var(--danger, #b42318); color: var(--danger, #b42318); }
.review-decide { margin: .4rem 0 .2rem; max-width: 40rem; }
.review-comment { margin: .2rem 0; color: var(--muted, inherit); }
.review-run { border-top: 1px solid var(--border, #e5e7eb); padding: .5rem 0; }
.review-start { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .6rem 0; }
.review-start select { width: auto; flex: 1 1 18rem; margin: 0; }
[data-review-link] input { width: 100%; margin: .3rem 0; }
.candidate-projects-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; justify-content: space-between; margin-bottom: .75rem; }
.candidate-projects-actions .inline-form { flex: 1 1 320px; align-items: center; }
.candidate-projects-actions select { flex: 1 1 220px; }
/* Name mit Sprachwahl (Makro lang_name, seit 0.252.0) */
.lang-name { display: inline-flex; align-items: stretch; min-width: 14rem; max-width: 22rem; width: 100%; }
.lang-name input[data-lang] { flex: 1 1 auto; min-width: 0; }
.lang-name.ready input[data-lang] { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.lang-name:not(.ready) { gap: .4rem; max-width: none; }
.lang-flags { display: inline-flex; align-items: center; gap: .15rem; padding: 0 .3rem; border: 1px solid var(--line); border-left: 0; border-radius: 0 var(--radius) var(--radius) 0; background: var(--surface); }
.lang-flag { background: none; border: 2px solid transparent; border-radius: 6px; padding: 0 .15rem; font-size: 1.05rem; line-height: 1.4; cursor: pointer; box-shadow: none; min-height: 0; }
.lang-flag.on { border-color: var(--accent); }
.lang-flag.empty { opacity: .35; filter: grayscale(1); }
.lang-flag:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lang-rows select { min-width: 9rem; }
.lang-rows input[type=color] { width: 2.6rem; height: 2.2rem; padding: .15rem; }
.lang-rows .lang-name { min-width: 12rem; max-width: 16rem; }

/* Personal › Aus Benutzern übernehmen (0.254) */
.from-users { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1rem; align-items: start; }
.from-users-options h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 1rem 0 .3rem; }
.from-users-options h2 + h3 { margin-top: .4rem; }
.from-users-options label.check { display: flex; gap: .4rem; align-items: center; margin: .25rem 0; }
.from-users-options input[type=date] { width: auto; margin: 0; }
.from-users-note { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: .5rem .8rem; background: var(--bg); }
.from-users-filter label.check { display: inline-flex; gap: .3rem; align-items: center; }
.from-users tr.off td { color: var(--muted); }
.from-users-choice { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .3rem; }
.badge.from-users-new { border-color: var(--ds-green); color: var(--ds-green); }
.badge.from-users-link { border-color: var(--accent); color: var(--accent); }
.badge.from-users-maybe { border-color: var(--ds-amber); color: var(--ds-amber); }
@media (max-width: 900px) { .from-users { grid-template-columns: minmax(0, 1fr); } }

/* Benutzer entfernen (0.261): Dialog und Knopf in der Benutzerliste */
.user-remove { max-width: 52rem; }
.user-remove h3 { margin: 1.25rem 0 .5rem; }
.user-remove .warn { background: var(--warn-bg); border-radius: 6px; padding: .5rem .75rem; }
.user-remove table td.num { text-align: right; white-space: nowrap; }
.user-remove table td:nth-child(2) { text-align: right; }
.user-remove .choice { display: block; border: 1px solid var(--border); border-radius: 8px; padding: .6rem .8rem; }
.user-remove .choice:has(input:checked) { border-color: var(--danger); }
.user-remove .choice:has(input:disabled) { opacity: .65; }
td.row-action { text-align: right; white-space: nowrap; padding-left: 0; }
.mon-maint { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: 1rem; }
.mon-maint form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }

/* Messen und Markieren im Plan (0.292.1) */
.markup-toolbar { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: .5rem 0; }
.markup-toolbar .sep { width: 1px; height: 1.6rem; background: var(--line); margin: 0 .25rem; }
.markup-toolbar .grow { flex: 1; }
.markup-toolbar button.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.markup-color { width: 1.4rem; height: 1.4rem; border-radius: 50%; padding: 0; border: 2px solid var(--surface); background: var(--c); cursor: pointer; }
.markup-color.on { outline: 2px solid var(--text, #1f2430); outline-offset: 1px; }
.markup-layout { display: flex; gap: 1rem; align-items: flex-start; }
.markup-canvas { flex: 1; min-width: 0; height: 72vh; position: relative; overflow: hidden; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius); touch-action: none; cursor: grab; }
.markup-canvas:not([data-tool="select"]) { cursor: crosshair; }
.markup-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.markup-stage img { display: block; max-width: none; background: #fff; user-select: none; }
.markup-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.markup-panel { width: 22rem; flex: none; }
.markup-list li { display: flex; gap: .5rem; align-items: flex-start; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.markup-list li .grow { flex: 1; }
.markup-dot { width: .8rem; height: .8rem; border-radius: 3px; background: var(--c); margin-top: .3rem; flex: none; }
.markup-sums { display: grid; grid-template-columns: 1fr auto; gap: .2rem .75rem; margin: .75rem 0; }
.markup-sums dd { margin: 0; font-weight: 600; text-align: right; }
@media (max-width: 900px) { .markup-layout { flex-direction: column; } .markup-panel { width: auto; } .markup-canvas { width: 100%; height: 60vh; } }

/* Firmen-Link: Sprache umschalten (0.292.4) */
/* Sprachwahl im Portal als Flaggen (Bug 20, 0.300.1): aktive Flagge voll und mit Akzentrahmen, andere gedämpft */
.portal-lang { float: right; margin-top: .25rem; display: flex; gap: .5rem; align-items: center; }
.portal-lang a, .portal-lang .portal-lang-active { display: inline-flex; border: 1px solid transparent; border-radius: 3px; opacity: .55; }
.portal-lang a:hover, .portal-lang a:focus-visible { opacity: 1; }
.portal-lang .portal-lang-active { opacity: 1; border-color: var(--accent); }
.portal-lang img { display: block; width: 24px; height: 16px; border-radius: 2px; }

/* Spracheingabe (Diktat, 0.294.3): Mikrofon-Knopf unter mehrzeiligen Feldern (static/dictate.js) */
.dictate-bar { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; margin-top: .2rem; font-size: .85rem; color: var(--muted); }
.dictate-btn { padding: .1rem .45rem; line-height: 1.4; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.dictate-btn.recording { background: #c62828; border-color: #c62828; color: #fff; animation: dictate-pulse 1.2s ease-in-out infinite; }
.dictate-btn:disabled { opacity: .5; cursor: progress; }
@keyframes dictate-pulse { 50% { box-shadow: 0 0 0 4px rgba(198, 40, 40, .25); } }
textarea.dictated::selection, .rich-area span.dictated { background: rgba(120, 120, 120, .22); }
.rich-area span.dictated { border-radius: 3px; }

/* Diktieren und verteilen (C1, 0.294.4): Knopf und Textfeld oben im Formular (static/dictate-fields.js) */
.dictate-fields { margin: 0 0 .75rem; }
.dictate-fields-panel { margin-top: .5rem; padding: .75rem; border: 1px dashed var(--ai-line, var(--line)); border-radius: var(--radius); background: var(--ai-bg, var(--surface)); }
.dictate-fields-panel textarea { width: 100%; }
.dictate-fields-panel .actions { align-items: center; }

/* Vergütung und Gehaltsrunden (0.349) */
.pay-chart-wrap { max-width: 720px; }
.pay-chart { width: 100%; height: auto; display: block; }
.pay-chart .grid { stroke: var(--line); stroke-width: 1; }
.pay-chart text { fill: var(--muted); font-size: 11px; }
.pay-chart .actual { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.pay-chart .full { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
.pay-chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; }
.pay-chart .dot.planned { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.pay-legend .lg { display: inline-block; width: 18px; height: 0; vertical-align: middle; margin: 0 4px 0 10px; border-top: 2.5px solid var(--accent); }
.pay-legend .lg.full { border-top: 1.5px dashed var(--muted); }
.pay-legend .lg.planned { width: 9px; height: 9px; border: 2px solid var(--accent); border-radius: 50%; }
.pay-history tr.planned td { color: var(--muted); }
.pay-history .positive, .salary-proposals .positive { color: var(--ds-green); }
.pay-items tr.muted td { color: var(--muted); }
.pay-new { margin-top: 12px; }
.pay-new summary { cursor: pointer; color: var(--accent); }
.mono { font-variant-numeric: tabular-nums; white-space: nowrap; }
.wage-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.steps-editor select { max-width: 14rem; }
.salary-proposals .decide { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.own-pay .metric-v { font-size: 1.5rem; margin: 0; }
.pay-items .row-actions { white-space: nowrap; }
.pay-items .row-actions input[type=date] { width: 9.5rem; }
.inline-form select[name=visibility] { width: auto; }
/* Glückwunsch zu Geburtstag oder Firmenjubiläum (0.342, greeting/_dialog.html, greeting.js) */
.greeting-dialog { width: min(480px, calc(100vw - 2rem)); margin: auto; padding: 0; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 18px 50px rgba(0, 0, 0, .25); }
.greeting-dialog:not([open]) { position: relative; margin: 1rem auto; }
.greeting-dialog::backdrop { background: rgba(10, 14, 28, .55); }
.greeting-fireworks { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; }
.greeting-body { position: relative; padding: 1.5rem 1.5rem 1.25rem; text-align: center;
  border-top: 4px solid var(--accent); border-radius: var(--radius); }
.greeting-icon { font-size: 2.5rem; margin: 0 0 .25rem; }
.greeting-body h2 { margin: 0 0 1rem; font-size: 1.25rem; line-height: 1.4; }
.greeting-line { display: block; }
.greeting-line + .greeting-line { margin-top: .5rem; }
.greeting-body .actions { justify-content: center; }
@media (prefers-reduced-motion: reduce) {
  .greeting-body { background-image: radial-gradient(circle at 12% 20%, color-mix(in srgb, var(--accent) 22%, transparent) 0 3px, transparent 4px),
    radial-gradient(circle at 88% 30%, color-mix(in srgb, var(--accent) 22%, transparent) 0 3px, transparent 4px),
    radial-gradient(circle at 20% 85%, color-mix(in srgb, var(--accent) 22%, transparent) 0 2px, transparent 3px),
    radial-gradient(circle at 80% 80%, color-mix(in srgb, var(--accent) 22%, transparent) 0 2px, transparent 3px); }
}
} /* Ende @layer legacy */

/* ---------- Ebene components: Bausteine der neuen Oberfläche (ab 0.351) ----------
   Klassen mit Vorsilbe ui-, erzeugt über die Makros in crates/pcs_app/templates/ui.html. Werte nur aus
   Stufe 2 und 3 der Ebene tokens. Diese Ebene gewinnt gegen legacy; deshalb hier keine alten Klassen
   umgestalten, sondern neue Bausteine anlegen und die Seiten nach und nach darauf umstellen. */
@layer components {
/* Tastatur-Fokus sichtbar (WCAG 2.4.7) für Links, Knöpfe und Aufklapper; Eingabefelder behalten ihren eigenen Fokus */
:where(a, button, summary, [tabindex]:not(input, select, textarea)):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Seitenkopf: Titel, Unterzeile, Aktionen rechts */
.ui-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--p-space-3) var(--ui-gap);
           flex-wrap: wrap; margin: 0 0 var(--p-space-4); }
.ui-head-t { display: flex; flex-direction: column; gap: var(--p-space-1); min-width: 0; }
.ui-head-t > h1 { margin: 0; overflow-wrap: anywhere; }
.ui-head-t > .ui-sub { color: var(--muted); }
.ui-head-t > p.ui-sub { margin: 0; }
.ui-actions { display: flex; flex-wrap: wrap; gap: var(--p-space-2); align-items: center; }

/* Karte mit Kopf (Titel, Anzahl, Aktionen) */
.ui-card { background: var(--ui-card-bg); border: 1px solid var(--ui-card-line); border-radius: var(--ui-card-radius);
           box-shadow: var(--ui-card-shadow); padding: var(--ui-card-pad); min-width: 0; }
.ui-card-h { display: flex; align-items: center; gap: var(--p-space-2); margin: 0 0 var(--p-space-3); }
.ui-card-h > h2 { margin: 0; font-size: 1.05rem; flex: 1; min-width: 0; }
.ui-count { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }

/* Filter-Chips: Links oder Knöpfe, „on“ = aktiv, mit Anzahl und Entfernen */
.ui-chips { display: flex; flex-wrap: wrap; gap: var(--p-space-2); margin: 0 0 var(--p-space-3); padding: 0; list-style: none; }
.ui-chip { display: inline-flex; align-items: center; gap: var(--p-space-1); min-height: var(--ui-target);
           padding: 0 var(--p-space-3); border-radius: var(--ui-chip-radius); background: var(--ui-chip-bg);
           color: var(--text); border: 1px solid transparent; font: inherit; font-size: .85rem; cursor: pointer; }
.ui-chip:hover { text-decoration: none; border-color: var(--line); }
.ui-chip.on { background: var(--ui-chip-on-bg); color: var(--ui-chip-on-text); font-weight: 600; }
.ui-chip .ui-count { font-size: .8rem; }
.ui-chip .ui-x { margin-left: var(--p-space-1); color: var(--muted); }

/* Leerer Zustand: Text und eine Aktion statt einer leeren Tabelle */
.ui-empty { display: flex; flex-direction: column; align-items: center; gap: var(--p-space-2); text-align: center;
            padding: var(--p-space-6) var(--p-space-4); color: var(--muted); }
.ui-empty > strong { color: var(--text); font-size: 1rem; }

/* Werkzeugleiste über Listen und Karten: links Suche/Filter, rechts Aktionen */
.ui-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--p-space-2) var(--p-space-3); margin: 0 0 var(--p-space-3); }
.ui-toolbar > .ui-grow { flex: 1 1 14rem; min-width: 0; }

/* Dialog (<dialog class="ui-dialog">): ohne Zusatzbibliothek, schließt mit Esc */
.ui-dialog { border: 1px solid var(--line); border-radius: var(--p-radius-l); padding: 0; color: var(--text);
             background: var(--surface); width: min(34rem, calc(100vw - 2rem)); box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.ui-dialog::backdrop { background: rgba(0,0,0,.35); }
.ui-dialog > form, .ui-dialog > .ui-dialog-b { padding: var(--p-space-5); }
.ui-dialog h2 { margin-top: 0; }
.ui-dialog .ui-actions { justify-content: flex-end; margin-top: var(--p-space-4); }

/* Raster für Karten und Kacheln; Spaltenzahl folgt der Breite des Behälters */
.ui-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--ui-grid-min, 16rem), 1fr)); gap: var(--ui-gap); }

/* Kennzahl-Kachel: großer Wert, Beschriftung, optional Hinweis; als Link oder ohne */
.ui-metric { display: flex; flex-direction: column; gap: var(--p-space-1); color: var(--text); min-width: 0;
             background: var(--ui-card-bg); border: 1px solid var(--ui-card-line); border-radius: var(--ui-card-radius);
             box-shadow: var(--ui-card-shadow); padding: var(--ui-card-pad); }
a.ui-metric:hover { text-decoration: none; border-color: var(--accent); }
.ui-metric > strong { font-size: 1.6rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ui-metric > span { color: var(--muted); font-size: .85rem; }
.ui-metric > small { color: var(--muted); font-size: .8rem; }
.ui-metric > strong { order: -1; }
.ui-metric.is-alert { border-color: color-mix(in srgb, var(--danger) 60%, transparent); }
.ui-metric.is-alert > strong { color: var(--danger); }
.kpi.is-alert strong { color: var(--danger); }
.rows li { flex-wrap: wrap; column-gap: .75rem; row-gap: .1rem; }
.rows .detail { white-space: normal; margin-left: auto; text-align: right; }
.ui-metric > strong.neg { color: var(--danger); }
.ui-metric > strong.pos { color: var(--ok-text); }

/* Befehlspalette (Strg K): Fenster oben mittig, Suchfeld, Liste mit Gruppen; static/palette.js */
.ui-palette-btn { display: inline-flex; align-items: center; gap: var(--p-space-1); }
.ui-palette-btn kbd, .ui-palette kbd { font: inherit; font-size: .72rem; color: var(--muted); border: 1px solid var(--line);
             border-radius: var(--p-radius-s); padding: 0 var(--p-space-1); line-height: 1.5; background: var(--surface); }
.ui-palette { margin: 12vh auto auto; padding: 0; width: min(40rem, calc(100vw - 2rem)); max-height: 70vh;
              border: 1px solid var(--line); border-radius: var(--p-radius-l); background: var(--surface); color: var(--text);
              box-shadow: 0 16px 48px rgba(0,0,0,.28); overflow: hidden; }
.ui-palette[open] { display: flex; flex-direction: column; }
.ui-palette::backdrop { background: rgba(0,0,0,.35); }
.ui-palette-q { display: flex; align-items: center; gap: var(--p-space-2); padding: var(--p-space-3) var(--p-space-4);
                border-bottom: 1px solid var(--line); margin: 0; }
.ui-palette-q > .ic { width: 1.1rem; height: 1.1rem; color: var(--muted); flex: none; }
.ui-palette-q > input::-webkit-search-cancel-button { display: none; }
.ui-palette-q > input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font-size: 1.05rem;
                        padding: var(--p-space-1) 0; box-shadow: none; outline: none; }
.ui-palette-list { overflow-y: auto; padding: var(--p-space-2); flex: 1; }
.ui-palette-sec { color: var(--muted); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
                  padding: var(--p-space-2) var(--p-space-3) var(--p-space-1); }
.ui-palette-list [role=option] { display: flex; align-items: baseline; gap: var(--p-space-2); min-height: var(--ui-target);
                  padding: var(--p-space-2) var(--p-space-3); border-radius: var(--p-radius-m); color: var(--text); }
.ui-palette-list [role=option]:hover { text-decoration: none; }
.ui-palette-list [role=option][aria-selected=true] { background: var(--ui-chip-on-bg); color: var(--accent); }
.ui-palette-list [role=option] > small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ui-palette-all { margin-top: var(--p-space-1); border-top: 1px solid var(--line); }
.ui-palette-none { color: var(--muted); padding: var(--p-space-4); text-align: center; margin: 0; }
.ui-palette-hint { margin: 0; padding: var(--p-space-2) var(--p-space-4); border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
@media (max-width: 1000px) { .ui-palette-btn { display: none; } }
@media (max-width: 700px) { .ui-palette-btn kbd, .ui-palette-q kbd { display: none; } .ui-palette { margin-top: var(--p-space-4); max-height: 85vh; } }

/* Gerüst „Arbeitsfläche“ (data-menu="work", ab 0.356): Leiste links mit Logo und Bereichen, Kontextleiste mit den
   Punkten des aktuellen Bereichs (data-ctx, static/shell.js), Pfad und Befehlspalette in der Kopfzeile.
   Nur auf großen Bildschirmen; auf dem Handy bleibt das Menü die Schublade hinter ☰. */
.ui-crumbs, .ui-palette-lbl, .ui-ctx-h { display: none; }
@media (min-width: 1001px) {
  [data-menu=work] { --side-w: var(--ui-rail-w); }
  [data-menu=work][data-ctx] { --side-w: calc(var(--ui-rail-w) + var(--ui-ctx-w)); }
  [data-menu=work] body:not(.auth-page) { padding-left: var(--side-w); }
  [data-menu=work] .topbar { position: sticky; top: 0; height: var(--top-h); padding: 0 1.25rem; gap: var(--p-space-3); }
  [data-menu=work] .topbar .brand { position: fixed; left: 0; top: 0; z-index: 3; width: var(--ui-rail-w); height: var(--top-h);
      display: flex; align-items: center; justify-content: center; padding: 0; overflow: hidden; background: var(--ui-rail-bg); }
  [data-menu=work] .topbar .brand span { display: none; }
  [data-menu=work] .topbar .brand .logo { max-width: 36px; height: 30px; }
  [data-menu=work] .tb-btn.nav-collapse, [data-menu=work] .globalsearch, [data-menu=work] #mainnav a.nav-extra,
  [data-menu=work] #mainnav .nav-hd, [data-menu=work] #mainnav .nav-head { display: none; }
  [data-menu=work] #mainnav { position: fixed; top: var(--top-h); left: 0; bottom: 0; z-index: 3; width: var(--ui-rail-w);
      display: flex; flex-direction: column; align-items: center; flex-wrap: nowrap; gap: 2px; padding: var(--p-space-2) 0;
      overflow-y: auto; background: var(--ui-rail-bg); border: 0; border-right: 1px solid var(--ui-rail-line); }
  /* Symbole der Leiste: einfache Punkte, Köpfe der Bereiche und die Punkte der Abschnitte (Arbeit, Weiteres) */
  [data-menu=work] #mainnav > a, [data-menu=work] #mainnav .nav-group:not(.nav-tree) > .nav-items > a,
  [data-menu=work] #mainnav .nav-tree > .nav-sec {
      display: flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; padding: 0; margin: 0;
      border: 0; border-radius: var(--p-radius-m); background: none; color: var(--ui-rail-text); font-size: 0; cursor: pointer; }
  [data-menu=work] #mainnav > a > span, [data-menu=work] #mainnav .nav-group:not(.nav-tree) > .nav-items > a > span,
  [data-menu=work] #mainnav .nav-tree > .nav-sec > :not(.ic) { display: none; }
  [data-menu=work] #mainnav .ic { display: block; width: 20px; height: 20px; }
  [data-menu=work] #mainnav .nav-chev, [data-menu=work] #mainnav .nav-cur { display: none; }
  [data-menu=work] #mainnav > a:hover, [data-menu=work] #mainnav .nav-group:not(.nav-tree) > .nav-items > a:hover,
  [data-menu=work] #mainnav .nav-tree > .nav-sec:hover { background: var(--ui-rail-on-bg); color: var(--ui-rail-on-text); text-decoration: none; }
  [data-menu=work] #mainnav > a.on, [data-menu=work] #mainnav .nav-group:not(.nav-tree) > .nav-items > a.on,
  [data-menu=work] #mainnav .nav-tree.has-on > .nav-sec { background: var(--ui-rail-on-bg); color: var(--ui-rail-on-text); box-shadow: none; }
  [data-menu=work] #mainnav .nav-group { display: flex; flex-direction: column; align-items: center; width: 100%; }
  [data-menu=work] #mainnav .nav-group:not(.nav-tree) > .nav-sec { display: block; width: 24px; height: 0; padding: 0; margin: var(--p-space-2) 0;
      border: 0; border-top: 1px solid rgba(255,255,255,.16); font-size: 0; background: none; }
  [data-menu=work] #mainnav .nav-group:not(.nav-tree) > .nav-items { display: flex; flex-direction: column; align-items: center; gap: 2px; position: static; }
  [data-menu=work] #mainnav .nav-tree > .nav-items { display: none; }
  /* Kontextleiste: Punkte des aktuellen Bereichs */
  [data-menu=work] #mainnav .nav-tree.has-on > .nav-items { display: flex; flex-direction: column; gap: 2px; position: fixed;
      left: var(--ui-rail-w); top: 0; bottom: 0; z-index: 2; width: var(--ui-ctx-w); padding: 0 var(--p-space-2) var(--p-space-4);
      overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); box-shadow: none; min-width: 0; }
  [data-menu=work] #mainnav .nav-tree.has-on > .nav-items > a { display: flex; align-items: center; gap: var(--p-space-2); width: auto;
      min-height: var(--ui-target); padding: var(--p-space-2) var(--p-space-3); border-radius: var(--p-radius-m); color: var(--text); white-space: nowrap; }
  [data-menu=work] #mainnav .nav-tree.has-on > .nav-items > a .ic { width: 18px; height: 18px; color: var(--muted); }
  [data-menu=work] #mainnav .nav-tree.has-on > .nav-items > a > span { display: inline; overflow: hidden; text-overflow: ellipsis; }
  [data-menu=work] #mainnav .nav-tree.has-on > .nav-items > a:hover { background: var(--bg); text-decoration: none; }
  [data-menu=work] #mainnav .nav-tree.has-on > .nav-items > a.on { background: var(--ui-chip-on-bg); color: var(--accent); font-weight: 600; }
  [data-menu=work] #mainnav .nav-tree.has-on > .nav-items > a.on .ic { color: var(--accent); }
  [data-menu=work] .ui-ctx-h { display: flex; align-items: center; height: var(--top-h); flex: none; padding: 0 var(--p-space-3); margin-bottom: var(--p-space-2);
      font-weight: 600; font-size: 1.05rem; border-bottom: 1px solid var(--line); color: var(--text); }
  /* Kopfzeile: Pfad links, Suche als breites Feld vor den Werkzeugen */
  [data-menu=work] .ui-crumbs:not([hidden]) { display: flex; align-items: center; min-width: 0; gap: var(--p-space-2); font-size: .9rem; color: var(--muted); overflow: hidden; white-space: nowrap; }
  [data-menu=work] .ui-crumbs > * + *::before { content: "›"; margin-right: var(--p-space-2); color: var(--muted); }
  [data-menu=work] .ui-crumbs > a { color: var(--muted); }
  [data-menu=work] .ui-crumbs > [aria-current] { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
  [data-menu=work] .ui-palette-btn { width: min(22rem, 30vw); justify-content: flex-start; gap: var(--p-space-2); padding: 0 var(--p-space-2) 0 var(--p-space-3);
      border: 1px solid var(--line); border-radius: var(--p-radius-m); background: var(--bg); color: var(--muted); font-size: .9rem; }
  [data-menu=work] .ui-palette-btn:hover { background: var(--bg); border-color: var(--muted); }
  [data-menu=work] .ui-palette-lbl { display: inline; flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  [data-menu=work] .tb-tools { margin-left: auto; }
}

/* Gespeicherte Ansichten über einer Liste (lists/_saved.html): Chips, aktive mit ✕, „Ansicht speichern“ klappt ein
   kleines Formular auf */
.ui-views { align-items: center; }
.ui-view { display: inline-flex; align-items: center; }
.ui-view:has(.ui-view-del) > .ui-chip { border-top-right-radius: 0; border-bottom-right-radius: 0; padding-right: var(--p-space-2); }
.ui-view-del { display: inline-flex; margin: 0; }
.ui-view-del > .ui-x { min-height: var(--ui-target); padding: 0 var(--p-space-2) 0 var(--p-space-1); margin: 0; border: 0;
    border-radius: 0 var(--ui-chip-radius) var(--ui-chip-radius) 0; background: var(--ui-chip-on-bg); color: var(--ui-chip-on-text); font: inherit; font-size: .8rem; cursor: pointer; }
.ui-view-save { display: inline-flex; align-items: center; gap: var(--p-space-2); }
.ui-view-save > summary { list-style: none; color: var(--accent); background: transparent; border: 1px dashed var(--line); }
.ui-view-save > summary::-webkit-details-marker { display: none; }
.ui-view-form { display: inline-flex; align-items: center; gap: var(--p-space-2); margin: 0; }
.ui-view-form input { width: 14rem; max-width: 50vw; }

/* Liste mit Vorschau rechts (Firmen, Kontakte …): ab 1200 px Breite, static/listpreview.js lädt die Vorschau */
.ui-split { display: block; }
.ui-preview { display: none; }
@media (min-width: 1200px) {
  .ui-split:has(> .ui-preview) { display: grid; grid-template-columns: minmax(0, 1fr) var(--ui-preview-w); gap: var(--ui-gap); align-items: start; }
  .ui-preview { display: flex; flex-direction: column; gap: var(--p-space-3); position: sticky; top: calc(var(--top-h) + var(--p-space-4));
      background: var(--ui-card-bg); border: 1px solid var(--ui-card-line); border-radius: var(--ui-card-radius); box-shadow: var(--ui-card-shadow);
      padding: var(--ui-card-pad); min-height: 10rem; max-height: calc(100vh - var(--top-h) - 2rem); overflow-y: auto; }
  .ui-preview-hint { margin: auto; color: var(--muted); text-align: center; }
  .ui-preview dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--p-space-1) var(--p-space-3); margin: 0; }
  .ui-preview dt { color: var(--muted); }
  .ui-preview dd { margin: 0; overflow-wrap: anywhere; }
  .ui-preview ul { margin: 0; padding-left: 1.1rem; }
  .ui-preview-open { align-self: flex-start; }
  table.list tr[data-preview] { cursor: pointer; }
  table.list tr.ui-sel > td { background: var(--ui-chip-on-bg); }
}

/* Dichte „Karten“ (data-lists="cards"): Tabellen der Listen als Kacheln, jede Spalte mit ihrer Überschrift */
[data-lists=cards] .list-tile table.list, [data-lists=cards] .list-tile table.list tbody { display: block; }
[data-lists=cards] .list-tile table.list thead { display: none; }
[data-lists=cards] .list-tile table.list tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: var(--p-space-3); }
[data-lists=cards] .list-tile table.list tr { display: flex; flex-direction: column; gap: var(--p-space-1); padding: var(--p-space-3);
    border: 1px solid var(--line); border-radius: var(--ui-card-radius); background: var(--surface); }
[data-lists=cards] .list-tile table.list td { display: flex; gap: var(--p-space-2); padding: 0; border: 0; min-width: 0; }
[data-lists=cards] .list-tile table.list td:empty { display: none; }
[data-lists=cards] .list-tile table.list td[data-label]::before { content: attr(data-label); flex: 0 0 7.5rem; color: var(--muted); font-size: .85rem; }
[data-lists=cards] .list-tile table.list td:first-child { display: block; font-weight: 600; font-size: 1.02rem; }
[data-lists=cards] .list-tile table.list td:first-child .badge, [data-lists=cards] .list-tile table.list td:first-child .cat-chip { white-space: normal; font-weight: 500; }
[data-lists=cards] .list-tile table.list td:first-child::before { display: none; }
[data-lists=cards] .list-tile table.list tr#more-row, [data-lists=cards] .list-tile table.list td[colspan] { grid-column: 1 / -1; border: 0; background: none; }
[data-lists=cards] .list-tile table.list td[colspan]::before { display: none; }
@media (min-width: 1200px) { [data-lists=cards] .list-tile table.list tr.ui-sel { border-color: var(--accent); } }

/* Detail-Bauteil (ab 0.361, pcs_app::detail): Kopf als Karte mit Zeichen, kleiner Zeile, Name, Angaben und Aktionen,
   darunter Phasen-Leiste und Reiter; Reiter „Übersicht“ mit Kennzahlen und Karten (.ui-dgrid) */
.chead.ui-dhead { background: var(--ui-card-bg); border: 1px solid var(--ui-card-line); border-radius: var(--ui-card-radius);
    box-shadow: var(--ui-card-shadow); overflow: hidden; }
.ui-dhead > .ch-top { background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%);
    padding: var(--p-space-4); gap: var(--p-space-4); }
.ui-dhead-ic { flex: 0 0 auto; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--line); color: var(--accent); font-weight: 700; font-size: 1.2rem;
    letter-spacing: .02em; overflow: hidden; }
.ui-dhead-ic img { width: 100%; height: 100%; object-fit: contain; }
.ui-dhead .ch-main { flex: 1 1 18rem; min-width: 0; }
.ui-dhead-kick { display: flex; flex-wrap: wrap; align-items: center; gap: var(--p-space-2); margin: 0 0 2px; font-size: .85rem; color: var(--muted); }
.ui-dhead-kick .ui-dhead-no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
.ui-dhead h1 { font-size: 1.5rem; line-height: 1.25; }
.ui-dhead .ch-line { margin: 2px 0 0; }
.ui-dhead > .dtabs { border-top: 1px solid var(--line); padding: 0 var(--p-space-3); }

.ui-phases { display: flex; list-style: none; margin: 0; padding: 0 var(--p-space-4) var(--p-space-3); gap: 3px; overflow-x: auto; scrollbar-width: none; }
.ui-phases::-webkit-scrollbar { display: none; }
.ui-phase { flex: 1 1 0; min-width: 6.5rem; position: relative; padding: 8px 10px 0; font-size: .82rem; color: var(--muted);
    border-top: 4px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-phase:first-child { border-top-left-radius: 2px; }
.ui-phase > span { overflow: hidden; text-overflow: ellipsis; }
.ui-phase.is-done { border-top-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--text); }
.ui-phase.is-done > span::before { content: "✓ "; color: var(--accent); }
.ui-phase.is-on { border-top-color: var(--accent); color: var(--accent); font-weight: 600; }
.ui-phase.is-lost { border-top-color: var(--danger); color: var(--danger); font-weight: 600; }

.ui-dmetrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: var(--ui-gap); margin-bottom: var(--ui-gap); }
.ui-dmetrics > .ui-metric { background: var(--ui-card-bg); border: 1px solid var(--ui-card-line); border-radius: var(--ui-card-radius);
    box-shadow: var(--ui-card-shadow); padding: var(--p-space-3) var(--p-space-4); min-width: 0; }
.ui-dmetrics > .ui-metric > strong { font-size: 1.35rem; overflow-wrap: break-word; hyphens: auto; }
.ui-dmetrics > .ui-metric > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-dgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: var(--ui-gap); align-items: start; }
.ui-dgrid > .card { margin: 0; }
.ui-dgrid .card-h { display: flex; justify-content: space-between; align-items: baseline; gap: var(--p-space-2); margin-bottom: var(--p-space-2); }
.ui-dgrid .card-h h2 { margin: 0; font-size: 1rem; }
.ui-kv { display: grid; grid-template-columns: minmax(6rem, max-content) 1fr; margin: 0; }
.ui-kv > dt, .ui-kv > dd { padding: 7px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); margin: 0; }
.ui-kv > dt { color: var(--muted); padding-right: var(--p-space-4); }
.ui-kv > dd { overflow-wrap: anywhere; }
.ui-kv > dt:nth-last-of-type(1), .ui-kv > dd:last-of-type { border-bottom: 0; }
.ui-people { list-style: none; margin: 0; padding: 0; }
.ui-people > li { display: flex; align-items: center; gap: var(--p-space-3); padding: 7px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.ui-people > li:last-child { border-bottom: 0; }
.ui-people .ui-av { flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
    background: var(--ui-chip-on-bg); color: var(--ui-chip-on-text); font-size: .78rem; font-weight: 700; }
.ui-people .ui-people-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ui-people .ui-people-t small { color: var(--muted); }
.ui-people .ui-people-x { margin-left: auto; color: var(--muted); font-size: .85rem; white-space: nowrap; }
@media (max-width: 700px) {
  .ui-dhead > .ch-top { padding: var(--p-space-3); gap: var(--p-space-3); }
  .ui-dhead-ic { width: 44px; height: 44px; font-size: 1rem; }
  .ui-dhead h1 { font-size: 1.25rem; }
  .ui-phases { padding: 0 var(--p-space-3) var(--p-space-2); }
  .ui-dmetrics { grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: var(--p-space-2); }
  .ui-dmetrics > .ui-metric > strong { font-size: 1.1rem; }
}

/* Startseite (ab 0.364): Kopf mit Gruß, Hinweis auf Neues, Kacheln „Schnell erfassen“, „Heute“, „Neuigkeiten“ */
.ui-head.welcome-head { margin-bottom: var(--p-space-2); }
.welcome-news { display: flex; align-items: center; gap: var(--p-space-2); flex-wrap: wrap; margin: 0 0 var(--ui-gap); }
.welcome-news .ui-chip { flex: 0 0 auto; }
.dash-template { margin-right: auto; }
.ui-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: var(--p-space-2); }
.ui-quick-btn { display: flex; align-items: center; justify-content: center; min-height: var(--ui-target, 2.75rem); padding: var(--p-space-2) var(--p-space-3);
    border: 1px solid var(--ui-card-line); border-radius: var(--ui-card-radius); background: var(--ui-card-bg); color: var(--text);
    font-weight: 600; text-align: center; }
.ui-quick-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.ui-today { list-style: none; margin: 0; padding: 0; }
.ui-today > li { display: grid; grid-template-columns: 3.4rem 1fr; column-gap: var(--p-space-3); padding: 7px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.ui-today > li:last-child { border-bottom: 0; }
.ui-today time { grid-row: span 2; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; color: var(--muted);
    border-right: 3px solid var(--accent); padding-right: var(--p-space-2); }
.ui-today small { grid-column: 2; color: var(--muted); }
.ui-today > li.empty { display: block; color: var(--muted); border: 0; }
.ui-news { display: flex; flex-direction: column; align-items: flex-start; gap: var(--p-space-2); }
.ui-news p { margin: 0; }
.dash-groups { flex-basis: 100%; }
.dash-groups ul li { display: flex; align-items: center; gap: var(--p-space-2); padding: 4px 0; }
.dash-groups ul li > span { min-width: 10rem; }

/* Spalten eines Boards (ab 0.366, V1): Vorgänge-Pipeline, Aufgaben-Board. Kopf mit Anzahl und Summe, Karten,
   unten „+ Neu“ für die Spalte */
.ui-col { background: color-mix(in srgb, var(--line) 35%, transparent); border-radius: var(--ui-card-radius); padding: var(--p-space-2); min-width: 0; }
.board:has(> .ui-col) { grid-auto-columns: minmax(210px, 1fr); }
.ui-col > h2, .ui-col > h3 { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .4rem; font-size: .95rem; margin: .15rem .2rem .55rem; }
.ui-col-sum { margin-left: auto; color: var(--muted); font-weight: 500; font-size: .85rem; white-space: nowrap; }
.ui-col > .card { margin-bottom: var(--p-space-2); }
.ui-col-add { display: block; padding: 6px 8px; border-radius: 8px; color: var(--muted); font-size: .9rem; }
.ui-col-add:hover { color: var(--accent); background: var(--ui-card-bg); text-decoration: none; }
.ui-col .deal-v { display: flex; justify-content: space-between; align-items: baseline; gap: var(--p-space-2); margin-top: 2px; }
.ui-col .deal-v small { color: var(--muted); }

/* Nur für Bildschirmleser */
.ui-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (pointer: coarse) { :root { --ui-target: 44px; } }

/* Formular „Antworten“ / „E-Mail schreiben“ (0.384): Kopfzeilen, Kopie/Bcc einblendbar, Kasten „Entwurf mit KI“ */
.send-mail .mail-head { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.mail-head-row { display: flex; align-items: center; gap: .5rem; padding: .35rem .75rem; border-bottom: 1px solid var(--line); }
.mail-head-row:last-child { border-bottom: 0; }
.mail-head-row[hidden] { display: none; }
.mail-head-row > label { flex: 1; display: grid; grid-template-columns: 4.5rem 1fr; align-items: center; gap: .5rem;
  margin: 0; color: var(--muted); font-size: .9rem; }
.mail-head-row > label > input:not([hidden]), .mail-head-row .cal-chips { border: 0; box-shadow: none; background: transparent;
  color: var(--text); font-size: 1rem; padding-left: 0; }
.mail-head-row .cal-chips:focus-within { box-shadow: none; }
.mail-head-add { display: flex; gap: .3rem; }
.mail-head-add[hidden], .mail-head-hide[hidden], .mail-head-add button[hidden] { display: none; }
.mail-head-add button { padding: .15rem .6rem; font-size: .85rem; font-weight: 600; }
.mail-head-hide { background: none; border: 0; color: var(--muted); font-size: 1.2rem; line-height: 1; padding: .2rem .4rem; cursor: pointer; }
.mail-head-hide:hover { color: var(--danger); }
.cal-suggest-head.area-dir { --area: var(--area-proj); }
.cal-suggest-head[class*="area-"]::before, .cal-suggest-head.area-user::before, .cal-suggest-head.area-dir::before {
  content: ""; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; margin-right: .4rem;
  background: var(--area, var(--muted)); }
.mail-draft { margin: .9rem 0; padding: 2px; border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(120deg, var(--accent), #c2255c 60%, #7048e8); }
.mail-draft-in { border-radius: calc(var(--radius) + 2px); padding: .8rem 1rem;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 7%, var(--surface)), color-mix(in srgb, #c2255c 6%, var(--surface))); }
.mail-draft-head { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; margin-bottom: .6rem; }
.mail-draft-head h2 { margin: 0; font-size: 1.05rem; }
.mail-draft-head .sub { margin-left: auto; font-size: .82rem; }
.mail-draft-icon { font-size: 1.25rem; }
.mail-draft-line { display: flex; gap: .6rem; align-items: stretch; }
.mail-draft-kw { flex: 1; margin: 0; }
.mail-draft-kw textarea { width: 100%; min-height: 2.8rem; resize: vertical; margin: 0;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--surface); }
.mail-draft-go { white-space: nowrap; font-weight: 700; padding: 0 1.2rem; border: 0; color: #fff;
  background: linear-gradient(120deg, var(--accent), #c2255c); }
.mail-draft-go:disabled { opacity: .6; }
.mail-draft-opts { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-top: .55rem; font-size: .88rem; }
.mail-draft-opts .check { margin: 0; }
.mail-draft-tone { display: inline-flex; align-items: center; gap: 0; border: 0; padding: 0; margin: 0; }
.mail-draft-tone legend { float: left; margin-right: .45rem; padding: 0; color: var(--muted); }
.mail-draft-tone label { margin: 0; border: 1px solid var(--line); padding: .15rem .6rem; background: var(--surface); cursor: pointer; }
.mail-draft-tone label:first-of-type { border-radius: 6px 0 0 6px; }
.mail-draft-tone label:last-of-type { border-radius: 0 6px 6px 0; border-left: 0; }
.mail-draft-tone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mail-draft-tone label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.mail-draft-tone label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.mail-draft-quick { display: inline-flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.mail-draft-chip { border: 1px dashed color-mix(in srgb, var(--accent) 55%, var(--line)); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: .1rem .65rem; font-size: .85rem; font-weight: 400; }
.mail-draft-chip:hover { border-style: solid; }
.mail-draft .actions:has(> [data-ai-cancel][hidden]):has(> [data-ai-status]:empty) { display: none; }
.mail-send-bar { justify-content: flex-end; }
@media (max-width: 640px) {
  .mail-draft-line { flex-direction: column; }
  .mail-draft-go { padding: .6rem 1rem; }
  .mail-head-row > label { grid-template-columns: 3.5rem 1fr; }
  .mail-draft-head .sub { margin-left: 0; }
}

/* Handy-Gerüst (0.386, Plan „Neue Oberfläche“ L6): Leiste unten mit Übersicht, häufigen Bereichen und „Mehr“,
   Ziele mindestens 44 px hoch, Schnell-Erfassen-Leiste über der Leiste unten (Bautagebuch) */
.ui-tabbar, .ui-quickbar { display: none; }
@media (max-width: 760px) {
  .ui-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; justify-content: space-around;
               padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom)); background: var(--surface);
               border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0,0,0,.06); }
  .ui-tabbar > a, .ui-tabbar > button { flex: 1 1 0; min-width: 0; min-height: 48px; display: flex; flex-direction: column;
               align-items: center; justify-content: center; gap: .15rem; padding: .2rem; border: 0; background: none;
               border-radius: 10px; color: var(--muted); font: inherit; font-size: .72rem; text-decoration: none; }
  .ui-tabbar .ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round;
               stroke-linejoin: round; }
  .ui-tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ui-tabbar > [aria-current="page"] { color: var(--accent); font-weight: 600; }
  .ui-tabbar > a:hover { text-decoration: none; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .topbar .nav-menu { display: none; }
  /* Zielgrößen: Knöpfe, Felder und Links in Menüs mindestens 44 px */
  :is(button, .button, select, input:not([type=checkbox], [type=radio], [type=hidden]), a.ui-chip, .view-switch a) { min-height: 44px; }
  .button { display: inline-flex; align-items: center; justify-content: center; }
  body:has(.topbar.nav-open) :is(.ui-tabbar, .ui-quickbar) { display: none; }
  .rows li > a, .ui-today li > a { display: inline-flex; align-items: center; min-height: 32px; }
  .ui-quickbar { position: fixed; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom)); z-index: 49;
               display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; padding: .5rem .75rem;
               background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); }
  .ui-quickbar > a, .ui-quickbar > button { min-height: 48px; display: flex; align-items: center; justify-content: center;
               gap: .4rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
               font: inherit; font-weight: 600; text-decoration: none; }
  .ui-quickbar > :first-child { background: var(--accent); border-color: var(--accent); color: var(--on-color); }
  .ui-quickbar .ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round;
               stroke-linejoin: round; }
  body:has(.ui-quickbar) { padding-bottom: calc(130px + env(safe-area-inset-bottom)); }
}
@media print { .ui-tabbar, .ui-quickbar { display: none !important; } }

/* Handy-Feinschliff der übrigen Bereiche (0.388, Plan „Neue Oberfläche“ V7): breite Tabellen scrollen in ihrem
   eigenen Rahmen (`static/shell.js` legt ihn an), die Leiste der Gutachten unterwegs ersetzt auf dem Handy die
   allgemeine Leiste unten und sieht aus wie sie, Schnell erfassen auch im Gutachten (Akte und Befund) */
.ui-scroll-x { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.ui-scroll-x > table { margin: 0; }
.fieldbar .ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round;
                stroke-linejoin: round; }
@media (max-width: 760px) {
  body:has(.fieldbar) .ui-tabbar { display: none; }
  .fieldbar { z-index: 50; padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom)); gap: 0;
              box-shadow: 0 -4px 16px rgba(0,0,0,.06); }
  .fieldbar a, .fieldbar button { min-height: 48px; padding: .2rem; justify-content: center; gap: .15rem; border-radius: 10px;
              color: var(--muted); font-size: .72rem; }
  .fieldbar [aria-current="page"] { color: var(--accent); font-weight: 600; }
  .fieldbar a:hover { text-decoration: none; }
  .field-page { padding-bottom: 0; }
}
/* Schmale Handys: Felder des Befunds untereinander, sonst werden Auswahl und Raum abgeschnitten */
@media (max-width: 480px) { .fx-row2, .fx-row3 { grid-template-columns: minmax(0, 1fr); } }
} /* Ende @layer components */

/* Beleg neben den Daten (Eingangsrechnung, 0.382.0) */
.doc-review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.doc-review-main { min-width: 0; }
.doc-viewer { position: sticky; top: .75rem; display: flex; flex-direction: column; max-height: calc(100vh - 1.5rem); margin: 0; min-width: 0; }
.doc-viewer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; margin-bottom: .5rem; }
.doc-viewer-bar h2 { margin: 0; font-size: 1rem; }
.doc-viewer-files { display: flex; flex-wrap: wrap; gap: .25rem .6rem; font-size: .9rem; }
.doc-viewer-files a[aria-current] { font-weight: 600; text-decoration: none; }
.doc-viewer-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-left: auto; }
.doc-viewer-zoom { min-width: 3.5rem; text-align: center; font-variant-numeric: tabular-nums; }
.doc-viewer-pages-nav { display: inline-flex; align-items: center; gap: .3rem; }
.doc-viewer-pages-nav a { padding: 0 .2rem; }
.doc-viewer-pages { overflow: auto; flex: 1; min-height: 20rem; background: var(--line, #e5e7eb); border-radius: 6px; padding: .5rem; }
.doc-viewer-pages .doc-page { position: relative; width: calc(var(--doc-zoom, 100) * 1%); margin: 0 auto .5rem; }
.doc-viewer-pages img { display: block; width: 100%; max-width: none; height: auto; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); user-select: none; }
/* Anmerkungen (0.392.0): Rahmen und Punkte über dem Seitenbild, Lage in Prozent der Seite */
.doc-note { position: absolute; display: block; text-decoration: none; color: #1f2328; }
.doc-note-highlight { background: rgba(255, 214, 0, .32); border: 2px solid rgba(214, 160, 0, .9); border-radius: 2px; }
.doc-note-highlight span { position: absolute; top: -.7rem; left: -.7rem; }
.doc-note-pin { width: 0; height: 0; }
.doc-note span { display: inline-flex; align-items: center; justify-content: center; min-width: 1.3rem; height: 1.3rem; padding: 0 .25rem; border-radius: 999px; background: #d6a000; color: #fff; font-size: .75rem; font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.doc-note-pin span { transform: translate(-50%, -50%); background: var(--accent, #1a5fb4); }
.doc-note:target span, .doc-note.is-active span { outline: 3px solid var(--accent, #1a5fb4); outline-offset: 1px; }
.doc-note-draft { position: absolute; border: 2px dashed var(--accent, #1a5fb4); background: rgba(26, 95, 180, .12); pointer-events: none; }
.doc-viewer.is-noting .doc-page { cursor: crosshair; }
.doc-viewer.is-noting .doc-note { pointer-events: none; }
.doc-note-tools { display: inline-flex; gap: .3rem; }
.doc-note-tools [aria-pressed=true] { background: var(--accent, #1a5fb4); color: #fff; }
.doc-notes { margin-top: .5rem; max-height: 40vh; overflow: auto; }
.doc-notes summary { font-weight: 600; cursor: pointer; }
.doc-notes-list { list-style: none; padding: 0; margin: .3rem 0; }
.doc-notes-list li { display: flex; gap: .5rem; align-items: flex-start; padding: .3rem 0; border-top: 1px solid var(--line); }
.doc-notes-list li:first-child { border-top: none; }
.doc-notes-list li:target, .doc-notes-list li.is-active { background: var(--warn-bg, #fff8e1); }
.doc-notes-no { flex: 0 0 auto; min-width: 1.4rem; height: 1.4rem; border-radius: 999px; background: var(--accent, #1a5fb4); color: #fff; font-size: .75rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.doc-notes-no-highlight { background: #d6a000; }
.doc-notes-main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.doc-notes-text { white-space: pre-line; }
.doc-note-form { margin-top: .4rem; }
.doc-note-fields { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.doc-note-fields .grow { flex: 1 1 14rem; }
.doc-note-fields select { width: auto; }
.doc-note-form .actions { margin-top: .3rem; }
.doc-viewer-pages .hint { margin: .5rem; }
@media (max-width: 1000px) {
  .doc-review { grid-template-columns: 1fr; }
  .doc-viewer { position: static; max-height: none; }
  .doc-viewer-pages { max-height: 70vh; }
}
