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

:root {
  /* ── Warm Ambient Intelligence palette ───────────────────────────────────── */
  /* Background & surfaces */
  --bg: #faf8f5;           /* warm off-white / cream */
  --surface: #ffffff;
  --surface-warm: #fdf9f4; /* slightly warmer surface for cards */
  --border: #e8e0d5;       /* warm gray-beige border */

  /* Primary — deep warm amber-brown, replaces LinkedIn blue */
  --primary: #b5651d;           /* warm sienna / burnt amber */
  --primary-hover: #944d14;
  --primary-light: #f5ede3;     /* tinted hover backgrounds */

  /* Accent colors */
  --accent-sage: #7a9e7e;       /* muted sage green — for "on track" */
  --accent-terracotta: #c0705a; /* terracotta — for warmth */
  --accent-amber: #c4862a;      /* amber — gentle urgency */
  --accent-plum: #6b4f7a;       /* deep plum — for special moments */

  /* Status — warmer versions of alert colors */
  --danger: #c0392b;            /* kept similar, readable */
  --danger-hover: #a93226;
  --warning: #c4862a;           /* amber instead of red for "overdue" */
  --success: #5a8a5e;           /* sage green success */

  /* Typography */
  --text: #2c1f14;             /* warm dark brown, not cold navy */
  --text-muted: #7a6a58;       /* warm taupe muted text */

  /* Layout */
  --radius: 12px;              /* slightly more rounded = warmer */
  --shadow: 0 2px 10px rgba(90,50,20,0.07);
  --shadow-lg: 0 8px 32px rgba(90,50,20,0.14);
}

body {
  /* Georgia for names (warmth), system sans for UI — subtle humanist mix */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55; /* more generous than default */
}

