/* Orbit · styles (dark, glass, Geist). Look and feel from design-directions/orbit.html. */
:root {
  color-scheme: dark;
  --void: #05070d;
  --deep: #0a0f1e;
  --glass: rgba(15, 21, 38, 0.6);
  --glass-strong: rgba(12, 17, 31, 0.86);
  --edge: rgba(255, 255, 255, 0.09);
  --edge-strong: rgba(255, 255, 255, 0.17);
  --text: #edf0f7;
  --muted: #9aa3b8;
  --faint: #656e84;
  --gold: #ffd27a;
  --gold-deep: #c9953a;
  --good: #3ccb8a;
  --warn: #f0b429;
  --bad: #f06a6a;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r-panel: 22px;
  --r-tile: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: radial-gradient(1400px 900px at 50% 38%, #0f1733 0%, #070a15 55%, var(--void) 100%); color: var(--text); font: 400 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 8px; }
.app { position: fixed; inset: 0; overflow: hidden; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#scene.dragging { cursor: grabbing; }
#scene.pointing { cursor: pointer; }
.glass { background: var(--glass); backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%); border: 1px solid var(--edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 18px 50px rgba(0, 0, 0, .4); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- top ---------- */
.top { position: absolute; left: 0; right: 0; top: 0; padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 12px; pointer-events: none; }
.top > * { pointer-events: auto; }
.left-stack { display: grid; gap: 8px; justify-items: start; }
.brand { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 10px; border-radius: 999px; }
.brand .logo { width: 30px; height: 30px; flex: none; }
.brand strong { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.brand .sub { display: block; font-size: 12px; color: var(--muted); margin-top: -2px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 36px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px 0 10px; border-radius: 999px; font-size: 13px; font-weight: 500; transition: border-color .2s; }
.chip:hover { border-color: var(--edge-strong); }
.chip svg { width: 16px; height: 16px; }
.chip .caret { width: 12px; height: 12px; color: var(--muted); }
.chip.gold { color: var(--gold); border-color: rgba(255, 210, 122, .28); }
.chip.gold b { font-weight: 600; }
.chip .stack { display: flex; }
.chip .stack .av { width: 20px; height: 20px; border-radius: 50%; overflow: hidden; border: 1.5px solid #0b1020; margin-left: -6px; }
.chip .stack .av:first-child { margin-left: 0; }
.search-pill { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 16px; border-radius: 999px; color: var(--muted); min-width: 300px; transition: border-color .2s; }
.search-pill:hover { border-color: var(--edge-strong); color: var(--text); }
.search-pill svg { width: 17px; height: 17px; }
.search-pill span { flex: 1; text-align: left; }
kbd { font: 500 11px var(--mono); color: var(--muted); border: 1px solid var(--edge-strong); border-radius: 7px; padding: 3px 7px; }
.modes { justify-self: end; display: flex; gap: 2px; padding: 4px; border-radius: 999px; }
.modes button { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 12px; border-radius: 999px; color: var(--muted); font-weight: 500; transition: background .25s, color .25s; }
.modes button svg { width: 18px; height: 18px; }
.modes button:hover { color: var(--text); }
.modes button[aria-selected="true"] { background: rgba(255, 255, 255, .12); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); }

/* center menu */
.menu { position: absolute; z-index: 9; top: calc(env(safe-area-inset-top, 0px) + 116px); left: 16px; width: 320px; border-radius: 20px; padding: 8px; background: var(--glass-strong); }
.menu h5 { margin: 8px 10px 6px; font-size: 10.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.menu button.opt { width: 100%; display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; text-align: left; padding: 8px 10px; border-radius: 12px; }
.menu button.opt:hover, .menu button.opt[aria-checked="true"] { background: rgba(255, 255, 255, .08); }
.menu .opt b { display: block; font-size: 13.5px; font-weight: 500; }
.menu .opt small { color: var(--muted); font-size: 12px; }
.menu .opt .tick { width: 16px; height: 16px; opacity: 0; }
.menu .opt[aria-checked="true"] .tick { opacity: 1; }
.pair { position: relative; width: 40px; height: 32px; }
.pair .av { position: absolute; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; border: 2px solid #111829; }
.pair .av:nth-child(1) { left: 0; top: 2px; }
.pair .av:nth-child(2) { left: 13px; top: 2px; }
.solo .av { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; display: block; }
.viewer { margin: 6px 4px 2px; padding: 10px; border-top: 1px solid var(--edge); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.seg { display: flex; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .06); }
.seg button { padding: 5px 10px; border-radius: 999px; font-size: 12px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: rgba(255, 255, 255, .14); color: var(--text); }

/* ---------- legend ---------- */
.legend { position: absolute; left: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 104px); border-radius: 18px; padding: 12px; width: 252px; max-height: calc(100% - 290px); overflow-y: auto; scrollbar-width: none; }
.legend h3 { margin: 0 4px 8px; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); display: flex; justify-content: space-between; }
.legend h3 button { text-transform: none; letter-spacing: 0; color: var(--muted); font-size: 11px; }
.legend h6 { margin: 10px 8px 4px; font-size: 10.5px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); display: flex; justify-content: space-between; align-items: center; }
.legend h6 button { font-size: 10.5px; text-transform: none; letter-spacing: 0; color: var(--muted); }
.legend h6 button:hover { color: var(--text); }
.legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lg { width: 100%; display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; text-align: left; transition: background .2s, opacity .2s; }
.lg:hover { background: rgba(255, 255, 255, .06); }
.lg .dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 10px currentColor; }
.lg u { color: var(--muted); text-underline-offset: 2px; }
.lg u:hover { color: var(--text); }
.lg b { font-weight: 500; font-size: 13px; }
.lg small { display: block; color: var(--faint); font-size: 11px; }
.lg .n { font: 12px var(--mono); color: var(--muted); }
.legend.filtering .lg:not(.on) { opacity: .4; }
.lg.on { background: rgba(255, 255, 255, .08); }

/* ---------- time bar ---------- */
.timebar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); width: min(760px, calc(100% - 32px)); border-radius: 20px; padding: 10px 12px 10px 10px; display: grid; grid-template-columns: auto 150px 1fr auto; align-items: center; gap: 14px; }
.round { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); transition: background .2s, transform .2s; }
.round:hover { background: rgba(255, 255, 255, .18); }
.round:active { transform: scale(.96); }
.round svg { width: 18px; height: 18px; }
.year-read { line-height: 1.1; min-width: 0; }
.year-read output { display: block; font: 600 20px var(--mono); letter-spacing: -.02em; white-space: nowrap; }
.year-read span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track { position: relative; height: 44px; }
.track input { position: absolute; inset: 0; width: 100%; margin: 0; appearance: none; -webkit-appearance: none; background: none; cursor: pointer; z-index: 2; }
.track input::-webkit-slider-runnable-track { height: 44px; background: none; }
.track input::-moz-range-track { height: 44px; background: none; }
.track input::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: 13px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px rgba(255, 255, 255, .15), 0 0 18px rgba(255, 255, 255, .6); }
.track input::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px rgba(255, 255, 255, .15), 0 0 18px rgba(255, 255, 255, .6); }
.track .rail { position: absolute; left: 9px; right: 9px; top: 21px; height: 2px; background: rgba(255, 255, 255, .14); border-radius: 2px; }
.track .fill { position: absolute; left: 9px; top: 21px; height: 2px; background: linear-gradient(90deg, rgba(255, 255, 255, .2), #fff); border-radius: 2px; }
.track .ev { position: absolute; top: 12px; height: 20px; border-radius: 3px; background: rgba(255, 255, 255, .07); pointer-events: none; }
.track .xm { position: absolute; top: 15px; width: 6px; height: 6px; margin-left: -3px; transform: rotate(45deg); background: var(--gold); box-shadow: 0 0 8px var(--gold); pointer-events: none; }
.track .ticks { position: absolute; left: 9px; right: 9px; bottom: -2px; height: 12px; font: 10px var(--mono); color: var(--faint); pointer-events: none; }
.track .ticks span { position: absolute; transform: translateX(-50%); }
.toggle { height: 36px; padding: 0 14px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--muted); border: 1px solid var(--edge-strong); transition: all .2s; white-space: nowrap; }
.toggle[aria-pressed="true"] { background: #fff; color: #0a0f1e; border-color: #fff; }

.hint { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); font-size: 12px; color: var(--muted); padding: 8px 14px; border-radius: 999px; background: rgba(10, 14, 28, .6); border: 1px solid var(--edge); white-space: nowrap; transition: opacity .6s; pointer-events: none; }
.hint.gone { opacity: 0; }
.tooltip { position: absolute; left: 0; top: 0; pointer-events: none; padding: 7px 11px; border-radius: 12px; background: var(--glass-strong); border: 1px solid var(--edge-strong); font-size: 12px; white-space: nowrap; opacity: 0; transition: opacity .15s; z-index: 5; }
.tooltip b { display: block; font-size: 13px; font-weight: 600; }
.tooltip span { color: var(--muted); }
.tooltip.on { opacity: 1; }
.toast { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 74px); transform: translate(-50%, -8px); z-index: 12; padding: 10px 16px; border-radius: 14px; font-size: 13px; opacity: 0; transition: all .35s var(--ease); pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 3D labels ---------- */
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lbl { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform; transition: opacity .35s; }
.lbl.person { font-size: 12px; font-weight: 500; color: var(--text); text-shadow: 0 1px 8px #000, 0 0 2px #000; padding-left: 12px; }
.lbl.person small { display: block; font-size: 10.5px; font-weight: 400; color: var(--muted); }
.lbl.ring { font: 500 10.5px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .42); }
.lbl.ring small { font: 10px var(--mono); letter-spacing: 0; text-transform: none; color: rgba(255, 255, 255, .3); margin-left: 6px; }
.lbl.side { font-size: 19px; font-weight: 600; letter-spacing: -.02em; color: rgba(255, 255, 255, .55); text-align: center; }
.lbl.side small { display: block; font-size: 11px; font-weight: 400; letter-spacing: 0; color: rgba(255, 255, 255, .38); }
.lbl.side i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 3px; }
.lbl.sat { pointer-events: auto; cursor: pointer; text-align: center; font-size: 15px; font-weight: 600; color: rgba(255, 255, 255, .8); padding: 6px 12px; border-radius: 999px; background: rgba(12, 17, 31, .55); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(6px); }
.lbl.sat small { display: block; font-size: 10.5px; font-weight: 400; color: rgba(255, 255, 255, .5); }
.lbl.sat i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 2px; }
.lbl.link { font-size: 10.5px; color: rgba(255, 255, 255, .55); letter-spacing: .02em; padding: 2px 8px; border-radius: 999px; background: rgba(5, 7, 13, .5); }
.lbl.cross { pointer-events: auto; cursor: pointer; font-size: 11px; font-weight: 500; color: #1c1405; background: var(--gold); padding: 4px 10px 4px 8px; border-radius: 999px; box-shadow: 0 0 18px rgba(255, 210, 122, .55); }
.lbl.cross::before { content: "✦ "; }
.lbl.cross.dim { background: rgba(255, 210, 122, .25); color: var(--gold); box-shadow: none; }
.lbl.place { font-size: 11.5px; font-weight: 500; color: #fff; text-shadow: 0 1px 6px #000, 0 0 2px #000; padding-left: 9px; }
.lbl.country { font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: rgba(190, 208, 255, .55); text-shadow: 0 1px 6px #000; }
.lbl.state { font-size: 9.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: rgba(190, 208, 255, .42); text-shadow: 0 1px 5px #000; }
.lbl.region { font-size: 11px; font-style: italic; color: rgba(200, 215, 255, .55); text-shadow: 0 1px 5px #000; }
.lbl.county { font-size: 9.5px; color: rgba(190, 208, 255, .4); text-shadow: 0 1px 4px #000; }
.lbl.city { font-size: 10.5px; color: rgba(225, 232, 250, .6); text-shadow: 0 1px 5px #000; padding-left: 7px; }
.lbl.city::before { content: ""; position: absolute; left: 0; top: 6px; width: 3px; height: 3px; border-radius: 50%; background: rgba(225, 232, 250, .6); }
.lbl.place::before { content: ""; position: absolute; left: 0; top: 5.5px; width: 5px; height: 5px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px #fff; }
.lbl.axis { font: 11px var(--mono); color: rgba(255, 255, 255, .45); }
.lbl.era { font-size: 11px; color: rgba(255, 255, 255, .55); border-left: 1px solid rgba(255, 255, 255, .25); padding-left: 6px; }

/* ---------- panel ---------- */
.panel { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 76px); right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); width: 392px; border-radius: var(--r-panel); overflow: hidden; display: flex; flex-direction: column; transform: translateX(calc(100% + 32px)); transition: transform .5s var(--ease); z-index: 4; }
.panel.open { transform: none; }
.panel .grab { display: none; }
.panel .scroll { overflow-y: auto; overscroll-behavior: contain; flex: 1; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.panel .x { position: absolute; top: 12px; right: 12px; z-index: 3; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(5, 7, 13, .5); backdrop-filter: blur(10px); border: 1px solid var(--edge); }
.panel .x svg { width: 16px; height: 16px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 16px 20px 0; }
.back:hover { color: var(--text); }
.hero { position: relative; aspect-ratio: 16 / 11; overflow: hidden; }
.hero .art { position: absolute; inset: 0; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 14, 28, 0) 35%, rgba(12, 17, 31, .95) 100%); }
.hero .rel { position: absolute; left: 20px; bottom: 16px; right: 20px; z-index: 2; display: inline-flex; width: fit-content; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; padding: 6px 12px 6px 10px; border-radius: 999px; background: rgba(5, 7, 13, .55); backdrop-filter: blur(8px); border: 1px solid var(--edge-strong); }
.hero .rel i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pbody { padding: 4px 20px 28px; display: grid; gap: 22px; }
.pname h2 { margin: 0; font-size: 28px; line-height: 1.1; font-weight: 600; letter-spacing: -.025em; text-wrap: balance; }
.pname p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.fact { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .05); min-width: 0; }
.fact dt { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.fact dd { margin: 3px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.fact dd .mono { color: var(--muted); font-size: 12px; }
.sec h4 { margin: 0 0 10px; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sec h4 .mono { letter-spacing: 0; text-transform: none; }
.sec p { margin: 0; color: #cfd5e3; font-size: 14px; line-height: 1.6; }
/* how two people are connected: a small relationship chart (shared ancestor on top, a line of descent down each side) */
.relchart { --ln: rgba(255, 255, 255, .16); }
.rc-sum { margin: 0 0 12px !important; font-size: 12.5px !important; color: var(--muted) !important; line-height: 1.5 !important; }
.rc-sum button { color: var(--text); text-decoration: underline dotted rgba(255, 255, 255, .35); text-underline-offset: 3px; }
.rc-node { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 7px 10px 7px 11px; border-radius: 10px; background: rgba(255, 255, 255, .045); border: 1px solid var(--edge); border-left: 3px solid var(--c, var(--edge-strong)); text-align: left; transition: border-color .2s, background .2s; }
.rc-node:hover { border-color: var(--edge-strong); border-left-color: var(--c, var(--edge-strong)); background: rgba(255, 255, 255, .07); }
.rc-node b { font-size: 12.5px; font-weight: 500; line-height: 1.3; }
.rc-node small { font-size: 10.5px; color: var(--muted); line-height: 1.35; }
.rc-node.shared { background: rgba(255, 210, 122, .07); border-color: rgba(255, 210, 122, .3); border-left-color: var(--c, var(--gold)); }
.rc-node.shared small { color: var(--gold); }
.rc-node.end { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .3); border-left-color: var(--c, #fff); }
.rc-top { display: flex; justify-content: center; }
.rc-top .rc-node { width: auto; min-width: 56%; max-width: 100%; }
.relchart.single .rc-top .rc-node { width: 64%; }
.rc-cols { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; padding-top: 18px; }
.rc-cols::before { content: ""; position: absolute; top: 9px; left: 25%; right: 25%; border-top: 1px solid var(--ln); }
.rc-cols::after { content: ""; position: absolute; top: 0; left: 50%; height: 9px; border-left: 1px solid var(--ln); }
.rc-cols.single { grid-template-columns: 1fr; width: 64%; margin: 0 auto; }
.rc-cols.single::before { display: none; }
.rc-cols.single::after { height: 18px; }
.rc-col { display: flex; flex-direction: column; align-items: stretch; gap: 12px; min-width: 0; }
.rc-col > :first-child::before { content: ""; position: absolute; left: 50%; top: -10px; height: 9px; border-left: 1px solid var(--ln); }
.rc-cols.single .rc-col > :first-child::before { display: none; }
.rc-col > .rc-node + .rc-node::before, .rc-col > .rc-wed + .rc-node::before { content: ""; position: absolute; left: 50%; top: -13px; height: 12px; border-left: 1px solid var(--ln); }
.rc-col > .rc-wed + .rc-node::before { border-left-style: dashed; }
.rc-wed { position: relative; align-self: center; margin: -6px 0; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.rc-steps { list-style: none; margin: 0; padding: 0; }
.rc-steps .rc-node { width: auto; min-width: 60%; }
.rc-steps .rc-hop { margin-left: 18px; padding: 4px 0 4px 12px; border-left: 1px solid var(--ln); font-size: 10.5px; color: var(--faint); }
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: rgba(255, 255, 255, .12); }
.tl li { position: relative; padding: 0 0 12px 24px; }
.tl li::before { content: ""; position: absolute; left: 1px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--deep); border: 1.5px solid var(--c, #fff); }
.tl li.world::before { border-color: rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .25); width: 5px; height: 5px; left: 3px; top: 8px; }
.tl li.xing::before { border-color: var(--gold); background: var(--gold); transform: rotate(45deg); border-radius: 2px; width: 8px; height: 8px; left: 1.5px; }
.tl .when { font: 11px var(--mono); color: var(--muted); }
.tl .what { font-size: 13px; }
.tl .where { font-size: 12px; color: var(--muted); }
.tl li.world .what { color: var(--muted); font-style: italic; }
.tl li.xing .what { color: var(--gold); }
.tl li.xing button { text-align: left; }
.conf { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 6px; vertical-align: 1px; }
.conf.confirmed { background: var(--good); }
.conf.probable { background: #7fb8ff; }
.conf.possible { background: var(--warn); }
.conf.conflict { background: var(--bad); padding: 0; border: 0; margin-top: 0; border-radius: 50%; }
.jr { display: grid; gap: 8px; }
.jr button { text-align: left; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .06); display: grid; gap: 4px; transition: border-color .2s; }
.jr button:hover { border-color: var(--edge-strong); }
.jr .y { font: 11px var(--mono); color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.jr .route { font-size: 13px; }
.jr .route em { font-style: normal; color: var(--faint); }
.media { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { position: relative; aspect-ratio: 1; border-radius: var(--r-tile); overflow: hidden; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .06); text-align: left; transition: transform .2s var(--ease), border-color .2s; }
.tile:hover { transform: translateY(-2px); border-color: var(--edge-strong); }
.tile .art { position: absolute; inset: 0; }
.tile .type { position: absolute; left: 6px; top: 6px; z-index: 2; font-size: 10px; font-weight: 500; padding: 2px 7px; border-radius: 999px; background: rgba(5, 7, 13, .6); backdrop-filter: blur(6px); color: #dfe4f0; }
.tile .cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 16px 8px 7px; font-size: 11px; line-height: 1.25; background: linear-gradient(180deg, transparent, rgba(5, 7, 13, .85)); }
.tile.textual { padding: 28px 9px 9px; display: flex; flex-direction: column; justify-content: space-between; }
.tile.textual .q { font-size: 11px; line-height: 1.35; color: #cdd3e2; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.tile.textual .cap { position: static; padding: 0; background: none; color: var(--muted); font-size: 10.5px; }
.tile .wave { display: flex; align-items: center; gap: 2px; height: 40px; }
.tile .wave i { flex: 1; background: rgba(255, 255, 255, .55); border-radius: 2px; }
.tile .play { position: absolute; z-index: 2; left: 50%; top: 46%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .9); color: #0a0f1e; display: grid; place-items: center; }
.tile .play svg { width: 14px; height: 14px; margin-left: 2px; }
.srcs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.srcs li { font-size: 12.5px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .05); }
.srcs li small { display: block; color: var(--faint); margin-top: 2px; }
.meter { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.meter .bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.meter .bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, rgba(255, 255, 255, .5), #fff); }
.todo { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.todo li { font-size: 12.5px; color: #cfd5e3; padding-left: 22px; position: relative; }
.todo li::before { content: ""; position: absolute; left: 0; top: 3px; width: 12px; height: 12px; border-radius: 4px; border: 1.5px solid var(--faint); }
.conflict { margin-top: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(240, 106, 106, .35); background: rgba(240, 106, 106, .07); font-size: 12.5px; }
.conflict ul { margin: 6px 0; padding-left: 16px; color: #cfd5e3; }
.conflict p { color: var(--muted); font-size: 12px; margin: 0; }
.fam { display: flex; flex-wrap: wrap; gap: 6px; }
.fam button { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border-radius: 999px; background: rgba(255, 255, 255, .05); border: 1px solid var(--edge); font-size: 12px; transition: border-color .2s; text-align: left; }
.fam button:hover { border-color: var(--edge-strong); }
.av { width: 24px; height: 24px; border-radius: 50%; overflow: hidden; flex: none; display: block; }
.fam small { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { height: 36px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; background: rgba(255, 255, 255, .1); border: 1px solid var(--edge); transition: background .2s; }
.btn:hover { background: rgba(255, 255, 255, .16); }
.btn.primary { background: #fff; color: #0a0f1e; border-color: #fff; }
.btn.goldb { background: var(--gold); color: #1c1405; border-color: var(--gold); }
.btn svg { width: 15px; height: 15px; }
.xnote { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255, 210, 122, .3); background: linear-gradient(135deg, rgba(255, 210, 122, .1), rgba(255, 210, 122, .02)); }
.xnote b { color: var(--gold); font-weight: 500; font-size: 12.5px; }
.xnote p { font-size: 13px !important; }
.xnote button { justify-self: start; font-size: 12px; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.kinnote { font-size: 12px; color: var(--muted); }
/* crossing views */
.xhero { position: relative; padding: 56px 20px 22px; background: radial-gradient(420px 220px at 50% 0%, rgba(255, 210, 122, .22), transparent 70%); border-bottom: 1px solid var(--edge); }
.xhero .kicker { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.xhero h2 { margin: 6px 0 4px; font-size: 25px; line-height: 1.12; letter-spacing: -.025em; font-weight: 600; text-wrap: balance; }
.xhero .when { font: 12px var(--mono); color: var(--muted); }
.xchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.xchips span { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; border: 1px solid rgba(255, 210, 122, .35); color: var(--gold); }
.xsides { display: grid; gap: 10px; }
.xside { display: grid; gap: 6px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06); }
.xside h5 { margin: 0; font-size: 11px; font-weight: 500; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.xside h5 i { width: 8px; height: 8px; border-radius: 50%; }
.xlist { display: grid; gap: 8px; }
.xitem { width: 100%; text-align: left; display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06); transition: border-color .2s, background .2s; }
.xitem:hover { border-color: rgba(255, 210, 122, .4); background: rgba(255, 210, 122, .05); }
.xitem .ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 210, 122, .14); color: var(--gold); font-size: 13px; }
.xitem b { display: block; font-size: 13.5px; font-weight: 500; }
.xitem small { display: block; font: 11px var(--mono); color: var(--muted); margin: 2px 0 6px; }
.xitem p { margin: 0; font-size: 12.5px !important; line-height: 1.5 !important; color: #c3cad9 !important; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dots { display: flex; gap: 4px; margin-top: 8px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; }
.lead { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: 0; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats3 div { padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, .04); }
.stats3 b { display: block; font: 600 18px var(--mono); }
.stats3 small { color: var(--faint); font-size: 11px; }
.privacy { font-size: 12px; color: var(--muted); padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--edge); line-height: 1.5; }

/* ---------- palette & lightbox ---------- */
.palette { position: absolute; inset: 0; z-index: 10; display: grid; place-items: start center; padding: calc(env(safe-area-inset-top, 0px) + 12vh) 16px 16px; background: rgba(3, 5, 10, .45); backdrop-filter: blur(4px); }
.palette .box { width: min(560px, 100%); border-radius: 20px; overflow: hidden; background: var(--glass-strong); }
.palette .in { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--edge); }
.palette .in svg { width: 18px; height: 18px; color: var(--muted); }
.palette input { flex: 1; height: 58px; background: none; border: 0; outline: none; font-size: 17px; }
.palette ul { list-style: none; margin: 0; padding: 8px; max-height: min(420px, 55vh); overflow-y: auto; }
.palette li button { width: 100%; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; text-align: left; }
.palette li button[aria-selected="true"], .palette li button:hover { background: rgba(255, 255, 255, .08); }
.palette .av { width: 36px; height: 36px; }
.palette b { display: block; font-weight: 500; font-size: 14px; }
.palette small { color: var(--muted); font-size: 12px; }
.palette .yr { font: 12px var(--mono); color: var(--faint); }
.palette .empty { padding: 18px; color: var(--muted); font-size: 13px; }
.palette .foot { display: flex; gap: 14px; flex-wrap: wrap; padding: 10px 18px; border-top: 1px solid var(--edge); font-size: 11.5px; color: var(--faint); }
.lightbox { position: absolute; inset: 0; z-index: 11; display: grid; place-items: center; padding: 24px 16px; background: rgba(3, 5, 10, .7); backdrop-filter: blur(8px); }
.lb { width: min(880px, 100%); max-height: 100%; overflow-y: auto; border-radius: 24px; background: var(--glass-strong); display: grid; grid-template-columns: 1.1fr 1fr; position: relative; }
.lb .x { position: absolute; top: 12px; right: 12px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(5, 7, 13, .6); border: 1px solid var(--edge); }
.lb .x svg { width: 16px; height: 16px; }
.lb .view { position: relative; min-height: 340px; background: #0b1020; display: grid; place-items: center; overflow: hidden; }
.lb .view .art { position: absolute; inset: 0; }
.lb .view .doc { position: relative; margin: 28px; padding: 22px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--edge); width: calc(100% - 56px); }
.lb .meta { padding: 28px 26px; display: grid; gap: 14px; align-content: start; }
.lb .meta .t { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.lb h3 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -.02em; font-weight: 600; text-wrap: balance; }
.lb .meta p { margin: 0; color: #cfd5e3; font-size: 14px; line-height: 1.55; }
.lb .meta dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 12.5px; }
.lb .meta dt { color: var(--faint); }
.lb .meta dd { margin: 0; }
.lb .bigplay { position: relative; z-index: 2; width: 64px; height: 64px; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #0a0f1e; display: grid; place-items: center; }
.lb .bigplay svg { width: 22px; height: 22px; margin-left: 3px; }
.lb .note { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font-size: 11px; color: rgba(255, 255, 255, .6); z-index: 2; }
.lb .wavebig { display: flex; align-items: center; gap: 3px; height: 90px; width: calc(100% - 56px); position: relative; z-index: 2; }
.lb .wavebig i { flex: 1; border-radius: 2px; background: rgba(255, 255, 255, .28); transition: background .2s; }
.lb .wavebig i.on { background: #fff; }
.ft-doc-table { overflow-x: auto; }
.ft-doc-table table { border-collapse: collapse; width: 100%; font-size: 12px; }
.ft-doc-table th { text-align: left; font-weight: 500; color: var(--faint); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; padding: 0 10px 8px 0; border-bottom: 1px solid var(--edge); }
.ft-doc-table td { padding: 8px 10px 8px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); font-family: var(--mono); font-size: 11.5px; }
/* a record's own fields: one row per field, label in a fixed column, value wrapping in readable text */
.ft-doc-fields, .lb .meta .ft-doc-fields { margin: 0; display: grid; grid-template-columns: 1fr; gap: 0; }
.ft-doc-fields div { display: grid; grid-template-columns: minmax(84px, 30%) 1fr; gap: 14px; padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 13px; line-height: 1.45; }
.ft-doc-fields div:first-child { border-top: 0; padding-top: 2px; }
.ft-doc-fields dt { color: var(--faint); font-size: 12px; line-height: 1.55; }
.ft-doc-fields dd { margin: 0; color: #dfe4ee; overflow-wrap: anywhere; }
.ft-rec { padding-top: 14px; border-top: 1px solid var(--edge); }
.ft-rec .ft-h { margin: 0 0 10px; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.ft-excerpt { margin: 14px 0 0; font-size: 15px; line-height: 1.6; color: #e6eaf3; }
.ft-excerpt:first-child { margin-top: 0; }
.ft-translation { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.ft-translation span { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-right: 6px; }
.loader { position: absolute; inset: 0; display: grid; place-items: center; z-index: 20; background: var(--void); transition: opacity .8s; }
.loader.done { opacity: 0; pointer-events: none; }
.loader .ld { text-align: center; color: var(--muted); font-size: 13px; padding: 0 24px; }
.loader svg { width: 64px; height: 64px; display: block; margin: 0 auto 14px; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.fab-row { display: none; position: absolute; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 118px); gap: 8px; z-index: 3; }
.fab { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.fab svg { width: 18px; height: 18px; }
/* ---------- real photos & files ---------- */
.av img, .hero .art img, .tile .art img, .tile .art video { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero .art img { object-position: 50% 30%; }
.tile .art { background: var(--art-mid, #0b1020); }
.tile .badge { position: absolute; right: 6px; top: 6px; z-index: 2; font: 500 9.5px var(--mono); letter-spacing: .04em; padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, .14); color: #dfe4f0; }
.tile.textual .dom { font: 11px var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.lb .view.media { display: flex; align-items: center; justify-content: center; min-height: 360px; max-height: 78vh; background: #05070d; }
.lb .view.media img { max-width: 100%; max-height: 78vh; width: auto; height: auto; object-fit: contain; display: block; }
.lb .view.media video { width: 100%; max-height: 78vh; display: block; background: #000; }
/* desktop: the record's image stays in view while its fields and details are scrolled (the dialog is the scroller) */
.lb .view.media { position: sticky; top: 0; align-self: start; }
.lb .view.embed { aspect-ratio: 16 / 9; min-height: 0; align-self: center; width: 100%; background: #000; }
.lb .view.embed iframe, .lb .view.pdf iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.lb .view.pdf { min-height: 520px; background: #1a1f2e; }
.lb .pager { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 10px; padding: 4px; border-radius: 999px; background: rgba(5, 7, 13, .7); border: 1px solid var(--edge); font: 11px var(--mono); color: var(--muted); }
.lb .pager button { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); }
.lb .pager button:disabled { opacity: .3; cursor: default; }
.lb .pager svg { width: 14px; height: 14px; }
.lb .wavebig i { cursor: pointer; }
.lb .clock { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font: 11px var(--mono); color: rgba(255, 255, 255, .6); z-index: 2; }
.lb .open { color: #fff; text-decoration: underline; text-underline-offset: 3px; font-size: 12.5px; justify-self: start; }
.srcs li a { color: inherit; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .3); text-underline-offset: 3px; }
.srcs .backs { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.srcs .backs span { white-space: nowrap; }
.srcs .backs .conf { margin: 0 4px 0 0; }
.confkey { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; font-size: 11px; color: var(--faint); }
.confkey .conf { margin: 0 4px 0 0; }
.living { font-size: 12px; color: var(--muted); padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--edge); line-height: 1.5; }
.empty-note { font-size: 12.5px; color: var(--faint); }
.tl .what button { text-align: left; }
.tl .what button:hover { text-decoration: underline; text-underline-offset: 3px; }
.lbl.person.dyn { font-size: 11px; opacity: .9; }
.lbl.person.dyn small { font-size: 10px; }
.loader .ld b { display: block; color: var(--text); font-weight: 500; margin-bottom: 4px; }

@media (max-width: 1100px) {
  .search-pill { min-width: 0; width: 44px; padding: 0; justify-content: center; }
  .search-pill span, .search-pill kbd { display: none; }
}
@media (max-width: 760px) {
  .top { grid-template-columns: 1fr auto; padding-inline: 12px; gap: 8px; }
  .top .search-pill { display: none; }
  .brand { padding: 6px 12px 6px 6px; gap: 8px; }
  .brand .sub { display: none; }
  .modes button { padding: 0 10px; }
  .modes button span { display: none; }
  .chip { height: 34px; font-size: 12px; padding: 0 12px 0 8px; }
  .chip .lbltext { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menu { left: 12px; right: 12px; width: auto; top: calc(env(safe-area-inset-top, 0px) + 110px); }
  .legend { display: none; }
  .legend.show { display: block; left: 12px; right: 12px; width: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 100px); z-index: 6; max-height: 60vh; }
  .timebar { grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; gap: 6px 10px; padding: 10px; width: calc(100% - 24px); bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); }
  .timebar .year-read { grid-column: 2; grid-row: 1; }
  .timebar .track { grid-column: 1 / -1; grid-row: 2; height: 38px; }
  .timebar .toggle { grid-column: 3; grid-row: 1; }
  .track .rail, .track .fill { top: 18px; }
  .track .xm { top: 12px; }
  .track input::-webkit-slider-thumb { margin-top: 10px; }
  .hint { bottom: calc(env(safe-area-inset-bottom, 0px) + 176px); max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
  .fab-row { display: flex; }
  .panel { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 62vh; border-radius: 24px 24px 0 0; transform: translateY(105%); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .panel.open { transform: translateY(0); }
  .panel.expanded { height: calc(100% - env(safe-area-inset-top, 0px) - 64px); }
  .panel .grab { display: block; position: absolute; left: 50%; top: 8px; transform: translateX(-50%); width: 40px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .3); z-index: 3; }
  .panel .grabzone { position: absolute; left: 0; right: 60px; top: 0; height: 30px; z-index: 3; touch-action: none; }
  .hero { aspect-ratio: 16 / 9; }
  .pname h2 { font-size: 24px; }
  .lb { grid-template-columns: 1fr; }
  .lb .view { min-height: 240px; }
  .lb .view.media { min-height: 220px; max-height: 60vh; position: relative; }
  .lb .view.media img, .lb .view.media video { max-height: 60vh; }
  .lb .view.pdf { min-height: 62vh; }
  .lbl.side { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
