:root {
  /* Clashy soft-clay dark theme */
  --primary: #5b6cff;
  --primary-hover: #4a5bf0;
  --primary-soft: rgba(91, 108, 255, 0.14);
  --bg: #000000;
  --accent: #f0468c;
  --accent-soft: rgba(240, 70, 140, 0.14);
  --gold: #ffc94a;
  --surface: #111113;
  --surface-2: #1c1c1f;
  --text: #f5f5f7;
  --text-muted: #9a9aa6;
  --border: #26262b;
  --danger: #ff453a;
  --success: #30d158;
  --warning-bg: rgba(255, 201, 74, 0.1);
  --warning-border: rgba(255, 201, 74, 0.35);
  --warning-text: #ffc94a;
  --shadow-sm: inset 0 0 0 1px #1c1c21;
  --radius: 22px;
  --header-height: 60px;
  --nav-height: 68px;
  --display: "Readex Pro", system-ui, sans-serif;
  --ui: "Inter", "Readex Pro", system-ui, sans-serif;
  color-scheme: dark;
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden,
[hidden] {
  display: none !important;
}

/* Mobile-first centered shell */
.app-shell {
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  background: #1c1c1f;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.06);
}

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

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.icon-btn .icon {
  width: 22px;
  height: 22px;
}

.status-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--surface);
}

.status-dot.status-saved {
  background: var(--success);
}

.status-dot.status-missing {
  background: var(--danger);
}

/* Main Content */
.app-main {
  flex: 1;
  padding: 16px;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 24px);
}

.screen[hidden] {
  display: none;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.screen:not(.active) {
  display: none;
}

.screen-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.screen-subtitle {
  margin: 6px 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Warning Banner */
.warning-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
}

.warning-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.88rem;
}

.warning-text strong {
  font-size: 0.92rem;
}

.banner-action-btn {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 14px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.banner-action-btn:hover {
  background: var(--primary-hover);
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.hero-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Buttons */
.scan-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  transition: background-color 0.15s ease, transform 0.08s ease, border-color 0.15s ease;
}

.btn:active {
  transform: scale(0.99);
}

.btn-xl {
  min-height: 64px;
  font-size: 1.1rem;
}

.btn-lg {
  min-height: 52px;
}

.btn-emoji {
  font-size: 1.3rem;
  line-height: 1;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: #2c2f55;
}

.btn-secondary:hover {
  background: #232329;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--danger);
  border-color: rgba(240, 70, 140, 0.4);
}

.text-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 8px;
  cursor: pointer;
}

/* Preview Card */
.preview-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.preview-image-wrap {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}

.preview-image {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--bg);
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  text-align: center;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
}

.preview-filename {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  word-break: break-all;
}

/* My Leads Empty State */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
}

.empty-state {
  text-align: center;
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.empty-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.empty-subtitle {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 280px;
}

/* Settings */
.settings-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.98rem;
  font-weight: 600;
}

.form-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.input-group {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.form-input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 108, 255, 0.16);
}

.toggle-visibility-btn {
  min-width: 68px;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #1c1c1f;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.toggle-visibility-btn:hover {
  background: var(--bg);
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-feedback {
  margin: 0;
  min-height: 1.25em;
  font-size: 0.9rem;
  font-weight: 500;
}

.settings-feedback.success {
  color: var(--success);
}

.settings-feedback.error {
  color: var(--danger);
}

.settings-footer {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.external-link {
  color: var(--primary);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
}

.external-link:hover {
  text-decoration: underline;
}

/* Bottom Tab Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  min-height: var(--nav-height);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  z-index: 20;
}

.nav-tab {
  min-height: var(--nav-height);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-tab:hover {
  background: #1c1c1f;
}

.nav-tab.active {
  color: var(--primary);
}

.nav-icon {
  width: 22px;
  height: 22px;
}

/* Review Lead Screen */
.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.review-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.review-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.review-thumbnail {
  width: 76px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.review-summary-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.review-summary-text strong {
  font-size: 0.95rem;
  color: var(--text);
}

.priority-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.priority-btn {
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.priority-btn.active[data-priority="Hot"] {
  background: rgba(240, 70, 140, 0.16);
  border-color: #f0468c;
  color: #ff7aa9;
}

.priority-btn.active[data-priority="Warm"] {
  background: rgba(255, 201, 74, 0.14);
  border-color: #ffc94a;
  color: #ffd77a;
}

.priority-btn.active[data-priority="Cold"] {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-hover);
}

.notes-highlight {
  padding: 12px;
  border-radius: 12px;
  background: var(--primary-soft);
  border: 1.5px solid #3a3f7a;
}

.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  resize: vertical;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 108, 255, 0.16);
}

.review-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 14px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #26262b;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  z-index: 40;
  text-align: center;
}

