/* ============================================================
   Pod Timeline — iOS-flavored design system
   ============================================================ */

/* ── tokens ── */
:root {
  color-scheme: light dark;

  --bg: #F2F2F7;
  --card: #FFFFFF;
  --elev: #FFFFFF;
  --ink: #0b0b0f;
  --ink2: rgba(60, 60, 67, 0.62);
  --ink3: rgba(60, 60, 67, 0.34);
  --sep: rgba(60, 60, 67, 0.12);
  --tint: #0A84FF;
  --tint-ink: #007AFF;
  --bar: rgba(249, 249, 251, 0.78);
  --chipbg: rgba(120, 120, 128, 0.12);
  --press: rgba(120, 120, 128, 0.16);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --shadow-lift: 0 2px 8px rgba(0,0,0,.08), 0 16px 40px rgba(0,0,0,.14);

  /* event-type palette — CVD-validated order:
     core, meeting, move, romance, friendship, relationship, work */
  --c-core: #5856D6;
  --c-meeting: #FF9500;
  --c-move: #30B0C7;
  --c-romance: #FF2D55;
  --c-friendship: #34C759;
  --c-relationship: #AF52DE;
  --c-work: #0A84FF;
  --c-moment: #8E8E93;

  --rail: rgba(120, 120, 128, 0.18);
  --radius: 22px;
  --spring: cubic-bezier(.32, .72, 0, 1);
  --pop: cubic-bezier(.34, 1.4, .44, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1C1C1E;
    --elev: #2C2C2E;
    --ink: #FFFFFF;
    --ink2: rgba(235, 235, 245, 0.62);
    --ink3: rgba(235, 235, 245, 0.32);
    --sep: rgba(84, 84, 88, 0.5);
    --tint: #0A84FF;
    --tint-ink: #409CFF;
    --bar: rgba(18, 18, 20, 0.72);
    --chipbg: rgba(120, 120, 128, 0.22);
    --press: rgba(120, 120, 128, 0.3);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
    --shadow-lift: 0 2px 8px rgba(0,0,0,.4), 0 16px 48px rgba(0,0,0,.55);

    /* dark steps, validated on #1C1C1E */
    --c-core: #7b77fc;
    --c-meeting: #ca7f13;
    --c-move: #0ea4ba;
    --c-romance: #d20944;
    --c-friendship: #0db042;
    --c-relationship: #9d35ce;
    --c-work: #3794f6;
    --c-moment: #98989d;

    --rail: rgba(120, 120, 128, 0.32);
  }
}

/* ── base ── */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
  min-height: 100dvh;
  overflow-x: clip; /* full-bleed sections may equal 100vw incl. scrollbar */
}
body.locked { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }

.ic { width: 1.25em; height: 1.25em; flex: none; display: inline-block; vertical-align: -0.28em; }
.xs-ic { width: 0.9em; height: 0.9em; opacity: .7; }
.chev { color: var(--ink3); }

/* ── layout ── */
#main {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 56px) 20px calc(env(safe-area-inset-bottom, 0px) + 128px);
}

/* compact top bar */
#cbar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  height: calc(env(safe-area-inset-top, 0px) + 48px);
  padding-top: env(safe-area-inset-top, 0px);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 17px; letter-spacing: -0.2px;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 0.5px solid transparent;
  opacity: 0; transform: translateY(-6px);
  transition: opacity .25s var(--spring), transform .25s var(--spring), border-color .25s;
  pointer-events: none;
}
#cbar.on { opacity: 1; transform: none; border-bottom-color: var(--sep); }

/* large header */
.lhead { padding: 30px 2px 14px; }
.lrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.logo {
  width: 44px; height: 44px; border-radius: 11px;
  background: #fff; box-shadow: var(--shadow);
  user-select: none; -webkit-user-select: none;
}
.lrow h1 {
  font-size: 34px; font-weight: 800; letter-spacing: -0.6px; line-height: 1.12;
}
.tagline {
  color: var(--ink); font-size: 17px; font-weight: 550; letter-spacing: -0.25px;
  line-height: 1.4; margin: 10px 0 4px; max-width: 34ch; text-wrap: balance;
}
.sub { color: var(--ink2); font-size: 15px; margin: 3px 0 20px; letter-spacing: -0.1px; }

/* header cascade on view entry */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.view.anim .lhead > * { animation: rise .6s var(--spring) backwards; }
.view.anim .lhead > *:nth-child(1) { animation-delay: .03s; }
.view.anim .lhead > *:nth-child(2) { animation-delay: .08s; }
.view.anim .lhead > *:nth-child(3) { animation-delay: .13s; }
.view.anim .lhead > *:nth-child(4) { animation-delay: .18s; }
.view.anim .lhead > *:nth-child(5) { animation-delay: .23s; }
.view.anim .lhead > *:nth-child(6) { animation-delay: .28s; }
.view.anim .lhead > *:nth-child(7) { animation-delay: .33s; }
.view.anim .lhead > *:nth-child(8) { animation-delay: .38s; }
.hbtns { display: flex; gap: 10px; }
.hbtn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--card); box-shadow: var(--shadow);
  display: grid; place-items: center; color: var(--tint-ink);
  transition: transform .18s var(--pop), background .18s;
  position: relative;
}
.hbtn .ic { width: 19px; height: 19px; }
.hbtn:active { transform: scale(.9); background: var(--press); }
.hbtn.badged::after {
  content: attr(data-badge);
  position: absolute; top: -3px; right: -3px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--c-romance); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 17px; text-align: center;
}

/* search */
.searchwrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--chipbg); border-radius: 12px;
  padding: 10px 13px; margin-bottom: 16px; color: var(--ink2);
}
.searchwrap .ic { width: 17px; height: 17px; }
.searchwrap input {
  flex: 1; border: 0; background: none; outline: none;
  font-size: 16px; color: var(--ink); letter-spacing: -0.1px;
}
.searchwrap input::placeholder { color: var(--ink3); }
.clearq { display: grid; place-items: center; color: var(--ink3); }

/* mode segmented control (header) */
.seg-mini {
  display: flex; align-items: center; gap: 2px;
  background: var(--chipbg); border-radius: 999px; padding: 3px;
}
.seg-ic {
  width: 34px; height: 32px; border-radius: 999px;
  display: grid; place-items: center; color: var(--ink2);
  transition: background .18s, color .18s, transform .15s var(--pop);
}
.seg-ic .ic { width: 17px; height: 17px; }
.seg-ic:active { transform: scale(.9); }
.seg-ic.on { background: var(--card); color: var(--tint-ink); box-shadow: var(--shadow); }

/* one-line filter pickers */
.pickerrow { display: flex; gap: 8px; padding: 2px 0 12px; }
.picker {
  flex: 1; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 10px; border-radius: 12px;
  background: var(--card); box-shadow: var(--shadow);
  font-size: 14px; font-weight: 600; letter-spacing: -0.15px;
  transition: transform .16s var(--pop), background .2s, color .2s;
}
.picker:active { transform: scale(.96); }
.picker .ic { width: 15px; height: 15px; color: var(--ink2); }
.picker span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker .pchev { width: 13px; height: 13px; color: var(--ink3); flex: none; }
.picker.on { background: var(--tint); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--tint) 38%, transparent); }
.picker.on .ic, .picker.on .pchev { color: rgba(255, 255, 255, .8); }

/* picker option list (native-style grouped rows) */
.optlist { background: var(--card); border-radius: 14px; overflow: hidden; margin-top: 6px; }
.opt {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 12px 14px; text-align: left;
  font-size: 15.5px; letter-spacing: -0.2px;
}
.opt + .opt { border-top: 0.5px solid var(--sep); }
.opt:active { background: var(--press); }
.opt-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt b { font-weight: 550; color: var(--ink3); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.opt .ic:not(.optcheck) { width: 17px; height: 17px; color: var(--ink2); }
.opt-tdot { display: grid; place-items: center; color: var(--tc); }
.opt-tdot .ic { color: var(--tc) !important; }
.opt.sel .opt-main { font-weight: 650; }
.optcheck { width: 18px; height: 18px; color: var(--tint-ink); flex: none; stroke-width: 2.4; }
.opt-count { color: var(--ink2); font-size: 13px; text-align: center; margin-top: 14px; }

/* compare tray (overlap mode) */
.cmp-tray {
  display: flex; align-items: center; gap: 8px; overflow-x: auto;
  padding: 2px 2px 12px; scrollbar-width: none; -ms-overflow-style: none;
}
.cmp-tray::-webkit-scrollbar { display: none; }
.cmp-label {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase;
  color: var(--ink2);
}
.cmp-label .ic { width: 14px; height: 14px; }
.cchip { padding-left: 4px; }
.cchip.on { background: var(--pc); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--pc) 40%, transparent); }
.cmp-hint { color: var(--ink2); font-size: 13px; margin: -4px 2px 12px; }

