﻿/* ═══════════════════════════════════════════════════════
   scanner.css — Pyng Scanner page styles
   Requires: tokens.css loaded first
═══════════════════════════════════════════════════════ */

/* ── Body / App Shell ── */
html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--canvas-dark);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0,0,0,0.5);
}

/* ── NAV BAR ── */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  z-index: 40;
  min-height: 56px;
  position: relative;
}
.nav-logo {
  font-size: 22px;
  font-weight: var(--weight-medium);
  color: var(--ink);
  letter-spacing: -0.01em;
  text-decoration: none;
  position: absolute;
  left: 16px;
}
.nav-logo em {
  font-style: italic;
  color: var(--gold);
}
.nav-back-btn {
  position: absolute;
  left: 16px;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-md);
  background: var(--paper);
  cursor: pointer;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.nav-back-btn:hover { background: var(--paper-2); }
.nav-back-btn:active { background: var(--paper-2); transform: scale(0.96); }
.nav-back-btn svg { width: 18px; height: 18px; stroke: var(--ink-2); }
.nav-step-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: center;
}
.nav-placeholder { width: 36px; }
.nav-queue-btn {
  position: absolute;
  right: 16px;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-md);
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; color: var(--ink-2);
  transition: background 0.15s;
  flex-shrink: 0;
}
.nav-queue-btn:hover { background: var(--paper-2); }
.nav-queue-count {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 16px; height: 16px;
  background: var(--gold);
  color: #fff;
  font-size: 10px; font-weight: var(--weight-semibold);
  border-radius: 8px;
  padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

/* ── SCREEN STACK ── */
.screen-stack {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  transform: translateX(30px);
  will-change: opacity, transform;
}
.screen.active {
  opacity: 1;
  pointer-events: all;
  z-index: 10;
  transform: translateX(0);
}
.screen.slide-out-left {
  opacity: 0;
  transform: translateX(-30px);
}

/* ══════════════════════════════════
   CAMERA — MODE PILLS (top bar)
══════════════════════════════════ */
.camera-mode-pills {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 8;
}
.mode-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,0.75);
  font-family: 'Instrument Sans', sans-serif;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all 0.2s;
}
.mode-pill svg { width: 15px; height: 15px; stroke: currentColor; fill: none; flex-shrink: 0; }
.mode-pill:hover { border-color: rgba(255,255,255,0.55); color: #fff; }
.mode-pill.active { border-color: var(--gold); color: var(--gold-dark); background: rgba(184,154,106,0.18); }

/* Card-detected border glow */
.vf-corner { transition: border-color 0.2s ease; }
.viewfinder-frame.detected .vf-corner { border-color: #4ade80; box-shadow: 0 0 6px #4ade8088; }
.viewfinder-frame.detected .vf-corner::before { border-color: #4ade80; }

/* Snap button transition */
.btn-capture { transition: border-color 0.15s, transform 0.1s, opacity 0.4s; }
.btn-capture.hidden-snap { opacity: 0; pointer-events: none; }

/* Desktop unavailable overlay */
#desktop-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(14,14,12,0.88);
  z-index: 20;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: rgba(255,255,255,0.7);
  font-size: 15px;
  text-align: center;
  padding: 32px;
}
#desktop-overlay svg { width: 56px; height: 56px; stroke: rgba(255,255,255,0.35); fill: none; }
#desktop-overlay .dov-title { font-size: 18px; font-weight: var(--weight-semibold); color: rgba(255,255,255,0.85); }
#desktop-overlay .dov-sub { font-size: var(--text-base); color: rgba(255,255,255,0.45); max-width: 280px; line-height: 1.6; text-align: center; }

/* Desktop mode — Upload + manual entry float above overlay, styled gold */
#screen-camera.desktop-mode .camera-controls {
  position: relative;
  z-index: 25;
}
#screen-camera.desktop-mode .btn-manual-entry {
  position: relative;
  z-index: 25;
  color: var(--gold-dark);
}
#screen-camera.desktop-mode .btn-camera-action {
  color: var(--gold-dark);
}
#screen-camera.desktop-mode .btn-camera-action svg {
  stroke: var(--gold);
}

/* Voice recording panel (bottom sheet) */
#voice-panel {
  display: none;
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(14,14,12,0.96);
  backdrop-filter: blur(12px);
  border-radius: 20px 20px 0 0;
  padding: 24px 24px max(24px, env(safe-area-inset-bottom));
  z-index: 10;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
