:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-subtle: #eef1f5;
  --ink: #0f172a;
  --ink-soft: #334155;
  --ink-faint: #64748b;
  --border: rgba(15, 23, 42, 0.12);
  --border-strong: rgba(15, 23, 42, 0.22);
  --accent: #c84b28;
  --accent-hover: #a73a1b;
  --accent-soft: rgba(200, 75, 40, 0.11);
  --teal: #0d6861;
  --teal-soft: rgba(13, 104, 97, 0.11);
  --memorial: #4c3f6e;
  --memorial-soft: rgba(76, 63, 110, 0.10);
  --amber: #9a4708;
  --amber-soft: rgba(245, 158, 11, 0.16);
  --danger: #b91c1c;
  --shadow-xs: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 4px 16px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 20px 54px rgba(15, 23, 42, 0.18);
  --radius: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

/* Accessible big default text + 1-click A / A+ / A++ scaling */
html {
  font-size: 17px;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

html.text-lg {
  font-size: 20px;
}

html.text-xl {
  font-size: 23px;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

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

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

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Clean, High-Contrast Top Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 18px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  border-bottom: 1.5px solid var(--border);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f172a 0%, #334155 55%, var(--accent) 100%);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--ink-soft);
}

/* Big, Simple Navigation Tabs */
.nav-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-subtle);
  padding: 5px;
  border-radius: 999px;
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.nav-btn {
  background: transparent;
  color: var(--ink-soft);
  border: none;
  padding: 9px 16px;
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

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

.nav-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.10);
  color: var(--ink);
}

.badge-warm {
  background: var(--accent);
  color: #fff;
}

/* Text Size Switcher (A / A+ / A++) */
.text-size-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--surface-subtle);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.ts-btn {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  padding: 5px 9px;
  min-height: 36px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  font-size: 0.82rem;
}

.ts-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.user-area {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  padding: 5px 14px 5px 6px;
  min-height: 44px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  border: 1.5px solid var(--border-strong);
}

.avatar-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}

/* Scan progress bar */
.scan-banner {
  background: #0f172a;
  color: #f8fafc;
  padding: 10px 22px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.progress-track {
  flex: 1;
  max-width: 320px;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #14b8a6);
  width: 0%;
  transition: width 0.25s ease;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 18px 22px 42px;
  max-width: 1720px;
  width: 100%;
  margin: 0 auto;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

/* Big, Clear, Clickable Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  min-height: 44px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-subtle);
}

.btn-primary {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.btn-primary:hover {
  background: #1e293b;
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-hover);
}

.btn-teal {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.btn-teal:hover {
  background: #0a524c;
  border-color: #0a524c;
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
}

.btn-ghost:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.btn-sm {
  padding: 6px 12px;
  min-height: 36px;
  font-size: 0.82rem;
  border-radius: 10px;
}

.btn-xs {
  padding: 3px 9px;
  min-height: 30px;
  font-size: 0.76rem;
  border-radius: 8px;
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.input, .select, .textarea {
  width: 100%;
  padding: 10px 13px;
  min-height: 44px;
  border: 1.5px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.92rem;
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.12);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-body {
  padding: 16px 18px;
}

/* Spatial / Main 3-Column Workspace: Resizable Live Family Tree | Divider | Center Stage | Divider | Resizable Right Details */
.spatial-layout {
  --tree-panel-w: 380px;
  --right-panel-w: 320px;
  display: grid;
  grid-template-columns: var(--tree-panel-w) 12px minmax(180px, 1fr) 12px var(--right-panel-w);
  column-gap: 4px;
  row-gap: 16px;
  align-items: start;
  transition: grid-template-columns 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

body.resizing-tree-panel .spatial-layout {
  transition: none !important;
}

/* Sleek compressed Family Tree header when focused on a single person's lineage */
.spatial-layout.tree-panel-focused .tree-compact-header {
  padding: 7px 9px !important;
  gap: 5px !important;
}

.spatial-layout.tree-panel-focused .tree-hdr-row1 {
  flex-wrap: nowrap;
}

.spatial-layout.tree-panel-focused .tree-hdr-row1 > div:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.spatial-layout.tree-panel-focused .tree-hdr-row1 > div:last-child {
  flex-wrap: nowrap !important;
  flex-shrink: 0;
}

.spatial-layout.tree-panel-focused .tree-hdr-row1 h3 {
  font-size: 0.9rem !important;
}

.spatial-layout.tree-panel-focused #liveTreeYearNote {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spatial-layout.tree-panel-focused #btnDrawLineMode,
.spatial-layout.tree-panel-focused #btnNonRelatives,
.spatial-layout.tree-panel-focused #treeBloodlineToggleWrap {
  display: none !important;
}

.spatial-layout.tree-panel-focused .tree-hdr-row1 .btn-xs {
  padding: 3px 8px;
  font-size: 0.72rem;
  min-height: 26px;
}

.spatial-layout.tree-panel-focused .tree-hdr-row2 {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.spatial-layout.tree-panel-focused .tree-portrait-mode-bar.compact {
  width: 100%;
  flex: none;
}

.spatial-layout.tree-panel-focused .tree-portrait-mode-bar.compact .tree-pm-btn {
  font-size: 0.72rem;
  padding: 3px 6px;
}

.spatial-layout.tree-panel-focused .tree-hdr-row3 .pqs-wrap {
  width: 100%;
  min-width: 0 !important;
}

.spatial-layout.tree-panel-focused .tree-full-family-btn {
  top: 10px;
  left: 10px;
  min-height: 38px;
  padding: 6px 13px;
  font-size: 0.84rem;
  gap: 6px;
}

.tree-resize-handle {
  width: 14px;
  min-height: 680px;
  align-self: stretch;
  cursor: col-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  transition: background 0.14s ease;
  user-select: none;
  touch-action: none;
}

.tree-resize-grip {
  width: 4px;
  height: 68px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.14s ease, height 0.14s ease, width 0.14s ease;
}

.tree-resize-handle:hover,
.tree-resize-handle.dragging {
  background: rgba(200, 75, 40, 0.10);
}

.tree-resize-handle:hover .tree-resize-grip,
.tree-resize-handle.dragging .tree-resize-grip {
  background: var(--accent);
  width: 5px;
  height: 110px;
}

body.resizing-tree-panel {
  cursor: col-resize !important;
  user-select: none !important;
}

@media (max-width: 1320px) {
  .spatial-layout {
    --tree-panel-w: 330px;
    grid-template-columns: var(--tree-panel-w) 14px minmax(300px, 1fr);
  }
  #rightResizeHandle {
    display: none;
  }
  .spatial-right {
    grid-column: 1 / -1;
  }
}

@media (max-width: 880px) {
  .spatial-layout {
    grid-template-columns: 1fr;
  }
  .tree-resize-handle {
    display: none;
  }
}

/* ==================== ALWAYS-VISIBLE FULL-WIDTH TOP TIMELINE BAR ==================== */
.global-timeline-bar {
  position: sticky;
  top: 56px;
  z-index: 45;
  padding: 6px 18px 4px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1.5px solid var(--border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  width: 100%;
  flex-shrink: 0;
}

.global-timeline-bar .timeline-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: nowrap;
  margin-bottom: 0;
}

.timeline-track-inline {
  flex: 1;
  min-width: 240px;
}

.timeline-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.timeline-bar {
  padding: 8px 14px 6px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1.5px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
}

.timeline-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.timeline-year-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.timeline-year-num {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--ink);
  min-width: 58px;
  font-variant-numeric: tabular-nums;
}

.timeline-sat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: #0b4f4a;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid rgba(13, 104, 97, 0.25);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-track-wrap {
  position: relative;
  width: 100%;
  padding: 36px 0 22px;
}

/* Thin black World History Events track sitting cleanly ON TOP of the date bar */
.timeline-history-track {
  position: absolute;
  top: 0;
  left: 8px;
  right: 8px;
  height: 30px;
  pointer-events: none;
  z-index: 6;
}

.timeline-history-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1.5px;
  background: #0f172a;
}

.history-ev-btn {
  position: absolute;
  bottom: 2px;
  transform: translateX(-50%);
  pointer-events: auto;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 7;
}

.history-ev-lbl {
  font-family: inherit;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1.05;
  color: #0f172a;
  white-space: nowrap;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  transition: background 0.12s ease, color 0.12s ease;
}

.history-ev-tick {
  width: 1px;
  background: #0f172a;
  height: 5px;
  flex-shrink: 0;
}

.history-ev-btn.row-1 .history-ev-tick {
  height: 16px;
}

.history-ev-btn:hover .history-ev-lbl,
.history-ev-btn.active-ev .history-ev-lbl {
  background: #0f172a;
  color: #ffffff;
}

.history-ev-btn:hover {
  z-index: 20;
}

.timeline-ruler-ticks {
  position: absolute;
  top: 39px;
  left: 8px;
  right: 8px;
  height: 8px;
  pointer-events: none;
  z-index: 2;
}

.timeline-ruler-notch {
  position: absolute;
  top: 2px;
  width: 1px;
  height: 5px;
  background: rgba(15, 23, 42, 0.28);
  transform: translateX(-50%);
}

.timeline-ruler-notch.major {
  top: 0;
  width: 1.5px;
  height: 8px;
  background: rgba(15, 23, 42, 0.55);
}

/* Ultra-thin date bar line so text & information ribbon below never compete! */
.timeline-slider {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0d6861 0%, #64748b 52%, #c84b28 100%);
  outline: none;
  cursor: pointer;
  position: relative;
  z-index: 5;
}

/* Sleek, refined vertical needle thumb on the ultra-thin date bar */
.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(180deg, #d95632 0%, #b73d1b 100%);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.42), 0 0 0 1px rgba(183, 61, 27, 0.55);
  cursor: grab;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.timeline-slider::-webkit-slider-thumb:hover {
  transform: scale(1.14);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.5), 0 0 0 1.5px rgba(200, 75, 40, 0.7);
}

.timeline-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.16);
}

.timeline-slider::-moz-range-thumb {
  width: 11px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(180deg, #d95632 0%, #b73d1b 100%);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.42), 0 0 0 1px rgba(183, 61, 27, 0.55);
  cursor: grab;
}

.timeline-sat-markers {
  position: absolute;
  top: 29px;
  left: 8px;
  right: 8px;
  height: 8px;
  pointer-events: none;
  z-index: 6;
}

.sat-dot-btn {
  position: absolute;
  transform: translateX(-50%);
  pointer-events: auto;
  width: 6px;
  height: 6px;
  padding: 0;
  border: 1px solid #fff;
  background: var(--teal);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(13, 104, 97, 0.35);
  transition: transform 0.14s ease, background 0.14s ease;
}

.sat-dot-btn:hover, .sat-dot-btn.active {
  transform: translateX(-50%) scale(1.55);
  background: var(--accent);
  z-index: 10;
}

/* Crisp year text cleanly OUTSIDE below the thin date line */
.timeline-decades {
  position: absolute;
  bottom: 0;
  left: 8px;
  right: 8px;
  height: 16px;
}

/* Crisp Map Date Badge pinned in the top-left corner of the map */
.map-date-corner-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 620;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.map-date-corner-year {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #fde68a;
}

.map-date-corner-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
}

/* Compact Family Tree Header + 1080p Zero-Scroll Desktop Landscape Fit */
.tree-compact-header {
  padding: 8px 10px !important;
  flex-direction: column;
  align-items: stretch !important;
  gap: 6px !important;
  flex-shrink: 0;
}

.tree-hdr-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.tree-hdr-row2 {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tree-hdr-row3 {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tree-portrait-mode-bar.compact {
  width: auto;
  flex: 1;
  padding: 2px;
  border-radius: 9px;
  gap: 2px;
}

.tree-portrait-mode-bar.compact .tree-pm-btn {
  font-size: 0.72rem;
  padding: 3px 6px;
  border-radius: 7px;
}

.tree-bloodline-toggle.compact {
  width: auto;
  padding: 3px 7px;
  border-radius: 8px;
  font-size: 0.73rem;
  white-space: nowrap;
}

@media (min-width: 1180px) {
  body.view-spatial-active {
    height: 100vh;
    overflow: hidden;
  }

  body.view-spatial-active .app-shell {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }

  body.view-spatial-active .main-content {
    flex: 1;
    min-height: 0;
    max-width: 100%;
    padding: 8px 14px 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.view-spatial-active #view-spatial.active {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.view-spatial-active .spatial-layout {
    flex: 1;
    min-height: 0;
    height: 100%;
    --tree-panel-w: 440px;
    --right-panel-w: 320px;
    grid-template-columns: var(--tree-panel-w) 12px minmax(180px, 1fr) 12px var(--right-panel-w);
    align-items: stretch;
  }

  body.view-spatial-active .spatial-layout.tree-expanded {
    grid-template-columns: minmax(320px, 1fr) 12px var(--right-panel-w) !important;
  }

  body.view-spatial-active .spatial-layout.tree-expanded #treeResizeHandle,
  body.view-spatial-active .spatial-layout.tree-expanded .spatial-center {
    display: none !important;
  }

  /* People & Places 3-mode flexible layout (Information Portal on right stays ALWAYS visible!) */
  body.view-spatial-active .spatial-layout.layout-tree-only {
    grid-template-columns: minmax(320px, 1fr) 12px var(--right-panel-w) !important;
  }

  body.view-spatial-active .spatial-layout.layout-tree-only #treeResizeHandle,
  body.view-spatial-active .spatial-layout.layout-tree-only .spatial-center {
    display: none !important;
  }

  body.view-spatial-active .spatial-layout.layout-map-only {
    grid-template-columns: minmax(320px, 1fr) 12px var(--right-panel-w) !important;
  }

  body.view-spatial-active .spatial-layout.layout-map-only .spatial-left,
  body.view-spatial-active .spatial-layout.layout-map-only #treeResizeHandle {
    display: none !important;
  }

  body.view-spatial-active .spatial-layout.layout-none {
    grid-template-columns: 1fr !important;
  }

  body.view-spatial-active .spatial-layout.layout-none .spatial-left,
  body.view-spatial-active .spatial-layout.layout-none #treeResizeHandle,
  body.view-spatial-active .spatial-layout.layout-none .spatial-center,
  body.view-spatial-active .spatial-layout.layout-none #rightResizeHandle {
    display: none !important;
  }

  body.view-spatial-active .spatial-left,
  body.view-spatial-active .spatial-center,
  body.view-spatial-active .spatial-right {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  body.view-spatial-active .tree-resize-handle {
    min-height: 0;
    height: 100%;
  }

  body.view-spatial-active .live-tree-canvas {
    flex: 1;
    min-height: 0;
    height: auto;
  }

  body.view-spatial-active .canvas-toolbar {
    padding: 6px 12px;
    flex-shrink: 0;
  }

  body.view-spatial-active .mode-switch-btn {
    padding: 5px 11px;
    min-height: 32px;
    font-size: 0.8rem;
  }

  body.view-spatial-active #centerGooglePane,
  body.view-spatial-active #centerPicturePane,
  body.view-spatial-active #centerPlanPane {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  body.view-spatial-active .center-map-viewport,
  body.view-spatial-active .map-viewport {
    flex: 1;
    min-height: 0;
    height: 100%;
  }

  body.view-spatial-active .center-picture-pane {
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
  }

  body.view-spatial-active .spatial-right .panel-header {
    padding: 8px 12px;
    flex-shrink: 0;
  }

  body.view-spatial-active .spatial-right .panel-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 12px;
  }
}

@media (max-width: 1179px) {
  .global-timeline-bar .timeline-top-row {
    flex-wrap: wrap;
    gap: 6px;
  }
  .timeline-track-inline {
    order: 3;
    flex-basis: 100%;
  }
}

.decade-tick {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-faint);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.decade-tick.edge-left {
  transform: translateX(0);
}

.decade-tick.edge-right {
  transform: translateX(-100%);
}

.decade-tick:hover {
  color: var(--ink);
}

/* ==================== LIVE GRAPHICAL FAMILY TREE (LEFT PANEL) ==================== */
.live-tree-canvas {
  position: relative;
  height: 620px;
  background: radial-gradient(circle at 50% 30%, #ffffff 0%, #f1f5f9 100%);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.live-tree-canvas.panning {
  cursor: grabbing;
}

.live-tree-canvas.draw-line-mode {
  cursor: crosshair;
  box-shadow: inset 0 0 0 3px var(--accent);
}

.live-tree-stage {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  transform-origin: 0 0;
  min-width: 340px;
  min-height: 460px;
}

.live-tree-stage.animate-zoom {
  transition: transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes treeLineageReveal {
  0% {
    opacity: 0.18;
  }
  100% {
    opacity: 1;
  }
}

.live-tree-stage.lineage-reveal {
  animation: treeLineageReveal 0.34s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.tree-full-family-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 32;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--teal);
  color: #ffffff;
  border: 2.5px solid #ffffff;
  font-size: 0.94rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.28);
  transition: transform 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.tree-full-family-btn:hover {
  background: #0a524c;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.34);
}

/* Zoom-Synced Era Watermark Dates sitting cleanly in the BACKGROUND behind faces & lines */
.tree-decade-rail {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.tree-decade-rail.horizontal-mode {
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  width: auto;
  height: 36px;
  background: transparent;
}

.tree-decade-rail.horizontal-mode .tree-decade-pill {
  top: 15px;
  transform: translate(-50%, -50%);
}

/* ==================== 90° COUNTERCLOCKWISE HORIZONTAL PERSON CARDS & COLLAPSE TOGGLES ==================== */
.tree-node.horiz-card {
  width: 176px;
  height: 42px;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  padding: 3px 8px 3px 4px;
  border-radius: 999px;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.1);
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease, opacity 0.28s ease;
}

.tree-node.horiz-card:hover {
  border-color: var(--teal);
  box-shadow: 0 4px 12px rgba(13, 104, 97, 0.22);
  z-index: 16;
}

.tree-node.horiz-card.deceased {
  background: #faf9f6;
  border-color: #c4b5fd;
}

.tree-node.horiz-card.selected {
  border-color: var(--accent);
  background: #fff7ed;
  box-shadow: 0 0 0 3px rgba(200, 75, 40, 0.28), 0 5px 14px rgba(15, 23, 42, 0.18);
  z-index: 18;
}

.tree-node.horiz-card.lineage-node {
  border-color: #eab308;
  box-shadow: 0 0 0 2.5px rgba(234, 179, 8, 0.34);
}

.tree-node.horiz-card.parent-hl-node {
  border-color: #eab308;
  box-shadow: 0 0 0 3.5px rgba(234, 179, 8, 0.55);
  z-index: 19;
}

.tree-node.horiz-card.draw-source {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(200, 75, 40, 0.35);
}

.tree-node.horiz-card.draw-target {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(13, 104, 97, 0.35);
}

.tree-node.horiz-card .tree-node-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-width: 2px;
  font-size: 0.72rem;
  box-shadow: none;
  margin: 0;
}

