:root {
  color-scheme: dark;
  --bg: #07121b;
  --bg-deep: #040b11;
  --surface: #0c1a24;
  --surface-2: #10232f;
  --surface-3: #152c39;
  --surface-soft: rgba(18, 39, 51, .72);
  --paper: #f2eee4;
  --paper-2: #e8e0d1;
  --ink: #eef2ed;
  --ink-dark: #142029;
  --muted: #98a9b1;
  --muted-2: #70828c;
  --line: rgba(204, 221, 225, .13);
  --line-strong: rgba(204, 221, 225, .22);
  --gold: #d9b574;
  --gold-bright: #f0d39b;
  --gold-dim: #a87b40;
  --teal: #80b9b0;
  --blue: #7ca9cb;
  --rose: #c88f8a;
  --danger: #e68f82;
  --success: #8fc2a0;
  --warning: #ddb674;
  --shadow: 0 28px 80px rgba(0, 0, 0, .35);
  --shadow-soft: 0 16px 40px rgba(0, 0, 0, .2);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --topbar-h: 78px;
  --transition: 220ms cubic-bezier(.2, .75, .25, 1);
  --font-ui: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 10%, rgba(121, 170, 159, .08), transparent 34%),
    linear-gradient(145deg, #07131d 0%, #061018 52%, #091924 100%);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

a {
  color: inherit;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 3000;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink-dark);
  font-weight: 700;
  transition: transform var(--transition);
}

.skip-link:focus {
  transform: translateY(0);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.ambient {
  position: fixed;
  z-index: -2;
  border-radius: 999px;
  filter: blur(80px);
  opacity: .12;
  pointer-events: none;
}

.ambient-one {
  width: 440px;
  height: 440px;
  left: -180px;
  bottom: -180px;
  background: #648f86;
}

.ambient-two {
  width: 520px;
  height: 520px;
  right: -220px;
  top: -240px;
  background: #b08653;
}

.app-shell {
  min-height: 100vh;
  opacity: 1;
  transition: opacity 350ms ease;
}

.app-shell.is-loading {
  opacity: 0;
}

.topbar {
  position: relative;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  height: var(--topbar-h);
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 16, 24, .82);
  backdrop-filter: blur(24px) saturate(135%);
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(217, 181, 116, .42);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(217, 181, 116, .12), rgba(217, 181, 116, .03));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03), 0 10px 28px rgba(0, 0, 0, .16);
}

.brand-mark svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.brand-copy strong {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .01em;
}

.brand-copy span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.primary-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .026);
}

.nav-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: color var(--transition), background var(--transition), transform var(--transition);
}

.nav-button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, .045);
}

.nav-button.is-active {
  color: var(--ink-dark);
  background: var(--paper);
  box-shadow: 0 7px 18px rgba(0, 0, 0, .17);
}

.nav-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.admin-button,
.toolbar-button,
.fit-button,
.primary-button,
.secondary-button,
.danger-button,
.text-button,
.chip-button,
.upload-button {
  border: 0;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition), opacity var(--transition), box-shadow var(--transition);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
  color: var(--muted);
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .075);
  color: var(--ink);
  transform: translateY(-1px);
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.command-button {
  position: relative;
  width: auto;
  min-width: 70px;
  padding: 0 8px 0 11px;
  grid-auto-flow: column;
  gap: 8px;
}

.command-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 23px;
  min-width: 28px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
}

.admin-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 15px;
  border: 1px solid rgba(217, 181, 116, .27);
  border-radius: 12px;
  background: rgba(217, 181, 116, .075);
  color: var(--gold-bright);
  font-size: 13px;
  font-weight: 700;
}

.admin-button:hover {
  transform: translateY(-1px);
  border-color: rgba(217, 181, 116, .5);
  background: rgba(217, 181, 116, .13);
}

.admin-button.is-authenticated {
  border-color: rgba(143, 194, 160, .38);
  background: rgba(143, 194, 160, .1);
  color: #b9dfc3;
}

.admin-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.main-content {
  height: calc(100vh - var(--topbar-h));
  min-height: 0;
}

.view-panel {
  height: 100%;
  animation: viewIn 420ms cubic-bezier(.2, .75, .25, 1) both;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tree-view {
  display: grid;
  grid-template-columns: 354px minmax(0, 1fr);
  min-height: 0;
}

.tree-context {
  position: relative;
  z-index: 5;
  overflow: auto;
  padding: 42px 34px 34px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(11, 27, 37, .94), rgba(8, 20, 29, .9)),
    radial-gradient(circle at 0 0, rgba(217, 181, 116, .08), transparent 42%);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .14) transparent;
}

.eyebrow-row,
.section-heading,
.panel-heading,
.sources-editor-heading,
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.updated-label {
  color: var(--muted-2);
  font-size: 10px;
}

.tree-context h1,
.page-hero h1 {
  margin: 18px 0 14px;
  font-family: var(--font-display);
  font-size: clamp(38px, 3.4vw, 60px);
  font-weight: 500;
  line-height: .99;
  letter-spacing: -.035em;
}

.tree-context h1 {
  font-size: 44px;
}

.lead,
.page-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 28px;
}

.metric-card {
  min-height: 78px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .025);
}

.metric-card.wide {
  grid-column: 1 / -1;
  min-height: 68px;
}

.metric-card strong {
  display: block;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 500;
  line-height: 1;
}

.metric-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.context-section {
  margin-top: 28px;
}

