/* Under One Tree — mobile-first. Bright & sunny: crisp white, leaf green, sky blue.
   Familiar feed layout, none of Facebook's assets. */
:root {
  --bg: #f2f8f2;
  --card: #ffffff;
  --ink: #1d2b22;
  --muted: #5f7263;
  --accent: #1b7a3d;
  --green: #43a047;
  --green-dark: #2e7d32;
  --green-soft: #e8f5e9;
  --line: #d8e8d8;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px; line-height: 1.45;
  padding-bottom: 130px; /* room for tabbar + mebar */
}
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 14px;
  background: var(--green); border-bottom: none;
  box-shadow: 0 2px 6px rgba(46,125,50,.25);
}
.brand { font-weight: 900; font-size: 20px; color: #ffffff; letter-spacing: -.4px;
  display: inline-flex; align-items: center; gap: 7px; }
.brand .oak { flex: none; }
.oak { display: inline-block; vertical-align: middle; }
.oak-img { display: inline-block; vertical-align: middle; max-width: 100%; height: auto; }

@font-face {
  font-family: 'Rye';
  src: url('/fonts/rye.woff2?v=1') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
.logo-lockup { text-align: center; padding: 0 0 12px; background: transparent; }
.logo-lockup .logo-tree { width: 100%; height: auto; display: block; border-radius: 18px; }
.logo-name {
  font-family: 'Rye', Georgia, serif;
  font-size: clamp(30px, 9.5vw, 44px);
  color: #5d4037; letter-spacing: 1px; line-height: 1.08;
  margin: 8px 0 4px;
}
.logo-tag { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0 4px; }
.logo-tag::before, .logo-tag::after {
  content: ""; width: 54px; height: 2px; background: #212121; border-radius: 2px;
  box-shadow: 0 5px 0 #212121;
}
.logo-tag span { font-weight: 900; letter-spacing: 3px; font-size: 15px; white-space: nowrap; }
.lt-green { color: var(--green-dark); }
.lt-dark { color: #212121; }
.logo-lockup.compact .logo-name { font-size: 25px; }
.logo-lockup.compact .logo-tag span { font-size: 12px; letter-spacing: 2px; }
.logo-lockup.compact .logo-tag::before, .logo-lockup.compact .logo-tag::after { width: 34px; }
.branch-switch select {
  background: rgba(255,255,255,.22); color: #ffffff; border: none;
  border-radius: 10px; padding: 8px 10px; font-size: 15px; max-width: 46vw; font-weight: 700;
}
.branch-switch select option { color: var(--ink); }
.wrap { max-width: 640px; margin: 0 auto; padding: 12px 12px 0; }
/* The global feed is a 3-column layout (240px rails + fluid center) — it needs
   a wide main wrapper. The shared 640px .wrap was squeezing the center column
   down to ~80px and overlapping the rails. */
body.page-feed main.wrap { max-width: 1440px; }
.branch-note { color: var(--muted); font-size: 14px; margin: 2px 2px 10px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(46,125,50,.07);
}
.linkcard { display: block; color: inherit; text-decoration: none; }
.linkcard:active { background: var(--green-soft); }
.center { text-align: center; }
.bigbrand { font-size: 44px; }
h1 { font-size: 26px; font-weight: 900; letter-spacing: -.5px; margin: 10px 0 8px; color: var(--green-dark); }
h2 { font-size: 18px; margin: 0 0 10px; color: var(--green-dark); }
h3 { margin: 0 0 6px; font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: #c62828; }
.stack > * { margin-bottom: 10px; }
.stack > *:last-child { margin-bottom: 0; }
input, textarea, select {
  width: 100%; background: #ffffff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; font-size: 16px; font-family: inherit;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--green); border-color: var(--green); }
label { display: block; font-size: 14px; color: var(--muted); font-weight: 600; }
label input, label select, label textarea { margin-top: 4px; font-weight: 400; }
.btn {
  display: inline-block; background: var(--green); color: #ffffff;
  border: none; border-radius: 10px; padding: 12px 18px;
  font-size: 16px; font-weight: 700; cursor: pointer; text-decoration: none;
  box-shadow: 0 2px 6px rgba(67,160,71,.35);
}
.btn:active { transform: scale(.98); }
.btn.small { font-size: 14px; padding: 8px 14px; }
.btn.secondary { background: var(--green-soft); color: var(--green-dark); box-shadow: none; border: 1px solid var(--line); }
details summary { cursor: pointer; }
.filebtn {
  display: inline-block; background: var(--green-soft); color: var(--green-dark);
  border: 1px dashed var(--green); border-radius: 10px;
  padding: 10px 14px; font-size: 15px; cursor: pointer; text-align: center; font-weight: 600;
}
.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.post-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.post-body { margin: 6px 0 10px; white-space: pre-wrap; }
.post-photo { width: 100%; border-radius: 10px; display: block; }
.rsvp-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.chip {
  background: var(--green-soft); color: var(--green-dark); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; font-size: 14px; cursor: pointer; font-weight: 600;
}
.chip.on { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.linklike { background: none; border: none; color: var(--accent); font-size: 14px; cursor: pointer; padding: 0; font-weight: 600; }
/* family tree */
ul.tree, ul.tree ul { list-style: none; margin: 0; padding-left: 18px; }
ul.tree { padding-left: 0; }
ul.tree ul { border-left: 2px solid var(--green); margin: 6px 0 6px 8px; }
ul.tree li { margin: 8px 0; }
.person { background: var(--green-soft); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: inline-block; color: var(--ink); }

/* Family tree chart — boxes joined by branch lines, like a real pedigree. */
.tree-chart { overflow-x: auto; padding: 6px 2px 10px; }
.tree-chart ul { display: flex; justify-content: center; padding: 24px 0 0; margin: 0; position: relative; list-style: none; }
.tree-chart li { position: relative; padding: 24px 10px 0; margin: 0; text-align: center; list-style: none; }
.tree-chart li::before, .tree-chart li::after {
  content: ''; position: absolute; top: 0; right: 50%;
  width: 50%; height: 24px; border-top: 2px solid var(--green);
}
.tree-chart li::after { right: auto; left: 50%; border-left: 2px solid var(--green); }
.tree-chart li:only-child::before, .tree-chart li:only-child::after { display: none; }
.tree-chart li:only-child { padding-top: 0; }
.tree-chart li:first-child::before, .tree-chart li:last-child::after { border: 0 none; }
.tree-chart li:last-child::before { border-right: 2px solid var(--green); border-radius: 0 6px 0 0; }
.tree-chart li:first-child::after { border-radius: 6px 0 0 0; }
.tree-chart > ul > li::before, .tree-chart > ul > li::after { border: 0 none; }
.tree-chart ul ul::before {
  content: ''; position: absolute; top: 0; left: 50%;
  width: 0; height: 24px; border-left: 2px solid var(--green);
}
.tnode { display: inline-block; background: #fff; border: 2px solid var(--green); border-radius: 12px; padding: 8px 12px; min-width: 104px; box-shadow: 0 2px 6px rgba(46,125,50,.12); }
.tnode a { color: var(--ink); font-weight: 700; text-decoration: none; }
.tnode .yrs { display: block; font-size: 12px; color: var(--ink-soft); font-weight: 400; }
.tnode .mate { display: block; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 14px; }
.tnode-photo { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 4px; border: 2px solid var(--green-soft); }
.tnode.pet { border-style: dashed; }
.spouse { color: var(--accent); font-weight: 600; }
/* bottom tab bar */
.tabbar {
  position: fixed; bottom: 34px; left: 0; right: 0; z-index: 10;
  display: flex; background: #ffffff; border-top: 1px solid var(--line);
  box-shadow: 0 -1px 6px rgba(46,125,50,.08);
}
.tabbar a {
  flex: 1; text-align: center; color: var(--muted); text-decoration: none;
  padding: 10px 0 8px; font-size: 20px; display: flex; flex-direction: column; gap: 2px;
}
.tabbar a span { font-size: 11px; }
.tabbar a.on { color: var(--green-dark); }
.mebar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; height: 34px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; background: #ffffff; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.mebar form { margin: 0; }
@media (min-width: 700px) {
  body { font-size: 17px; }
  .wrap { padding-top: 20px; }
}
/* houses & street */
.housebar { display: flex; align-items: center; gap: 8px; }
/* Header layout: brand left, house pill truly centered, company mark right. */
.housebar-center { position: absolute; left: 50%; transform: translateX(-50%); }
.topline-right { color: #ffffff; font-size: 14px; font-weight: 600; white-space: nowrap; opacity: .95; }
@media (max-width: 640px) {
  .topline-right { display: none; }
  .housebar-center { position: static; transform: none; }
}
/* View-only lockdown (house admin toggle in the top bar) */
.lockbtn { background: rgba(255,255,255,.22); border: none; border-radius: 999px; padding: 6px 10px; font-size: 14px; cursor: pointer; color: #fff; line-height: 1; }
.lockbtn:hover { background: rgba(255,255,255,.38); }
.viewonly-banner { background: #fff8e1; color: #7a5c00; text-align: center; padding: 8px 12px; font-size: 13px; border-bottom: 1px solid #f0e0a8; }
.housebadge { background: rgba(255,255,255,.22); border: none; border-radius: 999px; padding: 6px 12px; font-size: 13px; white-space: nowrap; color: #ffffff; font-weight: 700; }
ul.kin { list-style: none; margin: 8px 0; padding: 0; }
ul.kin li { margin: 8px 0; }
ul.kin a { color: var(--accent); }
/* founder + welcome */
.founder-hero { padding: 28px 20px; }
.btn.big { font-size: 18px; padding: 14px 22px; display: inline-block; margin: 10px 0; }
.invitecode { font-size: 34px; font-weight: 800; letter-spacing: 4px; color: var(--green-dark);
  background: var(--green-soft); border: 2px dashed var(--green); border-radius: 12px; padding: 14px; margin: 12px 0; }
/* family kitchen */
.recipe-card { display: block; text-decoration: none; color: inherit; }
.recipe-photo { width: 100%; border-radius: 10px; margin-bottom: 8px; }
.recipe-detail h1 { margin-top: 6px; }
ul.ingredients { list-style: none; padding: 0; margin: 8px 0; }
ul.ingredients li { padding: 7px 10px; margin: 6px 0; background: var(--green-soft); border-radius: 8px; }
ul.ingredients li::before { content: "🧂 "; }
ol.steps { padding-left: 22px; margin: 8px 0; }
ol.steps li { margin: 10px 0; line-height: 1.5; }
/* chat */
.chatlog { max-height: 55vh; overflow-y: auto; }
.chatmsg { margin: 12px 0; padding: 10px 12px; background: var(--green-soft); border-radius: 12px; }
.chat-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; color: var(--muted); }
.chatmsg p { margin: 0; }
/* tap-to-call */
a.tel { color: var(--accent); font-weight: 700; }
/* 8-tab bar fit */
.tabbar a { font-size: 16px; }
.tabbar a span { font-size: 9px; }
.tab-avatar {
  width: 26px; height: 26px; border-radius: 50%; color: #fff;
  font-weight: 800; font-size: 14px; display: inline-flex; align-items: center; justify-content: center;
  margin: 0 auto;
}
.tabbar a.on .tab-avatar { outline: 2px solid var(--green-dark); }

/* ---- stories row ---- */
.stories-row {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px;
  scrollbar-width: none;
}
.stories-row::-webkit-scrollbar { display: none; }
.story-card {
  flex: none; width: 108px; height: 168px; border-radius: 12px; overflow: hidden;
  position: relative; text-decoration: none; color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.story-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-card .story-label {
  position: absolute; left: 8px; right: 8px; bottom: 8px;
  font-size: 13px; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.story-create {
  background: #ffffff; border: 1px solid var(--line); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.story-create .story-label { position: static; color: var(--ink); text-shadow: none; }
.story-plus {
  width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 28px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
/* story fullscreen viewer */
.story-viewer { text-align: center; }
.story-viewer-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.story-viewer img { width: 100%; border-radius: 14px; display: block; }
.story-caption { font-size: 17px; margin: 10px 0; }
.story-viewer .btn { margin-top: 8px; }

/* ---- messenger ---- */
.msg-row { display: flex; gap: 8px; margin: 10px 0; align-items: flex-end; }
.msg-row.mine { justify-content: flex-end; }
.msg-who { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.msg-bubble {
  background: #f0f2f5; border-radius: 18px; padding: 9px 14px; font-size: 16px;
  max-width: 75vw; word-wrap: break-word;
}
.msg-bubble.mine { background: var(--accent); color: #fff; }

/* ---- profile ---- */
.profile-cover {
  height: 150px; border-radius: 0 0 16px 16px; margin: -12px -12px 0;
  background: linear-gradient(135deg, #2e7d32 0%, #43a047 55%, #81c784 100%);
  display: flex; align-items: center; justify-content: center;
}
.profile-cover-art { font-size: 64px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
.profile-head { text-align: center; margin-top: -44px; padding-top: 56px; position: relative; }
.avatar.xl {
  width: 88px; height: 88px; font-size: 36px; margin: 0 auto;
  border: 4px solid #ffffff; box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.family-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 10px; }
.family-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; text-align: center; }

/* ---- Facebook-style feed ---- */
.avatar {
  width: 44px; height: 44px; border-radius: 50%; color: #fff;
  font-weight: 800; font-size: 20px; display: flex; align-items: center; justify-content: center;
  flex: none;
}
.avatar.sm { width: 32px; height: 32px; font-size: 15px; }
.fb-composer { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.fb-fakeinput {
  flex: 1; background: #f0f2f5; border: none; border-radius: 999px;
  padding: 12px 16px; font-size: 16px; color: var(--ink);
}
.fb-fakeinput::placeholder { color: #65676b; }
.fb-composer-actions { margin-top: 2px; }
.fb-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.fb-name { font-weight: 700; font-size: 15px; }
.fb-sub { font-size: 13px; color: #65676b; }
.fb-photo { width: calc(100% + 28px); margin: 8px -14px 0; display: block; }
.fb-stats { font-size: 14px; color: #65676b; padding: 10px 2px 6px; }
.fb-actions { display: flex; border-top: 1px solid var(--line); }
.fb-actions form { flex: 1; display: flex; }
.fb-act {
  flex: 1; background: none; border: none; padding: 11px 0; width: 100%;
  font-size: 15px; font-weight: 600; color: #65676b; cursor: pointer;
}
.fb-act.liked { color: var(--accent); }
.comment { display: flex; gap: 8px; margin: 10px 0; align-items: flex-start; }
.bubble { background: #f0f2f5; border-radius: 16px; padding: 8px 12px; font-size: 15px; }
.bubble .who { font-weight: 700; font-size: 13px; display: block; }
.comment-form { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.comment-form input { border-radius: 999px; background: #f0f2f5; border: none; }
.comment-form .btn { padding: 10px 14px; border-radius: 50%; }

/* ---- Month grid (calendar) ---- */
.monthgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; }
.mg-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.mg-day { min-height: 64px; border: 1px solid #e3e6df; border-radius: 8px; padding: 3px; font-size: 12px; background: #fff; overflow: hidden; }
.mg-day.empty { background: transparent; border: none; }
.mg-day.today { border: 2px solid var(--green); }
.mg-num { font-weight: 700; font-size: 12px; margin-bottom: 2px; }
.mg-ev { display: block; font-size: 10px; line-height: 1.25; background: #e8f5e9; color: #2e7d32; border-radius: 4px; padding: 1px 3px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.mg-more { font-size: 10px; color: var(--muted); }

/* ---- Presence + roster ---- */
.presence { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #bdbdbd; flex: none; }
.presence.on { background: #43a047; box-shadow: 0 0 6px rgba(67,160,71,.8); }
.roster-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid #f0f0f0; text-decoration: none; color: inherit; }
.roster-row:last-child { border-bottom: none; }

/* ---- Address fieldset ---- */
.addrset { border: 1px solid #e3e6df; border-radius: 10px; padding: 10px; margin: 0; }
.addrset legend { font-size: 14px; padding: 0 6px; }
.addrset input { margin-bottom: 8px; }
.addrset input:last-child { margin-bottom: 0; }

/* ---- Facebook-style profile ---- */
.fb-cover { height: 190px; border-radius: 18px; overflow: hidden; background: linear-gradient(135deg, #2e7d32, #66bb6a);
  display: flex; align-items: center; justify-content: center; margin-bottom: -58px; position: relative; z-index: 0; }
.fb-cover-art { opacity: .9; }
.fb-idcard { text-align: center; padding-top: 66px; position: relative; z-index: 1; }
.fb-avatar { width: 120px; height: 120px; font-size: 48px; margin: 0 auto; border: 4px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.fb-cols { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
@media (min-width: 760px) { .fb-cols { grid-template-columns: 320px 1fr; align-items: start; } .fb-side { position: sticky; top: 12px; } }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
img.avatar { object-fit: cover; }

/* ---- Always-visible online panel (right edge) ---- */
.online-strip { position: fixed; right: 10px; top: 50%; transform: translateY(-50%); z-index: 60;
  width: 168px; max-height: 60vh; overflow-y: auto;
  background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 14px;
  padding: 8px; box-shadow: 0 2px 12px rgba(0,0,0,.14); }
.os-head { display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 12px; padding: 0 2px 6px; user-select: none; touch-action: none; }
.os-rows { display: flex; flex-direction: column; gap: 2px; }
.os-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 8px;
  text-decoration: none; color: var(--ink); }
a.os-row:hover { background: var(--green-soft); }
.os-wrap { position: relative; display: block; flex: none; }
.os-dot { position: absolute; bottom: -1px; right: -1px; border: 2px solid #fff; }
.os-name { flex: 1; min-width: 0; font-size: 12px; font-weight: 600; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-name em { display: block; font-style: normal; font-weight: 400; font-size: 11px; color: var(--ink-soft); }
.os-status { flex: none; font-size: 10px; color: var(--green); font-weight: 700;
  display: flex; align-items: center; gap: 4px; }
.os-none { font-size: 12px; color: var(--ink-soft); }
/* (online panel floats; no content shift) */

/* ---- Step-connections: dotted gray connectors ---- */
.tree-chart li.step::before { border-top: 2px dotted #9e9e9e; }
.tree-chart li.step::after { border-left: 2px dotted #9e9e9e; }
.tree-chart li.step:last-child::before { border-right: 2px dotted #9e9e9e; }
.tree-chart li.step > .tnode { border-style: dotted; border-color: #9e9e9e; }

/* ---- Online strip toggle + empty state ---- */
.os-toggle { border: none; background: none; color: var(--ink-soft); font-size: 18px; line-height: 1;
  cursor: pointer; padding: 2px 6px; border-radius: 999px; }
.os-toggle:hover { background: var(--green-soft); color: var(--ink); }
.os-reopen { position: fixed; right: 10px; top: 50%; transform: translateY(-50%); z-index: 60;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255,255,255,.94); box-shadow: 0 2px 12px rgba(0,0,0,.14);
  font-size: 20px; cursor: pointer; }
.os-reopen[hidden], .online-strip[hidden] { display: none; }

/* ---- Tree zoom controls ---- */
.tree-zoom { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-bottom: 6px; }
.tree-zoom button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; font-size: 18px; cursor: pointer; line-height: 1; color: var(--ink); }
.tree-zoom button:hover { background: var(--green-soft); }
#zoomLabel { font-size: 13px; color: var(--ink-soft); min-width: 46px; text-align: center; }
.tree-canvas { transition: transform .15s ease; }
/* Your own box on the tree — the view the page centers on. */
#meNode > .tnode { outline: 3px solid var(--green); outline-offset: 2px; }

/* ---- Floating popup chat box ---- */
.chat-pop { position: fixed; right: 12px; bottom: 12px; z-index: 80; width: 300px;
  max-width: calc(100vw - 24px); height: 400px; max-height: 62vh;
  display: flex; flex-direction: column; background: #fff;
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.22); overflow: hidden; }
.chat-pop[hidden] { display: none; }
.chat-pop-head { display: flex; align-items: center; gap: 8px; background: var(--green);
  color: #fff; padding: 8px 8px 8px 10px; cursor: default; user-select: none; }
.chat-pop-photo { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }
.chat-pop-who { flex: 1; min-width: 0; line-height: 1.25; }
.chat-pop-name { display: block; font-weight: 700; font-size: 14px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.chat-pop-active { display: flex; align-items: center; gap: 4px; font-size: 11px; opacity: .9; }
.chat-pop-min, .chat-pop-open, .chat-pop-x { color: #fff; background: none; border: none; font-size: 17px;
  cursor: pointer; text-decoration: none; line-height: 1; padding: 2px 4px; flex: none; }
.chat-pop.min .chat-pop-msgs, .chat-pop.min .chat-pop-form { display: none; }
.chat-pop.min { height: auto; }
.chat-pop-msgs { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column;
  gap: 6px; background: #f7f5f0; }
.cp-msg { max-width: 82%; padding: 6px 10px; border-radius: 12px; font-size: 14px;
  overflow-wrap: break-word; }
.cp-msg.me { align-self: flex-end; background: var(--green); color: #fff; }
.cp-msg.them { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.cp-meta { font-size: 10px; opacity: .75; margin-bottom: 2px; }
.chat-pop-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); background: #fff; }
.chat-pop-form input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 12px; font-size: 14px; }
.chat-pop-form button { border: none; background: var(--green); color: #fff; border-radius: 50%;
  width: 36px; height: 36px; font-size: 16px; cursor: pointer; flex: none; }

/* ---------- Focus-person tree (Oct 2026): one page per person, generations run up/down ---------- */
.focus-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; background: var(--green-soft); border-radius: 12px; margin: 10px 0 4px; }
.focus-nav-name { font-size: 17px; }
.focus-nav select { max-width: 200px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); font-size: 14px; }
/* Expanded-view toggle switch (tree page) */
.expand-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; margin-left: auto; }
.expand-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.expand-toggle .track { width: 46px; height: 26px; border-radius: 999px; background: #c9d2c0; position: relative; transition: background .2s; flex: none; box-shadow: inset 0 1px 3px rgba(0,0,0,.18); }
.expand-toggle .knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: left .18s; }
.expand-toggle input:checked + .track { background: #2e7d32; }
.expand-toggle input:checked + .track .knob { left: 23px; }
.expand-toggle input:focus-visible + .track { outline: 2px solid #2e7d32; outline-offset: 2px; }
.expand-toggle .lbl { font-size: 13px; color: var(--muted); font-weight: 700; }
.focus-wrap { max-width: 560px; margin: 0 auto; }
.gen-label { text-align: center; font-weight: 800; font-size: 13px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--green-dark); margin: 18px 0 8px; }
.gen-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.gen-col { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.gen-conn { width: 2px; height: 26px; background: var(--green); margin: 6px auto; border-radius: 2px; opacity: .55; }
.pchip { display: inline-flex; align-items: center; gap: 8px; background: #fff;
  border: 2px solid var(--green); border-radius: 999px; padding: 5px 12px 5px 5px;
  text-decoration: none; color: var(--ink); box-shadow: 0 2px 6px rgba(46,125,50,.10);
  max-width: 100%; }
.pchip.big { border-radius: 14px; padding: 8px 12px 8px 8px; }
.pchip:active { transform: scale(.97); }
.pchip-photo { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none;
  border: 2px solid var(--green-soft); }
.pchip.big .pchip-photo { width: 46px; height: 46px; }
.pchip-av { width: 38px; height: 38px; border-radius: 50%; flex: none; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 800; font-size: 17px;
  background: var(--green-soft); color: var(--green-dark); }
.pchip.big .pchip-av { width: 46px; height: 46px; font-size: 20px; }
.pchip-tx { display: flex; flex-direction: column; min-width: 0; }
.pchip-nm { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchip .yrs { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.focus-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .focus-grid { grid-template-columns: 1fr 1fr; align-items: stretch; } }
.focus-card { background: #fff; border: 3px solid var(--green); border-radius: 16px;
  padding: 18px 14px; text-align: center; box-shadow: 0 4px 14px rgba(46,125,50,.14); }
.focus-card.me { outline: 3px solid var(--green-dark); outline-offset: 2px; }
.focus-card.spouse-card { text-decoration: none; color: var(--ink); border-style: solid; border-color: var(--accent); display: block; }
.focus-card.spouse-card:active { transform: scale(.98); }
.focus-photo { width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--green); margin: 0 auto 8px; display: block; }
.focus-name { font-size: 21px; font-weight: 800; }
.focus-card .yrs { font-size: 13px; color: var(--muted); }
.focus-tags { margin: 6px 0; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.you-badge { background: var(--green); color: #fff; font-weight: 800; font-size: 12px;
  letter-spacing: 1px; border-radius: 999px; padding: 3px 10px; }
details.more { margin: 8px 0; text-align: center; }
details.more summary { cursor: pointer; color: var(--accent); font-weight: 700; font-size: 14px;
  display: inline-block; padding: 6px 14px; border: 1px dashed var(--green); border-radius: 999px; }
details.more .gen-row, details.more .gen-col { margin-top: 10px; }

/* ---- Birthdays under the messenger panel ---- */
.os-bdays { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 2px; }
.os-sec { font-size: 10px; font-weight: 800; color: var(--ink-soft);
  padding: 8px 4px 2px; text-transform: uppercase; letter-spacing: .05em; }

/* ---- Create-story floating panel (feed, right side, messenger-style) ---- */
.story-fab { position: fixed; right: 10px; top: 78px; z-index: 55; width: 108px;
  background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,.14); padding: 12px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-decoration: none; color: var(--ink); font-size: 13px; font-weight: 700; text-align: center; }
.story-fab-plus { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 28px; font-weight: 700; display: flex; align-items: center; justify-content: center; line-height: 1; }
@media (max-width: 759px) { .story-fab { display: none; } }
@media (min-width: 760px) { .story-create-row { display: none; } }

/* ---- Facebook-style profile header ---- */
.fb-profile-head { padding: 0; overflow: hidden; }
.fb-profile-head .fb-cover { margin-bottom: 0; border-radius: 0; }
.fb-cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-edit { position: absolute; right: 12px; bottom: 12px; margin: 0; }
.cover-edit label { display: inline-block; background: rgba(255,255,255,.94); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.fb-idrow { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
  padding: 0 16px 6px; flex-wrap: wrap; }
.fb-idleft { display: flex; align-items: flex-end; gap: 14px; }
.fb-avatar-lg { width: 132px; height: 132px; font-size: 52px; border: 4px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.18); margin-top: -66px; position: relative; z-index: 1; flex: none; }
.fb-idmeta h1 { margin: 0; font-size: 26px; }
.fb-idactions { display: flex; gap: 8px; padding-bottom: 8px; flex-wrap: wrap; }
.fb-btn-blue { background: #1877f2; color: #fff; border-color: #1877f2; }
.fb-tabs { display: flex; gap: 2px; border-top: 1px solid var(--line); margin-top: 8px;
  padding: 0 12px; overflow-x: auto; }
.fb-tabs > a, .fb-more > summary { padding: 12px 14px; font-weight: 600; font-size: 14px;
  color: var(--ink-soft); text-decoration: none; border-bottom: 3px solid transparent;
  white-space: nowrap; list-style: none; cursor: pointer; }
.fb-tabs > a.on { color: var(--accent); border-bottom-color: var(--accent); }
.fb-more { position: relative; }
.fb-more > summary::-webkit-details-marker { display: none; }
.fb-more-menu { position: absolute; right: 0; top: 100%; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.15); min-width: 190px; z-index: 30;
  padding: 6px; display: flex; flex-direction: column; }
.fb-more-menu a { padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 14px; }
.fb-more-menu a:hover { background: var(--green-soft); }

/* ---- Feed margin rails (desktop only, feed page) ---- */
.feed-rail { display: none; }
@media (min-width: 1080px) {
  .feed-grid { display: grid; grid-template-columns: 200px minmax(0,1fr) 200px; gap: 16px;
    align-items: start; width: 1064px; margin-left: -224px; margin-right: -224px; }
  .feed-rail { display: block; position: sticky; top: 12px; }
  .story-fab { display: none; }
  .online-strip { right: auto; left: 10px; }
}
.rail-card h3 { margin: 0; font-size: 14px; }
.rail-story { display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-decoration: none; color: inherit; text-align: center; }

/* ---- Memorial share row ---- */
.share-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---- Rummage sale (family marketplace) ---- */
.sale-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 760px) { .sale-grid { grid-template-columns: repeat(3, 1fr); } }
.sale-card { display: block; text-decoration: none; color: inherit; padding: 0; overflow: hidden; }
.sale-card img, .sale-nophoto { width: 100%; aspect-ratio: 1; object-fit: cover; display: flex;
  align-items: center; justify-content: center; font-size: 44px; background: var(--green-soft); }
.sale-price { font-weight: 800; font-size: 17px; padding: 8px 10px 0; }
.sale-title { padding: 2px 10px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sale-card .muted { padding: 0 10px 10px; }

/* ---- Memorial tribute wall ---- */
.mem-prompt { background: linear-gradient(135deg, #1b5faa, #2f7fd0); color: #fff; }
.mem-prompt h2 { color: #fff; }
.mem-prompt textarea { border-radius: 10px; }

/* Memorial photo layouts */
.media-switch { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:12px }
.media-switch button { border:1px solid #cfe0d4; background:#f4faf6; color:#2f6b45; border-radius:999px; padding:6px 14px; font-size:14px; cursor:pointer }
.media-switch button.on { background:#2f9e44; color:#fff; border-color:#2f9e44 }
.media-view { display:none }
.media-view.on { display:block }
.photo-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:8px }
.p-item { position:relative; aspect-ratio:1; overflow:hidden; border-radius:10px; cursor:pointer; background:#e8f0ea }
.p-item img { width:100%; height:100%; object-fit:cover; display:block }
.collage-grid { display:grid; grid-template-columns:repeat(3,1fr); grid-auto-rows:110px; gap:8px }
.c-item { position:relative; overflow:hidden; border-radius:10px; cursor:pointer; background:#e8f0ea }
.c-item img { width:100%; height:100%; object-fit:cover; display:block }
.c-item.tall { grid-row:span 2 }
.c-item.wide { grid-column:span 2 }
.dl-badge { position:absolute; bottom:6px; right:6px; background:rgba(0,0,0,.65); color:#fff; border-radius:8px; padding:3px 9px; font-size:14px; text-decoration:none }
.dl-badge:hover { background:rgba(0,0,0,.85) }
.loop-wrap { text-align:center }
.loop-stage { width:100%; height:62vh; min-height:340px; background:#101510; border-radius:12px; overflow:hidden; position:relative }
.loop-slide { width:100%; height:100%; display:flex; align-items:center; justify-content:center }
.loop-slide img { width:100%; height:100%; object-fit:contain; display:block }
.loop-wrap.is-fs { background:#0a0d0a; display:flex; flex-direction:column; justify-content:center; padding:16px; height:100% }
.loop-wrap.is-fs .loop-stage { height:calc(100vh - 175px); min-height:0 }
.loop-wrap.is-fs .muted, .loop-wrap.is-fs #loopCap { color:#cfd8cf }
#lightbox { position:fixed; inset:0; background:rgba(0,0,0,.88); z-index:9999; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:20px }
#lightbox[hidden] { display:none }
#lbImg { max-width:92vw; max-height:78vh; border-radius:10px }
/* Mobile business card: the desktop rails don't exist under 1080px */
.rail-mobile { margin-bottom:12px }
@media (min-width:1080px) { .rail-mobile { display:none } }
/* Free-floating feed cards — drift like the messenger panel */
/* Flowing feed card columns — cards stack with even gaps; a card that grows
   pushes the ones below it down, so nothing can ever overlap or touch.
   Fixed width, never wider; narrow screens and zoom reflow to one stack. */
#flowCols { display:grid; grid-template-columns:240px minmax(0,1fr) 240px; gap:16px; align-items:start; padding:12px 12px 24px; max-width:1400px; margin:0 auto; }
#flowCols .feed-center { max-width:680px; margin:0 auto; width:100%; min-width:0; display:flex; flex-direction:column; gap:12px; }
.flow-col { width:240px; flex:none; display:flex; flex-direction:column; gap:12px; min-height:60px; }
.rail-card { width:100%; }
#flowCols .rail-card .rail-head { cursor:grab; }
#flowCols .rail-card[data-locked] .rail-head { cursor:default; }
#flowCols .rail-card.dragging { position:fixed; z-index:99; margin:0; opacity:.92; box-shadow:0 14px 30px rgba(0,0,0,.25); pointer-events:none; }
.card-drop-ph { border:2px dashed #2f9e44; border-radius:10px; background:rgba(47,158,68,.07); width:100%; flex:none; }
#floatCards .rail-card { margin:0 0 12px; }
.drag-hint { color:#9db5a4; letter-spacing:2px; user-select:none; font-size:14px }
.rail-head { touch-action:none; user-select:none; }
.rail-card[data-locked] .rail-head { cursor:default; }
@media (min-width:1080px) {
  body.page-feed .online-strip, body.page-feed .os-reopen { display:none !important; }
}
@media (max-width:1079px) {
  #flowCols { display:flex; flex-direction:column; padding:12px; }
  .flow-col { width:100%; }
  .flow-col[data-col="left"] { order:1; }
  .flow-col[data-col="right"] { order:2; }
  #flowCols .feed-center { order:3; }
  body.page-feed .online-strip, body.page-feed .os-reopen { display:none !important; }
}
/* Founder page: returning-user sign-in block under the branding */
.returning-login { background:#f2f7f2; border:1px solid #dfe9df; border-radius:10px; padding:14px 16px; margin:8px 0 18px; text-align:left; }
.returning-login .rl-title { margin:0 0 10px; text-align:center; font-size:15px; }
.returning-login .stack { gap:10px; }
.rl-divider { display:flex; align-items:center; gap:10px; margin:14px 0 2px; color:#8aa08a; font-size:12px; }
.rl-divider:before, .rl-divider:after { content:''; flex:1; height:1px; background:#dfe9df; }
/* Feed card lock switches (settings) */
.lockrow { display:flex; align-items:center; gap:10px; padding:9px 0; border-bottom:1px solid var(--line, #e8efe9); cursor:pointer }
.lockrow:last-of-type { border-bottom:none }
.switch { position:relative; width:48px; height:27px; flex:none; display:inline-block }
.switch input { opacity:0; width:0; height:0 }
.switch .slider { position:absolute; inset:0; background:#c9d6cc; border-radius:999px; transition:.2s; cursor:pointer }
.switch .slider:before { content:''; position:absolute; width:21px; height:21px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.2s; box-shadow:0 1px 3px rgba(0,0,0,.25) }
.switch input:checked + .slider { background:#2f9e44 }
.switch input:checked + .slider:before { transform:translateX(21px) }
/* Locked rail cards don't move */
.rail-card[data-locked] { cursor:default }
@media (min-width:1080px) {
  body.page-feed .online-strip, body.page-feed .os-reopen { display:none !important; }
}
