/* ============================================================
   SPEAK2 INTAKE — STYLESHEET
   Design: Mobile-first, Lato, blue palette for middle-aged users
   ============================================================ */

/* ── Variables ── */
:root {
  --primary:        #1a73c8;
  --primary-dark:   #135aa0;
  --primary-deeper: #0d3f73;
  --primary-mid:    #4a96d4;
  --primary-light:  #deeef9;
  --primary-lighter:#f0f7fd;
  --primary-border: #b3d4ed;

  --text-dark:   #1a2535;
  --text-medium: #3a526a;
  --text-light:  #7693aa;
  --text-xlight: #b0c4d4;

  --bg:          #f4f8fc;
  --bg-card:     #ffffff;
  --border:      #d0e2ef;
  --border-light:#e8f1f8;

  --success:     #2a9d6f;
  --success-bg:  #e6f7f2;
  --error:       #c0392b;
  --error-bg:    #fdf0ee;
  --warning:     #d68910;
  --warning-bg:  #fef9ec;

  --shadow-sm:  0 1px 4px rgba(26,115,200,0.08);
  --shadow:     0 2px 14px rgba(26,115,200,0.12);
  --shadow-lg:  0 8px 32px rgba(26,115,200,0.16);

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --sidebar-w: 288px;
  --header-h:  60px;
  --font: 'Lato', sans-serif;

  --transition: 0.18s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
input, textarea, select, button { font-family: var(--font); }

/* ── Auth Pages ── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--primary-deeper) 0%, var(--primary) 60%, var(--primary-mid) 100%);
  padding: 24px 16px;
}
.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  padding: 40px 36px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo .logo-mark {
  display: inline-block;
  width: 80px; height: 80px;
  margin-bottom: 12px;
}
.auth-logo .logo-mark img {
  width: 100%; height: 100%;
  object-fit: contain;
}
.auth-logo h1 {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--primary-deeper);
  letter-spacing: -0.5px;
}
.auth-logo p {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-top: 4px;
}
.auth-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}
.auth-card .auth-sub {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 24px;
}

/* ── Form Elements ── */
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-medium);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.form-group .help-text {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 5px;
  line-height: 1.4;
}
.form-group .field-required {
  color: var(--primary);
  margin-left: 2px;
}
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 1rem;
  color: var(--text-dark);
  background: var(--bg-card);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,200,0.12);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237693aa' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

/* Radio & Checkbox Groups */
.radio-group, .checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.radio-group.inline, .checkbox-group.inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.radio-option, .checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 10px 14px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--primary-lighter);
  transition: all var(--transition);
  user-select: none;
}
.radio-option:hover, .checkbox-option:hover {
  border-color: var(--primary-mid);
  background: var(--primary-light);
}
.radio-option input, .checkbox-option input {
  width: 18px; height: 18px;
  min-width: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  border: none;
  padding: 0;
  margin: 0;
  box-shadow: none;
}
.radio-option.selected, .checkbox-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}
.radio-option span, .checkbox-option span {
  font-size: 0.9375rem;
  color: var(--text-medium);
  font-weight: 400;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: white; }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary-light); color: var(--primary-dark); }
.btn-ghost {
  background: transparent;
  color: var(--text-medium);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--border-light); color: var(--text-dark); }
.btn-sm { padding: 8px 16px; font-size: 0.875rem; }
.btn-lg { padding: 15px 32px; font-size: 1.05rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Divider */
.auth-divider {
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
  margin: 20px 0;
  position: relative;
}
.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.auth-divider span {
  background: var(--bg-card);
  padding: 0 12px;
  position: relative;
}
.auth-link-row {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-light);
}
.auth-link-row a { font-weight: 700; }
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 18px;
}
.alert-error { background: var(--error-bg); color: var(--error); border: 1px solid #f5c0bb; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #b7e5d5; }

/* ── App Shell ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--primary-deeper);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
}
.sidebar-header {
  padding: 24px 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo-mark {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-logo-mark img {
  width: 100%; height: 100%;
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar-logo-text h2 {
  color: white;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.3px;
  line-height: 1.1;
}
.sidebar-logo-text p {
  color: rgba(255,255,255,0.5);
  font-size: 0.72rem;
  font-weight: 400;
  margin-top: 1px;
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}
.nav-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 16px 22px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  text-decoration: none;
}
.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: white;
}
.nav-item.active {
  background: rgba(255,255,255,0.12);
  color: white;
  border-left-color: var(--primary-mid);
  font-weight: 700;
}
.nav-item .nav-icon { width: 18px; font-size: 15px; flex-shrink: 0; text-align: center; }
.nav-item .nav-check { margin-left: auto; font-size: 12px; color: var(--success); }
.nav-item .nav-pct {
  margin-left: auto;
  font-size: 0.72rem;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6);
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 700;
}
.nav-item .nav-pct.done { background: rgba(42,157,111,0.25); color: #6ee7c7; }

/* Category toggles */
.nav-category {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 22px;
  color: rgba(255,255,255,0.85);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.nav-category:hover { background: rgba(255,255,255,0.06); }
.nav-category .cat-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-category .cat-arrow {
  margin-left: auto;
  font-size: 11px;
  transition: transform var(--transition);
  color: rgba(255,255,255,0.4);
}
.nav-category.open .cat-arrow { transform: rotate(180deg); }
.nav-sub { display: none; }
.nav-sub.open { display: block; }
.nav-sub .nav-item {
  padding-left: 52px;
  font-size: 0.845rem;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 22px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-avatar {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info .name { color: white; font-size: 0.85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info .role { color: rgba(255,255,255,0.45); font-size: 0.72rem; }
.sidebar-logout { background: none; border: none; color: rgba(255,255,255,0.4); cursor: pointer; font-size: 18px; padding: 4px; transition: color var(--transition); }
.sidebar-logout:hover { color: rgba(255,255,255,0.8); }

/* Mobile Header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--primary-deeper);
  z-index: 150;
  align-items: center;
  padding: 0 16px;
  gap: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.mobile-logo { flex: 1; }
.mobile-logo h2 { color: white; font-size: 1.05rem; font-weight: 900; }
.mobile-logo p { color: rgba(255,255,255,0.45); font-size: 0.7rem; }
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: white;
  display: flex; flex-direction: column; gap: 5px;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: white;
  border-radius: 2px;
  transition: all var(--transition);
}

/* Mobile Drawer Overlay */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 190;
}
.drawer-overlay.open { display: block; }

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.content-area {
  flex: 1;
  padding: 36px 40px;
  max-width: 900px;
}

/* Page Header */
.page-header {
  margin-bottom: 28px;
}
.page-breadcrumb {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.page-breadcrumb span { color: var(--text-xlight); }
.page-header h1 {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--text-dark);
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.page-header .page-desc {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: 6px;
  line-height: 1.5;
}

/* Progress Bar */
.progress-bar-wrap {
  background: var(--border-light);
  border-radius: 20px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-mid));
  border-radius: 20px;
  transition: width 0.4s ease;
}
.progress-label {
  font-size: 0.78rem;
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  padding: 28px;
  margin-bottom: 20px;
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .card-icon { font-size: 18px; }

/* Dashboard */
.dashboard-welcome {
  background: linear-gradient(135deg, var(--primary-deeper) 0%, var(--primary) 100%);
  border-radius: var(--radius-lg);
  padding: 32px;
  color: white;
  margin-bottom: 28px;
}
.dashboard-welcome h1 { font-size: 1.5rem; font-weight: 900; margin-bottom: 6px; }
.dashboard-welcome p { color: rgba(255,255,255,0.7); font-size: 0.9rem; }

.section-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.section-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-light);
  padding: 22px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: block;
}
.section-card:hover {
  border-color: var(--primary-mid);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.section-card-icon { font-size: 28px; margin-bottom: 10px; }
.section-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}
.section-card p { font-size: 0.82rem; color: var(--text-light); margin-bottom: 14px; }
.section-card-progress { margin-top: auto; }
.section-card-pct {
  font-size: 0.78rem;
  color: var(--text-medium);
  font-weight: 700;
  margin-top: 6px;
}

/* Form Page */
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  gap: 12px;
}
.form-actions .save-status {
  font-size: 0.8rem;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 5px;
  opacity: 0;
  transition: opacity 0.3s;
}
.form-actions .save-status.visible { opacity: 1; }
.form-nav-btns { display: flex; gap: 10px; }

/* Section Subtitle */
.section-subtitle {
  background: var(--primary-lighter);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: var(--text-medium);
  line-height: 1.5;
  font-style: italic;
}

/* Profile */
.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}
.profile-avatar-lg {
  width: 72px; height: 72px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  font-size: 26px;
  color: white;
  flex-shrink: 0;
}
.profile-avatar-info h2 { font-size: 1.25rem; font-weight: 700; color: var(--text-dark); }
.profile-avatar-info p { font-size: 0.875rem; color: var(--text-light); }

