/* ============================================
   THE FOUNDERS HOUSE — App v3
   Professional • AngelList-inspired
   ============================================ */

/* --- App Shell --- */
.app-shell {
  display: flex;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

/* --- Sidebar --- */
.app-sidebar {
  width: 240px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
}
.sidebar-logo img { width: 24px; height: 24px; border-radius: 4px; }

.sidebar-nav {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}
.sidebar-section {
  margin-bottom: 8px;
}
.sidebar-section-label {
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sidebar-link:hover { background: var(--gray-50); color: var(--text-primary); }
[data-theme="dark"] .sidebar-link:hover { background: var(--bg-tertiary); }
.sidebar-link.active {
  background: var(--brand-50);
  color: var(--brand-700);
}
[data-theme="dark"] .sidebar-link.active { background: rgba(105, 65, 198, 0.15); color: var(--brand-400); }
.sidebar-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-link-investor {
  text-decoration: none;
  color: var(--accent-glow) !important;
  background: linear-gradient(135deg, rgba(158,119,237,0.10), rgba(158,119,237,0.02));
  border: 1px solid rgba(158,119,237,0.25);
}
.sidebar-link-investor:hover {
  background: linear-gradient(135deg, rgba(158,119,237,0.18), rgba(158,119,237,0.06)) !important;
  color: #fff !important;
  border-color: rgba(158,119,237,0.45);
}
.sidebar-link-investor svg { color: var(--accent-glow); }
.sidebar-link-investor:hover svg { color: #fff; }

.role-option-investor {
  background: linear-gradient(135deg, rgba(158,119,237,0.08), rgba(158,119,237,0.02));
  border-color: rgba(158,119,237,0.28) !important;
}
.role-option-investor:hover {
  border-color: rgba(158,119,237,0.5) !important;
  background: linear-gradient(135deg, rgba(158,119,237,0.14), rgba(158,119,237,0.04));
}

.sidebar-link-badge {
  margin-left: auto;
  min-width: 20px; height: 20px;
  border-radius: var(--radius-full);
  background: var(--brand-600);
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  padding: 0 6px;
}

/* Sidebar bottom actions (dark mode + logout) */
.sidebar-bottom-actions {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
}
.sidebar-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.sidebar-action-btn:hover {
  background: var(--gray-50);
  color: var(--text-primary);
}
.sidebar-action-btn svg { flex-shrink: 0; }
.theme-toggle-indicator {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--text-tertiary);
}
[data-theme="dark"] .theme-toggle-indicator {
  background: var(--brand-600);
  color: #fff;
}
.sidebar-logout-btn:hover {
  background: rgba(240, 68, 56, 0.08);
  color: #F04438;
}

.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.sidebar-user:hover { background: var(--gray-50); }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 12px; color: var(--text-tertiary); text-transform: capitalize; }

/* --- Main Content --- */
.app-content {
  flex: 1;
  margin-left: 240px;
  background: var(--bg-secondary);
  min-height: 100vh;
}

/* --- Top Bar --- */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-placeholder);
  font-size: 13px;
  cursor: pointer;
  min-width: 240px;
  max-width: 100%;
  transition: border-color var(--duration);
}
.topbar-search:hover { border-color: var(--border-dark); }
.topbar-search kbd {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 11px;
  color: var(--text-tertiary);
}
.topbar-btn { position: relative; }
.topbar-notif-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--error-500);
  border: 2px solid var(--bg);
}
.mobile-menu-btn { display: none; }

/* --- Page Content --- */
.page-content {
  padding: 24px;
  max-width: 1120px;
  box-sizing: border-box;
  width: 100%;
}
.page-header {
  margin-bottom: 24px;
}
.page-header h2 { margin-bottom: 4px; }
.page-header p { color: var(--text-secondary); font-size: 14px; }

/* --- Sections --- */
.app-section { display: none; }
.app-section.active { display: block; }

/* ===== DISCOVER ===== */
.discover-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration);
}
.filter-btn:hover { border-color: var(--border-dark); color: var(--text-primary); }
.filter-btn.active { border-color: var(--brand-300); background: var(--brand-50); color: var(--brand-700); }

.discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.profile-card { overflow: hidden; }
.profile-card-header {
  padding: 20px 20px 0;
  display: flex;
  gap: 12px;
}
.profile-card-info { flex: 1; min-width: 0; }
.profile-card-name {
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-card-name .verified {
  width: 16px; height: 16px;
  color: var(--brand-600);
}
.profile-card-meta {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 1px;
}
.profile-card-match {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--success-700);
  background: var(--success-50);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  height: fit-content;
}
.profile-card-body {
  padding: 12px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.profile-card-tags {
  padding: 0 20px 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.profile-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.profile-card-label {
  font-size: 12px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 4px;
}
.profile-card-actions { display: flex; gap: 6px; }
.profile-card-video {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--brand-600);
  font-weight: 500;
}
.profile-card-video::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand-500);
}

/* ===== FEED ===== */
.feed-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  max-width: 960px;
}
.feed-main { display: flex; flex-direction: column; gap: 16px; }

/* Post composer */
.post-composer {
  padding: 20px;
}
.composer-row { display: flex; gap: 12px; }
.composer-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-primary);
  resize: none;
  outline: none;
  min-height: 40px;
}
.composer-input::placeholder { color: var(--text-placeholder); }
.composer-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.composer-tools { display: flex; gap: 4px; }
.composer-tool {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--duration);
}
.composer-tool:hover { background: var(--gray-50); color: var(--text-secondary); }
.composer-preview {
  position: relative;
  margin-top: 12px;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.composer-preview img { width: 100%; max-height: 200px; object-fit: cover; }
.composer-preview-remove {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.6);
  color: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 16px;
}

/* Post card */
.post-card { overflow: hidden; }
.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 0;
}
.post-header-info { flex: 1; }
.post-author { font-weight: 600; font-size: 14px; }
.post-meta { font-size: 12px; color: var(--text-tertiary); }
.post-time { font-size: 12px; color: var(--text-tertiary); }
.post-body {
  padding: 12px 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
}
.post-milestone {
  margin: 0 20px 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--brand-50);
  border-left: 3px solid var(--brand-600);
  font-size: 13px;
  color: var(--brand-800);
  white-space: pre-line;
}
.post-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
}
.post-actions {
  display: flex;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  gap: 4px;
}
.post-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--duration);
}
.post-action:hover { background: var(--gray-50); color: var(--text-secondary); }
.post-action.liked { color: var(--error-500); }

/* Feed sidebar */
.feed-sidebar { display: flex; flex-direction: column; gap: 16px; }
.feed-sidebar-card { padding: 16px; }
.feed-sidebar-card h4 { font-size: 14px; margin-bottom: 12px; }
.suggested-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.suggested-user-info { flex: 1; min-width: 0; }
.suggested-user-name { font-size: 13px; font-weight: 600; }
.suggested-user-role { font-size: 12px; color: var(--text-tertiary); }

/* ===== CHAT ===== */
.chat-layout {
  display: flex;
  height: calc(100vh - 56px);  /* fallback for older browsers */
  height: calc(100dvh - 56px); /* iOS Safari: handles dynamic address bar */
  margin: -24px;
}
.chat-sidebar {
  width: 320px;
  border-right: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.chat-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-sidebar-header h3 { font-size: 16px; }
.chat-search { padding: 12px 16px; }
.chat-list { flex: 1; overflow-y: auto; }
.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--duration);
  border-bottom: 1px solid var(--border-light);
}
.chat-item:hover { background: var(--gray-50); }
[data-theme="dark"] .chat-item:hover { background: var(--bg-tertiary); }
.chat-item.active { background: var(--brand-50); }
[data-theme="dark"] .chat-item.active { background: rgba(105,65,198,0.1); }
.chat-item-avatar { position: relative; flex-shrink: 0; }
.chat-online-dot {
  position: absolute;
  bottom: 0; right: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--success-500);
  border: 2px solid var(--bg);
}
.chat-item-info { flex: 1; min-width: 0; }
.chat-item-name { font-size: 14px; font-weight: 600; }
.chat-item-preview { font-size: 13px; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-meta { text-align: right; flex-shrink: 0; }
.chat-item-time { font-size: 11px; color: var(--text-tertiary); }
.chat-unread {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--brand-600);
  color: white;
  font-size: 10px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  margin-top: 4px;
  margin-left: auto;
}