/* ── chips ── */
.chiprow {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.chiprow::-webkit-scrollbar { display: none; }
.chipwrap { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 6px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px;
  background: var(--chipbg); font-size: 14px; font-weight: 590;
  letter-spacing: -0.1px; white-space: nowrap; flex: none;
  transition: transform .16s var(--pop), background .2s, color .2s, box-shadow .2s;
  user-select: none; -webkit-user-select: none;
}
.chip:active { transform: scale(.94); }
.chip .ic { width: 15px; height: 15px; }
.chip b { font-weight: 600; opacity: .55; font-size: 12.5px; }

.tchip.on, .chip.all.on { background: var(--tc, var(--tint)); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--tc, var(--tint)) 40%, transparent); }
.tchip.on b { opacity: .85; }
.tchip:not(.on) .ic { color: var(--tc); }
.chip.all.on { background: var(--ink); color: var(--bg); box-shadow: none; }

.pchip .avatar.xs { margin-left: -6px; }
.pchip.on, .lchip.on, .ypill.on, .fchip.on {
  background: var(--tint); color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--tint) 40%, transparent);
}
.pchip.on b, .lchip.on b { opacity: .85; }
.ypill { font-variant-numeric: tabular-nums; }
.chip.clear { background: none; color: var(--tint-ink); font-weight: 600; }
.lchip:not(.on) .ic { color: var(--ink2); }
.active-filters { border-top: 0.5px solid var(--sep); padding-top: 10px; }

/* ── cards ── */
/* Ephemeral by default: cards live in an in/out cycle — they drift in when
   scrolled into view and dissolve again as they leave. */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(18px) scale(.98);
  transition: opacity .55s var(--spring), transform .55s var(--spring);
}
.card.in { opacity: 1; transform: none; }

/* ── timeline ── */
.ygroup { position: relative; scroll-margin-top: calc(env(safe-area-inset-top, 0px) + 56px); }
.yhead {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + 48px); z-index: 10;
  display: flex; align-items: baseline; gap: 10px;
  padding: 14px 2px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  animation: rise .55s var(--spring) backwards;
}
.yhead h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.4px; font-variant-numeric: tabular-nums; }
.yhead span { color: var(--ink2); font-size: 13.5px; font-weight: 500; }

.rail { position: relative; padding: 8px 0 36px 28px; display: flex; flex-direction: column; gap: 18px; }
.rail::before {
  content: ''; position: absolute; left: 8px; top: 0; bottom: 0;
  width: 2px; border-radius: 1px; background: var(--rail);
}
.ev {
  --evx: 18px; --evt: 18px; /* side/top padding, shared with the photo bleed */
  position: relative; padding: var(--evt) var(--evx) 16px; text-align: left; cursor: pointer;
}
.ev:active { transform: scale(.985); transition-duration: .1s; }

/* photos on moments — vertical list: full-bleed banner above the card body */
.ev-photo {
  display: block; position: relative;
  margin: calc(var(--evt) * -1) calc(var(--evx) * -1) 14px;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden; cursor: zoom-in;
  background: var(--chipbg);
}
.ev-photo img {
  display: block; width: 100%; height: auto;
  aspect-ratio: var(--ar, 4 / 3); max-height: 280px; object-fit: cover;
  transition: transform .5s var(--spring);
}
.ev-photo:focus-visible { outline: 2.5px solid var(--tint); outline-offset: -2.5px; }
.ev-photo:active img { transform: scale(1.03); }
.ev-photo.broken, .g-thumb.broken, .mini-thumb.broken { display: none; }
.raildot {
  position: absolute; left: -23px; top: 20px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--tc); border: 2.5px solid var(--bg);
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--tc) 55%, transparent);
}
.ev-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.tbadge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.1px;
  color: var(--tc); background: color-mix(in srgb, var(--tc) 13%, transparent);
  padding: 4px 9px; border-radius: 999px;
}
.tbadge .ic { width: 13px; height: 13px; }
.tbadge.big { font-size: 14px; padding: 6px 12px; }
.tbadge.big .ic { width: 16px; height: 16px; }
.ev-head time { color: var(--ink2); font-size: 13px; font-weight: 500; letter-spacing: -0.1px; white-space: nowrap; }
.ev-note { font-size: 15.5px; letter-spacing: -0.15px; line-height: 1.45; margin-bottom: 14px; }

/* first-meeting callouts */
:root { --spark: #C77D00; }
@media (prefers-color-scheme: dark) { :root { --spark: #FFD60A; } }
.firsts { display: flex; flex-wrap: wrap; gap: 6px; margin: -3px 0 12px; }
.fpair {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 650; letter-spacing: -0.1px;
  color: var(--spark);
  background: color-mix(in srgb, var(--spark) 12%, transparent);
  padding: 4px 10px; border-radius: 999px;
}
.fpair .ic { width: 12px; height: 12px; }
.fpair.more { color: var(--ink2); background: var(--chipbg); }
.kvrow.spark .ic { color: var(--spark); }
.bspark {
  width: 11px; height: 11px; color: var(--spark);
  margin: 0 3px -1px 0;
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tags .chip { padding: 5px 11px; font-size: 13px; background: var(--chipbg); }
.tags .chip.sm { padding: 4px 10px 4px 4px; font-size: 12.5px; color: var(--ink2); }
.tags .pchip { padding-left: 4px; }

.scope {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px; margin-left: auto;
}
.scope.pod { color: var(--tint-ink); background: color-mix(in srgb, var(--tint) 13%, transparent); }
.scope.self { color: var(--ink2); background: var(--chipbg); }

/* avatars */
.avatar {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: 0.2px;
  flex: none; user-select: none; -webkit-user-select: none;
}
.avatar.xs { width: 22px; height: 22px; font-size: 9px; }
.avatar.lg { width: 54px; height: 54px; font-size: 19px; }
.avatar.xl { width: 72px; height: 72px; font-size: 25px; }
.avatar.stack { margin-left: -8px; box-shadow: 0 0 0 2px var(--card); }
.avstack { display: flex; padding-left: 8px; }

/* hedcut avatars: no paper, just the stippling printed on whatever
   surface they sit on — multiply eats the white in light mode, and in
   dark the plate is inverted and screened so only white ink shows */
.avatar.hed { background: none; overflow: hidden; }
.avatar.hed img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%;
  display: block; mix-blend-mode: multiply;
  user-select: none; -webkit-user-select: none;
}
@media (prefers-color-scheme: dark) {
  .avatar.hed img { filter: invert(1); mix-blend-mode: screen; }
}
/* faces read better a touch bigger, snugged inside the pill rather
   than bleeding past its edge like the initials badges do */
.avatar.hed.xs { width: 28px; height: 28px; }
.pchip .avatar.xs.hed { margin-left: 0; }

/* ── horizontal timeline mode ── */
.tl-h .hrail {
  /* natural heights: photo cards run taller, like a scrapbook row */
  display: flex; align-items: flex-start; gap: 16px;
  overflow-x: auto; padding: 30px 4px 42px;
  scroll-snap-type: x mandatory; scroll-padding-left: 16px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.tl-h .hrail::-webkit-scrollbar { display: none; }
.hitem {
  flex: none; position: relative; padding-top: 34px;
  scroll-snap-align: start; display: flex;
}
.hitem::before {
  content: ''; position: absolute; top: 15px; left: -18px; right: -18px;
  height: 2px; border-radius: 1px; background: var(--rail);
}
.hitem:first-child::before { left: 50%; }
.hitem:last-child::before { right: 50%; }
.tl-h .ev { width: min(76vw, 340px); display: flex; flex-direction: column; }
.tl-h .ev .tags { margin-top: auto; padding-top: 4px; }

/* horizontal flow: the photo becomes a tilted instant snapshot pinned
   between the note and the tags (flex order re-slots the banner markup) */
.tl-h .ev .firsts, .tl-h .ev .tags { order: 2; }
.tl-h .ev .ev-photo {
  order: 1;
  margin: 2px auto 18px; width: min(86%, 264px);
  padding: 9px 9px 30px;
  background: #fdfdfb; border-radius: 5px;
  box-shadow: 0 1px 2px rgba(0,0,0,.14), 0 10px 24px rgba(0,0,0,.16);
  transform: rotate(-2.1deg);
  transition: transform .45s var(--spring);
}
.tl-h .hitem:nth-child(even) .ev-photo { transform: rotate(1.8deg); }
.tl-h .ev .ev-photo img {
  aspect-ratio: var(--ar, 4 / 3); max-height: 210px;
  border-radius: 2.5px;
}
.tl-h .ev .ev-photo:active { transform: rotate(0deg) scale(1.02); }
.tl-h .ev .ev-photo:active img { transform: none; }
.tl-h .raildot { left: 50%; margin-left: -6px; top: -24px; }
.tl-h .card { transform: translateX(34px) scale(.98); }
.tl-h .card.in { transform: none; }
.ymark {
  flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-width: 76px; padding-top: 32px; text-align: center;
  animation: rise .55s var(--spring) backwards;
}
.ymark::after {
  content: ''; position: absolute; top: 10px; left: 50%; margin-left: -6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--tint); border: 2.5px solid var(--bg);
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--tint) 55%, transparent);
}
.ymark h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.4px; font-variant-numeric: tabular-nums; }
.ymark span { color: var(--ink2); font-size: 12px; font-weight: 550; white-space: nowrap; }