#voice-panel.open { display: flex; }
.voice-panel-handle {
  width: 36px; height: 4px;
  background: rgba(255,255,255,0.18);
  border-radius: 2px;
  margin-bottom: 4px;
}
.voice-panel-title {
  font-size: 15px; font-weight: var(--weight-semibold); color: #fff;
}
.voice-panel-hint {
  font-size: var(--text-sm); color: rgba(255,255,255,0.5);
  text-align: center; line-height: 1.5;
}
.voice-prompt-chips {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.voice-chip {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 5px 10px;
}
.voice-mic-btn {
  width: 64px; height: 64px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.08);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.voice-mic-btn svg { width: 28px; height: 28px; stroke: currentColor; fill: none; }
.voice-mic-btn:hover { border-color: var(--gold); }
.voice-mic-btn.recording {
  border-color: #ef4444;
  background: rgba(239,68,68,0.15);
  animation: voice-pulse 1s ease-in-out infinite;
}
@keyframes voice-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); } 50% { box-shadow: 0 0 0 12px rgba(239,68,68,0); } }
.voice-status {
  font-size: var(--text-sm); color: rgba(255,255,255,0.6); min-height: 18px; text-align: center;
}
.voice-panel-close {
  font-size: var(--text-base); color: rgba(255,255,255,0.4);
  background: none; border: none; cursor: pointer; padding: 4px 8px;
}

/* NFC sheet (bottom sheet) */
#nfc-sheet {
  display: none;
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(14,14,12,0.96);
  backdrop-filter: blur(12px);
  border-radius: 20px 20px 0 0;
  padding: 24px 24px max(24px, env(safe-area-inset-bottom));
  z-index: 10;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
#nfc-sheet.open { display: flex; }
.nfc-sheet-title { font-size: 15px; font-weight: var(--weight-semibold); color: #fff; }
.nfc-sheet-body { font-size: var(--text-base); color: rgba(255,255,255,0.55); text-align: center; line-height: 1.6; max-width: 280px; }
.nfc-sheet-status { font-size: var(--text-base); color: rgba(255,255,255,0.6); min-height: 18px; }
.nfc-sheet-close {
  font-size: var(--text-base); color: rgba(255,255,255,0.4);
  background: none; border: none; cursor: pointer; padding: 4px 8px;
}
.nfc-wave-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  animation: nfc-ring 1.8s ease-in-out infinite;
}
.nfc-wave-icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; }
@keyframes nfc-ring { 0%,100% { box-shadow: 0 0 0 0 rgba(184,154,106,0.4); } 60% { box-shadow: 0 0 0 14px rgba(184,154,106,0); } }

/* ══════════════════════════════════
   SCREEN 1 — CAMERA
══════════════════════════════════ */
#screen-camera {
  background: #000;
}
#video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.camera-ui {
  position: absolute;
  inset: 0;
}
.viewfinder-hint {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.75);
  font-size: var(--text-base);
  text-align: center;
  white-space: nowrap;
  background: rgba(0,0,0,0.35);
  padding: 6px 14px;
  border-radius: 20px;
}
.viewfinder-frame {
  position: absolute;
  top: 140px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 320px;
  aspect-ratio: 85/55;
  pointer-events: none;
}
.vf-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255,255,255,0.8);
}
.vf-corner-tl { top: 0; left: 0; border-right: none; border-bottom: none; border-top-left-radius: 4px; }
.vf-corner-tr { top: 0; right: 0; border-left: none; border-bottom: none; border-top-right-radius: 4px; }
.vf-corner-bl { bottom: 0; left: 0; border-right: none; border-top: none; border-bottom-left-radius: 4px; }
.vf-corner-br { bottom: 0; right: 0; border-left: none; border-top: none; border-bottom-right-radius: 4px; }
.scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
  top: 0;
  animation: scanSweep 2.4s ease-in-out infinite;
}
@keyframes scanSweep {
  0%   { top: 0%; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
.camera-controls {
  position: absolute;
  bottom: 80px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.camera-secondary-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}
.camera-secondary-actions .btn-icon-only {
  width: 48px;
  height: auto;
  padding: 0;
  background: transparent;
  color: rgba(255,255,255,0.65);
  flex-direction: column;
  gap: 4px;
}
.camera-secondary-actions .btn-icon-only:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
}
.camera-secondary-actions .btn-icon-only svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}
.camera-secondary-actions .btn-icon-only span {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  font-family: 'Instrument Sans', sans-serif;
}
@media (max-width: 480px) {
  .camera-secondary-actions {
    gap: 12px;
    padding: 0 12px;
  }
}
.btn-manual-entry {
  margin-top: 16px;
  font-size: var(--text-base);
  font-family: 'Instrument Sans', sans-serif;
  color: rgba(255,255,255,0.6);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px 8px;
}
.btn-manual-entry:hover { color: rgba(255,255,255,0.9); }
/* Override .btn-secondary white box for camera manual entry */
#btn-manual-entry {
  position: absolute;
  bottom: 36px;
  left: 0;
  right: 0;
  text-align: center;
  background: transparent !important;
  border: none !important;
  color: rgba(255,255,255,0.6) !important;
  padding: 4px 8px;
  font-size: var(--text-base);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-capture {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.5);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, transform 0.1s;
}
.btn-capture:hover { border-color: rgba(255,255,255,0.85); }
.btn-capture:active { transform: scale(0.93); }
.btn-capture-inner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
}
.btn-camera-action {
  color: rgba(255,255,255,0.65);
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Instrument Sans', sans-serif;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
  width: 48px;
}
.btn-camera-action:hover { color: rgba(255,255,255,0.95); }
.btn-camera-action svg { width: 18px; height: 18px; stroke: currentColor; fill: none; }
#camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #111;
  color: rgba(255,255,255,0.4);
  font-size: var(--text-md);
  text-align: center;
  padding: 24px;
}
#camera-placeholder svg { width: 48px; height: 48px; opacity: 0.4; }
#file-input { display: none; }

