/* ============================================================================
   FamilyForest — Design System v2 "Warm Paper Forest"  (REDESIGN_PLAN.md §2)
   Ancestry-grade warm paper surfaces + our forest identity. No framework, no build.
   ============================================================================ */

/* ---------- vendored display face (SIL OFL) ---------- */
@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/vendor/fonts/source-serif-4-600.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/vendor/fonts/source-serif-4-700.woff2") format("woff2");
}

/* ---------- tokens ---------- */
:root {
  /* surfaces & ink — warm paper, never gray-on-white */
  --bg: #F6F3F0; --bg-2: #ECE9E4; --card: #FFFFFF;
  --ink: #21201D; --ink-2: #4A463E; --muted: #7A7466;
  --line: #E4DFD6; --line-soft: #EEEAE2;

  /* forest green ramp — CTAs, active nav, "family history" */
  --green-900: #1E4A28; --green-700: #2F6B3C; --green-500: #3E8A4E;
  --green-200: #CFE4D4; --green-100: #E4EFE7; --green-50: #F0F6F1;

  /* heritage gold — highlights, focal nodes, verified */
  --gold-700: #8F6A25; --gold-500: #B08436; --gold-100: #F5EDDA; --gold-50: #FAF5E9;

  /* slate blue — links + info chips only */
  --blue-700: #0C5F7D; --blue-500: #117FA6; --blue-100: #E0EEF3;

  --warn: #A9491F; --warn-soft: #F6E3D9;

  /* legacy aliases (older templates reference these) */
  --accent: var(--green-700); --accent-deep: var(--green-700); --accent-dark: var(--green-900);
  --accent-soft: var(--green-100); --accent-tint: var(--green-50);
  /* --paper: referenced by the photo box-tool buttons + the face bulk bar. Was UNDEFINED, which
     makes background:var(--paper) compute to TRANSPARENT (not the cascade fallback!) — green text
     floating unreadably over photos (Carl, 2026-07-22). Solid card white: these sit over images. */
  --paper: var(--card);
  --gold: var(--gold-500); --gold-soft: var(--gold-100); --good: var(--green-700);

  --shadow: 0 1px 2px rgba(40,36,28,.05), 0 4px 14px rgba(40,36,28,.06);
  --shadow-lift: 0 2px 6px rgba(40,36,28,.08), 0 14px 32px rgba(40,36,28,.12);

  --serif: "Source Serif 4", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 14px; --radius-sm: 9px;

  /* type scale (keep it to these) */
  --fs-hero: 44px; --fs-h1: 32px; --fs-h3: 20px; --fs-body: 15px; --fs-small: 13px; --fs-tiny: 11.5px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); line-height: 1.55; font-size: var(--fs-body);
  -webkit-font-smoothing: antialiased;
}

/* ---------- header / shell ---------- */
.site-header {
  background: linear-gradient(180deg, var(--green-700), var(--green-900));
  color: #fff; position: sticky; top: 0; z-index: 40;
  box-shadow: 0 1px 0 rgba(0,0,0,.15), 0 2px 12px rgba(0,0,0,.10);
}
.site-header .bar {
  max-width: 1240px; margin: 0 auto; padding: 0 22px;
  display: flex; align-items: center; gap: 18px; height: 62px;
}
.brand {
  display: flex; align-items: center; gap: 9px; color: #fff; text-decoration: none;
  font-family: var(--serif); font-size: 21px; font-weight: 700; letter-spacing: .01em;
  white-space: nowrap;
}
.brand .leaf { font-size: 22px; }
/* min-width is load-bearing: `flex: 1` alone lets a crowded nav shrink this to nothing, and at
   a few px wide a 999px radius renders as a bare circle — which is exactly what happened. */
