:root {
  --blue: #3b6fa0;
  --blue-dark: #2d5780;
  --blue-light: #4d84b8;
  --blue-pale: #e8f0f8;
  --white: #ffffff;
  --gray: #f5f7fa;
  --gray2: #e2e8f0;
  --text: #1a2940;
  --muted: #7a90a8;
  --success: #2ecc71;
  --radius: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body {
  background: var(--gray);
  color: var(--text);
  font-family: 'Open Sans', sans-serif;
  min-height: 100vh;
  padding: 0 0 80px;
  -webkit-font-smoothing: antialiased;
}

.header {
  background: var(--white);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--blue-pale);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(59,111,160,0.08);
}
.header-left { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.header-logo { width: 40px; height: 40px; object-fit: contain; }
.header-title { font-family: 'Montserrat', sans-serif; font-size: 15px; font-weight: 800; color: var(--text); }
.header-sub { font-family: 'Montserrat', sans-serif; font-size: 10px; font-weight: 500; color: var(--muted); text-transform: uppercase; }
.gear-btn {
  background: var(--blue-pale);
  border: 1.5px solid var(--blue-light);
  color: var(--blue);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}
.gear-btn:active { background: #d8e8f5; transform: scale(0.95); }

.wrapper { max-width: 480px; margin: 0 auto; padding: 16px 14px 0; }

/* Settings panel (simple) */
.settings-panel {
  background: var(--white);
  border-radius: var(--radius);
  margin-bottom: 14px;
  display: none;
  border: 1px solid var(--gray2);
  overflow: hidden;
}
.settings-panel.open { display: block; }
.settings-header {
  background: var(--blue);
  padding: 12px 18px;
  color: white;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
}
.settings-body { padding: 18px; }
.settings-section { margin-bottom: 20px; }
.settings-section h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 10px;
  font-family: 'Montserrat', sans-serif;
}
.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
  font-family: 'Montserrat', sans-serif;
}
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--gray);
  border: 1.5px solid var(--gray2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); background: white; }
.save-settings-btn {
  width: 100%;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
}
.close-settings-btn {
  width: 100%;
  background: var(--gray2);
  color: var(--text);
  border: none;
  border-radius: 10px;
  padding: 10px;
  margin-top: 8px;
  cursor: pointer;
}

/* Chip options (industry/tone/lead-destination pickers) */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--gray);
  border: 1.5px solid var(--gray2);
  color: var(--text);
  border-radius: 20px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
}
.chip:active { transform: scale(0.96); }
.chip.selected { background: var(--blue); border-color: var(--blue); color: white; }

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius);
  margin-bottom: 14px;
  border: 1px solid var(--gray2);
  overflow: hidden;
}
.card-header {
  background: var(--blue);
  padding: 11px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.step-badge {
  width: 22px;
  height: 22px;
  background: rgba(255,255,255,0.25);
  color: white;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-header span {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: white;
}
.card-body { padding: 18px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.full { grid-column: 1 / -1; }

.camera-btn {
  width: 100%;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.camera-btn:active { background: var(--blue-dark); transform: scale(0.98); }

.preview-img {
  width: 100%;
  border-radius: 10px;
  margin-top: 14px;
  display: none;
  border: 1px solid var(--gray2);
}
.note-text { text-align: center; color: var(--muted); font-size: 11px; margin-top: 10px; }

.generate-btn {
  width: 100%;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 14px;
}
.generate-btn:disabled { opacity: 0.5; }

.copy-block {
  background: var(--gray);
  border: 1.5px solid var(--gray2);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 8px;
}
.copy-block p { font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.copy-btn {
  background: var(--blue-pale);
  border: 1.5px solid var(--blue-light);
  color: var(--blue);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.copy-btn.copied { background: #edfaf3; border-color: var(--success); color: #219a52; }

.primary-btn {
  width: 100%;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
}

.status {
  margin-top: 13px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  display: none;
  font-weight: 500;
}
.status.loading {
  background: var(--blue-pale);
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 8px;
}
.status.error { background: #fdf0ef; color: #c0392b; display: block; }
.status.success { background: #edfaf3; color: #219a52; display: block; }
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.success-screen {
  display: none;
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
}
.success-screen.show { display: block; }
.success-check { font-size: 44px; margin-bottom: 10px; }
.success-screen h2 { font-size: 18px; color: var(--blue); margin-bottom: 6px; }
.reset-btn {
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 28px;
  font-weight: 700;
  cursor: pointer;
}
footer { text-align: center; padding: 28px 16px 16px; font-size: 11px; color: var(--muted); }
footer a { color: var(--blue); text-decoration: none; }

.saved-badge {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: white;
  padding: 8px 20px;
  border-radius: 30px;
  font-size: 12px;
  opacity: 0;
  transition: 0.3s;
  pointer-events: none;
  z-index: 1000;
}
.saved-badge.show { opacity: 1; }

/* Onboarding wizard */
.wizard-overlay {
  position: fixed;
  inset: 0;
  background: var(--gray);
  z-index: 500;
  display: none;
  flex-direction: column;
  overflow-y: auto;
}
.wizard-overlay.show { display: flex; }
.wizard-progress {
  height: 4px;
  background: var(--gray2);
  position: sticky;
  top: 0;
}
.wizard-progress-bar { height: 100%; background: var(--blue); transition: width 0.25s; }
.wizard-body {
  flex: 1;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.wizard-step-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.wizard-question {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
}
.wizard-hint { font-size: 12px; color: var(--muted); margin-top: -12px; margin-bottom: 20px; }
.wizard-nav { display: flex; gap: 10px; margin-top: 24px; }
.wizard-btn-back {
  background: var(--gray2);
  color: var(--text);
  border: none;
  border-radius: 10px;
  padding: 14px 20px;
  font-weight: 700;
  cursor: pointer;
}
.wizard-btn-next {
  flex: 1;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-weight: 700;
  cursor: pointer;
}
.wizard-btn-next:disabled { opacity: 0.5; }
.wizard-skip {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 14px;
  cursor: pointer;
  text-decoration: underline;
}