/* Stat Pills */
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.stat-pill {
  background: var(--primary-lighter);
  border: 1px solid var(--primary-border);
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 0.82rem;
  color: var(--primary-dark);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Page list in dashboard quick access */
.page-list {
  list-style: none;
}
.page-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  color: var(--text-medium);
  font-size: 0.9rem;
  transition: color var(--transition);
  text-decoration: none;
}
.page-list-item:last-child { border-bottom: none; }
.page-list-item:hover { color: var(--primary); }
.page-list-item .pli-icon { width: 30px; height: 30px; background: var(--primary-lighter); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.page-list-item .pli-name { flex: 1; }
.page-list-item .pli-arrow { color: var(--text-xlight); font-size: 12px; }
.page-list-item .pli-pct { font-size: 0.75rem; font-weight: 700; color: var(--text-light); background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 2px 8px; }
.page-list-item .pli-pct.complete { color: var(--success); background: var(--success-bg); border-color: #b7e5d5; }

/* Form row grid */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

/* Save notification */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--text-dark);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--success); }

/* Field groups inside cards */
.field-divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 20px 0;
}
.field-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-xlight);
  margin-bottom: 14px;
  margin-top: 20px;
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding-top: var(--header-h); }
  .mobile-header { display: flex; }
  .content-area { padding: 24px 18px; }
  .auth-card { padding: 28px 22px; }
}
@media (max-width: 640px) {
  .section-cards { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column-reverse; align-items: stretch; }
  .form-nav-btns { justify-content: space-between; }
  .dashboard-welcome { padding: 22px 18px; }
}

/* Scrollbar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.fw-700 { font-weight: 700; }
.color-light { color: var(--text-light); }
.color-primary { color: var(--primary); }
.small { font-size: 0.85rem; }

/* Page transition */
.page-enter {
  animation: fadeSlide 0.2s ease forwards;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Completion badge */
.completion-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-left: 8px;
}
.completion-badge.complete { background: var(--success-bg); color: var(--success); }
.completion-badge.in-progress { background: var(--warning-bg); color: var(--warning); }
.completion-badge.not-started { background: var(--border-light); color: var(--text-light); }

/* Char counter */
.char-counter {
  font-size: 0.75rem;
  color: var(--text-xlight);
  text-align: right;
  margin-top: 3px;
}

/* ── Section Landing Page ── */
.section-landing-hero {
  background: linear-gradient(135deg, var(--primary-deeper) 0%, var(--primary) 100%);
  border-radius: var(--radius-lg);
  padding: 32px;
  color: white;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.slh-left {
  display: flex;
  gap: 18px;
  flex: 1;
  min-width: 0;
}
.slh-icon {
  font-size: 3rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.slh-content { flex: 1; min-width: 0; }
.slh-content h1 {
  font-size: 1.5rem;
  font-weight: 900;
  color: white;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.slh-desc {
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  margin-bottom: 14px;
  line-height: 1.5;
}
.slh-subtitle {
  background: rgba(255,255,255,0.12) !important;
  border-left-color: rgba(255,255,255,0.5) !important;
  color: rgba(255,255,255,0.85) !important;
  margin-bottom: 14px !important;
}
.slh-progress-wrap { margin-top: 12px; }
.slh-bar {
  background: rgba(255,255,255,0.2) !important;
  height: 8px !important;
  margin-bottom: 6px !important;
}
.slh-progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
}
.slh-share-btn {
  background: rgba(255,255,255,0.15);
  color: white;
  border-color: rgba(255,255,255,0.35);
  flex-shrink: 0;
  white-space: nowrap;
  align-self: flex-start;
}
.slh-share-btn:hover {
  background: rgba(255,255,255,0.28);
  border-color: rgba(255,255,255,0.6);
  color: white;
}
.section-landing-subheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-landing-subheader h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.slh-page-count {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Page Grid ── */
.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.page-grid-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition);
  cursor: pointer;
  min-height: 120px;
}
.page-grid-card:hover {
  border-color: var(--primary-mid);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  color: inherit;
}
.page-grid-card--complete {
  border-color: #b7e5d5;
  background: #f4fdf9;
}
.page-grid-card--in-progress {
  border-color: var(--primary-border);
  background: var(--primary-lighter);
}
.pgc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pgc-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-xlight);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 7px;
}
.pgc-icon { font-size: 1.25rem; }
.pgc-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.3;
  flex: 1;
}
.pgc-footer { margin-top: auto; }
.pgc-bar {
  height: 4px !important;
  margin-bottom: 6px !important;
}
.pgc-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}
.pgc-badge--not-started { background: var(--bg); color: var(--text-xlight); border: 1px solid var(--border); }
.pgc-badge--in-progress { background: var(--primary-light); color: var(--primary-dark); }
.pgc-badge--complete    { background: var(--success-bg); color: var(--success); }

/* ── Share Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,63,115,0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  padding: 28px;
  animation: modalIn 0.2s ease forwards;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
}
.modal-close {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  line-height: 1;
}
.modal-close:hover { background: var(--border-light); color: var(--text-dark); }
.modal-desc {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 20px;
  line-height: 1.5;
}
.share-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.share-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--primary-lighter);
  cursor: pointer;
  text-decoration: none;
  color: var(--text-dark);
  transition: all var(--transition);
  font-family: var(--font);
  font-size: 1rem;
  width: 100%;
  text-align: left;
}
.share-option:hover {
  border-color: var(--primary-mid);
  background: var(--primary-light);
  color: var(--text-dark);
}
.share-option-icon { font-size: 1.4rem; flex-shrink: 0; }
.share-option-title { font-weight: 700; font-size: 0.875rem; color: var(--text-dark); }
.share-option-sub   { font-size: 0.775rem; color: var(--text-light); margin-top: 2px; }
.share-link-box input {
  width: 100%;
  font-size: 0.8rem;
  color: var(--text-light);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  cursor: text;
}

/* ── History Panel ── */
.history-card {
  padding: 0;
  overflow: hidden;
}
.history-details summary { list-style: none; }
.history-details summary::-webkit-details-marker { display: none; }
.history-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 17px 24px;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-dark);
  border-bottom: 1px solid transparent;
  transition: background var(--transition);
}
.history-summary:hover { background: var(--primary-lighter); }
.history-details[open] .history-summary { border-bottom-color: var(--border-light); }
.history-count {
  margin-left: auto;
  font-size: 0.72rem;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 2px 9px;
  border-radius: 20px;
  font-weight: 700;
}
.history-list { padding: 4px 24px 12px; }
.history-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-light);
}
.history-entry:last-child { border-bottom: none; }
.history-avatar {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: white;
  flex-shrink: 0;
}
.history-info { flex: 1; min-width: 0; }
.history-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.history-you-tag {
  font-size: 0.68rem;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 1px 6px;
  border-radius: 20px;
  font-weight: 700;
}
.history-meta {
  font-size: 0.775rem;
  color: var(--text-light);
  margin-top: 2px;
}

/* ── Contributors List ── */
.contributors-list {
  display: flex;
  flex-direction: column;
}
.contributor-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.contributor-item:last-child { border-bottom: none; }
.contributor-avatar {
  width: 42px; height: 42px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: white;
  flex-shrink: 0;
}
.contributor-info { flex: 1; min-width: 0; }
.contributor-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-dark);
}
.contributor-meta {
  font-size: 0.775rem;
  color: var(--text-light);
  margin-top: 2px;
}
.contributor-you {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 3px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* ── Nav category active state (section landing) ── */
.nav-category.section-active {
  background: rgba(255,255,255,0.1);
  border-left: 3px solid var(--primary-mid);
}

/* ── Breadcrumb links ── */
.page-breadcrumb a {
  color: var(--text-light);
  text-decoration: none;
}
.page-breadcrumb a:hover { color: var(--primary); }

/* ── Responsive for new components ── */
@media (max-width: 720px) {
  .section-landing-hero { flex-direction: column; gap: 16px; }
  .slh-left { gap: 14px; }
  .slh-icon { font-size: 2.2rem; }
  .slh-content h1 { font-size: 1.3rem; }
  .slh-share-btn { align-self: stretch; justify-content: center; }
  .page-grid { grid-template-columns: 1fr 1fr; }
  .section-landing-subheader { flex-direction: column; align-items: flex-start; gap: 10px; }
}
@media (max-width: 420px) {
  .page-grid { grid-template-columns: 1fr; }
  .modal { padding: 20px 18px; }
}

/* ============================================================
   SPEAKY SAYS PAGE
   ============================================================ */

/* Nav icon */
.speaky-nav-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 4px;
}

/* ── Mascot intro card */
.speaky-intro-card {
  background: linear-gradient(135deg, var(--primary-deeper) 0%, var(--primary) 60%, #4fa3e0 100%);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 20px;
  color: white;
}
.speaky-mascot-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
}
.speaky-mascot-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.18));
}
.speaky-speech-bubble {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.speaky-speech-bubble strong {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.speaky-speech-bubble span {
  font-size: 0.95rem;
  opacity: 0.88;
  line-height: 1.5;
}

/* ── Two-column layout */
.speaky-two-col {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 16px;
  margin-bottom: 20px;
  align-items: start;
}

/* ── Contributors */
.speaky-contrib-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.speaky-contrib-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.speaky-contrib-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.speaky-contrib-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dark);
}
.speaky-contrib-meta {
  font-size: 0.8rem;
  color: var(--text-xlight);
  margin-top: 2px;
}

