/* ── Reset & Vars ──────────────────────────────────────────────────────── */
:root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --surface2: #eaeaef;
  --border: #d5d5dc;
  --text: #1a1a2e;
  --text2: #6b6b80;
  --accent: #BF2020;
  --accent-bg: rgba(191, 32, 32, 0.08);
  --accent-light: #d42525;
  --green: #1a7f37;
  --radius: 12px;
  --radius-sm: 8px;
  --safe-bottom: env(safe-area-inset-bottom, 16px);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; border: none; background: none; color: inherit; font-family: inherit; }
input, textarea { font-family: inherit; }

/* ── #app container ────────────────────────────────────────────────────── */
#app {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  min-height: 100dvh;
}

/* ── Header (.header div) ──────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo {
  height: 32px;
  width: auto;
}

.header-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  background: var(--surface2);
  transition: background 0.15s;
}
.icon-btn:active { background: var(--accent-bg); }

/* ── Views ─────────────────────────────────────────────────────────────── */
.view { display: none; padding: 16px; position: relative; }
.view.active { display: block; }
/* Non-chat views need top padding for cover */
.view:not(.chat-view) { padding-top: calc(var(--cover-total-collapsed) + 16px); }

.view-title {
  font-size: 1.15rem; font-weight: 700;
  margin-bottom: 12px;
}

.back-btn {
  font-size: 0.85rem;
  color: var(--accent-light);
  font-weight: 600;
  margin-bottom: 10px;
  padding: 4px 0;
}

/* ── Greeting ──────────────────────────────────────────────────────────── */
.greeting { font-size: 1.1rem; font-weight: 700; }
.greeting-sub { font-size: 0.82rem; color: var(--text2); margin-bottom: 14px; }

/* ── Section Titles ────────────────────────────────────────────────────── */
.section-title {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text2);
  margin: 20px 0 10px; padding-left: 2px;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); opacity: 0.85; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* ── Insight Cards ─────────────────────────────────────────────────────── */
#insight-container {
  display: flex; flex-direction: column; gap: 10px;
  padding: 8px 0;
}
.insight-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; display: flex; gap: 10px; align-items: flex-start;
}
.insight-icon { font-size: 1.4rem; flex-shrink: 0; }
.insight-text { font-size: 0.88rem; line-height: 1.4; color: var(--text); }

/* ── Insights Progress Circle ──────────────────────────────────────────── */
.insights-progress-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 24px 16px;
}
.insights-progress-svg {
  display: block;
  transform: rotate(-90deg);
}
.insights-arc {
  stroke-dashoffset: 565.49;  /* full circumference = hidden */
  transition: stroke-dashoffset 1s ease-out;
}
.insights-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 130px;
  pointer-events: none;
}
.insights-progress-count {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: #1a1a2e;
  margin-bottom: 4px;
}
.insights-progress-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.35;
  color: #1a1a2e;
}

.insights-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 0;
  gap: 12px;
}
.insights-loading-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: #C61919;
}

/* ── Mic / Recording ───────────────────────────────────────────────────── */
.mic-section { text-align: center; margin: 20px 0 10px; }
.mic-btn {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(145deg, var(--accent) 0%, #991818 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; margin: 0 auto;
  box-shadow: 0 4px 16px rgba(191, 32, 32, 0.25);
  transition: transform 0.15s, box-shadow 0.15s;
}
.mic-btn:active { transform: scale(0.93); }
.mic-btn.recording {
  animation: pulse 1.4s infinite;
  box-shadow: 0 0 0 0 rgba(191, 32, 32, 0.4);
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0   rgba(191,32,32,0.4); }
  70%  { box-shadow: 0 0 0 18px rgba(191,32,32,0);   }
  100% { box-shadow: 0 0 0 0   rgba(191,32,32,0);   }
}
.mic-label { font-size: 0.75rem; color: var(--text2); margin-top: 6px; }

/* ── Text Input ────────────────────────────────────────────────────────── */
.text-input-section { margin-bottom: 16px; }
.text-input-row {
  display: flex; gap: 8px; align-items: flex-end;
}
.text-input {
  flex: 1;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--text); font-size: 0.9rem; outline: none;
  resize: vertical; min-height: 72px;
  transition: border-color 0.15s;
}
.text-input:focus { border-color: var(--accent); }
.text-input::placeholder { color: var(--text2); }

.send-btn {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.15s;
}
.send-btn:active { opacity: 0.8; }

/* ── Draft Tiles ───────────────────────────────────────────────────────── */
#draft-tiles-container { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.draft-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.draft-tile-label {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  color: var(--accent); letter-spacing: 0.04em; margin-bottom: 4px;
}
.draft-tile-text {
  font-size: 0.85rem; color: var(--text2); line-height: 1.4;
  white-space: pre-wrap; word-break: break-word; margin-bottom: 8px;
}
.draft-tile-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.draft-tile-send {
  background: var(--accent); color: #fff; border: none;
  border-radius: 16px; padding: 5px 14px; font-size: 0.78rem;
  font-weight: 600; cursor: pointer;
}
.draft-tile-send:active { opacity: 0.8; }
.draft-tile-edit, .draft-tile-dismiss {
  background: none; border: none; color: var(--text2);
  font-size: 1rem; cursor: pointer; padding: 4px;
}
.draft-tile-edit:hover, .draft-tile-dismiss:hover { color: var(--text); }

/* ── Ask Section ───────────────────────────────────────────────────────── */
.ask-section { margin-top: 16px; }
.ask-input-row { display: flex; gap: 8px; }
.ask-input {
  flex: 1;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--text); font-size: 0.9rem; outline: none;
  min-height: 72px;
}
.ask-input:focus { border-color: var(--accent); }
.ask-input::placeholder { color: var(--text2); transition: opacity 0.3s ease; }
.ask-input.placeholder-fade::placeholder { opacity: 0; }
.ask-answer {
  margin-top: 10px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 0.9rem;
  line-height: 1.5; display: none; color: var(--text);
}
.ask-answer.visible { display: block; }

/* ── People Cards ──────────────────────────────────────────────────────── */
.people-list { /* container */ }
.person-card {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 8px; cursor: pointer;
  transition: background 0.12s;
}
.person-card:active { background: var(--surface2); }
.person-processing-dot {
  position: absolute; top: 6px; right: 6px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #C61919;
  animation: pulseDot 1.1s ease-in-out infinite;
  pointer-events: none; z-index: 1;
}
.person-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent-bg); color: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700; flex-shrink: 0;
}
.person-info { flex: 1; min-width: 0; }
.person-name {
  font-size: 0.95rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 6px;
}
.person-meta {
  font-size: 0.78rem; color: var(--text2); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.person-count { font-size: 0.75rem; color: var(--text2); flex-shrink: 0; }
.unverified-dot { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; flex-shrink: 0; }

/* Closeness bar on cards */
.closeness-bar { width: 100%; height: 3px; background: var(--border); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.closeness-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-light)); border-radius: 2px; transition: width 0.3s; }

/* ── Multi-select mode ────────────────────────────────────────────────── */
.person-card.selected {
  background: rgba(198, 25, 25, 0.08);
  border-color: #C61919;
}
.person-card.selected .person-avatar {
  background: #C61919;
  color: #fff;
  font-size: 1rem;
}
.cover-delete-fab {
  position: sticky;
  bottom: 8px;
  float: right;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #C61919;
  color: #fff;
  border: none;
  box-shadow: 0 3px 12px rgba(198,25,25,0.4);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
}
.cover-delete-fab:active {
  background: #a01515;
  transform: scale(0.92);
}
.cover-delete-fab-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #fff;
  color: #C61919;
  font-size: 0.7rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ── Circle Filter Chips ───────────────────────────────────────────────── */
.circle-filter, #circle-filter { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; }
.filter-chip {
  flex-shrink: 0; padding: 6px 14px;
  border: 1px solid var(--border); border-radius: 20px;
  font-size: 0.78rem; font-weight: 600;
  background: var(--surface); color: var(--text2);
  transition: all 0.15s;
}
.filter-chip.active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent-light); }
.filter-chip:active { transform: scale(0.96); }
.sort-btn {
  flex-shrink: 0; width: 30px; height: 30px;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--surface); color: var(--text2);
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.15s; position: sticky; right: 0;
}
.sort-btn.active { border-color: var(--accent); color: var(--accent-light); background: var(--accent-bg); }
.sort-btn:active { transform: scale(0.94); }