/* empty state */
.empty { text-align: center; padding: 72px 24px; color: var(--ink2); animation: rise .5s var(--spring) backwards; }
.empty-ic {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 22px;
  background: var(--card); box-shadow: var(--shadow);
  display: grid; place-items: center; color: var(--ink3);
}
.empty-ic .ic { width: 28px; height: 28px; }
.empty h3 { color: var(--ink); font-size: 19px; letter-spacing: -0.3px; margin-bottom: 4px; }
.empty p { font-size: 14.5px; margin-bottom: 18px; }

/* ── people ── */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 14px; }
.pcard {
  padding: 26px 14px 20px; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
}
.pcard:active { transform: scale(.96); transition-duration: .1s; }
.pcard h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.25px; }
.pcard p { color: var(--ink2); font-size: 12.5px; margin-top: -4px; }
.typedots { display: flex; gap: 4px; }
.typedots i { width: 7px; height: 7px; border-radius: 50%; display: block; }

/* ── places ── */
.plist { display: flex; flex-direction: column; gap: 14px; }
.prow {
  display: flex; align-items: center; gap: 13px;
  padding: 16px 15px; text-align: left; cursor: pointer;
}
.prow:active { transform: scale(.985); transition-duration: .1s; }
.pinbadge {
  width: 42px; height: 42px; border-radius: 14px; flex: none;
  display: grid; place-items: center; color: #fff;
}
.pinbadge .ic { width: 20px; height: 20px; }
.prow-main { flex: 1; min-width: 0; }
.prow-main b { font-size: 15.5px; font-weight: 650; letter-spacing: -0.2px; display: block; }
.prow-main small { color: var(--ink2); font-size: 12.5px; display: block; margin: 1px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter { display: block; height: 4px; border-radius: 2px; background: var(--chipbg); overflow: hidden; max-width: 180px; }
.meter i { display: block; height: 100%; border-radius: 2px; background: var(--tint); }

/* ── insights ── */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 16px; }
.tile { padding: 22px 18px 18px; }
.tile b { font-size: 34px; font-weight: 800; letter-spacing: -0.8px; line-height: 1; display: block; }
.tile span { color: var(--ink2); font-size: 13px; font-weight: 550; }

.panel { padding: 22px 18px 18px; margin-bottom: 16px; }
.panel h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.25px; margin-bottom: 16px; }
.panel-note { color: var(--ink2); font-size: 12.5px; margin-top: 12px; }

.ybars { display: flex; align-items: stretch; gap: 8px; height: 150px; }
.ybar {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 6px; position: relative; cursor: pointer; min-width: 0;
}
.ybar b { font-size: 12px; font-weight: 650; color: var(--ink2); font-variant-numeric: tabular-nums; }
.ybar i {
  display: block; width: 100%; max-width: 44px;
  border-radius: 6px 6px 2px 2px;
  background: var(--tint);
  transition: transform .18s var(--pop), opacity .18s;
}
.ybar:hover i, .ybar:focus-visible i { opacity: .85; transform: scaleY(1.02); transform-origin: bottom; }
.ybar span { font-size: 12px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.ybar::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%) scale(.9);
  background: var(--elev); color: var(--ink);
  box-shadow: var(--shadow-lift); border-radius: 9px;
  font-size: 12px; font-weight: 600; padding: 5px 9px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s var(--pop);
  z-index: 5;
}
.ybar:hover::after, .ybar:focus-visible::after { opacity: 1; transform: translateX(-50%) scale(1); }

.hrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 7px 0; cursor: pointer; text-align: left; }
.hlabel {
  display: inline-flex; align-items: center; gap: 7px;
  width: 142px; flex: none; font-size: 13.5px; font-weight: 600; letter-spacing: -0.15px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hlabel .ic { width: 15px; height: 15px; color: var(--ink2); }
.hbar { flex: 1; height: 12px; border-radius: 6px; background: var(--chipbg); overflow: hidden; }
.hbar i { display: block; height: 100%; border-radius: 6px; background: var(--tint); min-width: 4px; }
.hrow b { width: 30px; text-align: right; font-size: 13.5px; font-weight: 650; color: var(--ink2); font-variant-numeric: tabular-nums; }

.duo { display: flex; gap: 2px; height: 44px; border-radius: 12px; overflow: hidden; }
.duo i { display: grid; place-items: center; font-style: normal; }
.duo i span { font-size: 13px; font-weight: 700; color: #fff; letter-spacing: -0.1px; }
.duo .pod { background: var(--tint); border-radius: 12px 2px 2px 12px; }
.duo .self { background: var(--c-moment); border-radius: 2px 12px 12px 2px; }

/* ── gantt view ── */
.gpanel { padding: 8px 0 12px; }
.g-scroll { overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.g-scroll::-webkit-scrollbar { display: none; }
.g-inner { min-width: 100%; }
.g-row { display: flex; align-items: center; height: 50px; }
.g-row + .g-row { border-top: 0.5px solid var(--sep); }
.g-axisrow { height: 32px; }
.g-axisrow + .g-row { border-top: 0; }
.g-name {
  position: sticky; left: 0; z-index: 5;
  width: 138px; flex: none; height: 100%;
  display: flex; align-items: center; gap: 6px;
  padding: 0 8px 0 12px; text-align: left;
  font-size: 12px; font-weight: 600; letter-spacing: -0.1px;
  background: linear-gradient(to right, var(--card) 80%, transparent);
}
.g-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-name:active { opacity: .6; }
.g-name.sel { color: var(--tint-ink); }
.gcheck { width: 14px; height: 14px; color: var(--tint-ink); flex: none; stroke-width: 2.4; }
.g-cmpname { font-weight: 700; }
.g-cmpname .avatar.stack:first-child { margin-left: 0; }

/* comparison: translucent person-hue bars sharing one track */
.g-bar.cmp {
  background: color-mix(in srgb, var(--pc) 26%, var(--card) 30%);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--pcs) 65%, transparent);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.g-bar.cmp b i { background: var(--pc); }
.g-bar.cmp:hover, .g-bar.cmp:focus-visible {
  background: color-mix(in srgb, var(--pc) 34%, var(--card) 40%);
  box-shadow: var(--shadow-lift), inset 0 0 0 1.5px var(--pcs);
}
.g-track {
  position: relative; height: 100%; flex: none;
  background-image: linear-gradient(to right, var(--sep) 1px, transparent 1px);
  background-size: var(--gpy) 100%;
  background-position: var(--gx) 0;
}
.g-axistrack { background-image: none; }
.g-year {
  position: absolute; top: 8px; transform: translateX(6px);
  font-size: 12px; font-weight: 700; color: var(--ink2);
  font-variant-numeric: tabular-nums;
}
.g-span {
  position: absolute; bottom: 4px; height: 4px;
  border-radius: 2px;
}
.g-bar {
  position: absolute; width: 172px; height: 36px;
  border-radius: 10px; padding: 3px 9px 4px 9px;
  background: color-mix(in srgb, var(--tc) 10%, var(--card));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 30%, transparent);
  text-align: left; overflow: hidden; z-index: 1;
  transition: transform .16s var(--pop), box-shadow .2s, z-index 0s;
}
.g-bar:hover, .g-bar:focus-visible {
  transform: scale(1.04); z-index: 6;
  box-shadow: var(--shadow-lift), inset 0 0 0 1px color-mix(in srgb, var(--tc) 45%, transparent);
}
.g-bar:active { transform: scale(.97); }
.g-bar b {
  display: block; position: relative; padding-left: 12px;
  font-size: 11.5px; font-weight: 650; letter-spacing: -0.1px; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.g-bar b i {
  position: absolute; left: 0; top: 50%; margin-top: -3.5px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--tc);
}
.g-bar small {
  display: block; padding-left: 12px; margin-top: 1px;
  font-size: 10.5px; color: var(--ink2); letter-spacing: -0.05px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* gantt: a moment with a photo carries a little photo chip on the bar */
.g-bar.has-photo { padding-right: 38px; }
.g-thumb {
  position: absolute; top: 4px; right: 4px;
  width: 28px; height: 28px; border-radius: 8px; overflow: hidden;
  box-shadow: 0 0 0 1.5px var(--card), 0 1px 4px rgba(0,0,0,.3);
  cursor: zoom-in;
  transition: transform .18s var(--pop);
}
.g-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-thumb:hover { transform: scale(1.35) rotate(-2deg); }
.g-thumb:active { transform: scale(1.1); }
.g-legend {
  display: flex; flex-wrap: wrap; gap: 10px 16px;
  padding: 14px 16px 4px; border-top: 0.5px solid var(--sep); margin-top: 2px;
}
.g-leg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink2); }
.g-leg i { width: 8px; height: 8px; border-radius: 50%; }
.g-note { color: var(--ink3); font-size: 12.5px; text-align: center; margin-top: 14px; }