.tree-node.horiz-card .horiz-card-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0px;
  line-height: 1.15;
}

.tree-node.horiz-card .horiz-card-name {
  font-size: 0.76rem;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-node.horiz-card .horiz-card-years {
  font-size: 0.66rem;
  font-weight: 700;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-node.horiz-card .tree-connect-handle {
  top: 50%;
  right: -10px;
  transform: translateY(-50%);
}

.tree-branch-toggle {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 14;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 20px;
  min-width: 20px;
  padding: 0 5px;
  border-radius: 999px;
  border: 1.5px solid #0d6861;
  background: #ffffff;
  color: #0d6861;
  font-size: 0.66rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.16);
  transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
}

.tree-branch-toggle:hover {
  background: #0d6861;
  color: #ffffff;
  transform: translate(-50%, -50%) scale(1.08);
}

.tree-branch-toggle.is-collapsed {
  background: #0d6861;
  color: #fde68a;
  border-color: #064e3b;
  padding: 0 7px;
}

.tree-full-family-btn.horiz-offset {
  top: 40px;
}

.tree-decade-pill {
  position: absolute;
  left: 10px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(15, 23, 42, 0.22);
  border: none;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: none;
  backdrop-filter: none;
  pointer-events: none;
}

.spatial-layout.tree-panel-focused .tree-decade-pill {
  left: 8px;
  padding: 0;
  font-size: 0.96rem;
}

/* Historical Biography, Countries of Residence & References Card in Individual Panel */
.person-countries-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.person-country-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  font-size: 0.76rem;
  font-weight: 800;
}

.person-bio-card {
  background: linear-gradient(180deg, #fffdf7 0%, #faf8f2 100%);
  border: 1.5px solid #e7dec8;
  border-left: 4px solid #b45309;
  border-radius: 12px;
  padding: 11px 13px;
  margin-bottom: 12px;
}

.person-bio-title {
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #92400e;
  margin-bottom: 5px;
}

.person-bio-text {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.56;
  color: #1e293b;
  white-space: pre-wrap;
}

.person-bio-refs {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed #d6cbb0;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #64748b;
}

.person-hist-homes {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.person-hist-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.person-hist-home-btn:hover {
  background: #f0fdfa;
  border-color: var(--teal);
  color: var(--teal);
}

.tree-zoom-hud {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid var(--border-strong);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
}

.tree-zoom-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.tree-zoom-btn:hover {
  background: var(--surface-subtle);
  border-color: var(--ink-faint);
}

.tree-zoom-pct {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--ink-soft);
  min-width: 38px;
  text-align: center;
}

.tree-portrait-mode-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.tree-pm-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.tree-pm-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
}

.tree-pm-btn.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.10);
}

.tree-bloodline-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}

.tree-bloodline-toggle input {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--teal);
  flex-shrink: 0;
}

.tree-node.radial-center {
  width: 82px;
  height: 82px;
  z-index: 14;
}

.tree-node.radial-center .tree-node-avatar {
  width: 80px;
  height: 80px;
  border-width: 3.5px;
  border-color: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft), 0 8px 20px rgba(15, 23, 42, 0.22);
}

.tree-node.radial-outer {
  width: 58px;
  height: 58px;
}

.tree-node.radial-outer .tree-node-avatar {
  width: 56px;
  height: 56px;
  font-size: 1rem;
}

.tree-node.radial-maternal .tree-node-avatar {
  border-color: rgba(13, 104, 97, 0.75);
}

.tree-node.radial-paternal .tree-node-avatar {
  border-color: rgba(200, 75, 40, 0.75);
}

.live-tree-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.live-tree-svg line.rel-line,
.live-tree-svg path.rel-line {
  pointer-events: stroke;
  cursor: pointer;
}

.tree-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  cursor: pointer;
  z-index: 4;
  transition: filter 0.45s ease, opacity 0.45s ease, transform 0.14s ease;
}

.tree-node:hover {
  z-index: 18;
}

.tree-node:active {
  cursor: grabbing;
}

.tree-node.selected {
  z-index: 12;
}

.tree-node.selected .tree-node-avatar {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 6px 16px rgba(15, 23, 42, 0.18);
}

/* Deceased people gracefully turn monochrome without letting background lines bleed through their faces */
.tree-node.deceased {
  z-index: 3;
}

.tree-node.deceased .tree-node-avatar {
  background: #eef2f6;
  border-color: #e2e8f0;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.14);
}

.tree-node.deceased .tree-node-avatar img {
  filter: grayscale(100%) contrast(0.95);
  opacity: 0.74;
  transition: opacity 0.18s ease, filter 0.18s ease;
}

.tree-node.deceased:hover,
.tree-node.deceased.parent-hl-node {
  z-index: 18;
}

.tree-node.deceased:hover .tree-node-avatar img,
.tree-node.deceased.parent-hl-node .tree-node-avatar img {
  opacity: 0.96;
}

/* Highlight both parent circles & connecting lines when hovering a child */
.tree-node.parent-hl-node {
  z-index: 16;
}

.tree-node.parent-hl-node .tree-node-avatar {
  border-color: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.34), 0 6px 16px rgba(15, 23, 42, 0.2);
}

.live-tree-svg .parent-link-hl {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.live-tree-svg .parent-link-hl.active {
  opacity: 1;
}

.live-tree-svg .radial-edge {
  transition: stroke 0.14s ease, stroke-width 0.14s ease, opacity 0.14s ease;
}

.live-tree-svg .radial-edge.hl-active,
.live-tree-svg .radial-edge.lineage-hl {
  stroke: #f59e0b !important;
  stroke-width: 4.2px !important;
  opacity: 1 !important;
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.45));
}

/* Full Ancestral Genealogy Highlight Back in History for Selected Person */
.live-tree-svg.has-lineage-hl .tree-family-branch {
  opacity: 0.24;
  transition: opacity 0.28s ease;
}

.live-tree-svg.has-lineage-hl.lineage-tracing .tree-family-branch {
  opacity: 0.42;
}

.live-tree-svg .parent-link-hl.lineage-hl {
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(250, 204, 21, 0.78));
}

.live-tree-svg .parent-link-hl.lineage-hl path,
.live-tree-svg .parent-link-hl.lineage-hl line {
  stroke: #eab308;
}

@keyframes lineagePathTrace {
  0% {
    opacity: 0;
  }
  40% {
    opacity: 1;
    filter: drop-shadow(0 0 9px rgba(250, 204, 21, 0.95));
  }
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 5px rgba(250, 204, 21, 0.78));
  }
}

.live-tree-svg.lineage-tracing .parent-link-hl.lineage-hl {
  opacity: 0;
  animation: lineagePathTrace 0.38s ease-out var(--trace-delay, 0ms) forwards;
}

.tree-node.lineage-node {
  z-index: 14;
}

.tree-node.lineage-node .tree-node-avatar {
  border-color: #facc15;
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.55), 0 0 14px rgba(234, 179, 8, 0.38);
}

@keyframes lineageNodeTrace {
  0% {
    border-color: #ffffff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
    transform: scale(1);
  }
  50% {
    border-color: #fde047;
    box-shadow: 0 0 0 7px rgba(250, 204, 21, 0.75), 0 0 22px rgba(234, 179, 8, 0.65);
    transform: scale(1.1);
  }
  100% {
    border-color: #facc15;
    box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.55), 0 0 14px rgba(234, 179, 8, 0.38);
    transform: scale(1);
  }
}

.tree-node.lineage-node.trace-pop .tree-node-avatar {
  border-color: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
  animation: lineageNodeTrace 0.44s cubic-bezier(0.22, 1, 0.36, 1) var(--trace-delay, 0ms) forwards;
}

.tree-node.deceased.lineage-node .tree-node-avatar img {
  opacity: 0.96;
}

.tree-node.lineage-dim {
  opacity: 0.52;
  transition: opacity 0.35s ease;
}

.live-tree-canvas.lineage-focused .tree-node.lineage-dim {
  opacity: 0.92;
}

.live-tree-canvas.lineage-focused .live-tree-svg.has-lineage-hl .tree-family-branch {
  opacity: 0.55;
}

/* Step 2: Graceful dissolve of unconnected relatives & lines before compacting */
.tree-node.lineage-fading-out {
  opacity: 0 !important;
  transform: translate(-50%, -50%) scale(0.66) !important;
  pointer-events: none;
  transition: opacity 0.52s cubic-bezier(0.4, 0, 0.2, 1), transform 0.52s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.live-tree-svg .lineage-fading-out {
  opacity: 0 !important;
  pointer-events: none;
  transition: opacity 0.48s ease !important;
}

.tree-node.lineage-dim:hover {
  opacity: 1;
  z-index: 20;
}

/* People not yet born in the selected timeline year softly disappear */
.tree-node.unborn {
  opacity: 0.13;
  filter: grayscale(100%);
  z-index: 1;
}

.tree-node.unborn:hover {
  opacity: 0.6;
  z-index: 18;
}

.tree-node.draw-target .tree-node-avatar {
  border-color: var(--teal);
  box-shadow: 0 0 0 5px var(--teal-soft);
  transform: scale(1.08);
}

.tree-node-avatar {
  position: relative;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
  background: var(--surface-subtle);
  overflow: hidden;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--ink-soft);
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.tree-node:hover .tree-node-avatar {
  transform: scale(1.06);
}

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

/* Picture-only at rest — crisp name pill appears ONLY on hover or draw target! */
.tree-node-name {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%) translateY(-3px);
  font-size: 0.84rem;
  font-weight: 800;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.92);
  padding: 4px 11px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 25;
}

.tree-node:hover .tree-node-name,
.tree-node.draw-target .tree-node-name,
.tree-node.draw-source .tree-node-name {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Very light grey birth year centered cleanly beneath each portrait (never collides between tight couples!) */
.tree-birth-year {
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: #b4becb;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  line-height: 1;
  transition: color 0.14s ease;
}

.tree-node:hover .tree-birth-year,
.tree-node.selected .tree-birth-year {
  color: #64748b;
}

.tree-connect-handle {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: 2px solid #fff;
  font-size: 13px;
  font-weight: 900;
  display: grid;
  place-items: center;
  cursor: crosshair;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 6;
}

.tree-node:hover .tree-connect-handle,
.live-tree-canvas.draw-line-mode .tree-connect-handle {
  opacity: 0.96;
}

.tree-connect-handle:hover {
  transform: scale(1.18);
}

.tree-draw-hint {
  padding: 8px 12px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 0.82rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(200, 75, 40, 0.22);
  text-align: center;
}

.tree-node.draw-source .tree-node-avatar {
  border-color: var(--accent);
  box-shadow: 0 0 0 6px rgba(200, 75, 40, 0.28), 0 6px 16px rgba(200, 75, 40, 0.3);
  transform: scale(1.08);
}

.live-tree-svg line.rel-line,
.live-tree-svg path.rel-line {
  transition: stroke-width 0.14s ease, opacity 0.14s ease;
}

.live-tree-svg line.rel-line:not([stroke="transparent"]):hover,
.live-tree-svg path.rel-line:not([stroke="transparent"]):hover {
  stroke-width: 5;
  opacity: 1;
}

.tree-quick-bar {
  padding: 12px 14px;
  background: linear-gradient(180deg, #fffaf8 0%, #f8fafc 100%);
  border-top: 1.5px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
}

.tree-quick-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.tree-quick-bar-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.qc-person-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 10px;
  max-height: 240px;
  overflow-y: auto;
  padding: 2px;
}

.qc-person-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: #ffffff;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.12s ease;
}

.qc-person-card:hover {
  border-color: var(--teal);
  background: #f0fdfa;
  transform: translateY(-1px);
}

.qc-person-card.connected {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.qc-person-card img,
.qc-person-card .qc-initial {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
}

.qc-person-card .qc-initial {
  display: grid;
  place-items: center;
  background: var(--surface-subtle);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.qc-person-card-name {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}

.qc-person-card-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: #0b4f4a;
}

.rel-section-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.rel-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.rel-chip-del {
  cursor: pointer;
  color: var(--ink-faint);
  font-weight: 900;
  padding-left: 2px;
}

.rel-chip-del:hover {
  color: #dc2626;
}

/* Center Stage Picture Viewer */
.center-picture-pane {
  padding: 18px;
  min-height: 580px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f8fafc;
  border-radius: 0 0 var(--radius) var(--radius);
}

.space-tree {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.space-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  min-height: 44px;
  border-radius: 11px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.space-item:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.space-item.active {
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 800;
}

.space-item .meta-pill {
  font-size: 0.78rem;
  background: rgba(15, 23, 42, 0.08);
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--ink);
}

/* Architectural Canvas */
.canvas-toolbar {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.canvas-filters {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: #f9fafb;
  font-size: 0.86rem;
}

.map-viewport {
  position: relative;
  height: 590px;
  overflow: hidden;
  background: #e9ecf0;
  user-select: none;
  cursor: grab;
  border-radius: 0 0 var(--radius) var(--radius);
}

.map-viewport.drop-mode {
  cursor: crosshair;
  box-shadow: inset 0 0 0 4px var(--accent);
}

.map-viewport.dragging {
  cursor: grabbing;
}

.map-stage {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

.map-image {
  display: block;
  max-width: none;
  pointer-events: none;
  box-shadow: 0 6px 26px rgba(15, 23, 42, 0.14);
}

.map-portal {
  position: absolute;
  transform: translate(-50%, -50%) scale(var(--inv-scale, 1));
  background: rgba(15, 23, 42, 0.90);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.28);
  z-index: 6;
}

.map-portal:hover {
  transform: translate(-50%, -50%) scale(calc(var(--inv-scale, 1) * 1.07));
  background: var(--teal);
  z-index: 15;
}

.map-pin {
  position: absolute;
  transform: translate(-37.5%, -87.5%) scale(var(--inv-scale, 1));
  transform-origin: 37.5% 87.5%;
  cursor: pointer;
  z-index: 10;
}

.map-pin:hover {
  transform: translate(-37.5%, -87.5%) scale(calc(var(--inv-scale, 1) * 1.1));
  z-index: 20;
}

.pin-bubble {
  width: 42px;
  height: 42px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.32);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.pin-bubble img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: rotate(45deg) scale(1.35);
}

.pin-bubble span {
  transform: rotate(45deg);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.pin-tooltip {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s ease;
}

.map-pin:hover .pin-tooltip {
  opacity: 1;
}

.drop-hint-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  z-index: 25;
  box-shadow: var(--shadow-lg);
}

/* ==================== CENTER GOOGLE MAPS HUB & ERA AERIAL STRIP ==================== */
.center-map-viewport {
  position: relative;
  height: 600px;
  background: #e5e7eb;
  border-radius: 0;
  overflow: hidden;
  isolation: isolate;
  z-index: 1;
}

#centerGoogleMap {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.era-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
}

.era-pill {
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-soft);
  padding: 6px 12px;
  min-height: 38px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

.era-pill:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.era-pill.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.era-pill.historical.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.mode-switch-bar {
  display: inline-flex;
  background: var(--surface-subtle);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
  gap: 4px;
}

.mode-switch-btn {
  border: none;
  background: transparent;
  padding: 7px 14px;
  min-height: 38px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--ink-soft);
  cursor: pointer;
}

.mode-switch-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

/* Fuzzy Name Suggestions Dropdown */
.fuzzy-suggest-box {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.fuzzy-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  border: 1px solid rgba(13, 104, 97, 0.35);
  color: #0b4f4a;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.fuzzy-pill:hover {
  background: var(--teal);
  color: #fff;
}

/* Generational Lineage Block in Family Tree */
.lineage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.lineage-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lineage-parents {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-strong);
  font-size: 0.82rem;
}

.lineage-children {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px dashed var(--border-strong);
  font-size: 0.82rem;
}

/* Photos & Archive */
.archive-layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 920px) {
  .archive-layout {
    grid-template-columns: 1fr;
  }
}

.folder-list {
  max-height: 620px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.folder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  min-height: 42px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.folder-row:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.folder-row.active {
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 800;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.media-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  display: flex;
  flex-direction: column;
  content-visibility: auto;
  contain-intrinsic-size: 220px 330px;
}

.media-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
}

.media-thumb-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #e9ecf0;
  overflow: hidden;
}

.media-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-tag-corner {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 7px;
}

.media-face-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(13, 104, 97, 0.94);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
}

.media-card-body {
  padding: 10px 12px;
  font-size: 0.84rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.media-filename {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dropzone */
.dropzone {
  border: 2.5px dashed var(--border-strong);
  border-radius: 16px;
  padding: 30px 20px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Family Tree & People */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}

.person-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.person-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.person-card.memorial {
  border-color: rgba(76, 63, 110, 0.28);
  background: linear-gradient(180deg, #ffffff 0%, #faf8fd 100%);
}

.face-avatar {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-subtle);
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--ink-soft);
}

.face-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border);
}

.tree-canvas-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 18px;
}

.rel-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.rel-card.delicate {
  background: #faf8fd;
  border-style: dashed;
  border-color: rgba(76, 63, 110, 0.35);
}

/* Crowdsourcing & AI Cards */
.cluster-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bridge-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--teal-soft);
  border: 1.5px solid rgba(13, 104, 97, 0.28);
  font-size: 0.88rem;
  color: #0f4c46;
}

.ai-draft-box {
  background: #f8fafc;
  border: 1.5px solid rgba(13, 104, 97, 0.25);
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 14px;
}

.face-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.face-crop-tile {
  width: 82px;
  height: 82px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
}

.face-crop-tile:hover {
  border-color: var(--accent);
}

/* Chips */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--surface-subtle);
  color: var(--ink);
  border: 1px solid var(--border);
}

.chip-click {
  cursor: pointer;
}

.chip-click:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
}

.chip-teal {
  background: var(--teal-soft);
  border-color: rgba(13, 104, 97, 0.28);
  color: #0b4f4a;
}

.chip-gold {
  background: var(--amber-soft);
  border-color: rgba(154, 71, 8, 0.28);
  color: var(--amber);
}

.chip-memorial {
  background: var(--memorial-soft);
  border-color: rgba(76, 63, 110, 0.28);
  color: var(--memorial);
}

