/* Family tree: look agreed in the design draft of 28 November 2026.
   Pale stone background, teal and amber accents, Bricolage Grotesque headings,
   Inter text. Large tap targets for older relatives. */

:root {
  --bg: #F4F5F1;
  --card: #FFFFFF;
  --card-2: #FAFBF9;
  --ink: #1C2321;
  --ink-2: #3E4744;
  --muted: #4D5653;
  --muted-2: #5B6461;
  --line: #E1E4DE;
  --line-2: #C9CFC9;
  --chip: #E6E9E3;
  --teal: #0F6B5C;
  --teal-ink: #FFFFFF;
  --teal-dark: #0A4D42;
  --teal-soft: #E3EFEB;
  --amber: #C9731C;
  --amber-ink: #9A5512;
  --amber-soft: #FBF5EC;
  --amber-line: #E6C9A8;
  --danger: #B4470F;
  --focus: #E0A526;
  --b1-bg: #D6E6E1; --b1-fg: #0F4F44;
  --b2-bg: #F1DFC8; --b2-fg: #7A4310;
  --b3-bg: #DDE1EE; --b3-fg: #2F3E6B;
  --b4-bg: #EBD9DF; --b4-fg: #6B2D44;
  --b0-bg: #ECEEE9; --b0-fg: #1C2321;
  --shadow: 0 1px 2px rgba(28, 35, 33, 0.06), 0 4px 16px rgba(28, 35, 33, 0.06);
  --radius: 14px;
  --head: 'Bricolage Grotesque', Inter, system-ui, sans-serif;
  --text: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --nav-h: 72px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141917; --card: #1D2321; --card-2: #232A27; --ink: #EEF1EC; --ink-2: #CDD3CF; --muted: #AEB6B2; --muted-2: #A2AAA6;
    --line: #2E3633; --line-2: #3D4743; --chip: #2A322F; --teal: #4FB8A3; --teal-ink: #0B1F1A; --teal-dark: #7CCFBD; --teal-soft: #1F3832;
    --amber: #E0954A; --amber-ink: #E8A866; --amber-soft: #2E261C; --amber-line: #5C4630; --danger: #F08A5D;
    --b1-bg: #21423A; --b1-fg: #BFE3D8; --b2-bg: #4A3622; --b2-fg: #F3D3AD; --b3-bg: #2C3450; --b3-fg: #CBD4F2;
    --b4-bg: #48303A; --b4-fg: #F1C9D7; --b0-bg: #2A322F; --b0-fg: #EEF1EC;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141917; --card: #1D2321; --card-2: #232A27; --ink: #EEF1EC; --ink-2: #CDD3CF; --muted: #AEB6B2; --muted-2: #A2AAA6;
  --line: #2E3633; --line-2: #3D4743; --chip: #2A322F; --teal: #4FB8A3; --teal-ink: #0B1F1A; --teal-dark: #7CCFBD; --teal-soft: #1F3832;
  --amber: #E0954A; --amber-ink: #E8A866; --amber-soft: #2E261C; --amber-line: #5C4630; --danger: #F08A5D;
  --b1-bg: #21423A; --b1-fg: #BFE3D8; --b2-bg: #4A3622; --b2-fg: #F3D3AD; --b3-bg: #2C3450; --b3-fg: #CBD4F2;
  --b4-bg: #48303A; --b4-fg: #F1C9D7; --b0-bg: #2A322F; --b0-fg: #EEF1EC;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html[data-text="large"] { font-size: 118%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--text); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
h1, h2, h3 { font-family: var(--head); font-weight: 700; margin: 0; line-height: 1.15; }
h1 { font-size: 26px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.amber-eyebrow { color: var(--amber-ink); }
.row { display: flex; gap: 10px; align-items: center; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-s { display: flex; flex-direction: column; gap: 6px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.spacer { flex: 1; }

/* ---- App frame ---------------------------------------------------------- */
#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); flex: 1; }
.page.narrow { max-width: 560px; }
.page.wide { max-width: 1440px; }
.topbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px 16px; position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); }
.topbar h1 { font-size: 22px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--head); font-weight: 700; font-size: 18px; }
.brand svg { color: var(--teal); }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--ink); border-radius: 12px; cursor: pointer; position: relative; text-decoration: none; flex-shrink: 0; }
.icon-btn:hover { background: var(--chip); }
.badge { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--line); display: flex; justify-content: space-around; align-items: center; }
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 60px; min-height: 52px; text-decoration: none; color: var(--muted-2); font-size: 11px; font-weight: 500; border-radius: 12px; }
.bottomnav a[aria-current="page"] { color: var(--teal); font-weight: 700; }
.desknav { display: none; }