/* Sort Dropdown */
.sort-overlay {
  position: fixed; inset: 0; z-index: 149;
  background: transparent; display: none;
}
.sort-overlay.visible { display: block; }
.sort-menu {
  position: fixed;
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
  z-index: 150;
  padding: 6px 0;
  display: none;
  animation: settingsSlideIn 0.15s ease-out;
}
.sort-menu.visible { display: block; }
.sort-menu-title {
  padding: 8px 16px 4px;
  font-size: 0.72rem; font-weight: 700; color: var(--text2);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.sort-option {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 10px 16px;
  font-size: 0.85rem; font-weight: 500;
  color: var(--text); text-align: left;
  border: none; background: none; cursor: pointer;
  transition: background 0.12s;
}
.sort-option:active { background: var(--accent-bg); }
.sort-option.active { color: var(--accent-light); background: var(--accent-bg); }
.sort-dir-icon { font-size: 14px; color: var(--text2); }

/* ── Profile ───────────────────────────────────────────────────────────── */
.profile-header { text-align: center; padding: 16px 0; }
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px;
  background: var(--accent-bg); color: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700;
}
.profile-name { font-size: 1.3rem; font-weight: 700; }
.profile-name-row {
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.profile-action-btn {
  background: none; border: none; cursor: pointer; font-size: 1rem;
  color: var(--text2); padding: 4px 6px; border-radius: var(--radius-sm);
  transition: background 0.12s, color 0.12s;
}
.profile-action-btn:hover { background: var(--surface2); color: var(--text); }
.profile-header-actions { margin-top: 10px; }
.btn-danger {
  background: #dc2626; color: #fff; border: none;
}
.btn-danger:hover { background: #b91c1c; }
.conflict-badge { margin-top: 6px; font-size: 0.78rem; color: #f59e0b; }

/* Profile field badges */
.profile-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; align-items: center; }
.field-badge {
  display: inline-flex; flex-direction: column;
  padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; min-width: 80px; transition: background 0.12s;
}
.field-badge:active { background: var(--surface2); }
.field-badge-label { font-size: 0.65rem; text-transform: uppercase; color: var(--text2); letter-spacing: 0.5px; }
.field-badge-value { font-size: 0.85rem; font-weight: 600; margin-top: 2px; }
.field-badge-check { font-size: 0.75rem; color: var(--green); }
.field-badge-action { font-size: 0.7rem; color: #f59e0b; font-weight: 600; }
.field-badge.unverified { border-color: rgba(245, 158, 11, 0.3); }
.field-badge .add-hint { color: var(--accent-light); font-size: 0.82rem; }

/* Closeness indicator (profile) */
.closeness-section { margin: 12px 0 16px; }
.closeness-control {
  display: flex; flex-direction: row; flex-wrap: nowrap;
  align-items: center; gap: 8px; padding: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); justify-content: center;
}
.closeness-btn {
  width: 32px; height: 32px; min-width: 32px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 1.2rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1; padding: 0; flex-shrink: 0;
}
.closeness-btn:active { background: var(--accent); color: #fff; border-color: var(--accent); }
.closeness-dots {
  display: flex; gap: 4px; align-items: center; flex-shrink: 1; min-width: 0;
}
.closeness-dot {
  width: 16px; height: 16px; min-width: 10px; border-radius: 50%;
  background: var(--border); transition: all 0.2s; flex-shrink: 1;
  aspect-ratio: 1;
}
.closeness-dot.filled {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  box-shadow: 0 0 6px rgba(191, 32, 32, 0.3);
}

/* Closeness widget in chat feed */
.closeness-widget-chat {
  margin: 6px 0 2px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.closeness-widget-name {
  font-size: 0.78rem; font-weight: 700; color: var(--text2);
  text-align: center; letter-spacing: 0.02em; text-transform: uppercase;
}
.closeness-widget-link {
  font-size: 0.75rem; color: var(--accent); cursor: pointer; text-align: center;
  opacity: 0.8; margin-top: 2px;
}
.closeness-widget-link:hover { opacity: 1; text-decoration: underline; }

/* Profile stats */
.profile-stats { display: flex; gap: 16px; justify-content: center; margin-bottom: 16px; }
.profile-stat { text-align: center; }
.profile-stat-value { font-size: 1.2rem; font-weight: 700; }
.profile-stat-label { font-size: 0.7rem; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; }

.profile-summary {
  padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.9rem; line-height: 1.5; margin-bottom: 12px;
}

/* Org cards */
.org-card {
  padding: 10px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.org-name { font-weight: 600; font-size: 0.9rem; }
.org-role { font-size: 0.8rem; color: var(--text2); margin-top: 2px; }

/* Relationship cards */
.rel-card {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 6px; cursor: pointer;
}
.rel-card:active { background: var(--surface2); }
.rel-name { font-weight: 600; font-size: 0.9rem; }
.rel-type { font-size: 0.78rem; color: var(--text2); }

/* Circle tags */
.profile-circles { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.circle-tag {
  padding: 5px 12px; border-radius: 16px;
  background: var(--accent-bg); border: 1px solid rgba(191, 32, 32, 0.25);
  font-size: 0.78rem; font-weight: 600; color: var(--accent-light);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.15s;
}
.circle-tag:active { background: rgba(191, 32, 32, 0.15); }
.circle-tag-remove {
  font-size: 0.65rem; opacity: 0.5; cursor: pointer;
  padding: 0 2px; line-height: 1;
}
.circle-tag-remove:hover { opacity: 1; }

/* Circle add button (red + in profile) */
.circle-add-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: #C61919; color: #fff; border: none;
  font-size: 1.2rem; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}
.circle-add-btn:active { background: #a01414; transform: scale(0.93); }

/* Circle cards (list page) */
.circle-card {
  display: flex; align-items: center; gap: 8px;
  padding: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 8px; overflow: hidden;
}
.circle-card-main {
  flex: 1; padding: 14px 16px; cursor: pointer;
  min-width: 0;
}
.circle-card-main:active { background: var(--surface2); }
.circle-name { font-weight: 600; font-size: 0.95rem; }
.circle-meta { font-size: 0.78rem; color: var(--text2); margin-top: 2px; }
.circle-delete-btn {
  background: none; border: none; padding: 14px 14px;
  font-size: 1rem; cursor: pointer; opacity: 0.4;
  flex-shrink: 0;
}
.circle-delete-btn:hover { opacity: 0.8; }
.create-circle-btn { width: 100%; margin-top: 8px; }

/* Circle detail page */
.circle-detail-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.circle-detail-name {
  font-size: 1.4rem; font-weight: 700; color: var(--text);
}
.circle-detail-desc-section { margin-bottom: 16px; }
.circle-detail-desc {
  padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.9rem; line-height: 1.5; min-height: 40px;
}

/* Circle popup (add person to circle) */
.circle-popup-new {
  margin-bottom: 12px;
}
.circle-popup-new-row {
  display: flex; gap: 8px; align-items: center;
}
.circle-popup-input {
  flex: 1; min-width: 0;
}
.circle-popup-check {
  width: 36px; height: 36px; border-radius: 50%;
  background: #C61919; color: #fff; border: none;
  font-size: 1.1rem; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: background 0.15s;
}
.circle-popup-check:active { background: #a01414; }
.circle-popup-list {
  max-height: 240px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.circle-popup-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.circle-popup-item:last-child { border-bottom: none; }
.circle-popup-item:active { background: var(--accent-bg); }
.circle-popup-name { font-weight: 600; font-size: 0.9rem; }
.circle-popup-count { font-size: 0.75rem; color: var(--text2); }

/* Goodwill */
.goodwill-balance { font-weight: 400; font-size: 0.7rem; color: var(--text2); }
.goodwill-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.goodwill-dir { font-size: 1rem; width: 24px; text-align: center; }
.goodwill-dir.given { color: var(--accent-light); }
.goodwill-dir.received { color: var(--green); }
.goodwill-desc { flex: 1; font-size: 0.85rem; }
.goodwill-recip { cursor: pointer; font-size: 1rem; padding: 4px; }

/* Reminder cards */
.reminders-list { /* container */ }
.reminder-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.reminder-card.completed { opacity: 0.5; }
.reminder-check { font-size: 1.2rem; cursor: pointer; flex-shrink: 0; padding: 2px; }
.reminder-body { flex: 1; }
.reminder-text { font-size: 0.88rem; }
.reminder-meta { font-size: 0.75rem; color: var(--text2); margin-top: 2px; }
.reminder-due { font-size: 0.72rem; color: var(--accent-light); margin-left: 6px; }

/* Interaction timeline */
.interaction-card {
  padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 8px; position: relative;
}
.interaction-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 6px;
}
.interaction-meta { font-size: 0.75rem; color: var(--text2); flex: 1; }
.interaction-actions {
  display: flex; gap: 4px; opacity: 0; transition: opacity 0.2s;
  margin-left: 8px; flex-shrink: 0;
}
.interaction-card:hover .interaction-actions,
.interaction-card:focus-within .interaction-actions { opacity: 1; }
@media (hover: none) {
  /* On touch devices, always show edit/delete buttons */
  .interaction-actions { opacity: 0.6; }
  .interaction-card:active .interaction-actions { opacity: 1; }
}
.ix-action-btn {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  color: var(--text2); font-size: 0.75rem; width: 26px; height: 26px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.ix-action-btn:hover { background: var(--bg); color: var(--text); border-color: var(--text2); }
.ix-delete-btn:hover { color: #e74c3c; border-color: #e74c3c; }
.interaction-transcript { font-size: 0.88rem; line-height: 1.5; }

/* Interaction inline edit */
.ix-edit-area { margin-top: 8px; }
.ix-edit-textarea {
  width: 100%; min-height: 72px; padding: 10px 12px;
  font-size: 0.88rem; line-height: 1.5;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--accent); border-radius: var(--radius);
  resize: vertical; font-family: inherit;
}
.ix-edit-textarea:focus { outline: none; border-color: var(--accent-light); }
.ix-edit-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px;
}

/* ── Circles View ── (styles defined above with circle-card, etc.) ──── */

/* ── Graph View ────────────────────────────────────────────────────────── */
#graph-canvas {
  width: 100%; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}

/* ── Enrichment Panel ──────────────────────────────────────────────────── */
.enrichment-list { /* container */ }
.enrichment-card {
  padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.enrichment-text { font-size: 0.88rem; margin-bottom: 8px; line-height: 1.4; }
.enrichment-actions { display: flex; gap: 8px; }

/* ── Modals ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.visible { display: flex; }

/* .modal is the inner card within modal-overlay */
.modal {
  width: 90%; max-width: 420px; max-height: 85dvh;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 20px;
  overflow-y: auto;
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 14px; text-align: center; }
.modal-subtitle { font-size: 0.85rem; color: var(--text2); margin-bottom: 12px; text-align: center; }
.modal-person-name { font-size: 1.15rem; font-weight: 700; text-align: center; margin-bottom: 6px; }
.modal-person-meta { font-size: 0.82rem; color: var(--text2); text-align: center; margin-bottom: 4px; }
.modal-last-seen { font-size: 0.78rem; color: var(--text2); text-align: center; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* Confirm counter & nav */
.confirm-counter { font-size: 0.82rem; color: var(--text2); font-weight: 600; text-align: center; margin-bottom: 10px; }
.confirm-nav { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }

/* Candidate cards */
.candidate-list { margin-top: 8px; }
.candidate-card {
  padding: 12px 14px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 6px; cursor: pointer; transition: background 0.12s;
}
.candidate-card:active { background: var(--accent-bg); }
.candidate-name { font-weight: 600; font-size: 0.9rem; }
.candidate-meta { font-size: 0.78rem; color: var(--text2); margin-top: 2px; }
.new-person-card { border-style: dashed; border-color: var(--accent); }

/* Pulsating dot (replaces all spinners) */
@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.5); opacity: 0.55; }
}
.pulse-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: #C61919;
  animation: pulseDot 1.1s ease-in-out infinite;
  flex-shrink: 0; display: inline-block;
}
.pulse-dot-sm {
  width: 9px; height: 9px;
}
@keyframes spin { to { transform: rotate(360deg); } }
#processing-message { font-size: 0.9rem; color: var(--text2); text-align: center; }

/* Input modal fields */
.field-edit-input {
  width: 100%; padding: 10px 14px; margin-bottom: 10px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 0.9rem; outline: none;
  min-height: 72px;
}
input.field-edit-input { min-height: unset; }
input[type="date"].field-edit-input { min-height: unset; }
.field-edit-input:focus { border-color: var(--accent); }
.field-edit-input::placeholder { color: var(--text2); }

/* ── Phone field action buttons (Call & WhatsApp) ──────────────────────── */
.field-display-value {
  font-size: 1.2rem; font-weight: 600; text-align: center;
  padding: 12px 0 8px; color: var(--text-primary);
  word-break: break-all;
}
.field-edit-phone-actions {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.field-phone-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: opacity 0.15s;
}
.field-phone-btn:hover { opacity: 0.85; }
.field-phone-btn.call-btn {
  background: rgba(46, 160, 67, 0.12); color: #2ea043; border: 1px solid rgba(46, 160, 67, 0.25);
}
.field-phone-btn.wa-btn {
  background: rgba(37, 211, 102, 0.12); color: #25d366; border: 1px solid rgba(37, 211, 102, 0.25);
}
.field-phone-btn.email-btn {
  background: rgba(59, 130, 246, 0.12); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.25);
}
.phone-btn-icon { font-size: 1rem; }
.profile-contact-actions {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  padding: 8px 0 4px;
}

.direction-toggle { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }

/* ── Toast ─────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; padding: 10px 20px;
  font-size: 0.85rem; font-weight: 600;
  opacity: 0; z-index: 300;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Settings Menu ─────────────────────────────────────────────────────── */
.settings-overlay {
  position: fixed; inset: 0; z-index: 149;
  background: transparent;
  display: none;
}
.settings-overlay.visible { display: block; }

.settings-menu {
  position: fixed;
  top: 52px; right: 12px;
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
  z-index: 150;
  padding: 6px 0;
  display: none;
  animation: settingsSlideIn 0.15s ease-out;
}
.settings-menu.visible { display: block; }

@keyframes settingsSlideIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.settings-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 11px 16px;
  font-size: 0.88rem; font-weight: 500;
  color: var(--text);
  text-align: left;
  transition: background 0.12s;
  border: none; background: none; cursor: pointer;
}
.settings-menu-item:active { background: var(--accent-bg); }
.settings-menu-item.settings-menu-danger { color: #d32f2f; }
.settings-menu-item.settings-menu-danger:active { background: rgba(211,47,47,0.08); }
.settings-menu-icon { font-size: 1rem; width: 22px; text-align: center; flex-shrink: 0; }
.settings-menu-divider { height: 1px; background: var(--border); margin: 4px 12px; }

.settings-menu-footer {
  padding: 10px 16px 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.settings-footer-link {
  font-size: 0.7rem; color: var(--text2);
  text-decoration: none; font-weight: 500;
  transition: color 0.15s;
}
.settings-footer-link:hover { color: var(--text); }
.settings-footer-sep {
  font-size: 0.65rem; color: var(--border);
}

/* ── Fullscreen Button ────────────────────────────────────────────────── */
.fullscreen-btn {
  position: fixed; bottom: 8px; right: 12px;
  font-size: 1.2rem; color: var(--text2);
  z-index: 50; opacity: 0.4;
}
.fullscreen-btn:active { opacity: 0.8; }
.is-native .fullscreen-btn { display: none; }
.is-native .auth-otp-section { display: none; }
.is-native body, .is-native html { overscroll-behavior: none; }

/* ── iOS safe areas & platform gating ────────────────────────────────── */
.is-ios { padding-top: env(safe-area-inset-top); }
.is-ios .cover-drawer { padding-bottom: env(safe-area-inset-bottom); }
.is-ios .chat-input-row { padding-bottom: env(safe-area-inset-bottom); }
/* TODO: Apple Sign-In button (Phase 7 — iOS auth) */
/* TODO: Payment UI gating — Apple policy prohibits in-app web payments on iOS */

/* ── My Profile ────────────────────────────────────────────────────────── */
.myprofile-bio {
  font-size: 0.88rem; color: var(--text2); margin-top: 6px;
  line-height: 1.5; text-align: center; max-width: 320px; margin-left: auto; margin-right: auto;
}
.myprofile-bio.hint { color: var(--accent-light); cursor: pointer; font-style: italic; font-size: 0.82rem; }
.myprofile-stats-section { margin-top: 16px; }
.myprofile-action-row { display: flex; gap: 10px; margin-top: 24px; padding-bottom: 32px; }
.myprofile-action-row .myprofile-action-btn { flex: 1; }

/* ── Empty state ───────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text2); }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 10px; }

/* ── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Inline Ingestion Tooltip ───────────────────────────────────────── */
.ingestion-tooltip {
  display: none;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
  animation: fadeIn 0.25s ease-out;
}
.ingestion-tooltip.visible {
  display: flex;
}
.tooltip-spinner {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #C61919;
  animation: pulseDot 1.1s ease-in-out infinite;
  flex-shrink: 0;
}
.tooltip-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.tooltip-retry {
  display: none;
  font-size: 0.78rem;
  color: var(--accent-light);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  margin-left: 4px;
}
.tooltip-retry:active { opacity: 0.7; }

/* ── Extraction Drawer ─────────────────────────────────────────────────── */
.extraction-drawer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  z-index: 200;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
  padding: 16px 16px calc(16px + var(--safe-bottom));
}
.extraction-drawer.visible {
  transform: translateX(-50%) translateY(0);
}
.drawer-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 12px;
}
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.drawer-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}
.drawer-close {
  font-size: 1.2rem;
  color: var(--text2);
  cursor: pointer;
  padding: 4px 8px;
}
.drawer-close:active { opacity: 0.6; }

/* Drawer card container — swipeable */
.drawer-card-wrapper {
  overflow: hidden;
  touch-action: pan-x;
  user-select: none;
  -webkit-user-select: none;
}
.drawer-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: transform 0.15s ease-out, opacity 0.15s;
  will-change: transform, opacity;
}
.drawer-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.drawer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
}
.drawer-name {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
}
.drawer-status-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--green);
  background: rgba(46, 160, 67, 0.12);
  padding: 2px 10px;
  border-radius: 10px;
}
.drawer-meta {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 8px;
}
.drawer-contact-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 8px;
}
.drawer-contact-item {
  font-size: 0.82rem;
  color: var(--text);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.drawer-relation {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text2);
  font-style: italic;
  margin-bottom: 8px;
}
.drawer-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