/* ══════════════════════════════════
   SCREEN 2 — PROCESSING
══════════════════════════════════ */
#screen-processing {
  background: var(--paper);
  align-items: center;
  justify-content: center;
  gap: 0;
}
.processing-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px 32px;
}
.processing-preview-img {
  width: 160px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--r);
  opacity: 0.85;
  display: none;
}
.spinner-ring {
  width: 52px;
  height: 52px;
  border: 3px solid var(--paper-2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.processing-title {
  font-size: 18px;
  font-weight: var(--weight-semibold);
  color: var(--ink);
  text-align: center;
}
.processing-subtitle {
  font-size: var(--text-base);
  color: var(--ink-3);
  text-align: center;
}
.processing-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 200px;
}
.p-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-base);
  color: var(--ink-3);
  transition: color 0.3s;
}
.p-step.done { color: var(--success); }
.p-step.active { color: var(--ink); font-weight: var(--weight-medium); }
.p-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--paper-2);
  flex-shrink: 0;
  transition: background 0.3s;
}
.p-step.done  .p-step-dot { background: var(--success); }
.p-step.active .p-step-dot { background: var(--gold); animation: pulse-dot 1s ease-in-out infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ══════════════════════════════════
   SCREEN 3 — REVIEW & EDIT
══════════════════════════════════ */
#screen-review {
  background: var(--paper);
  overflow: hidden;
}
.review-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Card image thumbnail */
.review-card-img-wrap {
  flex-shrink: 0;
  padding: 16px 16px 0;
}
.review-card-img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: var(--r);
  display: block;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  background: var(--paper);
}
.review-card-img-placeholder {
  width: 100%;
  height: 110px;
  background: var(--paper-2);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-size: var(--text-sm);
  gap: 6px;
  border: 1px dashed var(--border-md);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.review-card-img-placeholder:hover {
  background: var(--paper);
  border-color: var(--gold);
  color: var(--ink-2);
}
.review-card-img-placeholder:hover .ph-hint { color: var(--gold-dark); }
.ph-hint {
  font-size: var(--text-xs);
  color: var(--ink-3);
  font-weight: var(--weight-medium);
  letter-spacing: 0.04em;
}

/* Duplicate warning */
.duplicate-banner {
  margin: 12px 16px 0;
  background: #fff8e6;
  border: 1px solid #f0d070;
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: var(--text-base);
  color: #7a5c00;
  display: none;
  flex-direction: column;
  gap: 10px;
}
.duplicate-banner.visible { display: flex; }
.duplicate-banner-top { display: flex; gap: 8px; align-items: flex-start; }
.duplicate-banner-actions { display: flex; gap: 8px; }
.dup-btn {
  font-size: var(--text-sm); font-weight: var(--weight-medium); font-family: 'Instrument Sans', sans-serif;
  padding: 5px 12px; border-radius: 5px; cursor: pointer; border: 1px solid;
  transition: all 0.15s;
}
.dup-btn-view { background: #fff; border-color: #f0d070; color: #7a5c00; }
.dup-btn-view:hover { background: #fef3c7; }
.dup-btn-anyway { background: transparent; border-color: transparent; color: #9a7a20; text-decoration: underline; }
.dup-btn-anyway:hover { color: #7a5c00; }

/* Confidence badge */
.confidence-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 0;
}
.conf-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  padding: 3px 8px;
  border-radius: 20px;
}
.conf-badge.high   { background: var(--success-bg); color: var(--success); }
.conf-badge.medium { background: #fff8e6; color: #7a5c00; }
.conf-badge.low    { background: var(--error-bg); color: var(--error); }
.conf-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.conf-note { font-size: var(--text-sm); color: var(--ink-3); }
/* Fields */
.review-fields {
  padding: 12px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.field-row {
  display: flex;
  gap: 8px;
}
.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.field-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.field-conf-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.field-conf-dot.high   { background: var(--success); }
.field-conf-dot.medium { background: #d4a017; }
.field-conf-dot.low    { background: var(--error); }
.scan-field-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-family: 'Instrument Sans', sans-serif;
  font-size: var(--text-base);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.scan-field-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.scan-field-input.edited {
  border-color: var(--gold);
  background: #fdfaf5;
}
.scan-field-input.low-conf {
  border-color: rgba(192,57,43,0.3);
  background: #fffafa;
}

/* Field header row — aligns label left, button right */
.field-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

/* Swap name button — small version */
.btn-swap-small {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: none;
  border: 1px solid var(--border-md);
  border-radius: 5px;
  padding: 4px 6px;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  font-family: 'Instrument Sans', sans-serif;
  color: var(--ink-3);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-swap-small:hover { border-color: var(--gold); color: var(--gold-dark); background: var(--gold-dim); }
.btn-swap-small svg { flex-shrink: 0; width: 16px; height: 16px; }

/* MORE dropdown */
.more-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  cursor: pointer;
  font-family: 'Instrument Sans', sans-serif;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--ink-2);
  text-align: left;
  transition: color 0.15s;
}
.more-toggle:hover { color: var(--ink); }
.more-toggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  transition: transform 0.25s;
  flex-shrink: 0;
}
.more-toggle.open svg { transform: rotate(180deg); }
.more-toggle-count {
  margin-left: auto;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--ink-3);
  background: var(--paper-2);
  padding: 2px 7px;
  border-radius: 20px;
}
.more-fields {
  display: none;
  padding: 4px 16px 12px;
  flex-direction: column;
  gap: 10px;
}
.more-fields.open { display: flex; }

/* Notes */
.notes-section {
  padding: 0 16px 12px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.notes-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 8px;
}
.notes-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.btn-voice-note {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border-md);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: var(--text-sm);
  font-family: 'Instrument Sans', sans-serif;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-voice-note svg { width: 13px; height: 13px; stroke: currentColor; fill: none; }
.btn-voice-note:hover { background: var(--paper); border-color: var(--gold); color: var(--gold-dark); }
.btn-voice-note.recording { background: var(--error-bg); border-color: var(--error); color: var(--error); animation: pulse-record 1s ease-in-out infinite; }

/* Voice icon button — small microphone only */
.btn-voice-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: none;
  border: 1px solid var(--border-md);
  border-radius: 5px;
  padding: 4px 6px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-voice-icon svg { width: 18px; height: 18px; stroke: var(--ink-2); fill: none; }
.btn-voice-icon:hover { background: var(--paper); border-color: var(--gold); color: var(--gold); }
.btn-voice-icon svg:hover { stroke: var(--gold); }
.btn-voice-icon.recording { background: var(--error-bg); border-color: var(--error); }
.btn-voice-icon.recording svg { stroke: var(--error); animation: pulse-record 1s ease-in-out infinite; }
@keyframes pulse-record { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
#notes-input {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-family: 'Instrument Sans', sans-serif;
  font-size: var(--text-md);
  color: var(--ink);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#notes-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

/* Action bar */
.review-actions {
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

/* ── Sender strip ── */
.sender-strip {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--paper-2);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-sm);
  color: var(--ink-3);
}
.sender-strip-icon {
  font-size: var(--text-md);
  flex-shrink: 0;
}
.sender-strip-info {
  flex: 1;
  min-width: 0;
}
.sender-strip-label {
  font-size: 10px;
  font-weight: var(--weight-medium);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 1px;
}
.sender-strip-value {
  font-size: var(--text-sm);
  color: var(--ink);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-not-me {
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-family: 'Instrument Sans', sans-serif;
  color: var(--ink-3);
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-not-me:hover { color: var(--ink); background: var(--border); }

/* Auth-locked toggle row */
.sync-inline-row.auth-locked { opacity: 0.4; pointer-events: none; }
.sync-locked-hint {
  font-size: var(--text-xs);
  color: var(--ink-3);
  margin-top: -6px;
  padding: 0 16px 4px 48px;
}

/* Not-logged-in state */
.sender-auth-nudge {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border);
  background: var(--paper-2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sender-nudge-label {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--ink);
  line-height: 1.4;
}
.sender-nudge-label span { color: var(--gold-dark); font-weight: var(--weight-semibold); }
.sender-nudge-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sender-nudge-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sender-nudge-row-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--ink-3);
  width: 78px;
  flex-shrink: 0;
}
.sender-nudge-input {
  flex: 1;
  height: 34px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: var(--text-base);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
.sender-nudge-input:focus { border-color: var(--gold); }
.sender-nudge-input::placeholder { color: var(--ink-3); }
.sender-auth-btns {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.sender-auth-btns a {
  flex: 1;
  padding: 9px 12px;
  text-align: center;
  border-radius: 8px;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  cursor: pointer;
}
.sender-auth-btns .btn-signup {
  background: var(--ink);
  color: var(--surface);
}
.sender-auth-btns .btn-login {
  background: var(--paper);
  color: var(--ink-2);
  border: 1px solid var(--border-md);
}

/* Shared action buttons */
.btn-primary {
  flex: 1;
  padding: 13px 16px;
  background: var(--ink);
  color: var(--surface);
  border: none;
  border-radius: var(--r-sm);
  font-family: 'Instrument Sans', sans-serif;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-primary:hover { background: #1e1e1c; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.gold { background: var(--gold); }
.btn-primary.gold:hover { background: #a8895a; }
.btn-primary.gold:disabled { background: #4a4535; color: rgba(255,255,255,0.35); cursor: not-allowed; transform: none; }
.btn-secondary {
  padding: 13px 14px;
  background: var(--paper);
  color: var(--ink-2);
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  font-family: 'Instrument Sans', sans-serif;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn-secondary:hover { background: var(--paper-2); }
.btn-secondary:active { transform: scale(0.98); }
.btn-secondary svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }
#btn-queue { flex: 1; justify-content: center; }
#btn-sync  { flex: 2; }

/* ══════════════════════════════════
   SCREEN 4 — EMAIL COMPOSE
══════════════════════════════════ */
#screen-email {
  background: var(--paper);
  overflow: hidden;
}
.email-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}
.email-recipient-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.email-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--gold);
  flex-shrink: 0;
}
.email-recipient-name { font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--ink); }
.email-recipient-addr { font-size: var(--text-sm); color: var(--ink-3); }
.email-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.email-field-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.email-field-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-family: 'Instrument Sans', sans-serif;
  font-size: var(--text-md);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.email-field-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
#email-body-input {
  min-height: 180px;
  resize: vertical;
}
.email-actions {
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  display: flex;
  gap: 8px;
}

/* ══════════════════════════════════
   SCREEN 5 — SUCCESS
══════════════════════════════════ */
#screen-success {
  background: var(--paper);
  overflow-y: auto;
}
.success-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px 48px;
  gap: 20px;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}
.success-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  width: 100%;
}
.success-icon {
  width: 64px;
  height: 64px;
  background: var(--success-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.success-icon svg { width: 32px; height: 32px; stroke: var(--success); fill: none; stroke-width: 2; }
.success-title { font-size: 22px; font-weight: var(--weight-semibold); color: var(--ink); }
.success-subtitle { font-size: var(--text-md); color: var(--ink-3); line-height: 1.5; }
.success-name { font-weight: var(--weight-semibold); color: var(--ink); }

/* Viral nudge bar */
.success-nudge {
  width: 100%;
  background: rgba(184,154,106,0.08);
  border: 1px solid rgba(184,154,106,0.25);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: var(--text-sm);
  color: var(--ink-2);
  line-height: 1.5;
  text-align: center;
}
.success-nudge strong { color: var(--gold-dark); font-weight: var(--weight-semibold); }

/* Success card preview */
.success-card-preview-wrap {
  padding: 16px;
  margin-top: 8px;
}
.success-card-preview {
  background: #f9f7f3;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

/* Trial CTA card */
.trial-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: 14px;
  padding: 20px;
}
.trial-card-label {
  font-size: 10px; font-weight: var(--weight-semibold); letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold-dark); margin-bottom: 8px;
}
.trial-card-title {
  font-size: 17px; font-weight: var(--weight-semibold); color: var(--ink); margin-bottom: 4px;
}
.trial-card-sub {
  font-size: var(--text-sm); color: var(--ink-3); line-height: 1.5; margin-bottom: 16px;
}
.trial-features {
  display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px;
}
.trial-feature {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--text-base); color: var(--ink-2);
}
.trial-feature-check {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--success-bg); color: var(--success);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: var(--weight-semibold); flex-shrink: 0;
}
.trial-divider {
  height: 1px; background: var(--border); margin: 12px 0;
}
.trial-pro-label {
  font-size: 10px; font-weight: var(--weight-semibold); letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 7px;
}
.trial-feature.coming { color: var(--ink-3); }
.trial-feature-soon {
  font-size: 10px; color: var(--ink-3); background: var(--paper-2);
  border-radius: 4px; padding: 1px 5px; margin-left: auto;
}
.btn-trial {
  width: 100%; height: 48px; background: var(--ink); color: var(--paper);
  border: none; border-radius: var(--r-sm); font-family: inherit;
  font-size: var(--text-md); font-weight: var(--weight-semibold); cursor: pointer;
  text-decoration: none; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.btn-trial:hover { background: #1e1e1a; }
.success-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  align-items: center;
}
.success-contact-summary {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
}
.success-summary-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-base);
  color: var(--ink-2);
  line-height: 1.3;
}
.success-summary-row svg { flex-shrink: 0; }