.section-heading {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.journey-list {
  position: relative;
  display: grid;
  gap: 0;
  margin: 15px 0 0;
  padding: 0;
  list-style: none;
}

.journey-list::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 20px;
  bottom: 20px;
  width: 1px;
  background: linear-gradient(var(--gold-dim), rgba(217, 181, 116, .08));
}

.journey-list li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 54px;
}

.journey-list > li > span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid rgba(217, 181, 116, .28);
  border-radius: 50%;
  background: var(--surface);
  color: var(--gold);
  font-size: 8px;
  font-weight: 800;
}

.journey-list strong,
.journey-list small {
  display: block;
}

.journey-list strong {
  font-size: 12px;
  font-weight: 700;
}

.journey-list small {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10px;
}

.legend-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.legend-list > div {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.legend-line {
  display: block;
  width: 32px;
  height: 2px;
  background: var(--gold);
}

.legend-line.probable {
  background: repeating-linear-gradient(90deg, var(--teal) 0 6px, transparent 6px 10px);
}

.legend-line.hypothesis {
  background: repeating-linear-gradient(90deg, var(--rose) 0 2px, transparent 2px 7px);
}

.story-teaser {
  display: grid;
  grid-template-columns: 38px 1fr 18px;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 30px;
  padding: 14px;
  border: 1px solid rgba(217, 181, 116, .2);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(217, 181, 116, .1), rgba(255, 255, 255, .025));
  text-align: left;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.story-teaser:hover {
  transform: translateY(-2px);
  border-color: rgba(217, 181, 116, .4);
  background: linear-gradient(135deg, rgba(217, 181, 116, .15), rgba(255, 255, 255, .04));
}

.story-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(217, 181, 116, .11);
  color: var(--gold);
}

.story-icon svg,
.arrow-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.story-teaser small,
.story-teaser strong {
  display: block;
}

.story-teaser small {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.story-teaser strong {
  margin-top: 3px;
  color: var(--paper);
  font-size: 12px;
}

.arrow-icon {
  color: var(--gold);
}

.tree-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 60% 45%, rgba(128, 185, 176, .055), transparent 38%),
    linear-gradient(rgba(255, 255, 255, .014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .014) 1px, transparent 1px);
  background-size: auto, 42px 42px, 42px 42px;
}

.tree-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(7, 18, 27, .36), transparent 9%, transparent 91%, rgba(7, 18, 27, .4));
  z-index: 2;
}

.tree-toolbar {
  position: absolute;
  z-index: 10;
  top: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7, 18, 27, .78);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.toolbar-button,
.fit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.toolbar-button:hover,
.fit-button:hover {
  background: rgba(255, 255, 255, .065);
  color: var(--ink);
}

.toolbar-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zoom-controls .icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
}

.fit-button {
  min-width: 42px;
}

.tree-canvas,
#treeSvg {
  width: 100%;
  height: 100%;
}

.tree-canvas {
  position: relative;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.tree-canvas.is-dragging {
  cursor: grabbing;
}

#treeSvg {
  position: relative;
  z-index: 1;
  overflow: visible;
}

.tree-edge {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.65;
  opacity: .74;
  vector-effect: non-scaling-stroke;
  transition: opacity 250ms ease, stroke-width 250ms ease;
}

.tree-edge.probable,
.tree-edge.family {
  stroke: var(--teal);
  stroke-dasharray: 7 5;
}

.tree-edge.hypothesis {
  stroke: var(--rose);
  stroke-dasharray: 2 6;
}

.tree-edge.disputed {
  stroke: var(--danger);
  stroke-dasharray: 10 4 2 4;
}

.tree-edge.is-muted {
  opacity: .11;
}

.tree-edge.is-related {
  opacity: 1;
  stroke-width: 2.4;
}

.generation-band rect {
  fill: rgba(255, 255, 255, .014);
}

.generation-band:nth-child(even) rect {
  fill: rgba(128, 185, 176, .014);
}

.generation-band text {
  fill: rgba(180, 197, 204, .38);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.tree-node {
  transition: opacity 250ms ease;
}

.tree-node.is-muted {
  opacity: .27;
}

.tree-node-card {
  position: relative;
  display: grid;
  grid-template-columns: 50px 1fr 16px;
  align-items: center;
  gap: 12px;
  width: 258px;
  height: 108px;
  padding: 14px 13px 14px 14px;
  overflow: hidden;
  border: 1px solid rgba(208, 225, 228, .15);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(20, 43, 55, .98), rgba(11, 26, 36, .98));
  box-shadow: 0 18px 42px rgba(0, 0, 0, .26), inset 0 1px rgba(255, 255, 255, .035);
  color: var(--ink);
  cursor: pointer;
  transform: translateZ(0);
  transition: border-color 230ms ease, box-shadow 230ms ease, transform 230ms ease, background 230ms ease;
}

.tree-node-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  bottom: 15px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--gold);
  opacity: .82;
}

.tree-node-card.status-probable::before,
.tree-node-card.status-family::before {
  background: var(--teal);
}

.tree-node-card.status-hypothesis::before {
  background: var(--rose);
}

.tree-node-card.status-disputed::before {
  background: var(--danger);
}

.tree-node-card:hover,
.tree-node-card.is-selected {
  transform: translateY(-3px);
  border-color: rgba(217, 181, 116, .46);
  box-shadow: 0 22px 54px rgba(0, 0, 0, .36), 0 0 0 1px rgba(217, 181, 116, .08);
}

.tree-node-card.is-selected {
  background: linear-gradient(135deg, rgba(35, 54, 61, .99), rgba(17, 33, 41, .99));
}