/* Memory Web */
.graph-wrap {
  position: relative;
  height: 620px;
  background: radial-gradient(circle at center, #ffffff 0%, #eef1f5 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

#graphCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.graph-legend {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  display: flex;
  gap: 14px;
  font-size: 0.82rem;
  font-weight: 700;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  max-width: 1020px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-sm {
  max-width: 560px;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
}

/* Lightbox Photo + Zoom Viewport + Non-Blocking Face Boxes */
.photo-quick-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 7px 10px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1.5px solid var(--border);
}

.photo-quick-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.photo-zoom-pct {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ink);
  min-width: 44px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.photo-date-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  padding: 2px 6px 2px 8px;
}

.photo-date-inline input {
  width: 68px;
  border: none;
  outline: none;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--ink);
  background: transparent;
  font-variant-numeric: tabular-nums;
  padding: 3px 2px;
}

.photo-zoom-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  max-height: 58vh;
  padding: 10px 10px 24px;
  user-select: none;
  touch-action: none;
  margin-bottom: 12px;
}

.photo-zoom-viewport.is-zoomed {
  cursor: grab;
}

.photo-zoom-viewport.is-zoomed.is-panning {
  cursor: grabbing;
}

.lightbox-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  background: #0f172a;
  border-radius: 10px;
  overflow: visible;
  transform-origin: center center;
  transition: transform 0.14s ease-out;
  --photo-zoom: 1;
}

.photo-zoom-viewport.is-panning .lightbox-stage {
  transition: none;
}

.lightbox-stage img, .lightbox-stage video {
  display: block;
  max-width: 100%;
  max-height: 53vh;
  border-radius: 10px;
  pointer-events: none;
  user-select: none;
}

.lightbox-stage video {
  pointer-events: auto;
}

/* Sleek, thin, non-blocking face outline (never obscures eyes/nose/mouth!) */
.face-box {
  position: absolute;
  border: calc(1.75px / var(--photo-zoom, 1)) solid rgba(245, 158, 11, 0.85);
  border-radius: calc(6px / var(--photo-zoom, 1));
  background: transparent;
  cursor: pointer;
  box-shadow: 0 0 0 calc(1px / var(--photo-zoom, 1)) rgba(0, 0, 0, 0.35);
  z-index: 4;
  transition: opacity 0.16s ease, border-color 0.14s ease;
}

.face-box.identified {
  border-color: rgba(20, 184, 166, 0.82);
}

.face-box.ai-guess {
  border-style: dashed;
  border-color: rgba(56, 189, 248, 0.88);
}

/* When hovering one face box, softly fade all other boxes & labels so adjacent faces are 100% unobstructed */
.lightbox-stage.face-hover-active .face-box:not(:hover) {
  opacity: 0.15;
}

.lightbox-stage.hide-face-boxes .face-box {
  opacity: 0 !important;
  pointer-events: none !important;
}

.face-box:hover {
  border-color: #ffffff;
  border-width: calc(2.2px / var(--photo-zoom, 1));
  opacity: 1 !important;
  z-index: 16;
}

/* Labels appear cleanly on hover (or for the active focused face) so crowded group photos are NEVER blocked! */
.lightbox-stage:not(.show-all-face-labels) .face-box:not(:hover):not(.face-focused) .face-box-label {
  opacity: 0;
  pointer-events: none;
}

.face-box.face-focused {
  border-color: #fde047 !important;
  border-width: calc(2.4px / var(--photo-zoom, 1));
  z-index: 15;
}

.face-box-label {
  position: absolute;
  top: calc(100% + calc(3px / var(--photo-zoom, 1)));
  left: 50%;
  transform: translateX(-50%) scale(calc(1 / var(--photo-zoom, 1)));
  transform-origin: top center;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(2px);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  z-index: 6;
  transition: background 0.14s ease, opacity 0.15s ease;
}

.face-box:hover .face-box-label {
  background: rgba(15, 23, 42, 0.95);
  z-index: 18;
}

.face-box-label .face-fb-btn {
  display: none;
}

.face-box:hover .face-box-label .face-fb-btn,
.face-box.ai-guess .face-box-label .face-fb-btn {
  display: inline-grid;
}

/* Compact inline year edit row on Vet All Faces cards */
.vet-year-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
}

.vet-year-input {
  width: 68px;
  min-height: 28px;
  padding: 2px 6px;
  border-radius: 7px;
  border: 1.5px solid var(--border-strong);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink);
  background: #ffffff;
  font-variant-numeric: tabular-nums;
}

.vet-year-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(13, 104, 97, 0.16);
}

.face-fb-btn {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: none;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.face-fb-btn:hover {
  transform: scale(1.16);
  filter: brightness(1.08);
}

.face-fb-btn.ok {
  background: #10b981;
  color: #ffffff;
}

.face-fb-btn.no {
  background: #ef4444;
  color: #ffffff;
}

.face-confirmed-mark {
  color: #34d399;
  font-weight: 900;
  margin-left: 2px;
}

/* Universal Type-to-Search Quick Person Picker */
.pqs-wrap {
  position: relative;
  width: 100%;
}

.pqs-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  max-height: 250px;
  overflow-y: auto;
  z-index: 260;
  padding: 4px;
}

.pqs-dropdown.hidden {
  display: none;
}

.pqs-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--ink);
  transition: background 0.1s ease;
}

.pqs-item:hover,
.pqs-item.active {
  background: var(--teal-soft);
}

.pqs-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.pqs-sub {
  font-size: 0.74rem;
  color: var(--ink-faint);
}

.dup-name-warn {
  margin-top: 5px;
  padding: 7px 10px;
  border-radius: 9px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.manual-draw-rect {
  position: absolute;
  border: 3px dashed #fb7185;
  background: rgba(251, 113, 133, 0.2);
  pointer-events: none;
}

/* Grids & Utilities */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 820px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.muted {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.faint {
  color: var(--ink-faint);
  font-size: 0.82rem;
}

.empty-state {
  text-align: center;
  padding: 40px 22px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: #0f172a;
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  z-index: 220;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.activity-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-box {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}

.stat-val {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--ink);
}

.stat-lbl {
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-weight: 700;
}

/* ==================== HELP OUT CLUSTER 1-CLICK SPLIT / UNGROUP ==================== */
.cluster-face-wrap {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.cluster-face-split-btn {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.28);
  transition: background 0.14s ease, transform 0.14s ease;
  z-index: 3;
}

.cluster-face-split-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.crowd-vet-bar {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 100%);
  border: 1.5px solid rgba(13, 104, 97, 0.24);
}

/* ==================== PERSON FACE VETTING GALLERY MODAL ==================== */
#mediaLightboxModal {
  z-index: 160;
}

.modal-vet {
  max-width: 1120px;
  width: 96vw;
  max-height: 90vh;
}

.vet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.vet-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.vet-tab {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.14s ease;
}

.vet-tab:hover {
  border-color: var(--teal);
  color: var(--ink);
}

.vet-tab.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.vet-faces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(242px, 1fr));
  gap: 12px;
  max-height: 58vh;
  overflow-y: auto;
  padding: 2px 4px 8px 2px;
}

.vet-face-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, opacity 0.16s ease;
}

.vet-face-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.vet-face-card.bucket-ai_guess {
  border-color: rgba(217, 119, 6, 0.42);
}

.vet-face-card.bucket-confirmed {
  border-color: rgba(13, 104, 97, 0.32);
}

.vet-face-visuals {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 2px;
  background: #e2e8f0;
  height: 112px;
  cursor: pointer;
}

.vet-face-crop,
.vet-face-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vet-face-meta {
  padding: 9px 11px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.vet-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.vet-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.vet-status-pill.confirmed {
  background: var(--teal-soft);
  color: #0b4f4a;
}

.vet-status-pill.ai_guess {
  background: #fef3c7;
  color: #92400e;
}

.vet-status-pill.suggestion {
  background: #ede9fe;
  color: #5b21b6;
}

.vet-face-actions {
  display: flex;
  gap: 6px;
  padding: 8px 11px 10px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
}

.vet-face-actions .btn {
  flex: 1;
  min-height: 34px;
  padding: 5px 8px;
  font-size: 0.8rem;
}

/* ==================== CLICKABLE HEARTS, HOMES, TOP-TIMELINE ASSET PINS & VIEWERS ==================== */
.tree-couple-badge.clickable {
  cursor: pointer;
  pointer-events: auto;
}

.tree-couple-badge.clickable:hover circle {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(1.18);
  filter: drop-shadow(0 2px 6px rgba(200, 75, 40, 0.42));
}

.timeline-asset-markers {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 31px;
  height: 11px;
  pointer-events: none;
  z-index: 4;
}

.timeline-asset-dot {
  position: absolute;
  top: 1px;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  transform: translateX(-50%) rotate(45deg);
  background: #f59e0b;
  border: 1.5px solid #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.35);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.12s ease;
}

.timeline-asset-dot:hover {
  transform: translateX(-50%) rotate(45deg) scale(1.45);
  z-index: 8;
}

.timeline-asset-dot.type-music { background: #7c3aed; }
.timeline-asset-dot.type-vehicle { background: #dc2626; }
.timeline-asset-dot.type-map_overlay { background: #0d9488; }
.timeline-asset-dot.type-house_plan { background: #2563eb; }
.timeline-asset-dot.type-audio { background: #9333ea; }
.timeline-asset-dot.type-link { background: #0284c7; }

.map-pick-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  background: #0f172a;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.35);
}

.map-overlay-hud {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  background: rgba(255, 255, 255, 0.96);
  border: 1.5px solid var(--teal);
  border-radius: 999px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
}

.map-icon-pin {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid #0d6861;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.32);
  display: grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
}

.map-icon-pin.home-pin {
  border-color: #c84b28;
  background: #fff7f5;
  transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
}

.map-home-stack:hover .map-icon-pin.home-pin {
  transform: scale(1.12);
}

.map-icon-pin.home-pin.is-former {
  background: #e2e8f0;
  border-color: #64748b;
  filter: grayscale(1);
  opacity: 0.78;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.34);
  width: 27px;
  height: 27px;
  font-size: 13px;
}

.map-home-stack:hover .map-icon-pin.home-pin.is-former {
  opacity: 1;
  background: #f1f5f9;
  border-color: #475569;
}

.map-icon-pin.home-pin.is-selected-house {
  border-color: #0d6861 !important;
  box-shadow: 0 0 0 4px rgba(13, 104, 97, 0.35), 0 4px 14px rgba(15, 23, 42, 0.4) !important;
  opacity: 1 !important;
  transform: scale(1.15);
}

.map-home-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

.map-home-couple-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 3px 8px rgba(15, 23, 42, 0.35));
}

.map-home-av {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  background: #f1f5f9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink-soft);
  flex-shrink: 0;
  position: relative;
}

/* Override Leaflet's `.leaflet-container img { max-width: none !important; }` */
.leaflet-container .map-home-av img,
.map-home-av img {
  width: 42px !important;
  height: 42px !important;
  max-width: 42px !important;
  max-height: 42px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  object-fit: cover !important;
  object-position: center 20% !important;
  display: block !important;
}

.map-home-heart {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #c84b28;
  color: #c84b28;
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 -5px;
  z-index: 2;
  position: relative;
  line-height: 1;
}

.map-icon-pin.asset-pin {
  border-color: #7c3aed;
  background: #f5f3ff;
}

/* Right Panel Home & Assets Cards */
.person-home-card {
  background: linear-gradient(135deg, #fffaf8 0%, #f0fdfa 100%);
  border: 1.5px solid rgba(13, 104, 97, 0.26);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.person-home-card.is-unset {
  background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%);
  border-color: rgba(217, 119, 6, 0.42);
}

.person-home-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 8px 0;
}

.person-home-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  font-size: 0.78rem;
}

.person-home-row.active-home {
  border-color: var(--teal);
  background: #ffffff;
}

.person-inline-home-form {
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1.5px solid var(--teal);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.person-inline-home-form .input,
.person-inline-home-form .select {
  min-height: 34px;
  padding: 5px 9px;
  font-size: 0.82rem;
}

.person-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 6px;
}

.person-memories-box {
  min-height: 76px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.person-memory-item {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
}

.person-memory-form {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1.5px solid var(--teal);
  margin-bottom: 8px;
}

.person-assets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.person-asset-tile {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  display: flex;
  flex-direction: column;
}

.person-asset-tile:hover {
  transform: translateY(-1px);
  border-color: var(--teal);
  box-shadow: var(--shadow-sm);
}

.person-asset-tile.active-era {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(200, 75, 40, 0.14);
}

.person-asset-thumb {
  height: 70px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  display: grid;
  place-items: center;
  font-size: 1.85rem;
  position: relative;
  overflow: hidden;
}

.person-asset-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.person-asset-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
}

.person-asset-info {
  padding: 6px 8px 8px;
}

.person-asset-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Asset Type Picker */
.asset-type-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.atp-btn {
  padding: 8px 6px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.12s ease;
}

.atp-btn:hover {
  border-color: var(--teal);
  color: var(--ink);
}

.atp-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
}

/* Graphical Vehicle Timeline Viewer */
.vehicle-timeline-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 16px 6px 12px;
  position: relative;
}

.vehicle-timeline-strip::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 29px;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--accent));
  border-radius: 999px;
  z-index: 0;
}

.vt-card {
  position: relative;
  z-index: 1;
  width: 210px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.vt-year-pill {
  background: var(--ink);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.22);
}

.vt-card.selected .vt-year-pill {
  background: var(--accent);
}

.vt-box {
  width: 100%;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.14s ease;
}

.vt-card.selected .vt-box {
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(200, 75, 40, 0.18);
}

.vt-box img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

/* Graphical Lifetime Car Timeline (Oldest Top -> Newest Bottom, Overlapping Cars, 10–20+ Editable Cells) */
.car-gantt-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.car-gantt-header {
  display: grid;
  grid-template-columns: 230px 1fr 94px;
  gap: 10px;
  align-items: end;
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 8px;
}

.car-gantt-axis {
  position: relative;
  height: 22px;
}

.car-gantt-tick {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink-soft);
  white-space: nowrap;
}

.car-gantt-tick.edge-left {
  transform: translateX(0);
}

.car-gantt-tick.edge-right {
  transform: translateX(-100%);
}

.car-gantt-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.car-gantt-row {
  display: grid;
  grid-template-columns: 230px 1fr 94px;
  gap: 10px;
  align-items: center;
  padding: 5px 6px;
  border-radius: 10px;
  transition: background 0.12s ease;
  cursor: pointer;
}

.car-gantt-row:hover,
.car-gantt-row.highlighted {
  background: #f1f5f9;
}

.car-gantt-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.car-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(15, 23, 42, 0.25);
  flex-shrink: 0;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.45);
}

.car-gantt-track {
  position: relative;
  height: 34px;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.car-gantt-gridline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(148, 163, 184, 0.28);
  pointer-events: none;
}

.car-gantt-bar {
  position: absolute;
  top: 3px;
  bottom: 3px;
  min-width: 28px;
  border-radius: 7px;
  border: 1.5px solid rgba(15, 23, 42, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 8px;
  font-size: 0.74rem;
  font-weight: 800;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.car-gantt-bar-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.car-gantt-thumb-wrap {
  width: 90px;
  height: 50px;
  border-radius: 9px;
  border: 1.5px solid var(--border-strong);
  background: #0f172a;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.car-gantt-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.car-table-wrap {
  overflow-x: auto;
}

.car-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 5px;
  font-size: 0.82rem;
}

.car-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding: 4px 6px;
}

.car-table td {
  background: #ffffff;
  padding: 5px 6px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.car-table tr td:first-child {
  border-left: 1px solid var(--border);
  border-radius: 9px 0 0 9px;
  text-align: center;
  font-weight: 800;
  color: var(--ink-soft);
  width: 34px;
}

.car-table tr td:last-child {
  border-right: 1px solid var(--border);
  border-radius: 0 9px 9px 0;
}

.car-table tr.is-saved td {
  background: #f0fdfa;
  border-color: rgba(13, 104, 97, 0.25);
}

.car-table .input {
  min-height: 34px;
  padding: 4px 8px;
  font-size: 0.82rem;
  border-radius: 8px;
}

.car-color-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.car-photo-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.car-mini-thumb {
  width: 72px;
  height: 40px;
  border-radius: 8px;
  border: 1.5px solid var(--border-strong);
  background: #0f172a;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.car-mini-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Selected Car Marketing Materials Showcase */
.car-mkt-panel {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border: 1.5px solid #334155;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
}

.car-mkt-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.car-mkt-summary {
  font-size: 0.83rem;
  line-height: 1.52;
  color: #cbd5e1;
  margin: 6px 0 10px;
}

.car-mkt-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.car-mkt-links a {
  background: rgba(255, 255, 255, 0.11);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.14s ease;
}

.car-mkt-links a:hover {
  background: rgba(255, 255, 255, 0.22);
}

.car-mkt-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin: 10px 0 7px;
}

.car-mkt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
}

.car-mkt-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.car-mkt-thumb {
  position: relative;
  height: 112px;
  background: #020617;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.car-mkt-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.car-mkt-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(15, 23, 42, 0.85);
  color: #fde68a;
  font-size: 0.66rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(253, 230, 138, 0.35);
}

.car-mkt-card-body {
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.car-mkt-card-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: #f1f5f9;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.car-mkt-card-actions {
  display: flex;
  gap: 5px;
  margin-top: auto;
}

.car-mkt-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  padding: 3px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.car-mkt-btn:hover {
  background: rgba(20, 184, 166, 0.35);
  border-color: #14b8a6;
}

/* Interactive House Plan & Pin Stage inside Asset Viewer */
.plan-viewer-split {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 14px;
  align-items: start;
}

@media (max-width: 820px) {
  .plan-viewer-split {
    grid-template-columns: 1fr;
  }
}

.plan-pin-stage {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: #0f172a;
  user-select: none;
}

.plan-pin-stage.dropping {
  cursor: crosshair;
  border-color: var(--accent);
}

.plan-pin-stage img {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  display: block;
}

.plan-pin-marker {
  position: absolute;
  transform: translate(-37.5%, -87.5%);
  transform-origin: 37.5% 87.5%;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  display: block;
  cursor: pointer;
  transition: transform 0.14s ease;
  z-index: 4;
}

.plan-pin-marker:hover,
.plan-pin-marker.active {
  transform: translate(-37.5%, -87.5%) scale(1.12);
  background: transparent;
  z-index: 8;
}

#addAssetPinModal {
  z-index: 170;
}

/* Rich Music Player Card */
.music-player-hero {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: center;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 55%, #0f766e 100%);
  color: #ffffff;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
}

