/* The Watchers Trees – Gestaltung */

:root {
  --blue: #1b5fae;
  --blue-light: #2f7fd6;
  --blue-dark: #123f78;
  --green: #45c33a;
  --green-dark: #2a8f22;
  --bg: #eaf2fb;
  --card: #ffffff;
  --text: #1c2a3a;
  --muted: #62748a;
  --line: #d5e1ee;
  --danger: #d6455d;
  --female: #e0609d;
  --male: #3d8fe0;
  --other: #9a6be0;
  --radius: 16px;
  --shadow: 0 6px 22px rgba(18, 63, 120, .12);
  --topbar-h: 62px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background:
    radial-gradient(circle at 12% 0%, rgba(69, 195, 58, .10), transparent 40%),
    radial-gradient(circle at 90% 20%, rgba(47, 127, 214, .12), transparent 45%),
    var(--bg);
  min-height: 100vh;
}

a { color: var(--blue-light); }

[hidden] { display: none !important; }

/* ---------- Kopfleiste ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  background: linear-gradient(180deg, var(--blue-light), var(--blue));
  color: #fff;
  box-shadow: 0 2px 12px rgba(18, 63, 120, .3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  min-width: 0;
}

.brand-logo { height: 40px; filter: drop-shadow(0 0 6px rgba(168, 239, 124, .7)); }

.brand-text {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}

.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ---------- Knöpfe ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .08s, box-shadow .15s, background .15s;
  box-shadow: 0 2px 6px rgba(18, 63, 120, .12);
}
.btn:hover { box-shadow: 0 4px 12px rgba(18, 63, 120, .22); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(69, 195, 58, .6);
  outline-offset: 1px;
}

.btn-primary { background: linear-gradient(180deg, #5fd452, var(--green)); color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .2); }
.btn-primary:hover { background: linear-gradient(180deg, #6ce05f, #3fb534); }
.btn-blue { background: linear-gradient(180deg, var(--blue-light), var(--blue)); color: #fff; }
.btn-ghost { background: transparent; box-shadow: none; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: #fff; }
.btn-light { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: none; border-color: rgba(255, 255, 255, .35); }
.btn-light:hover { background: rgba(255, 255, 255, .28); box-shadow: none; }
.btn-danger { background: #fff; color: var(--danger); border-color: #f2c4cc; }
.btn-danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-icon { width: 40px; height: 40px; padding: 0; font-size: 1.2rem; }

/* ---------- Konto in der Kopfleiste ---------- */

.user-chip { padding-left: 6px; gap: 8px; }
.user-chip .avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .3);
  font-weight: 700;
  font-size: .9rem;
}

/* ---------- Startseite ---------- */

.home { max-width: 1100px; margin: 0 auto; padding: 36px 20px 60px; }

.home-section { margin-bottom: 28px; }
.home-section > h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.hero { text-align: center; margin-bottom: 30px; }
.hero h1 { margin: 0 0 8px; font-size: clamp(1.7rem, 4vw, 2.5rem); color: var(--blue-dark); }
.hero p { margin: 0; color: var(--muted); font-size: 1.08rem; }
.hero-logo { height: 70px; margin-bottom: 8px; animation: float 3.5s ease-in-out infinite; filter: drop-shadow(0 6px 10px rgba(42, 143, 34, .35)); }
@keyframes float { 50% { transform: translateY(-8px) rotate(2deg); } }

.home-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }

.tree-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }

.tree-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
  border: 2px solid transparent;
}
.tree-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(18, 63, 120, .18); border-color: var(--green); }

.tree-card-photos {
  height: 120px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: linear-gradient(135deg, #cfe6ff, #d8f5cf);
}
.tree-card-photos img { width: 100%; height: 100%; object-fit: cover; }
.tree-card-photos .placeholder { display: grid; place-items: center; }
.tree-card-photos .placeholder img { width: auto; height: 62px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(42, 143, 34, .3)); }