/* Pagination dots */
.drawer-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}
.drawer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s, transform 0.2s;
}
.drawer-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

/* ── Structured Summary ────────────────────────────────────────────────── */
.structured-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.summary-category { margin-bottom: 10px; }
.summary-category:last-child { margin-bottom: 0; }
.summary-category-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-light);
  margin-bottom: 4px;
}
.summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.summary-list li {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
  padding: 2px 0 2px 14px;
  position: relative;
}
.summary-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--text2);
}
.summary-text {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
  padding: 2px 0;
}

/* ── Auth Screen ────────────────────────────────────────────────────────── */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  background: var(--bg);
  padding: 24px 16px;
}

.auth-container {
  max-width: 380px;
  width: 100%;
  text-align: center;
}

.auth-logo-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 16px;
}

.auth-logo {
  height: 72px;
  width: auto;
}

.auth-beta {
  position: absolute;
  top: -2px;
  right: -38px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1.5px;
  pointer-events: none;
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 0.95rem;
  color: var(--text2);
  margin-bottom: 32px;
}

.auth-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.15s, transform 0.1s;
}

.auth-btn:active { transform: scale(0.98); }

.auth-btn-google {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.auth-btn-google:hover { background: var(--surface2); }


.auth-btn-icon {
  font-size: 1.1rem;
  font-weight: 700;
}

.auth-btn-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}