/* ── INLINE SYNC SECTION ── */
.sync-inline-section {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-bottom: 4px;
}
.sync-inline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 6px;
}
.sync-inline-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ── i-button tooltip ── */
.sync-title-group { display: flex; align-items: center; gap: 6px; }
.btn-info-tip {
  display: flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-4);
  background: none;
  color: var(--ink-4);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  font-style: italic;
  font-family: Georgia, serif;
  cursor: default;
  position: relative;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}
.btn-info-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  font-style: normal;
  font-family: 'Instrument Sans', sans-serif;
  letter-spacing: 0;
  text-transform: none;
  white-space: pre-line;
  width: 220px;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.5;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 200;
}
.btn-info-tip:hover::after,
.btn-info-tip:focus::after { opacity: 1; }

/* ── Social media grid rows ── */
.social-field-row {
  display: grid;
  grid-template-columns: 68px 1fr;
  align-items: center;
  gap: 8px;
}
.social-field-label {
  font-size: var(--text-xs);
  color: var(--ink-3);
  font-weight: var(--weight-regular);
  white-space: nowrap;
}

.btn-sync-settings {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border-md);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  font-family: 'Instrument Sans', sans-serif;
  color: var(--ink-3);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-sync-settings:hover { border-color: var(--gold); color: var(--gold-dark); }