/* ── tree view (braided lifelines) ── */
.tpanel { padding: 4px 0 10px; }
.t-scroll { overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.t-scroll::-webkit-scrollbar { display: none; }
.t-canvas { position: relative; }
.t-canvas svg { position: absolute; inset: 0; pointer-events: none; }
.t-canvas svg path {
  fill: none; stroke-width: 3; stroke-linecap: round;
  stroke: hsl(var(--ph) 62% 46% / 0.78);
  stroke-dasharray: 1; stroke-dashoffset: 1;
}
/* strands draw themselves in when the panel scrolls into view */
.tpanel.in svg path { animation: t-draw 1.1s ease forwards; animation-delay: calc(var(--pi, 0) * 90ms); }
@keyframes t-draw { to { stroke-dashoffset: 0; } }
.t-knot {
  fill: var(--tc); stroke: var(--card); stroke-width: 2.5;
  opacity: 0;
}
.tpanel.in .t-knot { animation: t-pop .5s var(--pop) forwards; animation-delay: calc(.25s + var(--ni, 0) * 40ms); }
@keyframes t-pop { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-color-scheme: dark) {
  .t-canvas svg path { stroke: hsl(var(--ph) 68% 60% / 0.8); }
}

.t-yearrow {
  position: absolute; left: 0; right: 0; transform: translateY(-50%);
  display: flex; align-items: center; gap: 14px; padding: 0 18px;
  pointer-events: none;
}
.t-yearrow b { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; color: var(--ink2); }
.t-yearrow i { flex: 1; height: 0; border-top: 1.5px dashed var(--sep); }

.t-entry {
  position: absolute; transform: translate(-50%, -50%); z-index: 3;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px 4px 4px; border-radius: 999px;
  background: var(--card); box-shadow: var(--shadow);
  font-size: 12.5px; font-weight: 650; letter-spacing: -0.1px; white-space: nowrap;
  transition: transform .16s var(--pop), box-shadow .2s;
}
.t-entry:active { transform: translate(-50%, -50%) scale(.94); }
.tpanel .t-entry { opacity: 0; }
.tpanel.in .t-entry { animation: t-entryin .5s var(--spring) forwards; animation-delay: .15s; }
@keyframes t-entryin {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

.t-node {
  position: absolute; transform: translateY(-50%); z-index: 2;
  max-width: 224px; padding: 6px 11px 7px; border-radius: 12px; text-align: left;
  background: color-mix(in srgb, var(--tc) 9%, var(--card));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 28%, transparent), 0 1px 4px rgba(0,0,0,.06);
  transition: transform .16s var(--pop), box-shadow .2s, z-index 0s;
}
.tpanel .t-node { opacity: 0; }
.tpanel.in .t-node { animation: t-nodein .5s var(--spring) forwards; animation-delay: calc(.3s + var(--i, 0) * 35ms); }
@keyframes t-nodein { from { opacity: 0; transform: translateY(calc(-50% + 10px)); } to { opacity: 1; transform: translateY(-50%); } }
.t-node:hover, .t-node:focus-visible {
  transform: translateY(-50%) scale(1.04); z-index: 6;
  box-shadow: var(--shadow-lift), inset 0 0 0 1px color-mix(in srgb, var(--tc) 45%, transparent);
}
.t-node:active { transform: translateY(-50%) scale(.97); }
.t-node b {
  display: block; font-size: 12px; font-weight: 650; letter-spacing: -0.1px; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.t-node small {
  display: block; margin-top: 1px; font-size: 10.5px; color: var(--ink2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.t-node.has-photo { padding-right: 42px; }
.t-thumb {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 9px; overflow: hidden;
  box-shadow: 0 0 0 1.5px var(--card), 0 1px 4px rgba(0,0,0,.3);
  cursor: zoom-in;
  transition: transform .18s var(--pop);
}
.t-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t-thumb:hover { transform: translateY(-50%) scale(1.32) rotate(-2deg); }
.t-thumb:active { transform: translateY(-50%) scale(1.08); }
.t-thumb.broken { display: none; }

/* ── tab bar ── */
#tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  display: flex; justify-content: space-around; align-items: flex-start;
  padding: 7px 8px calc(env(safe-area-inset-bottom, 0px) + 7px);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  border-top: 0.5px solid var(--sep);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--ink2); font-size: 10.5px; font-weight: 600; letter-spacing: -0.05px;
  width: 66px; padding: 3px 0; border-radius: 12px;
  transition: color .18s, transform .15s var(--pop);
}
.tab .ic { width: 25px; height: 25px; }
.tab:active { transform: scale(.92); }
.tab.on { color: var(--tint-ink); }
@keyframes tabpop { 0% { transform: scale(1); } 45% { transform: scale(1.22); } 100% { transform: scale(1); } }
.tab.on .ic { animation: tabpop .45s var(--pop); }

/* ── sheets ── */
#sheet-root { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
#sheet-root .backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.42);
  opacity: 0; transition: opacity .3s;
}
#sheet-root .sheet {
  position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 104%);
  width: min(100%, 640px); max-height: 88dvh;
  background: var(--bg); border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-lift);
  transition: transform .42s var(--spring);
  display: flex; flex-direction: column;
}
#sheet-root.open { pointer-events: auto; }
#sheet-root.open .backdrop { opacity: 1; }
#sheet-root.open .sheet { transform: translate(-50%, 0); }
.grabber {
  padding: 9px 0 5px; cursor: grab; touch-action: none; flex: none;
}
.grabber::before {
  content: ''; display: block; width: 38px; height: 5px; border-radius: 3px;
  background: var(--ink3); margin: 0 auto;
}
.sheet-body {
  overflow-y: auto; padding: 6px 20px calc(env(safe-area-inset-bottom, 0px) + 30px);
  /* notched phones in landscape: keep content out of the rounded corners */
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  overscroll-behavior: contain;
}

/* ── desktop filter popovers ─────────────────────────────────
   ≥900px, the pickers and More-filters open as a panel hanging off
   the control itself: translucent, blurred, springing out of the
   trigger (transform-origin is set per-open from the anchor). */
#sheet-root.pop .backdrop { background: transparent; }
#sheet-root .sheet.popmenu {
  left: 0; top: 0; bottom: auto;
  align-items: stretch;
  border-radius: 20px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  backdrop-filter: blur(32px) saturate(180%);
  box-shadow: 0 0 0 0.5px var(--sep), var(--shadow-lift);
  transform-origin: var(--ox, 40px) -10px;
  transform: scale(.82) translateY(-10px);
  opacity: 0;
  transition: transform .34s var(--pop), opacity .18s ease;
}
#sheet-root.open .sheet.popmenu { transform: none; opacity: 1; }
#sheet-root:not(.open) .sheet.popmenu { transition: transform .22s ease, opacity .16s ease; }
.sheet.popmenu .sheet-body { padding: 12px 16px 16px; }
.sheet.popmenu .fsheet-head h2 { font-size: 18px; }
.sheet.popmenu .optlist { background: none; border-radius: 0; }
.sheet.popmenu .opt { padding: 10px 9px; border-radius: 11px; }
@media (hover: hover) {
  .sheet.popmenu .opt:hover { background: var(--press); }
  .sheet.popmenu .opt:hover + .opt, .sheet.popmenu .opt:hover { border-top-color: transparent; }
}
.sheet.popmenu .opt-count { margin: 12px 0 2px; }
.sheet.popmenu .chipwrap { padding-bottom: 2px; }
.sheet.popmenu .sheet-actions { margin-top: 16px; }

