* { box-sizing: border-box; }

:root {
  --bg: #f4f6f9;
  /* Wie in der Buchhaltung (Arne 17.10.2026: „nehme den Hintergrund-Layout von meiner Buchhaltung"):
     leicht durchscheinende Karten nehmen die Farbe der Wolken an ihrer Stelle an. */
  --card: rgba(255, 255, 255, .80);
  --karten-schein: 0 1px 2px rgba(16, 24, 40, .05), 0 18px 46px -22px rgba(124, 58, 237, .40),
                   0 10px 30px -20px rgba(37, 99, 235, .38);
  --line: #e4e8ee;
  --text: #1f2937;
  --muted: #6b7280;
  --marke: #2e7d32;
  --marke-dunkel: #1b5e20;
  --marke-bg: #e8f3e9;
  --blau: #2563eb;
  --blau-bg: #dbeafe;
  --orange: #c2540a;
  --orange-bg: #ffedd5;
  --violett: #7c3aed;
  --violett-bg: #ede9fe;
  --rot: #dc2626;
  --rot-bg: #fee2e2;
  --gelb: #a16207;
  --gelb-bg: #fef3c7;
  --mann: #2563eb;
  --mann-bg: #eff5ff;
  --frau: #db2777;
  --frau-bg: #fdf0f6;
  --neutral: #7c3aed;
  --neutral-bg: #f5f2ff;
}

/* Hintergrund: Farbwolken auf eigener fester Ebene, in leiser Bewegung (Muster aus der Buchhaltung) */
body {
  margin: 0;
  background: var(--bg);
  min-height: 100vh;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16.5px;
  line-height: 1.45;
}
body::before {
  content: ""; position: fixed; inset: -12%; z-index: -1; pointer-events: none;
  background-repeat: no-repeat;
  background-image:
    radial-gradient(1100px 760px at 6% -4%, rgba(46, 125, 50, .26), transparent 62%),
    radial-gradient(1250px 850px at 96% 2%, rgba(37, 99, 235, .27), transparent 64%),
    radial-gradient(1000px 760px at 62% 106%, rgba(124, 58, 237, .24), transparent 66%),
    radial-gradient(900px 620px at 26% 62%, rgba(37, 99, 235, .12), transparent 70%);
  animation: farbwolken 90s ease-in-out infinite alternate;
  will-change: transform, filter;
}
@keyframes farbwolken {
  0%   { transform: translate3d(0, 0, 0) scale(1);           filter: hue-rotate(-6deg); }
  50%  { transform: translate3d(-1.8%, 1.2%, 0) scale(1.05); filter: hue-rotate(0deg); }
  100% { transform: translate3d(1.8%, -1%, 0) scale(1.02);   filter: hue-rotate(6deg); }
}
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }

[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.2; }
.leise { color: var(--muted); }
.klein { font-size: 14px; }
.fehler { color: var(--rot); font-weight: 600; min-height: 0; margin: 6px 0; }
.fehler:empty { display: none; }

