/* Ahnenwerk – Oberfläche. Ruhig, warm, gut lesbar; große Klickflächen für alle Generationen. */

:root {
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --bg: #f7f3ea;
  --surface: #ffffff;
  --surface-2: #faf7f2;
  --surface-3: #f1ece3;
  --ink: #1f1b16;
  --ink-2: #463f36;
  --muted: #776e63;
  --border: #e8e1d5;
  --border-strong: #d5cbbb;
  --accent: #0f3d2c;
  --accent-hover: #16503b;
  --teal: #1f6b5c;
  --gold: #bc9239;
  --accent-ink: #ffffff;
  --accent-soft: #e2ede8;
  --danger: #a63d2f;
  --pro: #8a6420;
  --pro-soft: #f5ebd3;
  --ring: 0 0 0 3px rgba(31, 107, 92, .25);
  --shadow-sm: 0 1px 2px rgba(40, 30, 15, .06);
  --shadow: 0 1px 2px rgba(40, 30, 15, .05), 0 8px 24px rgba(40, 30, 15, .08);
  --shadow-lg: 0 2px 6px rgba(40, 30, 15, .06), 0 24px 60px rgba(40, 30, 15, .18);
  --r: 12px;
  --top-h: 64px;
  --panel-w: 400px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14181a; --surface: #1c2124; --surface-2: #20262a; --surface-3: #283035;
    --ink: #eef0ed; --ink-2: #cfd4d0; --muted: #9ea6a1; --border: #2c3438; --border-strong: #3a454a;
    --accent: #7db597; --accent-hover: #93c6aa; --accent-ink: #0f231a; --accent-soft: #22342b;
    --danger: #e0806f; --pro: #e0b766; --pro-soft: #3a311f; --ring: 0 0 0 3px rgba(125, 181, 151, .3);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35); --shadow-lg: 0 24px 60px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14181a; --surface: #1c2124; --surface-2: #20262a; --surface-3: #283035;
  --ink: #eef0ed; --ink-2: #cfd4d0; --muted: #9ea6a1; --border: #2c3438; --border-strong: #3a454a;
  --accent: #7db597; --accent-hover: #93c6aa; --accent-ink: #0f231a; --accent-soft: #22342b;
  --danger: #e0806f; --pro: #e0b766; --pro-soft: #3a311f; --ring: 0 0 0 3px rgba(125, 181, 151, .3);
  color-scheme: dark;
}

html { font-size: 16px; }
html.large { font-size: 18.5px; }
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 1rem/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.0625rem; color: var(--ink-2); margin: 0 0 1rem; }
.ic { flex: none; }
.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.danger-text { color: var(--danger) !important; }

/* ------------------------------------------------------------ Buttons & Eingaben */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 42px; padding: 0 1rem; border-radius: 10px; border: 1px solid transparent;
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: .9375rem; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--ink); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { min-height: 34px; padding: 0 .75rem; font-size: .875rem; border-radius: 9px; }
.btn.lg { min-height: 52px; font-size: 1.0625rem; padding: 0 1.4rem; border-radius: 12px; }
.btn.block { width: 100%; justify-content: flex-start; }
.btn.primary.block { justify-content: center; }

.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 0; background: transparent; color: var(--ink-2);
}
.icon-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--ink); }
.search-toggle { display: none; }
svg.chart .more:hover circle { opacity: .85; }

.input {
  width: 100%; min-height: 42px; padding: .55rem .75rem; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input.lg { min-height: 50px; font-size: 1.0625rem; }
.input.small { min-height: 34px; padding: .3rem .5rem; width: auto; }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(166, 61, 47, .15); }
textarea.input { resize: vertical; min-height: 64px; line-height: 1.45; }
.input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }

.field { display: grid; gap: .35rem; min-width: 0; }
.field-label { font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
.field-hint { font-size: .78rem; color: var(--muted); }
.field-hint.tight { margin: -.5rem 0 0; }
.form-grid { display: grid; gap: .9rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-error { color: var(--danger); font-size: .9rem; margin: 0; min-height: 0; }
.form-error:empty { display: none; }
.check { display: inline-flex; align-items: center; gap: .55rem; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

.seg { display: inline-flex; justify-self: start; gap: 2px; padding: 3px; background: var(--surface-3); border-radius: 11px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button {
  border: 0; background: transparent; border-radius: 8px; padding: .45rem .9rem; font-weight: 600; font-size: .9rem; color: var(--muted);
  display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; min-height: 36px;
}
.seg button:hover:not(:disabled):not(.on) { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg.small button { padding: .3rem .7rem; font-size: .85rem; min-height: 32px; }

.pro-tag {
  display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--pro-soft); color: var(--pro); padding: .1rem .4rem; border-radius: 6px; margin-left: .35rem; vertical-align: 1px;
}

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; }
.switch-row > span { display: grid; }
.switch-row small { color: var(--muted); font-size: .8rem; }
.switch { appearance: none; width: 44px; height: 26px; border-radius: 99px; background: var(--border-strong); position: relative; flex: none; transition: background .15s; cursor: pointer; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }

.range-wrap { display: flex; align-items: center; gap: .75rem; }
.range { flex: 1; accent-color: var(--accent); height: 28px; }
.range-out { font-weight: 700; min-width: 1.5em; text-align: right; font-variant-numeric: tabular-nums; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .8rem; overflow: hidden; text-transform: uppercase;
}
.avatar.sm { width: 30px; height: 30px; font-size: .75rem; }
.avatar.lg { width: 60px; height: 60px; font-size: 1.2rem; font-family: var(--serif); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.unknown { background: var(--surface-3); color: var(--muted); }

/* ------------------------------------------------------------ Grundgerüst */

.shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-width: 0; }
.shell > * { flex: none; min-width: 0; }
.shell > .workspace { flex: 1 1 auto; min-height: 0; }
.topbar {
  display: flex; align-items: center; gap: 1rem; padding: 0 1rem; min-height: var(--top-h);
  background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 20;
}
.top-left { display: flex; align-items: center; gap: .5rem; min-width: 190px; flex: 1 1 0; }
.top-center { flex: 0 0 auto; display: flex; justify-content: center; min-width: 0; }
.top-actions { display: flex; align-items: center; gap: .25rem; flex: none; }
.top-actions .grp { display: flex; margin-right: .25rem; padding-right: .5rem; border-right: 1px solid var(--border); }

.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--serif); font-size: 1.35rem; font-weight: 700; color: inherit; text-decoration: none; }
.brand-mark { display: inline-grid; }
.brand-mark img { width: 36px; height: 36px; display: block; }
.brand.small { padding: 4px; border-radius: 10px; }
.tree-title {
  display: inline-flex; align-items: center; gap: .35rem; border: 0; background: transparent; padding: .4rem .6rem; border-radius: 10px;
  font-family: var(--serif); font-size: 1.12rem; font-weight: 700; min-width: 0; max-width: 32vw; color: var(--ink);
}
.tree-title:hover:not(:disabled) { background: var(--surface-3); }
.tree-title:disabled { opacity: 1; }
.tree-title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.top-search { position: relative; display: flex; align-items: center; gap: .4rem; color: var(--muted); background: var(--surface-3); border-radius: 10px; padding: 0 .7rem; height: 40px; width: 220px; flex: 0 1 220px; min-width: 170px; }
.search-input { border: 0; background: transparent; outline: none; width: 100%; height: 100%; color: var(--ink); }
.top-search:focus-within { box-shadow: var(--ring); background: var(--surface); }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; width: 340px; max-height: 60vh; overflow: auto; display: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 30;
}
.search-results.open { display: block; }
.sr { display: grid; width: 100%; text-align: left; border: 0; background: none; padding: .6rem .75rem; border-radius: 10px; }
.sr small { color: var(--muted); }
.sr.on, .sr:hover { background: var(--accent-soft); }
.sr-empty { padding: .75rem; color: var(--muted); }

.save-ind { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; color: var(--muted); padding: 0 .5rem; min-width: 118px; white-space: nowrap; }
.save-ind.saved { color: var(--accent); }
.save-ind.error { color: var(--danger); }
.account-btn { display: inline-flex; align-items: center; gap: .4rem; border: 0; background: transparent; padding: 4px 6px 4px 4px; border-radius: 99px; }
.account-btn:hover { background: var(--surface-3); }
.plan-badge { font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: .15rem .45rem; border-radius: 6px; background: var(--surface-3); color: var(--muted); }
.plan-badge.pro { background: var(--pro-soft); color: var(--pro); }

.demo-banner { background: var(--pro-soft); color: var(--ink-2); font-size: .875rem; padding: .45rem 1rem; text-align: center; border-bottom: 1px solid var(--border); }