/* Chat main */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
}
.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  gap: 8px;
}
.chat-empty svg { width: 48px; height: 48px; color: var(--gray-300); margin-bottom: 8px; }
.chat-msg-header {
  padding: 12px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-msg-header h4 { flex: 1; font-size: 14px; }
.chat-back { display: none; }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.chat-bubble.sent {
  align-self: flex-end;
  background: var(--brand-600);
  color: white;
  border-bottom-right-radius: 4px;
}
.chat-bubble.received {
  align-self: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-bubble-time { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.chat-bubble.sent .chat-bubble-time { color: rgba(255,255,255,0.7); }
.chat-input {
  padding: 16px 20px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
}
.chat-input .form-input { flex: 1; }

/* Call invite cards */
.chat-call-invites-block { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 4px; }

.chat-call-card {
  max-width: 320px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  align-self: flex-end;
}
.chat-call-card.theirs { align-self: flex-start; }
.chat-call-card.mine   { align-self: flex-end; }

.chat-call-card-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
  background: rgba(200,164,78,0.05);
}
.chat-call-icon { font-size: 16px; }
.chat-call-label {
  flex: 1;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.chat-call-time-sent { font-size: 10.5px; color: var(--text-tertiary); }

.chat-call-details { padding: 10px 14px; }
.chat-call-datetime {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.chat-call-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: #667eea;
  text-decoration: none;
  background: rgba(102,126,234,0.08);
  border: 1px solid rgba(102,126,234,0.2);
  border-radius: 8px;
  padding: 4px 10px;
  margin-bottom: 6px;
  transition: background 0.15s;
}
.chat-call-link:hover { background: rgba(102,126,234,0.14); }
.chat-call-note {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.45;
}

.chat-call-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 12px;
  flex-wrap: wrap;
}
.chat-call-status-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}
.chat-call-status-pill.pending  { background: rgba(245,158,11,0.1);  color: #f59e0b; border: 1px solid rgba(245,158,11,0.2); }
.chat-call-status-pill.accepted { background: rgba(16,185,129,0.1);  color: #10B981; border: 1px solid rgba(16,185,129,0.2); }
.chat-call-status-pill.declined { background: rgba(239,68,68,0.08);  color: #ef4444; border: 1px solid rgba(239,68,68,0.15); }
.chat-call-status-pill.past     { background: var(--bg-secondary);   color: var(--text-tertiary); border: 1px solid var(--border); }

/* Typing indicator */
.chat-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 20px 2px;
  font-size: 12px;
  color: var(--text-tertiary);
}
.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
.typing-name {
  margin-left: 4px;
}
@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ===== PROFILE ===== */
.profile-page { max-width: 720px; }
.profile-header-card { overflow: hidden; }
.profile-cover {
  height: 160px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-400));
  position: relative;
}
.profile-header-body {
  padding: 0 24px 24px;
  position: relative;
}
.profile-avatar-wrap {
  margin-top: -40px;
  margin-bottom: 16px;
  position: relative;
  width: fit-content;
}
.profile-avatar-wrap .avatar { border: 4px solid var(--bg-card); }
.profile-avatar-edit {
  position: absolute;
  bottom: 0; right: -4px;
  width: 28px; height: 28px;
  border-radius: var(--radius-full);
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 12px;
}
.profile-name { font-size: 24px; font-weight: 700; margin-bottom: 2px; }
.profile-handle { font-size: 14px; color: var(--text-tertiary); margin-bottom: 8px; }
.profile-bio { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; }
.profile-stats {
  display: flex;
  gap: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.profile-stat { text-align: center; }
.profile-stat strong { display: block; font-size: 18px; font-weight: 700; }
.profile-stat span { font-size: 12px; color: var(--text-tertiary); }

/* Onboarding */
.onboarding-card { padding: 20px; }
.onboarding-card h4 { font-size: 14px; margin-bottom: 12px; }
.onboarding-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.onboarding-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--gray-100); overflow: hidden; }
.onboarding-bar-fill { height: 100%; border-radius: 2px; background: var(--brand-600); transition: width 0.5s var(--ease); }
.onboarding-pct { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.onboarding-steps { display: flex; flex-direction: column; gap: 8px; }
.onboarding-step {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-secondary);
}
.onboarding-step.done { color: var(--success-500); }
.onboarding-check {
  width: 20px; height: 20px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--gray-300);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
}
.onboarding-step.done .onboarding-check { background: var(--success-500); border-color: var(--success-500); color: white; }