.header-search { flex: 1; min-width: 200px; max-width: 460px; position: relative; }
.header-search input {
  width: 100%; padding: 9px 14px 9px 36px; border-radius: 999px; border: 1px solid transparent;
  background: rgba(255,255,255,.16); color: #fff; font: inherit; font-size: 14px;
}
.header-search input::placeholder { color: rgba(255,255,255,.75); }
.header-search input:focus {
  outline: none; background: #fff; color: var(--ink); border-color: var(--gold-500); box-shadow: none;
}
.header-search .ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  opacity: .8; font-size: 14px; pointer-events: none;
}
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a, .nav .navitem {
  color: rgba(255,255,255,.92); text-decoration: none; font-size: 14.5px; font-weight: 500;
  padding: 8px 14px; border-radius: 999px; white-space: nowrap; cursor: pointer;
}
.nav a:hover, .nav .navitem:hover { background: rgba(255,255,255,.14); color: #fff; }
.nav a.active { background: rgba(255,255,255,.22); color: #fff; font-weight: 700; }
/* dropdown (CSS-only) */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { background: rgba(255,255,255,.18); color: #fff; }
.menu .menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lift); padding: 6px; z-index: 50;
  /* reset the .site-header's white text — without this, any PLAIN (non-link, non-.muted) text
     in a dropdown renders white-on-white (Carl's invisible backup notification, 2026-07-22) */
  color: var(--ink);
}
.menu .menu-panel a {
  display: block; color: var(--ink); padding: 9px 12px; border-radius: 6px; font-size: 14px;
}
.menu .menu-panel a:hover { background: var(--green-50); color: var(--green-700); text-decoration: none; }
.menu .menu-panel a small { display: block; color: var(--muted); font-size: var(--fs-tiny); }
.menu .menu-panel .sep { height: 1px; background: var(--line-soft); margin: 5px 4px; }

main { max-width: 1240px; margin: 0 auto; padding: 26px 22px 60px; }

/* ---------- typography ---------- */
h1 { font-family: var(--serif); font-weight: 700; font-size: var(--fs-h1); margin: 4px 0 16px; letter-spacing: .003em; }
h2 { font-size: var(--fs-small); font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
     color: var(--muted); margin: 0 0 12px; }
h3 { font-family: var(--serif); font-weight: 600; font-size: var(--fs-h3); margin: 0 0 8px; }
a { color: var(--blue-700); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.warntext { color: var(--warn); }
hr { border: none; border-top: 1px solid var(--line-soft); margin: 16px 0; }

/* ---------- hero (home) ---------- */
.hero {
  background: linear-gradient(150deg, var(--green-700) 0%, var(--green-900) 90%);
  color: #fff; border-radius: var(--radius); padding: 40px 38px 34px; margin-bottom: 14px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero::after { /* soft leaf-light wash so the panel isn't flat */
  content: ""; position: absolute; right: -120px; top: -160px; width: 420px; height: 420px;
  background: radial-gradient(closest-side, rgba(255,255,255,.10), transparent 70%);
  pointer-events: none;
}
.hero h1 { color: #fff; font-size: var(--fs-hero); line-height: 1.12; margin: 0 0 8px; }
.hero p { margin: 0 0 22px; color: rgba(255,255,255,.87); font-size: 16.5px; max-width: 640px; }
.hero-search { display: flex; gap: 0; max-width: 560px; background: #fff;
  border-radius: 999px; padding: 5px; box-shadow: var(--shadow-lift); }
.hero-search input { flex: 1; border: none; background: transparent; font-size: 16px;
  padding: 10px 18px; color: var(--ink); }
.hero-search input:focus { outline: none; box-shadow: none; border: none; }
.hero-search:focus-within { box-shadow: var(--shadow-lift), 0 0 0 3px rgba(176,132,54,.45); }
.hero-search button { border-radius: 999px; padding: 10px 24px; font-size: 15px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.hero-cta { display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.40);
  border-radius: 999px; padding: 10px 22px; font-size: 15px; font-weight: 600; transition: .12s; }
.hero-cta:hover { background: #fff; color: var(--green-900); border-color: #fff;
  text-decoration: none; box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.hero-cta .ico { font-size: 18px; line-height: 1; }
/* the phone-app CTA carries the heritage gold so it reads as the "and get it on your phone" nudge */
.hero-cta-app { background: var(--gold-500); border-color: var(--gold-500); color: #2b2410; }
.hero-cta-app:hover { background: var(--gold-600, #96702e); border-color: var(--gold-600, #96702e); color: #fff; }
/* nav "Get the app" — gold dot so it stands out from the section links without shouting */

/* the family-collage band under the hero: real photos ARE the decoration */
.collage { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 0 0 26px; }
.collage a { display: block; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow);
  position: relative; transition: .14s; }
.collage a:hover { transform: translateY(-2px) scale(1.01); box-shadow: var(--shadow-lift); }
.collage img { width: 100%; height: 110px; object-fit: cover; display: block;
  filter: saturate(.96); }
.collage a:nth-child(2n) img { height: 110px; }
.collage .cyr { position: absolute; right: 7px; bottom: 6px; background: rgba(20,18,14,.55);
  color: #fff; font-size: 10.5px; padding: 1px 7px; border-radius: 999px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card-pad-lg { padding: 22px 24px; }
.tint-green { background: var(--green-50); border-color: var(--green-200); }
.tint-gold  { background: var(--gold-50);  border-color: #E9DAB8; }
.tint-blue  { background: var(--blue-100); border-color: #C8DBE5; }

/* stat tiles */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 14px; margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 16px; box-shadow: var(--shadow); display: block; color: var(--ink); }
a.stat:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); text-decoration: none;
               border-color: var(--green-200); transition: .12s; }
.stat .num { font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.1; }
.stat .lbl { font-size: var(--fs-tiny); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.stat.warn .num { color: var(--warn); } .stat.accent .num { color: var(--green-700); }
.stat.gold .num { color: var(--gold-700); }

/* quick-action / attention cards */
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.action {
  display: flex; gap: 13px; align-items: flex-start; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); color: var(--ink); transition: .12s;
}
.action:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); text-decoration: none;
                border-color: var(--green-200); }
.action .emoji { font-size: 22px; line-height: 1.1; }
.action .t { font-weight: 600; font-size: 15px; }
.action .d { color: var(--muted); font-size: var(--fs-small); margin-top: 1px; }
.action .pill { margin-left: auto; }
.action.tint-gold:hover { border-color: var(--gold-500); }

/* ---------- on-this-day / hearth widgets ---------- */
.hearth { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; margin-bottom: 8px;
  align-items: start; /* cards end where their content ends — no stretched dead space */ }
@media (max-width: 900px) { .hearth { grid-template-columns: 1fr; } }
.today-list { display: flex; flex-direction: column; gap: 4px; }
.today-item { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-radius: 10px; }
.today-item:hover { background: var(--green-50); text-decoration: none; }
.today-item .cake { font-size: 20px; width: 28px; text-align: center; }
.today-item .who { font-weight: 600; color: var(--ink); }
.today-item .what { color: var(--muted); font-size: var(--fs-small); }
.today-item .yrs { margin-left: auto; font-family: var(--serif); font-weight: 700;
  color: var(--gold-700); font-size: 17px; white-space: nowrap; }
.photostrip { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.photostrip a { border-radius: 8px; overflow: hidden; display: block; position: relative;
  box-shadow: var(--shadow); transition: .12s; }
.photostrip a:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.photostrip img { width: 100%; aspect-ratio: 1 / 1; height: auto; object-fit: cover; display: block; }
.photostrip .cyr { position: absolute; right: 5px; bottom: 4px; background: rgba(20,18,14,.55);
  color: #fff; font-size: 10px; padding: 0 6px; border-radius: 999px; }
.empty-note { color: var(--muted); font-size: var(--fs-small); padding: 8px 4px; }

/* ---------- avatars (FACES FIRST — initials are the fallback only) ---------- */
.avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: none; object-fit: cover;
  background: var(--green-100); color: var(--green-700); display: inline-flex;
  align-items: center; justify-content: center; font-weight: 600; font-size: 17px;
  font-family: var(--serif); border: 2px solid #fff; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 2px 6px rgba(40,36,28,.10);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.lg { width: 96px; height: 96px; font-size: 34px; }
.people-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; }
.pcard { display: flex; gap: 12px; align-items: center; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow); color: var(--ink); transition: .12s; }
.pcard:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); text-decoration: none;
               border-color: var(--green-200); }
.pcard:hover .avatar { box-shadow: 0 0 0 2px var(--gold-500), 0 2px 6px rgba(40,36,28,.14); }
.pcard .nm { font-weight: 600; font-size: 14.5px; line-height: 1.25; }
.pcard .yr { color: var(--muted); font-size: 12.5px; }

/* ---------- badges / pills / chips ---------- */
.badge { display: inline-block; background: var(--green-100); color: var(--green-700);
         border-radius: 999px; padding: 2px 11px; font-size: 12px; font-weight: 600; }
.badge.gold { background: var(--gold-100); color: var(--gold-700); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.pill { display: inline-block; background: var(--green-50); color: var(--green-700);
        border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--ink-2);
        border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px;
        font-size: var(--fs-small); font-weight: 600; cursor: pointer; transition: .1s; }
.chip:hover { border-color: var(--green-500); color: var(--green-700); text-decoration: none; }
.chip.on { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.chip .x { opacity: .7; font-weight: 700; }

/* ---------- profile header (person page) ---------- */
.profile {
  display: flex; gap: 22px; align-items: center; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px;
  margin-bottom: 18px; box-shadow: var(--shadow); flex-wrap: wrap;
}
.profile .who { flex: 1; min-width: 260px; }
.profile .who h1 { margin: 0 0 2px; }
.profile .who .life { color: var(--muted); font-size: 16px; }
.profile .who .place { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.avatar.xl { width: 120px; height: 120px; font-size: 42px;
  box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--gold-500), 0 4px 14px rgba(40,36,28,.18); }
.lifechips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chip.chip-gold { border-color: var(--gold-500); color: var(--gold-700); background: var(--gold-50, #FAF5EC); }
.profile-actions { display: flex; flex-direction: column; gap: 8px; align-self: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 14px; font-weight: 700; padding: 9px 20px; border: 1px solid var(--green-700);
  border-radius: 999px; background: var(--green-700); color: #fff; transition: .12s; }
.btn:hover { background: var(--green-900); border-color: var(--green-900); color: #fff; text-decoration: none; }
.btn.quiet { background: #fff; color: var(--green-700); border-color: var(--line); }
.btn.quiet:hover { background: var(--green-50); border-color: var(--green-200); }

/* ---------- person-hub tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: 4px 0 18px;
  overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: none; border: none; border-radius: 10px 10px 0 0; color: var(--muted);
  font-size: 15px; font-weight: 600; padding: 10px 18px; margin-bottom: -2px;
  border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button:hover { background: var(--green-50); color: var(--green-700); border-bottom-color: var(--green-200); }
.tabs button.on { color: var(--green-700); border-bottom-color: var(--green-700); background: none; }
.tabs button .n { background: var(--green-50); color: var(--green-700); border-radius: 999px;
  font-size: 11.5px; padding: 1px 8px; margin-left: 3px; }
.story p { font-family: var(--serif); font-size: 17px; line-height: 1.65; margin: 4px 0 0;
  color: var(--ink); }
.facestrip { display: flex; gap: 8px; flex-wrap: wrap; }
.facestrip img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 2px #fff, 0 1px 5px rgba(40,36,28,.2); transition: .12s; }
.facestrip a:hover img { transform: scale(1.08); box-shadow: 0 0 0 2px var(--gold-500), 0 2px 8px rgba(40,36,28,.3); }
.famrail-group { padding: 7px 0; border-top: 1px solid var(--line-soft); display: flex;
  gap: 6px; flex-wrap: wrap; align-items: center; }
.famrail-group:first-of-type { border-top: none; }
.famrail-label { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); width: 68px; flex: none; }
.tl-ico { margin-right: 3px; }

/* ---------- buttons / inputs (pill language) ---------- */
input[type=text], input[type=number], input[type=search], select {
  font: inherit; font-size: 14px; padding: 8px 13px; border: 1px solid var(--line);
  border-radius: 999px; background: #fff; color: var(--ink); }
input:focus, select:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px var(--green-50); }
select { border-radius: var(--radius-sm); }
button {
  font: inherit; font-size: 14px; font-weight: 700; padding: 9px 20px; border: 1px solid var(--green-700);
  border-radius: 999px; background: var(--green-700); color: #fff; cursor: pointer; transition: .12s;
}
button:hover { background: var(--green-900); border-color: var(--green-900); }
button.quiet { background: #fff; color: var(--green-700); border-color: var(--line); }
button.quiet:hover { background: var(--green-50); border-color: var(--green-200); }
.result-pick { text-align: left; border-radius: var(--radius-sm); }
.result-pick .muted { color: rgba(255,255,255,.85); }
.facenum { position: absolute; top: -7px; left: -7px; min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--gold-500); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px;
  text-align: center; border-radius: 9px; box-shadow: 0 1px 3px rgba(0,0,0,.45); }

/* ---------- tables ---------- */
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); font-size: 14px; vertical-align: top; }
th { font-size: var(--fs-tiny); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
tr:hover td { background: var(--green-50); }

/* ---------- hints queue ---------- */
.hintcard { margin-bottom: 14px; }
.hintcard .hcard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hintcard table { margin-top: 10px; }
.hintcard .actions { display: flex; gap: 8px; margin-top: 12px; }
.nav a .n, .nav .navitem .n { background: var(--gold-500); color: #2b2410; border-radius: 999px;
  font-size: 11px; font-weight: 700; padding: 1px 7px; margin-left: 5px; }

/* ---------- nav dropdown previews (hints 🍃 / notifications 🔔) ---------- */
.menu.preview-menu .menu-panel { min-width: 280px; max-width: 340px; }
.menu .menu-panel .preview-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.menu .menu-panel .preview-row small { display: inline; font-size: var(--fs-tiny); }

/* ---------- photo grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
        overflow: hidden; box-shadow: var(--shadow); position: relative; transition: .12s; }
.tile:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.tile img { width: 100%; height: 160px; object-fit: cover; display: block; }
.tile .cap { font-size: var(--fs-tiny); color: var(--muted); padding: 5px 9px;
             white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.sel { outline: 3px solid var(--green-700); outline-offset: -1px; }
.tilesel { position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; z-index: 2;
           cursor: pointer; accent-color: var(--green-700); }
.facebadge { position: absolute; top: 6px; right: 6px; z-index: 2; background: rgba(20,18,14,.62);
             color: #fff; font-size: 10.5px; padding: 1px 7px; border-radius: 999px; }
#bulkbar { position: sticky; bottom: 0; margin-top: 16px; background: var(--green-900); color: #fff;
           border-radius: var(--radius); box-shadow: var(--shadow-lift); padding: 12px 16px; z-index: 50; }
#bulkbar .bulkrow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
#bulkbar .muted { color: rgba(255,255,255,.82); }
.bulksearch { position: relative; flex: 1; min-width: 220px; }
.bulksearch input { width: 100%; }
.bulkresults { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; background: #fff;
               color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-sm);
               box-shadow: var(--shadow-lift); max-height: 320px; overflow: auto; }
.bulkresults:empty { display: none; }

/* photos toolbar (replaces the placeholder-input wall) */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 16px; box-shadow: var(--shadow); }
.toolbar .field { display: flex; flex-direction: column; gap: 3px; }
.toolbar .field label { font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); padding-left: 12px; }
.toolbar .grow { flex: 1; min-width: 170px; }
.toolbar input, .toolbar select { font-size: 13.5px; }

/* ---------- the family tier: auth pages + user chrome ---------- */
.authcard { max-width: 420px; margin: 7vh auto 0; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-lift); padding: 30px 30px 24px; }
.authhead { text-align: center; margin-bottom: 18px; }
.authcard form { display: grid; gap: 12px; }
.authcard label { font-size: 13px; font-weight: 600; color: var(--ink-2); display: grid; gap: 5px; }
.authcard input { width: 100%; }
.autherr { background: var(--warn-soft, #FBEAE5); color: var(--warn, #A5391F);
  border-radius: 10px; padding: 9px 14px; font-size: 13.5px; font-weight: 600; }
.uavatar { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 50%; background: var(--gold-500); color: #fff; font-weight: 700; font-size: 14px; }

/* face-group cards (the naming queues) */
.clgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.clcard { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 10px 12px;
  box-shadow: var(--shadow); color: var(--ink); transition: .12s; }
.clcard:hover { border-color: var(--green-500); box-shadow: var(--shadow-lift);
  text-decoration: none; transform: translateY(-2px); }
.clcard img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 3px #fff, 0 1px 6px rgba(40,36,28,.22); margin-bottom: 4px; }
.clcard .clname { font-weight: 700; font-size: 14px; }
.clcard .clname.ok { color: var(--green-700); }
.clcard .clname.ask { color: var(--gold-700); }
.clcard .clmeta { font-size: 11.5px; color: var(--muted); }

/* the dark photo stage (photo detail) */
.stage { position: relative; background: #1B1915; border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); }
.stage #photozoom { border-radius: 8px; background: #1B1915; }
.stage-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 20;
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 30px; line-height: 1; padding-bottom: 4px;
  background: rgba(246,243,240,.92); color: var(--green-900); box-shadow: 0 2px 8px rgba(0,0,0,.4);
  opacity: .55; transition: .12s; }
.stage-arrow:hover { opacity: 1; text-decoration: none; transform: translateY(-50%) scale(1.08); }
.stage-arrow.left { left: 10px; }
.stage-arrow.right { right: 10px; }
.datechip { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px;
  background: var(--gold-50); border: 1px solid var(--gold-500); color: var(--gold-700);
  border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.datechip button { background: none; border: none; color: inherit; padding: 0 3px;
  font-size: 12.5px; font-weight: 700; cursor: pointer; }
.datechip button:hover { background: none; color: var(--green-700); }

/* person summary popover */
.pop { position: absolute; z-index: 300; width: 310px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lift);
  padding: 14px; animation: popin .12s ease-out; }
@keyframes popin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }
.pop-inner { display: flex; gap: 12px; align-items: center; }
.pop-name { font-weight: 700; font-size: 15px; }
.pop-actions { display: flex; gap: 7px; margin-top: 7px; }

/* family places map (vendored leaflet, local vector basemap) */
.fmap { height: 72vh; min-height: 440px; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); }
.fm-cluster { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; color: #fff; font-weight: 700; font-size: 12.5px;
  box-shadow: 0 0 0 3px rgba(255,255,255,.75), 0 2px 6px rgba(20,18,14,.3); }
.fm-cluster.ev { background: var(--green-700); }
.fm-cluster.ph { background: var(--gold-500); }
.fm-pop { margin: 4px 0 0; padding-left: 16px; max-height: 150px; overflow-y: auto; font-size: 12.5px; }
.fm-thumb { max-width: 190px; border-radius: 6px; display: block; }
.minimap { height: 240px; border-radius: 10px; border: 1px solid var(--line); }
.mm-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--green-700); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700;
  box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(20,18,14,.35); }

/* server-SVG-free bar charts (stats page) */
.bars { display: flex; flex-direction: column; gap: 7px; }
.barrow { display: grid; grid-template-columns: 132px 1fr 56px; gap: 10px; align-items: center; }
.barlabel { font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; text-align: right; }
.bartrack { background: var(--green-50); border-radius: 999px; height: 16px; overflow: hidden; }
.bar { display: block; height: 100%; border-radius: 999px; min-width: 3px;
  background: linear-gradient(90deg, var(--green-500), var(--green-700)); }
.barn { font-family: var(--serif); font-weight: 700; font-size: 13.5px; color: var(--green-700); }

/* misc */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 12px; }
.section-head h2 { margin: 0; }
.section-head a { font-size: 13.5px; }
.trayrow { display: flex; gap: 10px; flex-wrap: wrap; }
.jobrow { padding: 6px 0; }
.row { display: flex; gap: 18px; flex-wrap: wrap; }
.col { flex: 1; min-width: 280px; }
/* ---------- settings shell (sidebar + content, Ancestry's settings shape) ---------- */
.settings-shell { display: flex; gap: 26px; align-items: flex-start; }
.settings-nav { width: 200px; flex: 0 0 200px; position: sticky; top: 78px; }
.settings-nav-label { font-size: var(--fs-tiny); letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); margin: 4px 0 8px; }
.settings-nav a { display: block; padding: 8px 12px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.settings-nav a:hover { background: var(--green-50); color: var(--green-700); text-decoration: none; }
.settings-nav a.active { background: var(--green-100); color: var(--green-700); }
.settings-content { flex: 1; min-width: 0; }
@media (max-width: 640px) {
  .settings-shell { flex-direction: column; }
  .settings-nav { width: 100%; flex: none; position: static; display: flex; gap: 4px; overflow-x: auto; }
  .settings-nav-label { display: none; }
}
/* ---------- the phone pass: relatives will land here from a text message ---------- */
@media (max-width: 640px) {
  .header-search { display: none; }
  .site-header .bar { gap: 8px; height: 54px; padding: 0 10px; }
  .brand { font-size: 18px; }
  .nav { margin-left: 0; flex: 1; overflow-x: auto; scrollbar-width: none;
    justify-content: flex-end; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 7px 10px; font-size: 13.5px; }
  main { padding: 18px 12px 50px; }
  :root { --fs-hero: 30px; --fs-h1: 25px; }
  .hero { padding: 26px 18px; }
  .collage { grid-template-columns: repeat(3, 1fr); }
  .collage a:nth-child(n+4) { display: none; }
  .profile { padding: 16px 14px; gap: 14px; }
  .avatar.xl { width: 84px; height: 84px; font-size: 30px; }
  .profile-actions { flex-direction: row; width: 100%; }
  .profile-actions .btn { flex: 1; }
  .tabs button { padding: 9px 12px; font-size: 14px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 8px; }
  .people-row { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 8px; }
  .pcard { padding: 10px; gap: 9px; }
  .clgrid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
  .statgrid { grid-template-columns: 1fr 1fr; }
  .tree-viewport { height: 60vh; min-height: 380px; }
  .fmap { height: 58vh; min-height: 360px; }
  .treelegend { display: none; }
  .seg a { padding: 7px 11px; font-size: 12.5px; }
  .toolbar { padding: 10px; gap: 8px; }
  .toolbar .grow { min-width: 100%; }
  .barrow { grid-template-columns: 88px 1fr 48px; gap: 7px; }
  .pop { width: 280px; }
  .facestrip img { width: 52px; height: 52px; }
  .minimap { height: 200px; }
  .stage { padding: 8px; }
  .stage-arrow { width: 38px; height: 38px; opacity: .8; }
  .today-item .yrs { font-size: 14px; }
}

/* ---------- print: person sheet + fan chart export (Ctrl+P is the PDF export) ---------- */
@media print {
  .site-header, .tabs, .seg, .tree-controls, .profile-actions, .toolbar, .actions,
  button, form, .stage-arrow, .treelegend, .pop, details, .facestrip a:nth-child(n+15) { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .card, .profile { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .tabpane[hidden] { display: none !important; }
  a { color: inherit; }
  .tree-viewport { height: auto; overflow: visible; background: none; border: none; }
  .fanchart { max-width: 100% !important; }
}

/* timeline (person page) */
.tl-item { display: grid; grid-template-columns: 66px 1fr auto; gap: 14px; align-items: start; padding: 11px 0; }
.tl-item + .tl-item { border-top: 1px solid var(--line-soft); }
.tl-year { font-family: var(--serif); font-weight: 700; font-size: 15px; color: var(--green-700); padding-top: 1px; }
.tl-body { border-left: 2px solid var(--green-100); padding-left: 14px; }
.tl-item.tl-birth .tl-body, .tl-item.tl-death .tl-body { border-left-color: var(--gold-500); }
.tl-item.tl-marriage .tl-body { border-left-color: var(--green-500); }
.tl-title { font-weight: 600; }

/* ---------- the tree: shared chrome ---------- */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
  background: #fff; }
.seg a { padding: 7px 16px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.seg a + a { border-left: 1px solid var(--line); }
.seg a:hover { background: var(--green-50); color: var(--green-700); text-decoration: none; }
.seg a.on { background: var(--green-700); color: #fff; }
.treelegend { margin-left: 10px; font-size: 12px; white-space: nowrap; }
.treelegend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  vertical-align: -1px; margin-right: 2px; }
.treelegend .b-pp, .treelegend .fl-full { background: var(--green-700); }
.treelegend .b-pm { background: var(--gold-500); }
.treelegend .b-mp { background: #4A7FA5; }
.treelegend .b-mm { background: #9C5A5A; }
.treelegend .fl-dates { background: var(--green-300, #7FA98A); }
.treelegend .fl-thin { background: var(--green-50); border: 1px solid var(--green-200); }
.treelegend .fl-empty { background: var(--bg); border: 1px dashed var(--line); }

/* family view: pan/zoom canvas, vertical photo-first cards */
.tree-viewport { position: relative; overflow: hidden; height: 74vh; min-height: 460px;
  background: radial-gradient(120% 120% at 50% 0%, var(--green-700), var(--green-900) 70%);
  border: 1px solid var(--green-900); border-radius: var(--radius); cursor: grab; box-shadow: var(--shadow); }
.tree-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.tree-edges { position: absolute; left: 0; top: 0; pointer-events: none; }
.tree-edges path { fill: none; stroke: rgba(255, 255, 255, .32); stroke-width: 2; }
.tree-edges path.ghostline { stroke: rgba(255, 255, 255, .16); stroke-dasharray: 5 5; }
.tree-edges text.edgelabel { font-size: 10.5px; font-weight: 600; fill: rgba(255, 255, 255, .75); }
.tnode { position: absolute; display: flex; flex-direction: column; align-items: center;
  gap: 7px; padding: 14px 8px 10px; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
  cursor: pointer; }
.tnode * { pointer-events: none; }
.tnode:hover { border-color: var(--green-500); box-shadow: var(--shadow-lift); text-decoration: none; }
.tnode.t-focal { border: 2px solid var(--gold-500); border-top-width: 4px; background: var(--gold-50, #FAF5EC); }
.tnode.br-pp { border-top-color: var(--green-700); }
.tnode.br-pm { border-top-color: var(--gold-500); }
.tnode.br-mp { border-top-color: #4A7FA5; }
.tnode.br-mm { border-top-color: #9C5A5A; }
.tnode .tav { width: 78px; height: 78px; border-radius: 50%; flex: none; background: var(--green-100);
  color: var(--green-700); display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 24px; font-family: var(--serif); overflow: hidden;
  box-shadow: 0 0 0 3px #fff, 0 1px 5px rgba(20, 18, 14, .25); }
.tnode .tav img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tnode .tinfo { min-width: 0; width: 100%; }
.tnode .tname { font-weight: 600; font-size: 13px; line-height: 1.25; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tnode .tyr { font-size: 11.5px; color: var(--muted); display: block; margin-top: 2px; }
.tnode.t-ghost { border: 2px dashed rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .08);
  color: #fff; box-shadow: none; }
.tnode.t-ghost .tav { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: none;
  font-size: 34px; font-family: var(--sans); }
.tnode.t-ghost .tname { color: #fff; }
.tnode.t-ghost .tyr { color: rgba(255, 255, 255, .75); }
.tnode.t-ghost:hover { border-color: rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .16); }
.tree-controls { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 6px; }
.tree-controls button { width: 36px; height: 36px; padding: 0; font-size: 17px; line-height: 1;
  border-radius: 50%; }

/* fan chart */
.fanwrap { overflow-x: auto; text-align: center; }
.fanchart { width: 100%; height: auto; }
.fanchart .wedge { stroke: #fff; stroke-width: 1.6; transition: filter .1s; }
.fanchart a:hover .wedge { filter: brightness(1.12); }
.fanchart .c-full { fill: var(--green-700); }
.fanchart .c-dates { fill: #7FA98A; }
.fanchart .c-thin { fill: var(--green-50); }
.fanchart .c-empty { fill: var(--bg); stroke-dasharray: 4 3; stroke: var(--green-200); }
.fanchart .c-void { fill: transparent; stroke: none; }
.fanchart .ftext { font-size: 12px; font-weight: 600; fill: #fff; }
.fanchart .c-thin + text, .fanchart .ftext.dark { fill: var(--ink); }
.fanchart .ftext.fadd { font-size: 18px; fill: var(--green-500); }
.fanchart .fyrs { font-size: 10.5px; font-weight: 400; opacity: .85; }
.fanchart .fanroot { fill: var(--gold-50, #FAF5EC); stroke: var(--gold-500); stroke-width: 3; }
.fanchart .fanname { font-family: var(--serif); font-size: 17px; font-weight: 700; fill: var(--ink); }
.fanchart .fanname + .fyrs { fill: var(--muted); }

/* pedigree columns */
.pedwrap { display: flex; gap: 26px; overflow-x: auto; padding: 6px 2px 14px; }
.pedcol { display: flex; flex-direction: column; justify-content: space-around; gap: 10px; flex: none; }
.pedpair { display: flex; flex-direction: column; justify-content: space-around; gap: 8px; flex: 1;
  border-left: 2px solid var(--green-200); border-radius: 2px; padding-left: 12px; margin: 6px 0; }
.pedcell { display: flex; align-items: center; }
.pedcard { display: flex; align-items: center; gap: 9px; width: 220px; padding: 8px 11px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); color: var(--ink); }
.pedcard:hover { border-color: var(--green-500); text-decoration: none; box-shadow: var(--shadow-lift); }
.pedcard.focal { border: 2px solid var(--gold-500); background: var(--gold-50, #FAF5EC); }
.pedcard.empty { color: var(--muted); font-size: 12.5px; border-style: dashed; box-shadow: none;
  background: none; justify-content: center; }
.pedcard .tav { width: 40px; height: 40px; border-radius: 50%; flex: none; background: var(--green-100);
  color: var(--green-700); display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-family: var(--serif); overflow: hidden; box-shadow: none; }
.pedcard .tav img { width: 100%; height: 100%; object-fit: cover; }
.pedcard .tname { font-weight: 600; font-size: 13px; line-height: 1.25; display: block; }
.pedcard .tyr { font-size: 11px; color: var(--muted); }

/* descendancy outline */
.dkids { list-style: none; margin: 4px 0 0; padding-left: 26px; border-left: 2px solid var(--green-100); }
.dkids li { padding: 3px 0; }
.dkids summary { cursor: pointer; list-style: none; }
.dkids summary::-webkit-details-marker { display: none; }
.dkids details > summary .drow::before { content: '▸'; color: var(--green-500); width: 14px;
  display: inline-block; transition: .1s; }
.dkids details[open] > summary .drow::before { content: '▾'; }
.drow { display: inline-flex; align-items: center; gap: 9px; padding: 3px 8px; border-radius: 999px; }
.drow:hover { background: var(--green-50); }
.drow.dleaf { padding-left: 22px; }
.drow .tav { width: 32px; height: 32px; border-radius: 50%; flex: none; background: var(--green-100);
  color: var(--green-700); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; font-family: var(--serif); overflow: hidden; }
.drow .tav img { width: 100%; height: 100%; object-fit: cover; }
.droot { padding: 4px 8px 10px 0; }
.droot .tav { width: 44px; height: 44px; }

/* Pill search fields — must stay LAST (equal-specificity vs generic input rules; source order wins). */
.hero-search input,
.hero-search input:focus { border: none; border-radius: 999px; box-shadow: none; background: transparent; }
/* background/color/placeholder live down here too, and for the same reason the border does:
   `input[type="search"]` above is (0,1,1), identical to `.header-search input`, so whichever
   comes last wins. Left up at the .header-search block they lost — the field rendered opaque
   white with a WHITE placeholder on it, i.e. an empty blob. That, plus the nav squeezing it
   thin, is what Carl saw as "a search circle". */
.header-search input { border: 1px solid transparent; border-radius: 999px; padding: 9px 14px 9px 36px;
  background: rgba(255,255,255,.16); color: #fff; }
.header-search input::placeholder { color: rgba(255,255,255,.75); }
.header-search input:focus { box-shadow: none; background: #fff; color: var(--ink);
  border-color: var(--gold-500); }
.header-search input:focus::placeholder { color: var(--muted); }

/* Media-class lane chips on the photo grid (migration 037). */
.classchips { display:flex; flex-wrap:wrap; gap:6px; margin:10px 0 14px; }
.classchip {
  display:inline-block; padding:5px 12px; border-radius:999px; font-size:13px;
  border:1px solid var(--line); background:var(--card); color:var(--ink);
  text-decoration:none; white-space:nowrap;
}
.classchip:hover { border-color:var(--green-500); }
.classchip.on { background:var(--green-500); border-color:var(--green-500); color:#fff; font-weight:600; }