.sync-inline-row-wrap { display: flex; flex-direction: column; }
.sync-inline-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
}
.sync-inline-row:hover { background: var(--paper); }

/* Intro expand toggle button */
.btn-edit-intro {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 0 16px 8px 62px;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  font-family: 'Instrument Sans', sans-serif;
  color: var(--gold-dark);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: color 0.15s;
}
.btn-edit-intro:hover { color: #a8895a; }
.btn-edit-intro svg { transition: transform 0.25s; flex-shrink: 0; stroke: currentColor; }
.btn-edit-intro[aria-expanded="true"] svg { transform: rotate(180deg); }

/* Intro expand panel */
.intro-expand {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 4px 16px 14px 16px;
  background: var(--paper);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.intro-expand.open { display: flex; }
.intro-field-group { display: flex; flex-direction: column; gap: 4px; }
.intro-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 8px;
}
.intro-input, .intro-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-family: 'Instrument Sans', sans-serif;
  font-size: var(--text-base);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.intro-input:focus, .intro-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.intro-textarea { resize: vertical; min-height: 100px; line-height: 1.5; }

/* ── ACTION SHEET ── */
.sheet-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease;
}
.sheet-backdrop.show { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.action-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  z-index: 101;
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  box-shadow: 0 -8px 40px rgba(0,0,0,0.2);
}
.action-sheet.show { transform: translateX(-50%) translateY(0); }