.auth-btn-otp {
  background: var(--accent);
  color: #fff;
}
.auth-btn-otp:hover { background: var(--accent-light); }

.auth-btn-verify {
  background: var(--accent);
  color: #fff;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: var(--text2);
  font-size: 0.85rem;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-otp-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.auth-input:focus { border-color: var(--accent); }

.auth-otp-input {
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.3em;
  font-weight: 700;
}

.auth-verify {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.auth-verify-text {
  font-size: 0.95rem;
  color: var(--text2);
}

.auth-link {
  font-size: 0.9rem;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.auth-error {
  margin-top: 16px;
  padding: 10px 14px;
  background: rgba(191, 32, 32, 0.08);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 0.85rem;
}

/* ── Loading Screen (Network Animation) ─────────────────────────────────── */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg, #fff);
}

.loading-text {
  margin-top: 24px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text2, #666);
  letter-spacing: 0.02em;
}

/* SVG nodes & lines */
.net-node {
  fill: #C61919;
  opacity: 0;
}
.net-line {
  stroke: #C61919;
  stroke-width: 2;
  stroke-dasharray: 4 4;
  stroke-linecap: round;
  opacity: 0;
}

/*
 * Full looping cycle (3.5s total):
 *   0–0.8s  nodes appear staggered, lines draw
 *   0.8–2.5s  hold visible
 *   2.5–3.2s  fade everything out
 *   3.2–3.5s  stay invisible (gap before restart)
 */

/* Node: appear at its delay%, hold, fade out, stay hidden */
@keyframes nodeLoop1 { 0%{opacity:0;r:0} 3%{opacity:1;r:10} 6%{opacity:1;r:8} 71%{opacity:1;r:8} 86%{opacity:0;r:0} 100%{opacity:0;r:0} }
@keyframes nodeLoop2 { 0%{opacity:0;r:0} 14%{opacity:0;r:0} 17%{opacity:1;r:10} 20%{opacity:1;r:8} 71%{opacity:1;r:8} 86%{opacity:0;r:0} 100%{opacity:0;r:0} }
@keyframes nodeLoop3 { 0%{opacity:0;r:0} 29%{opacity:0;r:0} 32%{opacity:1;r:10} 34%{opacity:1;r:8} 71%{opacity:1;r:8} 86%{opacity:0;r:0} 100%{opacity:0;r:0} }
@keyframes nodeLoop4 { 0%{opacity:0;r:0} 51%{opacity:0;r:0} 54%{opacity:1;r:10} 57%{opacity:1;r:8} 71%{opacity:1;r:8} 86%{opacity:0;r:0} 100%{opacity:0;r:0} }

/* Line: draw at its delay%, hold, fade out, stay hidden */
@keyframes lineLoop1 { 0%{stroke-dashoffset:60;opacity:0} 6%{stroke-dashoffset:60;opacity:0} 8%{opacity:1} 17%{stroke-dashoffset:0;opacity:1} 71%{opacity:1} 86%{opacity:0} 100%{opacity:0;stroke-dashoffset:60} }
@keyframes lineLoop2 { 0%{stroke-dashoffset:60;opacity:0} 17%{stroke-dashoffset:60;opacity:0} 19%{opacity:1} 29%{stroke-dashoffset:0;opacity:1} 71%{opacity:1} 86%{opacity:0} 100%{opacity:0;stroke-dashoffset:60} }
@keyframes lineLoop3 { 0%{stroke-dashoffset:60;opacity:0} 37%{stroke-dashoffset:60;opacity:0} 40%{opacity:1} 51%{stroke-dashoffset:0;opacity:1} 71%{opacity:1} 86%{opacity:0} 100%{opacity:0;stroke-dashoffset:60} }

/* Staggered node loops — 3.5s cycle */
.net-node-1 { animation: nodeLoop1 3.5s ease-in-out infinite; }
.net-node-2 { animation: nodeLoop2 3.5s ease-in-out infinite; }
.net-node-3 { animation: nodeLoop3 3.5s ease-in-out infinite; }
.net-node-4 { animation: nodeLoop3 3.5s ease-in-out infinite; }
.net-node-5 { animation: nodeLoop4 3.5s ease-in-out infinite; }
.net-node-6 { animation: nodeLoop4 3.5s ease-in-out infinite; }
.net-node-7 { animation: nodeLoop4 3.5s ease-in-out infinite; }

/* Staggered line loops — 3.5s cycle */
.net-line-1 { animation: lineLoop1 3.5s ease-in-out infinite; }
.net-line-2 { animation: lineLoop2 3.5s ease-in-out infinite; }
.net-line-3 { animation: lineLoop2 3.5s ease-in-out infinite; }
.net-line-4 { animation: lineLoop3 3.5s ease-in-out infinite; }
.net-line-5 { animation: lineLoop3 3.5s ease-in-out infinite; }
.net-line-6 { animation: lineLoop3 3.5s ease-in-out infinite; }

/* Fade-out when loading done */
.loading-screen.fade-out {
  animation: fadeOut 0.4s ease-out forwards;
}
.view-loading-overlay.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}
@keyframes fadeOut {
  to { opacity: 0; pointer-events: none; }
}

/* ── Per-View Loading Overlay ──────────────────────────────────────────────── */
.view-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg, #fff);
  min-height: 60vh;
}

/* ── Item Actions Button (⋯) ──────────────────────────────────────────────── */
.item-actions-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-secondary, #888);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  line-height: 1;
  transition: background 0.15s;
}
.item-actions-btn:hover { background: var(--card-bg-hover, rgba(0,0,0,0.06)); }

.reminder-card, .goodwill-card { position: relative; }
.reminder-card .item-actions-btn,
.goodwill-card .item-actions-btn { margin-left: auto; }