/* the control a popover is hanging from stays ringed while it's open */
.pop-src { outline: 3px solid color-mix(in srgb, var(--tint) 26%, transparent); outline-offset: 1.5px; }
/* sheet content cascades in behind the sheet's slide */
#sheet-root.open .sheet-body > div > * { animation: rise .5s var(--spring) backwards; }
#sheet-root.open .sheet-body > div > *:nth-child(1) { animation-delay: .06s; }
#sheet-root.open .sheet-body > div > *:nth-child(2) { animation-delay: .1s; }
#sheet-root.open .sheet-body > div > *:nth-child(3) { animation-delay: .14s; }
#sheet-root.open .sheet-body > div > *:nth-child(4) { animation-delay: .18s; }
#sheet-root.open .sheet-body > div > *:nth-child(5) { animation-delay: .22s; }
#sheet-root.open .sheet-body > div > *:nth-child(6) { animation-delay: .26s; }
#sheet-root.open .sheet-body > div > *:nth-child(7) { animation-delay: .3s; }
#sheet-root.open .sheet-body > div > *:nth-child(n+8) { animation-delay: .34s; }
.sheet-body h4 {
  font-size: 13px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--ink2); margin: 18px 0 8px;
}

/* event sheet */
/* hedcut art: the moment's faces printed into the sheet's top corner.
   multiply lets the white paper melt into the sheet; dark mode inverts
   the plate and screens it, like a white-ink engraving */
.esheet { position: relative; }
.esheet > *:not(.hedart) { position: relative; z-index: 1; }
/* no z-index here — it would isolate the blend group and the white
   paper would stop multiplying away against the sheet behind it */
.hedart {
  position: absolute; top: -10px; right: -8px;
  display: flex; flex-direction: row-reverse; align-items: flex-start;
  pointer-events: none;
}
.hedart img {
  height: 200px; aspect-ratio: 1122 / 1402; object-fit: cover;
  mix-blend-mode: multiply; opacity: 1;
  -webkit-mask-image: radial-gradient(115% 115% at 72% 20%, #000 52%, transparent 86%);
  mask-image: radial-gradient(115% 115% at 72% 20%, #000 52%, transparent 86%);
  animation: hedfade .8s ease backwards;
}
.hedart img + img { height: 168px; margin-right: -34px; margin-top: 30px; opacity: .85; animation-delay: .12s; }
.hedart img + img + img { height: 140px; margin-top: 52px; opacity: .7; animation-delay: .2s; }
@keyframes hedfade { from { opacity: 0; } }
/* the sheet cascade animates transforms, which would isolate the blend
   mid-entrance — the art fades in on its own instead */
#sheet-root.open .sheet-body .hedart { animation: none; }
/* long notes stay clear of the printed corner */
.esheet:has(.hedart) .esheet-note { padding-right: 132px; }
@media (prefers-color-scheme: dark) {
  .hedart img { filter: invert(1); mix-blend-mode: screen; }
  .hedart img + img { opacity: .8; }
  .hedart img + img + img { opacity: .65; }
}
@media (max-width: 480px) {
  .hedart img { height: 158px; }
  .hedart img + img { height: 132px; }
  .hedart img + img + img { display: none; }
  .esheet:has(.hedart) .esheet-note { padding-right: 100px; }
}
.esheet-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.esheet-note { font-size: 19px; font-weight: 600; letter-spacing: -0.3px; line-height: 1.35; margin: 14px 0 16px; }
.ev-photo.esheet-photo {
  margin: 0 0 16px; border-radius: 16px;
  box-shadow: var(--shadow);
}
.ev-photo.esheet-photo img { max-height: 340px; transition: none; }
.esheet-photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 6px;
  padding: 26px 14px 10px;
  color: rgba(255,255,255,.94); font-size: 12.5px; font-weight: 600; letter-spacing: -0.1px;
  background: linear-gradient(to top, rgba(0,0,0,.52), transparent);
}
.esheet-photo figcaption .ic { width: 14px; height: 14px; }
.kv { display: flex; flex-direction: column; gap: 2px; background: var(--card); border-radius: 14px; overflow: hidden; }
.kvrow {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  font-size: 15px; letter-spacing: -0.15px;
}
.kvrow + .kvrow { border-top: 0.5px solid var(--sep); }
.kvrow .ic { width: 17px; height: 17px; color: var(--tint-ink); }
.rowref { color: var(--ink3); font-size: 12px; text-align: center; margin-top: 18px; }

/* person sheet */
.psheet-top { text-align: center; padding-top: 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.psheet-top h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.4px; }
.psheet-top .sub { margin: 0 0 8px; }
.mini-list { display: flex; flex-direction: column; background: var(--card); border-radius: 16px; overflow: hidden; }
.mini { display: flex; align-items: center; gap: 11px; padding: 11px 13px; text-align: left; cursor: pointer; }
.mini + .mini { border-top: 0.5px solid var(--sep); }
.mini:active { background: var(--press); }
.mini-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tc); flex: none; }
.mini-main { flex: 1; min-width: 0; }
.mini-main b { font-size: 13.5px; font-weight: 550; letter-spacing: -0.1px; display: block; line-height: 1.35; }
.mini-main small { color: var(--ink2); font-size: 12px; }
.mini-thumb {
  width: 38px; height: 38px; border-radius: 10px; overflow: hidden; flex: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.18); cursor: zoom-in;
  transition: transform .18s var(--pop);
}
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-thumb:active { transform: scale(1.12); }

/* filter sheet */
.fsheet-head { display: flex; align-items: center; justify-content: space-between; padding-top: 6px; }
.fsheet-head h2, .ssheet h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.35px; }
.seg {
  display: flex; background: var(--chipbg); border-radius: 10px; padding: 2px; gap: 2px;
}
.seg-btn {
  flex: 1; padding: 7px 0; border-radius: 8px; font-size: 14px; font-weight: 600;
  color: var(--ink2); transition: background .18s, color .18s, box-shadow .18s;
}
.seg-btn.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

/* settings sheet */
.ssheet h2 { padding-top: 6px; }
.srccard {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; margin-top: 12px;
  opacity: 1; transform: none;
}
.srccard .srcic {
  width: 40px; height: 40px; border-radius: 13px; flex: none;
  background: linear-gradient(135deg, #34C759, #248A3D);
  display: grid; place-items: center; color: #fff;
}
.srccard div { flex: 1; min-width: 0; }
.srccard b { display: block; font-size: 15px; letter-spacing: -0.2px; }
.srccard small { color: var(--ink2); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hint { color: var(--ink2); font-size: 13.5px; line-height: 1.5; margin-bottom: 10px; }
.urlrow input {
  width: 100%; border: 0; outline: none; background: var(--card);
  border-radius: 12px; padding: 12px 14px; font-size: 15px;
  box-shadow: inset 0 0 0 0.5px var(--sep);
}
.urlrow input:focus { box-shadow: inset 0 0 0 1.5px var(--tint); }
.errline { color: var(--c-romance); font-size: 13px; font-weight: 550; margin-top: 8px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 18px; border-radius: 13px;
  background: var(--card); box-shadow: var(--shadow);
  font-size: 15px; font-weight: 600; letter-spacing: -0.2px;
  transition: transform .16s var(--pop), opacity .2s;
}
.btn:active { transform: scale(.96); }
.btn.tint { background: var(--tint); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--tint) 38%, transparent); }
.btn.ghost { background: none; box-shadow: none; color: var(--tint-ink); padding: 8px 10px; }
.btn.wide { width: 100%; }
.btn.busy { opacity: .55; pointer-events: none; }
.btn .ic { width: 16px; height: 16px; }
.sheet-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 20px; }

/* toast */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); z-index: 70; display: flex; justify-content: center; pointer-events: none; }
.toast {
  background: var(--elev); color: var(--ink);
  border-radius: 999px; padding: 10px 18px;
  font-size: 14px; font-weight: 600; letter-spacing: -0.15px;
  box-shadow: var(--shadow-lift);
  opacity: 0; transform: translateY(12px) scale(.94);
  transition: opacity .3s var(--spring), transform .3s var(--spring);
  max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: none; }

/* ── full-screen search ── */
#search-root { position: fixed; inset: 0; z-index: 55; pointer-events: none; }
.s-panel {
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  backdrop-filter: blur(26px) saturate(160%);
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
  opacity: 0; transform: translateY(22px) scale(.99);
  transition: opacity .38s var(--spring), transform .38s var(--spring);
}
#search-root.open { pointer-events: auto; }
#search-root.open .s-panel { opacity: 1; transform: none; }

/* the app recedes behind the search layer, iOS-modal style */
body.searching #main {
  transform: scale(.97) translateY(-8px);
  opacity: .45;
}
#main { transition: transform .4s var(--spring), opacity .4s var(--spring); }
body.searching { overflow: hidden; }
body.searching #tabbar { transform: translateY(110%); }
#tabbar { transition: transform .35s var(--spring); }