.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--paper-2);
  border-radius: 2px;
  margin: 12px auto 0;
}
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.sheet-title { font-size: 17px; font-weight: var(--weight-semibold); color: var(--ink); }
.sheet-subtitle { font-size: var(--text-sm); color: var(--ink-3); margin-top: 2px; }

.btn-sheet-settings, .btn-sheet-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-md);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.btn-sheet-settings:hover, .btn-sheet-close:hover { background: var(--paper-2); }
.btn-sheet-settings svg, .btn-sheet-close svg { stroke: var(--ink-2); }

/* Sync options list */
.sync-options { padding: 8px 0; }
.sync-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background 0.1s;
}
.sync-option:hover { background: var(--paper); }
.sync-option-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sync-option-icon.crm      { background: #e8f4fd; color: #2980b9; }
.sync-option-icon.email    { background: #fef9e7; color: #d4ac0d; }
.sync-option-icon.whatsapp { background: #e8f8f0; color: #25d366; }
.sync-option-icon.phone    { background: #f4eef8; color: #8e44ad; }
.sync-option-info { flex: 1; min-width: 0; }
.sync-option-label { font-size: var(--text-md); font-weight: var(--weight-medium); color: var(--ink); }
.sync-option-desc  { font-size: var(--text-sm); color: var(--ink-3); margin-top: 1px; }

/* Toggle switch */
.toggle-wrap { position: relative; flex-shrink: 0; }
.toggle-wrap input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}
.toggle-track {
  display: block;
  width: 44px;
  height: 26px;
  background: var(--paper-2);
  border-radius: 13px;
  position: relative;
  transition: background 0.2s;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s cubic-bezier(0.34,1.2,0.64,1);
}
.toggle-wrap input:checked ~ .toggle-track { background: var(--gold); }
.toggle-wrap input:checked ~ .toggle-track::after { transform: translateX(18px); }

.sheet-actions {
  display: flex;
  gap: 8px;
  padding: 12px 20px 4px;
  border-top: 1px solid var(--border);
}

/* Settings sheet extras */
.settings-sheet { z-index: 102; }

/* Queue sheet */
.queue-sheet { z-index: 102; }
.queue-sheet-body {
  overflow-y: auto;
  max-height: 50vh;
  padding: 8px 0;
}
.queue-sheet-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: var(--text-md);
}
.queue-sheet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}
.queue-sheet-item:last-child { border-bottom: none; }
.queue-sheet-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gold-dim);
  color: var(--gold);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.queue-sheet-info { flex: 1; min-width: 0; }