/* ── Action Sheet (inside modal) ──────────────────────────────────────────── */
.action-sheet { display: flex; flex-direction: column; gap: 6px; }
.action-sheet-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  background: var(--card-bg, #f7f7f7);
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 10px;
  font-size: 15px;
  color: var(--text, #1a1a1a);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.action-sheet-btn:hover { background: var(--card-bg-hover, #eee); }
.action-sheet-btn.danger { color: #d32f2f; }
.action-sheet-btn.danger:hover { background: rgba(211,47,47,0.08); }
.action-sheet-desc {
  color: var(--text-secondary, #888);
  font-size: 14px;
  margin-bottom: 10px;
  word-break: break-word;
}

/* ── Install Prompt Modal ──────────────────────────────────────────────── */
.install-prompt-choices { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }
.install-prompt-choice {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background 0.12s;
}
.install-prompt-choice:active { background: var(--accent-bg); }
.install-prompt-choice input[type="checkbox"] {
  width: 20px; height: 20px; accent-color: var(--accent);
  flex-shrink: 0;
}
.install-prompt-choice-label { font-size: 0.9rem; font-weight: 600; }
.install-prompt-choice-desc { font-size: 0.78rem; color: var(--text2); margin-top: 2px; }

/* ── Contact Import Modal ──────────────────────────────────────────────── */
.contact-import-preview {
  max-height: 200px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin: 10px 0;
}
.contact-import-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.contact-import-item:last-child { border-bottom: none; }
.contact-import-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-bg); color: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; flex-shrink: 0;
}
.contact-import-info { flex: 1; min-width: 0; }
.contact-import-name { font-size: 0.9rem; font-weight: 600; }
.contact-import-meta { font-size: 0.78rem; color: var(--text2); }

/* ── Profile Interaction Input ─────────────────────────────────────────── */
.profile-interaction-section {
  margin: 16px 0;
}
.profile-interaction-row {
  display: flex; gap: 8px; align-items: flex-end;
}
.profile-interaction-input {
  flex: 1;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--text); font-size: 0.9rem; outline: none;
  resize: vertical; min-height: 72px;
  transition: border-color 0.15s;
}
.profile-interaction-input:focus { border-color: var(--accent); }
.profile-interaction-input::placeholder { color: var(--text2); }

/* ── Profile Processing Banner ─────────────────────────────────────────── */
.profile-processing-banner {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem; color: var(--text2);
  animation: profile-processing-pulse 1.8s ease-in-out infinite;
}
.spinner-small {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #C61919;
  animation: pulseDot 1.1s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes profile-processing-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ── Imported Contacts Empty State ─────────────────────────────────────── */
.imported-empty-state {
  text-align: center; padding: 32px 20px; color: var(--text2);
}
.imported-empty-state p { font-size: 0.88rem; margin-bottom: 12px; }

/* ── Ask input alignment fix (now textarea) ────────────────────────────── */
.ask-input-row { display: flex; gap: 8px; align-items: flex-end; }
.ask-input {
  resize: vertical;
}
.ask-input::placeholder { color: var(--text2); transition: opacity 0.3s ease; }
.ask-input.placeholder-fade::placeholder { opacity: 0; }

/* ── Cycling placeholder animation ─────────────────────────────────────── */
.text-input::placeholder { transition: opacity 0.3s ease; }
.text-input.placeholder-fade::placeholder { opacity: 0; }

/* ── Phonebook Sync (Drawer & Profile) ─────────────────────────────────── */
.drawer-sync-status {
  margin-top: 10px; padding: 8px 12px;
  background: rgba(46, 160, 67, 0.08); border: 1px solid rgba(46, 160, 67, 0.2);
  border-radius: var(--radius-sm); text-align: center;
}
.drawer-sync-label {
  font-size: 0.78rem; font-weight: 600; color: var(--green);
  margin-bottom: 4px;
}
.drawer-sync-btn { margin-top: 4px; }
.btn-xs {
  font-size: 0.7rem; padding: 3px 10px; border-radius: 10px; margin-top: 6px;
}

/* Matching imported contacts in drawer */
.drawer-imported-matches {
  margin-top: 10px;
}
.drawer-matches-title {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.4px; color: var(--text2); margin-bottom: 6px;
}
.drawer-match-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 4px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.drawer-match-item:active { background: var(--accent-bg); border-color: var(--accent); }
.drawer-match-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-bg); color: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 700; flex-shrink: 0;
}
.drawer-match-info { flex: 1; min-width: 0; }
.drawer-match-name { font-size: 0.82rem; font-weight: 600; }
.drawer-match-meta { font-size: 0.72rem; color: var(--text2); }
.drawer-match-score {
  font-size: 0.68rem; font-weight: 700; color: var(--accent-light);
  background: var(--accent-bg); padding: 2px 8px; border-radius: 8px;
}

/* Phonebook sync in profile */
.phonebook-sync-section {
  margin: 10px 0;
}
.phonebook-sync-status {
  padding: 10px 14px;
  background: rgba(46, 160, 67, 0.06); border: 1px solid rgba(46, 160, 67, 0.15);
  border-radius: var(--radius-sm); text-align: center;
}
.phonebook-sync-label {
  font-size: 0.82rem; font-weight: 600; color: var(--green);
  display: block; margin-bottom: 4px;
}
.phonebook-sync-btn {
  margin-top: 2px;
}
.phonebook-extra-contacts {
  display: flex; flex-wrap: wrap; gap: 4px; justify-content: center;
  margin: 6px 0;
}

/* Red circle sync button inside profile-badges */
.sync-contact-circle {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); /* red */
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(198, 25, 25, 0.25);
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.sync-contact-circle:active {
  transform: scale(0.9);
  box-shadow: 0 1px 4px rgba(198, 25, 25, 0.2);
}
.sync-contact-circle.synced {
  background: var(--green);
  box-shadow: 0 2px 8px rgba(46, 160, 67, 0.25);
}

/* Sync preview summary */
.sync-summary {
  margin: 8px 0; padding: 8px 12px;
  background: var(--surface2); border-radius: var(--radius-sm);
}
.sync-summary-item {
  font-size: 0.82rem; color: var(--text); margin-bottom: 2px;
}
.sync-summary-item:last-child { margin-bottom: 0; }

/* ── Limit Warning Popup ───────────────────────────────────────────────── */
.limit-warning-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeInSimple 0.2s ease;
}
.limit-warning-modal {
  background: #fff; border-radius: 16px;
  padding: 28px 24px; max-width: 360px; width: 100%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  animation: slideUp 0.3s ease;
}
.limit-warning-icon { font-size: 40px; margin-bottom: 12px; }
.limit-warning-title { font-size: 18px; font-weight: 700; color: #1a1a2e; margin-bottom: 10px; }
.limit-warning-message { font-size: 14px; color: #6b6b80; line-height: 1.5; margin-bottom: 20px; }
.limit-warning-message a { text-decoration: none; font-weight: 600; }
.limit-warning-close {
  width: 100%; padding: 12px; border: none; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer;
}
.limit-warning-close:hover { background: var(--accent-light); }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeInSimple { from { opacity: 0; } to { opacity: 1; } }

/* ── Notification Permission Prompt Banner ─────────────────────────────── */
#notif-prompt-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  z-index: 400;
  width: calc(100% - 32px);
  max-width: 420px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
#notif-prompt-banner.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
#notif-prompt-banner.hiding {
  animation: notifBannerOut 0.3s ease forwards;
}
@keyframes notifBannerOut {
  to { opacity: 0; transform: translateX(-50%) translateY(30px); }
}
.notif-prompt-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.notif-prompt-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}
.notif-prompt-text {
  flex: 1;
  min-width: 0;
}
.notif-prompt-text strong {
  display: block;
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 2px;
}
.notif-prompt-text span {
  font-size: 0.8rem;
  color: var(--text2);
  line-height: 1.35;
}
.notif-prompt-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.btn-primary-sm {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary-sm:hover { opacity: 0.85; }
.btn-text-sm {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 2px 4px;
  text-align: center;
}
.btn-text-sm:hover { color: var(--text); }

/* ── Permission Nudge Banner ───────────────────────────────────────────── */
#perm-nudge-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  z-index: 400;
  width: calc(100% - 32px);
  max-width: 420px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
#perm-nudge-banner.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
#perm-nudge-banner.hiding {
  animation: notifBannerOut 0.3s ease forwards;
}

