/* Layout: one full-bleed 3D canvas with floating glass panels over it.
   Palette: lantern light underground — amber on deep indigo, moss and teal for family/DNA links.
   This app commits to a single dark look; the 3D sky carries the day/dusk/night mood. */
:root {
  --bg: #0b0e16;
  --panel: rgba(15, 19, 29, 0.74);
  --panel-strong: rgba(15, 19, 29, 0.94);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.24);
  --fg: #efe9dd;
  --fg-dim: #aab2c0;
  --fg-faint: #7d8696;
  --accent: #f2b35a;
  --accent-ink: #1a1206;
  --accent-2: #8fc98f;
  --danger: #ef6f6f;
  --dna: #49c6c0;
  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --ui: Manrope, "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --top-inset: env(safe-area-inset-top, 0px);
  --bottom-inset: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.45 var(--ui); overflow: hidden; }
#app { position: fixed; inset: 0; }
canvas#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }

button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); color: var(--fg);
  padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; cursor: pointer;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: background 0.15s, border-color 0.15s, transform 0.1s; white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, 0.14); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { background: #ffc46b; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.icon { width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 16px; }
.btn[aria-pressed="true"] { background: rgba(242, 179, 90, 0.18); border-color: var(--accent); }

/* ---------- top bar ---------- */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: calc(12px + var(--top-inset)) var(--gutter-r) 10px var(--gutter-l);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 38px; height: 38px; color: var(--accent); filter: drop-shadow(0 0 10px rgba(242, 179, 90, 0.45)); flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-dim); font-weight: 700; }
.tree-title {
  background: none; border: 0; color: var(--fg); padding: 0; text-align: left; cursor: text;
  font-family: var(--display); font-size: 24px; font-weight: 600; line-height: 1.1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tree-title:hover { color: var(--accent); }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.menu { position: relative; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 300px; z-index: 30;
  background: var(--panel-strong); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 6px; box-shadow: var(--shadow); display: grid; gap: 2px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.menu-list button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left;
  padding: 10px 12px; background: none; border: 0; color: var(--fg); border-radius: 10px; cursor: pointer;
}
.menu-list button:hover { background: rgba(255, 255, 255, 0.08); }
.menu-list button small { color: var(--fg-dim); font-weight: 400; font-size: 12px; }
.menu-list button.danger b { color: var(--danger); }

/* ---------- bottom controls ---------- */
.viewbar {
  position: absolute; left: var(--gutter-l); bottom: calc(16px + var(--bottom-inset)); z-index: 15;
  display: flex; gap: 4px; padding: 5px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.viewbar .btn { background: transparent; border-color: transparent; backdrop-filter: none; padding: 7px 12px; }
.viewbar .btn:hover { background: rgba(255, 255, 255, 0.1); }
.viewbar .btn.primary { background: var(--accent); color: var(--accent-ink); margin-left: 4px; }
.viewbar .btn.primary:hover { background: #ffc46b; }
.hint {
  position: absolute; right: var(--gutter-r); bottom: calc(22px + var(--bottom-inset)); z-index: 10;
  font-size: 12.5px; color: var(--fg-dim); background: rgba(10, 12, 18, 0.55); padding: 6px 12px; border-radius: 999px;
  pointer-events: none; max-width: calc(100vw - var(--gutter-l) - var(--gutter-r) - 340px);
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 1000px) { .hint { display: none; } }
/* the branch compass: one chip per founding branch (a tap turns the view to it), and "Unfold all"
   while anything is folded; a slim row above the hint, clear of the view bar */
.compass {
  position: absolute; right: var(--gutter-r); bottom: calc(58px + var(--bottom-inset)); z-index: 14;
  display: flex; gap: 6px; align-items: center; box-sizing: border-box;
  max-width: min(620px, calc(100vw - var(--gutter-l) - var(--gutter-r) - 420px));
  overflow-x: auto; scrollbar-width: thin; padding: 4px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.compass-label { flex: none; padding-left: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--fg-faint); }
.compass-chips { display: flex; gap: 6px; flex: none; }
.compass-unfold { order: -1; }   /* (first in the row, so it is never scrolled out of sight) */
/* (a long row fades at the edge it scrolls on: ui.js sets .more-l / .more-r) */
.compass.more-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.compass.more-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent); }
.compass.more-l.more-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.compass .chip {
  height: 28px; min-height: 0; padding: 0 11px; border-radius: 999px; flex: none; white-space: nowrap;
  font: 600 12.5px var(--ui); backdrop-filter: none; -webkit-backdrop-filter: none;
}
.compass .chip[style*="--tint"]::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tint); flex: none; }
@media (max-width: 1000px) { .compass { bottom: calc(70px + var(--bottom-inset)); } }
@media (pointer: coarse) { .compass .chip { height: auto; min-height: 40px; } }   /* (touch tablets: thumb-sized too) */
@supports selector(:has(*)) {
  #app:has(.panel-right:not([hidden])) .compass { visibility: hidden; }   /* Customize, Share: it steps away */
}
/* a button that cannot act here, with its reason in its title (the home line's Fold this branch) */
.btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.orb-tip {
  position: absolute; transform: translate(-50%, -150%); z-index: 25; pointer-events: none;
  background: var(--panel-strong); color: var(--fg); padding: 5px 10px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; border: 1px solid var(--line-strong); white-space: nowrap;
}
/* the box that explains a button while the mouse rests on it (ui.showTip places it under the button,
   or beside a menu's item, its little point toward it at --tip-x / --tip-y) */