.node-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  overflow: hidden;
  border: 1px solid rgba(217, 181, 116, .28);
  border-radius: 16px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .12), transparent 35%),
    linear-gradient(145deg, rgba(217, 181, 116, .16), rgba(217, 181, 116, .035));
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: .04em;
}

.node-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.node-copy {
  min-width: 0;
}

.node-era,
.node-name,
.node-life,
.node-partner {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-era {
  margin-bottom: 3px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.node-name {
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.15;
}

.node-life {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.node-partner {
  margin-top: 4px;
  color: rgba(217, 181, 116, .72);
  font-size: 8.5px;
}

.node-chevron {
  color: rgba(217, 181, 116, .65);
}

.node-chevron svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.node-collapse {
  position: absolute;
  z-index: 3;
  right: -9px;
  top: 44px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(217, 181, 116, .32);
  border-radius: 50%;
  background: #122733;
  color: var(--gold);
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(0, 0, 0, .28);
  transition: transform var(--transition), background var(--transition);
}

.node-collapse:hover {
  transform: scale(1.12);
  background: #1b3643;
}

.node-collapse svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tree-empty {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  text-align: center;
}

.tree-empty strong,
.tree-empty span {
  display: block;
}

.tree-empty strong {
  font-family: var(--font-display);
  font-size: 25px;
}

.tree-empty span {
  margin-top: 6px;
  color: var(--muted);
}

.gesture-hint {
  position: absolute;
  z-index: 5;
  left: 20px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 18, 27, .7);
  color: var(--muted-2);
  font-size: 10px;
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.gesture-hint svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  padding: 54px clamp(28px, 5vw, 82px) 32px;
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  max-width: 800px;
  margin-top: 12px;
}

.compact-hero h1 {
  font-size: clamp(40px, 5vw, 68px);
}

.page-hero p {
  max-width: 650px;
  font-size: 15px;
}

.timeline-view,
.research-view {
  overflow: auto;
  background:
    radial-gradient(circle at 85% 5%, rgba(217, 181, 116, .075), transparent 24%),
    linear-gradient(180deg, rgba(10, 24, 33, .84), rgba(5, 14, 21, .98));
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .14) transparent;
}

.timeline-filter-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 250px;
}

.timeline-filter-wrap label {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(255, 255, 255, .035);
  color: var(--ink);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

select {
  min-height: 42px;
  padding: 0 38px 0 12px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 18px, calc(100% - 11px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

input {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 88px;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.55;
}

select:focus,
input:focus,
textarea:focus {
  border-color: rgba(217, 181, 116, .62);
  background-color: rgba(255, 255, 255, .055);
  box-shadow: 0 0 0 4px rgba(217, 181, 116, .08);
  outline: none;
}

.timeline-filter-wrap select {
  min-width: 200px;
}

.timeline-shell {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 52px clamp(28px, 6vw, 86px) 110px;
}

.timeline-rail {
  position: absolute;
  left: calc(clamp(28px, 6vw, 86px) + 140px);
  top: 70px;
  bottom: 130px;
  width: 1px;
  background: linear-gradient(var(--gold), rgba(217, 181, 116, .08));
}

.timeline-list {
  display: grid;
  gap: 18px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 120px 40px minmax(0, 1fr);
  gap: 0;
  align-items: center;
  min-height: 118px;
  opacity: 0;
  transform: translateY(18px);
  animation: timelineIn 520ms cubic-bezier(.2, .75, .25, 1) forwards;
  animation-delay: var(--delay, 0ms);
}

@keyframes timelineIn {
  to { opacity: 1; transform: translateY(0); }
}

.timeline-year {
  padding-right: 18px;
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 24px;
  text-align: right;
}

.timeline-dot-wrap {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
}

.timeline-dot {
  position: relative;
  z-index: 2;
  width: 12px;
  height: 12px;
  border: 3px solid var(--bg);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 1px rgba(217, 181, 116, .55), 0 0 24px rgba(217, 181, 116, .22);
}

.timeline-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 17px;
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(140deg, rgba(18, 40, 52, .8), rgba(10, 25, 35, .82));
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.timeline-card:hover {
  transform: translateX(5px);
  border-color: rgba(217, 181, 116, .35);
  background: linear-gradient(140deg, rgba(25, 48, 59, .9), rgba(12, 28, 38, .9));
}

.timeline-avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border: 1px solid rgba(217, 181, 116, .25);
  border-radius: 17px;
  background: rgba(217, 181, 116, .08);
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 17px;
}

.timeline-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timeline-card-copy {
  min-width: 0;
}

.timeline-card-copy small,
.timeline-card-copy strong,
.timeline-card-copy span {
  display: block;
}

.timeline-card-copy small {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.timeline-card-copy strong {
  margin-top: 4px;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
}

.timeline-card-copy span {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-status,
.status-badge,
.count-pill,
.priority-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.timeline-status,
.status-badge {
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(143, 194, 160, .25);
  background: rgba(143, 194, 160, .075);
  color: #a8d2b4;
}

.status-probable,
.status-family {
  border-color: rgba(128, 185, 176, .28);
  background: rgba(128, 185, 176, .08);
  color: #9ed0c8;
}

.status-hypothesis {
  border-color: rgba(200, 143, 138, .3);
  background: rgba(200, 143, 138, .085);
  color: #dda9a4;
}

.status-disputed {
  border-color: rgba(230, 143, 130, .35);
  background: rgba(230, 143, 130, .1);
  color: #f0aca2;
}

.research-hero {
  align-items: center;
}

.research-hero-copy {
  max-width: 760px;
}

.research-score-card {
  flex: 0 0 270px;
  padding: 22px 24px;
  border: 1px solid rgba(217, 181, 116, .24);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(217, 181, 116, .1), rgba(255, 255, 255, .025));
  box-shadow: var(--shadow-soft);
}

.research-score-card > span,
.research-score-card > strong,
.research-score-card > small {
  display: block;
}

.research-score-card > span {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.research-score-card > strong {
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 500;
}

.research-score-card > small {
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 9px;
}

.score-track {
  height: 5px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.score-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
  transition: width 900ms cubic-bezier(.2, .75, .25, 1);
}

.research-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
  gap: 22px;
  max-width: 1380px;
  margin: 0 auto;
  padding: 30px clamp(24px, 4vw, 64px) 110px;
}

.feature-story-card {
  position: relative;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(250px, .78fr) minmax(0, 1.22fr);
  min-height: 380px;
  overflow: hidden;
  border: 1px solid rgba(217, 181, 116, .22);
  border-radius: 26px;
  background:
    radial-gradient(circle at 10% 90%, rgba(217, 181, 116, .16), transparent 34%),
    linear-gradient(135deg, #142d39 0%, #0c202b 52%, #091822 100%);
  box-shadow: var(--shadow);
}

.story-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 330px;
  overflow: hidden;
  border-right: 1px solid rgba(217, 181, 116, .12);
  background:
    radial-gradient(circle at 50% 47%, rgba(217, 181, 116, .14), transparent 28%),
    linear-gradient(160deg, rgba(255, 255, 255, .025), transparent);
}

.story-visual::before,
.story-visual::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(217, 181, 116, .09);
  border-radius: 50%;
}

.story-visual::before {
  width: 290px;
  height: 290px;
}

.story-visual::after {
  width: 215px;
  height: 215px;
}

.ship-illustration {
  position: relative;
  z-index: 2;
  width: min(72%, 310px);
  color: var(--gold);
  filter: drop-shadow(0 22px 25px rgba(0, 0, 0, .3));
}

.ship-illustration path,
.ship-illustration line,
.ship-illustration polyline {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.story-route {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 26px;
  display: flex;
  justify-content: space-between;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.story-route::before {
  content: "";
  position: absolute;
  left: 52px;
  right: 52px;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-dim), rgba(217, 181, 116, .18), var(--gold-dim));
}

.story-route span {
  position: relative;
  z-index: 1;
  padding: 0 7px;
  background: #102731;
}

.story-copy {
  padding: clamp(30px, 4vw, 54px);
}

.story-copy h2 {
  max-width: 620px;
  margin: 14px 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -.025em;
}

.story-copy > p {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.story-sections {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.story-section {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .025);
}

.story-section strong,
.story-section span {
  display: block;
}

.story-section strong {
  color: var(--gold-bright);
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.story-section span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.research-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(16, 36, 47, .86), rgba(8, 22, 31, .88));
  box-shadow: var(--shadow-soft);
}

.panel-heading {
  padding: 22px 24px 17px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 500;
}

.count-pill {
  min-width: 32px;
  height: 28px;
  padding: 0 10px;
  background: rgba(217, 181, 116, .1);
  color: var(--gold-bright);
}

.question-list {
  display: grid;
  max-height: 590px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .14) transparent;
}

.question-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 13px;
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
}