@media (max-width: 680px) {
  .music-player-hero {
    grid-template-columns: 1fr;
  }
}

.music-cover-art {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  font-size: 3.5rem;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

/* ==================== GEO-BASED 3D MAP PUSH PINS (WITH GROUND SHADOW) ==================== */
.map-pushpin-icon {
  background: transparent !important;
  border: none !important;
}

.map-pushpin-icon.is-dimmed .map-pushpin-wrap {
  opacity: 0.44;
  transition: opacity 0.16s ease;
}

.map-pushpin-icon.is-dimmed:hover .map-pushpin-wrap {
  opacity: 1;
}

.map-pushpin-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  cursor: pointer;
  overflow: visible;
}

.map-pushpin-wrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  display: block;
}

.map-pushpin-wrap.is-former-pin {
  opacity: 0.78;
  transition: opacity 0.16s ease;
}

.map-home-stack:hover .map-pushpin-wrap.is-former-pin,
.map-pushpin-wrap.is-former-pin:hover {
  opacity: 1;
}

.map-pushpin-body {
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: 37.5% 87.5%;
}

.map-pushpin-shadow {
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform-origin: 37.5% 87.5%;
}

.map-pushpin-wrap:hover .map-pushpin-body,
.map-pushpin-wrap.active .map-pushpin-body,
.map-home-stack:hover .map-pushpin-body {
  transform: translateY(-3px) scale(1.09);
}

.map-pushpin-wrap:hover .map-pushpin-shadow,
.map-pushpin-wrap.active .map-pushpin-shadow,
.map-home-stack:hover .map-pushpin-shadow {
  opacity: 0.72;
  transform: translate(2px, 1px) scale(1.1);
}

.map-pushpin-pulse {
  fill: none;
  stroke-width: 2.2;
  opacity: 0;
  transform-origin: 37.5% 87.5%;
}

.map-pushpin-wrap.active .map-pushpin-pulse {
  opacity: 0.9;
  animation: pushpinPulse 1.8s ease-out infinite;
}

.map-pushpin-thumb {
  position: absolute;
  left: 33px;
  top: 4px;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  overflow: hidden;
  background: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.45);
  transform: rotate(3deg);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease;
  pointer-events: auto;
}

.map-pushpin-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.map-pushpin-wrap:hover .map-pushpin-thumb,
.map-pushpin-wrap.active .map-pushpin-thumb {
  transform: translateY(-2px) scale(1.36) rotate(0deg);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.55);
  z-index: 6;
}

@keyframes pushpinPulse {
  0% {
    r: 4;
    opacity: 0.95;
  }
  100% {
    r: 14;
    opacity: 0;
  }
}

/* ==================== MULTIMEDIA MEMORY VIEWER & COMPOSER (RIGHT PANEL) ==================== */
.mem-viewer-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mem-viewer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mem-viewer-hero {
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1.5px solid var(--border);
  border-left: 5px solid var(--pin-accent, var(--accent));
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.06);
}

.mem-viewer-title {
  font-size: 1.08rem;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 6px;
}

.mem-viewer-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.mem-person-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 4px;
  border-radius: 999px;
  background: #ffffff;
  border: 1.5px solid var(--border-strong);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
}

.mem-person-pill:hover {
  border-color: var(--teal);
  background: #f0fdfa;
}

.mem-person-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.25);
}

.mem-media-stage {
  border-radius: 14px;
  overflow: hidden;
  background: #0f172a;
  border: 1.5px solid var(--border-strong);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
}

.mem-yt-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.mem-yt-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.mem-video-el {
  width: 100%;
  max-height: 300px;
  display: block;
  background: #000000;
}

.mem-photo-img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
  background: #0f172a;
  cursor: pointer;
}

.mem-audio-card {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1.5px solid rgba(217, 119, 6, 0.35);
  border-radius: 14px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mem-audio-card audio {
  width: 100%;
  height: 38px;
}

.mem-story-box {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 13px 15px;
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
}

.mem-composer-card {
  background: #ffffff;
  border: 1.5px solid var(--border-strong);
  border-radius: 14px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.pin-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.pin-swatch-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.28);
  cursor: pointer;
  padding: 0;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.pin-swatch-btn:hover {
  transform: scale(1.14);
}

.pin-swatch-btn.active {
  box-shadow: 0 0 0 2.5px #0f172a, 0 2px 8px rgba(15, 23, 42, 0.35);
  transform: scale(1.16);
}

.mem-media-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: var(--surface-subtle);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.mem-media-tab {
  border: none;
  background: transparent;
  border-radius: 7px;
  padding: 5px 4px;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--ink-soft);
  cursor: pointer;
}

.mem-media-tab.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.person-memory-item.clickable {
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.person-memory-item.clickable:hover {
  border-color: var(--teal);
  background: #f0fdfa;
}

/* ==================== ERA HISTORICAL COUNTRY LABELS & LIFE JOURNEY MAP ==================== */
.hist-country-label-wrap {
  background: transparent !important;
  border: none !important;
  pointer-events: none !important;
}

.hist-country-label {
  display: inline-block;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #fef3c7;
  text-shadow:
    0 1px 4px rgba(15, 23, 42, 0.98),
    0 0 8px rgba(15, 23, 42, 0.92),
    1px 1px 0 rgba(15, 23, 42, 0.95),
    -1px -1px 0 rgba(15, 23, 42, 0.95);
  padding: 1px 5px;
  border-radius: 4px;
  pointer-events: none;
  user-select: none;
}

.hist-country-label.major {
  font-size: 0.92rem;
  letter-spacing: 0.14em;
  color: #fde68a;
}

.hist-country-label.road-mode {
  color: #78350f;
  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.98),
    0 0 3px rgba(255, 255, 255, 0.98),
    1px 1px 0 rgba(255, 255, 255, 0.95),
    -1px -1px 0 rgba(255, 255, 255, 0.95);
}

.journey-stop-wrap {
  background: transparent !important;
  border: none !important;
}

.journey-stop-pin {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transform: translate(-15px, -35px);
  pointer-events: auto;
  cursor: pointer;
}

.journey-stop-steelpin {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: block;
}

.journey-stop-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 900;
  color: #ffffff;
  border: 2.5px solid #ffffff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.5);
  flex-shrink: 0;
}

.journey-stop-pin.kind-born .journey-stop-dot {
  background: linear-gradient(135deg, #10b981, #047857);
}

.journey-stop-pin.kind-moved .journey-stop-dot {
  background: linear-gradient(135deg, #f59e0b, #c2410c);
}

.journey-stop-pin.kind-died .journey-stop-dot {
  background: linear-gradient(135deg, #7c3aed, #4c1d95);
}

.journey-stop-callout {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 9px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.42);
  white-space: nowrap;
  max-width: 230px;
  backdrop-filter: blur(4px);
}

.journey-stop-pin.kind-born .journey-stop-callout {
  border-color: rgba(52, 211, 153, 0.78);
}

.journey-stop-pin.kind-moved .journey-stop-callout {
  border-color: rgba(251, 191, 36, 0.75);
}

.journey-stop-pin.kind-died .journey-stop-callout {
  border-color: rgba(196, 181, 253, 0.85);
}

.journey-stop-pin.callout-left {
  flex-direction: row-reverse;
  transform: translate(calc(-100% + 25px), -35px);
}

.journey-stop-pin.callout-compact .journey-stop-callout {
  display: none;
}

.journey-stop-head {
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1.2;
  color: #fde68a;
  overflow: hidden;
  text-overflow: ellipsis;
}

.journey-stop-pin.kind-born .journey-stop-head {
  color: #6ee7b7;
}

.journey-stop-pin.kind-died .journey-stop-head {
  color: #ddd6fe;
}

.journey-stop-sub {
  font-size: 0.69rem;
  font-weight: 700;
  line-height: 1.2;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.journey-stop-died-tag {
  margin-top: 2px;
  font-size: 0.69rem;
  font-weight: 900;
  color: #ddd6fe;
  background: rgba(109, 40, 217, 0.38);
  border-radius: 5px;
  padding: 1px 5px;
  align-self: flex-start;
}

.journey-arrow-wrap {
  background: transparent !important;
  border: none !important;
  pointer-events: none !important;
}

.journey-arrow-glyph {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.08rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 3px #020617, 0 0 6px #020617, 0 1px 4px rgba(2, 6, 23, 0.98);
  transform-origin: center center;
}

.map-journey-banner {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 520;
  display: flex;
  align-items: center;
  gap: 5px 6px;
  flex-wrap: wrap;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  border: 1.5px solid rgba(251, 191, 36, 0.45);
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(6px);
  font-size: 0.75rem;
}

.map-journey-banner.hidden {
  display: none !important;
}

.map-journey-step-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  font-size: 0.73rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.map-journey-step-btn:hover {
  background: rgba(251, 191, 36, 0.24);
  border-color: #fbbf24;
}

.map-journey-step-btn.kind-born {
  border-color: rgba(52, 211, 153, 0.65);
  color: #a7f3d0;
}

.map-journey-step-btn.kind-died {
  border-color: rgba(196, 181, 253, 0.72);
  color: #e9d5ff;
}

.map-journey-arrow-sep {
  color: #fbbf24;
  font-weight: 900;
  flex-shrink: 0;
}

/* ==================== CLEAN INDIVIDUAL PAGE & FREESTANDING LIFE ASSETS WINDOW ==================== */
.person-milestones-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.person-milestone-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 0.82rem;
  line-height: 1.35;
}

.person-milestone-year {
  font-weight: 900;
  color: var(--teal);
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  flex-shrink: 0;
}

.person-timeline-photos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  max-height: 290px;
  overflow-y: auto;
  padding-right: 2px;
}

.ptp-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 9px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  cursor: pointer;
  background: #0f172a;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.ptp-card:hover {
  transform: translateY(-1px);
  border-color: var(--teal);
}

.ptp-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ptp-badge {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.82);
  color: #fde68a;
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.person-memories-scroll {
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ap-houses-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1.5px solid var(--border);
}

.ap-house-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid var(--border);
  font-size: 0.84rem;
}

.ap-house-row.married-home {
  border-left: 4px solid var(--accent);
}

.ap-house-row.solo-home {
  border-left: 4px solid var(--teal);
}

.life-assets-cars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.life-asset-car-card {
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  border: 1.5px solid var(--border);
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.life-asset-car-card:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
}

.life-asset-car-photo {
  position: relative;
  height: 158px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6px;
}

.life-asset-car-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.life-asset-car-year-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.86);
  color: #fde68a;
  border: 1px solid rgba(253, 230, 138, 0.5);
  font-size: 0.76rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.life-asset-car-span-pill {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(13, 104, 97, 0.9);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.life-asset-car-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.life-asset-car-title {
  font-weight: 900;
  font-size: 0.94rem;
  color: var(--ink);
}

.life-asset-car-sub {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* Miniature white-background side-profile car fleet strip directly below Life Assets button */
.person-mini-cars-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 7px;
  padding: 6px 9px;
  margin-bottom: 11px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.person-mini-cars-strip:hover {
  border-color: var(--teal);
  box-shadow: 0 2px 8px rgba(13, 104, 97, 0.12);
}

.mini-car-profile-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 2px 3px;
  border-radius: 6px;
  background: #ffffff;
}

.mini-car-profile-img {
  width: 68px;
  height: 31px;
  object-fit: contain;
  display: block;
  background: #ffffff;
}

.mini-car-profile-svg {
  width: 64px;
  height: 26px;
  display: block;
}

.mini-car-profile-yr {
  font-size: 0.6rem;
  font-weight: 800;
  color: #64748b;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ==================== EXTENSIBLE UNDER-TIMELINE STAGE (CARS & FUTURE TRACKS) ==================== */
.timeline-under-stage {
  position: relative;
  margin: 7px 8px 2px;
  min-height: 28px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.timeline-under-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(200, 75, 40, 0.72);
  pointer-events: none;
  z-index: 8;
  transform: translateX(-50%);
}

.timeline-under-lane {
  position: relative;
  width: 100%;
  min-height: 34px;
}

.timeline-under-empty {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  pointer-events: none;
  user-select: none;
}

.timeline-car-span {
  position: absolute;
  height: 4px;
  border-radius: 999px;
  background: rgba(13, 104, 97, 0.28);
  pointer-events: none;
  z-index: 2;
}

.timeline-car-span.active-year {
  background: var(--accent);
}

.timeline-car-item {
  position: absolute;
  transform: translateX(-50%);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 3px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.timeline-car-item:hover {
  transform: translateX(-50%) scale(1.22);
  border-color: var(--teal);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.18);
  z-index: 12;
}

.timeline-car-item.active-year {
  border-color: rgba(200, 75, 40, 0.78);
  box-shadow: 0 0 0 2px rgba(200, 75, 40, 0.22);
  z-index: 7;
}

.timeline-car-item img {
  width: 58px;
  height: 24px;
  object-fit: contain;
  display: block;
  background: #ffffff;
}

.timeline-car-item svg {
  width: 52px;
  height: 21px;
  display: block;
}

/* ==================== DEDICATED HOUSE ENTITY PAGE ==================== */
.house-page-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.house-page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.house-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1.5px solid transparent;
}

.house-status-pill.occupied {
  background: #ecfdf5;
  color: #065f46;
  border-color: #6ee7b7;
}

.house-status-pill.former {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

.house-status-pill.future {
  background: #fffbeb;
  color: #92400e;
  border-color: #fcd34d;
}

.house-hero-box {
  background: linear-gradient(135deg, #fffaf8 0%, #f0fdfa 100%);
  border: 1.5px solid rgba(13, 104, 97, 0.22);
  border-radius: 12px;
  overflow: hidden;
}

.house-hero-box.is-former {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-color: #cbd5e1;
}

.house-ext-photo {
  width: 100%;
  max-height: 170px;
  object-fit: cover;
  display: block;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.house-hero-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.house-section-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.house-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.house-section-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.house-fp-card {
  border: 1.5px solid rgba(13, 104, 97, 0.28);
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.house-fp-card:hover {
  border-color: var(--teal);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.house-fp-img-wrap {
  position: relative;
  background: #ffffff;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.house-fp-img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  display: block;
  background: #ffffff;
}

.house-fp-zoom-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.house-fp-meta {
  padding: 8px 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.house-fp-era-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}

.house-fp-era-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}

.house-fp-era-chip:hover {
  border-color: var(--teal);
  background: #f0fdfa;
  color: var(--teal);
}

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

.house-resident-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f8fafc;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  transition: all 0.12s ease;
}

.house-resident-chip:hover {
  border-color: var(--teal);
  background: #f0fdfa;
}

.house-resident-av {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  background: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.66rem;
  font-weight: 800;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.house-inline-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1.5px solid var(--teal);
}

.house-inline-form .input,
.house-inline-form .select {
  min-height: 34px;
  padding: 5px 9px;
  font-size: 0.82rem;
}

/* ==================== PEOPLE & PLACES PANEL TOGGLES (BELOW TIMELINE TRACK) ==================== */
.workspace-toggle-row {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  flex-wrap: wrap;
}

body.view-spatial-active .workspace-toggle-row {
  display: flex;
}

.workspace-toggle-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wm-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.wm-toggle-btn:hover {
  border-color: var(--teal);
  color: var(--ink);
  background: #f0fdfa;
}

.wm-toggle-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
  box-shadow: 0 2px 7px rgba(13, 104, 97, 0.25);
}

.wm-toggle-btn.active::before {
  content: "✓";
  font-weight: 900;
  font-size: 0.76rem;
}

.workspace-toggle-hint {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  margin-left: 2px;
}

/* Non-1080p / narrow-viewport fallback for flexible workspace modes */
.spatial-layout.layout-tree-only {
  grid-template-columns: minmax(320px, 1fr) 12px var(--right-panel-w);
}

.spatial-layout.layout-tree-only #treeResizeHandle,
.spatial-layout.layout-tree-only .spatial-center {
  display: none !important;
}

.spatial-layout.layout-map-only {
  grid-template-columns: minmax(320px, 1fr) 12px var(--right-panel-w);
}

.spatial-layout.layout-map-only .spatial-left,
.spatial-layout.layout-map-only #treeResizeHandle {
  display: none !important;
}

.spatial-layout.layout-none {
  grid-template-columns: 1fr;
}

.spatial-layout.layout-none .spatial-left,
.spatial-layout.layout-none #treeResizeHandle,
.spatial-layout.layout-none .spatial-center,
.spatial-layout.layout-none #rightResizeHandle {
  display: none !important;
}

/* ==================== FAMILY TREE VIEW & EDIT POPOVER ==================== */
.tree-settings-popover {
  position: absolute;
  top: calc(100% - 2px);
  right: 10px;
  width: 288px;
  max-width: calc(100% - 16px);
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.22);
  padding: 12px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tsp-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tsp-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ==================== 3-TRACK LIFE RIBBON (HOUSES + CARS + TRIPS) ==================== */
.timeline-houses-lane {
  height: 24px;
  min-height: 24px;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.35);
}

.timeline-cars-lane {
  border-bottom: 1px dashed rgba(148, 163, 184, 0.35);
}

.timeline-trips-lane {
  height: 24px;
  min-height: 24px;
}