.queue-sheet-name { font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-sheet-meta { font-size: var(--text-sm); color: var(--ink-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-sheet-del {
  background: none; border: none; padding: 6px;
  color: var(--ink-4); cursor: pointer; border-radius: 6px;
  display: flex; align-items: center; transition: color 0.15s;
}
.queue-sheet-del:hover { color: var(--error); }
.queue-sheet-full-link {
  display: block; text-align: center; text-decoration: none;
  font-size: var(--text-md); font-weight: var(--weight-semibold);
}
.settings-body { padding: 4px 0; }
.settings-note {
  font-size: var(--text-base);
  color: var(--ink-3);
  line-height: 1.5;
  padding: 12px 20px 4px;
}

/* ── OTP MODAL ── */
.otp-overlay {
  position: fixed; inset: 0; background: rgba(14,14,12,0.6);
  z-index: 10000; display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(4px);
}
/* Hidden by default — JS shows them via element.style.display which bypasses CSP */
#wa-overlay {
  display: none;
}
.otp-modal {
  width: 100%; max-width: 480px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 28px 24px 40px;
}
.otp-modal-logo {
  font-size: 20px; font-weight: var(--weight-semibold); color: var(--ink);
  font-family: Georgia, serif; letter-spacing: .04em; margin-bottom: 20px;
}
.otp-modal-logo em { font-style: italic; color: var(--gold); }
.otp-title { font-size: 17px; font-weight: var(--weight-semibold); color: var(--ink); margin: 0 0 6px; }
.otp-desc  { font-size: var(--text-base); color: var(--ink-3); line-height: 1.5; margin: 0 0 16px; }
.otp-input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border-md); border-radius: 8px;
  font-size: 15px; font-family: inherit;
  box-sizing: border-box; margin-bottom: 10px;
  transition: border-color .2s;
}
.otp-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.otp-input.otp-code { font-size: 24px; font-family: monospace; letter-spacing: .18em; text-align: center; }
.otp-error { font-size: var(--text-sm); color: var(--error); margin-bottom: 10px; }
.otp-btn {
  width: 100%; padding: 13px; background: var(--ink); color: #fff;
  border: none; border-radius: 8px; font-size: 15px; font-weight: var(--weight-semibold);
  cursor: pointer; margin-bottom: 10px;
}
.otp-btn:disabled { opacity: .5; cursor: not-allowed; }
.otp-skip {
  width: 100%; padding: 10px; background: none; border: none;
  font-size: var(--text-base); color: var(--ink-3); cursor: pointer;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  color: #fff;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  padding: 10px 18px;
  border-radius: 20px;
  z-index: 9999;
  white-space: nowrap;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
  opacity: 0;
  pointer-events: none;
  max-width: 90%;
  text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { background: var(--error); }
.toast.success { background: var(--success); }

/* ── LOADING OVERLAY ── */
.action-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(245,243,238,0.85);
  backdrop-filter: blur(4px);
  z-index: 50;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}
.action-overlay.show { display: flex; }
.action-overlay-text { font-size: var(--text-md); color: var(--ink-2); }

/* ── RESCAN / ROTATE BUTTONS ── */
.review-card-img-wrap { position: relative; overflow: hidden; border-radius: var(--r); }
.btn-rescan, .btn-rotate {
  position: absolute;
  top: 10px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  color: rgba(255,255,255,0.85);
  font-size: var(--text-sm);
  font-family: 'Instrument Sans', sans-serif;
  padding: 5px 12px;
  cursor: pointer;
  z-index: 5;
}
.btn-rescan { right: 10px; }
.btn-rotate  { left: 10px; }

