:root {
  --bg: #fffaf4;
  --surface: #ffffff;
  --surface-2: #f6f1ff;
  --ink: #1e1940;
  --ink-2: #4a4570;
  --muted: #8a84aa;
  --line: #ece5f6;
  --happy: #ff6a3d;      /* happiness line — sunny coral */
  --achieve: #5b6cff;    /* achievement line — electric indigo */
  --mine: #ff3d8b;       /* hot pink accents */
  --sun: #ffc83d;
  --mint: #1cc8a8;
  --reflect: #0e9f7e;   /* Looking back — emerald, apart from the two lines and the pink accents */
  --place: #0a8fd0;     /* Places / map */
  --focus: #5b6cff;
  --grad: linear-gradient(120deg, #ff6a3d 0%, #ff3d8b 48%, #7b5cff 100%);
  --grad-soft: linear-gradient(120deg, #fff0e6 0%, #ffe6f1 50%, #eee9ff 100%);
  --shadow: 0 1px 2px rgba(60, 30, 120, .05), 0 10px 30px rgba(91, 60, 200, .08);
  --shadow-pop: 0 2px 4px rgba(60, 30, 120, .06), 0 18px 40px rgba(255, 80, 120, .16);
  --display: 'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14112a; --surface: #1e1a3a; --surface-2: #29234d; --ink: #f6f3ff; --ink-2: #cfc9ee; --muted: #9690bd;
    --line: #322b5c; --happy: #ff8a5c; --achieve: #8b97ff; --mine: #ff6aa8; --sun: #ffd166; --mint: #3ee0c0; --reflect: #34d6a8; --place: #5cc4ff; --focus: #a8b2ff;
    --grad-soft: linear-gradient(120deg, #2c1f3f 0%, #331d40 50%, #241f4d 100%);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.3);
    --shadow-pop: 0 2px 4px rgba(0,0,0,.3), 0 18px 40px rgba(255, 80, 140, .18);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 16px/1.6 var(--sans);
  background:
    radial-gradient(900px 500px at 8% -10%, color-mix(in srgb, var(--sun) 28%, transparent), transparent 70%),
    radial-gradient(800px 520px at 100% 0%, color-mix(in srgb, var(--mine) 16%, transparent), transparent 70%),
    radial-gradient(900px 600px at 50% 120%, color-mix(in srgb, var(--achieve) 12%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 750; line-height: 1.12; margin: 0 0 .4em; letter-spacing: -.02em; }
h1 { font-size: clamp(32px, 5.4vw, 54px); }
h2 { font-size: clamp(22px, 3vw, 30px); }
h3 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 60%, transparent); outline-offset: 2px; border-radius: 6px; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: flex-start; gap: 10px;
  padding: 12px max(16px, env(safe-area-inset-left)); background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--display); font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.brand svg { width: 36px; height: 20px; fill: none; stroke: url(#brandGrad); stroke-width: 3; stroke-linecap: round; }

/* SOFT OPEN badge (series common, _handoff/soft-open.md) */
.soft { font: 800 10px var(--sans); letter-spacing: .1em; padding: 4px 9px; border-radius: 999px; border: 1.5px solid color-mix(in srgb, var(--mine) 40%, transparent); background: color-mix(in srgb, var(--mine) 8%, var(--surface)); color: var(--mine); white-space: nowrap; line-height: 1.2; cursor: pointer; }
.soft:hover { background: color-mix(in srgb, var(--mine) 16%, var(--surface)); }

/* bottom tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); max-width: 640px; margin: 0 auto;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-top: 1px solid var(--line); }
@media (min-width: 641px) { .tabbar { bottom: 12px; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-pop); padding: 6px 8px; } }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 14px; text-decoration: none; color: var(--muted); font: 700 11px var(--sans); letter-spacing: .01em; transition: color .15s, background .15s; }
.tabbar a svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a:hover { color: var(--ink-2); }
.tabbar a.on { color: var(--mine); background: color-mix(in srgb, var(--mine) 9%, transparent); }
.tabbar a.on svg { stroke-width: 2.4; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
body:has(.dw-gate) .tabbar { visibility: hidden; }

main { max-width: 1080px; margin: 0 auto; padding: 24px 16px 48px; outline: none; }
.foot { max-width: 1080px; margin: 0 auto; padding: 24px 16px 48px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 9px 18px; border-radius: 999px; font: 650 15px var(--sans); cursor: pointer; text-decoration: none; min-height: 42px; transition: transform .12s, box-shadow .15s, border-color .15s; }
.btn:hover { border-color: color-mix(in srgb, var(--mine) 45%, var(--line)); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(255, 61, 139, .28); }
.btn.primary:hover { box-shadow: 0 10px 26px rgba(255, 61, 139, .38); }
.btn.ghost { background: transparent; }
.btn.danger { color: #e5484d; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.sm { padding: 5px 13px; min-height: 32px; font-size: 13px; }
input[type=text], input[type=number], input[type=search], input[type=password], textarea, select {
  width: 100%; font: 15px var(--sans); color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--achieve); box-shadow: 0 0 0 4px color-mix(in srgb, var(--achieve) 16%, transparent); }
textarea { resize: vertical; min-height: 70px; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; font-weight: 600; }
input[type=range] { width: 100%; accent-color: var(--happy); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink-2); text-decoration: none; transition: transform .12s, background .15s, border-color .15s; }
.chip:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--chip, var(--mine)) 50%, var(--line)); }
.chip.on { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(255, 61, 139, .25); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 4px; }
.seg button { border: 0; background: transparent; padding: 7px 16px; border-radius: 999px; font: 650 14px var(--sans); color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg button.on::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--grad); margin-right: 7px; vertical-align: 1px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 20px; box-shadow: var(--shadow); }
.section { margin-top: 38px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: var(--mine); font-weight: 800; margin-bottom: 6px; }
.badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.badge.record { background: color-mix(in srgb, var(--mint) 18%, transparent); color: color-mix(in srgb, var(--mint) 75%, var(--ink)); }
.badge.self { background: color-mix(in srgb, var(--happy) 16%, transparent); color: var(--happy); }

/* home */
.hero { text-align: center; padding: 34px 0 10px; position: relative; }
.hero h1 { font-size: clamp(38px, 7vw, 72px); font-weight: 800; }
.hero .wave { display: block; width: min(420px, 80%); height: 44px; margin: 0 auto 8px; }
.hero p.lead { font-size: clamp(17px, 2.2vw, 21px); color: var(--ink-2); font-weight: 500; }
.searchbar { display: flex; gap: 8px; max-width: 660px; margin: 22px auto 0; padding: 6px; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow-pop); border: 1px solid var(--line); }
.searchbar input { border: 0; border-radius: 999px; padding: 12px 18px; font-size: 16px; box-shadow: none; background: transparent; }
.searchbar input:focus { box-shadow: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 26px 0 14px; }
.toolbar select { width: auto; border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.life-card { --accent: var(--mine); position: relative; overflow: hidden; display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 18px 18px 14px; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; }
.life-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--accent); }
.life-card::after { content: ''; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: var(--accent); opacity: .09; }
.life-card:hover { transform: translateY(-4px) rotate(-.3deg); box-shadow: var(--shadow-pop); }
.life-card h3 { margin: 8px 0 2px; font-size: 21px; }
.life-card .meta { font-size: 13px; color: var(--muted); font-weight: 500; }
.life-card .tag { font-size: 15px; color: var(--ink-2); margin-top: 8px; font-family: var(--serif); font-style: italic; line-height: 1.35; }
.life-card svg { display: block; width: 100%; height: 60px; margin-top: 12px; }
.life-card .badge { background: color-mix(in srgb, var(--accent) 14%, transparent); color: color-mix(in srgb, var(--accent) 80%, var(--ink)); }
.wisdom { background: var(--grad-soft); border: 1px solid var(--line); border-radius: 26px; padding: 24px; margin-top: 28px; position: relative; overflow: hidden; }
.wisdom h2 { margin-bottom: 4px; }
.wisdom .chip { background: color-mix(in srgb, var(--surface) 85%, transparent); }
.wisdom .chip:nth-child(5n+1) { --chip: var(--happy); }
.wisdom .chip:nth-child(5n+2) { --chip: var(--achieve); }
.wisdom .chip:nth-child(5n+3) { --chip: var(--mint); }
.wisdom .chip:nth-child(5n+4) { --chip: var(--sun); }
.wisdom .chip:nth-child(5n+5) { --chip: var(--mine); }
.wisdom .chip:not(.on)::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--chip); margin-right: 8px; vertical-align: 1px; }
.empty { text-align: center; padding: 40px 0; color: var(--muted); }

/* photos */
.life-card .avatar { position: absolute; right: 14px; top: 16px; width: 54px; height: 54px; border-radius: 50%; object-fit: cover; object-position: top; border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--accent), var(--shadow); z-index: 1; filter: saturate(1.05); }
.life-card:has(.avatar) h3, .life-card:has(.avatar) .meta { padding-right: 62px; }
.portrait { margin: 0; flex: 0 0 auto; }
.portrait img { display: block; width: 132px; height: 160px; object-fit: cover; object-position: top; border-radius: 26px; border: 4px solid var(--surface); box-shadow: 0 0 0 3px var(--accent, var(--mine)), var(--shadow-pop); transform: rotate(-2.5deg); transition: transform .2s; }
.portrait img:hover { transform: rotate(0) scale(1.03); }
.portrait figcaption { font-size: 11px; color: var(--muted); max-width: 150px; margin-top: 10px; line-height: 1.35; }
.portrait figcaption span { display: none; }
.portrait:hover figcaption span { display: inline; }
.ev-main { display: flex; gap: 16px; align-items: flex-start; }
.ev-main.flip { flex-direction: row-reverse; }
.ev-text { flex: 1 1 auto; min-width: 0; }
.moment-photo { flex: 0 0 96px; margin: 4px 0 0; }
.moment-photo img { display: block; width: 100%; height: 110px; object-fit: cover; object-position: top; border-radius: 14px; border: 3px solid var(--surface); box-shadow: 0 0 0 2px color-mix(in srgb, var(--happy) 45%, transparent), var(--shadow); transform: rotate(1.5deg); transition: transform .2s; }
.ev-main.flip .moment-photo img { transform: rotate(-1.5deg); }
.moment-photo img:hover { transform: rotate(0) scale(1.04); }
.moment-photo figcaption { font-size: 11px; line-height: 1.35; color: var(--ink-2); margin-top: 6px; font-weight: 500; }
.moment-photo figcaption span { color: var(--muted); font-weight: 400; }
@media (max-width: 520px) { .moment-photo { flex-basis: 96px; } .moment-photo img { height: 112px; } .moment-photo figcaption span { display: none; } }

