@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Color Palette */
  --bg-app: #080c14;
  --bg-sidebar: rgba(26, 26, 26, 0.85);
  --bg-card: rgba(22, 33, 58, 0.65);
  --bg-card-hover: rgba(30, 45, 78, 0.85);
  --bg-card-selected: rgba(79, 70, 229, 0.15);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(99, 102, 241, 0.4);
  --border-color-selected: #f59e0b; /* luxury gold */
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --color-indigo: #6366f1;
  --color-indigo-glow: rgba(99, 102, 241, 0.25);
  --color-gold: #f59e0b;
  --color-gold-glow: rgba(245, 158, 11, 0.3);
  --color-emerald: #10b981;
  --color-rose: #f43f5e;
  
  --sidebar-width: 420px;
  --header-height: 80px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

input, select, textarea, button {
  font-family: var(--font-sans);
  outline: none;
  border: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(8, 12, 20, 0.3);
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.4);
}

/* Grid Layout */
.app-container {
  display: grid;
  grid-template-rows: var(--header-height) 1fr;
  grid-template-columns: 1fr;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* Header Styles */
.app-header {
  background: rgba(8, 12, 20, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-divider {
  color: var(--text-secondary);
  font-size: 1.25rem;
  font-weight: 300;
  user-select: none;
  opacity: 0.45;
}

.brand-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-indigo), var(--color-gold));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
  font-size: 1.45rem;
  line-height: 1;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.brand-subtitle {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-subtitle .gold-number {
  -webkit-text-fill-color: var(--color-gold);
  color: var(--color-gold);
}

.brand-subtext {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
  line-height: 1;
}

.brand-subtext .gold-number {
  color: var(--color-gold);
}

/* Search & Filters */
.controls-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-wrapper {
  position: relative;
  width: 240px;
}

.search-wrapper svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: var(--text-secondary);
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 8px 12px 8px 36px;
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: var(--transition-smooth);
}

.search-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-indigo);
  box-shadow: 0 0 10px var(--color-indigo-glow);
}

.filter-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6" fill="none" stroke="%2394a3b8" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="m1 1 4 4 4-4"/></svg>');
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px 6px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 8px 30px 8px 16px;
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.filter-select:hover {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6" fill="none" stroke="%23f59e0b" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="m1 1 4 4 4-4"/></svg>');
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--border-color-hover);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px 6px;
}

.filter-select option {
  background-color: var(--bg-app);
  color: var(--text-primary);
}

/* Unified Filter Dropdown Styling */
.filter-dropdown-container {
  position: relative;
  display: flex;
}

.btn-filter-trigger {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(13, 20, 35, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
}

.btn-filter-trigger:hover {
  background: rgba(22, 33, 58, 0.9);
  border-color: var(--border-color-hover);
  color: var(--color-indigo);
  transform: translateY(-2px);
}

.btn-filter-trigger.active {
  background-color: rgba(99, 102, 241, 0.15);
  border-color: var(--color-indigo);
  color: var(--color-gold);
}

.btn-filter-trigger svg {
  opacity: 0.7;
  transition: opacity 0.2s;
  pointer-events: none;
}

.btn-filter-trigger.active svg,
.btn-filter-trigger:hover svg {
  opacity: 1;
}

.filter-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-gold);
  color: var(--bg-app);
  font-size: 0.7rem;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.filter-dropdown-menu {
  position: absolute;
  top: 0;
  left: 70px;
  width: 260px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  padding: 16px;
  z-index: 1000;
  display: none;
  flex-direction: column;
  gap: 12px;
  animation: filterDropdownFadeIn 0.2s ease-out;
}

.filter-dropdown-menu.open {
  display: flex;
}

.filter-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.filter-dropdown-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.btn-clear-filters {
  background: none;
  border: none;
  color: var(--color-gold);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s;
}

.btn-clear-filters:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.filter-group .filter-select {
  width: 100%;
  box-sizing: border-box;
}

@keyframes filterDropdownFadeIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}


.btn-primary {
  background: linear-gradient(135deg, var(--color-indigo), #4f46e5);
  color: white;
  font-weight: 500;
  border-radius: 20px;
  padding: 8px 20px;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  transition: var(--transition-smooth);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.btn-primary:active {
  transform: translateY(1px);
}

/* Workspace Layout */
.workspace-wrapper {
  position: relative;
  display: flex;
  overflow: hidden;
  height: 100%;
}

.tree-viewport {
  flex: 1;
  position: relative;
  cursor: grab;
  background-color: var(--bg-app);
  margin-left: 80px;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    radial-gradient(rgba(255, 255, 255, 0.02) 1.5px, transparent 1.5px);
  background-size: 24px 24px, 48px 48px;
  background-position: 0 0, 12px 12px;
}

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

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



.btn-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(13, 20, 35, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-circle:hover {
  background: rgba(22, 33, 58, 0.9);
  border-color: var(--border-color-hover);
  color: var(--color-indigo);
  transform: translateY(-2px);
}

.btn-circle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* HTML Node Card Styles (Inside SVG foreignObject) */
.node-card {
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  margin: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1.5px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.node-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
  box-shadow: 0 0 15px var(--color-indigo-glow);
  transform: translateY(-2px);
}

.node-card.selected {
  background: var(--bg-card-selected);
  border-color: var(--border-color-selected);
  box-shadow: 0 0 20px var(--color-gold-glow);
}

.node-card.highlighted {
  border-color: var(--color-indigo);
  box-shadow: 0 0 15px var(--color-indigo-glow);
}

.node-card.context-active {
  background: var(--bg-card-hover);
  border-color: var(--color-indigo);
  box-shadow: 0 0 20px var(--color-indigo-glow);
  transform: translateY(-2px);
}

.node-card.faded {
  opacity: 0.25;
  pointer-events: none;
}

.node-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
}

.node-name-full, .node-name-first {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.node-name-first {
  display: none;
}
.node-name-full {
  display: -webkit-box;
}

.node-flag {
  font-size: 1.25rem;
}

.node-dates {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.node-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.node-age {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.node-status {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  text-transform: uppercase;
}

.node-status.living {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-emerald);
}

.node-status.deceased {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-secondary);
}

/* Zoomed Out Status Badge Circle */
.node-status-badge {
  display: none; /* hidden by default */
  width: 18px;
  height: 18px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  user-select: none;
}

.node-status-badge.living {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-emerald);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.node-status-badge.deceased {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-secondary);
  border: 1px solid rgba(100, 116, 139, 0.4);
}


/* Connection Lines */
.connection-line {
  stroke: rgba(148, 163, 184, 0.45);
  stroke-width: 3.5px;
  fill: none;
  transition: stroke 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              stroke-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.connection-line.spouse-link {
  stroke: var(--color-gold);
  stroke-width: 3.5px;
  stroke-dasharray: 6, 4;
  opacity: 0.9;
  filter: drop-shadow(0 0 4px var(--color-gold-glow));
}

.connection-line.highlight {
  stroke: var(--color-indigo);
  stroke-width: 5px;
  filter: drop-shadow(0 0 6px var(--color-indigo-glow));
}

.connection-line.highlight-spouse {
  stroke: var(--color-gold);
  stroke-width: 5px;
  filter: drop-shadow(0 0 6px var(--color-gold-glow));
}

.connection-line.faded {
  opacity: 0.15;
}

.connection-line.comparison-link {
  stroke: var(--color-indigo);
  stroke-width: 4.5px;
  stroke-dasharray: 4, 4;
  filter: drop-shadow(0 0 10px var(--color-indigo-glow));
  animation: pulseLine 2s infinite alternate;
}

@keyframes pulseLine {
  from { opacity: 0.7; stroke-width: 4.5px; }
  to { opacity: 1; stroke-width: 6.5px; }
}

/* Sidebar Styling */
.sidebar {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 3px solid rgba(255, 255, 255, 0.3);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 8;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-close {
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-close:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}

.btn-close svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Profile Panel Inside Sidebar */
.profile-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(245, 158, 11, 0.2));
  border: 2px solid var(--color-indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.profile-name-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
}

.profile-flag {
  font-size: 1.75rem;
}

.profile-maiden {
  font-size: 0.9rem;
  color: var(--color-gold);
  font-style: italic;
  margin-top: -2px;
  margin-bottom: 6px;
  text-align: center;
}

.profile-dates {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.profile-badges {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.profile-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
}

.profile-badge.age {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.profile-badge.country {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.profile-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  width: 100%;
}

.btn-secondary {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 500;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-color-hover);
}

.btn-secondary.btn-delete {
  color: var(--color-rose);
  border-color: rgba(244, 63, 94, 0.2);
}

.btn-secondary.btn-delete:hover {
  background: rgba(244, 63, 94, 0.08);
  border-color: var(--color-rose);
}

/* Sidebar Metadata Grid (Zodiac, US President, etc.) */
.profile-metadata-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metadata-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
}

.metadata-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.metadata-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Relationship Sections in Sidebar */
.info-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-indigo);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 4px;
}

.relations-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.relation-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.relation-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-color-hover);
  transform: translateX(4px);
}

