/* Rees & Tomsett family site. Four styles, chosen with html[data-theme]:
   parchment (default), victorian, chart (like Mum's framed chart), album (heritage album). */

:root, [data-theme="parchment"] {
  --bg: #e9d6ac; --paper: #f3e6c8; --card: rgba(251,243,224,.94); --ink: #3b2a17; --ink-2: #6e5634;
  --line: #8a6a3f; --accent: #6b3a1f; --field: rgba(255,250,236,.75); --card-solid: #f6ead0; --hover: rgba(139,103,58,.12);
  --display: "IM Fell English SC", "IM Fell English", Georgia, serif; --serif: "IM Fell English", Georgia, serif;
  --body: "IM Fell English", Georgia, serif; --shadow: 0 10px 30px rgba(70,45,15,.22);
  --tree-ink: #4a3218; --tree-fill: rgba(250,240,215,.72); --name-size: 20px;
  --page-bg:
    radial-gradient(ellipse at 50% 35%, transparent 35%, rgba(110,70,25,.30) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .32 0 0 0 0 .15 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(135deg, #f1e3c2, #e8d3a6 60%, #dcc28f);
}
[data-theme="victorian"] {
  --bg: #f6f1e4; --paper: #f6f1e4; --card: #fffdf6; --ink: #1f2a24; --ink-2: #6d5a2c; --line: #b9a46a;
  --accent: #233d31; --field: #fffdf6; --hover: #efe8d4;
  --display: "Cinzel", Georgia, serif; --serif: "EB Garamond", Georgia, serif; --body: "EB Garamond", Georgia, serif;
  --shadow: 0 8px 24px rgba(40,30,10,.14); --tree-ink: #233d31; --tree-fill: #fffdf6;
  --page-bg: #f6f1e4;
}
[data-theme="chart"] {
  --bg: #fbfaf6; --paper: #fbfaf6; --card: #ffffff; --ink: #1d1d1d; --ink-2: #555; --line: #1d1d1d;
  --accent: #2f6b45; --field: #fff; --hover: #f1efe8;
  --display: "Cormorant Garamond", Georgia, serif; --serif: "Cormorant Garamond", Georgia, serif;
  --body: "Cormorant Garamond", Georgia, serif; --script: "Pinyon Script", cursive;
  --shadow: 0 6px 20px rgba(0,0,0,.08); --tree-ink: #1d1d1d; --tree-fill: transparent;
  --page-bg: #fbfaf6;
}
[data-theme="album"] {
  --bg: #261b14; --paper: #2b2018; --card: linear-gradient(#f4ead6, #e9dcc0); --ink: #2e2117; --ink-2: #7a5b33;
  --line: #c9a764; --accent: #8a6a2e; --field: rgba(255,255,255,.08); --hover: rgba(255,255,255,.5);
  --display: "Cormorant Garamond", Georgia, serif; --serif: "Cormorant Garamond", Georgia, serif;
  --body: "Cormorant Garamond", Georgia, serif; --shadow: 0 14px 30px rgba(0,0,0,.5);
  --tree-ink: #c9a764; --tree-fill: #efe3c9;
  --page-bg: radial-gradient(ellipse at 30% 20%, #3b2c22 0%, #261b14 70%);
}

* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; min-height: 100%; }
.tree-page, .login-page { height: 100%; }
body { background: var(--page-bg); background-attachment: fixed; color: var(--ink); font: 17px/1.45 var(--body); }
a { color: var(--accent); }
button, select, input { font: inherit; }
button { cursor: pointer; }

/* ---------------------------------------------------------------- login */
.login-page { display: grid; place-items: center; min-height: 100%; padding: 24px 16px; }
.login-card { width: 100%; max-width: 390px; background: var(--card); border: 1px solid var(--line);
  outline: 1px solid var(--line); outline-offset: 4px; padding: 36px 30px 28px; box-shadow: var(--shadow); text-align: center; }
[data-theme="album"] .login-card { border-radius: 6px; outline: 0; }
.login-mark { width: 56px; height: 56px; }
.login-card h1 { font: 32px/1.15 var(--display); margin: 14px 0 8px; letter-spacing: .03em; }
.login-card h1 span { font: italic 22px var(--serif); color: var(--ink-2); letter-spacing: 0; }
.login-intro { color: var(--ink-2); margin: 0 0 20px; font-size: 16px; }
.login-error { background: #f6ddd5; color: #8a2a17; padding: 10px 12px; font-size: 15px; }
.login-card form { display: grid; gap: 14px; text-align: left; }
.login-card label { display: grid; gap: 6px; font-size: 15px; color: var(--ink-2); }
.login-card input { font-size: 17px; padding: 10px 12px; border: 1px solid var(--line); background: #fffdf7; color: #2b2622; border-radius: 2px; }
.login-card input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.login-card button { margin-top: 6px; padding: 11px; border: 0; background: var(--accent); color: #fff8ec;
  font: 19px var(--display); letter-spacing: .06em; border-radius: 2px; }
[data-theme="album"] .login-card button { background: #6b4a22; }
.login-help { color: var(--ink-2); font-size: 14px; margin: 18px 0 0; font-style: italic; }

/* ---------------------------------------------------------------- header */
.topbar { position: fixed; inset: 0 0 auto 0; z-index: 20;
  padding: 8px 22px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
  background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(6px); }
[data-theme="album"] .topbar { background: rgba(38,27,20,.88); color: #f1e6d0; }
.topbar-row { display: flex; align-items: center; gap: 18px; }
.topbar-row .spacer { flex: 1; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: inherit; }
.tabs { display: flex; gap: 2px; margin-top: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 6px 14px 7px; color: var(--ink-2); font-style: italic; text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); font-style: normal; border-bottom-color: var(--accent); }
[data-theme="album"] .tabs a { color: #c8b28a; }
[data-theme="album"] .tabs a[aria-current="page"] { color: #f1e6d0; border-bottom-color: #c9a764; }
[data-theme="victorian"] .tabs a { font-style: normal; font-family: "Cinzel", serif; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand strong { display: block; font: 24px/1.05 var(--display); white-space: nowrap; letter-spacing: .03em; }
.brand span { display: block; font: italic 14px var(--serif); color: var(--ink-2); }
[data-theme="victorian"] .brand strong { font-weight: 700; letter-spacing: .1em; font-size: 20px; color: var(--accent); }
[data-theme="chart"] .brand strong { text-transform: uppercase; letter-spacing: .16em; font-weight: 500; }
[data-theme="chart"] .brand span { font: 19px var(--script); color: var(--accent); }
[data-theme="album"] .brand strong { color: #e8cf98; font-weight: 700; }
[data-theme="album"] .brand span { color: #c8b28a; }
.search { position: relative; flex: 1; max-width: 400px; margin-left: auto; }
.search input { width: 100%; padding: 7px 4px; border: 0; border-bottom: 1px solid var(--line); background: transparent;
  color: inherit; font-style: italic; font-size: 17px; }
[data-theme="victorian"] .search input { border: 1px solid var(--line); padding: 7px 14px; background: var(--field); }
[data-theme="album"] .search input { border: 1px solid rgba(214,180,110,.5); border-radius: 999px; padding: 7px 16px; color: #f1e6d0; }
.search input::placeholder { color: var(--ink-2); opacity: .85; }
[data-theme="album"] .search input::placeholder { color: #b9a582; }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
#results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); max-height: 60vh; overflow: auto; }
#results li { padding: 7px 10px; cursor: pointer; }
#results li small { color: var(--ink-2); margin-left: 8px; font-style: italic; }
#results li[aria-selected="true"], #results li:hover { background: var(--hover); }
.user { display: flex; align-items: center; gap: 16px; font-size: 16px; white-space: nowrap; }
.user .who { color: var(--ink-2); font-style: italic; }
[data-theme="album"] .user a { color: #e8cf98; }
[data-theme="album"] .user .who { color: #c8b28a; }
.theme-pick { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-style: italic; }
.theme-pick select { padding: 4px 6px; border: 1px solid var(--line); background: var(--field); color: inherit; border-radius: 2px; font-style: normal; }
[data-theme="album"] .theme-pick { color: #c8b28a; }
[data-theme="album"] .theme-pick select { color: #f1e6d0; background: #3b2c22; }

/* ---------------------------------------------------------------- tree */
.tree-page { overflow: hidden; }
/* the Tree sits in a framed box like "Family of…", below its title and options */
.tree-head { position: fixed; left: 16px; right: 16px; top: calc(var(--header-h, 96px) + 16px); text-align: center; z-index: 4; }
#stage { position: fixed; top: var(--tree-top, 250px); left: 20px; right: 20px; bottom: 14px; overflow: hidden;
  background: var(--card-solid, var(--card)); border: 1px solid var(--line); box-shadow: var(--shadow); }
[data-theme="parchment"] #stage { outline: 1px solid var(--line); outline-offset: -6px; }
[data-theme="album"] #stage { border-radius: 6px; border-color: #c9a764; }
[data-theme="chart"] .tree-head { top: calc(var(--header-h, 96px) + 40px); }
[data-theme="chart"] #stage { left: 50px; right: 50px; bottom: 50px; }
.tree-page #panel { top: var(--tree-top, 250px); right: 28px; bottom: 22px; }
[data-theme="chart"] .tree-page #panel { right: 58px; bottom: 58px; }
#canvas { position: absolute; inset: 0; touch-action: none; cursor: grab; }
#canvas.dragging { cursor: grabbing; }
#canvas svg { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-select: none; }
.loading { position: absolute; top: 50%; left: 0; right: 0; text-align: center; color: var(--ink-2); font: italic 22px var(--serif); }

#tree .person { cursor: pointer; }
#tree .hit { fill: transparent; }
#tree .link, #tree .couple, #tree .rule { stroke: var(--tree-ink); stroke-width: 1.3; fill: none; }
#tree .link.coloured { stroke-width: 1.8; opacity: 1; }
#tree text { fill: var(--tree-ink); text-anchor: middle; }
#tree .name { font: var(--name-size, 20px) var(--serif); }
#tree .years { font: italic 15px var(--serif); }
#tree .place { font: italic 12.5px var(--serif); opacity: .75; }
#tree .marr { font: italic 14px var(--serif); paint-order: stroke; stroke: var(--bg); stroke-width: 6px; stroke-linejoin: round; }
#tree .frame { fill: none; stroke: var(--tree-ink); stroke-width: 1.6; }
#tree .cameo-bg { fill: #8d7457; }
#tree .cameo-head { fill: #c8b08a; }
#tree .person:hover .box, #tree .person:hover .rule { filter: brightness(.95); stroke-width: 2; }
.highlight-ring { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-dasharray: 8 5; pointer-events: none; }

/* parchment */
[data-theme="parchment"] #tree .box { fill: var(--tree-fill); stroke: var(--tree-ink); stroke-width: 1.1; }
[data-theme="parchment"] #tree .box-inner { fill: none; stroke: var(--tree-ink); stroke-width: .9; }
[data-theme="parchment"] #tree .name { font-size: 20px; }
[data-theme="parchment"] .highlight-ring { stroke: #8b2f12; }

/* victorian */
[data-theme="victorian"] #tree .box { fill: #fffdf6; stroke: #233d31; stroke-width: 1.2; }
[data-theme="victorian"] #tree .box-outer { fill: #fffdf6; stroke: #b9a46a; stroke-width: 1; filter: drop-shadow(0 3px 5px rgba(40,30,10,.12)); }
[data-theme="victorian"] #tree .name { font: 600 14.5px "Cinzel", serif; letter-spacing: .04em; fill: #233d31; }
[data-theme="victorian"] #tree .years { font: 15.5px "EB Garamond", serif; font-style: normal; fill: #6d5a2c; }
[data-theme="victorian"] #tree .place { font: italic 13px "EB Garamond", serif; fill: #6f6a5c; opacity: 1; }
[data-theme="victorian"] #tree .medal { fill: #233d31; stroke: #b9a46a; stroke-width: 2.5; }
[data-theme="victorian"] #tree .medal-m { font: 600 10px "Cinzel", serif; fill: #ead9a2; }
[data-theme="victorian"] #tree .medal-y { font: 600 12.5px "Cinzel", serif; fill: #ead9a2; }
[data-theme="victorian"] #tree .link, [data-theme="victorian"] #tree .couple { stroke: #233d31; }

/* chart (like Mum's framed chart) */
[data-theme="chart"] #tree text { text-anchor: start; }
[data-theme="chart"] #tree .name { font: 26px "Pinyon Script", cursive; }
[data-theme="chart"] #tree .years { font: 500 15px "Cormorant Garamond", serif; font-style: normal; }
[data-theme="chart"] #tree .place { font: italic 500 14px "Cormorant Garamond", serif; opacity: .8; }
[data-theme="chart"] #tree .marr { text-anchor: middle; font: italic 500 15px "Cormorant Garamond", serif; fill: #2f6b45; }
[data-theme="chart"] #tree .rule, [data-theme="chart"] #tree .couple { stroke-width: 1.4; }
[data-theme="chart"] .highlight-ring { stroke: #2f6b45; }

/* album */
[data-theme="album"] #tree .box { fill: #efe3c9; stroke: #c9a764; stroke-width: 1.2; filter: drop-shadow(0 6px 9px rgba(0,0,0,.45)); }
[data-theme="album"] #tree .person text { fill: #2e2117; }
[data-theme="album"] #tree .name { font: 700 17px "Cormorant Garamond", serif; }
[data-theme="album"] #tree .years { font: 500 14px "Cormorant Garamond", serif; font-style: normal; fill: #7a5b33 !important; }
[data-theme="album"] #tree .place { font: italic 500 12.5px "Cormorant Garamond", serif; fill: #7a6a55 !important; opacity: 1; }
[data-theme="album"] #tree .frame { stroke: #c9a764; stroke-width: 3; filter: drop-shadow(0 3px 5px rgba(0,0,0,.4)); }
[data-theme="album"] #tree .link, [data-theme="album"] #tree .couple { stroke: #c9a764; opacity: .85; }
[data-theme="album"] #tree .marr { font: italic 600 14px "Cormorant Garamond", serif; fill: #e8cf98; stroke: none; }
[data-theme="album"] #tree .marr-bg { fill: #2b2018; }
[data-theme="album"] .highlight-ring { stroke: #e8cf98; }

/* Greek-key border for the "Mum's chart" style */
#frame { display: none; }
[data-theme="chart"] #frame { display: block; position: fixed; inset: 6px; z-index: 25; pointer-events: none;
  --key: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M0 21H21V3H7V15H15V9H11' stroke='%23444' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background: var(--key) top left / 24px 24px repeat-x, var(--key) bottom left / 24px 24px repeat-x,
              var(--key) top left / 24px 24px repeat-y, var(--key) top right / 24px 24px repeat-y;
  outline: 1px solid #444; outline-offset: 2px; }
[data-theme="chart"] #frame::after { content: ""; position: absolute; inset: 28px; border: 1px solid #444; }
[data-theme="chart"] .topbar { inset: 34px 34px auto 34px; border-bottom: 1px solid #444; padding: 8px 14px 0; background: rgba(251,250,246,.95); }
[data-theme="chart"] #panel { top: calc(var(--header-h, 96px) + 46px); right: 46px; bottom: 46px; }
[data-theme="chart"] .zoom { left: 16px; bottom: 16px; }

.zoom { position: absolute; left: 16px; bottom: 16px; display: grid; gap: 6px; z-index: 5; }
.zoom button { width: 42px; height: 42px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 21px; box-shadow: 0 2px 8px rgba(60,40,20,.1); border-radius: 2px; }
[data-theme="album"] .zoom button { border-radius: 50%; color: #2e2117; }
.zoom button:hover { color: var(--accent); }
.hint { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); margin: 0; pointer-events: none; white-space: nowrap;
  color: var(--ink-2); font: italic 15px var(--serif); background: var(--card-solid, var(--card)); border: 1px solid var(--line);
  padding: 4px 16px; box-shadow: 0 2px 8px rgba(60,40,20,.12); transition: opacity .6s; }
.hint.used { opacity: 0; }
[data-theme="album"] .hint { color: #7a5b33; border-radius: 999px; }

/* ---------------------------------------------------------------- person card */
#panel { position: fixed; z-index: 30; top: calc(var(--header-h, 96px) + 12px); right: 16px; bottom: 16px; width: min(420px, calc(100% - 32px));
  background: var(--card-solid, var(--card)); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: auto; padding: 24px 24px 28px; }
[data-theme="parchment"] #panel, [data-theme="parchment"] .login-card { outline: 1px solid var(--line); outline-offset: -6px; }
[data-theme="victorian"] #panel { box-shadow: 0 0 0 4px #fffdf6, 0 0 0 5px #b9a46a, var(--shadow); }
[data-theme="album"] #panel { border-radius: 6px; border-color: #c9a764; }
#panel[hidden], #lightbox[hidden] { display: none; }
.close { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; font-size: 21px; line-height: 1; color: var(--ink); }
.p-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; margin: 0 26px; }
.p-face { width: 92px; height: 112px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); }
.p-initial { width: 92px; height: 112px; border-radius: 50%; display: grid; place-items: center; font: 44px var(--serif);
  color: var(--accent); border: 2px solid var(--line); background: radial-gradient(color-mix(in srgb, var(--paper) 70%, #fff), var(--paper)); }
[data-theme="chart"] .p-initial, [data-theme="chart"] .p-face { border-radius: 0; font-family: var(--script); }
[data-theme="album"] .p-initial { background: radial-gradient(circle at 50% 38%, #c8b08a 0 18%, #8d7457 19% 34%, #6b5640 35%); color: transparent; border: 3px solid #c9a764; }
.p-head h2 { font: 30px/1.1 var(--serif); margin: 4px 0 0; }
[data-theme="victorian"] .p-head h2 { font: 700 22px/1.25 "Cinzel", serif; letter-spacing: .05em; color: var(--accent); }
[data-theme="chart"] .p-head h2 { font: 38px/1.05 var(--script); }
[data-theme="album"] .p-head h2 { font-weight: 700; }
.p-head .years { color: var(--ink-2); font-style: italic; }
.p-head .aka { color: var(--ink-2); font-size: 15px; font-style: italic; }
#panel h3 { font: 15px var(--display); letter-spacing: .1em; color: var(--accent); margin: 22px 0 8px; text-align: center; }
[data-theme="parchment"] #panel h3::before, [data-theme="parchment"] #panel h3::after { content: " ❧ "; opacity: .7; }
[data-theme="victorian"] #panel h3, [data-theme="chart"] #panel h3, [data-theme="album"] #panel h3 {
  text-align: left; font: 600 13px var(--display); text-transform: uppercase; letter-spacing: .16em; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
[data-theme="victorian"] #panel h3 { color: #6d5a2c; }
[data-theme="chart"] #panel h3 { border-color: #ccc; }
.facts { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.facts dt { color: var(--ink-2); font-style: italic; }
.facts dd { margin: 0; }
.people-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.people-list a { display: flex; justify-content: space-between; gap: 10px; padding: 6px 8px; text-decoration: none; color: var(--ink);
  border-bottom: 1px dotted color-mix(in srgb, var(--line) 70%, transparent); }
.people-list a:hover { background: var(--hover); }
[data-theme="victorian"] .people-list a { background: #f6f1e4; border: 0; }
[data-theme="chart"] .people-list a span:first-child { font: 23px var(--script); }
[data-theme="album"] .people-list a { background: rgba(255,255,255,.45); border: 0; border-radius: 3px; }
.people-list small { color: var(--ink-2); white-space: nowrap; font-style: italic; }
.marriage { font-size: 15px; color: var(--ink-2); margin: 10px 0 6px; font-style: italic; }
.notes p { margin: 0 0 8px; font-size: 15px; color: var(--ink-2); white-space: pre-line; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.gallery button { padding: 0; border: 1px solid var(--line); aspect-ratio: 1; background: var(--paper); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; filter: sepia(.15); }
.empty { color: var(--ink-2); font-style: italic; }

/* ---------------------------------------------------------------- photo lightbox */
#lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(25,18,12,.9); display: grid; place-items: center; padding: 24px 16px; }
#lightbox .close { background: rgba(255,250,240,.9); }
#lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: grid; gap: 10px; justify-items: center; }
.lb-frame { position: relative; display: inline-block; border: 8px solid #f3e6c8; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
#lb-img { display: block; max-width: min(1400px, 92vw); max-height: 78vh; }
.lb-face { position: absolute; border: 2px solid rgba(255,250,235,.9); border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.lb-face span { position: absolute; top: 100%; left: 50%; transform: translate(-50%, 4px); white-space: nowrap;
  background: rgba(251,243,224,.95); color: #3b2a17; font: 14px "IM Fell English", Georgia, serif; padding: 1px 8px; }
#lb-caption { color: #f3ece0; text-align: center; font: 17px "IM Fell English", Georgia, serif; max-width: 900px; }
#lb-caption a { color: #ffd9b0; }

/* ---------------------------------------------------------------- activity */
.activity-page { overflow: visible; }
.activity { max-width: 960px; margin: 0 auto; padding: 100px 16px 48px; }
.activity h1 { font: 32px var(--display); margin: 0 0 18px; }
[data-theme="album"] .activity { color: #f1e6d0; }
.activity h2 { font: 22px var(--serif); margin: 28px 0 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card { background: var(--card); color: var(--ink); border: 1px solid var(--line); padding: 14px 16px; }
.card h2 { margin: 0 0 4px; font-size: 21px; }
.card p { margin: 0; color: var(--ink-2); font-size: 15px; }
.activity table { width: 100%; border-collapse: collapse; background: var(--card); color: var(--ink); border: 1px solid var(--line); font-size: 15px; }
.activity th, .activity td { text-align: left; padding: 7px 12px; border-bottom: 1px solid color-mix(in srgb, var(--line) 40%, transparent); vertical-align: top; }
.activity th { font-weight: 600; }
.activity tr.fail td { color: #8a2a17; }
[data-theme="chart"] .activity { padding-top: 130px; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 760px) {
  .topbar { padding: 8px 14px 0; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .brand span, .user .who, .theme-pick span { display: none; }
  .brand strong { font-size: 20px; }
  .user { margin-left: auto; gap: 6px 10px; font-size: 15px; flex-wrap: wrap; justify-content: flex-end; }
  .theme-pick select { max-width: 128px; }
  #panel, [data-theme="chart"] #panel { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 66vh; }
  .topbar-row { flex-wrap: wrap; gap: 8px 12px; }
  .tabs a { padding: 6px 10px 7px; }
  [data-theme="chart"] .topbar { inset: 30px 30px auto 30px; }
  .hint { display: none; }
  .activity { padding-top: 130px; }
}

/* ---------------------------------------------------------------- chart pages (fan, timeline, map, related, glance) */
.chart-page { overflow: visible; }
.sheet { max-width: 1400px; margin: 0 auto; padding: calc(var(--header-h, 100px) + 18px) 20px 40px; }
[data-theme="chart"] .sheet { padding: calc(var(--header-h, 100px) + 54px) 60px 60px; }
.chart-head { text-align: center; margin-bottom: 8px; }
.chart-head h1 { font: 34px var(--display); margin: 0; letter-spacing: .03em; }
[data-theme="victorian"] .chart-head h1 { font-weight: 700; letter-spacing: .08em; color: var(--accent); font-size: 28px; }
[data-theme="chart"] .chart-head h1 { text-transform: uppercase; letter-spacing: .14em; font-weight: 500; font-size: 30px; }
[data-theme="album"] .chart-head h1 { color: #e8cf98; font-weight: 700; }
.chart-head p { margin: 2px 0 0; font-style: italic; color: var(--ink-2); }
[data-theme="album"] .chart-head p, [data-theme="album"] .footnote { color: #c8b28a; }
.chart-body { position: relative; display: grid; grid-template-columns: 1fr; gap: 16px; }
.chart-map .chart-body, .chart-journeys .chart-body { grid-template-columns: 1fr 340px; align-items: start; }
.chart-map #legend, .chart-journeys #legend { grid-column: 1 / -1; }
#figure { background: var(--card-solid, var(--card)); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 14px; min-height: 200px; color: #3b2a17; }
[data-theme="parchment"] #figure { outline: 1px solid var(--line); outline-offset: -6px; }
[data-theme="album"] #figure { border-radius: 6px; border-color: #c9a764; }
.chart-related #figure, .chart-glance #figure { background: transparent; border: 0; box-shadow: none; outline: 0; padding: 0; color: inherit; }
.chart-svg, .rel-svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; font-size: 16px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
[data-theme="album"] .legend { color: #f1e6d0; }
.footnote { text-align: center; font-style: italic; color: var(--ink-2); font-size: 15px; margin: 12px 0 0; }
.tip { position: fixed; z-index: 60; max-width: 360px; background: #f6ead0; color: #3b2a17; border: 1px solid #8a6a3f; box-shadow: 0 6px 18px rgba(60,40,20,.25);
  padding: 8px 12px; font: 15px "IM Fell English", Georgia, serif; pointer-events: none; }
.tip b { display: block; font-size: 18px; font-weight: normal; }
.tip span { display: block; color: #6e5634; font-style: italic; }
.chart-svg text, .rel-svg text { font-family: "IM Fell English", Georgia, serif; fill: #3b2a17; }
.chart-svg .hit { fill: transparent; }
.chart-svg g:hover > rect:not(.hit), .chart-svg .fan-seg:hover path { filter: brightness(.93); }
/* fan */
.fan-root { fill: #6b3a1f; stroke: #f6ecd6; stroke-width: 2; }
.chart-svg text.fan-root-t { fill: #f6ecd6; font-size: 19px; text-anchor: middle; }
.fan-seg path { stroke: #f6ecd6; stroke-width: 2; }
.fan-seg.empty path { fill: rgba(255,250,235,.3); stroke: rgba(138,106,63,.45); stroke-dasharray: 3 3; stroke-width: 1; }
.chart-svg .fan-yr { font-style: italic; font-size: 12px; fill: #6e5634; }
.chart-svg .fan-gen { font-style: italic; font-size: 13px; fill: #6e5634; }
:root { --empty: rgba(255,250,235,.4); }
/* timeline */
.era { fill: rgba(122,90,54,.11); } .era.alt { fill: rgba(122,90,54,.04); } .war { fill: rgba(150,40,30,.17); } .famine { fill: rgba(150,110,20,.15); }
.chart-svg .ev-t { font-size: 13px; fill: #6b2a1a; }
.chart-svg .era-t { font-style: italic; font-size: 14px; fill: #6e5634; }
.grid line { stroke: rgba(138,106,63,.2); }
.axis path, .axis line { stroke: rgba(138,106,63,.55); }
.chart-svg .axis text { font-size: 14px; fill: #6e5634; }
.chart-svg .tl-nm { font-size: 13.5px; }
.tl-mark { fill: #6b2a1a; stroke: #f6ecd6; stroke-width: 2; }
.chart-svg .tl-ev { font-style: italic; font-size: 13px; fill: #6b2a1a; }
/* map */
.sea { fill: #d9dccb; } .land { fill: #efe2c3; stroke: #8a6a3f; stroke-width: .8; }
.grat { fill: none; stroke: rgba(138,106,63,.16); stroke-width: .6; }
.land, .grat { vector-effect: non-scaling-stroke; }
.chart-map #figure, .chart-journeys #figure { position: relative; }
.chart-map .chart-svg { cursor: grab; touch-action: none; }
.chart-map .chart-svg:active { cursor: grabbing; }
.zoom-btns { position: absolute; top: 24px; left: 24px; display: flex; flex-direction: column; gap: 6px; }
.zoom-btn { width: 38px; height: 38px; font: 22px/1 Georgia, serif; color: #3b2a17; background: rgba(251,243,224,.95);
  border: 1px solid #8a6a3f; border-radius: 6px; cursor: pointer; box-shadow: 0 2px 6px rgba(70,45,15,.2); }
.zoom-btn:hover { background: #fff; }
@media (max-width: 800px) {
  .zoom-btns { top: 14px; left: 14px; gap: 4px; }
  .zoom-btn { width: 30px; height: 30px; font-size: 18px; }
}
.pin { stroke: #f6ecd6; stroke-width: 2; }
.spot:hover .pin { stroke: #3b2a17; }
.chart-svg .town { font-size: 15px; paint-order: stroke; stroke: rgba(240,228,196,.95); stroke-width: 4px; }
.chart-svg .ct { font-style: italic; font-size: 12px; fill: #6e5634; paint-order: stroke; stroke: rgba(240,228,196,.95); stroke-width: 3px; }
.died-ring { fill: #f6ecd6; stroke: #6b2a1a; stroke-width: 2.2; }
.legend i.ring { background: #f6ecd6; border: 2px solid #6b2a1a; border-radius: 50%; box-sizing: border-box; }
.rose circle { fill: none; stroke: #8a6a3f; } .rose-n { fill: #8a6a3f; } .rose-e { fill: #b39a70; }
.chart-svg .rose-t { font-size: 15px; fill: #6e5634; }
#side { background: var(--card-solid, var(--card)); color: #3b2a17; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 18px 20px; max-height: 790px; overflow: auto; }
[data-theme="album"] #side { border-radius: 6px; border-color: #c9a764; }
#side h2 { font: 24px "IM Fell English", Georgia, serif; margin: 6px 0 2px; text-align: center; }
#side .sub { text-align: center; font-style: italic; color: #6e5634; margin-bottom: 10px; }
#side h3 { font: 14px "IM Fell English SC", Georgia, serif; letter-spacing: .1em; color: #6b3a1f; margin: 14px 0 6px; text-align: center; }
#side .back { border: 0; background: none; color: #6b3a1f; font-style: italic; padding: 0; }
#side .people-list a { color: #3b2a17; }
/* related */
.pickers { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 14px 0 6px; flex-wrap: wrap; }
.picker { position: relative; width: min(340px, 100%); }
.picker input { width: 100%; padding: 10px 14px; font-size: 20px; text-align: center; background: var(--card-solid, var(--card)); color: #3b2a17;
  border: 1px solid var(--line); outline: 1px solid var(--line); outline-offset: 3px; }
.picker-results { position: absolute; z-index: 10; top: calc(100% + 8px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none;
  background: #f6ead0; color: #3b2a17; border: 1px solid var(--line); box-shadow: var(--shadow); max-height: 50vh; overflow: auto; text-align: left; }
.picker-results li { padding: 6px 10px; cursor: pointer; } .picker-results li:hover { background: rgba(139,103,58,.12); }
.picker-results small { color: #6e5634; margin-left: 8px; font-style: italic; }
.swap { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card-solid, var(--card)); color: #3b2a17; font-size: 20px; }
.answer { text-align: center; font: 50px/1.1 var(--display); color: var(--accent); margin: 18px 0 6px; letter-spacing: .02em; }
[data-theme="album"] .answer { color: #e8cf98; }
.answer-sub { text-align: center; font-style: italic; color: var(--ink-2); font-size: 19px; max-width: 900px; margin: 0 auto 14px; }
[data-theme="album"] .answer-sub { color: #c8b28a; }
.rel-svg { max-width: 1000px; margin: 0 auto; }
.rel-box rect { fill: #f6ead0; stroke: #4a3218; stroke-width: 1.1; }
.rel-box.hi rect { fill: #6b3a1f; stroke: #6b3a1f; }
.rel-svg .rel-nm { font-size: 19px; text-anchor: middle; }
.rel-svg .rel-yr { font-style: italic; font-size: 14px; fill: #6e5634; text-anchor: middle; }
.rel-box.hi .rel-nm { fill: #f6ecd6; } .rel-box.hi .rel-yr { fill: #e9d6ac; }
.rel-box:hover rect { stroke-width: 2.4; }
.rel-ln { stroke: var(--tree-ink); stroke-width: 1.4; fill: none; } .rel-ln.dashed { stroke-dasharray: 6 5; }
[data-theme="album"] .rel-ln { stroke: #c9a764; }
/* glance */
.glance { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.glance .card { background: var(--card-solid, var(--card)); color: #3b2a17; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 18px 20px; }
[data-theme="parchment"] .glance .card { outline: 1px solid var(--line); outline-offset: -6px; }
[data-theme="album"] .glance .card { border-radius: 6px; border-color: #c9a764; }
.glance .stat { text-align: center; }
.glance .big { font: 56px/1 "IM Fell English", Georgia, serif; color: #6b3a1f; }
.glance .what { font: 15px "IM Fell English SC", Georgia, serif; letter-spacing: .08em; margin-top: 8px; }
.glance .sub { font-style: italic; color: #6e5634; font-size: 15px; }
.glance .card h2 { font: 16px "IM Fell English SC", Georgia, serif; letter-spacing: .1em; text-align: center; color: #6b3a1f; margin: 0 0 12px; }
.bars { display: grid; gap: 7px; }
.bar { display: grid; grid-template-columns: 96px 1fr 28px; align-items: center; gap: 10px; }
.bar .t { height: 12px; background: rgba(122,90,54,.14); border-radius: 0 3px 3px 0; }
.bar .f { height: 100%; background: #7a5a36; border-radius: 0 3px 3px 0; }
.bar .n { text-align: right; color: #6e5634; font-style: italic; }
.trades { display: flex; flex-wrap: wrap; gap: 3px 12px; justify-content: center; align-items: baseline; line-height: 1.25; }
.rec { display: grid; gap: 10px; }
.rec div { display: grid; gap: 2px; border-bottom: 1px dotted var(--line); padding-bottom: 6px; }
.rec div > :first-child { font-style: italic; color: #6e5634; font-size: 14px; }
.rec a { color: #3b2a17; }
@media (max-width: 1000px) { .glance { grid-template-columns: repeat(2, 1fr); } .chart-map .chart-body, .chart-journeys .chart-body { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .sheet { padding-left: 10px; padding-right: 10px; }
  [data-theme="chart"] .sheet { padding-left: 40px; padding-right: 40px; }
  .chart-fan #figure, .chart-timeline #figure, .chart-map #figure { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .chart-fan .chart-svg { min-width: 820px; } .chart-timeline .chart-svg { min-width: 980px; } .chart-map .chart-svg { min-width: 0; }
  .glance { grid-template-columns: 1fr; }
  .chart-head h1 { font-size: 26px; } .answer { font-size: 36px; }
}

/* brothers & sisters ordering switch on the tree page */
.tree-options { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 22px; margin-top: 10px; font-style: italic; color: var(--ink-2); }
.tree-options label { display: flex; align-items: center; gap: 8px; }
.tree-options select { font: inherit; font-style: normal; padding: 3px 6px; border: 1px solid var(--line); background: #fffdf7; color: #3b2a17; }
[data-theme="album"] .tree-options { color: #c8b28a; }
@media (max-width: 760px) { .tree-options { font-size: 14px; } }

/* ---------------------------------------------------------------- "Family of…" */
.fv-controls { display: flex; justify-content: center; gap: 10px 22px; flex-wrap: wrap; margin: 10px 0 4px; font-style: italic; color: var(--ink-2); }
[data-theme="album"] .fv-controls { color: #c8b28a; }
.fv-controls label { display: flex; align-items: center; gap: 8px; }
.fv-controls select { font: inherit; font-style: normal; padding: 3px 6px; border: 1px solid var(--line); background: #fffdf7; color: #3b2a17; }
.fv-trail { text-align: center; font-style: italic; color: var(--ink-2); margin: 4px 0 10px; min-height: 1.3em; }
[data-theme="album"] .fv-trail { color: #c8b28a; }
.fv-trail a { color: inherit; } .fv-trail b { font-style: normal; color: var(--ink); }
[data-theme="album"] .fv-trail b { color: #f1e6d0; }
.chart-head p a { color: var(--accent); }
[data-theme="album"] .chart-head p a { color: #e8cf98; }
.fv-figure { overflow-x: auto; padding: 22px 14px 30px !important; }
.fv-wrap { position: relative; width: max-content; margin: 0 auto; display: flex; flex-direction: column; align-items: flex-start; }
.fv-lines { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.fv-lines path { fill: none; stroke: #4a3218; stroke-width: 1.4; }
[data-theme="victorian"] .fv-lines path { stroke: #233d31; }
[data-theme="chart"] .fv-lines path { stroke: #1d1d1d; }
.fv-lines path.coloured { stroke-width: 1.9; }
.fv-anc { position: relative; margin-bottom: 46px; }
.fv-anc > .fv-card { position: absolute; }
.fv-sibs { display: flex; justify-content: center; align-items: flex-start; gap: 22px; }
.fv-node { display: flex; flex-direction: column; align-items: center; }
.fv-couple { display: flex; align-items: center; }
.fv-m { width: 58px; text-align: center; font: italic 13px var(--serif); color: #6e5634; position: relative; top: -12px; }
.fv-groups { display: flex; justify-content: center; gap: 30px; margin-top: 48px; }
.fv-desc { position: relative; margin-top: 48px; }
.fv-desc > .fv-couple { position: absolute; width: max-content; }
.fv-desc > .fv-couple > * { flex-shrink: 0; }
.fv-kids { display: flex; justify-content: center; align-items: flex-start; gap: 18px; }
.fv-card { position: relative; width: 176px; min-height: 84px; padding: 10px 8px; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; text-align: center; font: inherit; color: #3b2a17; background: #f6ead0; border: 1px solid #4a3218; outline: 1px solid rgba(74,50,24,.35); outline-offset: -5px; cursor: pointer; }
.fv-card:hover { background: #fbf3e0; box-shadow: 0 3px 10px rgba(60,40,20,.15); }
.fv-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.fv-name { font: 17px/1.15 var(--serif); } .fv-years { font: italic 13.5px var(--serif); color: #5a4428; }
.fv-born { font: italic 12.5px var(--serif); color: #6e5634; }
.fv-face { width: 42px; height: 52px; object-fit: cover; border-radius: 50%; border: 1px solid #4a3218; margin-bottom: 3px; }
.fv-me { width: 206px; min-height: 104px; background: #fffaf0; border: 2px solid var(--accent); box-shadow: 0 0 0 5px rgba(107,58,31,.12), 0 8px 18px rgba(70,45,15,.18); cursor: default; }
.fv-me .fv-name { font-size: 20px; }
.fv-tab { position: absolute; left: 50%; transform: translateX(-50%); bottom: -11px; white-space: nowrap; background: #f6ead0; border: 1px solid rgba(138,106,63,.7);
  border-radius: 10px; padding: 0 8px; font: italic 12.5px var(--serif); color: #6b3a1f; line-height: 1.5; }
.fv-tab.up { bottom: auto; top: -11px; }
.fv-card.small { width: 138px; min-height: 72px; padding: 8px 4px; } .fv-card.small .fv-name { font-size: 15px; } .fv-card.small .fv-years { font-size: 12px; }
.fv-card.small .fv-face { width: 30px; height: 38px; }
.fv-card.tiny { width: 116px; padding: 6px 3px; } .fv-card.tiny .fv-name { font-size: 14px; } .fv-card.tiny .fv-years { font-size: 11.5px; }
.fv-card.tiny .fv-face { width: 26px; height: 32px; } .fv-anc .fv-card.tiny { height: 70px; }
.fv-half { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 30px; }
.fv-half-group { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 8px; }
.fv-half-group em { color: #6e5634; margin-right: 4px; }
.fv-chip { font: 14px var(--serif); color: #3b2a17; background: #f6ead0; border: 1px solid rgba(138,106,63,.7); border-radius: 12px; padding: 2px 10px; cursor: pointer; }
.fv-chip:hover { background: #fbf3e0; }
[data-theme="victorian"] .fv-card, [data-theme="victorian"] .fv-chip, [data-theme="victorian"] .fv-tab { background: #fffdf6; border-color: #233d31; }
[data-theme="victorian"] .fv-me { border-color: #233d31; box-shadow: 0 0 0 5px rgba(35,61,49,.12); }
[data-theme="chart"] .fv-card { background: #fff; border-color: #1d1d1d; outline: none; }
[data-theme="chart"] .fv-me { border-width: 2px; box-shadow: none; }
[data-theme="album"] .fv-card { border-color: #c9a764; outline-color: rgba(201,167,100,.4); background: #f4ead6; }
@media (max-width: 760px) {
  .fv-figure { padding: 18px 8px 24px !important; }
  .fv-card { width: 132px; min-height: 76px; } .fv-name { font-size: 15px; }
  .fv-me { width: 150px; } .fv-me .fv-name { font-size: 17px; }
  .fv-sibs { gap: 12px; } .fv-kids { gap: 10px; } .fv-m { width: 40px; font-size: 11.5px; }
  .fv-card.small { width: 120px; }
}
.fv-anc .fv-card { height: 84px; min-height: 0; overflow: visible; } .fv-anc .fv-card.small { height: 76px; }
.family-page .sheet { max-width: none; }

/* ---------------------------------------------------------------- add a photo */
.photo-page .sheet { max-width: 1240px; }
.photo-page [hidden] { display: none !important; }
.user a.waiting { font-weight: 700; color: var(--accent); }
.ap-pick { max-width: 560px; margin: 24px auto 0; text-align: center; }
.ap-drop { display: flex; flex-direction: column; gap: 6px; align-items: center; padding: 44px 24px; cursor: pointer;
  background: var(--card); border: 2px dashed var(--line); border-radius: 10px; box-shadow: var(--shadow); color: var(--ink); }
.ap-drop:hover { background: var(--hover); }
.ap-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ap-drop:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.ap-drop strong { font: 26px var(--display); color: var(--accent); }
.ap-drop span { font-style: italic; color: var(--ink-2); }
.ap-status { min-height: 1.4em; font-style: italic; color: var(--accent); margin: 10px 0 0; }
[data-theme="album"] .ap-pick .ap-status { color: #e8cf98; }
.ap-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 28px; align-items: start; margin-top: 16px; }
.ap-photo { position: relative; user-select: none; -webkit-user-select: none; touch-action: none; line-height: 0;
  border: 1px solid var(--line); box-shadow: var(--shadow); }
.ap-left { min-width: 0; }
.ap-photo img { width: 100%; height: auto; display: block; pointer-events: none; }
.ap-photo.drawing { cursor: crosshair; outline: 3px solid #f4c542; }
.ap-box { position: absolute; border: 2.5px solid #f4c542; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.55);
  cursor: move; touch-action: none; line-height: 1.2; }
.ap-box.todo { border-style: dashed; }
.ap-box.on { border-color: #fff; box-shadow: 0 0 0 2px #f4c542, 0 0 0 3px rgba(0,0,0,.55); }
.ap-box .ap-num { position: absolute; right: -11px; top: -11px; }
.ap-num { width: 22px; height: 22px; border-radius: 50%; background: #f4c542; color: #2a1d0e; font: 700 13px/22px Georgia, serif;
  text-align: center; box-shadow: 0 0 0 1px rgba(0,0,0,.5); flex: none; }
.ap-tag { position: absolute; left: -2px; top: calc(100% + 4px); background: rgba(40,28,14,.88); color: #fbf3e0;
  font: 13px var(--body); padding: 1px 7px; border-radius: 3px; white-space: nowrap; pointer-events: none; }
.ap-tag.right { left: auto; right: -2px; }
.ap-grip { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; background: #f4c542; border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.55); cursor: nwse-resize; }
.ap-hint { font-size: 15px; font-style: italic; color: var(--ink-2); margin: 10px 0 0; }
[data-theme="album"] .ap-left .ap-hint { color: #c8b28a; }
.ap-link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
[data-theme="album"] .ap-left .ap-link { color: #e8cf98; }
.ap-panel { background: var(--card); border: 1px solid var(--line); outline: 1px solid var(--line); outline-offset: -6px;
  padding: 18px 24px 22px; box-shadow: var(--shadow); color: var(--ink); }
.ap-panel h2, .ap-waiting h2 { font: 19px var(--display); letter-spacing: .06em; color: var(--accent); margin: 16px 0 8px; }
.ap-panel h2:first-of-type { margin-top: 2px; }
.ap-from { margin: 0 0 10px; font-style: italic; color: var(--ink-2); }
.ap-face { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dotted var(--line); }
.ap-crop { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line); background-repeat: no-repeat; flex: none; }
.ap-who { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.ap-who b { font-weight: 600; } .ap-who small { color: var(--ink-2); font-style: italic; }
.ap-del { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--ink-2); cursor: pointer; padding: 4px 6px; }
.ap-del:hover { color: #a8402a; }
.ap-pick-name { position: relative; width: 100%; }
.ap-pick-name input, .ap-field input, .ap-field textarea, .ap-password input { width: 100%; box-sizing: border-box; font: inherit; color: var(--ink);
  background: var(--field); border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; }
[data-theme="album"] .ap-panel input, [data-theme="album"] .ap-panel textarea { background: rgba(255,255,255,.6); }
.ap-menu { list-style: none; margin: 4px 0 0; padding: 4px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--card-solid, #fffaf0); max-height: 300px; overflow: auto; }
[data-theme="album"] .ap-menu { background: #f4ead6; }
.ap-menu li { padding: 6px 8px; cursor: pointer; border-radius: 3px; }
.ap-menu li small { margin-left: 8px; color: var(--ink-2); font-style: italic; }
.ap-menu li:hover, .ap-menu li[aria-selected="true"] { background: var(--hover); }
.ap-menu li.empty { cursor: default; font-style: italic; color: var(--ink-2); }
.ap-menu li.ap-none { font-style: italic; color: var(--ink-2); border-top: 1px dotted var(--line); }
.ap-event { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; cursor: pointer; }
.ap-event small { display: block; color: var(--ink-2); font-style: italic; }
.ap-field { display: grid; grid-template-columns: 70px 1fr; gap: 10px; align-items: center; margin: 7px 0; }
.ap-field:has(textarea) { align-items: start; }
.ap-field textarea { resize: vertical; }
.ap-password { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--accent); border-radius: 6px; }
.ap-password p { margin: 0 0 6px; }
.ap-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.ap-btn { font: inherit; padding: 8px 16px; border-radius: 5px; border: 1px solid var(--accent); background: transparent;
  color: var(--accent); cursor: pointer; text-decoration: none; display: inline-block; }
.ap-btn.main { background: var(--accent); color: var(--paper); }
[data-theme="album"] .ap-btn.main { color: #f4ead6; }
.ap-btn:disabled { opacity: .6; cursor: progress; }
.ap-done { max-width: 560px; margin: 30px auto 0; text-align: center; background: var(--card); border: 1px solid var(--line);
  padding: 24px; box-shadow: var(--shadow); color: var(--ink); }
.ap-done p:first-child { font-size: 20px; }
.ap-waiting { max-width: 900px; margin: 10px auto 0; }
[data-theme="album"] .ap-waiting h2 { color: #e8cf98; }
.ap-waiting-list { display: flex; flex-wrap: wrap; gap: 12px; }
.ap-waiting-item { display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line);
  padding: 6px 12px 6px 6px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.ap-waiting-item:hover { background: var(--hover); }
.ap-waiting-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; }
.ap-waiting-item small { display: block; color: var(--ink-2); font-style: italic; }
@media (max-width: 800px) {
  .ap-edit { grid-template-columns: 1fr; gap: 18px; }
  .ap-panel { padding: 14px 16px 18px; }
  .ap-menu li small { display: block; margin-left: 0; }
}

/* ---- This week */
.wk { max-width: 720px; margin: 14px auto 0; }
.wk-day { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin-bottom: 14px; }
.wk-day h2 { font: 22px var(--display); margin: 0 0 8px; color: var(--accent); }
.wk-day h2 span { font: italic 16px var(--body, inherit); color: var(--ink-2); margin-left: 6px; }
.wk-day.today { border-width: 2px; border-color: var(--accent); }
.wk-day.today h2 { font-size: 26px; }
.wk-item { display: flex; align-items: center; gap: 14px; padding: 8px 0; border-top: 1px dotted var(--line); }
.wk-day h2 + .wk-item { border-top: 0; }
.wk-faces { display: flex; flex: none; }
.wk-face { width: 58px; height: 58px; border-radius: 50%; overflow: hidden; border: 2px solid var(--line);
  background: var(--paper); display: grid; place-items: center; text-decoration: none; color: var(--ink-2); font: 20px var(--display); }
.wk-face + .wk-face { margin-left: -14px; }
.wk-face img { width: 100%; height: 100%; object-fit: cover; }
.wk-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wk-text strong { font-size: 18px; }
.wk-text strong a { color: var(--ink); text-decoration: none; }
.wk-text strong a:hover { text-decoration: underline; }
.wk-text span { color: var(--ink-2); }
.wk-none { color: var(--ink-2); font-style: italic; margin: 4px 0; }
.wk-foot { text-align: center; color: var(--ink-2); font-size: 14px; font-style: italic; }
@media (max-width: 600px) { .wk-face { width: 46px; height: 46px; font-size: 16px; } .wk-text strong { font-size: 16px; } }

/* ---- drag to move around a chart (mouse) */
@media (hover: hover) and (pointer: fine) {
  .chart-fan #figure, .chart-timeline #figure, .chart-related #figure, .fv-figure { cursor: grab; }
}
body.drag-scrolling, body.drag-scrolling * { cursor: grabbing !important; user-select: none; }

/* ---- the fan chart fits the screen height on a laptop or desktop (it still scrolls sideways on phones) */
@media (min-width: 761px) {
  .chart-fan .chart-svg { max-height: max(420px, calc(100vh - var(--header-h, 96px) - 194px)); }
}

/* ---- full screen */
.fs-btn { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.fs-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.fs-btn:hover { text-decoration: underline; }
.fs-exit { display: none; position: fixed; top: 10px; right: 12px; z-index: 60; padding: 6px 12px; font: 15px var(--display, Georgia, serif);
  background: var(--card-solid, #f6ead0); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); cursor: pointer; opacity: .85; }
.fs-exit:hover { opacity: 1; }
body.full-screen .topbar { display: none; }
body.full-screen .fs-exit { display: block; }
body.full-screen .sheet { padding-top: 12px; }
[data-theme="chart"] body.full-screen .sheet { padding-top: 48px; }
@media (max-width: 760px) { .fs-btn span { display: none; } .fs-btn svg { width: 20px; height: 20px; } }

/* ---- Family of…: the Tree's zoom buttons, in the corner of the box */
.fv-stage { position: relative; }
.fv-stage .zoom, [data-theme="chart"] .fv-stage .zoom { left: 14px; bottom: 14px; }
@media (max-width: 720px) { .fv-stage .zoom, [data-theme="chart"] .fv-stage .zoom { bottom: auto; top: 10px; left: 10px; }
  .fv-stage .zoom button { width: 34px; height: 34px; } }

@media (max-width: 760px) {
  .tree-head h1 { font-size: 24px; } .tree-head p { font-size: 14px; }
  #stage { left: 8px; right: 8px; bottom: 8px; }
  [data-theme="chart"] #stage { left: 38px; right: 38px; bottom: 38px; }
  .tree-page #panel, [data-theme="chart"] .tree-page #panel { top: auto; left: 0; right: 0; bottom: 0; }
}
body.full-screen .tree-head { top: 12px; }

/* ---- Family of…: the person whose details are open, and the panel's "Show … family" button */
.fv-card.fv-picked { outline: 3px dashed var(--accent); outline-offset: 5px; }
.p-action { display: block; margin: 4px auto 6px; padding: 6px 14px; font: inherit; font-style: italic; cursor: pointer;
  background: var(--field, #fffdf7); color: var(--ink); border: 1px solid var(--line); border-radius: 3px; }
.p-action:hover { color: var(--accent); }
a.p-action { width: fit-content; text-decoration: none; text-align: center; }

/* ---- Logins (admins): who can sign in and which family trees each login sees */
.logins-page .sheet { max-width: 980px; }
.logins h1 { margin-bottom: 4px; }
.logins .intro { color: var(--ink-2); margin-top: 0; }
.logins .msg, .logins .err { padding: 10px 14px; border-radius: 3px; border: 1px solid var(--line); background: var(--field, #fffdf7); }
.logins .err { border-color: #a8402a; color: #a8402a; }
.logins form { margin: 0; }
.logins label.tick { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.logins input[type=text], .logins input[type=password] { padding: 6px 8px; border: 1px solid var(--line); background: var(--field, #fffdf7); color: inherit; font: inherit; border-radius: 2px; }
.logins button { padding: 5px 12px; font: inherit; cursor: pointer; background: var(--field, #fffdf7); color: var(--ink); border: 1px solid var(--line); border-radius: 3px; }
.logins button:hover { color: var(--accent); }

/* ---- Tree: labels where children are far across the row from their parents */
#tree .far-tag { cursor: pointer; }
#tree .far-tag rect { fill: var(--paper); stroke: var(--tree-ink); stroke-width: 1; }
#tree .far-tag text { font: italic 13px var(--serif); }
#tree .far-tag:hover rect { stroke-width: 2; }
[data-theme="album"] #tree .far-tag rect { fill: #2b2018; stroke: #c9a764; }
[data-theme="album"] #tree .far-tag text { fill: #e8cf98; }
.logins select { padding: 5px 6px; border: 1px solid var(--line); background: var(--field, #fffdf7); color: inherit; font: inherit; border-radius: 2px; }

/* Journeys: play controls, the year on the map, and the list of what has happened */
.j-bar { display: flex; align-items: center; gap: 18px; max-width: 900px; margin: 0 auto 14px; font-style: italic; color: var(--ink-2); }
.j-play { font: 17px var(--serif); padding: 7px 18px; border: 1px solid var(--line); background: var(--card-solid, var(--card)); color: var(--ink); cursor: pointer; min-width: 110px; }
.j-play:focus-visible, .j-slide input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.j-slide { flex: 1; position: relative; padding-bottom: 18px; }
.j-slide input { width: 100%; accent-color: #6b3a1f; }
.j-ticks span { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 13px; }
.j-bar select { font: inherit; background: var(--card-solid, var(--card)); border: 1px solid var(--line); color: var(--ink); }
[data-theme="album"] .j-bar { color: #f1e6d0; }
.j-year { font: 64px "IM Fell English", Georgia, serif; fill: #3b2a17; opacity: .85; pointer-events: none; }
.j-cap { font: italic 17px "IM Fell English", Georgia, serif; fill: #6e5634; paint-order: stroke; stroke: rgba(240,228,196,.9); stroke-width: 4px; pointer-events: none; }
.j-log { list-style: none; padding: 0; margin: 8px 0 0; font-size: 15px; }
.j-log li { border-bottom: 1px dotted var(--line); }
.j-log a { display: block; padding: 7px 4px; color: #6e5634; text-decoration: none; }
.j-log a:hover { background: rgba(107,58,31,.07); }
.j-log li.now a { color: #3b2a17; background: rgba(107,58,31,.08); }
.j-log i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.j-log b { font-weight: 600; color: #3b2a17; }
@media (max-width: 700px) {
  .j-bar { flex-wrap: wrap; gap: 10px 14px; }
  .j-slide { order: 3; flex-basis: 100%; }
  .j-year { font-size: 52px; }
}
.logins .person-pick { position: relative; display: inline-block; }
.logins .person-pick input[type=search] { width: 100%; box-sizing: border-box; padding: 6px 8px; border: 1px solid var(--line);
  background: var(--field, #fffdf7); color: inherit; font: inherit; border-radius: 2px; }
.logins .person-pick.unpicked input[type=search] { border-color: #a8402a; }
.logins .lp-menu { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin-top: 2px; box-shadow: var(--shadow, 0 4px 14px rgba(0,0,0,.15)); }
.logins .lp-menu li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.logins .lp-menu li small { margin-left: 0; }
.logins .setup-link { display: flex; gap: 6px; margin: 8px 0 4px; }
.logins .setup-link input { flex: 1; min-width: 0; font-size: 14px; }
.logins .msg small { display: block; color: var(--ink-2); }

.logins h2 { margin: 28px 0 8px; }
.logins .cards { display: grid; grid-template-columns: minmax(0, 760px); gap: 14px; }
.logins .add { max-width: 760px; box-sizing: border-box; }
.logins .login-card-row { background: var(--card, #fffaf0); border: 1px solid var(--line); border-radius: 6px; padding: 14px 18px; box-shadow: var(--shadow); }
.logins .login-card-row h3 { margin: 0 0 10px; font-size: 20px; }
.logins .badge { font-size: 13px; font-weight: normal; font-style: italic; color: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; padding: 1px 8px; vertical-align: middle; }
.logins .fields { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px 14px; align-items: center; max-width: 640px; }
.logins .fields > label { color: var(--ink-2); font-style: italic; }
.logins .fields small { color: var(--ink-2); font-style: italic; }
.logins .fields input[type=text], .logins .person-pick { width: 100%; box-sizing: border-box; }
.logins label.tick { display: inline-flex; align-items: center; gap: 5px; margin-right: 16px; white-space: nowrap; }
.logins .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.logins .actions button.main { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.logins .actions button.danger { margin-left: auto; color: #a8402a; }
.logins button.small { font-size: 14px; padding: 2px 10px; margin-left: 8px; }
.logins .add .intro { margin: 12px 0 0; }
@media (max-width: 560px) {
  .logins .fields { grid-template-columns: 1fr; gap: 4px; }
  .logins .fields > label { margin-top: 8px; }
  .logins .actions button.danger { margin-left: 0; }
}
.logins .uname b { font-weight: normal; margin-right: 6px; }
.logins .uname button.small { margin-left: 4px; }
.logins .shared-link { max-width: 760px; box-sizing: border-box; background: var(--card, #fffaf0); border: 1px solid var(--accent); border-radius: 6px; padding: 12px 18px; margin: 16px 0; }
.logins .shared-link h2 { margin: 0 0 4px; }
.logins .shared-link p { margin: 4px 0; }
.logins .shared-link small { color: var(--ink-2); font-style: italic; }
.logins .shared-link button.small { margin-left: 0; }
.logins-page .sheet { max-width: 1200px; }
.logins .login-table { width: 100%; border-collapse: collapse; margin: 8px 0 24px; font-size: 16px; }
.logins .login-table th { text-align: left; font-weight: normal; font-style: italic; color: var(--ink-2); padding: 6px 8px; border-bottom: 2px solid var(--line); }
.logins .login-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.logins .login-table tr.sum:hover td, .logins .login-table tr.sum.open td { background: var(--hover, rgba(0,0,0,.04)); }
.logins .login-table tr.sum.open td { border-bottom-color: transparent; }
.logins .login-table tr.sum td:last-child { text-align: right; white-space: nowrap; }
.logins .login-table tr.edit > td { text-align: left; }
.logins .login-table tr.edit > td { padding: 4px 8px 14px; background: var(--hover, rgba(0,0,0,.04)); }
.logins .login-table .login-card-row { box-shadow: none; }
.logins .login-table .login-card-row h3 { display: none; }
.logins .login-table .wait { font-style: italic; color: var(--ink-2); }
.logins .login-table .badge { font-size: 12px; }
@media (max-width: 760px) {
  .logins .login-table, .logins .login-table tbody { display: block; width: 100%; }
  .logins .login-table thead { display: none; }
  .logins .login-table tr.sum { display: grid; grid-template-columns: 1fr auto; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .logins .login-table tr.sum td { border: 0; padding: 1px 4px; background: none; }
  .logins .login-table tr.sum td:first-child { grid-column: 1; }
  .logins .login-table tr.sum td:last-child { grid-column: 2; grid-row: 1; }
  .logins .login-table tr.sum td[data-h]:not(:first-child) { grid-column: 1 / -1; font-size: 15px; }
  .logins .login-table tr.sum td[data-h]:not(:first-child)::before { content: attr(data-h) ": "; font-style: italic; color: var(--ink-2); }
  .logins .login-table tr.edit, .logins .login-table tr.edit > td { display: block; }
  .logins .login-table tr.edit[hidden] { display: none; }
}