/* Settings */
.settings-section { padding: 20px; }
.settings-section h4 { font-size: 14px; margin-bottom: 16px; }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label strong { font-size: 14px; font-weight: 500; }
.settings-row-label p { font-size: 12px; color: var(--text-tertiary); margin: 0; }

/* Toggle */
.toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  border-radius: 24px;
  background: var(--gray-200);
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--brand-600); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.2s var(--ease);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h3 { font-size: 18px; }

/* ===== NOTIFICATION DROPDOWN ===== */
.notif-dropdown {
  position: fixed;
  top: 48px; right: 24px;
  width: 380px;
  max-height: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 200;
  overflow: hidden;
}
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.notif-header h4 { font-size: 14px; }
.notif-list { overflow-y: auto; max-height: 360px; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--duration);
  cursor: pointer;
}
.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: var(--brand-50); }
.notif-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.notif-text { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.notif-text strong { color: var(--text-primary); }
.notif-time { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

/* ===== FILTER DROPDOWNS ===== */
.filter-dropdown-wrap {
  position: relative;
}
.filter-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 50;
  min-width: 160px;
}
.filter-dropdown label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.filter-dropdown label:hover {
  background: var(--gray-50);
}
[data-theme="dark"] .filter-dropdown label:hover {
  background: var(--bg-tertiary);
}
.filter-dropdown input[type="checkbox"] {
  accent-color: var(--brand-600);
}

/* ===== VIDEO PITCH ===== */
.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  text-align: center;
}
.video-badge-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}
.badge-default {
  background: var(--gray-100);
  color: var(--text-secondary);
}
.badge-brand {
  background: var(--brand-50);
  color: var(--brand-700);
}
.badge-success {
  background: var(--success-50);
  color: var(--success-700);
}

/* ===== CIRCLE PREMIUM ===== */
.circle-upgrade-card {
  padding: 32px 24px;
}
.circle-badge-large {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin: 0 auto;
  border-radius: var(--radius-full);
  background: var(--brand-50);
}
.circle-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.circle-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}
.circle-badge {
  vertical-align: middle;
  margin-left: 4px;
}

/* ===== ROLE CARDS ===== */
.role-card { overflow: hidden; }

/* ===== DEALFLOW CARDS ===== */
.dealflow-card { overflow: hidden; }
.watchlisted {
  color: var(--warning-500) !important;
}

/* ===== EVENT CARDS ===== */
.event-card { overflow: hidden; }

/* ===== MARKETPLACE CARDS ===== */
.marketplace-card { overflow: hidden; }

/* ===== MOBILE ===== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  height: 64px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  align-items: center;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-tertiary);
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: color var(--duration);
}
.bottom-nav-item.active { color: var(--brand-600); }
.bottom-nav-item svg { width: 22px; height: 22px; }

/* ===== MOBILE RESPONSIVENESS ===== */

/* --- Tablet breakpoint (max 1024px) --- */
@media (max-width: 1024px) {
  .topbar-search { min-width: 180px; }
  .discover-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .feed-layout { grid-template-columns: 1fr 260px; gap: 16px; }
  .profile-stats { gap: 16px; }
}