.relation-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.relation-flag {
  font-size: 1.1rem;
}

.relation-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.relation-type {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(99, 102, 241, 0.1);
  padding: 2px 6px;
  border-radius: 6px;
}

.relation-dates {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.no-data {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Timeline Elements */
.timeline {
  position: relative;
  padding-left: 20px;
  margin-left: 6px;
  border-left: 2px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.timeline-item {
  position: relative;
}

.timeline-marker {
  position: absolute;
  left: -27px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-app);
  border: 2px solid var(--text-muted);
  transition: var(--transition-smooth);
}

.timeline-item.personal .timeline-marker {
  border-color: var(--color-indigo);
  background: var(--color-indigo);
  box-shadow: 0 0 8px var(--color-indigo);
}

.timeline-item.historical .timeline-marker {
  border-color: var(--color-gold);
}

.timeline-year {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.timeline-item.personal .timeline-year {
  color: var(--color-indigo);
}

.timeline-item.historical .timeline-year {
  color: var(--color-gold);
}

.timeline-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

/* Modal Overlay & Styling */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 520px;
  max-width: 90vw;
  max-height: 90vh;
  background: rgba(13, 20, 35, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-overlay.open .modal-card {
  transform: scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 600;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-select {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  height: 42px !important;
  padding: 0 14px;
  line-height: 40px;
  box-sizing: border-box !important;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
  width: 100%;
}

.form-input:focus {
  border-color: var(--color-indigo);
  background-color: rgba(255, 255, 255, 0.07);
}

.form-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6" fill="none" stroke="%2394a3b8" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="m1 1 4 4 4-4"/></svg>') !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 10px 6px !important;
  padding-right: 30px !important;
  cursor: pointer;
}

.form-select:focus {
  border-color: var(--color-indigo);
  background-color: rgba(255, 255, 255, 0.07);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6" fill="none" stroke="%23818cf8" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="m1 1 4 4 4-4"/></svg>') !important;
}

.form-select option {
  background-color: var(--bg-app);
  color: var(--text-primary);
}

.form-help {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.form-spouse-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.form-spouse-header .form-label {
  margin-bottom: 0;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-container input[type="checkbox"] {
  accent-color: var(--color-indigo);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Custom Delete Modal */
.modal-card.delete-card {
  width: 420px;
}

.delete-body p {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-primary);
  padding: 1.5rem;
}

.delete-body p strong {
  color: var(--color-rose);
}

.btn-delete-confirm {
  background: linear-gradient(135deg, var(--color-rose), #be123c) !important;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3) !important;
}

.btn-delete-confirm:hover {
  background: linear-gradient(135deg, #f43f5e, #e11d48) !important;
}

/* Legend Styles */
.tree-legend {
  position: absolute;
  right: 24px;
  bottom: 24px;
  background: rgba(13, 20, 35, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  z-index: 5;
  display: flex;
  flex-direction: column;
}

.legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.btn-legend-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
}

.btn-legend-toggle:hover {
  color: var(--text-primary);
}

.tree-legend:not(.collapsed) .btn-legend-toggle {
  transform: rotate(180deg);
}

.legend-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, margin-top 0.3s ease;
}

.tree-legend.collapsed .legend-content {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.tree-legend:not(.collapsed) .legend-content {
  margin-top: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-color.indigo { background: var(--color-indigo); }
.legend-color.gold { background: var(--color-gold); }
.legend-color.slate { background: var(--text-secondary); }
.legend-color.green { background: var(--color-emerald); }

.legend-line {
  height: 2px;
  width: 16px;
}
.legend-line.dash {
  border-bottom: 2px dashed var(--color-gold);
}
.legend-line.solid {
  background: rgba(148, 163, 184, 0.4);
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
  .app-header {
    padding: 0 1rem;
  }
  
  .controls-group {
    gap: 0.5rem;
  }
  
  .search-wrapper {
    width: 130px;
  }
  
  .search-input {
    padding: 6px 10px 6px 28px;
    font-size: 0.8rem;
  }
  
  .search-wrapper svg {
    left: 8px;
    width: 12px;
    height: 12px;
  }
  
  .filter-select {
    padding: 6px 26px 6px 10px;
    background-position: right 10px center;
    font-size: 0.8rem;
  }
  
  .btn-primary {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  
  .sidebar {
    width: 100vw;
    height: 60vh;
    top: auto;
    bottom: 0;
    transform: translateY(100%);
    border-left: none;
    border-top: 1px solid var(--border-color);
  }
  
  .sidebar.open {
    transform: translateY(0);
  }
  
  .left-rail {
    bottom: calc(60vh + 24px);
    transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }
  
  .sidebar.open ~ .left-rail {
    bottom: calc(60vh + 24px);
  }
}

/* Relation Finder Toast Styles */
.relation-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translate(-50%, -150%);
  z-index: 1000;
  background: rgba(13, 20, 35, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--color-indigo);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px var(--color-indigo-glow);
  width: 420px;
  max-width: 90vw;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.relation-toast.open {
  transform: translate(-50%, 0);
}

.toast-content {
  padding: 12px 16px;
}

.toast-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.toast-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-indigo);
}

.toast-body {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.toast-body strong {
  color: var(--color-gold);
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
  height: auto !important;
  padding: 10px 14px !important;
  line-height: 1.5 !important;
}

.profile-notes {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-primary);
  font-style: italic;
  font-weight: 300;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px dashed var(--border-color);
  margin-top: 4px;
}

#form-flag {
  font-size: 1.1rem;
  padding: 0 14px;
  height: 42px !important;
  line-height: 40px;
  box-sizing: border-box !important;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  cursor: default;
}

#form-flag::placeholder {
  font-size: 0.9rem;
}

/* Custom Context Menu */
.context-menu {
  position: fixed;
  display: none;
  background: rgba(13, 20, 35, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  padding: 6px;
  z-index: 1000;
  min-width: 180px;
  animation: contextMenuFadeIn 0.15s ease-out;
}

@keyframes contextMenuFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.context-menu .menu-item {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: var(--transition-smooth);
}

.context-menu .menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.context-menu .menu-item.delete {
  color: var(--color-rose);
}

.context-menu .menu-item.delete:hover {
  background: rgba(244, 63, 94, 0.15);
}

.context-menu .menu-item:disabled {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
  background: transparent !important;
}

.context-menu .menu-item.delete:disabled {
  color: rgba(244, 63, 94, 0.4) !important;
}

/* ========================================== PLAYBACK TIMELINE (EASY ROLLBACK) ========================================== */
.timeline-dock {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 20, 35, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 9;
  width: 720px;
  max-width: 95vw;
  animation: timelineDockFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-audio-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.timeline-soundtrack-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 4px 10px 4px 28px;
  transition: var(--transition-smooth);
}

.timeline-soundtrack-wrapper:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-indigo);
  box-shadow: 0 0 10px var(--color-indigo-glow);
}

.timeline-music-icon {
  position: absolute;
  left: 9px;
  width: 14px;
  height: 14px;
  color: var(--color-gold);
  pointer-events: none;
}

.timeline-soundtrack-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  padding-right: 2px;
}

.timeline-soundtrack-select option {
  background: #0d1423;
  color: var(--text-primary);
}

.timeline-volume-container {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2px 10px 2px 3px;
  gap: 6px;
  transition: var(--transition-smooth);
}

.timeline-volume-container:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-indigo);
  box-shadow: 0 0 10px var(--color-indigo-glow);
}

.timeline-volume-container .btn-time-control.audio {
  border: none !important;
  background: transparent !important;
  width: 28px;
  height: 28px;
  padding: 0;
  box-shadow: none !important;
  color: var(--text-primary);
}

.timeline-volume-container .btn-time-control.audio:hover {
  color: var(--color-indigo);
  transform: scale(1.1);
}

.timeline-volume-container .btn-time-control.audio.muted {
  color: var(--text-muted);
}

.timeline-volume-container .btn-time-control.audio.muted:hover {
  color: #f43f5e;
}

.timeline-volume-slider-wrapper {
  display: flex;
  align-items: center;
  width: 64px;
}

.timeline-volume-range {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  accent-color: var(--color-indigo);
}

.timeline-volume-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(99, 102, 241, 0.6);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.timeline-volume-range::-webkit-slider-thumb:hover {
  transform: scale(1.3);
  background: var(--color-indigo);
}

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

.timeline-scrubber-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.25rem;
}

.timeline-text-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-sans);
}