.s-head { display: flex; align-items: center; gap: 4px; padding: 14px 16px 8px; }
.s-input { flex: 1; margin: 0; }
.s-input input { min-width: 0; }
.s-cancel {
  color: var(--tint-ink); font-weight: 600; font-size: 16px; letter-spacing: -0.2px;
  padding: 8px 4px 8px 12px; flex: none;
  transition: opacity .15s;
}
.s-cancel:active { opacity: .5; }
.s-body {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 6px 16px calc(env(safe-area-inset-bottom, 0px) + 28px);
}
.s-sec { margin-top: 18px; animation: rise .5s var(--spring) backwards; animation-delay: calc(var(--s, 0) * 60ms); }
.s-sec h4 {
  font-size: 13px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--ink2); margin-bottom: 9px;
}
.s-sechead { display: flex; align-items: baseline; justify-content: space-between; }
.s-mini { color: var(--tint-ink); font-size: 13.5px; font-weight: 600; }
.s-randwrap { margin-top: 26px; }

.s-row {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 12px 13px; margin-bottom: 8px; text-align: left;
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  animation: rise .42s var(--spring) backwards;
  animation-delay: calc(min(var(--i, 0), 14) * 22ms);
  transition: transform .15s var(--pop);
}
.s-row:active { transform: scale(.98); }
.s-row .mini-dot { background: var(--tc); }
.s-main { flex: 1; min-width: 0; }
.s-main b { font-size: 14px; font-weight: 570; letter-spacing: -0.15px; line-height: 1.35; display: block; }
.s-main small { color: var(--ink2); font-size: 12px; display: block; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-empty { animation: rise .4s var(--spring) backwards; }

mark {
  background: color-mix(in srgb, var(--tint) 26%, transparent);
  color: inherit; border-radius: 3px; padding: 0 1px;
}

/* faux search field in the header */
.searchwrap.faux { width: 100%; cursor: text; }
.searchwrap.faux .ph { flex: 1; text-align: left; color: var(--ink3); font-size: 16px; letter-spacing: -0.1px; }
.searchwrap.faux .qtext { flex: 1; text-align: left; color: var(--ink); font-size: 16px; letter-spacing: -0.1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.searchwrap.faux .clearq { display: grid; place-items: center; }

/* ── presentation mode ── */
#present-root { position: fixed; inset: 0; z-index: 75; pointer-events: none; }
#present-root.open { pointer-events: auto; }
.p-stage {
  position: absolute; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  opacity: 0; transform: scale(1.02);
  transition: opacity .5s var(--spring), transform .5s var(--spring);
}
#present-root.open .p-stage { opacity: 1; transform: none; }
body.presenting { overflow: hidden; }

.p-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 8;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 22px 10px;
  display: flex; flex-direction: column; gap: 10px;
  transition: opacity .4s;
}
.p-progress { height: 3px; border-radius: 2px; background: var(--chipbg); overflow: hidden; }
.p-progress i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--tint); transition: width .5s var(--spring); }
.p-controls { display: flex; align-items: center; gap: 10px; }
.p-countlabel { margin-right: auto; color: var(--ink2); font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: 0.2px; }
.p-btn { width: 40px; height: 40px; }

.p-zone { position: absolute; top: 14%; bottom: 0; width: 26%; z-index: 4; cursor: pointer; }
.p-zone.left { left: 0; } .p-zone.right { right: 0; }

.p-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 6;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--card); box-shadow: var(--shadow-lift);
  display: grid; place-items: center; color: var(--ink2);
  transition: opacity .35s, transform .15s var(--pop);
}
.p-nav .ic { width: 22px; height: 22px; }
.p-nav.prev { left: 28px; } .p-nav.next { right: 28px; }
.p-nav:active { transform: translateY(-50%) scale(.88); }
.p-nav.off { opacity: .18; pointer-events: none; }

.p-stage.idle { cursor: none; }
.p-stage.idle :is(.p-top, .p-nav) { opacity: 0; pointer-events: none; }

#p-slide-wrap { position: relative; z-index: 2; width: 100%; display: flex; justify-content: center; }
.p-slide { max-width: min(1180px, 88vw); padding: 0 28px; position: relative; }

@keyframes pin-fwd  { from { opacity: 0; transform: translateX(72px) scale(.985); } }
@keyframes pin-back { from { opacity: 0; transform: translateX(-72px) scale(.985); } }
@keyframes pin-year { from { opacity: 0; transform: scale(.78); } }
.p-slide.fwd  { animation: pin-fwd  .55s var(--spring); }
.p-slide.back { animation: pin-back .55s var(--spring); }
.p-slide.year.fwd, .p-slide.year.back { animation: pin-year .6s var(--spring); }

.p-slide.year { text-align: center; }
.p-slide.year h2 {
  font-size: clamp(96px, 24vw, 300px);
  font-weight: 800; letter-spacing: -0.045em; line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, var(--ink) 30%, color-mix(in srgb, var(--ink) 30%, transparent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.p-slide.year p { color: var(--ink2); font-size: clamp(17px, 2vw, 28px); font-weight: 600; margin-top: clamp(10px, 2vh, 22px); }

/* persistent glow layer: registered properties let the gradient's color
   and anchor points interpolate smoothly between slides instead of
   snapping with the slide's entrance transform */
@property --glow { syntax: '<color>'; inherits: false; initial-value: transparent; }
@property --g1x { syntax: '<percentage>'; inherits: false; initial-value: 72%; }
@property --g1y { syntax: '<percentage>'; inherits: false; initial-value: 12%; }
@property --g2x { syntax: '<percentage>'; inherits: false; initial-value: 8%; }
.p-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  --glow: transparent;
  transition: --glow .9s ease, --g1x 1.2s ease, --g1y 1.2s ease, --g2x 1.2s ease;
  background:
    radial-gradient(55% 48% at var(--g1x) var(--g1y), var(--glow), transparent 70%),
    radial-gradient(40% 40% at var(--g2x) 90%, color-mix(in srgb, var(--glow) 55%, transparent), transparent 70%);
}

/* photo-less slides: a giant ghosted hedcut watches from the right.
   No z-index and no transform on this container — either would isolate
   the blend group and the white paper would stop multiplying away;
   flex centering + z-index on the text siblings keep it behind. */
.p-hed {
  position: absolute; right: -2%; top: 0; bottom: 0;
  display: flex; align-items: center;
  pointer-events: none;
  animation: p-hedin 1.4s ease .2s backwards;
}
.p-slide.ev > :not(.p-hed) { position: relative; z-index: 1; }
@keyframes p-hedin { from { opacity: 0; } }
.p-hed img {
  height: min(66vh, 600px); aspect-ratio: 1122 / 1402; object-fit: cover;
  mix-blend-mode: multiply; opacity: .15;
  -webkit-mask-image: radial-gradient(115% 115% at 60% 32%, #000 40%, transparent 74%);
  mask-image: radial-gradient(115% 115% at 60% 32%, #000 40%, transparent 74%);
}
@media (prefers-color-scheme: dark) {
  .p-hed img { filter: invert(1); mix-blend-mode: screen; opacity: .18; }
}
@media (max-width: 760px) {
  .p-hed { right: -14%; align-items: flex-start; padding-top: 12vh; }
  .p-hed img { height: min(46vh, 420px); }
}

.p-meta { display: flex; align-items: center; gap: clamp(12px, 1.6vw, 22px); flex-wrap: wrap; margin-bottom: clamp(20px, 4vh, 36px); }
.p-meta .tbadge.big { font-size: clamp(14px, 1.4vw, 21px); padding: 9px 18px; }
.p-meta .tbadge.big .ic { width: 1em; height: 1em; }
.p-date { color: var(--ink2); font-size: clamp(15px, 1.6vw, 23px); font-weight: 600; display: inline-flex; align-items: center; gap: 7px; letter-spacing: -0.01em; }
.p-date .ic { width: 1em; height: 1em; }
.p-meta .scope { font-size: clamp(11px, 1vw, 15px); margin-left: 0; }

.p-note {
  font-size: clamp(32px, 4.8vw, 68px);
  font-weight: 750; letter-spacing: -0.022em; line-height: 1.12;
  text-wrap: balance;
}
.p-note.long { font-size: clamp(24px, 3.2vw, 46px); line-height: 1.22; }

.p-firsts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(18px, 3.5vh, 30px); }
.fpair.big { font-size: clamp(14px, 1.5vw, 21px); padding: 9px 18px; }
.fpair.big .ic { width: 1em; height: 1em; }

/* slides with a photo: text keeps the left column, the photo owns the
   right one — empty until the print drops into it */
.p-slide.ev.has-photo {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  column-gap: clamp(28px, 4.5vw, 64px); align-items: center;
}
.p-slide.ev.has-photo > :not(.p-photo) { grid-column: 1; }
.p-photo {
  grid-column: 2; grid-row: 1 / span 8; justify-self: end;
  width: min(clamp(220px, 30vw, 420px), calc(56vh * (var(--ar, 1.33))));
  visibility: hidden; cursor: zoom-in;
}
.p-photo.landed { visibility: visible; }
.p-photo:focus-visible { outline: none; }
.p-photo:focus-visible .p-photo-fig { outline: 2.5px solid var(--tint); outline-offset: 3px; }
.p-photo-fig {
  background: #fdfdfb; border-radius: 6px;
  padding: clamp(8px, 1vw, 12px);
  padding-bottom: clamp(24px, 3.2vw, 38px);
  box-shadow: 0 2px 6px rgba(0,0,0,.18), 0 22px 48px rgba(0,0,0,.28);
  transform: rotate(var(--tilt, -2deg));
}
.p-photo-fig img {
  display: block; width: 100%;
  aspect-ratio: var(--ar, 4 / 3); object-fit: cover;
  border-radius: 2.5px;
}
.p-photo.landed .p-photo-fig { transition: transform .4s var(--spring), box-shadow .3s; }
.p-photo.landed:active .p-photo-fig { transform: rotate(0deg) scale(1.02); }

/* the airborne print (position + rotation driven from JS physics) */
.p-flyer {
  position: fixed; top: 0; z-index: 9;
  pointer-events: none; will-change: transform;
}
/* paper feed: constant speed with tiny roller hesitations */
:root { --feed: linear; }
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --feed: linear(0, .045 7%, .052 10%, .16 21%, .168 24%, .31 37%,
      .318 40%, .47 53%, .478 56%, .63 68%, .638 71%, .8 84%, .806 86%, 1);
  }
}
.p-flyer.printing { transition: transform 2.3s var(--feed); }
@keyframes feedjitter {
  0% { transform: rotate(.3deg); } 50% { transform: rotate(-.35deg); } 100% { transform: rotate(.25deg); }
}
.p-flyer.printing .p-photo-fig { animation: feedjitter 1.18s ease-in-out infinite; }
.p-flyer .p-photo-fig { transform: none; will-change: transform; }

