/* Banyan's look (v1.26): warm ivory ground, white surfaces, deep garden green.
   Every page takes its colours from these, so change them here first. */
:root {
  --ink: #1d2920;
  --muted: #56625a;
  --line: #e4dccb;
  --paper: #ffffff;
  --cream: #f7f3ea;
  --surface-soft: #fdfbf6;
  --green: #2e5b43;
  --green-deep: #1f4331;
  --leaf: #eaf1e3;
  --gold: #a9782e;
  --amber: #c9871f;
  --shadow: 0 1px 2px rgba(50, 40, 20, 0.05), 0 8px 22px rgba(50, 40, 20, 0.07);
  --radius: 20px;
  font-family: Figtree, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
}

* { box-sizing: border-box; }
/* Text size: everything is sized from this one base, so choosing a bigger size
   grows text, buttons, cards, and menus together. 100% also follows the size
   people set in their browser. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; font-size: 100%; }
html[data-text="lg"] { font-size: 115%; }
html[data-text="xl"] { font-size: 130%; }
html[data-text="xxl"] { font-size: 150%; }
body {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.55;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
a { color: var(--green-deep); }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
/* iOS Safari zooms inputs under 16px — keep controls readable without pinch-zoom jumps */
input, select, textarea { font-size: max(16px, 1em); }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 560; letter-spacing: -0.03em; line-height: 1.15; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); margin: 0 0 0.3rem; }
h2 { font-size: 1.5rem; margin: 0 0 0.6rem; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: white; padding: 0.5rem 0.8rem; z-index: 5; }

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  padding: 0.8rem 1.2rem;
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 0.7rem; align-items: center; text-decoration: none; color: inherit; margin-right: auto; }
.brand-mark { border-radius: 12px; object-fit: cover; box-shadow: 0 0 0 1px rgba(50, 40, 20, 0.08); }
.brand span { display: flex; flex-direction: column; font-family: Fraunces, Georgia, serif; font-size: 1.2rem; line-height: 1; }
.brand small { font-family: Figtree, sans-serif; color: var(--muted); font-size: 0.82rem; letter-spacing: 0.04em; margin-top: 0.2rem; }
.current-tree { color: var(--muted); font-weight: 600; text-decoration: none; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The welcome sits in the open middle of the header, with room on both sides. */
.top:has(.header-greet-slot) > .brand { margin-right: 0; }
.header-greet-slot {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center;
  overflow: hidden; container: greet / inline-size;
}
.header-greet {
  margin: 0; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-weight: 600; font-size: 1.02rem; line-height: 1.2;
}
@container greet (max-width: 13rem) {
  .header-greet { display: none; }
}
.current-tree:hover { color: var(--ink); text-decoration: underline; }
.top nav { display: flex; gap: 0.5rem; align-items: center; }
.nav-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  background: transparent;
}
.nav-bell:hover { background: var(--leaf); }
.nav-bell.has-notes { color: var(--green-deep); }
.nav-bell-badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: #b45309;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.15rem;
  text-align: center;
}
.emoji-picker { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.2rem 0 0.4rem; }
.emoji-btn {
  min-width: 2.2rem;
  min-height: 2.2rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fdfbf6;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
}
.emoji-btn:hover { background: var(--leaf); }
.note-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; }
.note-card {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fdfbf6;
}
.note-card.needs-you { border-color: #c9a227; background: #fff9e8; }
.note-card.is-done { opacity: 0.78; }
.note-meta { margin: 0 0 0.35rem; font-size: 0.9rem; color: var(--muted); }
.note-body { margin: 0.35rem 0 0.6rem; white-space: pre-wrap; }
.pill {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--leaf);
  color: var(--green-deep);
  font-size: 0.82rem;
  font-weight: 700;
}
.pill.warn { background: #fde8c8; color: #8a4b00; }
.admin-manual .manual-toc { margin: 1rem 0 1.5rem; }
.admin-manual .manual-section { margin: 1.5rem 0; padding-top: 0.5rem; border-top: 1px solid var(--line); }
.plain { padding-left: 1.2rem; }

.icon {
  width: 1.05em;
  height: 1.05em;
  flex: none;
  display: block;
  color: inherit;
  opacity: 0.82;
  stroke-width: 1.65;
}
.icon-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  line-height: 1.2;
}
.btn .icon {
  opacity: 0.92;
}
.btn.primary .icon,
.view-switch a.on .icon {
  opacity: 1;
  color: #fff;
}
.btn.quiet .icon {
  color: var(--green-deep);
  opacity: 0.72;
}
.btn.quiet:hover .icon {
  opacity: 0.95;
  color: var(--green);
}
.menu summary .icon {
  color: var(--green);
  opacity: 0.78;
  width: 1.1em;
  height: 1.1em;
}
.menu a .icon-label,
.menu button .icon-label {
  width: 100%;
  justify-content: flex-start;
}
.menu a .icon,
.menu button .icon {
  color: var(--green-deep);
  opacity: 0.7;
  width: 1.05em;
  height: 1.05em;
}
.menu a:hover .icon,
.menu button:hover .icon {
  opacity: 1;
  color: var(--green);
}
.page-title,
.help-title,
.help-heading {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.page-title .icon,
.help-title .icon,
.help-heading .icon {
  width: 0.78em;
  height: 0.78em;
  color: var(--green);
  opacity: 0.8;
}
.help-nav .icon-label {
  gap: 0.55rem;
}
.help-nav .icon {
  width: 1rem;
  height: 1rem;
  padding: 0.32rem;
  border-radius: 9px;
  background: var(--leaf);
  color: var(--green-deep);
  opacity: 1;
  box-sizing: content-box;
}
.help-nav a:hover .icon {
  background: #d7efe3;
  color: var(--green);
}
.view-switch .icon {
  width: 0.95em;
  height: 0.95em;
  opacity: 0.7;
  color: var(--green-deep);
}
.view-switch a.on .icon {
  opacity: 1;
  color: #fff;
}
.view-switch a:hover:not(.on) .icon {
  opacity: 0.95;
  color: var(--green);
}

.btn, button {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: white;
  font-weight: 600;
  min-height: 44px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button[hidden] { display: none !important; }
.btn.primary, button.primary { background: var(--green); color: white; border-color: transparent; box-shadow: 0 6px 14px rgba(46, 91, 67, 0.24); }
.btn.primary:hover, button.primary:hover { background: var(--green-deep); }
.btn.quiet { background: transparent; }
.btn.danger { background: #8d2f2f; color: white; border: 0; }
.btn.wide { width: 100%; }
.btn.on, .zoom button.on { background: var(--ink); color: white; }

.account-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.25rem 0.85rem 0.25rem 0.28rem;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
}
.who-photo { position: relative; }
.who-photo::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 0.5rem;
}
.who-photo-face {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--leaf);
  color: var(--green-deep);
  font-weight: 650;
  font-size: 0.84rem;
  cursor: pointer;
}
.who-photo-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.who-photo-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 6;
  min-width: 11.5rem;
  padding: 0.35rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.who-photo:hover .who-photo-menu,