.timeline-current-year {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-gold);
  text-shadow: 0 0 10px var(--color-gold-glow);
}

.timeline-stats {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Custom styling for the range input */
.timeline-range-input {
  -webkit-appearance: none;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  height: 6px;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.timeline-range-input::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.timeline-range-input::-webkit-slider-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--color-indigo);
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -5px;
  box-shadow: 0 0 8px var(--color-indigo-glow);
  transition: var(--transition-smooth);
}

.timeline-range-input::-webkit-slider-thumb:hover {
  background: #4f46e5;
  transform: scale(1.2);
  box-shadow: 0 0 12px var(--color-indigo);
}

.btn-time-control {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
  transition: var(--transition-smooth);
}

.btn-time-control svg {
  width: 18px;
  height: 18px;
}

.btn-time-control:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-indigo);
  color: var(--color-indigo);
  box-shadow: 0 0 10px var(--color-indigo-glow);
  transform: scale(1.05);
}

.btn-time-control.reset:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
  box-shadow: 0 0 10px var(--color-gold-glow);
}

/* Node card disabled state for timeline playback */
.node-card.time-inactive {
  opacity: 0.15 !important;
  pointer-events: none !important;
  filter: grayscale(80%) !important;
  box-shadow: none !important;
  border-color: var(--border-color) !important;
  background: rgba(10, 15, 30, 0.3) !important;
}

/* Adjust timeline placement when sidebar is open on smaller layouts */
@media (max-width: 900px) {
  .timeline-dock {
    bottom: calc(60vh + 24px);
  }
}

/* Empty Tree State Placeholder */
.empty-tree-state {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  z-index: 4;
}

.empty-tree-placeholder {
  text-align: center;
  color: var(--text-secondary);
  padding: 36px 32px;
  border: 1.5px dashed var(--border-color);
  border-radius: 16px;
  background: rgba(13, 20, 35, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  max-width: 580px;
  width: 90%;
  box-sizing: border-box;
  margin-bottom: 40px;
  pointer-events: auto;
}

.empty-tree-placeholder .icon {
  font-size: 2.75rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.empty-tree-placeholder .title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.empty-tree-placeholder .description {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0 0 0.85rem 0;
}

.empty-tree-placeholder .description:last-child {
  margin-bottom: 0;
}

.empty-tree-placeholder .description strong {
  color: var(--color-indigo);
  font-weight: 600;
}

.empty-tree-add-icon {
  display: inline-block;
  width: 1.3em;
  height: 1.3em;
  vertical-align: -0.28em;
  margin: 0 0.18em;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(79, 70, 229, 0.35));
}

/* Revert to native date inputs without calendar icons */
input[type="date"]::-webkit-calendar-picker-indicator {
  display: none;
  -webkit-appearance: none;
}

/* Header Backup/Restore Buttons */
.btn-header-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 500;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.btn-header-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-color-hover);
}

.btn-header-secondary svg {
  opacity: 0.8;
}

/* Reset Page Button */
.btn-reset-page {
  background: linear-gradient(135deg, var(--color-gold), #d97706);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--color-gold-glow);
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.btn-reset-page:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.45);
  background: linear-gradient(135deg, #d97706, #b45309);
}

.btn-reset-page:active {
  transform: translateY(1px);
}

.btn-reset-page svg {
  opacity: 0.9;
  pointer-events: none;
}

/* Add Member Button Custom styles */
.add-member-container {
  position: relative;
  display: flex;
}

#btn-add-member {
  border-radius: 50% !important;
  width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  flex-shrink: 0 !important;
}

#btn-add-member svg {
  pointer-events: none;
}

.add-member-tooltip {
  position: absolute;
  top: 46px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  pointer-events: none;
  z-index: 100;
}

.add-member-container:hover .add-member-tooltip,
.add-member-container:focus-within .add-member-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Tree Selector UI */
.tree-selector-container {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2px 6px;
  height: 38px;
  box-sizing: border-box;
}

.tree-selector-container select.select-tree {
  border: none;
  background: transparent;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6" fill="none" stroke="%23f59e0b" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="m1 1 4 4 4-4"/></svg>');
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 8px 5px;
  padding: 0 20px 0 8px;
  font-weight: 600;
  color: var(--color-gold);
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
  height: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.tree-selector-container select.select-tree option {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-weight: normal;
}

.btn-icon-only {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 0.95rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-color: transparent !important;
}

.btn-icon-only:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--border-color-hover) !important;
}

#btn-delete-tree:hover {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.1) !important;
}

/* ─── Magnifier Toggle Button (Purple Circle) ─── */
.magnifier-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-indigo), #4f46e5);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.magnifier-toggle-btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
  border-color: var(--color-gold);
}

.magnifier-toggle-btn.active {
  background: linear-gradient(135deg, var(--color-gold) 0%, #d97706 100%);
  border-color: #ffffff;
  box-shadow: 0 0 12px var(--color-gold-glow);
}

/* ─── Magnifier Lens ─── */
.magnifier-lens {
  position: absolute;
  width: 500px;
  height: 280px;
  border-radius: 20px;
  border: 2px solid var(--border-color-hover);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.3),
    0 8px 32px rgba(0, 0, 0, 0.5),
    inset 0 0 30px rgba(99, 102, 241, 0.05);
  overflow: hidden;
  pointer-events: auto;
  cursor: pointer;
  z-index: 100;
  background: var(--bg-app);
  transform: translate(-50%, -50%);
  transition: opacity 0.15s ease;
}

.magnifier-label {
  position: absolute;
  z-index: 100;
  font-size: 12px;
  font-family: var(--font-primary);
  color: var(--text-secondary);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.7;
  transform: translateX(-50%);
  transition: opacity 0.15s ease;
}

.magnifier-lens svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Override zoom-level-out styles inside the lens — not needed, pure SVG chips */

/* Dynamic Level of Detail (LOD) - Zoomed Out Styles */
.zoom-level-out .node-card {
  height: 110px !important;
  width: calc(100% - 24px);
  margin: 12px;
  padding: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}

.zoom-level-out .node-card:hover {
  transform: none !important;
}

.zoom-level-out .node-header {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 20px; /* pill shape */
  transition: var(--transition-smooth);
  gap: 6px;
}

.zoom-level-out .node-card:hover .node-header {
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
  box-shadow: 0 0 15px var(--color-indigo-glow);
  transform: translateY(-2px);
}

.zoom-level-out .node-card.selected .node-header {
  background: var(--bg-card-selected);
  border-color: var(--color-gold);
  box-shadow: 0 0 20px var(--color-gold-glow);
}

.zoom-level-out .node-card.highlighted .node-header {
  border-color: var(--color-indigo);
  box-shadow: 0 0 15px var(--color-indigo-glow);
}

.zoom-level-out .node-name-full {
  display: none !important;
}

.zoom-level-out .node-name-first {
  display: inline-block !important;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
  -webkit-line-clamp: none;
  -webkit-box-orient: horizontal;
}

.zoom-level-out .node-flag {
  display: none !important;
}

.zoom-level-out .node-status-badge {
  display: flex !important;
}

.zoom-level-out .node-dates {
  display: none !important;
}

.zoom-level-out .node-footer {
  display: none !important;
}

/* Timeline Activation Feedback - Option B (Radiant Border Pulse) */
@keyframes timeline-activate-normal {
  0% {
    border-color: var(--border-color);
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
  12.5% {
    border-color: var(--color-indigo);
    box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.6);
  }
  100% {
    border-color: var(--border-color);
    box-shadow: 0 0 0 20px rgba(99, 102, 241, 0);
  }
}

@keyframes timeline-activate-zoomed-out {
  0% {
    border-color: var(--border-color);
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
  12.5% {
    border-color: var(--color-indigo);
    box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.6);
  }
  100% {
    border-color: var(--border-color);
    box-shadow: 0 0 0 15px rgba(99, 102, 241, 0);
  }
}