.workspace { display: grid; grid-template-columns: 1fr auto; min-height: 0; position: relative; }
.stage { position: relative; overflow: hidden; min-width: 0; background: var(--bg); transition: background .3s; }
svg.chart { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
svg.chart.dragging { cursor: grabbing; }
svg.chart .card:hover > rect:first-child { stroke-width: 2.2px; }
svg.chart .ghost:hover > rect, svg.chart .ghost:hover > path { fill-opacity: .8; }

.zoom-ctl { position: absolute; right: 16px; bottom: 16px; display: grid; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 3px; }
.focus-chip {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: .75rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 99px; box-shadow: var(--shadow); padding: .3rem .35rem .3rem 1rem; font-size: .9rem;
}
.focus-chip .btn { border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.hint {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); background: rgba(31, 27, 22, .82); color: #fff;
  font-size: .85rem; padding: .45rem .9rem; border-radius: 99px; pointer-events: none; transition: opacity .6s; white-space: nowrap; max-width: calc(100% - 140px); overflow: hidden; text-overflow: ellipsis;
}
.hint.fade { opacity: 0; }

/* ------------------------------------------------------------ Seitenleiste */

.panel {
  width: 0; overflow: hidden; background: var(--surface); border-left: 1px solid var(--border);
  transition: width .22s ease; position: relative; z-index: 10;
}
.panel.open { width: var(--panel-w); overflow-y: auto; overflow-x: hidden; }
.panel-close { position: absolute; top: 14px; right: 12px; z-index: 2; }
.panel-body { padding: 1.4rem 1.4rem 3rem; width: 100%; min-width: 340px; }
.panel-person-head { display: flex; align-items: center; gap: .9rem; margin: 0 2.5rem 1.2rem 0; }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .02em; color: var(--accent); }
.panel-title { font-family: var(--serif); font-size: 1.5rem; line-height: 1.2; margin: .1rem 0 .15rem; }
.panel-section { padding: 1.1rem 0; border-top: 1px solid var(--border); }
.panel-section.actions { display: grid; gap: .25rem; }
.section-title { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: .4rem 0 .6rem; }
.section-title:first-child { margin-top: 0; }
.sub-label { font-size: .8rem; font-weight: 600; color: var(--muted); margin: .6rem 0 .35rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .55rem; border: 1px solid var(--border); background: var(--surface);
  border-radius: 12px; padding: .35rem .75rem .35rem .4rem; text-align: left; max-width: 100%; min-height: 46px;
}
.chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.chip-text { display: grid; line-height: 1.2; min-width: 0; }
.chip-text strong { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-text small { color: var(--muted); font-size: .78rem; }
.add-btn {
  display: inline-flex; align-items: center; gap: .4rem; border: 1.5px dashed var(--border-strong); background: transparent; color: var(--accent);
  border-radius: 12px; padding: .5rem .8rem; font-weight: 600; font-size: .9rem; min-height: 46px;
}
.add-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.panel-section > .add-btn { margin-top: .6rem; }
.family-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: .8rem; margin-bottom: .6rem; }
.family-box .marriage { margin-top: .7rem; }
.row2.marriage { margin-top: .6rem; }
.photo-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 100px 1fr; gap: .75rem; padding: .35rem 0; }
.kv > span:first-child { color: var(--muted); font-size: .9rem; }
.stack { display: grid; gap: .5rem; }
.install-steps { margin: 0; padding-left: 1.3rem; display: grid; gap: .4rem; color: var(--ink-2); }

.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.theme-swatch { border: 2px solid transparent; background: none; padding: 0; border-radius: 14px; text-align: left; }
.theme-swatch .sw { position: relative; display: block; height: 64px; border-radius: 12px; border: 1px solid; overflow: hidden; }
.theme-swatch .sw > span { position: absolute; left: 12px; top: 12px; width: 56px; height: 30px; border-radius: 6px; border: 1px solid; }
.theme-swatch .sw i { position: absolute; bottom: 10px; width: 10px; height: 10px; border-radius: 50%; }
.theme-swatch .sw i:nth-of-type(1) { right: 54px; } .theme-swatch .sw i:nth-of-type(2) { right: 40px; }
.theme-swatch .sw i:nth-of-type(3) { right: 26px; } .theme-swatch .sw i:nth-of-type(4) { right: 12px; }
.theme-swatch .sw-label { display: block; padding: .35rem .2rem 0; font-weight: 600; font-size: .9rem; }
.theme-swatch.on .sw { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }

/* ------------------------------------------------------------ Liste */

.list-view { height: 100%; display: grid; grid-template-rows: auto 1fr; background: var(--bg); }
.list-toolbar { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; }
.list-toolbar .input { max-width: 360px; }
.list-toolbar .btn { margin-left: auto; }
.table-wrap { overflow: auto; padding: 0 1.25rem 2rem; }
.list-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.list-table th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-size: .8rem; font-weight: 700; color: var(--muted); padding: .7rem .9rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.list-table th.sortable { cursor: pointer; }
.list-table th.on { color: var(--accent); }
.list-table td { padding: .7rem .9rem; border-bottom: 1px solid var(--border); font-size: .92rem; vertical-align: top; }
.list-table tr:last-child td { border-bottom: 0; }
.list-table tbody tr { cursor: pointer; }
.list-table tbody tr:hover td { background: var(--surface-2); }
.list-table tbody tr.on td { background: var(--accent-soft); }
.list-table td small { color: var(--muted); }