/* the slot the print feeds out of */
.p-printslot {
  position: fixed; top: 0; height: 5px; z-index: 10;
  border-radius: 0 0 4px 4px;
  background: color-mix(in srgb, var(--ink) 62%, transparent);
  box-shadow: 0 1px 10px rgba(0,0,0,.35);
  opacity: 0; transition: opacity .45s;
}
.p-printslot.on { opacity: .92; }

/* small screens: the photo drops in below the words instead of beside them */
@media (max-width: 760px) {
  .p-slide.ev.has-photo { display: flex; flex-direction: column; align-items: flex-start; }
  .p-photo {
    align-self: center; margin-top: clamp(18px, 4vh, 30px);
    width: min(64vw, 320px, calc(34vh * (var(--ar, 1.33))));
  }
  .p-slide.has-photo .p-people { margin-top: clamp(16px, 3vh, 24px); }
  .p-slide.has-photo .p-note { font-size: clamp(24px, 6vw, 40px); }
  .p-slide.has-photo .p-note.long { font-size: clamp(19px, 4.6vw, 30px); }
}

.p-people { display: flex; flex-wrap: wrap; gap: clamp(16px, 2.2vw, 30px); margin-top: clamp(28px, 6vh, 52px); }
.p-person {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: clamp(13px, 1.3vw, 19px); font-weight: 600; color: var(--ink2);
  animation: rise .55s var(--spring) backwards;
  animation-delay: calc(.18s + var(--i, 0) * 80ms);
}
.p-person .avatar.xl {
  width: clamp(64px, 7.2vw, 104px); height: clamp(64px, 7.2vw, 104px);
  font-size: clamp(22px, 2.5vw, 38px);
}

/* ── photo viewer ── */
#photo-root { position: fixed; inset: 0; z-index: 85; pointer-events: none; }
#photo-root .pv { position: absolute; inset: 0; pointer-events: auto; --bd: 1; }
body.viewing { overflow: hidden; }
.pv-bd {
  position: absolute; inset: 0;
  background: rgba(6, 6, 9, 0.93);
  -webkit-backdrop-filter: blur(28px) saturate(120%);
  backdrop-filter: blur(28px) saturate(120%);
  opacity: 0; transition: opacity .34s ease;
}
.pv.bd-in .pv-bd { opacity: var(--bd); }
.pv-stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  touch-action: none; overflow: hidden;
}
.pv-img {
  display: block; flex: none;
  transform-origin: center; will-change: transform;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
  cursor: zoom-in;
}
.pv.zoomed .pv-img { cursor: grab; }
.pv.zoomed .pv-img:active { cursor: grabbing; }
.pv-close {
  position: absolute; z-index: 4;
  top: calc(env(safe-area-inset-top, 0px) + 16px); right: 18px;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.14); color: #fff;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  opacity: 0; transform: scale(.8);
  transition: opacity .3s ease .12s, transform .3s var(--pop) .12s, background .18s;
}
.pv-close .ic { width: 19px; height: 19px; }
.pv-close:active { transform: scale(.9); background: rgba(255,255,255,.26); }
.pv.in .pv-close { opacity: 1; transform: none; }
.pv-cap {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0;
  padding: 40px 22px calc(env(safe-area-inset-bottom, 0px) + 18px);
  background: linear-gradient(to top, rgba(0,0,0,.6), transparent);
  color: #fff; text-align: center; pointer-events: none;
  opacity: 0; transform: translateY(14px);
  transition: opacity .34s ease .14s, transform .34s var(--spring) .14s;
}
.pv.in .pv-cap { opacity: 1; transform: none; }
.pv-cap b { display: block; font-size: 14.5px; font-weight: 650; letter-spacing: -0.15px; line-height: 1.4; max-width: 640px; margin: 0 auto; text-wrap: balance; }
.pv-cap small { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 550; color: rgba(255,255,255,.66); }
/* zoomed in or tucked away: the chrome gets out of the picture's way */
.pv.zoomed :is(.pv-cap, .pv-close),
.pv.chromeless :is(.pv-cap, .pv-close) { opacity: 0; transform: translateY(6px); pointer-events: none; transition-delay: 0s; }
.pv.chromeless .pv-close { transform: scale(.85); }

/* ── view transitions ── */
@keyframes vt-in-fwd  { from { opacity: 0; transform: translateX(28px); } }
@keyframes vt-out-fwd { to   { opacity: 0; transform: translateX(-18px); } }
@keyframes vt-in-back { from { opacity: 0; transform: translateX(-28px); } }
@keyframes vt-out-back{ to   { opacity: 0; transform: translateX(18px); } }
@keyframes vt-in-fade { from { opacity: 0; } }
@keyframes vt-out-fade{ to   { opacity: 0; } }

html[data-dir="fwd"]::view-transition-new(root)  { animation: vt-in-fwd  .32s var(--spring); }
html[data-dir="fwd"]::view-transition-old(root)  { animation: vt-out-fwd .32s var(--spring); }
html[data-dir="back"]::view-transition-new(root) { animation: vt-in-back .32s var(--spring); }
html[data-dir="back"]::view-transition-old(root) { animation: vt-out-back .32s var(--spring); }
html[data-dir="fade"]::view-transition-new(root) { animation: vt-in-fade .26s ease; }
html[data-dir="fade"]::view-transition-old(root) { animation: vt-out-fade .26s ease; }

/* ── motion & pointer preferences ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .card { opacity: 1; transform: none; }
}
@media (hover: hover) {
  .ev:hover, .pcard:hover, .prow:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
  .card.in { transition: opacity .55s var(--spring), transform .28s var(--spring), box-shadow .28s var(--spring); }
  .chip:hover { filter: brightness(1.04); }
  .tab:hover { color: var(--ink); }
  .tab.on:hover { color: var(--tint-ink); }
}

/* wider screens: give timeline a bit more air */
@media (min-width: 560px) {
  .lrow h1 { font-size: 38px; }
  .rail { padding-left: 32px; }
  .rail::before { left: 10px; }
  .raildot { left: -27px; }
}