/* ── Permission Settings Rows ──────────────────────────────────────────── */
.perm-settings-header {
  padding: 12px 16px 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text2);
  font-weight: 600;
}
.perm-row-status {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: auto;
}
.perm-granted { color: #2e7d32; background: rgba(46,125,50,0.1); }
.perm-denied  { color: #d32f2f; background: rgba(211,47,47,0.08); }
.perm-prompt  { color: var(--text2); background: var(--accent-bg); }

/* ══════════════════════════════════════════════════════════════════════════
   CHAT-FIRST INTERFACE
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Nav Tabs (Chat / Network) ─────────────────────────────────────────── */
.nav-tab {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.nav-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.nav-tab:not(.active):active {
  background: var(--surface2);
}

/* ── Chat View Layout ──────────────────────────────────────────────────── */
.chat-view {
  flex-direction: column;
  height: 100dvh;
  padding: 0 !important;
  overflow: hidden;
}
.chat-view.active { display: flex !important; }

/* ── Reminder Strip ────────────────────────────────────────────────────── */
.chat-reminder-strip {
  flex-shrink: 0;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(191, 32, 32, 0.06) 0%, rgba(191, 32, 32, 0.02) 100%);
  border-bottom: 1px solid rgba(191, 32, 32, 0.1);
  animation: reminderSlideIn 0.3s ease-out;
}
@keyframes reminderSlideIn {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.reminder-strip-text {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 8px;
}
.reminder-strip-actions {
  display: flex;
  gap: 8px;
}
.reminder-strip-btn {
  padding: 5px 14px;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.15s;
}
.reminder-strip-btn.primary {
  background: var(--accent);
  color: #fff;
}
.reminder-strip-btn.secondary {
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
}
.reminder-strip-btn:active { transform: scale(0.96); }

/* ── Chat Feed ─────────────────────────────────────────────────────────── */
.chat-feed {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}
/* Push chat content to the bottom (WhatsApp-style) */
.chat-feed > :first-child {
  margin-top: auto;
}

/* Welcome state */
.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  min-height: 60%;
}
.chat-welcome-logo {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  opacity: 0.7;
}
.chat-welcome-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.chat-welcome-sub {
  font-size: 0.85rem;
  color: var(--text2);
  line-height: 1.5;
  max-width: 280px;
}

/* Chat bubbles */
.chat-msg {
  margin-bottom: 12px;
  max-width: 85%;
  animation: chatBubbleIn 0.25s ease-out;
}
@keyframes chatBubbleIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-msg.user {
  margin-left: auto;
}
.chat-msg.assistant {
  margin-right: auto;
}
.chat-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}
.chat-msg.user .chat-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.assistant .chat-bubble {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-msg-time {
  font-size: 0.65rem;
  color: var(--text2);
  margin-top: 3px;
  padding: 0 4px;
}
.chat-msg.user .chat-msg-time { text-align: right; }
.chat-msg.assistant .chat-msg-time { text-align: left; }

/* Pending message status (local-first: message stored but not yet confirmed by server) */
.chat-msg.pending .chat-bubble {
  opacity: 0.75;
}
.chat-msg.pending .chat-msg-time::after {
  content: " ◦";
  font-size: 0.7rem;
}
.chat-msg.failed .chat-bubble {
  opacity: 0.6;
  border: 1px solid var(--accent);
}
.chat-msg.failed .chat-msg-time::after {
  content: " ✕";
  color: var(--accent);
  font-size: 0.65rem;
}

/* @mention highlighting in user messages */
.chat-mention {
  font-weight: 700;
}
.chat-msg.assistant .chat-mention {
  color: #C61919;
}
.chat-msg.user .chat-mention {
  color: #fff !important;
}

/* Typing indicator */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  max-width: 80px;
  margin-bottom: 12px;
}
.chat-typing .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text2);
  animation: typingDot 1.2s infinite;
}
.chat-typing .dot:nth-child(2) { animation-delay: 0.15s; }
.chat-typing .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}

/* ── Action Tiles (in chat) ────────────────────────────────────────────── */
.chat-action-tiles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.chat-action-tile {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: all 0.15s;
}
.chat-action-tile:active { background: var(--surface2); }
.chat-tile-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.chat-tile-icon {
  font-size: 1rem;
  flex-shrink: 0;
}
.chat-tile-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.chat-tile-meta {
  font-size: 0.78rem;
  color: var(--text2);
  margin-bottom: 8px;
}
.chat-tile-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chat-tile-btn {
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.15s;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.chat-tile-btn:active { transform: scale(0.96); }
.chat-tile-btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.chat-tile-btn.completed {
  background: rgba(26, 127, 55, 0.1);
  border-color: rgba(26, 127, 55, 0.2);
  color: var(--green);
  pointer-events: none;
}

/* ── Chat Input Bar ────────────────────────────────────────────────────── */

/* Sync status indicator — subtle dot to the left of the input bar */
.sync-indicator {
  position: absolute;
  top: -12px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  color: var(--text2);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.sync-indicator.visible { opacity: 1; }
.sync-indicator .sync-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text2);
  transition: background 0.3s;
}
.sync-indicator.syncing .sync-dot {
  background: var(--accent);
  animation: sync-pulse 1.2s ease-in-out infinite;
}
.sync-indicator.offline .sync-dot { background: #aaa; }
.sync-indicator.reconnecting .sync-dot {
  background: #e8a317;
  animation: sync-pulse 0.8s ease-in-out infinite;
}
.sync-indicator.error .sync-dot { background: var(--accent); }

@keyframes sync-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}

/* Offline banner — thin, non-intrusive bar below the cover */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0; right: 0;
  z-index: 200;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #fff;
  background: #888;
  padding: 2px 0;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}
.offline-banner.visible { transform: translateY(0); }

.chat-input-bar {
  flex-shrink: 0;
  position: relative;
  padding: 10px 12px calc(10px + var(--safe-bottom));
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 6px 6px 6px 16px;
  transition: border-color 0.15s;
}
.chat-input-row:focus-within {
  border-color: var(--accent);
}
/* Mention indicator — inline red label inside the input row */
.mention-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex-shrink: 0;
  padding: 2px 0;
}
.mention-chips-container .mention-indicator {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(198, 25, 25, 0.08);
  border-radius: 12px;
  padding: 2px 8px;
}
.mention-chip-x {
  font-size: 0.75rem;
  margin-left: 2px;
  opacity: 0.6;
  cursor: pointer;
}
.mention-chip-x:hover {
  opacity: 1;
}
.mention-indicator {
  font-size: 0.82rem;
  font-weight: 600;
  color: #C61919;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  padding: 4px 0;
  line-height: 1.4;
}
.chat-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.4;
  outline: none;
  resize: none;
  max-height: 120px;
  min-height: 24px;
  padding: 4px 0;
  font-family: inherit;
}
.chat-input::placeholder {
  color: var(--text2);
  transition: opacity 0.3s ease;
}
.chat-input.placeholder-fade::placeholder { opacity: 0; }
.chat-mic-btn, .chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.chat-mic-btn {
  background: transparent;
  color: var(--text2);
}
.chat-mic-btn:active { color: var(--accent); }
.chat-mic-btn.recording {
  background: var(--accent);
  color: #fff;
  animation: pulse 1.4s infinite;
}
.chat-send-btn {
  background: var(--accent);
  color: #fff;
}
.chat-send-btn:active { opacity: 0.8; }

/* ── Network Menu ──────────────────────────────────────────────────────── */
#network-menu {
  top: 52px;
  right: 12px;
}

/* ── Progressive Discovery Locks ───────────────────────────────────────── */
.nm-locked {
  opacity: 0.4;
  pointer-events: none;
  position: relative;
}
.nm-locked::after {
  content: "🔒";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
}

/* ── Chat Processing Indicator ─────────────────────────────────────────── */
.chat-processing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  max-width: 85%;
  margin-bottom: 12px;
  animation: chatBubbleIn 0.25s ease-out;
}
.chat-processing .pulse-dot-sm {
  width: 9px; height: 9px;
}
.chat-processing-text {
  font-size: 0.82rem;
  color: var(--text2);
}

/* ── Driver Agent Chat Elements ─────────────────────────────────────────────── */

/* Person suggestion buttons */
.chat-suggestion-buttons {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 8px; max-width: 85%;
}
.chat-person-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}
.chat-person-btn:active {
  background: var(--surface2);
  transform: scale(0.98);
}
.chat-person-btn.secondary {
  background: var(--surface);
  border-style: dashed;
}
.chat-person-btn-info {
  display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0;
}
.chat-person-btn-name {
  font-size: 0.88rem; font-weight: 600; color: var(--text);
}
.chat-person-btn-meta {
  font-size: 0.75rem; color: var(--text2);
}
/* Contact action icons in chat tiles/cards */
.chat-contact-actions {
  display: flex; gap: 6px; align-items: center; flex-shrink: 0;
}
.chat-action-icon {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 0.9rem; text-decoration: none;
  transition: opacity 0.15s;
}
.chat-action-icon:active { opacity: 0.7; transform: scale(0.9); }
.chat-action-icon.call { background: rgba(46, 160, 67, 0.12); }
.chat-action-icon.whatsapp { background: rgba(37, 211, 102, 0.12); }
.chat-action-icon.email { background: rgba(59, 130, 246, 0.12); }
.chat-card-actions {
  display: flex; gap: 6px; justify-content: flex-end; padding-top: 8px;
  border-top: 1px solid var(--border); margin-top: 8px;
}
/* Person disambiguation dropdown (4+ matches) */
.chat-person-dropdown-wrap {
  margin-top: 8px; max-width: 85%;
}
.chat-person-dropdown {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.88rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  appearance: auto;
}
/* Event suggestion controls */
.chat-event-suggestion {
  max-width: 85%;
}
.chat-event-controls {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 8px;
}