.question-item:last-child {
  border-bottom: 0;
}

.question-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 13px;
}

.question-copy strong {
  display: block;
  font-size: 12px;
}

.question-copy p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.priority-pill {
  width: fit-content;
  min-height: 20px;
  margin-top: 9px;
  padding: 0 7px;
  background: rgba(255, 255, 255, .045);
  color: var(--muted-2);
}

.priority-pill.critical {
  background: rgba(230, 143, 130, .1);
  color: #efa99f;
}

.priority-pill.high {
  background: rgba(217, 181, 116, .09);
  color: var(--gold-bright);
}

.ledger-panel {
  min-width: 0;
}

.ledger-heading {
  align-items: flex-end;
}

.ledger-filters {
  display: flex;
  gap: 5px;
}

.chip-button {
  min-height: 29px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
}

.chip-button:hover,
.chip-button.is-active {
  border-color: rgba(217, 181, 116, .3);
  background: rgba(217, 181, 116, .08);
  color: var(--gold-bright);
}

.evidence-ledger {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  max-height: 590px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .14) transparent;
}

.ledger-person {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 76px;
  padding: 12px 15px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition);
}

.ledger-person:nth-child(even) {
  border-right: 0;
}

.ledger-person:hover {
  background: rgba(255, 255, 255, .035);
}

.ledger-person-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(217, 181, 116, .065);
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 12px;
}

.ledger-person-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ledger-person-copy {
  min-width: 0;
}

.ledger-person-copy strong,
.ledger-person-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-person-copy strong {
  font-size: 11px;
}

.ledger-person-copy span {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9px;
}

.source-count {
  color: var(--muted-2);
  font-size: 9px;
}

.profile-drawer {
  position: fixed;
  inset: 0;
  z-index: 600;
  visibility: hidden;
  pointer-events: none;
}

.profile-drawer.is-open {
  visibility: visible;
  pointer-events: auto;
}

.drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 7, 11, .54);
  opacity: 0;
  backdrop-filter: blur(3px);
  transition: opacity 300ms ease;
}

