:root {
  --navy: #0d1f3c;
  --navy-mid: #162b52;
  --navy-lt: #1e3a6e;
  --blue-lt: #deeef7;
  --blue-lt-dk: #c8e2f1;
  --gold: #c9973a;
  --gold-lt: #e8b86d;
  --cream: #f7f4ef;
  --smoke: #edeae4;
  --text: #1a1a2e;
  --muted: #6b7280;
  --white: #fff;
  --green: #16a34a;
  --border: #d1ccc3;
  --shadow: 0 4px 24px rgba(13, 31, 60, 0.10);
  --shadow-lg: 0 12px 48px rgba(13, 31, 60, 0.18);
  --radius: 10px;
  /* Brand colors — overridden at runtime by applyBrandColors() from Admin settings */
  --brand-cvb: #dc2626;
  --brand-rb:  #16a34a;
  --brand-he:  #2563eb;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ── */
.header {
  background: var(--white);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.10);
}
.header-logo {
  height: 22px;
  width: auto;
  opacity: 0.85;
}

/* ── Proposal bar ── */
.sidebar-controls {
  background: var(--smoke);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.sidebar-proposal-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-proposal-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.proposal-status-select {
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  background: var(--white);
  cursor: pointer;
}
.proposal-status-select:focus { outline: none; border-color: var(--navy-lt); }
.header-brand {
  font-family: 'Playfair Display', serif;
  color: var(--white);
  font-size: 1.15rem;
  font-weight: 600;
}
.header-brand span { color: var(--gold-lt); }
.header-tag {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── Top nav bar ── */
.topnav {
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 40px;
  position: sticky;
  top: 64px;
  z-index: 99;
  flex-shrink: 0;
}
.topnav-link {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  padding: 5px 13px;
  border-radius: 5px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.topnav-link:hover { background: rgba(255,255,255,0.12); color: #fff; }
.topnav-link.active { background: rgba(255,255,255,0.18); color: #fff; }
.topnav-link.topnav-admin { position: absolute; right: 8px; }
.topnav-link.topnav-action {
  margin-left: 6px;
  color: var(--gold-lt, #f5c842);
  border: 1.5px solid rgba(245,200,66,0.45);
}
.topnav-link.topnav-action:hover { background: rgba(245,200,66,0.15); color: var(--gold-lt,#f5c842); }
.topnav-link.topnav-action:disabled { opacity: 0.4; cursor: not-allowed; }
/* ── Sub nav ── */
.subnav {
  background: var(--navy-lt);
  display: flex; align-items: center; justify-content: center;
  gap: 2px; height: 34px;
  position: sticky; top: 104px; z-index: 98; flex-shrink: 0;
}
.subnav-link {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(255,255,255,0.72); text-decoration: none;
  padding: 4px 13px; border-radius: 5px; border: none;
  background: transparent; cursor: pointer;
  transition: background 0.15s, color 0.15s; white-space: nowrap;
}
.subnav-link:hover { background: rgba(255,255,255,0.10); color: #fff; }
.subnav-link.active { background: rgba(255,255,255,0.16); color: #fff; }

/* ── Progress bar ── */
.progress-wrap { background: var(--blue-lt-dk); padding: 0; position: sticky; top: 138px; z-index: 97; }
.progress-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
}
.steps { display: flex; grid-column: 1; }
.step-tab {
  flex: 1;
  padding: 14px 8px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  opacity: 0.45;
}
.step-tab.active { border-color: var(--gold); opacity: 1; }
.step-tab.done { border-color: var(--gold-lt); opacity: 0.75; cursor: pointer; }
.step-tab.done:hover { opacity: 1; }

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--navy);
  flex-shrink: 0;
}
.step-tab.active .step-num { background: var(--gold); color: var(--navy); }
.step-tab.done .step-num { background: var(--green); color: #fff; }
.step-tab.done .step-num::after { content: '✓'; font-size: 0.65rem; }
.step-tab.done .step-num-inner { display: none; }
.step-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Main layout ── */
.main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}

/* ── Panel ── */
.panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: fadeUp 0.3s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.panel-head {
  background: var(--blue-lt);
  padding: 22px 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.panel-head-icon {
  width: 36px;
  height: 36px;
  background: rgba(201, 151, 58, 0.28);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.panel-head h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--navy);
  font-weight: 700;
}
.panel-head p { font-size: 0.78rem; color: rgba(13, 31, 60, 0.6); margin-top: 2px; }
.panel-body { padding: 28px; }

/* ── Form fields ── */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.field-row.thirds { grid-template-columns: 1fr 1fr 1fr; }
.field-row.full   { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 5px; }

label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
input[type=text],
input[type=email],
input[type=date],
select,
textarea {
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 9px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy-lt);
  box-shadow: 0 0 0 3px rgba(30, 58, 110, 0.08);
}

/* ── Brand tabs (Step 2) ── */
.brand-tabs {
  display: flex;
  border-bottom: 2px solid var(--smoke);
  margin-bottom: 24px;
  gap: 0;
}
.brand-tab {
  padding: 10px 22px;
  border: none;
  background: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.18s, border-color 0.18s;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand-tab:hover { color: var(--navy); }
.brand-tab.active { color: var(--navy); border-bottom-color: var(--navy); }
/* Per-brand active colors — driven by CSS vars set from Admin brand colors */
#brand-tab-cvb.active, #brand-tab-cvb:hover { color: var(--brand-cvb); }
#brand-tab-cvb.active { border-bottom-color: var(--brand-cvb); }
#brand-tab-rb.active,  #brand-tab-rb:hover  { color: var(--brand-rb); }
#brand-tab-rb.active  { border-bottom-color: var(--brand-rb); }
#brand-tab-he.active,  #brand-tab-he:hover  { color: var(--brand-he); }
#brand-tab-he.active  { border-bottom-color: var(--brand-he); }

/* ── Brand logo bar ── */
.brand-logo-bar {
  display: flex;
  align-items: center;
  padding: 16px 0 20px;
  border-bottom: 1px solid var(--smoke);
  margin-bottom: 24px;
}
.brand-logo-bar img {
  height: 36px;
  width: auto;
  display: block;
  transition: opacity 0.2s;
}
.brand-logo-bar-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.expand-collapse-btn {
  background: none;
  border: 1px solid var(--smoke);
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}
.expand-collapse-btn:hover {
  background: var(--smoke);
}
.service-section-block { margin-bottom: 8px; }

/* ── Section Bullets panel (shared with admin) ── */
.section-block { margin-bottom: 10px; }
.section-block-head {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 0; border-bottom: 2px solid var(--smoke); margin-bottom: 10px;
  cursor: default;
}
.section-block-name {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--navy);
}
.collapse-btn {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 0.75rem; padding: 2px 6px; flex-shrink: 0;
  border-radius: 4px; transition: background 0.15s; font-family: 'DM Sans', sans-serif;
}
.collapse-btn:hover { background: var(--smoke); color: var(--navy); }
.bullet-row {
  display: flex; gap: 6px; align-items: flex-start; padding: 4px 0;
}
.bullet-drag-handle {
  font-size: 0.95rem; color: var(--muted); cursor: grab;
  user-select: none; flex-shrink: 0; width: 16px; text-align: center; padding-top: 6px;
}
.bullet-drag-handle:active { cursor: grabbing; }
.bullet-dot { font-size: 1rem; color: var(--muted); flex-shrink: 0; line-height: 1; padding-top: 6px; }
.bullet-row .text-input {
  flex: 1; min-width: 0; padding: 5px 9px; font-size: 0.82rem;
  height: 52px; resize: none; overflow-y: auto; line-height: 1.4;
  border: 1.5px solid var(--border); border-radius: 6px;
  font-family: 'DM Sans', sans-serif; color: var(--text);
  transition: border-color 0.2s;
}
.bullet-row .text-input:focus { outline: none; border-color: var(--navy-lt); box-shadow: 0 0 0 3px rgba(30,58,110,0.08); }
.bold-toggle {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 5px;
  background: none; border: 1.5px solid var(--border); color: var(--muted);
  font-weight: 700; font-size: 0.85rem; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  display: flex; align-items: center; justify-content: center;
}
.bold-toggle.bold-active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.bullet-row .clone-btn {
  position: static; width: 26px; height: 26px; border-radius: 5px; flex-shrink: 0;
  background: var(--smoke); color: var(--navy); border: none; cursor: pointer;
  font-size: 0.8rem; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.bullet-row .clone-btn:hover { background: var(--navy); color: #fff; }
.bullet-row .delete-btn {
  position: static; width: 26px; height: 26px; border-radius: 5px; flex-shrink: 0;
  background: #e53e3e; color: #fff; border: none; cursor: pointer;
  font-size: 0.8rem; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.bullet-row .delete-btn:hover { background: #c53030; }
.add-item-btn {
  width: 100%; padding: 9px; border: 1.5px dashed var(--border);
  border-radius: 8px; background: none; color: var(--muted);
  font-family: 'DM Sans', sans-serif; font-size: 0.8rem; font-weight: 500;
  cursor: pointer; transition: all 0.18s; margin-top: 4px;
}
.add-item-btn:hover { border-color: var(--navy-lt); color: var(--navy); background: rgba(30,58,110,0.02); }

/* ── Sidebar brand heading ── */
.price-brand-head {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
  padding: 8px 0 3px;
  margin-top: 4px;
  border-top: 1px solid rgba(13,31,60,0.15);
}
.price-brand-head:first-child { border-top: none; margin-top: 0; }

/* ── Section headings ── */
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--smoke);
}
.section-head:first-child { margin-top: 0; }
.section-head h3 {
  font-family: 'Playfair Display', serif;
  font-size: 19px;
  font-weight: 600;
  color: var(--navy);
}
.section-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--smoke);
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 4px;
}

/* ── Service items ── */
.service-grid { display: flex; flex-direction: column; gap: 8px; }
.service-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s;
  background: var(--white);
}
.service-item:hover { border-color: var(--navy-lt); background: rgba(30, 58, 110, 0.02); }
.service-item.selected {
  border-color: var(--navy);
  background: rgba(13, 31, 60, 0.03);
  box-shadow: 0 2px 8px rgba(13, 31, 60, 0.08);
}
.service-item input[type=checkbox] { display: none; }

.custom-check {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 5px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
}
.service-item.selected .custom-check {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  font-size: 0.7rem;
}
.service-item.selected .custom-check::after { content: '✓'; }

.service-info { flex: 1; }
.service-name { font-size: 0.88rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.service-desc { font-size: 0.75rem; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.service-price {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Qty row ── */
.qty-row { display: none; align-items: center; gap: 8px; margin-top: 8px; }
.service-item.selected .qty-row { display: flex; }
.whitepaper-fields { display: none; }
.service-item.selected .whitepaper-fields { display: flex; }
.custom-item-fields { display: none; }
.service-item.selected .custom-item-fields { display: flex; }
.qty-row label {
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--muted);
}
.qty-row input[type=number] {
  width: 64px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 0.82rem;
  font-family: 'DM Sans', sans-serif;
}

/* ── Month picker ── */
.month-picker { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--smoke); }
.service-item.selected .month-picker { display: block; }
.month-picker-hint { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.month-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.month-pill {
  padding: 3px 8px; border-radius: 4px; border: 1.5px solid var(--border);
  background: var(--white); color: var(--muted);
  font-family: 'DM Sans', sans-serif; font-size: 0.72rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s; line-height: 1.4;
}
.month-pill:hover:not(:disabled):not(.selected) { border-color: var(--navy-lt); color: var(--navy); }
.month-pill.selected { background: var(--navy); border-color: var(--navy); color: var(--white); }
.month-pill:disabled { opacity: 0.3; cursor: not-allowed; }
.month-pill.booked {
  background: #fee2e2; border-color: #fca5a5; color: #b91c1c;
  cursor: not-allowed; opacity: 0.75; text-decoration: line-through;
  pointer-events: none;
}

/* ── Multi-instance email promotions ── */
.multi-instance-wrap { display: flex; flex-direction: column; gap: 6px; }
.instance-slot { display: flex; flex-direction: column; gap: 3px; }
.add-instance-btn {
  align-self: flex-start;
  background: none;
  border: 1.5px dashed var(--border);
  border-radius: 6px;
  color: var(--navy);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 14px;
  transition: all 0.15s;
}
.add-instance-btn:hover { border-color: var(--navy); background: rgba(13,31,60,0.04); }
.remove-instance-btn {
  align-self: flex-end;
  background: none;
  border: 1.5px solid #e0e0e0;
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.71rem;
  padding: 2px 9px;
  transition: all 0.15s;
}
.remove-instance-btn:hover { border-color: #c00; color: #c00; }

/* ── Radio cards ── */
.radio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio-card {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.18s;
}
.radio-card:hover { border-color: var(--navy-lt); }
.radio-card.selected { border-color: var(--navy); background: rgba(13, 31, 60, 0.03); }
.radio-card input { display: none; }
.radio-card-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.radio-dot {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.18s;
}
.radio-card.selected .radio-dot {
  border-color: var(--navy);
  background: var(--navy);
  box-shadow: inset 0 0 0 3px #fff;
}
.radio-card-desc { font-size: 0.75rem; color: var(--muted); margin-top: 6px; line-height: 1.5; }

/* ── Sidebar ── */
.sidebar { position: sticky; top: 120px; }
.price-card {
  background: var(--blue-lt);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.price-card-head {
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(13, 31, 60, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.price-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: var(--navy);
  font-weight: 700;
}
.price-card-subtitle { font-size: 0.72rem; color: rgba(13, 31, 60, 0.55); margin-top: 2px; }
.live-badge {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(201, 151, 58, 0.15);
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid rgba(201, 151, 58, 0.3);
}
.price-items {
  padding: 16px 22px;
  max-height: 320px;
  overflow-y: auto;
}
.price-items::-webkit-scrollbar { width: 4px; }
.price-items::-webkit-scrollbar-thumb { background: rgba(13, 31, 60, 0.2); border-radius: 4px; }
.price-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(13, 31, 60, 0.1);
  animation: lineIn 0.2s ease;
}
@keyframes lineIn { from { opacity: 0; } to { opacity: 1; } }
.price-line:last-child { border-bottom: none; }
.price-line-name { font-size: 0.78rem; color: rgba(13, 31, 60, 0.75); flex: 1; line-height: 1.3; }
.price-line-qty { display: block; font-size: 0.68rem; color: var(--muted); margin-top: 1px; }
.price-line-amt { font-size: 0.78rem; color: var(--navy); font-weight: 600; white-space: nowrap; }
.empty-msg {
  text-align: center;
  padding: 24px 0;
  font-size: 0.78rem;
  color: rgba(13, 31, 60, 0.4);
  font-style: italic;
}
.price-footer { padding: 14px 22px 20px; border-top: 1px solid rgba(13, 31, 60, 0.12); }
.subtotal-row,
.discount-row,
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
}
.subtotal-row span  { font-size: 0.78rem; color: rgba(13, 31, 60, 0.65); }
.subtotal-row strong { font-size: 0.82rem; color: var(--navy); font-weight: 600; }
.discount-row { display: none; }
.discount-row span,
.discount-row strong { font-size: 0.78rem; color: var(--navy); font-weight: 600; }
.total-row { margin-top: 8px; padding-top: 10px; border-top: 1px solid rgba(13, 31, 60, 0.15); }
.total-row span   { font-family: 'Playfair Display', serif; font-size: 0.88rem; color: var(--navy); font-weight: 600; }
.total-row strong { font-family: 'Playfair Display', serif; font-size: 1.4rem; color: var(--navy); font-weight: 700; }

/* ── Client card ── */
.client-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 16px;
  overflow: hidden;
}
.client-card-head {
  background: var(--smoke);
  padding: 12px 18px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.client-card-body { padding: 14px 18px; }
.client-row { display: flex; gap: 8px; margin-bottom: 6px; }
.client-row:last-child { margin-bottom: 0; }
.client-row-label { font-size: 0.7rem; color: var(--muted); font-weight: 600; min-width: 60px; }
.client-row-val { font-size: 0.78rem; color: var(--text); font-weight: 500; }

/* ── Buttons ── */
.btn-row {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1.5px solid var(--smoke);
}
.btn {
  padding: 10px 24px;
  border-radius: 7px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-lt); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(13, 31, 60, 0.25); }
.btn-secondary { background: var(--smoke); color: var(--text); }
.btn-secondary:hover { background: var(--border); }
.btn-gold { background: var(--gold); color: var(--white); }
.btn-gold:hover { background: #b8852e; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(201, 151, 58, 0.4); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Preview document ── */
.preview-doc {
  padding: 36px 40px 0;
  font-size: 0.85rem;
  line-height: 1.7;
}
.preview-doc h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--navy);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--navy);
}
.preview-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; font-size: 0.8rem; }
.preview-table td { padding: 8px 12px; border: 1px solid var(--border); vertical-align: top; }
.preview-table td:first-child { font-weight: 600; background: var(--smoke); width: 50%; }
.preview-section-head {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--navy);
  margin: 22px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--smoke);
}
.preview-items { padding-left: 18px; }
.preview-items li { margin-bottom: 6px; font-size: 0.82rem; page-break-inside: avoid; break-inside: avoid; }
.preview-terms-page {
  background: var(--smoke);
  margin: 28px -40px 0;
  padding: 14px 40px 18px;
  page-break-before: always;
  break-before: page;
}
.preview-terms-page .preview-section-head { font-size: 0.92rem; margin-bottom: 8px; padding-bottom: 7px; }
.preview-terms { padding-left: 18px; margin-top: 5px; list-style-type: lower-roman; }
.preview-terms li { margin-bottom: 4px; font-size: 0.7rem; line-height: 1.42; }
.preview-terms li strong { font-size: 0.7rem; }
/* ── Toggle switch ── */
.toggle-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.toggle-switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: var(--border); border-radius: 22px; transition: background 0.2s; }
.toggle-slider::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: transform 0.2s; }
.toggle-switch input:checked + .toggle-slider { background: var(--navy); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }
.toggle-label { font-size: 0.82rem; font-weight: 500; color: var(--text); }