/* life page */
.life-head { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-end; }
.life-head .who { flex: 1 1 280px; min-width: 0; }
@media (max-width: 560px) { .portrait img { width: 96px; height: 116px; border-radius: 20px; } .portrait figcaption { display: none; } }
.life-head .eyebrow { color: var(--accent, var(--mine)); }
.chart-wrap { position: relative; margin-top: 18px; scroll-margin-top: 80px; }
.chart { width: 100%; height: auto; display: block; touch-action: none; user-select: none; -webkit-user-select: none; overflow: visible; }
.chart .grid line { stroke: var(--line); }
.chart .axis text { fill: var(--muted); font: 600 12px var(--sans); }
.chart .axis .axis-title { fill: var(--ink-2); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.chart .lines { pointer-events: none; }
.chart .pt { cursor: pointer; }
.chart .pt .dot { transition: r .15s; }
.chart .pt:hover .dot, .chart .pt.on .dot { r: 8; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-top: 10px; align-items: center; }
.legend i { display: inline-block; width: 20px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.legend button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.legend button.off { opacity: .4; text-decoration: line-through; }
.legend .muted { font-weight: 500; }
.track-tabs { display: flex; gap: 6px; margin: 26px 0 0; padding: 4px; background: var(--surface-2); border-radius: 999px; width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.track-tabs button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font: 700 14px var(--sans); color: var(--ink-2); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.track-tabs button .count { font-size: 12px; color: var(--track); background: color-mix(in srgb, var(--track) 14%, transparent); border-radius: 999px; padding: 1px 8px; }
.track-tabs button.on { background: var(--track); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--track) 35%, transparent); }
.track-tabs button.on .count { color: var(--track); background: #fff; }
.tracks { margin-top: 16px; }
.track .timeline li { border-image: none; border-left-color: color-mix(in srgb, var(--track) 35%, transparent); }
.track .timeline li::before { border-color: var(--track); }
.track .timeline li.on::before { background: var(--track); box-shadow: 0 0 0 5px color-mix(in srgb, var(--track) 22%, transparent); }
.track .timeline li.on .ev { border-color: color-mix(in srgb, var(--track) 55%, transparent); }
.track .timeline .age { color: var(--track); }
.timeline li.none { border: 0; padding-left: 0; }
.timeline li.none::before { display: none; }
.timeline-scroll { max-height: min(70vh, 640px); overflow-y: auto; overscroll-behavior: contain; padding: 14px 4px 0 0; scroll-padding-top: 14px; border-radius: 18px; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 28px; margin-left: 9px; border-left: 3px solid transparent; border-image: linear-gradient(var(--happy), var(--mine), var(--achieve)) 1; }
.timeline li::before { content: ''; position: absolute; left: -10px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--happy); transition: transform .15s; }
.timeline li.on::before { background: var(--happy); transform: scale(1.25); box-shadow: 0 0 0 5px color-mix(in srgb, var(--happy) 22%, transparent); }
.timeline li.on .ev { border-color: color-mix(in srgb, var(--happy) 55%, transparent); box-shadow: var(--shadow-pop); background: var(--surface); }
.timeline .ev { border: 1.5px solid transparent; border-radius: 18px; padding: 10px 14px; margin-top: -10px; transition: border-color .2s, box-shadow .2s, background .2s; }
.timeline .age { font-size: 13px; color: var(--happy); font-weight: 800; letter-spacing: .02em; }
.timeline .scores { font-size: 12px; color: var(--muted); font-weight: 600; }
.timeline .scores b { color: var(--happy); }
.timeline .scores b.a { color: var(--achieve); }
.resonate { background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 12px; font: 650 13px var(--sans); color: var(--ink-2); cursor: pointer; margin-top: 8px; transition: transform .12s; }
.resonate:hover { transform: scale(1.04); }
.resonate.on { border-color: var(--mine); color: #fff; background: var(--mine); }
.reflect { margin: 10px 0 6px; padding: 12px 16px; border-radius: 16px; background: color-mix(in srgb, var(--reflect) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--reflect) 30%, transparent); border-left: 4px solid var(--reflect); position: relative; }
.reflect::before { content: '“'; position: absolute; right: 12px; top: -6px; font: 800 52px/1 var(--serif); color: var(--reflect); opacity: .55; }
.reflect > .small:first-child { color: var(--reflect); font-weight: 700; }
.reflect blockquote { margin: 4px 0 6px; font-family: var(--serif); font-size: 17px; line-height: 1.45; padding-right: 26px; }
.linkish { background: none; border: 0; padding: 0; margin-top: 6px; font: 700 13px var(--sans); color: var(--reflect); cursor: pointer; text-align: left; }
.linkish:hover { text-decoration: underline; }
.legend-happy { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.legend-happy b { font-weight: 800; color: var(--ink); }
.happy-scale { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; line-height: 1; }
.happy-scale > span:first-child { color: rgb(52,70,112); }
.happy-scale > span:nth-child(3) { color: rgb(255,140,20); }
.happy-bar { display: inline-block; width: 64px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgb(52,70,112), rgb(158,166,182) 40%, rgb(255,176,46) 70%, rgb(255,128,20)); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.legend-mark { display: inline-flex; align-items: center; gap: 6px; }
.chart .reflect-mark { pointer-events: none; }
.field.qa { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.answer { border-left: 4px solid var(--reflect); padding: 4px 0 4px 18px; margin: 20px 0; }
.looking-back > .eyebrow { color: var(--reflect); }
.answer blockquote { margin: 6px 0; font-family: var(--serif); font-size: 20px; line-height: 1.4; }
.quote { font-family: var(--serif); font-size: 21px; margin: 0 0 4px; line-height: 1.4; }
.lesson-card { background: var(--grad); color: #fff; border: 0; box-shadow: var(--shadow-pop); }
.lesson-card .eyebrow { color: rgba(255,255,255,.85); }
.lesson { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.25; margin: 0; }
.bio { max-width: 820px; margin-top: 16px; }
.bio-text { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink-2); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.bio.open .bio-text { display: block; -webkit-line-clamp: unset; overflow: visible; }
.more-btn { background: none; border: 0; padding: 4px 0; margin-top: 4px; font: 700 14px var(--sans); color: var(--mine); cursor: pointer; }
.more-btn:hover { text-decoration: underline; }
.name-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.name-row h1 { margin: 0; }
.head-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; transition: color .15s, border-color .15s, transform .12s; }
.icon-btn:hover { color: var(--mine); border-color: color-mix(in srgb, var(--mine) 45%, var(--line)); transform: translateY(-1px); }
.about .summary { font-size: 17px; margin-bottom: 22px; }
.two-col { display: grid; grid-template-columns: 1fr; gap: 28px; }
@media (min-width: 880px) { .two-col { grid-template-columns: 1.1fr 1fr; } }

/* editor */
.ev-row { border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 12px; background: var(--surface); box-shadow: var(--shadow); }
.ev-row .row > label.field { margin-bottom: 0; }
.sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.sliders .ach { accent-color: var(--achieve); }
@media (max-width: 520px) { .sliders { grid-template-columns: 1fr; } }
.sticky-actions { position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(12px); padding: 12px 0; border-top: 1px solid var(--line); margin-top: 20px; z-index: 5; }

/* lists */
.list-item { display: block; text-decoration: none; padding: 16px 0; border-bottom: 1px solid var(--line); transition: background .15s; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover .quote { color: var(--mine); }

#toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(30px); opacity: 0; background: var(--grad); color: #fff; padding: 12px 18px; border-radius: 18px; font-size: 14px; font-weight: 600; line-height: 1.45; box-shadow: var(--shadow-pop); transition: all .25s; pointer-events: none; z-index: 150; width: max-content; max-width: min(420px, calc(100% - 32px)); text-align: center; }
#toast b { font-weight: 800; }
#toast.show { opacity: 1; transform: translateX(-50%); }

/* series gate */
.dw-gate { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px 16px; background: inherit; }
body:has(.dw-gate) .top, body:has(.dw-gate) .foot, body:has(.dw-gate) #sisters { visibility: hidden; }
.gate-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 30px 24px; box-shadow: var(--shadow-pop); }
.gate-card .wave { width: 160px; height: 22px; margin: 0 auto; }
.gate-card h2 { margin: 0; font-size: 34px; }
.gate-card p { margin: 0; color: var(--muted); font-size: 14px; }
.gate-card .err { color: #e5484d; font-weight: 600; }

/* interviews */
.iv-switch a { display: inline-block; padding: 7px 16px; border-radius: 999px; font: 650 14px var(--sans); color: var(--ink-2); text-decoration: none; }
.iv-switch a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.iv-card .iv-q { margin-top: 10px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--reflect); }
.iv-card .iv-a { margin: 4px 0 0; font-family: var(--serif); font-size: 16px; line-height: 1.45; color: var(--ink); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
/* Crossed paths (Explore) */
.crossed h2 { margin-bottom: 12px; }
.crossed-row { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.crossed-card { flex: 0 0 240px; scroll-snap-align: start; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--place); border-radius: 20px; padding: 14px; box-shadow: var(--shadow); }
.cc-place { font: 800 18px var(--display); margin-bottom: 8px; }
.cc-place span { font: 600 13px var(--sans); color: var(--muted); }
.cc-person { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 5px 0; text-decoration: none; border-top: 1px solid var(--line); }
.cc-person img, .cc-person i { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--surface-2); display: block; }
.cc-person b { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-person span { font-size: 12px; color: var(--place); font-weight: 700; }
.cc-person:hover b { color: var(--place); }

/* graph card header: play + Graph | Map */
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -4px 0 6px; flex-wrap: wrap; }
.where { margin-left: auto; font: 800 13px var(--sans); color: var(--place); }
.viz { display: block; }
.mapbox { position: relative; height: 200px; margin: 0 -8px 8px; border-radius: 16px; overflow: hidden; }
@media (min-width: 760px) {
  .viz.with-map { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 14px; align-items: stretch; }
  .viz.with-map .mapbox { height: auto; min-height: 220px; margin: 0; }
}
.mapbox canvas { display: block; width: 100%; height: 100%; cursor: pointer; }
.mapbox.loading::after { content: 'Loading the map…'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-weight: 600; font-size: 14px; }
@media (max-width: 640px) { .mapbox { height: min(44vw, 190px); } }
.timeline .age .at { color: var(--place); }
.timeline li.place { --track: var(--place); }
.timeline li.place::before { border-radius: 4px; transform: rotate(45deg); }
.timeline li.place.on::before { transform: rotate(45deg) scale(1.25); }
.timeline li.place h3 { font-size: 22px; }
.timeline li.place h3 .country { font-weight: 600; color: var(--muted); font-size: 15px; }
.timeline li.place .ev { background: color-mix(in srgb, var(--place) 6%, transparent); }
.here { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.here-chip { border: 1.5px solid color-mix(in srgb, var(--track) 40%, var(--line)); background: var(--surface); color: var(--track); border-radius: 999px; padding: 3px 10px; font: 700 12px var(--sans); cursor: pointer; }
.here-chip:hover { background: color-mix(in srgb, var(--track) 10%, var(--surface)); }

/* life playback: start button in the graph card */
.player { display: flex; align-items: center; }
.pl-start { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 7px 16px 7px 12px; background: var(--grad); color: #fff; font: 700 14px var(--sans); cursor: pointer; box-shadow: 0 6px 18px rgba(255, 61, 139, .28); transition: transform .12s; }
.pl-start:hover { transform: translateY(-1px); }
.chart .band { cursor: pointer; }
.chart .band rect { fill: color-mix(in srgb, var(--place) 13%, var(--surface)); stroke: color-mix(in srgb, var(--place) 35%, transparent); stroke-width: 1; }
.chart .band text { fill: var(--place); font: 700 11px var(--sans); pointer-events: none; }
.chart .band:hover rect { fill: color-mix(in srgb, var(--place) 24%, var(--surface)); }
.chart .band.on rect { fill: var(--place); stroke: var(--place); }
.chart .band.on text { fill: #fff; }
.chart .band-shade { fill: color-mix(in srgb, var(--place) 10%, transparent); }
.chart .playhead { stroke: var(--mine); stroke-width: 1.5; stroke-dasharray: 3 4; opacity: .7; }

/* shorts-style full-screen player */
.shorts { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(12, 8, 30, .92); backdrop-filter: blur(6px); animation: sh-fade .25s ease-out; }
.sh-frame { position: relative; width: min(100vw, 480px); height: 100dvh; max-height: 100dvh; display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); background-image: radial-gradient(500px 300px at 10% 0%, color-mix(in srgb, var(--sun) 30%, transparent), transparent 70%), radial-gradient(500px 360px at 100% 10%, color-mix(in srgb, var(--mine) 18%, transparent), transparent 70%);
  padding: calc(10px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); }
@media (min-width: 520px) { .sh-frame { height: min(100dvh, 900px); border-radius: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.45); } }
.sh-frame[data-kind="reflect"] , .sh-frame[data-kind="iv"] { background: color-mix(in srgb, var(--reflect) 92%, #0b3d33); background-image: radial-gradient(500px 360px at 80% 0%, rgba(255,255,255,.18), transparent 70%); color: #fff; }
.sh-bars { display: flex; gap: 4px; position: relative; z-index: 3; }
.sh-seg { flex: 1; min-width: 0; padding: 8px 0; margin: -8px 0; border: 0; background: none; cursor: pointer; display: block; }
.sh-seg:hover span { transform: scaleY(1.8); }
.sh-seg:focus-visible { outline: 2px solid var(--accent, var(--mine)); outline-offset: 2px; border-radius: 4px; }
.sh-bars span { display: block; transition: transform .15s; height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 15%, transparent); overflow: hidden; }
.sh-frame[data-kind="reflect"] .sh-bars span , .sh-frame[data-kind="iv"] .sh-bars span { background: rgba(255,255,255,.3); }
.sh-bars i { display: block; height: 100%; width: 0; background: var(--grad); }
.sh-frame[data-kind="reflect"] .sh-bars i , .sh-frame[data-kind="iv"] .sh-bars i { background: #fff; }
.sh-top { display: flex; align-items: center; gap: 10px; margin: 12px 0 6px; position: relative; z-index: 3; }
.sh-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; object-position: top; border: 2px solid var(--accent); }
.sh-who { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.sh-who b { font: 800 16px var(--display); }
.sh-who span { font-size: 12px; opacity: .7; }
.sh-x { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--ink) 8%, transparent); color: inherit; font-size: 16px; cursor: pointer; }
.sh-frame[data-kind="reflect"] .sh-x , .sh-frame[data-kind="iv"] .sh-x { background: rgba(255,255,255,.16); }
.sh-viz { flex: 0 0 auto; display: flex; gap: 8px; align-items: stretch; margin: 6px -6px 0; }
.sh-viz.with-map .sh-map { position: relative; flex: 0 0 40%; height: 150px; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.sh-viz.with-map .sh-chart { flex: 1 1 auto; min-width: 0; margin: 0; }
.sh-map canvas { display: block; width: 100%; height: 100%; }
.sh-place { position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--place); font: 800 11px var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.sh-place:empty { display: none; }
.sh-frame[data-kind="reflect"] .sh-map , .sh-frame[data-kind="iv"] .sh-map { opacity: .45; }
.sh-chart { flex: 0 0 auto; margin: 4px -6px 0; transition: opacity .3s; }
.sh-frame[data-kind="reflect"] .sh-chart , .sh-frame[data-kind="iv"] .sh-chart { opacity: .35; }
.sh-frame[data-kind="reflect"] .chart .axis text , .sh-frame[data-kind="iv"] .chart .axis text { fill: rgba(255,255,255,.8); }
.sh-stage { flex: 1 1 auto; min-height: 0; overflow-y: auto; position: relative; z-index: 2; padding: 10px 2px 70px; scrollbar-width: none; }
.sh-slide { animation: sh-in .45s cubic-bezier(.2,.8,.2,1); }
.sh-kicker { font: 800 12px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--track, var(--mine)); margin-bottom: 8px; }
.sh-slide h2 { font-size: clamp(26px, 7vw, 34px); margin: 0 0 12px; }
.sh-slide p { font-size: 17px; line-height: 1.6; color: var(--ink-2); }
.sh-photo { float: right; width: 30%; max-width: 120px; margin: 2px 0 8px 12px; }
.sh-photo img { display: block; width: 100%; height: auto; max-height: 150px; object-fit: cover; object-position: top; border-radius: 12px; box-shadow: var(--shadow); }
.sh-slide.lookback .sh-kicker { color: rgba(255,255,255,.85); }
.sh-q { font: 800 14px var(--sans); color: rgba(255,255,255,.85); margin: 18px 0 6px; }
.sh-slide.lookback blockquote { margin: 0; font-family: var(--serif); font-size: clamp(22px, 6vw, 28px); line-height: 1.4; color: #fff; }
.sh-slide.place .sh-kicker, .sh-slide.death .sh-kicker { color: var(--place); }
.sh-country { display: block; font: 700 15px var(--sans); color: var(--muted); margin-top: 4px; letter-spacing: 0; }
.sh-slide.death h2 { opacity: .9; }
.sh-slide.end { text-align: center; padding-top: 14px; }
.sh-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; margin: 14px 0 18px; }
.sh-stats div { background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--line); border-radius: 16px; padding: 10px 4px; box-shadow: var(--shadow); }
.sh-stats b { display: block; font: 800 26px var(--display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sh-stats span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.sh-closing { margin: 6px 4px 4px; font-family: var(--serif); font-style: italic; font-size: clamp(19px, 5vw, 23px); line-height: 1.45; color: var(--ink); }
.sh-closing-note { font-size: 13px !important; color: var(--muted) !important; margin-bottom: 0; }
.sh-speed { width: auto !important; padding: 0 10px; border-radius: 999px !important; font: 800 13px var(--sans); }
.sh-years { color: var(--muted) !important; }
.sh-end-actions { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 22px; }
.sh-zone { position: absolute; top: 90px; bottom: 80px; border: 0; background: transparent; cursor: pointer; z-index: 1; }
.sh-zone.prev { left: 0; width: 30%; }
.sh-zone.next { right: 0; width: 70%; }
.sh-frame[data-kind="end"] .sh-zone { display: none; }
.sh-pause { position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 4; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 24px rgba(255, 61, 139, .35); }
.sh-frame[data-kind="reflect"] .sh-pause , .sh-frame[data-kind="iv"] .sh-pause { background: #fff; color: var(--reflect); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.sh-frame[data-kind="end"] .sh-pause { display: none; }
@keyframes sh-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes sh-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sh-slide, .shorts { animation: none; } }

/* Interview tab */
.iv-list { position: relative; display: flex; flex-direction: column; gap: 20px; padding-right: 4px; }
.iv-note { margin: 0; font-size: 13px; color: var(--muted); }
.iv-qa .iv-q { margin: 0 0 4px; font: 800 14px var(--sans); color: var(--reflect); letter-spacing: 0; }
.iv-qa .iv-a { margin: 0 0 6px; font-family: var(--serif); font-size: 18px; line-height: 1.5; color: var(--ink); }
.iv-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; }
.iv-src { color: var(--muted); }

@media (max-width: 640px) {
  .track-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; border-radius: 18px; }
  .track-tabs button { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .track-tabs button .count { display: none; }
  .track-tabs button { justify-content: center; padding: 8px 6px; font-size: 13px; gap: 5px; border-radius: 14px; }
  .chart-wrap { padding: 12px 8px 14px; border-radius: 18px; }
  .chart .axis text { font-size: 11px; }
  .legend { gap: 10px 14px; padding: 0 6px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
/* player: map above the graph instead of beside it */
.sh-viz.with-map.stacked { flex-direction: column; gap: 6px; }
.sh-viz.with-map.stacked .sh-map { flex: 0 0 auto; width: 100%; height: 140px; }
/* five numbers on the closing slide: tighter so each fits on one line */
.sh-stats.n5 { gap: 6px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sh-stats.n5 div { padding: 10px 2px; }
.sh-stats.n5 b { font-size: clamp(16px, 4.6vw, 22px); }
.sh-stats.n5 span { font-size: 11px; line-height: 1.25; display: block; }

/* ---------- People: map + period + list ---------- */
.people-filters { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 14px; }
.people-filters .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pp-when { display: flex; align-items: center; gap: 8px; }
.pp-when[hidden] { display: none; }
.pp-when input[type="range"] { flex: 1; min-width: 0; accent-color: var(--mine); }
.pp-when b { min-width: 9.5em; font: 800 15px var(--sans); }
.atlas-card { padding: 0; overflow: hidden; }
.atlas { position: relative; height: clamp(240px, 46vw, 420px); }
.atlas canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.atlas canvas:active { cursor: grabbing; }
.atlas-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.atlas-zoom .icon-btn { background: var(--surface); box-shadow: var(--shadow); font-size: 18px; font-weight: 700; }
.people-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; margin: 20px 0 10px; scroll-margin-top: 80px; }
.people-head h2 { margin: 0; }
.people-head .btn { margin-left: auto; }
.people-list { padding: 6px; }
.person-row { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; color: inherit; text-decoration: none; }
.person-row:hover, .person-row:focus-visible { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.person-row + .person-row { border-top: 1px solid var(--line); }
.person-row .avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: top; flex: 0 0 auto; border: 2px solid var(--accent); }
.person-row .avatar.initial { display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 15%, var(--surface)); font: 800 18px var(--sans); color: var(--accent); }
.pr-main { display: flex; flex-direction: column; min-width: 0; }
.pr-main b { font-size: 16px; }
.pr-sub { font-size: 13px; color: var(--muted); }
.pr-meta { font-size: 13px; color: var(--ink-2); margin-top: 2px; line-height: 1.45; }

/* ---------- home ---------- */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sec-head h2 { margin: 2px 0 0; }
.swipe { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 14px; margin: 0 -2px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.swipe > * { scroll-snap-align: start; flex: 0 0 auto; }
.today-card { width: min(78vw, 280px); display: flex; flex-direction: column; border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: transform .15s; }
.today-card:hover { transform: translateY(-2px); }
.today-card img, .today-pic { width: 100%; height: 150px; object-fit: cover; object-position: center 25%; display: block; background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.today-body { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px 14px; border-top: 4px solid var(--accent); }
.today-when { font: 700 12px var(--sans); color: var(--muted); letter-spacing: .02em; }
.today-what { font: 800 18px var(--display); line-height: 1.25; }
.today-card.born .today-what { color: var(--mint); }
.today-card.died .today-what { color: var(--muted); }
.today-who { font-size: 14px; color: var(--ink-2); }
.answers { background: var(--grad-soft); border: 1px solid var(--line); border-radius: 26px; padding: 24px; }
.answers h2 { font-family: var(--serif); font-style: italic; margin: 4px 0 14px; }
.ans-card { width: min(80vw, 320px); display: flex; flex-direction: column; justify-content: space-between; gap: 12px; background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); border-radius: 18px; padding: 16px; color: inherit; text-decoration: none; }
.ans-card blockquote { margin: 0; font-family: var(--serif); font-size: 17px; line-height: 1.5; }
.ans-who { font-size: 13px; color: var(--ink-2); }
.ans-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 4px; }
.ans-dots { display: flex; gap: 6px; }
.ans-dots i { width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 18%, transparent); }
.ans-dots i.on { background: var(--mine); width: 18px; border-radius: 4px; }
.crossed-card.wide { width: 100%; max-width: 560px; }
.cc-more { display: block; padding: 10px 0 2px; font-weight: 700; font-size: 14px; color: var(--place); }