.timeline-active:not(.zoom-level-out) .node-card:not(.time-inactive) {
  animation: timeline-activate-normal 2.0s cubic-bezier(0.25, 1, 0.5, 1) both;
}

.timeline-active.zoom-level-out .node-card:not(.time-inactive) .node-header {
  animation: timeline-activate-zoomed-out 2.0s cubic-bezier(0.25, 1, 0.5, 1) both;
}

/* Unified Left Rail Controls */
.left-rail {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 80px;
  background-color: #000000;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0 24px 0;
  z-index: 100;
  box-sizing: border-box;
}

.left-rail-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

/* Custom Instant Tooltip System */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 50%;
  left: 50px;
  transform: translateY(-50%) translateX(-8px);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
  z-index: 10005;
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* Suppress tooltips in top-group when Filter dropdown is open */
.top-group:has(.filter-dropdown-menu.open) [data-tooltip]::after {
  opacity: 0 !important;
  visibility: hidden !important;
  transition: none !important;
}

.settings-container,
.help-container,
.filter-dropdown-container {
  position: relative;
  display: flex;
}

/* Settings Button & Dropdown */
.btn-settings-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #475569, #334155);
  color: #e2e8f0;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: var(--transition-smooth);
}

.btn-settings-circle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(71, 85, 105, 0.45);
  background: linear-gradient(135deg, #64748b, #475569);
  color: white;
}

.btn-settings-circle svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.settings-dropdown {
  position: absolute;
  bottom: 0;
  left: 70px;
  width: 180px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  color: var(--text-primary);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  pointer-events: none;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-dropdown h3 {
  margin-top: 0;
  margin-bottom: 4px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 6px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.btn-settings-action {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-smooth);
  width: 100%;
  box-sizing: border-box;
}

.btn-settings-action:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-color-hover);
  transform: translateY(-1px);
}

.btn-settings-action svg {
  opacity: 0.8;
  flex-shrink: 0;
}

.settings-container:hover .settings-dropdown,
.settings-container:focus-within .settings-dropdown,
.settings-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}

/* Hover-bridge pseudo-element to prevent dropdown/tooltip dismissal across the gap */
.settings-dropdown::before,
.help-tooltip::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -32px;
  width: 32px;
  height: calc(100% + 20px);
}

/* Floating Help Icon & Tooltip */
.btn-help-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-gold);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--color-gold-glow);
  transition: var(--transition-smooth);
}

.btn-help-circle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.45);
  background: #ea580c;
}

.help-tooltip {
  position: absolute;
  bottom: -14px;
  left: 70px;
  width: 310px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  color: var(--text-primary);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  pointer-events: none;
  z-index: 100;
}

.help-container:hover .help-tooltip,
.help-container:focus-within .help-tooltip,
.help-tooltip.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}

.help-tooltip h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 0.95rem;
  color: var(--color-gold);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 6px;
  font-weight: 600;
}

.help-tooltip ul {
  margin: 0;
  padding-left: 16px;
  font-size: 0.8rem;
  line-height: 1.4;
}

.help-tooltip li {
  margin-bottom: 8px;
}

.help-tooltip li strong {
  color: var(--text-primary);
}

.help-tooltip code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 4px;
  border-radius: 4px;
  font-family: monospace;
  color: #fbbf24;
}

.help-tooltip li.help-alert {
  color: #ef4444 !important;
  font-weight: 600 !important;
}

/* Access Control & Settings enhancements */
.btn-header-secondary:disabled,
.btn-settings-action:disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.settings-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 0;
  width: 100%;
}



/* ========================================== TREE SELECTOR PORTAL STYLES ========================================== */
/* Auth state body selectors */
body.auth-pending #starter-signed-out-state,
body.auth-pending .app-header {
  display: none !important;
}

body:not(.user-signed-in) .app-header {
  display: none !important;
}

.starter-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  background: #080c14;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  padding: 3rem 1rem;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s;
  opacity: 1;
  visibility: visible;
}

.starter-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.starter-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 3.5rem 2.5rem;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(99, 102, 241, 0.05);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body:not(.user-signed-in):not(.auth-pending) .starter-card > .starter-logo,
body:not(.user-signed-in):not(.auth-pending) .starter-card > .starter-title {
  display: none;
}

body:not(.user-signed-in):not(.auth-pending) .starter-card {
  max-width: 1280px;
  width: 100%;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.starter-signed-out-state {
  width: 100%;
}

/* Landing Page Components */
.landing-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: rgba(8, 12, 20, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-header-inner {
  width: 100%;
  max-width: 1280px;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.landing-header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.landing-header-logo {
  font-size: 1.5rem;
}

.landing-header-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.landing-header-actions .btn-google-login {
  margin-top: 0;
}

.landing-hero {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 5rem;
  margin-bottom: 0;
}

.landing-hero-headline {
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  max-width: 25ch;
}

.landing-hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 60ch;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.landing-hero-media-wrapper {
  width: 100%;
  max-width: 1280px;
  max-height: 48vh;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: var(--bg-card);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(245, 158, 11, 0.12);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.landing-hero-img,
.landing-hero-video,
.landing-hero-poster-fallback {
  width: 100%;
  max-height: 48vh;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: left top;
}

.landing-hero-poster-fallback {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .landing-hero-video {
    display: none !important;
  }
  .landing-hero-poster-fallback {
    display: block !important;
  }
}

.landing-divider {
  width: 100%;
  max-width: 1280px;
  margin: 5rem auto;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.landing-features {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.landing-feature-section {
  display: flex;
  align-items: center;
  gap: 4rem;
  width: 100%;
}

.landing-feature-reverse {
  flex-direction: row-reverse;
}

.landing-feature-content {
  flex: 1;
  text-align: left;
}

.landing-feature-reverse .landing-feature-content {
  text-align: left;
}

.landing-feature-title {
  font-size: 1.75rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.landing-feature-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 68ch;
}

.landing-feature-media {
  flex: 1;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: var(--bg-card);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4), 0 0 25px rgba(245, 158, 11, 0.10);
}

.landing-feature-img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.landing-grid-section {
  width: 100%;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

.landing-grid-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.75rem;
  text-align: left;
}

.landing-grid-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.landing-grid-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--color-gold);
}

.landing-grid-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 65ch;
}

.landing-closing-section {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.landing-closing-text {
  font-size: 1.2rem;
  color: var(--text-primary);
  line-height: 1.6;
  max-width: 65ch;
  margin: 0 auto;
}

.landing-closing-actions {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
}

.landing-closing-actions .btn-google-login {
  margin-top: 0;
}

.landing-footer {
  width: 100%;
  padding: 0 0 3rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.9rem;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (max-width: 768px) {
  .landing-feature-section,
  .landing-feature-reverse {
    flex-direction: column;
    text-align: center;
  }

  .landing-feature-content,
  .landing-feature-reverse .landing-feature-content {
    text-align: center;
  }

  .landing-footer {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }
}

.starter-logo {
  font-size: 3rem;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--color-indigo), var(--color-gold));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.3);
  margin-bottom: 0.5rem;
  animation: starterLogoPulse 3s infinite alternate ease-in-out;
}

@keyframes starterLogoPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.3);
  }
  100% {
    transform: scale(1.05);
    box-shadow: 0 0 35px rgba(245, 158, 11, 0.4);
  }
}

.starter-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.25rem;
}