.preview-total-box {
  background: var(--smoke);
  border-top: 2px solid var(--navy);
  border-bottom: 2px solid var(--navy);
  margin: 24px -40px 0;
  padding: 0;
}
.preview-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 22px;
}
.preview-total-sub span { font-size: 0.78rem; color: var(--muted); }
.preview-total-disc span { font-size: 0.78rem; color: var(--navy); font-style: italic; font-weight: 600; }
.preview-total-main {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  padding-bottom: 14px;
}
.preview-total-main span { font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.preview-total-main strong { font-family: 'Playfair Display', serif; font-size: 1.5rem; color: var(--navy); }
.preview-note {
  font-size: 0.73rem;
  color: var(--muted);
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--smoke);
  border-radius: 6px;
  border-left: 3px solid var(--gold);
}

/* ── Hint box ── */
.hint {
  background: rgba(201, 151, 58, 0.08);
  border: 1px solid rgba(201, 151, 58, 0.25);
  border-radius: 7px;
  padding: 10px 14px;
  font-size: 0.78rem;
  color: #7a5a1e;
  margin-bottom: 18px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.hint-icon { font-size: 0.9rem; flex-shrink: 0; }

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--navy);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(60px);
  opacity: 0;
  transition: all 0.3s;
  z-index: 999;
  border-left: 3px solid var(--gold);
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ── Section bullets (builder display) ── */
.section-bullets-list {
  list-style: disc;
  padding-left: 22px;
  margin: 6px 0 14px;
}
.section-bullets-list li {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 3px;
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .main { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .field-row { grid-template-columns: 1fr; }
  .field-row.thirds { grid-template-columns: 1fr; }
  .radio-grid { grid-template-columns: 1fr; }
}

/* ── Print page header (hidden on screen) ── */
.print-page-header { display: none; }

/* ── Print ── */
/* Top margin = 0 suppresses browser title/URL header.
   Bottom margin gives space for the @bottom-center page counter.
   Explicit empty @top-* and @bottom-left/right clear browser decorations. */
@page {
  margin: 0mm 0mm 0.38in 0mm;
  @top-left   { content: ""; }
  @top-center { content: ""; }
  @top-right  { content: ""; }
  @bottom-left  { content: ""; }
  @bottom-right { content: ""; }
  @bottom-center {
    content: "Page " counter(page) " of " counter(pages);
    font-family: 'DM Sans', sans-serif;
    font-size: 8pt;
    color: #9CA3AF;
  }
}

@media print {
  .print-page-header { display: none; }

  .header, .progress-wrap, .sidebar, .btn-row, .panel-head, .proposal-bar { display: none !important; }
  .main { grid-template-columns: 1fr; padding: 0; max-width: 100%; }
  .panel { box-shadow: none; }
  body { background: white; margin: 0; padding: 0.4in 0.75in 0.15in; }

  /* Tighten terms page to fit on one printed page */
  .preview-terms-page { padding-top: 10px; padding-bottom: 10px; }
  .preview-terms-page .preview-section-head { margin-bottom: 5px; padding-bottom: 5px; }
  .preview-terms { margin-top: 3px; }
  .preview-terms li { margin-bottom: 2px; line-height: 1.32; }
}