.tree-card-body { padding: 14px 16px 16px; }
.tree-card-title { margin: 0 0 4px; font-size: 1.15rem; color: var(--blue-dark); }
.tree-card-desc { margin: 0 0 8px; color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tree-card-meta { font-size: .82rem; color: var(--muted); }

.empty-state {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
}
.empty-state .ic.big, .empty-state .ic-draw.big { width: 54px; height: 54px; color: var(--blue-light); margin-bottom: 10px; }
.empty-state h2 { color: var(--blue-dark); margin: 0 0 8px; }
.empty-state p { margin: 0 0 18px; }

/* ---------- Stammbaum-Seite ---------- */

.tree-page {
  height: calc(100vh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
  display: flex;
  flex-direction: column;
}

.tree-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  /* muss über der Seitenleiste liegen, sonst verdeckt sie Suche und Menue */
  position: relative;
  z-index: 10;
}
.toolbar-title { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; flex: 1 1 180px; }

.tree-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--blue-dark);
  text-align: left;
  cursor: pointer;
}
.tree-title:hover { color: var(--blue-light); }
.tree-title .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-mark { display: inline-flex; color: var(--muted); }

/* ---------- Text über die Familie ---------- */

.tree-note {
  padding: 12px 18px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  max-height: 38vh;
  overflow-y: auto;
  z-index: 4;
  animation: note-in .18s ease-out;
}
@keyframes note-in { from { opacity: 0; transform: translateY(-6px); } }
.note-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.note-head h2 { margin: 0; font-size: .95rem; color: var(--blue-dark); }
.note-text { margin: 0; max-width: 80ch; white-space: pre-wrap; line-height: 1.5; }
.note-text.empty { color: var(--muted); font-style: italic; }
.note-edit { min-height: 120px; }
.note-actions { display: flex; gap: 8px; margin-top: 8px; }
.save-status { font-size: .8rem; color: var(--muted); min-height: 1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save-status.error { color: var(--danger); font-weight: 600; }
.toolbar-right { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.search { position: relative; }
.search input[type="search"] {
  width: 190px;
  padding: 8px 14px 8px 38px;
  border: 2px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: .92rem;
  background: #fff;
}
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input[type="search"]:focus { border-color: var(--blue-light); }
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 220px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 30;
}
.search-results button {
  display: block;
  width: 100%;
  padding: 9px 14px;
  border: 0;
  background: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.search-results button:hover, .search-results button:focus { background: #eef6ff; }

.tree-stage { position: relative; flex: 1; overflow: hidden; }

.tree-svg { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.tree-svg.dragging { cursor: grabbing; }

.zoom-controls {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 4;
}

.legend {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 4;
  background: rgba(255, 255, 255, .95);
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-size: .85rem;
  max-width: calc(100% - 90px);
}
.legend summary { display: flex; align-items: center; gap: 6px; padding: 9px 14px; cursor: pointer; font-weight: 600; color: var(--blue-dark); list-style: none; }
.legend summary::-webkit-details-marker { display: none; }

.legend ul { list-style: none; margin: 0; padding: 0 14px 12px; display: grid; gap: 6px; max-height: 46vh; overflow-y: auto; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend svg { flex-shrink: 0; }
@media (min-width: 900px) { .legend ul { grid-template-columns: 1fr 1fr; gap: 6px 18px; } }

.tree-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  pointer-events: none;
}
.tree-empty > div { pointer-events: auto; max-width: 420px; }

/* ---------- Seitenleiste mit Sim-Details ---------- */

.side-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: 340px;
  max-width: calc(100% - 24px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(18, 63, 120, .25);
  overflow-y: auto;
  z-index: 6;
  animation: slide-in .18s ease-out;
}
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } }

.panel-close { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(255, 255, 255, .9); }

.panel-photo { height: 230px; background: linear-gradient(135deg, #cfe6ff, #d8f5cf); display: grid; place-items: center; overflow: hidden; }
.panel-photo img { width: 100%; height: 100%; object-fit: cover; }
.panel-photo .initials { font-size: 4.5rem; font-weight: 700; color: rgba(255, 255, 255, .95); text-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.wt-gray-dead .panel-photo.deceased img { filter: grayscale(1); }

.panel-body { padding: 16px 20px 22px; }
.panel-name { margin: 0; font-size: 1.45rem; color: var(--blue-dark); line-height: 1.2; }
.panel-subtitle { color: var(--muted); margin: 3px 0 10px; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eef4fb;
  font-size: .82rem;
  font-weight: 600;
  color: var(--blue-dark);
}
.badge.heir { background: #e3f8de; color: var(--green-dark); }
.badge.dead { background: #ececec; color: #555; }

.info-list { margin: 0 0 14px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .93rem; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; word-break: break-word; }

.notes { white-space: pre-wrap; background: #f6f9fd; border-radius: 12px; padding: 10px 12px; font-size: .93rem; margin: 0 0 14px; }

.rel-section { margin-bottom: 12px; }
.rel-section h3 { margin: 0 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.rel-list { display: flex; flex-wrap: wrap; gap: 6px; }
.rel-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font: inherit;
  font-size: .88rem;
  cursor: pointer;
}
.rel-chip:hover { border-color: var(--green); }
.rel-chip.link { border-color: #cfe0f3; background: #f2f8ff; color: var(--blue); font-weight: 600; }
.rel-chip.link:hover { border-color: var(--blue-light); }
.rel-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--other); }
.rel-chip .dot.female { background: var(--female); }
.rel-chip .dot.male { background: var(--male); }

.panel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.panel-actions .wide { grid-column: 1 / -1; }

/* ---------- Menü ---------- */

.menu { position: relative; }
.menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 262px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 30;
}
.menu-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}
.menu-item:hover { background: #eef6ff; }
.menu-item.danger { color: var(--danger); }

/* ---------- Dialoge ---------- */

dialog.modal {
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(18, 63, 120, .35);
  color: var(--text);
  overflow: hidden;
}
dialog.modal.small { width: min(420px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(18, 40, 70, .45); backdrop-filter: blur(2px); }
dialog.modal form { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: linear-gradient(180deg, var(--blue-light), var(--blue));
  color: #fff;
}
.modal-header h2 { margin: 0; font-size: 1.2rem; }
.modal-header .btn { width: 34px; height: 34px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: #f7fafd; }
.modal-footer .spacer { flex: 1; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; min-width: 0; }
.field > label, .field-label { font-weight: 600; font-size: .9rem; color: var(--blue-dark); }
.field .hint { font-size: .82rem; color: var(--muted); }

input[type="text"], input[type="password"], input[type="search"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  color: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue-light); outline: none; }
textarea { min-height: 90px; resize: vertical; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.section-title { margin: 8px 0 12px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label {
  padding: 7px 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: .92rem;
  background: #fff;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { border-color: var(--green); background: #effbec; font-weight: 600; }
.seg label:has(input:focus-visible) { outline: 3px solid rgba(69, 195, 58, .6); }

.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .95rem; }
.check input { width: 18px; height: 18px; accent-color: var(--green); }

.photo-edit { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.photo-preview {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, #cfe6ff, #d8f5cf);
  display: grid;
  place-items: center;
  font-size: 2.6rem;
  border: 3px solid #fff;
  box-shadow: var(--shadow);
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-buttons { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
.chips:focus-within { border-color: var(--blue-light); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 11px; border-radius: 999px; background: #e6f1fc; font-size: .88rem; }
.chip button { border: 0; background: none; cursor: pointer; font-size: 1rem; line-height: 1; color: var(--muted); padding: 0 3px; }
.chips input { flex: 1; min-width: 120px; border: 0 !important; padding: 5px !important; }

.partner-list { display: grid; gap: 8px; margin-bottom: 10px; }
.partner-row { display: grid; grid-template-columns: 1fr 150px auto; gap: 8px; align-items: center; }
.partner-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.partner-add { display: grid; grid-template-columns: 1fr 150px auto; gap: 8px; }

.form-error { color: var(--danger); font-weight: 600; margin: 0 0 12px; }

/* ---------- Konten-Dialoge ---------- */

.dialog-intro { margin: 0 0 14px; color: var(--muted); font-size: .93rem; }
.dialog-switch { margin: 4px 0 0; font-size: .9rem; color: var(--muted); }
.link-button {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--blue-light);
  text-decoration: underline;
  cursor: pointer;
}
.setting-hint { margin: 0 0 10px; color: var(--muted); font-size: .85rem; }

.user-list { max-height: 190px; overflow-y: auto; }
.user-list table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.user-list td { padding: 5px 6px; border-bottom: 1px solid var(--line); }
.user-list td.mail { color: var(--muted); word-break: break-all; }
.user-list td.num { text-align: right; white-space: nowrap; color: var(--muted); }

/* ---------- Auswahl mit Erklärung (Sichtbarkeit) ---------- */

.choices { display: grid; gap: 8px; }
.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}
.choice:hover { border-color: var(--blue-light); }
.choice:has(input:checked) { border-color: var(--green); background: #f4fcf2; }
.choice:has(input:focus-visible) { outline: 3px solid rgba(69, 195, 58, .6); }
.choice input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green); flex-shrink: 0; }
.choice > span { display: grid; gap: 2px; }
.choice-hint { color: var(--muted); font-size: .85rem; }

/* ---------- Sichtbarkeit in der Werkzeugleiste ---------- */

.vis-chip {
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 6px 12px;
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.vis-chip:hover { border-color: var(--blue-light); color: var(--text); }
.vis-chip.vis-private { border-color: #f2c4cc; color: var(--danger); }
.vis-chip.vis-link { border-color: #cfe0f3; color: var(--blue); }

/* ---------- Hinweise ---------- */

#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 1000; pointer-events: none; }
.toast {
  background: var(--blue-dark);
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-weight: 600;
  animation: toast-in .2s ease-out;
  text-align: center;
}
.toast.error { background: var(--danger); }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

.loading { text-align: center; padding: 60px 20px; color: var(--muted); }
.loading img { height: 56px; animation: float 1.6s ease-in-out infinite; }

/* ---------- Handy ---------- */

@media (max-width: 700px) {
  .topbar { padding: 0 12px; }
  .brand-text { font-size: 1.1rem; }
  .brand-logo { height: 34px; }
  .topbar .btn { padding: 7px 12px; font-size: .85rem; }
  .topbar .label { display: none; }
  .user-chip { padding: 5px; }
  .vis-chip { padding: 5px 9px; font-size: .78rem; }
  .tree-toolbar { padding: 8px 10px; }
  .search input[type="search"] { width: 140px; }
  .toolbar-right .label { display: none; }
  .side-panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; max-height: 65%; }
  .panel-photo { height: 180px; }
  .row { grid-template-columns: 1fr; }
  .partner-row, .partner-add { grid-template-columns: 1fr 1fr; }
  .partner-row .name { grid-column: 1 / -1; }
  .legend { bottom: 12px; left: 10px; }
  .zoom-controls { right: 10px; bottom: 12px; }
  /* Bedienknöpfe über die Infokarte schieben, damit sie erreichbar bleiben */
  .tree-stage:has(.side-panel) .zoom-controls { bottom: calc(65% + 16px); }
  .tree-stage:has(.side-panel) .legend { bottom: calc(65% + 16px); }
}

/* ---------- Symbole (Lucide) ---------- */

.ic, .ic-draw {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  vertical-align: -.18em;
}
/* Die Lucide-Symbole sind Striche, keine Flächen – und nehmen die Textfarbe an */
.ic {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn .ic, .btn .ic-draw { width: 1.2em; height: 1.2em; }
.btn-icon .ic { width: 1.35em; height: 1.35em; }
.badge .ic-draw { width: 1.1em; height: 1.1em; }
.check .ic-draw { width: 1.2em; height: 1.2em; }
.menu-item { display: flex; align-items: center; gap: 9px; }
.menu-item .ic { color: var(--muted); }
.menu-item.danger .ic { color: var(--danger); }
.modal-header h2 { display: flex; align-items: center; gap: 9px; }
.badge .ic { width: 1em; height: 1em; }
.save-status { display: flex; align-items: center; gap: 5px; }
.vis-chip { display: inline-flex; align-items: center; gap: 6px; }
.choice strong { display: inline-flex; align-items: center; gap: 7px; }
.rel-chip .rel-mini { width: 1.25em; height: 1.25em; margin-left: 1px; }
.ic.inline { vertical-align: -.25em; color: var(--muted); }
.tree-title .caret { width: 1em; height: 1em; color: var(--muted); transition: transform .15s; }
.tree-title.open .caret { transform: rotate(180deg); }
.note-head h2 { display: flex; align-items: center; gap: 7px; }
.photo-preview .ic.placeholder { width: 46px; height: 46px; color: #fff; opacity: .8; }
.wt-grave { fill: #b9c5d2; stroke: none; }
.wt-grave-mark { stroke: #fff; stroke-width: 1.6; stroke-linecap: round; }