.starter-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.5;
  max-width: 460px;
  margin-bottom: 1.25rem;
}
/* ========================================== TREE ENTRANCE ANIMATIONS ========================================== */
@keyframes card-entrance {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.node-card-animate {
  animation: card-entrance 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0; /* Hidden by default until animation starts */
}

@keyframes line-entrance {
  to {
    stroke-dashoffset: 0;
  }
}

.connection-line-animate {
  animation: line-entrance 2.0s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transition: none !important;
}

@keyframes fade-in-entrance {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in-animate {
  animation: fade-in-entrance 1.0s ease-out forwards;
  opacity: 0;
}

/* ========================================== MOBILE/TABLET BLOCK OVERLAY ========================================== */
.mobile-block-overlay {
  display: none;
}

@media (max-width: 1024px) {
  .mobile-block-overlay {
    position: fixed;
    inset: 0;
    z-index: 200000;
    background: radial-gradient(circle at top center, rgba(99, 102, 241, 0.15) 0%, #080c14 100%);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #ffffff;
  }
}

.mobile-block-overlay.force-show {
  position: fixed;
  inset: 0;
  z-index: 200000;
  background: radial-gradient(circle at top center, rgba(99, 102, 241, 0.15) 0%, #080c14 100%);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: #ffffff;
}

.mobile-block-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 3rem 2rem;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(99, 102, 241, 0.05);
  text-align: center;
}

.mobile-block-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  animation: floatLaptop 3s ease-in-out infinite;
}

@keyframes floatLaptop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.mobile-block-gold-message {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--color-gold) !important;
  margin: 0;
  text-shadow: 0 0 10px var(--color-gold-glow);
}

/* ========================================== SEARCH RESULTS OVERLAY ========================================== */
.search-results-card {
  width: 800px;
  max-width: 95vw;
}

.search-results-body {
  padding: 8px 16px 20px 16px;
}

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(244px, 1fr));
  gap: 16px;
  justify-items: center;
  padding: 4px;
  max-height: 55vh;
  overflow-y: auto;
}

/* Custom scrollbar for search results grid */
.search-results-grid::-webkit-scrollbar {
  width: 6px;
}
.search-results-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 3px;
}
.search-results-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
.search-results-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.search-result-item {
  width: 244px;
  height: 134px;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.search-result-item:hover {
  transform: scale(1.03);
}

.no-search-results {
  grid-column: 1 / -1;
  color: var(--color-gold);
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  text-align: center;
  padding: 3rem 1rem;
}

/* ========================================== AI HELPER CHAT PANEL ========================================== */

.ai-chat-trigger {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-indigo) 0%, var(--color-purple) 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-chat-trigger:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
  border-color: var(--color-gold);
}

.ai-chat-window {
  position: fixed;
  bottom: 24px;
  left: 90px;
  width: 450px;
  height: 580px;
  max-height: 75vh;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: translateX(-20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-chat-window.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.02);
}

.ai-chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ai-chat-avatar {
  font-size: 1.25rem;
}

.ai-chat-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 24px;
  height: 24px;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-chat-close svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.ai-chat-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.ai-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Custom scrollbar for chat body */
.ai-chat-body::-webkit-scrollbar {
  width: 4px;
}

.ai-chat-body::-webkit-scrollbar-track {
  background: transparent;
}

.ai-chat-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.ai-chat-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ai-message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.ai-message.assistant {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  align-self: flex-start;
  border-top-left-radius: 2px;
}

.ai-message.ai-greeting {
  max-width: 100%;
  align-self: stretch;
}

.ai-message.user {
  background: var(--color-indigo);
  color: #ffffff;
  align-self: flex-end;
  border-top-right-radius: 2px;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

.ai-suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  align-self: flex-start;
}

.ai-chip {
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--color-gold);
  padding: 6px 12px;
  border-radius: 14px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-chip:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--color-gold);
  transform: translateY(-1px);
}

.ai-chat-footer {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px 16px;
  border-top: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.01);
}

#ai-chat-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s;
}

#ai-chat-input:focus {
  border-color: var(--color-indigo);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.btn-ai-send {
  background: var(--color-indigo);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ai-send:hover {
  background: var(--color-purple);
  transform: scale(1.05);
}

.chat-member-link {
  color: var(--color-gold);
  font-weight: 700;
  text-decoration: underline dotted;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-member-link:hover {
  color: #ffffff;
  background: rgba(245, 158, 11, 0.2);
  border-radius: 4px;
  padding: 0 2px;
}

/* Loading animation dots */
.ai-loading-dots {
  display: flex;
  gap: 4px;
  padding: 6px 10px;
  align-items: center;
}

.ai-loading-dot {
  width: 6px;
  height: 6px;
  background-color: var(--text-secondary);
  border-radius: 50%;
  animation: dotPulse 1.4s infinite ease-in-out both;
}

.ai-loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dotPulse {
  0%, 80%, 100% { 
    transform: scale(0);
  } 40% { 
    transform: scale(1.0);
  }
}

@media (max-width: 480px) {
  .ai-chat-window {
    width: calc(100% - 32px);
    right: 16px;
    left: 16px;
    bottom: 80px;
    height: 65vh;
  }
}

/* ========================================== AUTH & PEER-LOCKING UI STYLES ========================================== */

/* Google Sign-In Button */
.btn-google-login {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(30, 41, 59, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
  margin-top: 16px;
  box-shadow: var(--shadow-sm);
}

.btn-google-login:hover {
  border-color: var(--color-gold);
  box-shadow: 0 0 15px var(--color-gold-glow);
  transform: translateY(-1px);
}

.google-icon {
  width: 18px;
  height: 18px;
}

.btn-starter-secondary {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-starter-secondary:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Avatar Containers & Fallbacks */
.user-avatar-container {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--color-gold);
  background: linear-gradient(135deg, #10b981, #d97706);
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.user-avatar-container:hover {
  border-color: #ffffff;
}

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

.user-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
}

/* Header User Profile Widget */
.header-user-profile {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 10px;
}

/* Profile Dropdown Menu */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 175px;
  background: rgba(30, 41, 59, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
  flex-direction: column;
  gap: 4px;
  animation: profileDropdownFadeIn 0.2s ease-out;
}

.profile-dropdown::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

.header-user-profile:hover .profile-dropdown,
.profile-dropdown.open {
  display: flex;
}

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

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.profile-dropdown-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

#header-btn-logout:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
}

.profile-dropdown-item svg {
  color: inherit;
  transition: none;
}


/* Shimmer Loader / Status Alerts */
.starter-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px 0;
}

.shimmer-loader {
  width: 140px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  margin-top: 10px;
}

.shimmer-loader::after {
  content: '';
  display: block;
  width: 50px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(217, 119, 6, 0.5), transparent);
  position: absolute;
  top: 0;
  left: -50px;
  animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
  100% {
    left: 140px;
  }
}

/* Share Tree Modal / Table Layout */
.share-modal-card {
  max-width: 500px !important;
}

.add-collaborator-form {
  margin-bottom: 20px;
}

.add-collaborator-form-action .form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.flex-3 {
  flex: 3;
}

.flex-2 {
  flex: 2;
}

.btn-align {
  display: flex;
  align-items: center;
}

.share-section-title {
  font-size: 13px;
  color: var(--color-gold);
  margin: 16px 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 4px;
}

.collaborators-list-wrapper {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.01);
}

.collaborators-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.collaborators-table th, .collaborators-table td {
  padding: 8px 12px;
  text-align: left;
}

.collaborators-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.collaborators-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.collaborator-email {
  color: var(--text-primary);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collaborator-role-dropdown {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
}

.collaborator-role-dropdown:disabled {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
  cursor: not-allowed;
}

.collaborators-table .btn-delete {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.collaborators-table .btn-delete:hover:not(:disabled) {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
}

.collaborators-table .btn-delete:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ========================================== MANAGER MODE FULL SCREEN WORKSPACE ========================================== */

/* Layout Transitions */
body.manager-mode-active .left-rail,
body.manager-mode-active .workspace-wrapper,
body.manager-mode-active .timeline-dock,
body.manager-mode-active .controls-group .search-wrapper,
body.manager-mode-active .controls-group .add-member-container,
body.manager-mode-active .controls-group .tree-selector-container {
  display: none !important;
}

body.manager-mode-active #btn-exit-manager {
  display: flex !important;
}

body.manager-mode-active .manager-workspace {
  display: flex !important;
}

/* Manage Pill Button in Header Selector */
.tree-selector-container #btn-manage-trees {
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  font-size: 0.75rem;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.tree-selector-container #btn-manage-trees:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.tree-selector-container #btn-manage-trees svg {
  opacity: 0.8;
  transition: transform 0.3s ease;
}

.tree-selector-container #btn-manage-trees:hover svg {
  transform: rotate(45deg);
}

/* Workspace Panels */
.manager-workspace {
  height: calc(100vh - var(--header-height));
  width: 100vw;
  display: flex;
  flex-direction: column;
  background: var(--bg-app);
  box-sizing: border-box;
  overflow: hidden;
}

.manager-tab-bar {
  display: flex;
  justify-content: center;
  background: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid var(--border-color);
  padding: 0 2rem;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.manager-tab-bar::-webkit-scrollbar {
  display: none;
}

.manager-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 14px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  outline: none;
  white-space: nowrap;
}

.manager-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.manager-tab.active {
  color: var(--color-gold);
  border-bottom-color: var(--color-gold);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
}

