/* Roots & Branches
   Warm cream background, rounded colour cards, arch-framed photos.
   Fraunces (soft) for names and headings, DM Sans for everything else.
   Each generation has its own colour: lavender, sage, orange, soft blue. */

@font-face { font-family: "Fraunces"; src: url(fonts/fraunces-latin-full-normal.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url(fonts/fraunces-latin-ext-full-normal.woff2) format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Sans"; src: url(fonts/dm-sans-latin-wght-normal.woff2) format("woff2"); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url(fonts/dm-sans-latin-ext-wght-normal.woff2) format("woff2"); font-weight: 100 1000; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --cream: #fbf3e6;
  --sand: #f1e4cd;
  --paper: #ffffff;
  --ink: #2b2620;
  --ink-2: #5d564c;
  --mute: #8a8174;
  --line: #e6d8bf;
  --lav: #bdb8ee;   --lav-d: #4d4a8a;
  --sage: #cfe2aa;  --sage-d: #33502f;
  --orange: #e8743f; --orange-d: #7a2e0e;
  --blue: #a9bfd8;  --blue-d: #2e4b6a;
  --lilac: #c9b0d2; --lilac-d: #4d3a55;
  --mustard: #c9a04b;
  --danger: #b5321b;
  --danger-bg: #fde4dc;
  --veil: rgba(255,255,255,.72);   /* soft white layer on colour cards */
  --veil-strong: #ffffff;
  --primary-hover: #3d362d;
  --knob: #d9c8a8;
  --r-lg: 28px; --r-md: 20px;
  --head: "Fraunces", Georgia, serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 400 17px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--mustard); outline-offset: 2px; }
h1, h2, h3, .fr { font-family: var(--head); font-variation-settings: "SOFT" 100, "WONK" 0; font-weight: 600; letter-spacing: -.02em; margin: 0; }
h1 { font-size: clamp(2.4rem, 7vw, 4rem); line-height: .98; }
h2 { font-size: 1.5rem; line-height: 1.1; }
h3 { font-size: 1.3rem; line-height: 1.15; }
.muted { color: var(--mute); }
.small { font-size: .88rem; }
[hidden] { display: none !important; }