.profile-drawer.is-open .drawer-scrim {
  opacity: 1;
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(540px, 94vw);
  height: 100%;
  overflow: hidden;
  border-left: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 100% 0, rgba(217, 181, 116, .1), transparent 28%),
    linear-gradient(180deg, #10232f, #081923 70%);
  box-shadow: -30px 0 80px rgba(0, 0, 0, .38);
  transform: translateX(102%);
  transition: transform 440ms cubic-bezier(.2, .8, .24, 1);
}

.profile-drawer.is-open .drawer-panel {
  transform: translateX(0);
}

.drawer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  min-height: 68px;
  padding: 0 20px 0 24px;
  border-bottom: 1px solid var(--line);
}

.drawer-position {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-edit-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(217, 181, 116, .25);
  border-radius: 11px;
  background: rgba(217, 181, 116, .08);
  color: var(--gold-bright);
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.drawer-edit-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.close-button {
  border: 0;
  background: transparent;
}

.profile-content {
  flex: 1;
  overflow: auto;
  padding-bottom: 70px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .14) transparent;
}

.profile-hero {
  position: relative;
  padding: 34px 34px 28px;
  border-bottom: 1px solid var(--line);
}

.profile-hero-top {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.profile-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  overflow: hidden;
  border: 1px solid rgba(217, 181, 116, .3);
  border-radius: 26px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .14), transparent 30%),
    linear-gradient(145deg, rgba(217, 181, 116, .16), rgba(217, 181, 116, .035));
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 27px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, .24);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-title-block {
  min-width: 0;
  padding-top: 3px;
}

.profile-title-block .eyebrow {
  display: block;
  margin-bottom: 7px;
}

.profile-title-block h2 {
  margin: 0;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -.02em;
}

.profile-lifespan {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.profile-summary {
  margin: 22px 0 0;
  color: #c5d0d0;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.55;
}

.profile-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
}

.profile-section {
  padding: 25px 34px;
  border-bottom: 1px solid var(--line);
}

.profile-section:last-child {
  border-bottom: 0;
}

.profile-section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.profile-section-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.profile-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-fact {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .025);
}

.profile-fact small,
.profile-fact strong,
.profile-fact span {
  display: block;
}

.profile-fact small {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.profile-fact strong {
  margin-top: 5px;
  color: var(--paper);
  font-size: 11px;
}

.profile-fact span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.profile-biography {
  color: #bac6c7;
  font-size: 12px;
  line-height: 1.8;
}

.profile-biography p {
  margin: 0 0 14px;
}

.profile-biography p:last-child {
  margin-bottom: 0;
}

.relation-list {
  display: grid;
  gap: 8px;
}

.relation-button {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .022);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.relation-button:hover {
  border-color: rgba(217, 181, 116, .28);
  background: rgba(255, 255, 255, .045);
}

.relation-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(217, 181, 116, .08);
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 11px;
}

.relation-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.relation-copy {
  min-width: 0;
}

.relation-copy strong,
.relation-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relation-copy strong {
  font-size: 10px;
}

.relation-copy small {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8px;
}

.relation-arrow {
  color: var(--muted-2);
  font-size: 14px;
}

.profile-note {
  padding: 14px;
  border-left: 2px solid var(--gold-dim);
  border-radius: 0 12px 12px 0;
  background: rgba(217, 181, 116, .055);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.source-list {
  display: grid;
  gap: 8px;
}

.source-link {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .02);
  text-decoration: none;
  transition: border-color var(--transition), background var(--transition);
}

.source-link:hover {
  border-color: rgba(217, 181, 116, .28);
  background: rgba(255, 255, 255, .04);
}

.source-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: rgba(217, 181, 116, .075);
  color: var(--gold);
}

.source-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.source-copy {
  min-width: 0;
}

.source-copy strong,
.source-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-copy strong {
  font-size: 10px;
}

.source-copy span {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 8px;
}

.source-external {
  color: var(--muted-2);
  font-size: 13px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .025);
  color: var(--muted);
  font-size: 8px;
}

.admin-dock {
  position: fixed;
  z-index: 550;
  left: 50%;
  bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  width: min(680px, calc(100vw - 32px));
  min-height: 62px;
  padding: 8px 10px 8px 14px;
  border: 1px solid rgba(143, 194, 160, .26);
  border-radius: 18px;
  background: rgba(8, 24, 31, .92);
  box-shadow: 0 25px 70px rgba(0, 0, 0, .45);
  backdrop-filter: blur(22px) saturate(140%);
  transform: translateX(-50%);
  animation: dockIn 420ms cubic-bezier(.2, .8, .25, 1) both;
}

@keyframes dockIn {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.admin-dock-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pulse {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(143, 194, 160, .08);
}

.status-pulse::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(143, 194, 160, .26);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(.7); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

.admin-dock-status strong,
.admin-dock-status small {
  display: block;
}

.admin-dock-status strong {
  font-size: 10px;
}

.admin-dock-status small {
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 8px;
}

.admin-dock-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-dock-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .04);
  color: var(--ink);
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.admin-dock-actions button:hover {
  border-color: rgba(217, 181, 116, .28);
  background: rgba(255, 255, 255, .075);
}

.admin-dock-actions button.quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted-2);
}