.tab-close-btn {
  font-size: 0.85rem;
  opacity: 0.5;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
}

.tab-close-btn:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.manager-tab-panels {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  box-sizing: border-box;
}

.manager-tab-panel {
  display: none;
  max-width: 900px;
  margin: 0 auto;
  animation: managerPanelFadeIn 0.25s ease-out;
}

.manager-tab-panel.active {
  display: block;
}

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

/* Action Links and Lists */
.action-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-gold);
  text-decoration: none;
  margin-left: 16px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.action-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

.action-link.danger-action {
  color: #f87171;
}

.tree-list-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.tree-list-table th, 
.tree-list-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tree-list-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.tree-list-table tbody tr {
  transition: background-color 0.15s ease;
}

.tree-list-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.tree-list-table tbody tr.active-row {
  background-color: rgba(245, 158, 11, 0.03);
}

.tree-list-table tbody tr.active-row td:first-child {
  color: var(--color-gold);
  font-weight: 600;
}

/* Edit Details Tab Cards */
.settings-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.settings-card h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1rem;
  color: var(--color-gold);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tree-edit-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0;
  margin-bottom: 24px;
  border-bottom: 1.5px solid var(--border-color);
  padding-bottom: 12px;
}

.tree-list-table .tree-role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.tree-list-table .tree-role-badge.owner {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-gold);
  border: 1.5px solid rgba(245, 158, 11, 0.3);
}

.tree-list-table .tree-role-badge.editor {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1.5px solid rgba(16, 185, 129, 0.3);
}

.tree-list-table .tree-role-badge.viewer {
  background: rgba(156, 163, 175, 0.15);
  color: #d1d5db;
  border: 1.5px solid rgba(156, 163, 175, 0.3);
}

/* Sortable headers inside manager tables */
.sortable-header {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

.sortable-header:hover {
  color: var(--color-gold);
}

.sortable-header::after {
  content: ' ↕';
  font-size: 0.75rem;
  opacity: 0.4;
  margin-left: 4px;
}

.sortable-header.asc::after {
  content: ' ▲';
  opacity: 1;
  color: var(--color-gold);
}

.sortable-header.desc::after {
  content: ' ▼';
  opacity: 1;
  color: var(--color-gold);
}

/* Belongs to Trees list formatting */
.directory-tree-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.directory-tree-badge {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Directory specific controls adjustments */
.directory-header-controls .form-group select {
  background-color: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 0 10px;
  outline: none;
  transition: var(--transition-smooth);
}

.directory-header-controls .form-group select:focus {
  border-color: var(--border-color-hover);
}

/* Global Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.loading-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.loading-card {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 32px 48px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  min-width: 200px;
}

.loading-tree-svg {
  color: var(--accent-orange, #f97316);
}

.main-stem {
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
  animation: grow-stem 4s ease-in-out infinite, sway-main 4s ease-in-out infinite;
  transform-origin: 50px 85px;
}

.left-branch {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: grow-left 4s ease-in-out infinite, sway-left 4s ease-in-out infinite;
  transform-origin: 49px 58px;
}

.right-branch {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: grow-right 4s ease-in-out infinite, sway-right 4s ease-in-out infinite;
  transform-origin: 50px 42px;
}

/* Growing/sap flowing animation */
@keyframes grow-stem {
  0% { stroke-dashoffset: 80; }
  40%, 60% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -80; }
}

@keyframes grow-left {
  0%, 15% { stroke-dashoffset: 50; }
  45%, 65% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -50; }
}

@keyframes grow-right {
  0%, 25% { stroke-dashoffset: 50; }
  55%, 70% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -50; }
}

/* Swaying animation */
@keyframes sway-main {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(3deg); }
}

@keyframes sway-left {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-8deg); }
}

@keyframes sway-right {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(8deg); }
}

/* Leaves pulsing at branch tips */
.leaf {
  animation: pulse-leaf 4s ease-in-out infinite;
  opacity: 0;
}

.leaf-1 {
  transform-origin: 25px 42px;
  animation-delay: 0.8s;
}

.leaf-2 {
  transform-origin: 75px 30px;
  animation-delay: 1.2s;
}

.leaf-3 {
  transform-origin: 52px 25px;
  animation-delay: 1.6s;
}

@keyframes pulse-leaf {
  0%, 100% { transform: scale(0); opacity: 0; }
  35%, 65% { transform: scale(1.3); opacity: 1; }
}

.loading-message {
  color: var(--text-primary, #cbd5e1);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-align: center;
}

/* ─── Part 2: Photo & Document Storage (Biography Modal & Lightbox) ─── */

/* Horizontal Thumbnail Grid in Details Sidebar */
.sidebar-carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 364px;
  margin: 0 auto;
}

.sidebar-attachments-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  width: 100%;
}

.sidebar-attachments-grid::-webkit-scrollbar {
  display: none;
}

.sidebar-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(13, 20, 35, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.85);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0;
}

.sidebar-carousel-arrow svg {
  display: block;
  width: 12px;
  height: 12px;
}

.sidebar-carousel-arrow.left {
  left: -10px;
}

.sidebar-carousel-arrow.right {
  right: -10px;
}

.sidebar-carousel-arrow:hover {
  background: var(--color-indigo, #6366f1);
  border-color: #ffffff;
  transform: translateY(-50%) scale(1.15);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.6);
}

.sidebar-thumb-card {
  width: 54px;
  height: 54px;
  min-width: 54px;
  border-radius: 8px;
  overflow: visible;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.sidebar-thumb-card:hover {
  transform: scale(1.05);
  border-color: var(--color-indigo);
}

.sidebar-thumb-img {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  overflow: hidden;
  object-fit: cover;
  display: block;
}

.sidebar-thumb-doc {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: rgba(255, 255, 255, 0.05);
}

/* Fullscreen Biography Modal */
.biography-modal-card {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 850px;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.biography-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bio-avatar-block {
  display: flex;
  align-items: center;
  gap: 16px;
}

.bio-modal-name {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.bio-modal-dates {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.biography-modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.bio-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 10px 0;
}

.bio-notes-textarea {
  width: 100%;
  min-height: 100px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.bio-notes-textarea:focus {
  border-color: var(--color-indigo);
  box-shadow: 0 0 10px var(--color-indigo-glow);
}

/* Upload Dropzone */
.bio-upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bio-upload-zone.dragover {
  border-color: var(--color-indigo);
  background: rgba(99, 102, 241, 0.1);
}

.upload-icon {
  color: var(--color-indigo);
  margin-bottom: 6px;
}

.upload-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin: 0;
}

.browse-link {
  color: var(--color-indigo);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.upload-subtext {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 4px 0 0 0;
}

.pre-upload-caption-input {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  text-align: center;
  box-sizing: border-box;
}

.pre-upload-caption-input:focus {
  border-color: var(--color-indigo);
}

/* Attachments Grid in Modal */
.bio-attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 150px));
  gap: 16px;
}

.attachment-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.attachment-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-color-hover);
}

/* Rotated image overflow containment wrapper */
.attachment-thumb-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.attachment-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.attachment-doc-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 2rem;
  color: var(--text-secondary);
}

.attachment-doc-name {
  font-size: 0.7rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 90%;
  color: var(--text-muted);
}

.attachment-caption-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 18px;
}

.btn-delete-attachment {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(239, 68, 68, 0.85);
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 5;
}

.attachment-card:hover .btn-delete-attachment {
  opacity: 1;
}

.btn-delete-attachment:hover {
  transform: scale(1.15);
  background: #dc2626;
}