.life-house-bar {
  position: absolute;
  top: 3px;
  height: 18px;
  border-radius: 999px;
  padding: 0 7px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(90deg, #0d6861, #0f766e);
  border: 1px solid rgba(255, 255, 255, 0.5);
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  z-index: 4;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.life-house-bar.is-childhood {
  background: linear-gradient(90deg, #475569, #64748b);
}

.life-house-bar.is-couple {
  background: linear-gradient(90deg, #b45309, #c84b28);
}

.life-house-bar.active-year {
  box-shadow: 0 0 0 2px rgba(200, 75, 40, 0.45);
  z-index: 6;
}

.life-house-bar:hover {
  transform: translateY(-1px);
  z-index: 10;
}

.life-trip-pill {
  position: absolute;
  top: 2px;
  transform: translateX(-50%);
  height: 19px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  cursor: pointer;
  z-index: 5;
  transition: transform 0.12s ease, background 0.12s ease;
}

.life-trip-pill.is-milestone {
  border-color: #6366f1;
  background: #eef2ff;
  color: #3730a3;
}

.life-trip-pill:hover {
  transform: translateX(-50%) scale(1.08);
  z-index: 12;
}

/* ==================== PERSON AGING FACE CIRCLES STRIP ==================== */
.person-aging-strip {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 4px 2px 6px;
  margin-bottom: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.person-aging-strip::-webkit-scrollbar {
  display: none;
}

.person-aging-track {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
}

.person-aging-track.full {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 8px;
}

.person-aging-track:not(.single)::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 24px;
  height: 1.5px;
  background: linear-gradient(90deg, rgba(242, 198, 122, 0.25), rgba(242, 198, 122, 0.58), rgba(242, 198, 122, 0.25));
  pointer-events: none;
  z-index: 0;
}

.person-aging-item {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.person-aging-item:hover {
  transform: translateY(-2px) scale(1.12);
  z-index: 5;
}

.person-aging-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 22%;
  border: 2px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.28);
  background: #1e293b;
  display: grid;
  place-items: center;
  font-size: 0.92rem;
  font-weight: 800;
  color: #f8fafc;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.person-aging-item:hover .person-aging-avatar {
  border-color: #f2c67a;
  box-shadow: 0 0 0 3px rgba(242, 198, 122, 0.32), 0 4px 12px rgba(0, 0, 0, 0.42);
}

.person-aging-year {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  line-height: 1;
  transition: color 0.16s ease;
}

.person-aging-item:hover .person-aging-year {
  color: var(--teal);
}

.person-portal-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 8px;
}

/* ==================== INFORMATION PORTAL SUB-TABS ==================== */
.portal-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 3px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.portal-tabs::-webkit-scrollbar {
  display: none;
}

.portal-tab-btn {
  flex: 0 0 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 6px 6px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s ease;
}

.portal-tab-count {
  font-weight: 600;
  opacity: 0.76;
  font-size: 0.72rem;
}

.portal-tab-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
}

.portal-tab-btn.active {
  background: #ffffff;
  color: var(--teal);
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.12);
}

.portal-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
}

.portal-photo-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  background: #f8fafc;
  aspect-ratio: 1 / 1;
}

.portal-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portal-photo-badge {
  position: absolute;
  bottom: 3px;
  left: 3px;
  background: rgba(15, 23, 42, 0.82);
  color: #ffffff;
  font-size: 0.64rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
}

/* ==================== MAP VACATION TRIP PINS ==================== */
.map-trip-pin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px 3px 4px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 2px solid #d97706;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.32);
  font-size: 0.72rem;
  font-weight: 800;
  color: #78350f;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.map-trip-pin:hover {
  transform: scale(1.08);
}

.map-trip-pin-thumb {
  width: 22px !important;
  height: 22px !important;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #ffffff;
  display: block;
}

/* ==================== GUIDED FAMILY CHAPTERS BAR ==================== */
.chapters-bar {
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: 10px;
  background: linear-gradient(90deg, #f0fdfa 0%, #fffaf8 100%);
  border: 1.5px solid rgba(13, 104, 97, 0.28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.chapter-pills-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.chapter-pill {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.chapter-pill:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.chapter-pill.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
}

.chapter-active-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 260px;
  justify-content: space-between;
}


/* ============================================================================
   CINEMATIC DARK FROSTED-GLASS FULL-BLEED MAP INTERFACE (v20261126f)
   Edge-to-edge live satellite canvas + floating dark-glass header, Family Tree,
   Information Portal, and sleek bottom Timeline Dock.
   ============================================================================ */

/* Global Dark Frosted-Glass Top Bar (harmonized across all tabs!) */
.topbar {
  background: linear-gradient(180deg, rgba(13, 20, 24, 0.92) 0%, rgba(17, 25, 30, 0.86) 100%);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  padding: 7px 20px;
  color: #f8fafc;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(36, 46, 52, 0.95) 0%, rgba(20, 27, 31, 0.98) 100%);
  border: 1px solid rgba(242, 198, 122, 0.38);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.12rem;
  color: #f6e7c8;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.brand-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.14rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.brand-sub {
  font-size: 0.72rem;
  color: rgba(226, 232, 240, 0.72);
}

.nav-tabs {
  background: rgba(16, 23, 27, 0.66);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.nav-btn {
  color: rgba(226, 232, 240, 0.80);
  min-height: 38px;
  padding: 6px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.nav-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-btn.active {
  background: linear-gradient(180deg, rgba(242, 198, 122, 0.20) 0%, rgba(196, 152, 82, 0.14) 100%);
  color: #ffffff;
  border: 1.5px solid rgba(242, 198, 122, 0.72);
  box-shadow: 0 0 18px rgba(242, 198, 122, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.topbar .text-size-group {
  background: rgba(20, 28, 33, 0.70);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 3px 4px;
}

.topbar .ts-btn {
  color: rgba(226, 232, 240, 0.78);
  min-height: 32px;
  padding: 4px 9px;
  border-radius: 999px;
}

.topbar .ts-btn.active {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  box-shadow: none;
}

.topbar .btn-accent {
  background: linear-gradient(135deg, #d85a32 0%, #b53f1c 100%);
  border: 1px solid rgba(255, 200, 175, 0.35);
  border-radius: 999px;
  min-height: 38px;
  padding: 6px 15px;
  box-shadow: 0 6px 18px rgba(181, 63, 28, 0.36);
}

.topbar .user-pill {
  background: rgba(20, 28, 33, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.20);
  color: #f8fafc;
  min-height: 38px;
  padding: 4px 13px 4px 5px;
}

.topbar .user-pill:hover {
  background: rgba(34, 46, 52, 0.85);
}

/* ==================== FULL-BLEED CINEMATIC SPATIAL WORKSPACE (DESKTOP) ==================== */
@media (min-width: 1180px) {
  body.view-spatial-active {
    background: #0d1417;
    color: #f1f5f9;
  }

  /* Keep all light-surface modals crisp dark ink (never inherit dark-theme white body color!) */
  body.view-spatial-active .modal,
  body.view-spatial-active .modal-backdrop .modal {
    color: var(--ink);
  }

  /* Translucent gradient overlay header floating directly over the satellite map */
  body.view-spatial-active .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    background: linear-gradient(180deg, rgba(10, 16, 19, 0.84) 0%, rgba(12, 19, 23, 0.50) 76%, rgba(12, 19, 23, 0) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: none;
    padding: 8px 20px 10px;
  }

  body.view-spatial-active .main-content {
    padding: 0;
    max-width: 100%;
    height: 100vh;
    position: relative;
  }

  body.view-spatial-active #view-spatial.active {
    height: 100vh;
    position: relative;
  }

  /* Full-bleed edge-to-edge canvas container */
  body.view-spatial-active .main-content,
  body.view-spatial-active #view-spatial.active,
  body.view-spatial-active .spatial-layout {
    overflow: hidden !important;
  }

  body.view-spatial-active .spatial-layout {
    display: block !important;
    position: relative;
    width: 100%;
    height: 100vh;
    --tree-panel-w: 440px;
    --right-panel-w: 365px;
    background: radial-gradient(circle at 50% 45%, #162328 0%, #0b1114 100%);
  }

  /* CENTER MAP fills 100% of the viewport behind floating glass panels! */
  body.view-spatial-active .spatial-center {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #0e161a !important;
    display: flex;
    flex-direction: column;
  }

  /* Sleek floating dark-glass Map Toolbar pills centered below the top nav */
  body.view-spatial-active .spatial-center .canvas-toolbar {
    position: absolute;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 28;
    background: rgba(16, 24, 28, 0.66);
    backdrop-filter: blur(16px) saturate(130%);
    -webkit-backdrop-filter: blur(16px) saturate(130%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 4px 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
    max-width: calc(100vw - var(--tree-panel-w, 440px) - var(--right-panel-w, 365px) - 56px);
  }

  body.view-spatial-active .spatial-layout.layout-map-only .spatial-center .canvas-toolbar {
    max-width: calc(100vw - var(--right-panel-w, 365px) - 64px);
  }

  body.view-spatial-active .spatial-center .canvas-toolbar span[style*="font-weight:800"] {
    color: rgba(248, 250, 252, 0.92) !important;
    font-size: 0.8rem !important;
  }

  body.view-spatial-active .spatial-center .canvas-toolbar .btn {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f1f5f9;
    border-radius: 999px;
    min-height: 26px;
    padding: 2px 9px;
    font-size: 0.74rem;
  }

  body.view-spatial-active .spatial-center .canvas-toolbar .btn:hover {
    background: rgba(255, 255, 255, 0.22);
  }

  body.view-spatial-active .spatial-center .canvas-toolbar .btn-teal {
    background: rgba(15, 118, 110, 0.72);
    border-color: rgba(94, 234, 212, 0.35);
    color: #ffffff;
  }

  body.view-spatial-active .spatial-center .canvas-toolbar .btn-accent {
    background: rgba(208, 86, 46, 0.88);
    border-color: rgba(255, 200, 175, 0.35);
    color: #ffffff;
  }

  /* Bottom dock already shows the year + satellite pill cleanly */
  body.view-spatial-active #mapDateCornerBadge {
    display: none !important;
  }

  /* Position Leaflet zoom buttons cleanly in the open map area */
  body.view-spatial-active .leaflet-top.leaflet-left {
    top: 70px;
    left: calc(var(--tree-panel-w, 440px) + 28px);
  }

  body.view-spatial-active .spatial-layout.layout-map-only .leaflet-top.leaflet-left {
    left: 16px;
  }

  body.view-spatial-active .leaflet-bar {
    border: 1px solid rgba(255, 255, 255, 0.20) !important;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
  }

  body.view-spatial-active .leaflet-bar a {
    background: rgba(18, 26, 30, 0.76) !important;
    backdrop-filter: blur(12px);
    color: #f8fafc !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
  }

  body.view-spatial-active .leaflet-bar a:hover {
    background: rgba(34, 48, 54, 0.92) !important;
  }

  body.view-spatial-active .leaflet-control-attribution {
    display: none !important;
  }

  /* ==================== FLOATING DARK FROSTED-GLASS LEFT FAMILY TREE ==================== */
  body.view-spatial-active .spatial-left {
    position: absolute;
    top: 70px;
    left: 16px;
    bottom: calc(var(--bottom-dock-h, 96px) + 14px);
    height: auto !important;
    width: var(--tree-panel-w, 440px);
    z-index: 25;
    background: rgba(18, 27, 30, 0.62) !important;
    backdrop-filter: blur(18px) saturate(135%);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    border-radius: 18px !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
    color: #f1f5f9;
    overflow: hidden;
  }

  body.view-spatial-active .spatial-left .panel-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.01) 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    padding: 10px 14px 8px !important;
  }

  body.view-spatial-active .spatial-left h3 {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.08rem !important;
    font-weight: 700;
    color: #ffffff;
  }

  body.view-spatial-active #liveTreeYearNote {
    color: rgba(226, 232, 240, 0.68) !important;
  }

  body.view-spatial-active .spatial-left .btn {
    background: rgba(255, 255, 255, 0.11);
    border: 1px solid rgba(255, 255, 255, 0.20);
    color: #f8fafc;
    border-radius: 10px;
  }

  body.view-spatial-active .spatial-left .btn:hover {
    background: rgba(255, 255, 255, 0.20);
  }

  body.view-spatial-active .spatial-left .btn-primary {
    background: rgba(208, 86, 46, 0.88);
    border-color: rgba(255, 200, 175, 0.35);
    color: #ffffff;
  }

  body.view-spatial-active #treePersonSearchInput {
    background: rgba(10, 16, 19, 0.46) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: #f8fafc !important;
    border-radius: 10px !important;
  }

  body.view-spatial-active #treePersonSearchInput::placeholder {
    color: rgba(226, 232, 240, 0.56);
  }

  body.view-spatial-active .live-tree-canvas {
    background: transparent !important;
  }

  /* Subtle background watermark era dates behind faces & lines (no pill!) */
  body.view-spatial-active .tree-decade-rail.horizontal-mode {
    background: transparent !important;
  }

  body.view-spatial-active .tree-decade-pill {
    background: transparent !important;
    color: rgba(246, 229, 191, 0.30) !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    padding: 0 !important;
  }

  /* Sleek dark frosted-glass Family Tree person cards & nodes */
  body.view-spatial-active .tree-node.horiz-card {
    background: rgba(19, 28, 33, 0.82) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.26) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.34) !important;
  }

  body.view-spatial-active .tree-node.horiz-card:hover {
    border-color: rgba(242, 198, 122, 0.85) !important;
    background: rgba(28, 40, 46, 0.92) !important;
  }

  body.view-spatial-active .tree-node.horiz-card.deceased {
    background: rgba(28, 27, 42, 0.82) !important;
    border-color: rgba(196, 181, 253, 0.42) !important;
  }

  body.view-spatial-active .tree-node.horiz-card.selected {
    background: rgba(66, 44, 28, 0.92) !important;
    border-color: #f5b963 !important;
    box-shadow: 0 0 0 3px rgba(245, 185, 99, 0.34), 0 6px 18px rgba(0, 0, 0, 0.44) !important;
  }

  body.view-spatial-active .tree-node.horiz-card .horiz-card-name {
    color: #f8fafc !important;
  }

  body.view-spatial-active .tree-node.horiz-card .horiz-card-years {
    color: rgba(203, 213, 225, 0.78) !important;
  }

  body.view-spatial-active .tree-node-name {
    color: #f8fafc !important;
    background: rgba(15, 23, 28, 0.78) !important;
    border: 1px solid rgba(255, 255, 255, 0.14);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
  }

  body.view-spatial-active .tree-node-years {
    color: rgba(226, 232, 240, 0.78) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  }

  body.view-spatial-active .tree-node-avatar {
    border-color: rgba(255, 255, 255, 0.78) !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45) !important;
  }

  body.view-spatial-active .tree-branch-toggle {
    background: rgba(20, 30, 35, 0.92);
    color: #f6e5bf;
    border-color: rgba(245, 214, 148, 0.55);
  }

  /* Bottom-right dark-glass Zoom HUD pill (+ 33% − Fit) */
  body.view-spatial-active .tree-zoom-hud {
    background: rgba(14, 21, 25, 0.78) !important;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.20) !important;
    border-radius: 999px !important;
    padding: 3px 6px !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.36);
  }

  body.view-spatial-active .tree-zoom-btn {
    background: rgba(255, 255, 255, 0.10) !important;
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    border-radius: 999px !important;
  }

  body.view-spatial-active .tree-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.22) !important;
  }

  body.view-spatial-active .tree-zoom-pct {
    color: #f8fafc !important;
  }

  /* Dark-glass View & Edit popover & person search dropdown */
  body.view-spatial-active .tree-settings-popover,
  body.view-spatial-active .pqs-dropdown {
    background: rgba(18, 26, 31, 0.95) !important;
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    color: #f1f5f9 !important;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.54) !important;
  }

  body.view-spatial-active .tree-settings-popover .tsp-label {
    color: rgba(242, 198, 122, 0.90) !important;
  }

  body.view-spatial-active .tree-settings-popover .tree-portrait-mode-bar {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
  }

  body.view-spatial-active .tree-settings-popover .tree-pm-btn {
    color: rgba(226, 232, 240, 0.80) !important;
  }

  body.view-spatial-active .tree-settings-popover .tree-pm-btn.active {
    background: rgba(242, 198, 122, 0.24) !important;
    color: #ffffff !important;
  }

  body.view-spatial-active .pqs-item {
    color: #f1f5f9 !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
  }

  body.view-spatial-active .pqs-item:hover {
    background: rgba(255, 255, 255, 0.12) !important;
  }

  /* ==================== FLOATING DARK FROSTED-GLASS RIGHT INFORMATION PORTAL ==================== */
  body.view-spatial-active .spatial-right {
    position: absolute;
    top: 70px;
    right: 16px;
    bottom: calc(var(--bottom-dock-h, 96px) + 14px);
    height: auto !important;
    width: var(--right-panel-w, 365px);
    z-index: 25;
    background: rgba(20, 29, 32, 0.72) !important;
    backdrop-filter: blur(18px) saturate(135%);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    border-radius: 18px !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
    color: #f1f5f9;
    overflow: hidden;
  }

  body.view-spatial-active .spatial-right .panel-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.01) 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    padding: 12px 15px 10px !important;
  }

  body.view-spatial-active #rightPanelHeading {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.24rem !important;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
  }

  body.view-spatial-active #spacePinCountBadge {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #f8fafc;
    font-weight: 700;
  }

  /* High-contrast readable dark-glass styles for EVERY card, chip, tab & input inside Right Portal */
  body.view-spatial-active .spatial-right h1,
  body.view-spatial-active .spatial-right h2,
  body.view-spatial-active .spatial-right h3,
  body.view-spatial-active .spatial-right h4,
  body.view-spatial-active .spatial-right strong {
    color: #ffffff;
  }

  body.view-spatial-active .spatial-right .form-label {
    color: rgba(242, 198, 122, 0.90) !important;
    letter-spacing: 0.04em;
  }

  body.view-spatial-active .spatial-right .muted,
  body.view-spatial-active .spatial-right .faint {
    color: rgba(226, 232, 240, 0.74) !important;
  }

  body.view-spatial-active .spatial-right .chip {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.20);
    color: #f8fafc;
  }

  body.view-spatial-active .spatial-right .chip-teal {
    background: rgba(20, 148, 136, 0.26);
    border-color: rgba(94, 234, 212, 0.36);
    color: #ccfbf1;
  }

  body.view-spatial-active .spatial-right .chip-gold {
    background: rgba(242, 198, 122, 0.20);
    border-color: rgba(242, 198, 122, 0.42);
    color: #fde68a;
  }

  body.view-spatial-active .spatial-right .btn {
    background: rgba(255, 255, 255, 0.11);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #f8fafc;
    border-radius: 10px;
  }

  body.view-spatial-active .spatial-right .btn:hover {
    background: rgba(255, 255, 255, 0.22);
  }

  body.view-spatial-active .spatial-right .btn-primary {
    background: rgba(242, 198, 122, 0.22);
    border-color: rgba(242, 198, 122, 0.55);
    color: #ffffff;
  }

  body.view-spatial-active .spatial-right .btn-teal {
    background: rgba(15, 118, 110, 0.80);
    border-color: rgba(94, 234, 212, 0.38);
    color: #ffffff;
  }

  body.view-spatial-active .spatial-right .btn-accent {
    background: rgba(208, 86, 46, 0.90);
    border-color: rgba(255, 200, 175, 0.35);
    color: #ffffff;
  }

  body.view-spatial-active .spatial-right .input,
  body.view-spatial-active .spatial-right .select,
  body.view-spatial-active .spatial-right .textarea {
    background: rgba(10, 16, 19, 0.56);
    border: 1px solid rgba(255, 255, 255, 0.20);
    color: #f8fafc;
  }

  /* Dark-glass sub-cards inside Person Portal, House Entity Page & Memory Pin Viewer */
  body.view-spatial-active .spatial-right .person-bio-card,
  body.view-spatial-active .spatial-right .person-country-chip,
  body.view-spatial-active .spatial-right .portal-tab-bar,
  body.view-spatial-active .spatial-right .portal-section,
  body.view-spatial-active .spatial-right .mem-viewer-card,
  body.view-spatial-active .spatial-right .mem-story-box,
  body.view-spatial-active .spatial-right .mem-media-stage,
  body.view-spatial-active .spatial-right .house-page-card,
  body.view-spatial-active .spatial-right .house-section,
  body.view-spatial-active .spatial-right .house-hero,
  body.view-spatial-active .spatial-right .house-stat-pill,
  body.view-spatial-active .spatial-right .res-card,
  body.view-spatial-active .spatial-right .memory-card,
  body.view-spatial-active .spatial-right .life-asset-card,
  body.view-spatial-active .spatial-right .trip-portal-card,
  body.view-spatial-active .spatial-right .empty-state {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    color: #f1f5f9 !important;
  }

  body.view-spatial-active .spatial-right .portal-tab-btn {
    color: rgba(226, 232, 240, 0.78) !important;
    background: transparent !important;
  }

  body.view-spatial-active .spatial-right .portal-tab-btn.active {
    background: rgba(242, 198, 122, 0.22) !important;
    color: #ffffff !important;
    border: 1px solid rgba(242, 198, 122, 0.55) !important;
  }

  body.view-spatial-active .spatial-right [style*="background:#fff"],
  body.view-spatial-active .spatial-right [style*="background: #fff"],
  body.view-spatial-active .spatial-right [style*="background:#ffffff"],
  body.view-spatial-active .spatial-right [style*="background:#f8fafc"],
  body.view-spatial-active .spatial-right [style*="background: #f8fafc"],
  body.view-spatial-active .spatial-right [style*="background:#f0fdfa"],
  body.view-spatial-active .spatial-right [style*="background:#fafbfc"],
  body.view-spatial-active .spatial-right [style*="background:#fefce8"],
  body.view-spatial-active .spatial-right [style*="background:#fffbeb"],
  body.view-spatial-active .spatial-right [style*="background:linear-gradient(135deg,#fff"],
  body.view-spatial-active .spatial-right [style*="background:linear-gradient(135deg, #fff"] {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    color: #f1f5f9 !important;
  }

  body.view-spatial-active .spatial-right [style*="color:var(--ink)"],
  body.view-spatial-active .spatial-right [style*="color:var(--ink-soft)"],
  body.view-spatial-active .spatial-right [style*="color: var(--ink-soft)"],
  body.view-spatial-active .spatial-right [style*="color:#0f172a"],
  body.view-spatial-active .spatial-right [style*="color:#1e293b"],
  body.view-spatial-active .spatial-right [style*="color:#334155"],
  body.view-spatial-active .spatial-right [style*="color:#475569"],
  body.view-spatial-active .spatial-right [style*="color:#78350f"],
  body.view-spatial-active .spatial-right [style*="color:var(--teal)"],
  body.view-spatial-active .spatial-right .person-memory-item * {
    color: #f1f5f9 !important;
  }

  body.view-spatial-active .spatial-right .mem-photo-img {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
  }

  /* Subtle dark-glass scrollbars inside Right Portal */
  body.view-spatial-active .spatial-right .panel-body::-webkit-scrollbar {
    width: 6px;
  }

  body.view-spatial-active .spatial-right .panel-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
  }

  /* ==================== FLOATING DRAG RESIZE HANDLES ==================== */
  body.view-spatial-active #treeResizeHandle {
    position: absolute;
    top: 86px;
    bottom: calc(var(--bottom-dock-h, 96px) + 30px);
    height: auto !important;
    left: calc(16px + var(--tree-panel-w, 440px));
    width: 12px;
    z-index: 30;
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body.view-spatial-active #rightResizeHandle {
    position: absolute;
    top: 86px;
    bottom: calc(var(--bottom-dock-h, 96px) + 30px);
    height: auto !important;
    right: calc(16px + var(--right-panel-w, 365px));
    width: 12px;
    z-index: 30;
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body.view-spatial-active .tree-resize-grip {
    width: 4px;
    height: 44px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    transition: background 0.15s ease, height 0.15s ease;
  }

  body.view-spatial-active .tree-resize-handle:hover .tree-resize-grip,
  body.view-spatial-active .tree-resize-handle.dragging .tree-resize-grip {
    background: rgba(242, 198, 122, 0.90);
    height: 70px;
  }

  /* ==================== ALL 4 WORKSPACE MODES (Both / Map / Tree / None) ==================== */
  body.view-spatial-active .spatial-layout.layout-tree-only .spatial-left,
  body.view-spatial-active .spatial-layout.tree-expanded .spatial-left {
    width: auto !important;
    right: calc(var(--right-panel-w, 365px) + 32px);
  }

  body.view-spatial-active .spatial-layout.layout-none .spatial-right {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(940px, calc(100vw - 48px));
  }

  /* ==================== SLEEK DARK FROSTED-GLASS BOTTOM TIMELINE DOCK ==================== */
  body.view-spatial-active .global-timeline-bar {
    position: fixed;
    top: auto !important;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    background: linear-gradient(180deg, rgba(14, 21, 24, 0.78) 0%, rgba(9, 14, 17, 0.94) 100%) !important;
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-top: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-bottom: none !important;
    box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.42) !important;
    padding: 5px 18px 6px !important;
    color: #f8fafc;
  }

  body.view-spatial-active .timeline-year-num {
    color: #ffffff !important;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
  }

  body.view-spatial-active .timeline-sat-pill {
    background: rgba(255, 255, 255, 0.10) !important;
    color: rgba(241, 245, 249, 0.90) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    padding: 4px 11px;
  }

  body.view-spatial-active .timeline-history-line {
    background: rgba(255, 255, 255, 0.45) !important;
  }

  body.view-spatial-active .history-ev-lbl {
    background: transparent !important;
    color: rgba(248, 250, 252, 0.88) !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
    font-weight: 700;
  }

  body.view-spatial-active .history-ev-tick {
    background: rgba(255, 255, 255, 0.55) !important;
  }

  body.view-spatial-active .history-ev-btn:hover .history-ev-lbl,
  body.view-spatial-active .history-ev-btn.active-ev .history-ev-lbl {
    background: rgba(242, 198, 122, 0.92) !important;
    color: #0f172a !important;
    text-shadow: none;
  }

  body.view-spatial-active .timeline-ruler-notch {
    background: rgba(255, 255, 255, 0.25) !important;
  }

  body.view-spatial-active .timeline-ruler-notch.major {
    background: rgba(255, 255, 255, 0.55) !important;
  }

  body.view-spatial-active .timeline-slider {
    background: rgba(255, 255, 255, 0.26) !important;
  }

  body.view-spatial-active .timeline-slider::-webkit-slider-thumb {
    background: #f2c67a !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 0 12px rgba(242, 198, 122, 0.72) !important;
  }

  body.view-spatial-active .decade-tick {
    color: rgba(226, 232, 240, 0.68) !important;
  }

  body.view-spatial-active .decade-tick:hover {
    color: #ffffff !important;
  }

  body.view-spatial-active .timeline-actions .btn {
    background: rgba(255, 255, 255, 0.11);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    border-radius: 10px;
    min-height: 32px;
    padding: 4px 12px;
  }

  body.view-spatial-active .timeline-actions .btn:hover {
    background: rgba(255, 255, 255, 0.22);
  }

  body.view-spatial-active .timeline-actions .btn-teal {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(242, 198, 122, 0.40);
  }

  /* Subtle dark-glass workspace panel toggles (🌳 Family Tree | 🗺 Map) tucked cleanly in the bottom dock */
  body.view-spatial-active .workspace-toggle-row {
    margin-top: 2px;
    padding-top: 3px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    justify-content: center;
    gap: 6px;
  }

  body.view-spatial-active .workspace-toggle-label,
  body.view-spatial-active .workspace-toggle-hint {
    color: rgba(203, 213, 225, 0.66) !important;
    font-size: 0.72rem;
  }

  body.view-spatial-active .wm-toggle-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: rgba(226, 232, 240, 0.78) !important;
    border-radius: 999px;
    min-height: 24px;
    padding: 2px 10px;
    font-size: 0.72rem;
  }

  body.view-spatial-active .wm-toggle-btn.active {
    background: rgba(242, 198, 122, 0.20) !important;
    border-color: rgba(242, 198, 122, 0.62) !important;
    color: #ffffff !important;
  }

  /* Dark-glass 3-Track Life Ribbon & Chapters Bar inside the bottom dock */
  body.view-spatial-active .timeline-under-stage {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
  }

  body.view-spatial-active .chapters-bar {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(242, 198, 122, 0.30) !important;
    color: #f8fafc !important;
  }

  body.view-spatial-active .chapter-pill {
    background: rgba(255, 255, 255, 0.10) !important;
    border-color: rgba(255, 255, 255, 0.20) !important;
    color: #f1f5f9 !important;
  }

  body.view-spatial-active .chapter-pill.active {
    background: rgba(242, 198, 122, 0.26) !important;
    border-color: rgba(242, 198, 122, 0.72) !important;
    color: #ffffff !important;
  }
}