/* ── Completion donut + bars */
.speaky-chart-wrap {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.speaky-donut-wrap {
  flex-shrink: 0;
}
.speaky-donut-svg .donut-pct-text {
  font-size: 18px;
  font-weight: 800;
  fill: var(--text-dark);
  font-family: 'Lato', sans-serif;
}
.speaky-donut-svg .donut-label-text {
  font-size: 11px;
  fill: var(--text-xlight);
  font-family: 'Lato', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.speaky-chart-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 6px;
}
.speaky-chart-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.speaky-chart-label {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 155px;
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--text-medium);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.speaky-chart-icon {
  font-size: 0.9rem;
}
.speaky-chart-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--border-light);
  border-radius: 99px;
  overflow: hidden;
}
.speaky-chart-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #4fa3e0 100%);
  border-radius: 99px;
  transition: width 0.9s ease;
}
.speaky-chart-pct {
  font-size: 0.75rem;
  color: var(--text-xlight);
  width: 52px;
  text-align: right;
  flex-shrink: 0;
}
.speaky-chart-pct-num {
  font-weight: 700;
  color: var(--primary);
}

/* ── Working Genius */
.speaky-wg-intro {
  font-size: 0.88rem;
  color: var(--text-medium);
  margin-bottom: 18px;
  line-height: 1.6;
}
.wg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.wg-card {
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.wg-card--top {
  border-color: var(--primary-border);
  background: var(--primary-lighter);
  box-shadow: 0 2px 8px rgba(30, 90, 168, 0.07);
}
.wg-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.wg-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.wg-card-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-dark);
  line-height: 1.2;
}
.wg-card-desc {
  font-size: 0.75rem;
  color: var(--text-xlight);
  margin-top: 2px;
  line-height: 1.4;
}
.wg-level-badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.wg-genius     { background: #d1fae5; color: #065f46; }
.wg-competency { background: #dbeafe; color: #1e40af; }
.wg-frustration{ background: var(--bg); color: var(--text-xlight); border: 1px solid var(--border-light); }
.wg-card-bar-wrap {
  height: 5px;
  background: var(--border-light);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}
.wg-card-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.9s ease;
}
.wg-card-score {
  font-size: 0.72rem;
  color: var(--text-xlight);
  font-weight: 600;
  text-align: right;
}
.speaky-wg-story {
  margin-top: 18px;
  padding: 16px 20px;
  background: var(--primary-lighter);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-medium);
  font-style: italic;
}

/* ── Department Summaries */
.speaky-summaries-card {}
.speaky-summaries-intro {
  font-size: 0.88rem;
  color: var(--text-medium);
  margin-bottom: 18px;
}
.speaky-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 0;
  flex-wrap: wrap;
}
.speaky-tab {
  padding: 8px 18px;
  border: none;
  background: none;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-xlight);
  cursor: pointer;
  margin-bottom: -2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.speaky-tab:hover {
  color: var(--primary);
  background: var(--primary-lighter);
}
.speaky-tab.active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
  background: var(--primary-lighter);
}
.speaky-tab-content {
  min-height: 120px;
}
.speaky-tab-panel p {
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--text-medium);
  margin-bottom: 16px;
}
.speaky-tab-panel p:last-child { margin-bottom: 0; }
.speaky-tab-panel em { color: var(--text-dark); font-style: italic; }
.speaky-tab-panel strong { color: var(--text-dark); }

/* ── Print button */
.speaky-print-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0 16px;
}
.speaky-print-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 16px 40px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 16px rgba(30, 90, 168, 0.25);
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.speaky-print-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(30, 90, 168, 0.32);
}
.speaky-print-btn:active {
  transform: translateY(0);
}

/* ── Print styles */
@media print {
  .sidebar, .mobile-header, .speaky-print-wrap, .speaky-tabs { display: none !important; }
  .main-content { margin: 0 !important; padding: 0 !important; }
  .speaky-tab-panel { display: block !important; }
  .speaky-tab-panel::before {
    content: attr(id);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.8rem;
    color: #666;
    display: block;
    margin-bottom: 8px;
    letter-spacing: 0.1em;
  }
  .wg-card-bar-fill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── Responsive */
@media (max-width: 820px) {
  .speaky-two-col { grid-template-columns: 1fr; }
  .speaky-chart-wrap { flex-direction: column; align-items: flex-start; gap: 16px; }
  .speaky-donut-wrap { align-self: center; }
  .wg-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .speaky-mascot-wrap { flex-direction: column; text-align: center; }
  .speaky-mascot-img { width: 80px; height: 80px; }
  .speaky-chart-label { width: 110px; font-size: 0.7rem; }
}

/* ── Purpose Profile grid */
.purpose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}
.purpose-card {
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--bg);
}
.purpose-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}
.purpose-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.purpose-card-label {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.purpose-card-main {
  font-size: 0.88rem;
  color: var(--text-dark);
  line-height: 1.55;
  font-weight: 500;
  margin-bottom: 5px;
}
.purpose-card-sub {
  font-size: 0.78rem;
  color: var(--text-xlight);
  line-height: 1.5;
  border-top: 1px solid var(--border-light);
  padding-top: 7px;
  margin-top: 4px;
}
@media (max-width: 820px) {
  .purpose-grid { grid-template-columns: 1fr; }
}

/* ── Sidebar Profile Icon */
.sidebar-profile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.1rem;
  text-decoration: none;
  color: rgba(255,255,255,0.6);
  transition: background 0.15s, color 0.15s;
  margin-left: auto;
  flex-shrink: 0;
}
.sidebar-profile-icon:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.sidebar-profile-icon.active {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

/* ─────────────────────────────────────────────────────
   BIOGRAPHY PAGE
───────────────────────────────────────────────────── */
.bio-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* Header bar */
.bio-header-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 2px solid var(--border-light);
}
.bio-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-xlight);
  margin-bottom: 6px;
}
.bio-title {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text-dark);
  margin: 0 0 6px;
  line-height: 1.1;
}
.bio-subtitle {
  font-size: 0.9rem;
  color: var(--text-light);
  font-style: italic;
}
.bio-header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}
.bio-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.bio-create-btn:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); }
.bio-create-btn:disabled { opacity: 0.7; cursor: default; }
.bio-btn-icon { font-size: 1rem; }
.bio-btn-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: bio-spin 0.7s linear infinite;
}
@keyframes bio-spin { to { transform: rotate(360deg); } }
.bio-print-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.82rem;
  color: var(--text-light);
  cursor: pointer;
  transition: background 0.15s;
}
.bio-print-btn:hover { background: var(--bg-light); }

/* Chapters */
.bio-chapters {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.bio-chapter {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 40px 44px;
  margin-bottom: 28px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s;
}
.bio-chapter:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.07); }
.bio-chapter--locked {
  background: #fafafa;
  opacity: 0.7;
}
.bio-chapter-number {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}
.bio-chapter-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0 0 14px;
  line-height: 1.2;
}
.bio-chapter-rule {
  height: 3px;
  width: 48px;
  background: var(--primary);
  border-radius: 2px;
  margin-bottom: 24px;
  opacity: 0.5;
}

/* Chapter body typography */
.bio-chapter-body p {
  font-size: 1rem;
  line-height: 1.8;
  color: #374151;
  margin: 0 0 18px;
}
.bio-chapter-body p:last-child { margin-bottom: 0; }
.bio-chapter-body em {
  font-weight: 600;
  font-style: italic;
  color: var(--text-light);
  display: block;
  margin: 24px 0 10px;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.bio-pullquote {
  border-left: 4px solid var(--primary);
  margin: 24px 0;
  padding: 14px 20px;
  background: #f5f3ff;
  border-radius: 0 10px 10px 0;
  font-size: 0.97rem;
  line-height: 1.7;
  color: #4c3fa0;
  font-style: italic;
}

/* Locked placeholder */
.bio-chapter-placeholder {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-xlight);
  font-size: 0.88rem;
  padding: 12px 0;
}
.bio-lock-icon {
  font-size: 1.1rem;
  color: var(--primary);
  opacity: 0.4;
}

/* Print */
@media print {
  .sidebar, .mobile-header, .bio-header-actions { display: none !important; }
  .main-content { margin-left: 0 !important; padding: 0 !important; }
  .bio-chapter { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
  .bio-chapter--locked { display: none; }
  .bio-page { padding: 0; }
}

/* Responsive */
@media (max-width: 600px) {
  .bio-header-bar { flex-direction: column; }
  .bio-header-actions { align-items: flex-start; }
  .bio-chapter { padding: 24px 20px; }
  .bio-title { font-size: 1.6rem; }
}

/* ── Biography extra buttons */
.bio-secondary-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.bio-download-btn,
.bio-canva-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  white-space: nowrap;
}
.bio-download-btn:hover:not(:disabled),
.bio-canva-btn:hover:not(:disabled) { transform: translateY(-1px); }
.bio-download-btn:disabled,
.bio-canva-btn:disabled { opacity: 0.65; cursor: default; }

.bio-download-btn {
  background: #fff;
  border-color: var(--border);
  color: var(--text-light);
}
.bio-download-btn:hover:not(:disabled) { background: var(--bg-light); color: var(--text-dark); }