/* Inline action buttons */
.chat-action-btns {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 8px;
}

/* Inline contact card */
.chat-contact-card {
  margin-top: 8px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  max-width: 85%;
}
.chat-contact-card:active {
  background: var(--surface2);
  transform: scale(0.98);
}
.chat-card-label {
  font-size: 0.72rem; color: var(--text2); text-transform: uppercase;
  letter-spacing: 0.04em; margin-bottom: 8px; font-weight: 600;
}
.chat-card-row {
  display: flex; align-items: center; gap: 12px;
}
.chat-card-info { flex: 1; min-width: 0; }
.chat-card-name {
  font-size: 0.9rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-card-meta {
  font-size: 0.78rem; color: var(--text2); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-card-closeness {
  font-size: 0.72rem; color: var(--accent); margin-top: 3px; font-weight: 600;
}
.chat-card-arrow {
  font-size: 1.4rem; color: var(--text2); flex-shrink: 0;
}
.person-avatar.sm {
  width: 36px; height: 36px; font-size: 0.75rem;
}

/* Chat lists (sorted/unsorted) */
.chat-list {
  margin-top: 8px; max-width: 85%;
}
.chat-sort-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; margin-bottom: 6px;
  font-size: 0.72rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; color: var(--text2); cursor: pointer;
  transition: all 0.15s;
}
.chat-sort-toggle:active { background: var(--surface2); }
.chat-list-items {
  display: flex; flex-direction: column; gap: 4px;
}
.chat-list-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: left; cursor: pointer;
  transition: all 0.15s; width: 100%;
}
.chat-list-item:active {
  background: var(--surface2);
}
.chat-list-item-name {
  font-size: 0.85rem; font-weight: 600; color: var(--text);
}
.chat-list-item-meta {
  font-size: 0.73rem; color: var(--text2);
}