.tip-box {
  position: fixed; left: 0; top: 0; z-index: 35; box-sizing: border-box; width: max-content; max-width: min(340px, calc(100vw - 24px)); pointer-events: none;
  display: flex; flex-direction: column; gap: 4px; padding: 11px 14px 12px; border-radius: 12px; text-align: left;
  background: var(--panel-strong); color: var(--fg); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  font-size: 15px; line-height: 1.45; text-wrap: pretty;
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s 0.18s;
}
.tip-box.on { opacity: 1; visibility: visible; transform: none; transition: opacity 0.18s ease, transform 0.18s ease; }
.tip-box b { font-size: 16.5px; color: var(--accent); }
.tip-box::before { content: ""; position: absolute; width: 10px; height: 10px; background: inherit; border: inherit; border-width: 1px 0 0 1px; }
.tip-box.below::before { left: var(--tip-x, 50%); top: -6px; transform: translateX(-50%) rotate(45deg); }
.tip-box.left::before { top: var(--tip-y, 18px); right: -6px; transform: translateY(-50%) rotate(135deg); }
.tip-box.right::before { top: var(--tip-y, 18px); left: -6px; transform: translateY(-50%) rotate(-45deg); }

/* ---------- panels ---------- */
.panel {
  position: absolute; z-index: 18;
  top: calc(74px + var(--top-inset)); bottom: calc(16px + var(--bottom-inset));
  width: min(390px, calc(100vw - var(--gutter-l) - var(--gutter-r)));
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  backdrop-filter: blur(20px) saturate(1.25); -webkit-backdrop-filter: blur(20px) saturate(1.25);
  box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
}
.panel-left { left: var(--gutter-l); }
.panel-right { right: var(--gutter-r); }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-family: var(--display); font-size: 26px; font-weight: 600; margin: 2px 0 0; line-height: 1.1; text-wrap: balance; overflow-wrap: anywhere; }
.panel-body { overflow: auto; padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 14px; min-height: 0; flex: 1; }
.panel-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--line); }
.panel-foot .btn.danger { margin-left: auto; }   /* (wrapped onto a line of its own, Delete still stands right) */
.spacer { flex: 1; }
.kicker { text-transform: uppercase; letter-spacing: 0.14em; font-size: 11px; color: var(--accent); font-weight: 700; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-dim); font-weight: 700; display: flex; justify-content: space-between; }
.field output { color: var(--fg); letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
.field.grow { flex: 1 1 150px; }
input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="tel"], input[type="url"], input[type="number"], textarea, select {
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: var(--fg);
  border-radius: 10px; padding: 9px 11px; font: inherit; width: 100%; box-sizing: border-box; min-width: 0;
}
textarea { resize: vertical; }
select option { background: #151a26; color: var(--fg); }
input[type="color"] { width: 46px; height: 38px; padding: 2px; border-radius: 10px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
input[type="range"] { width: 100%; accent-color: var(--accent); margin: 6px 0 2px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

.seg { display: flex; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--fg-dim); padding: 7px 4px; border-radius: 8px; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.16); color: var(--fg); }

.photo-row { display: flex; gap: 14px; align-items: center; }
.photo-frame {
  width: 96px; height: 96px; border-radius: 50%; flex: none; background: #2b3447 center / cover no-repeat;
  border: 3px solid var(--accent); display: grid; place-items: center;
  font-family: var(--display); font-size: 38px; font-weight: 600; color: rgba(255, 255, 255, 0.92);
}
.photo-actions { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.photo-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-strip:empty { display: none; }
.photo-thumb {
  width: 44px; height: 44px; border-radius: 9px; padding: 0; cursor: pointer; position: relative; flex: none;
  background: #2b3447 center / cover no-repeat; border: 2px solid var(--line);
}
.photo-thumb.is-profile { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(242, 179, 90, 0.35); }
.photo-thumb .x {
  position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; line-height: 1;
  display: grid; place-items: center; background: var(--panel-strong); color: var(--fg); border: 1px solid var(--line-strong);
}
.photo-thumb[disabled] { cursor: default; opacity: 0.8; }
#pp-photo-hint { flex: 1 1 120px; }

.rel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.links { display: flex; flex-wrap: wrap; gap: 6px; }
.links:empty::after { content: "No one yet"; color: var(--fg-faint); font-size: 12.5px; }
.links button {
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); color: var(--fg);
  border-radius: 999px; padding: 5px 11px; font-size: 12.5px; cursor: pointer; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.links button:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.12); }