.admin-dock-actions svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast-region {
  position: fixed;
  z-index: 2500;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 9px;
  width: min(360px, calc(100vw - 40px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(13, 31, 41, .96);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  animation: toastIn 350ms cubic-bezier(.2, .8, .25, 1) both;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.is-leaving {
  animation: toastOut 240ms ease forwards;
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(18px); }
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: rgba(143, 194, 160, .09);
  color: var(--success);
}

.toast.error .toast-icon {
  background: rgba(230, 143, 130, .1);
  color: var(--danger);
}

.toast-copy strong,
.toast-copy span {
  display: block;
}

.toast-copy strong {
  font-size: 10px;
}

.toast-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.toast button {
  border: 0;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 7, 10, .72);
  backdrop-filter: blur(10px);
  animation: fadeIn 200ms ease both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  position: relative;
  z-index: 1;
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0, rgba(217, 181, 116, .08), transparent 28%),
    linear-gradient(165deg, #112731, #081923 72%);
  box-shadow: 0 42px 120px rgba(0, 0, 0, .58);
  animation: modalIn 330ms cubic-bezier(.2, .8, .25, 1) both;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .14) transparent;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  border: 0;
  background: transparent;
}

.search-modal {
  align-self: start;
  width: min(680px, calc(100vw - 32px));
  margin-top: min(15vh, 140px);
  overflow: hidden;
}

.search-field-wrap {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--line);
}

.search-field-wrap svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-field-wrap input {
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--paper);
  font-size: 17px;
}

.search-field-wrap input:focus {
  box-shadow: none;
}

.search-field-wrap kbd {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  color: var(--muted-2);
  font-size: 9px;
}

.search-results {
  max-height: min(58vh, 470px);
  overflow: auto;
  padding: 8px;
}

.search-empty {
  padding: 42px 24px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.search-result {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 64px;
  padding: 9px 11px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.search-result:hover,
.search-result.is-active {
  background: rgba(255, 255, 255, .055);
}

.search-result-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(217, 181, 116, .08);
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 13px;
}

.search-result-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-result-copy {
  min-width: 0;
}

.search-result-copy strong,
.search-result-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-copy strong {
  font-size: 11px;
}

.search-result-copy span {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 9px;
}

.search-result-era {
  color: var(--muted-2);
  font-size: 8px;
  text-transform: uppercase;
}

.search-footer {
  display: flex;
  gap: 16px;
  padding: 10px 17px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 8px;
}

.auth-modal {
  width: min(430px, calc(100vw - 32px));
  padding: 38px;
  text-align: center;
}

.auth-modal .modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.auth-emblem {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin: 0 auto 24px;
  border: 1px solid rgba(217, 181, 116, .26);
  border-radius: 21px;
  background: rgba(217, 181, 116, .075);
  color: var(--gold);
}

.auth-emblem svg {
  width: 37px;
  height: 37px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-modal h2 {
  margin: 9px 0 8px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
}

.auth-modal > p {
  margin: 0 auto;
  max-width: 330px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.stack-form,
.form-stack {
  display: grid;
  gap: 14px;
}

.stack-form {
  margin-top: 25px;
  text-align: left;
}

label > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .04em;
}

label > span small {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 500;
}

label > small {
  display: block;
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 8px;
}

.primary-button,
.secondary-button,
.danger-button,
.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 11px;
  font-size: 10px;
  font-weight: 800;
}

.primary-button {
  background: var(--paper);
  color: var(--ink-dark);
  box-shadow: 0 9px 24px rgba(0, 0, 0, .2);
}

.primary-button:hover {
  transform: translateY(-1px);
  background: #fffaf0;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .26);
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled {
  opacity: .55;
  cursor: wait;
  transform: none;
}

.secondary-button,
.upload-button {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .04);
  color: var(--ink);
}

.secondary-button:hover,
.upload-button:hover {
  border-color: rgba(217, 181, 116, .32);
  background: rgba(255, 255, 255, .075);
}

.secondary-button.small {
  min-height: 34px;
  padding: 0 11px;
  font-size: 9px;
}

.secondary-button svg,
.upload-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.danger-button {
  border: 1px solid rgba(230, 143, 130, .3);
  background: rgba(230, 143, 130, .085);
  color: #f0aaa0;
}

.danger-button:hover {
  border-color: rgba(230, 143, 130, .52);
  background: rgba(230, 143, 130, .14);
}

.form-error {
  margin: 0;
  color: #f2aaa0;
  font-size: 9px;
  line-height: 1.5;
}

.auth-footnote {
  display: block;
  margin-top: 17px;
  color: var(--muted-2);
  font-size: 8px;
}

.person-modal {
  width: min(980px, calc(100vw - 34px));
}

.modal-header {
  min-height: 82px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 500;
}

.editor-tabs {
  display: flex;
  gap: 4px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .015);
}

.editor-tab {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.editor-tab:hover,
.editor-tab.is-active {
  background: rgba(255, 255, 255, .06);
  color: var(--ink);
}

.person-form {
  min-height: 0;
}

.editor-panel {
  padding: 25px 26px 28px;
}

.editor-profile-grid {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 28px;
}

.portrait-editor {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.portrait-preview {
  display: grid;
  place-items: center;
  width: 140px;
  height: 164px;
  overflow: hidden;
  border: 1px dashed rgba(217, 181, 116, .3);
  border-radius: 22px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .1), transparent 35%),
    linear-gradient(145deg, rgba(217, 181, 116, .12), rgba(217, 181, 116, .025));
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 31px;
}

.portrait-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-editor .upload-button {
  width: 140px;
  min-height: 38px;
  margin-top: 11px;
  cursor: pointer;
}

.text-button {
  margin-top: 8px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 8px;
}

.text-button:hover {
  color: var(--danger);
}

.portrait-editor > small {
  max-width: 145px;
  margin-top: 9px;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.45;
  text-align: center;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .span-2,
.source-row-fields .span-2 {
  grid-column: 1 / -1;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.toggle-row {
  display: grid;
  grid-template-columns: 33px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 59px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .02);
  cursor: pointer;
}

.toggle-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-control {
  position: relative;
  width: 31px;
  height: 18px;
  margin: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  transition: background var(--transition);
}

.toggle-control::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform var(--transition), background var(--transition);
}