/* Lightbox Modal */
.lightbox-overlay {
  z-index: 100100;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

.lightbox-card {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 95vw;
  height: 95vh;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

.lightbox-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.lightbox-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.lightbox-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.lightbox-media-container {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.lightbox-img-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.lightbox-img.changing {
  opacity: 0;
  transform: scale(0.96);
}

.lightbox-doc-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.lightbox-doc-fallback .doc-icon {
  font-size: 4rem;
}

.lightbox-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  flex-shrink: 0;
}

.lightbox-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lightbox-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bio-preview-caption-edit,
.preview-filter-select {
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  box-sizing: border-box;
  width: 100%;
}

.preview-filter-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6" fill="none" stroke="%2394a3b8" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="m1 1 4 4 4-4"/></svg>') !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 10px 6px !important;
  padding-right: 30px !important;
  cursor: pointer;
}

.bio-preview-caption-edit:focus {
  border-color: var(--color-indigo);
}

.preview-filter-select:focus {
  border-color: var(--color-indigo);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6" fill="none" stroke="%23818cf8" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="m1 1 4 4 4-4"/></svg>') !important;
}

.preview-filter-select option {
  background-color: var(--bg-app);
  color: var(--text-primary);
}

.bio-preview-caption-edit[readonly] {
  border: none;
  background: transparent;
  padding-left: 0;
  font-weight: 500;
}

.rotate-btn-group {
  display: flex;
  gap: 8px;
}

.rotate-btn-group button {
  flex: 1;
}

/* CSS Filter Presets (Part 1.5 Canonical Contract) */
.filter-original, .filter-none { filter: none; }
.filter-sepia { filter: sepia(100%) contrast(95%); }
.filter-colorize, .filter-teal { filter: sepia(100%) saturate(150%) hue-rotate(190deg); }
.filter-vintage { filter: sepia(30%) contrast(85%) brightness(110%) saturate(80%); }
.filter-vivid { filter: saturate(160%) contrast(110%); }
.filter-bw, .filter-mono { filter: grayscale(100%) contrast(110%); }
.filter-noir { filter: grayscale(100%) contrast(150%) brightness(90%); }

/* High Stacking Dialogs & Overlays */
#confirm-dialog-modal {
  z-index: 200050 !important;
}

#global-loading-overlay {
  z-index: 200100 !important;
}

/* ==========================================================================
   Member Hub Overlay (Unified 95vw Workspace Modal)
   ========================================================================== */
#member-hub-modal {
  z-index: 100000;
}

.member-hub-card {
  width: 95vw;
  height: 95vh;
  max-width: 1600px;
  max-height: 950px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.hub-floating-close {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 100;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.hub-floating-close:hover {
  background: var(--color-indigo, #6366f1);
  color: #ffffff;
  border-color: #ffffff;
  transform: scale(1.1);
}

.member-hub-body {
  display: flex;
  flex: 1;
  height: 100%;
  overflow: hidden;
}

/* Left Vertical Navigation Sidebar */
.member-hub-nav {
  width: 240px;
  background: rgba(0, 0, 0, 0.25);
  border-right: 1px solid var(--border-color);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.hub-avatar-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 4px 6px 18px 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  width: 100%;
  box-sizing: border-box;
}

.hub-avatar-block .profile-avatar {
  width: 48px;
  height: 48px;
  font-size: 1.2rem;
  border-width: 2px;
}

.hub-header-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  word-break: break-word;
}

.hub-modal-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.25;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  transition: font-size 0.2s ease;
}

.hub-modal-dates {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hub-tab-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  position: relative;
}

.hub-tab-btn:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.hub-tab-btn.active {
  background: var(--color-gold-soft);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--color-gold);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.hub-tab-btn.active svg {
  stroke: var(--color-gold);
}

.hub-tab-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hub-tab-badge {
  margin-left: auto;
  font-size: 0.68rem;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Right Main Workspace */
.member-hub-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
  background: rgba(0, 0, 0, 0.1);
}

.hub-workspace-pane {
  display: none;
  height: 100%;
  padding: 24px;
  box-sizing: border-box;
  flex-direction: column;
}

.hub-workspace-pane.active {
  display: flex;
}

/* Tab 1: Member Info Form */
.hub-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.hub-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  margin-top: 8px;
}

/* Tab 2: Photos & Media Workspace */
.hub-photos-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
}

.hub-photo-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  overflow: hidden;
  min-height: 0;
}

.hub-stage-container {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: visible;
  padding: 0 12px;
  gap: 12px;
}

.hub-stage-media-wrapper {
  flex: 1;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.hub-stage-arrow {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
  flex-shrink: 0;
  user-select: none;
}

.hub-stage-arrow.left {
  margin-left: 4px;
}

.hub-stage-arrow.right {
  margin-right: 4px;
}

.hub-stage-arrow:hover {
  background: var(--color-gold);
  border-color: var(--color-gold);
  color: #000;
  transform: scale(1.08);
}

.hub-empty-photos {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  text-align: center;
}

.hub-stage-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 16px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.hub-stage-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hub-stage-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hub-stage-field.caption-field {
  flex: 1;
  min-width: 200px;
}

.hub-photo-title {
  font-weight: 600;
  color: var(--color-gold);
  font-size: 0.9rem;
}

/* Bottom Thumbnails Carousel */
.hub-carousel-strip {
  height: 80px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  overflow-x: auto;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}

.hub-carousel-thumbs {
  display: flex;
  gap: 16px;
  height: 100%;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  margin: 0 auto;
  padding: 6px 0;
}

.hub-thumb-card {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  overflow: visible;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.4);
}

.hub-thumb-card:hover {
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
}

.hub-thumb-card.active {
  border-color: var(--color-gold);
  box-shadow: 0 0 10px var(--color-gold-glow);
}

.hub-thumb-img {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  overflow: hidden;
  object-fit: cover;
}

.sidebar-thumb-doc,
.hub-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  border-radius: 6px;
  overflow: hidden;
}

.thumb-loading-svg {
  opacity: 0.5;
  animation: thumbPulse 1.6s ease-in-out infinite;
}

@keyframes thumbPulse {
  0% { opacity: 0.3; transform: scale(0.95); }
  50% { opacity: 0.75; transform: scale(1.05); }
  100% { opacity: 0.3; transform: scale(0.95); }
}

.error-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-gold, #f59e0b);
  box-shadow: 0 0 8px var(--color-gold-glow, rgba(245, 158, 11, 0.6));
  display: inline-block;
}

/* Favorite Photo Control & Badge */
.btn-favorite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.btn-favorite:hover {
  color: #ec4899;
  border-color: rgba(236, 72, 153, 0.4);
}

.btn-favorite.is-favorite {
  background: rgba(236, 72, 153, 0.15);
  border-color: rgba(236, 72, 153, 0.6);
  color: #ec4899;
}

.btn-favorite.is-favorite .heart-icon {
  fill: #ec4899;
  stroke: #ec4899;
  filter: drop-shadow(0 0 4px rgba(236, 72, 153, 0.5));
}

.thumb-favorite-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  z-index: 10;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.hub-thumb-card:hover .thumb-favorite-badge,
.sidebar-thumb-card:hover .thumb-favorite-badge,
.photo-thumb-card:hover .thumb-favorite-badge {
  opacity: 0.85;
}

.thumb-favorite-badge:hover {
  opacity: 1 !important;
  transform: scale(1.15);
  color: #ec4899;
  border-color: #ec4899;
}

.thumb-favorite-badge.is-favorite {
  opacity: 1;
  background: rgba(236, 72, 153, 0.9);
  border-color: #f472b6;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(236, 72, 153, 0.6);
}

.thumb-favorite-badge.is-favorite svg {
  fill: #ffffff;
  stroke: #ffffff;
}

/* Placeholders for upcoming features */
.hub-placeholder-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  gap: 16px;
  color: var(--text-muted);
}

.hub-placeholder-pane h3 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--text-primary);
}

.hub-placeholder-pane p {
  margin: 0;
  max-width: 400px;
  font-size: 0.95rem;
}

/* Upload Photo / Document Button & Modal */
.btn-hub-upload {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-indigo, #6366f1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-hub-upload:hover {
  background: #4f46e5;
  border-color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.upload-modal-card {
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 520px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  position: relative;
  margin: auto;
}

.modal-upload-dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.5);
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  background: rgba(99, 102, 241, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-upload-dropzone:hover,
.modal-upload-dropzone.dragover {
  border-color: var(--color-indigo, #6366f1);
  background: rgba(99, 102, 241, 0.12);
}

.modal-file-selected-indicator {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--color-gold, #f59e0b);
}

/* ==========================================
   PHOTOS & DOCS MANAGER TAB STYLES
   ========================================== */

.photos-docs-header-controls {
  margin-bottom: 16px !important;
}

.photos-docs-chips-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px 0;
  width: 100%;
}

.photos-docs-chips-row[style*="display: none"] {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.photos-batch-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
  width: 100%;
}

.photos-batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px !important;
  padding: 0 16px;
  box-sizing: border-box !important;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  flex: 1;
  width: 100%;
  margin-bottom: 0;
}

.photos-batch-bar.hidden {
  display: none !important;
}

