/* ── Kinnected Design System ── */
:root {
  --purple:    #534AB7;
  --purple-lt: #EEEDFE;
  --purple-md: #7F77DD;
  --purple-dk: #3C3489;
  --teal:      #1D9E75;
  --teal-lt:   #E1F5EE;
  --teal-md:   #5DCAA5;
  --teal-dk:   #0F6E56;
  --gray-100:  #F4F3F0;
  --gray-200:  #E8E6E1;
  --gray-400:  #B4B2A9;
  --gray-600:  #5F5E5A;
  --bg:        #F7F6F3;
  --surface:   #FFFFFF;
  --border:    rgba(0,0,0,0.08);
  --text:      #1A1A18;
  --text-2:    #5F5E5A;
  --text-3:    #999894;
  --radius:    10px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── App Grid ── */
.app {
  display: grid;
  grid-template-columns: 210px 1fr 270px;
  grid-template-rows: 54px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ── Topbar ── */
.topbar {
  grid-column: 1 / -1;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  z-index: 10;
}

.logo {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  color: var(--purple-dk);
  flex-shrink: 0;
  letter-spacing: -0.5px;
}
.logo span { color: var(--teal); }

.search-bar {
  flex: 1;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 99px;
  padding: 0 14px;
  height: 34px;
}
.search-bar i { color: var(--text-3); font-size: 15px; }
.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  width: 100%;
}
.search-bar input::placeholder { color: var(--text-3); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.icon-btn {
  position: relative;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  font-size: 17px;
  transition: background 0.15s;
}
.icon-btn:hover { background: var(--gray-100); }

.notif-badge {
  position: absolute;
  top: -2px; right: -2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-size: 9px;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}

.add-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 99px;
  padding: 7px 16px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.add-btn:hover { background: var(--purple-dk); }

.avatar-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--teal-lt);
  color: var(--teal-dk);
  font-size: 11px;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: 2px solid var(--teal-md);
}

/* ── Sidebar ── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
  overflow-y: auto;
}

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sidebar-footer { display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: 1px solid var(--border); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.12s;
  position: relative;
}
.nav-item:hover { background: var(--gray-100); color: var(--text); }
.nav-item.active { background: var(--purple-lt); color: var(--purple); font-weight: 500; }
.nav-item i { font-size: 17px; flex-shrink: 0; }

.nav-section {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 12px 10px 4px;
}

.nav-badge {
  margin-left: auto;
  background: var(--purple);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 500;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ── Main tree area ── */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.tree-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.tree-toolbar-left { display: flex; align-items: center; gap: 10px; }
.tree-toolbar-left h2 { font-size: 15px; font-weight: 500; }
.tree-toolbar-right { display: flex; align-items: center; gap: 8px; }

.toolbar-btn {
  display: flex; align-items: center; gap: 5px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-2);
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.12s;
}
.toolbar-btn:hover { background: var(--gray-100); color: var(--text); }

.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.view-btn {
  padding: 5px 12px;
  font-size: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  font-family: 'DM Sans', sans-serif;
  transition: all 0.12s;
}
.view-btn.active { background: var(--purple-lt); color: var(--purple); font-weight: 500; }

.tree-canvas {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

#family-tree {
  width: 100%;
  height: 100%;
  max-height: 480px;
}