@media (min-width: 900px) {
  .bottomnav { display: none; }
  .page { padding-bottom: 40px; }
  .desknav { display: flex; gap: 4px; align-items: center; }
  .desknav a { padding: 10px 14px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 15px; position: relative; }
  .desknav a[aria-current="page"] { background: var(--teal-soft); color: var(--teal-dark); }
  .desknav .badge { position: static; display: inline-flex; margin-left: 6px; vertical-align: 1px; }
  .topbar { padding: 12px 24px; border-bottom: 1px solid var(--line); }
}

/* ---- Building blocks -------------------------------------------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.tight { padding: 12px 14px; }
.btn { min-height: 48px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--muted-2); }
.btn.primary { background: var(--teal); color: var(--teal-ink); border-color: var(--teal); }
.btn.primary:hover { background: var(--teal-dark); color: var(--teal-ink); }
.btn.dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.chip { min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--card); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.chip.on { background: var(--teal); color: var(--teal-ink); border-color: var(--teal); }
.chip.amber { border-color: var(--amber-line); background: var(--amber-soft); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--teal-dark); background: var(--teal-soft); padding: 3px 10px; border-radius: 12px; }
.pill.amber { color: var(--amber-ink); background: var(--amber-soft); }
.pill.grey { color: var(--muted); background: var(--chip); }
.segmented { display: flex; padding: 4px; background: var(--chip); border-radius: 12px; gap: 2px; }
.segmented button, .segmented a { flex: 1; min-height: 40px; border: 0; border-radius: 9px; font-weight: 600; font-size: 14px; cursor: pointer; background: transparent; color: var(--ink); text-decoration: none; display: flex; align-items: center; justify-content: center; padding: 0 10px; white-space: nowrap; }
.segmented [aria-selected="true"], .segmented [aria-current="page"] { background: var(--card); box-shadow: var(--shadow); }
label.field, .field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.input, input[type=text], input[type=email], input[type=search], input:not([type]), select, textarea {
  min-height: 48px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--card); font-size: 16px; font-weight: 400; width: 100%; min-width: 0;
}
textarea { padding: 10px 12px; min-height: 110px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #6B7470; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.error { color: var(--danger); font-size: 14px; font-weight: 600; }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--teal-soft); color: var(--ink); font-size: 14px; }
.notice.warm { background: var(--amber-soft); }
.searchbox { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 12px; padding: 0 12px; min-height: 48px; background: var(--card); }
.searchbox input { border: 0; background: transparent; min-height: 46px; padding: 0; outline: none; }
.searchbox svg { color: var(--muted-2); flex-shrink: 0; }
.lock-line { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; z-index: 100; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--teal); animation: spin 0.8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- Avatars ----------------------------------------------------------- */
.av { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; overflow: hidden; background: var(--b0-bg); color: var(--b0-fg); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.s { width: 28px; height: 28px; font-size: 11px; }
.av.m { width: 44px; height: 44px; font-size: 15px; }
.av.l { width: 56px; height: 56px; font-size: 18px; }
.av.xl { width: 76px; height: 76px; font-size: 24px; }
.av.xxl { width: 104px; height: 104px; font-size: 32px; }
.b1 { background: var(--b1-bg); color: var(--b1-fg); }
.b2 { background: var(--b2-bg); color: var(--b2-fg); }
.b3 { background: var(--b3-bg); color: var(--b3-fg); }
.b4 { background: var(--b4-bg); color: var(--b4-fg); }

/* ---- Landing page --------------------------------------------------------- */
.landing { max-width: 640px; margin: 0 auto; padding: 0 0 40px; }
.landing header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; }
.landing .hero { padding: 20px 20px 28px; display: flex; flex-direction: column; gap: 16px; }
.landing .hero h1 { font-size: clamp(34px, 8vw, 48px); line-height: 1.06; }
.landing .hero p.lead { font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.landing section { padding: 0 20px; }
.landing .sec { padding-top: 32px; display: flex; flex-direction: column; gap: 14px; }
.branch { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.branch .mark { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-family: var(--head); font-weight: 700; font-size: 18px; flex-shrink: 0; }
.journey { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 8px 18px; }
.journey .stop { display: flex; gap: 14px; }
.journey .rail { display: flex; flex-direction: column; align-items: center; width: 14px; }
.journey .rail i { width: 2px; flex: 1; background: var(--amber-line); }
.journey .stop:first-child .rail i:first-child, .journey .stop:last-child .rail i:last-child { background: transparent; }
.journey .rail b { width: 12px; height: 12px; border-radius: 6px; background: var(--amber); flex-shrink: 0; }
.journey .txt { padding: 12px 0; }
.landing footer { padding: 28px 20px 0; display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 13px; }

/* ---- Tree: around a person ---------------------------------------------- */
.tree-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 4px 0 14px; }
.tree-head h1 { font-size: 24px; }
.family-view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.sides { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 900px) { .sides.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.side { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.side.spouse-side { border-color: var(--amber-line); background: color-mix(in srgb, var(--amber-soft) 55%, var(--card)); }
.side h2 { font-size: 17px; }
.gen-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.couple-row { display: flex; flex-wrap: wrap; gap: 8px; }
.couple { display: flex; flex-wrap: wrap; min-width: 0; max-width: 100%; gap: 6px; padding: 6px; border-radius: 12px; background: var(--card-2); border: 1px dashed var(--line-2); }
.pcard { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 10px 6px 6px; border: 1px solid var(--line); background: var(--card); border-radius: 12px; cursor: pointer; text-align: left; color: var(--ink); min-width: 0; text-decoration: none; }
.pcard:hover { border-color: var(--teal); }
.pcard .nm { font-size: 14px; font-weight: 600; line-height: 1.25; display: block; }
.pcard .yr { font-size: 12px; color: var(--muted); display: block; }
.pcard.add { border-style: dashed; color: var(--teal); }
.focus-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; padding: 6px 0; }
.focus-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 12px; border-radius: 18px; background: var(--card); border: 2px solid var(--teal); width: 170px; text-align: center; }
.focus-card.spouse { border-color: var(--amber); cursor: pointer; }
.focus-card .nm { font-weight: 700; font-size: 16px; line-height: 1.2; }
.marriage-link { width: 28px; height: 3px; background: var(--amber); border-radius: 2px; }
.vline { width: 2px; height: 18px; background: var(--line-2); margin: 0 auto; }
.kids { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.kid { display: flex; flex-direction: column; gap: 6px; align-items: stretch; padding: 8px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.kid .gk { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 6px; border-top: 1px dashed var(--line-2); }
.panel { position: sticky; top: 76px; }
.limited-line { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }

/* ---- Ancestors (pedigree) ---------------------------------------------- */
.ped-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 1100px) { .ped-wrap { grid-template-columns: minmax(0, 1fr) 360px; } }
.ped-scroll { overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; -webkit-overflow-scrolling: touch; max-height: 75vh; }
.ped-canvas { position: relative; }
.ped-heads { display: flex; position: sticky; top: -14px; background: var(--card); z-index: 2; padding: 4px 0 8px; }
.ped-heads span { flex-shrink: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.ped-box { position: absolute; height: 46px; border-radius: 10px; padding: 4px 10px; display: flex; flex-direction: column; justify-content: center; border: 1px solid transparent; cursor: pointer; text-align: left; overflow: hidden; }
.ped-box .nm { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.ped-box .yr { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.85; }
.ped-box .more { font-size: 11px; font-weight: 700; margin-left: 4px; padding: 0 5px; border-radius: 6px; background: rgba(255,255,255,0.6); }
.ped-box[aria-pressed="true"] { border: 2px solid var(--ink); }
.ped-box.shared { border: 1.5px solid var(--amber); }
.ped-box.hit { box-shadow: 0 0 0 3px var(--focus); }
.ped-line { position: absolute; background: var(--line-2); }
.ped-line.second { background: var(--amber); }
.outline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.outline li { display: flex; gap: 6px; align-items: flex-start; padding: 4px 6px; border-radius: 8px; }
.outline li.hl { background: #FBE7B5; color: #1C2321; }
.outline .tog { width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; font-weight: 700; }
.outline .dot { width: 28px; text-align: center; flex-shrink: 0; color: var(--muted); }
.outline a { color: var(--ink); font-weight: 600; text-decoration: none; }
.outline a:hover { color: var(--teal); }
.legend { display: flex; flex-wrap: wrap; gap: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 10px; }

/* ---- Person page ------------------------------------------------------ */
.person-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 8px 0 14px; }
.person-hero h1 { font-size: 28px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button, .tabs a { min-height: 46px; padding: 0 14px; border: 0; background: transparent; font-weight: 600; font-size: 15px; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none; display: flex; align-items: center; }
.tabs [aria-selected="true"] { color: var(--ink); border-bottom-color: var(--teal); }
.person-grid { display: grid; gap: 16px; }
@media (min-width: 980px) { .person-grid { grid-template-columns: 340px minmax(0, 1fr); align-items: start; } .person-grid .person-side { position: sticky; top: 80px; } }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 56px 22px minmax(0, 1fr); gap: 0 8px; }
.timeline .yr { font-family: var(--head); font-weight: 700; font-size: 16px; text-align: right; padding-top: 10px; }
.timeline .rail { display: flex; flex-direction: column; align-items: center; }
.timeline .rail i { width: 3px; flex: 1; background: var(--place-color, var(--line-2)); }
.timeline .rail b { width: 14px; height: 14px; border-radius: 7px; margin: 12px 0 0; background: var(--card); border: 3px solid var(--teal); flex-shrink: 0; }
.timeline li.other .rail b { border-color: var(--amber); }
.timeline li.loss .rail b { border-color: var(--muted-2); }
.timeline .body { padding: 8px 0 16px; display: flex; flex-direction: column; gap: 4px; }
.timeline .ttl { font-weight: 600; font-size: 15px; }
.timeline .plc { font-size: 13px; color: var(--muted); }
.timeline .faces { display: flex; flex-wrap: wrap; gap: 6px; }
.timeline .cmp-tag { align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: var(--amber-ink); background: var(--amber-soft); padding: 2px 8px; border-radius: 8px; }
.place-strip { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: 6px 0 4px; }
.place-strip span { display: block; height: 100%; }
.place-key { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.place-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
.rel-faces { display: flex; flex-wrap: wrap; gap: 8px; }
.face-link { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 78px; text-decoration: none; color: var(--ink); font-size: 12.5px; font-weight: 600; text-align: center; line-height: 1.2; }
.face-link .rl { font-weight: 400; color: var(--muted); font-size: 11.5px; }

/* ---- Map ------------------------------------------------------------- */
.map-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px; }
.map-svg { width: 100%; height: auto; display: block; touch-action: none; border-radius: 10px; background: color-mix(in srgb, var(--teal-soft) 40%, var(--card)); cursor: grab; }
.map-svg .land { fill: var(--chip); stroke: var(--card); stroke-width: 0.5; }
.map-svg .land.lived { fill: color-mix(in srgb, var(--teal) 22%, var(--chip)); }
.map-svg .arc { fill: none; stroke: var(--amber); stroke-linecap: round; opacity: 0.85; }
.map-svg .arc.gen { stroke: var(--teal); stroke-dasharray: 4 4; }
.map-svg .dot { fill: var(--ink); stroke: var(--card); stroke-width: 1; }
.map-svg text { font-family: var(--text); font-weight: 600; fill: var(--ink); paint-order: stroke; stroke: var(--card); stroke-width: 3px; }
.map-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 2px 2px; }
.slider-row { display: flex; flex-direction: column; gap: 6px; }
input[type=range] { accent-color: var(--teal); width: 100%; min-height: 32px; }
.moves { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.moves li { display: flex; gap: 12px; align-items: baseline; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.moves .y { font-family: var(--head); font-weight: 700; min-width: 52px; }

/* ---- Search ----------------------------------------------------------- */
.results { display: flex; flex-direction: column; gap: 8px; }
.result { display: flex; gap: 12px; align-items: center; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); }
.result:hover { border-color: var(--teal); }
.result .why { font-size: 12.5px; color: var(--muted); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters select { width: auto; min-height: 38px; font-size: 14px; padding: 0 8px; border-radius: 18px; }

/* ---- Photos ----------------------------------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
@media (min-width: 700px) { .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; } }
.gallery a { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--chip); display: block; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font-size: 11px; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,0.6)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer { display: grid; gap: 14px; }
@media (min-width: 900px) { .viewer { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.viewer .imgbox { position: relative; background: #111; border-radius: 14px; overflow: hidden; display: flex; justify-content: center; }
.viewer .imgbox img { max-height: 72vh; width: auto; }
.facebox { position: absolute; border: 2px solid #fff; border-radius: 8px; box-shadow: 0 0 0 1px rgba(0,0,0,0.4); display: block; }
.facebox span { position: absolute; left: 0; top: 100%; margin-top: 4px; background: rgba(0,0,0,0.75); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 6px; white-space: nowrap; }

/* ---- Review queue / accounts -------------------------------------------- */
.qitem { display: flex; flex-direction: column; gap: 10px; }
.qitem .ph { width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px; background: var(--chip); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.table-scroll { overflow-x: auto; }
.picker { position: relative; }
.picker .list { position: absolute; left: 0; right: 0; top: 100%; z-index: 40; background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); max-height: 280px; overflow: auto; margin-top: 4px; }
.picker .list button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 8px 10px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.picker .list button:hover, .picker .list button:focus { background: var(--teal-soft); }

/* ---- Welcome guide ------------------------------------------------------- */
.guide { max-width: 520px; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; min-height: 80vh; }
.guide .dots { display: flex; gap: 6px; justify-content: center; }
.guide .dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--line-2); }
.guide .dots i.on { width: 22px; background: var(--teal); }
.guide .art { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.guide .steps { display: flex; flex-direction: column; gap: 10px; text-align: left; width: 100%; }
.guide .step { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); }
.guide .step b { width: 30px; height: 30px; border-radius: 15px; background: var(--teal); color: var(--teal-ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---- Print ------------------------------------------------------------- */
.print-only { display: none; }
.print-sheet { background: #fff; color: #1C2321; }
.ptree { position: relative; }
.ptree .pbox { position: absolute; border: 1px solid #8A938F; border-radius: 8px; background: #fff; padding: 5px 8px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.ptree .pbox.centre { border: 2px solid #1C2321; }
.ptree .pbox .n { font-size: 11.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptree .pbox .s { font-size: 10.5px; color: #3E4744; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptree .pl { position: absolute; background: #1C2321; }
.ptree .pl.m { background: #9A5512; }
.print-page { width: 100%; padding: 0; break-after: page; page-break-after: always; }
.print-page:last-child { break-after: auto; page-break-after: auto; }
.print-page header { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1.5px solid #1C2321; padding-bottom: 8px; margin-bottom: 12px; }
.print-page footer { display: flex; justify-content: space-between; border-top: 1px solid #C9CFC9; padding-top: 6px; margin-top: 10px; font-size: 10px; color: #3E4744; }
.avoid-break { break-inside: avoid; page-break-inside: avoid; }
.print-preview { background: var(--chip); padding: 16px; border-radius: 16px; overflow: auto; }
.print-preview .print-page { background: #fff; color: #1C2321; padding: 28px; margin: 0 auto 16px; box-shadow: var(--shadow); border-radius: 4px; }
.print-preview .landscape { width: 1040px; min-height: 720px; }
.print-preview .portrait { width: 760px; min-height: 1000px; }

@media print {
  :root { --bg: #fff; --card: #fff; --ink: #1C2321; color-scheme: light; }
  body { background: #fff; color: #1C2321; font-size: 11pt; }
  .no-print, .topbar, .bottomnav, .toast { display: none !important; }
  .print-only { display: block; }
  .page { padding: 0; max-width: none; }
  .print-preview { background: none; padding: 0; overflow: visible; }
  .print-preview .print-page { box-shadow: none; margin: 0; padding: 0; width: auto; min-height: 0; border-radius: 0; }
  .timeline li, .card, .side, .pbox, .result { break-inside: avoid; page-break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

.mobile-only { }
@media (min-width: 900px) { .mobile-only { display: none !important; } }
@media (max-width: 899px) { .sr-only-mobile { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
@media (min-width: 1100px) { .print-layout { grid-template-columns: 300px minmax(0, 1fr) !important; align-items: start; } }
@media print { .print-layout { display: block !important; } }
.shell { display: flex; flex-direction: column; min-height: 100vh; }

.badge[hidden] { display: none; }
.couple .pcard { flex: 1 1 140px; }