.btn-clear-selections {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px !important;
  padding: 0 16px;
  box-sizing: border-box !important;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.btn-clear-selections:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.photos-select-all-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.photos-select-all-label input[type="checkbox"] {
  accent-color: var(--color-gold);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.photos-selected-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-batch-delete {
  font-size: 0.8rem;
  height: 26px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-batch-delete:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-batch-delete:not(:disabled):hover {
  background: rgba(239, 68, 68, 0.35) !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
  color: #ffffff !important;
}

.member-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px !important;
  padding: 0 14px;
  box-sizing: border-box !important;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--color-gold);
}

.btn-clear-chip {
  background: none;
  border: none;
  color: var(--color-gold);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.btn-clear-chip:hover {
  opacity: 1;
}

.photos-docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.photo-thumb-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: visible;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.photo-thumb-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.2), 0 4px 16px rgba(0, 0, 0, 0.4);
}

.photo-thumb-card.selected {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
}

.photo-thumb-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #0f172a;
  overflow: visible;
  border-top-left-radius: 9px;
  border-top-right-radius: 9px;
  cursor: pointer;
}

.photo-thumb-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-top-left-radius: 9px;
  border-top-right-radius: 9px;
  overflow: hidden;
  transition: filter 0.3s ease;
}

.photo-select-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  accent-color: var(--color-gold);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.photo-card-info {
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom-left-radius: 9px;
  border-bottom-right-radius: 9px;
  overflow: hidden;
}

.photo-card-title {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-card-member-name {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Manage Photos & Docs Lightbox Overlay & Header Favorite Filter */
#photos-docs-lightbox-modal {
  z-index: 120000;
}

.photos-docs-lightbox-card {
  width: 95vw;
  height: 95vh;
  max-width: 1600px;
  max-height: 950px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.btn-filter-favorite {
  height: 38px !important;
  width: 38px !important;
  min-width: 38px !important;
  border-radius: 20px !important;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  cursor: pointer;
  box-sizing: border-box;
}

.btn-filter-favorite.active {
  background: rgba(236, 72, 153, 0.18) !important;
  border-color: rgba(236, 72, 153, 0.6) !important;
  color: #ec4899 !important;
}

.btn-filter-favorite.active .heart-icon {
  fill: #ec4899 !important;
  stroke: #ec4899 !important;
  filter: drop-shadow(0 0 4px rgba(236, 72, 153, 0.5)) !important;
}

/* ─── Terms of Use & Privacy Notice Modal & Links ─── */
.link-terms-privacy {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: var(--text-secondary, #94a3b8) !important;
  font-size: 0.85rem !important;
  font-family: var(--font-sans) !important;
  cursor: pointer !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  opacity: 0.85 !important;
  transition: opacity 0.2s ease, color 0.2s ease, background 0.2s ease !important;
  padding: 6px 12px !important;
  border-radius: 6px !important;
  display: inline-block !important;
  box-shadow: none !important;
  user-select: auto !important;
}

.link-terms-privacy:hover {
  opacity: 1 !important;
  color: #818cf8 !important;
  background: rgba(99, 102, 241, 0.12) !important;
}

#terms-privacy-modal.terms-privacy-overlay {
  z-index: 100005;
}

.terms-privacy-card {
  width: 90%;
  max-width: 960px;
  max-height: 88vh;
  background: rgba(13, 20, 35, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
}

.terms-privacy-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.terms-privacy-title-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.terms-privacy-title {
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text-primary);
}

.terms-privacy-effective {
  font-size: 0.92rem;
  color: #8b94a8 !important;
  font-weight: 500;
}

#terms-privacy-modal .modal-close-btn {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: var(--text-secondary, #94a3b8) !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
}

#terms-privacy-modal .modal-close-btn:hover {
  color: var(--text-primary, #ffffff) !important;
  background: rgba(255, 255, 255, 0.12) !important;
}

.terms-privacy-body {
  padding: 1.75rem 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  color: #cbd5e1;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.7;
  letter-spacing: 0.15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: text;
}

.terms-privacy-body h3 {
  font-size: 1.18rem;
  font-weight: 600;
  color: #818cf8; /* indigo highlight matching design */
  margin-top: 0.8rem;
  margin-bottom: 0;
  letter-spacing: 0.2px;
}

.terms-privacy-body h3:first-child {
  margin-top: 0;
}

.terms-privacy-body h3 + p,
.terms-privacy-body h3 + ul {
  margin-top: -0.85rem;
}

.terms-privacy-body p {
  margin: 0;
  font-weight: 300;
}

.terms-privacy-body ul {
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
}

.terms-privacy-body li {
  line-height: 1.65;
  font-weight: 300;
}

.terms-privacy-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

.protected-email-link {
  color: #818cf8 !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  transition: color 0.2s ease !important;
}

.protected-email-link:hover {
  color: #a5b4fc !important;
}

.terms-privacy-footer {
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.2);
}

.terms-privacy-close-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  font-size: 0.85rem;
  border-radius: 20px;
}

/* ==========================================
   AI MEMBER STORIES WORKSPACE (RELEASE 2.9)
   ========================================== */
.hub-story-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px;
  gap: 16px;
  overflow-y: auto;
}

.hub-story-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.hub-story-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-amber, #fbbf24);
  letter-spacing: -0.2px;
}

.hub-story-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.hub-story-date {
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
  font-style: italic;
  margin-top: 0;
  text-align: left;
}

.hub-story-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.story-action-btn-wrapper {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

button.story-action-btn {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: var(--text-secondary, #cbd5e1) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
}

button.story-action-btn:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

.story-action-tooltip {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  left: 50% !important;
  transform: translateX(-50%) translateY(0) !important;
  padding: 5px 10px !important;
  background: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 14px !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  color: #ffffff !important;
  white-space: nowrap !important;
  pointer-events: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5) !important;
  z-index: 99 !important;
}

.story-action-btn-wrapper:hover .story-action-tooltip {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateX(-50%) translateY(4px) !important;
}


.hub-story-header-row {
  display: flex;
  align-items: center;
  width: 100%;
  height: 128px;
  position: relative;
  margin-bottom: 0px;
}

.hub-story-vine-banner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 128px;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}

.hub-story-vine-banner .vine-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.hub-story-vine-banner .branch-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hub-story-vine-banner .branch-main {
  stroke: #8b5e3c;
  stroke-width: 3.5px;
  stroke-dasharray: 3500;
  stroke-dashoffset: 3500;
  animation: storyGrowBranch var(--anim-dur, 7.5s) cubic-bezier(0.35, 0, 0.25, 1) forwards;
}

.hub-story-vine-banner .branch-sub1 {
  stroke: #a06d46;
  stroke-width: 2.2px;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
}

.hub-story-vine-banner .branch-sub2 {
  stroke: #a06d46;
  stroke-width: 2px;
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
}

@keyframes storyGrowBranch {
  to {
    stroke-dashoffset: 0;
  }
}

.hub-story-vine-banner .leaf {
  opacity: 0;
  animation: storyRevealLeaf 0.01s linear forwards;
}

.hub-story-vine-banner .leaf-path {
  transform-origin: 0px 0px;
  animation: storyPopLeafScale 0.85s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes storyRevealLeaf {
  to { opacity: 1; }
}

@keyframes storyPopLeafScale {
  0% {
    transform: scale(0);
  }
  65% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

.hub-story-media-strip {
  display: flex;
  gap: clamp(16px, 2.5vw, 32px);
  align-items: center;
  justify-content: center;
  z-index: 2;
  width: 100%;
  overflow: hidden;
  padding: 2px 0;
}

.hub-story-media-thumb-wrapper {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  position: relative;
  animation: thumbFadeInScale 3.00s cubic-bezier(0.16, 1, 0.3, 1) var(--thumb-delay, 0s) backwards;
}

@keyframes thumbFadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.hub-story-media-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #94a3b8);
  background: rgba(15, 23, 42, 0.4);
}

.hub-story-media-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none; /* Non-clickable static showcase */
}

.hub-story-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 16px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  backdrop-filter: blur(12px);
}

.hub-story-loading-msg {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary, #cbd5e1);
  letter-spacing: 0.3px;
}

.hub-story-body {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px 28px;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.hub-story-text {
  font-size: 0.98rem;
  line-height: 1.75;
  color: var(--text-primary, #f1f5f9);
}

.hub-story-text p {
  margin-bottom: 1rem;
}

.hub-story-text p:last-child {
  margin-bottom: 0;
}

.hub-story-text strong {
  color: #ffffff;
  font-weight: 600;
}