/* Chat inline confirmation buttons */
.chat-confirm-candidate-btn,
.chat-confirm-new-btn {
  display: block;
  width: 100%;
  padding: 10px 14px;
  margin-top: 6px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.chat-confirm-candidate-btn {
  background: #fff;
  color: var(--text);
}
.chat-confirm-candidate-btn:hover {
  background: var(--primary-light, #fef2f2);
  border-color: var(--cover-red, #C61919);
}
.chat-confirm-new-btn {
  background: transparent;
  color: var(--text2);
  border-style: dashed;
}
.chat-confirm-new-btn:hover {
  background: var(--surface2, #f5f5f5);
  color: var(--text);
}

/* Cover profile action buttons */
.cover-profile-actions {
  padding: 10px 0 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cover-action-btn {
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--border, #e0e0e0);
  background: #fff;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
.cover-action-btn:active {
  background: var(--surface2, #f5f5f5);
}
.cover-action-btn--done {
  background: #2e7d32;
  color: #fff;
  border-color: #2e7d32;
}
.cover-action-btn--done:active {
  background: #256029;
}
.cover-action-btn--danger {
  background: transparent;
  color: #C61919;
  border-color: #C61919;
}
.cover-action-btn--danger:active {
  background: #C61919;
  color: #fff;
}

/* Floating + button on cover profile */
.cover-profile-fab {
  position: sticky;
  bottom: 16px;
  float: right;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #C61919;
  color: #fff;
  border: none;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(198,25,25,0.35);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  margin-right: 4px;
}
.cover-profile-fab:active {
  background: #a01515;
  transform: scale(0.92);
}

/* Chat bubble with formatted text */
.chat-bubble strong { font-weight: 700; }
.chat-bubble .chat-bullet {
  display: block;
  padding-left: 12px;
  position: relative;
  margin: 2px 0;
}
.chat-bubble .chat-bullet::before {
  content: '\2022';
  position: absolute; left: 0;
}
/* Markdown headings inside chat bubbles */
.chat-bubble .chat-heading {
  font-weight: 700;
  font-size: 0.85rem;
  color: #C61919;
  margin: 10px 0 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(198,25,25,0.18);
  line-height: 1.35;
}
.chat-bubble .chat-heading:first-child { margin-top: 0; }
/* Lists inside chat bubbles */
.chat-bubble .chat-list {
  margin: 4px 0 6px 0;
  padding-left: 18px;
  list-style: disc;
}
.chat-bubble .chat-list li {
  margin: 2px 0;
  line-height: 1.45;
}
/* Override pre-wrap for formatted bubbles so list/heading layout works */
.chat-bubble:has(.chat-heading), .chat-bubble:has(.chat-list) {
  white-space: normal;
}

/* ══════════════════════════════════════════════════════════════════════════
   COVER (Pull-Down Drawer)
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  --cover-red: #C61919;
  --cover-collapsed-h: 120px;
  --cover-handle-h: 40px;
  --cover-total-collapsed: calc(var(--cover-collapsed-h) + var(--cover-handle-h));
  --safe-top: env(safe-area-inset-top, 0px);
}

/* ── Cover container ──────────────────────────────────────────────────── */
.cover {
  position: fixed;
  top: 0;
  left: 50%;
  width: 100%;
  max-width: 480px;
  z-index: 500;
  transform: translateX(-50%) translateY(var(--cover-ty, 0px));
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.cover.dragging { transition: none !important; }
.cover.dragging .cover-content-box { transition: none !important; }
.cover.dragging .cover-menu { transition: none !important; }
.cover.dragging .cover-notifications { transition: none !important; }


/* ── Red area ─────────────────────────────────────────────────────────── */
.cover-red {
  background: var(--cover-red);
  padding: calc(var(--safe-top) + 24px) 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;


/* ── RUNGS logo — always at bottom of red area ────────────────────────── */
.cover-logo {
  font-family: "MuseoModerno", sans-serif;
  font-weight: 700;
  font-size: 2.8rem;
  color: #fff;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 10px 0 8px;
  transition: opacity 0.4s ease;
  pointer-events: none;
  flex-shrink: 0;
  z-index: 1;
  overflow: visible;
}
.cover-logo-inner {
  position: relative;
  display: inline-block;
}
.cover-logo.hidden { opacity: 0; pointer-events: none; padding: 0; max-height: 0; }

.cover-beta {
  position: absolute;
  top: -2px;
  right: -4px;
  transform: translateX(100%);
  font-family: inherit;
  font-size: 0.3em;
  font-weight: 700;
  letter-spacing: 1.5px;
}
}

/* ── White content box ─────────────────────────────────────────────── */
.cover-content-box {
  width: calc(100% - 40px);
  margin: 0 auto;
  background: #fff;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  /* hidden by default — visually collapsed, zero height so no layout impact */
  max-height: 0;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: center center;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform, opacity, max-height;
  flex-shrink: 0;
  flex-grow: 0;
  pointer-events: none;
}
.cover-content-box.visible {
  opacity: 1;
  transform: scaleX(1);
  pointer-events: auto;
}

/* State 0: no notification box — logo only */

/* State 1: half-open notifications — all visible, scrollable.
   42vh is visible in state 1; subtract logo (~90px) + padding so
   notifications stay inside the visible area instead of being clipped. */
.cover-content-box.state-1 {
  max-height: calc(42vh - 110px);
}
.cover-content-box.state-1 .cover-notifications {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(42vh - 130px);
}

/* State 2: menu / subview canvas — pinned to top, logo stays at bottom */
.cover-content-box.state-2 {
  max-height: calc(100dvh - 280px);
  margin-bottom: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Notification area ────────────────────────────────────────────────── */
.cover-notifications {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity 0.25s ease, max-height 0.3s ease;
}
.cover-notifications.cover-notifs-hidden {
  opacity: 0;
  max-height: 0;
  padding: 0 16px;
  overflow: hidden;
  pointer-events: none;
}
}

.cover-notif-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  min-height: 32px;
  animation: notifFadeIn 0.3s ease-out;
}

/* Staggered entrance animation for all-at-once rendering */
.cover-notif-item.cover-notif-stagger {
  opacity: 0;
  transform: translateY(8px);
  animation: notifStaggerIn 0.35s ease-out forwards;
}
@keyframes notifStaggerIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.cover-notif-text {
  flex: 1;
  font-size: 0.84rem;
  color: var(--text);
  line-height: 1.35;
  min-width: 0;
  word-break: break-word;
}
/* Typewriter — allow wrapping so text isn't clipped */
.cover-notif-text.typing {
  border-right: 2px solid var(--cover-red);
  animation: typewriterCursor 0.6s step-end infinite;
}
@keyframes typewriterCursor {
  50% { border-color: transparent; }
}

.cover-notif-actions {
  display: flex; gap: 6px; flex-shrink: 0; align-items: center;
}
.cover-notif-check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border); background: transparent;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; padding: 0; font-size: 0.7rem;
  transition: background 0.2s, border-color 0.2s;
}
.cover-notif-check.checked { background: var(--green); border-color: var(--green); color: #fff; }
.cover-notif-dismiss {
  width: 22px; height: 22px; border-radius: 50%;
  background: transparent; border: 1px solid var(--border);
  color: var(--text2); font-size: 0.75rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; padding: 0;
}
.cover-notif-dismiss:active { background: var(--surface2); }

/* ── Pulsating expand arrow — inside cover-red, not content-box ──────── */
.cover-expand-arrow {
  align-self: flex-end;
  margin-right: 28px;
  margin-top: -4px;
  margin-bottom: 4px;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.3s ease;
  flex-shrink: 0;
}
.cover-expand-arrow.visible {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
  animation: pulseArrow 1.2s ease-in-out infinite;
}
@keyframes pulseArrow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

/* ── Cover menu ───────────────────────────────────────────────────────── */
.cover-menu {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, max-height 0.35s ease;
}
.cover-menu.visible {
  opacity: 1;
  max-height: 600px;
  pointer-events: auto;
}
.cover-menu-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 14px 20px;
  font-size: 0.95rem; font-weight: 500;
  color: var(--text); text-align: left;
  border: none; background: none; cursor: pointer;
  transition: background 0.12s;
}
.cover-menu-item:active { background: var(--accent-bg); }
.cover-menu-item.cover-menu-danger { color: #d32f2f; }
.cover-menu-icon { font-size: 1.1rem; width: 24px; text-align: center; flex-shrink: 0; }
.cover-menu-divider { height: 1px; background: var(--border); margin: 4px 16px; }

/* ── Cover sub-view (views opened inside cover) ──────────────────────── */
.cover-subview {
  background: #fff;
  border-radius: 14px;
  z-index: 3;
  padding: 12px 16px;
}
.cover-back-btn {
  font-size: 0.85rem; color: var(--accent-light); font-weight: 600;
  margin-bottom: 10px; padding: 4px 0;
  background: none; border: none; cursor: pointer;
}

/* ── Hamburger handle ─────────────────────────────────────────────────── */
.cover-handle {
  width: 100%;
  height: var(--cover-handle-h);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
.cover-handle:active { cursor: grabbing; }

/* Curved background for handle — transparent sides, only red tab visible */
.cover-handle::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  background: transparent;
}
/* Red fill in the curved tab center */
.cover-handle::after {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--cover-red);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 40' preserveAspectRatio='none'%3E%3Cpath d='M0,0 L170,0 Q200,0 210,20 Q220,40 240,40 Q260,40 270,20 Q280,0 310,0 L480,0 Z' fill='white'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 40' preserveAspectRatio='none'%3E%3Cpath d='M0,0 L170,0 Q200,0 210,20 Q220,40 240,40 Q260,40 270,20 Q280,0 310,0 L480,0 Z' fill='white'/%3E%3C/svg%3E");
  mask-size: 100% 100%; -webkit-mask-size: 100% 100%;
  z-index: -1;
}
.cover-hamburger {
  display: flex; flex-direction: column; gap: 4px;
  align-items: center; z-index: 1; padding: 8px;
}
.cover-hamburger span {
  display: block; width: 22px; height: 2px;
  background: #fff; border-radius: 1px;
  transition: background 0.3s ease;
}

/* Pulsating red notification indicator on hamburger */
.cover-hamburger.has-notifs span {
  animation: hamburgerNotifPulse 1.4s ease-in-out infinite;
}
@keyframes hamburgerNotifPulse {
  0%, 100% { background: #fff; }
  50% { background: #C61919; box-shadow: 0 0 6px rgba(255, 68, 68, 0.6); }
}
@media (hover: hover) {
  .cover-handle:hover { cursor: grab; }
  .cover-handle:hover .cover-hamburger span { background: #ffffffcc; }
}

/* ── Chat feed padding ────────────────────────────────────────────────── */
.chat-feed {
  padding-top: calc(var(--cover-total-collapsed) + 20px) !important;
}
.chat-input-bar {
  padding-bottom: calc(10px + var(--safe-bottom)) !important;
  position: relative; z-index: 1;
}

/* ── Hide old header ──────────────────────────────────────────────────── */
.header { display: none !important; }

/* ── Mention Dropdown ────────────────────────────────────────────────── */
.mention-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  z-index: 1000;
  padding: 4px 0;
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.mention-item:hover,
.mention-item-active {
  background: var(--hover);
}
.mention-icon {
  font-size: 18px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.mention-name {
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
}
.mention-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: auto;
}

/* Mention context chip — no longer used (mention is inline text in textarea) */

/* ── Command Info Modal ──────────────────────────────────────────────── */
.command-info-section {
  text-align: left;
  padding: 4px 0;
}
.command-info-group {
  margin-bottom: 16px;
}
.command-info-heading {
  font-weight: 600;
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.command-info-item {
  font-size: 13px;
  color: var(--text);
  padding: 3px 0;
  line-height: 1.5;
}
.command-info-item code {
  background: var(--hover);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'SF Mono', 'Menlo', monospace;
  color: var(--accent);
}
.command-info-example {
  background: var(--hover);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  font-family: 'SF Mono', 'Menlo', monospace;
  color: var(--text-secondary);
  white-space: pre-line;
  line-height: 1.6;
  margin-top: 6px;
}

/* ── Multi-select popup items ────────────────────────────────────────── */
.multi-select-item {
  display: flex !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.multi-select-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--accent, #C61919);
  cursor: pointer;
}
.multi-select-item input[type="checkbox"]:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ── WhatsApp Chat Import ──────────────────────────────────────────────────── */

.whatsapp-import-modal {
  max-width: 380px;
  width: 90vw;
}

.whatsapp-instructions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}

.whatsapp-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary, #6b6b80);
  line-height: 1.4;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  background: var(--accent, #C61919);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.whatsapp-note {
  font-size: 12px;
  color: var(--text-muted, #999);
  margin: 8px 0;
  padding: 8px 12px;
  background: var(--bg-secondary, #f0f0f3);
  border-radius: 8px;
}

.whatsapp-divider {
  height: 1px;
  background: var(--border, #e0e0e5);
  margin: 12px 0;
}

.whatsapp-or {
  font-size: 13px;
  color: var(--text-secondary, #6b6b80);
  text-align: center;
  margin-bottom: 12px;
}

.whatsapp-open-btn {
  background: #25D366 !important;
  text-decoration: none;
  text-align: center;
}

.whatsapp-processing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 0;
  font-size: 14px;
  color: var(--text-secondary, #6b6b80);
}

.whatsapp-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  font-size: 14px;
  text-align: center;
}

.whatsapp-processing-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted, #999);
}

.whatsapp-shared-info {
  text-align: center;
  padding: 12px 0;
  font-size: 14px;
  color: var(--text-secondary, #6b6b80);
}

.whatsapp-associate {
  margin: 12px 0;
}

.whatsapp-associate label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary, #6b6b80);
  margin-bottom: 6px;
}

.whatsapp-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border, #e0e0e5);
  border-radius: 8px;
  background: var(--bg, #fff);
  color: var(--text-primary, #1a1a2e);
  font-size: 14px;
  appearance: none;
  -webkit-appearance: none;
}

/* WhatsApp import suggestion tile (in chat view) */
.whatsapp-import-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin: 8px 0;
  background: var(--bg, #fff);
  border: 1px solid var(--border, #e0e0e5);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.whatsapp-import-tile:active {
  background: var(--bg-secondary, #f0f0f3);
}

.wa-tile-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.wa-tile-content {
  flex: 1;
  min-width: 0;
}

.wa-tile-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #1a1a2e);
}

.wa-tile-subtitle {
  font-size: 12px;
  color: var(--text-muted, #999);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wa-tile-dismiss {
  background: none;
  border: none;
  color: var(--text-muted, #999);
  font-size: 16px;
  padding: 4px;
  cursor: pointer;
  flex-shrink: 0;
}

/* WhatsApp person picker */
.wa-person-pick-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wa-person-pick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
}

.wa-person-pick-item:active,
.wa-person-pick-item:hover {
  background: var(--bg-secondary, #f0f0f3);
}

.wa-person-pick-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent, #C61919);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.wa-person-pick-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #1a1a2e);
}