/* --- Main mobile breakpoint (max 768px) --- */
@media (max-width: 768px) {
  /* Sidebar: hidden on mobile, toggleable via hamburger */
  .app-sidebar {
    display: none;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    z-index: 200;
    box-shadow: var(--shadow-xl);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .app-sidebar.open,
  .app-sidebar.mobile-open {
    display: flex;
    transform: translateX(0);
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(0, 0, 0, 0.4);
  }
  .sidebar-overlay.open { display: block; }

  /* Main content: full width, no overflow */
  .app-content {
    margin-left: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  /* Bottom nav visible */
  .bottom-nav { display: flex; }

  /* Hamburger visible */
  .mobile-menu-btn { display: flex; }

  /* Hide desktop search in topbar */
  .topbar-search { display: none; }

  /* Topbar adjustments */
  .app-topbar { padding: 0 12px; height: 52px; }
  .topbar-title { font-size: 15px; }

  /* Page content spacing */
  .page-content { padding: 12px; }
  .page-header { margin-bottom: 16px; }
  .page-header h2 { font-size: 20px; }

  /* Notification dropdown full-width */
  .notif-dropdown {
    right: 8px;
    left: 8px;
    width: auto;
    max-height: 70vh;
  }

  /* --- Discover --- */
  .discover-grid { grid-template-columns: 1fr; gap: 12px; }
  .discover-filters { gap: 6px; margin-bottom: 16px; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; max-width: 100%; }
  .discover-filters::-webkit-scrollbar { display: none; }
  .filter-btn { padding: 6px 10px; font-size: 12px; }
  .filter-dropdown-wrap { position: static; }
  .filter-dropdown {
    position: fixed;
    bottom: 64px;
    left: 8px;
    right: 8px;
    top: auto;
    border-radius: var(--radius-lg);
    z-index: 150;
  }
  .profile-card-header { padding: 16px 16px 0; }
  .profile-card-body { padding: 10px 16px; }
  .profile-card-tags { padding: 0 16px 10px; }
  .profile-card-footer { padding: 10px 16px; }

  /* --- Feed --- */
  .feed-layout { grid-template-columns: 1fr; }
  .feed-sidebar { display: none; }
  .post-composer { padding: 14px; }
  .post-header { padding: 12px 14px 0; }
  .post-body { padding: 10px 14px; }
  .post-milestone { margin: 0 14px 10px; }
  .post-actions { padding: 6px 8px; }
  .post-action { padding: 8px 4px; font-size: 12px; }
  .composer-toolbar { margin-top: 10px; padding-top: 10px; }
  .composer-tool { padding: 6px 8px; font-size: 12px; }
  .composer-tool span { display: none; }

  /* --- Chat: full-screen when conversation open --- */
  .chat-layout {
    margin: -12px;
    height: calc(100vh - 52px);
    height: calc(100dvh - 52px);
    width: calc(100% + 24px);
    overflow: hidden;
    box-sizing: border-box;
  }
  .chat-sidebar { width: 100%; min-width: 0; box-sizing: border-box; }
  .chat-sidebar-header, .chat-search, .chat-list { max-width: 100%; box-sizing: border-box; }
  .chat-main { display: none; }
  .chat-layout.open .chat-sidebar { display: none; }
  .chat-layout.open .chat-main {
    display: flex;
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 64px;
    z-index: 90;
    height: auto;
  }
  .chat-layout.open .chat-back { display: flex; }
  .chat-messages { padding: 12px; }
  .chat-bubble { max-width: 85%; }
  .chat-input { padding: 10px 12px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .chat-sidebar-header { padding: 12px; }
  .chat-search { padding: 8px 12px; }
  .chat-item { padding: 10px 12px; }

  /* --- Profile: stack vertically --- */
  .profile-page { max-width: 100%; }
  .profile-header-body { padding: 0 16px 16px; }
  .profile-cover { height: 120px; }
  .profile-name { font-size: 20px; }
  .profile-stats { gap: 16px; flex-wrap: wrap; }
  .profile-stat strong { font-size: 16px; }

  /* --- Settings --- */
  .settings-section { padding: 14px; }
  .settings-row { flex-wrap: wrap; gap: 8px; }

  /* --- Modals: full-screen on mobile --- */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 20px 16px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }

  /* --- Touch-friendly tap targets (min 44px) --- */
  .btn, .filter-btn, .sidebar-link, .post-action,
  .chat-item, .notif-item, .bottom-nav-item {
    min-height: 44px;
  }
  .btn-icon, .topbar-btn, .mobile-menu-btn {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* --- Prevent horizontal scroll --- */
  html, body { overflow-x: hidden; }
  .app-shell { overflow-x: hidden; }

  /* --- Text overflow safety --- */
  .profile-card-name,
  .chat-item-name,
  .post-author,
  .sidebar-user-name,
  .topbar-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* --- Images don't overflow --- */
  img, video { max-width: 100%; height: auto; }
  .post-image { width: 100%; }

  /* --- Onboarding card spacing --- */
  .onboarding-card { padding: 14px; }

  /* --- Circle / Premium card --- */
  .circle-upgrade-card { padding: 20px 16px; }

  /* --- Plan upgrade overlay --- */
  .plan-upgrade-card { padding: 24px 16px; max-width: 100%; }
}

/* --- Small phone breakpoint (max 480px) --- */
@media (max-width: 480px) {
  .page-content { padding: 10px; }
  .page-header h2 { font-size: 18px; }
  .page-header p { font-size: 13px; }

  .discover-filters { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .discover-filters::-webkit-scrollbar { display: none; }
  .filter-btn { flex-shrink: 0; }

  .profile-card-header { gap: 10px; }
  .profile-card-name { font-size: 14px; }

  .feed-layout { gap: 10px; }
  .post-composer { padding: 12px; }
  .composer-row { gap: 8px; }
  .post-header { padding: 10px 12px 0; gap: 10px; }
  .post-body { padding: 8px 12px; font-size: 13px; }
  .post-actions { gap: 0; }
  .post-action { gap: 4px; font-size: 11px; }

  .chat-bubble { max-width: 90%; font-size: 13px; padding: 8px 12px; }
  .chat-msg-header { padding: 10px 12px; }

  .profile-cover { height: 100px; }
  .profile-avatar-wrap { margin-top: -32px; }
  .profile-header-body { padding: 0 12px 12px; }
  .profile-name { font-size: 18px; }
  .profile-handle { font-size: 13px; }
  .profile-bio { font-size: 13px; }
  .profile-stats { gap: 12px; }

  .modal { padding: 16px 12px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .modal-header h3 { font-size: 16px; }

  .settings-row-label strong { font-size: 13px; }
  .settings-row-label p { font-size: 11px; }

  /* Bottom nav smaller text */
  .bottom-nav { height: 56px; }
  .bottom-nav-item { font-size: 9px; gap: 1px; }
  .bottom-nav-item svg { width: 20px; height: 20px; }

  .app-topbar { padding: 0 10px; }
  .topbar-left { gap: 8px; }

  /* Notification dropdown */
  .notif-dropdown { right: 4px; left: 4px; }
  .notif-item { padding: 10px 12px; }
  .notif-icon { width: 28px; height: 28px; }
}

/* --- Very small screens (max 360px) --- */
@media (max-width: 360px) {
  .page-content { padding: 8px; }
  .profile-stats { flex-direction: column; align-items: flex-start; gap: 8px; }
  .discover-search-bar .form-input { font-size: 14px; }
}

/* --- Safe area insets for notched devices --- */
@supports (padding: env(safe-area-inset-bottom)) {
  .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 0);
    height: calc(64px + env(safe-area-inset-bottom, 0px));
  }
  @media (max-width: 768px) {
    .app-content {
      padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }
    .chat-layout.open .chat-main {
      bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }
  }
}

/* --- Landscape phone orientation --- */
@media (max-width: 768px) and (orientation: landscape) {
  .bottom-nav { height: 48px; }
  .bottom-nav-item { font-size: 0; gap: 0; padding: 6px 12px; }
  .bottom-nav-item svg { width: 20px; height: 20px; }
  .chat-layout { height: calc(100vh - 52px); }
  .modal { max-height: 100vh; }
}

/* Post comments */
.post-comments .comment-list:empty + div { margin-top: 0; }
.post-delete { opacity: 0; transition: opacity 0.15s; }
.post-card:hover .post-delete { opacity: 1; }

/* Search overlay */
#searchResults .search-result-item:hover { background: var(--bg-secondary); }

/* ============================================
   PLAN GATING
   ============================================ */

/* Inline-Lock: Feature-Button/Link mit Lock-Icon */
.plan-locked {
  position: relative;
  opacity: 0.55;
  cursor: not-allowed !important;
}
.plan-locked:hover { opacity: 0.75; }

.plan-lock-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  vertical-align: middle;
}
.plan-lock-icon svg { width: 10px; height: 10px; }

/* Sektion mit Upgrade-Overlay */
.plan-section-locked { position: relative; }
.plan-section-locked > *:not(.plan-upgrade-overlay) {
  filter: blur(4px) grayscale(0.6);
  pointer-events: none;
  user-select: none;
}
.plan-upgrade-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, rgba(15,15,20,0.55), rgba(15,15,20,0.85));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: var(--radius-xl, 16px);
  z-index: 10;
}
.plan-upgrade-card {
  max-width: 380px;
  text-align: center;
  background: var(--bg-card, #1a1a24);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}
.plan-upgrade-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.plan-upgrade-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.plan-upgrade-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}
.plan-upgrade-card .btn { width: 100%; }

/* Sidebar plan badge — positioned top-right so it doesn't collide with
   the role badge sitting below the user name. */
.sidebar-plan-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  z-index: 2;
}
.sidebar-user { position: relative; }
.sidebar-user-role { text-transform: none !important; padding-top: 2px; min-height: 22px; }