/* ==================== CONTRAST POLISH: ALL RIGHT-PORTAL SUB-CARDS & NON-SPATIAL TIMELINE ==================== */
/* Harmonize Timeline Bar in dark frosted glass across Photos & Help Out tabs too (zero light/dark text clash!) */
.global-timeline-bar {
  background: linear-gradient(180deg, rgba(14, 21, 24, 0.90) 0%, rgba(10, 16, 20, 0.95) 100%) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #f8fafc !important;
}

.global-timeline-bar .timeline-year-num {
  color: #ffffff !important;
}

.global-timeline-bar .timeline-sat-pill {
  background: rgba(255, 255, 255, 0.10) !important;
  color: rgba(241, 245, 249, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

.global-timeline-bar .timeline-history-line {
  background: rgba(255, 255, 255, 0.45) !important;
}

.global-timeline-bar .history-ev-lbl {
  background: transparent !important;
  color: rgba(248, 250, 252, 0.90) !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.global-timeline-bar .history-ev-tick {
  background: rgba(255, 255, 255, 0.55) !important;
}

.global-timeline-bar .history-ev-btn:hover .history-ev-lbl,
.global-timeline-bar .history-ev-btn.active-ev .history-ev-lbl {
  background: rgba(242, 198, 122, 0.92) !important;
  color: #0f172a !important;
  text-shadow: none;
}

.global-timeline-bar .decade-tick {
  color: rgba(226, 232, 240, 0.72) !important;
}

.global-timeline-bar .timeline-slider {
  background: rgba(255, 255, 255, 0.26) !important;
}

.global-timeline-bar .timeline-actions .btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.global-timeline-bar .workspace-toggle-label,
.global-timeline-bar .workspace-toggle-hint {
  color: rgba(203, 213, 225, 0.72) !important;
}

.global-timeline-bar .wm-toggle-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: rgba(226, 232, 240, 0.82) !important;
}

.global-timeline-bar .wm-toggle-btn.active {
  background: rgba(242, 198, 122, 0.22) !important;
  border-color: rgba(242, 198, 122, 0.64) !important;
  color: #ffffff !important;
}

/* Complete dark-glass sub-card coverage inside Right Info Portal (House Page + Person Portal + Memory Pin) */
@media (min-width: 1180px) {
  body.view-spatial-active .spatial-right .house-page-card,
  body.view-spatial-active .spatial-right .house-hero-box,
  body.view-spatial-active .spatial-right .house-hero-card,
  body.view-spatial-active .spatial-right .house-section-card,
  body.view-spatial-active .spatial-right .house-section-box,
  body.view-spatial-active .spatial-right .house-inline-form,
  body.view-spatial-active .spatial-right .house-fp-card,
  body.view-spatial-active .spatial-right .house-resident-chip,
  body.view-spatial-active .spatial-right .house-fp-era-chip,
  body.view-spatial-active .spatial-right .person-memory-item,
  body.view-spatial-active .spatial-right .portal-tabs,
  body.view-spatial-active .spatial-right .person-card,
  body.view-spatial-active .spatial-right .person-hero,
  body.view-spatial-active .spatial-right .person-portal-card,
  body.view-spatial-active .spatial-right .person-portal-hero,
  body.view-spatial-active .spatial-right .person-section,
  body.view-spatial-active .spatial-right .person-residence-card,
  body.view-spatial-active .spatial-right .person-rel-chip,
  body.view-spatial-active .spatial-right .person-asset-chip,
  body.view-spatial-active .spatial-right .mem-pin-card,
  body.view-spatial-active .spatial-right .mem-pin-story,
  body.view-spatial-active .spatial-right .mem-linked-photos {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    color: #f1f5f9 !important;
  }

  body.view-spatial-active .spatial-right .house-status-pill.occupied {
    background: rgba(16, 185, 129, 0.24) !important;
    border-color: rgba(52, 211, 153, 0.48) !important;
    color: #a7f3d0 !important;
  }

  body.view-spatial-active .spatial-right .house-status-pill.former,
  body.view-spatial-active .spatial-right .house-status-pill.future {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
    color: #e2e8f0 !important;
  }

  body.view-spatial-active .spatial-right .portal-tab {
    color: rgba(226, 232, 240, 0.78) !important;
    background: transparent !important;
  }

  body.view-spatial-active .spatial-right .portal-tab.active {
    background: rgba(242, 198, 122, 0.24) !important;
    color: #ffffff !important;
    border-color: rgba(242, 198, 122, 0.56) !important;
  }

  body.view-spatial-active .spatial-right .house-page-title,
  body.view-spatial-active .spatial-right .house-hero-title,
  body.view-spatial-active .spatial-right .house-section-title,
  body.view-spatial-active .spatial-right .house-address-line,
  body.view-spatial-active .spatial-right .house-story-text,
  body.view-spatial-active .spatial-right .person-name-lg,
  body.view-spatial-active .spatial-right .person-meta-line,
  body.view-spatial-active .spatial-right .person-bio-text,
  body.view-spatial-active .spatial-right p,
  body.view-spatial-active .spatial-right li,
  body.view-spatial-active .spatial-right label {
    color: #f1f5f9 !important;
  }
}


/* ==================== COMPLETE DARK-GLASS CONTRAST FOR ALL RIGHT-PORTAL ROWS & CHIPS (v20261126h) ==================== */
@media (min-width: 1180px) {
  body.view-spatial-active .spatial-right .person-home-row,
  body.view-spatial-active .spatial-right .person-home-row.active-home,
  body.view-spatial-active .spatial-right .person-home-card,
  body.view-spatial-active .spatial-right .person-home-card.is-unset,
  body.view-spatial-active .spatial-right .person-hist-home-btn,
  body.view-spatial-active .spatial-right .person-milestone-row,
  body.view-spatial-active .spatial-right .person-inline-home-form,
  body.view-spatial-active .spatial-right .person-memories-box,
  body.view-spatial-active .spatial-right .person-memory-form,
  body.view-spatial-active .spatial-right .person-asset-tile,
  body.view-spatial-active .spatial-right .person-asset-thumb,
  body.view-spatial-active .spatial-right .rel-chip,
  body.view-spatial-active .spatial-right .mem-viewer-hero,
  body.view-spatial-active .spatial-right .mem-person-pill,
  body.view-spatial-active .spatial-right .mem-audio-card,
  body.view-spatial-active .spatial-right .mem-composer-card,
  body.view-spatial-active .spatial-right .mem-media-tabs,
  body.view-spatial-active .spatial-right .mem-media-tab,
  body.view-spatial-active .spatial-right .house-hero-box.is-former,
  body.view-spatial-active .spatial-right .portal-photo-card {
    background: rgba(255, 255, 255, 0.10) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: #f8fafc !important;
  }

  body.view-spatial-active .spatial-right .person-home-row.active-home {
    background: rgba(20, 148, 136, 0.22) !important;
    border-color: rgba(94, 234, 212, 0.48) !important;
  }

  body.view-spatial-active .spatial-right .person-home-row:hover,
  body.view-spatial-active .spatial-right .person-hist-home-btn:hover,
  body.view-spatial-active .spatial-right .person-memory-item.clickable:hover,
  body.view-spatial-active .spatial-right .house-resident-chip:hover,
  body.view-spatial-active .spatial-right .house-fp-era-chip:hover,
  body.view-spatial-active .spatial-right .mem-person-pill:hover,
  body.view-spatial-active .spatial-right .rel-chip:hover {
    background: rgba(242, 198, 122, 0.20) !important;
    border-color: rgba(242, 198, 122, 0.52) !important;
    color: #ffffff !important;
  }

  body.view-spatial-active .spatial-right .mem-media-tab.active {
    background: rgba(242, 198, 122, 0.24) !important;
    border-color: rgba(242, 198, 122, 0.56) !important;
    color: #ffffff !important;
  }

  body.view-spatial-active .spatial-right .person-milestone-year {
    color: #f6d591 !important;
  }

  body.view-spatial-active .spatial-right .house-resident-av {
    background: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
  }

  /* Fix any dark-slate address/subtext inside House Hero or Person Portal */
  body.view-spatial-active .spatial-right .house-hero-box *,
  body.view-spatial-active .spatial-right .house-page-card .house-addr,
  body.view-spatial-active .spatial-right .house-page-card a,
  body.view-spatial-active .spatial-right .person-home-row *,
  body.view-spatial-active .spatial-right .person-milestone-row * {
    color: #f1f5f9;
  }

  body.view-spatial-active .spatial-right .person-home-row .faint,
  body.view-spatial-active .spatial-right .house-hero-box .faint {
    color: rgba(226, 232, 240, 0.78) !important;
  }

  /* Keep white studio car strip clearly readable with dark year captions */
  body.view-spatial-active .spatial-right .person-mini-cars-strip {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.24) !important;
  }

  body.view-spatial-active .spatial-right .person-mini-cars-strip * {
    color: #0f172a !important;
  }
}


/* ==================== FULL-WIDTH INITIAL FAMILY TREE + ALWAYS-VISIBLE FULL TREE BUTTON + 3S CINEMATIC GLIDE (v20261126k) ==================== */
.tree-hdr-row3 {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tree-full-inline-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
  min-height: 30px;
  padding: 4px 11px !important;
  border-radius: 999px !important;
  font-size: 0.76rem !important;
  font-weight: 800 !important;
  white-space: nowrap;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

body.view-spatial-active .tree-full-inline-btn {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.26) !important;
  color: #f8fafc !important;
}

body.view-spatial-active .tree-full-inline-btn:hover {
  background: rgba(255, 255, 255, 0.22) !important;
  border-color: rgba(242, 198, 122, 0.65) !important;
}

body.view-spatial-active .tree-full-inline-btn.is-focused-cta {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.92) 0%, rgba(13, 148, 136, 0.88) 100%) !important;
  border: 1px solid rgba(94, 234, 212, 0.65) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.36);
}