.bio-canva-btn {
  background: #8B3DFF;
  border-color: #8B3DFF;
  color: #fff;
  box-shadow: 0 2px 8px rgba(139,61,255,0.28);
}
.bio-canva-btn:hover:not(:disabled) { background: #7a30ee; border-color: #7a30ee; }

/* ── Toast notification */
.bio-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1e1b4b;
  color: #fff;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  max-width: 480px;
  text-align: center;
  line-height: 1.5;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 9999;
  pointer-events: none;
}
.bio-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 600px) {
  .bio-secondary-btns { justify-content: flex-start; }
  .bio-canva-btn, .bio-download-btn { font-size: 0.78rem; padding: 8px 12px; }
}

/* ── Editable chapter bodies */
.bio-chapter-body[contenteditable] {
  outline: none;
  border-radius: 8px;
  padding: 4px 6px;
  margin: -4px -6px;
  transition: background 0.15s, box-shadow 0.15s;
  cursor: text;
}
.bio-chapter-body[contenteditable]:hover {
  background: #fafafa;
}
.bio-chapter-body[contenteditable]:focus {
  background: #fff;
  box-shadow: 0 0 0 2px rgba(99,102,241,0.18), inset 0 0 0 1px rgba(99,102,241,0.22);
}

/* Edit hint label */
.bio-edit-hint {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-xlight);
  margin-left: 8px;
  opacity: 0;
  transition: opacity 0.15s;
  text-transform: none;
  font-style: italic;
  vertical-align: middle;
}
.bio-chapter:hover .bio-edit-hint { opacity: 1; }
.bio-chapter-body[contenteditable]:focus ~ * .bio-edit-hint,
.bio-chapter:focus-within .bio-edit-hint { opacity: 0; }

/* Save state indicators on chapter number */
.bio-chapter-number--saving .bio-edit-hint::after {
  content: ' · saving…';
  opacity: 1;
  color: var(--text-xlight);
}
.bio-chapter-number--saved .bio-edit-hint {
  opacity: 1 !important;
  color: #10b981;
}
.bio-chapter-number--saved .bio-edit-hint::before { content: '✓ saved'; }
.bio-chapter-number--saved .bio-edit-hint .bio-edit-hint-text { display: none; }

/* ── All bio buttons on one row */
.bio-all-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.bio-btn-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 2px;
}
/* Override old stacked direction */
.bio-header-actions {
  flex-direction: row !important;
  align-items: center !important;
}
.bio-secondary-btns { display: contents; } /* flatten if still referenced */

/* ── Sidebar Resident Picker (staff) ── */
.sidebar-resident-picker {
  padding: 10px 14px;
  background: rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.srp-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.45);
  margin-bottom: 5px;
}
.srp-select {
  width: 100%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
}
.srp-select option { background: #1e2a38; color: #fff; }

/* ── Admin Dashboard ── */
.admin-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.admin-tab {
  background: none;
  border: none;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 4px 4px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}
.admin-tab:hover { color: var(--primary); }
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.admin-tab-badge {
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}
.admin-tab-panel { }
.admin-tab-refresh {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-tab-refresh:hover { background: var(--bg-light); }

.admin-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
  font-size: 0.95rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.admin-user-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.auc-info { flex: 1; min-width: 180px; }
.auc-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-dark);
  margin-bottom: 2px;
}
.auc-email {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 6px;
}
.auc-note {
  font-size: 0.83rem;
  color: var(--text-medium);
  font-style: italic;
  margin-bottom: 4px;
}
.auc-date {
  font-size: 0.78rem;
  color: var(--text-light);
}
.auc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.auc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.auc-resident-select,
.auc-role-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.83rem;
  background: var(--bg-input);
  color: var(--text-dark);
  cursor: pointer;
}

/* Badge chips */
.auc-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.auc-role-family  { background: #dbeafe; color: #1e40af; }
.auc-role-staff   { background: #d1fae5; color: #065f46; }
.auc-role-admin   { background: #ede9fe; color: #5b21b6; }
.auc-status-active    { background: #d1fae5; color: #065f46; }
.auc-status-pending   { background: #fef3c7; color: #92400e; }
.auc-status-suspended { background: #fee2e2; color: #991b1b; }
.auc-linked { background: #e0f2fe; color: #0369a1; }

/* ── Change Password Modal ── */
.sidebar-change-pw {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.6;
  padding: 4px;
  border-radius: 6px;
  transition: opacity 0.15s, background 0.15s;
  margin-right: 2px;
}
.sidebar-change-pw:hover { opacity: 1; background: rgba(255,255,255,0.12); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-card {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-dark);
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  border-radius: 4px;
}
.modal-close:hover { background: var(--bg-muted); color: var(--text-dark); }
.modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-footer {
  padding: 16px 24px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}
.form-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ── Resident Connections Panel ── */
.res-card { flex-wrap: wrap; }
.res-card-expanded { border-color: var(--primary); }
.res-connections-panel {
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.res-conn-empty {
  color: var(--text-light);
  font-size: 0.88rem;
  padding: 8px 0;
}
.res-connection-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-muted);
  border-radius: 8px;
}
.res-conn-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.res-conn-info { flex: 1; min-width: 0; }
.res-conn-name { font-weight: 600; font-size: 0.9rem; color: var(--text-dark); }
.res-conn-email { font-size: 0.8rem; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-conn-badges { display: flex; gap: 4px; flex-shrink: 0; flex-wrap: wrap; }

/* ── Community Sidebar Label ── */
.sidebar-community-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.75);
  font-weight: 500;
}
.scl-icon { font-size: 0.9rem; }
.scl-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Community Cards ── */
.community-card .comm-contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}
.comm-contact {
  font-size: 0.82rem;
  color: var(--text-light);
}
.auc-badge.auc-community {
  background: #f0fdf4;
  color: #166534;
}

/* ── Form Row (two columns) ── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ── Family Resident Label (sidebar) ── */
.family-resident-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
}
.frl-name { color: #fff; font-size: 0.85rem; font-weight: 600; }
.frl-room { color: rgba(255,255,255,0.55); font-size: 0.75rem; }
.frl-community { color: rgba(255,255,255,0.45); font-size: 0.72rem; font-style: italic; }
.frl-invite-btn {
  margin-top: 8px;
  width: 100%;
  padding: 7px 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: rgba(255,255,255,0.85);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background .15s, border-color .15s;
  font-family: inherit;
}
.frl-invite-btn:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.35);
  color: #fff;
}

/* ── User Card Connection Rows */
.auc-connection-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--text-medium);
  margin-top: 3px;
}
.auc-conn-icon { font-size: 0.85rem; }
.auc-conn-label { font-weight: 600; color: var(--text-light); }
.auc-conn-value { color: var(--text-dark); }

/* ── Dashboard Top Row (50/50 layout) */
.dashboard-top-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .dashboard-top-row { grid-template-columns: 1fr; }
}

/* ── Prospect Profile & Membership Card */
.prospect-profile-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  height: 100%;
  box-sizing: border-box;
}
.pp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.pp-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pp-icon { font-size: 1.8rem; line-height: 1; }
.pp-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0 0 2px;
}
.pp-subtitle {
  font-size: 0.8rem;
  color: var(--text-light);
  margin: 0;
}
.pp-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.pp-progress-bar { flex: 1; }
.pp-progress-label {
  font-size: 0.78rem;
  color: var(--text-light);
  white-space: nowrap;
}
.pp-readiness-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.82rem;
  margin-bottom: 16px;
}
.pp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.pp-col { display: flex; flex-direction: column; gap: 8px; }
.pp-col-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  margin-bottom: 2px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.pp-insight-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.pp-insight-icon { font-size: 0.9rem; margin-top: 1px; flex-shrink: 0; }
.pp-insight-label {
  font-size: 0.72rem;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 1px;
}
.pp-insight-value {
  font-size: 0.82rem;
  color: var(--text-dark);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pp-empty {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-light);
}
.pp-empty-icon { font-size: 2.2rem; margin-bottom: 10px; }
.pp-empty-text {
  font-size: 0.875rem;
  color: var(--text-medium);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
}
@media (max-width: 640px) {
  .pp-grid { grid-template-columns: 1fr; }
  .prospect-profile-card { padding: 16px; }
}

/* ── Connections Panel Card */
.connections-panel-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cp-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cp-icon { font-size: 1.5rem; }
.cp-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0;
}
.cp-member-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
  border: 1.5px solid;
}
.cp-member-badge--active {
  background: #f0fdf4;
  border-color: #86efac;
  color: #16a34a;
}
.cp-member-badge--inactive {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #94a3b8;
}
.cp-invite-block {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.cp-invite-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}
.cp-invite-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.cp-invite-input {
  flex: 1;
  font-size: 0.75rem;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--text-medium);
  min-width: 0;
  cursor: text;
}
.cp-invite-hint {
  font-size: 0.73rem;
  color: var(--text-light);
  margin-top: 6px;
  line-height: 1.4;
}
.cp-connections { flex: 1; }
.cp-section-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cp-conn-count {
  background: var(--primary-light, #e0e7ff);
  color: var(--primary-dark, #3730a3);
  font-size: 0.7rem;
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 700;
}
.cp-conn-list { display: flex; flex-direction: column; gap: 10px; }
.conn-empty {
  font-size: 0.83rem;
  color: var(--text-light);
  font-style: italic;
  padding: 8px 0;
}
.conn-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.conn-row:last-child { border-bottom: none; }
.conn-avatar {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.conn-info { flex: 1; min-width: 0; }
.conn-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.conn-rel {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 1px;
}
.conn-avatar--rp {
  background: #2563eb;
  box-shadow: 0 0 0 2px #bfdbfe;
}
.conn-rp-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  padding: 1px 7px;
  border-radius: 10px;
}
.conn-you-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #86efac;
  padding: 1px 7px;
  border-radius: 10px;
}
.cp-rp-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.8rem;
  color: #1e40af;
  line-height: 1.5;
}

