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

:root {
  --green: #2563eb;
  --green-dark: #1d4ed8;
  --bg: #f9fafb;
  --bg-2: #ffffff;
  --bg-3: #f3f4f6;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --sidebar-w: 224px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
}

.sidebar-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--green);
  text-decoration: none;
  padding: 22px 20px;
  border-bottom: 1px solid var(--border);
  display: block;
  letter-spacing: -0.3px;
}

.sidebar-nav {
  padding: 14px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s;
}

.nav-item:hover { background: var(--bg-3); color: #ccc; }
.nav-item.active { background: rgba(37,99,235,0.1); color: var(--green); }

.nav-badge {
  margin-left: auto;
  background: var(--green);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

.sidebar-footer {
  padding: 16px 14px;
  border-top: 1px solid var(--border);
}

.sidebar-tip {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
  background: var(--bg-3);
  padding: 10px 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
}

/* ── Main ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 18px 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.topbar-sub { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

/* ── Views ── */
.view { display: none; padding: 24px 28px; }
.view.active { display: block; }

/* ── Search Card ── */
.search-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 18px;
}

.search-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 160px;
}

.field-group label {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Select */
.select-wrap {
  position: relative;
}

.select-wrap select {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 32px 9px 12px;
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.select-wrap select:focus { border-color: var(--green); }
.select-wrap select option { background: #ffffff; }

.select-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
}

/* City autocomplete */
.city-wrap { position: relative; }

#cityInput {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

#cityInput::placeholder { color: #333; }
#cityInput:focus { border-color: var(--green); }

.city-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 200;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.city-dropdown.open { display: block; }

.city-option {
  padding: 9px 14px;
  font-size: 0.87rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s;
}

.city-option:hover, .city-option.highlighted { background: rgba(37,99,235,0.08); color: var(--green); }

.city-dropdown::-webkit-scrollbar { width: 4px; }
.city-dropdown::-webkit-scrollbar-track { background: transparent; }
.city-dropdown::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* Search button */
.btn-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--green);
  color: #fff;
  border: none;
  padding: 9px 22px;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-end;
}

.btn-search:hover { background: var(--green-dark); color: #fff; }
.btn-search:disabled { background: #bfdbfe; color: #93c5fd; cursor: not-allowed; }

.btn-outline {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-outline:hover { border-color: var(--green); color: var(--green); }

/* ── Status / Error ── */
.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(37,99,235,0.05);
  border: 1px solid rgba(37,99,235,0.15);
  border-radius: 9px;
  padding: 12px 16px;
  margin-bottom: 16px;
  color: var(--green);
  font-size: 0.87rem;
  font-weight: 500;
}

.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(37,99,235,0.2);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}

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

.error-row {
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 9px;
  padding: 12px 16px;
  color: #f87171;
  font-size: 0.87rem;
  margin-bottom: 16px;
}

/* ── Results bar ── */
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

#resultsLabel { font-size: 0.83rem; font-weight: 600; color: var(--muted); }

/* ── Cards Grid ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 16px;
}

/* ── Lead Card ── */
.lead-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, transform 0.15s;
}