/* ------------------------------------------------------------ Leerer Zustand */

.empty { height: 100%; display: grid; place-items: center; padding: 1.5rem; overflow: auto; position: relative; isolation: isolate; }
.empty::before {
  content: ''; position: absolute; z-index: -1; left: 50%; top: 50%; width: 1400px; height: 1400px; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: repeating-radial-gradient(circle, transparent 0 48px, rgba(188, 146, 57, .22) 49px 50px, transparent 51px 97px, rgba(31, 107, 92, .14) 98px 99px);
  -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 65%); mask-image: radial-gradient(circle, #000 20%, transparent 65%);
}
.empty-card { width: min(560px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); padding: 2rem; display: grid; gap: 1rem; }
.empty-card h2 { font-family: var(--serif); font-size: 1.9rem; margin: 0; line-height: 1.15; }
.empty-card p { margin: 0; }
.empty-card .btn { justify-self: start; }

/* ------------------------------------------------------------ Modal, Popover, Toast */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(24, 19, 12, .4); backdrop-filter: blur(2px); display: grid; place-items: center;
  padding: 16px; z-index: 100; animation: fade .14s ease;
}
.modal-backdrop.closing { opacity: 0; transition: opacity .14s; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(8px) scale(.99); opacity: 0; } }
.modal { width: min(540px, 100%); max-height: calc(100dvh - 32px); display: grid; grid-template-rows: auto 1fr auto; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); animation: rise .18s ease; }
.modal.wide { width: min(780px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 1.2rem .6rem 1.6rem; }
.modal-head h2 { font-family: var(--serif); font-size: 1.5rem; margin: 0; }
.modal-body { padding: .2rem 1.6rem 1rem; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: .6rem; padding: .8rem 1.6rem 1.4rem; flex-wrap: wrap; }

.popover { position: fixed; z-index: 90; min-width: 260px; max-width: 340px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; animation: rise .12s ease; }
.pop-head { padding: .6rem .75rem .5rem; display: grid; font-size: .8rem; color: var(--muted); font-weight: 600; }
.pop-head strong { color: var(--ink); font-size: .95rem; }
.pop-head small { color: var(--muted); font-weight: 400; }
.pop-item { display: flex; align-items: center; gap: .65rem; width: 100%; text-align: left; border: 0; background: none; padding: .6rem .75rem; border-radius: 10px; min-height: 44px; }
.pop-item span:first-of-type { flex: 1; }
.pop-item:hover { background: var(--surface-3); }
.popover hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #221d17; color: #fff; padding: .7rem 1.1rem; border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 200;
  transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); font-weight: 500;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }

.export-list { display: grid; gap: .7rem; }
.export-tile { display: grid; grid-template-columns: 44px 1fr auto; gap: 1rem; align-items: center; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 14px; }
.export-tile.locked { background: var(--surface-2); }
.export-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.export-tile.locked .export-ic { background: var(--pro-soft); color: var(--pro); }
.export-txt p { margin: .1rem 0 0; color: var(--muted); font-size: .88rem; }
.inline-opt { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; font-size: .85rem; color: var(--muted); flex-wrap: wrap; }