/* ── Connection Viewer */
.connection-viewer {
  margin-bottom: 0;
}
.cv-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.cv-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.cv-icon { font-size: 1.3rem; margin-top: 2px; }
.cv-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 2px;
}
.cv-subtitle { font-size: 0.78rem; color: var(--text-light); }
.cv-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  background: #fff;
  color: var(--text-dark);
  min-width: 220px;
  cursor: pointer;
}
.cv-body { border-top: 1px solid var(--border); padding-top: 16px; }
.cv-person-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 10px;
}
.cv-avatar {
  width: 44px; height: 44px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.cv-person-name { font-size: 0.95rem; font-weight: 700; color: var(--text-dark); }
.cv-person-rel  { font-size: 0.78rem; color: var(--primary); font-weight: 600; margin-top: 1px; }
.cv-person-meta { font-size: 0.73rem; color: var(--text-light); margin-top: 2px; }
.cv-empty { font-size: 0.85rem; color: var(--text-light); font-style: italic; padding: 8px 0; }
.cv-section { margin-bottom: 20px; }
.cv-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}
.cv-section-pct {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-light);
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 10px;
}
.cv-section-pct.cv-done { background: #dcfce7; color: #16a34a; }
.cv-page { margin-bottom: 14px; padding-left: 8px; }
.cv-page-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.cv-page-icon { font-size: 0.95rem; flex-shrink: 0; }
.cv-page-title { font-size: 0.85rem; font-weight: 700; color: var(--text-dark); flex: 1; min-width: 0; }
.cv-page-bar-wrap {
  width: 80px;
  height: 5px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}
.cv-page-bar-fill { height: 100%; background: var(--primary); border-radius: 3px; }
.cv-page-pct { font-size: 0.72rem; color: var(--text-light); font-weight: 600; flex-shrink: 0; width: 28px; text-align: right; }
.cv-fields { display: flex; flex-direction: column; gap: 5px; padding-left: 24px; }
.cv-field-row {
  display: flex;
  gap: 8px;
  font-size: 0.8rem;
  line-height: 1.5;
  flex-wrap: wrap;
}
.cv-field-label {
  color: var(--text-light);
  font-weight: 600;
  min-width: 150px;
  flex-shrink: 0;
}
.cv-field-value { color: var(--text-dark); }

/* ── Contributor Notice Banner */
.contributor-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 0.875rem;
  color: #1e40af;
  line-height: 1.5;
}
.contributor-notice span:first-child { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* ── Contributions Panel (What Others Shared) */
.contrib-panel { margin-top: 16px; }
.contrib-panel-list { padding-top: 8px; }
.contrib-panel-entry {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.contrib-panel-entry:last-child { border-bottom: none; padding-bottom: 0; }
.contrib-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.contrib-panel-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-dark);
}
.contrib-panel-fields { display: flex; flex-direction: column; gap: 6px; padding-left: 54px; }
.contrib-panel-field {
  display: flex;
  gap: 8px;
  font-size: 0.82rem;
  line-height: 1.5;
}
.contrib-field-label {
  color: var(--text-light);
  font-weight: 600;
  min-width: 160px;
  flex-shrink: 0;
}
.contrib-field-value { color: var(--text-dark); }

/* ── Viewing As Banner (RP/staff viewing a connection's answers) */
.viewing-as-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  background: linear-gradient(90deg, #e8f4fd 0%, #f0f8ff 100%);
  border: 1.5px solid #7ec8f5;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 0.875rem;
  color: #0d5c8a;
  line-height: 1.4;
}
.viewing-as-banner strong { font-weight: 700; color: #0a4a70; }
.viewing-as-banner button {
  flex-shrink: 0;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.viewing-as-banner button:hover { background: #1558b0; }

/* ── Read-only form card (viewing a connection's answers) */
.form-read-only {
  position: relative;
}
.form-read-only::before {
  content: '🔒 Read-only — these are ' attr(data-viewer) ''s answers';
  display: none; /* toggled via JS if needed */
}
.form-read-only input:disabled,
.form-read-only textarea:disabled,
.form-read-only select:disabled {
  background: #f5f7fa;
  color: #444;
  cursor: not-allowed;
  border-color: #dde3eb;
  opacity: 1; /* override browser dimming */
}
.form-read-only .radio-option,
.form-read-only .checkbox-option {
  pointer-events: none;
  cursor: default;
}
.form-read-only .radio-option.selected,
.form-read-only .checkbox-option.selected {
  opacity: 1;
}
.form-read-only .radio-option:not(.selected),
.form-read-only .checkbox-option:not(.selected) {
  opacity: 0.5;
}

/* ── Sidebar Connection Viewer Dropdown */
.sidebar-conn-viewer {
  padding: 8px 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.1);
}
.scv-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 5px;
}
.scv-select {
  background: rgba(255,255,255,0.18) !important;
  border-color: rgba(255,255,255,0.25) !important;
}
.scv-select:focus {
  background: rgba(255,255,255,0.28) !important;
}

/* ══════════════════════════════════════════════════════
   CRM — PROSPECT PIPELINE
   ══════════════════════════════════════════════════════ */

/* ── Page Layout */
.crm-page { max-width: 100%; }

.crm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.crm-title { font-size: 1.5rem; font-weight: 700; color: var(--text-dark); margin: 0 0 4px; }
.crm-subtitle { color: var(--text-light); font-size: 0.88rem; margin: 0; }

.crm-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.crm-search {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  width: 220px;
  background: #fff;
}
.crm-view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.crm-view-toggle button {
  padding: 7px 14px;
  font-size: 0.82rem;
  background: #fff;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.crm-view-toggle button.active {
  background: var(--primary);
  color: #fff;
}

/* ── Stats Bar */
.crm-stats-bar {
  display: flex;
  gap: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  margin-bottom: 24px;
  overflow: hidden;
}
.crm-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 10px;
  border-right: 1px solid var(--border);
}
.crm-stat:last-child { border-right: none; }
.crm-stat-val { font-size: 1.5rem; font-weight: 700; color: var(--text-dark); line-height: 1; }
.crm-stat-label { font-size: 0.72rem; color: var(--text-light); margin-top: 4px; text-align: center; }