/* SVG tree styles */
.tree-line { stroke: #D3D1C7; stroke-width: 1.5; fill: none; }
.spouse-line { stroke: #AFA9EC; stroke-dasharray: 5,4; }

.node-ring { fill: none; stroke-width: 2; }
.you-ring    { stroke: #1D9E75; }
.parent-ring { stroke: #7F77DD; }
.gp-ring     { stroke: #B4B2A9; }
.sib-ring    { stroke: #5DCAA5; }

.node-fill   { }
.you-fill    { fill: #1D9E75; }
.parent-fill { fill: #534AB7; }
.gp-fill     { fill: #F1EFE8; stroke: #B4B2A9; stroke-width: 1; }
.sib-fill    { fill: #E1F5EE; stroke: #5DCAA5; stroke-width: 1; }

.node-emoji  { font-size: 16px; text-anchor: middle; dominant-baseline: middle; }
.node-name   { font-size: 9px; text-anchor: middle; fill: #fff; font-weight: 500; font-family: 'DM Sans', sans-serif; }
.node-relation { font-size: 8px; text-anchor: middle; fill: rgba(255,255,255,0.75); font-family: 'DM Sans', sans-serif; }
.you-name    { fill: #fff; }
.you-rel     { fill: rgba(255,255,255,0.8); }
.parent-name { fill: #fff; }
.parent-rel  { fill: rgba(255,255,255,0.75); }
.sib-name    { fill: #085041; font-size: 8px; }
.sib-rel     { fill: #0F6E56; font-size: 7px; }

.tree-node { transition: opacity 0.15s; }
.tree-node:hover { opacity: 0.85; }

.legend-bg { fill: white; stroke: #E8E6E1; stroke-width: 1; }
.legend-text { font-size: 8px; fill: #888780; font-family: 'DM Sans', sans-serif; dominant-baseline: middle; }

/* ── Right panel ── */
.right-panel {
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.panel-tab {
  flex: 1;
  padding: 11px 0;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.12s;
}
.panel-tab.active { color: var(--purple); border-bottom-color: var(--purple); font-weight: 500; }

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.panel-body.hidden { display: none; }

/* Feed */
.feed-item {
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 12px;
}
.feed-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.feed-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500;
  flex-shrink: 0;
}
.feed-meta { display: flex; flex-direction: column; }
.feed-name { font-size: 12px; font-weight: 500; }
.feed-time { font-size: 10px; color: var(--text-3); }
.feed-text { font-size: 12px; color: var(--text-2); line-height: 1.6; margin-bottom: 8px; }
.feed-actions { display: flex; gap: 8px; }
.feed-btn {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-3);
  background: transparent; border: none;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  padding: 2px 0;
  transition: color 0.12s;
}
.feed-btn:hover { color: var(--purple); }

.post-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px dashed var(--gray-400);
  background: transparent;
  border-radius: var(--radius);
  padding: 10px;
  font-size: 12px;
  color: var(--text-3);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.12s;
}
.post-btn:hover { border-color: var(--purple); color: var(--purple); background: var(--purple-lt); }

/* Members */
.member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s;
}
.member-row:hover { background: var(--gray-100); }
.member-info { flex: 1; display: flex; flex-direction: column; }
.member-name { font-size: 13px; font-weight: 500; }
.member-rel { font-size: 11px; color: var(--text-3); }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #1D9E75; flex-shrink: 0; }

/* Alerts */
.alert-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.alert-item:last-child { border-bottom: none; }
.alert-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0; margin-top: 5px;
}
.alert-dot.purple { background: var(--purple); }
.alert-dot.green  { background: var(--teal); }
.alert-dot.gray   { background: var(--gray-400); }
.alert-text { font-size: 12px; color: var(--text-2); line-height: 1.5; margin-bottom: 2px; }
.alert-text strong { color: var(--text); font-weight: 500; }
.alert-time { font-size: 10px; color: var(--text-3); }

/* Pills */
.pill {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 500;
  padding: 3px 10px;
  border-radius: 99px;
}
.pill.purple { background: var(--purple-lt); color: var(--purple); }
.pill.teal   { background: var(--teal-lt); color: var(--teal-dk); }

/* ── Modals ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 380px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-2); font-size: 14px;
}
.modal-close:hover { background: var(--gray-100); }

.profile-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px;
}
.profile-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--teal-lt);
  color: var(--teal-dk);
  font-size: 16px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--teal-md);
}
.profile-header h3 { font-size: 17px; font-weight: 500; margin-bottom: 4px; }

.profile-details { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.detail-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.detail-row i { font-size: 16px; color: var(--text-3); }

.modal-actions { display: flex; gap: 8px; }

.form-label {
  display: block;
  font-size: 12px; font-weight: 500;
  color: var(--text-2);
  margin-bottom: 5px; margin-top: 14px;
}
.form-input {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border 0.15s;
}
.form-input:focus { border-color: var(--purple-md); }

/* ── Profile Dropdown ── */
.avatar-dropdown-wrap { position:relative; }
.avatar-dropdown {
  position:absolute; top:calc(100% + 8px); right:0;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:8px;
  min-width:200px; z-index:200;
  box-shadow:0 8px 24px rgba(0,0,0,0.1);
  display:none; animation:fadeDown 0.15s ease;
}
@keyframes fadeDown { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:translateY(0)} }
.avatar-dropdown.open { display:block; }
.dd-header { padding:10px 10px 8px; border-bottom:1px solid var(--border); margin-bottom:6px; }
.dd-name { font-size:13px;font-weight:500; }
.dd-email { font-size:11px;color:var(--text-3); }
.dd-item {
  display:flex;align-items:center;gap:9px;
  padding:8px 10px;border-radius:var(--radius);
  font-size:13px;color:var(--text-2);cursor:pointer;
  text-decoration:none;transition:background 0.12s;
}
.dd-item:hover { background:var(--gray-100);color:var(--text); }
.dd-item i { font-size:16px;flex-shrink:0; }
.dd-divider { height:1px;background:var(--border);margin:6px 0; }
.dd-item.danger { color:#E24B4A; }
.dd-item.danger:hover { background:#FFF5F5; }

/* ── Mobile bottom nav ── */
.mobile-nav {
  display:none;
  position:fixed; bottom:0; left:0; right:0;
  background:var(--surface);
  border-top:1px solid var(--border);
  padding:8px 0 env(safe-area-inset-bottom, 8px);
  z-index:100;
}
.mobile-nav-items { display:flex;justify-content:space-around; }
.mobile-nav-item {
  display:flex;flex-direction:column;align-items:center;gap:3px;
  padding:6px 12px;font-size:10px;color:var(--text-3);
  text-decoration:none;cursor:pointer;transition:color 0.12s;
  font-family:'DM Sans',sans-serif;
}
.mobile-nav-item i { font-size:22px; }
.mobile-nav-item.active { color:var(--purple); }
.mobile-nav-item:hover { color:var(--purple); }

@media (max-width: 768px) {
  .app { grid-template-columns:1fr;grid-template-rows:54px 1fr auto; }
  .sidebar { display:none; }
  .right-panel { display:none; }
  .mobile-nav { display:block; }
  .main { padding-bottom:70px; }
}

/* ── Spinner + empty states (added) ── */
@keyframes spin { to { transform: rotate(360deg); } }

.empty-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 6px; padding: 32px 16px; color: var(--text-3);
}
.empty-panel i { font-size: 28px; opacity: 0.6; }
.empty-panel p { font-size: 13px; font-weight: 500; color: var(--text-2); margin: 0; }
.empty-panel span { font-size: 11px; color: var(--text-3); max-width: 240px; line-height: 1.5; }

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); } 40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(4px); }
}

.filter-pill.active, .sf-btn.active {
  background: var(--purple-lt) !important;
  color: var(--purple) !important;
  border-color: var(--purple-md) !important;
  font-weight: 500 !important;
}

/* Messages unread badge: hidden until real messaging + unread tracking exists */
.nav-badge { display: none !important; }

/* ── Spinners ── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
.spinner.light {
  width: 16px; height: 16px;
  border-color: rgba(255,255,255,0.3);
  border-top-color: #fff;
  margin: 0 auto;
}

.tree-loading {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 100%; min-height: 420px;
  color: var(--text-3); font-size: 13px;
}

/* ── Tree empty state ── */
.tree-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: 20px; text-align: center; padding: 40px;
}
.tree-empty-icon { font-size: 56px; }
.tree-empty-title { font-family: 'DM Serif Display', serif; font-size: 22px; color: var(--text); }
.tree-empty-sub { font-size: 14px; color: var(--text-3); max-width: 340px; line-height: 1.7; }
.tree-empty-note { font-size: 12px; color: var(--text-3); }

/* ── Tree canvas overlays ── */
.tree-canvas { position: relative; }

.tree-legend {
  position: absolute; left: 16px; bottom: 14px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px;
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 10px; color: var(--gray-600);
  z-index: 5;
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot {
  width: 13px; height: 13px; border-radius: 50%;
  border: 1px solid transparent;
  flex-shrink: 0;
}
.legend-dot.dashed { border-style: dashed; }

.zoom-controls {
  position: absolute; top: 12px; right: 12px;
  display: flex; gap: 8px;
  z-index: 6;
}
.zoom-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(0,0,0,0.10);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}
.zoom-btn i { font-size: 15px; }
.zoom-btn:hover { background: var(--gray-100); }

#family-tree { touch-action: none; cursor: grab; }
.tree-node { cursor: pointer; }

/* ── List view ── */
.list-view { width: 100%; height: 100%; overflow-y: auto; padding: 20px; }
.list-view-inner {
  display: flex; flex-direction: column; gap: 8px;
  max-width: 600px; margin: 0 auto;
}
.list-row {
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  transition: border-color 0.12s;
}
.list-row:hover { border-color: var(--purple-md); }
.list-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500; flex-shrink: 0;
}
.list-row-info { flex: 1; }
.list-row-name { font-size: 14px; font-weight: 500; }
.list-row-rel { font-size: 12px; color: var(--text-3); }
.list-empty { height: 100%; min-height: 320px; }

/* ── Node action menu ── */
.node-menu {
  position: fixed; display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.2);
  padding: 6px;
  z-index: 3800;
  min-width: 200px;
}
.node-menu-title {
  font-size: 11px; color: var(--text-3);
  padding: 7px 11px 9px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
}
.nm-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  background: none; border: none; text-align: left;
  padding: 9px 11px; border-radius: 8px;
  font-size: 13px; font-family: 'DM Sans', sans-serif;
  color: var(--text); cursor: pointer;
  transition: background 0.12s;
}
.nm-btn:hover { background: var(--gray-100); }
.nm-btn i { font-size: 16px; }
.nm-btn.danger { color: #E24B4A; }

/* ── Modal form pieces ── */
.modal-title { margin-bottom: 20px; font-size: 17px; }

.form-hint { font-size: 11px; color: var(--text-3); margin-top: 4px; line-height: 1.4; }
.form-hint.success { color: var(--teal); display: none; }

.form-input.file { padding: 9px; }

.form-card {
  margin-top: 16px; padding: 14px;
  background: var(--gray-100);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.form-card-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.form-card-title { font-size: 13px; font-weight: 500; }
.form-card-fields {
  display: none;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.form-check {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: 13px; font-weight: 500;
}
.form-label.first { margin-top: 0; }

.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute; inset: 0;
  background: var(--gray-200);
  border-radius: 99px; cursor: pointer;
  transition: background 0.2s;
}
.switch-track::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px; left: 3px; top: 3px;
  border-radius: 50%; background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .switch-track { background: #2C2464; }
.switch input:checked + .switch-track::after { transform: translateX(18px); }

.add-btn.block { width: 100%; justify-content: center; margin-top: 14px; }

/* Invite modal */
.invite-send-row, .invite-link-row { display: flex; gap: 8px; align-items: stretch; }
.invite-send-row .form-input, .invite-link-row .form-input { flex: 1; min-width: 0; }
.invite-send-row .add-btn { flex-shrink: 0; }
.invite-link-row .toolbar-btn { flex-shrink: 0; }
.invite-link-row .form-input { font-size: 11.5px; color: var(--text-2); background: var(--gray-100); }

.invite-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 14px;
  font-size: 11px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.invite-divider::before, .invite-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--gray-200);
}

.invite-mailto {
  display: inline-flex;
  margin-top: 10px;
  text-decoration: none;
}

/* ── Connected trees ── */
.tree-switcher {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-2);
  background: var(--surface);
  cursor: pointer;
  max-width: 210px;
}

.viewing-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 20px;
  background: var(--purple-lt);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--purple-dk);
}
.viewing-banner .toolbar-btn { background: var(--surface); flex-shrink: 0; }
.viewing-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }

#new-post-text { resize: vertical; }

/* ── Right-panel post cards ── */
.panel-post-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  animation: fadeIn 0.3s ease;
}
.panel-post-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.panel-post-author { font-size: 13px; font-weight: 500; }
.panel-post-time { font-size: 11px; color: var(--text-3); }
.panel-post-body { font-size: 13px; color: var(--text-2); line-height: 1.5; white-space: pre-wrap; }

/* ── Toast, undo bar, claim banner ── */
.toast {
  position: fixed; left: 50%; bottom: 30px;
  transform: translateX(-50%) translateY(8px);
  background: #2C2464; color: #fff;
  padding: 12px 20px; border-radius: 12px;
  font-size: 13px; font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 4000; pointer-events: none;
  box-shadow: 0 8px 28px rgba(0,0,0,0.28);
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.undo-bar {
  position: fixed; left: 50%; bottom: 30px;
  transform: translateX(-50%);
  display: none; align-items: center;
  background: #2C2464; color: #fff;
  padding: 11px 16px; border-radius: 12px;
  font-size: 13px; z-index: 4001;
  box-shadow: 0 8px 28px rgba(0,0,0,0.28);
  transition: opacity 0.25s;
}
.undo-bar button {
  background: rgba(255,255,255,0.2);
  border: none; color: #fff;
  font-weight: 600;
  padding: 5px 14px; border-radius: 99px;
  font-size: 12px; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  margin-left: 14px;
}
.undo-bar button:hover { background: rgba(255,255,255,0.32); }

.claim-banner {
  display: none;
  position: fixed; top: 16px; left: 50%;
  transform: translateX(-50%);
  align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px 16px; border-radius: 14px;
  z-index: 4002;
  box-shadow: 0 10px 32px rgba(0,0,0,0.16);
  max-width: 92vw;
}
.claim-emoji { font-size: 22px; }
.claim-body { font-size: 13px; line-height: 1.4; color: var(--text-2); }
.claim-banner .add-btn { padding: 8px 14px; white-space: nowrap; }
.claim-dismiss {
  background: none; border: none;
  color: var(--text-3); cursor: pointer;
  font-size: 18px; line-height: 1;
}