.toggle-row input:checked + .toggle-control {
  background: rgba(217, 181, 116, .32);
}

.toggle-row input:checked + .toggle-control::after {
  transform: translateX(13px);
  background: var(--gold-bright);
}

.toggle-row > span:last-child {
  margin: 0;
}

.toggle-row strong,
.toggle-row small {
  display: block;
}

.toggle-row strong {
  font-size: 8.5px;
}

.toggle-row small {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 7.5px;
  line-height: 1.35;
}

.form-stack.roomy {
  gap: 20px;
}

.form-stack textarea + small {
  text-align: right;
}

.relationship-intro {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding: 15px;
  border: 1px solid rgba(128, 185, 176, .18);
  border-radius: 14px;
  background: rgba(128, 185, 176, .05);
}

.relationship-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: rgba(128, 185, 176, .09);
  color: var(--teal);
}

.relationship-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.relationship-intro strong,
.relationship-intro p {
  display: block;
}

.relationship-intro strong {
  font-size: 10px;
}

.relationship-intro p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.sources-editor {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
}

.sources-editor-heading {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
}

.sources-editor-heading strong,
.sources-editor-heading small {
  display: block;
}

.sources-editor-heading strong {
  font-size: 10px;
}

.sources-editor-heading small {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8px;
}

.source-rows {
  display: grid;
}

.source-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.source-row:last-child {
  border-bottom: 0;
}

.source-row-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.remove-source-button {
  width: 30px;
  height: 30px;
  margin-top: 21px;
  border-color: rgba(230, 143, 130, .18);
  color: var(--danger);
}

.editor-error {
  margin: 0 26px 12px;
  padding: 10px 12px;
  border: 1px solid rgba(230, 143, 130, .22);
  border-radius: 10px;
  background: rgba(230, 143, 130, .06);
}

.modal-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 70px;
  padding: 12px 26px;
  border-top: 1px solid var(--line);
  background: rgba(5, 17, 24, .74);
  backdrop-filter: blur(15px);
}

.footer-spacer {
  flex: 1;
}

.data-modal {
  width: min(900px, calc(100vw - 34px));
}

.data-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 24px 26px;
}

.data-tool-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 220px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, .025);
}

.tool-card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: rgba(217, 181, 116, .08);
  color: var(--gold);
}

.tool-card-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.data-tool-card h3 {
  margin: 16px 0 7px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
}

.data-tool-card p {
  flex: 1;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.data-tool-card .secondary-button,
.data-tool-card .danger-button {
  width: 100%;
}

.file-button {
  cursor: pointer;
}

.danger-card {
  border-color: rgba(230, 143, 130, .18);
}

.danger-card .tool-card-icon {
  background: rgba(230, 143, 130, .08);
  color: var(--danger);
}

.password-panel {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 34px;
  align-items: center;
  padding: 24px 26px 28px;
  border-top: 1px solid var(--line);
}

.password-panel h3 {
  margin: 4px 0 5px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 500;
}

.password-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.password-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 9px;
}

.password-form .form-error {
  grid-column: 1 / -1;
}

@media (max-width: 1180px) {
  .tree-view {
    grid-template-columns: 304px minmax(0, 1fr);
  }

  .tree-context {
    padding: 34px 27px;
  }

  .tree-context h1 {
    font-size: 38px;
  }

  .journey-section {
    display: none;
  }

  .research-dashboard {
    grid-template-columns: 1fr;
  }

  .feature-story-card {
    grid-column: auto;
  }
}