.links button b { color: var(--fg-dim); font-weight: 700; margin-right: 5px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.ged-link { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ged-link span { font-size: 12px; color: var(--fg-faint); }
.dna-box { border: 1px solid rgba(73, 198, 192, 0.45); background: rgba(73, 198, 192, 0.1); border-radius: 12px; padding: 10px 12px; color: var(--fg); font-size: 13px; }
.dna-box b { color: var(--dna); }

/* customize */
.cz h3 { font-family: var(--display); font-size: 20px; font-weight: 600; margin: 0 0 8px; }
.cz { display: flex; flex-direction: column; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.cz:last-of-type { border-bottom: 0; }
.style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.style-grid button {
  text-align: left; padding: 10px 12px; border-radius: 12px; cursor: pointer;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); color: var(--fg);
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.style-grid button:hover { background: rgba(255, 255, 255, 0.1); }
.style-grid button[aria-pressed="true"] { border-color: var(--accent); background: rgba(242, 179, 90, 0.12); }
.style-grid b { font-family: var(--display); font-size: 17px; font-weight: 600; }
.style-grid small { color: var(--fg-dim); font-size: 11.5px; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); cursor: pointer; padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3); position: relative;
}
.swatch.metal::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, 0.35)); }
.swatch.crystal::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0 20%, rgba(255, 255, 255, 0.1) 21% 55%, rgba(255, 255, 255, 0.6) 56% 60%, transparent 61%); }
.swatch[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(242, 179, 90, 0.45); }
.biome-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.biome-grid button {
  padding: 5px; border-radius: 10px; cursor: pointer; min-width: 0;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); color: var(--fg);
  display: flex; flex-direction: column; gap: 5px; align-items: stretch; font-size: 11px; font-weight: 600;
}
.biome-grid button:hover { background: rgba(255, 255, 255, 0.1); }
.biome-grid button[aria-pressed="true"] { border-color: var(--accent); background: rgba(242, 179, 90, 0.12); }
.biome-grid i { display: block; height: 34px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.15); }
.biome-grid span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.color-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.color-row .field > span { font-size: 9.5px; letter-spacing: 0.04em; justify-content: center; }
.color-row input[type="color"] { width: 100%; height: 34px; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 13px; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }

/* share panel and guest bar */
.sh-note { margin: 0; color: var(--fg-dim); }
.sh-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.sh-box h3 { font-family: var(--display); font-size: 20px; font-weight: 600; margin: 0; }
.sh-account { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sh-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.sh-row:first-of-type { border-top: 0; }
.sh-row > div:first-child { min-width: 0; }
.sh-row b { overflow-wrap: anywhere; }
.sh-account b { overflow-wrap: anywhere; }
.sh-details summary { cursor: pointer; color: var(--fg-dim); font-size: 12.5px; }
.sh-details { display: flex; flex-direction: column; gap: 8px; }
/* sign in / create account: two tabs over one short form */
.sh-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.sh-tabs button { border: 0; border-radius: 9px; padding: 9px 8px; min-height: 40px; background: transparent; color: var(--fg-dim); font: inherit; font-weight: 700; cursor: pointer; }
.sh-tabs button[aria-selected="true"] { background: rgba(242, 179, 90, 0.18); color: var(--fg); }
.sh-switch { align-self: center; padding: 8px 4px; min-height: 40px; font-size: 14px; }
.sh-alert { border-color: rgba(242, 179, 90, 0.55); background: rgba(242, 179, 90, 0.08); }
#sh-link { font-size: 12px; flex: 1; }
.btn.busy { opacity: 0.6; pointer-events: none; }
.guestbar {
  position: absolute; top: calc(70px + var(--top-inset)); left: 50%; transform: translateX(-50%); z-index: 19;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center;
  padding: 8px 10px 8px 16px; background: var(--panel-strong); border: 1px solid var(--line-strong); border-radius: 999px;
  max-width: calc(100vw - var(--gutter-l) - var(--gutter-r)); box-shadow: var(--shadow); font-weight: 600;
}
.gb-actions { display: flex; gap: 6px; flex-wrap: wrap; }
body.mode-viewer #examplebar, body.mode-guest #examplebar { display: none; }
#examplebar .short { display: none; }
/* the free trial's bar (js/share.js applyPlan) */
#planbar { padding-right: 6px; }
#planbar .short { display: none; }
#planbar #pb-close { width: 34px; height: 34px; padding: 0; font-size: 18px; }
body.mode-viewer #planbar, body.mode-guest #planbar { display: none; }
/* keeping a tree: what paying brings, and its web address (needed before the payment page) */
.sh-plan { border-color: rgba(242, 179, 90, 0.55); background: rgba(242, 179, 90, 0.06); }
.sh-perks { margin: 0; padding-left: 18px; color: var(--fg-dim); font-size: 13px; line-height: 1.55; }
.sh-why { margin: 2px 0 0; color: var(--fg); font-size: 13px; line-height: 1.5; font-style: italic; }
.slug-wrap { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: rgba(0, 0, 0, 0.18); }
.slug-wrap:focus-within { border-color: var(--accent); }
.slug-host { display: flex; align-items: center; padding: 0 2px 0 10px; color: var(--fg-dim); font-size: 13px; white-space: nowrap; text-transform: none; letter-spacing: 0; font-weight: 600; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.slug-wrap input { flex: 1; min-width: 0; border: 0 !important; border-radius: 0; background: transparent !important; box-shadow: none !important; padding-left: 0; }
.slug-msg { margin: -4px 0 0; min-height: 1.4em; }
.slug-msg.ok { color: #8fd694; }
.slug-msg.bad { color: var(--danger); }
.slug-sugg { color: var(--fg-dim); }
.sh-box .fine a { color: var(--accent); }
body.mode-viewer .viewbar #btn-add { display: none; }

/* ---------- landing, modal, toasts ---------- */
/* ---- landing page: the showcase reel (js/showcase.js) plays behind a tagline and four buttons ---- */
.landing { display: none; position: absolute; left: 0; right: 0; top: calc(72px + var(--top-inset)); z-index: 16; pointer-events: none;
  flex-direction: column; align-items: center; gap: 10px; padding: 0 var(--gutter-r) 0 var(--gutter-l); text-align: center;
  transition: opacity 0.5s ease, transform 0.5s ease, visibility 0s linear 0s; }
body.showcase .landing { display: flex; }
.landing > * { pointer-events: auto; }
.landing-tag { margin: 0; font-family: var(--display); font-size: clamp(22px, 3.2vw, 32px); font-weight: 600; line-height: 1.1; text-wrap: balance;
  color: #fffaf2; text-shadow: 0 1px 3px rgba(20, 12, 24, 0.75), 0 0 14px rgba(20, 12, 24, 0.6), 0 2px 26px rgba(0, 0, 0, 0.45); }   /* (the tight shadow keeps it legible on the reel's pale opening sky) */
.landing-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.landing-actions .btn { min-height: 44px; padding: 10px 20px; font-size: 15px; }
/* (a darker glass under the plain buttons: the reel's pale skies, Rose Garden and Lavender Morning,
   would wash out the usual faint white one) */
.landing .btn:not(.primary), body.showcase .topbar .btn:not(.primary) { background: rgba(16, 14, 24, 0.46); border-color: rgba(255, 255, 255, 0.3); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45); }
.landing .btn:not(.primary):hover, body.showcase .topbar .btn:not(.primary):hover { background: rgba(16, 14, 24, 0.6); }
.landing-fine { margin: -2px 0 0; font-size: 12.5px; font-weight: 600; color: #eef1f6; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85), 0 0 12px rgba(0, 0, 0, 0.55); }
.landing .short { display: none; }
/* close shots and demos: the strip fades up and away, a compact Start my tree waits in the top bar */
body.showcase.sc-zoom .landing { opacity: 0; transform: translateY(-14px); visibility: hidden; pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease, visibility 0s linear 0.5s; }
body.showcase.sc-zoom .landing > * { pointer-events: none; }
.landing-mini { display: none; }
.landing-mini .short { display: none; }
body.showcase .landing-mini { display: inline-flex; opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0s linear 0.4s; }
body.showcase.sc-zoom .landing-mini { opacity: 1; visibility: visible; transition: opacity 0.4s ease 0.15s; }
/* the caption: large dreamy words over the scene, crossfading softly as they change; a dark haze
   behind them keeps them readable on bright skies */
.showcase-caption { position: absolute; left: 0; right: 0; margin: 0 auto; width: fit-content; bottom: calc(30px + var(--bottom-inset)); z-index: 16;
  max-width: min(720px, calc(100% - 40px)); box-sizing: border-box; padding: 6px 22px; text-align: center; text-wrap: balance;
  font-family: var(--display); font-style: italic; font-weight: 500; font-size: clamp(23px, 2.3vw, 30px); line-height: 1.22; letter-spacing: 0.01em;
  color: #fff6e6; text-shadow: 0 0 22px rgba(255, 206, 140, 0.55), 0 0 6px rgba(255, 226, 180, 0.35), 0 2px 14px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.6);
  opacity: 0; filter: blur(7px); transform: translateY(4px); pointer-events: none;
  transition: opacity 0.5s ease, filter 0.5s ease, transform 0.5s ease; }
.showcase-caption::before { content: ""; position: absolute; inset: -18px -40px; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(6, 8, 16, 0.5), rgba(6, 8, 16, 0.28) 55%, transparent); }
.showcase-caption:empty::before { display: none; }
.showcase-caption.on { opacity: 1; filter: none; transform: none; transition: opacity 0.9s ease, filter 0.9s ease, transform 0.9s ease; }
.showcase-caption.measure { visibility: hidden; transition: none; }
/* over a phone's bottom sheet the reel opened, the caption goes up under the top bar */
.showcase-caption.at-top { bottom: auto; top: calc(66px + var(--top-inset)); }
body:not(.showcase) .showcase-caption { display: none; }
.showcase-fade { position: absolute; inset: 0; z-index: 5; background: #05060a; opacity: 0; pointer-events: none; transition: opacity 0.6s ease; }
.showcase-fade.on { opacity: 1; }
/* between two families the last frame is held still over the scene, then melts into the next tree */
.showcase-still { position: absolute; inset: 0; z-index: 5; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.showcase-still.on { opacity: 1; }
.showcase-still.melt { transition: opacity 0.9s ease; }
/* (a postcard's quicker dissolve, from one look of the family to the next: POSTCARD_MELT) */
.showcase-still.melt.quick { transition-duration: 0.6s; }
body:not(.showcase) .showcase-still { display: none; }
/* a landing button the reel's hand pressed (only for show): it glows while the caption explains it */
body.showcase .landing .btn { transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.3s ease; }
body.showcase .landing .btn.sc-hot { box-shadow: 0 0 0 2px #ffd28a, 0 0 22px rgba(255, 200, 120, 0.7); }
/* the guiding hand: it glides to what it clicks (moved by js/showcase.js), presses, and a ring of light spreads */
.showcase-hand { position: absolute; left: 0; top: 0; z-index: 40; width: 36px; height: 45px; pointer-events: none; opacity: 0; transition: opacity 0.35s ease; }
.showcase-hand.on { opacity: 1; }
.showcase-hand.gone { transition: none; }
.showcase-hand svg, .showcase-look svg { display: block; width: 100%; height: 100%; overflow: visible; transform-origin: 40% 8%; transition: transform 0.14s ease; }
.showcase-hand path, .showcase-look path { fill: #fffaf0; stroke: #1c1408; stroke-width: 1.6; stroke-linejoin: round; }
.showcase-hand .knuckles, .showcase-look .knuckles { fill: none; stroke-width: 1.2; stroke-linecap: round; opacity: 0.55; }
.showcase-hand svg { filter: drop-shadow(0 0 10px rgba(255, 200, 120, 0.75)) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5)); }
.showcase-hand.press svg { transform: scale(0.86) translateY(1px); }
/* its shapes: the pointing finger; an open hand and a fist for a drag (both held at their middle);
   the finger on a mouse wheel that rolls; two fingertips for a pinch (--pinch: how far apart) */
.showcase-hand > svg { position: absolute; inset: 0; transition: opacity 0.12s ease, transform 0.14s ease, scale 0.2s ease; }
.showcase-hand .hand-open, .showcase-hand .hand-fist, .showcase-hand .sc-mouse, .showcase-hand > i,
.showcase-hand.open .hand-point, .showcase-hand.fist .hand-point, .showcase-hand.pinch .hand-point { opacity: 0; }
.showcase-hand.open .hand-open, .showcase-hand.fist .hand-fist, .showcase-hand.wheel .sc-mouse, .showcase-hand.pinch > i { opacity: 1; }
.showcase-hand .hand-open, .showcase-hand .hand-fist { transform-origin: 58% 72%; }
.showcase-hand.fist .hand-fist { transform: scale(0.94); }
.showcase-hand .sc-mouse { inset: auto; left: -0.4px; top: -15.9px; width: 30px; height: 45px; transform-origin: 15px 18.2px; }
/* (the finger on the wheel is drawn larger, round its fingertip, so the mouse reads at a glance) */
.showcase-hand.wheel > svg { scale: 1.4; }
.showcase-hand .sc-mouse .body { fill: rgba(18, 14, 9, 0.9); stroke: #fffaf0; stroke-width: 1.3; }
.showcase-hand .sc-mouse .seam { fill: none; stroke: rgba(255, 250, 240, 0.45); stroke-width: 1; }
.showcase-hand .sc-mouse .wheel { fill: #ffd28a; stroke: none; }
.showcase-hand .sc-mouse .ticks { fill: none; stroke: #5a3a10; stroke-width: 1.1; }
.showcase-hand.zoom-in .sc-mouse .ticks { animation: sc-roll 0.42s linear infinite; }
.showcase-hand.zoom-out .sc-mouse .ticks { animation: sc-roll 0.42s linear infinite reverse; }
@keyframes sc-roll { from { transform: translateY(0); } to { transform: translateY(-3px); } }
/* (the fingertips in the hand's own colours, with a faint line from one to the other, so the two
   read as one pinch and never as two more lights in the roots) */
.showcase-hand > i { position: absolute; left: 12px; top: 21px; width: 18px; height: 22px; box-sizing: border-box; border-radius: 50%; transition: opacity 0.12s ease;
  background: #fffaf0; border: 1.6px solid #1c1408; box-shadow: 0 0 10px rgba(255, 200, 120, 0.75), 0 3px 6px rgba(0, 0, 0, 0.5);
  transform: translate(calc(var(--pinch, 12px) * -0.7), calc(var(--pinch, 12px) * 0.7)) rotate(45deg); }
.showcase-hand > i + i { transform: translate(calc(var(--pinch, 12px) * 0.7), calc(var(--pinch, 12px) * -0.7)) rotate(45deg); }
.showcase-hand::before { content: ""; position: absolute; left: 21px; top: 32px; width: calc(var(--pinch, 12px) * 1.98); height: 2px; border-radius: 1px; opacity: 0;
  background: rgba(255, 250, 240, 0.6); box-shadow: 0 0 6px rgba(255, 200, 120, 0.7); transform: translate(-50%, -50%) rotate(-45deg); transition: opacity 0.12s ease; }
.showcase-hand.pinch::before { opacity: 1; }
/* "Click to look around": a hand swaying as if it turns the scene, just above the caption */
.showcase-look { position: absolute; left: 50%; bottom: calc(110px + var(--bottom-inset)); z-index: 17; display: flex; align-items: center; gap: 10px;
  padding: 7px 16px 7px 12px; border-radius: 999px; background: rgba(10, 12, 20, 0.55); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--fg); font-weight: 600; font-size: 13.5px; white-space: nowrap;
  opacity: 0; visibility: hidden; transform: translate(-50%, 6px); pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease, visibility 0s linear 0.5s; }
.showcase-look.on { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity 0.5s ease, transform 0.5s ease; }
.showcase-look svg { width: 20px; height: 25px; flex: none; animation: sc-look 2.2s ease-in-out infinite; }
@keyframes sc-look { 0%, 100% { transform: translateX(-5px) rotate(-8deg); } 50% { transform: translateX(5px) rotate(8deg); } }
body:not(.showcase) .showcase-hand, body:not(.showcase) .showcase-look { display: none; }
/* while the reel plays, only what a first-time visitor needs is on screen. The reel's own demos show
   the real Customize and person panels (marked .sc-open), the view bar (body.sc-bar) and the branch
   compass (body.sc-compass), as props: the visitor's own taps go through them to the scene, which
   pauses the reel. */
body.showcase:not(.sc-bar) .viewbar, body.showcase:not(.sc-compass) .compass, body.showcase #panel-customize:not(.sc-open), body.showcase #panel-person:not(.sc-open), body.showcase #panel-family,
body.showcase .topbar .actions .menu, body.showcase #btn-share, body.showcase #btn-account, body.showcase .guestbar, body.showcase .hint { display: none !important; }
body.showcase .viewbar, body.showcase .viewbar *, body.showcase .compass, body.showcase .compass *, body.showcase .panel.sc-open, body.showcase .panel.sc-open * { pointer-events: none; }
/* (Customize's last button, under its sections, comes and goes from view as the demo opens and
   folds them: the visitor cannot press it during the reel anyway) */
body.showcase #cz-reset { visibility: hidden; }
body.showcase.sc-bar .showcase-caption:not(.at-top), body.showcase.sc-compass .showcase-caption:not(.at-top) { bottom: calc(76px + var(--bottom-inset)); }
/* (the compass prop goes down where the hint would be, so the caption stands clear above it; it
   glows twice as it comes up, to draw the eye there) */
body.showcase.sc-compass .compass { bottom: calc(22px + var(--bottom-inset)); animation: sc-glow 1.1s ease-out 2; }
@keyframes sc-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 206, 140, 0); } 35% { box-shadow: 0 0 24px 4px rgba(255, 206, 140, 0.6); } }
/* (over a bright sky or a close shot, a soft dark haze behind the brand, the title and the buttons) */
body.showcase .topbar::before { content: ""; position: absolute; inset: 0 0 auto; height: calc(100% + 10px); z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(6, 8, 16, 0.5), rgba(6, 8, 16, 0.22) 60%, transparent); }
body.showcase .topbar .btn:not(.primary) { background: rgba(10, 12, 20, 0.55); }
#pp-caption.sc-focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 179, 90, 0.28); }
body.showcase #title-btn { pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .showcase-caption, .showcase-caption.on, .showcase-fade, .showcase-still.melt, .landing, body.showcase.sc-zoom .landing, .landing-mini, body.showcase .landing-mini,
  body.showcase.sc-zoom .landing-mini, .showcase-look, .showcase-look.on, body.showcase .landing .btn { transition: none; }
  .showcase-caption { filter: none; transform: none; }
  .showcase-hand { display: none; }
  .showcase-look svg, body.showcase.sc-compass .compass { animation: none; }
}
.fine { font-size: 12px; color: var(--fg-faint); margin: 16px 0 0 !important; }

.modal { position: absolute; inset: 0; background: rgba(5, 7, 12, 0.6); display: grid; place-items: center; padding: 16px var(--gutter-r) 16px var(--gutter-l); z-index: 50; }
.modal-card {
  width: min(600px, 100%); max-height: calc(100% - 20px); overflow: auto; box-sizing: border-box;
  background: var(--panel-strong); border: 1px solid var(--line-strong); border-radius: 18px; padding: 22px 24px; box-shadow: var(--shadow);
}
.modal h2 { font-family: var(--display); font-size: 30px; font-weight: 600; margin: 0 0 8px; }
.modal p { color: var(--fg-dim); margin: 0 0 12px; }
.modal p.warn { color: var(--accent); }
.modal textarea { width: 100%; min-height: 220px; font: 12px/1.45 ui-monospace, Consolas, "SF Mono", monospace; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.modal img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; }
.modal ul { color: var(--fg-dim); padding-left: 20px; margin: 0 0 12px; }
.modal li { margin: 3px 0; }
.modal kbd { background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font: 12px var(--ui); color: var(--fg); }
.modal h3 { font-family: var(--display); font-size: 20px; margin: 14px 0 6px; font-weight: 600; }
/* a person's record from their GEDCOM file, and the whole file */
.ged-rows { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ged-row { display: grid; grid-template-columns: 128px minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 9px 12px; }
.ged-row + .ged-row { border-top: 1px solid var(--line); }
.ged-row b { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-dim); padding-top: 3px; }
.ged-row span { white-space: pre-wrap; overflow-wrap: anywhere; }
.ged-row .btn { padding: 4px 11px; font-size: 12px; }
.modal p.ged-none { margin: 10px 0 0; }
.ged-raw { margin-top: 12px; }
.ged-raw summary { cursor: pointer; color: var(--fg-dim); font-size: 13px; }
.ged-raw pre { margin: 8px 0 0; max-height: 220px; overflow: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.04); font: 12px/1.45 ui-monospace, Consolas, "SF Mono", monospace; }
.ged-find { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.ged-count { font-size: 12px; color: var(--fg-faint); white-space: nowrap; }
.modal textarea#ged-text { height: min(48vh, 420px); min-height: 160px; resize: none; }

.toasts { position: absolute; left: 50%; top: calc(80px + var(--top-inset)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; pointer-events: none; width: min(520px, calc(100vw - 32px)); align-items: center; }
.toast {
  background: var(--panel-strong); border: 1px solid var(--line-strong); color: var(--fg); padding: 10px 16px; border-radius: 12px;
  box-shadow: var(--shadow); animation: toast-in 0.25s ease-out; text-align: center; max-width: 100%; box-sizing: border-box;
}
.toast.error { border-color: rgba(239, 111, 111, 0.6); }
/* a note that stays a while, with a button to put it away (the one-time fold suggestion) */
.toast.note { display: flex; align-items: center; gap: 12px; text-align: left; }
.toast.note .btn { flex: none; pointer-events: auto; }   /* (only its button takes taps: the guest bar under it stays usable) */
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }
/* "Arranging the roots…": a quiet note over the canvas while a very large tree is first laid out
   (under the panels, sheets and the top bar; it never takes a tap) */
.roots-busy {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); z-index: 12; pointer-events: none;
  background: var(--panel); border: 1px solid var(--line); color: var(--fg); font-size: 13px; padding: 8px 16px; border-radius: 999px;
  backdrop-filter: blur(14px); white-space: nowrap; animation: busy-pulse 1.6s ease-in-out infinite alternate;
}
@keyframes busy-pulse { from { opacity: 0.55; } to { opacity: 0.9; } }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .ged-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ged-row b { grid-column: 1 / -1; }
  .brand-name { display: none; }
  .tree-title { font-size: 19px; max-width: 34vw; }
  .btn { padding: 7px 11px; font-size: 12.5px; }
  .menu-list { min-width: 260px; }
  .panel {
    top: auto; bottom: 0; left: 0; right: 0; width: 100%; max-height: 64vh; border-radius: 18px 18px 0 0;
    padding-bottom: var(--bottom-inset);
  }
  .panel-left, .panel-right { left: 0; right: 0; }
  .hint { display: none; }
  .viewbar { bottom: calc(12px + var(--bottom-inset)); }
  .viewbar .btn { padding: 7px 9px; font-size: 12px; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
  .roots-busy { animation: none; opacity: 0.8; }
  .btn { transition: none; }
}

/* a button that reads as a link inside a sentence (sign-in panel) */
.linklike { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--accent, #ffcf7a); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.linklike:hover { opacity: .85; }
#btn-account.signed-in { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* password fields: an eye toggles between hidden and visible text */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 44px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft, #c9c2b6); cursor: pointer; display: grid; place-items: center; }
.pw-eye:hover { background: rgba(255,255,255,.06); }
.pw-eye::before { content: ""; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--eye) center / contain no-repeat; mask: var(--eye) center / contain no-repeat;
  --eye: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.pw-eye.on::before { --eye: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18M10.6 10.6a3 3 0 0 0 4.2 4.2M9.9 5.2A10.5 10.5 0 0 1 12 5c6.5 0 10 7 10 7a17 17 0 0 1-3.2 4.1M6.2 6.2A17.5 17.5 0 0 0 2 12s3.5 7 10 7c1.6 0 3-.4 4.2-1'/%3E%3C/svg%3E"); }

/* ---- Customize: compact, collapsible, leaves most of the screen to the tree ---- */
#panel-customize { width: min(320px, calc(100vw - var(--gutter-l) - var(--gutter-r))); }
#panel-customize .panel-head { padding: 12px 14px 8px; }
#panel-customize .panel-head h2 { font-size: 20px; }
.cz-body { padding: 8px 12px 12px; gap: 6px; }
details.cz { gap: 8px; padding: 0 0 6px; }
details.cz > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 8px; padding: 8px 2px; user-select: none; }
details.cz > summary::-webkit-details-marker { display: none; }
details.cz > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--fg-dim); border-bottom: 2px solid var(--fg-dim); transform: rotate(-45deg); transition: transform .15s; flex: none; margin-right: 2px; }
details.cz[open] > summary::before { transform: rotate(45deg); }
details.cz > summary h3 { font-size: 17px; margin: 0; }
details.cz > summary small { color: var(--fg-dim); font-size: 11.5px; }
details.cz:not([open]) { padding-bottom: 0; }
#panel-customize .style-grid { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
#panel-customize .style-grid button { padding: 7px 6px; }
#panel-customize .style-grid b { font-size: 13.5px; }
#panel-customize .style-grid small { display: none; }
#panel-customize .biome-grid { grid-template-columns: repeat(4, 1fr); gap: 5px; font-size: 10.5px; }
#panel-customize .biome-grid i { height: 24px; }
#panel-customize .swatches { gap: 5px; }
#panel-customize .swatch { width: 22px; height: 22px; }
#panel-customize .field > span { font-size: 10.5px; }
#panel-customize .rel-grid .btn, #panel-customize .seg button { font-size: 12.5px; }
#panel-customize .fine { margin: 0; }