.who-photo:focus-within .who-photo-menu,
.who-photo.open .who-photo-menu { display: grid; }
.who-photo-menu form { margin: 0; }
.who-photo-menu label,
.who-photo-menu button {
  min-height: 44px;
  padding: 0.4rem 0.8rem;
  border: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  width: 100%;
  background: transparent;
  color: inherit;
  font-weight: 650;
  cursor: pointer;
  text-align: left;
}
.who-photo-menu label:hover,
.who-photo-menu button:hover { background: var(--leaf); }
.who-photo-menu input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
}
.menu { position: relative; }
.menu summary {
  list-style: none;
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
}
.account-chip .menu summary {
  background: transparent;
  border: 0;
  padding: 0.15rem 0;
  min-height: 36px;
  border-radius: 0;
}
.menu summary .who { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; min-width: 0; }
.who-name { font-weight: 650; }
.who-roles { font-size: 0.8rem; color: var(--muted); font-weight: 650; letter-spacing: 0.01em; }
.tree-dates {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
  margin: 0.2rem 0 0.45rem;
}
.tree-dates span { display: block; }
.menu summary::-webkit-details-marker { display: none; }
.menu div { position: absolute; right: 0; top: calc(100% + 0.4rem); background: white; border-radius: 16px; box-shadow: var(--shadow); min-width: 220px; padding: 0.4rem; display: grid; gap: 0.1rem; z-index: 40; }
/* The account menu hangs from the whole name chip: same right edge, at least as wide. */
.account-chip .menu { position: static; }
.account-chip .menu > div { min-width: max(100%, 232px); border: 1px solid var(--line); }
.menu div form { margin: 0; }
/* Every item, link or button, is the same row: same padding, height, font, and hover. */
.menu div a, .menu div button {
  display: flex; align-items: center; justify-content: flex-start; width: 100%; box-sizing: border-box;
  min-height: 42px; margin: 0; padding: 0.5rem 0.8rem; border: 0; border-radius: 11px; background: transparent;
  color: var(--ink); font: inherit; font-weight: 550; text-align: left; text-decoration: none; cursor: pointer; box-shadow: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.menu div a:hover, .menu div button:hover, .menu div a:focus-visible, .menu div button:focus-visible { background: var(--leaf); color: var(--green-deep); }
.menu div a[aria-current="page"] { background: #f7f4ec; color: var(--green-deep); }
.menu div form { border-top: 1px solid var(--line); margin-top: 0.25rem; padding-top: 0.25rem; }
.menu div form button:hover { background: #fdf0ee; color: #a3392b; }
.menu div form button:hover .icon { color: #a3392b; }

main { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; padding: 1.4rem 0 4rem; }
/* Tree page: use nearly the whole window so big charts have room (v1.23). */
body.tree-home main {
  width: min(100% - 1rem, calc(100vw - 1rem));
  max-width: none;
  padding: 0.85rem 0 1.5rem;
}
body.tree-home .tree-stage .tree-view {
  max-height: calc(100vh - var(--header-h, 76px) - 7.5rem);
  max-height: calc(100dvh - var(--header-h, 76px) - 7.5rem);
  min-height: min(560px, 72vh);
}
body.tree-home.side-card-open .tree-chart-area { margin-right: min(25rem, 42vw); }
@media (max-width: 700px) {
  body.tree-home.side-card-open .tree-chart-area { margin-right: 0; }
  body.tree-home .tree-stage .tree-view {
    min-height: min(420px, 58vh);
    max-height: calc(100dvh - var(--header-h, 76px) - 9rem);
  }
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 450;
  line-height: 1.4;
}
.crumbs a { color: inherit; font-weight: inherit; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--ink); font-weight: 500; }
.crumb-sep { color: var(--muted); }
.flash { padding: 0.8rem 1rem; border-radius: 14px; background: var(--leaf); }
.flash.bad { background: #fde8e4; }
.panel, .family-card, .person-box, .profile, .share-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel { padding: 1.3rem; margin: 1rem 0; }
.narrow { max-width: 640px; }
.page-head { display: flex; justify-content: space-between; gap: 1rem; align-items: end; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head:has(.family-intro) { align-items: start; }
.page-head h1 { display: inline; }
.family-intro { display: grid; justify-items: start; gap: 0.35rem; }
.family-title-row { display: flex; align-items: center; gap: 0.85rem; }
.family-title-row h1, .family-intro > h1 { margin: 0; }
.family-portrait {
  width: 128px;
  height: 128px;
  margin-top: 0.35rem;
  border-radius: 28px;
  object-fit: cover;
  background: var(--leaf);
  box-shadow: 0 12px 28px rgba(50, 40, 20, 0.12), 0 0 0 4px #fff, 0 0 0 5px rgba(46, 91, 67, 0.16);
}
.family-description {
  margin: 0.2rem 0 0.15rem;
  max-width: 38rem;
  font-weight: 450;
  line-height: 1.45;
}
.family-card-description {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 450;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lede, .muted, .hint { color: var(--muted); }
.stack { display: grid; gap: 0.8rem; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; align-items: start; }
/* Side-by-side fields are exactly the same width, whatever is inside them. */
.split > label, .split input, .split select, .split .phone-field { min-width: 0; }
.split input:not([type="checkbox"]):not([type="radio"]), .split select { width: 100%; }
label { display: grid; gap: 0.35rem; font-weight: 600; }
input, select, textarea {
  width: 100%;
  border: 1px solid #ddd5c4;
  background: #fcfaf5;
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  min-height: 48px;
}
input:focus, select:focus, textarea:focus { background: #fff; border-color: var(--green); outline: 3px solid rgba(46, 91, 67, 0.18); outline-offset: 0; }
textarea { min-height: 120px; }
fieldset { border: 1px solid var(--line); border-radius: 16px; padding: 0.8rem; }
.choice-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choice {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  border-radius: 12px;
  background: #f8f5ee;
  border: 1px solid var(--line);
  padding: 0.55rem 0.9rem;
  font-weight: 600;
}
.choice input { width: auto; min-height: 0; margin: 0; }
.choice:has(input:checked) { background: var(--leaf); border-color: #9dccb4; }
.check {
  display: grid;
  font-weight: 500;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.65rem;
  margin: 0.35rem 0;
}
.check input {
  width: 1.25rem;
  height: 1.25rem;
  min-height: 0;
  margin-top: 0.2rem;
  flex-shrink: 0;
  accent-color: var(--green);
}
.terms-agree span { line-height: 1.4; }
.terms-agree a { font-weight: 650; }
.more summary { cursor: pointer; font-weight: 650; min-height: 44px; }
.optional { font-weight: 500; color: var(--muted); font-size: 0.9em; }
.field-hint { display: block; margin-top: 0.35rem; font-weight: 500; line-height: 1.35; }
.auth-forgot { margin: 0.35rem 0 0; text-align: right; }
.auth-forgot a {
  display: inline-block;
  font-weight: 650;
  color: var(--muted);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  transition: color 0.18s ease, background-size 0.22s ease;
}
.auth-forgot a:hover,
.auth-forgot a:focus-visible {
  color: var(--green-deep);
  background-size: 100% 1px;
}
.auth-form .btn.primary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}
.auth-form .btn.primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, 0.32) 50%, transparent 68%);
  transform: translateX(-130%);
  pointer-events: none;
}
.auth-form .btn.primary:hover {
  background: var(--green-deep);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(14, 59, 40, 0.28);
}
.auth-form .btn.primary:hover::after {
  animation: auth-btn-sheen 0.65s ease;
}
.auth-form .btn.primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: none;
}
@keyframes auth-btn-sheen {
  from { transform: translateX(-130%); }
  to { transform: translateX(130%); }
}
@media (prefers-reduced-motion: reduce) {
  .auth-form .btn.primary,
  .auth-form .btn.primary::after,
  .auth-forgot a {
    transition: none;
    animation: none;
  }
  .auth-form .btn.primary:hover,
  .auth-form .btn.primary:active { transform: none; }
}
.auth-terms { margin: 0.55rem 0 0.85rem; }
.auth-form { width: 100%; max-width: 100%; }
.auth-form .lede { overflow-wrap: anywhere; }

.auth-body { background: var(--cream); }
.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.7fr);
}
.auth-brand {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: white;
  padding: 8vh 7vw;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(12, 40, 28, 0.08) 0%, rgba(12, 36, 28, 0.35) 48%, rgba(10, 28, 22, 0.72) 100%),
    var(--auth-hero) center 40% / cover no-repeat,
    linear-gradient(160deg, #114832, #1d7a4d 70%, #d7b56d);
}
.auth-brand-veil {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, rgba(8, 28, 20, 0.12), transparent 35%);
  pointer-events: none;
}
.auth-brand-copy {
  position: relative;
  z-index: 1;
  max-width: 30rem;
  text-shadow: 0 2px 22px rgba(8, 24, 18, 0.55);
}
.auth-brand h1 {
  font-size: clamp(3.6rem, 8vw, 6rem);
  margin: 0;
  color: #fff;
  letter-spacing: -0.02em;
}
.auth-brand .tag {
  font-size: 1.25rem;
  margin: 0.35rem 0 0;
  font-weight: 500;
  opacity: 0.95;
}
.auth-welcome {
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  line-height: 1.25;
  margin: 1.2rem 0 0.45rem;
  font-weight: 560;
}
.auth-welcome-sub {
  margin: 0 0 1.2rem;
  font-size: 1.05rem;
  line-height: 1.45;
  max-width: 26rem;
  opacity: 0.92;
}
.auth-help-link {
  color: white;
  font-weight: 650;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  padding-bottom: 0.1rem;
  align-self: flex-start;
}
.auth-help-link:hover { border-bottom-color: white; }
.auth-panel {
  padding: 6vh 5vw;
  padding-bottom: max(6vh, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--cream);
  min-width: 0;
  overflow-x: hidden;
}
.signin-card, .or { margin: 0.6rem 0; }
.or { text-align: center; color: var(--muted); display: flex; align-items: center; gap: 0.8rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.or span { white-space: nowrap; font-size: 0.8rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; }
.auth-tabs { display: flex; gap: 0.35rem; background: #ede7da; border-radius: 999px; padding: 0.25rem; margin-bottom: 1.2rem; }
.auth-tab { flex: 1; text-align: center; text-decoration: none; color: var(--muted); font-weight: 650; min-height: 44px; display: grid; place-items: center; border-radius: 999px; }
.auth-tab.on { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(50, 40, 20, 0.08); }
.btn.google { width: 100%; gap: 0.65rem; background: white; border: 1px solid var(--line); font-weight: 650; margin: 0.4rem 0 0.8rem; }
.btn.google:hover:not(:disabled) { background: #f8f5ee; }
.btn.google:disabled { opacity: 0.7; cursor: not-allowed; }
.google-mark { flex-shrink: 0; }
/* Real Google button sits on top of our styled one so the click reaches Google.
   Stretch every GSI wrapper to the wrap size — absolute iframe alone collapses parents to 0px (v1.22.2). */
.google-sign-wrap { position: relative; display: block; margin: 0.4rem 0 0.8rem; }
.google-sign-wrap > .btn.google { margin: 0; width: 100%; }
.google-real {
  position: absolute; inset: 0; z-index: 2; overflow: hidden; opacity: 0.02;
}
.google-real .g_id_signin,
.google-real .g_id_signin > div,
.google-real .g_id_signin > div > div {
  position: absolute !important; inset: 0 !important;
  width: 100% !important; height: 100% !important;
}
.google-real iframe,
.google-real div[role="button"] {
  position: absolute !important; inset: 0 !important;
  width: 100% !important; height: 100% !important; max-width: none !important;
  margin: 0 !important;
}
.google-soon { margin-top: 0.4rem; }
.trust-strip {
  margin: 1.1rem 0 0.4rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: #e7f0ea;
  border: 1px solid #c5d8cc;
  text-align: left;
}
.trust-strip p { margin: 0; color: var(--ink); font-size: 0.92rem; line-height: 1.45; }
.trust-strip a { color: var(--forest); font-weight: 650; }
.turnstile-wrap { margin: 0.85rem 0 0.35rem; }
.turnstile-hint { margin: 0.45rem 0 0; font-size: 0.82rem; }
.auth-legal, .copyright, .site-foot { color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
.auth-legal { text-align: center; margin-top: 1.4rem; }
.auth-legal a, .site-foot a, .copyright a { color: inherit; }
.copyright { text-align: center; margin: 0.6rem 0 0; }
.site-foot { width: min(1120px, calc(100% - 2rem)); margin: 0 auto 2.5rem; text-align: center; padding-top: 1rem; border-top: 1px solid var(--line); }
.site-foot-links { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.tip { position: relative; display: inline-flex; vertical-align: middle; }
.tip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  min-height: 0;
  margin-left: 0.2rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.tip-btn:hover, .tip-btn:focus-visible, .tip.on .tip-btn { color: var(--green-deep); background: var(--leaf); outline: none; }
.tip-btn .icon { width: 16px; height: 16px; }
.tip-bubble {
  display: none;
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.35rem);
  left: 0;
  width: max-content;
  max-width: min(18rem, calc(100vw - 2rem));
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: var(--ink);
  color: #f7f4ec;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  box-shadow: var(--shadow);
}
.tip.on .tip-bubble { display: block; }
@media (hover: hover) and (pointer: fine) {
  .tip:hover .tip-bubble,
  .tip:focus-within .tip-bubble { display: block; }
}
.tip-row { display: inline-flex; align-items: center; gap: 0.15rem; }
.view-switch-wrap { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.branch-search .tip { margin-left: 0.25rem; }
h2 .tip, label .tip { font-weight: 500; }

.phone-field { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem; align-items: start; }
.phone-code { position: relative; }
.phone-code-btn { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 48px; padding: 0.55rem 0.75rem; border-radius: 12px; background: #fdfbf6; white-space: nowrap; }
.phone-code-flag { display: inline-flex; }
.phone-code-caret { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--muted); }
.phone-code-panel { position: absolute; z-index: 30; top: calc(100% + 0.35rem); left: 0; width: min(320px, 80vw); background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 0.55rem; }
.phone-code-search input { min-height: 42px; margin-bottom: 0.4rem; }
.phone-code-list { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow: auto; }
.phone-code-list button { width: 100%; justify-content: flex-start; gap: 0.55rem; border: 0; background: transparent; border-radius: 10px; min-height: 42px; padding: 0.4rem 0.55rem; display: inline-flex; align-items: center; }
.phone-code-list button:hover, .phone-code-list button[aria-selected="true"] { background: var(--leaf); }
.country-field { position: relative; width: 100%; }
.country-field-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 48px;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: #fdfbf6;
  border: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}
.country-field-btn:hover { background: #f3f8f5; }
.country-field-flag { display: inline-flex; flex: none; min-width: 24px; }
.country-field-text { flex: 1; min-width: 0; font-weight: 500; }
.country-field-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.35rem);
  left: 0;
  width: min(360px, 100%);
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 0.55rem;
}
.flag-placeholder {
  display: inline-block;
  width: 24px;
  height: 18px;
  border-radius: 3px;
  background: #ede7da;
  box-shadow: 0 0 0 1px rgba(50, 40, 20, 0.08);
}
.password-field { display: grid; gap: 0.35rem; width: 100%; }
.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.password-input-wrap input {
  width: 100%;
  min-width: 0;
  padding-right: 3.25rem;
}
.password-toggle {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.password-toggle:hover,
.password-toggle:focus-visible { background: var(--leaf); color: var(--ink); outline: none; }
.password-toggle svg { width: 1.25rem; height: 1.25rem; display: block; pointer-events: none; }
.password-strength { margin-top: 0.15rem; }
.password-strength-bar {
  height: 0.4rem;
  border-radius: 999px;
  background: #e4ebe6;
  overflow: hidden;
}
.password-strength-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: #9aa8a0;
  transition: width 0.2s ease, background 0.2s ease;
}
.password-strength[data-level="1"] .password-strength-bar span { width: 25%; background: #c2410c; }
.password-strength[data-level="2"] .password-strength-bar span { width: 50%; background: #ca8a04; }
.password-strength[data-level="3"] .password-strength-bar span { width: 75%; background: #4d7c0f; }
.password-strength[data-level="4"] .password-strength-bar span { width: 100%; background: #2e5b43; }
.password-strength-label { margin: 0.35rem 0 0; font-size: 0.82rem; }
.phone-option-name { flex: 1; text-align: left; font-weight: 500; }
.phone-option-dial { color: var(--muted); font-weight: 650; }
.phone-local { min-width: 0; }
.phone-hint { font-weight: 500; margin: 0.35rem 0 0; }

.legal-body { background: var(--cream); }
.legal-wrap { max-width: 760px; margin: 0 auto; }
.legal-doc { max-width: none; margin: 0.85rem 0 1.2rem; }
.legal-doc h2 { margin-top: 1.6rem; }
.legal-doc h3 { font-family: Figtree, sans-serif; font-size: 1.05rem; margin: 1rem 0 0.4rem; }
.legal-doc ul { padding-left: 1.2rem; }
.legal-doc li { margin: 0.35rem 0; }
.legal-eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.82rem; font-weight: 700; color: var(--green); margin: 0 0 0.4rem; }
.legal-note { font-size: 0.92rem; }
.about-lede { font-size: 1.12rem; color: var(--ink); max-width: 38rem; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 2rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }

.tree-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.4rem 0 0.8rem; }
.move-hint { max-width: 52rem; }
.tree-movable.move-on { cursor: grab; }
.tree-movable .person-box.can-move { touch-action: none; user-select: none; -webkit-user-select: none; }
.person-box.is-lifting { opacity: 0.35; }
.person-box.drop-target { outline: 3px solid var(--green); outline-offset: 3px; transform: scale(1.03); }
.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 80; pointer-events: none;
  width: 180px; opacity: 0.95; box-shadow: var(--shadow); border-radius: var(--radius);
  background: white; padding: 0.6rem; display: flex; gap: 0.55rem; align-items: center;
}
.drag-ghost .peek { display: none; }
.reconnect-sheet {
  position: fixed; inset: 0; z-index: 90; background: rgba(12, 28, 20, 0.45);
  display: flex; align-items: flex-end; justify-content: center; padding: 1rem;
}
.reconnect-sheet[hidden] { display: none !important; }
.reconnect-card {
  width: min(440px, 100%); background: white; border-radius: 22px 22px 18px 18px;
  padding: 1.2rem 1.2rem 1.4rem; box-shadow: var(--shadow);
}
.reconnect-title { font-size: 1.15rem; margin: 0 0 0.4rem; }
.reconnect-choices { margin: 0.8rem 0; }
.reconnect-choices .choice { min-height: 48px; border: 1px solid var(--line); background: #f8f5ee; cursor: pointer; }
.reconnect-choices .choice:active { background: var(--leaf); }
body.sheet-open { overflow: hidden; }
.quick-row { margin: 0; }
.btn.on { background: var(--ink); color: white; border-color: transparent; }

@media (min-width: 860px) {
  .reconnect-sheet { align-items: center; }
  .reconnect-card { border-radius: 22px; }
}

.card-grid, .report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.family-card {
  position: relative;
  padding: 1rem;
  color: inherit;
  display: grid;
  gap: 0.35rem;
  min-height: 180px;
  align-content: end;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
@media (hover: hover) and (pointer: fine) {
  .family-card:hover,
  .family-card:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(50, 40, 20, 0.12), 0 0 0 1px rgba(46, 91, 67, 0.16);
    z-index: 3;
  }
}
.family-card:has(.card-menu[open]) { z-index: 5; }
@media (prefers-reduced-motion: reduce) {
  .family-card { transition: none; }
  .family-card:hover,
  .family-card:focus-within { transform: none; }
}
.family-card-open { text-decoration: none; color: inherit; display: grid; gap: 0.4rem; }
.card-menu { position: absolute; top: 0.35rem; right: 0.35rem; z-index: 2; }
.card-menu summary {
  list-style: none;
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
}
.card-menu summary::-webkit-details-marker { display: none; }
.card-menu summary::marker { content: ''; }
.card-menu summary:hover,
.card-menu[open] summary { background: var(--leaf); color: var(--green-deep); }
.card-menu:not([open]) > div { display: none; }
.card-menu div {
  position: absolute;
  right: 0;
  top: calc(100% - 0.15rem);
  z-index: 3;
  min-width: 9.5rem;
  padding: 0.35rem;
  display: grid;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.card-menu a {
  min-height: 44px;
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  font-weight: 650;
}
.card-menu a:hover { background: var(--leaf); }
.card-menu a.danger-link { color: #9b3b2c; }
.family-settings-link { margin: 0.15rem 0 0.2rem; }
.family-settings-link a { font-weight: 650; }
.family-fallback, .family-profile { width: 72px; height: 72px; border-radius: 18px; }
.family-profile { object-fit: cover; display: block; }
.family-leaders { display: grid; gap: 0.05rem; font-weight: 500; }
.family-leaders-label { font-weight: 650; font-style: normal; }
.family-leader-name { font-style: italic; font-weight: 450; font-size: 0.88rem; }
.family-count { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted); font-size: 0.92rem; }
.family-count .icon { width: 1.05em; height: 1.05em; color: var(--green); }
.family-fallback { display: grid; place-items: center; background: var(--leaf); font-family: Fraunces, Georgia, serif; font-size: 1.4rem; }
.profile-pick-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.profile-pick { display: grid; justify-items: center; gap: 0.3rem; font-weight: 500; }
.profile-pick img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; border: 2px solid transparent; }
.profile-pick:has(input:checked) img { border-color: var(--green); }
.profile-picks { border: 0; margin: 0; padding: 0; }

.view-switch, .zoom { display: inline-flex; flex-direction: row; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.zoom { background: white; border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem; }
.view-switch a, .zoom button { border-radius: 999px; padding: 0.4rem 0.85rem; text-decoration: none; background: white; border: 1px solid var(--line); color: inherit; min-height: 40px; }
.zoom button { border-color: transparent; background: transparent; }
.view-switch a.on { background: var(--green); color: white; border-color: transparent; }
.toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin: 0.6rem 0; }
.branch { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: end; position: relative; }
.branch select { width: auto; min-width: 11rem; }
.branch-search input { min-width: min(100%, 220px); }
.branch-search { position: relative; display: grid; grid-template-columns: max-content 1fr; align-items: center; gap: 0.3rem; font-weight: 650; min-width: min(100%, 240px); }
.branch-search > input { grid-column: 1 / -1; }
.branch-search > .tip { justify-self: start; }
.branch > .tip { align-self: flex-end; margin-bottom: 0.6rem; }
.tool-view { display: inline-flex; align-items: center; gap: 0.15rem; }
.branch-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.3rem);
  left: 0;
  right: 0;
  max-height: min(50vh, 280px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.branch-results button {
  width: 100%;
  text-align: left;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  padding: 0.45rem 0.65rem;
}
.branch-results button:hover,
.branch-results button[aria-selected="true"] { background: var(--leaf); }
.branch-note { margin-top: 0; }
.card-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.7rem; }
.card-actions .btn, .card-actions a.btn { flex: 1 1 8rem; text-align: center; }
.dupe-banner { display: grid; gap: 0.75rem; }
.dupe-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0.75rem;
  align-items: center;
  background: white;
  border-radius: 14px;
  padding: 0.7rem;
}
.dupe-card img, .dupe-card .avatar {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: var(--leaf);
  font-weight: 700;
}
.dupe-card p { margin: 0.15rem 0; }
#connect-people { width: 100%; min-height: 9rem; }

.tree-view { overflow: auto; padding: 1rem 0 2rem; min-height: 50vh; }
.tree-canvas { transform-origin: top left; width: max-content; min-width: 100%; }
.chart-pane { display: none; }
.tree-canvas[data-chart="family"] .chart-pane[data-pane="family"],
.tree-canvas[data-chart="descendants"] .chart-pane[data-pane="descendants"],
.tree-canvas[data-chart="hourglass"] .chart-pane[data-pane="hourglass"],
.tree-canvas[data-chart="pedigree"] .chart-pane[data-pane="pedigree"],
.tree-canvas[data-chart="fan"] .chart-pane[data-pane="fan"] { display: block; width: max-content; min-width: 100%; position: relative; z-index: 1; }
.chart-caption { text-align: center; margin: 3.1rem 0 0.8rem; }
.fan-svg { width: 1100px; height: auto; background: white; border-radius: 24px; }
.fan-svg text { font-family: Figtree, sans-serif; pointer-events: none; }
.fan-svg .fan-person circle { fill: #2e5b43; stroke: #f7f3ea; stroke-width: 3; }
.fan-svg .fan-person text { fill: white; font-size: 15px; font-weight: 650; }
.fan-svg .fan-g1 path { fill: #2e5b43; }
.fan-svg .fan-g2 path { fill: #1f7a4e; }
.fan-svg .fan-g3 path { fill: #3d9a68; }
.fan-svg .fan-g4 path { fill: #c5e0d0; }
.fan-svg .fan-g1 text, .fan-svg .fan-g2 text, .fan-svg .fan-g3 text { fill: white; font-weight: 650; }
.fan-svg .fan-g4 text { fill: #143c28; font-weight: 650; }
.fan-svg .fan-person path, .fan-svg .fan-empty path { stroke: #f7f3ea; stroke-width: 2; }
.fan-svg .fan-empty path { fill: #f7f4ec; stroke: #b9c6ad; }
.fan-svg .fan-empty text { fill: #3d5c4c; font-weight: 650; }
.fan-svg .fan-mark { font-weight: 700; }
.fan-svg .fan-g4 .fan-mark { fill: #2e5b43; }
.fan-svg a.is-selected path, .fan-svg a.is-selected circle { stroke: #e0a915; stroke-width: 4; }

.gen { display: flex; justify-content: center; gap: 0.8rem; list-style: none; margin: 0; padding: 1.4rem 0 0; position: relative; }
.gen > li { display: flex; flex-direction: column; align-items: center; position: relative; padding: 0 0.6rem; }
.couple { display: flex; gap: 0.55rem; position: relative; }
.gen .gen { border-top: 2px solid #ddd5c4; margin-top: 1.1rem; }
.gen .gen > li::before {
  content: "";
  position: absolute;
  top: -1.15rem;
  left: 50%;
  height: 1.15rem;
  border-left: 2px solid #ddd5c4;
}

.person-box {
  position: relative;
  display: flex;
  gap: 0.7rem;
  min-width: 13rem;
  max-width: 16.25rem;
  padding: 0.75rem;
  color: inherit;
  border: 1px solid var(--line);
  border-top: 4px solid var(--pip, var(--green));
  background: var(--paper);
}
.person-box-link {
  display: grid;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.person-box .who { display: grid; }
.person-box strong { font-size: 1.02rem; }
.person-box small { color: var(--muted); font-style: normal; }
.person-box .years { color: var(--ink); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.flags { display: flex; gap: 0.35rem; align-items: center; }
.flag-img { width: 24px; height: 18px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(50, 40, 20, 0.12); }
.avatar, .portrait.fallback, .person-photo-face {
  width: 46px; height: 46px; border-radius: 50%; background: var(--leaf);
  display: grid; place-items: center; overflow: hidden; flex: none; font-weight: 700;
}
.avatar img, .portrait, .person-photo-face img { width: 100%; height: 100%; object-fit: cover; }
.person-photo { position: relative; flex: none; }
.person-photo::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 0.5rem;
}
.person-photo-face {
  border: 0;
  padding: 0;
  color: var(--green-deep);
  cursor: pointer;
}
.person-photo-face:hover { box-shadow: 0 0 0 2px var(--green); }
.person-photo-menu {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 0.35rem);
  z-index: 8;
  min-width: 12rem;
  padding: 0.35rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.person-photo:hover .person-photo-menu,
.person-photo:focus-within .person-photo-menu,
.person-photo.open .person-photo-menu { display: grid; }
.person-photo-menu form { margin: 0; }
.person-photo-menu label,
.person-photo-menu button {
  min-height: 44px;
  padding: 0.4rem 0.8rem;
  border: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  width: 100%;
  background: transparent;
  color: inherit;
  font-weight: 650;
  cursor: pointer;
  text-align: left;
}
.person-photo-menu label:hover,
.person-photo-menu button:hover { background: var(--leaf); }
.person-photo-menu input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.person-photo-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: end center;
  padding: 1rem;
  background: rgba(50, 40, 20, 0.35);
}
.person-photo-sheet[hidden] { display: none !important; }
.person-photo-card {
  width: min(100%, 420px);
  max-height: min(80vh, 560px);
  overflow: auto;
  background: white;
  border-radius: 22px 22px 16px 16px;
  padding: 1.1rem 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}
@media (min-width: 860px) {
  .person-photo-sheet { place-items: center; }
  .person-photo-card { border-radius: 22px; }
}
.peek {
  display: none;
  position: absolute;
  left: 0; top: calc(100% + 8px);
  background: var(--ink); color: white;
  padding: 0.7rem 0.8rem; border-radius: 12px; width: 220px; z-index: 3;
}
.peek span, .peek b { display: block; }
@media (hover: hover) {
  .person-box:hover .person-box-link .peek,
  .person-box:focus-within .person-box-link .peek { display: block; }
  .person-box.has-photo-edit .person-photo:hover ~ .person-box-link .peek,
  .person-box.has-photo-edit .person-photo.open ~ .person-box-link .peek { display: none; }
}

.list { display: grid; gap: 0.6rem; }
.list a, .member-list li {
  display: flex; gap: 0.8rem; align-items: center;
  background: white; border-radius: 16px; padding: 0.8rem 1rem; text-decoration: none; color: inherit;
  box-shadow: 0 8px 24px rgba(20,40,30,0.04);
}
/* display:flex above would otherwise keep “hidden” rows visible (v1.22.9). */
.list a[hidden] { display: none !important; }
.list a span:nth-child(2) { display: grid; flex: 1; }
.list small { color: var(--muted); }
.list-empty { margin: 0.4rem 0 0; }
.search { display: grid; gap: 0.35rem; margin-bottom: 1rem; max-width: 420px; }
.search input { max-width: 420px; margin-bottom: 0; }
.search .field-hint { margin: 0; }
.family-map { height: 520px; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); }
.leaflet-tooltip.family-map-tip {
  border: 0;
  border-radius: 12px;
  box-shadow: var(--shadow);
  background: #123524;
  color: #f7f4ec;
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  line-height: 1.35;
}
.leaflet-tooltip.family-map-tip::before { border-top-color: #123524; }
.profile { padding: 1.2rem; }
.profile-top { display: grid; grid-template-columns: 160px 1fr; gap: 1.2rem; align-items: start; }
.profile-main { position: relative; min-width: 0; padding-right: 14.5rem; }
.profile-nav {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
}
.profile-nav .btn.primary {
  box-shadow: 0 2px 10px rgba(46, 91, 67, 0.28);
  white-space: nowrap;
}
.portrait { width: 160px; height: 160px; border-radius: 28px; object-fit: cover; }
.portrait.fallback { width: 160px; height: 160px; border-radius: 28px; font-size: 2rem; }
.kicker { color: var(--green); font-weight: 650; margin: 0; }
.flag-line { display: flex; gap: 1rem; flex-wrap: wrap; }
.links { list-style: none; padding: 0; }
.links li { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.links button, .changes button, .member-list button { min-height: 36px; }
.row-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.banner, .gaps, .whats-new, .empty, .share-card, .reunion {
  background: white; border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); margin: 0.8rem 0;
}
.gaps { list-style: none; display: flex; gap: 0.5rem; flex-wrap: wrap; padding-left: 1rem; }
.gaps a { background: var(--leaf); border-radius: 999px; padding: 0.35rem 0.7rem; text-decoration: none; }
.member-list { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
.member-list li form { display: flex; gap: 0.4rem; }
.share-card { text-align: center; padding: 2rem 1rem; }
.share-link input { text-align: center; }
.help-shell {
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.25fr);
}
.help-shell .auth-brand {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 100vh;
  background-position: center center;
}
.help-panel {
  justify-content: flex-start;
  overflow-y: auto;
  max-height: 100vh;
  padding: 3.5vh 3.5vw 4vh;
}
.help-layout {
  display: grid;
  grid-template-columns: minmax(160px, 200px) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  max-width: 920px;
}
.help-aside h1 {
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(2rem, 4vw, 2.6rem);
  margin: 0 0 0.35rem;
}
.help-lede { color: var(--muted); margin: 0 0 1.2rem; }
.help-nav { display: grid; gap: 0.15rem; position: sticky; top: 0.5rem; }
.help-nav a {
  text-decoration: none;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  color: var(--ink);
  font-weight: 550;
  font-size: 0.95rem;
  line-height: 1.3;
}
.help-nav a:hover { background: var(--leaf); }
.help-body {
  display: block;
  min-width: 0;
}
.help-body article {
  display: block;
  max-width: 40rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.2rem;
  scroll-margin-top: 1rem;
}
.help-body article:last-child { border-bottom: 0; margin-bottom: 0; }
.help-body h2 {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.45rem;
  margin: 0 0 0.55rem;
}
.help-body p {
  margin: 0 0 0.65rem;
  line-height: 1.55;
  color: #24362c;
}
.changes { list-style: none; padding: 0; }
.changes li { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.reunion { max-width: 800px; margin: 2rem auto; }
.reunion-list { padding-left: 1.1rem; }
.foot-links { color: var(--muted); }
.errors { background: #fde8e4; border-radius: 12px; padding: 0.6rem 0.8rem; }
.memory { background: var(--cream); border-radius: 12px; padding: 0.8rem; margin-bottom: 0.6rem; }
.memory form { margin-top: 0.55rem; }
audio { width: 100%; }

.danger-panel { border: 1px solid #e8b4a8; background: #fff8f6; }
.warn-badge {
  display: inline-block; margin: 0 0 0.4rem; padding: 0.2rem 0.55rem;
  border-radius: 999px; background: #f0c9bf; color: #6b2a1c; font-size: 0.84rem; font-weight: 650;
}
.danger-list { margin: 0.6rem 0 1rem; padding-left: 1.2rem; }
.danger-form { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid #e8b4a8; }
.btn.danger { background: #9b3b2c; color: #fff; border-color: #9b3b2c; }
.guide-card {
  background: linear-gradient(160deg, #f4faf4, #fff);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; margin: 0.8rem 0; box-shadow: var(--shadow);
}
.guide-steps { margin: 0.6rem 0 1rem; padding-left: 1.2rem; }
.guide-steps li { margin: 0.35rem 0; }
.guide-steps li.done { color: var(--muted); text-decoration: line-through; }
.quota { margin: 0.4rem 0; color: var(--muted); }
.quota-low { color: #9b3b2c; font-weight: 650; }
.quota-bar {
  height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; max-width: 420px; margin-bottom: 1rem;
}
.quota-bar span { display: block; height: 100%; background: var(--green); }
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.9rem; margin: 1rem 0 2rem;
}
.album-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin: 1rem 0 2rem;
}
.album-card {
  display: block; background: white; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow);
  color: inherit; text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.album-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(18, 53, 36, 0.14); }
.album-card img, .album-card-empty {
  display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #d7e5dc;
}
.album-card-empty {
  background:
    linear-gradient(135deg, #d7e5dc 0%, #eef5f0 55%, #c9dacf 100%);
}
.album-card-meta {
  display: flex; flex-direction: column; gap: 0.15rem; padding: 0.7rem 0.85rem 0.9rem;
}
.album-card-meta strong { font-size: 1.02rem; }
.album-cover-mark {
  margin: 0; padding: 0.35rem 0.7rem; background: #123524; color: #f7f4ec; font-size: 0.84rem; font-weight: 650;
}
.gallery-card {
  margin: 0; background: white; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow);
}
.gallery-card img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.gallery-card figcaption, .gallery-card .muted, .gallery-card form { padding: 0.45rem 0.7rem; }
.gallery-card form { padding-bottom: 0.7rem; }
.moment-preview { margin: 1rem auto; max-width: 22rem; }
.moment-preview img { display: block; width: 100%; border-radius: 14px; }
.moment-caption { font-size: 1.05rem; margin: 0.5rem 0 1rem; }
.moment-public { text-align: center; }
.gallery-share { margin-top: 0.25rem; }
.form.inline, form.inline { display: inline; }

/* Large phones / small tablets in portrait */
@media (max-width: 980px) {
  .auth-shell, .help-shell {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.95fr);
  }
}

@media (max-width: 860px) {
  .auth-shell, .help-shell, .help-layout, .profile-top, .split { grid-template-columns: 1fr; }
  .profile-main { padding-right: 0; }
  .profile-nav {
    position: static;
    margin: 0.75rem 0 0.4rem;
  }
  .profile-nav .btn.primary {
    width: 100%;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(46, 91, 67, 0.32);
  }
  .auth-brand, .help-shell .auth-brand {
    position: relative;
    padding: max(1.6rem, env(safe-area-inset-top)) 1.25rem 1.4rem;
    min-height: min(38vh, 280px);
    height: auto;
    justify-content: flex-end;
    background-position: center 28%;
  }
  .auth-brand h1 { font-size: clamp(2.6rem, 12vw, 3.6rem); }
  .auth-welcome { font-size: 1.2rem; margin-top: 0.7rem; }
  .auth-welcome-sub { display: none; }
  .auth-panel, .help-panel {
    padding: 1.25rem 1.15rem max(1.6rem, env(safe-area-inset-bottom));
    max-height: none;
    overflow: visible;
    justify-content: flex-start;
  }
  .auth-tabs { margin-bottom: 1rem; }
  .auth-tab { font-size: 0.95rem; padding: 0 0.4rem; }
  .btn.google { min-height: 48px; }
  .btn.wide, .auth-form .btn { width: 100%; }
  .turnstile-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .help-nav { position: static; display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1rem; }
  .help-nav a { background: var(--leaf); }
  .top {
    flex-wrap: wrap;
    padding-top: max(0.8rem, env(safe-area-inset-top));
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
  .top nav { flex-wrap: wrap; justify-content: flex-end; }
  .current-tree { display: inline-block; max-width: 8.5rem; font-size: 0.9rem; }
  .family-map { height: 380px; }
  .person-box { min-width: 10rem; }
  .tree-move-desktop { display: none; }
  .tree-movable .person-box.can-move { touch-action: pan-x pan-y; }
  .branch, .toolbar, .card-actions { width: 100%; }
  .tool-view { width: 100%; }
  .zoom { flex: 1 1 auto; flex-wrap: nowrap; gap: 0.1rem; }
  .zoom button { flex: 1 1 auto; padding: 0.4rem 0.45rem; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .album-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .phone-code-panel {
    width: min(100vw - 2rem, 320px);
    max-height: min(55vh, 360px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Narrow phones */
@media (max-width: 480px) {
  .phone-field {
    grid-template-columns: 1fr;
  }
  .who-name, .who-roles { max-width: 8.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .phone-code-btn { width: 100%; justify-content: space-between; }
  .auth-brand {
    min-height: min(32vh, 220px);
    padding: max(1.2rem, env(safe-area-inset-top)) 1rem 1.1rem;
  }
  .auth-panel, .help-panel { padding: 1rem 0.95rem max(1.4rem, env(safe-area-inset-bottom)); }
  .auth-legal, .copyright { font-size: 0.84rem; }
  .trust-strip { padding: 0.75rem 0.85rem; }
  .lede { font-size: 0.98rem; }
}

/* Tablets in landscape / MacBook-like mid widths keep two columns readable */
@media (min-width: 861px) and (max-width: 1100px) {
  .auth-shell, .help-shell {
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  }
  .auth-panel, .help-panel { padding: 4vh 3.5vw; }
  .auth-brand { padding: 6vh 4vw; }
}

.auth-shell:not(.help-shell) .signin-form {
  width: min(420px, 100%);
}
.auth-shell:not(.help-shell) .auth-panel h2 {
  margin: 0;
  text-align: center;
  font-weight: 460;
  font-size: 2.15rem;
}
.auth-shell:not(.help-shell) .auth-panel .lede {
  margin: 0.45rem auto 1rem;
  max-width: 36ch;
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.4;
}
.auth-shell:not(.help-shell) .btn.google {
  margin: 0;
  background: #fff;
  box-shadow: 0 4px 16px rgba(50, 40, 20, 0.06);
}
.auth-shell:not(.help-shell) .google-soon {
  margin: 0.45rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.35;
}
.auth-shell:not(.help-shell) .or { margin: 0.85rem 0; }
.auth-shell:not(.help-shell) .or span { letter-spacing: 0.08em; font-size: 0.8rem; }
.auth-shell:not(.help-shell) .auth-tabs { margin: 0 0 0.95rem; }
.auth-shell:not(.help-shell) .auth-form.stack { gap: 0.75rem; }
.auth-shell:not(.help-shell) .phone-hint { display: none; }
.auth-shell:not(.help-shell) .phone-field {
  gap: 0;
  align-items: center;
  border: 1px solid #dfe8e3;
  border-radius: 999px;
  background: #fff;
}
.auth-shell:not(.help-shell) .phone-code-btn {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 999px 0 0 999px;
  background: #fff;
  box-shadow: none;
}
.auth-shell:not(.help-shell) .phone-local {
  border: 0;
  border-radius: 0 999px 999px 0;
  background: transparent;
}
/* The sign-in phone box is one rounded pill, so the code and number stay side by side on phones too. */
@media (max-width: 480px) {
  .auth-shell:not(.help-shell) .phone-field { grid-template-columns: auto minmax(0, 1fr); }
  .auth-shell:not(.help-shell) .phone-code-btn { width: auto; justify-content: flex-start; gap: 0.35rem; padding-inline: 0.8rem 0.6rem; }
}
.auth-shell:not(.help-shell) .password-input-wrap input,
.auth-shell:not(.help-shell) .auth-panel input:not(.phone-local) {
  border-radius: 999px;
  background: #fff;
}
.auth-shell:not(.help-shell) .auth-legal { margin-top: 0.9rem; text-align: center; }
.auth-shell:not(.help-shell) .copyright { margin-top: 0.2rem; }

/* Sign-in, create account, and password pages sit in one screen on a laptop. */
@media (min-width: 861px) {
  body.auth-body:has(.auth-shell:not(.help-shell)) {
    height: 100dvh;
    overflow: hidden;
  }
  .auth-shell:not(.help-shell) {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    grid-template-columns: minmax(0, 1.35fr) minmax(380px, 520px);
  }
  .auth-shell:not(.help-shell) .auth-brand {
    min-height: 0;
    height: 100%;
    padding: clamp(1.1rem, 3vh, 2.2rem) clamp(1.5rem, 3.5vw, 3rem);
  }
  .auth-shell:not(.help-shell) .auth-brand h1 {
    font-size: clamp(2.8rem, 5vw, 4.6rem);
  }
  .auth-shell:not(.help-shell) .auth-welcome {
    margin: 0.4rem 0 0.2rem;
    font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  }
  .auth-shell:not(.help-shell) .auth-welcome-sub {
    margin: 0 0 0.55rem;
    font-size: 0.98rem;
    line-height: 1.35;
  }
  .auth-shell:not(.help-shell) .auth-panel {
    min-height: 0;
    height: 100%;
    overflow: auto;
    overscroll-behavior: contain;
    align-items: center;
    justify-content: safe center;
    padding: clamp(1rem, 2vh, 1.6rem) clamp(1.2rem, 2.4vw, 2rem);
  }
}

.scroll-up {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1.1rem, env(safe-area-inset-bottom));
  z-index: 30;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--green-deep);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  line-height: 1;
}
.scroll-up:hover { background: var(--leaf); }
.scroll-up:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.scroll-up[hidden] { display: none !important; }
@media (prefers-reduced-motion: no-preference) {
  .scroll-up {
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
  }
}

@media print {
  .top, .btn, .view-switch, .toolbar, .foot-links, .scroll-up, .person-photo-menu, .person-photo-sheet { display: none !important; }
  body { background: white; }
  .reunion { box-shadow: none; }
}

/* ------------------------------------------------------------------ */
/* First-visit landing page                                            */
/* ------------------------------------------------------------------ */
.landing { background: var(--cream); }
.landing main { max-width: 1180px; margin: 0 auto; padding: 0 1.2rem 3rem; }
.landing-top nav { gap: 0.4rem; }
.btn.big { min-height: 52px; padding: 0.75rem 1.4rem; font-size: 1.05rem; font-weight: 600; }
.btn.small { min-height: 36px; padding: 0.35rem 0.85rem; font-size: 0.92rem; }
.landing-hero {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 2.5rem; align-items: center;
  padding: 3.2rem 0 2.6rem;
}
.landing-kicker { color: var(--green); font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.82rem; margin: 0 0 0.6rem; }
.landing-hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); margin-bottom: 0.9rem; }
.landing-lede { font-size: 1.15rem; color: #34463c; max-width: 34rem; margin: 0 0 1.4rem; }
.landing-cta { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.landing-note { color: var(--muted); margin-top: 0.9rem; font-size: 0.95rem; }
.landing-hero-art {
  position: relative; border-radius: 28px; padding: 1.6rem 1.2rem;
  background: linear-gradient(180deg, rgba(14, 59, 40, 0.15), rgba(14, 59, 40, 0.55)), var(--hero) center / cover;
  box-shadow: var(--shadow);
}
.sample-tree { margin: 0; display: grid; justify-items: center; gap: 0; }
.sample-row { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }
.sample-line { width: 2px; height: 18px; background: rgba(255, 255, 255, 0.85); }
.sample-card {
  display: flex; gap: 0.6rem; align-items: center; min-width: 10.5rem;
  background: white; border-radius: 14px; padding: 0.6rem 0.75rem;
  border-top: 4px solid var(--pip, var(--green)); box-shadow: 0 10px 24px rgba(10, 30, 20, 0.18);
}
.sample-card .avatar { width: 40px; height: 40px; font-size: 0.9rem; }
.sample-card .who { display: grid; line-height: 1.2; }
.sample-card strong { font-size: 0.98rem; }
.sample-card small { color: var(--muted); font-size: 0.82rem; }
.sample-card .years { color: var(--ink); }
.sample-card.is-me { outline: 3px solid #f3c64f; outline-offset: 2px; }
.sample-tree figcaption { margin-top: 1rem; color: #f7f4ec; font-size: 0.85rem; text-align: center; max-width: 26rem; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.landing-band { padding: 2.4rem 0; border-top: 1px solid var(--line); }
.landing-band > h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 1.3rem; }
.landing-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.landing-point { background: white; border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); }
.landing-point h3 { margin: 0.7rem 0 0.4rem; font-size: 1.25rem; }
.landing-point p { margin: 0; color: #3f5047; }
.landing-point-icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--leaf); color: var(--green); }
.landing-point-icon .icon { width: 24px; height: 24px; }
.landing-steps ol { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.landing-steps li { counter-increment: step; display: grid; gap: 0.35rem; padding-top: 3rem; position: relative; }
.landing-steps li::before {
  content: counter(step); position: absolute; top: 0; left: 0; width: 2.3rem; height: 2.3rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--green); color: white; font-weight: 650;
}
.landing-steps strong { font-size: 1.15rem; }
.landing-steps span { color: #3f5047; }
.landing-split { display: grid; grid-template-columns: 1fr 1.2fr; gap: 1.2rem; align-items: start; }
.landing-price { background: white; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); border: 2px solid var(--leaf); }
.landing-price-amount { font-family: Fraunces, Georgia, serif; font-size: 2.2rem; margin: 0 0 0.6rem; color: var(--green-deep); }
.landing-price ul { padding-left: 1.2rem; margin: 0 0 1.2rem; display: grid; gap: 0.3rem; }
.landing-story { padding: 0.5rem 0.5rem 0 1rem; }
.landing-story p { color: #34463c; max-width: 36rem; }
.landing-final { text-align: center; padding: 2.8rem 1rem; margin-top: 1rem; border-radius: 28px; background: var(--green-deep); color: white; }
.landing-final h2 { color: white; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.landing-final .btn.primary { background: white; color: var(--green-deep); }
@media (max-width: 900px) {
  .landing-hero, .landing-split { grid-template-columns: 1fr; }
  .landing-hero { padding-top: 1.8rem; gap: 1.6rem; }
  .landing-points, .landing-steps ol { grid-template-columns: 1fr; }
  .landing-story { padding: 0; }
}
@media (max-width: 480px) {
  .landing main { padding: 0 1rem 2rem; }
  .landing-top .brand small { display: none; }
  .landing-top nav .btn { padding: 0.45rem 0.8rem; }
  .landing-top nav .btn.quiet { display: none; }
  .landing-cta .btn { width: 100%; }
  .landing-hero-art { padding: 1rem 0.6rem; }
  .sample-row { flex-wrap: nowrap; gap: 0.4rem; width: 100%; }
  .sample-card { min-width: 0; flex: 1 1 0; gap: 0.45rem; padding: 0.5rem; }
  .sample-card .avatar { width: 30px; height: 30px; font-size: 0.82rem; }
  .sample-card strong { font-size: 0.86rem; }
  .sample-card small { font-size: 0.8rem; }
}

/* Sign in: invite welcome and tabs on top */
.auth-tabs-top { margin-bottom: 1.4rem; }
.invite-welcome {
  display: flex; gap: 0.8rem; align-items: flex-start;
  background: var(--leaf); border-radius: 16px; padding: 0.9rem 1rem; margin: 0 0 1.2rem;
}
.invite-welcome p { margin: 0; }
.invite-welcome .muted { font-size: 0.92rem; margin-top: 0.25rem; }
.invite-welcome-face {
  flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--green); color: white; font-weight: 650;
}

/* Families page: brand-new account */
.welcome-hero {
  display: flex; gap: 1.2rem; align-items: center; margin: 0.6rem 0 0.4rem;
  background: linear-gradient(160deg, #eaf6ef, #fff); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow);
}
.welcome-hero img { border-radius: 22px; flex: none; }
.welcome-hero p { margin: 0.3rem 0 0; max-width: 40rem; }
.start-panel { border: 2px solid var(--leaf); }
.card-grid:empty { display: none; }
@media (max-width: 560px) {
  .welcome-hero { flex-direction: column; align-items: flex-start; }
  .welcome-hero img { width: 64px; height: 64px; }
}

/* ------------------------------------------------------------------ */
/* Tree page: tree first                                               */
/* ------------------------------------------------------------------ */
.tree-head { margin-bottom: 0.6rem; }
.tree-head .family-intro { grid-template-columns: auto 1fr; column-gap: 1rem; align-items: center; }
.tree-head .family-intro > * { grid-column: 2; }
.tree-head .family-portrait { grid-column: 1; grid-row: 1 / span 3; width: 84px; height: 84px; margin: 0; border-radius: 22px; }
.tree-head .family-title-row .emblem-img, .tree-head .family-title-row svg { width: 48px; height: auto; }
.tree-head .tree-dates { margin-top: 0.2rem; }

.family-menu { position: relative; }
.family-menu summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.35rem;
  border-radius: 999px; padding: 0.4rem 0.85rem; min-height: 40px; background: white; border: 1px solid var(--line); font-weight: 600;
}
.family-menu summary::-webkit-details-marker { display: none; }
.family-menu summary::marker { content: ''; }
.family-menu[open] summary { background: var(--leaf); }
.family-menu > div {
  position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 18; min-width: 15rem;
  display: grid; padding: 0.4rem; background: white; border-radius: 16px; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.family-menu a { display: flex; align-items: center; padding: 0.6rem 0.75rem; border-radius: 12px; text-decoration: none; color: inherit; }
.family-menu a:hover, .family-menu a:focus-visible { background: var(--leaf); outline: none; }
.family-menu .icon { color: var(--green); }

.how-link { display: inline-flex; align-items: center; color: var(--muted); font-weight: 550; text-decoration: none; padding: 0 0.4rem; }
.how-link:hover { color: var(--green-deep); text-decoration: underline; }
.tree-actions { align-items: center; }

.below-card { background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; margin: 0; }
.below-card h2 { font-size: 1.2rem; display: flex; align-items: center; }
.below-card .gaps { box-shadow: none; padding: 0; margin: 0; background: none; }
.gap-photo a { background: #fff4dc; }

/* "For you" (v1.29): one strip under the family band, the most useful thing first; See all opens
   the full list (checklist, how to refer to you, coming up, this week's question, things to fill in,
   what the family just added). A dropdown on computers, a sheet from the bottom on phones. */
.for-you {
  position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem 0.9rem;
  margin: 0 0 1rem; padding: 0.65rem 0.75rem 0.65rem 0.9rem;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 2px 6px rgba(60, 50, 20, 0.05);
}
.fy-tag {
  flex: none; display: inline-flex; align-items: center; gap: 0.4rem; height: 30px; padding: 0 0.75rem;
  border-radius: 999px; background: #fff3dc; color: #7a4e0c; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.02em;
}
.fy-main { flex: 1 1 18rem; min-width: 0; display: flex; align-items: center; gap: 0.7rem; }
.fy-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--leaf); color: var(--green); }
.fy-text { min-width: 0; line-height: 1.3; }
.fy-sub { color: var(--muted); }
.fy-main .btn { flex: none; }
.fy-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.fy-chip {
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 38px; padding: 0 0.75rem; border-radius: 10px;
  background: #f6f2e8; border: 1px solid #ece4d3; color: #34413a; font-size: 0.9rem; font-weight: 600; text-decoration: none;
}
.fy-chip:hover { background: var(--leaf); border-color: #b9c6ad; }
.fy-all {
  flex: none; display: inline-flex; align-items: center; gap: 0.4rem; margin-left: auto;
  border: 0; background: transparent; color: var(--green); font-weight: 600; box-shadow: none;
}
.fy-n { min-width: 22px; height: 22px; padding: 0 0.3rem; border-radius: 11px; background: var(--green); color: #fff; font-size: 0.75rem; font-weight: 700; display: inline-grid; place-items: center; }
.for-you-panel {
  position: absolute; z-index: 60; top: calc(100% + 8px); right: 0; width: min(36rem, 100%);
  max-height: min(70vh, 40rem); overflow-y: auto;
  background: var(--cream); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 60px rgba(50, 40, 20, 0.18);
}
.for-you-panel[hidden] { display: none; }
.fy-panel-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.7rem 0.85rem; background: #fff; border-bottom: 1px solid var(--line); border-radius: 20px 20px 0 0;
}
.fy-panel-head h2 { margin: 0; font-size: 1.15rem; display: flex; align-items: center; gap: 0.35rem; }
.fy-close { width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%; font-size: 1.4rem; line-height: 1; }
.fy-panel-body { display: flex; flex-direction: column; gap: 0.75rem; padding: 0.75rem 0.75rem 1rem; }
.fy-panel-body .below-card, .fy-panel-body .guide-card, .fy-panel-body .call-me { margin: 0; box-shadow: 0 8px 22px rgba(50, 40, 20, 0.06); }
.fy-panel-body .next-steps { margin: 0; padding: 0.85rem; background: #fff; border-radius: var(--radius); box-shadow: 0 8px 22px rgba(50, 40, 20, 0.06); }
.fy-panel-body .next-steps-grid { grid-template-columns: 1fr; }
@media (max-width: 700px) {
  .fy-main, .fy-chips { flex-basis: 100%; }
  .for-you-panel {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: 100%; z-index: 1100;
    max-height: min(78vh, 40rem); border-radius: 20px 20px 0 0;
    box-shadow: 0 -16px 48px rgba(50, 40, 20, 0.22); padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}
@media print {
  .for-you { display: none !important; }
}

/* Checklist */
.guide-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.guide-head h2 { margin-bottom: 0.1rem; }
.guide-head p { margin: 0; }
.guide-progress { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 0.8rem 0 0.4rem; }
.guide-progress span { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width 0.4s ease; }
.guide-steps { list-style: none; padding: 0; margin: 0.6rem 0 0; display: grid; gap: 0.4rem; }
.guide-steps li { display: flex; align-items: center; gap: 0.75rem; margin: 0; padding: 0.55rem 0.6rem; border-radius: 14px; }
.guide-steps li > div { display: grid; flex: 1; min-width: 0; }
.guide-steps li > div span { color: var(--muted); font-size: 0.92rem; }
.guide-steps li.done { text-decoration: none; color: var(--muted); }
.guide-steps li.next { background: var(--leaf); }
.guide-tick {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid #ddd5c4; background: white; color: white; font-weight: 700; font-size: 0.9rem;
}
.guide-steps li.done .guide-tick { background: var(--green); border-color: var(--green); }
.guide-steps li.next .guide-tick { border-color: var(--green); }

/* Empty tree */
.empty-tree { text-align: center; padding: 2rem 1.2rem 2.4rem; }
.empty-tree-art { width: min(220px, 70%); height: auto; margin: 0 auto 0.6rem; display: block; }
.empty-tree p { max-width: 32rem; margin-left: auto; margin-right: auto; }
.empty-actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }

/* Tree cards: a little more room and clearer names */
.gen { gap: 1.1rem; padding-top: 1.7rem; }
.gen .gen { margin-top: 1.4rem; }
.couple { gap: 0.7rem; }
.person-box { border-radius: 16px; padding: 0.85rem 0.9rem; }
.person-box strong { font-size: 1.1rem; line-height: 1.2; }
.person-box small { font-size: 0.9rem; }
.avatar, .person-photo-face { width: 3.25rem; height: 3.25rem; }
/* Invite a photo: an empty circle you can edit shows a small camera badge */
.has-photo-edit .person-photo-face:not(:has(img)) { border: 2px dashed #a9c9b6; background: #f7f4ec; color: var(--green-deep); }

/* Phone header: one compact row */
@media (max-width: 860px) {
  .header-greet-slot { display: none; }
  .top:has(.header-greet-slot) > .brand { margin-right: auto; }
  .top { flex-wrap: nowrap; gap: 0.5rem; padding-top: max(0.6rem, env(safe-area-inset-top)); padding-bottom: 0.6rem; }
  .top .brand small { display: none; }
  .top .brand span { font-size: 1.05rem; }
  .top .brand-mark { width: 34px; height: 34px; }
  .top nav { flex-wrap: nowrap; gap: 0.35rem; }
  .top nav .btn { padding: 0.45rem 0.75rem; min-height: 40px; }
  .top nav > a.btn.quiet[href$="/help"] { padding: 0.45rem; width: 40px; }
  .top nav > a.btn.quiet[href$="/help"] .icon-label > span,
  .account-chip .menu summary .who {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
  }
  .account-chip { padding: 0; border: 0; background: none; min-height: 0; }
  .account-chip .menu summary { padding: 0; border: 0; background: none; min-height: 0; }
  .who-initials {
    display: grid !important; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%;
    background: var(--leaf); color: var(--green-deep); font-weight: 650; font-size: 0.9rem; border: 1px solid var(--line);
  }
  .tree-head .family-portrait { width: 64px; height: 64px; border-radius: 18px; }
  .family-menu > div { right: auto; left: 0; }
}
@media (max-width: 420px) {
  .top .brand > span { display: none; }
  .top nav .btn.primary .icon-label { gap: 0.25rem; }
}
.who-initials {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--leaf);
  color: var(--green-deep);
  font-weight: 650;
  font-size: 0.84rem;
  flex: none;
}
.who-initials img { width: 100%; height: 100%; object-fit: cover; display: block; }
.account-face-row { display: flex; gap: 0.9rem; align-items: flex-start; }
.account-face, .account-card-face {
  display: grid; place-items: center; border-radius: 50%; overflow: hidden; flex: none;
  background: var(--leaf); color: var(--green-deep); font-weight: 650;
}
.account-face { width: 64px; height: 64px; font-size: 1.15rem; }
.account-card-face { width: 40px; height: 40px; font-size: 0.85rem; }
.account-face img, .account-card-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 860px) {
  .who-initials { width: 2.5rem; height: 2.5rem; border: 1px solid var(--line); }
}

/* Phone: get to the tree faster */
@media (max-width: 860px) {
  .view-switch-wrap { flex-wrap: nowrap; width: 100%; }
  .view-switch-wrap .view-switch {
    flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; padding-bottom: 2px;
  }
  .view-switch-wrap .view-switch::-webkit-scrollbar { display: none; }
  .view-switch a { white-space: nowrap; flex: none; }
  .family-menu > div { right: 0; left: auto; }
  .tree-head .tree-dates { display: none; }
  .tree-head h1, .tree-head .family-name { font-size: 1.9rem; }
  .branch { flex-wrap: nowrap; align-items: end; }
  .branch-search { flex: 1 1 0; min-width: 0; font-size: 0.92rem; grid-template-columns: minmax(0, 1fr); }
  .branch-search > .tip { display: none; }
  .branch-search input { min-width: 0; }
  .branch select { min-width: 0; width: 8.5rem; flex: none; padding-left: 0.6rem; padding-right: 0.4rem; }
  .branch .btn { flex: none; padding: 0.5rem 0.8rem; }
  .toolbar { gap: 0.6rem; }
}

/* ------------------------------------------------------------------ */
/* Generation-band chart (Down layout)                                 */
/* ------------------------------------------------------------------ */
.tree-canvas { position: relative; }
.tree-canvas .orgchart { position: relative; z-index: 1; }
.chart-lines { position: absolute; top: 0; left: 0; z-index: 0; pointer-events: none; overflow: visible; }
.chart-lines .band { fill: transparent; }
.chart-lines .band-alt { fill: rgba(46, 91, 67, 0.045); }
.tree-view { position: relative; }
.chart-rail { position: absolute; left: 0; top: 0; z-index: 3; height: 0; width: 0; }
.chart-rail span {
  position: absolute; left: 6px; transform: translateY(-100%); white-space: nowrap;
  font-size: 0.8rem; font-weight: 650; color: var(--green-deep);
  background: rgba(255, 253, 248, 0.92); border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.6rem;
}
.chart-lines .chart-ink line, .chart-lines .chart-ink path { stroke: #b9c6ad; stroke-width: 2; fill: none; }
.chart-lines .join { fill: var(--green); stroke: white; stroke-width: 2; }
.tree-canvas[data-layout="down"] { padding-left: 1.5rem; padding-right: 1.5rem; }
.tree-canvas[data-layout="down"] .gen { gap: 1.6rem; padding-top: 2.2rem; }
.tree-canvas[data-layout="down"] .gen .gen { border-top: 0; margin-top: 0; padding-top: 4.4em; }
.tree-canvas[data-layout="down"] .gen .gen > li::before { display: none; }
.tree-canvas[data-layout="down"] .gen > li { padding: 0 0.4rem; margin-top: calc(var(--gen-offset, 0) * 12.2em); }
.tree-canvas[data-layout="down"] .couple { gap: 2.2rem; }
.tree-canvas[data-layout="down"] .person-box { height: 7.8em; min-width: 13rem; max-width: 14.5rem; overflow: hidden; }
.tree-canvas[data-layout="down"] .person-box strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.person-box.is-former { opacity: 0.85; border-top-style: dashed; }
.chart-lines .chart-ink line.former { stroke-dasharray: 5 5; }
.chart-lines .join-former { fill: white; stroke: #b9c6ad; }
.tree-canvas:not([data-layout="down"]) .chart-lines,
.tree-canvas[data-chart="pedigree"] .chart-lines,
.tree-canvas[data-chart="fan"] .chart-lines { display: none; }
.link-mark {
  position: absolute; top: -0.55rem; right: 0.45rem; z-index: 2;
  font-size: 0.72rem; font-weight: 700; color: var(--green-deep);
  background: var(--leaf); border-radius: 999px; padding: 0.05rem 0.45rem;
}
.tree-canvas[data-layout="down"] .person-box.has-link-mark { overflow: visible; }
.pedigree { display: flex; align-items: center; padding: 0.4rem 0.4rem 1.6rem; }
.ped-branch { display: flex; align-items: center; position: relative; }
.ped-person { position: relative; }
.ped-parents {
  display: flex; flex-direction: column; justify-content: center; gap: 0.8rem;
  margin-left: 1.6rem; padding-left: 1.15rem; border-left: 2px solid #b9c6ad;
}
.ped-parents > .ped-branch::before,
.ped-parents > .ped-empty::before {
  content: ""; position: absolute; right: 100%; top: 50%; width: 1.15rem; border-top: 2px solid #b9c6ad;
}
.ped-empty { position: relative; }
.ped-branch:has(> .ped-parents) > .ped-person::after {
  content: ""; position: absolute; left: 100%; top: 50%; width: 1.6rem; border-top: 2px solid #b9c6ad;
}
.ped-empty {
  min-width: 9.5rem; min-height: 4.4rem; padding: 0.7rem;
  border: 1px dashed #b9c6ad; border-radius: 16px; background: rgba(255, 255, 255, 0.75);
  display: grid; place-items: center; text-align: center; color: #4d6658;
}
.ped-empty a { font-weight: 700; }
.hourglass { display: flex; flex-direction: column; align-items: center; gap: 2.4rem; padding: 0.4rem 0.4rem 1.4rem; }
.hg-ancestors { display: flex; justify-content: center; }
.hg-parent-row { display: flex; align-items: flex-end; justify-content: center; gap: 1.5rem; }
.hg-line { display: flex; flex-direction: column-reverse; align-items: center; gap: 2.3rem; }

/* ------------------------------------------------------------------ */
/* Phone family card                                                   */
/* ------------------------------------------------------------------ */
.mobile-view-switch, .family-card-view { display: none; }
@media (max-width: 700px) {
  .mobile-view-switch {
    display: flex; gap: 0.3rem; padding: 0.25rem; margin: 0.4rem 0 0.8rem;
    background: #ede7da; border-radius: 999px;
  }
  .mobile-view-switch button {
    flex: 1; border: 0; background: transparent; min-height: 42px; font-weight: 600; color: var(--muted);
  }
  .mobile-view-switch button[aria-pressed="true"] { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(50, 40, 20, 0.1); }
  html:not([data-mobile-view="chart"]) .family-card-view { display: block; }
  html:not([data-mobile-view="chart"]) .tree-chart-area { display: none; }
  .tree-canvas[data-layout="down"] { padding-left: 7.5rem; }
  .chart-rail span { font-size: 0.8rem; padding: 0.15rem 0.45rem; }
}
.family-card-view {
  background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1rem 1rem; margin-bottom: 1rem;
  scroll-margin-top: 80px;
}
.fc-head { text-align: center; margin-bottom: 0.4rem; }
.fc-face {
  width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 0.6rem; overflow: hidden;
  display: grid; place-items: center; background: var(--leaf); color: var(--green-deep);
  font-size: 1.9rem; font-weight: 650; box-shadow: 0 0 0 4px white, 0 0 0 6px rgba(46, 91, 67, 0.25);
}
.fc-face img { width: 100%; height: 100%; object-fit: cover; }
.fc-head h2 { margin: 0; font-size: 1.6rem; }
.fc-meta { margin: 0.2rem 0 0; color: var(--ink); font-weight: 500; }
.fc-places { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.92rem; }
.fc-section { padding-top: 0.8rem; margin-top: 0.8rem; border-top: 1px solid var(--line); }
.fc-section h3 { font-family: Figtree, sans-serif; font-size: 0.82rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.5rem; }
.fc-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.kin-chip {
  display: inline-flex; align-items: center; gap: 0.5rem; max-width: 100%;
  padding: 0.3rem 0.85rem 0.3rem 0.3rem; min-height: 48px;
  border: 1px solid var(--line); border-radius: 999px; background: #fdfbf6; color: inherit; text-decoration: none;
}
.kin-chip:active { background: var(--leaf); }
.kin-chip-face {
  flex: none; width: 38px; height: 38px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--leaf); color: var(--green-deep); font-weight: 650; font-size: 0.85rem;
}
.kin-chip-face img { width: 100%; height: 100%; object-fit: cover; }
.kin-chip-text { display: grid; line-height: 1.15; min-width: 0; }
.kin-chip-text strong { font-size: 0.98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kin-chip-text small { color: var(--muted); font-size: 0.8rem; }
.kin-add { border-style: dashed; color: var(--green-deep); padding-left: 0.9rem; font-weight: 600; background: transparent; }
.fc-actions { display: grid; gap: 0.5rem; margin-top: 1.1rem; }
.fc-actions .btn { width: 100%; }

/* Back to the home page from Sign in / Create account */
.auth-back {
  display: inline-flex; align-items: center; gap: 0.4rem; align-self: flex-start;
  margin: 0 0 1rem; padding: 0.35rem 0.8rem 0.35rem 0.6rem; border-radius: 999px;
  color: var(--green-deep); font-weight: 600; font-size: 0.92rem; text-decoration: none; background: var(--leaf);
}
.auth-back:hover { background: #dfe9d4; }
.auth-brand-home { color: inherit; text-decoration: none; }
.auth-brand-home:hover { text-decoration: underline; text-underline-offset: 6px; }

/* How to call them */
.call-me {
  display: flex; flex-wrap: wrap; gap: 0.8rem 1rem; align-items: center; justify-content: space-between;
  background: #fff8e8; border: 1px solid #f1dfb6; border-radius: var(--radius); padding: 0.9rem 1.1rem; margin: 0.8rem 0;
}
.call-me > div:first-child { display: grid; gap: 0.15rem; }
.call-me .muted { font-size: 0.92rem; }
.call-me-choices { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.call-me-own { font-size: 0.92rem; margin-left: 0.3rem; }
.gap-title a { background: #efe9ff; }
.add-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; margin: 0.2rem 0.6rem 0.2rem 0; }
.add-group-label { color: var(--muted); font-weight: 600; margin-right: 0.15rem; }
.titles-list { list-style: none; padding: 0; margin: 0; display: grid; }
.titles-list li { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; justify-content: space-between; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.titles-who { display: grid; }
.titles-choices { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.titles-choices .choice { margin: 0; }
.titles-save { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; position: sticky; bottom: 0; background: white; padding: 0.6rem 0; }
.card-actions .add-group { flex: 1 1 100%; margin: 0; }
.card-actions .add-group .btn { flex: 0 0 auto; }
.card-actions .add-group-label { min-width: 3.6rem; }

/* Origin → home flags */
.flags { gap: 0.25rem; }
.flag-arrow { color: var(--muted); font-size: 0.85rem; line-height: 1; }

/* Sign in with phone or email */
.login-with { display: flex; gap: 0.3rem; padding: 0.2rem; border-radius: 999px; border: 1px solid var(--line); background: white; width: fit-content; margin-bottom: 0.2rem; }
.login-with a { display: inline-flex; align-items: center; min-height: 36px; padding: 0.3rem 0.9rem; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 0.92rem; }
.login-with a.on { background: var(--leaf); color: var(--green-deep); }
.stay-signed-in { font-weight: 500; font-size: 0.95rem; }

/* How you are related: You → your mother Grace → her brother Paul */
.kin-path { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.35rem; margin: 0.5rem 0 0; font-size: 0.92rem; }
.fc-head .kin-path { justify-content: center; }
.kin-step { display: inline-flex; gap: 0.25rem; padding: 0.15rem 0.6rem; border-radius: 999px; background: var(--leaf); color: var(--green-deep); text-decoration: none; }
.kin-step-you { font-weight: 650; }
a.kin-step:hover { background: #dfe9d4; }
.kin-arrow { color: var(--muted); }

/* Coming up: birthdays and remembrance */
.occasion-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.occasion-list a { display: flex; gap: 0.6rem; align-items: center; padding: 0.45rem 0.6rem; border-radius: 12px; color: inherit; text-decoration: none; background: #fdfbf6; border: 1px solid var(--line); }
.occasion-list a:hover { background: var(--leaf); }
.occasion-list .is-today a { background: #fff4dc; border-color: #f1dfb6; font-weight: 600; }
.occasion-remembrance a { background: #f6f4fb; }
.occasion-icon { font-size: 1.15rem; }

/* Invite card share buttons */
.share-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin: 0.6rem 0; }
.share-whatsapp { background: #1f8f4e; }

/* Side panel family card (computers) */
.side-card {
  position: fixed; top: 76px; right: 16px; bottom: 16px; z-index: 1100; width: min(24rem, calc(100vw - 32px));
  overflow-y: auto; background: white; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 60px rgba(50, 40, 20, 0.18);
  padding: 0.6rem 0.4rem 0.4rem;
}
.side-card[hidden] { display: none; }
.side-card .family-card-view { display: block; box-shadow: none; margin: 0; padding-top: 0.4rem; }
.side-card-top { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.15rem 0.3rem 0.35rem 0.6rem; background: white; }
.side-card-full { font-size: 0.9rem; font-weight: 600; }
.side-card-close {
  width: 36px; height: 36px; min-height: 0; padding: 0; flex: none;
  border-radius: 50%; font-size: 1.4rem; line-height: 1; background: white;
}
/* Inside the full-screen tree the card sits over the tree, below the full-screen controls. */
.side-card.in-fullscreen { top: 4.4rem; }
.person-box.is-selected { outline: 3px solid #f3c64f; outline-offset: 3px; }
body.side-card-open .tree-chart-area { margin-right: min(25rem, 42vw); }
@media (max-width: 700px) {
  /* Phones: the family card slides up from the bottom over the tree, so you keep your place. */
  .side-card, .side-card.in-fullscreen { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 68vh; border-radius: 20px 20px 0 0; padding-bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -16px 48px rgba(50, 40, 20, 0.22); }
  body.side-card-open .tree-chart-area { margin-right: 0; }
}

/* Print poster: only the family name and the chart, landscape, colours kept */
.link-button { background: none; border: 0; padding: 0; min-height: 0; color: var(--green-deep); text-decoration: underline; cursor: pointer; font: inherit; }
@media print {
  @page { size: landscape; margin: 10mm; }
  html, body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.printing-tree main > *:not(.page-head):not(.tree-chart-area),
  body.printing-tree .tree-chart-area > *:not(.tree-view),
  body.printing-tree .site-foot, body.printing-tree .crumbs, body.printing-tree .side-card, body.printing-tree .for-you,
  body.printing-tree .view-switch-wrap, body.printing-tree .family-portrait, body.printing-tree .family-description,
  body.printing-tree .tree-dates, body.printing-tree .mobile-view-switch, body.printing-tree .family-card-view { display: none !important; }
  body.printing-tree .tree-chart-area { display: block !important; margin: 0 !important; }
  body.printing-tree .tree-view { overflow: visible !important; padding: 0; min-height: 0; }
  body.printing-tree .page-head { margin: 0 0 4mm; }
  body.printing-tree .person-box { box-shadow: none; break-inside: avoid; }
  body.printing-tree .person-photo::after, body.printing-tree .peek { display: none !important; }
}

/* Versions */
.version-link { color: var(--muted); font-variant-numeric: tabular-nums; text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 0.05rem 0.5rem; margin-left: 0.25rem; white-space: nowrap; }
.version-link:hover { color: var(--green-deep); border-color: #b9c6ad; }
.update-note { display: flex; align-items: center; gap: 0.5rem; background: #eef3e8; }
.update-note[hidden] { display: none; }
.update-note > span { flex: 1; }
.update-note-close { min-height: 0; width: 32px; height: 32px; padding: 0; border-radius: 50%; font-size: 1.2rem; line-height: 1; }
.release h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; margin-bottom: 0.1rem; }
.release-version { font-family: Figtree, sans-serif; font-size: 0.85rem; font-weight: 650; color: var(--green-deep); background: var(--leaf); border-radius: 999px; padding: 0.15rem 0.6rem; letter-spacing: 0; }
.release ul { margin: 0.6rem 0 0; padding-left: 1.2rem; display: grid; gap: 0.25rem; }
.version-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.version-table th, .version-table td { text-align: left; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.version-table th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.account-version { max-width: 640px; margin: 0.5rem 0; }
@media (max-width: 640px) { .version-table th:nth-child(4), .version-table td:nth-child(4) { display: none; } }

/* About page title */
.about-title, .legal-title { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.18em; text-decoration-color: var(--green); }

/* Account chip in the header: show that it opens a menu */
.account-chip { transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; }
.account-chip:has(.menu summary:hover),
.account-chip:has(.menu[open]) {
  background: var(--leaf);
  border-color: #b9c6ad;
  box-shadow: 0 4px 14px rgba(46, 91, 67, 0.12);
}
.account-chip .menu summary { cursor: pointer; }
.account-chip .menu summary:hover .who-name { color: var(--green-deep); }
.account-chip .menu summary:focus-visible { outline: 3px solid #f3c64f; outline-offset: 4px; border-radius: 999px; }
.who-caret {
  width: 0.45rem; height: 0.45rem; margin-left: 0.15rem; flex: none;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); color: var(--muted); transition: transform 0.15s ease, color 0.15s ease;
}
.account-chip .menu summary:hover .who-caret { color: var(--green-deep); }
.account-chip .menu[open] .who-caret { transform: rotate(-135deg) translateY(-1px); color: var(--green-deep); }
.who-initials { transition: background-color 0.15s ease, box-shadow 0.15s ease; }
.account-chip .menu summary:hover .who-initials,
.account-chip .menu[open] .who-initials { box-shadow: 0 0 0 3px rgba(46, 91, 67, 0.18); }
@media (max-width: 860px) {
  .who-caret { display: none; }
  .account-chip:has(.menu summary:hover), .account-chip:has(.menu[open]) { background: none; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .account-chip, .who-caret, .who-initials { transition: none; }
}

/* ------------------------------------------------------------------ */
/* One hover language for everything you can click (mouse devices)    */
/* ------------------------------------------------------------------ */
.btn, button, .view-switch a, .family-menu summary, .auth-tab, .login-with a, .kin-chip, .gaps a,
.family-card, .person-box, .nav-bell, .choice, .zoom button, .occasion-list a, .kin-step, .landing-point {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
@media (hover: hover) and (pointer: fine) {
  /* Quiet and plain buttons: soft green tint and border */
  .btn:not(.primary):not(.danger):not(.google):hover,
  button:not(.primary):not(.danger):not(.btn.google):not(.choice):not(.link-button):not(.menu-signout):not([role="option"]):hover,
  .view-switch a:not(.on):hover,
  .family-menu summary:hover,
  .login-with a:not(.on):hover,
  .auth-tab:not(.on):hover {
    background: var(--leaf);
    border-color: #b9c6ad;
    color: var(--green-deep);
  }
  .zoom button:not(.on):hover { background: var(--leaf); color: var(--green-deep); }
  .zoom button.on:hover, .view-switch a.on:hover { box-shadow: 0 3px 10px rgba(50, 40, 20, 0.18); }
  /* Main actions: a deeper green and a small lift */
  .btn.primary:hover, button.primary:hover {
    background: var(--green-deep);
    box-shadow: 0 6px 16px rgba(14, 59, 40, 0.25);
    transform: translateY(-1px);
  }
  .btn.danger:hover { filter: brightness(0.92); box-shadow: 0 6px 16px rgba(155, 59, 44, 0.25); }
  .landing-final .btn.primary:hover { background: #f7f4ec; color: var(--green-deep); }
  /* Things you open: lift with a stronger shadow */
  .family-card:hover, .landing-point:hover { transform: translateY(-2px); box-shadow: 0 22px 50px rgba(50, 40, 20, 0.14); }
  .tree-canvas .person-box:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(50, 40, 20, 0.16); border-color: #b9c6ad; }
  .tree-canvas .person-box:hover .person-box-link strong { color: var(--green-deep); text-decoration: underline; text-underline-offset: 3px; }
  .kin-chip:hover { background: var(--leaf); border-color: #b9c6ad; box-shadow: 0 4px 12px rgba(50, 40, 20, 0.1); }
  .kin-add:hover { background: #f7f4ec; border-color: var(--green); }
  .gaps a:hover { background: #dfe9d4; box-shadow: 0 3px 10px rgba(50, 40, 20, 0.1); }
  .choice:hover { border-color: #b9c6ad; background: #f7f4ec; }
  .nav-bell:hover { box-shadow: 0 0 0 1px #b9c6ad inset; color: var(--green-deep); }
  /* Text links get a clearer underline on hover */
  main a:not(.btn):not(.kin-chip):not(.kin-step):not(.family-card-open):not(.person-box-link):not(.auth-tab):hover,
  .site-foot a:hover, .auth-legal a:hover { color: var(--green); text-decoration-thickness: 2px; }
}
/* Keyboard users: a clear outline on whatever has focus */
a:focus-visible, button:focus-visible, summary:focus-visible, .choice:focus-within, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #f3c64f;
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .btn, button, .family-card, .person-box, .kin-chip, .landing-point { transition: none; transform: none !important; }
}

/* ------------------------------------------------------------------ */
/* Reading comfort: the "Text" control, first-visit hint, contrast    */
/* ------------------------------------------------------------------ */
.top { position: sticky; }
.a11y { position: relative; }
.a11y summary { list-style: none; }
.a11y summary::-webkit-details-marker { display: none; }
.a11y summary::marker { content: ''; }
.a11y-btn {
  display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer;
  min-height: 2.6rem; padding: 0.3rem 0.8rem 0.3rem 0.65rem; border-radius: 999px;
  background: white; border: 1px solid var(--line); color: var(--ink); font-weight: 600;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.a11y-aa { display: inline-flex; align-items: baseline; gap: 0.05rem; font-family: Fraunces, Georgia, serif; line-height: 1; }
.a11y-aa span:first-child { font-size: 0.85rem; }
.a11y-aa span:last-child { font-size: 1.25rem; }
.a11y[open] .a11y-btn { background: var(--leaf); border-color: #b9c6ad; color: var(--green-deep); }
@media (hover: hover) and (pointer: fine) {
  .a11y-btn:hover { background: var(--leaf); border-color: #b9c6ad; color: var(--green-deep); }
}
.a11y-panel {
  position: absolute; right: 0; top: calc(100% + 0.5rem); z-index: 40; width: min(20rem, calc(100vw - 2rem));
  background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 0.9rem;
}
.a11y:not([open]) .a11y-panel { display: none; }
.a11y-title { margin: 0 0 0.5rem; font-weight: 650; }
.a11y-sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.35rem; }
.a11y-size {
  display: grid; justify-items: center; gap: 0.15rem; min-height: 4.2rem; padding: 0.4rem 0.2rem;
  border-radius: 14px; background: #fdfbf6; border: 1px solid var(--line); color: var(--ink);
}
.a11y-size-a { font-family: Fraunces, Georgia, serif; line-height: 1; }
.a11y-size-1 .a11y-size-a { font-size: 1rem; }
.a11y-size-2 .a11y-size-a { font-size: 1.25rem; }
.a11y-size-3 .a11y-size-a { font-size: 1.55rem; }
.a11y-size-4 .a11y-size-a { font-size: 1.9rem; }
.a11y-size-label { font-size: 0.8rem; font-weight: 600; }
.a11y-size[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: white; }
.a11y-contrast {
  display: flex; align-items: center; gap: 0.55rem; margin-top: 0.8rem; padding: 0.6rem 0.7rem;
  border: 1px solid var(--line); border-radius: 14px; font-weight: 600; cursor: pointer;
}
.a11y-contrast input { width: 1.3rem; height: 1.3rem; min-height: 0; margin: 0; accent-color: var(--green); }
.a11y-note { margin: 0.6rem 0 0; font-size: 0.82rem; color: var(--muted); }
/* On the sign-in style pages the control sits at the top of the form panel */
.a11y-panel-row { position: relative; display: flex; justify-content: flex-end; margin: -0.4rem 0 0.6rem; }
/* First-visit hint, pointing at the control */
.a11y-hint {
  position: absolute; z-index: 35; right: 1rem; top: calc(100% + 0.35rem); max-width: min(19rem, calc(100vw - 2rem));
  display: flex; align-items: center; gap: 0.5rem; margin: 0; padding: 0.55rem 0.55rem 0.55rem 0.85rem;
  background: var(--ink); color: #f7f4ec; border-radius: 14px; box-shadow: var(--shadow); font-size: 0.92rem;
}
.a11y-hint[hidden] { display: none; }
.a11y-hint::before { content: ''; position: absolute; top: -6px; right: 2.2rem; border: 6px solid transparent; border-top: 0; border-bottom-color: var(--ink); }
.a11y-panel-row .a11y-hint { top: calc(100% + 0.4rem); right: 0; }
.a11y-hint-close { min-height: 0; width: 1.9rem; height: 1.9rem; padding: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: white; border: 0; font-size: 1.1rem; line-height: 1; }
/* Phones: keep the header on one row at every text size */
@media (max-width: 860px) {
  .a11y-word { display: none; }
  .a11y-btn { padding: 0.3rem 0.6rem; min-height: 2.5rem; }
  .top nav { gap: 0.3rem; }
}
@media (max-width: 480px) {
  .top nav .btn.primary .icon-label > span { display: none; }
  .top nav .btn.primary { padding: 0.45rem 0.7rem; }
  .landing-top nav .btn.primary { padding: 0.45rem 0.9rem; }
}
/* iPhone and iPad: at Normal size, follow the text size set in the phone's settings */
@supports (font: -apple-system-body) {
  @media (hover: none) and (pointer: coarse) {
    html[data-text="md"] { font: -apple-system-body; font-family: Figtree, "Segoe UI", sans-serif; }
  }
}

/* High contrast: darker text, stronger outlines, underlined links */
html[data-contrast="high"] {
  --ink: #000;
  --muted: #26332c;
  --line: #6b7c72;
  --leaf: #d8eee1;
  --green: #0b5a35;
  --green-deep: #052a1b;
  --cream: #ffffff;
  --shadow: 0 0 0 1px #6b7c72;
}
html[data-contrast="high"] body { background: #fff; color: #000; }
html[data-contrast="high"] .panel, html[data-contrast="high"] .family-card, html[data-contrast="high"] .person-box,
html[data-contrast="high"] .below-card, html[data-contrast="high"] .guide-card, html[data-contrast="high"] .family-card-view,
html[data-contrast="high"] .banner, html[data-contrast="high"] .landing-point { border: 2px solid #3f4d45; box-shadow: none; }
html[data-contrast="high"] .btn, html[data-contrast="high"] button, html[data-contrast="high"] .kin-chip,
html[data-contrast="high"] input, html[data-contrast="high"] select, html[data-contrast="high"] textarea { border-color: #3f4d45; }
html[data-contrast="high"] main a:not(.btn), html[data-contrast="high"] .site-foot a { text-decoration: underline; text-underline-offset: 3px; }
html[data-contrast="high"] .muted, html[data-contrast="high"] small, html[data-contrast="high"] .hint { color: #26332c; }
html[data-contrast="high"] .chart-lines .chart-ink line, html[data-contrast="high"] .chart-lines .chart-ink path { stroke: #2f3d35; stroke-width: 2.5; }
html[data-contrast="high"] .chart-lines .band-alt { fill: rgba(0, 0, 0, 0.06); }
html[data-contrast="high"] .top { background: #fff; border-bottom: 2px solid #3f4d45; }
html[data-contrast="high"] .auth-brand-veil { background: rgba(0, 0, 0, 0.55); }
/* Sign-in style pages: Text control at the top-right of the form column */
.a11y-panel-row { align-self: center; width: min(420px, 100%); }
.auth-shell.help-shell .a11y-panel-row, .about-layout ~ .a11y-panel-row { width: 100%; }
.a11y-hint { width: max-content; }
.overflow-visible, .auth-panel { overflow: visible; }
.a11y-size[aria-pressed="true"], .a11y-size[aria-pressed="true"]:hover { background: var(--green) !important; border-color: var(--green) !important; color: white !important; }
.top .brand, .top .brand-mark { flex: none; }
@media (max-width: 480px) { .top .brand-mark { width: 2.1rem; height: 2.1rem; } }
/* Phones: header buttons stay a fixed finger-friendly size at every text size,
   so the header always fits on one row; the page below grows with the text. */
@media (max-width: 480px) {
  .top { padding-left: 12px; padding-right: 12px; gap: 6px; }
  .top nav { gap: 6px; }
  .top .brand-mark { width: 34px; height: 34px; }
  .top nav > .btn, .top .a11y-btn, .top .nav-bell, .top .who-initials {
    height: 42px; min-height: 42px; min-width: 42px; padding: 0 10px; font-size: 16px;
  }
  .top nav > .btn .icon, .top .nav-bell .icon { width: 20px; height: 20px; }
  .top .who-initials { width: 42px !important; height: 42px !important; padding: 0; font-size: 15px !important; }
  .top .a11y-aa span:first-child { font-size: 13px; }
  .top .a11y-aa span:last-child { font-size: 19px; }
  .top nav > a.btn.quiet[href$="/help"] { width: 42px; padding: 0; }
}
/* Large text on small screens: let grid columns shrink and long words wrap */
.landing-hero > *, .landing-split > *, .landing-points > *, .landing-steps li { min-width: 0; }
@media (max-width: 900px) { .landing-hero, .landing-split { grid-template-columns: minmax(0, 1fr); } }
.sample-card .who { min-width: 0; }
.sample-card strong, .sample-card small { overflow-wrap: anywhere; }
h1, h2, .btn { overflow-wrap: break-word; }
.btn { white-space: normal; text-align: center; }
/* Large text on phones: rows of buttons wrap, long addresses break, nothing pushes the page sideways */
.member-list li { flex-wrap: wrap; gap: 0.5rem; }
.member-list li > div { min-width: 0; flex: 1 1 12rem; }
.legal-doc a, .help-layout a, .about-layout a, .panel a, .family-card-view a { overflow-wrap: anywhere; }
@media (max-width: 860px) {
  .account-chip .menu summary .who { display: none; }
}
@media (max-width: 860px) {
  html[data-text="xl"] .zoom, html[data-text="xxl"] .zoom, html[data-text="lg"] .zoom { flex-wrap: wrap; justify-content: center; border-radius: 1.2rem; }
  html[data-text="xl"] .branch, html[data-text="xxl"] .branch { flex-wrap: wrap; }
  .tool-view, .toolbar, .tree-chart-area { max-width: 100%; min-width: 0; }
}

/* Page expired (403) */
.expired-steps { margin: 0.4rem 0 1rem; padding-left: 1.3rem; display: grid; gap: 0.25rem; }
.expired-actions { display: grid; gap: 0.5rem; margin: 0.4rem 0 1rem; }

/* Create account: the terms box asks for attention inline */
.terms-agree.needs-attention { outline: 2px solid #b3261e; outline-offset: 4px; border-radius: 8px; }
.terms-error { margin: 0.1rem 0 0; color: #b3261e; font-weight: 600; font-size: 0.92rem; }


/* ------------------------------------------------------------------ */
/* Home page sample tree (country-matched illustrated family)          */
/* ------------------------------------------------------------------ */
.sample-tree-v2 { margin: 0; position: relative; }
.st-rows { position: relative; z-index: 1; display: grid; gap: 1.6rem; }
.st-row { display: grid; gap: .35rem; }
.st-label { justify-self: start; font-size: .74rem; font-weight: 650; letter-spacing: .02em; color: #fff; background: rgba(14,59,40,.55); border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: .1rem .55rem; }
.st-cards { display: flex; align-items: center; justify-content: center; gap: .5rem; }
.st-join { flex: none; width: 1rem; height: 2px; background: rgba(255,255,255,.9); position: relative; }
.st-join::after { content: ''; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: #2e5b43; border: 2px solid #fff; }
.st-card { flex: 1 1 0; min-width: 0; max-width: 13rem; display: flex; gap: .5rem; align-items: center; background: #fff; border-radius: 14px; padding: .45rem .55rem; border-top: 4px solid var(--pip, #2e5b43); box-shadow: 0 10px 24px rgba(10,30,20,.2); }
.st-card.is-you { outline: 3px solid #f3c64f; outline-offset: 2px; }
.st-face { flex: none; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--leaf); }
.st-face svg { display: block; width: 44px; height: 44px; }
.st-initials { font-weight: 650; color: var(--green-deep); font-size: .85rem; }
.st-photo { background: radial-gradient(circle at 50% 38%, var(--skin) 0 30%, transparent 31%), radial-gradient(ellipse at 50% 112%, #c9d6cf 0 46%, transparent 47%), #e9efeb; position: relative; }
.st-photo::before { content: ''; position: absolute; left: 22%; right: 22%; top: 8%; height: 26%; border-radius: 50% 50% 40% 40%; background: var(--hair); }
.st-photo img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.st-who { display: grid; min-width: 0; line-height: 1.2; }
.st-who strong { font-size: .9rem; overflow-wrap: anywhere; }
.st-who small { color: #46564d; font-size: .76rem; }
.st-who .st-years { color: #14241c; }
.st-flags { display: flex; align-items: center; gap: .2rem; margin-top: .1rem; }
.st-flags .flag-img { width: 16px; height: 12px; }
.st-flags .flag-arrow { font-size: .7rem; color: #46564d; }
.st-lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; overflow: visible; }
.st-lines path { stroke: rgba(255,255,255,.92); stroke-width: 2; fill: none; }
.sample-tree-v2 figcaption { margin-top: 1rem; color: #f7f4ec; font-size: .82rem; text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.st-flags { display: flex; align-items: center; gap: .2rem; margin-top: .1rem; }
.st-flags .flag-img { width: 16px; height: 12px; }
.st-flags .flag-arrow { font-size: .7rem; color: #46564d; }
@media (max-width: 480px) {
  .st-rows { gap: 1.3rem; }
  .st-cards { gap: .3rem; }
  .st-join { width: .6rem; }
  .st-card { padding: .4rem .4rem; gap: .35rem; }
  .st-face, .st-face svg { width: 34px !important; height: 34px !important; }
  .st-who strong { font-size: .8rem; }
  .st-who small { font-size: .72rem; }
}
.admin-families { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.8rem; }
.admin-family { display: grid; gap: 0.5rem; padding: 0.8rem; border: 1px solid var(--line); border-radius: 14px; background: #fdfbf6; }
.admin-family-faces { display: flex; gap: 0.2rem; }
.admin-family-faces svg { border-radius: 50%; }
.admin-family p { margin: 0.2rem 0 0.5rem; font-size: 0.88rem; }
@media (max-width: 480px) {
  html[data-text="xl"] .st-card, html[data-text="xxl"] .st-card { flex-direction: column; align-items: center; text-align: center; padding: .4rem .3rem; }
  html[data-text="xl"] .st-flags, html[data-text="xxl"] .st-flags { justify-content: center; }
  html[data-text="xxl"] .st-who strong { font-size: .72rem; }
  html[data-text="xxl"] .st-who small { font-size: .66rem; }
  .landing-hero-art { overflow: hidden; }
}

/* ------------------------------------------------------------------ */
/* Branches: tabs above the tree, folding on the chart                 */
/* ------------------------------------------------------------------ */
.branch-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.2rem 0.1rem 0.5rem; margin: 0.2rem 0 0.4rem; align-items: flex-start; }
.branch-tab {
  flex: none; display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.5rem; padding: 0.35rem 0.85rem;
  border-radius: 999px; border: 1px solid var(--line); background: white; color: inherit; text-decoration: none; font-weight: 600; cursor: pointer;
}
.branch-tab .icon { width: 1rem; height: 1rem; color: var(--green); }
.branch-tab small { font-weight: 650; font-size: 0.8rem; color: var(--muted); background: var(--cream); border-radius: 999px; padding: 0 0.45rem; }
.branch-tab.on { background: var(--green); border-color: var(--green); color: white; }
.branch-tab.on .icon { color: white; }
.branch-tab.on small { background: rgba(255, 255, 255, 0.2); color: white; }
.branch-tab-add { border-style: dashed; color: var(--green-deep); list-style: none; }
.branch-tab-add::-webkit-details-marker { display: none; }
.branch-tab-add::marker { content: ''; }
.branch-new { position: relative; flex: none; }
.branch-new[open] .branch-tab-add { background: var(--leaf); }
.branch-new-form {
  position: absolute; z-index: 25; top: calc(100% + 0.4rem); left: 0; width: min(24rem, calc(100vw - 2rem));
  background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 1rem;
}
@media (max-width: 700px) { .branch-new[open] { flex-basis: 100%; } .branch-new-form { position: static; width: auto; margin-top: 0.4rem; } }
@media (hover: hover) and (pointer: fine) {
  .branch-tab:not(.on):hover { background: var(--leaf); border-color: #b9c6ad; color: var(--green-deep); }
}
.branch-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0 0 0.6rem; padding: 0.6rem 0.8rem; border-radius: 14px; background: #f7f4ec; border: 1px dashed #b9c6ad; }
.branch-suggest > span { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; margin-right: 0.3rem; }
.branch-suggest .icon { width: 1rem; height: 1rem; color: var(--green); }
.branch-suggest form { margin: 0; }
.inline-form { display: inline; margin: 0; }
/* Folding */
.fold-toggle {
  display: block; margin: 0.35rem auto 0; min-height: 0; padding: 0.2rem 0.7rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 650; color: var(--green-deep); background: white; border: 1px solid #b9c6ad; position: relative; z-index: 2;
}
.tree-canvas li.is-folded > ul.gen { display: none; }
.tree-canvas li.is-folded > .fold-toggle { background: var(--leaf); }
/* In the generation chart the button floats in the gap under the couple, so rows stay aligned */
.tree-canvas[data-layout="down"] .gen > li { position: relative; }
.tree-canvas[data-layout="down"] .fold-toggle { position: absolute; left: 50%; top: calc(7.8em + 0.3rem); transform: translateX(-50%); margin: 0; white-space: nowrap; }
.tree-canvas[data-chart="fan"] .fold-toggle,
.tree-canvas[data-chart="pedigree"] .fold-toggle { display: none; }
/* Family card: which branches someone is in */
.fc-branches { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem; margin: 0.5rem 0 0; }
.fc-branch { font-size: 0.8rem; font-weight: 650; text-decoration: none; color: var(--green-deep); background: var(--leaf); border-radius: 999px; padding: 0.15rem 0.6rem; }

/* ===== v1.6 polish: the tree comes first ===== */
/* Compact family heading: smaller title, both dates on one line. */
.tree-head { align-items: center; margin-bottom: 0.5rem; row-gap: 0.6rem; }
.tree-head h1, .tree-head .family-name { font-size: clamp(1.55rem, 2.4vw, 2.15rem); margin: 0; }
.tree-head .tree-dates { font-size: 0.86rem; }
.tree-head .tree-dates span { display: inline; }
.tree-head .tree-dates span + span::before { content: " · "; }
.tree-head .family-title-row .emblem-img, .tree-head .family-title-row svg { width: 40px; }

/* One gentle prompt, on one line. */
.prompt-line { padding: 0.55rem 0.6rem 0.55rem 1rem; margin: 0.4rem 0 0.6rem; gap: 0.4rem 1rem; }
.prompt-line > div:first-child { display: block; }
.prompt-line .muted { font-size: 0.9rem; }
.prompt-line[hidden] { display: none; }
.prompt-later { background: none; border: 0; min-height: 36px; padding: 0 0.6rem; color: var(--muted); font: inherit; font-size: 0.92rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.prompt-later:hover { color: var(--ink); }

/* The update note is a small card in the corner, not a band across the page. */
.update-note {
  position: fixed; left: 1rem; bottom: 1rem; z-index: 60; margin: 0; max-width: min(25rem, calc(100vw - 2rem));
  padding: 0.7rem 0.7rem 0.7rem 1rem; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(50, 40, 20, 0.18);
  font-size: 0.93rem; animation: note-in 0.25s ease-out; transition: opacity 0.35s ease, transform 0.35s ease;
}
.update-note.is-leaving { opacity: 0; transform: translateY(10px); pointer-events: none; }
@keyframes note-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Saved messages fade away by themselves; problems stay until you close them. */
.flash { display: flex; align-items: center; gap: 0.6rem; transition: opacity 0.35s ease, max-height 0.35s ease, margin 0.35s ease, padding 0.35s ease; max-height: 12rem; overflow: hidden; }
.flash > span { flex: 1; }
.flash-close { min-height: 0; width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.6); font-size: 1.1rem; line-height: 1; cursor: pointer; flex: none; }
.flash.is-leaving { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; margin: 0; }

/* Toolbar: search on the left, More on the right. */
.tree-chart-area .toolbar { align-items: center; margin: 0.3rem 0 0.5rem; }
.tree-more { position: relative; flex: none; }
.tree-more > summary { list-style: none; cursor: pointer; }
.tree-more > summary::-webkit-details-marker { display: none; }
.tree-more > summary::marker { content: ''; }
.tree-more[open] > summary { background: var(--leaf); }
.tree-more > div {
  position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 40; display: grid; gap: 0.1rem; min-width: 230px; padding: 0.4rem;
  background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
.tree-more > div a, .tree-more > div button {
  display: flex; align-items: center; justify-content: flex-start; width: 100%; box-sizing: border-box; min-height: 42px; margin: 0;
  padding: 0.5rem 0.8rem; border: 0; border-radius: 11px; background: transparent; color: var(--ink); font: inherit; font-weight: 550;
  text-align: left; text-decoration: none; cursor: pointer; box-shadow: none;
}
.tree-more > div a:hover, .tree-more > div button:hover, .tree-more > div button[aria-pressed="true"] { background: var(--leaf); color: var(--green-deep); }
.tree-more .icon { color: var(--green-deep); opacity: 0.75; }
.tree-more-note { margin: 0.3rem 0.8rem 0.4rem; font-size: 0.88rem; }

/* Zoom and layout float on the tree, like a map. */
.tree-stage { position: relative; }
.tree-float { position: absolute; top: 0.6rem; right: 0.6rem; z-index: 6; display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; pointer-events: none; }
.tree-float .zoom { pointer-events: auto; display: inline-flex; flex: none; background: rgba(255, 255, 255, 0.95); box-shadow: 0 6px 18px rgba(50, 40, 20, 0.12); }
.tree-float .zoom button { min-height: 36px; padding: 0.3rem 0.75rem; font-size: 0.92rem; flex: none; }
.tree-float .zoom.layouts { max-width: calc(100vw - 7.5rem); overflow: visible; flex-wrap: nowrap; align-items: center; }
.tree-float .zoom.layouts button { white-space: nowrap; }
.tree-float .chart-pick { display: inline-flex; align-items: center; width: auto; margin: 0; font-weight: 600; }
.tree-float .chart-pick select {
  width: auto; min-width: 8.6rem; max-width: 11rem; min-height: 36px; height: 36px;
  margin: 0; padding: 0 1.6rem 0 0.75rem; border: 0; border-radius: 999px;
  background-color: transparent; font-size: 0.92rem; font-weight: 600; line-height: 1.2; cursor: pointer;
}
.tree-stage .tree-view { padding-top: 3.4rem; }

/* Branch suggestions sit in the tab row as dashed chips. */
.branch-suggest-chip { margin: 0; display: inline-flex; }
.branch-tab-suggest { border-style: dashed; background: #f6fbf8; color: var(--green-deep); cursor: pointer; font: inherit; }
.branch-tab-suggest small { background: none; padding: 0; font-weight: 500; }
.branch-tab-suggest:hover { background: var(--leaf); }

/* Cards: easy to find yourself, room for long titles, fold buttons you can hit. */
.tree-canvas .person-box[data-me="1"] { outline: 3px solid #f3c64f; outline-offset: 2px; background: #fffdf3; }
.tree-canvas[data-layout="down"] .person-box small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.22; font-size: 0.84rem; }
/* v1.31.2: one clean line with "…" for long names. Line-clamp left half of a second line showing
   ("Joseph…" over a cut-off "Newcomer"); the full name is in the card's hover pop-up. */
.tree-canvas[data-layout="down"] .person-box .who { min-width: 0; }
.tree-canvas[data-layout="down"] .person-box strong { display: block; -webkit-line-clamp: unset; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fold-toggle {
  min-height: 28px; padding: 0.2rem 0.75rem; font-size: 0.8rem; box-shadow: 0 2px 6px rgba(50, 40, 20, 0.12); cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.25rem;
}
.tree-canvas[data-layout="down"] .fold-toggle { top: calc(7.8em + 0.2rem); }
.fold-toggle:hover { background: var(--leaf); }

@media (max-width: 700px) {
  .tree-float { top: 0.4rem; right: 0.4rem; left: 0.4rem; }
  .tree-float .zoom button { padding: 0.3rem 0.55rem; }
  .tree-chart-area .toolbar { flex-wrap: nowrap; gap: 0.5rem; align-items: flex-end; }
  .tree-chart-area .toolbar .branch { width: auto; flex: 1 1 auto; min-width: 0; }
  .tree-more > summary .icon-label > span:last-child { display: none; }
  .update-note { left: 0.6rem; right: 0.6rem; bottom: 0.6rem; max-width: none; }
  .prompt-line { padding: 0.6rem 0.8rem; }
}
@media print { .tree-float, .tree-more, .update-note, .prompt-line { display: none !important; } .tree-stage .tree-view { padding-top: 0; } }
.tree-chart-area .toolbar { flex-wrap: nowrap; justify-content: space-between; }
.tree-chart-area .toolbar .branch { flex: 0 1 38rem; flex-wrap: nowrap; align-items: center; min-width: 0; }
.tree-chart-area .branch-search { flex: 1 1 auto; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.tree-chart-area .branch-search input { min-width: 0; }
.tree-chart-area .branch select { min-width: 0; width: 9.5rem; flex: none; }
.tree-chart-area .branch .btn, .tree-more > summary.btn { flex: none; }
.tree-stage .tree-view { padding-top: 3rem; }

/* Your family trees: cards read like sentences, with a clear way in. */
.family-card { align-content: start; min-height: 0; }
.family-card-open { display: flex; flex-direction: column; align-items: flex-start; gap: 0.45rem; height: 100%; }
.family-card-foot { align-self: stretch; margin-top: auto !important; }
.family-card-open > strong { font-family: Fraunces, Georgia, serif; font-size: 1.25rem; font-weight: 560; letter-spacing: -0.02em; line-height: 1.2; }
.family-fallback { background: linear-gradient(145deg, var(--tile-a, #2e5b43), var(--tile-b, #2f9d68)); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15); }
.family-fallback svg { display: block; width: 100%; height: 100%; }
.family-leaders { display: block; font-weight: 450; font-size: 0.95rem; color: var(--ink); }
.family-leaders-label { font-weight: 450; color: var(--muted); }
.family-leader-name { font-style: normal; font-weight: 650; font-size: inherit; }
.family-card-meta { display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; color: var(--muted); font-size: 0.88rem; }
.family-updated { color: var(--muted); }
.family-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.35rem; padding-top: 0.6rem; border-top: 1px solid var(--line); }
.family-role { font-size: 0.8rem; font-weight: 650; color: var(--green-deep); background: var(--leaf); border-radius: 999px; padding: 0.15rem 0.6rem; }
.family-card-go { font-weight: 650; color: var(--green-deep); font-size: 0.92rem; }
.family-card:hover .family-card-go { text-decoration: underline; text-underline-offset: 3px; }
.card-menu summary { width: 38px; height: 38px; min-height: 38px; border: 1px solid var(--line); background: white; border-radius: 50%; color: var(--ink); }
.card-menu { top: 0.7rem; right: 0.7rem; }

/* Your profile: side menu on computers, stacked sections on phones. */
.account-layout { display: grid; grid-template-columns: 14rem minmax(0, 46rem); gap: 1.6rem; align-items: start; justify-content: center; }
.account-nav { position: sticky; top: 5.5rem; display: grid; gap: 0.1rem; padding: 0.5rem; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.account-nav-title { margin: 0.3rem 0.7rem 0.4rem; font-weight: 700; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.account-nav a { display: flex; align-items: center; min-height: 40px; padding: 0.4rem 0.7rem; border-radius: 11px; color: var(--ink); text-decoration: none; font-weight: 550; }
.account-nav a:hover, .account-nav a.on { background: var(--leaf); color: var(--green-deep); }
.account-nav a.danger-link { color: #9b3b2c; }
.account-nav .icon { color: var(--green-deep); opacity: 0.75; }
.account-main { min-width: 0; }
.account-head h1 { margin-bottom: 0.2rem; }
.account-head .lede { margin-top: 0; }
.account-section { margin: 0 0 1rem; scroll-margin-top: 5.5rem; }
.account-section h2 { font-size: 1.3rem; margin: 0 0 0.6rem; }
.account-section h2 .icon { color: var(--green); }
.account-form { display: block; }
.account-save { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: -0.2rem 0 1.4rem; padding: 0.7rem 1rem; background: rgba(255, 255, 255, 0.96); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 30px rgba(50, 40, 20, 0.12); }
.account-save .muted { font-size: 0.88rem; }
.plan-meter { height: 10px; border-radius: 999px; background: var(--leaf); overflow: hidden; margin: 0.2rem 0 0.6rem; }
.plan-meter span { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.plan-meter span.over { background: #d08a2e; }
.account-section.narrow { max-width: none; }
@media (max-width: 900px) {
  .account-layout { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
  .account-nav { position: static; display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 0.3rem; padding: 0.35rem; border-radius: 999px; scrollbar-width: none; }
  .account-nav-title { display: none; }
  .account-nav a { flex: none; min-height: 36px; padding: 0.3rem 0.75rem; border-radius: 999px; font-size: 0.9rem; }
  .account-nav .icon { display: none; }
}

/* First steps: the tree to come, drawn as soft empty cards. */
.starter-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 1.5rem; align-items: center; text-align: left; padding: 1.6rem; }
.starter-hero h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 0 0 0.4rem; }
.starter-hero .empty-actions { justify-content: flex-start; }
.starter-hero p { margin-left: 0; }
.ghost-tree { display: grid; gap: 1.1rem; justify-items: center; padding: 1.2rem 0.6rem; border-radius: 20px; background: radial-gradient(circle at 50% 40%, #eef3e8, transparent 70%); position: relative; }
.ghost-row { display: flex; gap: 0.8rem; justify-content: center; position: relative; }
.ghost-row + .ghost-row::before { content: ""; position: absolute; top: -1.1rem; left: 50%; height: 1.1rem; border-left: 2px dashed #b9d3c3; }
.ghost-card { display: flex; align-items: center; gap: 0.55rem; min-width: 9.5rem; padding: 0.5rem 0.8rem 0.5rem 0.5rem; border: 2px dashed #b9d3c3; border-radius: 16px; background: rgba(255, 255, 255, 0.75); color: var(--muted); font-weight: 600; font-size: 0.92rem; text-decoration: none; }
.ghost-card .cartoon-face { flex: none; opacity: 0.55; filter: saturate(0.6); border-radius: 50%; }
.ghost-card.is-you { border-style: solid; border-color: #f3c64f; background: #fffdf3; color: var(--ink); box-shadow: 0 8px 22px rgba(50, 40, 20, 0.1); }
.ghost-card.is-you .cartoon-face { opacity: 1; filter: none; }
.ghost-card.is-step { color: var(--green-deep); justify-content: flex-start; cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease; }
.ghost-card.is-step > .icon { margin-left: auto; color: var(--green); }
.ghost-card.is-step:hover { background: var(--leaf); border-color: var(--green); border-style: solid; }
.ghost-card.is-step:hover .cartoon-face { opacity: 0.9; filter: none; }
.next-steps { margin: 1rem 0; padding: 1.1rem 1.2rem; background: white; border-radius: var(--radius); box-shadow: var(--shadow); }
.next-steps-head h2 { font-size: 1.25rem; margin: 0; }
.next-steps-head p { margin: 0.2rem 0 0.8rem; }
.next-steps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.6rem; }
@media (max-width: 700px) {
  .starter-hero { grid-template-columns: minmax(0, 1fr); padding: 1.1rem; text-align: center; }
  .starter-hero .empty-actions { justify-content: center; }
  .ghost-card { min-width: 0; font-size: 0.85rem; }
  .ghost-card .cartoon-face { width: 36px; height: 36px; }
}
.tree-head .tree-dates span:first-child:not(:only-child) { display: none; }
.tree-head .tree-dates span + span::before { content: none; }

/* One button system: green primary and white secondary, in three sizes (36, 44, 52px). */
.btn, button.btn, #content form > button:not(.link-button):not(.choice):not(.prompt-later):not(.flash-close):not([role="option"]) { font-weight: 600; font-size: 1rem; letter-spacing: 0; line-height: 1.2; }
.btn.quiet, button.quiet { background: white; border: 1px solid var(--line); color: var(--ink); }
.btn.small, button.small { min-height: 36px; padding: 0.35rem 0.9rem; font-size: 0.92rem; font-weight: 600; }
.btn.big { min-height: 52px; padding: 0.75rem 1.4rem; font-size: 1.05rem; font-weight: 600; }
.btn.primary { box-shadow: 0 4px 12px rgba(46, 91, 67, 0.18); }
.guide-card .btn, .call-me-choices .btn { min-height: 36px; padding: 0.35rem 0.9rem; font-size: 0.92rem; }
.branch-tab, .view-switch a, .family-menu summary { font-weight: 600; }
.zoom button { font-weight: 600; }

/* Phones: keep the prompt, tabs, and breadcrumbs compact so the family shows sooner. */
.crumbs a { display: inline-block; padding: 0.15rem 0; min-height: 24px; }
@media (max-width: 700px) {
  .prompt-line .muted { display: none; }
  .prompt-line { gap: 0.45rem; }
  .prompt-line .call-me-choices { gap: 0.3rem; }
  .prompt-line .call-me-choices .btn { min-height: 36px; padding: 0.3rem 0.65rem; font-size: 0.86rem; }
  .prompt-line .call-me-own, .prompt-line .prompt-later { font-size: 0.86rem; min-height: 36px; display: inline-flex; align-items: center; }
  .branch-tabs { gap: 0.3rem; margin-bottom: 0.2rem; }
  .branch-tab { min-height: 36px; padding: 0.3rem 0.7rem; font-size: 0.88rem; }
  .branch-tab small { font-size: 0.74rem; }
  .branch-tab-suggest small { display: none; }
}

/* Bigger tick boxes and round choices (24px), easier for older hands. */
input[type="checkbox"], input[type="radio"] { width: 1.5rem; height: 1.5rem; min-height: 0; accent-color: var(--green); flex-shrink: 0; }
.check input { width: 1.5rem; height: 1.5rem; margin-top: 0.05rem; }
/* Fold buttons stay at least 24px tall even when the chart is zoomed out. */
.fold-toggle { min-height: 34px; padding: 0.25rem 0.85rem; font-size: 0.86rem; }
@media (max-width: 700px) {
  .tree-chart-area .toolbar .branch > .btn[type="submit"] { display: none; }
  .tree-chart-area .branch select { width: 7.4rem; font-size: 0.9rem; }
  .tree-chart-area .branch-search input { font-size: 0.95rem; }
}
.call-me-own, .whats-new > a, .version-link { display: inline-flex; align-items: center; min-height: 24px; }
.map-summary { margin: 0.2rem 0 0; font-size: 0.95rem; }
.map-summary a { font-weight: 600; }

/* Generation labels sit in the gap above each row; they stay small so they fit between rows. */
.chart-rail span { font-size: 0.76rem; padding: 0.12rem 0.55rem; line-height: 1.3; box-shadow: 0 1px 3px rgba(50, 40, 20, 0.08); }

/* ===== v1.6.3: moving around a big tree ===== */
/* The tree box fits the screen and scrolls both ways, so both sliders are always in reach. */
.tree-stage .tree-view { max-height: calc(100vh - var(--header-h, 76px) - 1rem); max-height: calc(100dvh - var(--header-h, 76px) - 1rem); min-height: min(420px, 60vh); cursor: grab; }
.tree-stage.is-fullscreen .tree-view { overscroll-behavior: contain; }
.tree-stage .tree-view.is-panning { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.tree-stage .tree-view .person-box, .tree-stage .tree-view button, .tree-stage .tree-view a { cursor: pointer; }
.tree-stage { border-radius: 18px; }

/* Full screen: only the tree. */
.fs-only { display: none; }
.tree-stage.is-fullscreen { position: fixed; inset: 0; z-index: 1000; margin: 0; border-radius: 0; background: var(--cream); display: flex; flex-direction: column; }
.tree-stage.is-fullscreen .tree-view { flex: 1; max-height: none; min-height: 0; height: 100%; padding-top: 3.6rem; }
.tree-stage.is-fullscreen .fs-only { display: flex; }
.tree-stage.is-fullscreen .fs-toggle-wrap { display: none; }
.tree-stage.is-fullscreen .tree-float { left: 0.6rem; justify-content: space-between; }
html.tree-fullscreen, html.tree-fullscreen body { overflow: hidden; }
.fs-bar { pointer-events: auto; gap: 0.4rem; align-items: center; margin-right: auto; flex-wrap: wrap; }
.fs-exit { min-height: 40px; padding: 0.35rem 0.9rem; border-radius: 999px; border: 0; background: var(--ink); color: white; font-weight: 650; box-shadow: 0 6px 18px rgba(50, 40, 20, 0.18); cursor: pointer; }
.fs-exit .icon { color: white; }
.fs-exit:hover { background: var(--green-deep); }
.fs-find input { min-height: 40px; width: 14rem; max-width: 46vw; border-radius: 999px; padding: 0.35rem 0.9rem; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.96); box-shadow: 0 6px 18px rgba(50, 40, 20, 0.12); }
.person-box.is-found { outline: 4px solid #f3c64f; outline-offset: 3px; animation: found-pulse 0.8s ease-in-out 3; }
@keyframes found-pulse { 50% { outline-color: rgba(243, 198, 79, 0.35); } }

/* Overview map in the corner, only when the tree is bigger than the screen. */
.tree-minimap { position: absolute; right: 0.8rem; bottom: 0.8rem; z-index: 6; padding: 0.35rem; background: rgba(255, 255, 255, 0.96); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 26px rgba(50, 40, 20, 0.16); }
.tree-minimap[hidden], .minimap-show[hidden] { display: none; }
.tree-minimap canvas { display: block; width: 200px; height: 130px; cursor: crosshair; border-radius: 9px; background: #f6faf7; touch-action: none; }
.minimap-hide { position: absolute; top: -10px; right: -10px; width: 28px; height: 28px; min-height: 0; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: white; font-size: 1.1rem; line-height: 1; cursor: pointer; box-shadow: 0 2px 6px rgba(50, 40, 20, 0.12); }
.minimap-show { position: absolute; right: 0.8rem; bottom: 0.8rem; z-index: 6; min-height: 36px; padding: 0.3rem 0.8rem; font-size: 0.88rem; font-weight: 600; border-radius: 999px; background: rgba(255, 255, 255, 0.96); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(50, 40, 20, 0.12); cursor: pointer; }
@media (max-width: 700px) {
  .tree-minimap canvas { width: 140px; height: 91px; }
  .fs-toggle-wrap button .icon-label > span:last-child { display: none; }
  .tree-float .layouts { order: 1; flex: 1 1 100%; justify-content: flex-end; }
  .tree-stage .tree-view { padding-top: 7.4rem; }
  .tree-stage.is-fullscreen .tree-float { top: 0.4rem; }
  .tree-stage.is-fullscreen .tree-view { padding-top: 7.4rem; }
  .fs-find input { width: 9rem; }
}
@media print { .tree-minimap, .minimap-show, .fs-only, .fs-toggle-wrap { display: none !important; } .tree-stage .tree-view { max-height: none !important; overflow: visible !important; } }
body.printing-tree .tree-stage .tree-view { max-height: none !important; overflow: visible !important; }

/* ------------------------------------------------------------------ */
/* Site admin: side menu, overview cards, tables                       */
/* ------------------------------------------------------------------ */
main:has(> .admin-shell) { width: min(1440px, calc(100% - 2rem)); padding-top: 1rem; }
.admin-shell { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.admin-menu-toggle { display: none; }
.admin-nav { position: sticky; top: 5.5rem; display: grid; gap: 0; padding: 0.6rem; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); max-height: calc(100vh - 7rem); overflow-y: auto; }
.admin-nav-brand { display: flex; align-items: center; gap: 0.5rem; margin: 0.1rem 0.5rem 0.4rem; font-family: Fraunces, Georgia, serif; font-size: 1.1rem; color: var(--green-deep); }
.admin-nav-group { margin: 0.55rem 0.7rem 0.1rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.admin-nav a { display: flex; align-items: center; min-height: 34px; padding: 0.25rem 0.7rem; border-radius: 11px; color: var(--ink); text-decoration: none; font-weight: 500; }
.admin-nav a .icon { color: var(--green); opacity: 0.8; }
.admin-nav a:hover { background: var(--cream); }
.admin-nav a.on { background: var(--green); color: #fff; font-weight: 600; }
.admin-nav a.on .icon { opacity: 1; color: #fff; }
.admin-nav-badge { margin-left: auto; min-width: 1.35rem; padding: 0.05rem 0.4rem; border-radius: 999px; background: #c44; color: #fff; font-size: 0.72rem; font-weight: 700; text-align: center; line-height: 1.35; }
.admin-nav a.on .admin-nav-badge { background: #fff; color: var(--green-deep); }
.admin-nav-back { margin: 0.2rem 0 0.5rem; background: var(--leaf); color: var(--green-deep) !important; font-weight: 600; }
.admin-nav-back:hover { background: #dfe9d4 !important; }
.admin-attention-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.admin-attention-list a { display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.55rem 0.65rem; border-radius: 12px; text-decoration: none; color: var(--ink); background: var(--cream); }
.admin-attention-list a:hover { background: var(--leaf); }
.admin-attention-list .admin-row-main { display: grid; gap: 0.1rem; min-width: 0; flex: 1; }
.admin-attention-list .admin-row-main small { color: var(--muted); }
.admin-attention-mark { flex: none; width: 10px; height: 10px; margin-top: 0.45rem; border-radius: 50%; background: #c98a1f; box-shadow: 0 0 0 3px #f8ead0; }
.admin-attention-list .level-urgent .admin-attention-mark { background: #c44; box-shadow: 0 0 0 3px #f8dede; }
.admin-attention-list .level-setup .admin-attention-mark { background: var(--muted); box-shadow: 0 0 0 3px #e8ebe9; }
.admin-attention-go { flex: none; align-self: center; font-size: 0.85rem; font-weight: 600; color: var(--green-deep); }
.admin-attention-card .admin-note { margin-top: 0.6rem; }
.admin-main { min-width: 0; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin: 0 0 1.1rem; }
.admin-head h1 { font-size: clamp(1.7rem, 2.6vw, 2.2rem); margin: 0; }
.admin-sub { margin: 0.25rem 0 0; color: var(--muted); }
.admin-search { display: flex; gap: 0.4rem; align-items: center; }
.admin-search input { min-width: 16rem; min-height: 42px; }
.admin-card { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 1.1rem 1.25rem; margin: 0 0 1rem; box-shadow: 0 6px 20px rgba(50, 40, 20, 0.04); }
.admin-card h2 { font-size: 1.2rem; margin: 0 0 0.7rem; }
.admin-card .panel { margin: 0; padding: 0; box-shadow: none; border: 0; background: none; }
.admin-main > .panel { background: white; border: 1px solid var(--line); border-radius: 18px; margin: 0 0 1rem; }
.admin-main > .panel > h2:first-child { display: none; }
.admin-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.admin-card-head a { font-size: 0.92rem; font-weight: 500; }
.admin-quiet { background: var(--cream); box-shadow: none; }
.admin-quiet h2 { font-size: 1.05rem; }
.admin-form-card { max-width: 46rem; }
.admin-note { font-size: 0.93rem; color: var(--muted); margin: 0.3rem 0 0.9rem; }
.admin-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; margin: 0 0 1rem; }
.admin-stat { display: grid; gap: 0.15rem; padding: 1rem 1.1rem; background: white; border: 1px solid var(--line); border-radius: 18px; text-decoration: none; color: var(--ink); box-shadow: 0 6px 20px rgba(50, 40, 20, 0.04); transition: border-color 0.15s ease, transform 0.15s ease; }
.admin-stat:hover { border-color: var(--green); transform: translateY(-1px); }
.admin-stat-label { font-size: 0.9rem; color: var(--muted); }
.admin-stat strong { font-family: Fraunces, Georgia, serif; font-size: 2.1rem; font-weight: 560; line-height: 1.1; }
.admin-stat-note { font-size: 0.85rem; color: var(--muted); }
.admin-stat-note.good { color: var(--green); font-weight: 500; }
.admin-checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; }
.admin-checks a { display: flex; align-items: center; gap: 0.55rem; min-height: 44px; padding: 0.5rem 0.75rem; border-radius: 12px; background: var(--cream); color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.admin-checks a:hover { background: var(--leaf); }
.admin-check-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: #c98a1f; box-shadow: 0 0 0 3px #f8ead0; }
.admin-checks .ok .admin-check-dot { background: var(--green); box-shadow: 0 0 0 3px var(--leaf); }
.admin-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.admin-columns-wide { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.admin-stack > .admin-card:last-child { margin-bottom: 0; }
.admin-rows, .admin-events { list-style: none; margin: 0; padding: 0; }
.admin-rows li, .admin-events li { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; padding: 0.55rem 0; border-top: 1px solid var(--line); }
.admin-rows li:first-child, .admin-events li:first-child { border-top: 0; }
.admin-rows a { display: flex; align-items: center; gap: 0.65rem; min-width: 0; color: var(--ink); text-decoration: none; }
.admin-rows a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.admin-row-main { display: grid; min-width: 0; }
.admin-row-main small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-rows time, .admin-events time { flex: none; color: var(--muted); font-size: 0.88rem; }
.admin-events li > span { min-width: 0; }
.admin-events li.warn > span { color: #9b3b2c; }
.admin-avatar { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--leaf); color: var(--green-deep); font-weight: 600; font-size: 0.85rem; }
.admin-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.9rem; }
.admin-filters a { padding: 0.35rem 0.85rem; min-height: 36px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.92rem; }
.admin-filters a:hover { border-color: var(--green); }
.admin-filters a.on { background: var(--green-deep); border-color: var(--green-deep); color: white; }
.admin-filter-form { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin: 0 0 0.9rem; }
.admin-filter-form label { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.admin-filter-form select { min-width: 14rem; }
.admin-table-wrap { background: white; border: 1px solid var(--line); border-radius: 18px; overflow-x: auto; box-shadow: 0 6px 20px rgba(50, 40, 20, 0.04); margin: 0 0 1rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.admin-table th { text-align: left; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: #f8f5ee; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table th a { color: inherit; text-decoration: none; }
.admin-table th a.on { color: var(--green-deep); }
.admin-table th a.on::after { content: " ▾"; }
.admin-table td { padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover td { background: #fafcfb; }
.admin-table tr.warn td { background: #fdf3f1; }
.admin-person { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; }
.admin-person:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.admin-badge { margin-left: 0.4rem; font-size: 0.72rem; font-weight: 600; padding: 0.1rem 0.45rem; border-radius: 999px; background: var(--green-deep); color: white; vertical-align: middle; }
.admin-pill { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 0.15rem 0.55rem; border-radius: 999px; }
.admin-pill.ok { background: var(--leaf); color: var(--green-deep); }
.admin-pill.off { background: #fbe7e3; color: #8a2f22; }
.admin-pill.plan { background: #f8ead0; color: #6b4a12; }
.admin-detail { max-width: 22rem; color: var(--muted); overflow-wrap: anywhere; }
.admin-ip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; color: var(--muted); }
.admin-pager { display: flex; align-items: center; justify-content: center; gap: 0.8rem; margin: 0 0 1rem; color: var(--muted); }
.admin-manual .manual-toc { margin-top: 0; }
@media (max-width: 1100px) {
  .admin-stats, .admin-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-columns, .admin-columns-wide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  main:has(> .admin-shell) { width: calc(100% - 1.5rem); }
  .admin-shell { grid-template-columns: minmax(0, 1fr); gap: 0.8rem; }
  .admin-menu-toggle { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; width: 100%; min-height: 46px; padding: 0.5rem 0.9rem; border: 1px solid var(--line); border-radius: 14px; background: white; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
  .admin-menu-current { margin-left: auto; color: var(--green-deep); font-weight: 500; }
  .admin-menu-current::after { content: " ▾"; }
  .admin-nav { display: none; position: static; max-height: none; box-shadow: none; }
  .admin-shell.menu-open .admin-nav { display: grid; }
  .admin-search { width: 100%; }
  .admin-search label { flex: 1; }
  .admin-search input { min-width: 0; width: 100%; }
  .admin-head { align-items: stretch; }
}
@media (max-width: 640px) {
  .admin-stats { gap: 0.6rem; }
  .admin-stat { padding: 0.8rem 0.9rem; }
  .admin-stat strong { font-size: 1.7rem; }
  .admin-checks { grid-template-columns: minmax(0, 1fr); }
  /* Tables become one card per row on phones. */
  .admin-table-wrap { background: none; border: 0; box-shadow: none; overflow: visible; }
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 0.5rem 0.9rem; margin: 0 0 0.6rem; }
  .admin-table td { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; border-bottom: 1px solid var(--line); text-align: right; }
  .admin-table td:first-child { justify-content: flex-start; text-align: left; }
  .admin-table td:last-child { border-bottom: 0; }
  .admin-table td[data-label]:not(:first-child)::before { content: attr(data-label); color: var(--muted); font-size: 0.85rem; text-align: left; flex: none; }
  .admin-table td[colspan] { display: block; text-align: left; }
  .admin-detail { max-width: none; }
}
.admin-head-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.admin-row-actions { display: flex; gap: 0.4rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.admin-row-actions form { margin: 0; }
.admin-meter { display: inline-block; width: 100%; max-width: 12rem; height: 8px; border-radius: 999px; background: var(--leaf); overflow: hidden; vertical-align: middle; }
.admin-meter > span { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.admin-meter.warn > span { background: #c98a1f; }
.admin-stat .admin-meter { max-width: none; margin: 0.2rem 0 0.1rem; }
.admin-meter-cell { white-space: nowrap; }
.admin-meter-cell .admin-meter { width: 8rem; margin-right: 0.4rem; }
.admin-flat { box-shadow: none; margin: 0; }
.admin-field-note { margin: -0.5rem 0 0.2rem; font-size: 0.88rem; }
.admin-live-note { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 0.6rem 0.9rem; margin: 0 0 1rem; border-radius: 14px; background: #fff7e6; border: 1px solid #f0d9a8; }
.admin-privacy li { align-items: flex-start; }
.admin-privacy li.warn strong { color: #9b3b2c; }
.admin-privacy-side { display: grid; justify-items: end; gap: 0.35rem; }
.admin-privacy-side form { margin: 0; }
.admin-rows li > strong { text-align: right; }
.announce { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 1rem; padding: 0.7rem 0.8rem 0.7rem 1rem; border-radius: 14px; background: var(--leaf); border: 1px solid #cfdcc2; color: var(--green-deep); font-weight: 500; }
.announce > span { flex: 1; }
.announce-important { background: #fff4dc; border-color: #f0d9a8; color: #5b3d07; }
.announce-close { flex: none; width: 32px; height: 32px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.7); font-size: 1.2rem; line-height: 1; cursor: pointer; color: inherit; }
.auth-panel .announce, .landing main > .announce { margin: 1rem 0; }
/* Free-trial messages (v1.11): newest unread note, or the countdown before trees become look-only. */
.trial-banner { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin: 0 0 1rem; padding: 0.8rem 0.8rem 0.8rem 1rem; border-radius: 14px; background: var(--leaf); border: 1px solid #cfdcc2; color: var(--green-deep); }
.trial-banner > div { flex: 1 1 260px; display: grid; gap: 0.2rem; }
.trial-banner > div span { font-size: 0.95rem; color: #3d5246; }
.trial-banner form { margin: 0; }
.trial-countdown { background: #fff4dc; border-color: #f0d9a8; color: #5b3d07; }
.trial-countdown > div span { color: #6b5320; }
.trial-notices { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.9rem; }
.trial-notices li { padding-bottom: 0.9rem; border-bottom: 1px solid var(--line, #e3e8e4); }
.trial-notices li:last-child { border-bottom: 0; padding-bottom: 0; }
.trial-notices p { margin: 0.25rem 0; }
.trial-followup li { flex-wrap: wrap; }
.trial-followup-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.admin-switches { border: 1px solid var(--line, #e3e8e4); border-radius: 12px; padding: 0.8rem 1rem; display: grid; gap: 0.45rem; }
.admin-switches legend { font-weight: 600; padding: 0 0.3rem; }
.admin-switches label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.admin-switches label.check input { width: auto; }
@media (max-width: 640px) {
  .admin-meter-cell .admin-meter { width: 5rem; }
  .admin-row-actions { justify-content: flex-start; }
  .admin-head-actions { width: 100%; }
}

/* Languages: the menu in the header, the one-time offer, and fonts for other scripts. */
.lang-menu { position: relative; }
.lang-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > div { position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 80; min-width: 13rem; display: grid; gap: 0.1rem; padding: 0.4rem; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(50, 40, 20, 0.16); }
.lang-menu a { display: grid; padding: 0.45rem 0.7rem; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.lang-menu a small { color: var(--muted); font-weight: 400; font-size: 0.82rem; }
.lang-menu a:hover { background: var(--cream); }
.lang-menu a[aria-current] { background: var(--leaf); color: var(--green-deep); }
.lang-panel > div { right: auto; left: 0; }
.lang-offer { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 0 0 1rem; padding: 0.6rem 0.8rem 0.6rem 1rem; border-radius: 14px; background: white; border: 1px solid var(--line); box-shadow: 0 6px 20px rgba(50, 40, 20, 0.06); font-weight: 500; }
.lang-offer > span { flex: 1; min-width: 12rem; }
.lang-offer .icon { color: var(--green); }
@media (max-width: 700px) {
  .lang-header .lang-current { display: none; }
  .lang-menu > summary { padding-inline: 0.6rem; }
}
html:lang(zh-Hans) body, html:lang(zh-Hans) :is(button, input, select, textarea) { font-family: Figtree, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; }
html:lang(zh-Hant) body, html:lang(zh-Hant) :is(button, input, select, textarea) { font-family: Figtree, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif; }
html:lang(ja) body, html:lang(ja) :is(button, input, select, textarea) { font-family: Figtree, "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif; }
html:lang(th) body, html:lang(th) :is(button, input, select, textarea) { font-family: Figtree, "IBM Plex Sans Thai Looped", "Sarabun", "Leelawadee UI", Tahoma, sans-serif; line-height: 1.6; }
html:lang(hi) body, html:lang(hi) :is(button, input, select, textarea) { font-family: Figtree, "Noto Sans Devanagari", Mangal, "Nirmala UI", "Hind Siliguri", sans-serif; line-height: 1.55; }
/* Headings: Chinese in serif, like Fraunces in English; Japanese and Thai in their text font, bolder. */
html:lang(zh-Hans) :is(h1, h2, h3) { font-family: Fraunces, "Noto Serif SC", "Songti SC", SimSun, serif; }
html:lang(zh-Hant) :is(h1, h2, h3) { font-family: Fraunces, "Noto Serif TC", "Songti TC", PMingLiU, serif; }
html:lang(ja) :is(h1, h2, h3) { font-family: Fraunces, "Zen Maru Gothic", "Hiragino Maru Gothic ProN", sans-serif; }
html:lang(th) :is(h1, h2, h3) { font-family: Fraunces, "IBM Plex Sans Thai Looped", "Sarabun", Tahoma, sans-serif; }
html:lang(hi) :is(h1, h2, h3) { font-family: Fraunces, "Noto Serif Devanagari", "Noto Sans Devanagari", Mangal, "Nirmala UI", serif; }
html:is(:lang(zh-Hans), :lang(zh-Hant), :lang(ja), :lang(th), :lang(hi)) :is(h1, h2, h3) { letter-spacing: 0; font-weight: 700; }
.admin-words td:first-child { width: 42%; color: var(--ink); }
.admin-words textarea { width: 100%; min-height: 2.6rem; resize: vertical; }
.admin-badge-soft { display: inline-block; margin-top: 0.2rem; font-size: 0.75rem; font-weight: 600; color: var(--green-deep); background: var(--leaf); padding: 0.05rem 0.45rem; border-radius: 999px; }
/* The language button stays visible even where small grey buttons are hidden on phones. */
.lang-menu > summary.btn { display: inline-flex !important; }
@media (max-width: 700px) {
  .lang-menu > div { position: fixed; top: 4.4rem; left: 0.75rem; right: 0.75rem; min-width: 0; max-height: calc(100vh - 6rem); overflow-y: auto; }
}

/* Banyan's own social pages, above the footer links. */
.social-links { display: flex; justify-content: center; gap: 0.6rem; margin: 0 0 0.5rem; }
.social-link { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: white; color: var(--green-deep); text-decoration: none; transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.social-link:hover { background: var(--green-deep); border-color: var(--green-deep); color: white; }
.social-link .icon { width: 20px; height: 20px; }
.social-missing { opacity: 0.45; border-style: dashed; }
.auth-panel .social-links { margin-top: 0.8rem; }
/* LINE's own green, so people recognise it. */
.btn.share-line { background: #06c755; border-color: #06c755; color: white; }
.btn.share-line:hover { background: #05a847; border-color: #05a847; color: white; }
/* Longer words in other languages: the role under your name shortens with “…” instead of stacking. */
.account-chip .who-name, .account-chip .who-roles { display: block; max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) {
  .lang-header .lang-current { display: none; }
  .lang-header > summary { padding-inline: 0.65rem; }
  .account-chip .who-name, .account-chip .who-roles { max-width: 8rem; }
}
/* Every language by name in the footer, as a way back for anyone lost in a language they cannot read. */
.lang-footer { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.15rem 0.3rem; margin: 0 auto 0.6rem; max-width: 46rem; font-size: 0.9rem; color: var(--muted); }
.lang-footer .icon { width: 16px; height: 16px; margin-right: 0.2rem; color: var(--green); }
.lang-footer a { color: var(--ink); text-decoration: none; padding: 0.2rem 0.15rem; border-radius: 6px; }
.lang-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.lang-footer strong { color: var(--green-deep); font-weight: 600; padding: 0.2rem 0.15rem; }
.auth-panel .lang-footer { margin-top: 0.4rem; }

/* Ask a relative, invite from a card, the question of the week, birthday wishes. */
.ask-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.3rem 1rem; }
.ask-quote { margin: 0.6rem 0 1rem; padding: 0.9rem 1.1rem; border-left: 4px solid var(--green); background: var(--leaf); border-radius: 0 14px 14px 0; font-size: 1.15rem; font-weight: 500; color: var(--green-deep); }
.ask-answer { padding: 1rem 0; border-top: 1px solid var(--line); }
.ask-answer:first-of-type { border-top: 0; }
.ask-reply { font-size: 1.05rem; white-space: normal; }
.ask-answer .row-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.ask-answer .row-actions form { margin: 0; }
.ask-banner .icon { color: var(--green); vertical-align: -3px; }
.invite-person { display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem 1rem; border-radius: 16px; background: #fffdf3; border: 2px solid #f3c64f; }
.invite-person strong { display: block; font-size: 1.15rem; }
.invite-person small { color: var(--muted); }
.invite-person .muted { margin: 0; font-size: 0.88rem; }
.weekly-question-text { font-size: 1.1rem; font-weight: 500; margin: 0 0 0.7rem; }
.wishes { display: inline-flex; gap: 0.35rem; margin-left: 0.4rem; vertical-align: middle; }
.wishes .btn { min-height: 32px; padding: 0.2rem 0.7rem; font-size: 0.88rem; }
.btn.share-whatsapp:not(.primary):not(.quiet) { background: #25d366; border-color: #25d366; color: #fff; }
.occasion-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 0.3rem; }
.birthday-today { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.translated-note { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; padding: 0.55rem 0.8rem; margin: 0 0 1rem; border-radius: 12px; background: var(--cream); color: var(--muted); font-size: 0.92rem; }
.translated-note .icon { color: var(--green); }
/* Free memberships (v1.14) */
.free-plan-note { margin: 0 0 1rem; padding: 0.85rem 1rem; border-radius: 14px; background: var(--leaf); border: 1px solid #cfdcc2; color: var(--green-deep); }
.free-plan-note p { margin: 0.25rem 0 0; color: #3d5246; }
.admin-free-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
@media (min-width: 1101px) { .admin-stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
/* Admin → People (v1.14.1): filters, bulk bar, sorting, paging, contacts */
.admin-people-filters { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: end; margin: 0 0 0.8rem; }
.admin-people-filters label { display: grid; gap: 0.2rem; font-size: 0.85rem; color: var(--muted); }
.admin-people-filters select { min-width: 10rem; }
.admin-showing { margin: 0.2rem 0 0.6rem; color: var(--muted); font-size: 0.9rem; }
.admin-people-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.6rem; }
.admin-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.admin-pager a:not(.btn), .admin-pager-on { min-width: 2.1rem; text-align: center; padding: 0.3rem 0.5rem; border-radius: 8px; text-decoration: none; }
.admin-pager-on { background: var(--green-deep, #14382a); color: white; font-weight: 600; }
.admin-pager-gap { color: var(--muted); }
.admin-table th a.admin-sort.on::after { content: none; }
.admin-check { width: 2.2rem; }
.admin-check input { width: 1.1rem; height: 1.1rem; }
.admin-contacts { display: grid; gap: 0.2rem; }
.admin-contact { display: inline-flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.admin-copy { border: 0; background: none; padding: 0.15rem; min-height: 0; cursor: pointer; color: var(--muted); border-radius: 6px; line-height: 0; }
.admin-copy:hover { color: var(--green-deep); background: #eef5f0; }
.admin-copy.copied { color: #2e5b43; }
.admin-copy svg { width: 15px; height: 15px; }
.admin-bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; padding: 0.7rem 0.9rem; margin: 0 0 0.8rem; background: #eef6f1; border: 1px solid #cfdcc2; border-radius: 14px; }
.admin-bulk-bar[hidden] { display: none; }
.admin-bulk-bar label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; }
.admin-bulk-bar label[hidden] { display: none; }
.admin-bulk-bar input[name="confirm"] { width: 7rem; }
.linklike { border: 0; background: none; padding: 0; min-height: 0; color: var(--green-deep); text-decoration: underline; cursor: pointer; font: inherit; }
.admin-email-list { width: 100%; font-family: ui-monospace, monospace; font-size: 0.9rem; margin: 0 0 0.8rem; }
@media (max-width: 640px) {
  .admin-people td.admin-check { position: absolute; border: 0; width: auto; padding: 0; }
  .admin-people tr { position: relative; padding-left: 2.6rem !important; }
  .admin-people td.admin-check { left: 0.9rem; top: 0.95rem; }
  .admin-bulk-bar { position: fixed; left: 0.6rem; right: 0.6rem; bottom: 0.6rem; z-index: 40; box-shadow: 0 10px 30px rgba(50, 40, 20, 0.18); margin: 0; }
  body.bulk-open { padding-bottom: 9rem; }
  .admin-people-filters select { min-width: 0; width: 100%; }
  .admin-people-filters label { flex: 1 1 8rem; }
}
.admin-people .admin-pill { white-space: nowrap; }
.admin-people td[data-label="Contact"] { min-width: 15rem; }
@media (max-width: 640px) {
  .admin-people td[data-label="Contact"] { display: grid; justify-content: stretch; text-align: left; min-width: 0; gap: 0.3rem; }
  .admin-people td[data-label="Contact"]::before { margin-bottom: 0.1rem; }
  .admin-people .admin-contact { overflow-wrap: anywhere; }
}
body.bulk-open .update-note { display: none !important; }
/* Admin → People quick view, notes and undo (v1.14.2) */
.admin-quick-veil { position: fixed; inset: 0; background: rgba(15, 30, 22, 0.35); z-index: 60; }
.admin-quick-veil[hidden], .admin-quick[hidden] { display: none; }
.admin-quick { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: white; z-index: 61; box-shadow: -12px 0 40px rgba(50, 40, 20, 0.18); overflow-y: auto; padding: 1.2rem 1.2rem 2rem; }
.admin-quick-close { position: sticky; top: 0; float: right; width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: white; font-size: 1.3rem; line-height: 1; cursor: pointer; z-index: 2; }
.admin-quick-head { display: flex; gap: 0.8rem; align-items: center; margin: 0 2.5rem 0.8rem 0; }
.admin-quick-head h2 { margin: 0; font-size: 1.3rem; }
.admin-quick-head p { margin: 0.15rem 0 0; }
.admin-quick h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 1.1rem 0 0.4rem; }
.admin-quick-facts { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 0.9rem; margin: 0; }
.admin-quick-facts dt { color: var(--muted); font-size: 0.9rem; }
.admin-quick-facts dd { margin: 0; overflow-wrap: anywhere; }
.admin-quick-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.3rem; }
.admin-quick-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.admin-quick-actions form { margin: 0; }
.admin-quick .admin-person-notes { box-shadow: none; padding: 0; border: 0; margin-top: 1rem; }
body.quick-open { overflow: hidden; }
.admin-notes-list { list-style: none; padding: 0; margin: 0.8rem 0 0; display: grid; gap: 0.6rem; }
.admin-notes-list li { padding: 0.6rem 0.75rem; background: #f8f5ee; border-radius: 10px; }
.admin-notes-list p { margin: 0 0 0.2rem; }
.admin-notes-list form { display: inline; margin-left: 0.5rem; }
.admin-note-flag { display: inline-flex; align-items: center; gap: 0.15rem; margin-left: 0.4rem; font-size: 0.8rem; color: var(--muted); vertical-align: middle; }
.admin-note-flag svg { width: 14px; height: 14px; }
.admin-undo { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; justify-content: space-between; padding: 0.6rem 0.9rem; margin: 0 0 0.8rem; background: #fff4dc; border: 1px solid #f0d9a8; border-radius: 14px; color: #5b3d07; }
@media (max-width: 640px) {
  .admin-quick { top: auto; left: 0; width: 100%; max-height: 88vh; border-radius: 18px 18px 0 0; box-shadow: 0 -12px 40px rgba(50, 40, 20, 0.2); }
}
.admin-pill.warn { background: #fff4dc; color: #6b4a12; }
.admin-family-link { color: inherit; text-decoration: none; } .admin-family-link:hover strong { text-decoration: underline; color: var(--green-deep); }
/* Security log (v1.15) */
.admin-chain { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.9rem; border-radius: 12px; margin: 0 0 0.9rem; font-size: 0.92rem; }
.admin-chain.ok { background: var(--leaf); color: var(--green-deep); }
.admin-chain.bad { background: #fbe7e3; color: #8a2f22; font-weight: 600; }
.admin-chain svg { width: 16px; height: 16px; }
.admin-security-filters input[type="search"] { min-width: 14rem; }
.admin-changes { color: #6b4a12; font-size: 0.88rem; }
.admin-only-link { text-decoration: none; color: var(--muted); font-size: 0.85rem; }
.admin-event-place { display: block; color: var(--muted); font-size: 0.82rem; }
.admin-h3-link { font-size: 0.8rem; text-transform: none; letter-spacing: 0; margin-left: 0.4rem; }
.account-activity { list-style: none; padding: 0; margin: 0 0 0.8rem; display: grid; gap: 0.5rem; }
.account-activity li { display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; align-items: center; padding: 0.5rem 0.7rem; background: #f8f5ee; border-radius: 10px; }
.account-activity li span { color: var(--muted); font-size: 0.92rem; }
.btn.danger { background: #a3352a; border-color: #a3352a; color: white; }
/* Admin Guide (v1.16) */
.admin-head-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.guide-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.guide-nav { position: sticky; top: 1rem; background: white; border: 1px solid var(--line); border-radius: 16px; padding: 0.8rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
.guide-nav ul { list-style: none; padding: 0; margin: 0 0 0.6rem; }
.guide-nav li a { display: block; padding: 0.32rem 0.55rem; border-radius: 8px; text-decoration: none; color: inherit; font-size: 0.93rem; line-height: 1.3; }
.guide-nav li a:hover { background: #f3efe5; }
.guide-nav li a.on { background: var(--leaf); color: var(--green-deep); font-weight: 600; }
.guide-group { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0.7rem 0.4rem 0.25rem; }
.guide-search input { width: 100%; }
.guide-results { list-style: none; padding: 0; margin: 0.5rem 0; }
.guide-results[hidden] { display: none; }
.guide-results li a { display: block; padding: 0.4rem 0.55rem; border-radius: 8px; text-decoration: none; color: inherit; }
.guide-results li a:hover { background: #f3efe5; }
.guide-results small { display: block; color: var(--muted); font-size: 0.8rem; }
.guide-page { max-width: 860px; line-height: 1.6; }
.guide-page h2 { font-size: 1.7rem; margin: 0.1rem 0 0.3rem; }
.guide-page h3 { margin: 1.4rem 0 0.4rem; font-size: 1.12rem; }
.guide-page ol, .guide-page ul { padding-left: 1.3rem; }
.guide-page li { margin: 0.3rem 0; }
.guide-crumb { margin: 0; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.guide-lede { font-size: 1.08rem; color: #3d5246; margin: 0 0 1rem; }
.guide-figure { margin: 1rem 0 1.3rem; }
.guide-figure img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 20px rgba(50, 40, 20, 0.08); display: block; }
.guide-figure figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 0.45rem; }
.guide-prevnext { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 1.6rem; padding-top: 0.9rem; }
.guide-prevnext .next { margin-left: auto; }
.guide-updated { font-size: 0.85rem; margin-top: 0.8rem; }
.guide-technical-note { background: #fff4dc; border: 1px solid #f0d9a8; color: #5b3d07; border-radius: 12px; padding: 0.7rem 0.9rem; }
.guide-technical code { background: #f3f5f4; padding: 0.05rem 0.3rem; border-radius: 5px; font-size: 0.9em; }
.guide-toc > summary { display: none; }
@media (max-width: 1199px) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); }
  .guide-nav { position: static; max-height: none; padding: 0.4rem 0.8rem; }
  .guide-toc > summary { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; padding: 0.45rem 0.2rem; font-weight: 600; list-style: none; }
  .guide-toc > summary::-webkit-details-marker { display: none; }
  .guide-toc[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 0.5rem; }
}
@media print {
  .admin-nav, .admin-menu-toggle, .guide-nav, .admin-head-tools, .guide-prevnext, header.top, footer, .update-note { display: none !important; }
  .guide-layout { display: block; }
  .guide-page { box-shadow: none; border: 0; max-width: none; }
  .guide-figure { break-inside: avoid; }
}
/* The country button is as tall as the number box beside it. */
.phone-field { align-items: stretch; }
.phone-field .phone-code { display: flex; }
.phone-field .phone-code-btn { height: 100%; }
/* Text boxes and dropdowns are exactly the same height, so fields side by side line up. */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]), select { line-height: 1.4; min-height: 3.1em; }
/* Profile photos in admin (v1.17) */
.admin-avatar.has-photo { padding: 0; overflow: hidden; background: #e9efeb; }
.admin-avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-avatar-sm { width: 26px; height: 26px; font-size: 0.7rem; vertical-align: middle; display: inline-grid; }
.admin-avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; flex: none; }
.admin-quick-head .admin-avatar-lg { width: 56px; height: 56px; }
.admin-photo-row { display: flex; gap: 1rem; align-items: flex-start; }
.admin-photo-row p { margin: 0 0 0.5rem; }
.admin-photo-card .admin-avatar-lg { width: 96px; height: 96px; font-size: 1.8rem; }
/* Home page: the memories banner (v1.18). Photo prints of a made-up family like the visitor's own. */
.landing-memories { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 500px); align-items: center; gap: 1.5rem; margin-top: 1rem; padding: 2.2rem 2.4rem; border-radius: 28px; background: #fbf5ea; color: #3b2a14; overflow: hidden; }
.landing-memories h2 { color: #3b2a14; font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin: 0 0 0.6rem; text-wrap: balance; }
.landing-memories p { color: #6b5320; max-width: 34rem; margin: 0 0 1.2rem; }
.memories-wall { position: relative; height: 300px; }
.memories-print { position: absolute; margin: 0; background: #fff; padding: 10px 10px 38px; border-radius: 3px; box-shadow: 0 12px 28px rgba(60, 40, 10, 0.18); transition: transform 0.35s ease; }
.memories-print:nth-of-type(1) { left: 10px; top: 24px; transform: rotate(-6deg); }
.memories-print:nth-of-type(2) { left: 170px; top: 6px; transform: rotate(4deg); z-index: 2; }
.memories-print:nth-of-type(3) { left: 330px; top: 56px; transform: rotate(-3deg); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .memories-print:nth-of-type(1):hover { transform: rotate(-3deg) translateY(-6px); }
  .memories-print:nth-of-type(2):hover { transform: rotate(1deg) translateY(-6px); }
  .memories-print:nth-of-type(3):hover { transform: rotate(-1deg) translateY(-6px); }
}
.memories-photo { width: 150px; height: 150px; overflow: hidden; line-height: 0; filter: sepia(0.5) saturate(0.9) contrast(0.96); }
.memories-photo svg { width: 150px; height: 150px; }
.memories-print figcaption { position: absolute; left: 4px; right: 4px; bottom: 7px; text-align: center; font-family: Caveat, "Segoe Print", "Bradley Hand", cursive; font-size: 1.3rem; line-height: 1.1; color: #4b3a20; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.memories-voice { position: absolute; left: 70px; bottom: 6px; z-index: 3; display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.45rem 1rem 0.45rem 0.45rem; border-radius: 999px; background: #1f4331; color: #fff; text-decoration: none; font-size: 0.92rem; box-shadow: 0 10px 24px rgba(10, 40, 25, 0.25); }
.memories-voice:hover, .memories-voice:focus-visible { background: #2e5b43; color: #fff; }
.memories-mic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #e8b84a; color: #1f4331; }
.memories-mic svg { width: 16px; height: 16px; }
.memories-wave { width: 54px; height: 14px; background: repeating-linear-gradient(90deg, #9fd1b6 0 3px, transparent 3px 6px); -webkit-mask: linear-gradient(#000 0 0) bottom / 100% 40% no-repeat, linear-gradient(#000 0 0) bottom / 100% 100% no-repeat; opacity: 0.85; clip-path: polygon(0 60%, 10% 20%, 20% 70%, 30% 0, 40% 50%, 50% 10%, 60% 65%, 70% 25%, 80% 55%, 90% 15%, 100% 60%, 100% 100%, 0 100%); }
.memories-time { color: #cfe8da; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .landing-memories { grid-template-columns: minmax(0, 1fr); padding: 1.8rem 1.3rem; text-align: center; }
  .landing-memories p { margin-left: auto; margin-right: auto; }
  /* On phones one photo at a time; it changes every few seconds, or when tapped. */
  .memories-wall { height: 290px; max-width: 320px; margin: 0 auto; width: 100%; }
  .memories-print { left: 50% !important; top: 8px !important; transform: translateX(-50%) rotate(-3deg) !important; opacity: 0; visibility: hidden; transition: opacity 0.6s ease, visibility 0s linear 0.6s; pointer-events: none; }
  .memories-print.is-current { opacity: 1; visibility: visible; transition: opacity 0.6s ease, visibility 0s; pointer-events: auto; z-index: 2; }
  .memories-voice { left: 50%; transform: translateX(-50%); bottom: 4px; white-space: nowrap; }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) { .memories-print { transition: none; } }
.admin-memory-words { display: flex; flex-wrap: wrap; align-items: end; gap: 0.4rem 0.6rem; margin: 0.4rem 0; }
.admin-memory-words > .muted { width: 100%; font-size: 0.8rem; }
.admin-memory-words label { display: grid; gap: 0.15rem; font-size: 0.78rem; color: var(--muted); flex: 1 1 6.5rem; min-width: 0; }
.admin-memory-words input { min-height: 0; padding: 0.4rem 0.55rem; font-size: 0.92rem; }
.admin-memory-captions { font-family: Caveat, cursive; font-size: 1.05rem; }
/* Handwriting for captions in each script: Caveat for Latin letters, then the language's own. */
html:lang(th) .memories-print figcaption { font-family: Caveat, Mali, cursive; font-size: 1.15rem; }
html:lang(ja) .memories-print figcaption { font-family: Caveat, "Klee One", cursive; font-size: 1.05rem; }
html:lang(zh-Hans) .memories-print figcaption { font-family: Caveat, "Ma Shan Zheng", cursive; font-size: 1.2rem; }
html:lang(zh-Hant) .memories-print figcaption { font-family: Caveat, "LXGW WenKai TC", cursive; font-size: 1.1rem; }
html:lang(hi) .memories-print figcaption { font-family: Caveat, Kalam, cursive; font-size: 1.1rem; }
/* v1.18.1: the People quick view opens in the middle of the screen on a computer, in two columns. */
.admin-quick-head { flex-wrap: wrap; }
.admin-quick-head > div { flex: 1 1 auto; min-width: 0; }
.admin-quick-edit { margin-left: auto; }
.admin-quick-edit svg { width: 15px; height: 15px; }
.admin-quick-grid { display: grid; gap: 0 1.6rem; }
.admin-quick-col { min-width: 0; }
@media (min-width: 900px) {
  .admin-quick { top: 50%; left: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%); width: min(920px, 92vw); max-height: 86vh; border-radius: 22px; box-shadow: 0 30px 80px rgba(10, 30, 20, 0.3); padding: 1.4rem 1.6rem 1.6rem; }
  .admin-quick-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
  .admin-quick-head { margin-right: 2.8rem; }
}
.admin-row-edit { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: 0.3rem; border-radius: 8px; color: var(--muted); vertical-align: middle; }
.admin-row-edit:hover, .admin-row-edit:focus-visible { background: var(--leaf); color: var(--green-deep); }
.admin-row-edit svg { width: 15px; height: 15px; }
/* The Profile photo box at the top of the right column. */
.admin-stack > .admin-photo-card .admin-avatar-lg { width: 112px; height: 112px; font-size: 2rem; }
/* Admin → Emails (v1.19) */
.admin-emails-catalog { list-style: none; padding: 0; margin: 0; display: grid; }
.admin-emails-catalog li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 0.5rem 1rem; padding: 0.85rem 0; border-top: 1px solid var(--line); }
.admin-emails-catalog li:first-child { border-top: 0; }
.admin-email-main { flex: 1 1 26rem; min-width: 0; }
.admin-email-main p { margin: 0.25rem 0 0; font-size: 0.92rem; }
.admin-email-name { font-weight: 600; font-size: 1.02rem; margin-right: 0.4rem; text-decoration: none; }
.admin-email-side { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; font-size: 0.85rem; }
.admin-email-side svg { width: 14px; height: 14px; }
.admin-email-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .admin-email-editor { grid-template-columns: minmax(0, 1fr); } }
.admin-email-body-label { font-weight: 600; font-size: 0.95rem; margin-bottom: -0.5rem; }
.admin-email-toolbar { display: flex; flex-wrap: wrap; gap: 0.3rem; padding: 0.35rem; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; background: #f8f5ee; }
.admin-email-toolbar button { min-height: 0; padding: 0.3rem 0.6rem; border-radius: 8px; border: 1px solid transparent; background: transparent; font-size: 0.88rem; cursor: pointer; }
.admin-email-toolbar button:hover { background: white; border-color: var(--line); }
.admin-email-body { min-height: 240px; margin-top: -0.9rem; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 0 0 12px 12px; background: white; line-height: 1.6; outline: none; overflow-wrap: anywhere; }
.admin-email-body:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(46, 91, 67, 0.12); }
.admin-email-body h2 { font-size: 1.3rem; margin: 0 0 0.6rem; }
.admin-email-body a.button { display: inline-block; background: #2e5b43; color: white; padding: 0.45rem 1rem; border-radius: 999px; text-decoration: none; font-weight: 600; }
.admin-email-body blockquote { margin: 0 0 0.8rem; padding: 0.5rem 0.8rem; background: #f2f7f4; border-left: 3px solid var(--green); border-radius: 6px; }
.admin-email-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.admin-email-tags > .muted { width: 100%; font-size: 0.85rem; }
.admin-email-tag { min-height: 0; padding: 0.25rem 0.55rem; border-radius: 999px; border: 1px dashed #9fc6b0; background: #f2f8f4; font-family: ui-monospace, monospace; font-size: 0.8rem; cursor: pointer; }
.admin-email-tag.required { border-style: solid; border-color: #d98d7f; background: #fdf1ee; }
.admin-email-preview-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: space-between; }
.admin-email-preview-bar h2 { margin: 0; }
.admin-email-device { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.admin-email-device button { min-height: 0; border: 0; border-radius: 0; padding: 0.35rem 0.8rem; background: white; font-size: 0.85rem; cursor: pointer; }
.admin-email-device button.on { background: var(--green-deep); color: white; }
.admin-email-frame-wrap { display: flex; justify-content: center; background: #eef2f0; border-radius: 12px; padding: 0.6rem; }
.admin-email-frame-wrap iframe { width: 640px; max-width: 100%; height: 720px; border: 0; background: #f4f6f5; border-radius: 8px; transition: width 0.2s ease; }

/* Family settings: shared photo links (v1.20) */
.moment-links { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.moment-links li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 0; border-top: 1px solid var(--line, #dbe5df); }
.moment-links li form { flex: none; }

/* Admin Guide without the admin menu (v1.20.1): full width, like Help. */
.admin-shell.admin-shell-plain { display: block; max-width: 1180px; margin-inline: auto; }
.admin-back { margin: 0 0 0.6rem; }
.admin-back a { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; text-decoration: none; }
/* Section titles in the guide's page list: clearly headings, not links. */
.guide-group { font-size: 0.86rem; font-weight: 800; color: var(--ink); letter-spacing: 0.05em; margin: 1.1rem 0.4rem 0.4rem; padding-bottom: 0.3rem; border-bottom: 2px solid var(--green); }
.guide-nav .guide-group:first-of-type { margin-top: 0.5rem; }
@media print { .admin-back, .admin-head-tools { display: none !important; } }

/* v1.20.3: a "Saved" note fades but keeps its space, so nothing moves under a click. */
.flash.is-faded { opacity: 0; visibility: hidden; transition: opacity .4s ease, visibility 0s linear .4s; }
/* v1.20.3: "Invite someone" lands on the form with its heading clear of the sticky header. */
#invite { scroll-margin-top: 6rem; }

/* v1.20.3 small fixes */
/* The "own word" box and the current/former partner choice show only when they apply. */
#call-them:not(:has(input[name="call_as"][value="custom"]:checked)) .call-custom { display: none; }
#who-they-are:not(:has(input[name="relation"][value="partner"]:checked)) .partner-status { display: none; }
/* Phone: the view buttons wrap onto a second line instead of hiding under Family. */
@media (max-width: 860px) {
  .view-switch-wrap { flex-wrap: wrap; gap: 0.35rem; }
  .view-switch-wrap .view-switch { display: contents; }
  .view-switch-wrap .family-menu { flex: none; }
}

/* v1.21: someone further out */
.further-routes { display: grid; gap: 0.45rem; }
.further-routes .choice { justify-content: flex-start; text-align: left; }
.placeholder-note { margin-bottom: 1rem; }
.chart-lines .chart-ink path.sibling-line { stroke-dasharray: 6 5; }
/* v1.21.1: shorter edit form */
.died-group { display: grid; gap: 0.6rem; }
.died-group:not(:has(input[name="is_deceased"]:checked)) .died-year { display: none; }
.who-more > fieldset { margin-top: 0.6rem; }
.card-actions .add-group-label { min-width: 5.6rem; } /* v1.21.1: room for "Further out", so every row of buttons lines up */

/* v1.21.2: record a voice memory */
.voice-field { display: grid; gap: 0.5rem; }
.voice-label { font-weight: 600; }
.voice-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.voice-controls audio { width: 100%; max-width: 22rem; }
.voice-file span { display: block; font-size: 0.9rem; color: var(--muted); margin-bottom: 0.25rem; }
.voice-stop { animation: rec-pulse 1.4s ease-in-out infinite; }
@keyframes rec-pulse { 50% { opacity: 0.75; } }
@media (prefers-reduced-motion: reduce) { .voice-stop { animation: none; } }
#edit-form { scroll-margin-top: 5.5rem; }
.viewer-note { display: block; flex-basis: 100%; font-size: 0.92rem; }
.remove-person { margin-top: 2.2rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 0.92rem; }
[data-voice-recorder] [hidden] { display: none !important; }
.voice-stop { gap: 0.4rem; }

/* v1.22.1: folded sections on Family settings */
.family-help-panel summary, .profile-picks-more summary { font-weight: 600; }
.family-help-panel .fold-hint { margin: 0.35rem 0 0; }
.family-help-panel:has(details[open]) .fold-hint { display: none; }
.profile-picks-more[open] > summary { margin-bottom: 0.6rem; }
.profile-tap { color: inherit; text-decoration: none; border-bottom: 1px dotted color-mix(in srgb, var(--ink) 35%, transparent); }
.profile-tap:hover, .profile-tap:focus-visible { border-bottom-color: var(--green-deep); color: var(--green-deep); }
.banner .inline-form { display: inline; margin: 0; }
.banner .inline-form .btn { vertical-align: baseline; }

/* ------------------------------------------------------------------ */
/* Tree page, v1.27: a welcome band, underlined tabs, one toolbar,    */
/* a calm "paper" for the tree, and softer cards.                     */
/* ------------------------------------------------------------------ */
.page-head.tree-head {
  position: relative; overflow: hidden; align-items: flex-end;
  margin: 0 0 1rem; padding: 1.3rem 1.4rem 0; border: 1px solid var(--line); border-radius: 24px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='200' viewBox='0 0 420 200'%3E%3Cg fill='none' stroke='%237e9a68' stroke-width='1.6' opacity='.35'%3E%3Cpath d='M0 0C18-26 58-30 90 0C58 30 18 26 0 0Z' transform='translate(60 50) rotate(-20) scale(1.5)'/%3E%3Cpath d='M0 0C18-26 58-30 90 0C58 30 18 26 0 0Z' transform='translate(170 130) rotate(25) scale(1.8)'/%3E%3Cpath d='M0 0C18-26 58-30 90 0C58 30 18 26 0 0Z' transform='translate(300 40) rotate(-45) scale(1.3)'/%3E%3Cpath d='M0 0C18-26 58-30 90 0C58 30 18 26 0 0Z' transform='translate(340 170) rotate(10) scale(1.1)'/%3E%3C/g%3E%3C/svg%3E") right -40px top -20px / 420px 200px no-repeat,
    linear-gradient(115deg, #e6eedc 0%, #f3eedf 55%, #f8ebd2 100%);
}
.page-head.tree-head > .view-switch-wrap { flex: 1 1 100%; justify-content: space-between; margin-top: 0.4rem; }
.tree-head .family-portrait { box-shadow: 0 6px 18px rgba(60, 50, 20, 0.18), 0 0 0 4px #fff; }

/* View tabs: a row with a green underline, on every tree page. */
.view-switch { flex-wrap: nowrap; overflow-x: auto; gap: 0.15rem; scrollbar-width: none; }
.view-switch::-webkit-scrollbar { display: none; }
.view-switch a {
  flex: none; background: transparent; border: 0; border-bottom: 3px solid transparent; border-radius: 0;
  min-height: 48px; padding: 0.4rem 0.85rem; font-weight: 600; color: #4a574c;
}
.view-switch a.on { background: transparent; color: var(--green); border-bottom-color: var(--green); }
.view-switch a.on .icon { color: var(--green); }
.view-switch a:hover:not(.on) { background: transparent; color: var(--ink); border-bottom-color: #d8d0bd; }

/* One white toolbar holds the search, how much to show, and More. */
.tree-chart-area > .toolbar {
  align-items: center; margin: 0 0 0.9rem; padding: 0.55rem 0.6rem;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 2px 6px rgba(60, 50, 20, 0.05);
}
.tree-chart-area > .toolbar .branch { align-items: center; }
.tree-chart-area > .toolbar .branch-search { grid-template-columns: 1fr; }
.tree-chart-area > .toolbar input[type="search"] { background: #f8f5ee; border-color: #ece5d6; }

/* The tree sits on soft dotted paper. */
.tree-stage {
  border: 1px solid var(--line); border-radius: 24px;
  background-color: #fffdf8; background-image: radial-gradient(#e9e2d1 1.1px, transparent 1.2px); background-size: 22px 22px;
}
.tree-stage.is-fullscreen { border: 0; }
.chart-lines .band-alt { fill: rgba(242, 229, 200, 0.42); }
.chart-rail span {
  background: rgba(255, 253, 248, 0.94); color: #5c6656; border-color: #e8e0cf;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
}

/* Cards: white, gently raised, a ringed face; the flags already say the country. */
.tree-canvas .person-box {
  border: 1px solid #e6decd; border-radius: 18px; background: #fff;
  box-shadow: 0 1px 2px rgba(50, 40, 20, 0.06), 0 8px 20px rgba(50, 40, 20, 0.08);
}
.tree-canvas .person-box .avatar, .tree-canvas .person-box .person-photo-face { box-shadow: 0 0 0 3px #fff, 0 0 0 4px #e6decd; }
.tree-canvas .person-box[data-me="1"] { outline: 2px solid rgba(46, 91, 67, 0.35); outline-offset: 2px; background: #fff; }
.tree-canvas .person-box.is-you {
  outline: 0; border: 2px solid var(--amber); background: #fff7e6;
  box-shadow: 0 0 0 6px rgba(201, 135, 31, 0.14), 0 10px 24px rgba(120, 80, 20, 0.14);
}
.tree-canvas .person-box.is-you::after {
  content: attr(data-you-label); position: absolute; top: -11px; left: 50%; transform: translateX(-50%); z-index: 2;
  padding: 1px 11px; border-radius: 999px; background: var(--amber); color: #fff;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; line-height: 1.6; white-space: nowrap;
}
.tree-canvas[data-layout="down"] .person-box.is-you { overflow: visible; }
.person-box.is-selected { outline: 3px solid rgba(46, 91, 67, 0.55); outline-offset: 4px; }

/* The person panel: the same family card, laid out like a profile. */
.side-card { border-radius: 24px; padding: 0.7rem 0.6rem 0.6rem; box-shadow: -18px 0 40px rgba(50, 40, 20, 0.12), 0 24px 60px rgba(50, 40, 20, 0.14); }
.side-card .fc-face { width: 104px; height: 104px; }
.side-card .fc-head h2 { font-size: 1.7rem; }
.side-card-full { display: inline-flex; align-items: center; min-height: 40px; padding: 0 0.9rem; border-radius: 12px; background: var(--leaf); color: var(--green-deep); text-decoration: none; }
.side-card-full:hover { background: #dfe9d4; }
.kin-add { border-color: #b7c6ad; background: #f6f9f2; }
.kin-add:hover { background: var(--leaf); }
/* Phones: the underlined tabs are one row you can swipe, with a soft fade hinting at more
   (this replaces the v1.20.3 wrap, which suited the old pill buttons). Family sits below. */
@media (max-width: 860px) {
  .view-switch-wrap .view-switch {
    display: flex; flex: 1 1 100%; min-width: 0;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .view-switch-wrap .family-menu { margin-left: auto; }
  .view-switch a { padding: 0.4rem 0.7rem; }
}
/* The smallest phones (iPhone SE and similar, under 360px): the header holds seven round
   buttons, which do not fit. Language is also in the Text (Aa) panel, so the globe steps
   aside there, and the gaps tighten a little, keeping your account button on screen. */
@media (max-width: 359px) {
  .top { padding-left: 8px; padding-right: 8px; gap: 4px; }
  .top nav { gap: 4px; }
  .top nav > .lang-menu { display: none; }
}
/* The narrowest folded phones (original Galaxy Fold, 280px): the logo and tree name step aside
   so all six buttons fit (the tree name is in the welcome band); "Banyan" at the start of the breadcrumb and the account menu still lead home. */
@media (max-width: 300px) {
  .top .brand, .top .current-tree { display: none; }
}
/* Narrow phones: a getting-started step puts its button under the words, so the words never hide behind it. */
@media (max-width: 400px) {
  .guide-steps li { flex-wrap: wrap; }
  .guide-steps li > div { flex: 1 1 11rem; }
  .guide-steps li > .btn { margin-left: calc(28px + 0.75rem); }
}

/* Dashed "add" cards on the tree (v1.28): a gentle place for someone missing near you. */
.tree-canvas .person-box.add-ghost { background: rgba(255, 255, 255, 0.6); border: 2px dashed #b7c6ad; box-shadow: none; outline: 0; }
.tree-canvas .person-box.add-ghost:hover { background: #f6f9f2; border-color: var(--green); }
.add-ghost .ghost-plus {
  flex: none; width: 3.25rem; height: 3.25rem; border-radius: 50%; display: grid; place-items: center;
  background: #eef3e8; color: var(--green); border: 2px dashed #b7c6ad; font-size: 1.6rem; font-weight: 500; line-height: 1;
}
.add-ghost .who strong { color: var(--green); }
.add-ghost .ghost-btn {
  justify-self: start; margin-top: 0.35rem; display: inline-flex; align-items: center; height: 30px; padding: 0 14px;
  border-radius: 999px; background: var(--green); color: #fff; font-weight: 700; font-size: 0.82rem;
}
.chart-lines .chart-ink .ghost-join { stroke: #b7c6ad; stroke-dasharray: 5 5; }
@media print { .add-ghost { display: none !important; } }
body.printing-tree .add-ghost { display: none !important; }

/* The family band on every tree page (v1.28.2): on List, Map, Photos, Notes and Reports the family
   name looks like the Tree page heading, and the page's own title sits a little smaller below. */
.tree-head .family-name { font-family: Fraunces, Georgia, serif; font-weight: 560; letter-spacing: -0.03em; line-height: 1.15; color: var(--ink); }
.page-head.tree-head + .page-head { margin-top: 0.4rem; }
.page-head.tree-head + .page-head h1 { font-size: clamp(1.3rem, 2vw, 1.7rem); }

/* "Your family trees" (v1.30): the welcome band, cards with a cover, a dashed card to start another, and the plan bar. */
.families-head {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  margin: 0 0 1.2rem; padding: 1.4rem 1.5rem; border: 1px solid var(--line); border-radius: 24px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='200' viewBox='0 0 420 200'%3E%3Cg fill='none' stroke='%237e9a68' stroke-width='1.6' opacity='.35'%3E%3Cpath d='M0 0C18-26 58-30 90 0C58 30 18 26 0 0Z' transform='translate(60 50) rotate(-20) scale(1.5)'/%3E%3Cpath d='M0 0C18-26 58-30 90 0C58 30 18 26 0 0Z' transform='translate(170 130) rotate(25) scale(1.8)'/%3E%3Cpath d='M0 0C18-26 58-30 90 0C58 30 18 26 0 0Z' transform='translate(300 40) rotate(-45) scale(1.3)'/%3E%3Cpath d='M0 0C18-26 58-30 90 0C58 30 18 26 0 0Z' transform='translate(340 170) rotate(10) scale(1.1)'/%3E%3C/g%3E%3C/svg%3E") right -40px top -20px / 420px 200px no-repeat,
    linear-gradient(115deg, #e6eedc 0%, #f3eedf 55%, #f8ebd2 100%);
}
.families-head h1 { margin: 0 0 0.35rem; }
.families-private { display: flex; align-items: center; gap: 0.45rem; margin: 0; color: #3f4b41; }
.families-private .icon { opacity: 0.7; }
.families-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.1rem; }
.families-grid .family-card { padding: 0 1.1rem 1.1rem; overflow: visible; }
.family-card-cover {
  display: block; align-self: stretch; position: relative; height: 92px; margin: 0 -1.1rem 2.3rem; border-radius: 20px 20px 0 0;
  background: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.22) 0 48px, transparent 49px), linear-gradient(135deg, #5f8a4a, #2e5b43);
}
.family-card-cover > * { position: absolute; left: 1.1rem; bottom: -30px; width: 68px; height: 68px; border-radius: 18px; border: 4px solid #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); overflow: hidden; }
.family-card-cover > img { background: #fff; object-fit: cover; }
.family-card-cover > .family-fallback { display: block; background: linear-gradient(135deg, var(--tile-a), var(--tile-b)); }
.family-card-cover > .family-fallback svg, .family-card-cover > svg { display: block; width: 100%; height: 100%; }
.families-grid .card-menu { top: 0.7rem; right: 0.7rem; }
.families-grid .family-card-go { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 40px; padding: 0 1rem; border-radius: 12px; background: var(--green); color: #fff; }
.families-grid .family-card:hover .family-card-go { text-decoration: none; background: var(--green-deep); }
.family-card-new {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; min-height: 16rem; padding: 1.5rem;
  text-align: center; text-decoration: none; color: inherit; background: rgba(255, 255, 255, 0.55); border: 2px dashed #b7c6ad; box-shadow: none;
}
.family-card-new:hover { background: #f6f9f2; border-color: var(--green); }
.family-card-new strong { font-family: Fraunces, Georgia, serif; font-size: 1.25rem; font-weight: 560; color: var(--ink); }
.family-card-plus { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: #eef3e8; color: var(--green); border: 2px dashed #b7c6ad; }
.family-card-plus .icon { width: 1.5rem; height: 1.5rem; }
.choice-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.6rem; }
.start-family .choice:has(input:checked) { border-color: var(--green); background: #f1f6ec; box-shadow: 0 0 0 3px rgba(46, 91, 67, 0.12); }
.tree-meter { margin-top: 1rem; padding: 0.9rem 1rem; border-radius: 14px; background: #f8f5ee; border: 1px solid #ece5d6; }
.tree-meter-row { display: flex; justify-content: space-between; margin: 0 0 0.45rem; font-weight: 600; }
.tree-meter-bar { display: block; height: 8px; border-radius: 4px; background: #e8e1d1; overflow: hidden; }
.tree-meter-bar i { display: block; height: 100%; border-radius: 4px; background: var(--green); }
.tree-meter .muted { margin: 0.55rem 0 0; font-size: 0.92rem; }

/* Tree pages (v1.30): the family band is the same full width on every tree page, like the Tree page;
   on List, Map, Photos, Notes and Reports only the content below keeps a comfortable reading width. */
body:not(.tree-home) main:has(> .page-head.tree-head) { width: min(100% - 1rem, calc(100vw - 1rem)); max-width: none; padding-top: 0.85rem; }
body:not(.tree-home) main:has(> .page-head.tree-head) > :not(.tree-head):not(.crumbs) { width: min(1120px, 100%); margin-left: auto; margin-right: auto; }
/* Tree pages (v1.30.1): the band keeps its full-width background, but the family name and tabs
   line up with the content column below, so every tree page shares one left edge. */
@media (min-width: 1200px) {
  main:has(> .page-head.tree-head) > .page-head.tree-head,
  main:has(> .page-head.tree-head) > .crumbs { padding-left: max(1.4rem, calc((100% - 1120px) / 2)); padding-right: max(1.4rem, calc((100% - 1120px) / 2)); }
  /* On the Tree page the words above the chart use that column too; only the chart itself stays wide. */
  body.tree-home main > .for-you,
  body.tree-home .tree-chart-area > :not(.tree-stage) { width: min(1120px, 100%); margin-left: auto; margin-right: auto; }
}

/* v1.30.2: the List page search is a full-width bar, like the search bar on the Tree page. */
.search.list-search-bar {
  max-width: none; display: grid; grid-template-columns: max-content 1fr; align-items: center; gap: 0.35rem 0.8rem;
  padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: 18px; background: #fff; font-weight: 650;
}
.search.list-search-bar input { max-width: none; width: 100%; }
.search.list-search-bar .field-hint { grid-column: 2; font-weight: 400; font-size: 0.9rem; }
@media (max-width: 480px) {
  .search.list-search-bar { grid-template-columns: 1fr; }
  .search.list-search-bar .field-hint { grid-column: 1; }
}

/* v1.30.2: Photos storage line and bar stay together on the left. */
.quota-box { margin-bottom: 1rem; }
.quota-box .quota-bar { margin-bottom: 0; }

/* v1.30.2: file pickers get a soft green button instead of the browser's grey one. */
input[type="file"] { font: inherit; color: var(--muted); }
input[type="file"]::file-selector-button {
  margin-right: 0.8rem; padding: 0.55rem 1rem; border: 1px solid #b7c6ad; border-radius: 12px;
  background: var(--leaf); color: var(--green-deep); font: inherit; font-weight: 650; cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: #dfe9d5; border-color: var(--green); }

/* v1.30.3: version numbers and dates in Admin → Versions stay on one line on phones. */
.version-table td:first-child { white-space: nowrap; }
@media (min-width: 361px) { .version-table td:nth-child(3) { white-space: nowrap; } }
/* Long email addresses in release notes wrap instead of pushing the page sideways. */
.release li, .release p { overflow-wrap: anywhere; }
/* v1.30.3: role boxes on Members are wide enough for "Editor — can change the tree". */
.member-list li form { flex-wrap: wrap; }
.member-list li form select[name="role"] { min-width: 16.5rem; }
@media (max-width: 480px) { .member-list li form, .member-list li form select, .member-list li form select[name="role"] { width: 100%; min-width: 0; } }
/* v1.30.3: on Members the role boxes sit in one row on computers instead of stacking. */
@media (min-width: 481px) {
  .member-list li form select { width: auto; flex: 0 1 auto; }
  .member-list li > div { flex: 1 1 10rem; }
}
/* v1.30.3: on phones, the person card's Add buttons wrap under each other, not back under the word "Add". */
@media (max-width: 480px) {
  .card-actions .add-group { position: relative; padding-left: 6.4rem; }
  .card-actions .add-group-label { position: absolute; left: 0; top: 0.5rem; min-width: 0; }
}

/* v1.31.0: "Find someone on the tree" shows you first with the gold You tag,
   then everyone with their picture or initials and how they are related. */
.branch-results { max-height: min(60vh, 420px); }
.branch-results button { display: flex; align-items: center; gap: 0.65rem; text-align: left; justify-content: flex-start; padding: 0.4rem 0.6rem; }
.branch-results .avatar { width: 32px; height: 32px; font-size: 0.72rem; border: 1px solid #dfe8d6; }
.branch-results .avatar.me { background: #fbf1dc; border-color: #ecd29b; color: #8a5a0c; }
.branch-result-text { display: grid; min-width: 0; line-height: 1.2; }
.branch-result-text strong { font-weight: 650; overflow-wrap: anywhere; }
.branch-result-text small { color: var(--muted); font-size: 0.82rem; font-weight: 450; margin-top: 0.1rem; }
.you-tag { display: inline-block; margin-left: 0.3rem; padding: 0 0.45rem; border-radius: 999px; background: var(--amber); color: #fff; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em; line-height: 1.6; vertical-align: 0.1em; }
.branch-results .is-me button { background: var(--leaf); }
.branch-results-sep { height: 1px; margin: 0.3rem 0.5rem; background: var(--line); }
@media (max-width: 700px) {
  /* On phones the list is wider than the small search box, so names and words fit on one line. */
  .branch-results { right: auto; width: min(24rem, calc(100vw - 2.5rem)); }
}

/* v1.31.1: hover pop-ups on tree cards. The words live in a hidden .peek on each card;
   app.js shows them in one layer above the page, so nothing cuts them off or covers them. */
.person-box .peek { display: none !important; }
.peek-float {
  position: fixed; z-index: 90; width: 18rem; max-width: calc(100vw - 16px);
  padding: 0.8rem 0.95rem 0.7rem; border-radius: 14px; background: var(--ink); color: #fff;
  box-shadow: 0 16px 40px rgba(20, 30, 20, 0.32); font-size: 0.86rem; line-height: 1.45; pointer-events: none;
}
.peek-float[hidden] { display: none; }
.peek-float::before {
  content: ""; position: absolute; left: var(--peek-arrow, 30px); top: -6px; width: 13px; height: 13px;
  background: var(--ink); border-radius: 2px; transform: rotate(45deg);
}
.peek-float.above::before { top: auto; bottom: -6px; }
.peek-float > span, .peek-float > b { display: block; }
.peek-float .peek-name { font-size: 1rem; font-weight: 700; }
.peek-float .peek-rel { color: #cfe2c4; font-weight: 600; margin: 0.1rem 0 0.4rem; }
.peek-float .peek-row { display: flex; gap: 0.5rem; color: #eef2ec; margin: 0.15rem 0; }
.peek-float .peek-row i { font-style: normal; width: 1rem; text-align: center; opacity: 0.75; }
.peek-float .peek-go { margin-top: 0.5rem; padding-top: 0.45rem; border-top: 1px solid rgba(255, 255, 255, 0.14); color: #cfe2c4; font-weight: 600; font-size: 0.8rem; }
@media print { .peek-float { display: none !important; } }

/* v1.31.1: the photo menu floats above the page while open (moved there by app.js). */
.person-photo-menu.floating { display: grid; position: fixed; z-index: 91; min-width: 13rem; box-shadow: 0 16px 40px rgba(20, 30, 20, 0.22); }
.person-photo-menu.floating::before {
  content: ""; position: absolute; left: var(--menu-arrow, 18px); top: -7px; width: 12px; height: 12px;
  background: #fff; border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg);
}
.person-photo-menu.floating.above::before { top: auto; bottom: -7px; transform: rotate(225deg); }
.person-photo-menu-title { margin: 0; padding: 0.35rem 0.6rem 0.2rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
/* The old "open on hover" rules would show a second copy inside the card; app.js handles opening now. */
.person-photo:hover .person-photo-menu:not(.floating), .person-photo:focus-within .person-photo-menu:not(.floating) { display: none; }
/* A small pencil on the photo shows it can be changed. */
.has-photo-edit .person-photo::before {
  content: "✎"; position: absolute; right: -3px; bottom: -3px; z-index: 2; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; background: var(--green); color: #fff; font-size: 10px; border: 2px solid #fff;
  opacity: 0; transition: opacity 0.15s ease; pointer-events: none;
}
.has-photo-edit .person-photo:hover::before, .has-photo-edit .person-photo.open::before { opacity: 1; }
@media print { .has-photo-edit .person-photo::before, .person-photo-menu.floating { display: none !important; } }
.person-photo-menu.floating label, .person-photo-menu.floating button { text-align: left; justify-content: flex-start; width: 100%; }

/* v1.32: a person's places read as a short journey: born in → grew up in → lives in now. */
.flag-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.5rem; }
.flag-step { color: var(--muted); font-weight: 600; }
.tip-row > .muted { margin-left: 0.3rem; font-weight: 500; }

/* v1.33 Invite family: a green button in the family band, a simple pop-up, and an editable message. */
.band-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; flex: none; }
.btn.invite-family { min-height: 40px; padding: 0.4rem 0.95rem; border-radius: 999px; box-shadow: 0 4px 12px rgba(46, 91, 67, 0.22); white-space: nowrap; }
@media (max-width: 860px) {
  .band-actions { flex: 1 1 100%; justify-content: flex-end; }
  .band-actions .invite-family { flex: 1 1 auto; justify-content: center; }
}
.invite-sheet { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 1rem; background: rgba(20, 30, 22, 0.45); }
.invite-sheet[hidden] { display: none; }
.invite-card {
  position: relative; width: min(30rem, 100%); max-height: calc(100vh - 2rem); overflow: auto;
  padding: 1.4rem 1.4rem 1.2rem; border-radius: 22px; background: #fff; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(20, 30, 20, 0.3);
}
.invite-card h2 { margin: 0 0 0.3rem; padding-right: 2rem; }
.invite-close { position: absolute; top: 0.7rem; right: 0.7rem; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.invite-roles { border: 0; padding: 0; margin: 0; }
.invite-roles legend { font-weight: 600; margin-bottom: 0.4rem; padding: 0; }
.invite-roles .choice-pair { grid-template-columns: 1fr 1fr; }
.invite-roles .choice { align-items: flex-start; }
.invite-roles .choice b { display: block; }
.invite-roles .choice small { display: block; color: var(--muted); font-weight: 450; margin-top: 0.15rem; line-height: 1.3; }
.invite-roles .choice:has(input:checked) { border-color: var(--green); background: #f1f6ec; box-shadow: 0 0 0 3px rgba(46, 91, 67, 0.12); }
.invite-safe { display: flex; gap: 0.5rem; align-items: flex-start; margin: 0.2rem 0 0; padding: 0.6rem 0.75rem; border-radius: 12px; background: #f8f5ee; color: #4a564d; font-size: 0.88rem; line-height: 1.4; }
.invite-safe .icon { flex: none; margin-top: 0.1rem; color: var(--green); }
.invite-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.3rem; margin: 0; font-size: 0.9rem; }
.invite-foot a { font-weight: 650; }
.invite-share { display: grid; gap: 0.6rem; margin: 0.6rem 0; text-align: left; }
.invite-message { display: grid; gap: 0.35rem; font-weight: 600; }
.invite-message textarea { width: 100%; min-height: 8.5rem; font: inherit; font-weight: 450; line-height: 1.45; resize: vertical; }
.invite-send .btn { width: 100%; justify-content: center; min-height: 50px; font-size: 1.05rem; }
.invite-send .btn.share-whatsapp.primary { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.invite-send .btn.share-whatsapp.primary:hover { background: #188547; border-color: #188547; }
.invite-more-ways { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.invite-more-ways .btn { flex: 1 1 auto; justify-content: center; }
@media (max-width: 600px) {
  /* Phones: the pop-up rises from the bottom of the screen. */
  .invite-sheet { place-items: end stretch; padding: 0; }
  .invite-card { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; padding: 1.2rem 1rem calc(1rem + env(safe-area-inset-bottom)); }
  .invite-roles .choice-pair { grid-template-columns: 1fr 1fr; }
}
@media print { .invite-sheet, .band-actions .invite-family { display: none !important; } }
/* "Not sure? Ask a relative" on a dashed parent card (v1.33). */
/* v1.33.1: on a dashed card with "Ask a relative", the name link covers the whole card; the ask link sits above it, on its own line. */
.person-box.add-ghost.has-ask { position: relative; }
.add-ghost.has-ask .who { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; min-width: 0; }
.add-ghost.has-ask .ghost-main { color: inherit; text-decoration: none; }
.add-ghost.has-ask .ghost-main::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.add-ghost.has-ask .ghost-ask { position: relative; z-index: 2; font-size: 0.78rem; font-weight: 650; line-height: 1.25; color: var(--green); }
.add-ghost.has-ask .ghost-btn { margin-top: 0.15rem; }
.fy-chip.fy-invite { background: var(--leaf); border-color: #cfe0c2; color: var(--green-deep); }
/* "Kathy isn't on Family Banyan yet" on a person's page (v1.33). */
.invite-them { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 0.8rem 0; padding: 0.7rem 0.9rem; border-radius: 14px; background: var(--leaf); }
.invite-them > .icon { color: var(--green); flex: none; }
.invite-them > span { flex: 1 1 12rem; font-weight: 600; }
/* Steps of the pop-up hide properly even where a layout rule sets display (v1.33). */
.invite-card [hidden] { display: none !important; }
.invite-message .muted { font-weight: 450; }
.add-ghost.has-ask .ghost-main { display: block; flex: none; min-height: 0; padding: 0; max-width: 100%; }
.add-ghost.has-ask .who { justify-content: center; }
/* The name's click area must cover the whole card, and the Add button lets clicks through to it. */
.add-ghost.has-ask .who, .add-ghost.has-ask .ghost-main { position: static; }
.add-ghost.has-ask .ghost-btn { pointer-events: none; }

/* v1.34 Family calendar in Your profile. */
.calendar-adds { display: grid; gap: 0.5rem; }
.calendar-add {
  display: flex; align-items: center; gap: 0.8rem; width: 100%; padding: 0.7rem 0.9rem; border-radius: 14px;
  border: 1px solid var(--line); background: #fbf8f1; color: inherit; text-decoration: none; text-align: left; font: inherit; font-weight: 650; cursor: pointer;
}
.calendar-add:hover { background: var(--leaf); text-decoration: none; }
.calendar-add.primary { border: 2px solid var(--green); background: #f1f6ec; }
.calendar-add small { display: block; font-weight: 450; color: var(--muted); font-size: 0.82rem; }
.calendar-add b { font-weight: 650; }
.cal-ic { width: 32px; height: 32px; border-radius: 9px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; }
.cal-g { background: #4285f4; } .cal-a { background: #ff3b30; } .cal-o { background: #0a64c2; } .cal-l { background: var(--green); }
.cal-l .icon { width: 17px; height: 17px; }
.calendar-prefs { border-top: 1px solid var(--line); padding-top: 0.9rem; }
.calendar-prefs-title { margin: 0; font-weight: 700; font-size: 0.82rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.calendar-prefs .check span small { display: block; font-size: 0.82rem; }
.calendar-families { border: 0; padding: 0; margin: 0; }
.calendar-families legend { font-weight: 600; padding: 0; margin-bottom: 0.3rem; }
.calendar-reset { margin: 0; font-size: 0.9rem; }
.calendar-reset .link-button { background: none; border: 0; padding: 0; min-height: 0; font: inherit; font-weight: 650; color: #9b3b2c; cursor: pointer; text-decoration: underline; }
.occasions-calendar { margin: 0.6rem 0 0; font-weight: 650; }
.calendar-add { justify-content: flex-start; }
/* v1.34.1: "Add someone" never wraps onto two lines; on narrower windows it shows just "+". */
.top nav .btn.top-add { white-space: nowrap; }
@media (max-width: 720px) {
  .top nav .btn.top-add .icon-label > span { display: none; }
  .top nav .btn.top-add { padding: 0.45rem 0.7rem; }
}
.form-card > .form-card-title { font-size: clamp(2rem, 4vw, 3.2rem); margin: 0 0 0.3rem; }