.lead-card:hover { border-color: #93c5fd; transform: translateY(-2px); }

.card-photo {
  width: 100%; height: 128px;
  object-fit: cover;
  background: var(--bg-3);
  display: block;
}

.card-photo-placeholder {
  width: 100%; height: 128px;
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem;
}

.card-body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.card-tag {
  display: inline-block;
  background: rgba(37,99,235,0.1);
  color: var(--green);
  font-size: 0.67rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  width: fit-content;
  margin-bottom: 2px;
}

.card-name { font-size: 0.93rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.card-detail { font-size: 0.78rem; color: var(--muted); line-height: 1.4; }
.card-rating { font-size: 0.76rem; color: #888; }

.card-actions {
  padding: 0 16px 14px;
  display: flex;
  gap: 7px;
}

.btn-build {
  flex: 1;
  background: var(--green);
  color: #fff;
  border: none;
  padding: 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-build:hover { background: var(--green-dark); color: #fff; }
.btn-build:disabled { background: #bfdbfe; color: #93c5fd; cursor: not-allowed; }

.btn-save {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-save:hover { border-color: var(--green); color: var(--green); }
.btn-save.is-saved { color: var(--green); border-color: var(--green); cursor: default; }

/* ── Empty State ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 80px 20px; gap: 10px;
}

.empty-icon { font-size: 2.8rem; }
.empty-title { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.empty-sub { font-size: 0.83rem; color: var(--muted); max-width: 340px; line-height: 1.6; margin-bottom: 6px; }

/* ── Modal ── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
}

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%; max-width: 940px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: none; border: none;
  color: var(--muted); font-size: 1rem;
  cursor: pointer; padding: 4px 8px; border-radius: 5px;
  transition: color 0.15s;
}

.modal-close:hover { color: var(--text); }

.modal-toolbar {
  display: flex; gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}

.preview-frame {
  flex: 1; border: none;
  min-height: 540px;
  background: #fff;
}

/* ══════════════════════════════════════════════
   QUESTIONNAIRE MODAL
══════════════════════════════════════════════ */

.quiz-modal {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.12);
  animation: modalIn 0.22s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)  scale(1); }
}

/* Header */
.qm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.qm-header-left { display: flex; flex-direction: column; gap: 4px; }

.qm-badge {
  display: inline-block;
  background: rgba(37,99,235,0.1);
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  width: fit-content;
}

.qm-biz {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
}

/* Progress bar */
.qm-progress-wrap {
  height: 2px;
  background: var(--border);
  flex-shrink: 0;
}

.qm-progress-bar {
  height: 100%;
  background: var(--green);
  transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
}

/* Body */
.qm-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 28px 24px;
}

.qm-body::-webkit-scrollbar { width: 4px; }
.qm-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* Steps */
.qm-step { display: none; animation: stepIn 0.2s ease; }
.qm-step.active { display: block; }

@keyframes stepIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.qm-step-meta {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 10px;
}

.qm-question {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.qm-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 22px;
  line-height: 1.55;
}

/* Options */
.qm-options {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.qm-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  text-align: left;
  width: 100%;
}

.qm-opt:hover {
  border-color: rgba(37,99,235,0.35);
  background: rgba(37,99,235,0.04);
  transform: translateX(3px);
}

.qm-opt.selected {
  border-color: var(--green);
  background: rgba(37,99,235,0.08);
}

.qo-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.qo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.qo-text strong {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.qo-text span {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Prompt step */
.prompt-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 22px;
  min-height: 100px;
  position: relative;
}

.prompt-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.prompt-text {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.75;
  font-family: 'Consolas', 'Monaco', monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt-textarea {
  width: 100%;
  min-height: 220px;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.75;
  font-family: 'Consolas', 'Monaco', monospace;
  background: transparent;
  border: none;
  outline: none;
  resize: vertical;
  box-sizing: border-box;
}

.prompt-cursor {
  display: inline-block;
  width: 2px;
  height: 14px;
  background: var(--green);
  vertical-align: middle;
  margin-left: 2px;
  animation: blink 0.9s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Build final button */
.btn-build-final {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--green);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: -0.2px;
}

.btn-build-final:hover {
  background: var(--green-dark);
  color: #fff;
  transform: translateY(-1px);
}

/* Building state */
.qm-building {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 20px;
  text-align: center;
}

.building-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(37,99,235,0.15);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.building-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.building-sub {
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 280px;
  line-height: 1.55;
}

/* ── Sidebar nav section ── */
.nav-section { display: flex; flex-direction: column; flex: 1; overflow-y: auto; }
.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #9ca3af;
  padding: 14px 22px 6px;
}

/* ── Sidebar bottom ── */
.sidebar-bottom {
  padding: 10px 10px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item-bottom {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
}

.nav-item-bottom:hover { background: var(--bg-3); color: var(--text); }
.nav-item-bottom.active { background: rgba(37,99,235,0.08); color: var(--green); }

.credits-chip {
  margin-left: auto;
  background: rgba(37,99,235,0.12);
  color: var(--green);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── Projects view ── */
.projects-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.projects-empty {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 80px 20px; gap: 10px;
}

/* ── Deploy Guide ── */
.guide-wrap { max-width: 820px; }

.guide-intro {
  margin-bottom: 32px;
}

.guide-intro h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.guide-intro p {
  font-size: 0.87rem;
  color: var(--muted);
  line-height: 1.6;
}

.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 36px;
}

.guide-step {
  display: flex;
  gap: 18px;
  padding: 22px 24px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  position: relative;
}

.guide-step.recommended {
  border-color: rgba(37,99,235,0.3);
  background: rgba(37,99,235,0.03);
}

.gs-badge {
  position: absolute;
  top: -10px; right: 16px;
  background: var(--green);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 20px;
}

.gs-num {
  width: 36px; height: 36px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--green);
  flex-shrink: 0;
}

.gs-content { flex: 1; }

.gs-content h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 7px;
}

.gs-content p {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.6;
}

.gs-content strong { color: var(--text); }
.gs-content code {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.82rem;
  color: var(--green);
}

.gs-tag {
  display: inline-block;
  background: #f1f5f9;
  border: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 5px;
  margin-left: 8px;
  vertical-align: middle;
}

.guide-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--green);
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
}

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

.guide-ol {
  padding-left: 18px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 2;
}

.guide-tip {
  margin-top: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
}

.guide-tip strong { color: var(--text); }

.guide-resources h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.resource-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.1s;
}