body.view-spatial-active .tree-full-inline-btn.is-focused-cta:hover {
  background: linear-gradient(135deg, rgba(17, 138, 128, 0.98) 0%, rgba(20, 168, 154, 0.94) 100%) !important;
}

/* Smooth 0.7s dissolve for non-lineage faces & branches during the 3-second cinematic glide */
.tree-node.lineage-fading-out,
.tree-couple-line.lineage-fading-out,
.tree-couple-badge.lineage-fading-out,
.tree-family-branch.lineage-fading-out {
  opacity: 0 !important;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1) !important;
  pointer-events: none;
}

@media (min-width: 1180px) {
  /* Full-width Family Tree Hero state on initial site open (and whenever Full Family Tree is clicked) */
  body.view-spatial-active .spatial-layout.tree-hero-full .spatial-right {
    opacity: 0;
    transform: translateX(42px);
    pointer-events: none;
  }

  body.view-spatial-active .spatial-layout.tree-hero-full .spatial-center .canvas-toolbar,
  body.view-spatial-active .spatial-layout.tree-hero-full .leaflet-top.leaflet-left,
  body.view-spatial-active .spatial-layout.tree-hero-full #treeResizeHandle,
  body.view-spatial-active .spatial-layout.tree-hero-full #rightResizeHandle {
    opacity: 0;
    pointer-events: none;
  }

  /* Narrow focused sidebar: stack search + Full Family Tree cleanly with ZERO right-edge clipping! */
  body.view-spatial-active .spatial-layout.tree-panel-focused .spatial-left .panel-header {
    padding: 8px 10px !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  body.view-spatial-active .spatial-layout.tree-panel-focused .spatial-left .tree-hdr-row1,
  body.view-spatial-active .spatial-layout.tree-panel-focused .spatial-left .tree-hdr-row3 {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  body.view-spatial-active .spatial-layout.tree-panel-focused .spatial-left h3 {
    font-size: 0.92rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.view-spatial-active .spatial-layout.tree-panel-focused .spatial-left .tree-hdr-row1 .btn {
    padding: 3px 7px !important;
    font-size: 0.71rem !important;
    min-height: 26px !important;
  }

  body.view-spatial-active .spatial-layout.tree-panel-focused .tree-hdr-row3 {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }

  body.view-spatial-active .spatial-layout.tree-panel-focused .tree-full-inline-btn {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Smooth GPU-composited fade/slide transitions on right panel & map toolbar */
  body.view-spatial-active .spatial-right,
  body.view-spatial-active .spatial-center .canvas-toolbar,
  body.view-spatial-active .leaflet-top.leaflet-left {
    will-change: transform, opacity;
  }

  body.view-spatial-active .spatial-left {
    will-change: width;
  }
}


/* ============================================================================
   ULTRA-SLICK BORDERLESS FLAT EDITORIAL OVERRIDE (v20261126m)
   Removes heavy rounded pills across Map bar, Topbar, Family Tree, Right Portal,
   and Bottom Timeline Dock — tighter spacing, single-line bars, gold underlines.
   ============================================================================ */

/* 1. TOP HEADER BAR — Flat Navigation Links, Flat Text-Size, Flat Actions */
.topbar {
  padding: 5px 18px;
}

.topbar .nav-tabs {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  gap: 6px;
}

.topbar .nav-btn {
  border-radius: 4px !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  min-height: 34px;
  padding: 5px 12px;
  font-size: 0.86rem;
  color: rgba(226, 232, 240, 0.72);
}

.topbar .nav-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff;
}

.topbar .nav-btn.active {
  background: transparent !important;
  border-bottom: 2px solid #f2c67a !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.topbar .badge {
  background: transparent !important;
  color: #f2c67a !important;
  padding: 0 3px;
  min-width: auto;
  height: auto;
  font-size: 0.76rem;
}

.topbar .text-size-group {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  gap: 2px;
}

.topbar .ts-btn {
  border-radius: 4px !important;
  border-bottom: 2px solid transparent;
  min-height: 28px;
  padding: 3px 7px;
  font-size: 0.78rem;
}

.topbar .ts-btn.active {
  background: transparent !important;
  color: #f2c67a !important;
  border-bottom-color: #f2c67a;
}

.topbar .btn-accent {
  background: transparent !important;
  border: none !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  color: #ff9f7a !important;
  min-height: 32px;
  padding: 4px 10px;
  font-size: 0.84rem;
}

.topbar .btn-accent:hover {
  background: rgba(216, 90, 50, 0.22) !important;
  color: #ffffff !important;
}

.topbar .user-pill {
  background: transparent !important;
  border: none !important;
  border-radius: 6px !important;
  min-height: 32px;
  padding: 3px 8px 3px 4px;
  font-size: 0.84rem;
}

.topbar .user-pill:hover {
  background: rgba(255, 255, 255, 0.10) !important;
}

/* 2. BOTTOM TIMELINE DOCK — Flat Borderless Controls (Global across all views) */
.global-timeline-bar .timeline-sat-pill {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 4px !important;
  color: rgba(226, 232, 240, 0.72) !important;
  font-size: 0.76rem;
  font-weight: 600;
}

.global-timeline-bar .timeline-actions {
  gap: 4px;
}

.global-timeline-bar .timeline-actions .btn,
.global-timeline-bar .timeline-actions .btn-teal {
  background: transparent !important;
  border: none !important;
  border-radius: 5px !important;
  color: rgba(241, 245, 249, 0.88) !important;
  min-height: 28px;
  padding: 3px 9px;
  font-size: 0.78rem;
}

.global-timeline-bar .timeline-actions .btn:hover,
.global-timeline-bar .timeline-actions .btn-teal:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
}

.global-timeline-bar .wm-toggle-btn {
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 3px !important;
  padding: 2px 8px !important;
  min-height: 22px;
  color: rgba(203, 213, 225, 0.58) !important;
}

.global-timeline-bar .wm-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
}

.global-timeline-bar .wm-toggle-btn.active {
  background: transparent !important;
  border-bottom: 2px solid #f2c67a !important;
  color: #ffffff !important;
}

.global-timeline-bar .chapter-pill {
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 3px !important;
  padding: 2px 8px !important;
}

.global-timeline-bar .chapter-pill.active {
  background: transparent !important;
  border-bottom: 2px solid #f2c67a !important;
  color: #f2c67a !important;
}

@media (min-width: 1180px) {
  /* 3. MAP TOOLBAR — Sleek Single-Line Borderless Strip centered in the OPEN map gap (Never occluded!) */
  body.view-spatial-active .spatial-center .canvas-toolbar {
    top: 62px;
    left: calc(50% + (var(--tree-panel-w, 440px) - var(--right-panel-w, 365px)) / 2) !important;
    transform: translateX(-50%);
    border-radius: 8px !important;
    background: rgba(14, 21, 25, 0.72) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    padding: 3px 10px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.30);
    max-width: calc(100vw - var(--tree-panel-w, 440px) - var(--right-panel-w, 365px) - 52px);
  }

  body.view-spatial-active .spatial-layout.layout-map-only .spatial-center .canvas-toolbar {
    left: calc(50% - var(--right-panel-w, 365px) / 2) !important;
    max-width: calc(100vw - var(--right-panel-w, 365px) - 52px);
  }

  body.view-spatial-active .spatial-center #googleMapTools {
    flex-wrap: nowrap !important;
    gap: 2px !important;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body.view-spatial-active .spatial-center #googleMapTools::-webkit-scrollbar {
    display: none;
  }

  body.view-spatial-active .spatial-center .canvas-toolbar .btn,
  body.view-spatial-active .spatial-center .canvas-toolbar .btn-teal,
  body.view-spatial-active .spatial-center .canvas-toolbar .btn-accent {
    background: transparent !important;
    border: none !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    color: rgba(241, 245, 249, 0.86) !important;
    min-height: 24px !important;
    padding: 2px 7px !important;
    font-size: 0.74rem !important;
    font-weight: 600 !important;
    position: relative;
  }

  body.view-spatial-active .spatial-center .canvas-toolbar .btn + .btn::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 22%;
    height: 56%;
    width: 1px;
    background: rgba(255, 255, 255, 0.14);
  }

  body.view-spatial-active .spatial-center .canvas-toolbar .btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
  }

  body.view-spatial-active .spatial-center .canvas-toolbar .btn-teal {
    color: #7ee8db !important;
  }

  body.view-spatial-active .spatial-center .canvas-toolbar .btn-accent {
    color: #ff9f7a !important;
    font-weight: 700 !important;
  }

  body.view-spatial-active .spatial-center .canvas-toolbar #activePersonFilterChip {
    background: transparent !important;
    border: none !important;
    border-right: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 0 !important;
    color: #f2c67a !important;
    padding: 1px 8px 1px 4px !important;
    margin-right: 2px;
    font-size: 0.74rem !important;
    font-weight: 700 !important;
  }

  body.view-spatial-active .spatial-center .canvas-toolbar #activePersonFilterChip button {
    color: #f2c67a !important;
  }

  /* 4. FAMILY TREE PANEL — Flat Header Actions & Minimal Zoom Strip */
  body.view-spatial-active .spatial-left .panel-header .btn,
  body.view-spatial-active .spatial-left .tree-full-inline-btn {
    background: transparent !important;
    border: none !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    color: rgba(241, 245, 249, 0.86) !important;
  }

  body.view-spatial-active .spatial-left .panel-header .btn:hover,
  body.view-spatial-active .spatial-left .tree-full-inline-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
  }

  body.view-spatial-active .spatial-left .tree-full-inline-btn.is-focused-cta {
    background: rgba(94, 234, 212, 0.10) !important;
    border: none !important;
    border-left: 2px solid #5eead4 !important;
    border-radius: 3px !important;
    color: #99f6e4 !important;
    box-shadow: none !important;
    justify-content: flex-start;
    padding-left: 9px !important;
  }

  body.view-spatial-active .spatial-left .tree-full-inline-btn.is-focused-cta:hover {
    background: rgba(94, 234, 212, 0.20) !important;
    color: #ffffff !important;
  }

  body.view-spatial-active .tree-zoom-hud {
    border-radius: 6px !important;
    background: rgba(14, 21, 25, 0.68) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    padding: 2px 5px !important;
    gap: 2px;
  }

  body.view-spatial-active .tree-zoom-btn {
    background: transparent !important;
    border: none !important;
    border-radius: 4px !important;
  }

  body.view-spatial-active .tree-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.14) !important;
  }

  /* 5. RIGHT INFORMATION PORTAL — Clean Underline Tabs, Flat Links & Hairline Rows (Zero Pills!) */
  body.view-spatial-active #spacePinCountBadge {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    color: rgba(242, 198, 122, 0.88) !important;
    font-size: 0.78rem;
  }

  body.view-spatial-active .spatial-right .person-aging-year {
    color: rgba(226, 232, 240, 0.72) !important;
  }

  body.view-spatial-active .spatial-right .person-aging-item:hover .person-aging-year {
    color: #f2c67a !important;
  }

  /* Previous Landowners & Land History (House Page) */
  .house-landowner-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .house-landowner-card {
    padding: 9px 10px;
    border-radius: 9px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .house-landowner-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
  }

  .house-landowner-name-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    min-width: 0;
  }

  .house-landowner-name {
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--ink);
  }

  .house-landowner-era {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(242, 198, 122, 0.22);
    color: #92400e;
  }

  .house-landowner-role {
    font-size: 0.67rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(13, 148, 136, 0.14);
    color: var(--teal);
  }

  .house-landowner-meta {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--ink-soft);
  }

  .house-landowner-bio {
    font-size: 0.77rem;
    line-height: 1.44;
    color: var(--ink);
  }

  .house-landowner-links {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 3px;
  }

  .house-landowner-link-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    text-decoration: none;
    background: rgba(13, 148, 136, 0.1);
    color: var(--teal);
    border: 1px solid rgba(13, 148, 136, 0.24);
    transition: background 0.14s ease, color 0.14s ease;
  }

  .house-landowner-link-pill:hover {
    background: rgba(13, 148, 136, 0.22);
  }

  .house-lo-del-btn {
    border: 0;
    background: transparent;
    color: rgba(148, 163, 184, 0.7);
    font-size: 0.74rem;
    cursor: pointer;
    padding: 1px 4px;
    border-radius: 4px;
    flex-shrink: 0;
  }

  .house-lo-del-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
  }

  body.view-spatial-active .spatial-right .house-landowner-card {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.11) !important;
  }

  body.view-spatial-active .spatial-right .house-landowner-name {
    color: #f8fafc !important;
  }

  body.view-spatial-active .spatial-right .house-landowner-era {
    background: rgba(242, 198, 122, 0.22) !important;
    color: #f2c67a !important;
  }

  body.view-spatial-active .spatial-right .house-landowner-role {
    background: rgba(45, 212, 191, 0.16) !important;
    color: #5eead4 !important;
  }

  body.view-spatial-active .spatial-right .house-landowner-meta {
    color: rgba(226, 232, 240, 0.74) !important;
  }

  body.view-spatial-active .spatial-right .house-landowner-bio {
    color: rgba(241, 245, 249, 0.9) !important;
  }

  body.view-spatial-active .spatial-right .house-landowner-link-pill {
    background: rgba(242, 198, 122, 0.12) !important;
    color: #f2c67a !important;
    border: 1px solid rgba(242, 198, 122, 0.28) !important;
  }

  body.view-spatial-active .spatial-right .house-landowner-link-pill:hover {
    background: rgba(242, 198, 122, 0.26) !important;
    color: #ffffff !important;
  }

  /* Classic editorial underline tab bar */
  body.view-spatial-active .spatial-right .portal-tabs {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 0 !important;
    padding: 0 0 2px !important;
    gap: 6px !important;
    overflow-x: auto !important;
  }

  body.view-spatial-active .spatial-right .portal-tab-btn,
  body.view-spatial-active .spatial-right .portal-tab {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 3px 3px 0 0 !important;
    padding: 5px 4px !important;
    color: rgba(226, 232, 240, 0.72) !important;
    font-size: 0.77rem !important;
    white-space: nowrap !important;
  }

  body.view-spatial-active .spatial-right .portal-tab-btn:hover,
  body.view-spatial-active .spatial-right .portal-tab:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.06) !important;
  }

  body.view-spatial-active .spatial-right .portal-tab-btn.active,
  body.view-spatial-active .spatial-right .portal-tab.active {
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid #f2c67a !important;
    color: #ffffff !important;
    box-shadow: none !important;
  }

  /* Flatten right-panel buttons to sleek minimal controls */
  body.view-spatial-active .spatial-right .btn {
    background: rgba(255, 255, 255, 0.06) !important;
    border: none !important;
    border-radius: 5px !important;
    color: #f1f5f9 !important;
    box-shadow: none !important;
  }

  body.view-spatial-active .spatial-right .btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
  }

  body.view-spatial-active .spatial-right .btn-primary {
    background: rgba(242, 198, 122, 0.14) !important;
    color: #f8e3b8 !important;
  }

  body.view-spatial-active .spatial-right .btn-teal {
    background: rgba(20, 148, 136, 0.24) !important;
    color: #99f6e4 !important;
  }

  body.view-spatial-active .spatial-right .btn-accent {
    background: rgba(216, 90, 50, 0.24) !important;
    color: #ffb294 !important;
  }

  /* De-pill ALL chips, status badges, residence links, relatives & countries inside Right Portal! */
  body.view-spatial-active .spatial-right .chip,
  body.view-spatial-active .spatial-right .chip-teal,
  body.view-spatial-active .spatial-right .chip-gold,
  body.view-spatial-active .spatial-right .house-status-pill,
  body.view-spatial-active .spatial-right .person-country-chip,
  body.view-spatial-active .spatial-right .person-hist-home-btn,
  body.view-spatial-active .spatial-right .rel-chip,
  body.view-spatial-active .spatial-right .house-resident-chip,
  body.view-spatial-active .spatial-right .house-fp-era-chip,
  body.view-spatial-active .spatial-right .mem-person-pill {
    border-radius: 4px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: none !important;
    border-left: 2px solid rgba(255, 255, 255, 0.22) !important;
    padding: 3px 8px !important;
    box-shadow: none !important;
  }

  body.view-spatial-active .spatial-right .house-status-pill.occupied {
    background: transparent !important;
    border: none !important;
    padding: 2px 0 !important;
    color: #6ee7b7 !important;
  }

  body.view-spatial-active .spatial-right .house-status-pill.former,
  body.view-spatial-active .spatial-right .house-status-pill.future {
    background: transparent !important;
    border: none !important;
    padding: 2px 0 !important;
    color: rgba(226, 232, 240, 0.72) !important;
  }

  body.view-spatial-active .spatial-right .person-hist-home-btn:hover,
  body.view-spatial-active .spatial-right .rel-chip:hover,
  body.view-spatial-active .spatial-right .house-resident-chip:hover,
  body.view-spatial-active .spatial-right .house-fp-era-chip:hover,
  body.view-spatial-active .spatial-right .mem-person-pill:hover {
    background: rgba(242, 198, 122, 0.16) !important;
    border-left-color: #f2c67a !important;
    color: #ffffff !important;
  }

  /* Flatten stacked home/milestone/memory rows into sleek hairline-separated list items */
  body.view-spatial-active .spatial-right .person-home-row,
  body.view-spatial-active .spatial-right .person-milestone-row,
  body.view-spatial-active .spatial-right .person-memory-item {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10) !important;
    border-radius: 4px !important;
    padding: 7px 6px !important;
  }

  body.view-spatial-active .spatial-right .person-home-row.active-home {
    background: rgba(94, 234, 212, 0.10) !important;
    border-left: 2px solid #5eead4 !important;
  }

  body.view-spatial-active .spatial-right .person-home-row:hover,
  body.view-spatial-active .spatial-right .person-memory-item.clickable:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-bottom-color: rgba(242, 198, 122, 0.40) !important;
  }

  body.view-spatial-active .spatial-right .person-bio-card,
  body.view-spatial-active .spatial-right .house-hero-box,
  body.view-spatial-active .spatial-right .house-section-card {
    background: rgba(255, 255, 255, 0.04) !important;
    border: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.10) !important;
    border-radius: 6px !important;
  }
}