/* ── FIRST-RUN ONBOARDING OVERLAY ── */
#onboarding-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(14,14,12,0.72);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
#onboarding-overlay.open { opacity: 1; pointer-events: all; }
.onboarding-sheet {
  background: var(--paper);
  border-radius: 24px 24px 0 0;
  padding: 0 24px calc(32px + env(safe-area-inset-bottom));
  width: 100%; max-width: 480px;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.34, 1.3, 0.64, 1);
}
#onboarding-overlay.open .onboarding-sheet { transform: translateY(0); }
.ob-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--border-md); margin: 12px auto 20px;
}
.ob-title {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 17px; font-weight: var(--weight-semibold); color: var(--ink);
  margin-bottom: 4px; text-align: center;
}
.ob-sub {
  font-size: var(--text-base); color: var(--ink-3); text-align: center;
  margin-bottom: 20px; line-height: 1.5;
}
.ob-steps { display: flex; flex-direction: column; gap: 0; margin-bottom: 20px; }
.ob-step {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.ob-step:last-child { border-bottom: none; }
.ob-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: var(--paper-2); border: 1px solid var(--border-md);
  display: flex; align-items: center; justify-content: center;
}
.ob-icon svg { width: 17px; height: 17px; stroke: var(--gold); fill: none; }
.ob-step-text { flex: 1; padding-top: 2px; }
.ob-step-title { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--ink); margin-bottom: 2px; }
.ob-step-desc  { font-size: var(--text-sm); color: var(--ink-3); line-height: 1.5; }
.btn-ob-start {
  width: 100%; height: 52px; border-radius: 12px;
  background: var(--ink); color: var(--paper);
  font-family: 'Instrument Sans', sans-serif; font-size: 15px; font-weight: var(--weight-medium);
  border: none; cursor: pointer; transition: background 0.2s, transform 0.15s;
  margin-bottom: 10px;
}
.btn-ob-start:active { transform: scale(0.98); }
.ob-skip {
  display: block; text-align: center; font-size: var(--text-base); color: var(--ink-3);
  background: none; border: none; cursor: pointer; width: 100%; padding: 4px 0;
}
.ob-skip:hover { color: var(--ink-2); }

/* ── Follow-up sequence panel ─────────────────────────────────────────── */
.followup-panel {
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: var(--r);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}
.followup-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: var(--space-4);
}
.followup-days {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
  justify-content: center;
}
.followup-day-btn {
  height: var(--ctrl-sm);
  padding: 0 var(--space-3);
  border: 1px solid var(--border-md);
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-family: 'Instrument Sans', sans-serif;
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.followup-day-btn.selected,
.followup-day-btn:hover { background: var(--gold); border-color: var(--gold); color: #fff; }
.followup-date-preview {
  font-size: var(--text-base);
  color: var(--ink-3);
  text-align: center;
  margin-bottom: var(--space-4);
  min-height: 18px;
}
.followup-input {
  width: 100%;
  box-sizing: border-box;
  height: var(--ctrl-md);
  padding: 0 var(--space-3);
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink);
  font-size: var(--text-lg);
  font-family: 'Instrument Sans', sans-serif;
  margin-bottom: var(--space-3);
}
.followup-input:focus { outline: none; border-color: var(--gold); }
.followup-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 96px;
  padding: var(--space-3);
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink);
  font-size: var(--text-lg);
  font-family: 'Instrument Sans', sans-serif;
  line-height: 1.55;
  resize: vertical;
  margin-bottom: var(--space-4);
}
.followup-textarea:focus { outline: none; border-color: var(--gold); }

/* Follow-up header (label + toggle row) */
.followup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}
.followup-info {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-base);
  color: var(--ink-3);
  margin-bottom: var(--space-4);
}
.followup-info svg { flex-shrink: 0; stroke: var(--ink-3); }

/* Toggle switch */
.fu-toggle { position: relative; display: inline-flex; cursor: pointer; }
.fu-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.fu-toggle-track {
  width: 36px; height: 20px;
  background: var(--border-md);
  border-radius: 20px;
  transition: background 0.2s;
  position: relative;
}
.fu-toggle-track::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.fu-toggle input:checked + .fu-toggle-track { background: var(--gold); }
.fu-toggle input:checked + .fu-toggle-track::after { transform: translateX(16px); }

/* Scheduled item rows */
.followup-items { margin-bottom: var(--space-3); }
.followup-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.followup-item:first-child { border-top: 1px solid var(--border); }
.followup-item-icon {
  width: 28px; height: 28px; flex-shrink: 0;
  background: var(--gold-dim);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.followup-item-icon svg { width: 13px; height: 13px; stroke: var(--gold); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.followup-item-info { flex: 1; min-width: 0; }
.followup-item-date { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--ink); }
.followup-item-subj { font-size: var(--text-base); color: var(--ink-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.followup-item-cancel {
  width: var(--ctrl-xs); height: var(--ctrl-xs); flex-shrink: 0;
  border: none; background: none; color: var(--ink-3);
  cursor: pointer; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.followup-item-cancel:hover { background: var(--error-bg); color: var(--error); }