/* Verified badge (Circle members) */
.verified-badge {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}
.verified-badge svg { display: block; }

/* Plan badges differentiation */
.badge-pro { background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff !important; }
.badge-circle { background: linear-gradient(135deg, #a855f7, #6941c6); color: #fff !important; }
.badge-investor { background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff !important; }

/* ===========================
   PWA INSTALL BANNER
   =========================== */
#pwa-install-banner {
  position: fixed;
  bottom: -100px;
  left: 0;
  right: 0;
  z-index: 99998;
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  transform: translateY(0);
}
#pwa-install-banner.pwa-banner-visible {
  transform: translateY(-100px);
  bottom: 0;
  transform: translateY(0);
}
.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
}
.pwa-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
}
.pwa-banner-text {
  flex: 1;
  min-width: 0;
}
.pwa-banner-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.pwa-banner-text span {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.pwa-install-btn {
  flex-shrink: 0;
  white-space: nowrap;
}
.pwa-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  flex-shrink: 0;
}
.pwa-close-btn:hover { color: var(--text-primary); }

/* Standalone mode adjustments */
.pwa-standalone .app-sidebar {
  padding-top: env(safe-area-inset-top, 0px);
}
.pwa-standalone .app-main {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ====================================================
   CALENDAR
   ==================================================== */

.cal-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: flex-start;
}
@media (max-width: 900px) {
  .cal-layout { grid-template-columns: 1fr; }
}