.toast.toast-error {
  background: var(--danger);
}

.toast.toast-success {
  background: var(--success);
}

/* Scan Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow-sm);
}

.stat-card-hot {
  border-color: rgba(240, 70, 140, 0.4);
  background: #fff8f7;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat-card-hot .stat-value {
  color: var(--danger);
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Nav Badge */
.nav-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-badge {
  position: absolute;
  top: -5px;
  right: -12px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* My Leads Controls & Cards */
.leads-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-pill {
  flex: 1;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.filter-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.leads-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lead-card {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, transform 0.08s ease;
}

.lead-card:hover {
  border-color: var(--primary);
}

.lead-card:active {
  transform: scale(0.99);
}

.lead-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.lead-card-names {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lead-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.lead-card-arabic {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.lead-card-role {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.lead-card-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text);
  background: #1c1c1f;
  padding: 6px 10px;
  border-radius: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lead-card-date {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.priority-pill {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.priority-pill.tag-hot {
  background: rgba(240, 70, 140, 0.16);
  color: #ff7aa9;
}

.priority-pill.tag-warm {
  background: rgba(255, 201, 74, 0.14);
  color: #ffd77a;
}

.priority-pill.tag-cold {
  background: var(--primary-soft);
  color: var(--primary-hover);
}

/* Lead Detail Screen */
.detail-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.detail-thumbnail {
  width: 84px;
  height: 58px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.detail-identity {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.detail-name-arabic {
  margin: 0;
  font-size: 1rem;
  color: var(--text-muted);
}

.detail-role {
  margin: 2px 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.detail-date {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.detail-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #1c1c1f;
}

.detail-row-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.detail-row-value {
  font-size: 0.95rem;
  color: var(--text);
  word-break: break-word;
}

.detail-link {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}

.detail-link:hover {
  text-decoration: underline;
}

.detail-notes-text {
  margin: 4px 0 0;
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.detail-secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.settings-section-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

/* Follow-up Writer Screen */
.followup-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.followup-lead-context {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #1c1c1f;
  border: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.followup-lead-context strong {
  font-size: 0.98rem;
  color: var(--text);
}

.segmented-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.segmented-btn {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.segmented-btn.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.followup-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: var(--primary-soft);
}

.message-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.char-counter {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.char-counter.counter-over {
  color: var(--danger);
}

.followup-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.followup-action-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.btn-whatsapp {
  background: #1e8e3e;
  color: #ffffff;
}

.btn-whatsapp:hover {
  background: #187532;
}

/* My Leads */
.leads-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-group {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-group::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex-shrink: 0;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.filter-chip.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.filter-chip:focus-visible,
.lead-item:focus-visible {
  outline: 3px solid rgba(91, 108, 255, 0.35);
  outline-offset: 2px;
}

.leads-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lead-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-family: inherit;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.08s ease;
}

.lead-item:hover {
  border-color: #3a3f7a;
}

.lead-item:active {
  transform: scale(0.99);
}

.lead-thumb {
  width: 64px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.lead-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.lead-name,
.lead-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-name {
  font-size: 0.98rem;
  font-weight: 600;
}

.lead-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lead-when {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.priority-pill {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 600;
}

.priority-pill[data-priority="Hot"] {
  background: rgba(240, 70, 140, 0.16);
  border-color: rgba(240, 70, 140, 0.4);
  color: #ff7aa9;
}

.priority-pill[data-priority="Warm"] {
  background: rgba(255, 201, 74, 0.14);
  border-color: rgba(255, 201, 74, 0.4);
  color: #ffd77a;
}

.priority-pill[data-priority="Cold"] {
  background: var(--primary-soft);
  border-color: #2c2f55;
  color: var(--primary-hover);
}

.export-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.export-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.export-actions .btn {
  min-height: 48px;
  padding: 10px 12px;
  font-size: 0.92rem;
}

.btn-danger {
  color: var(--danger);
  border-color: rgba(240, 70, 140, 0.4);
}

.btn-danger:hover {
  background: rgba(240, 70, 140, 0.16);
}

/* NFC */
.nfc-status {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.nfc-status:empty {
  display: none;
}

/* Swipe triage */
.swipe-deck {
  position: relative;
  height: min(58dvh, 440px);
  touch-action: none;
}

.swipe-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 6px 22px rgba(60, 64, 67, 0.16);
  overflow: hidden;
  user-select: none;
  transform: scale(0.96) translateY(10px);
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.swipe-card.top {
  transform: none;
  cursor: grab;
}

.swipe-card.top:active {
  cursor: grabbing;
}

.swipe-photo {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  font-size: 4rem;
}

.swipe-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.swipe-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.swipe-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.swipe-role,
.swipe-contact,
.swipe-notes {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.swipe-notes {
  color: var(--text);
}

.swipe-stamp {
  position: absolute;
  top: 22px;
  z-index: 2;
  padding: 4px 14px;
  border: 3px solid currentColor;
  border-radius: 10px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
}

.stamp-hot {
  left: 18px;
  color: var(--danger);
  transform: rotate(-12deg);
}

.stamp-cold {
  right: 18px;
  color: var(--primary);
  transform: rotate(12deg);
}

.stamp-warm {
  left: 50%;
  color: #ffc94a;
  transform: translateX(-50%);
}

.swipe-actions {
  display: flex;
  justify-content: center;
  gap: 22px;
}

.swipe-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 1.6rem;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.swipe-btn:active {
  transform: scale(0.92);
}

.swipe-warm {
  width: 52px;
  height: 52px;
  align-self: center;
  font-size: 1.3rem;
}

.swipe-legend {
  margin: 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* My Card */
.me-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.me-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.me-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.me-ident {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.me-ident strong {
  font-size: 1.15rem;
}

.me-ident span {
  font-size: 0.88rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.me-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Onboarding */
.onboarding {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(32, 33, 36, 0.55);
}

.onb-panel {
  width: 100%;
  max-width: 480px;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: onb-up 0.28s ease;
}

@keyframes onb-up {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}

.onb-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.onb-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  transition: width 0.2s ease, background-color 0.2s ease;
}

.onb-dots span.active {
  width: 22px;
  background: var(--primary);
}

.onb-step {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.onb-hero {
  font-size: 3.4rem;
  text-align: center;
  line-height: 1.1;
}

.onb-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
}

.onb-text,
.onb-note {
  margin: 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.onb-note {
  font-size: 0.85rem;
}

.onb-note:empty {
  display: none;
}

.google-slot {
  display: flex;
  justify-content: center;
  min-height: 0;
}

@media (prefers-reduced-motion: reduce) {
  .onb-panel,
  .swipe-card {
    animation: none;
    transition: none;
  }
}

/* Icon-only bottom tabs: labels stay for screen readers. */
.nav-tab > span:not(.nav-icon-wrap) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.nav-tab .nav-icon {
  width: 26px;
  height: 26px;
}

.nav-tab {
  position: relative;
}

.nav-tab.active::after {
  content: "";
  position: absolute;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px) * 0);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.brand-mark {
  background: linear-gradient(135deg, var(--primary), var(--accent)) !important;
}

.btn-primary {
  background: linear-gradient(135deg, #5b6cff 0%, #7a86ff 60%, #8e9aff 100%);
  box-shadow: 0 6px 16px rgba(91, 108, 255, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4a5bf0 0%, #6f7cff 100%);
}

/* Language picker */
.lang-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.lang-btn {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.lang-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

[dir="rtl"] .lead-item,
[dir="rtl"] .review-summary-text,
[dir="rtl"] .me-ident {
  text-align: right;
}

/* Onboarding mascot */
.onb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.onb-mascot {
  display: block;
  width: 200px;
  height: 200px;
  margin: -6px auto -10px;
  object-fit: contain;
  animation: saqr-bounce 1.6s ease-in-out infinite;
}

.onb-mascot-sm {
  width: 120px;
  height: 120px;
}

.onb-mascot-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  line-height: 1;
}

.onb-mascot-sm.onb-mascot-emoji {
  font-size: 4rem;
}

@keyframes saqr-bounce {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-10px) rotate(3deg); }
}

.onb-bubble {
  position: relative;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
  border: 1.5px solid #2c2f55;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.onb-bubble::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 16px;
  height: 16px;
  background: var(--primary-soft);
  border-left: 1.5px solid #2c2f55;
  border-top: 1.5px solid #2c2f55;
  transform: translateX(-50%) rotate(45deg);
}

.swipe-actions.people-mode .swipe-warm {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .onb-mascot {
    animation: none;
  }
}

/* Clashy clay: display type, darker inputs, glowing primary */
.app-title,
.screen-title,
.onb-title,
.swipe-name,
.empty-title {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.form-input,
.form-textarea,
.toggle-visibility-btn,
.priority-btn,
.filter-chip,
.lang-btn,
.swipe-btn {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.app-header,
.bottom-nav {
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: #1d1d22;
}

.btn-primary {
  background: var(--primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 14px 34px -14px rgba(91, 108, 255, 0.9);
}

.btn-primary:hover {
  background: #6b7aff;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: transparent;
  box-shadow: inset 0 0 0 1px #2a2a31;
}

.btn-secondary:hover {
  background: #232329;
}

.brand-mark {
  background: linear-gradient(135deg, var(--primary), var(--accent)) !important;
}

.nav-tab.active {
  color: var(--text);
}

.nav-tab.active::after {
  background: var(--gold);
}

.nav-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: saturate(0.2) brightness(0.65);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.nav-tab.active .nav-img {
  filter: none;
  transform: translateY(-2px) scale(1.06);
}

.onb-panel {
  background: #0e0e11;
  box-shadow: inset 0 1px 0 #1c1c21;
}

.onb-bubble {
  background: radial-gradient(120% 90% at 50% 0%, rgba(91, 108, 255, 0.22), transparent 70%), var(--surface-2);
  border-color: #2c2f55;
}

.onb-bubble::before {
  background: #23264a;
  border-color: #2c2f55;
}

.swipe-card {
  background: #0e0e11;
  box-shadow: inset 0 0 0 1.5px #2c2f55, 0 40px 70px -40px rgba(91, 108, 255, 0.7);
}

.swipe-photo {
  background: radial-gradient(90% 60% at 50% 40%, rgba(91, 108, 255, 0.34), transparent 72%), #0e0e11;
}

.swipe-stamp {
  background: rgba(0, 0, 0, 0.6);
}

.stamp-cold {
  color: var(--primary);
}

.stamp-warm {
  color: var(--gold);
}

.hero-card {
  background: radial-gradient(90% 55% at 50% 0%, rgba(91, 108, 255, 0.22), transparent 70%), var(--surface);
}

.toast.toast-success {
  background: #1f8a3c;
}

.empty-art {
  width: 120px;
  height: 120px;
  object-fit: contain;
}

body {
  background: #000;
}

.btn-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.empty-art {
  margin-bottom: -4px;
}

/* Brand */
.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
}

.brand-wordmark {
  display: block;
  height: 40px;
  width: auto;
}

.app-title {
  line-height: 0;
}

/* Saqr: 16-frame clay animation (one sprite strip, CSS steps) */
.saqr-anim {
  width: 200px;
  height: 200px;
  margin: -6px auto -10px;
  background: url("assets/anim/saqr-catch-strip.webp") 0 0 / 1600% 100% no-repeat;
  animation: saqr-frames 1.25s steps(15) infinite alternate;
}

.saqr-anim.onb-mascot {
  animation: saqr-frames 1.25s steps(15) infinite alternate;
}

.saqr-anim-sm {
  width: 120px;
  height: 120px;
  margin: 0 auto;
}

@keyframes saqr-frames {
  from { background-position: 0% 0; }
  to { background-position: 100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .saqr-anim,
  .saqr-anim.onb-mascot {
    animation: none;
  }
}

.google-btn {
  background: #ffffff;
  color: #1f1f1f;
  border-color: transparent;
  box-shadow: 0 10px 28px -14px rgba(255, 255, 255, 0.5);
}

.google-btn:hover {
  background: #f2f2f2;
}

.google-slot {
  flex-direction: column;
}

.nav-icon-wrap {
  position: relative;
  display: inline-flex;
}

/* His light surfaces → dark clay */
.app-shell { background: #000000; }
.card, .lead-card, .detail-card, .review-card, .settings-card { background: var(--surface); }

/* Merge fixes: four icon tabs in one row; dark stat cards */
.bottom-nav {
  grid-template-columns: repeat(4, 1fr) !important;
}

.stat-card,
.stat-card-hot {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

.stat-card-hot {
  background: radial-gradient(120% 120% at 0% 0%, rgba(240, 70, 140, 0.22), transparent 60%), var(--surface) !important;
  border-color: rgba(240, 70, 140, 0.45) !important;
}

.stat-card-hot .stat-value {
  color: #ff7aa9 !important;
}

.nav-tab:hover,
.nav-tab.active {
  background: transparent !important;
}

.btn-contest {
  background: linear-gradient(135deg, #ffc94a, #f0468c);
  color: #1a1020;
  font-weight: 700;
  box-shadow: 0 14px 34px -14px rgba(240, 70, 140, 0.8);
}

.quick-key {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}