/* ==================== HOVER 2X CIRCLE + 4-SECOND UPWARD YELLOW LINEAGE TRACE (v20261127b) ==================== */
.tree-node {
  transition: z-index 0s;
}

.tree-node:not(.horiz-card):hover {
  z-index: 45 !important;
}

.tree-node:not(.horiz-card) .tree-node-avatar {
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.22s ease, box-shadow 0.22s ease;
  will-change: transform;
}

/* Double the hovered person's circle cleanly */
.tree-node:not(.horiz-card):hover .tree-node-avatar {
  transform: scale(2) !important;
  border-color: #fde047 !important;
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.55), 0 12px 30px rgba(0, 0, 0, 0.55) !important;
}

/* Keep hovered person's name pill neatly below the doubled 2x circle */
.tree-node:not(.horiz-card):hover .tree-node-name {
  top: calc(100% + 40px) !important;
  z-index: 46;
}

.tree-node.horiz-card:hover {
  z-index: 45 !important;
}

.tree-node.horiz-card:hover .tree-node-avatar {
  transform: scale(1.75) !important;
  border-color: #fde047 !important;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.55), 0 6px 18px rgba(0, 0, 0, 0.48) !important;
}

/* 4-second upward yellow lineage trace on hover */
.parent-link-hl.hover-trace-active {
  opacity: 1 !important;
  filter: drop-shadow(0 0 7px rgba(250, 204, 21, 0.88));
  pointer-events: none;
}

.parent-link-hl.hover-trace-active path,
.parent-link-hl.hover-trace-active line {
  stroke: #facc15 !important;
}

.tree-node.hover-trace-node {
  z-index: 26;
}

.tree-node.hover-trace-node .tree-node-avatar {
  border-color: #facc15 !important;
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.62), 0 0 18px rgba(234, 179, 8, 0.55) !important;
}

.tree-node.deceased.hover-trace-node .tree-node-avatar img {
  opacity: 0.98 !important;
  filter: none !important;
}

@keyframes hoverAncestorGlowPop {
  0% {
    box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.25), 0 0 6px rgba(234, 179, 8, 0.25);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(250, 204, 21, 0.82), 0 0 24px rgba(234, 179, 8, 0.78);
  }
  100% {
    box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.62), 0 0 18px rgba(234, 179, 8, 0.55);
  }
}

.tree-node.hover-trace-node.hover-trace-pop .tree-node-avatar {
  animation: hoverAncestorGlowPop 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}


/* ==================== INDIVIDUAL VACATION TAB & ROUTE/CRUISE MAP ==================== */
.vac-tab-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.vac-filter-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.vac-filter-chip {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(226, 232, 240, 0.86);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

.vac-filter-chip:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.vac-filter-chip.active {
  background: #f2c67a;
  border-color: #f2c67a;
  color: #1e293b;
}

.vac-map-shell {
  position: relative;
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #0f172a;
  margin-bottom: 8px;
}

.vac-mini-map {
  width: 100%;
  height: 270px;
  z-index: 1;
}

.vac-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 6px 9px;
  background: rgba(15, 23, 42, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.69rem;
  color: rgba(226, 232, 240, 0.88);
}

.vac-leg-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.vac-leg-swatch {
  display: inline-block;
  width: 18px;
  height: 3.5px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(2, 6, 23, 0.85);
}

.vac-leg-swatch.drive {
  background: #ffffff;
}

.vac-leg-swatch.flight {
  background: repeating-linear-gradient(90deg, #ffffff 0 5px, #020617 5px 8px);
}

.vac-leg-swatch.cruise {
  background: repeating-linear-gradient(90deg, #ffffff 0 3px, #020617 3px 6px);
}

.vac-leg-swatch.incountry {
  background: repeating-linear-gradient(90deg, #ffffff 0 7px, #020617 7px 10px);
}

.vac-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vac-card {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  padding: 9px 10px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.vac-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(242, 198, 122, 0.45);
}

.vac-card.active {
  background: rgba(242, 198, 122, 0.11);
  border-color: #f2c67a;
}

.vac-card-top {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.vac-card-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 23, 42, 0.55);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
}

.vac-card-meta {
  flex: 1;
  min-width: 0;
}

.vac-card-title {
  font-weight: 800;
  font-size: 0.85rem;
  color: #f8fafc;
  line-height: 1.25;
}

.vac-card-sub {
  font-size: 0.74rem;
  color: rgba(203, 213, 225, 0.82);
  margin-top: 2px;
}

.vac-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.67rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

.vac-mode-pill.drive {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.vac-mode-pill.flight {
  background: rgba(56, 189, 248, 0.22);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.vac-mode-pill.cruise {
  background: rgba(6, 182, 212, 0.24);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.5);
}

.vac-route-chain {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  font-size: 0.7rem;
  color: rgba(253, 230, 138, 0.92);
}

.vac-detail-drawer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.vac-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 5px;
  margin-top: 6px;
  max-height: 260px;
  overflow-y: auto;
}

.vac-map-legend-inline {
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 8px;
}

.vac-focused-panel {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 12px;
  padding: 10px 11px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.vac-focused-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.vac-focused-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vac-focused-title {
  font-size: 0.94rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.25;
}

.vac-focused-sub {
  font-size: 0.76rem;
  color: rgba(203, 213, 225, 0.88);
}

.vac-focused-notes {
  font-size: 0.78rem;
  color: rgba(226, 232, 240, 0.9);
  margin-top: 7px;
  line-height: 1.4;
}

.vac-focused-panel .vac-photo-grid {
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 6px;
  max-height: none;
  overflow-y: visible;
}

.vac-focused-panel .vac-photo-tile:hover {
  border-color: rgba(242, 198, 122, 0.7);
  transform: translateY(-1px);
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.vac-photo-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  background: #0f172a;
}

.vac-photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vac-photo-tile .vac-ph-tag {
  position: absolute;
  bottom: 2px;
  left: 2px;
  background: rgba(15, 23, 42, 0.84);
  color: #f8fafc;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
}

/* Map marker styles for vacations */
.vac-pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px 2px 4px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.42);
  border: 2px solid #ffffff;
  color: #ffffff;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.vac-pin-badge.drive { background: #059669; }
.vac-pin-badge.flight { background: #0284c7; }
.vac-pin-badge.cruise { background: #0891b2; }
.vac-pin-badge.selected {
  box-shadow: 0 0 0 3px #f2c67a, 0 4px 14px rgba(0, 0, 0, 0.55);
  transform: translate(-50%, -50%) scale(1.1);
}

.vac-pin-thumb {
  width: 18px !important;
  height: 18px !important;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.85);
}

.vac-stop-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f59e0b;
  color: #0f172a;
  font-size: 0.66rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.vac-port-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #06b6d4;
  color: #0f172a;
  font-size: 0.66rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.vac-home-pin {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid #f2c67a;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.vac-mid-icon {
  font-size: 0.92rem;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.75));
  pointer-events: none;
}

/* Vacation Editor Modal */
.vac-form-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

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

.vac-mode-opt {
  border: 1.5px solid var(--border);
  background: #ffffff;
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.14s ease;
}

.vac-mode-opt span {
  font-size: 0.68rem;
  font-weight: 600;
}

.vac-mode-opt.active {
  border-color: var(--teal);
  background: #f0fdfa;
  color: var(--teal);
  box-shadow: 0 2px 8px rgba(13, 104, 97, 0.14);
}

.vac-stop-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vac-stop-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink);
}

.vac-stop-chip button {
  border: 0;
  background: transparent;
  color: #dc2626;
  font-weight: 900;
  cursor: pointer;
  padding: 0 2px;
}

.vac-traveler-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 5px;
  max-height: 150px;
  overflow-y: auto;
}

.vac-traveler-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  padding: 4px 7px;
  border-radius: 7px;
  background: #ffffff;
  border: 1px solid var(--border);
  cursor: pointer;
}

/* Bulk Quick-Add Multiple Vacations UI */
.vac-modal-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.vac-modal-tab {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.vac-modal-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
}

.vac-modal-tab.active {
  background: #ffffff;
  color: var(--teal);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.10);
}

.vac-bulk-rows-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 210px;
  overflow-y: auto;
}

.vac-bulk-row {
  display: grid;
  grid-template-columns: 1.5fr 0.65fr 0.95fr auto;
  gap: 6px;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 7px;
}

.vac-bulk-row .input,
.vac-bulk-row .select {
  min-height: 30px;
  padding: 3px 8px;
  font-size: 0.8rem;
}

.vac-bulk-row-rm {
  border: none;
  background: transparent;
  color: #dc2626;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.vac-bulk-row-rm:hover {
  background: #fee2e2;
}

.vac-bulk-status {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.vac-bulk-status.has-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}


/* ==================== ORGANIZED "EDIT ALL DETAILS" HUB MODAL ==================== */
.ap-hub-modal {
  max-width: 920px !important;
  width: 94vw !important;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.ap-hub-header {
  padding-bottom: 10px;
}

.ap-hub-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
}

.ap-hub-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.14s ease;
}

.ap-hub-tab:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--ink);
}

.ap-hub-tab.active {
  background: var(--teal);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(13, 104, 97, 0.22);
}

.ap-hub-badge {
  font-size: 0.7rem;
  font-weight: 700;
  opacity: 0.85;
}

.ap-hub-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px !important;
  background: #f1f5f9;
}

.ap-section-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 15px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.ap-section-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.ap-section-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--ink);
}

.ap-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.ap-item-row:hover {
  border-color: rgba(13, 104, 97, 0.35);
}

/* ==================== VIRTUAL FILING SYSTEM & INSTANT FILTER EVICTION ==================== */
.vf-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f0fdfa 0%, #eff6ff 100%);
  border: 1.5px solid rgba(13, 104, 97, 0.25);
  font-size: 0.82rem;
}

.vf-card {
  border: 1.5px solid rgba(13, 104, 97, 0.28);
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.vf-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 13px;
  background: linear-gradient(135deg, #f0fdfa 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--border);
}

.vf-disk-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 7px 13px;
  background: #f8fafc;
  border-bottom: 1px dashed var(--border-strong);
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.vf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 13px;
}

@media (max-width: 720px) {
  .vf-grid {
    grid-template-columns: 1fr;
  }
}

.vf-field {
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vf-field-full {
  grid-column: 1 / -1;
}

.vf-field-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.vf-field-lbl {
  font-size: 0.77rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.vf-field-hint {
  font-size: 0.71rem;
  color: var(--ink-soft);
}

.vf-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.vf-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  min-height: 29px;
  border-radius: 8px;
  border: 1.5px solid var(--border-strong);
  background: #ffffff;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}

.vf-toggle-btn:hover {
  border-color: var(--teal);
  color: var(--ink);
}

.vf-toggle-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
}

.vf-toggle-btn.active-gold {
  background: #d97706;
  border-color: #b45309;
  color: #ffffff;
}

.vf-badge-filed {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
  font-size: 0.67rem;
  font-weight: 800;
}

.vf-badge-disk {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  font-size: 0.67rem;
  font-weight: 700;
}

.vf-evicted-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 9px;
  background: #eff6ff;
  border: 1.5px solid #3b82f6;
  color: #1e3a8a;
  font-size: 0.82rem;
  font-weight: 700;
}

.media-card.evicting,
.media-tile.evicting {
  opacity: 0;
  transform: scale(0.86);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.media-card.just-updated,
.media-tile.just-updated {
  box-shadow: 0 0 0 2.5px var(--teal), 0 4px 12px rgba(13, 104, 97, 0.18);
  transition: box-shadow 0.25s ease;
}

.vf-sidebar-section-hdr {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding: 8px 6px 4px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

/* Inline Fast Year & Location Editor directly on Photo Cards */
.card-qe-box {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.archive-hide-qe .card-qe-box {
  display: none !important;
}

.card-qe-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-qe-inp {
  flex: 1;
  min-width: 0;
  height: 26px;
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
}

.card-qe-inp:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(13, 104, 97, 0.14);
}

.card-qe-save {
  height: 26px;
  min-width: 26px;
  padding: 0 7px;
  border: 1px solid rgba(13, 104, 97, 0.4);
  border-radius: 6px;
  background: #f0fdfa;
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.card-qe-save:hover {
  background: var(--teal);
  color: #ffffff;
}

.card-qe-save .qe-ic-rm {
  display: none;
}

/* Assigned (unchanged) checkmark: hover previews red X, click flips to X and clears/removes from stack */
.card-qe-save.is-assigned:hover,
.card-qe-save.is-removing {
  background: #fee2e2;
  border-color: #ef4444;
  color: #dc2626;
}

.card-qe-save.is-assigned:hover .qe-ic-ok,
.card-qe-save.is-removing .qe-ic-ok {
  display: none;
}

.card-qe-save.is-assigned:hover .qe-ic-rm,
.card-qe-save.is-removing .qe-ic-rm {
  display: inline;
}

.card-qe-save.is-removing {
  background: #dc2626;
  color: #ffffff;
}

/* Edited input: bright solid teal checkmark to save the new value */
.card-qe-save.is-dirty {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
}

.card-qe-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.card-qe-pill {
  padding: 1px 6px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: #f8fafc;
  color: var(--ink-soft);
  font-size: 0.69rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.card-qe-pill:hover {
  border-color: var(--teal);
  color: var(--ink);
}

.card-qe-pill.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
}

.card-qe-pill.active:hover {
  background: #dc2626;
  border-color: #b91c1c;
  color: #ffffff;
}

.card-qe-pill.active-gold {
  background: #d97706;
  border-color: #b45309;
  color: #ffffff;
}

.card-qe-pill.active-gold:hover {
  background: #dc2626;
  border-color: #b91c1c;
  color: #ffffff;
}

.vf-priority-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: #0f766e;
  color: #ffffff;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.vf-priority-field {
  background: #ffffff;
  border: 1.5px solid rgba(13, 104, 97, 0.34);
}

/* ==================== TOPBAR WORKSPACE TOGGLES (LEFT OF PEOPLE & PLACES) ==================== */
.topbar-nav-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar .topbar-workspace-toggles {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 0 !important;
  padding: 0 10px 0 0 !important;
  border-top: none !important;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

body.view-spatial-active .topbar .topbar-workspace-toggles {
  display: inline-flex;
}

.topbar .topbar-workspace-toggles .workspace-toggle-hint {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar .topbar-workspace-toggles .wm-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 11px !important;
  border-radius: 6px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: rgba(226, 232, 240, 0.68) !important;
  font-size: 0.8rem !important;
  font-weight: 700;
  box-shadow: none !important;
  transition: all 0.14s ease;
}

.topbar .topbar-workspace-toggles .wm-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.13) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
  color: #ffffff !important;
}

.topbar .topbar-workspace-toggles .wm-toggle-btn.active {
  background: rgba(242, 198, 122, 0.18) !important;
  border: 1px solid rgba(242, 198, 122, 0.62) !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(242, 198, 122, 0.16) !important;
}

.topbar .topbar-workspace-toggles .wm-toggle-btn.active::before {
  content: "✓";
  color: #f2c67a;
  font-weight: 900;
  font-size: 0.76rem;
}

/* ==================== VIDEO PEOPLE / CAST LISTS ==================== */
.video-people-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.video-people-label {
  font-size: 0.71rem;
  font-weight: 800;
  color: var(--ink-soft);
  margin-right: 2px;
}

.video-person-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 700;
  background: #e6f4f1;
  color: #0d5c55;
  border: 1px solid rgba(13, 104, 97, 0.25);
  cursor: pointer;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.video-person-pill:hover {
  background: #cdece6;
  border-color: rgba(13, 104, 97, 0.55);
}

.video-person-pill.confirmed {
  background: #d8f3dc;
  color: #1b4332;
  border-color: rgba(27, 67, 50, 0.28);
}

.video-person-pill.suggested {
  background: #fef3c7;
  color: #92400e;
  border-color: rgba(217, 119, 6, 0.35);
  font-style: italic;
}

.video-person-pill.muted {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
  cursor: default;
  font-weight: 600;
}

.video-cast-roster {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.video-cast-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 11px;
  border-radius: 11px;
  background: #f0fdfa;
  border: 1.5px solid rgba(13, 104, 97, 0.22);
}

.video-cast-row.suggested {
  background: #fffbeb;
  border-color: rgba(217, 119, 6, 0.3);
}

.video-cast-person-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.video-cast-name {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
}

.video-cast-name:hover {
  color: var(--teal);
  text-decoration: underline;
}

.video-cast-ts-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.video-ts-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #fff;
  color: var(--teal);
  border: 1px solid rgba(13, 104, 97, 0.32);
  cursor: pointer;
}

.video-ts-pill:hover {
  background: var(--teal);
  color: #fff;
}

.video-cast-section-lbl {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin-top: 6px;
}

/* ==================== LIVE VIDEO / AUDIO VOICE BOOST BAR ==================== */
.video-player-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 100%;
}

.video-audio-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  font-size: 0.78rem;
  width: fit-content;
  max-width: 100%;
}

.vab-label {
  font-weight: 800;
  color: rgba(241, 245, 249, 0.88);
  white-space: nowrap;
}

.vab-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.vab-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(226, 232, 240, 0.86);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.vab-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.vab-btn.active {
  background: #0d9488;
  border-color: #2dd4bf;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.4);
}

.vab-btn[data-vab-mode="max"].active {
  background: #d97706;
  border-color: #fbbf24;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.42);
}

.vab-gain-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 4px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.vab-gain-lbl {
  font-weight: 800;
  color: #fde68a;
  min-width: 38px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.vab-gain-slider {
  width: 86px;
  accent-color: #fbbf24;
  cursor: pointer;
}

/* ==================== FAMILY LINE ISOLATOR BAR & PYRAMID CONTROLS ==================== */
.tree-line-isolator-bar {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(224, 214, 198, 0.7);
}
.tree-isolator-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.tree-iso-lbl {
  font-size: 0.72rem;
  font-weight: 800;
  color: #475569;
  white-space: nowrap;
}
.tree-iso-pill {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border, #dfd4c2);
  background: #ffffff;
  color: #334155;
  font-size: 0.71rem;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.tree-iso-pill:hover {
  border-color: var(--teal, #2f616b);
  color: var(--teal, #2f616b);
}
.tree-iso-pill.active {
  background: var(--teal, #2f616b);
  border-color: var(--teal, #2f616b);
  color: #ffffff;
}
.tree-iso-select {
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--border, #dfd4c2);
  background: #faf7f1;
  color: #1e293b;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  max-width: 175px;
}
.tree-iso-select.compact {
  max-width: 130px;
}