/* ===== Knöpfe, Felder, Chips ===== */
button, input, select, textarea { font: inherit; color: inherit; }
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--marke); color: #fff; border: 0; border-radius: 12px;
  padding: 10px 16px; font-weight: 650; cursor: pointer; text-decoration: none;
  box-shadow: 0 4px 14px -6px rgba(46, 125, 50, .7); min-height: 44px;
}
.knopf:hover { background: var(--marke-dunkel); }
.knopf:disabled { opacity: .55; cursor: wait; }
.knopf.hell { background: #fff; color: var(--marke-dunkel); border: 1.5px solid #cfe3d1; box-shadow: none; }
.knopf.hell:hover { background: var(--marke-bg); }
.knopf.hell.rot { background: #fff; color: var(--rot); border-color: #f5c2c2; box-shadow: none; }
.knopf.hell.rot:hover { background: var(--rot-bg); }
.knopf.rot { background: var(--rot); box-shadow: 0 4px 14px -6px rgba(220, 38, 38, .7); }
.knopf.voll { width: 100%; }
.knopf.gross { font-size: 18px; padding: 14px 22px; }
.knopf.klein { min-height: 36px; padding: 6px 12px; font-size: 14.5px; }
.knopf.gruen-wa { background: #16a34a; }

label { display: block; font-weight: 600; font-size: 15px; margin: 10px 0; }
label small { font-weight: 400; }
input:not([type=radio]):not([type=checkbox]), select, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 11px 13px; min-height: 48px;
  border: 1.5px solid #e2e7ee; border-radius: 12px; background: #f8fafc; font-weight: 400;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--marke); background: #fff; box-shadow: 0 0 0 3px rgba(46, 125, 50, .15); }
/* Mit Kennung, damit es die allgemeine Feld-Regel (input:not(...)) sicher übertrumpft */
#dialog input.falsch { border-color: var(--rot); background: var(--rot-bg); }
#dialog input.vorgeschlagen, #dialog textarea.vorgeschlagen { border-color: #eab308; background: #fef9c3; box-shadow: 0 0 0 3px rgba(234, 179, 8, .25); }
/* Farbauswahl */
.farb-wahl { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.farb-feld { margin: 0; cursor: pointer; position: relative; }
.farb-feld > input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.farb-feld > span { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--kf); box-shadow: 0 0 0 2px #fff, 0 0 0 3px #e2e7ee; font-size: 12.5px; font-weight: 700; color: #fff; }
.farb-feld.standard > span, .farb-feld.eigen > span { width: auto; border-radius: 999px; padding: 0 12px; }
.farb-feld.standard > span { background: linear-gradient(135deg, color-mix(in srgb, var(--kf) 78%, #fff), color-mix(in srgb, var(--kf) 82%, #000)); }
.farb-feld.eigen > span { background: conic-gradient(#ef4444, #f59e0b, #22c55e, #06b6d4, #6366f1, #d946ef, #ef4444); text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.farb-feld.eigen > span.gesetzt, .farb-feld.eigen > input:checked + span { background: var(--kf); }
.farb-feld > input:checked + span { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--text); }
.farb-rad { position: absolute !important; left: 0; bottom: 0; width: 1px !important; height: 1px !important; min-height: 0 !important; opacity: 0; border: 0 !important; padding: 0 !important; margin: 0 !important; }
.einst-titel { margin: 22px 0 4px; }

/* Partner-Status im Bearbeiten-Fenster */
.paar-block { margin: 6px 0 4px; }
.paar-zeile { background: #f6f8fb; border-radius: 14px; padding: 10px 12px; margin: 6px 0; }
.paar-name { margin-bottom: 8px; }
.paar-zeile .chip { min-height: 38px; padding: 6px 13px; }

/* Datumsfeld mit eigenem Kalender */
.datum-label { position: relative; }
.datum-zeile { display: flex; gap: 6px; align-items: stretch; margin-top: 5px; }
.datum-zeile input { margin-top: 0 !important; flex: 1; min-width: 0; }
.kal-knopf { flex: none; width: 48px; border: 0; border-radius: 12px; cursor: pointer; background: var(--marke); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px -6px rgba(46, 125, 50, .8); }
.kal-knopf:hover { background: var(--marke-dunkel); }
.kalender {
  position: absolute; z-index: 10; left: 0; top: calc(100% + 4px); width: 318px; max-width: calc(100vw - 48px);
  background: #fff; border-radius: 16px; padding: 12px; font-weight: 400;
  box-shadow: 0 18px 46px -12px rgba(16, 24, 40, .35), 0 0 0 1px #e4e8ee;
}
.k-kopf { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.k-kopf select, .k-kopf input { margin: 0 !important; min-height: 40px !important; padding: 6px 8px !important; font-weight: 600; }
.k-kopf select { flex: 1.4; }
.k-kopf .k-jahr { flex: 1; text-align: center; width: 70px; }
.k-pfeil { width: 38px; height: 40px; border: 0; border-radius: 10px; background: var(--marke-bg); color: var(--marke-dunkel); font-size: 22px; font-weight: 700; cursor: pointer; flex: none; }
.k-pfeil:hover { background: #d4ead6; }
.k-woche, .k-tage { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.k-woche span { font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.k-woche span:nth-child(n+6) { color: var(--frau); }
.k-tag { height: 38px; border: 0; border-radius: 10px; background: #f6f8fb; cursor: pointer; font-size: 15px; }
.k-tag:hover { background: var(--marke-bg); color: var(--marke-dunkel); font-weight: 700; }
.k-tag.heute { box-shadow: inset 0 0 0 2px #f59e0b; }
.k-tag.gewaehlt { background: var(--marke); color: #fff; font-weight: 700; }
.k-fuss { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.k-mehr { border: 1.5px solid #cfe3d1; background: #fff; color: var(--marke-dunkel); border-radius: 999px; padding: 6px 11px; font-size: 13.5px; font-weight: 650; cursor: pointer; }
.k-mehr:hover { background: var(--marke-bg); }
.feld-info { display: block; color: var(--rot); font-weight: 500; margin-top: 3px; }
.feld-info:empty { display: none; }
.feld-titel { font-weight: 600; font-size: 15px; margin: 12px 0 6px; }
.raster2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; align-items: end; }
.haken { display: flex; align-items: center; gap: 8px; min-height: 48px; font-weight: 500; }
.haken input { width: 20px; height: 20px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; margin: 0; cursor: pointer;
  border: 1.5px solid #d6e9d8; background: #fff; color: var(--marke-dunkel);
  border-radius: 999px; padding: 8px 15px; font-weight: 600; font-size: 15px; min-height: 42px;
}
.chip:hover { background: var(--marke-bg); }
.chip.aktiv, .chip:has(input:checked) { background: var(--marke); border-color: var(--marke); color: #fff; box-shadow: 0 4px 12px -6px rgba(46, 125, 50, .8); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip input[type=checkbox] { position: static; opacity: 1; pointer-events: auto; width: 18px; height: 18px; accent-color: #fff; }

.banner { border-radius: 12px; padding: 12px 14px; margin: 10px 0; font-weight: 500; }
.banner.blau { background: var(--blau-bg); color: #1e3a8a; border: 1px solid #bfdbfe; }
.banner.gelb { background: var(--gelb-bg); color: #713f12; border: 1px solid #fde68a; }
.banner.gruen { background: var(--marke-bg); color: var(--marke-dunkel); border: 1px solid #c8e6c9; }

.status { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 700; }
.status.gelb { background: var(--gelb-bg); color: var(--gelb); }
.status.gruen { background: var(--marke-bg); color: var(--marke-dunkel); }
.status.blau { background: var(--blau-bg); color: var(--blau); }
.status.grau { background: #eef0f3; color: #6b7280; }

/* ===== Anmeldung ===== */
.vollbild { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px 16px; }
.anmelde-karte {
  width: 100%; max-width: 420px; background: var(--card); border-radius: 22px; padding: 28px 24px;
  box-shadow: var(--karten-schein); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.anmelde-karte h1 { text-align: center; margin: 6px 0 18px; font-family: Georgia, "Times New Roman", serif; font-size: 30px; color: var(--marke-dunkel); }
.anmelde-logo, .kopf-logo { background: url(icon.svg) center/contain no-repeat; }
.anmelde-logo { width: 74px; height: 74px; margin: 0 auto; }

/* ===== Kopf + Navigation ===== */
.kopf {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 10px 18px; background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.kopf-titel { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.kopf-logo { width: 36px; height: 36px; flex: none; }
.kopf h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 23px; color: var(--marke-dunkel);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf-nav { display: flex; gap: 6px; }
.nav-knopf {
  position: relative; display: flex; align-items: center; gap: 7px; border: 0; cursor: pointer;
  background: transparent; color: #44505f; padding: 9px 14px; border-radius: 12px; font-weight: 600;
}
.nav-knopf:hover { background: var(--marke-bg); }
.nav-knopf.aktiv { background: var(--marke); color: #fff; box-shadow: 0 4px 14px -6px rgba(46, 125, 50, .7); }
.ic { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.zaehler {
  background: linear-gradient(135deg, #db2777, #7c3aed); color: #fff; font-size: 12px; min-width: 20px; height: 20px;
  border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
  box-shadow: 0 0 8px rgba(219, 39, 119, .5);
}

.seite { padding: 14px 18px 30px; }
.karte-block {
  background: var(--card); border-radius: 18px; padding: 18px 20px; box-shadow: var(--karten-schein);
  max-width: 980px; margin: 0 auto 16px;
}
.karte-block h2 { margin-top: 0; }
.seitenkopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.seitenkopf h2 { margin: 0; }

/* ===== Baum ===== */
#seite-baum { padding: 0; display: flex; flex-direction: column; height: calc(100vh - 61px); height: calc(100dvh - 61px); }
.werkzeuge { padding: 10px 14px 8px; display: flex; flex-direction: column; gap: 8px; }
.werkzeuge .chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
.werkzeuge .chip { white-space: nowrap; flex: none; }
.werkzeug-zeile { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.werkzeug-luecke { flex: 1; }
.zweig-wahl { display: flex; align-items: center; gap: 8px; margin: 0; }
.zweig-wahl select { margin: 0; min-height: 40px; padding: 6px 10px; width: auto; max-width: 62vw; background: #fff; }
.stufen { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px;
  background: rgba(255,255,255,.8); border-radius: 999px; padding: 3px 4px 3px 12px; }
.stufen b { min-width: 18px; text-align: center; }
.mini {
  min-width: 40px; height: 40px; border-radius: 12px; border: 0; cursor: pointer; font-weight: 700; font-size: 19px;
  background: var(--marke); color: #fff; box-shadow: 0 4px 12px -6px rgba(46, 125, 50, .8);
}
.mini.breit { font-size: 15px; padding: 0 14px; }
.mini:hover { background: var(--marke-dunkel); }

.baum-rahmen { position: relative; flex: 1; display: flex; min-height: 0; margin: 0 12px 12px; }
.zoom-knoepfe { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 5; }
.zoom-knoepfe .mini { width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; }
.baum-flaeche {
  position: relative; flex: 1; overflow: hidden; touch-action: none; cursor: grab;
  border-radius: 18px; background: rgba(255, 255, 255, .42);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7), var(--karten-schein);
  user-select: none; -webkit-user-select: none;
}
.baum-flaeche.zieht { cursor: grabbing; }
.baum-inhalt { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.baum-linien { position: absolute; left: 0; top: 0; overflow: visible; }

.karte {
  position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-align: left;
  border-radius: 16px; border: 0; cursor: pointer; background: #fff; color: var(--text);
  box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 10px 24px -16px rgba(16,24,40,.45);
  border-top: 5px solid var(--neutral); transition: box-shadow .15s, transform .15s;
}
.karte:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(16,24,40,.08), 0 16px 30px -16px rgba(16,24,40,.5); }
/* Kartenfarbe aus --kf (Grundfarbe je Geschlecht oder eigene Farbe der Person) */
.karte:not(.geist) { border-top-color: var(--kf, var(--neutral)); background: linear-gradient(180deg, color-mix(in srgb, var(--kf, var(--neutral)) 11%, #fff), #fff 72%); }
.karte.tot { filter: saturate(.55); }
.karte.tot .k-bild { filter: grayscale(.6); }
.karte.fokus { box-shadow: 0 0 0 4px #f59e0b, 0 0 26px rgba(245, 158, 11, .55); }
.karte.geist {
  justify-content: center; background: rgba(255,255,255,.55); border: 2px dashed #9aa4b1; border-top-width: 2px;
  color: #4b5563; font-weight: 700; box-shadow: none; font-size: 16px;
}
.karte.geist:hover { background: #fff; border-color: var(--marke); color: var(--marke-dunkel); }
.k-bild { width: 54px; height: 54px; border-radius: 50%; flex: none; object-fit: cover; }
.initialen { display: inline-flex; align-items: center; justify-content: center; font-weight: 750; color: #fff; font-size: 19px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--kf, var(--neutral)) 78%, #fff), color-mix(in srgb, var(--kf, var(--neutral)) 82%, #000)); }
.k-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.22; }
.k-vor { font-size: 15px; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-nach { font-size: 17px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-geb { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-daten { font-size: 13.5px; color: #4b5563; margin-top: 2px; white-space: nowrap; }

.leer-hinweis { max-width: 560px; margin: 40px auto; padding: 26px; text-align: center; background: var(--card);
  border-radius: 20px; box-shadow: var(--karten-schein); }

/* ===== Namensliste ===== */
.liste-kopf { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.liste-kopf input { flex: 2 1 240px; margin: 0; }
.liste-kopf select { flex: 1 1 180px; margin: 0; width: auto; }
.namensliste { display: flex; flex-direction: column; gap: 8px; }
.zeile {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; cursor: pointer;
  background: #fff; border-radius: 14px; padding: 10px 12px; border-left: 5px solid var(--neutral);
  box-shadow: 0 1px 2px rgba(16,24,40,.05);
}
.zeile:hover { background: #f8fbff; }
.zeile { border-left-color: var(--kf, var(--neutral)); }
.z-bild { width: 46px; height: 46px; border-radius: 50%; flex: none; object-fit: cover; }
.z-text { display: flex; flex-direction: column; min-width: 0; }
.z-name { font-weight: 700; font-size: 17px; }
.z-daten, .z-eltern { font-size: 14.5px; color: #4b5563; }
.kreuz { color: #6b7280; font-weight: 600; }

/* ===== Personen-Tafel ===== */
.tafel {
  position: fixed; top: 70px; right: 14px; bottom: 14px; width: 420px; z-index: 30; overflow-y: auto;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-radius: 20px; box-shadow: 0 24px 60px -20px rgba(16,24,40,.45), var(--karten-schein); padding: 18px 18px 22px;
}
.tafel-zu {
  position: sticky; top: 0; float: right; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  background: #eef1f5; font-size: 26px; line-height: 1; z-index: 2;
}
.tafel-zu:hover { background: #e2e6ec; }
.t-kopf { display: flex; gap: 14px; align-items: center; margin: 4px 0 12px; }
.t-kopf h2 { margin: 0; font-size: 23px; font-family: Georgia, "Times New Roman", serif; }
.t-bild { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; flex: none; font-size: 30px;
  box-shadow: 0 0 0 4px #fff, 0 6px 18px -6px rgba(16,24,40,.4); }
.t-geb { margin: 4px 0 0; color: var(--muted); }
.t-alter { margin: 4px 0 0; font-weight: 600; color: var(--marke-dunkel); }
.t-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.t-fakten { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 12px 0; background: #f6f8fb; border-radius: 14px; padding: 12px 14px; }
.t-fakten:empty { display: none; }
.t-fakten dt { font-weight: 700; color: #4b5563; }
.t-fakten dd { margin: 0; }
.t-block { margin: 14px 0; }
.t-block h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; margin: 0 0 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.t-plus { border: 0; background: var(--marke-bg); color: var(--marke-dunkel); font-weight: 700; border-radius: 999px;
  padding: 6px 12px; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 14px; }
.t-plus:hover { background: #d4ead6; }
.t-notizen { white-space: pre-wrap; background: #fffbea; border-radius: 12px; padding: 12px 14px; border: 1px solid #fde68a; }
.t-fuss { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

.person-chip { display: flex; align-items: center; background: #fff; border-radius: 14px; margin: 0 0 6px;
  border: 1.5px solid #e6e9ef; border-left: 5px solid var(--neutral); }
.person-chip { border-left-color: var(--kf, var(--neutral)); }
.pc-name { flex: 1; display: flex; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer;
  padding: 7px 10px; text-align: left; min-height: 50px; }
.pc-name:hover { background: #f6f9fc; border-radius: 12px; }
.pc-name span { display: flex; flex-direction: column; font-weight: 650; }
.pc-name small { font-weight: 500; color: var(--muted); font-size: 13.5px; }
.pc-bild { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; font-size: 14px; }
.pc-weg { border: 0; background: none; color: #9aa4b1; font-size: 20px; width: 44px; height: 44px; cursor: pointer; border-radius: 10px; }
.pc-weg:hover { background: #f1f4f8; color: var(--text); }
.h-person .person-chip { display: inline-flex; }

/* ===== Dialog ===== */
dialog {
  border: 0; border-radius: 22px; padding: 0; width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 30px);
  box-shadow: 0 30px 80px -20px rgba(16,24,40,.5), 0 18px 46px -22px rgba(124, 58, 237, .40);
}
dialog::backdrop { background: rgba(17, 24, 39, .42); backdrop-filter: blur(3px); }
#dialog-form { padding: 20px 22px; }
#dialog-titel { margin: 0 0 10px; font-family: Georgia, "Times New Roman", serif; color: var(--marke-dunkel); }
.dialog-knoepfe { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px;
  position: sticky; bottom: -20px; background: #fff; padding: 12px 0 4px; }
.dialog-knoepfe .links { margin-right: auto; }
.reiter { display: flex; gap: 4px; background: #eef1f5; border-radius: 14px; padding: 4px; margin-bottom: 8px; }
.reiter button { flex: 1; border: 0; background: none; border-radius: 11px; padding: 10px; font-weight: 650; cursor: pointer; color: #4b5563; }
.reiter button.aktiv { background: #fff; color: var(--marke-dunkel); box-shadow: 0 2px 6px rgba(16,24,40,.12); }
.reiter button:disabled { opacity: .45; cursor: default; }
.auswahl-liste { max-height: 290px; overflow-y: auto; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.auswahl-zeile { display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 10px; border-radius: 12px; cursor: pointer; border: 1.5px solid transparent; }
.auswahl-zeile:hover { background: #f6f9fc; }
.auswahl-zeile:has(input:checked) { border-color: var(--marke); background: var(--marke-bg); }
.auswahl-zeile span { display: flex; flex-direction: column; }
.auswahl-zeile small { font-weight: 400; color: var(--muted); }
.link-feld { font-size: 15px; }
.teilen-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ===== Hinweise ===== */
.hinweis { background: #fff; border-radius: 16px; padding: 12px 16px; margin: 10px 0; border-left: 5px solid #cbd5e1; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.hinweis.offen { border-left-color: #eab308; }
.hinweis header { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 14.5px; }
.hinweis p { margin: 8px 0; }
.h-text { white-space: pre-wrap; }
.h-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
details.erledigt { margin-top: 18px; }
details.erledigt summary { cursor: pointer; font-weight: 700; color: #4b5563; padding: 8px 0; }

/* ===== Mehr ===== */
.mehr-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; max-width: 980px; margin: 0 auto 16px; }
.kachel {
  display: flex; flex-direction: column; gap: 4px; text-align: left; border: 0; cursor: pointer;
  background: var(--card); border-radius: 18px; padding: 16px; box-shadow: var(--karten-schein); border-top: 5px solid var(--marke);
}
.kachel b { font-size: 17px; }
.kachel span { color: var(--muted); font-size: 14.5px; }
.kachel.blau { border-top-color: var(--blau); }
.kachel.orange { border-top-color: var(--orange); }
.kachel.violett { border-top-color: var(--violett); }
.kachel.grau { border-top-color: #9aa4b1; }
.kachel.aktiv, .kachel:hover { background: #fff; }
.kachel.aktiv { box-shadow: 0 0 0 3px var(--marke), var(--karten-schein); }
.zeile-schlicht { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.zeile-schlicht.durch > span:first-child { opacity: .6; }
.zeile-knoepfe { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.version { border-bottom: 1px solid var(--line); padding: 10px 0; }
.version h3 { margin: 4px 0; font-size: 17px; }
.version p { margin: 4px 0; }
.hilfe li { margin: 8px 0; }

.meldung {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 100; opacity: 0; pointer-events: none;
  background: var(--marke-dunkel); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(16,24,40,.3); transition: opacity .25s, transform .25s; max-width: calc(100vw - 32px);
}
.meldung.sichtbar { opacity: 1; transform: translate(-50%, 0); }
.meldung.fehler { background: var(--rot); }

/* ===== Handy ===== */
@media (max-width: 880px) {
  body::before {
    background-image:
      radial-gradient(440px 400px at 0% -2%, rgba(46, 125, 50, .18), transparent 66%),
      radial-gradient(480px 440px at 100% 2%, rgba(37, 99, 235, .19), transparent 68%),
      radial-gradient(440px 440px at 72% 102%, rgba(124, 58, 237, .17), transparent 70%);
  }
  :root { --karten-schein: 0 1px 2px rgba(16, 24, 40, .05), 0 12px 28px -24px rgba(124, 58, 237, .28); }
  .tafel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 88vh; max-height: 88dvh; border-radius: 22px 22px 0 0; padding-bottom: 90px; }
  /* Der Kopf (mit der unteren Leiste darin) bildet eine eigene Ebene mit z-index 20 — die Tafel muss
     darunter liegen, sonst verdeckt sie am Handy die Navigation */
  .tafel { z-index: 19; }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  .kopf { padding: 8px 12px; }
  .kopf h1 { font-size: 20px; }
  /* Navigation wandert als Leiste an den unteren Rand — dort erreicht der Daumen sie */
  .kopf-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; justify-content: space-around; gap: 0;
    background: rgba(255,255,255,.96); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  .nav-knopf { flex-direction: column; gap: 2px; font-size: 12.5px; padding: 6px 8px; min-width: 70px; }
  .nav-knopf .zaehler { position: absolute; top: 0; right: 10px; }
  #seite-baum { height: calc(100vh - 53px - 66px); height: calc(100dvh - 53px - 66px); }
  .seite { padding: 10px 10px 90px; }
  #seite-baum.seite { padding: 0; }
  .baum-rahmen { margin: 0 8px 8px; }
  #baum-drucken { display: none; }
  .werkzeug-zeile:not(:has(> :not([hidden]):not(.werkzeug-luecke):not(#baum-drucken))) { display: none; }
  /* backdrop-filter am Kopf würde die feste Leiste unten an den Kopf binden statt an den Bildschirm */
  .kopf { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(255,255,255,.94); }
  .werkzeuge { padding: 8px 8px 6px; }
  .mini.breit { padding: 0 10px; font-size: 14px; }
  .karte-block { padding: 14px; }
  .raster2 { grid-template-columns: 1fr; }
  #dialog-form { padding: 16px; }
  dialog { width: calc(100vw - 16px); }
  .t-bild { width: 74px; height: 74px; }
  .meldung { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* ===== Druck ===== */
@media print {
  body::before { display: none; }
  body { background: #fff; }
  .kopf, .werkzeuge, .tafel, .meldung, dialog, #seite-hinweise, #seite-mehr { display: none !important; }
  body.druck-baum #seite-liste { display: none !important; }
  body.druck-baum #seite-baum { display: block !important; height: auto; }
  body.druck-baum .baum-flaeche { overflow: visible; margin: 0; box-shadow: none; background: none; height: auto; }
  body.druck-baum .baum-inhalt { position: relative; }
  body.druck-liste #seite-baum { display: none !important; }
  body.druck-liste #seite-liste { display: block !important; padding: 0; }
  body.druck-liste .liste-kopf { display: none; }
  .karte-block { box-shadow: none; background: #fff; padding: 0; max-width: none; }
  .zeile { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; border-left-width: 5px; }
  .karte { box-shadow: none; border: 1px solid #ccc; border-top-width: 5px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .karte.fokus { box-shadow: none; }
  .karte.geist { display: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