.share-box { display: grid; gap: .8rem; justify-items: start; }
.copy-row { display: flex; gap: .5rem; width: 100%; }
.rev-list { display: grid; gap: .4rem; }
.rev { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: 12px; }
.rev > div { display: grid; }
.rev small { color: var(--muted); }
.add-member { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.add-member .btn { justify-self: start; }

.plan-hero { background: linear-gradient(135deg, var(--pro-soft), var(--surface-2)); border: 1px solid var(--border); border-radius: 16px; padding: 1.1rem 1.3rem; margin-bottom: 1rem; }
.plan-hero .eyebrow { color: var(--pro); }
.plan-hero .price { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; }
.plan-hero p { margin: .2rem 0 0; }
.plan-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.plan-table th, .plan-table td { padding: .55rem .6rem; border-bottom: 1px solid var(--border); text-align: left; }
.plan-table th { font-size: .8rem; color: var(--muted); }
.plan-table .pro { color: var(--ink); font-weight: 600; background: color-mix(in srgb, var(--pro-soft) 55%, transparent); }

/* ------------------------------------------------------------ Anmeldung */

.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; min-height: 100dvh; }
.auth-art {
  background: #22402f; color: #f3ecdf; padding: 2.5rem 3rem; display: grid; grid-template-rows: auto 1fr auto; gap: 2rem; position: relative; overflow: hidden;
}
.auth-art .brand-mark { color: #e7c98f; }
.auth-art .brand { color: #f3ecdf; }
.auth-claim { align-self: center; max-width: 30rem; }
.auth-claim h2 { font-family: var(--serif); font-size: clamp(1.8rem, 3.2vw, 2.7rem); line-height: 1.12; margin: 0 0 1rem; font-weight: 600; }
.auth-claim p { font-size: 1.1rem; opacity: .85; margin: 0; }
.auth-tree { color: #e7c98f; opacity: .9; max-width: 520px; }
.auth-main { display: grid; place-items: center; grid-template-rows: 1fr auto; padding: 2rem 1.5rem 1.2rem; overflow: auto; }
.auth-foot { font-size: .8rem; color: var(--muted); margin: 1.5rem 0 0; }
.auth-form { width: min(420px, 100%); display: grid; gap: 1rem; }
.auth-form h1 { font-family: var(--serif); font-size: 2.2rem; margin: 0; }
.auth-form .lead { margin: 0; }
.auth-form .seg { justify-self: start; }

.fatal { max-width: 560px; margin: 15vh auto; padding: 1.5rem; }
.fatal h1 { font-family: var(--serif); }

/* ------------------------------------------------------------ Responsiv */

@media (max-width: 1560px) {
  .top-actions .lbl { display: none; }
  .top-actions .btn.ghost { padding: 0 .6rem; }
}
@media (max-width: 1180px) {
  .top-search { width: 170px; }
  .save-ind { min-width: 0; }
  .save-ind > :not(svg) { display: none; }
}
@media (max-width: 900px) {
  .topbar { flex-wrap: nowrap; gap: .4rem; padding: 0 .5rem; min-height: 56px; }
  .top-left { flex: 1 1 auto; min-width: 0; }
  .tree-title { max-width: none; font-size: 1.02rem; padding: .35rem .4rem; }
  .top-actions { gap: 0; }
  .top-actions .grp { margin-right: .1rem; padding-right: .2rem; }
  .search-toggle { display: inline-grid; }
  .top-search {
    display: none; position: absolute; left: .5rem; right: .5rem; top: 8px; width: auto; min-width: 0; z-index: 35;
    background: var(--surface); box-shadow: var(--ring), var(--shadow);
  }
  .topbar.searching .top-search { display: flex; }
  .search-results { width: 100%; left: 0; }
  .top-center {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: .45rem .5rem calc(.45rem + env(safe-area-inset-bottom, 0px));
    background: var(--surface); border-top: 1px solid var(--border); justify-content: stretch;
  }
  .top-center .view-seg { width: 100%; }
  .top-center .view-seg button { flex: 1; justify-content: center; padding: .4rem .3rem; }
  .shell { padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
  .zoom-ctl { bottom: 12px; right: 12px; }
  .save-ind { min-width: 0; padding: 0 .3rem; }
  .save-ind > :not(svg) { display: none; }
  .demo-banner { font-size: .8rem; padding: .3rem .75rem; }
  .demo-banner .long { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .panel {
    position: fixed; left: 0; right: 0; bottom: 0; width: 100% !important; max-height: 0; border-left: 0; border-top: 1px solid var(--border);
    border-radius: 20px 20px 0 0; box-shadow: var(--shadow-lg); transition: max-height .25s ease; z-index: 50;
  }
  .panel.open { max-height: 78%; }
  .panel-body { width: 100%; min-width: 0; padding: 1.1rem 1rem 2.5rem; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 1.5rem; grid-template-rows: auto auto; }
  .auth-tree { display: none; }
  .hint { display: none; }
  .focus-chip { top: 10px; font-size: .85rem; padding-left: .8rem; max-width: calc(100% - 24px); white-space: nowrap; }
  .focus-chip > span { overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 520px) {
  .row2 { grid-template-columns: 1fr; }
  .top-actions .grp { display: none; }
  .plan-badge { display: none; }
  .brand.small { display: none; }
  .modal-body { padding: .2rem 1.1rem 1rem; }
  .export-tile { grid-template-columns: 1fr; }
  .export-ic { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.lang-btn { border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); font: 700 .78rem var(--sans); letter-spacing: .06em; border-radius: 8px; height: 32px; min-width: 40px; padding: 0 .5rem; margin: 0 .25rem; }
.lang-btn:hover { border-color: var(--accent); color: var(--accent); }