/* ── desktop: use the whole canvas ── */
@media (min-width: 900px) {
  #main {
    max-width: 1360px;
    padding-left: 48px;
    padding-right: 48px;
  }
  .lhead { padding-top: 44px; }
  .lrow h1 { font-size: 46px; }
  .tagline { font-size: 19px; max-width: 46ch; }
  .sub { font-size: 16px; }

  /* keep the controls tidy rather than stretched */
  .searchwrap, .searchwrap.faux { max-width: 880px; }
  .pickerrow { max-width: 880px; }
  .picker { flex: 0 1 236px; }

  /* list layout: two readable columns, no rail line */
  .tl-content:not(.tl-h) .rail {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 20px; align-items: start;
    padding-left: 0; padding-bottom: 46px;
  }
  .tl-content:not(.tl-h) .rail::before { display: none; }
  .tl-content:not(.tl-h) .raildot { display: none; }
  .ev { --evx: 24px; --evt: 22px; padding: var(--evt) var(--evx) 19px; }
  .ev-note { font-size: 16.5px; }

  /* flow layout: full-bleed carousel with bigger cards */
  .tl-h .hrail {
    margin-inline: calc(50% - 50vw);
    padding-inline: calc(50vw - 50% + 4px);
    scroll-padding-left: calc(50vw - 50% + 4px);
    gap: 20px; padding-top: 34px; padding-bottom: 48px;
  }
  .tl-h .ev { width: 390px; }
  .hitem { padding-top: 38px; }
  .hitem::before { top: 17px; left: -22px; right: -22px; }
  .ymark { min-width: 96px; }
  .ymark h2 { font-size: 32px; }

  /* overlap chart breathes */
  .g-name { width: 168px; font-size: 13px; }
  .g-row { }
  .g-year { font-size: 13px; }

  /* people: bigger cells */
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
  .pcard { padding-top: 30px; }

  /* places: two columns */
  .plist { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .prow-main .meter { max-width: none; }

  /* insights: tiles in one row, panels in two columns */
  .v-insights { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; align-items: start; }
  .v-insights .lhead, .v-insights .tiles { grid-column: 1 / -1; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .tile b { font-size: 40px; }
  .ybars { height: 190px; }
}

/* very large screens / TVs */
@media (min-width: 1600px) {
  #main { max-width: 1520px; }
  .tl-content:not(.tl-h) .rail { grid-template-columns: repeat(3, 1fr); }
  .tl-h .ev { width: 420px; }
}

/* ── map view (map over time) ── */
.mapmode { position: relative; }
.map-shell {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 54px);
  z-index: 5;
  height: 44vh; min-height: 300px;
  border-radius: var(--radius); overflow: hidden;
  background: var(--card); box-shadow: var(--shadow);
}
#podmap { position: absolute; inset: 0; z-index: 0; background: #E9E9EE; }
.leaflet-container { font: inherit; }
.leaflet-control-attribution {
  background: color-mix(in srgb, var(--card) 72%, transparent) !important;
  color: var(--ink3) !important;
  font-size: 9.5px !important;
}
.leaflet-control-attribution a { color: var(--ink2) !important; }
.leaflet-tooltip {
  background: var(--elev); color: var(--ink); border: 0;
  border-radius: 10px; box-shadow: var(--shadow-lift);
  font-size: 12px; font-weight: 570; letter-spacing: -0.1px;
  max-width: 220px; white-space: normal; padding: 6px 10px;
}
.leaflet-tooltip-top::before { border-top-color: var(--elev); }
.map-fail {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
  color: var(--ink2); font-size: 14px; font-weight: 600; text-align: center; padding: 20px;
}

/* the fixed "current time" HUD */
.map-hud {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 600;
  display: flex; flex-direction: column; align-items: center;
  min-width: 148px; padding: 8px 20px 7px;
  border-radius: 17px; text-align: center;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  box-shadow: var(--shadow-lift);
  pointer-events: none;
}
.map-hud b {
  font-size: 21px; font-weight: 800; letter-spacing: -0.35px; line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.map-hud small { color: var(--ink2); font-size: 11.5px; font-weight: 600; letter-spacing: -0.05px; }

/* moments ↔ people toggle, floating at the map's foot */
.map-toggle {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 600;
  display: flex; gap: 2px; padding: 3px;
  border-radius: 999px;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  box-shadow: var(--shadow-lift);
}
.mtog {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px; border-radius: 999px;
  font-size: 12.5px; font-weight: 650; letter-spacing: -0.1px;
  color: var(--ink2);
  transition: background .18s, color .18s, transform .15s var(--pop);
}
.mtog .ic { width: 14px; height: 14px; }
.mtog:active { transform: scale(.94); }
.mtog.on { background: var(--card); color: var(--tint-ink); box-shadow: var(--shadow); }

/* markers: quiet dots for the past, a pulse for right now */
.mk { background: none; border: 0; }
.mk .mkin {
  position: absolute; inset: 0; display: block;
  transition: opacity .4s, transform .45s var(--spring);
}
.mk.future { pointer-events: none; }
.mk.future .mkin { opacity: 0; transform: scale(.2); }
.mk.past .mkin { opacity: .58; transform: scale(.72); }
.mkdot {
  position: absolute; inset: 0; margin: auto;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--tc);
  border: 2.5px solid #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .4);
  transition: width .3s var(--pop), height .3s var(--pop);
}
.mk.now .mkdot { width: 17px; height: 17px; }
.mkring {
  position: absolute; inset: 0; margin: auto;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--tc); opacity: 0;
}
.mk.now .mkring { animation: mkpulse 1.8s ease-out infinite; }
@keyframes mkpulse {
  0% { transform: scale(.55); opacity: .5; }
  70%, 100% { transform: scale(3); opacity: 0; }
}

/* person pins (People mode): little faces at last-known locations.
   The two modes' markers coexist; the container class picks a side. */
.people-mode .mk { display: none; }
#podmap:not(.people-mode) .pk { display: none; }
.pk { background: none; border: 0; }
.leaflet-marker-pane .pk { transition: transform .9s var(--spring); } /* dots glide on a move */
.leaflet-zoom-anim .pk { transition: none; } /* but never fight the zoom animation */
.pkin { position: absolute; inset: 0; display: block; animation: pkpop .5s var(--pop) backwards; }
@keyframes pkpop { from { transform: scale(0); opacity: 0; } }
.pkin .avatar.pkface {
  position: absolute; inset: 0;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  font-size: 12px; font-weight: 700; color: #fff; letter-spacing: 0;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.pkin .avatar.hed.pkface { background: #fff; }
.pkin .avatar.pkface img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pkring {
  position: absolute; inset: 0; margin: auto;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--pc); opacity: 0;
}
.pk.now .pkring { animation: mkpulse 1.8s ease-out infinite; }

/* the time track scrolling under the pinned map */
.map-steps {
  position: relative; z-index: 1;
  max-width: 620px; margin: 0 auto;
  padding: 22px 0 34vh;
}
.map-hint, .map-end {
  text-align: center; color: var(--ink2);
  font-size: 13.5px; font-weight: 600;
  padding: 8px 0 22px;
}
.map-end { padding: 26px 0 4px; }
.map-yearrow {
  display: flex; align-items: center; gap: 14px;
  padding: 24px 6px 14px;
}
.map-yearrow b { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.map-yearrow i { flex: 1; height: 1px; background: var(--sep); }
.mstep {
  background: var(--card); border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  opacity: .55; transform: scale(.985);
  transition: opacity .35s, transform .35s var(--spring), box-shadow .35s;
}
.mstep.past { opacity: .8; transform: none; }
.mstep.now {
  opacity: 1; transform: none;
  box-shadow: var(--shadow-lift), 0 0 0 1.5px color-mix(in srgb, var(--tint) 55%, transparent);
}
.mstep-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 13px 15px 9px;
}
.mstep-head b { font-size: 16px; font-weight: 750; letter-spacing: -0.25px; }
.mstep-head span { color: var(--ink2); font-size: 12px; font-weight: 600; flex: none; }
.mrow {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  padding: 10px 15px; text-align: left;
  border-top: 0.5px solid var(--sep);
}
.mrow:active { background: var(--press); }
.mrow .mini-dot { margin-top: 5px; }
.mrow-main { flex: 1; min-width: 0; }
.mrow-main b { font-size: 13.5px; font-weight: 550; letter-spacing: -0.1px; display: block; line-height: 1.35; }
.mrow-main small { color: var(--ink2); font-size: 12px; }

@media (prefers-color-scheme: dark) {
  #podmap { background: #17171a; }
  .mkdot { border-color: #3A3A3C; }
  .pkin .avatar.pkface { border-color: #3A3A3C; }
}
@media (min-width: 900px) {
  .map-shell { height: 52vh; }
  .map-hud b { font-size: 24px; }
}
/* five layout buttons now — keep the header on one line on small phones */
@media (max-width: 430px) {
  .seg-mini { padding: 2px; }
  .seg-ic { width: 30px; height: 30px; }
  .hbtns { gap: 7px; }
  .hbtn { width: 34px; height: 34px; }
}