/* ── Pipeline Board */
.crm-pipeline {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 16px;
  align-items: flex-start;
}
.crm-column {
  flex: 0 0 260px;
  background: #f8f9fa;
  border-radius: 12px;
  overflow: hidden;
  min-height: 200px;
}
.crm-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  background: #fff;
}
.crm-column-title { font-weight: 700; font-size: 0.88rem; color: var(--text-dark); }
.crm-column-count {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}
.crm-column-cards { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.crm-empty-col { text-align: center; color: var(--text-light); font-size: 0.82rem; padding: 24px 8px; }

/* ── Prospect Card */
.crm-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
}
.crm-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.1); transform: translateY(-1px); }
.crm-card-name { font-weight: 700; font-size: 0.92rem; color: var(--text-dark); margin-bottom: 3px; }
.crm-card-age { font-weight: 400; color: var(--text-light); }
.crm-card-care { font-size: 0.78rem; color: var(--text-light); margin-bottom: 6px; }
.crm-card-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.crm-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
}
.crm-badge--source { background: #f3f4f6; color: #374151; }
.crm-card-contact { font-size: 0.78rem; color: var(--text-light); margin-bottom: 6px; }
.crm-card-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px; }
.crm-card-days { font-size: 0.72rem; color: #9ca3af; }
.crm-card-followup { font-size: 0.72rem; color: #6b7280; }
.crm-overdue { color: #ef4444 !important; font-weight: 600; }

/* ── Status Pill (list view) */
.crm-status-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

/* ── List View — two-column card layout ── */
.crm-empty { text-align: center; color: var(--text-light); padding: 48px; font-size: 0.9rem; }

.crm-list-split {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  height: calc(100vh - 260px);
  min-height: 500px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

/* ── Left cards column ── */
.crm-list-cards {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: #f8f9fc;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.crm-list-cards::-webkit-scrollbar { width: 4px; }
.crm-list-cards::-webkit-scrollbar-track { background: transparent; }
.crm-list-cards::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* ── Individual prospect card ── */
.crm-prospect-card {
  display: flex;
  align-items: stretch;
  background: #fff;
  border-radius: 12px;
  border: 1.5px solid transparent;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  will-change: transform;
}
.crm-prospect-card:hover {
  transform: translateX(3px) scale(1.015);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  border-color: var(--stage-color, #6366f1);
}
.crm-prospect-card.selected {
  border-color: var(--stage-color, #6366f1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--stage-color, #6366f1) 20%, transparent),
              0 4px 16px rgba(0,0,0,0.10);
  background: var(--stage-bg, #f0f0ff);
}

/* Left accent bar */
.crm-pc-bar {
  width: 5px;
  flex-shrink: 0;
  background: var(--stage-color, #6366f1);
  border-radius: 0;
}

.crm-pc-body {
  flex: 1;
  padding: 11px 13px 10px;
  min-width: 0;
}
.crm-pc-top {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
}
.crm-pc-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.crm-pc-age {
  font-size: 0.75rem;
  color: var(--text-light);
  flex-shrink: 0;
}
.crm-pc-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.crm-pc-stage-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--stage-color, #6366f1) 14%, transparent);
  color: var(--stage-color, #6366f1);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.crm-pc-urgency {
  font-size: 0.7rem;
  color: var(--text-light);
  white-space: nowrap;
}
.crm-pc-days {
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: auto;
}

/* ── Right detail column ── */
.crm-list-detail {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

/* Empty state (no card selected) */
.crm-list-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 10px;
  color: var(--text-light);
}
.crm-list-empty-icon { font-size: 3rem; opacity: 0.35; }
.crm-list-empty-title { font-size: 1.05rem; font-weight: 600; color: var(--text-dark); }
.crm-list-empty-sub  { font-size: 0.85rem; }

/* ── Inline detail panel ── */
.crm-ld-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.crm-ld-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: linear-gradient(135deg, #fafafa 0%, color-mix(in srgb, var(--stage-color,#6366f1) 5%, #fff) 100%);
}
.crm-ld-name-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.crm-ld-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0 0 6px;
  line-height: 1.2;
}
.crm-ld-age {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-light);
}
.crm-ld-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.crm-ld-stage-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}
.crm-ld-tag {
  font-size: 0.75rem;
  color: var(--text-light);
  background: #f1f3f5;
  padding: 3px 9px;
  border-radius: 20px;
}
.crm-ld-header-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Scrollable body */
.crm-ld-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 40px;
}
.crm-ld-body::-webkit-scrollbar { width: 5px; }
.crm-ld-body::-webkit-scrollbar-track { background: transparent; }
.crm-ld-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* Key details grid */
.crm-ld-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: #f8f9fc;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.crm-ld-kv { display: flex; flex-direction: column; gap: 2px; }
.crm-ld-k  { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-light); }
.crm-ld-v  { font-size: 0.85rem; color: var(--text-dark); font-weight: 500; }

.crm-ld-section-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 10px;
}

/* ── Activity Timeline ── */
.crm-timeline {
  display: flex;
  flex-direction: column;
}
.crm-tl-empty {
  font-size: 0.85rem;
  color: var(--text-light);
  padding: 16px 0;
}
.crm-timeline-item {
  display: flex;
  gap: 12px;
  position: relative;
}
.crm-tl-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 18px;
}
.crm-tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.12);
  flex-shrink: 0;
  margin-top: 3px;
  position: relative;
  z-index: 1;
}
.crm-tl-line {
  width: 2px;
  flex: 1;
  background: linear-gradient(to bottom, #e2e8f0 0%, #e2e8f0 100%);
  min-height: 16px;
  margin: 2px 0;
}
.crm-tl-content {
  flex: 1;
  padding-bottom: 18px;
  min-width: 0;
}
.crm-tl-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.crm-tl-icon { font-size: 0.85rem; flex-shrink: 0; }
.crm-tl-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  flex: 1;
  min-width: 0;
}
.crm-tl-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: #d1d5db;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
  border-radius: 4px;
  transition: color 0.15s;
  flex-shrink: 0;
}
.crm-tl-delete:hover { color: #ef4444; }
.crm-tl-note {
  font-size: 0.82rem;
  color: var(--text-dark);
  line-height: 1.45;
  margin-bottom: 3px;
  opacity: 0.85;
  word-break: break-word;
}
.crm-tl-meta {
  font-size: 0.72rem;
  color: var(--text-light);
}

/* ── Detail Panel (slide-in overlay) */
.crm-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
}
.crm-detail-panel {
  width: min(680px, 100vw);
  height: 100%;
  background: #fff;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 32px rgba(0,0,0,0.18);
  animation: slideInRight 0.22s ease;
}
@keyframes slideInRight {
  from { transform: translateX(60px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.crm-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border);
  background: #f8f9fa;
  position: sticky;
  top: 0;
  z-index: 10;
}
.crm-detail-name { font-size: 1.2rem; font-weight: 700; color: var(--text-dark); margin: 0 0 4px; }
.crm-detail-age { font-size: 0.9rem; font-weight: 400; color: var(--text-light); }
.crm-detail-meta { font-size: 0.82rem; color: var(--text-light); display: flex; flex-wrap: wrap; gap: 4px; }
.crm-detail-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  line-height: 1;
  padding: 0;
  margin-left: 12px;
  flex-shrink: 0;
}
.crm-detail-close:hover { color: var(--text-dark); }