/* Header — warm gradient replaces flat corporate blue */
header {
  /* Warm gradient: deep amber-brown to slightly lighter — morning light feel */
  background: linear-gradient(135deg, #3d2010 0%, #6b3a1f 60%, #8b4f25 100%);
  color: white;
  padding: 0 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(61,32,16,0.35);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.3px; margin-right: 8px; white-space: nowrap; }

/* Buttons — warm palette */
.btn-primary {
  /* In header context: white text on warm surface */
  background: rgba(255,255,255,0.92);
  color: var(--primary);
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.btn-primary:hover { background: rgba(255,255,255,1); box-shadow: 0 2px 8px rgba(90,50,20,0.18); }
.btn-primary[type="submit"] {
  background: var(--primary);
  color: white;
}
.btn-primary[type="submit"]:hover { background: var(--primary-hover); }
.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-secondary:hover { background: var(--primary-light); border-color: var(--accent-amber); color: var(--text); }
.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-danger:hover { background: var(--danger-hover); }
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: background 0.12s;
}
.btn-icon:hover { background: var(--primary-light); color: var(--text); }
.btn-icon.danger:hover { color: var(--danger); background: #fde8e8; }

/* Main */
main { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }

.search-bar {
  margin-bottom: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.search-bar input {
  width: 100%;
  max-width: 340px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s;
}
.search-bar input:focus { border-color: var(--primary); }
.deep-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 240px;
  max-width: 420px;
}
.deep-search-wrap input {
  flex: 1;
  max-width: unset;
  border-color: var(--border);
  background: #fffef0;
}
.deep-search-wrap input:focus { border-color: #b08000; }
.deep-search-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Contact Grid */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.contact-card {
  background: var(--surface-warm);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}
.contact-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(90,50,20,0.12);
  border-color: var(--accent-amber);
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.avatar-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  /* Warm gradient: sienna to amber — replaces cold corporate blue */
  background: linear-gradient(135deg, var(--accent-terracotta), var(--accent-amber));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.avatar-silhouette { background: none; padding: 0; }
.remove-photo-link { display:block; margin-top:4px; background:none; border:none; font-size:0.72rem; color:var(--text-muted); cursor:pointer; padding:0; text-align:center; width:100%; }
.remove-photo-link:hover { color:#c0392b; }
.card-name { font-weight: 700; font-size: 1rem; }
.li-degree {
  display: inline-block; font-size: 0.6rem; font-weight: 700;
  padding: 1px 5px; border-radius: 3px; vertical-align: middle;
  margin-left: 5px; letter-spacing: 0.02em;
}
.li-degree-1st { background: #dff0d8; color: #2d6a2d; border: 1px solid #b2d8b2; }
.li-degree-2nd { background: #dce8f8; color: #1a5fa8; border: 1px solid #aac9ed; }
.li-degree-3rdp { background: #f5f0ff; color: #6b3fa0; border: 1px solid #d0b8f0; }
.card-title { font-size: 0.82rem; color: var(--text-muted); }
.card-company { font-size: 0.85rem; color: var(--primary); font-weight: 500; }
.card-last-contacted { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

/* Contacts toolbar: filters + view toggle */
.contacts-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.contacts-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.contacts-filters select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.83rem;
  color: var(--text);
  cursor: pointer;
}
.contacts-filters select:focus { outline: none; border-color: var(--primary); }

.view-toggle-btns { display: flex; gap: 3px; }
.view-toggle-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 32px; height: 32px;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.13s;
}
.view-toggle-btn:hover { background: var(--bg); color: var(--text); }
.view-toggle-btn.active { background: var(--primary); color: white; border-color: var(--primary); border-radius: 8px; }

/* List view */
.contact-list { display: flex; flex-direction: column; gap: 2px; }
.contact-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.contact-list-row:hover { background: var(--primary-light); }
.cl-avatar { flex-shrink: 0; }
.cl-name { font-weight: 600; font-size: 0.9rem; min-width: 160px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cl-company { flex: 1; font-size: 0.83rem; color: var(--text-muted); }
.cl-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; white-space: nowrap; }
.cl-meta { font-size: 0.78rem; color: var(--text-muted); }
.cl-due { font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
/* Warm list-view due badges */
.cl-due-overdue { background: #f5ede3; color: var(--accent-terracotta); }
.cl-due-soon    { background: #fdf5eb; color: var(--accent-amber); }
.cl-due-ok      { background: #eef4ee; color: var(--accent-sage); }

/* Table view */
.contact-table-wrap { overflow-x: auto; }
.contacts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.ct-th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.ct-th:hover { color: var(--primary); }
.ct-th-active { color: var(--primary); }
.ct-th-avatar { width: 44px; cursor: default; }
.ct-th-cb { width: 36px; cursor: default; }
.ct-row { cursor: pointer; transition: background 0.1s; }
.ct-row:hover { background: var(--primary-light); }
.ct-row-selected { background: #f5ede3 !important; }
.ct-row:not(:last-child) td { border-bottom: 1px solid var(--border); }
.ct-td { padding: 9px 12px; vertical-align: middle; }
.ct-td-avatar { width: 44px; }
.ct-td-cb { width: 36px; padding: 0 6px; text-align: center; }
.ct-td-name { font-weight: 600; }
.ct-td-muted { color: var(--text-muted); }

/* Multi-select action bar */
.ct-selection-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px; margin-bottom: 8px;
  background: var(--primary-light); border: 1px solid var(--accent-amber);
  border-radius: 8px; font-size: 0.88rem; font-weight: 500;
}
.ct-selection-bar span { flex: 1; color: var(--primary); }
.btn-danger-sm {
  padding: 5px 14px; font-size: 0.82rem; font-weight: 600;
  background: #e53e3e; color: #fff; border: none; border-radius: 6px; cursor: pointer;
}
.btn-danger-sm:hover { background: #c53030; }
.btn-ghost-sm {
  padding: 5px 12px; font-size: 0.82rem; font-weight: 500;
  background: transparent; color: var(--text-muted); border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
}
.btn-ghost-sm:hover { background: #f5f5f5; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 1rem;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
}
.modal.hidden { display: none; }
.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-wide { max-width: 760px; }
.modal-crop { max-width: 960px; }
.modal-small { max-width: 400px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
  margin-bottom: 20px;
}
.modal-header h2 { font-size: 1.2rem; }
.modal-header-brand { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; color: var(--primary); opacity: 0.5; }
.close-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 4px;
}
.close-btn:hover { background: var(--bg); }

/* Form */
form { padding: 0 24px 24px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }

/* ── Email list (form) ───────────────────────────────────────────────── */
.email-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.email-entry { display: flex; align-items: center; gap: 6px; }
.email-label-sel { flex-shrink: 0; width: 100px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.85rem; background: var(--surface); color: var(--text); font-family: inherit; }
.email-addr { flex: 1; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.88rem; font-family: inherit; background: var(--surface); color: var(--text); outline: none; transition: border-color 0.15s; }
.email-addr:focus { border-color: var(--primary); }
.email-primary-badge { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px; }
.email-remove-btn { flex-shrink: 0; background: none; border: none; font-size: 0.9rem; cursor: pointer; color: var(--text-muted); padding: 4px 6px; border-radius: 4px; line-height: 1; transition: background 0.12s, color 0.12s; }
.email-remove-btn:hover { background: #fee2e2; color: #b91c1c; }
.btn-add-entry { background: none; border: 1px dashed var(--border); border-radius: 6px; padding: 5px 12px; font-size: 0.82rem; color: var(--primary); cursor: pointer; margin-top: 2px; transition: background 0.12s; }
.btn-add-entry:hover { background: var(--primary-light, #dde8fa); }

.form-group input,
.form-group textarea,
.form-group select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  background: var(--surface);
  color: var(--text);
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; }
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* Detail modal — two-column */
.modal-detail {
  max-width: 1200px;
  height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-detail .modal-header { flex-shrink: 0; border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 0; }
.detail-content { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.detail-cols { display: flex; flex: 1; overflow: hidden; }
.detail-left {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 24px;
  min-width: 0;
}
.detail-right {
  width: 420px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 20px 20px 24px;
  border-left: 1px solid var(--border);
  background: var(--bg); /* warm cream instead of cold #f9fafb */
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Left column */
.detail-top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.detail-avatar { flex-shrink: 0; }
.detail-avatar .avatar,
.detail-avatar .avatar-placeholder { width: 72px; height: 72px; font-size: 1.6rem; }
.detail-info { flex: 1; min-width: 0; }
.detail-info h3 { font-size: 1.2rem; margin-bottom: 2px; }
.detail-info .d-fullname { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 3px; font-style: italic; }
.detail-info .d-berf-brand { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; color: var(--primary); opacity: 0.45; margin-bottom: 4px; }
.detail-info .d-title { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2px; }
.detail-info .d-company { color: var(--primary); font-weight: 600; font-size: 0.9rem; }
.detail-info .d-headline { color: var(--text-muted); font-size: 0.8rem; margin-top: 2px; }
.detail-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.detail-section { margin-bottom: 18px; }
.detail-section h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}
.detail-fields { display: flex; flex-direction: column; gap: 5px; }
.detail-field { display: flex; gap: 8px; font-size: 0.88rem; align-items: baseline; }
.detail-field .label { color: var(--text-muted); min-width: 96px; font-size: 0.8rem; flex-shrink: 0; }
.detail-field a { color: var(--primary); text-decoration: none; word-break: break-all; }
.detail-field a:hover { text-decoration: underline; }
.detail-empty { color: #bbb; }
.detail-email-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-gmail {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 5px; font-size: 0.75rem;
  background: #e4e7ec; color: #555 !important; text-decoration: none !important;
  white-space: nowrap; line-height: 1.6; flex-shrink: 0;
  border: 1px solid #d0d5dd;
}
.btn-gmail:hover { background: #d0d5dd; color: #333 !important; }
.next-followup-val { display: flex; align-items: center; }
.next-followup-input {
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.85rem; font-family: inherit; background: var(--bg); color: var(--text);
  width: 130px;
}
.next-followup-input:focus { border-color: var(--primary); outline: none; }
.rel-field-row { cursor: text; }
.rel-field-row:hover .rel-field-display { color: var(--primary); }
.rel-field-text {
  border: none; border-bottom: 1px solid var(--border); border-radius: 0;
  background: transparent; padding: 0; font-size: 0.9rem; font-family: inherit;
  color: var(--text); width: 160px;
}
.rel-field-text:focus { border-bottom-color: var(--primary); outline: none; }
.detail-notes {
  background: var(--bg);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.88rem;
  white-space: pre-wrap;
  line-height: 1.5;
  color: var(--text);
}

/* Personal history timeline */
.ct-section {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.ct-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.ct-track-wrap {
  position: relative;
  padding: 8px 0 4px;
}
.ct-track {
  position: relative;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 6px;
}
.ct-tick {
  position: absolute;
  top: -4px;
  width: 1px;
  height: 11px;
  background: #c8cdd6;
  transform: translateX(-50%);
  z-index: 1;
}
.ct-label-row {
  position: relative;
  height: 18px;
  margin: 5px 6px 0;
}
.ct-tick-lbl {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  top: 0;
}
.ct-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-amber);  /* warm amber dot on contact history track */
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--accent-amber);
  cursor: default;
  z-index: 2;
}
.ct-dot.today-dot {
  background: #e55;
  box-shadow: 0 0 0 1px #e55;
  width: 11px;
  height: 11px;
}
.ct-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.ct-label.today-label { color: #e55; font-weight: 600; }
.ct-empty { font-size: 0.82rem; color: var(--text-muted); }
.ct-toggle-btn {
  font-size: 0.68rem;
  padding: 2px 8px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #f2f4f7;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
}
.ct-toggle-btn:hover { background: #e4e7ec; color: var(--text); }

/* Contact type badge */
.contact-type-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 10px;
  vertical-align: middle;
  margin-left: 6px;
}
.modal-maximized .contact-type-badge {
  font-size: 0.72rem;
  padding: 3px 10px;
}

/* Right column section blocks & separators */
.right-section-block { margin-bottom: 4px; }
.right-section-sep {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}
.right-section-hdr {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
}
.right-section-hdr h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0;
}
.right-section-icon { font-size: 0.85rem; line-height: 1; }
.btn-add-meeting {
  margin-left: auto;
  font-size: 0.78rem;
  padding: 3px 12px;
  border: 1px solid var(--primary);
  border-radius: 5px;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}
.btn-add-meeting:hover { background: var(--primary); color: white; }

/* Right column — touchpoints (kept for count badge reuse) */
.touchpoints-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.touchpoints-header h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin: 0;
}
.touchpoints-count {
  background: var(--accent-sage);  /* warm sage instead of primary blue */
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}

.interaction-add {
  margin-bottom: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 11px 10px;
}
.interaction-add textarea {
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  resize: none;
  outline: none;
  transition: border-color 0.15s;
  background: var(--surface);
  color: var(--text);
  line-height: 1.5;
}
.interaction-add textarea:focus { outline: none; }
.interaction-bottom-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.interaction-date-inline {
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface);
}
.interaction-date-inline:focus { border-color: var(--primary); outline: none; color: var(--text); }
/* keep old date-row rule in case anything else uses it */
.interaction-date-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.interaction-date-row input {
  flex: 1;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
}
.interaction-date-row input:focus { border-color: var(--primary); outline: none; }
.interaction-add-btns { display: flex; gap: 6px; margin-top: 7px; justify-content: flex-end; } /* legacy */

.btn-add-note {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-add-note:hover { background: #e7f0fb; }

.btn-mark-contacted {
  background: var(--accent-sage);  /* warm sage green instead of hard Google green */
  color: white;
  border: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-mark-contacted:hover { background: #5a7a5e; }

/* Interaction timeline entries */
.interaction-entry {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  align-items: flex-start;
}
.interaction-entry:last-child { border-bottom: none; }
.interaction-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent-amber);  /* warm amber dot in interaction timeline */
  flex-shrink: 0;
  margin-top: 4px;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent-amber);
}
.interaction-dot.contacted {
  background: var(--accent-sage);
  box-shadow: 0 0 0 2px var(--accent-sage);
}
.interaction-body { flex: 1; min-width: 0; }
.interaction-date { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 2px; }
.est-marker { color: #aaa; font-size: 0.7rem; font-style: italic; }

/* Correspondence */
.corr-section { margin-top: 4px; }
.corr-thread {
  border: 1px solid var(--border); border-radius: 6px;
  margin-bottom: 8px; overflow: hidden;
}
.corr-thread-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; cursor: pointer; background: var(--bg);
  transition: background 0.1s;
}
.corr-thread-header:hover { background: #f0f2f5; }
.corr-icon { font-size: 0.9rem; color: #888; flex-shrink: 0; }
.corr-thread-info { flex: 1; min-width: 0; }
.corr-subject { font-size: 0.82rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.corr-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 1px; }
.corr-thread-body { border-top: 1px solid var(--border); }
.corr-email { border-bottom: 1px solid var(--border); }
.corr-email:last-child { border-bottom: none; }
.corr-email.corr-incoming .corr-email-header { background: #f0f7ff; }
.corr-email.corr-incoming .corr-email-header:hover { background: #e3f0ff; }
.corr-email-header {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 28px; cursor: pointer;
  background: #fafbfc; transition: background 0.1s;
}
.corr-email-header:hover { background: #f0f2f5; }
.corr-dir { font-size: 0.68rem; font-weight: 600; flex-shrink: 0; padding: 1px 5px; border-radius: 3px; }
.corr-dir-in  { background: #e3f0ff; color: #1a73e8; }
.corr-dir-out { background: #f0f4f0; color: #34a853; }
.corr-email-date { font-size: 0.72rem; color: var(--text-muted); flex-shrink: 0; min-width: 80px; }
.corr-email-subj { font-size: 0.78rem; color: var(--text); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.corr-gmail-link {
  font-size: 0.7rem; color: var(--primary); flex-shrink: 0;
  text-decoration: none; padding: 1px 5px; border-radius: 3px;
  border: 1px solid var(--border);
}
.corr-gmail-link:hover { background: var(--primary); color: white; }
.corr-full {
  font-size: 0.78rem; color: var(--text); margin: 0;
  padding: 10px 10px 10px 28px;
  line-height: 1.55; word-break: break-word; white-space: pre-wrap;
  background: white; border-top: 1px solid var(--border);
}
.corr-chevron {
  font-size: 1.1rem; color: #aaa; flex-shrink: 0;
  transition: transform 0.15s; line-height: 1;
}
.interaction-text { font-size: 0.85rem; line-height: 1.45; word-break: break-word; color: var(--text); }
.interaction-del {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 5px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}
.interaction-actions { display: flex; flex-direction: column; gap: 2px; align-self: flex-start; margin-top: 2px; }
.interaction-entry:hover .interaction-del,
.interaction-entry:hover .interaction-edit { opacity: 1; }
.interaction-del:hover { background: #fee2e2; color: var(--danger); }
.interaction-edit {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 0.85rem; padding: 2px 5px; border-radius: 4px;
  opacity: 0; transition: opacity 0.15s;
  align-self: flex-start;
}
.interaction-edit:hover { background: #e8f0fe; color: var(--primary); }
.interaction-edit-form { padding: 6px 0 6px 24px; display: flex; flex-direction: column; gap: 6px; }
.iedit-date-text {
  padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.85rem; font-family: inherit; background: var(--bg); color: var(--text);
  width: 160px;
}
.interaction-edit-form textarea {
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.85rem; resize: vertical; font-family: inherit; background: var(--bg); color: var(--text);
}
.interaction-edit-form textarea:focus,
.interaction-edit-form .iedit-date-text:focus { border-color: var(--primary); outline: none; }
.interaction-edit-btns { display: flex; gap: 6px; justify-content: flex-end; }
.btn-sm { padding: 4px 12px; font-size: 0.8rem; }
.inline-confirm {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.14);
  z-index: 9999;
  font-size: 0.82rem;
  white-space: nowrap;
  animation: popIn 0.1s ease;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
.inline-confirm span { color: var(--text); font-weight: 500; }
.ic-yes {
  padding: 3px 10px; border-radius: 6px; border: none; cursor: pointer;
  background: var(--danger); color: #fff; font-size: 0.8rem; font-weight: 500;
}
.ic-yes:hover { background: #b91c1c; }
.ic-no {
  padding: 3px 10px; border-radius: 6px; border: 1px solid var(--border); cursor: pointer;
  background: var(--bg); color: var(--text); font-size: 0.8rem;
}
.ic-no:hover { background: var(--surface); }

@media (max-width: 680px) {
  .modal-detail { height: 94vh; max-width: 100%; }
  .detail-cols { flex-direction: column; }
  .detail-right { width: 100%; border-left: none; border-top: 1px solid var(--border); }
}

/* Photo grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.photo-item {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--bg);
  border: 1px solid var(--border);
}
.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  display: block;
}
.photo-item .delete-photo {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.photo-item:hover .delete-photo { opacity: 1; }

.linkedin-screenshot {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  display: block;
}

.upload-btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.upload-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.upload-label:hover { border-color: var(--primary); color: var(--primary); }
.upload-label input { display: none; }

/* Lightbox */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#lightbox.hidden { display: none; }
#lightbox img { max-width: 95vw; max-height: 95vh; object-fit: contain; border-radius: 4px; }

/* Import bar */
.import-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: var(--primary-light);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.import-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--primary);
  color: white;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.import-label:hover { background: var(--primary-hover); }
.import-label input { display: none; }
.import-label:disabled { opacity: 0.7; pointer-events: none; }
.import-label.loading { opacity: 0.7; pointer-events: none; }
.import-label-secondary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.import-label-secondary:hover { color: var(--primary); }
.import-label-secondary input { display: none; }
.import-status {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.import-status.success { color: #1a7f37; font-weight: 600; }
.import-status.error { color: var(--danger); }

/* Crop modal */
.crop-wrap {
  padding: 0 24px;
  display: flex;
  justify-content: center;
  overflow: auto;
}
#cropCanvas {
  cursor: crosshair;
  display: block;
  max-width: 100%;
  border-radius: 6px;
}
.detail-photo-zoom { cursor: zoom-in; }
.detail-photo-zoom:hover { opacity: 0.9; }
.crop-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 8px 0 16px;
}

/* Form photo upload */
.photo-upload-row .photo-upload-preview {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

/* Header nav */
.header-nav { display: flex; gap: 4px; }
.nav-btn {
  background: rgba(255,255,255,0.15);
  color: white;
  border: none;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.nav-btn:hover { background: rgba(255,255,255,0.25); }
.nav-btn.active { background: rgba(255,255,255,0.95); color: var(--primary); font-weight: 700; }
.btn-scheduler {
  background: rgba(255,255,255,0.12); color: white; border: 1px solid rgba(255,255,255,0.25);
  padding: 7px 14px; border-radius: 6px; font-size: 0.82rem; font-weight: 500; cursor: pointer;
  transition: background 0.15s;
}
.btn-scheduler:hover { background: rgba(255,255,255,0.22); }
.btn-scheduler.scheduler-on { background: rgba(52,168,83,0.35); border-color: rgba(52,168,83,0.6); }

/* Gear panel */
.gear-wrap { position: relative; }
.gear-btn {
  background: rgba(255,255,255,0.12); color: white; border: 1px solid rgba(255,255,255,0.25);
  width: 34px; height: 34px; border-radius: 6px; font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.2s;
}
.gear-btn:hover { background: rgba(255,255,255,0.22); transform: rotate(30deg); }
.gear-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: white; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.13); padding: 12px 14px;
  min-width: 360px; z-index: 200; white-space: nowrap;
}
.gear-panel-title { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 10px; }
.gear-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.gear-row:last-child { border-bottom: none; }
.gear-dot { width: 8px; height: 8px; border-radius: 50%; background: #ccc; flex-shrink: 0; transition: background 0.3s; }
.gear-label { font-size: 0.82rem; color: var(--text); white-space: nowrap; }
.gear-started { flex: 1; font-size: 0.7rem; color: var(--text-muted); font-style: italic; white-space: nowrap; text-align: right; padding-right: 4px; }
.gear-synced  { font-size: 0.7rem; color: #1a73e8; font-style: italic; white-space: nowrap; padding-right: 6px; }
.gear-action {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  font-size: 0.72rem; padding: 3px 9px; cursor: pointer; color: var(--text-muted);
  transition: background 0.1s;
}
.gear-action:hover { background: #f0f2f5; color: var(--text); }
.gear-action:disabled { opacity: 0.5; cursor: default; }
.gear-toggle { font-weight: 600; }
.gear-toggle.scheduler-on { background: #e6f4ea; border-color: #34a853; color: #1e7e34; }
.gear-user-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0 10px; cursor: pointer; border-radius: 8px;
  transition: background 0.15s;
}
.gear-user-row:hover { background: var(--bg); padding-left: 6px; padding-right: 6px; margin: 0 -6px; }
.gear-user-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-terracotta), var(--accent-amber));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; flex-shrink: 0;
  overflow: hidden; box-shadow: 0 2px 6px rgba(176,100,50,.3);
}
.gear-user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.gear-user-info { flex: 1; min-width: 0; }
.gear-user-name { font-size: 0.92rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gear-user-role { font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }
.gear-user-links {
  display: flex; align-items: center; gap: 6px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 10px;
}
.gear-user-btn { background: none; border: none; padding: 0; font-size: 0.75rem; color: var(--primary); cursor: pointer; text-decoration: underline; }
.gear-user-btn:hover { color: var(--primary-hover); }

/* View stats bar (replaces old dashboard-toolbar, lives inside each view) */
.view-statsbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.statsbar-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.statsbar-btn:hover { background: var(--bg); color: var(--text); }
.statsbar-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Dashboard toolbar (legacy, kept for reference) */
.dashboard-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.dash-view-toggle { display: flex; gap: 4px; background: var(--bg); border-radius: 8px; padding: 4px; border: 1px solid var(--border); }
.dash-tab {
  background: none;
  border: none;
  padding: 7px 18px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}
.dash-tab.active { background: white; color: var(--primary); font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.dash-summary { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-stat { font-size: 0.82rem; font-weight: 600; padding: 4px 10px; border-radius: 12px; }
.dash-stat.overdue { background: #f5ede3; color: var(--accent-terracotta); }
.dash-stat.soon { background: #fdf5eb; color: var(--accent-amber); }
.dash-stat.muted { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.dash-empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* Urgency list */
.urgency-group-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 16px 0 6px;
}
.urgency-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.urgency-row:hover { box-shadow: var(--shadow-lg); }
.urgency-row.muted { opacity: 0.7; }
.urgency-avatar { flex-shrink: 0; }
.urgency-info { flex: 1; min-width: 0; }
.urgency-name { font-weight: 700; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.urgency-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 1px; }
.urgency-last { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.urgency-status { min-width: 100px; text-align: right; font-size: 0.85rem; }
.btn-mark {
  flex-shrink: 0;
  background: var(--primary);
  color: white;
  border: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-mark:hover { background: var(--primary-hover); }
.btn-mark.secondary { background: var(--surface); color: var(--primary); border: 1px solid var(--accent-amber); }
.btn-mark.secondary:hover { background: var(--primary-light); }
.btn-mark.small { padding: 5px 10px; }
.no-target-section { margin-top: 16px; }
.no-target-section summary { font-size: 0.85rem; color: var(--text-muted); cursor: pointer; padding: 8px 0; }

/* Timeline / Gantt */
.tl-header {
  display: flex;
  align-items: flex-end;
  gap: 0;
  margin-bottom: 4px;
  padding-left: 0;
}
.tl-btn-spacer { width: 36px; flex-shrink: 0; }
.tl-label-row { position: relative; flex: 1; height: 24px; }
.tl-label {
  position: absolute;
  font-size: 0.7rem;
  color: var(--text-muted);
  transform: translateX(-50%);
  white-space: nowrap;
}
.tl-today-label {
  position: absolute;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
  transform: translateX(-50%);
  white-space: nowrap;
  bottom: 0;
}
.tl-rows { display: flex; flex-direction: column; gap: 6px; }
.tl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.tl-row:hover { box-shadow: var(--shadow); }
.tl-row.muted { opacity: 0.55; }
.badge.muted { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); font-size: 0.75rem; padding: 2px 8px; border-radius: 10px; }
.tl-name {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tl-track {
  flex: 1;
  height: 20px;
  background: transparent;
  border-radius: 4px;
  position: relative;
  overflow: visible;
  border: none;
}
.tl-bar {
  position: absolute;
  top: 2px;
  height: calc(100% - 4px);
  border-radius: 3px;
  opacity: 0.85;
}
.tl-bar.ok      { background: var(--accent-sage); }
.tl-bar.soon    { background: var(--accent-amber); }
.tl-bar.overdue { background: var(--accent-terracotta); } /* warm terracotta instead of alarm red */
.tl-today {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--primary);
  border-radius: 2px;
  z-index: 2;
}
.tl-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: #fff;
  border: 2px solid #555;
  border-radius: 1px;
  z-index: 3;
  cursor: default;
  transition: transform 0.1s;
}
.tl-dot:hover {
  transform: translate(-50%, -50%) rotate(45deg) scale(1.4);
  border-color: var(--primary);
}
/* Next follow-up pin: vertical stem + triangle flag */
.tl-pin {
  position: absolute;
  top: -10px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  z-index: 4;
  cursor: default;
}
.tl-pin::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 8px;
  width: 2px;
  height: 22px;
  background: #e67e22;
}
.tl-pin::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 0;
  border-top: 8px solid #e67e22;
  border-right: 8px solid transparent;
  border-left: 0;
}
.tl-pin:hover::after { border-top-color: #c0392b; }
/* Inline freq select in detail view */
.freq-inline-select {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.freq-inline-select:focus { border-color: var(--primary); outline: none; }
.tl-badge { min-width: 90px; text-align: right; font-size: 0.8rem; }

/* Collapsible section */
.collapsible-header {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.collapsible-header:hover { color: var(--primary); }
.toggle-icon { font-size: 0.75rem; color: var(--primary); font-weight: 600; white-space: nowrap; }
.collapsible-body { margin-top: 8px; }

.linkedin-summary {
  margin: 4px 0 8px;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.6;
}
.summary-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.summary-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 0 8px;
}
.summary-line {
  padding: 1px 0;
}
.summary-exp-line {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pdf-text-view {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px;
  font-size: 0.78rem;
  font-family: "Segoe UI", sans-serif;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  max-height: 400px;
  overflow-y: auto;
  color: var(--text);
}

/* Messages import */
.msg-person-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.msg-person-row:last-child { border-bottom: none; }
.msg-person-info { width: 180px; flex-shrink: 0; }
.msg-preview { flex: 1; min-width: 0; }

/* Utility */
.hidden { display: none !important; }
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}

/* --- Maximize button --- */
.btn-maximize {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 9px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-right: 6px;
  line-height: 1;
}
.btn-maximize:hover { background: var(--bg); }
.modal-maximized { padding: 0 !important; }
.modal-maximized .modal-box.modal-detail {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
}
/* In maximized mode: pin left col, give all extra space to right col */
.modal-maximized .detail-left {
  flex: 0 0 520px;
}
.modal-maximized .detail-right {
  flex: 1;
  width: auto;
}

/* --- Meeting modal --- */
.modal-meeting {
  width: min(780px, 92vw);
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-meeting-maximized .modal-box.modal-meeting {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
}
.modal-meeting-maximized { padding: 0 !important; }
.meeting-meta-row {
  display: flex;
  gap: 12px;
  padding: 0 24px 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.meeting-editor-wrap {
  padding: 0 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.meeting-editor-wrap .ql-toolbar.ql-snow { border-radius: 4px 4px 0 0; flex-shrink: 0; }
.meeting-editor-wrap .ql-container.ql-snow { border-radius: 0 0 4px 4px; font-size: 0.95rem; flex: 1; overflow-y: auto; }
.meeting-editor-wrap #meetingEditor { height: 100%; min-height: 200px; }
.meeting-photos-section {
  padding: 10px 24px 4px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  margin-top: 10px;
}
.meeting-photos-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}
.meeting-photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.meeting-photo-item {
  position: relative;
  width: 100px;
  height: 72px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.meeting-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  display: block;
}
.del-photo-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.55);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 0.68rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.meeting-view-content {
  padding: 0 24px 12px;
  max-height: 55vh;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.6;
}
.meeting-view-content p { margin-bottom: 6px; }
.meeting-view-content ul, .meeting-view-content ol { padding-left: 20px; margin-bottom: 6px; }

/* --- Personal & Family section in detail --- */
.modal-personal { max-width: 620px; }
.personal-summary-bullets {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.personal-summary-bullets li {
  padding: 3px 0 3px 18px;
  position: relative;
  font-size: 0.88rem;
  line-height: 1.5;
}
.personal-summary-bullets li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: var(--primary);
  font-weight: 700;
}
.bday-alert {
  display: inline-block;
  background: #fff3cd;
  color: #856404;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 6px;
  vertical-align: middle;
}

/* --- Connection Themes (tags) --- */
.theme-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  min-height: 28px;
}
.theme-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  /* Warm sage green instead of corporate blue */
  background: #eef4ee;
  color: #4a7a4e;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 3px 8px 3px 10px;
  border-radius: 14px;
  white-space: nowrap;
  border: 1px solid #c4ddc6;
}
.theme-chip-del {
  background: none;
  border: none;
  color: #6b8de0;
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0;
  line-height: 1;
  opacity: 0.7;
}
.theme-chip-del:hover { opacity: 1; color: #c0392b; }

/* Suggested theme chips (not yet applied) */
.theme-chip-suggestion {
  background: #f0fdf4;
  color: #166534;
  border: 1px dashed #86efac;
  opacity: 0.9;
}
.theme-chip-add {
  background: none;
  border: none;
  color: #16a34a;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0;
  line-height: 1;
}
.theme-chip-add:hover { color: #14532d; }
.theme-suggestions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed var(--border);
}
.theme-suggestions-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 2px;
}
.theme-chip-add-all {
  font-size: 0.75rem;
  font-weight: 600;
  color: #16a34a;
  background: none;
  border: 1px solid #86efac;
  border-radius: 10px;
  padding: 2px 8px;
  cursor: pointer;
}
.theme-chip-add-all:hover { background: #f0fdf4; }

.theme-add-wrap { display: inline-flex; align-items: center; }
.theme-add-input {
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 3px 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: transparent;
  width: 110px;
  outline: none;
  transition: border-color 0.15s, width 0.2s;
}
.theme-add-input:focus {
  border-color: var(--primary);
  color: var(--text);
  width: 160px;
}

/* ── Summary Page ─────────────────────────────────────────── */
.summary-page { padding: 24px 28px 40px; max-width: 1100px; margin: 0 auto; }
.summary-loading { padding: 40px; text-align: center; color: var(--text-muted); }

/* Stat cards — removed in favour of face strip; kept for possible re-use */
.sum-stat-row { display: flex; gap: 14px; margin-bottom: 28px; flex-wrap: wrap; }
.sum-stat-card {
  flex: 1; min-width: 120px;
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-align: center;
}
/* warm amber urgency instead of blood-red */
.sum-stat-card.stat-danger  { border-color: #e8c49a; background: #fdf5eb; }
.sum-stat-card.stat-warning { border-color: #e8c49a; background: #fdf5eb; }
.sum-stat-card.stat-muted   { opacity: 0.65; }
.sum-stat-val  { font-size: 2rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.sum-stat-card.stat-danger  .sum-stat-val { color: var(--accent-terracotta); }
.sum-stat-card.stat-warning .sum-stat-val { color: var(--accent-amber); }
.sum-stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-top: 4px; font-weight: 600; }

/* Two-column body */
.sum-body { display: flex; gap: 22px; align-items: flex-start; }
.sum-col-left  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.sum-col-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }

/* Section blocks */
.sum-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
}
.sum-section-hdr {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.sum-section-icon { font-size: 0.9rem; }
.sum-section-count {
  background: var(--accent-amber);  /* warm amber count badge */
  color: white;
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 700;
}
.sum-empty { font-size: 0.82rem; color: var(--text-muted); padding: 4px 0; font-style: italic; }

/* Person rows (overdue / due soon / birthdays) */
.sum-person-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.86rem;
}
.sum-person-row:last-child { border-bottom: none; }
.sum-person-row:hover .sum-person-name { color: var(--primary); }
.sum-person-name { font-weight: 600; flex-shrink: 0; }
.sum-person-co   { color: var(--text-muted); font-size: 0.8rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Warm amber urgency instead of alarm red */
.sum-overdue-badge { margin-left: auto; flex-shrink: 0; font-size: 0.72rem; font-weight: 600; background: #f5ede3; color: var(--accent-terracotta); padding: 2px 9px; border-radius: 10px; border: 1px solid #e8c49a; }
.sum-due-badge     { margin-left: auto; flex-shrink: 0; font-size: 0.72rem; font-weight: 600; background: #fdf5eb; color: var(--accent-amber); padding: 2px 9px; border-radius: 10px; border: 1px solid #e8c49a; }
.sum-bday-badge    { margin-left: auto; flex-shrink: 0; font-size: 0.72rem; font-weight: 600; background: #f5f0f8; color: var(--accent-plum); padding: 2px 9px; border-radius: 10px; border: 1px solid #d4c4e8; }
.sum-bday-info     { color: var(--text-muted); font-size: 0.8rem; flex: 1; }

/* Activity feed */
.sum-activity-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.84rem;
}
.sum-activity-row:last-child { border-bottom: none; }
.sum-activity-row:hover .sum-act-name { color: var(--primary); }
.sum-act-icon  { flex-shrink: 0; font-size: 0.75rem; width: 16px; text-align: center; color: var(--text-muted); }
.sum-act-name  { font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.sum-act-note  { color: var(--text-muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8rem; }
.sum-act-date  { flex-shrink: 0; font-size: 0.75rem; color: var(--text-muted); }

/* Type breakdown */
.sum-type-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.sum-type-badge { flex-shrink: 0; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 10px; width: 88px; text-align: center; }
.sum-type-bar-wrap { flex: 1; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.sum-type-bar { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.sum-type-count { flex-shrink: 0; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); width: 24px; text-align: right; }

/* Themes in summary */
.sum-themes-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.sum-theme-chip { cursor: default; }
.sum-theme-count { font-size: 0.68rem; opacity: 0.7; margin-left: 2px; }

/* Digest on summary page — full-width, multi-column bullets */
.sum-digest-section { }
.sum-digest-section .digest-section { margin-bottom: 14px; }
.sum-digest-section .digest-section:last-child { margin-bottom: 0; }
.sum-digest-section .digest-section-hdr { margin-bottom: 8px; }
.sum-digest-section .digest-item { padding: 5px 0; }

/* LinkedIn summary section */
.sum-linkedin-btn {
  margin-left: auto;
  font-size: 0.72rem;
  padding: 2px 10px;
  border: 1px solid var(--primary);
  border-radius: 5px;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
}
.sum-linkedin-btn:hover:not(:disabled) { background: var(--primary); color: white; }
.sum-linkedin-btn:disabled { opacity: 0.5; cursor: default; }
.sum-li-group { margin-bottom: 14px; }
.sum-li-group:last-child { margin-bottom: 0; }
.sum-li-group-hdr { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 7px; }
.sum-li-bullet { display: flex; gap: 6px; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 0.84rem; line-height: 1.45; }
.sum-li-bullet:last-child { border-bottom: none; }
.sum-li-name { font-weight: 600; flex-shrink: 0; color: var(--text); }
.sum-li-text { color: var(--text); flex: 1; }

@media (max-width: 720px) {
  .sum-body { flex-direction: column; }
}

/* --- Meeting list in detail --- */
.meeting-list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  border-radius: 4px;
}
.meeting-list-item:last-child { border-bottom: none; }
.meeting-list-item:hover { background: var(--bg); }
.meeting-item-date {
  font-size: 0.74rem;
  color: var(--text-muted);
  width: 76px;
  flex-shrink: 0;
  padding-top: 2px;
}
.meeting-item-title {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 500;
}
.meeting-item-del {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 5px;
  border-radius: 4px;
  opacity: 0.6;
}
.meeting-item-del:hover { color: var(--danger); opacity: 1; }

/* --- Calendar View --- */
.cal-wrap { padding: 16px 20px; }
.cal-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.cal-nav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text);
}
.cal-nav-btn:hover { background: var(--bg); }
.cal-month-label { font-size: 1.1rem; font-weight: 600; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day-hdr {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0 8px;
}
.cal-cell {
  min-height: 80px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
  cursor: default;
  transition: background 0.1s;
  background: var(--surface);
}
.cal-cell-active { cursor: pointer; }
.cal-cell-active:hover { background: #eef3fb; }
.cal-empty { background: none; border: none; cursor: default; }
.cal-today { border-color: var(--primary); background: #f0f6ff; }
.cal-day-num { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 3px; }
.cal-today .cal-day-num { color: var(--primary); }
.cal-dots { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 3px; }
.cal-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.cal-dot-touch   { background: #34a853; }
.cal-dot-due     { background: #f9ab00; }
.cal-dot-overdue { background: var(--danger); }
.cal-dot-email   { background: #4a90d9; }
.cal-names { display: flex; flex-direction: column; gap: 1px; }
.cal-name {
  font-size: 0.7rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: inherit;
  padding: 1px 2px;
  border-radius: 2px;
}
.cal-name:hover { background: var(--bg); color: var(--primary); }
/* Calendar legend */
.cal-legend {
  display: flex;
  gap: 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 10px;
  align-items: center;
}
.cal-legend-item { display: flex; align-items: center; gap: 4px; }

/* Calendar controls bar — view switcher + name format */
.cal-controls-spacer { flex: 1; }
.cal-today-btn { font-size: 0.8rem !important; }
.cal-view-btns {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.cal-view-btn {
  background: none;
  border: none;
  border-right: 1px solid var(--border);
  padding: 4px 11px;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--text);
  white-space: nowrap;
  transition: background 0.1s;
}
.cal-view-btn:last-child { border-right: none; }
.cal-view-btn:hover { background: var(--bg); }
.cal-view-btn.active { background: var(--primary); color: #fff; }
.cal-fmt-sel {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.78rem;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

/* ── Week view ─────────────────────────────────────────────────── */
.cal-wk-grid  { display: flex; flex-direction: column; gap: 4px; }
.cal-wk-hdrs  { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wk-body  { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wk-hdr {
  text-align: center;
  padding: 6px 4px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.cal-wk-hdr-today {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.cal-wk-dow { font-size: 0.68rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.cal-wk-dom { font-size: 1.25rem; font-weight: 700; line-height: 1.1; }
.cal-wk-mon { font-size: 0.62rem; color: var(--text-muted); }
.cal-wk-hdr-today .cal-wk-dow,
.cal-wk-hdr-today .cal-wk-mon { color: rgba(255,255,255,0.75); }
.cal-wk-col {
  min-height: 180px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 4px;
  background: var(--surface);
}
.cal-wk-col-today { border-color: var(--primary); }
.cal-wk-empty { height: 100%; }
.cal-wk-item {
  display: flex;
  flex-direction: column;
  padding: 4px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.1s;
}
.cal-wk-item:hover { background: var(--bg); }
.cal-wk-item-touch   { border-left-color: #34a853; }
.cal-wk-item-due     { border-left-color: #f9ab00; }
.cal-wk-item-overdue { border-left-color: var(--danger); }
.cal-wk-item-email   { border-left-color: #4a90d9; }
.cal-wk-item-name { font-size: 0.76rem; font-weight: 600; color: var(--text); }
.cal-wk-item-note { font-size: 0.67rem; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── 3-Month view ──────────────────────────────────────────────── */
.cal-3month {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.mini-cal { }
.mini-cal-current .mini-cal-title { color: var(--primary); font-weight: 700; }
.mini-cal-title {
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 6px;
  color: var(--text);
}
.mini-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}
.mini-hdr {
  text-align: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 2px 0 4px;
  text-transform: uppercase;
}
.mini-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 0;
  cursor: pointer;
  border-radius: 4px;
  min-height: 24px;
}
.mini-cell:hover:not(.mini-empty) { background: var(--bg); }
.mini-empty { cursor: default; }
.mini-today .mini-day-num {
  background: var(--primary);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mini-day-num {
  font-size: 0.67rem;
  line-height: 1;
  color: var(--text);
}
.mini-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  margin-top: 1px;
}
.mini-dot-touch   { background: #34a853; }
.mini-dot-due     { background: #f9ab00; }
.mini-dot-overdue { background: var(--danger); }

/* --- Digest --- */
.digest-section { margin-bottom: 20px; }
.digest-section-hdr {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.digest-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.digest-item:last-child { border-bottom: none; }
.digest-item-text { flex: 1; font-size: 0.88rem; line-height: 1.5; }
.digest-item-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--primary);
  white-space: nowrap;
}
.digest-item-btn:hover { background: var(--bg); }
.digest-cat-overdue .digest-item-text { color: var(--text); }
.digest-cat-birthday .digest-item-text { color: #856404; }
.digest-empty { color: var(--text-muted); font-size: 0.88rem; padding: 20px 0; text-align: center; }

@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .detail-top { flex-direction: column; }
}

/* ── Network Graph ─────────────────────────────────────────────────────────── */
#networkView {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
  overflow: hidden;
}
#networkView.hidden { display: none; }

.net-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.net-controls-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.net-controls-left {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.net-tag-filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 4px;
}
/* Hide extra chips by default — toggled by JS adding .net-tags-expanded */
.net-tag-filter-row .net-tag-chip[data-extra="1"] {
  display: none !important;
}
.net-tag-filter-row.net-tags-expanded .net-tag-chip[data-extra="1"] {
  display: inline-block !important;
}
.net-tag-chip {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.net-tag-chip:hover {
  border-color: var(--chip-color, var(--primary));
  color: var(--text);
}
.net-tag-chip.active {
  background: var(--chip-color, var(--primary));
  border-color: var(--chip-color, var(--primary));
  color: white;
}
.net-tag-chip-all.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.net-tag-filter-wrap {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.net-tag-filter-row.net-tag-collapsed {
  max-height: 32px;
  overflow: hidden;
}
.net-tag-more {
  font-size: 0.73rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 12px;
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 3px;
  transition: all 0.12s;
}
.net-tag-more:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.net-ctrl-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.net-select {
  font-size: 0.85rem;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
}
.net-reset-btn {
  font-size: 0.8rem;
  padding: 4px 12px;
  margin-left: 4px;
}
.net-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.net-legend-item {
  display: flex;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text);
  gap: 4px;
}
.net-legend-hint {
  color: var(--text-muted);
  font-style: italic;
  margin-left: 8px;
}
.net-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.net-svg-wrap {
  flex: 1;
  min-height: 0;       /* needed for flex child to shrink below content size */
  overflow: hidden;
  position: relative;
  background: var(--bg);
}
.net-svg-wrap svg {
  display: block;
  width: 100%;
  height: 100%;
}
.net-tooltip {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 11px;
  font-size: 0.82rem;
  color: var(--text);
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  max-width: 200px;
  z-index: 10;
  line-height: 1.5;
}
.net-tooltip.hidden { display: none; }
.net-node circle { transition: opacity 0.15s; }
.net-node:hover circle { opacity: 1 !important; stroke-width: 3px; }

/* ── Theme Suggestions Review ──────────────────────────────────────────────── */
.tr-row {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.tr-row:last-child { border-bottom: none; }
.tr-name-row {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.tr-ignore-btn {
  font-size: 0.72rem; color: var(--text-muted); border: 1px solid var(--border);
  background: none; border-radius: 5px; padding: 2px 8px; cursor: pointer;
  white-space: nowrap;
}
.tr-ignore-btn:hover { color: var(--danger); border-color: var(--danger); background: #fff5f5; }
.tr-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.tr-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.tr-col-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.tr-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.tr-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 10px;
  border: 1px solid transparent;
}
.tr-tag-current  { background: var(--bg); color: var(--text); border-color: var(--border); }
.tr-tag-new      { background: var(--primary-light); color: var(--primary); border-color: var(--accent-amber); }
.tr-tag-existing { background: var(--bg); color: var(--text-muted); border-color: var(--border); }
.tr-tag-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.tr-tag-label input[type="checkbox"] {
  width: 13px;
  height: 13px;
  cursor: pointer;
}

/* ── Map View ──────────────────────────────────────────────────────────────── */
#mapView { display: flex; flex-direction: column; height: calc(100vh - 56px); }
.map-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; background: var(--surface);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.map-search {
  flex: 1; max-width: 280px; padding: 5px 10px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 0.85rem; background: var(--bg); color: var(--text);
}
.map-count { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }
#mapContainer { flex: 1; }

/* Leaflet popup custom styling */
.map-popup { min-width: 180px; }
.map-popup-name {
  font-weight: 700; font-size: 0.95rem; color: var(--primary);
  cursor: pointer; text-decoration: underline;
}
.map-popup-name:hover { opacity: 0.8; }
.map-popup-company { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.map-popup-loc { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.map-popup-peers {
  margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border);
  font-size: 0.78rem; color: var(--text-muted);
}
.map-popup-peer {
  cursor: pointer; color: var(--primary); display: inline-block;
  margin: 2px 4px 2px 0; text-decoration: underline;
}

/* Location chips in contact detail */
.loc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.loc-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 3px 10px; font-size: 0.78rem; color: var(--text);
}
.loc-chip.current {
  background: #e8f0fe; border-color: #c5d8fc; color: var(--primary); font-weight: 600;
}
.loc-chip-icon { font-size: 0.75rem; }

/* ── Group By ────────────────────────────────────────────────────────────────── */
.contact-grid-grouped {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.group-section {
  margin-bottom: 8px;
}

.group-section-tiles .contact-grid {
  padding: 12px 4px 4px 4px;
}

.group-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
  margin-bottom: 2px;
}
.group-hdr:hover { background: var(--bg); }

.group-toggle {
  font-size: 0.65rem;
  color: var(--text-muted);
  width: 14px;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.group-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.group-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1px 8px;
  font-weight: 500;
}

/* List view inside group */
.contact-list .group-section { margin-bottom: 6px; }
.contact-list .group-hdr { border-radius: var(--radius) var(--radius) 0 0; margin-bottom: 0; }
.contact-list .group-section > div:not(.group-hdr) > .contact-list-row:last-child {
  border-radius: 0 0 var(--radius) var(--radius);
}

/* Table group header row (inline in the single table) */
.ct-group-hdr-row { cursor: pointer; }
.ct-group-hdr-row:hover .ct-group-hdr-cell { background: #e8edf3; }
.ct-group-hdr-cell {
  background: var(--bg);
  padding: 7px 14px;
  border-top: 2px solid var(--border);
  user-select: none;
}
.ct-group-hdr-cell .group-toggle { font-size: 0.65rem; color: var(--text-muted); margin-right: 6px; }
.ct-group-hdr-cell .group-label  { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.ct-group-hdr-cell .group-count  {
  font-size: 0.72rem; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 1px 7px; margin-left: 8px; font-weight: 500;
}

/* "No grouping" select option style hint */
#groupBy { min-width: 140px; }

/* ── Day Panel ──────────────────────────────────────────────────────────────── */
.day-panel-box { max-width: 480px; width: 100%; max-height: 80vh; display: flex; flex-direction: column; }
.day-panel-title { font-size: 1rem; font-weight: 600; }
.day-panel-body { overflow-y: auto; padding: 4px 0 8px; flex: 1; }
.dp-section-hdr {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted);
  padding: 6px 4px 4px; display: flex; align-items: center; gap: 6px;
}
.dp-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px; border-radius: 8px; cursor: pointer;
  transition: background 0.12s;
}
.dp-row:hover { background: var(--bg); }
.dp-avatar { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  background: var(--primary-light, #dde8fa); display: flex; align-items: center; justify-content: center; }
.dp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dp-avatar-initials { font-size: 0.85rem; font-weight: 700; color: var(--primary); }
.dp-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.dp-info { flex: 1; min-width: 0; }
.dp-name { font-size: 0.9rem; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dp-sub  { font-size: 0.78rem; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-note { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; font-style: italic; }
.dp-arrow { color: var(--text-muted); font-size: 1.2rem; flex-shrink: 0; }
.dp-badge { font-size: 0.65rem; font-weight: 700; padding: 2px 6px; border-radius: 10px; white-space: nowrap; }
.dp-badge-touch   { background: #d4edda; color: #155724; }
.dp-badge-due     { background: #fff3cd; color: #856404; }
.dp-badge-overdue { background: #f8d7da; color: #721c24; }
.dp-badge-email   { background: #dbeafe; color: #1e40af; }
.dp-email-subject { font-style: italic; color: var(--text-muted); }

/* Location geocoded chips */
.loc-geo-row { display: flex; flex-wrap: wrap; gap: 5px; padding: 4px 0 6px 0; margin-left: 0; }
.loc-chip { font-size: 0.75rem; background: #e8f4fd; color: #1565c0; border: 1px solid #b3d9f7; border-radius: 12px; padding: 2px 9px; white-space: nowrap; }
.loc-chip-region { background: #f3e8ff; color: #7e22ce; border-color: #ddd6fe; }
.dp-row-email { display: flex; align-items: center; border-radius: 8px; overflow: hidden; transition: background 0.12s; }
.dp-row-email:hover { background: var(--bg); }
.dp-row-main { display: flex; align-items: center; gap: 12px; padding: 10px 8px; flex: 1; min-width: 0; cursor: pointer; }
.dp-row-main:hover { background: var(--primary-light, #dde8fa); border-radius: 8px; }
.dp-arrow-contact { flex-shrink: 0; padding: 10px 12px; font-size: 1.3rem; color: var(--text-muted); cursor: pointer; border-radius: 8px; transition: background 0.12s, color 0.12s; }
.dp-arrow-contact:hover { background: var(--primary); color: #fff; }
.cal-cell-active:hover .cal-name { color: var(--primary); }
.cal-name-more { color: var(--text-muted) !important; }

/* ── Email Detail Modal ──────────────────────────────────────────────────────── */
.email-detail-box { max-width: 560px; width: 100%; max-height: 85vh; display: flex; flex-direction: column; }
.email-detail-header { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.email-detail-back-btn { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; font-size: 0.8rem; cursor: pointer; color: var(--text-muted); white-space: nowrap; transition: background 0.12s; }
.email-detail-back-btn:hover { background: var(--bg); color: var(--text); }
.email-detail-contact-name { flex: 1; font-weight: 700; font-size: 0.95rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-detail-view-contact-btn { background: none; border: 1px solid var(--primary); border-radius: 6px; padding: 4px 10px; font-size: 0.8rem; cursor: pointer; color: var(--primary); white-space: nowrap; transition: background 0.12s, color 0.12s; }
.email-detail-view-contact-btn:hover { background: var(--primary); color: #fff; }
.email-detail-body { overflow-y: auto; padding: 16px 4px 8px; flex: 1; }
.email-detail-meta { background: var(--bg); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.email-detail-dir-date { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.email-detail-subject { font-size: 1rem; font-weight: 600; color: var(--text); }
.email-detail-body-text { font-size: 0.85rem; line-height: 1.65; color: var(--text); white-space: pre-wrap; word-break: break-word; }

/* ── vCard Import ─────────────────────────────────────────────────────────── */
.vcf-import-btn { font-size: 0.82rem; padding: 5px 12px; white-space: nowrap; }
.vcf-import-box { max-width: 720px; width: 100%; max-height: 90vh; display: flex; flex-direction: column; }
.vcf-instructions { font-size: 0.84rem; color: var(--text-muted); line-height: 1.6; margin: 0 0 18px; }
.vcf-dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.vcf-dropzone.drag-over { border-color: var(--primary); background: var(--primary-light, #dde8fa); }
.vcf-drop-icon  { font-size: 2.8rem; }
.vcf-drop-label { font-size: 0.88rem; color: var(--text-muted); }
.vcf-browse-btn { cursor: pointer; padding: 7px 18px; }
.vcf-upload-status { margin-top: 14px; font-size: 0.88rem; color: var(--text-muted); }

/* Step 2 — preview */
.vcf-preview-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.vcf-preview-summary { font-size: 0.88rem; color: var(--text); }
.vcf-preview-scroll {
  overflow-y: auto;
  max-height: calc(90vh - 240px);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.vcf-preview-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.vcf-preview-table th {
  background: var(--bg);
  padding: 8px 10px;
  text-align: left;
  font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted);
  position: sticky; top: 0;
  border-bottom: 1px solid var(--border);
}
.vcf-preview-table td { padding: 8px 10px; border-bottom: 1px solid var(--bg); vertical-align: middle; }
.vcf-preview-table tr:last-child td { border-bottom: none; }
.vcf-row-dup td { background: #fffbeb; }
.vcf-row-dup:hover td { background: #fef3c7; }
.vcf-name-cell { font-weight: 600; color: var(--text); }
.vcf-muted { color: var(--text-muted); max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcf-dup-badge {
  display: inline-block;
  font-size: 0.67rem; font-weight: 500;
  background: #fef3c7; color: #92400e;
  border: 1px solid #fbbf24;
  border-radius: 10px; padding: 1px 6px;
  margin-left: 6px; vertical-align: middle;
}

/* Step 3 — result */
.vcf-result { text-align: center; padding: 48px 20px; }
.vcf-result-success { font-size: 1.05rem; color: var(--text); line-height: 1.7; }

/* ── Facebook ─────────────────────────────────────────────────────────────── */
.fb-search-btn {
  display: inline-block;
  font-size: 0.72rem; font-weight: 400;
  color: var(--text-muted);
  text-decoration: none; margin-left: 8px;
  white-space: nowrap; vertical-align: middle;
  opacity: 0.6;
  transition: opacity 0.15s, color 0.15s;
}
.fb-search-btn:hover { opacity: 1; color: #1877f2; }

/* Login overlay */
.login-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.login-overlay.hidden { display: none; }
.login-box {
  background: #fff; border-radius: 16px; padding: 40px 36px;
  width: 340px; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  display: flex; flex-direction: column; gap: 14px;
}
.login-box h2 { margin: 0; font-size: 1.5rem; font-weight: 800; color: #1e293b; }
.login-tagline { margin: -4px 0 2px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); opacity: 0.85; }
.login-sub { margin: -4px 0 4px; color: #64748b; font-size: 0.88rem; font-style: italic; }
.login-box input {
  border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 14px;
  font-size: 0.95rem; outline: none;
}
.login-box input:focus { border-color: #6366f1; }
.login-error { color: #dc2626; font-size: 0.82rem; min-height: 16px; margin: -6px 0; }
.login-btn {
  background: #6366f1; color: white; border: none; border-radius: 8px;
  padding: 11px; font-size: 0.95rem; font-weight: 700; cursor: pointer;
}
.login-btn:hover { background: #4f46e5; }

/* Shares */
.shares-banner {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  background: #f0fdf4; border: 1px solid #86efac; border-top: none;
  border-radius: 0 0 10px 10px; padding: 8px 20px;
  font-size: 0.85rem; font-weight: 600; color: #166534;
  cursor: pointer; z-index: 1000;
}
.shares-banner.hidden { display: none; }
.shares-panel {
  position: fixed; top: 40px; left: 50%; transform: translateX(-50%);
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 20px; min-width: 360px; box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  z-index: 999;
}
.shares-panel.hidden { display: none; }
.share-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}
.share-from { color: #64748b; font-size: 0.82rem; flex: 1; }


/* ── Profile Modal (legacy selectors kept for backwards compat) ─────── */
.pf-section-title {
  margin-top: 20px; margin-bottom: 8px; font-weight: 600;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); padding-bottom: 4px; border-bottom: 1px solid var(--border);
}
.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pf-full { grid-column: 1 / -1; }

/* ── Profile Modal (redesign) ──────────────────────────────────────── */
.pf-modal-box {
  max-width: 680px !important; width: 95vw;
  display: flex; flex-direction: column;
  max-height: 92vh !important; padding: 0 !important; overflow: hidden !important;
  position: relative;
}
.pf-close-btn {
  position: absolute; top: 14px; right: 16px; z-index: 10;
}

/* Hero — warm gradient, replaces corporate LinkedIn blue */
.pf-hero {
  display: flex; align-items: flex-start; gap: 20px;
  padding: 28px 28px 20px;
  background: linear-gradient(135deg, #3d2010 0%, #7a3f1c 60%, #b5651d 100%);
  color: #fff;
}
.pf-avatar-wrap {
  position: relative; flex-shrink: 0;
  width: 80px; height: 80px;
}
.pf-avatar-initials, .pf-avatar-img {
  width: 80px; height: 80px; border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,.4);
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.pf-avatar-initials {
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 700; color: #fff;
}
.pf-avatar-overlay {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(0,0,0,.0); display: flex; align-items: center;
  justify-content: center; cursor: pointer; font-size: 1.3rem;
  opacity: 0; transition: opacity .2s, background .2s;
}
.pf-avatar-wrap:hover .pf-avatar-overlay { opacity: 1; background: rgba(0,0,0,.45); }
.pf-hero-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pf-hero-name-input {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
  border-radius: 8px; color: #fff; font-size: 1.2rem; font-weight: 600;
  padding: 6px 12px; width: 100%; box-sizing: border-box;
  outline: none;
}
.pf-hero-name-input::placeholder { color: rgba(255,255,255,.55); }
.pf-hero-name-input:focus { border-color: rgba(255,255,255,.7); background: rgba(255,255,255,.22); }
.pf-hero-sub { display: flex; gap: 8px; flex-wrap: wrap; }
.pf-hero-sub-input {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  border-radius: 6px; color: #fff; font-size: 0.82rem; padding: 5px 10px;
  flex: 1; min-width: 120px; outline: none; box-sizing: border-box;
}
.pf-hero-sub-input::placeholder { color: rgba(255,255,255,.5); }
.pf-hero-sub-input:focus { border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.2); }
.pf-full-width { width: 100%; flex: unset !important; }
.pf-hero-linkedin { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pf-linkedin-btn {
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.35);
  color: #fff; border-radius: 6px; font-size: 0.78rem; padding: 5px 12px;
  cursor: pointer; white-space: nowrap; transition: background .15s;
}
.pf-linkedin-btn:hover { background: rgba(255,255,255,.32); }
.pf-linkedin-status { font-size: 0.75rem; color: rgba(255,255,255,.7); min-height: 14px; }

/* Body / cards */
.pf-body {
  overflow-y: auto; flex: 1; padding: 16px 20px 8px;
  display: flex; flex-direction: column; gap: 12px;
}
.pf-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
}
.pf-card-info { background: #f8fafc; }
.pf-card-title {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted); margin-bottom: 12px;
}
.pf-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pf-label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 0.78rem; font-weight: 500; color: var(--text-muted);
}
.pf-col-2 { grid-column: 1 / -1; }
.pf-input {
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 10px; font-size: 0.85rem; color: var(--text);
  width: 100%; box-sizing: border-box; resize: vertical; outline: none;
  font-family: inherit;
}
.pf-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(26,86,219,.12); }
.pf-info-text { font-size: 0.8rem; color: var(--text-muted); margin: 0 0 6px; line-height: 1.5; }
.pf-code-block {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 12px; font-size: 0.77rem;
  font-family: monospace; color: var(--text); line-height: 1.6;
}

.pf-pw-toggle-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 14px; font-size: 0.82rem; color: var(--text-muted);
  cursor: pointer; transition: border-color .15s, color .15s;
}
.pf-pw-toggle-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Footer */
.pf-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  background: var(--surface);
}

@media (max-width: 520px) {
  .pf-hero { flex-direction: column; align-items: center; text-align: center; }
  .pf-hero-sub, .pf-hero-linkedin { justify-content: center; }
  .pf-card-grid { grid-template-columns: 1fr; }
  .pf-col-2 { grid-column: 1; }
}

/* ── Agent Chat Widget ─────────────────────────────────────────────── */
#agentChatBtn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  z-index: 1100;
  user-select: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
#agentChatBtn:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(0,0,0,0.22); }

.agent-chat-panel {
  position: fixed;
  bottom: 88px;
  right: 24px;
  width: 340px;
  height: 520px;
  max-height: calc(100vh - 110px);
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  z-index: 1099;
  overflow: hidden;
  transition: width 0.2s, height 0.2s;
}
.agent-chat-panel.hidden { display: none; }
.agent-chat-panel.agent-expanded {
  width: 520px;
  height: min(780px, calc(100vh - 110px));
}
.agent-resize-handle {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  cursor: ns-resize;
  z-index: 10;
  border-radius: 16px 16px 0 0;
}
.agent-resize-handle:hover { background: rgba(var(--primary-rgb, 59,130,246), 0.15); }

.agent-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}
.agent-chat-header button {
  background: none;
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.8;
  padding: 0;
  line-height: 1;
}
.agent-chat-header button:hover { opacity: 1; }

.agent-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 200px;
}
.agent-chat-bubble-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 86%;
}
.agent-chat-bubble-wrap.user { align-self: flex-end; align-items: flex-end; }
.agent-chat-bubble-wrap.agent { align-self: flex-start; align-items: flex-start; }
.agent-chat-bubble-wrap.typing { align-self: flex-start; align-items: flex-start; }
.agent-chat-ts {
  font-size: 0.68rem;
  color: var(--text-muted);
  opacity: 0.6;
  padding: 0 4px;
}
.agent-chat-msg {
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 0.84rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.agent-chat-msg.user {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}
.agent-chat-msg.agent {
  background: var(--bg);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.agent-chat-msg.typing { color: var(--text-muted); font-style: italic; background: var(--bg); border-bottom-left-radius: 4px; }

.agent-chat-input-row {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.agent-chat-input-row input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 0.85rem;
  outline: none;
  background: var(--bg);
  color: var(--text);
}
.agent-chat-input-row input:focus { border-color: var(--primary); }
.agent-chat-input-row button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.agent-chat-input-row button:hover { opacity: 0.85; }

.agent-chat-contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0 4px;
}
.agent-chat-contact-btn {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--primary);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.agent-chat-contact-btn:hover {
  background: var(--primary);
  color: white;
}

/* ═══════════════════════════════════════════════════════════════════════════
   WARM AMBIENT INTELLIGENCE — New UI Components
   Added in redesign: Faces strip, mode selector, warm summary page
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Login box — warm brand colours ──────────────────────────────────────── */
.login-box h2 { color: var(--text) !important; }
.login-tagline { color: var(--primary) !important; }
.login-box input:focus { border-color: var(--accent-amber) !important; }
.login-btn {
  background: var(--primary) !important;
  transition: background 0.15s;
}
.login-btn:hover { background: var(--primary-hover) !important; }

/* ── Profile hero — warm gradient replaces cold LinkedIn blue ────────────── */
.pf-hero {
  background: linear-gradient(135deg, #3d2010 0%, #7a3f1c 60%, #b5651d 100%) !important;
}

/* ── "People who need attention" face strip (replaces stat cards on summary) */
.sum-faces-section {
  margin-bottom: 28px;
}
.sum-faces-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.sum-faces-strip {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: flex-start;
}

/* Individual face card in the strip */
.sum-face-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  width: 80px;
  text-align: center;
  /* no card background — floating faces, gardener metaphor */
}
.sum-face-card:hover .sum-face-avatar { transform: translateY(-2px); }

/* Avatar circle with warm pulse for urgency */
.sum-face-avatar {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: visible; /* allow glow to show outside */
  transition: transform 0.2s;
  flex-shrink: 0;
}
.sum-face-avatar-inner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-terracotta), var(--accent-amber));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
  position: relative;
  z-index: 1;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(90,50,20,0.18);
}
.sum-face-avatar-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Warm pulse glow for urgent contacts — CSS animation */
.sum-face-avatar.needs-attention::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  /* Warm amber glow, not alarm red */
  background: radial-gradient(circle, rgba(196,134,42,0.35) 0%, rgba(196,134,42,0) 70%);
  animation: warmPulse 2.4s ease-in-out infinite;
  z-index: 0;
}
@keyframes warmPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50%       { transform: scale(1.25); opacity: 0.3; }
}

/* Birthday indicator — plum glow */
.sum-face-avatar.has-birthday::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(107,79,122,0.35) 0%, rgba(107,79,122,0) 70%);
  animation: warmPulse 2.8s ease-in-out infinite;
  z-index: 0;
}

.sum-face-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  /* Wrap naturally for two-word names */
  word-break: break-word;
}
.sum-face-reason {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.2;
  font-style: italic;
}
/* "Say hi" button — minimal, warm */
.sum-face-action {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid var(--accent-amber);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.sum-face-action:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Empty state for the strip */
.sum-faces-empty {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 20px 0;
}

/* ── "Who to reach" large cards ─────────────────────────────────────────── */
.sum-reach-section {
  margin-bottom: 28px;
}
.sum-reach-cards {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.sum-reach-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
  flex: 1;
  min-width: 240px;
  max-width: 360px;
}
.sum-reach-card:hover {
  box-shadow: 0 6px 20px rgba(90,50,20,0.12);
  transform: translateY(-2px);
  border-color: var(--accent-amber);
}
.sum-reach-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-terracotta), var(--accent-amber));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(90,50,20,0.15);
}
.sum-reach-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.sum-reach-card-info { flex: 1; min-width: 0; }
.sum-reach-card-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 3px;
}
.sum-reach-card-reason {
  /* The warm human line: "Haven't talked in 47 days" */
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
  font-style: italic;
}
.sum-reach-card-btn {
  /* "Say hi →" */
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--accent-amber);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.sum-reach-card-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ── Mode selector — per contact group ─────────────────────────────────── */
/*
  The four modes: Presence | Cultivation | Momentum | Volume
  Rendered as a pill selector row — tasteful, not tab-bar heavy.
  Stored in localStorage per group key.
*/
.mode-selector {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface-warm);
  padding: 2px;
}
.mode-pill {
  padding: 5px 14px;
  border-radius: 18px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  line-height: 1.4;
}
.mode-pill:hover { color: var(--text); background: var(--primary-light); }
.mode-pill.active {
  /* Warm fill for active mode */
  background: var(--primary);
  color: white;
  font-weight: 600;
}
/* Tonal variations per mode */
.mode-pill[data-mode="presence"].active    { background: var(--accent-sage); }
.mode-pill[data-mode="cultivation"].active { background: var(--primary); }
.mode-pill[data-mode="momentum"].active    { background: var(--accent-amber); }
.mode-pill[data-mode="volume"].active      { background: var(--accent-terracotta); }

/* Mode context indicator — tiny pill shown near group label */
.mode-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mode-badge-presence    { background: #eef4ee; color: #4a7a4e; }
.mode-badge-cultivation { background: var(--primary-light); color: var(--primary); }
.mode-badge-momentum    { background: #fdf5eb; color: var(--accent-amber); }
.mode-badge-volume      { background: #fdf0ed; color: var(--accent-terracotta); }

/* ── Group-level mode selector row (shown above each grouped section) ──── */
.group-mode-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.group-mode-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Warm section headers (used in new summary layout) ──────────────────── */
.sum-warm-hdr {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
}
.sum-warm-hdr-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}
.sum-warm-hdr-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Warm section blocks (replaces clinical .sum-section) ─────────────── */
.sum-warm-section {
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.sum-warm-section:last-child { margin-bottom: 0; }

/* ── "Reach out" context line language ─────────────────────────────────── */
/* Urgency rows now use warmer copy via JS; the badge below reflects it */
.warm-reach-badge {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  background: #f5ede3;
  color: var(--accent-terracotta);
  padding: 2px 9px;
  border-radius: 10px;
  border: 1px solid #e8c49a;
}
.warm-reach-badge.soon {
  background: #fdf5eb;
  color: var(--accent-amber);
  border-color: #e8d4a0;
}
.warm-reach-badge.bday {
  background: #f5f0f8;
  color: var(--accent-plum);
  border-color: #d4c4e8;
}

/* ── "Recent sparks" timeline strip ────────────────────────────────────── */
.sum-sparks-strip {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sum-spark-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
}
.sum-spark-row:hover { background: var(--primary-light); }
.sum-spark-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-sage);
  flex-shrink: 0;
}
.sum-spark-name {
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--text);
  white-space: nowrap;
}
.sum-spark-note {
  color: var(--text-muted);
  font-size: 0.8rem;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sum-spark-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── Urgency view — warm language overrides ─────────────────────────────── */
/* Group labels use warmer descriptors via JS (see renderUrgencyList override) */
.urgency-group-label-warm {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  padding: 16px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* "Show up" quick-action button on urgency/timeline rows */
.btn-show-up {
  flex-shrink: 0;
  background: var(--primary);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-show-up:hover { background: var(--primary-hover); }

/* ── Summary page — full restructured layout ────────────────────────────── */
.summary-page {
  padding: 28px 28px 48px;
  max-width: 1100px;
  margin: 0 auto;
}

/* Section divider used in new summary */
.sum-section-divider {
  height: 1px;
  background: var(--border);
  margin: 28px 0;
}

/* ── Loc chips — warm instead of cold blue ──────────────────────────────── */
.loc-chip.current {
  background: var(--primary-light) !important;
  border-color: var(--accent-amber) !important;
  color: var(--primary) !important;
}
.loc-chip {
  background: var(--bg) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

/* ── Calendar cell — warm today highlight ───────────────────────────────── */
/* The cold var(--primary) today marker is overridden below */
.tl-today { background: var(--accent-amber) !important; }
.tl-today-label { color: var(--accent-amber) !important; }

/* ── Warmth in contact type degree badges ───────────────────────────────── */
/* LinkedIn 1st degree stays green; 2nd degree gets warm tint */
.li-degree-2nd { background: #f5ede3; color: var(--primary); border-color: var(--accent-amber); }

/* ── "People you care about" branding — card name uses Georgia for warmth ── */
.card-name {
  font-weight: 700;
  font-size: 1rem;
  /* Names deserve a serif touch — warmth over system sans */
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.01em;
}