/* ── Header ─────────────────────────────────────────────── */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 12px max(16px, calc((100vw - 1040px) / 2)); background: color-mix(in srgb, var(--cream) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; font-family: var(--head); font-variation-settings: "SOFT" 100, "WONK" 0; font-size: 1.3rem; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.brand svg { width: 28px; height: 28px; flex: none; }
nav { margin-left: auto; display: flex; gap: 6px; }
nav a { text-decoration: none; padding: 8px 16px; border-radius: 999px; background: var(--sand); font-size: .92rem; font-weight: 500; }
nav a:hover { background: var(--line); }
nav a.on { background: var(--ink); color: var(--cream); }
@media (max-width: 480px) { .brand span { display: none; } nav { gap: 4px; } nav a { padding: 7px 12px; font-size: .88rem; } }

#whoami-bar { padding: 0 max(16px, calc((100vw - 1040px) / 2)) 6px; font-size: .85rem; color: var(--mute); }
#whoami-bar strong { color: var(--ink); font-weight: 600; }
#whoami-bar button { background: none; border: 0; padding: 0; color: var(--orange); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

main { max-width: 1040px; margin: 0 auto; padding: 12px 16px 96px; }
.error { background: var(--danger-bg); color: var(--danger); padding: 12px 16px; border-radius: 16px; margin: 0 0 16px; }

/* ── Buttons ────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 20px; border: 0; border-radius: 999px; background: var(--sand); color: var(--ink); text-decoration: none; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--line); }
.btn.primary { background: var(--ink); color: var(--cream); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.light { background: var(--veil); }
.btn.light:hover { background: var(--veil-strong); }
.btn.danger { background: var(--danger-bg); color: var(--danger); }
.btn.small { min-height: 38px; padding: 4px 16px; font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

/* ── Photos ─────────────────────────────────────────────── */
.avatar { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.ph { display: grid; place-items: center; font-family: var(--head); font-variation-settings: "SOFT" 100; font-weight: 600; font-size: 1.6rem; color: rgba(43,38,32,.7); }
.tint-0 { background: linear-gradient(160deg, #e9e6fb, var(--lav)); color: var(--lav-d) !important; }
.tint-1 { background: linear-gradient(160deg, #eef6dc, var(--sage)); color: var(--sage-d) !important; }
.tint-2 { background: linear-gradient(160deg, #ffe1cc, #f4a77f); color: var(--orange-d) !important; }
.tint-3 { background: linear-gradient(160deg, #e4edf6, var(--blue)); color: var(--blue-d) !important; }
.passed .avatar, .avatar.passed { filter: grayscale(1); }

/* Arch frame: white border, rounded top like a doorway */
.arch-frame { display: block; padding: 5px; background: var(--paper); border-radius: 50%; box-shadow: 0 6px 18px rgba(43,38,32,.12); overflow: hidden; }
.arch-frame .avatar { border-radius: 50%; aspect-ratio: 1; height: auto; }
.arch-frame.you { background: var(--mustard); }
.sticker { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--mustard); color: #fff; font-weight: 700; font-size: .8rem; transform: rotate(-12deg); box-shadow: 0 0 0 3px var(--cream); }

/* Cards */
.card { position: relative; border-radius: var(--r-lg); padding: 20px; margin-top: 12px; overflow: hidden; }
.card.plain { background: var(--paper); }

/* ── Person page ────────────────────────────────────────── */
.hero { background: var(--lilac); padding: 22px 22px 24px; margin-top: 4px; }
.hero-row { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 14px; align-items: stretch; }
.arch-frame.big .avatar.ph { font-size: 4rem; }
.shapes { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; max-width: 280px; }
.shapes i { display: block; aspect-ratio: 1; }
.shapes { align-content: start; }
.s1 { background: var(--orange); border-radius: 50%; } .s2 { background: var(--paper); border-radius: 0 0 999px 999px; }
.s3 { background: var(--mustard); border-radius: 999px 999px 0 0; } .s4 { background: var(--sage); border-radius: 0 999px 999px 0; }
.hero h1 { margin-top: 20px; }
@media (min-width: 760px) {
  .hero { display: grid; grid-template-columns: 220px 1fr 230px; gap: 0 28px; align-items: end; }
  .hero-row { display: contents; }
  .hero-row .arch-frame { grid-column: 1; grid-row: 1 / span 4; }
  .hero-row .shapes { grid-column: 3; grid-row: 1 / span 4; align-self: start; width: 100%; }
  .hero > h1, .hero > .meta, .hero > .aka, .hero > .actions { grid-column: 2; }
  .hero > h1 { margin-top: 0; font-size: clamp(3rem, 6vw, 4.6rem); }
}
@media (max-width: 759px) { .hero-row { grid-template-columns: 1.5fr 1fr; } }
.hero .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; font-size: .95rem; color: var(--lilac-d); }
.rel { background: var(--ink); color: var(--cream); font-weight: 600; font-size: .9rem; padding: 6px 14px; border-radius: 999px; }
.rel.quiet { background: var(--veil); color: var(--ink-2); }
.aka { margin: 8px 0 0; color: var(--lilac-d); font-size: .95rem; }
.hero.passed .shapes { filter: grayscale(.6); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 12px; }
@media (max-width: 860px) { .tiles { grid-template-columns: 1fr 1fr; } }
.tiles .card { margin-top: 0; }
.tile { min-height: 184px; display: flex; flex-direction: column; justify-content: space-between; padding: 16px 16px 18px; }
.tile .plus { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%; background: var(--veil); display: grid; place-items: center; font-size: 1.2rem; text-decoration: none; }
.tile .plus:hover { background: var(--veil-strong); }
.duo { display: flex; gap: 6px; align-items: flex-end; min-height: 72px; padding-right: 30px; }
.mini { text-decoration: none; display: block; width: 58px; padding: 3px; background: var(--paper); border-radius: 50%; overflow: hidden; }
.mini .avatar { aspect-ratio: 1; height: auto; border-radius: 50%; font-size: 1rem; }
.mini.round, .mini.round .avatar { border-radius: 50%; } .mini.round .avatar { aspect-ratio: 1; }
.more { font-weight: 700; font-size: .85rem; padding-bottom: 6px; }
.tile h2 { font-size: 1.45rem; margin-top: 14px; }
.tile .names { margin: 4px 0 0; font-size: .86rem; }
.tile .names a { text-decoration: none; } .tile .names a:hover { text-decoration: underline; }
.sage { background: var(--sage); color: var(--sage-d); } .blue { background: var(--blue); color: var(--blue-d); }
.orange { background: var(--orange); color: #fff; } .lav { background: var(--lav); color: var(--lav-d); }

.story { background: var(--blue); color: var(--blue-d); padding: 18px 20px 22px; }
.story-photo { height: 150px; border-radius: 999px; overflow: hidden; margin-bottom: 16px; border: 5px solid var(--veil); }
.story-photo img { width: 100%; height: 100%; object-fit: cover; }
.story h3 { font-size: 1.6rem; }
.story .body { margin-top: 8px; font-size: 1.05rem; line-height: 1.65; white-space: pre-wrap; color: #22405e; max-width: 62ch; }
.story .by { margin: 12px 0 0; font-size: .86rem; font-weight: 600; }
.story .by a { text-underline-offset: 3px; }

.line-card { background: var(--sage); color: var(--sage-d); }
.line-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.line { display: flex; align-items: flex-end; justify-content: flex-start; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.step { display: grid; justify-items: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: .9rem; width: 104px; }
@media (max-width: 480px) { .line { gap: 4px; flex-wrap: nowrap; } .step { width: 78px; font-size: .82rem; } .arr { font-size: 1rem; padding-bottom: 36px; } }
.step .arch-frame { width: 100%; }
.step .arch-frame.self:not(.you) { background: var(--sage-d); }
.arr { font-size: 1.2rem; padding-bottom: 46px; opacity: .7; }

.cta { background: var(--paper); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cta h2 { color: var(--orange); font-size: 1.35rem; }
.cta p { margin: 4px 0 0; color: var(--ink-2); font-size: .92rem; }

.details h2 { margin-bottom: 8px; }
.facts { display: grid; grid-template-columns: max-content 1fr; margin: 0; }
.facts dt, .facts dd { padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0; }
.facts dt { color: var(--mute); padding-right: 24px; }
.notes { white-space: pre-wrap; line-height: 1.65; margin: 14px 0 0; color: var(--ink-2); }
details.fix summary { cursor: pointer; font-weight: 600; }
.rel-list { list-style: none; padding: 0; margin: 12px 0 0; }
.rel-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rel-list a { text-underline-offset: 3px; }
.x { background: none; border: 0; color: var(--danger); cursor: pointer; font-weight: 600; }

/* "who": a person in a grid (who are you, everyone) */
.who { display: grid; justify-items: center; gap: 8px; text-align: center; text-decoration: none; padding: 0; position: relative; }
.who .avatar { aspect-ratio: 1; height: auto; border-radius: 50%; }
.who > .avatar, .who > span.avatar { border: 5px solid var(--paper); border-radius: 50%; box-shadow: 0 6px 18px rgba(43,38,32,.1); }
.who .n { font-family: var(--head); font-variation-settings: "SOFT" 100; font-weight: 600; font-size: 1.05rem; line-height: 1.15; }
.who .nick, .who .y, .who .tag { font-size: .8rem; color: var(--mute); margin-top: -4px; }
.who.you > .avatar { border-color: var(--mustard); }
.who.you .tag { color: var(--ink); font-weight: 700; }
.who:hover > .avatar { transform: translateY(-2px); }
.who.passed .n::after { content: " †"; color: var(--mute); font-weight: 400; }

/* ── Forms ──────────────────────────────────────────────── */
.form-head { margin: 8px 0 18px; }
form.sheet { max-width: 760px; background: var(--paper); border-radius: var(--r-lg); padding: 26px; }
@media (max-width: 600px) { form.sheet { padding: 18px; } }
.field { display: grid; gap: 6px; margin-bottom: 18px; align-content: start; }
.field label, .field .label { font-weight: 600; font-size: .95rem; }
.field .hint { font-size: .82rem; color: var(--mute); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
input[type=text], input[type=search], select, textarea { width: 100%; min-height: 48px; padding: 10px 16px; border: 2px solid transparent; border-radius: 16px; background: var(--cream); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--mustard); background: var(--paper); }
textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 400 !important; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.checks { display: grid; gap: 8px; max-height: 280px; overflow: auto; padding: 12px 16px; border-radius: 16px; background: var(--cream); }
.seg { display: inline-flex; gap: 6px; margin: 0 0 18px; }
.seg a { padding: 8px 16px; text-decoration: none; border-radius: 999px; background: var(--sand); font-weight: 600; font-size: .92rem; }
.seg a.on { background: var(--ink); color: var(--cream); }

/* ── Lists ──────────────────────────────────────────────── */
.search { margin: 16px 0 24px; max-width: 460px; background: var(--paper) !important; }
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 22px 14px; }
.album > * { min-width: 0; }
.album button.who { background: none; border: 0; cursor: pointer; font: inherit; color: inherit; }
@media (max-width: 480px) { .album { grid-template-columns: repeat(3, 1fr); gap: 16px 10px; } .who .n { font-size: .92rem; } }

/* ── Family map ─────────────────────────────────────────── */
body.mapmode main { max-width: none; padding: 0; }
body.mapmode #whoami-bar { display: none !important; }
.map { position: relative; height: calc(100dvh - 64px); overflow: hidden; background: var(--cream); touch-action: none; cursor: grab; outline: none; }
.map.dragging { cursor: grabbing; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.map-svg { position: absolute; inset: 0; overflow: visible; }
.gridline { display: none; }
.band.lav { fill: var(--lav); } .band.sage { fill: var(--sage); } .band.orange { fill: var(--orange); } .band.blue { fill: var(--blue); }
.band-label { font: 600 26px var(--head); font-variation-settings: "SOFT" 100; letter-spacing: -.02em; }
.band-label.lav { fill: var(--lav-d); } .band-label.sage { fill: var(--sage-d); } .band-label.orange { fill: #fff; } .band-label.blue { fill: var(--blue-d); }
.glow path { fill: none; stroke: var(--ink); stroke-opacity: .8; stroke-width: 4; stroke-linecap: round; }
.couples line { stroke: var(--ink); stroke-opacity: .8; stroke-width: 4; stroke-linecap: round; }
.couples circle { fill: var(--mustard); }
.pin { position: absolute; display: grid; justify-items: center; gap: 6px; text-align: center; text-decoration: none; -webkit-user-drag: none; user-select: none; }
.pin .arch-frame { width: 100%; }
.pin .avatar { pointer-events: none; -webkit-user-drag: none; }
.pin:hover .arch-frame { box-shadow: 0 10px 24px rgba(43,38,32,.2); }
.pin .n { font-family: var(--head); font-variation-settings: "SOFT" 100; font-weight: 600; font-size: 1.05rem; line-height: 1.1; color: var(--ink); }
.pin .y { font-size: .78rem; color: var(--ink-2); margin-top: -3px; }
.pin.passed .n::after { content: " †"; font-weight: 400; }
.pin.focus:not(.you) .arch-frame { background: var(--ink); }
.pin .sticker { position: absolute; right: -16px; top: -12px; }
.map-ui { position: absolute; z-index: 2; }
.map-head { left: 16px; top: 14px; display: grid; gap: 10px; justify-items: start; padding: 16px 20px; background: var(--sand); border-radius: 24px; box-shadow: 0 6px 20px rgba(43,38,32,.12); }
.map-head h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.map-head .seg { margin: 0; } .map-head .seg a { background: var(--veil); } .map-head .seg a.on { background: var(--ink); }
.map-head .back { font-weight: 600; font-size: .9rem; }
.map-zoom { right: 16px; top: 14px; display: grid; gap: 8px; }
.map-zoom button { width: 46px; height: 46px; border: 0; border-radius: 16px; background: var(--paper); font-size: 1.3rem; cursor: pointer; box-shadow: 0 4px 14px rgba(43,38,32,.15); }
.map-zoom button:hover { background: var(--sand); }
.minimap { right: 16px; bottom: 16px; width: 180px; height: 120px; background: var(--paper); border-radius: 20px; padding: 10px; box-shadow: 0 6px 18px rgba(43,38,32,.15); }
.minimap svg { width: 100%; height: 100%; cursor: pointer; touch-action: none; }
.minimap circle { fill: var(--ink); opacity: .35; } .minimap circle.you { fill: var(--mustard); opacity: 1; }
.mm-view { fill: var(--mustard); fill-opacity: .15; stroke: var(--mustard); vector-effect: non-scaling-stroke; stroke-width: 2; }
.map-hint { left: 20px; bottom: 18px; margin: 0; font-size: .82rem; color: var(--ink-2); background: var(--paper); padding: 7px 14px; border-radius: 999px; pointer-events: none; }
@media (max-width: 640px) {
  .map-head { left: 10px; top: 10px; padding: 12px 14px; border-radius: 20px; }
  .minimap { width: 118px; height: 82px; border-radius: 16px; }
  .map-hint { display: none; }
}

/* ── Welcome & other pages ──────────────────────────────── */
.welcome { max-width: 640px; margin: 4vh auto 0; text-align: center; background: var(--lilac); border-radius: var(--r-lg); padding: 36px 26px; }
.welcome h1 { margin-bottom: 14px; }
.welcome p { font-size: 1.1rem; line-height: 1.55; color: var(--lilac-d); margin: 0 0 22px; }
.section { margin-top: 12px; background: var(--paper); border-radius: var(--r-lg); padding: 24px; }
.section p { max-width: 62ch; color: var(--ink-2); }

#toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); text-align: center; background: var(--ink); color: var(--cream); padding: 12px 22px; border-radius: 999px; font-weight: 600; z-index: 20; }
@media (prefers-reduced-motion: no-preference) {
  #toast { animation: rise .2s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }
  .who > .avatar { transition: transform .15s; }
}

/* ── Viewing / editing mode ─────────────────────────────── */
body.viewing .edit-only { display: none !important; }
body:not(.viewing) .view-only { display: none !important; }
.view-only { opacity: .75; }
#whoami-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.linkish { background: none; border: 0; padding: 0; color: var(--orange); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
#whoami-bar .mode { margin-left: auto; display: inline-flex; text-decoration: none; align-items: center; gap: 8px; border: 0; background: var(--sand); color: var(--ink); padding: 5px 14px 5px 5px; border-radius: 999px; font-weight: 600; font-size: .85rem; cursor: pointer; }
#whoami-bar .mode .knob { width: 34px; height: 20px; border-radius: 999px; background: var(--knob); position: relative; transition: background .15s; }
#whoami-bar .mode .knob::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
#whoami-bar .mode[aria-pressed="true"] { background: var(--orange); color: #fff; }
#whoami-bar .mode[aria-pressed="true"] .knob { background: rgba(255,255,255,.4); }
#whoami-bar .mode[aria-pressed="true"] .knob::after { transform: translateX(14px); }
.locked { max-width: 640px; }
.locked p { color: var(--ink-2); }

/* ── Form extras ────────────────────────────────────────── */
.opt { font-weight: 400; color: var(--mute); font-size: .85rem; margin-left: 4px; }
.form-sub { font-size: 1.2rem; margin: 10px 0 12px; }
.date-row { display: grid; grid-template-columns: 1fr 1.6fr 1.1fr; gap: 8px; }
.check.small { font-size: .88rem; color: var(--ink-2); margin-top: 4px; }
.place-wrap { position: relative; }
.suggest { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; background: var(--paper); border-radius: 18px; box-shadow: 0 10px 30px rgba(43,38,32,.18); max-height: 320px; overflow: auto; }
.suggest li { padding: 9px 12px; border-radius: 12px; cursor: pointer; }
.suggest li[role=option]:hover, .suggest li.on { background: var(--sand); }
.suggest li small { display: block; color: var(--mute); font-size: .78rem; line-height: 1.3; }
.suggest .sg-head { font-size: .75rem; font-weight: 700; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; cursor: default; padding: 8px 12px 4px; }
.suggest .sg-note { color: var(--ink-2); font-size: .88rem; cursor: default; }

/* ── Birthdays ──────────────────────────────────────────── */
.bdays { background: var(--lilac); color: var(--lilac-d); margin-bottom: 8px; }
.bdays h2 { font-size: 1.3rem; }
.bday-row { display: flex; gap: 10px; margin-top: 14px; overflow-x: auto; padding-bottom: 4px; }
.bday { flex: none; display: flex; align-items: center; gap: 10px; background: var(--veil); border-radius: 20px; padding: 8px 16px 8px 8px; text-decoration: none; color: var(--ink); }
.bday .mini { width: 46px; }
.bday b { display: block; font-family: var(--head); font-variation-settings: "SOFT" 100; font-weight: 600; }
.bday span span { display: block; font-size: .8rem; color: var(--ink-2); }
.bday em { font-style: normal; font-size: .78rem; font-weight: 700; color: var(--orange-d); }
.bday.soon { background: var(--paper); box-shadow: 0 0 0 3px var(--mustard); }

/* ── Places ─────────────────────────────────────────────── */
.map-card { padding: 8px; background: var(--paper); }
#pmap { height: 380px; border-radius: 22px; z-index: 0; }
#map-note { margin: 10px 12px; }
.place-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; }
.place-list .card { margin-top: 0; }
.place { background: var(--paper); }
.place:nth-child(4n+1) { background: var(--sage); } .place:nth-child(4n+2) { background: var(--blue); } .place:nth-child(4n+3) { background: var(--lav); } .place:nth-child(4n+4) { background: var(--sand); }
.pl-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.pl-head h2 { font-size: 1.3rem; }
.pl-flag { font-size: .72rem; font-weight: 700; background: var(--veil); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.pl-aka { margin: 4px 0 0; font-size: .85rem; opacity: .85; }
.pl-kind { margin: 14px 0 6px; font-size: .78rem; font-weight: 700; opacity: .75; }
.pl-people { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-person { display: inline-flex; align-items: center; gap: 8px; background: var(--veil); border-radius: 999px; padding: 4px 12px 4px 4px; text-decoration: none; font-weight: 600; font-size: .9rem; }
.pl-person .mini { width: 30px; padding: 2px; }
.pl-person .mini .avatar { font-size: .7rem; }
@media (max-width: 480px) { nav a[data-nav="places"] { padding: 7px 10px; } #pmap { height: 300px; } }

/* ── Sign in & sharing ──────────────────────────────────── */
.signin { margin-top: 10vh; }
.signin input { max-width: 280px; background: var(--paper) !important; }
.row-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.row-form input { flex: 1 1 220px; }
.inv-list, .bk-list { list-style: none; padding: 0; margin: 16px 0 0; }
.inv-list li, .bk-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.inv-list li > div:first-child { display: grid; gap: 2px; min-width: 0; }
.inv-list code { font-size: .78rem; color: var(--ink-2); background: var(--cream); padding: 4px 8px; border-radius: 8px; word-break: break-all; }
.bk-list li > span:first-child { display: grid; }
.inv-actions { display: flex; gap: 10px; align-items: center; }
details.sub { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
details.sub summary { cursor: pointer; font-weight: 600; }
.changed { margin: 6px 0 0; font-size: .82rem; color: var(--lilac-d); opacity: .85; }
.line-head h2 { margin: 0; }
.hist { list-style: none; padding: 0; margin: 10px 0 0; }
.hist li { display: grid; grid-template-columns: 170px 1fr auto; gap: 4px 16px; padding: 10px 0; border-top: 1px solid var(--line); align-items: baseline; }
.hist li:first-child { border-top: 0; }
.h-who { font-weight: 600; } .h-what a { text-underline-offset: 3px; }
@media (max-width: 640px) { .hist li { grid-template-columns: 1fr; } }

/* ── Places tips & tidy ─────────────────────────────────── */
details.tips { font-size: .84rem; color: var(--ink-2); }
details.tips summary { cursor: pointer; color: var(--orange-d); font-weight: 600; width: max-content; }
details.tips ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.5; }
.fix-place { margin-top: 10px; }
.fp-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.fp-list button { width: 100%; text-align: left; border: 0; background: var(--veil); border-radius: 14px; padding: 9px 12px; cursor: pointer; }
.fp-list button:hover { background: var(--veil-strong); }
.fp-list small { display: block; color: var(--mute); font-size: .76rem; }
.fp-form input { background: var(--veil) !important; min-height: 40px; }

/* ── Photos & videos ────────────────────────────────────── */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.thumb { position: relative; display: block; aspect-ratio: 1; border: 0; padding: 0; border-radius: 20px; overflow: hidden; background: var(--sand); cursor: pointer; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.thumb .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(43,38,32,.7); color: #fff; display: grid; place-items: center; font-size: .9rem; padding-left: 3px; }
.thumb:hover { box-shadow: 0 0 0 3px var(--mustard); }
.noshow { display: grid; place-items: center; height: 100%; padding: 10px; text-align: center; font-size: .8rem; color: var(--ink-2); }
@media (max-width: 480px) { .gallery { grid-template-columns: repeat(3, 1fr); gap: 6px; } .thumb { border-radius: 14px; } }
.empty-g { grid-column: 1 / -1; }
.media-card { background: var(--lav); color: var(--lav-d); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 14px; }
.thumbs .thumb { border-radius: 16px; }
.media-add { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.media-add h2 { font-size: 1.25rem; } .media-add p { margin: 4px 0 0; color: var(--ink-2); font-size: .92rem; }
.upload { margin: 0 0 14px; }
.drop { display: grid; place-items: center; min-height: 120px; border: 2.5px dashed var(--line); border-radius: 22px; background: var(--cream); cursor: pointer; text-align: center; padding: 16px; margin-top: 12px; }
.drop.over, .drop:hover { border-color: var(--mustard); background: #fff8ea; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.tag-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-height: 180px; overflow: auto; }
.tag { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; background: var(--sand); cursor: pointer; font-size: .9rem; font-weight: 500; user-select: none; }
.tag input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tag.on { background: var(--ink); color: var(--cream); }
.tag:focus-within { outline: 3px solid var(--mustard); }
.date-row.two { grid-template-columns: 1.6fr 1fr; }
.progress { position: relative; height: 34px; border-radius: 999px; background: var(--sand); overflow: hidden; margin-top: 8px; }
.progress div { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--mustard); transition: width .2s; }
.progress span { position: relative; display: grid; place-items: center; height: 100%; font-weight: 600; font-size: .88rem; }
.viewer { position: fixed; inset: 0; z-index: 30; background: rgba(28,24,20,.94); color: #fff; display: grid; grid-template-rows: auto 1fr auto; overflow: auto; }
.v-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; }
.v-top .muted { color: #cfc6b8; }
.v-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 56px; }
.v-stage img, .v-stage video { max-width: 100%; max-height: 70vh; border-radius: 18px; }
.v-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 1.4rem; cursor: pointer; }
.v-btn:hover:not(:disabled) { background: rgba(255,255,255,.26); }
.v-btn:disabled { opacity: .25; cursor: default; }
.v-prev { position: absolute; left: 6px; } .v-next { position: absolute; right: 6px; }
.v-info { max-width: 760px; width: 100%; margin: 0 auto; padding: 14px 18px 26px; }
.v-info h2 { font-size: 1.4rem; } .v-info p { color: #e2d9cb; margin: 4px 0 10px; }
.v-info .pl-person { background: rgba(255,255,255,.14); color: #fff; }
.v-info .x { color: #ffb4a3; }
.v-form { background: var(--paper); color: var(--ink); border-radius: 22px; padding: 18px; margin-top: 12px; }
@media (max-width: 640px) { .v-stage { padding: 0 8px; } .v-prev, .v-next { top: auto; bottom: -56px; } .v-prev { left: 16px; } .v-next { right: 16px; } .v-info { padding-top: 60px; } }
@media (max-width: 520px) { nav { gap: 3px; } nav a { padding: 7px 9px; font-size: .82rem; } }

/* fixes */
.hero-row > .arch-frame { align-self: start; }
input[type=password] { width: 100%; min-height: 48px; padding: 10px 16px; border: 2px solid transparent; border-radius: 16px; background: var(--paper); }
input[type=password]:focus { outline: none; border-color: var(--mustard); }
body.signed-out nav, body.signed-out #whoami-bar { display: none !important; }
nav { overflow-x: auto; scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }
.viewer { background: rgba(28,24,20,.97); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
@media (max-width: 759px) {
  .hero-row { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .hero-row > .arch-frame { width: 100%; }
}
.hero-row > * { min-width: 0; }
.shapes { width: 100%; }
@media (max-width: 420px) { nav { gap: 2px; } nav a { padding: 6px 8px; font-size: .8rem; } .top { gap: 8px; padding-left: 12px; padding-right: 12px; } .brand svg { width: 24px; height: 24px; } }
.shapes { grid-template-rows: auto auto; }
.shapes i { width: 100%; height: auto; }

/* ── Explore cards ──────────────────────────────────────── */
.explore-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 14px; }
.ex { display: grid; gap: 4px; padding: 16px 18px; border-radius: 20px; text-decoration: none; min-height: 96px; align-content: start; }
.ex b { font-family: var(--head); font-variation-settings: "SOFT" 100; font-weight: 600; font-size: 1.15rem; }
.ex span { font-size: .86rem; opacity: .9; }
.ex:hover { filter: brightness(.97); }
.sand { background: var(--sand); color: var(--ink); }
.grey { background: #e6e1d8; color: var(--ink-2); }
.duo-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px; }
@media (max-width: 640px) { .duo-cta { grid-template-columns: 1fr; } }

/* ── Timeline ───────────────────────────────────────────── */
.timeline { list-style: none; padding: 0; margin: 14px 0 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; display: grid; grid-template-columns: 150px 1fr; gap: 2px 16px; padding: 8px 0 8px 28px; align-items: baseline; }
.tl-dot { position: absolute; left: 0; top: 13px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--paper); box-shadow: 0 0 0 1.5px var(--line); }
.tl-item.tone-sage .tl-dot { background: #8fb36a; } .tl-item.tone-orange .tl-dot { background: var(--orange); } .tl-item.tone-blue .tl-dot { background: #6f92b8; }
.tl-item.tone-lav .tl-dot { background: #8b86d6; } .tl-item.tone-sand .tl-dot { background: var(--mustard); } .tl-item.tone-grey .tl-dot { background: #9a9186; }
.tl-when { font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.tl-what a { text-decoration: none; } .tl-what a:hover { text-decoration: underline; }
.tl-kind { display: inline-block; font-size: .72rem; font-weight: 700; background: var(--cream); border-radius: 999px; padding: 1px 8px; margin-right: 8px; color: var(--ink-2); }
.tl-edit { font-size: .82rem; color: var(--orange-d); }
.tl-thumbs { display: flex; gap: 6px; margin-top: 6px; }
.tl-thumbs .thumb { width: 54px; border-radius: 10px; cursor: default; }
.tl-thumbs .thumb .play { width: 24px; height: 24px; font-size: .55rem; }
@media (max-width: 560px) { .tl-item { grid-template-columns: 1fr; } }
.decade h2 { font-size: 1.6rem; }
.tl-card .timeline, .decade .timeline { margin-top: 10px; }

/* ── Documents ──────────────────────────────────────────── */
.doc-list { list-style: none; padding: 0; margin: 10px 0 0; }
.doc { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.doc:first-child { border-top: 0; }
.doc-icon { width: 56px; height: 68px; border-radius: 10px; background: var(--sand); display: grid; place-items: center; font-weight: 800; font-size: .78rem; color: var(--orange-d); text-decoration: none; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.doc-icon img { width: 100%; height: 100%; object-fit: cover; }
.doc-main { display: grid; gap: 2px; min-width: 0; } .doc-main a { text-decoration: none; }

/* ── Coming up ──────────────────────────────────────────── */
.minis { display: flex; } .minis .mini + .mini { margin-left: -14px; }
.bday.anniversary { background: #fff2e8; } .bday.remember { background: #efebe6; }
.bday b { max-width: 220px; white-space: normal; line-height: 1.2; }

/* ── How are we related ─────────────────────────────────── */
.rel-card { background: var(--blue); color: var(--blue-d); }
.rel-card h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
.rel-card > p { margin: 6px 0 0; }
.rel-chain { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.rel-step { display: grid; justify-items: center; gap: 6px; width: 92px; text-decoration: none; font-size: .9rem; }
.rel-step .arch-frame { width: 100%; } .rel-step .arch-frame.end { background: var(--mustard); }
.rel-arrow { display: grid; justify-items: center; font-size: .78rem; font-weight: 700; padding-bottom: 28px; min-width: 70px; }
.rel-arrow span { background: var(--veil); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.rel-arrow::after { content: "→"; font-size: 1.1rem; }
.rel-sentence { margin-top: 14px !important; opacity: .85; }

/* ── Interview ──────────────────────────────────────────── */
.iv-progress { margin: 14px 4px 0; font-weight: 600; }
.iv-cat h2 { font-size: 1.35rem; }
.iv-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 12px; }
.iv-card { background: var(--veil); border-radius: 18px; }
.iv-card:has(.iv-form:not([hidden])) { grid-column: 1 / -1; background: var(--paper); }
.iv-q { width: 100%; text-align: left; border: 0; background: none; padding: 14px 16px; font-family: var(--head); font-variation-settings: "SOFT" 100; font-weight: 600; font-size: 1.05rem; color: var(--ink); cursor: pointer; line-height: 1.3; }
.iv-card.done .iv-q { opacity: .6; }
.iv-tick { display: block; font-family: var(--body); font-size: .75rem; color: #2e7d4f; margin-top: 4px; }
.iv-form { padding: 0 16px 16px; color: var(--ink); }
.iv-form textarea { min-height: 160px; background: var(--cream); }
.iv-form input { background: var(--cream); }

/* ── Journeys ───────────────────────────────────────────── */
#jmap { height: 460px; border-radius: 22px; z-index: 0; }
.legend { display: grid; gap: 8px; margin-top: 14px; }
.lg { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 600; }
.lg input { width: 18px; height: 18px; accent-color: var(--ink); }
.sw { width: 26px; height: 6px; border-radius: 3px; }
.arrow-ic span { display: block; font-size: 15px; line-height: 18px; text-align: center; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
input[type=range] { width: 100%; accent-color: var(--orange); }

/* ── Print views ────────────────────────────────────────── */
.print-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.print-choices .card { margin-top: 0; }
.print-choices input, .print-choices select { background: var(--veil) !important; }
body.printmode main { max-width: none; padding: 16px; }
body.printmode #whoami-bar { display: none !important; }
.print-bar { position: sticky; top: 64px; z-index: 5; display: flex; gap: 10px; align-items: center; justify-content: center; padding: 10px; margin-bottom: 16px; background: var(--cream); }
.sheet-page { background: #fff; margin: 0 auto 24px; box-shadow: 0 8px 30px rgba(43,38,32,.15); position: relative; overflow: hidden; box-sizing: border-box; }
.poster { padding: 8mm; display: grid; grid-template-rows: auto 1fr; justify-items: center; background: var(--cream); }
.poster-head { width: 100%; display: flex; justify-content: space-between; align-items: baseline; padding: 0 4mm 4mm; }
.poster-head h1 { font-size: 30pt; }
.poster-head span { font-size: 10pt; color: var(--ink-2); }
.poster-fit { position: relative; align-self: center; }
.poster .world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.poster .band-label, .poster .sticker, .poster .gridline { display: none; }
.poster .pin { cursor: default; }
.book-cover { background: var(--lilac); padding: 18mm; display: grid; grid-template-rows: 1fr auto auto auto; }
.cover-photos { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 5mm; margin-bottom: 12mm; }
.cp { border-radius: 50%; overflow: hidden; border: 4px solid #fff; box-shadow: 0 6px 18px rgba(43,38,32,.15); aspect-ratio: 1; }
.cp img { width: 100%; height: 100%; object-fit: cover; }
.cp1, .cp4 { border-radius: 50%; aspect-ratio: 1; align-self: center; }
.cp-shape { border-radius: 50%; aspect-ratio: 1; } .cp-shape.s1 { background: var(--orange); } .cp-shape.s2 { background: var(--mustard); border-radius: 999px 999px 0 0; aspect-ratio: 5/6; } .cp-shape.s3 { background: var(--sage); border-radius: 0 999px 999px 0; }
.cover-photos .cp ~ .cp-shape:nth-of-type(n) { }
.book-cover h1 { font-size: 44pt; line-height: 1; }
.cover-sub { font-size: 16pt; color: var(--lilac-d); margin: 4mm 0 0; }
.cover-foot { font-size: 10pt; color: var(--lilac-d); margin: 10mm 0 0; }
.book-page { padding: 14mm 14mm 10mm; font-size: 10.5pt; line-height: 1.5; }
.bp-head { display: grid; grid-template-columns: 42mm 1fr; gap: 8mm; align-items: end; border-radius: 8mm; padding: 7mm; }
.bp-head h2 { font-size: 28pt; line-height: 1; margin-bottom: 2mm; }
.bp-head p { margin: 1mm 0 0; }
.bp-nick { font-style: italic; }
.bp-photo .avatar.ph { font-size: 30pt; }
.bp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8mm; margin-top: 7mm; }
.bp-cols p { margin: 0 0 2.5mm; } .bp-cols b { display: block; font-size: 8.5pt; color: var(--mute); font-weight: 700; }
.bp-notes { white-space: pre-wrap; color: var(--ink-2); }
.bp-tl { margin-top: 0; } .bp-tl .tl-item { grid-template-columns: 14mm 1fr; padding: 1.5mm 0 1.5mm 7mm; font-size: 9.5pt; }
.bp-tl .tl-dot { width: 3.4mm; height: 3.4mm; top: 2.6mm; border-width: 2px; } .bp-tl::before { left: 1.4mm; }
.bp-tl .tl-kind { display: none; } .bp-tl a { color: inherit; }
.bp-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; margin-top: 6mm; }
.bp-photos figure { margin: 0; } .bp-photos img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 4mm; }
.bp-photos figcaption { font-size: 8pt; color: var(--ink-2); margin-top: 1mm; }
.bp-story { margin-top: 6mm; break-inside: avoid; }
.bp-story h3 { font-size: 14pt; }
.bp-story p { margin: 1.5mm 0 0; white-space: pre-wrap; }
.bp-by { font-size: 8.5pt; color: var(--mute); }
.bp-docs { margin-top: 6mm; font-size: 9pt; color: var(--ink-2); }
@media print {
  html, body { background: #fff !important; }
  .top, #whoami-bar, .no-print, #toast { display: none !important; }
  main { padding: 0 !important; max-width: none !important; }
  .sheet-page { box-shadow: none; margin: 0; break-after: page; }
  .sheet-page:last-child { break-after: auto; }
  .book-page { min-height: 0 !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.cover-photos { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: auto; align-items: center; }
.cover-photos > * { min-width: 0; width: 100%; }
.cp-shape.s1 { width: 80%; justify-self: center; }
.note-box { background: var(--cream); border-radius: 18px; padding: 14px 16px; }
.note-box input { background: var(--paper) !important; }
.note-box .grid2 { margin-top: 8px; gap: 8px 12px; }
.wifi-note { background: #fff3dc; border-radius: 16px; padding: 12px 16px; margin: 4px 0 10px; font-size: .9rem; line-height: 1.45; color: #5a4310; }
.wifi-note b { display: block; margin-bottom: 2px; }

/* ── Opening screen ─────────────────────────────────────────────────── */
#splash { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: var(--cream); overflow: hidden; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; }
#splash svg { width: 112px; height: 112px; display: block; filter: drop-shadow(0 10px 24px rgba(232, 116, 63, .25)); }
.splash-name { font-family: var(--head); font-variation-settings: "SOFT" 100, "WONK" 0; font-weight: 600; font-size: clamp(32px, 8vw, 46px); letter-spacing: -.02em; color: var(--ink); }
#splash.out { opacity: 0; pointer-events: none; transition: opacity .4s ease .45s; }
#splash.out .splash-name { opacity: 0; transition: opacity .2s ease; }
@media (prefers-reduced-motion: no-preference) {
  .splash-inner { animation: splash-arrive .6s cubic-bezier(.2, .8, .2, 1) both; }
  #splash.out svg { transform: scale(16); transition: transform .85s cubic-bezier(.7, 0, .3, 1); }
  @keyframes splash-arrive { from { opacity: 0; transform: scale(.9) translateY(8px); } to { opacity: 1; transform: none; } }
}

/* The swirly ampersand in the name: the font's large-size "&", kept at every size. */
.amp { font-variation-settings: "SOFT" 100, "opsz" 72; }

/* ── Sign in: name, "is this you?", password ───────────────────────── */
.signin .si-form { display: grid; gap: 10px; max-width: 360px; margin: 18px auto 0; text-align: left; }
.signin .si-form input { width: 100%; max-width: none; box-sizing: border-box; font-size: 1.05rem; }
.signin .si-label { font-weight: 600; font-size: .95rem; }
.signin .si-q { font-family: var(--head); font-variation-settings: "SOFT" 100, "WONK" 0; font-weight: 600; font-size: 1.5rem; letter-spacing: -.01em; color: var(--ink); margin: 14px 0 6px; }
.signin .si-pick { display: grid; gap: 10px; max-width: 360px; margin: 16px auto 0; }
.signin .si-person { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 14px 18px; border-radius: var(--r-md); }
.signin .si-new { background: transparent; border: 2px dashed var(--line); }
.signin .si-foot { margin-top: 18px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.signin .si-which { flex-direction: row; align-items: center; gap: 14px; }
.signin .si-which > span { display: flex; flex-direction: column; gap: 2px; }
.signin .si-which .avatar { flex: none; width: 56px !important; height: 56px !important; min-width: 0; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; object-fit: cover; padding: 0; margin: 0; aspect-ratio: auto; }

/* ── Dark mode ──────────────────────────────────────────────────────────
   Light unless someone picks Dark (or "Match this device") on the More page,
   stored as data-theme on <html>. Colour cards turn into deep
   tones with light writing; posters and books always stay light for printing. */
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
  --cream: #191612; --sand: #2b2620; --paper: #221e1a; --ink: #f3ebdd; --ink-2: #cfc5b4; --mute: #9b9181; --line: #3b342c;
  --lav: #36325f; --lav-d: #d6d2f8; --sage: #2e3e27; --sage-d: #d5e8b4; --orange: #e8743f; --orange-d: #ffb48f;
  --blue: #263a51; --blue-d: #cadbec; --lilac: #3d3047; --lilac-d: #e5d4ec; --danger: #ff8a73; --danger-bg: #4a221a;
  --veil: rgba(255,255,255,.09); --veil-strong: rgba(255,255,255,.16); --primary-hover: #ffffff; --knob: #4a4238; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --cream: #191612; --sand: #2b2620; --paper: #221e1a; --ink: #f3ebdd; --ink-2: #cfc5b4; --mute: #9b9181; --line: #3b342c;
  --lav: #36325f; --lav-d: #d6d2f8; --sage: #2e3e27; --sage-d: #d5e8b4; --orange: #e8743f; --orange-d: #ffb48f;
  --blue: #263a51; --blue-d: #cadbec; --lilac: #3d3047; --lilac-d: #e5d4ec; --danger: #ff8a73; --danger-bg: #4a221a;
  --veil: rgba(255,255,255,.09); --veil-strong: rgba(255,255,255,.16); --primary-hover: #ffffff; --knob: #4a4238; color-scheme: dark;
}

/* Things that used fixed light colours */
html.is-dark .tint-0 { background: linear-gradient(160deg, #4a4680, #2e2b55); }
html.is-dark .tint-1 { background: linear-gradient(160deg, #46593a, #2a3923); }
html.is-dark .tint-2 { background: linear-gradient(160deg, #7a3c1f, #4d2614); }
html.is-dark .tint-3 { background: linear-gradient(160deg, #3c5470, #233449); }
html.is-dark .story .body { color: var(--blue-d); }
html.is-dark .drop.over, html.is-dark .drop:hover { background: #2e281f; }
html.is-dark .grey { background: #2c2925; }
html.is-dark .bday.anniversary { background: #3a2a20; }
html.is-dark .bday.remember { background: #2c2925; }
html.is-dark .iv-tick { color: #84cfa0; }
html.is-dark .wifi-note { background: #3a2f17; color: #f1d9a0; }
html.is-dark .avatar.ph { color: rgba(243,235,221,.8); }
html.is-dark .arch-frame, html.is-dark .who > .avatar, html.is-dark .who > span.avatar { box-shadow: 0 6px 18px rgba(0,0,0,.35); }
html.is-dark #pmap, html.is-dark #jmap { filter: brightness(.82) contrast(1.05); }
html.is-dark .sheet-page .tint-0 { background: linear-gradient(160deg, #e9e6fb, #bdb8ee); }
html.is-dark .sheet-page .tint-1 { background: linear-gradient(160deg, #eef6dc, #cfe2aa); }
html.is-dark .sheet-page .tint-2 { background: linear-gradient(160deg, #ffe1cc, #f4a77f); }
html.is-dark .sheet-page .tint-3 { background: linear-gradient(160deg, #e4edf6, #a9bfd8); }
html.is-dark .sheet-page .avatar.ph { color: rgba(43,38,32,.7); }

/* Posters, books and printing: always the light colours */
.sheet-page { --cream: #fbf3e6; --sand: #f1e4cd; --paper: #ffffff; --ink: #2b2620; --ink-2: #5d564c; --mute: #8a8174; --line: #e6d8bf;
  --lav: #bdb8ee; --lav-d: #4d4a8a; --sage: #cfe2aa; --sage-d: #33502f; --orange: #e8743f; --orange-d: #7a2e0e;
  --blue: #a9bfd8; --blue-d: #2e4b6a; --lilac: #c9b0d2; --lilac-d: #4d3a55; --danger: #b5321b; --danger-bg: #fde4dc;
  --veil: rgba(255,255,255,.72); --veil-strong: #ffffff; --primary-hover: #3d362d; --knob: #d9c8a8; color-scheme: light; color: var(--ink); }
@media print {
  :root, :root[data-theme] { --cream: #fbf3e6; --sand: #f1e4cd; --paper: #ffffff; --ink: #2b2620; --ink-2: #5d564c; --mute: #8a8174; --line: #e6d8bf;
  --lav: #bdb8ee; --lav-d: #4d4a8a; --sage: #cfe2aa; --sage-d: #33502f; --orange: #e8743f; --orange-d: #7a2e0e;
  --blue: #a9bfd8; --blue-d: #2e4b6a; --lilac: #c9b0d2; --lilac-d: #4d3a55; --danger: #b5321b; --danger-bg: #fde4dc;
  --veil: rgba(255,255,255,.72); --veil-strong: #ffffff; --primary-hover: #3d362d; --knob: #d9c8a8; color-scheme: light; }
}

/* Appearance switch on the More page */
.theme-seg { margin: 6px 0 0; }
.theme-seg button { border: 0; padding: 8px 16px; border-radius: 999px; background: var(--sand); color: var(--ink); font-weight: 600; font-size: .92rem; cursor: pointer; }
.theme-seg button.on { background: var(--ink); color: var(--cream); }

/* ── Install help ───────────────────────────────────────────────────── */
.ih-back { position: fixed; inset: 0; z-index: 40; background: rgba(28,24,20,.45); display: grid; place-items: end center; padding: 16px; }
@media (min-width: 640px) { .ih-back { place-items: center; } }
.ih-sheet { width: 100%; max-width: 440px; background: var(--paper); color: var(--ink); border-radius: var(--r-lg); padding: 24px 24px 20px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.ih-sheet h2 { margin-bottom: 14px; }
.ih-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.ih-steps li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; line-height: 1.45; }
.ih-steps li::before { content: counter(s); width: 32px; height: 32px; border-radius: 50%; background: var(--orange); color: #fff; font-weight: 700; display: grid; place-items: center; }
.ih-ic { width: 20px; height: 20px; vertical-align: -4px; color: #2f7bf6; }
.ih-dots { font-size: 1.15em; padding: 0 2px; }
@media (prefers-reduced-motion: no-preference) { .ih-sheet { animation: rise-sheet .22s ease-out; } @keyframes rise-sheet { from { opacity: 0; transform: translateY(14px); } } }

/* ── A colour per person ──────────────────────────────────────────────── */
:root {
  --c-lilac: #c9b0d2; --c-lilac-d: #4d3a55;
  --c-lav: #bdb8ee; --c-lav-d: #4d4a8a;
  --c-rose: #f2bfcf; --c-rose-d: #6b2a40;
  --c-orange: #f0a27a; --c-orange-d: #6e2a0c;
  --c-mustard: #e9c46a; --c-mustard-d: #5a4310;
  --c-sage: #cfe2aa; --c-sage-d: #33502f;
  --c-teal: #a6d6cc; --c-teal-d: #1f4d45;
  --c-blue: #a9bfd8; --c-blue-d: #2e4b6a;
}
html.is-dark {
  --c-lilac: #3d3047; --c-lilac-d: #e5d4ec;
  --c-lav: #36325f; --c-lav-d: #d6d2f8;
  --c-rose: #4d2533; --c-rose-d: #f6cfdb;
  --c-orange: #6a3218; --c-orange-d: #ffd0b5;
  --c-mustard: #4a3a16; --c-mustard-d: #f1d9a0;
  --c-sage: #2e3e27; --c-sage-d: #d5e8b4;
  --c-teal: #1f3d38; --c-teal-d: #bfe6de;
  --c-blue: #263a51; --c-blue-d: #cadbec;
}
.hero.pc-lilac { background: var(--c-lilac); } .hero.pc-lilac .meta, .hero.pc-lilac .aka, .hero.pc-lilac .changed { color: var(--c-lilac-d); }
.arch-frame:not(.you):has(> .avatar.pc-lilac), .mini:has(> .avatar.pc-lilac), .sw.pc-lilac { background: var(--c-lilac); } .who:not(.you) > .avatar.pc-lilac { border-color: var(--c-lilac); }
.hero.pc-lav { background: var(--c-lav); } .hero.pc-lav .meta, .hero.pc-lav .aka, .hero.pc-lav .changed { color: var(--c-lav-d); }
.arch-frame:not(.you):has(> .avatar.pc-lav), .mini:has(> .avatar.pc-lav), .sw.pc-lav { background: var(--c-lav); } .who:not(.you) > .avatar.pc-lav { border-color: var(--c-lav); }
.hero.pc-rose { background: var(--c-rose); } .hero.pc-rose .meta, .hero.pc-rose .aka, .hero.pc-rose .changed { color: var(--c-rose-d); }
.arch-frame:not(.you):has(> .avatar.pc-rose), .mini:has(> .avatar.pc-rose), .sw.pc-rose { background: var(--c-rose); } .who:not(.you) > .avatar.pc-rose { border-color: var(--c-rose); }
.hero.pc-orange { background: var(--c-orange); } .hero.pc-orange .meta, .hero.pc-orange .aka, .hero.pc-orange .changed { color: var(--c-orange-d); }
.arch-frame:not(.you):has(> .avatar.pc-orange), .mini:has(> .avatar.pc-orange), .sw.pc-orange { background: var(--c-orange); } .who:not(.you) > .avatar.pc-orange { border-color: var(--c-orange); }
.hero.pc-mustard { background: var(--c-mustard); } .hero.pc-mustard .meta, .hero.pc-mustard .aka, .hero.pc-mustard .changed { color: var(--c-mustard-d); }
.arch-frame:not(.you):has(> .avatar.pc-mustard), .mini:has(> .avatar.pc-mustard), .sw.pc-mustard { background: var(--c-mustard); } .who:not(.you) > .avatar.pc-mustard { border-color: var(--c-mustard); }
.hero.pc-sage { background: var(--c-sage); } .hero.pc-sage .meta, .hero.pc-sage .aka, .hero.pc-sage .changed { color: var(--c-sage-d); }
.arch-frame:not(.you):has(> .avatar.pc-sage), .mini:has(> .avatar.pc-sage), .sw.pc-sage { background: var(--c-sage); } .who:not(.you) > .avatar.pc-sage { border-color: var(--c-sage); }
.hero.pc-teal { background: var(--c-teal); } .hero.pc-teal .meta, .hero.pc-teal .aka, .hero.pc-teal .changed { color: var(--c-teal-d); }
.arch-frame:not(.you):has(> .avatar.pc-teal), .mini:has(> .avatar.pc-teal), .sw.pc-teal { background: var(--c-teal); } .who:not(.you) > .avatar.pc-teal { border-color: var(--c-teal); }
.hero.pc-blue { background: var(--c-blue); } .hero.pc-blue .meta, .hero.pc-blue .aka, .hero.pc-blue .changed { color: var(--c-blue-d); }
.arch-frame:not(.you):has(> .avatar.pc-blue), .mini:has(> .avatar.pc-blue), .sw.pc-blue { background: var(--c-blue); } .who:not(.you) > .avatar.pc-blue { border-color: var(--c-blue); }
.hero.passed[class*="pc-"] .shapes { filter: grayscale(.6); }
.swatches { border: 0; padding: 0; margin: 0 0 18px; }
.swatches legend { padding: 0; margin-bottom: 6px; }
.sw-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.sw { position: relative; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-none { width: auto; padding: 0 14px; border-radius: 999px; background: var(--cream); font-size: .85rem; font-weight: 600; }
.sw:has(input:checked) { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--ink); }
.sw:has(input:focus-visible) { outline: 3px solid var(--mustard); outline-offset: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html.is-dark .sheet-page { --c-lilac: #c9b0d2; --c-lilac-d: #4d3a55; --c-lav: #bdb8ee; --c-lav-d: #4d4a8a; --c-rose: #f2bfcf; --c-rose-d: #6b2a40; --c-orange: #f0a27a; --c-orange-d: #6e2a0c; --c-mustard: #e9c46a; --c-mustard-d: #5a4310; --c-sage: #cfe2aa; --c-sage-d: #33502f; --c-teal: #a6d6cc; --c-teal-d: #1f4d45; --c-blue: #a9bfd8; --c-blue-d: #2e4b6a; }

/* ── Stickers ──────────────────────────────────────────────────────── */
.badge { position: absolute; z-index: 2; left: -8px; top: -6px; transform: rotate(-9deg); padding: 5px 11px; border-radius: 999px; font: 700 .72rem/1.1 var(--body); letter-spacing: .01em; white-space: nowrap; box-shadow: 0 0 0 3px var(--cream), 0 4px 10px rgba(43,38,32,.18); pointer-events: none; }
.b-birthday { background: var(--orange); color: #fff; }
.b-eldest { background: var(--mustard); color: #3b2c08; }
.b-newest { background: #2e7d4f; color: #fff; }
.b-photos { background: #4d4a8a; color: #fff; }
.hero-row { position: relative; }
.who > .badge { left: 0; top: -4px; }
.pin > .badge { left: -18px; top: -10px; font-size: .8rem; }
@media (prefers-reduced-motion: no-preference) { .badge { animation: badge-in .35s cubic-bezier(.2,1.4,.4,1) both .15s; } @keyframes badge-in { from { opacity: 0; transform: rotate(-9deg) scale(.6); } } }

/* ── The tree grows in ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .map.grow .glow path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: rb-draw .7s ease-out forwards; animation-delay: var(--d, 0s); }
  .map.grow .couples g { opacity: 0; animation: rb-fade .4s ease-out forwards; animation-delay: var(--d, 0s); }
  .map.grow .pin { animation: rb-pop .5s cubic-bezier(.2, 1.35, .4, 1) both; animation-delay: var(--d, 0s); }
  @keyframes rb-draw { to { stroke-dashoffset: 0; } }
  @keyframes rb-fade { to { opacity: 1; } }
  @keyframes rb-pop { from { opacity: 0; transform: translateY(14px) scale(.82); } }
}


/* ── Map pins with faces ───────────────────────────────────────────── */
.face-pin-wrap { background: none; border: 0; }
.face-pin { position: relative; width: 70px; height: 58px; }
.fp-arch { position: absolute; left: 0; top: 0; width: 44px; padding: 3px; background: var(--paper); border-radius: 50%; box-shadow: 0 6px 14px rgba(43,38,32,.3); overflow: hidden; }
.fp-arch .avatar { aspect-ratio: 1; height: auto; border-radius: 50%; font-size: .85rem; }
.fp-2 { left: 20px; top: 8px; z-index: -1; transform: rotate(8deg); }
.fp-n { position: absolute; right: 0; top: -6px; z-index: 2; background: var(--orange); color: #fff; font: 700 .72rem/1 var(--body); padding: 4px 7px; border-radius: 999px; box-shadow: 0 0 0 2px var(--paper); }
.face-pin:hover .fp-arch:not(.fp-2) { box-shadow: 0 0 0 3px var(--mustard), 0 6px 14px rgba(43,38,32,.3); }
.fp-arch:has(> .avatar.pc-lilac) { background: var(--c-lilac); }
.fp-arch:has(> .avatar.pc-lav) { background: var(--c-lav); }
.fp-arch:has(> .avatar.pc-rose) { background: var(--c-rose); }
.fp-arch:has(> .avatar.pc-orange) { background: var(--c-orange); }
.fp-arch:has(> .avatar.pc-mustard) { background: var(--c-mustard); }
.fp-arch:has(> .avatar.pc-sage) { background: var(--c-sage); }
.fp-arch:has(> .avatar.pc-teal) { background: var(--c-teal); }
.fp-arch:has(> .avatar.pc-blue) { background: var(--c-blue); }

/* ── Paper grain: a very faint texture over everything, like printed paper ── */
body::after { content: ""; position: fixed; inset: 0; z-index: 25; pointer-events: none; opacity: .07; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .32  0 0 0 0 .26  0 0 0 0 .2  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
html.is-dark body::after { opacity: .05; mix-blend-mode: screen; }
@media print { body::after { display: none; } }

/* ── Birthday takeover ─────────────────────────────────────────────── */
.bd-take { position: fixed; inset: 0; z-index: 60; background: var(--cream); display: grid; place-items: center; padding: 24px; overflow: hidden; text-align: center; }
.bd-inner { position: relative; z-index: 1; display: grid; justify-items: center; gap: 6px; max-width: 520px; }
.bd-inner .arch-frame { width: min(46vw, 210px); margin-bottom: 14px; }
.bd-hello { font: 600 1.1rem var(--body); color: var(--ink-2); margin: 0; }
.bd-name { font-family: var(--head); font-variation-settings: "SOFT" 100, "WONK" 0; font-weight: 600; font-size: clamp(3.2rem, 14vw, 6rem); line-height: .95; letter-spacing: -.03em; margin: 0; }
.bd-turns { margin: 8px 0 0; font-size: 1.1rem; color: var(--ink-2); }
.bd-inner .actions { justify-content: center; margin-top: 22px; }
.bd-confetti i { position: absolute; display: block; opacity: .95; }
.bd-confetti .c1 { width: 70px; height: 70px; border-radius: 50%; background: var(--orange); }
.bd-confetti .c2 { width: 56px; height: 68px; border-radius: 999px 999px 0 0; background: var(--mustard); }
.bd-confetti .c3 { width: 60px; height: 60px; border-radius: 0 999px 999px 0; background: var(--sage); }
.bd-confetti .c4 { width: 50px; height: 50px; border-radius: 0 0 999px 999px; background: var(--lav); }
@media (prefers-reduced-motion: no-preference) {
  .bd-confetti i { animation: bd-fall 1.4s cubic-bezier(.2,.8,.3,1) both; }
  .bd-inner { animation: rb-pop .7s cubic-bezier(.2,1.3,.4,1) both .15s; }
  @keyframes bd-fall { from { transform: translateY(-60vh) rotate(-90deg); opacity: 0; } }
  @keyframes rb-pop { from { opacity: 0; transform: translateY(14px) scale(.82); } }
  .bd-take.out { animation: bd-out .35s ease forwards; }
  @keyframes bd-out { to { opacity: 0; transform: scale(1.04); } }
}
/* Album portraits all the same size, however many lines sit under the name */
.who { align-content: start; }
.who > .avatar { width: 100%; align-self: start; }
/* On their own page the whole card is their colour, so the photo keeps a white frame */
.hero.pc-lilac .arch-frame.big:not(.you), .hero.pc-lav .arch-frame.big:not(.you), .hero.pc-rose .arch-frame.big:not(.you), .hero.pc-orange .arch-frame.big:not(.you),
.hero.pc-mustard .arch-frame.big:not(.you), .hero.pc-sage .arch-frame.big:not(.you), .hero.pc-teal .arch-frame.big:not(.you), .hero.pc-blue .arch-frame.big:not(.you) { background: var(--paper); }
/* Stickers that never get cut off or cover each other */
.hero .meta .badge { position: static; display: inline-block; font-size: .85rem; padding: 6px 13px; box-shadow: none; }
.pin > .badge { left: 50%; top: calc(var(--pin-photo, 118px) - 22px); translate: -50% 0; }

/* ══ Polish ═══════════════════════════════════════════════════════════ */

/* Header: only the page you're on is filled in */
.ni { display: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
nav a { background: transparent; color: var(--ink-2); }
nav a:hover { background: var(--sand); color: var(--ink); }
nav a.on, nav a.on:hover { background: var(--ink); color: var(--cream); }

/* Phones: the pages sit in a bar at the bottom, like an app */
@media (max-width: 640px) {
  .top { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--cream); padding-top: 12px; padding-bottom: 8px; }
  .brand span { display: inline; font-size: 1.12rem; }
  .brand svg { width: 28px; height: 28px; }
  nav#nav { position: fixed; z-index: 15; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); margin: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; padding: 6px; overflow: visible;
    background: color-mix(in srgb, var(--paper) 94%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-radius: 26px; box-shadow: 0 12px 30px rgba(43,38,32,.16), 0 0 0 1px var(--line); }
  nav#nav a { display: grid; justify-items: center; gap: 2px; padding: 7px 0 6px; font-size: .68rem; font-weight: 600; border-radius: 19px; }
  nav#nav a .ni { display: block; }
  main { padding-bottom: 120px; }
  #toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
  body.mapmode .minimap { bottom: calc(92px + env(safe-area-inset-bottom)); }
  body.mapmode .map { height: calc(100dvh - 56px); }
  #whoami-bar { flex-wrap: nowrap; gap: 10px; font-size: .8rem; }
  #whoami-bar .wb { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #whoami-bar .wb-pre { display: none; }
  #whoami-bar .wb-dot::after { content: " ·"; } #whoami-bar .wb-dot { font-size: 0; } #whoami-bar .wb-dot::after { font-size: .8rem; }
  #whoami-bar .mode { flex: none; padding: 4px 12px 4px 4px; font-size: .8rem; }
}


/* Family tiles: less empty space on phones */
@media (max-width: 860px) { .tile { min-height: 0; gap: 14px; } .tile h2 { margin-top: 4px; } }

/* Tree: softer generation colours so the people stand out; labels at the bottom of each band */
.band.lav { fill: color-mix(in srgb, var(--lav) 62%, var(--cream)); }
.band.sage { fill: color-mix(in srgb, var(--sage) 62%, var(--cream)); }
.band.orange { fill: color-mix(in srgb, var(--orange) 34%, var(--cream)); }
.band.blue { fill: color-mix(in srgb, var(--blue) 62%, var(--cream)); }
.band-label.orange { fill: var(--orange-d); }
.band-label { font-size: 22px; opacity: .85; }
.glow path, .couples line { stroke-opacity: .55; stroke-width: 3.5; }

/* Coming up: clean white cards, the timing as a small label */
.bday, .bday.soon { background: var(--paper); box-shadow: none; }
.bday em { display: inline-block; margin-top: 3px; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange-d); }
.bday.soon em { background: var(--orange); color: #fff; }

/* Timeline: the kind sits above the words on phones */
@media (max-width: 560px) { .tl-what .tl-kind { display: table; margin: 2px 0 4px; } }
.seg { flex-wrap: wrap; } .seg a { white-space: nowrap; }

/* Sharing: tidy invite form and buttons */
.row-form input[type=checkbox] { flex: none; }
.row-form .check { flex: 1 1 100%; order: 1; }
.row-form .btn { order: 2; }
.inv-actions { flex-wrap: wrap; } .inv-actions .btn { white-space: nowrap; }

/* ── Reactions ─────────────────────────────────────────────────────── */
.react { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.rx { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px; border: 0; border-radius: 999px; background: var(--veil); color: inherit; font: 600 .86rem var(--body); cursor: pointer; transition: transform .12s, background .15s; }
.rx:hover { background: var(--veil-strong); }
.rx:active { transform: scale(.94); }
.rx-ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.rx-heart.on { background: #e2462b; color: #fff; }
.rx-heart.on .rx-ic { fill: currentColor; }
.rx.on:not(.rx-heart) { background: var(--ink); color: var(--cream); }
.rx-n { padding-left: 6px; margin-left: 2px; border-left: 1px solid currentColor; opacity: .8; }
.rx-who { font-size: .8rem; opacity: .8; }
@media (prefers-reduced-motion: no-preference) { .rx-heart.on .rx-ic { animation: rx-pop .35s cubic-bezier(.2, 1.6, .4, 1); } @keyframes rx-pop { 50% { transform: scale(1.35); } } }
.v-info .rx { background: rgba(255,255,255,.14); color: #fff; } .v-info .rx:hover { background: rgba(255,255,255,.24); }
.v-info .rx.on:not(.rx-heart) { background: #fff; color: #1c1814; }
.v-info .rx-who { color: #e2d9cb; }
.thumb-rx { position: absolute; right: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px 3px 6px; border-radius: 999px; background: rgba(28,24,20,.6); color: #fff; font: 700 .72rem var(--body); }
.thumb-rx .rx-ic { width: 13px; height: 13px; fill: currentColor; stroke: none; }

/* ── Possibly the same person ──────────────────────────────────────── */
.dupes { margin: 0 0 18px; }
.dupes h2 { margin-bottom: 4px; }
.dup { padding: 14px 0 4px; border-top: 1px solid var(--line); margin-top: 12px; }
.dup-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; }
.dup-p { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 18px; background: var(--cream); text-decoration: none; min-width: 0; }
.dup-p .avatar { width: 54px; height: 54px; flex: none; border-radius: 50%; font-size: 1rem; }
.dup-p > span { display: grid; gap: 2px; min-width: 0; }
.dup-p b { font-family: var(--head); font-variation-settings: "SOFT" 100; font-weight: 600; font-size: 1.05rem; }
.dup-or { font: 700 1.2rem var(--body); color: var(--mute); }
.dup-why { margin: 8px 0 0; color: var(--ink-2); }
.dup .actions { margin-top: 10px; }
@media (max-width: 600px) { .dup-pair { grid-template-columns: 1fr; } .dup-or { justify-self: center; } }

/* ── Changes, grouped by day ───────────────────────────────────────── */
.hist-day { padding-top: 18px; }
.h-day { font-size: 1.15rem; margin-bottom: 4px; color: var(--ink-2); }
.hist li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.h-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 .85rem var(--body); }
.h-av.anon { background: var(--sand); color: var(--mute); }
.h-line { margin: 0; line-height: 1.45; }
.h-line b { font-weight: 700; margin-right: 4px; }
.h-line a { text-decoration: none; } .h-line a:hover { text-decoration: underline; text-underline-offset: 3px; }
.h-when { display: block; margin-top: 2px; font-size: .8rem; color: var(--mute); }

/* ── Friendly empty pages ──────────────────────────────────────────── */
.empty-state { text-align: center; padding: 34px 24px 30px; }
.empty-state h2 { margin: 14px 0 6px; }
.empty-state p { margin: 0 auto; max-width: 42ch; color: var(--ink-2); }
.empty-state .actions { justify-content: center; }
.es-art { position: relative; display: block; width: 92px; height: 64px; margin: 0 auto; }
.es-art i { position: absolute; border-radius: 50%; }
.es-art i:nth-child(1) { width: 52px; height: 52px; left: 0; top: 6px; background: var(--orange); }
.es-art i:nth-child(2) { width: 40px; height: 40px; left: 38px; top: 0; background: var(--mustard); opacity: .9; }
.es-art i:nth-child(3) { width: 30px; height: 30px; left: 58px; top: 32px; background: var(--sage); }

/* ── Long forms on phones: Save stays in reach ─────────────────────── */
@media (max-width: 640px) {
  form.sheet > .actions { position: sticky; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 3; margin: 18px -18px -18px; padding: 12px 18px; background: color-mix(in srgb, var(--paper) 94%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid var(--line); border-radius: 0 0 var(--r-lg) var(--r-lg); }
}
@media (max-width: 640px) {
  form.sheet > .actions { flex-wrap: nowrap; align-items: center; }
  form.sheet > .actions #del { background: none; padding: 8px 2px; min-height: 0; font-size: .9rem; white-space: nowrap; }
}
.del-short { display: none; }
@media (max-width: 640px) { .del-long { display: none; } .del-short { display: inline; } form.sheet > .actions .btn { white-space: nowrap; } }

/* ── Since you were last here / On this day ────────────────────────── */
#home-cards:empty { display: none; }
.news-card { position: relative; }
.news-card h2, .otd-card h2 { font-size: 1.35rem; margin-bottom: 6px; }
.news-x { position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--sand); color: var(--ink-2); cursor: pointer; font-size: .9rem; }
.news-sum { margin: 0 0 12px; font-weight: 600; }
.news-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.news-row .pl-person { background: var(--cream); }
.light-outline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.otd { list-style: none; margin: 4px 0 0; padding: 0; }
.otd li { display: grid; grid-template-columns: 92px auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.otd li:first-child { border-top: 0; }
.otd-year { display: grid; line-height: 1.15; } .otd-year b { font-family: var(--head); font-variation-settings: "SOFT" 100; font-size: 1.3rem; } .otd-year span { font-size: .75rem; color: var(--mute); }
.otd-thumb { display: block; width: 52px; height: 52px; border-radius: 14px; overflow: hidden; } .otd-thumb img, .otd-thumb video { width: 100%; height: 100%; object-fit: cover; }
.otd .minis .mini { width: 44px; }

/* ── Help fill the gaps ────────────────────────────────────────────── */
.gaps-card { margin: 0 0 18px; }
.gap-pct { font-weight: 700; color: var(--ink-2); font-size: .9rem; }
.gap-bar { height: 10px; border-radius: 999px; background: var(--sand); overflow: hidden; margin: 10px 0 6px; }
.gap-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--mustard), var(--orange)); }
.gaps { list-style: none; padding: 0; margin: 8px 0 12px; }
.gaps li { display: grid; grid-template-columns: minmax(0, 170px) minmax(0, 1fr); gap: 8px 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
@media (max-width: 560px) { .gaps li { grid-template-columns: 1fr; } }
.gap-who { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; min-width: 0; }
.gap-who .mini { width: 38px; flex: none; }
.gap-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gap-chip { padding: 5px 11px; border-radius: 999px; background: var(--cream); text-decoration: none; font-size: .82rem; font-weight: 600; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.gap-chip:hover { background: var(--sand); color: var(--ink); }

/* ── How it's doing ────────────────────────────────────────────────── */
.hl-list { list-style: none; padding: 0; margin: 10px 0 0; }
.hl { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.hl:first-child { border-top: 0; }
.hl > span:last-child { display: grid; gap: 2px; }
.hl-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; background: #4caf73; box-shadow: 0 0 0 4px color-mix(in srgb, #4caf73 18%, transparent); }
.hl.warn .hl-dot { background: var(--mustard); box-shadow: 0 0 0 4px color-mix(in srgb, var(--mustard) 22%, transparent); }
.hl.bad .hl-dot { background: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 18%, transparent); }
.hl-steps { padding-left: 20px; line-height: 1.6; }
.hl-steps code { display: block; margin: 6px 0; padding: 8px 10px; border-radius: 10px; background: var(--cream); font-size: .74rem; word-break: break-all; }