/* ── Stage Selector */
.crm-detail-stages {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.crm-detail-stages-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-light); margin-bottom: 8px; }
.crm-stage-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.crm-stage-pills--archive { border-top: 1px dashed var(--border); padding-top: 8px; margin-top: 2px; }
.crm-stage-pill {
  padding: 5px 14px;
  border-radius: 20px;
  border: 2px solid var(--sc, #d1d5db);
  background: transparent;
  color: var(--sc, #374151);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.crm-stage-pill.active, .crm-stage-pill:hover {
  background: var(--sc, #374151);
  color: #fff;
}
.crm-stage-pill--decline { --sc: #ef4444; }
.crm-stage-pill--lost    { --sc: #6b7280; }
.crm-stage-pill--movedin { --sc: #059669; }

/* ── Detail Body */
.crm-detail-body { padding: 20px 24px; flex: 1; }
.crm-detail-section { margin-bottom: 24px; }
.crm-detail-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.crm-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.crm-detail-field { display: flex; flex-direction: column; gap: 4px; }
.crm-detail-field--full { grid-column: 1 / -1; }
.crm-detail-label { font-size: 0.75rem; font-weight: 600; color: var(--text-light); }
.crm-detail-input {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.875rem;
  background: #fff;
  transition: border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
}
.crm-detail-input:focus { outline: none; border-color: var(--primary); }
.crm-detail-textarea { resize: vertical; min-height: 72px; }

/* ── Activity Log */
.crm-log-compose {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

/* ── Activity type pill-button row ── */
.crm-act-compose-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.crm-act-type-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.crm-act-type-btn {
  padding: 5px 13px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.crm-act-type-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.crm-act-type-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.crm-act-textarea {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  resize: vertical;
  font-family: inherit;
}
.crm-activity-log { display: flex; flex-direction: column; gap: 0; }
.crm-activity-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.crm-activity-item:last-child { border-bottom: none; }
.crm-act-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.crm-act-body { flex: 1; min-width: 0; }
.crm-act-note { font-size: 0.875rem; color: var(--text-dark); line-height: 1.4; margin-bottom: 2px; }
.crm-act-meta { font-size: 0.75rem; color: var(--text-light); }
.crm-act-del {
  background: none;
  border: none;
  color: #d1d5db;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}
.crm-act-del:hover { color: #ef4444; }
.crm-act-empty { font-size: 0.875rem; color: var(--text-light); padding: 12px 0; }

/* ── Responsive */
@media (max-width: 700px) {
  .crm-pipeline { flex-direction: column; }
  .crm-column   { flex: none; width: 100%; }
  .crm-detail-grid { grid-template-columns: 1fr; }
  .crm-detail-panel { width: 100vw; }
  .crm-stats-bar { flex-wrap: wrap; }
  .crm-stat { flex: 0 0 33%; border-right: none; border-bottom: 1px solid var(--border); }
  .crm-header-actions { width: 100%; }
  .crm-search { width: 100%; }
}

/* ── In-nav resident picker (Resident Profiles section) */
.nav-resident-picker {
  padding: 6px 10px 10px;
  margin-bottom: 2px;
}
.nrp-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.6);
  margin-bottom: 5px;
}
.nrp-select {
  width: 100%;
}

/* ── Card age indicator bar */
.crm-card-age-bar {
  height: 3px;
  border-radius: 3px 3px 0 0;
  margin: -12px -12px 10px;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.crm-card:hover .crm-card-age-bar { opacity: 1; }

/* ── Card created date */
.crm-card-created {
  font-size: 0.7rem;
  color: #9ca3af;
  margin-top: 6px;
  border-top: 1px solid #f3f4f6;
  padding-top: 6px;
}

/* ── Not Interested quick action */
.crm-card-not-interested {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 4px 0;
  background: none;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  color: #ef4444;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: center;
}
.crm-card-not-interested:hover {
  background: #fef2f2;
}

/* ── Collapsible top-level nav sections */
.nav-section-collapsible {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-section-collapsible:hover { opacity: 0.85; }
.nav-collapse-arrow { font-size: 0.65rem; opacity: 0.7; }
.nav-section-label--top { margin-top: 0; }

.nav-collapsible-body {
  display: none;
  overflow: hidden;
}
.nav-collapsible-body.open { display: block; }

/* ── Drag and drop */
.crm-card--dragging {
  opacity: 0.45;
  transform: scale(0.97) rotate(1deg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  cursor: grabbing;
}
.crm-card[draggable="true"] { cursor: grab; }
.crm-column--over {
  background: #eff6ff;
  outline: 2px dashed #3b82f6;
  outline-offset: -4px;
}
.crm-column--over .crm-empty-col { color: #3b82f6; }

/* ── Delete button in detail panel header */
.crm-detail-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.crm-detail-delete {
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #fef2f2;
  color: #ef4444;
  border: 1px solid #fca5a5;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s;
}
.crm-detail-delete:hover { background: #fee2e2; }

/* ── Referral Network page */
.rn-grid { display: flex; flex-direction: column; gap: 24px; }
.rn-group { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.rn-group-title {
  padding: 12px 18px;
  background: #f8f9fa;
  font-weight: 700;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dark);
}
.rn-group-count {
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  padding: 1px 8px;
  border-radius: 20px;
}
.rn-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.rn-card:last-child { border-bottom: none; }
.rn-card-main { flex: 1; min-width: 0; }
.rn-card-name { font-weight: 700; font-size: 0.92rem; color: var(--text-dark); }
.rn-card-title { font-size: 0.8rem; color: var(--text-light); }
.rn-card-org { font-size: 0.82rem; color: #374151; margin-top: 2px; }
.rn-card-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-light);
}
.rn-card-notes { margin-top: 6px; font-size: 0.8rem; color: var(--text-light); font-style: italic; }
.rn-card-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.rn-delete-btn { color: #ef4444; background: #fef2f2; border: 1px solid #fca5a5; }
.rn-delete-btn:hover { background: #fee2e2; }
.rn-empty { text-align: center; color: var(--text-light); padding: 48px; font-size: 0.9rem; }

/* ── Referral Network: referred prospects */
.rn-referrals {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.rn-referrals-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  display: block;
  margin-bottom: 6px;
}
.rn-referrals--none .rn-referrals-label { display: none; }
.rn-referrals--none {
  font-size: 0.78rem;
  color: #d1d5db;
  font-style: italic;
}
.rn-referral-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #0369a1;
  cursor: pointer;
  margin: 0 4px 4px 0;
  transition: background 0.15s;
}
.rn-referral-pill:hover { background: #e0f2fe; }
.rn-referral-stage {
  font-size: 0.7rem;
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════════════════
   MEMBERHUB
   ══════════════════════════════════════════════════════════════════ */

/* Page layout */
.mh-page { max-width: 1200px; padding: 24px; margin: 0 auto; }
.mh-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.mh-title { font-size: 1.6rem; font-weight: 800; color: var(--text-dark); margin: 0 0 4px; }
.mh-subtitle { font-size: 0.9rem; color: var(--text-light); margin: 0; }

/* Tabs */
.mh-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.mh-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.mh-tab:hover { color: var(--primary); }
.mh-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.mh-tab-count {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 1px 8px;
}

/* Package grid */
.mh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.mh-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
  font-size: 1rem;
}

/* Package cards */
.mh-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.18s, transform 0.18s;
  position: relative;
}
.mh-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.mh-card-accent {
  height: 5px;
  background: var(--pkg-color, var(--primary));
}
.mh-card-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.mh-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}
.mh-card-icon { font-size: 2rem; line-height: 1; }
.mh-card-badges { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.mh-badge-default {
  font-size: 0.68rem;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  border-radius: 20px;
  padding: 2px 8px;
  border: 1px solid #fde68a;
}
.mh-badge-tier {
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 20px;
  padding: 2px 8px;
}
.mh-badge-basic    { background: #f1f5f9; color: #475569; }
.mh-badge-standard { background: var(--primary-light); color: var(--primary-dark); }
.mh-badge-premium  { background: #ede9fe; color: #5b21b6; }
.mh-badge-signature { background: #fef3c7; color: #92400e; }

.mh-card-name { font-size: 1.05rem; font-weight: 800; color: var(--text-dark); margin: 0 0 2px; }
.mh-card-subtitle { font-size: 0.8rem; color: var(--text-light); margin: 0 0 10px; }
.mh-card-price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--pkg-color, var(--primary));
  margin-bottom: 12px;
}
.mh-card-highlights {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  flex: 1;
}
.mh-card-highlight {
  font-size: 0.8rem;
  color: var(--text-medium);
  padding: 3px 0;
  display: flex;
  gap: 6px;
}
.mh-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}
.mh-btn-edit, .mh-btn-email, .mh-btn-clone, .mh-btn-delete {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s;
}
.mh-btn-edit   { background: var(--primary-light); color: var(--primary-dark); border-color: var(--primary-border); }
.mh-btn-email  { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }
.mh-btn-clone  { background: #f3f4f6; color: #374151; border-color: #d1d5db; }
.mh-btn-delete { background: var(--error-bg); color: var(--error); border-color: #f3c0b8; margin-left: auto; }
.mh-btn-edit:hover   { background: var(--primary-border); }
.mh-btn-email:hover  { background: #c8e6c9; }
.mh-btn-clone:hover  { background: #e5e7eb; }
.mh-btn-delete:hover { background: #fbd6d2; }

/* Editor panel (reuses crm-detail-overlay/panel) */
.mh-editor-panel { max-width: 680px; }
.mh-email-textarea { font-family: 'Courier New', monospace; font-size: 0.8rem; resize: vertical; }

/* ── EMAIL BUILDER OVERLAY ── */
.mh-email-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 40, 0.6);
  display: flex;
  align-items: stretch;
  justify-content: center;
  z-index: 2100;
  padding: 12px;
}

/* Main composer window */
.mh-builder {
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(10,20,40,0.3);
  width: 100%;
  max-width: 1280px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Top bar */
.mh-builder-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--primary-deeper) 0%, #1a5faa 100%);
  color: #fff;
  flex-shrink: 0;
}
.mh-builder-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.mh-builder-title-icon { font-size: 1.5rem; }
.mh-builder-title-main { font-size: 1rem; font-weight: 800; color: #fff; }
.mh-builder-title-sub  { font-size: 0.78rem; opacity: 0.8; color: #fff; }
.mh-builder-meta {
  display: flex;
  gap: 8px;
  flex: 1;
  overflow: hidden;
}
.mh-meta-pill {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.mh-meta-pill label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.65);
}
.mh-meta-pill input {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: #fff;
  font-size: 0.82rem;
  padding: 4px 8px;
  outline: none;
  width: 100%;
}
.mh-meta-pill input::placeholder { color: rgba(255,255,255,0.45); }
.mh-meta-pill input:focus { background: rgba(255,255,255,0.22); border-color: rgba(255,255,255,0.45); }
.mh-meta-subject { flex: 2; }
.mh-builder-close {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mh-builder-close:hover { background: rgba(255,255,255,0.28); }

/* 3-column workspace */
.mh-builder-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* LEFT: block palette */
.mh-palette {
  width: 175px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mh-palette-heading {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dark);
  padding: 0 4px 2px;
}
.mh-palette-subheading {
  font-size: 0.7rem;
  color: var(--text-light);
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 4px;
}
.mh-palette-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg);
  cursor: grab;
  transition: all 0.13s;
  user-select: none;
}
.mh-palette-chip:hover { background: var(--primary-lighter); border-color: var(--primary-border); transform: translateX(2px); }
.mh-palette-chip:active { cursor: grabbing; }
.mh-chip--dragging { opacity: 0.5; }
.mh-chip-icon  { font-size: 1rem; line-height: 1; flex-shrink: 0; }
.mh-chip-label { font-size: 0.78rem; font-weight: 600; color: var(--text-medium); flex: 1; }
.mh-chip-drag  { font-size: 0.9rem; color: var(--text-xlight); cursor: grab; }
.mh-palette-tip {
  font-size: 0.68rem;
  color: var(--text-xlight);
  text-align: center;
  padding: 8px 4px 0;
  margin-top: auto;
}

/* CENTER: canvas */
.mh-canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #eef3f8;
}
.mh-canvas-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mh-canvas-count { font-size: 0.78rem; font-weight: 700; color: var(--text-medium); }
.mh-canvas-hint  { font-size: 0.72rem; color: var(--text-light); }
.mh-canvas {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 40px;
  /* display: block so blocks take their natural content height
     and the canvas scrolls — never flex-squishes blocks */
}
.mh-canvas-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
  min-height: 300px;
}

/* Canvas blocks */
.mh-canvas-block {
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.13s, box-shadow 0.13s;
  overflow: hidden;   /* clips to border-radius; block grows freely to content height */
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  /* Ensure block always sizes to its content (never squished by a flex parent) */
  flex-shrink: 0;
  min-height: 0;
}
.mh-canvas-block:hover { border-color: var(--primary-border); box-shadow: var(--shadow-sm); }
.mh-canvas-block--selected { border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(26,115,200,0.13); }
.mh-canvas-block--over { border-color: var(--primary) !important; border-style: dashed !important; }
.mh-canvas-block--dragging { opacity: 0.4; }

.mh-block-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
}
.mh-block-drag  { font-size: 1rem; color: var(--text-xlight); cursor: grab; line-height: 1; }
.mh-block-label { font-size: 0.72rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; flex: 1; }
.mh-block-del {
  background: none;
  border: none;
  color: var(--text-xlight);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.12s;
}
.mh-block-del:hover { color: var(--error); }

.mh-block-preview { padding: 0; }

/* Drop sentinel at end of canvas */
.mh-drop-sentinel {
  min-height: 36px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-xlight);
  margin-top: 4px;
  transition: border-color 0.13s, background 0.13s;
}
.mh-drop-sentinel:hover { border-color: var(--primary-border); background: var(--primary-lighter); }

/* RIGHT: properties panel */
.mh-props {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.mh-props-heading {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dark);
  padding: 14px 14px 6px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.mh-props-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px;
  color: var(--text-light);
  font-size: 0.82rem;
  gap: 10px;
}
.mh-props-empty-icon { font-size: 2rem; }
.mh-props-type-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-dark);
  border-bottom: 1px solid var(--border-light);
  background: var(--primary-lighter);
  flex-shrink: 0;
}
.mh-prop-fields {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.mh-prop-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-medium);
  display: block;
  margin-top: 6px;
}
.mh-prop-label:first-child { margin-top: 0; }
.mh-prop-hint {
  font-size: 0.68rem;
  color: var(--text-xlight);
  margin-top: 2px;
}
.mh-prop-hint code { background: #f1f5f9; padding: 1px 4px; border-radius: 3px; color: var(--primary-dark); }
.mh-prop-hint-inline { font-weight: 400; color: var(--text-xlight); }
.mh-prop-colors { display: flex; gap: 12px; margin-top: 4px; }
.mh-prop-colors > div { display: flex; flex-direction: column; gap: 4px; }
.mh-prop-textarea { resize: vertical; min-height: 100px; }
.mh-color-swatch {
  width: 44px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  padding: 2px;
  cursor: pointer;
}

/* Bottom footer */
.mh-builder-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Block previews in canvas (WYSIWYG) */
.mh-prev-header {
  padding: 28px 24px;
  text-align: center;
}
.mh-prev-header-icon { font-size: 1.8rem; margin-bottom: 6px; }
.mh-prev-header-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 4px; }
.mh-prev-header-sub   { font-size: 0.85rem; opacity: 0.85; }
.mh-prev-greeting {
  padding: 16px 20px 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  font-style: italic;
}
.mh-prev-text {
  padding: 10px 20px;
  font-size: 0.88rem;
  color: var(--text-medium);
  line-height: 1.65;
  white-space: pre-wrap;
}
.mh-prev-highlights {
  padding: 14px 20px;
}
.mh-prev-hl-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}
.mh-prev-hl-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.mh-prev-hl-list li {
  font-size: 0.82rem;
  color: var(--text-medium);
  padding: 4px 0;
  display: flex;
  gap: 8px;
}
.mh-prev-hl-list li::before { content: '✓'; color: #2a9d6f; font-weight: 700; flex-shrink: 0; }
.mh-prev-price {
  padding: 18px 20px;
  text-align: center;
  margin: 0;
}
.mh-prev-price-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 2px; }
.mh-prev-price-value { font-size: 1.6rem; font-weight: 800; }
.mh-prev-cta-wrap { padding: 16px 20px; text-align: center; }
.mh-prev-cta {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}
.mh-prev-divider {
  margin: 8px 20px;
  border-top: 2px solid;
}
.mh-prev-sig {
  padding: 14px 20px;
}
.mh-prev-sig-name   { font-size: 0.9rem; font-weight: 700; color: var(--text-dark); }
.mh-prev-sig-detail { font-size: 0.78rem; color: var(--text-light); margin-top: 1px; }

@media (max-width: 700px) {
  .mh-builder-meta { display: none; }
  .mh-palette { width: 120px; }
  .mh-props   { display: none; }
  .mh-grid    { grid-template-columns: 1fr; }
}

/* ── MemberHub Package Editor polish ── */
.mh-editor-panel { max-width: 640px !important; }

/* Sticky save footer */
.mh-editor-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  z-index: 10;
  flex-shrink: 0;
}

/* Appearance section */
.mh-appearance-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.mh-appearance-preview {
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s;
}
.mh-appearance-fields {
  flex: 1;
  display: flex;
  gap: 16px;
}
.mh-appearance-fields .crm-detail-field { flex: 1; }

/* Color picker */
.mh-color-pick {
  width: 44px;
  height: 36px;
  padding: 2px 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: none;
}
.mh-color-hex {
  font-size: 0.8rem;
  font-family: 'Courier New', monospace;
  color: var(--text-light);
}

/* Label hint */
.mh-label-hint {
  font-weight: 400;
  color: var(--text-xlight);
  font-size: 0.7rem;
}

/* Email builder notice */
.mh-email-builder-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--primary-lighter);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.82rem;
  color: var(--text-medium);
  line-height: 1.5;
}

/* Form error */
.mh-form-error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid #f3c0b8;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  margin: 0 0 12px;
}

/* ═══════════════════════════════════════════════════════════════
   CALENDAR
   ═══════════════════════════════════════════════════════════════ */

.cal-page { max-width: 100%; }

/* ── Header bar */
.cal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.cal-title   { font-size: 1.5rem; font-weight: 700; color: var(--text-dark); margin: 0 0 4px; }
.cal-subtitle { color: var(--text-light); font-size: 0.88rem; margin: 0; }

.cal-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Month / Day nav pill */
.cal-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 8px;
}
.cal-nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  color: var(--text-dark);
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.1s;
}
.cal-nav-btn:hover { background: #f0f2f5; }
.cal-nav-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-dark);
  min-width: 180px;
  text-align: center;
  padding: 0 4px;
}
.cal-today-btn {
  margin-left: 4px;
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-dark);
  transition: background 0.1s;
  font-family: inherit;
}
.cal-today-btn:hover { background: #f0f2f5; }

/* ── View toggle */
.cal-view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.cal-view-toggle button {
  padding: 7px 16px;
  font-size: 0.82rem;
  background: #fff;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-weight: 500;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.cal-view-toggle button.active {
  background: var(--primary);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   MONTH GRID
   ═══════════════════════════════════════════════════════════════ */
.cal-grid-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

/* Day-of-week header row */
.cal-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f8f9fc;
  border-bottom: 1px solid var(--border);
}
.cal-dow {
  padding: 11px 0;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-light);
}