/* Navigation */
.cal-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.cal-month-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  text-transform: capitalize;
}

/* Day-of-week headers */
.cal-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}
.cal-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 0;
}

/* Grid */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-cell {
  min-height: 80px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 7px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  overflow: hidden;
}
.cal-cell:hover { border-color: rgba(200,164,78,0.4); background: rgba(200,164,78,0.03); }
.cal-cell-empty { background: transparent; border-color: transparent; cursor: default; }
.cal-cell-empty:hover { background: transparent; border-color: transparent; }

.cal-today {
  border-color: rgba(200,164,78,0.5) !important;
  background: rgba(200,164,78,0.06) !important;
}
.cal-today .cal-day-num {
  background: linear-gradient(135deg, #c8a44e, #d8b454);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.cal-day-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
  line-height: 1;
}
.cal-event-dot {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-dot-matching { background: rgba(200,164,78,0.15); color: #c8a44e; }
.cal-dot-chat     { background: rgba(102,126,234,0.15); color: #667eea; }
.cal-dot-manual   { background: rgba(16,185,129,0.12); color: #10B981; }
.cal-dot-circle   { background: rgba(200,164,78,0.15); color: #c8a44e; }
.cal-event-more   { font-size: 9px; color: var(--text-tertiary); font-weight: 600; }

/* Legend */
.cal-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
}
.cal-legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Sidebar upcoming */
.cal-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 16px;
  position: sticky;
  top: 80px;
}
.cal-sidebar-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  color: var(--text-tertiary);
}
.cal-empty-upcoming {
  text-align: center;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.cal-empty-upcoming p { font-size: 13px; color: var(--text-tertiary); }

.cal-upcoming-card {
  display: flex;
  gap: 0;
  background: var(--bg-secondary);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.cal-upcoming-card:hover { opacity: 0.85; }
.cal-upcoming-stripe { width: 4px; flex-shrink: 0; }
.cal-upcoming-body { flex: 1; padding: 10px 10px 10px 12px; min-width: 0; }
.cal-upcoming-title { font-size: 12.5px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-upcoming-meta { font-size: 11px; color: var(--text-secondary); display: flex; gap: 8px; margin-bottom: 3px; }
.cal-upcoming-type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.cal-upcoming-person { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-secondary); margin-top: 4px; }
.cal-upcoming-actions { display: flex; flex-direction: column; gap: 4px; padding: 8px 8px 8px 0; justify-content: center; align-items: flex-end; flex-shrink: 0; }
.cal-pending-badge { font-size: 10px; color: #f59e0b; font-weight: 700; }
.cal-confirmed-badge { font-size: 10px; color: #10B981; font-weight: 700; }

/* ===========================
   SETTINGS — Extended
   =========================== */
.settings-section h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.settings-section .settings-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

/* Circle Apply Modal */
.circle-apply-success {
  text-align: center;
  padding: 32px 24px;
}
.circle-apply-success-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(200,164,78,0.15), rgba(200,164,78,0.05));
  border: 1.5px solid rgba(200,164,78,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

/* Delete modal danger styling */
#settingsDeleteModal { /* used via _cOverlay id */ }
#deleteConfirmInput:focus { border-color: var(--error-400, #f87171) !important; box-shadow: 0 0 0 3px rgba(220,38,38,0.1); }

@media (max-width: 768px) {
  #pwa-install-banner {
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .pwa-banner-text strong { font-size: 13px; }
  .pwa-banner-text span { font-size: 11px; }
}

/* ===========================
   ROLE BADGES
   =========================== */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
  white-space: nowrap;
  vertical-align: middle;
  border: 1px solid transparent;
}
.role-badge svg { width: 11px; height: 11px; flex-shrink: 0; }
.role-badge--founder  { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; }
.role-badge--talent   { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.role-badge--operator { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.role-badge--investor { background: #fef3c7; color: #854d0e; border-color: #fde68a; }
.role-badge--admin    { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

/* Dark mode */
[data-theme="dark"] .role-badge--founder  { background: #312e81; color: #c7d2fe; border-color: #4338ca; }
[data-theme="dark"] .role-badge--talent   { background: #064e3b; color: #a7f3d0; border-color: #059669; }
[data-theme="dark"] .role-badge--operator { background: #7c2d12; color: #fed7aa; border-color: #c2410c; }
[data-theme="dark"] .role-badge--investor { background: #78350f; color: #fde68a; border-color: #b45309; }
[data-theme="dark"] .role-badge--admin    { background: #7f1d1d; color: #fecaca; border-color: #b91c1c; }

/* Larger variant for profile header */
.role-badge--lg {
  padding: 4px 12px;
  font-size: 13px;
}
.role-badge--lg svg { width: 13px; height: 13px; }

/* === "In meiner Stadt" quick filter chip === */
.my-city-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--brand-50, #eef2ff);
  color: var(--brand-700, #4338ca);
  border: 1px solid var(--brand-200, #c7d2fe);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
.my-city-chip:hover { background: var(--brand-100, #e0e7ff); }
.my-city-chip:active { transform: scale(0.97); }
.my-city-chip.active { background: var(--brand-600, #4f46e5); color: #fff; border-color: var(--brand-600, #4f46e5); }
.my-city-chip svg { width: 12px; height: 12px; }