@media (max-width: 960px) {
  :root {
    --topbar-h: 68px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    padding: 0 18px;
    backdrop-filter: none;
    background: rgba(6, 16, 24, .96);
  }

  .primary-nav {
    position: fixed;
    z-index: 700;
    left: 50%;
    bottom: max(13px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    box-shadow: 0 20px 45px rgba(0, 0, 0, .42);
    background: rgba(7, 20, 28, .92);
    backdrop-filter: blur(20px);
  }

  .nav-button.is-active {
    background: var(--paper);
  }

  .topbar-actions .command-key,
  .admin-button span {
    display: none;
  }

  .command-button {
    width: 40px;
    min-width: 40px;
    padding: 0;
  }

  .admin-button {
    width: 40px;
    padding: 0;
    justify-content: center;
  }

  .tree-view {
    grid-template-columns: 245px minmax(0, 1fr);
  }

  .tree-context {
    padding: 28px 22px 88px;
  }

  .tree-context h1 {
    font-size: 33px;
  }

  .legend-section {
    display: none;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric-card.wide {
    grid-column: auto;
  }

  .feature-story-card {
    grid-template-columns: 1fr;
  }

  .story-visual {
    min-height: 260px;
    border-right: 0;
    border-bottom: 1px solid rgba(217, 181, 116, .12);
  }

  .story-sections {
    grid-template-columns: 1fr;
  }

  .evidence-ledger {
    grid-template-columns: 1fr;
  }

  .ledger-person,
  .ledger-person:nth-child(even) {
    border-right: 0;
  }

  .person-modal,
  .data-modal {
    width: calc(100vw - 22px);
  }

  .editor-profile-grid {
    grid-template-columns: 1fr;
  }

  .portrait-editor {
    display: grid;
    grid-template-columns: 100px 140px;
    justify-content: start;
    align-items: center;
    column-gap: 14px;
  }

  .portrait-preview {
    grid-row: 1 / 4;
    width: 100px;
    height: 118px;
  }

  .portrait-editor .upload-button {
    width: 140px;
    margin: 0;
  }

  .portrait-editor > small {
    text-align: left;
  }

  .toggle-grid {
    grid-template-columns: 1fr;
  }

  .data-tool-grid {
    grid-template-columns: 1fr;
  }

  .data-tool-card {
    min-height: 0;
  }

  .password-panel,
  .password-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  body {
    overflow: hidden;
  }

  .brand-copy span {
    display: none;
  }

  .brand-copy strong {
    font-size: 18px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .tree-view {
    display: block;
    position: relative;
  }

  .tree-context {
    position: absolute;
    z-index: 8;
    top: 14px;
    left: 14px;
    width: min(290px, calc(100vw - 28px));
    max-height: 178px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(8, 23, 31, .88);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
  }

  .tree-context .eyebrow-row,
  .tree-context .lead,
  .tree-context .metric-grid,
  .tree-context .context-section,
  .tree-context .story-teaser {
    display: none;
  }

  .tree-context h1 {
    margin: 0;
    font-size: 31px;
    line-height: 1.02;
  }

  .tree-stage {
    height: 100%;
  }

  .tree-toolbar {
    top: auto;
    bottom: 79px;
    left: 12px;
    right: 12px;
  }

  .toolbar-button.compact {
    display: none;
  }

  .gesture-hint {
    display: none;
  }

  .page-hero {
    display: block;
    padding: 34px 20px 25px;
  }

  .page-hero h1 {
    font-size: 40px;
  }

  .timeline-filter-wrap {
    margin-top: 22px;
  }

  .timeline-shell {
    padding: 34px 16px 110px;
  }

  .timeline-rail {
    left: 45px;
    top: 48px;
  }

  .timeline-item {
    grid-template-columns: 0 58px minmax(0, 1fr);
  }

  .timeline-year {
    position: absolute;
    left: 58px;
    z-index: 2;
    padding: 0;
    transform: translateY(-54px);
    font-size: 18px;
    text-align: left;
  }

  .timeline-card {
    grid-template-columns: 48px minmax(0, 1fr);
    margin-top: 25px;
  }

  .timeline-avatar {
    width: 48px;
    height: 48px;
  }

  .timeline-status {
    display: none;
  }

  .research-score-card {
    margin-top: 24px;
  }

  .research-dashboard {
    padding: 18px 12px 110px;
  }

  .feature-story-card,
  .research-panel {
    border-radius: 18px;
  }

  .story-copy {
    padding: 25px 20px;
  }

  .story-copy h2 {
    font-size: 36px;
  }

  .ledger-heading {
    display: block;
  }

  .ledger-filters {
    margin-top: 14px;
  }

  .drawer-panel {
    top: auto;
    bottom: 0;
    width: 100%;
    height: min(86vh, 760px);
    border-top: 1px solid var(--line-strong);
    border-left: 0;
    border-radius: 24px 24px 0 0;
    transform: translateY(102%);
  }

  .profile-drawer.is-open .drawer-panel {
    transform: translateY(0);
  }

  .drawer-topbar::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    transform: translateX(-50%);
  }

  .drawer-topbar {
    position: relative;
    padding-top: 7px;
  }

  .profile-hero,
  .profile-section {
    padding-left: 22px;
    padding-right: 22px;
  }

  .profile-hero-top {
    gap: 15px;
  }

  .profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 21px;
  }

  .profile-title-block h2 {
    font-size: 28px;
  }

  .profile-facts {
    grid-template-columns: 1fr;
  }

  .admin-dock {
    bottom: 80px;
    display: block;
    min-height: 0;
    padding: 9px;
  }

  .admin-dock-status {
    display: none;
  }

  .admin-dock-actions {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
  }

  .toast-region {
    bottom: 82px;
  }

  .modal-shell {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
  }

  .search-modal {
    align-self: start;
    width: calc(100% - 20px);
    margin: 10px;
    border-radius: 18px;
  }

  .auth-modal {
    width: 100%;
    padding: 32px 24px max(28px, env(safe-area-inset-bottom));
  }

  .person-modal,
  .data-modal {
    width: 100%;
  }

  .modal-header {
    padding: 0 18px;
  }

  .editor-tabs {
    overflow-x: auto;
    padding-left: 12px;
    scrollbar-width: none;
  }

  .editor-tab {
    flex: 0 0 auto;
  }

  .editor-panel {
    padding: 20px 18px 24px;
  }

  .form-grid,
  .source-row-fields {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2,
  .source-row-fields .span-2 {
    grid-column: auto;
  }

  .relationship-grid {
    grid-template-columns: 1fr;
  }

  .modal-footer {
    position: sticky;
    bottom: 0;
    padding: 10px 14px max(10px, env(safe-area-inset-bottom));
  }

  .person-footer .secondary-button {
    display: none;
  }

  .data-tool-grid,
  .password-panel {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 430px) {
  .brand-copy {
    display: none;
  }

  .primary-nav {
    width: calc(100vw - 24px);
    justify-content: stretch;
  }

  .nav-button {
    flex: 1;
    justify-content: center;
    padding: 0 8px;
  }

  .tree-context {
    max-height: 160px;
  }

  .tree-context h1 {
    font-size: 27px;
  }

  .toolbar-button {
    font-size: 0;
    width: 34px;
    padding: 0;
  }

  .toolbar-button svg {
    margin: 0;
  }

  .profile-hero-top {
    align-items: center;
  }

  .profile-summary {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