.resource-card:hover { border-color: rgba(37,99,235,0.3); transform: translateY(-1px); }

.rc-icon { font-size: 1.4rem; flex-shrink: 0; }

.resource-card strong { display: block; font-size: 0.85rem; color: var(--text); font-weight: 700; }
.resource-card span { font-size: 0.75rem; color: var(--muted); }

/* ── Account / Settings ── */
.settings-wrap { max-width: 600px; display: flex; flex-direction: column; gap: 28px; }

.settings-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
}

.settings-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
}

.settings-form { display: flex; flex-direction: column; gap: 14px; }

.sf-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sf-row label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sf-row input {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}

.sf-row input:focus { border-color: var(--green); }

.btn-save-settings {
  background: var(--green);
  color: #000;
  border: none;
  padding: 10px 20px;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  width: fit-content;
  transition: background 0.15s;
  margin-top: 4px;
}

.btn-save-settings:hover { background: var(--green-dark); color: #fff; }

.current-plan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 14px 18px;
}

.cp-plan { font-size: 1rem; font-weight: 800; color: var(--text); }
.cp-desc { font-size: 0.78rem; color: var(--muted); margin-top: 3px; }

.btn-upgrade {
  background: transparent;
  border: 1px solid var(--green);
  color: var(--green);
  padding: 7px 16px;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-upgrade:hover { background: var(--green); color: #000; }

/* ── Plans ── */
.plans-wrap { max-width: 900px; }

.plans-header {
  margin-bottom: 28px;
}

.plans-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.plans-header p {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── Plans billing toggle ── */
.db-billing-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  justify-content: center;
}
.dbt-label {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.dbt-save {
  background: rgba(37,99,235,0.15);
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}
.dbt-switch {
  width: 40px;
  height: 22px;
  background: var(--border);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.dbt-switch.active { background: var(--green); }
.dbt-knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  display: block;
}
.dbt-switch.active .dbt-knob { transform: translateX(18px); }

/* ── Plans grid (5 cols) ── */
.plans-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-top: 24px;
}
@media (max-width: 1300px) { .plans-grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px)  { .plans-grid-5 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .plans-grid-5 { grid-template-columns: 1fr; } }

.plan-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 18px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.plan-card.featured {
  border-color: rgba(37,99,235,0.45);
  background: rgba(37,99,235,0.03);
}

.plan-badge {
  position: absolute;
  top: -11px; left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.plan-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.plan-price {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -1px;
  margin-bottom: 6px;
}

.plan-price span {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
}

.plan-desc {
  font-size: 0.78rem;
  color: #666;
  margin-bottom: 16px;
  line-height: 1.5;
}

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 20px;
  flex: 1;
}

.plan-features li {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
  padding-left: 18px;
  position: relative;
}
.plan-features li::before {
  content: '';
  position: absolute;
  left: 0; top: 3px;
  width: 12px; height: 12px;
  background-size: contain;
  background-repeat: no-repeat;
}
.plan-features li.pf-yes { color: #ccc; }
.plan-features li.pf-yes::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}
.plan-features li.pf-no { color: #555; }
.plan-features li.pf-no::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2.5'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
}

.plan-btn {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.plan-btn:hover { border-color: var(--green); color: var(--green); }
.plan-btn.current { color: var(--muted); border-color: var(--border); cursor: default; }
.plan-btn.green { background: var(--green); color: #fff; border-color: var(--green); }
.plan-btn.green:hover { background: var(--green-dark); color: #fff; }

/* ── Plans guarantee bar ── */
.plans-guarantee {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  padding: 14px 20px;
  background: rgba(37,99,235,0.07);
  border: 1px solid rgba(37,99,235,0.2);
  border-radius: 10px;
  font-size: 0.84rem;
  color: var(--green);
  font-weight: 600;
}

/* ── Credits ── */
.credits-wrap { max-width: 680px; }

.credits-header {
  margin-bottom: 22px;
}

.credits-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.credits-header p {
  font-size: 0.85rem;
  color: var(--muted);
}

.usage-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 24px;
}

.usage-row {
  margin-bottom: 18px;
}

.usage-row:last-of-type { margin-bottom: 0; }

.usage-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--text);
}

.usage-count {
  font-size: 0.78rem;
  color: var(--muted);
}

.usage-bar-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 20px;
  overflow: hidden;
}

.usage-bar {
  height: 100%;
  background: var(--green);
  border-radius: 20px;
  transition: width 0.6s ease;
}

.usage-reset {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--muted);
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.credits-history h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.history-item:last-child { border-bottom: none; }

.hi-icon {
  font-size: 1.1rem;
  width: 34px; height: 34px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.history-item > div:nth-child(2) { flex: 1; }
.history-item > div:nth-child(2) strong { display: block; font-size: 0.85rem; color: var(--text); font-weight: 600; }
.history-item > div:nth-child(2) span { font-size: 0.76rem; color: var(--muted); }

.hi-time {
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Bookings view ── */
.bookings-wrap { max-width: 860px; }

.bookings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.bookings-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.bookings-header p {
  font-size: 0.85rem;
  color: var(--muted);
}

.bookings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.booking-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  transition: border-color 0.15s;
}

.booking-card:hover { border-color: #93c5fd; }

.booking-card.status-new { border-left: 3px solid var(--green); }
.booking-card.status-confirmed { border-left: 3px solid #16a34a; }
.booking-card.status-done { border-left: 3px solid var(--muted); opacity: 0.7; }

.booking-avatar {
  width: 40px;
  height: 40px;
  background: var(--blue-light, #eff6ff);
  border: 1px solid var(--blue-border, #bfdbfe);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green);
  flex-shrink: 0;
}

.booking-body { flex: 1; min-width: 0; }

.booking-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.booking-business {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.booking-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.booking-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--muted);
}

.booking-meta-item svg { flex-shrink: 0; color: var(--green); }

.booking-message {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--bg-3);
  border-radius: 6px;
  padding: 8px 10px;
  line-height: 1.5;
  font-style: italic;
}

.booking-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.booking-status-badge {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  text-align: center;
}

.badge-new       { background: rgba(37,99,235,0.1); color: var(--green); }
.badge-confirmed { background: #dcfce7; color: #16a34a; }
.badge-done      { background: var(--bg-3); color: var(--muted); }

.booking-action-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.booking-action-btn:hover { border-color: var(--green); color: var(--green); }

.booking-time {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: right;
  margin-top: 4px;
}

.booking-datetime {
  background: var(--blue-light, #eff6ff);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
}

/* ── Help view ── */
.help-wrap { max-width: 760px; padding: 0 0 60px; }
.help-section { margin-bottom: 48px; }
.help-section h3 { font-size: 1rem; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.help-intro { font-size: .9rem; color: var(--muted); line-height: 1.7; margin-bottom: 10px; }
.faq-item { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.faq-item summary { padding: 14px 16px; font-size: .9rem; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; color: var(--text); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.1rem; color: var(--muted); }
.faq-item[open] summary::after { content: '−'; }
.faq-body { padding: 0 16px 14px; font-size: .87rem; color: var(--muted); line-height: 1.7; }
.support-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 24px; }
.support-email { font-size: 1.1rem; font-weight: 700; color: var(--green); text-decoration: none; }
.support-email:hover { text-decoration: underline; }
.support-meta { font-size: .83rem; color: var(--muted); margin-top: 8px; line-height: 1.6; }
.tips-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.tips-list li { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; font-size: .87rem; color: var(--muted); line-height: 1.6; }
.tips-list li strong { color: var(--text); display: block; margin-bottom: 2px; }

/* ── CRM panel on saved cards ── */
.crm-panel { border-top: 1px solid var(--border); padding: 14px 16px; background: var(--bg-3); }
.crm-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.crm-label { font-size: .72rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.crm-select, .crm-input, .crm-textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font-size: .85rem; color: var(--text); font-family: inherit; }
.crm-select:focus, .crm-input:focus, .crm-textarea:focus { outline: none; border-color: var(--green); }
.crm-textarea { resize: vertical; min-height: 70px; }
.crm-updated { font-size: .74rem; color: var(--muted); opacity: .6; margin-top: 6px; }
.crm-status-new { color: #6366f1; }
.crm-status-contacted { color: #f59e0b; }
.crm-status-called { color: #3b82f6; }
.crm-status-interested { color: #10b981; }
.crm-status-closed { color: #22c55e; font-weight: 700; }
.crm-status-notinterested { color: var(--muted); }