/* Date grid */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cal-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px 7px 6px;
  min-height: 110px;
  cursor: pointer;
  transition: background 0.12s;
  overflow: hidden;
  position: relative;
}
.cal-cell:nth-child(7n)    { border-right: none; }
.cal-cell:hover            { background: #f8f9fc; }
.cal-cell--other           { cursor: default; }
.cal-cell--other:hover     { background: transparent; }

/* "Today" highlight — circle on day number */
.cal-cell-day {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dark);
  width: 27px;
  height: 27px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 4px;
}
.cal-cell--other .cal-cell-day  { color: #c5cad3; font-weight: 400; }
.cal-cell--today .cal-cell-day  {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

/* Event chips inside each cell */
.cal-cell-events { display: flex; flex-direction: column; gap: 3px; }
.cal-event-chip {
  font-size: 0.67rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
  cursor: pointer;
}
.cal-cell-more {
  font-size: 0.65rem;
  color: var(--text-light);
  padding: 1px 4px;
}

/* ═══════════════════════════════════════════════════════════════
   DAY VIEW
   ═══════════════════════════════════════════════════════════════ */
.cal-day-view {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.cal-day-events {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Individual event card */
.cal-day-event {
  border-radius: 12px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  transition: box-shadow 0.15s;
}
.cal-day-event:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.cal-day-event-type {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
}
.cal-day-event-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 5px;
}
.cal-day-event-notes {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 10px;
  line-height: 1.45;
}
.cal-day-event-link {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.cal-day-event-link:hover { text-decoration: underline; }

/* Empty day state */
.cal-day-empty {
  text-align: center;
  padding: 64px 40px;
  color: var(--text-light);
  font-size: 0.9rem;
}
.cal-day-empty-icon { font-size: 2.8rem; margin-bottom: 14px; }

/* ── Upcoming sidebar */
.cal-upcoming-section {
  width: 290px;
  flex-shrink: 0;
}
.cal-section-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 10px;
}
.cal-upcoming-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 6px;
  transition: box-shadow 0.12s;
}
.cal-upcoming-row:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.07); }
.cal-upcoming-date {
  font-size: 0.72rem;
  color: var(--text-light);
  min-width: 68px;
}
.cal-upcoming-ev   { font-size: 1rem; flex-shrink: 0; }
.cal-upcoming-info { flex: 1; min-width: 0; }
.cal-upcoming-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-upcoming-type { font-size: 0.7rem; }

/* ═══════════════════════════════════════════════════════════════
   ADD EVENT MODAL — type toggle
   ═══════════════════════════════════════════════════════════════ */
.cal-type-toggle {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.cal-type-btn {
  flex: 1;
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-light);
  font-family: inherit;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.cal-type-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.cal-type-btn:not(.active):hover {
  border-color: var(--primary);
  color: var(--primary);
}
