/* ─── Signlab Quote Calculator — styles ─────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #0051bc;
  --primary-dark: #003d8f;
  --primary-light: #7bb6ff;
  --navy: #001d61;
  /* Brand-blue scale — used by the cost stacked-bar segments and the
     sign-in tile avatars. Aliased to the primary blues above. */
  --color-brand-300: #7bb6ff;
  --color-brand-500: #0051bc;
  --color-brand-700: #003d8f;
  --text: #1f2937;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-alt: #f9fafb;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --success: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04), 0 1px 1px rgba(15,23,42,0.03);
  --shadow: 0 2px 8px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-lg: 0 12px 32px rgba(15,23,42,0.10), 0 4px 12px rgba(15,23,42,0.06);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* overflow-x clip must live on <html> ONLY. On <body> it makes body its own
   scroll container; combined with overscroll-behavior:none (below), wheel and
   keyboard scrolling then die — body becomes the scroll target, has nothing
   to scroll, and is barred from chaining the scroll up to <html>. */
html { overflow-x: hidden; scroll-padding-top: 80px; }
img, iframe, video { max-width: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px; line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout shell ─────────────────────────────────────────────────── */
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* ─── Top nav (logged-in) ──────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════
   Topbar — denser, modern, clearer hierarchy
   Brand blue background. Logo only on left. Nav text-links in middle.
   Primary "New quote" CTA + user-avatar dropdown on right.
   ═══════════════════════════════════════════════════════════════════ */
.topbar {
  background: var(--primary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
  position: sticky; top: 0; z-index: 50;
  /* Add the iOS status-bar safe area on top of the 60px content height,
     rather than letting the padding (set below) eat into it. */
  height: calc(60px + env(safe-area-inset-top));
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center;
  padding: 0 24px; gap: 24px; height: 100%;
}

/* ─── Logo ───────────────────────────────────────────────────────── */
.topbar-logo {
  display: inline-flex; align-items: center;
  height: 100%; padding: 0 4px;
  flex: 0 0 auto;
  text-decoration: none;
}
.topbar-logo img {
  height: 22px; width: auto;
  filter: brightness(0) invert(1);
}

/* ─── Nav links (text only with subtle pill on active) ───────────── */
.topbar-nav {
  display: flex; align-items: center;
  gap: 2px; height: 100%;
  flex: 1; min-width: 0;
}
@media (max-width: 760px) { .topbar-nav { display: none; } }

.topbar-nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  font-size: 13.5px; font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.topbar-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}
.topbar-nav-link.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 600;
}
.topbar-nav-link.is-active::after {
  content: ''; position: absolute;
}

.topbar-nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 999px;
  font-size: 10px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.topbar-nav-link.is-active .topbar-nav-badge {
  background: #fff; color: var(--primary);
}

/* ─── Right-side actions ─────────────────────────────────────────── */
.topbar-actions {
  display: flex; align-items: center; gap: 10px;
  flex: 0 0 auto;
}

/* Primary CTA — white pill on blue */
.topbar-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: #fff; color: var(--primary);
  border-radius: 8px;
  font-size: 13px; font-weight: 700;
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  white-space: nowrap;
}
.topbar-cta:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.06);
}
.topbar-cta:active { transform: translateY(0); }

/* ─── User menu ──────────────────────────────────────────────────── */
.topbar-user-menu { position: relative; }
.topbar-avatar-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 3px 8px 3px 3px;
  cursor: pointer; font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.topbar-avatar-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.24);
}
.topbar-user-menu.is-open .topbar-avatar-btn {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.32);
}
.topbar-avatar {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: var(--primary);
  font-weight: 700; font-size: 12px;
  border-radius: 50%;
}
.topbar-caret {
  color: rgba(255, 255, 255, 0.7);
  transition: transform 0.2s;
}
.topbar-user-menu.is-open .topbar-caret { transform: rotate(180deg); color: #fff; }

/* Dropdown card */
.topbar-dropdown {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  width: 280px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  animation: topbar-dropdown-in 0.18s ease;
  z-index: 60;
}
@keyframes topbar-dropdown-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.topbar-dropdown-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.topbar-dropdown-avatar {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff;
  font-weight: 700; font-size: 14px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.topbar-dropdown-meta { min-width: 0; }
.topbar-dropdown-name { font-size: 14px; font-weight: 700; color: var(--text); }
.topbar-dropdown-role {
  font-size: 11px; color: var(--primary);
  font-weight: 600; margin-top: 2px;
}
.topbar-dropdown-email {
  font-size: 11px; color: var(--text-muted);
  margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 16px;
  background: transparent; border: none;
  color: var(--text); font: inherit; font-size: 13px;
  text-align: left; cursor: pointer;
  text-decoration: none;
  transition: background 0.12s;
}
.topbar-dropdown-item:hover {
  background: var(--surface-alt);
  text-decoration: none;
}
.topbar-dropdown-item-danger { color: var(--danger); }
.topbar-dropdown-item-danger:hover { background: rgba(220, 38, 38, 0.06); }
.topbar-dropdown-item svg {
  flex: 0 0 14px;
  opacity: 0.7;
}

/* Search trigger in the topbar (opens the command palette) */
.topbar-search {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 8px 6px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer; font-family: inherit; font-size: 13px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  min-width: 180px;
}
.topbar-search:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}
.topbar-search-label { flex: 1; text-align: left; }
.topbar-search-kbd {
  display: inline-flex; align-items: center;
  padding: 2px 6px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 10px; font-weight: 600;
  font-family: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", monospace;
  color: rgba(255, 255, 255, 0.85);
}

/* On narrow screens (mobile bottom-nav takes over), keep the CTA + avatar
   compact. Hide the "New quote" text label and show just the + icon. */
@media (max-width: 760px) {
  .topbar-search-label, .topbar-search-kbd { display: none; }
  .topbar-search { min-width: 0; padding: 8px; }
}
@media (max-width: 520px) {
  .topbar-cta span { display: none; }
  .topbar-cta { padding: 7px 10px; }
}

/* ─── Main content ─────────────────────────────────────────────────── */
.main { flex: 1; max-width: 1280px; width: 100%; margin: 0 auto; padding: 32px 28px 80px; }
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 28px; gap: 24px; flex-wrap: wrap;
}
.page-title { font-size: 28px; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.page-subtitle { color: var(--text-muted); margin: 4px 0 0; font-size: 14px; }
.page-actions { display: flex; gap: 10px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm);
}
.card-section { padding: 20px 24px; border-bottom: 1px solid var(--border); }
.card-section:last-child { border-bottom: none; }
.card-padded { padding: 24px; }
.card-inset { background: var(--surface-alt); border-radius: var(--radius); padding: 16px; }

/* ─── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px;
  font-weight: 600; font-size: 14px;
  border: 1px solid transparent;
  transition: all 0.15s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--border-strong); background: var(--surface-alt); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface-alt); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: rgba(220,38,38,0.06); border-color: rgba(220,38,38,0.3); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 24px; font-size: 15px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-icon-only { padding: 8px; }

/* ─── Stats grid (dashboard) ───────────────────────────────────────── */

/* ─── Tables ───────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-weight: 600; font-size: 11px;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}
.table td {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover { background: var(--surface-alt); cursor: pointer; }
.table tbody tr:last-child td { border-bottom: none; }
.table-quote-number { font-weight: 600; color: var(--primary); }

/* ─── Status pills ─────────────────────────────────────────────────── */
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pill-draft { background: #f3f4f6; color: #4b5563; }
.pill-sent  { background: #dbeafe; color: #1e40af; }
.pill-won   { background: #dcfce7; color: #166534; }
.pill-lost  { background: #fee2e2; color: #991b1b; }

/* ─── Filters & search ─────────────────────────────────────────────── */
.toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 18px;
}
.search {
  position: relative; flex: 1; min-width: 220px; max-width: 340px;
}
.search input {
  width: 100%; padding: 10px 14px 10px 38px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text);
  outline: none; transition: border-color 0.15s;
}
.search input:focus { border-color: var(--primary); }
.search svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint);
}
.filter-group { display: flex; gap: 6px; }
.filter-chip {
  padding: 8px 14px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  transition: all 0.15s;
}
.filter-chip:hover { color: var(--text); }
.filter-chip.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.filter-select {
  padding: 8px 32px 8px 12px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: var(--text);
  cursor: pointer; outline: none; appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
}
.filter-select:focus { border-color: var(--primary); }

/* ─── Empty states ─────────────────────────────────────────────────── */
.empty {
  text-align: center; padding: 60px 24px;
  color: var(--text-muted);
}
.empty-title { font-size: 16px; font-weight: 600; color: var(--text); margin: 12px 0 6px; }
.empty-text { font-size: 14px; max-width: 380px; margin: 0 auto 18px; }

/* ─── Login ────────────────────────────────────────────────────────── */
.login-shell {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 15% -5%, rgba(0, 81, 188, 0.16), transparent 55%),
    radial-gradient(circle at 95% 105%, rgba(123, 182, 255, 0.22), transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(123, 182, 255, 0.04), transparent 70%),
    var(--bg);
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 24px 60px -16px rgba(0, 81, 188, 0.25), 0 4px 12px rgba(0, 0, 0, 0.04);
  width: 100%; max-width: 460px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  overflow: hidden;
  animation: login-card-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes login-card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.login-banner {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.12), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.08), transparent 50%),
    linear-gradient(135deg, var(--primary), var(--navy, #003c8c));
  padding: 36px 24px 32px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.login-banner::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.08) 1px, transparent 0);
  background-size: 24px 24px;
  pointer-events: none;
  opacity: 0.7;
}
.login-banner img {
  height: 42px;
  display: block;
  margin: 0 auto;
  position: relative;
  /* Logo artwork is blue; the banner is blue. Flatten it to solid white
     so the wordmark reads cleanly (same treatment as the boot splash). */
  filter: brightness(0) invert(1);
}
.login-banner-tag {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  opacity: 0.85;
  position: relative;
}
.login-body { padding: 32px 36px 36px; }
.login-tagline {
  text-align: center; font-size: 13px; color: var(--text-muted);
  margin-bottom: 28px;
  font-style: italic;
}
.login-title {
  font-size: 26px; font-weight: 800; text-align: center;
  margin: 6px 0 4px;
  letter-spacing: -0.025em;
  color: var(--text);
}
.login-sub {
  text-align: center; color: var(--text-muted);
  font-size: 14px; margin-bottom: 26px;
  line-height: 1.5;
}
.login-quick-label {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px;
}
.login-quick {
  display: flex; flex-direction: column; gap: 8px;
}
.login-quick-btn {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  text-align: left; width: 100%;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
}
.login-quick-btn .topbar-avatar {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--color-brand-700));
  color: #fff;
  font-size: 13px;
  flex: 0 0 auto;
}
.login-quick-btn:hover {
  border-color: var(--primary);
  background: rgba(0, 81, 188, 0.03);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px -4px rgba(0, 81, 188, 0.25);
}
.login-quick-btn:active { transform: translateY(0); }
.login-quick-btn::after {
  content: '→';
  margin-left: auto;
  color: var(--text-faint);
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.18s, color 0.18s;
}
.login-quick-btn:hover::after {
  color: var(--primary);
  transform: translateX(2px);
}
.login-quick-name { font-weight: 700; font-size: 14px; color: var(--text); }
.login-quick-role {
  font-size: 11px; color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-top: 2px;
}
.login-divider {
  text-align: center; margin: 24px 0 16px; color: var(--text-faint);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  display: flex; align-items: center; gap: 10px;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form input {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  outline: none; transition: border-color 0.15s;
}
.login-form input:focus { border-color: var(--primary); }
.login-pin {
  font-size: 11px; color: var(--text-faint); text-align: center; margin-top: 14px;
}
.login-hint {
  font-size: 12px; color: var(--text-muted);
  text-align: center; min-height: 18px;
  transition: color 0.15s;
}
.login-hint-error { color: var(--danger) !important; }
.btn:disabled { cursor: not-allowed; opacity: 0.55; }

.login-back-btn {
  background: transparent; border: none; padding: 4px 8px;
  font-size: 12px; color: var(--text-muted); cursor: pointer;
  margin-bottom: 12px; align-self: flex-start;
  border-radius: 6px;
}
.login-back-btn:hover { background: var(--surface-alt); color: var(--text); }
.login-greeting {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; background: var(--surface-alt);
  border-radius: 12px; margin-bottom: 16px;
}
.login-avatar-lg {
  width: 48px; height: 48px; font-size: 16px;
}
.login-greeting-name { font-size: 16px; font-weight: 700; color: var(--text); }
.login-greeting-role {
  font-size: 12px; color: var(--text-muted);
  text-transform: capitalize; margin-top: 2px;
}
.login-pin-title {
  font-size: 18px; font-weight: 700; margin: 4px 0 6px;
  color: var(--text);
}
/* PIN view: greeting card, title, description, inputs and hint all share
   one left edge so the card reads as a single clean column. The name-pick
   view keeps its centred treatment, so these overrides are scoped. */
.login-body--pin .login-sub,
.login-body--pin .login-hint { text-align: left; }
.login-pin-shake { animation: pin-shake 0.4s ease; border-color: var(--danger) !important; }
@keyframes pin-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ─── Settings: category rows ────────────────────────────────────── */
#ss-cat-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.ss-cat-row {
  display: flex; align-items: center; gap: 8px;
}
.ss-cat-icon {
  width: 56px; flex: 0 0 56px;
  text-align: center; font-size: 18px;
}
.ss-cat-name { flex: 1; }

/* ─── Settings: user rows (compact) ──────────────────────────────── */
#ss-user-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.ss-user-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.ss-user-avatar {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff;
  font-weight: 700; font-size: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.ss-user-grid {
  display: grid; grid-template-columns: 1.2fr 1.4fr 70px 95px 70px;
  gap: 6px; flex: 1; min-width: 0; align-items: center;
}
@media (max-width: 900px) {
  .ss-user-grid { grid-template-columns: 1fr 1fr; }
}
.ss-user-init  { text-align: center; }
.ss-user-rep   { text-align: center; }
.ss-user-actions {
  display: flex; align-items: center; gap: 8px;
  flex: 0 0 auto;
}
.ss-user-pin-status {
  font-size: 11px; font-weight: 600;
  color: var(--text-faint);
  padding: 2px 8px; border-radius: 4px;
  background: var(--surface-alt);
  white-space: nowrap;
}
.ss-user-pin-status.is-set { color: var(--accent-green, #1a8f4a); background: rgba(26, 143, 74, 0.08); }

/* ─── Settings: danger section ───────────────────────────────────── */
.pe-section-danger {
  background: rgba(220, 38, 38, 0.03);
  border-color: rgba(220, 38, 38, 0.18);
}
.pe-section-danger .pe-section-title { color: var(--danger); }

/* ─── Calculator stepped form (mirrors QuoteSection.jsx) ───────────── */
.calc-shell {
  display: grid; grid-template-columns: 1fr 380px;
  gap: 24px; align-items: start;
}
/* Cost-breakdown step hides the live price rail and runs full-width. */
.calc-shell-full { grid-template-columns: 1fr; }
@media (max-width: 900px) {
  .calc-shell { grid-template-columns: 1fr; }
}

.calc-main {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  box-shadow: var(--shadow-sm); min-height: 520px;
}
.calc-steps {
  display: flex; gap: 6px; margin-bottom: 12px;
}
.calc-dot {
  flex: 1; height: 6px; border-radius: 3px;
  background: var(--border); padding: 0; border: none;
  transition: background 0.2s, transform 0.1s;
  cursor: pointer;
}
.calc-dot.reachable:hover { background: var(--text-faint); }
.calc-dot.reachable:active { transform: scaleY(1.4); }
.calc-dot.active { background: var(--primary); cursor: default; }
.calc-dot.done   { background: var(--primary); opacity: 0.5; }
.calc-dot.done.reachable:hover { opacity: 0.75; }
.calc-dot[disabled] { cursor: not-allowed; opacity: 0.4; }

.calc-label-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.calc-label {
  font-size: 11px; font-weight: 600; color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.calc-jump {
  display: inline-block; padding: 6px 28px 6px 10px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-size: 12px; font-weight: 500;
  appearance: none; outline: none; cursor: pointer; max-width: 60%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 8px center;
}
.calc-jump:focus { border-color: var(--primary); }
.calc-jump:hover { border-color: var(--text-faint); }
.calc-title {
  font-size: 26px; font-weight: 700; margin: 6px 0 20px;
  letter-spacing: -0.02em; line-height: 1.2;
}
.calc-hint {
  font-size: 13px; color: var(--text-muted); margin-bottom: 16px;
}

.chip-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 12px 18px; border-radius: 12px;
  background: var(--surface-alt); border: 1.5px solid var(--border);
  font-size: 14px; font-weight: 500; color: var(--text);
  text-align: left; transition: all 0.15s;
  position: relative; padding-right: 44px;
}
.chip:hover { border-color: var(--primary-light); background: #fff; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.chip.selected {
  background: rgba(0,81,188,0.06); border-color: var(--primary); color: var(--primary);
}
.chip.selected::after {
  content: '✓'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-weight: 700; color: var(--primary);
}
/* "No equipment needed" — set apart from the real gear with a dashed border. */
.chip-none { border-style: dashed; color: var(--text-muted); }
.chip-none.selected { color: var(--primary); }
.chip-price {
  display: block; font-size: 12px; color: var(--text-muted); font-weight: 500;
  margin-top: 2px;
}
.chip.selected .chip-price { color: var(--primary); opacity: 0.8; }

.calc-input {
  width: 100%; padding: 14px 16px;
  border: 1.5px solid var(--border); border-radius: 12px;
  font-size: 16px; outline: none; transition: border-color 0.15s;
  background: var(--surface);
}
.calc-input:focus { border-color: var(--primary); }
.calc-number-wrap { display: flex; align-items: center; gap: 10px; max-width: 280px; }
.calc-number-wrap input { flex: 1; }
.calc-number-suffix {
  font-size: 14px; color: var(--text-muted); font-weight: 500;
}
.calc-stepper {
  display: inline-flex; align-items: center; gap: 0;
  border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden;
}
.calc-stepper button {
  width: 44px; height: 48px; background: var(--surface); border: none;
  font-size: 20px; font-weight: 500; color: var(--text);
}
.calc-stepper button:hover { background: var(--surface-alt); color: var(--primary); }
.calc-stepper input {
  width: 70px; height: 48px; border: none; text-align: center;
  font-size: 17px; font-weight: 600; outline: none;
  border-left: 1.5px solid var(--border); border-right: 1.5px solid var(--border);
}

.calc-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.calc-field-label {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}

.calc-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border);
}
.calc-nav-hint { font-size: 12px; color: var(--text-faint); }

/* ─── Live price panel (right column) ──────────────────────────────── */
.price-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 0;
  box-shadow: var(--shadow-sm); overflow: hidden;
  position: sticky; top: 90px;
}
.price-panel-header {
  background: linear-gradient(135deg, var(--primary), var(--navy));
  color: #fff; padding: 20px 22px;
}
.price-panel-product {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  opacity: 0.85; font-weight: 600;
}
.price-panel-total {
  font-size: 30px; font-weight: 700; margin: 4px 0 0;
  letter-spacing: -0.02em;
}
.price-panel-total-unit {
  font-size: 14px; font-weight: 600; opacity: 0.85;
  letter-spacing: 0.02em; margin-left: 4px;
}
.price-panel-gst {
  font-size: 12px; opacity: 0.85; margin-top: 2px;
}
.mobile-price-bar-total-unit {
  font-size: 12px; font-weight: 600; opacity: 0.75;
  margin-left: 3px;
}

.price-panel-body { padding: 16px 22px; }
.price-panel-sizes { padding: 12px 22px; border-bottom: 1px solid var(--border); background: var(--surface-alt); }
.price-panel-sizes-head { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.price-panel-sizerow { display: flex; justify-content: space-between; font-size: 13px; padding: 2px 0; }
.mobile-price-bar-body .price-panel-sizes { background: transparent; padding: 8px 0 12px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.price-line {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; font-size: 13px;
  border-bottom: 1px dashed var(--border);
}
.price-line:last-child { border-bottom: none; }
.price-line-label { color: var(--text); }
.price-line-cat {
  font-size: 10px; color: var(--text-faint); text-transform: uppercase;
  letter-spacing: 0.04em; margin-bottom: 1px;
}
.price-line-amount { font-weight: 600; white-space: nowrap; }
.price-empty {
  text-align: center; color: var(--text-muted); padding: 20px 0;
  font-size: 13px;
}
.price-panel-footer {
  border-top: 1px solid var(--border); padding: 16px 22px;
  background: var(--surface-alt);
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px;
}
.price-panel-row { display: flex; justify-content: space-between; }
.price-panel-row.total { font-weight: 700; font-size: 15px; padding-top: 6px; border-top: 1px solid var(--border); margin-top: 4px; }

/* ─── Product picker ──────────────────────────────────────────────── */
.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.product-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  cursor: pointer; transition: all 0.15s; text-align: left;
  display: flex; flex-direction: column; gap: 8px;
}
.product-card:hover {
  border-color: var(--primary); transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.product-card-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(0,81,188,0.12), rgba(123,182,255,0.18));
  color: var(--primary);
  font-size: 22px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px;
}
.product-card-name { font-weight: 600; font-size: 15px; }
.product-card-cat {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); font-weight: 600;
}
.product-card-desc { font-size: 13px; color: var(--text-muted); }
.product-card-meta {
  display: flex; gap: 12px; margin-top: 10px;
  font-size: 12px; color: var(--text-faint);
}

/* ─── Quote preview (PDF-like document) ───────────────────────────── */
.quote-doc-wrap { display: flex; gap: 24px; align-items: flex-start; }
@media (max-width: 900px) { .quote-doc-wrap { flex-direction: column; } }
.quote-doc {
  flex: 1;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 48px 56px; box-shadow: var(--shadow);
  max-width: 820px; min-height: 1100px;
}
.quote-doc-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 24px; border-bottom: 3px solid var(--primary);
  margin-bottom: 24px;
}
.quote-doc-header img { height: 38px; }
.quote-doc-meta { text-align: right; font-size: 12px; color: var(--text-muted); }
.quote-doc-meta-num {
  font-size: 18px; color: var(--primary); font-weight: 700;
}
.quote-doc-section { margin-bottom: 28px; }
.quote-doc-section h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin: 0 0 8px;
}
.quote-doc-two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  margin-bottom: 28px;
}
.quote-doc-block-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin: 0 0 6px;
}
.quote-doc-block-body { font-size: 14px; line-height: 1.6; }
.quote-doc-table {
  width: 100%; border-collapse: collapse; margin-bottom: 16px;
}
.quote-doc-table th {
  background: var(--surface-alt); padding: 10px 12px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); text-align: left; font-weight: 600;
}
.quote-doc-table th:last-child, .quote-doc-table td:last-child { text-align: right; }
.quote-doc-table td {
  padding: 12px; font-size: 13px; border-bottom: 1px solid var(--border);
}
.quote-doc-totals {
  margin-left: auto; max-width: 340px; font-size: 14px;
}
.quote-doc-totals-row {
  display: flex; justify-content: space-between; padding: 6px 0;
}
.quote-doc-totals-row.grand {
  border-top: 2px solid var(--primary); margin-top: 8px; padding-top: 12px;
  font-size: 18px; font-weight: 700; color: var(--primary);
}
.quote-doc-footer {
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-muted); line-height: 1.6;
}

.quote-doc-actions {
  width: 240px; display: flex; flex-direction: column; gap: 10px;
  position: sticky; top: 90px;
}
.quote-doc-actions .btn { justify-content: center; }

/* Print styles for PDF "Save as PDF" via browser print */
@media print {
  body { background: #fff; }
  .topbar, .quote-doc-actions, .page-header, .calc-nav { display: none !important; }
  .main { padding: 0; max-width: none; }
  .quote-doc { box-shadow: none; border: none; padding: 32px; max-width: none; }
  .quote-doc-wrap { display: block; }
}

/* ─── Admin product edit ──────────────────────────────────────────── */
.admin-grid {
  display: grid; grid-template-columns: 240px 1fr; gap: 24px;
  align-items: start;
}
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }
.admin-side-nav {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 8px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 2px;
}
.admin-side-nav a {
  padding: 10px 14px; border-radius: 8px;
  color: var(--text); font-weight: 500; font-size: 14px;
  display: flex; align-items: center; gap: 10px;
}
.admin-side-nav a:hover { background: var(--surface-alt); text-decoration: none; }
.admin-side-nav a.active { background: rgba(0,81,188,0.08); color: var(--primary); }

.step-editor {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 14px; overflow: hidden;
}
.step-editor-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.step-editor-head h4 {
  margin: 0; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.step-editor-head .step-num {
  background: var(--primary); color: #fff;
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.step-editor-body { padding: 16px 18px; }
.option-row {
  display: grid; grid-template-columns: 1fr 100px 130px 36px;
  gap: 8px; align-items: center; margin-bottom: 6px;
}
.option-row input {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; outline: none;
}
.option-row input:focus { border-color: var(--primary); }
.option-row-remove {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  width: 36px; height: 36px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}
.option-row-remove:hover { color: var(--danger); border-color: rgba(220,38,38,0.3); }

.form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
/* Stacked full-width fields on the customer step (Address, Installation address,
   Notes) are standalone form-groups; .form-row supplies its own spacing, so give
   these the same vertical rhythm instead of letting them sit flush. */
.cf-form-main > .form-group { margin-bottom: 14px; }
.cf-form-main > .form-group:last-child { margin-bottom: 0; }
.form-group label {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.form-group input, .form-group select, .form-group textarea {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; outline: none; background: var(--surface);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { min-height: 80px; resize: vertical; }

/* ─── Modals / toasts ──────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,0.5);
  z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn 0.15s;
}
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  max-width: 480px; width: 100%; padding: 28px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s;
}
.modal-wide { max-width: 760px; }
.modal-title { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.modal-body { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* "Email to customer" compose box (Corey 2026-05-31) */
.email-compose-meta {
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
  font-size: 13px; color: var(--text); line-height: 1.7;
}
.email-compose-label {
  display: inline-block; min-width: 64px; color: var(--text-faint);
  font-weight: 600;
}
.email-compose-msglabel {
  display: block; font-weight: 600; font-size: 13px; color: var(--text);
  margin-bottom: 6px;
}
.email-compose-textarea {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 200px;
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
  font: inherit; font-size: 14px; line-height: 1.55; color: var(--text);
  background: #fff; outline: none; transition: border-color 120ms ease;
}
.email-compose-textarea:focus { border-color: var(--primary); }
.email-compose-hint { margin-top: 8px; font-size: 12px; color: var(--text-faint); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 12px 20px;
  border-radius: 10px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); z-index: 200;
  display: flex; align-items: center; gap: 10px;
  animation: slideUp 0.25s;
}
.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }
/* Inside the calculator the mobile price bar is pinned to the bottom; lift the
   toast clear of it so it never covers the live total or the Undo button. */
@media (max-width: 900px) {
  body.in-calculator .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
}

.toast-undo {
  margin-left: 8px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #fff;
  border-radius: 5px;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.toast-undo:hover { background: rgba(255, 255, 255, 0.28); }

.toast-icon {
  width: 18px; height: 18px;
  flex: 0 0 18px;
  animation: toast-icon-in 0.25s ease;
}
@keyframes toast-icon-in {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════
   Display-weight numbers — premium tabular money values
   Applied to grand totals, stat headlines, breakdown totals, and the
   live price panel hero number.
   ═══════════════════════════════════════════════════════════════════ */
.cb-tot-row-grand .cb-tot-amt,
.price-panel-total,
.fq-totals-grand span:last-child,
.pp-cb-grand > div:last-child {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum" 1, "ss01" 1;
}

/* Lift the hero numbers on the live price panel */
.price-panel-total { font-size: 32px; font-weight: 800; line-height: 1; }
.cb-tot-row-grand .cb-tot-amt { font-size: 24px; font-weight: 800; }
.fq-totals-grand span:last-child { font-size: 22px; font-weight: 800; }

/* Animated value pulse — applied briefly via JS when a number changes. */
.num-pulse {
  animation: num-pulse-anim 0.5s ease;
}
@keyframes num-pulse-anim {
  0%   { color: var(--primary); transform: scale(1); }
  40%  { color: var(--primary); transform: scale(1.06); }
  100% { color: inherit; transform: scale(1); }
}

/* ─── Cost breakdown stacked bar (where the money goes) ──────────── */
.cb-bar {
  display: flex; align-items: stretch;
  height: 28px; border-radius: 8px; overflow: hidden;
  margin-top: 12px;
  box-shadow: inset 0 0 0 1px var(--border);
  background: var(--surface-alt);
}
.cb-bar:empty { display: none; }
.cb-bar-seg {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-width: 4px;
  transition: flex-basis 0.4s ease, filter 0.15s;
  overflow: hidden;
}
.cb-bar-seg:hover { filter: brightness(1.08); }
.cb-bar-seg-label {
  font-size: 10px; font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}


@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.25s; }
.slide-in { animation: slideUp 0.3s; }

/* ─── Small helpers ───────────────────────────────────────────────── */
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); font-size: 12px; }
.bold  { font-weight: 600; }
.row   { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer-sm { height: 8px; } .spacer { height: 16px; } .spacer-lg { height: 32px; }
.center { text-align: center; }
.right { text-align: right; }
.flex-grow { flex: 1; }
.hidden { display: none !important; }

/* ─── New v2 styles: leads, categories, dimensions, cost breakdown ─── */

/* Nav badges */
.nav-badge {
  display: inline-block; margin-left: 6px;
  background: rgba(255,255,255,0.2); color: #fff;
  border-radius: 999px; padding: 1px 7px;
  font-size: 11px; font-weight: 700;
}
/* legacy topbar selectors removed in the 2026-05-20 redesign. */


/* Tag pills */
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: rgba(0,81,188,0.08); color: var(--primary);
  font-size: 12px; font-weight: 600;
}
.tag-muted {
  background: var(--surface-alt); color: var(--text-muted);
}

/* Lead card */
.lead-card {
  display: grid; grid-template-columns: 1fr 220px; gap: 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}
.lead-card:hover { border-color: var(--border-strong); }
.lead-card-compact {
  margin-bottom: 8px;
  box-shadow: none;
}
.lead-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 8px; gap: 12px;
}
.lead-card-tags { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.lead-card-message {
  font-size: 13px; color: var(--text);
  line-height: 1.5;
  background: var(--surface-alt); padding: 10px 12px;
  border-radius: 10px;
}
.lead-card-actions {
  display: flex; flex-direction: column; gap: 8px;
  justify-content: center;
}
.lead-card-actions .btn { justify-content: center; }
@media (max-width: 700px) {
  .lead-card { grid-template-columns: 1fr; }
}

/* Category grid (quoting category picker) */
.category-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.category-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 28px 18px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer; transition: all 0.15s;
  text-align: center;
}
.category-card:hover {
  border-color: var(--primary);
  background: rgba(0,81,188,0.03);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.category-card.selected {
  border-color: var(--primary); background: rgba(0,81,188,0.06);
}
.category-icon { font-size: 40px; line-height: 1; }
.category-name { font-weight: 600; font-size: 15px; }
.category-count {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* Product pick grid (under chosen category) */
.product-pick-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.product-pick-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px; text-align: left;
  cursor: pointer; transition: all 0.15s;
}
.product-pick-card:hover {
  border-color: var(--primary); transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.product-pick-card.selected {
  border-color: var(--primary); background: rgba(0,81,188,0.04);
}
.product-pick-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.product-pick-desc { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.product-pick-cat {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 6px;
}

/* Smart-hybrid picker layout (Corey 2026-05-29) */
.product-pick { display: flex; flex-direction: column; gap: 18px; }
.product-pick-toolbar { display: flex; justify-content: flex-end; }
.product-pick-search {
  width: 100%; max-width: 360px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 999px; padding: 10px 16px; font: inherit; font-size: 14px;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.product-pick-search:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,81,188,0.12);
}
.product-pick-section { display: flex; flex-direction: column; gap: 10px; }
.product-pick-section-head {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-faint);
}
.product-pick-recents {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.product-pick-card-compact { padding: 12px 14px; }
.product-pick-card-compact .product-pick-desc { display: none; }
.product-pick-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding-bottom: 6px;
}
.pick-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 999px; padding: 8px 14px;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--text);
  cursor: pointer; transition: all 0.12s;
}
.pick-chip:hover { border-color: var(--primary); color: var(--primary); }
.pick-chip.is-on {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.pick-chip-count {
  display: inline-flex; min-width: 18px; height: 18px;
  align-items: center; justify-content: center; padding: 0 5px;
  background: rgba(0,0,0,0.08); border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.pick-chip.is-on .pick-chip-count {
  background: rgba(255,255,255,0.22);
}
@media (max-width: 640px) {
  .product-pick-chips {
    flex-wrap: nowrap; overflow-x: auto;
    margin: 0 -16px; padding: 0 16px 8px;
    scrollbar-width: none;
  }
  .product-pick-chips::-webkit-scrollbar { display: none; }
  .pick-chip { flex: 0 0 auto; }
}

/* Dimensions step */
.dim-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 12px;
  align-items: end;
  max-width: 640px;
}
.dim-x, .dim-eq {
  font-size: 22px; font-weight: 700; color: var(--primary);
  padding-bottom: 14px;
  align-self: end;
}
.calc-input-readonly {
  background: var(--surface-alt) !important;
  border-color: var(--border) !important;
  color: var(--primary); font-weight: 700;
  cursor: default;
}
@media (max-width: 700px) {
  .dim-grid { grid-template-columns: 1fr; }
  .dim-x, .dim-eq { display: none; }
}

/* Multi-panel additions on the size step */
.dim-extra-label {
  display: inline-block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 8px;
}
.dim-extra-label-primary {
  margin-top: 4px;
}
.dim-extra {
  margin-top: 22px; padding-top: 18px;
  border-top: 1px dashed var(--border);
}
.dim-extra-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.dim-extra-remove {
  background: transparent; border: none; padding: 4px 8px;
  color: var(--text-faint); font-size: 12px; font-weight: 600;
  cursor: pointer; border-radius: 6px;
}
.dim-extra-remove:hover { color: #c43; background: rgba(204, 64, 51, 0.08); }
.dim-add-row {
  margin-top: 26px; padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.dim-add-prompt {
  font-size: 15px; font-weight: 700; color: var(--text);
}
.dim-add-btn { white-space: nowrap; }

/* Cost breakdown (key screen) */
.cost-breakdown {
  display: grid; grid-template-columns: 1fr 320px; gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .cost-breakdown { grid-template-columns: 1fr; }
}
.cost-breakdown-section { }
.cost-breakdown-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); margin: 0 0 12px; font-weight: 700;
}
.cost-breakdown-lines {
  display: flex; flex-direction: column; gap: 8px;
}
.cost-line {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: grid; grid-template-columns: 1fr auto; gap: 12px;
  align-items: center;
}
.cost-line-label { min-width: 0; }
.cost-line-label .bold { font-size: 14px; }
.cost-line-label .faint {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-faint); font-weight: 600;
}
.cost-line-inputs {
  display: flex; align-items: center; gap: 6px;
}
.cost-line-field {
  display: flex; flex-direction: column; gap: 2px;
}
.cost-line-field label {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); font-weight: 600;
}
.cost-line-field input {
  width: 70px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; outline: none;
  background: var(--surface);
  text-align: right;
}
.cost-line-field input:focus { border-color: var(--primary); }
.cost-line-x, .cost-line-eq {
  color: var(--text-muted); font-size: 14px;
  align-self: end; padding-bottom: 6px;
}
.cost-line-amount {
  font-weight: 700; min-width: 90px; text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.cost-line-remove {
  width: 28px; height: 28px; border-radius: 6px;
  background: none; border: 1px solid var(--border);
  color: var(--text-muted); font-size: 16px;
  margin-left: 4px;
  display: flex; align-items: center; justify-content: center;
}
.cost-line-remove:hover { color: var(--danger); border-color: rgba(220,38,38,0.3); }
@media (max-width: 700px) {
  .cost-line { grid-template-columns: 1fr; }
  .cost-line-inputs { justify-content: flex-end; }
}

/* Cost breakdown totals (right side) */
.cost-breakdown-totals {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  position: sticky; top: 90px;
  display: flex; flex-direction: column; gap: 8px;
}
.cost-breakdown-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; font-size: 13px;
}
.cost-row-label { color: var(--text-muted); }
.cost-row-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.cost-row-input input {
  width: 80px; padding: 5px 8px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; outline: none;
  text-align: right;
}
.cost-row-input input:focus { border-color: var(--primary); }
.cost-row-total {
  border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px;
  font-size: 15px;
}
.cost-row-total .cost-row-label, .cost-row-total .cost-row-amount {
  color: var(--text); font-weight: 700;
}
.cost-row-grand {
  border-top: 2px solid var(--primary); padding-top: 12px; margin-top: 4px;
  font-size: 18px;
}
.cost-row-grand span:first-child { font-weight: 700; }
.cost-row-grand span:last-child {
  color: var(--primary); font-weight: 700; font-variant-numeric: tabular-nums;
}

/* Quote summary grid (in PDF preview) */
.quote-summary-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; font-size: 13px;
}
.quote-summary-grid .faint {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); font-weight: 600; display: block; margin-bottom: 2px;
}

/* ─── Resume draft card on dashboard ──────────────────────────────── */
.resume-card {
  background: linear-gradient(135deg, var(--primary), var(--navy));
  color: #fff; border-radius: var(--radius-lg);
  padding: 18px 22px; margin-bottom: 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; box-shadow: var(--shadow);
}
.resume-card-eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  opacity: 0.8; font-weight: 600; margin-bottom: 4px;
}
.resume-card-title { font-weight: 700; font-size: 16px; }
.resume-card-sub { font-size: 13px; opacity: 0.85; margin-top: 2px; }
.resume-card-right { display: flex; gap: 8px; flex-shrink: 0; }
.resume-card-right .btn-primary {
  background: #fff !important; color: var(--primary) !important;
}
.resume-card-right .btn-ghost {
  color: rgba(255,255,255,0.85) !important;
}
.resume-card-right .btn-ghost:hover {
  background: rgba(255,255,255,0.12) !important;
  color: #fff !important;
}
@media (max-width: 700px) {
  .resume-card { flex-direction: column; align-items: stretch; gap: 12px; }
  .resume-card-right { width: 100%; }
  .resume-card-right .btn { flex: 1; justify-content: center; }
}

/* ─── Bottom nav (mobile native-feel tabs) ────────────────────────── */
/* Shown at exactly the width the topbar nav links disappear (760px), so
   navigation hands over seamlessly — no dead zone where neither exists
   (iPad mini portrait sits at 744px). */
.bottom-nav { display: none; }
@media (max-width: 760px) {
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 80;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 12px rgba(15,23,42,0.04);
  }
  .bottom-nav-tab {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 2px;
    padding: 10px 4px; min-height: 56px;
    color: var(--text-muted); text-decoration: none;
    position: relative; transition: color 0.15s;
    background: none; border: none; font: inherit; cursor: pointer;
  }
  /* The + tab replaces the floating FAB at this width (one bottom-edge
     control, not two stacked ones), and content gets clearance so the last
     row is never hidden behind the bar. */
  .fab { display: none; }
  .main { padding-bottom: 120px; }
  body.in-calculator .bottom-nav { display: none; }
  /* Toasts sit ABOVE the tab bar, not on top of it (delete-undo toasts were
     covering the + / Saved tabs for their full 5s lifetime). The calculator
     keeps its own taller offset (price bar) defined elsewhere. */
  body:not(.in-calculator) .toast { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .bottom-nav-tab:hover { text-decoration: none; }
  .bottom-nav-tab.active { color: var(--primary); }
  .bottom-nav-icon { font-size: 22px; line-height: 1; }
  .bottom-nav-label { font-size: 10px; font-weight: 600; }
  .bottom-nav-badge {
    position: absolute; top: 6px; right: 22%;
    background: var(--danger); color: #fff;
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 999px;
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
  }
  .bottom-nav-primary { color: #fff !important; }
  .bottom-nav-primary .bottom-nav-icon {
    background: var(--primary); color: #fff;
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; font-weight: 300;
    margin-top: -16px;
    box-shadow: 0 4px 12px rgba(0,81,188,0.4);
  }
  .bottom-nav-primary .bottom-nav-label {
    color: var(--primary); font-weight: 700;
  }
}

/* ─── Mobile sticky price bar (in calculator) ─────────────────────── */
.mobile-price-bar { display: none; }
@media (max-width: 900px) {
  .calc-shell .price-panel { display: none; }
  .mobile-price-bar {
    display: block;
    position: fixed; left: 0; right: 0;
    bottom: 0;
    background: var(--primary); color: #fff;
    z-index: 70;
    border-top: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 -8px 24px rgba(0,81,188,0.25);
    padding-bottom: env(safe-area-inset-bottom);
  }
}
@media (max-width: 700px) {
  /* When bottom nav is rendered, lift price bar above it. Inside the
     calculator we hide the bottom nav (body.in-calculator) so the price
     bar can sit flush at bottom: 0. */
  body:not(.in-calculator) .mobile-price-bar { bottom: 0; }
  body.in-calculator .mobile-price-bar { bottom: 0; }
}
.mobile-price-bar-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 12px 18px; min-height: 56px;
  background: none; border: none; color: #fff;
  font-family: inherit; text-align: left;
}
.mobile-price-bar-info { flex: 1; min-width: 0; }
.mobile-price-bar-product {
  font-size: 11px; opacity: 0.85; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mobile-price-bar-total { font-size: 20px; font-weight: 700; line-height: 1.2; }
.mobile-price-bar-arrow {
  font-size: 18px; padding: 4px 8px; opacity: 0.85;
}
.mobile-price-bar.expanded { max-height: 60vh; overflow-y: auto; }
.mobile-price-bar-body {
  padding: 4px 18px 16px; font-size: 13px;
  background: rgba(0,0,0,0.08);
}
.mobile-pb-line {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 6px 0;
}
.mobile-pb-line .muted { opacity: 0.75; }
.mobile-pb-divider {
  height: 1px; background: rgba(255,255,255,0.18);
  margin: 6px 0;
}

/* ─── Mobile padding & touch tweaks ───────────────────────────────── */
@media (max-width: 900px) {
  /* leave space at bottom for mobile price bar.
     ~80px collapsed bar + 56px bottom nav (when shown). The .in-calculator
     hides the bottom nav so we need less space there. */
  body:not(.in-calculator) .calc-shell { padding-bottom: 150px; }
  body.in-calculator .calc-shell { padding-bottom: 100px; }

  /* iOS zooms in on focus when an input's font-size is below 16px and
     never zooms back. Phone (≤700px) had this safety net already; iPad
     portrait (768-900px) didn't, which is why earlier pillars had to
     hunt individual offenders. Scoped to rep-flow surfaces (.cf-*,
     .calc-shell, .quote-doc, .fq-*) so dense admin rows on iPad portrait
     keep their compact sizing. !important matches the phone block's
     pattern and is the only way to beat 0,1,1 selectors like
     .form-group input. */
  .cf-form-wrap input, .cf-form-wrap textarea, .cf-form-wrap select,
  .cf-step input, .cf-step textarea, .cf-step select,
  .calc-shell input:not([type="checkbox"]):not([type="radio"]),
  .calc-shell textarea, .calc-shell select,
  .quote-doc input:not([type="checkbox"]):not([type="radio"]),
  .quote-doc textarea, .quote-doc select,
  .fq-input { font-size: 16px !important; }

  /* Buttons reachable with a finger at iPad portrait too. Base .btn is
     ~38px tall — fine with a mouse, borderline on touch. */
  .btn { min-height: 44px; }
  .btn-lg { min-height: 52px; }
}

@media (max-width: 700px) {
  /* Outside calculator: leave room for the floating + button + safe area.
     Inside calculator: no FAB, but the mobile price bar reserves ~80px. */
  body { padding-bottom: calc(env(safe-area-inset-bottom) + 16px); }
  body.in-calculator { padding-bottom: 0; }
  .main { padding: 16px 12px 24px; }
  body.in-calculator .main { padding-bottom: 96px; }

  .topbar-inner { padding: 0 14px; }

  .calc-main, .quote-doc { padding: 18px 14px; min-height: 0; }
  .calc-steps { margin-bottom: 10px; gap: 4px; }
  .calc-dot { height: 10px; border-radius: 5px; }
  .calc-label { font-size: 10px; }
  .calc-title { font-size: 20px; margin: 4px 0 12px; line-height: 1.25; }
  .calc-hint { font-size: 13px; }

  .page-title { font-size: 20px; }
  .page-subtitle { font-size: 12px; }
  .page-header {
    margin-bottom: 14px; flex-direction: row; align-items: center;
    justify-content: space-between; gap: 8px;
  }
  .page-actions { width: auto; gap: 8px; flex: 0 0 auto; }
  .page-actions .btn { padding: 8px 14px; min-height: 40px; }
  /* In the calculator, the customer/product subtitle is duplicated lower
     in the card. Drop it on mobile to reclaim vertical space. */
  body.in-calculator .page-subtitle { display: none; }
  body.in-calculator .page-header > div:first-child { min-width: 0; flex: 1; }
  body.in-calculator .page-title {
    font-size: 16px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .quote-doc { padding: 24px 20px; min-height: auto; }
  .quote-doc-wrap { display: block; }
  .quote-doc-actions { width: 100%; margin-top: 16px; position: static; }
  .quote-doc-two-col { grid-template-columns: 1fr; gap: 18px; }
  .option-row { grid-template-columns: 1fr; gap: 4px; }
  /* Two-up form rows (customer name/company, email/phone) stack on phones
     so the inputs never spill past the card edge. */
  .form-row { grid-template-columns: 1fr; }
  .table th:nth-child(3), .table td:nth-child(3),
  .table th:nth-child(4), .table td:nth-child(4) { display: none; }

  /* iOS: 16px+ inputs to prevent zoom on focus */
  input, textarea, select {
    font-size: 16px !important;
  }
  .form-group input, .form-group textarea, .form-group select { font-size: 16px !important; }

  /* Bigger chip targets, full-width stacked */
  .chip-grid { gap: 8px; }
  .chip {
    width: 100%; min-height: 56px;
    padding: 14px 18px; font-size: 15px;
    padding-right: 44px;
  }
  .calc-stepper button { width: 48px; height: 48px; font-size: 22px; }
  .calc-stepper input { width: 70px; height: 48px; font-size: 18px; }

  /* Buttons taller for thumbs */
  .btn { min-height: 44px; padding: 10px 16px; }
  .btn-lg { min-height: 52px; }
  .btn-sm { min-height: 44px; }

  /* Calc nav row stacks on small screens */
  .calc-nav { flex-direction: column-reverse; gap: 10px; align-items: stretch; }
  .calc-nav > div { width: 100%; }
  .calc-nav .btn { width: 100%; justify-content: center; }

  /* Login card padding */
  .login-card { padding: 28px 22px; }
  .login-quick-btn { min-height: 56px; }

  /* Lead card stacks */
  .lead-card-head { flex-direction: column; align-items: flex-start; gap: 6px; }

  /* Category cards in 2 cols on small */
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .category-card { padding: 22px 14px; }
  .category-icon { font-size: 32px; }

  /* Cost line on mobile - stack label on first row, inputs below */
  .cost-line { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px; }
  .cost-line-label { width: 100%; }
  .cost-line-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto;
    align-items: center; gap: 6px;
  }
  .cost-line-field { min-width: 0; }
  .cost-line-field label { display: none; }
  .cost-line-field input { width: 100%; min-width: 0; }
  .cost-line-x, .cost-line-eq { font-size: 14px; padding: 0 2px; }
  .cost-line-amount { font-size: 14px; }
  .cost-line-remove {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
  }

  /* Custom flow steps on mobile */
  .cf-inline { flex-direction: column; align-items: stretch; gap: 8px; }
  .cf-math { font-size: 13px; }
  .cf-toggle { width: 100%; }
  .cf-toggle-btn { flex: 1; min-height: 48px; font-size: 15px; }
  .cf-access-row { grid-template-columns: 1fr; row-gap: 6px; }
  .cf-access-total { grid-column: 1 / -1; text-align: right; padding-top: 4px; border-top: 1px dashed var(--border); }
  .cf-map { height: 220px; }
}

/* ─── Custom flow (Composite Panel v1) ─────────────────────────── */
.cf-step { display: flex; flex-direction: column; gap: 22px; max-width: 720px; }
.cf-field { display: flex; flex-direction: column; gap: 10px; }
.cf-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
}
.cf-hint { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.cf-fact {
  font-size: 14px; color: var(--text); padding: 12px 14px;
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: 10px; display: flex; align-items: center; justify-content: space-between;
}
.cf-fact strong { font-size: 16px; color: var(--primary); }

.cf-inline {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.cf-math { font-size: 14px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.cf-math strong { color: var(--text); font-weight: 600; }
.cf-math-labour { flex-wrap: wrap; margin-top: 14px; }
.cf-field-spaced { margin-top: 18px; }

/* Yes/No toggle (segmented) */
.cf-toggle {
  display: inline-flex; padding: 4px; background: var(--surface-alt);
  border: 1px solid var(--border); border-radius: 999px;
  gap: 4px;
}
.cf-toggle-btn {
  appearance: none; border: 0; background: transparent;
  font: inherit; cursor: pointer; padding: 8px 22px;
  border-radius: 999px; color: var(--text-muted); font-weight: 600; font-size: 14px;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
  min-width: 80px;
}
.cf-toggle-btn:hover { color: var(--text); }
.cf-toggle-btn.selected {
  background: var(--primary); color: #fff; box-shadow: 0 1px 3px rgba(0,29,97,0.18);
}

/* Conditional reveal */
.cf-conditional {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 260ms ease, opacity 200ms ease;
  display: flex; flex-direction: column; gap: 14px;
}
.cf-conditional.open {
  max-height: 2400px; opacity: 1;
  padding-top: 4px;
}

/* Stepper override - tighter, modern */
.cf-stepper { min-width: 160px; }
.cf-stepper input { font-weight: 600; }

/* Money input with $ prefix */
.cf-money {
  display: inline-flex; align-items: stretch; gap: 0;
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: #fff; transition: border-color 120ms ease;
  max-width: 220px;
}
.cf-money:focus-within { border-color: var(--primary); }
.cf-money-prefix {
  display: flex; align-items: center; padding: 0 14px;
  background: var(--surface-alt); color: var(--text-muted);
  font-weight: 600; font-size: 16px; border-right: 1px solid var(--border);
}
.cf-money input {
  border: 0; outline: none; padding: 12px 14px;
  font-size: 16px; font-weight: 600; width: 100%; background: transparent;
}
.cf-money-sm { max-width: 140px; }
.cf-money-sm .cf-money-prefix { padding: 0 10px; font-size: 14px; }
.cf-money-sm input { padding: 8px 10px; font-size: 16px; }

/* USD → AUD converter on contractor sub-quote steps */
.cf-fx-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cf-fx-row .cf-money { max-width: 160px; }
.cf-fx-rate { max-width: 120px; }
.cf-fx-op { font-size: 18px; color: var(--text-muted); font-weight: 600; }
.cf-fx-aud { font-size: 18px; font-weight: 700; color: var(--text); }

/* Map / address block */
.cf-map-wrap { gap: 6px; }
.cf-map {
  width: 100%; height: 260px; border: 0; border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.cf-map-link {
  font-size: 13px; color: var(--primary); font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px; padding-top: 4px;
}
.cf-map-link:hover { text-decoration: underline; }
.cf-map-placeholder {
  font-size: 13px; color: var(--text-muted); padding: 24px;
  text-align: center; background: var(--surface-alt);
  border: 1px dashed var(--border); border-radius: 12px;
}

/* Access equipment grid */
.cf-supplier-note {
  background: #f6f8fb;
  border: 1px solid var(--border, #d6dae1); border-left: 3px solid var(--brand, #0051bc);
  border-radius: 8px; padding: 10px 14px; font-size: 14px; line-height: 1.5; color: #2a3340;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; justify-content: space-between;
}
.cf-supplier-text { white-space: pre-line; }
.cf-supplier-doc {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--brand, #0051bc); font-weight: 600;
  background: #fff; border: 1px solid var(--border, #d6dae1);
  border-radius: 8px; padding: 8px 12px; max-width: 100%;
}
.cf-supplier-doc:hover { border-color: var(--brand, #0051bc); }
.cf-supplier-doc-icon { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.cf-supplier-doc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-pick-search { margin-bottom: 12px; }
/* Rep-facing picker category cards (folder workflow, no folder iconography) */
.cf-pick-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 4px; }
.cf-pick-folder {
  position: relative; display: flex; align-items: center; gap: 12px;
  text-align: left; padding: 15px 16px 15px 18px; background: #fff; cursor: pointer;
  border: 1px solid var(--border, #d6dae1); border-radius: 14px;
  transition: border-color .14s, box-shadow .14s, transform .08s;
}
.cf-pick-folder::before {
  content: ""; position: absolute; left: 0; top: 11px; bottom: 11px; width: 3px;
  border-radius: 0 3px 3px 0; background: #dde3ec; transition: background .14s;
}
.cf-pick-folder:hover { border-color: var(--brand, #0051bc); box-shadow: 0 6px 18px rgba(15,23,42,0.08); }
.cf-pick-folder:hover::before { background: var(--brand, #0051bc); }
.cf-pick-folder.has-sel::before { background: var(--brand, #0051bc); }
.cf-pick-folder.has-sel { border-color: rgba(0,81,188,0.35); }
.cf-pick-folder:active { transform: translateY(1px); }
.cf-pick-folder-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cf-pick-folder-name { font-weight: 600; font-size: 15px; color: #0f172a; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-pick-folder-meta { font-size: 12.5px; color: #64748b; }
.cf-pick-folder-badge {
  flex: 0 0 auto; padding: 3px 9px; border-radius: 999px;
  background: rgba(0,81,188,0.10); color: var(--brand, #0051bc); font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
}
.cf-pick-folder-chev { flex: 0 0 auto; color: #cbd5e1; display: inline-flex; transition: transform .14s, color .14s; }
.cf-pick-folder:hover .cf-pick-folder-chev { color: var(--brand, #0051bc); transform: translateX(2px); }
.cf-pick-folderbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cf-pick-folder-back {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f1f5f9; border: 1px solid var(--border, #d6dae1); cursor: pointer;
  color: #334155; font-weight: 600; font-size: 13px; padding: 7px 12px; border-radius: 999px;
  transition: background .12s, border-color .12s, color .12s;
}
.cf-pick-folder-back:hover { background: #e7edf5; border-color: var(--brand, #0051bc); color: var(--brand, #0051bc); }
.cf-pick-folderbar-name { font-weight: 700; font-size: 15px; color: #0f172a; }
/* Builder folder rail */
.pe-pick-folrail { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 14px; }
.pe-pick-folchip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px;
  background: #eef2f8; border: 1px solid var(--border, #d6dae1); border-radius: 999px; font-size: 13px;
}
.pe-pick-folchip-unfiled { background: #f6f8fb; color: #6b7280; }
.pe-pick-folchip-name { font-weight: 600; }
.pe-pick-folchip-btn { background: none; border: none; cursor: pointer; color: #6b7280; font-size: 13px; line-height: 1; padding: 2px 4px; }
.pe-pick-folchip-btn:hover { color: #111827; }
.pe-pick-folder-sel { max-width: 150px; }
.pe-pick-row.is-dragging { opacity: 0.5; }
.pe-pick-folchip.is-drop-target { border-color: var(--brand, #0051bc); background: #dbe7fb; }
.cf-pick-search-input {
  width: 100%; box-sizing: border-box; padding: 10px 14px;
  border: 1px solid var(--border, #d6dae1); border-radius: 999px;
  font-size: 15px; background: #fff;
}
.cf-pick-search-input:focus { outline: none; border-color: var(--brand, #0051bc); box-shadow: 0 0 0 3px rgba(0,81,188,0.12); }
.cf-access-grid { display: flex; flex-direction: column; gap: 10px; }
.cf-access-row {
  display: grid; grid-template-columns: 1fr 110px;
  align-items: center; gap: 14px; padding: 14px;
  border: 1px solid var(--border); border-radius: 12px;
  background: #fff; transition: border-color 120ms ease, background 120ms ease;
}
.cf-access-row:hover { border-color: var(--primary-light); }
.cf-access-row.checked { border-color: var(--primary); background: rgba(0,81,188,0.04); }
.cf-access-row input[type="checkbox"] {
  width: 22px; height: 22px; cursor: pointer; accent-color: var(--primary);
}
.cf-access-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cf-access-name { font-weight: 600; font-size: 15px; color: var(--text); }
.cf-access-rate { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }
.cf-access-total { font-weight: 700; font-size: 16px; color: var(--text); text-align: right; }

/* Plain textarea in custom flow */
.cf-field textarea {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font: inherit; font-size: 15px; resize: vertical;
  min-height: 120px; background: #fff; outline: none; transition: border-color 120ms ease;
}
.cf-field textarea:focus { border-color: var(--primary); }
.cf-field > input[type="text"] {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font: inherit; font-size: 15px; background: #fff;
  outline: none; transition: border-color 120ms ease;
}
.cf-field > input[type="text"]:focus { border-color: var(--primary); }

/* Hour preset chips */
.cf-preset-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 4px 0 10px;
}
.cf-preset {
  appearance: none; cursor: pointer;
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: 10px 18px; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--text-muted); transition: all 120ms ease;
  min-height: 40px;
}
.cf-preset:hover { border-color: var(--primary-light); color: var(--text); transform: translateY(-1px); }
.cf-preset.selected {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(0,81,188,0.25);
}

/* JS map (replaces iframe embed) */
.cf-map-js {
  height: 320px; width: 100%; border-radius: 12px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  background: var(--surface-alt);
}
.cf-address-wrap { position: relative; }
.cf-address-input {
  /* Make tap target generous on phones */
  font-size: 16px; min-height: 48px; padding: 14px 16px;
}
.cf-address-status {
  font-size: 12px; color: var(--text-muted);
  padding: 4px 2px 0;
  min-height: 16px;
}
.cf-distance-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(0,81,188,0.08), rgba(0,81,188,0.04));
  border: 1px solid rgba(0,81,188,0.2);
  border-radius: 999px;
  font-size: 14px; color: var(--text);
  align-self: flex-start;
  margin-top: 6px;
}
.cf-distance-pill strong { font-weight: 700; color: var(--primary); }
.cf-distance-icon {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 14px;
}

/* Google Places autocomplete dropdown — ensure it sits above modals */
.pac-container {
  z-index: 10000 !important;
  font-family: 'Inter', system-ui, sans-serif;
  border-radius: 10px;
  margin-top: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border: 1px solid var(--border);
  max-width: calc(100vw - 24px);
}
.pac-item {
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  line-height: 1.4;
  border-top: 1px solid var(--surface-alt);
}
.pac-item:first-child { border-top: 0; }
.pac-item:hover, .pac-item-selected { background: var(--surface-alt); }
.pac-item-query { font-weight: 600; color: var(--text); }

/* Price-change pulse on live total */
@keyframes priceBump {
  0%   { transform: scale(1);   color: inherit; }
  30%  { transform: scale(1.08); color: var(--primary-light, #7bb6ff); }
  100% { transform: scale(1);   color: inherit; }
}
.price-panel-total.pulse,
.mobile-price-bar-total.pulse {
  animation: priceBump 380ms ease-out;
}

/* ─── Cost breakdown redesign (Corey-clean) ────────────────────── */
.cb-wrap {
  display: grid; grid-template-columns: 1fr 340px; gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .cb-wrap { grid-template-columns: 1fr; gap: 18px; }
}

.cb-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.cb-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 18px 14px;
  box-shadow: var(--shadow-sm);
}
.cb-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.cb-card-title {
  margin: 0; font-size: 14px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-muted);
}
.cb-card-add {
  appearance: none; border: 1px solid var(--border); background: #fff;
  color: var(--primary); font-weight: 600; font-size: 13px;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  transition: all 120ms ease;
}
.cb-card-add:hover { border-color: var(--primary); background: rgba(0,81,188,0.04); }
.cb-card-count {
  font-size: 12px; color: var(--text-muted);
  background: var(--surface-alt); border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 999px;
}

/* Cost lines - tight horizontal rows, amounts column-aligned */
.cb-lines { display: flex; flex-direction: column; }
.cb-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 110px 32px;
  gap: 14px; align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.cb-line:first-child { border-top: 0; padding-top: 4px; }
.cb-line-name { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cb-line-text {
  font-size: 14px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis;
}
.cb-line-tag {
  font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 600;
}
.cb-line-supplier {
  font-size: 11px; color: var(--text-faint); font-weight: 500;
  margin-top: 2px; font-style: italic;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cb-line-calc {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px 8px;
}
.cb-num {
  border: 0; background: transparent; outline: none;
  font: inherit; font-weight: 600; font-size: 14px;
  width: 64px; text-align: right; padding: 4px 2px;
  font-variant-numeric: tabular-nums;
}
.cb-num:focus { color: var(--primary); }
.cb-op {
  color: var(--text-faint); font-size: 14px; font-weight: 600;
  padding: 0 2px;
}
.cb-line-amount {
  text-align: right; font-weight: 700; font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.cb-line-remove {
  width: 30px; height: 30px; border-radius: 8px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-faint); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 120ms ease;
}
.cb-line-remove:hover { color: var(--danger); border-color: rgba(220,38,38,0.3); background: rgba(220,38,38,0.04); }

@media (max-width: 700px) {
  .cb-line {
    grid-template-columns: 1fr auto;
    grid-template-areas: "name remove" "calc amount";
    gap: 8px 12px; padding: 14px 0;
  }
  .cb-line-name { grid-area: name; }
  .cb-line-calc { grid-area: calc; justify-self: start; }
  .cb-line-amount { grid-area: amount; align-self: center; }
  .cb-line-remove { grid-area: remove; align-self: start; }
  .cb-num { width: 60px; font-size: 16px; }
}

/* Totals card - clean rows mirroring Corey's mock */
.cb-totals {
  position: sticky; top: 90px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 20px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 900px) {
  .cb-totals { position: static; }
}
.cb-tot-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; font-size: 14px;
}
.cb-tot-label { color: var(--text-muted); }
.cb-tot-label-atcost { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.cb-tot-sub { font-size: 11px; color: var(--text-faint); margin-left: 4px; }
.cb-tot-amt { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.cb-tot-amt-neg { color: var(--accent-green, #1a8f4a); }
.cb-tot-row-input { padding: 2px 0; }
.cb-tot-cluster {
  display: inline-flex; align-items: center; gap: 6px;
}
.cb-tot-affix {
  font-size: 12px; color: var(--text-faint); font-weight: 600;
  background: var(--surface-alt); border: 1px solid var(--border);
  width: 28px; height: 30px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
}
.cb-tot-cluster input {
  width: 60px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; outline: none; text-align: right;
  font-weight: 600;
}
.cb-tot-cluster input:focus { border-color: var(--primary); }
.cb-tot-cluster .cb-tot-amt { min-width: 78px; text-align: right; }
.cb-tot-divider { height: 1px; background: var(--border); margin: 4px 0; }
.cb-tot-section {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-faint);
  padding: 10px 0 4px; margin-top: 2px;
  border-top: 1px dashed var(--border);
}
.cb-tot-row-flat .cb-tot-label { color: var(--text); }

/* ─── Rep-flow summary pane in the product builder ────────────────── */
.pp-flow {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.pp-flow-head { margin-bottom: 8px; }
.pp-flow-title { font-size: 13px; font-weight: 700; color: var(--text); }
.pp-flow-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.pp-flow-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.pp-flow-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 7px 10px;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, border-color 0.1s;
}
.pp-flow-row:hover {
  background: var(--surface-alt);
  border-color: var(--border);
}
.pp-flow-row-disabled {
  cursor: default;
  opacity: 0.6;
}
.pp-flow-row-disabled:hover { background: transparent; border-color: transparent; }
.pp-flow-num {
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--text-faint);
  min-width: 22px;
}
.pp-flow-label { flex: 1; font-size: 13px; color: var(--text); }
.pp-flow-tag {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 999px;
  background: var(--surface-alt); border: 1px solid var(--border);
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.pp-flow-tag-cond {
  background: rgba(234, 88, 12, 0.08); color: #c2410c;
  border-color: rgba(234, 88, 12, 0.18);
}

/* Flash animation for the section a flow-row jumps to. */
.pe-flash {
  animation: pe-flash 1.1s ease-out;
}
@keyframes pe-flash {
  0%   { box-shadow: 0 0 0 0 rgba(0,81,188,0.5); background-color: rgba(0,81,188,0.10); }
  100% { box-shadow: 0 0 0 8px rgba(0,81,188,0); background-color: transparent; }
}

/* ─── Variant pick step (rep-facing, in calculator) ───────────────── */
.variant-list {
  display: flex; flex-direction: column; gap: 18px;
  max-width: 560px; margin: 0 auto;
}
.variant-group { display: flex; flex-direction: column; gap: 4px; }
.variant-group-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-faint);
  padding: 0 4px 6px;
}
.variant-row {
  display: block; width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  font-size: 14px; color: var(--text); line-height: 1.35;
  transition: border-color 0.1s, background 0.1s;
}
.variant-row:hover {
  border-color: var(--primary);
  background: rgba(0,81,188,0.04);
}
.variant-row.selected {
  border-color: var(--primary);
  background: rgba(0,81,188,0.08);
  font-weight: 600;
}
.variant-row-custom {
  margin-top: 6px;
  font-style: italic;
  color: var(--text-muted);
  border-style: dashed;
}

/* ─── Multi-question (stepGroup) step layout in the rep flow ──────── */
.cf-step-group {
  display: flex; flex-direction: column; gap: 18px;
}
.cf-step-group-item {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.cf-step-group-item:last-child { border-bottom: 0; padding-bottom: 0; }
.cf-step-group-head { margin-bottom: 8px; }
.cf-step-group-q { font-size: 14px; font-weight: 700; color: var(--text); }
.cf-step-group-hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.45; }

/* ─── Cost breakdown $0-lines collapsible footer ──────────────────── */
.cb-zero-toggle {
  display: block; width: 100%;
  margin: 6px 0 0;
  padding: 7px 10px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 12px; font-weight: 600;
  color: var(--text-faint);
  text-align: left;
  cursor: pointer;
}
.cb-zero-toggle:hover { color: var(--text-muted); border-color: var(--text-faint); }

/* ─── Variants section in the product builder ─────────────────────── */
.pe-section-hint {
  font-size: 12px; color: var(--text-muted); line-height: 1.5;
  margin: -4px 0 10px;
}
.pe-var-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 10px;
}
.pe-var-head { display: flex; align-items: center; gap: 8px; }
.pe-var-name { flex: 1; }
.pe-var-dims { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pe-var-dim { display: inline-flex; align-items: center; gap: 4px; }
.pe-var-dim-label { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.pe-var-dim-suffix { font-size: 11px; color: var(--text-faint); }
.pe-var-dim input { width: 70px; }
.pe-var-dim-x { color: var(--text-faint); font-weight: 700; }
.pe-var-answers {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px 10px;
  background: var(--surface); border-radius: 8px;
  border: 1px solid var(--border);
}
.pe-var-answers-text { flex: 1; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.pe-var-edit-answers { white-space: nowrap; }

/* ─── Variant answers modal (Corey preset picker) ─────────────────── */
.pe-vam-list { display: flex; flex-direction: column; gap: 14px; max-height: 60vh; overflow-y: auto; }
.pe-vam-row {
  display: flex; flex-direction: column; gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.pe-vam-row:last-child { border-bottom: 0; }
.pe-vam-q { font-size: 13px; font-weight: 600; color: var(--text); }
.pe-vam-checks { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.pe-vam-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.pe-vam-num { display: inline-flex; align-items: center; gap: 6px; }
.pe-vam-num input { width: 120px; }
.pe-vam-num-unit { font-size: 11px; color: var(--text-faint); }

/* ─── Building blocks: cost-item card ─────────────────────────────────── */
/* Sections on the Blocks page used to butt right up against each other —
   add a margin so Equipment / Cost items / Saved blocks each get
   breathing room. Section margin lives here (one declaration) instead of
   inside each section so the rule applies wherever .pe-section is used in
   a vertical list. */
.section-subnav ~ .pe-section { margin-top: 18px; }
.pe-section + .pe-section { margin-top: 18px; }

.bl-ci-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 12px;
}
.bl-ci-card:last-child { margin-bottom: 0; }
.bl-ci-head {
  display: flex; align-items: flex-end; gap: 12px;
  margin-bottom: 16px;
}
.bl-ci-name-field { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.bl-ci-folder-field { width: 150px; flex: none; display: flex; flex-direction: column; gap: 6px; margin-bottom: 0; }
.bl-ci-head .pe-ci-del { margin-bottom: 4px; }
.bl-ci-card.is-dragging { opacity: 0.5; }
.bl-ci-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.bl-ci-field { display: flex; flex-direction: column; gap: 6px; }
.bl-ci-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text-muted);
}
.bl-ci-auto-note {
  font-size: 13px; color: var(--text-muted);
  font-style: italic;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
}
.bl-ci-always {
  display: inline-flex; align-items: center; gap: 8px;
  padding-top: 6px;
  font-size: 13px; color: var(--text);
  cursor: pointer;
}
.bl-ci-always input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer;
}
@media (max-width: 640px) {
  .bl-ci-grid { grid-template-columns: 1fr 1fr; }
  .bl-ci-grid .bl-ci-field:nth-child(3) { grid-column: 1 / -1; }
}

/* ─── Cost item linked-to-library state ────────────────────────────── */
.pe-ci-card-linked {
  background: linear-gradient(180deg, rgba(0,81,188,0.04), transparent);
  border-color: rgba(0,81,188,0.22);
}
.pe-ci-linktag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  background: rgba(0,81,188,0.1); color: var(--primary);
  white-space: nowrap;
}
.pe-ci-linktag-broken {
  background: rgba(220, 38, 38, 0.10); color: #b91c1c;
}
.pe-ci-card-linked input[readonly],
.pe-ci-card-linked select[disabled] {
  background: var(--surface-alt);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ─── Equipment question body in the product builder ─────────────── */
.pe-q-eq {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 8px;
}
.pe-q-eq-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
}
.pe-q-eq-title { font-size: 13px; font-weight: 600; color: var(--text); }
.pe-q-eq-edit { font-size: 12px; color: var(--primary); text-decoration: none; }
.pe-q-eq-edit:hover { text-decoration: underline; }
.pe-q-eq-list { display: flex; flex-direction: column; gap: 4px; }
.pe-eq-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 4px;
  font-size: 13px;
  cursor: pointer;
}
.pe-eq-row input[type=checkbox] { margin: 0; cursor: pointer; }
.pe-eq-row-name { flex: 1; color: var(--text); }
.pe-eq-row-meta { color: var(--text-faint); font-size: 11px; }
.pe-q-eq-hint { font-size: 11px; color: var(--text-faint); margin-top: 8px; }

/* ─── Product template picker (shown for + New product) ───────────── */
.pe-tpl-shell {
  max-width: 880px; margin: 0 auto; padding: 18px 8px 60px;
}
.pe-tpl-back { margin-bottom: 18px; }
.pe-tpl-title {
  font-size: 28px; font-weight: 700; margin: 4px 0 6px;
}
.pe-tpl-sub {
  color: var(--text-muted); margin: 0 0 24px;
}
.pe-tpl-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.pe-tpl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 18px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.08s, box-shadow 0.12s;
  display: flex; flex-direction: column; gap: 8px;
}
.pe-tpl-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15,23,42,0.08);
}
.pe-tpl-card:active { transform: translateY(0); }
.pe-tpl-icon { font-size: 28px; line-height: 1; }
.pe-tpl-label { font-size: 17px; font-weight: 700; color: var(--text); }
.pe-tpl-summary { font-size: 13px; color: var(--text-muted); line-height: 1.45; }

/* "optional" tag next to a non-required field's label */
.cf-optional {
  font-weight: 500; font-size: 11px;
  color: var(--text-faint);
  text-transform: lowercase; letter-spacing: 0;
  margin-left: 6px;
}

/* ─── Floating + New quote (FAB) ──────────────────────────────────── */
.fab {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 4px);
  width: 56px; height: 56px;
  background: var(--primary); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px rgba(0,81,188,0.38), 0 2px 6px rgba(15,23,42,0.18);
  z-index: 80;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.fab:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(0,81,188,0.42), 0 4px 8px rgba(15,23,42,0.20); }
.fab:active { transform: translateY(0); }
/* The desktop topbar already has a visible "+ New quote" CTA, so save the
   bottom-right corner for mobile thumbs only. */
@media (min-width: 901px) { .fab { display: none; } }
/* In-calculator the price bar owns the bottom; FAB hides via renderFab(),
   but if anything else mounts one make sure it stays clear. */
body.in-calculator .fab { display: none; }

/* Dropdown nav items inherit the same row look as Settings/Sign out but with
   a small badge for outstanding quotes. */
.topbar-dropdown-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  margin-left: 6px;
  background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700;
  border-radius: 999px;
}

/* Required-field block: short visual pulse on the step body so the rep sees
   where the missing answer is when Continue is rejected. */
.cf-step.is-blocking {
  animation: cf-shake 0.36s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  border-radius: 12px;
  box-shadow: 0 0 0 2px var(--danger, #e11d48), 0 0 0 6px rgba(225, 29, 72, 0.14);
}
@keyframes cf-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}
.cb-tot-row-sub .cb-tot-label { color: var(--text); font-weight: 600; }
.cb-tot-row-sub .cb-tot-amt { font-size: 15px; }
.cb-tot-row-bold .cb-tot-label { font-weight: 600; }
.cb-tot-row-bold .cb-tot-amt { font-weight: 700; }
.cb-tot-row-gst { font-size: 13px; color: var(--text-muted); }
.cb-tot-row-gst .cb-tot-amt { color: var(--text-muted); font-weight: 600; }
.cb-tot-row-grand {
  border-top: 2px solid var(--primary);
  padding-top: 12px; margin-top: 6px;
}
.cb-tot-row-grand .cb-tot-label { color: var(--text); font-size: 14px; font-weight: 700; }
.cb-tot-row-grand .cb-tot-amt { color: var(--primary); font-size: 22px; }

/* Site photos uploader */
.cb-images-card { }
.cb-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}
.cb-image-tile {
  position: relative; aspect-ratio: 1 / 1;
  border-radius: 10px; overflow: hidden;
  background: var(--surface-alt); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.cb-image-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cb-image-remove {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff; border: 0;
  font-size: 16px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.cb-image-remove:hover { background: var(--danger); }
.cb-image-add {
  appearance: none; cursor: pointer;
  background: var(--surface-alt); border: 2px dashed var(--border);
  border-radius: 10px; aspect-ratio: 1 / 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--text-muted); font: inherit; transition: all 120ms ease;
  padding: 6px;
}
.cb-image-add:hover { border-color: var(--primary); color: var(--primary); background: rgba(0,81,188,0.04); }
.cb-image-add-icon { font-size: 26px; font-weight: 300; line-height: 1; }
.cb-image-add-label { font-size: 11px; font-weight: 600; text-align: center; }
.cb-images-hint {
  font-size: 12px; color: var(--text-muted);
  margin: 12px 0 0; line-height: 1.5;
}

/* Client supplied files uploader (list-style, file-type icons) */
.cb-files-card { margin-top: 12px; }
.cb-files-list {
  display: flex; flex-direction: column; gap: 8px;
}
.cb-file-tile {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.cb-file-tile-icon { font-size: 22px; flex: 0 0 auto; line-height: 1; }
.cb-file-tile-name {
  flex: 1 1 auto; min-width: 0;
  font-size: 13px; color: var(--text); font-weight: 600;
  text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cb-file-tile-name:hover { color: var(--primary); text-decoration: underline; }
.cb-file-tile-size { flex: 0 0 auto; font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cb-file-tile-remove {
  flex: 0 0 auto;
  width: 26px; height: 26px; border-radius: 50%;
  background: transparent; color: var(--text-muted); border: 0;
  font-size: 16px; line-height: 1; cursor: pointer;
}
.cb-file-tile-remove:hover { background: var(--danger); color: #fff; }
.cb-file-add {
  appearance: none; cursor: pointer;
  background: var(--surface-alt); border: 2px dashed var(--border);
  border-radius: 10px; padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
  color: var(--text-muted); font: inherit; transition: all 120ms ease;
}
.cb-file-add:hover { border-color: var(--primary); color: var(--primary); background: rgba(0,81,188,0.04); }
.cb-file-add-icon { font-size: 22px; font-weight: 300; line-height: 1; }
.cb-file-add-label { font-size: 13px; font-weight: 600; }

/* Site photos in the quote preview */
.quote-doc-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.quote-doc-image {
  display: block; aspect-ratio: 1 / 1;
  border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border);
}
.quote-doc-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Job-at-a-glance review card on the cost-breakdown step */
.cb-review {
  background: linear-gradient(135deg, rgba(0,81,188,0.04), rgba(123,182,255,0.05));
  border: 1px solid rgba(0,81,188,0.18);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.cb-review-head {
  margin-bottom: 14px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.cb-review-head > div:first-child { min-width: 0; }
.cb-review-title { font-size: 15px; font-weight: 700; color: var(--primary); letter-spacing: 0.02em; }
.cb-review-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.cb-review-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px 22px;
}
.cb-review-grid > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cb-review-grid .faint { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.cb-review-grid .bold { font-size: 14px; color: var(--text); overflow-wrap: anywhere; }

/* Dimensions presets row */
#dim-presets { margin-bottom: 10px; }

/* Bigger tap targets on phones */
@media (max-width: 700px) {
  .cf-preset { padding: 12px 20px; min-height: 48px; font-size: 15px; }
  .calc-stepper button { width: 48px; height: 48px; font-size: 22px; }
  .calc-stepper input { font-size: 18px; min-height: 48px; }
  .cf-map-js { height: 260px; }
  .cf-distance-pill { font-size: 13px; padding: 12px 14px; }
  .cf-money input { min-height: 48px; font-size: 16px; }
  .cf-money-prefix { font-size: 18px; padding: 0 16px; }
}

/* ─── Send to production: CTA, modal preview, sent stamp ──────────── */
/* The headline action on a saved composite quote. Visually loud on
   purpose — this is the one click that replaces three rounds of
   re-typing into Monday and MYOB. Composite-only for now. */

.btn-send-prod {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #0051bc 0%, #00a36b 100%);
  color: #fff; border: none;
  padding: 14px 18px;
  font-size: 15px; font-weight: 700; letter-spacing: 0.01em;
  border-radius: 12px; cursor: pointer;
  box-shadow: 0 8px 24px -10px rgba(0, 81, 188, 0.55), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn-send-prod:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -10px rgba(0, 81, 188, 0.65), inset 0 1px 0 rgba(255,255,255,0.2);
  filter: brightness(1.04);
}
.btn-send-prod:active { transform: translateY(0); }
.btn-send-prod-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  background: rgba(255,255,255,0.18); border-radius: 6px;
}
.prod-cta-sub {
  font-size: 12px; line-height: 1.5; margin: 4px 2px 6px;
}

@media (max-width: 700px) {
  .modal-wide { max-width: none; }
}


/* ─── Formal quote composer (Signlab-branded customer quote) ──────────
   Matches the layout Corey supplied (QTE-2026-050 mockup). All editable
   fields are styled to look like static text but reveal a dotted blue
   underline on hover/focus so the rep knows what's editable. Print
   stylesheet at the bottom strips composer chrome and prints just the
   doc on A4. */

.fq-wrap {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 32px;
  align-items: start;
}
.fq-actions { /* inherits .quote-doc-actions positioning */ }
.fq-action-divider {
  height: 1px; background: var(--border); margin: 4px 0 2px;
}

/* The doc itself — paper-card surface */
.fq-doc {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 56px 64px 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1f2937;
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  max-width: 880px;
  margin: 0 auto;
}

/* Header — logo+badge left, meta right */
.fq-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.fq-header-left {
  display: flex; flex-direction: column; gap: 14px; align-items: flex-start;
}
.fq-logo {
  height: 28px; width: auto;
  /* override the global `img { max-width: 100% }` — with a fixed height that
     cap was squashing the width and stretching the logo tall (Corey). */
  max-width: none;
  display: block;
}
/* Brand-blue bar across the very top of the page (Corey 2026-06-01). Negative
   margins cancel the .fq-doc padding so it spans edge to edge. */
.fq-topbar {
  height: 10px; background: #0051bc;
  margin: -56px -64px 30px;
}
.fq-stamp-badge {
  display: inline-block;
  padding: 5px 14px;
  background: #0051bc;
  color: #fff;
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.18em;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 81, 188, 0.3);
}
.fq-header-meta {
  text-align: right;
  color: #0051bc;
  font-size: 13px;
  line-height: 1.6;
}
.fq-quote-num {
  font-size: 20px; font-weight: 800;
  color: #0051bc;
  letter-spacing: 0.01em;
  margin-bottom: 6px;
}
.fq-meta-line { color: #374151; font-size: 12px; }
.fq-meta-strong { color: #111827; font-weight: 500; }
.fq-rep-line { margin-top: 12px; color: #374151; }
.fq-rep-line .fq-input {
  display: inline-block; min-width: 0; width: auto;
  /* size to content (the `size` attr) so there's no empty space between the
     label and the name (Corey 2026-06-01). field-sizing for modern browsers. */
  field-sizing: content;
  text-align: left;
  padding-left: 4px; padding-right: 4px;
}
.fq-rep-name { min-width: 0; }
.fq-rep-phone { min-width: 0; }
.fq-rep-dash { color: #9ca3af; margin: 0 1px; }

/* Brand-blue divider under header */
.fq-divider {
  height: 3px; background: #0051bc;
  margin: 0 0 32px;
  border-radius: 2px;
}

/* From / To parties */
.fq-parties {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  margin-bottom: 42px;
}
.fq-party-right { text-align: right; }
.fq-party-name { font-weight: 700; color: #111827; margin-bottom: 2px; }
.fq-install { margin-top: 8px; }
.fq-install-label { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #6b7280; }
.fq-party div { font-size: 13px; line-height: 1.55; }

/* Line items table */
.fq-table {
  width: 100%; border-collapse: collapse;
  margin-bottom: 8px;
}
.fq-table thead tr { border-bottom: 1px solid #e5e7eb; }
.fq-table th {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: #6b7280; font-weight: 600;
  padding: 14px 8px;
  text-align: left;
}
.fq-th-qty { text-align: center; width: 80px; }
.fq-th-amt { text-align: right; width: 140px; }
.fq-th-rm { width: 30px; }
.fq-line { border-bottom: 1px solid #f3f4f6; }
.fq-line td { padding: 14px 8px; vertical-align: top; }
.fq-cell-desc { width: auto; }
.fq-cell-qty { text-align: center; }
.fq-cell-amt { text-align: right; font-weight: 600; color: #111827; white-space: nowrap; }
.fq-cell-rm { text-align: right; padding-left: 0; padding-right: 0; }

/* Phones: the fixed-width line columns crush the description to ~30px, so
   reflow each line into a stacked card with a usable full-width description. */
@media (max-width: 600px) {
  .fq-table thead { display: none; }
  .fq-table, .fq-table tbody { display: block; }
  .fq-line {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "desc rm" "qty amt";
    gap: 8px 12px;
    border: 1px solid #e5e7eb; border-radius: 8px;
    padding: 10px 12px; margin-bottom: 10px;
  }
  .fq-line td { display: block; padding: 0; }
  .fq-cell-desc { grid-area: desc; }
  .fq-cell-rm   { grid-area: rm; }
  .fq-cell-qty  { grid-area: qty; text-align: left; }
  .fq-cell-amt  { grid-area: amt; text-align: right; }
  .fq-cell-qty::before { content: 'Qty: '; font-size: 11px; color: #6b7280; }
  .fq-cell-amt::before { content: 'Unit price: '; font-size: 11px; color: #6b7280; }
  .fq-desc { width: 100%; }
}

/* Inline-editable inputs — look like text, reveal on hover/focus */
.fq-input {
  border: none; background: transparent;
  padding: 2px 4px; margin: -2px -4px;
  font: inherit; color: inherit;
  border-bottom: 1px dotted transparent;
  border-radius: 3px;
  outline: none;
  transition: background 0.12s, border-color 0.12s;
  font-family: inherit;
}
/* iOS zooms in on focus when input font-size < 16px and never zooms back.
   Body font is 15px so .fq-input inherits 15px — bump it on touch widths
   (covers phone + iPad portrait) so editing a formal quote line doesn't
   zoom the page. */
@media (max-width: 900px) {
  .fq-input { font-size: 16px; }
}
.fq-input:hover { background: rgba(0, 81, 188, 0.04); border-bottom-color: rgba(0, 81, 188, 0.25); }
.fq-input:focus { background: rgba(0, 81, 188, 0.07); border-bottom-color: #0051bc; }
.fq-input::placeholder { color: #9ca3af; font-style: italic; }

textarea.fq-input {
  display: block; width: 100%;
  resize: none; overflow: hidden;
  min-height: 1.5em;
  line-height: 1.5;
}
.fq-desc { font-size: 13px; color: #1f2937; }
.fq-qty { width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.fq-amt { width: 84px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.fq-money-prefix { color: #6b7280; font-weight: 500; margin-right: 2px; }

/* Remove input spinners */
.fq-qty::-webkit-outer-spin-button, .fq-qty::-webkit-inner-spin-button,
.fq-amt::-webkit-outer-spin-button, .fq-amt::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.fq-qty, .fq-amt { -moz-appearance: textfield; }

.fq-rm-line {
  border: none; background: transparent;
  color: #cbd5e1; font-size: 18px; line-height: 1; cursor: pointer;
  width: 22px; height: 22px; border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}
.fq-rm-line:hover { color: #ef4444; background: #fee2e2; }

.fq-add-row { padding: 14px 8px 0; }
.fq-add-line {
  background: transparent; border: 1px dashed #cbd5e1;
  color: #6b7280; padding: 8px 14px;
  border-radius: 8px; cursor: pointer;
  font-size: 12px; font-weight: 600;
  transition: all 0.12s;
}
.fq-add-line:hover { border-color: #0051bc; color: #0051bc; background: rgba(0, 81, 188, 0.04); }

/* Conditions of Sale block — gray rounded box */
.fq-conditions {
  background: #f5f7fa; border-radius: 10px;
  padding: 18px 22px;
  margin: 36px 0 28px;
}
.fq-conditions-label { font-size: 13px; color: #374151; font-weight: 600; margin-bottom: 8px; }
.fq-conditions-text {
  font-size: 13px; line-height: 1.7;
  color: #374151;
  white-space: pre-wrap;
}
.fq-conditions-text:hover, .fq-conditions-text:focus { background: rgba(0, 81, 188, 0.04); }

/* Totals — right-aligned column */
.fq-totals {
  display: flex; justify-content: flex-end;
  margin-bottom: 32px;
}
#fq-totals-block { width: 280px; }
.fq-totals-row {
  display: flex; justify-content: space-between;
  padding: 6px 0; font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.fq-totals-row span:first-child { color: #6b7280; }
.fq-totals-row span:last-child { font-weight: 600; color: #111827; }
.fq-totals-grand {
  margin-top: 8px; padding: 14px 16px;
  background: linear-gradient(135deg, rgba(0, 81, 188, 0.06), rgba(0, 81, 188, 0.02));
  border: 1.5px solid rgba(0, 81, 188, 0.2);
  border-radius: 10px;
  font-size: 14px;
  align-items: center;
}
.fq-totals-grand span:first-child {
  color: #0051bc !important;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.fq-totals-grand span:last-child {
  font-weight: 800;
  color: #0051bc !important;
  font-size: 24px;
  letter-spacing: -0.02em;
}

/* Customer accept / signature block — sits above the dashed divider */
.fq-accept {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  margin: 28px 0 28px;
  padding: 22px 24px;
  background: linear-gradient(135deg, rgba(0, 81, 188, 0.03), rgba(123, 182, 255, 0.04));
  border: 1px solid rgba(0, 81, 188, 0.18);
  border-radius: 12px;
}
.fq-accept-head {
  font-size: 14px; font-weight: 700;
  color: #0051bc;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.fq-accept-body {
  font-size: 12px; line-height: 1.55;
  color: #374151;
}
.fq-accept-right {
  display: flex; flex-direction: column; gap: 22px;
  align-self: end;
}
.fq-sig-line {
  border-bottom: 1.5px solid #1f2937;
  padding-bottom: 4px;
  min-height: 28px;
  position: relative;
}
.fq-sig-label {
  position: absolute;
  bottom: -16px; left: 0;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
  font-weight: 600;
}

/* Dashed divider before footer */
.fq-dashed {
  border-top: 1px dashed #9ca3af;
  margin: 8px 0 24px;
}

/* Payment options + cards row */
.fq-payment {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px;
  margin-bottom: 40px;
}
.fq-payment-head {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  color: #111827; text-transform: uppercase;
  margin-bottom: 10px;
}
.fq-payment-body { font-size: 13px; line-height: 1.7; color: #374151; }
.fq-payment-right { text-align: right; font-size: 12px; color: #374151; line-height: 1.6; }
.fq-cc-row {
  display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 10px;
}
.fq-cc {
  display: inline-flex; align-items: center; justify-content: center;
  height: 26px; padding: 0 10px;
  border-radius: 4px;
  font-weight: 800; font-size: 11px; letter-spacing: 0.04em;
  color: #fff; line-height: 1;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.fq-cc-amex { background: #2e77bb; }
.fq-cc-visa { background: #1a1f71; font-style: italic; font-family: 'Inter', sans-serif; }
.fq-cc-mc {
  background: #fff; color: #111; position: relative;
  padding: 0 6px 0 24px;
  border: 1px solid #e5e7eb;
}
.fq-cc-mc-c1, .fq-cc-mc-c2 {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; border-radius: 50%;
}
.fq-cc-mc-c1 { left: 4px; background: #eb001b; }
.fq-cc-mc-c2 { left: 12px; background: #f79e1b; mix-blend-mode: multiply; }
.fq-cc-mc-label {
  font-size: 8px; letter-spacing: 0.02em;
  color: #1a1a1a; font-weight: 700;
  text-transform: lowercase;
}
.fq-cc-line { color: #374151; }

/* Footer brand band — full bleed across the doc */
.fq-footer-band {
  background: #0051bc;
  color: #fff;
  margin: 0 -64px;
  padding: 22px 64px;
  text-align: center;
  font-size: 12px; line-height: 1.6;
  letter-spacing: 0.01em;
}
.fq-footer-line { margin: 2px 0; }
.fq-footer-band strong { font-weight: 700; }

/* Contractor-quote flags on the internal cost sheet */
.ci-quote-missing { color: #d11f2d; font-weight: 700; }
.ci-quote-ok { color: #0a8a3a; font-weight: 600; }

/* Hard gate shown in place of the formal-quote CTA / page when a required
   contractor quote is missing (Corey 2026-06-01). */
.fq-gate {
  border: 1px solid rgba(209, 31, 45, 0.35);
  background: rgba(209, 31, 45, 0.05);
  border-radius: 12px;
  padding: 16px 18px;
}
.fq-gate-head { font-size: 14px; margin-bottom: 8px; }
.fq-gate-body { font-size: 13px; color: #374151; line-height: 1.5; }
.fq-gate-list { margin: 8px 0 14px; padding-left: 20px; font-size: 13px; color: #111827; }
.fq-gate-list li { margin: 2px 0; }
.fq-gate-full { max-width: 560px; margin: 24px auto; }

/* Saved-stamp shown on the internal quote sidebar after formal quote exists */
.fq-stamp {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.fq-stamp-head { display: flex; align-items: flex-start; gap: 10px; }
.fq-stamp-icon {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 6px;
  background: #0051bc; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.fq-stamp-title { font-size: 13px; font-weight: 700; color: #0b3a8c; line-height: 1.2; }
.fq-stamp-meta { font-size: 11px; color: #1e40af; margin-top: 2px; }
.fq-stamp-actions { display: flex; flex-direction: column; gap: 8px; }
.fq-stamp-actions .btn { width: 100%; text-align: center; }

/* Composer print stylesheet — fired by body.printing-fq class */
@media print {
  body.printing-fq .topbar,
  body.printing-fq .page-header,
  body.printing-fq .fq-actions,
  body.printing-fq .calc-nav,
  body.printing-fq #toast-root,
  body.printing-fq #modal-root,
  body.printing-fq .bottom-nav { display: none !important; }
  body.printing-fq .main { padding: 0; max-width: none; }
  body.printing-fq .fq-wrap { display: block; }
  body.printing-fq .fq-doc {
    box-shadow: none; border: none; border-radius: 0;
    padding: 32px 40px 0; max-width: none; margin: 0;
  }
  body.printing-fq .fq-footer-band { margin: 0 -40px; padding: 20px 40px; }
  body.printing-fq .fq-topbar { margin: -32px -40px 24px; }
  body.printing-fq .fq-input {
    background: transparent !important;
    border-bottom: none !important;
  }
  body.printing-fq .fq-rm-line,
  body.printing-fq .fq-add-row { display: none !important; }
  body.printing-fq .fq-doc { page-break-inside: avoid; }
  @page { size: A4; margin: 12mm; }
}

/* Mobile pass */
@media (max-width: 900px) {
  .fq-wrap { grid-template-columns: 1fr; }
  .fq-doc { padding: 36px 28px 0; }
  .fq-footer-band { margin: 0 -28px; padding: 18px 28px; }
  .fq-topbar { margin: -36px -28px 24px; }
}
@media (max-width: 600px) {
  .fq-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .fq-header-meta { text-align: left; }
  .fq-parties { grid-template-columns: 1fr; gap: 18px; }
  .fq-party-right { text-align: left; }
  .fq-payment { grid-template-columns: 1fr; gap: 18px; }
  .fq-payment-right { text-align: left; }
  .fq-cc-row { justify-content: flex-start; }
}


/* ════════════════════════════════════════════════════════════════
   Admin → Products (v3): list + split-screen editor
   Built 2026-05-19 as step 2 of CP-1/2 (Corey-facing admin builder)
   ════════════════════════════════════════════════════════════════ */

/* ─── Products list empty state ──────────────────────────────────── */
.prod-empty {
  text-align: center; padding: 56px 32px; max-width: 540px; margin: 32px auto;
}
.prod-empty-icon { font-size: 48px; margin-bottom: 12px; }
.prod-empty-title { font-size: 22px; font-weight: 700; margin: 0 0 12px; }
.prod-empty-text { color: var(--text-muted); margin: 0 0 24px; line-height: 1.7; font-size: 15px; }
.prod-empty-hint { margin-top: 14px; font-size: 12px; color: var(--text-faint); }

.prod-row-name { display: flex; align-items: center; gap: 8px; }
.prod-row-icon { font-size: 18px; }

/* ─── Editor topbar (sticky title + save indicator) ──────────────── */
.pe-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0 18px; gap: 16px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); margin-bottom: 20px;
}
.pe-topbar-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.pe-topbar-right { display: flex; align-items: center; gap: 12px; }
.pe-title {
  font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 480px;
}

.pe-save-indicator {
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 6px;
  transition: color 0.2s;
}
.pe-save-indicator::before {
  content: '✓'; font-weight: 700; color: var(--accent-green, #1a8f4a);
  font-size: 13px;
}
.pe-save-indicator[data-save-state="typing"],
.pe-save-indicator[data-save-state="saving"] { color: var(--text-faint); }
.pe-save-indicator[data-save-state="typing"]::before,
.pe-save-indicator[data-save-state="saving"]::before {
  content: '○'; color: var(--text-faint);
  animation: pe-spin 1.2s linear infinite;
}
.pe-save-indicator[data-save-state="error"] { color: var(--danger); }
.pe-save-indicator[data-save-state="error"]::before { content: '!'; color: var(--danger); }
@keyframes pe-spin { to { transform: rotate(360deg); } }

/* ─── Issues summary banner ──────────────────────────────────────── */
.pe-issues-summary {
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease, padding 0.2s ease, margin 0.2s ease;
  border-radius: 10px;
  font-size: 13px;
  background: rgba(220, 38, 38, 0.05);
  border: 1px solid rgba(220, 38, 38, 0.15);
  color: var(--text);
  padding: 0 16px;
  margin: 0;
}
.pe-issues-summary.open {
  max-height: 320px; padding: 12px 16px; margin: 0 0 20px;
}
.pe-issues-summary strong { color: var(--danger); display: block; margin-bottom: 4px; }
.pe-issues-summary ul { margin: 0; padding-left: 18px; }
.pe-issues-summary li { margin: 2px 0; line-height: 1.5; }

/* ─── Product Draft/Ready status bar (editor) ──────────────────── */
.pe-status-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 11px 16px; margin: 0 0 20px;
  border-radius: 10px; border: 1px solid var(--border);
  font-size: 13px; line-height: 1.5;
}
.pe-status-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pe-status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  flex: 0 0 auto; background: var(--text-muted);
}
.pe-status-bar[data-status="draft"] { background: #fff8ec; border-color: #efd7a4; }
.pe-status-bar[data-status="draft"] .pe-status-dot { background: #d2941f; }
.pe-status-bar[data-status="ready"] { background: #ecf9f0; border-color: #b4e3c3; }
.pe-status-bar[data-status="ready"] .pe-status-dot { background: #2da458; }
.pe-status-bar[data-status="ready-issues"] {
  background: rgba(220, 38, 38, 0.05); border-color: rgba(220, 38, 38, 0.22);
}
.pe-status-bar[data-status="ready-issues"] .pe-status-dot { background: var(--danger); }

/* Admin "preview as rep" banner inside the calculator */
.calc-preview-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 10px 16px; margin-bottom: 16px;
  background: #fff8ec; border: 1px solid #efd7a4;
  border-radius: 10px; font-size: 13px; color: var(--text);
}

/* Collapsible builder sections + question cards */
.pe-section-headrow {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
  margin: 0 0 14px;
}
.pe-section-headrow .pe-section-title { margin: 0; }
.pe-section-headrow:hover .pe-section-chevron { color: var(--text); }
.pe-section-chevron {
  font-size: 11px; color: var(--text-muted);
  width: 14px; text-align: center; flex: 0 0 auto;
}
.pe-q-collapse-btn {
  background: none; border: none; cursor: pointer;
  font-size: 11px; color: var(--text-muted);
  padding: 4px 5px; flex: 0 0 auto; border-radius: 5px;
}
.pe-q-collapse-btn:hover { background: var(--surface-alt); color: var(--text); }
.pe-q-card-collapsed { padding-bottom: 6px; }
.pe-q-summary {
  flex: 1; min-width: 0;
  display: flex; align-items: baseline; gap: 10px;
  background: none; border: none; cursor: pointer; text-align: left;
  padding: 6px 2px;
}
.pe-q-summary-text {
  font-weight: 600; color: var(--text); font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pe-q-summary-meta { font-size: 11px; color: var(--text-muted); flex: 0 0 auto; }

/* Quote Library page */
.lib-group { margin-bottom: 24px; }
.lib-group-title { font-size: 15px; font-weight: 700; margin: 0 0 10px; color: var(--text); }
.lib-card { padding: 6px; }
.lib-row {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px;
}
.lib-row + .lib-row { border-top: 1px solid var(--border); }
.lib-name.pe-input-sm { width: 100%; max-width: none; min-width: 0; font-size: 16px; }
.lib-row-actions { display: flex; align-items: center; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.lib-total { font-weight: 700; color: var(--text); min-width: 84px; text-align: right; }

/* ─── Split-screen layout ────────────────────────────────────────── */
.pe-split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px; align-items: start;
}
@media (max-width: 1100px) {
  .pe-split { grid-template-columns: 1fr; }
}
.pe-builder { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.pe-preview {
  position: sticky; top: 90px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 110px); max-height: calc(100dvh - 110px); overflow-y: auto;
}
.pe-preview-head {
  padding: 18px 22px; background: linear-gradient(135deg, rgba(0,81,188,0.06), rgba(123,182,255,0.04));
  border-bottom: 1px solid var(--border);
}
.pe-preview-eyebrow {
  display: inline-block; font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--primary);
  background: rgba(0,81,188,0.08); padding: 4px 10px; border-radius: 4px;
}
.pe-preview-title { font-size: 16px; font-weight: 700; margin-top: 8px; color: var(--text); }
.pe-preview-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.pe-preview-body { padding: 22px; display: flex; flex-direction: column; gap: 20px; }

/* ─── Builder sections ───────────────────────────────────────────── */
.pe-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.pe-section-title {
  font-size: 16px; font-weight: 700; margin: 0 0 4px; color: var(--text);
  letter-spacing: -0.01em;
}
.pe-section-hint {
  font-size: 13px; color: var(--text-muted); margin: 0 0 16px; line-height: 1.5;
}
.pe-section-stub { background: var(--surface-alt); }

.pe-grid { display: grid; gap: 14px; }
.pe-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pe-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) {
  .pe-grid-2, .pe-grid-3 { grid-template-columns: 1fr; }
}

/* ─── Field (label + input + hint stack) ─────────────────────────── */
.pe-field {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 14px;
}
.pe-field:last-child { margin-bottom: 0; }
.pe-grid .pe-field { margin-bottom: 0; }

.pe-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-muted);
}
.pe-hint {
  font-size: 12px; color: var(--text-faint); line-height: 1.5; margin-top: 2px;
}

.pe-input {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 15px; outline: none; transition: border-color 0.15s;
  background: var(--surface); font-family: inherit;
}
.pe-input:focus { border-color: var(--primary); }
.pe-input-sm { max-width: 240px; }
select.pe-input { cursor: pointer; }

/* Inline error state */
.pe-field.pe-field-error .pe-input { border-color: var(--danger); background: rgba(220,38,38,0.02); }
.pe-issue {
  display: block; font-size: 12px; color: var(--danger);
  margin-top: 4px; font-weight: 500;
}

/* ─── Toggle switch ──────────────────────────────────────────────── */
.pe-toggle {
  display: inline-flex; align-items: center; gap: 12px;
  cursor: pointer; user-select: none;
}
.pe-toggle input[type="checkbox"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.pe-toggle-track {
  display: inline-block; width: 40px; height: 22px;
  background: var(--border); border-radius: 999px;
  position: relative; transition: background 0.2s;
  flex: 0 0 auto;
}
.pe-toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; background: #fff;
  border-radius: 50%; transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.pe-toggle input:checked + .pe-toggle-track { background: var(--primary); }
.pe-toggle input:checked + .pe-toggle-track .pe-toggle-thumb { left: 20px; }
.pe-toggle-label {
  font-size: 14px; color: var(--text); font-weight: 500;
}

/* ─── Conditional reveal ─────────────────────────────────────────── */
.pe-conditional {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.2s ease;
  display: flex; flex-direction: column; gap: 12px;
}
.pe-conditional.open {
  max-height: 600px; opacity: 1; padding-top: 6px; margin-bottom: 12px;
}

/* ─── Stubs (placeholders for steps 3+) ──────────────────────────── */
.pe-stub {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px; background: var(--surface);
  border: 1px dashed var(--border-strong); border-radius: 10px;
}
.pe-stub-icon { font-size: 28px; flex: 0 0 auto; }
.pe-stub-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.pe-stub-text { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* ─── Danger zone (delete) ───────────────────────────────────────── */
.pe-danger-zone {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px; border-top: 1px dashed var(--border);
  margin-top: 12px;
}

/* ─── Preview pane (.pp-*) ───────────────────────────────────────── */
.pp-step {
  display: flex; flex-direction: column; gap: 8px;
}
.pp-eyebrow {
  display: inline-block; font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted);
  background: var(--surface-alt); padding: 4px 10px; border-radius: 4px;
  align-self: flex-start;
}

.pp-product-card {
  padding: 16px 18px; background: var(--surface);
  border: 1.5px solid var(--primary); border-radius: 12px;
  background: rgba(0,81,188,0.04);
  display: flex; flex-direction: column; gap: 4px;
}
.pp-product-icon { font-size: 22px; }
.pp-product-name { font-size: 16px; font-weight: 700; color: var(--text); }
.pp-product-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.pp-product-cat {
  display: inline-block; font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--primary); margin-top: 6px;
}

.pp-size-row { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.pp-size-field { display: flex; flex-direction: column; gap: 4px; min-width: 60px; }
.pp-size-label { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.pp-size-input {
  padding: 8px 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-weight: 600; color: var(--text);
  text-align: center; min-width: 56px;
}
.pp-size-input.pp-size-readonly { background: var(--surface-alt); color: var(--primary); }
.pp-size-x { font-size: 18px; font-weight: 700; color: var(--primary); padding-bottom: 6px; }
.pp-size-qty {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
}
.pp-size-qty-input { min-width: 48px; }
.pp-size-unit { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.pp-size-multi {
  margin-top: 6px; padding: 8px 12px;
  background: var(--surface-alt); border: 1px dashed var(--border-strong);
  border-radius: 8px; font-size: 12px; color: var(--text-muted);
}

.pp-stub {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--surface-alt);
  border: 1px dashed var(--border-strong); border-radius: 10px;
}
.pp-stub-icon { font-size: 22px; flex: 0 0 auto; }
.pp-stub-text { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ─── Built-in flow markers (composite-panel-v1 etc.) ────────────── */
.prod-row-badge {
  display: inline-block; margin-left: 8px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--primary);
  background: rgba(0, 81, 188, 0.08);
  padding: 3px 8px; border-radius: 4px;
  border: 1px solid rgba(0, 81, 188, 0.2);
  vertical-align: middle;
}
.prod-row-badge-draft {
  color: #9a6a12;
  background: #fdeed0;
  border-color: #eccf94;
}

.pe-section-builtin {
  background: linear-gradient(135deg, rgba(0,81,188,0.03), rgba(123,182,255,0.04));
  border-color: rgba(0,81,188,0.18);
}
.pe-builtin-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--primary);
  background: rgba(0, 81, 188, 0.1);
  padding: 3px 9px; border-radius: 4px;
  border: 1px solid rgba(0, 81, 188, 0.2);
  margin-right: 8px; vertical-align: 2px;
}
.pe-builtin-info { display: flex; flex-direction: column; gap: 14px; }
.pe-builtin-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 700px) {
  .pe-builtin-grid { grid-template-columns: 1fr; }
}
.pe-builtin-key {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 8px;
}
.pe-builtin-list {
  margin: 0; padding-left: 20px;
  font-size: 13px; color: var(--text); line-height: 1.7;
}
.pe-builtin-list li { margin: 2px 0; }
.pe-builtin-hint {
  font-size: 13px; color: var(--text); line-height: 1.6;
  padding: 12px 14px;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.pe-builtin-hint strong { color: var(--primary); }

/* Small inline advisory shown above the cost-items section on template
 * products (e.g. Composite Panel Sign ships with a pre-built flow). NOT a
 * lock-out — Corey can edit everything below it. */
.pe-template-note {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(0,81,188,0.04), rgba(123,182,255,0.04));
  border: 1px solid rgba(0,81,188,0.18);
  border-radius: 10px;
  font-size: 13px; color: var(--text); line-height: 1.55;
}
.pe-template-icon { font-size: 18px; flex: 0 0 auto; line-height: 1.4; }
.pe-template-note strong { color: var(--primary); }

/* ─── Cost items editor (step 3 of CP-1/2) ───────────────────────── */
.pe-emptyish {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; background: var(--surface-alt);
  border: 1px dashed var(--border-strong); border-radius: 10px;
  margin-bottom: 12px;
}
.pe-emptyish-icon { font-size: 26px; flex: 0 0 auto; }
.pe-emptyish-text { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

#pe-cost-items-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }

.pe-ci-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pe-ci-card:hover { border-color: var(--border-strong); }
.pe-ci-card.pe-field-error { border-color: var(--danger); background: rgba(220,38,38,0.02); }

.pe-ci-head { display: flex; align-items: center; gap: 10px; }
.pe-ci-order { display: inline-flex; flex-direction: column; gap: 2px; }
.pe-ci-order-btn {
  width: 22px; height: 18px; padding: 0; line-height: 1;
  font-size: 9px; color: var(--text-muted); cursor: pointer;
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: 4px;
}
.pe-ci-order-btn:hover:not(:disabled) {
  color: var(--primary); border-color: var(--primary-light);
}
.pe-ci-order-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* Drag-to-reorder handles + states for question cards and option cards */
.pe-q-drag, .pe-opt-drag {
  cursor: grab; color: var(--text-muted); font-size: 14px; line-height: 1;
  padding: 0 4px; user-select: none; align-self: center;
}
.pe-q-drag:hover, .pe-opt-drag:hover { color: var(--primary); }
.pe-q-drag:active, .pe-opt-drag:active { cursor: grabbing; }
.pe-opt-order { margin-right: 2px; }
.pe-q-card.is-dragging, .pe-opt-card.is-dragging, .pe-ci-card.is-dragging { opacity: 0.45; }
.pe-q-card.is-drop-target, .pe-opt-card.is-drop-target, .pe-ci-card.is-drop-target {
  outline: 2px dashed var(--primary, #0051bc); outline-offset: 2px;
}

.pe-ci-num {
  font-size: 11px; font-weight: 700; color: var(--text-faint);
  background: var(--surface-alt); border-radius: 4px;
  padding: 3px 7px; flex: 0 0 auto; min-width: 28px; text-align: center;
}
.pe-ci-name { flex: 1; font-weight: 600; }
.pe-ci-del {
  width: 28px; height: 28px; padding: 0; line-height: 1;
  font-size: 18px; font-weight: 500;
  color: var(--text-faint);
  background: transparent; border: 1px solid transparent;
  border-radius: 6px; cursor: pointer;
  flex: 0 0 auto;
}
.pe-ci-del:hover {
  color: var(--danger); border-color: rgba(220,38,38,0.3);
  background: rgba(220,38,38,0.04);
}

.pe-ci-helptext-wrap { margin: 8px 0 0 70px; }
.pe-ci-helptext { font-style: italic; font-size: 13px; }

.pe-ci-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 12px; margin: 10px 0 0 70px;
}
@media (max-width: 700px) { .pe-ci-grid { grid-template-columns: 1fr; } }
.pe-ci-grid .pe-field { margin-bottom: 0; }

.pe-ci-foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin: 10px 0 0 70px;
  padding-top: 8px; border-top: 1px dashed var(--border);
  flex-wrap: wrap;
}
.pe-ci-preview {
  font-size: 12px; font-weight: 600;
  color: var(--primary);
  background: rgba(0,81,188,0.06);
  padding: 4px 10px; border-radius: 4px;
}

.pe-toggle-sm { font-size: 13px; gap: 8px; }
.pe-toggle-sm .pe-toggle-track { width: 32px; height: 18px; }
.pe-toggle-sm .pe-toggle-thumb { width: 14px; height: 14px; top: 2px; left: 2px; }
.pe-toggle-sm input:checked + .pe-toggle-track .pe-toggle-thumb { left: 16px; }
.pe-toggle-sm .pe-toggle-label { font-size: 13px; font-weight: 500; }

.pe-add-btn { margin-top: 4px; }

/* ─── Preview pane: cost breakdown rows ──────────────────────────── */
.pp-cb {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 2px;
  font-size: 12px;
}
.pp-cb-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; padding: 3px 0;
}
.pp-cb-name {
  display: flex; align-items: center; gap: 8px;
  color: var(--text); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pp-cb-tag {
  font-size: 10px; font-weight: 600;
  color: var(--text-faint);
  background: var(--surface-alt);
  padding: 2px 6px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.pp-cb-amt { font-weight: 600; color: var(--text); white-space: nowrap; }
.pp-cb-divider { height: 1px; background: var(--border); margin: 6px 0; }
.pp-cb-sub { color: var(--text-muted); font-size: 11px; }
.pp-cb-sub > div:first-child { font-weight: 500; }
.pp-cb-grand {
  font-size: 14px; font-weight: 700; color: var(--primary);
  padding-top: 4px;
}
.pp-cb-hint {
  font-size: 11px; color: var(--text-faint);
  font-style: italic; margin-top: 6px;
}

/* ─── Questions editor (step 4 of CP-1/2) ────────────────────────── */
#pe-questions-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 12px; }

.pe-q-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px 14px;
}
.pe-q-card.pe-field-error { border-color: var(--danger); background: rgba(220,38,38,0.02); }
.pe-q-card:hover { border-color: var(--border-strong); }

.pe-q-head { display: flex; align-items: center; gap: 10px; }
.pe-q-num { background: rgba(0,81,188,0.08); color: var(--primary); }

.pe-q-helptext-wrap { margin: 8px 0 0 70px; }

.pe-q-grid {
  display: grid; grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px; margin: 10px 0 0 70px; align-items: end;
}
@media (max-width: 700px) {
  .pe-q-grid { grid-template-columns: 1fr; }
}
.pe-q-grid .pe-field { margin-bottom: 0; }

.pe-q-options, .pe-q-singlevalue {
  margin: 14px 0 0 70px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
.pe-q-options-head { margin-bottom: 2px; }
.pe-q-atcost { display: inline-flex; margin-top: 8px; }
.pe-q-options-title {
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-muted);
}
.pe-q-options-sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

.pe-opt-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.pe-opt-head { display: flex; align-items: center; gap: 8px; }
.pe-opt-bullet { color: var(--primary); font-size: 14px; flex: 0 0 auto; }
.pe-opt-label { flex: 1; font-weight: 500; }
.pe-opt-label[readonly] {
  background: var(--surface-alt);
  color: var(--text);
  cursor: default;
}
.pe-opt-del { margin-left: auto; }

.pe-opt-effects {
  margin-left: 22px; margin-top: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.pe-opt-effects-label {
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.pe-opt-effects-empty {
  font-size: 12px; color: var(--text-faint);
  font-style: italic; padding: 4px 0;
}

.pe-eff-row {
  display: flex; align-items: center; gap: 6px;
  background: #fff;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 8px;
  flex-wrap: wrap;
}
.pe-eff-item { flex: 1 1 200px; min-width: 0; }
.pe-eff-num { width: 70px; flex: 0 0 70px; text-align: center; }
.pe-eff-del { margin-left: auto; }

.pe-add-effect {
  align-self: flex-start;
  margin-top: 4px;
  font-size: 12px;
  padding: 4px 10px;
}
.pe-add-opt { align-self: flex-start; margin-top: 4px; }

/* ─── Preview pane: question hints ───────────────────────────────── */
.pp-q-hint {
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 8px; line-height: 1.5;
}
.pp-chip-grid .chip {
  pointer-events: none;
  font-size: 13px;
  padding: 8px 14px;
  padding-right: 32px;
}
.pp-chip-grid .chip.selected::after {
  right: 10px;
  font-size: 12px;
}

/* Picker option editor + preview */
.pe-pick-grid {
  display: grid; grid-template-columns: 1fr 100px 100px;
  gap: 8px; margin-top: 10px;
}
@media (max-width: 700px) { .pe-pick-grid { grid-template-columns: 1fr; } }
.pe-pick-grid .pe-field { margin-bottom: 0; }

.pp-picker {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 6px;
}
.pp-pick-row {
  display: grid; grid-template-columns: 22px 1fr auto auto auto;
  gap: 8px; align-items: center;
  padding: 8px 10px; border-radius: 8px;
  font-size: 12px; color: var(--text);
}
.pp-pick-row.selected { background: rgba(0,81,188,0.06); }
.pp-pick-check { color: var(--primary); font-size: 14px; }
.pp-pick-label { font-weight: 600; }
.pp-pick-rate, .pp-pick-qty { color: var(--text-muted); font-size: 11px; }
.pp-pick-amt { font-weight: 700; color: var(--primary); }

/* Multi-select preview */
.pp-multi-grid .chip { padding-left: 16px; }
.pp-multi-check { margin-right: 6px; color: var(--primary); }

/* Contractor / Notes / Address / File preview */
.pp-contractor { display: flex; flex-direction: column; gap: 8px; }
.pp-contractor-file {
  padding: 8px 12px;
  background: var(--surface-alt, #f5f6f8);
  border: 1px dashed var(--border, #d0d4dc);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted, #6b7280);
}
.pp-notes {
  width: 100%; min-height: 80px; resize: vertical;
  padding: 10px 12px; font: inherit; font-size: 13px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface);
}
.pp-file-drop {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 2px dashed var(--border-strong); border-radius: 10px;
  background: var(--surface-alt);
}
.pp-file-icon { font-size: 22px; }
.pp-file-text { font-size: 13px; color: var(--text-muted); }

/* ─── ShowIf / conditional reveal (step 6 of CP-1/2) ─────────────── */
.pe-q-showif {
  margin: 14px 0 0 70px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.pe-showif-row { display: flex; flex-direction: column; gap: 8px; }
.pe-radio { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.pe-radio input { cursor: pointer; }
.pe-radio input:disabled + span { color: var(--text-faint); cursor: not-allowed; }
.pe-showif-detail {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 8px; padding: 10px 12px;
  background: rgba(0,81,188,0.04);
  border: 1px solid rgba(0,81,188,0.18);
  border-radius: 8px;
  margin-top: 4px;
}
.pe-showif-prefix { font-size: 13px; color: var(--text-muted); }
.pe-showif-select { width: auto; min-width: 140px; }

/* Preview: conditional question styling */
.pp-step-conditional { opacity: 0.85; }
.pp-conditional-tag {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: #a16207;
  background: rgba(217,119,6,0.1);
  border: 1px solid rgba(217,119,6,0.2);
  padding: 3px 8px; border-radius: 4px;
  margin-bottom: 6px;
}

/* ─── Question block library (step 6.5 of CP-1/2) ────────────────── */
.pe-q-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.pe-library {
  margin-top: 14px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(0,81,188,0.03), rgba(123,182,255,0.04));
  border: 1px solid rgba(0,81,188,0.18);
  border-radius: 12px;
}
.pe-library-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

/* Library cost-item folders (Corey 2026-06-01) — folder rail + grid */
.pe-lib-layout { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: start; }
.pe-lib-sidebar { min-width: 0; }
.pe-lib-side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.pe-lib-side-title { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #6b7280; }
.pe-lib-folder-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.pe-lib-folder {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: #374151;
}
.pe-lib-folder:hover { background: rgba(0,81,188,0.06); }
.pe-lib-folder.is-active { background: rgba(0,81,188,0.12); color: #0051bc; font-weight: 600; }
.pe-lib-folder.is-drop-target { background: rgba(0,81,188,0.2); outline: 2px dashed #0051bc; }
.pe-lib-folder-icon { flex: none; }
.pe-lib-folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-lib-folder-count { flex: none; font-size: 11px; color: #9ca3af; }
.pe-lib-folder-menu-btn {
  flex: none; border: none; background: none; cursor: pointer;
  color: #9ca3af; font-size: 15px; line-height: 1; padding: 0 2px;
}
.pe-lib-folder-menu-btn:hover { color: #374151; }
.pe-lib-folder-special { color: #6b7280; }
.pe-lib-hint { margin-top: 10px; font-size: 11px; color: #9ca3af; line-height: 1.5; }
.pe-lib-main { min-width: 0; }
.pe-block-card-wrap.is-dragging { opacity: 0.5; }
@media (max-width: 700px) {
  .pe-lib-layout { grid-template-columns: 1fr; }
}
.pe-block-card {
  display: flex; flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.pe-block-icon { font-size: 26px; line-height: 1; }
.pe-block-name {
  font-size: 14px; font-weight: 700; color: var(--text);
}
.pe-block-meta {
  font-size: 11px; color: var(--text-faint);
  font-weight: 500;
}
/* ─── Density polish (less text, tighter cards) ─────────────────── */

/* Section headers get a subtle count badge instead of a paragraph hint */
.pe-section { padding: 16px 18px; }
.pe-section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; margin: 0 0 12px;
}
.pe-section-count {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-alt);
  padding: 2px 8px; border-radius: 999px;
}
.pe-section-hint { display: none; } /* legacy paragraph hint — hidden */

/* Tighten field spacing across the board */
.pe-field { margin-bottom: 10px; gap: 4px; }
.pe-field:last-child { margin-bottom: 0; }
.pe-grid { gap: 10px; }
.pe-hint { font-size: 11px; }

/* Cost item card — single horizontal row when possible */
.pe-ci-card { padding: 10px 12px; }
.pe-ci-head { gap: 8px; align-items: center; }
.pe-ci-head .pe-ci-name { font-size: 14px; font-weight: 500; padding: 7px 10px; }
.pe-ci-num { display: none; } /* number is implied by order */
.pe-ci-grid {
  display: grid; grid-template-columns: 130px 110px 90px 1fr;
  gap: 8px; margin: 8px 0 0 0; align-items: center;
}
@media (max-width: 780px) {
  .pe-ci-grid { grid-template-columns: 1fr 1fr; }
}
.pe-ci-grid .pe-input, .pe-ci-grid select {
  font-size: 13px; padding: 7px 10px;
}
.pe-ci-money {
  display: inline-flex; align-items: stretch; gap: 0;
  border: 1.5px solid var(--border); border-radius: 10px;
  overflow: hidden; background: #fff;
}
.pe-ci-money:focus-within { border-color: var(--primary); }
.pe-ci-money-prefix {
  display: flex; align-items: center; padding: 0 8px;
  background: var(--surface-alt); color: var(--text-muted);
  font-weight: 600; font-size: 13px; border-right: 1.5px solid var(--border);
}
.pe-ci-money input {
  border: 0; outline: none; padding: 7px 10px;
  font-size: 13px; font-weight: 600; width: 100%; min-width: 0;
  background: transparent;
}
.pe-ci-na {
  text-align: center; color: var(--text-faint);
  font-size: 14px;
}
.pe-ci-always { justify-content: flex-start; }
.pe-ci-toggles { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pe-ci-atmargin {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 999px;
  background: var(--surface-alt, #eef2f7); border: 1px solid var(--border, #d6dae1);
}
.pe-ci-atmargin-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.pe-ci-atmargin-input { width: 48px; text-align: right; }
.pe-ci-atmargin-affix { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.pe-ci-preview {
  font-size: 11px; padding: 3px 8px;
  flex: 0 0 auto;
}
.pe-ci-add-help, .pe-showif-pill {
  background: transparent; border: 1px dashed var(--border-strong);
  padding: 4px 10px; border-radius: 6px;
  font-size: 11px; color: var(--text-muted); cursor: pointer;
  font-family: inherit;
}
.pe-ci-add-help { margin-top: 8px; }
.pe-ci-add-help:hover, .pe-showif-pill:hover {
  border-color: var(--primary-light); color: var(--primary);
}
.pe-showif-pill-active {
  background: rgba(0, 81, 188, 0.06);
  border-style: solid; border-color: rgba(0, 81, 188, 0.25);
  color: var(--primary); font-weight: 600;
}

/* Question card */
.pe-q-card { padding: 12px 14px; }
.pe-q-head { gap: 8px; align-items: center; }
.pe-q-num {
  background: rgba(0,81,188,0.08); color: var(--primary);
  font-size: 11px;
}
.pe-q-type {
  flex: 0 0 auto; max-width: 200px;
  font-size: 12px;
}
.pe-q-helptext { margin: 6px 0 0 0; font-style: italic; }
.pe-q-foot {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--border);
  flex-wrap: wrap;
}
.pe-q-foot .pe-toggle-sm { font-size: 12px; }

/* ShowIf inline editor */
.pe-showif-inline {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-top: 8px; padding: 8px 10px;
  background: rgba(0,81,188,0.04);
  border: 1px solid rgba(0,81,188,0.18);
  border-radius: 8px;
  font-size: 12px;
}
.pe-showif-inline select { min-width: 120px; }
.pe-showif-values {
  display: flex; flex-wrap: wrap; gap: 4px 6px;
  align-items: center;
}
.pe-showif-val {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  background: #fff;
  border: 1px solid rgba(0,81,188,0.25);
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.pe-showif-val input { margin: 0; cursor: pointer; }
.pe-showif-val:hover { border-color: rgba(0,81,188,0.5); }
.pe-showif-clear {
  margin-left: auto;
  background: transparent; border: none;
  color: var(--text-faint); cursor: pointer;
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
}
.pe-showif-clear:hover { color: var(--danger); background: rgba(220,38,38,0.05); }
.pe-showif-empty {
  margin-top: 8px; padding: 8px 10px;
  background: var(--surface-alt);
  border-radius: 6px;
  font-size: 11px; color: var(--text-faint);
}

/* Library cards (tight buttons) */
.pe-library-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.pe-block-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 12px 8px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  text-align: center; cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.pe-block-card:hover {
  border-color: var(--primary); background: rgba(0,81,188,0.04);
  transform: translateY(-1px);
}
.pe-block-icon { font-size: 22px; }
.pe-block-name { font-size: 12px; font-weight: 700; color: var(--text); }
.pe-block-meta { font-size: 10px; color: var(--text-faint); font-weight: 500; }
/* Library: save buttons + deletable cards */
.pe-ci-lib-btn, .pe-q-lib-btn, .pe-q-dup {
  width: 28px; height: 28px; padding: 0; line-height: 1;
  font-size: 13px; flex: 0 0 auto; opacity: 0.5;
  background: transparent; border: 1px solid transparent;
  border-radius: 6px; cursor: pointer;
}
.pe-ci-lib-btn:hover, .pe-q-lib-btn:hover, .pe-q-dup:hover {
  opacity: 1; border-color: rgba(0,81,188,0.3);
  background: rgba(0,81,188,0.05);
}
.pe-block-card-wrap { position: relative; display: flex; }
.pe-block-card-wrap .pe-block-card { flex: 1; }
.pe-lib-card-del {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; padding: 0; line-height: 1;
  font-size: 13px; color: var(--text-faint);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 5px; cursor: pointer; opacity: 0.55;
}
.pe-lib-card-del:hover {
  opacity: 1; color: var(--danger);
  border-color: rgba(220,38,38,0.3); background: rgba(220,38,38,0.06);
}
.pe-library-label {
  font-size: 10px; font-weight: 700; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin: 2px 0 8px;
}
.pe-library-label:not(:first-child) { margin-top: 16px; }
.pe-library-empty {
  font-size: 12px; color: var(--text-muted); line-height: 1.5;
}

/* Building blocks page */
.bl-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.bl-row .bl-grow { flex: 1 1 auto; min-width: 0; }
.bl-row .bl-type { flex: 0 0 120px; }
.bl-row .bl-num { flex: 0 0 90px; }
.bl-meta { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* Section sub-navigation (Products / Building blocks) */
.section-subnav {
  display: flex; gap: 4px; margin: -2px 0 18px;
  border-bottom: 1px solid var(--border);
}
.section-subnav-tab {
  padding: 8px 14px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.section-subnav-tab:hover { color: var(--text); }
.section-subnav-tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }

/* Saved-block detail cards on the Building Blocks page */
.bl-group {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px; background: var(--surface);
}
.bl-group-head { display: flex; gap: 8px; align-items: center; }
.bl-group-detail { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.bl-q { display: flex; gap: 8px; align-items: baseline; font-size: 12px; padding: 2px 0; }
.bl-q-num { font-weight: 700; color: var(--text-faint); flex: 0 0 auto; }
.bl-q-text { flex: 1 1 auto; color: var(--text); min-width: 0; }
.bl-q-type {
  flex: 0 0 auto; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-faint);
}
.bl-q-cost { margin-top: 6px; font-size: 11px; color: var(--text-muted); }

/* Address question — embedded travel map */
.dd-map {
  height: 220px; margin-top: 10px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-alt); overflow: hidden;
}
.dd-map-link {
  display: inline-block; margin-top: 8px;
  font-size: 12px; font-weight: 600; color: var(--primary);
}

/* Address question — manual travel cost (the rep enters the hours to charge;
   drive-time estimates are guidance only and never auto-price). */
.dd-travel { border-top: 1px solid var(--border); padding-top: 18px; }
.dd-travel-est { align-self: flex-start; margin-top: 2px; }
/* Shorter embedded map on phones so the address step needs less scrolling. */
@media (max-width: 700px) { .dd-map { height: 170px; } }

/* Danger zone with no helper text */
.pe-danger-zone { padding: 10px 16px; margin-top: 8px; }

/* ─── Question option rows (compact) ─────────────────────────────── */
.pe-opt-card { padding: 8px 10px; }
.pe-opt-head { gap: 8px; }
.pe-opt-label { font-size: 13px; }
.pe-opt-effect-count {
  font-size: 10px; font-weight: 700;
  color: var(--primary);
  background: rgba(0,81,188,0.08);
  padding: 2px 7px; border-radius: 999px;
  white-space: nowrap;
}
.pe-opt-effects {
  margin-left: 18px; margin-top: 6px;
  display: flex; flex-direction: column; gap: 4px;
}
.pe-opt-effects-label, .pe-opt-effects-empty { display: none; } /* legacy */

.pe-eff-row {
  display: grid; grid-template-columns: 1fr 70px 80px 28px;
  gap: 6px; align-items: center;
  padding: 4px 6px;
  background: var(--surface-alt);
  border-radius: 6px;
  border: none;
}
.pe-eff-row .pe-input { font-size: 12px; padding: 5px 8px; }
.pe-eff-num { text-align: center; }
.pe-eff-del { font-size: 14px; width: 24px; height: 24px; }

/* Column header above the cost-effect rows — same grid template so the
   "Cost item / Qty / Rate" labels line up over their inputs. */
.pe-eff-head {
  display: grid; grid-template-columns: 1fr 70px 80px 28px;
  gap: 6px; padding: 0 6px;
  font-size: 10px; font-weight: 700; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.pe-eff-head span:not(:first-child) { text-align: center; }

.pe-add-effect-pill {
  background: transparent;
  border: 1px dashed var(--border-strong);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  align-self: flex-start;
  margin-left: 18px;
  margin-top: 4px;
}
.pe-add-effect-pill:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

/* ─── Inline single-value blocks (number / hours / money / notes / etc) ─── */
.pe-q-inline {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-top: 10px; padding: 8px 10px;
  background: var(--surface-alt);
  border-radius: 8px;
  font-size: 12px;
}
.pe-q-inline .pe-input { font-size: 12px; padding: 6px 10px; }
.pe-q-inline select { min-width: 160px; }
.pe-q-inline input[type="text"], .pe-q-inline input:not([type="number"]) { flex: 1; min-width: 160px; }
.pe-q-inline-label {
  font-size: 11px; color: var(--text-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.pe-q-inline-num { width: 70px; flex: 0 0 70px; text-align: center; }
.pe-q-inline-presets { width: 140px; flex: 0 0 140px; }

/* ─── Products folder admin (Corey 2026-05-29) ────────────────────── */
.prod-folder-layout {
  display: grid; grid-template-columns: 260px 1fr; gap: 20px;
  align-items: start;
}
.prod-folder-sidebar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px;
  position: sticky; top: 80px;
}
.prod-folder-side-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.prod-folder-side-title {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 700; margin: 0;
}
.prod-folder-new-btn { padding: 2px 8px; font-size: 12px; }
.prod-folder-list { list-style: none; padding: 0; margin: 0; }
.prod-folder-item {
  display: grid;
  grid-template-columns: 22px 1fr auto auto;
  gap: 8px; align-items: center;
  padding: 9px 10px;
  border-radius: 8px; cursor: pointer;
  font-size: 14px; color: var(--text);
  transition: background 0.12s, color 0.12s;
}
.prod-folder-item:hover { background: rgba(0,81,188,0.06); }
.prod-folder-item.is-active {
  background: rgba(0,81,188,0.1); color: var(--primary); font-weight: 600;
}
.prod-folder-item.is-drop-target {
  background: rgba(0,81,188,0.18); outline: 2px dashed var(--primary);
  outline-offset: -2px;
}
.prod-folder-item-special { font-style: italic; color: var(--text-muted); }
.prod-folder-icon { font-size: 16px; line-height: 1; text-align: center; }
.prod-folder-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.prod-folder-count {
  font-size: 11px; color: var(--text-faint); font-weight: 600;
  background: rgba(0,0,0,0.05); padding: 2px 7px; border-radius: 999px;
  min-width: 22px; text-align: center;
}
.prod-folder-item.is-active .prod-folder-count {
  background: rgba(0,81,188,0.18); color: var(--primary);
}
.prod-folder-menu-btn {
  background: transparent; border: 0; cursor: pointer;
  width: 22px; height: 22px; padding: 0; line-height: 1;
  font-size: 14px; color: var(--text-faint);
  border-radius: 6px; opacity: 0.6;
}
.prod-folder-menu-btn:hover {
  background: rgba(0,0,0,0.06); opacity: 1; color: var(--text);
}
.prod-folder-hint {
  font-size: 11px; color: var(--text-faint); line-height: 1.55;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border);
}
.prod-folder-main-head {
  font-size: 18px; font-weight: 700; color: var(--text);
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.prod-folder-main-icon { font-size: 22px; }
@media (max-width: 720px) {
  .prod-folder-layout { grid-template-columns: 1fr; }
  .prod-folder-sidebar { position: static; }
}

/* Floating context menu (folder right-click + ⋯) */
.ctx-menu {
  position: fixed; z-index: 9999;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,0.18);
  padding: 6px; min-width: 180px;
}
.ctx-menu-item {
  display: block; width: 100%; text-align: left;
  background: transparent; border: 0; cursor: pointer;
  padding: 9px 12px; border-radius: 6px;
  font: inherit; font-size: 13.5px; color: var(--text);
}
.ctx-menu-item:hover { background: rgba(0,81,188,0.08); }
.ctx-menu-item-danger { color: var(--danger, #c0392b); }
.ctx-menu-item-danger:hover { background: rgba(192,57,43,0.08); }
.ctx-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Drag-state on the product card */
.prod-row[draggable="true"] { cursor: grab; }
.prod-row.is-dragging { opacity: 0.45; cursor: grabbing; }

/* ─── Products list (card-grid style) ────────────────────────────── */
.prod-list { display: flex; flex-direction: column; gap: 8px; }
.prod-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px; align-items: center;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none; color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.prod-row:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
@media (max-width: 700px) {
  .prod-row { grid-template-columns: 1fr; gap: 8px; }
  .prod-row-stats, .prod-row-actions { justify-self: start; }
}
.prod-row-main { min-width: 0; }
.prod-row-name {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 14px;
}
.prod-row-cat {
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-alt);
  padding: 2px 8px; border-radius: 4px;
}
.prod-row-desc {
  font-size: 12px; color: var(--text-muted);
  margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}
.prod-row-stats {
  display: flex; align-items: center; gap: 16px;
  font-size: 11px; color: var(--text-faint);
  white-space: nowrap;
}
.prod-row-stats strong { color: var(--text); font-weight: 700; font-size: 13px; }
.prod-row-actions { display: flex; gap: 4px; }
.prod-row-icon-btn {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px; color: var(--text-muted);
  cursor: pointer; transition: all 0.15s;
}
.prod-row-icon-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: rgba(0,81,188,0.04);
}
.prod-row-icon-btn-danger:hover {
  border-color: rgba(220,38,38,0.3);
  color: var(--danger);
  background: rgba(220,38,38,0.04);
}

/* ─── Dashboard hero (empty state) ───────────────────────────────── */
.dash-hero {
  text-align: center;
  padding: 64px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 560px;
  margin: 32px auto;
}
.dash-hero-icon { font-size: 48px; margin-bottom: 12px; }
.dash-hero-title {
  font-size: 24px; font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.dash-hero-text {
  color: var(--text-muted);
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.6;
}
.dash-hero-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
}

/* ─── Leads section heads (replaces inline-styled h3s) ───────────── */
.leads-section-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.leads-section-title {
  font-size: 14px; font-weight: 700; color: var(--text);
}
.leads-list { display: flex; flex-direction: column; gap: 10px; }

/* ─── Resume draft strip (was a tall card, now a thin pill row) ──── */
.resume-strip {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(0,81,188,0.04), rgba(123,182,255,0.06));
  border: 1px solid rgba(0,81,188,0.18);
  border-radius: 10px;
  font-size: 13px;
}
.resume-strip-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
  flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(0,81,188,0.18);
  animation: resume-pulse 2s ease-in-out infinite;
}
@keyframes resume-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(0,81,188,0.18); }
  50%      { box-shadow: 0 0 0 6px rgba(0,81,188,0.08); }
}
.resume-strip-text {
  flex: 1; display: flex; align-items: center; gap: 8px;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.resume-strip-total {
  font-weight: 700; color: var(--primary);
  margin-left: 8px;
}

/* ─── Formal quote action sidebar (tightened) ────────────────────── */
.fq-actions .btn { width: 100%; justify-content: center; }
.fq-action-divider {
  height: 1px; background: var(--border);
  margin: 14px 0 4px;
}
.fq-last-saved {
  font-size: 11px; color: var(--text-faint);
  text-align: center; padding: 4px 0;
}
.fq-pdf-hint {
  font-size: 11px; color: var(--text-faint);
  line-height: 1.5; margin-top: 10px;
  padding: 8px 10px;
  background: var(--surface-alt);
  border-radius: 6px;
}

/* ─── Customer step: history pane sidebar ────────────────────────── */
.cf-form-wrap { min-width: 0; }
.cf-form-main { min-width: 0; }
/* (customer past-quotes history pane removed 2026-05-22, Corey feedback) */

/* ─── Data-driven flow ───────────────────────────────────────────
 * Tiny set of overrides for picker rows + file placeholder used by
 * the admin-built question renderer. Everything else reuses the
 * composite atoms (.cf-step, .chip-grid, .chip, .cf-money etc).
 * --------------------------------------------------------------- */
.dd-pick-stepper { min-width: 130px; }
.dd-pick-qty-label { padding: 0 4px; font-weight: 600; }
.cf-access-row .cf-access-rate { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dd-file-drop {
  display: flex; align-items: center; gap: 14px;
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 18px 16px; background: var(--surface-alt);
}
.dd-file-icon { font-size: 28px; line-height: 1; }
.dd-file-text { flex: 1; }
.dd-file-title { font-weight: 600; color: var(--text); }
.dd-file-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════════════
   Mobile / touch optimisation
   Reps will use this on iPhones and iPads in the field. Apple HIG
   minimum touch target is 44pt; iOS Safari auto-zooms any input
   under 16px font-size. We fix both globally, then layer narrow-
   screen layout overrides on top.
   ═══════════════════════════════════════════════════════════════════ */

/* iOS tap highlight: subtle brand-blue flash instead of default grey box. */
html {
  -webkit-tap-highlight-color: rgba(0, 81, 188, 0.12);
}

/* Branded focus rings — kill the default browser outline, replace with a
   soft brand-blue glow. Only shown for keyboard focus (:focus-visible) so
   mouse clicks don't leave a ring stuck on whatever was just pressed. */
*:focus { outline: none; }
*:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 81, 188, 0.22);
  border-radius: var(--focus-radius, 6px);
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 81, 188, 0.18);
}
button:focus-visible, a:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 81, 188, 0.28);
}
/* Some elements should keep their own focus treatment because they have
   custom backgrounds (e.g. the topbar nav links on a blue bar). */
.topbar-nav-link:focus-visible, .topbar-cta:focus-visible,
.topbar-avatar-btn:focus-visible, .topbar-search:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45);
}

/* Disable iOS pull-to-refresh / overscroll bounce. Scoped to <html> (the real
   scroll container) — must NOT be on <body>, or it traps wheel and keyboard
   scrolling (see the overflow-x note near the top of this file). */
html { overscroll-behavior-y: none; }

/* Better tap target: every <button> and link-as-button should accept touch
   without text-selection or callout menus. */
button, .btn, [role="button"] {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;  /* removes the 300ms tap delay */
}

/* ─── Prevent iOS auto-zoom on any text/number/email/etc input ─── */
/* iOS zooms in when an input is focused if its font-size is < 16px.
   We override font-size to 16px on touch devices only, so desktop keeps
   the tighter density we already designed. */
@media (hover: none) and (pointer: coarse) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="password"],
  input[type="search"],
  input:not([type]),
  select,
  textarea {
    font-size: 16px !important;
  }
  /* Some inputs are sized intentionally small (e.g. the small-stepper number
     fields in cost-item rows). Keep them readable but anti-zoom. */
  .pe-input-sm, .pe-eff-num, .pe-q-inline-num, .ss-user-grid input, .ss-user-grid select {
    font-size: 16px !important;
  }
}

/* ─── Touch targets ─────────────────────────────────────────────── */
/* On touch devices, bump small icon/utility buttons to a 44px minimum
   so reps don't fat-finger the wrong control. */
@media (hover: none) and (pointer: coarse) {
  .pe-ci-del, .pe-eff-del, .pe-opt-del, .ci-rm, .cb-line-remove,
  .prod-row-icon-btn, .pe-ci-order-btn, .topbar-avatar-btn,
  .login-back-btn, .pe-block-card, .pe-add-effect-pill,
  .pe-showif-pill, .pe-showif-clear, .toast-undo,
  .cb-file-tile-remove,
  .pe-ci-add-help, .ss-cat-icon {
    min-height: 44px;
    min-width: 44px;
  }
  .pe-ci-del, .pe-eff-del, .pe-opt-del, .cb-line-remove,
  .prod-row-icon-btn, .pe-ci-order-btn {
    font-size: 18px;
  }
  /* Calc steppers — bigger plus/minus buttons */
  .calc-stepper button { width: 52px; height: 52px; font-size: 22px; }
  .calc-stepper input { width: 76px; height: 52px; font-size: 18px; }

  /* Chips need real finger-room */
  .chip, .cf-preset { min-height: 44px; }
  .cf-toggle-btn { min-height: 38px; padding: 10px 22px; }
  /* Step-jump dropdown — comfortable tap target + readable on phone */
  .calc-jump { padding: 12px 32px 12px 12px; font-size: 15px; max-width: 100%; }

  /* Avatar pill in topbar — bigger circle on touch */
  .topbar-avatar { width: 34px; height: 34px; }

  /* Nav links big enough to tap */
  .topbar-nav-link { padding: 10px 14px; }
  .bottom-nav-tab { min-height: 56px; }
}

/* ─── Safe-area insets (iPhone notch + home indicator) ─────────── */
.topbar { padding-top: env(safe-area-inset-top); }
.topbar-inner { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
.bottom-nav { padding-bottom: env(safe-area-inset-bottom); }
.main { padding-left: max(28px, env(safe-area-inset-left)); padding-right: max(28px, env(safe-area-inset-right)); }
@media (max-width: 900px) {
  .topbar-inner { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .main { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
}

/* When the calculator is open, leave room at the bottom for the floating
   price bar so the rep can scroll all the way to the last step's content. */
body.in-calculator .main {
  padding-bottom: calc(140px + env(safe-area-inset-bottom));
}

/* ─── Cost breakdown lines: stack vertically on narrow screens ─── */
@media (max-width: 700px) {
  .cb-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    padding: 12px 0;
  }
  .cb-line-name { grid-column: 1 / -1; }
  .cb-line-calc {
    grid-column: 1;
    display: flex; align-items: center; gap: 8px;
  }
  .cb-num { min-height: 44px; min-width: 64px; font-size: 16px; }
  .cb-line-amount {
    grid-column: 2; grid-row: 2;
    font-size: 16px; font-weight: 700;
    align-self: center;
  }
  .cb-line-remove {
    grid-column: 2; grid-row: 1;
    min-width: 44px; min-height: 44px;
    align-self: start;
  }
  /* Totals stack — full width side panel */
  .cb-wrap { grid-template-columns: 1fr; }
  .cb-totals {
    position: static !important;
    margin-top: 16px;
  }
  /* Totals bar — taller for touch readability */
  .cb-bar { height: 32px; }
}

/* ─── Quotes list: month sections ───────────────────────────────── */
/* Slim collapsible dividers that file quotes by month inside the table.
   A collapsed month keeps just its header line (count + value), so years
   of quotes stay scannable without folder navigation. */
.month-row td {
  background: var(--surface-alt);
  padding: 9px 16px;
}
.month-row-inner { display: flex; align-items: center; gap: 10px; }
.month-chevron { color: var(--text-faint); font-size: 11px; width: 12px; flex: none; }
.month-label {
  font-weight: 700;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.month-meta {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ─── Quotes table → card list on narrow screens ────────────────── */
@media (max-width: 700px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  /* Month sections stay slim dividers in the card list, not cards */
  .table tr.month-row {
    border: none;
    border-radius: 0;
    background: none;
    padding: 0;
    margin: 14px 0 8px;
  }
  .table tr.month-row td { padding: 4px 2px; background: none; }
  .table tr {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    background: var(--surface);
  }
  .table td {
    padding: 6px 0;
    text-align: left !important;
    border: none;
  }
  .table td:last-child { padding-top: 10px; border-top: 1px solid var(--border); margin-top: 4px; }
  .table .table-quote-number { font-weight: 700; color: var(--primary); font-size: 14px; }
  .table .right { text-align: left !important; }
}

/* ─── Cost-item card on phones: stack into 2 columns ────────────── */
@media (max-width: 520px) {
  .pe-ci-grid { grid-template-columns: 1fr 1fr; }
  .pe-ci-foot { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ─── Calculator chrome polish on phones ────────────────────────── */
@media (max-width: 700px) {
  /* Step dots: thinner row, but each dot still tappable */
  .calc-dot { min-height: 12px; }
  .calc-title { font-size: 22px; }
  .calc-main { padding: 20px 16px; min-height: 0; }
  .calc-nav { margin-top: 24px; }
  .calc-nav .btn { min-height: 48px; padding: 12px 18px; font-size: 14px; }
  /* The cf-field gap loosens on touch so labels don't crowd inputs */
  .cf-field { gap: 8px; }
  .cf-label { font-size: 13px; }
  .cf-hint { font-size: 13px; }
}

/* ─── Modals: respect safe area + cap height with internal scroll ─ */
@media (max-width: 700px) {
  .modal-backdrop { padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); align-items: flex-end; }
  .modal {
    width: 100%; max-width: none;
    max-height: 90vh; overflow-y: auto;
    border-radius: 16px 16px 0 0;
  }
}

/* ─── Sign-in flow on phones: single-column tile grid ──────────── */
@media (max-width: 520px) {
  .login-quick { grid-template-columns: 1fr; }
  .login-card { margin: 0; border-radius: 0; min-height: 100vh; min-height: 100dvh; }
  .login-shell { padding: 0; align-items: stretch; }
}

/* ─── Admin product editor split-screen → stacked on tablets ───── */
@media (max-width: 1100px) {
  .pe-preview { position: static !important; max-height: none; }
}

/* ─── Bottom nav: more prominent on touch devices ──────────────── */
@media (hover: none) and (pointer: coarse) {
  .bottom-nav { box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08); }
  .bottom-nav-icon { font-size: 22px; }
  .bottom-nav-label { font-size: 11px; }
}

/* ─── Disable hover effects on touch (avoids sticky :hover states) ── */
@media (hover: none) and (pointer: coarse) {
  .prod-row:hover,
  .lead-card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }
}

/* ═══════════════════════════════════════════════════════════════════
   Command palette (Cmd+K / Ctrl+K)
   Global jump-to anywhere overlay. Opens from the topbar search button
   or any keyboard shortcut.
   ═══════════════════════════════════════════════════════════════════ */
.palette-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 300;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh;
  padding-left: 16px; padding-right: 16px;
  animation: palette-fade 0.18s ease;
}
@keyframes palette-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.palette {
  width: 100%; max-width: 600px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22), 0 4px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: calc(76vh);
  animation: palette-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes palette-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.palette-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.palette-search-icon { color: var(--text-faint); flex: 0 0 auto; }
.palette-input-wrap input {
  flex: 1; border: none; outline: none;
  font-size: 16px; background: transparent;
  font-family: inherit; color: var(--text);
}
.palette-input-wrap input::placeholder { color: var(--text-faint); }

.palette-kbd {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 8px; min-width: 24px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 11px; font-weight: 600;
  font-family: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", monospace;
  color: var(--text-muted);
}
.palette-list {
  flex: 1; overflow-y: auto;
  padding: 6px;
  display: flex; flex-direction: column;
}
.palette-empty {
  padding: 32px 16px; text-align: center;
  color: var(--text-muted); font-size: 13px;
}
.palette-group-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-faint);
  padding: 10px 12px 4px;
}
.palette-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
}
.palette-row.is-active {
  background: rgba(0, 81, 188, 0.08);
}
.palette-row.is-active .palette-row-kbd { opacity: 1; }
.palette-icon {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-alt);
  border-radius: 6px;
  font-size: 13px; font-weight: 700;
  color: var(--primary);
  flex: 0 0 auto;
}
.palette-row.is-active .palette-icon {
  background: var(--primary); color: #fff;
}
.palette-row-main { flex: 1; min-width: 0; }
.palette-row-label {
  font-size: 14px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.palette-row-hint {
  font-size: 12px; color: var(--text-muted);
  margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.palette-row-kbd {
  opacity: 0;
  font-size: 12px; color: var(--text-faint);
  transition: opacity 0.15s;
}
.palette-foot {
  display: flex; align-items: center; gap: 18px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 11px; color: var(--text-muted);
}
.palette-foot .palette-kbd { font-size: 10px; padding: 2px 5px; }

/* Mobile palette: full-screen sheet */
@media (max-width: 600px) {
  .palette-backdrop { padding-top: 0; padding-left: 0; padding-right: 0; }
  .palette {
    max-width: none;
    max-height: 100vh; max-height: 100dvh;
    height: 100vh; height: 100dvh;
    border-radius: 0; border: none;
  }
  .palette-foot { display: none; }  /* keyboard shortcuts irrelevant on touch */
}

/* ─── Quote ageing pills ─────────────────────────────────────────── */
.age-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.age-pill-fresh  { background: rgba(22, 163, 74, 0.10); color: #15803d; border-color: rgba(22, 163, 74, 0.18); }
.age-pill-fading { background: rgba(202, 138, 4, 0.10); color: #a16207; border-color: rgba(202, 138, 4, 0.18); }
.age-pill-warm   { background: rgba(234, 88, 12, 0.10); color: #c2410c; border-color: rgba(234, 88, 12, 0.18); }
.age-pill-cold   { background: rgba(220, 38, 38, 0.10); color: #b91c1c; border-color: rgba(220, 38, 38, 0.20); }

/* ─── Cost-line category groups in the breakdown ─────────────────── */
.cb-group { display: flex; flex-direction: column; }
.cb-group + .cb-group { margin-top: 4px; }
.cb-group-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 8px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.cb-group-name { color: var(--primary); }
.cb-group-count {
  margin-left: 4px;
  font-size: 10px; font-weight: 600;
  color: var(--text-faint);
  letter-spacing: 0;
  text-transform: none;
}
.cb-group-subtotal {
  margin-left: auto;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ─── Pull-to-refresh indicator ──────────────────────────────────── */
#ptr-indicator {
  position: fixed; top: 12px; left: 50%;
  transform: translate(-50%, -60px);
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  color: var(--text-muted);
  font-size: 12px; font-weight: 600;
  z-index: 220;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  pointer-events: none;
}
#ptr-indicator .ptr-icon { transition: transform 0.2s; }
#ptr-indicator.is-armed { color: var(--primary); }
#ptr-indicator.is-armed .ptr-icon { transform: rotate(180deg); }
#ptr-indicator.is-loading .ptr-icon { animation: ptr-spin 0.8s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* Job panel on the quote view: groups multiple signs of one job (Corey:
   multiple signs, one Monday row + one formal quote). */
.job-panel {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 16px; background: #f7f9fc;
}
.job-panel-head { font-weight: 700; font-size: 13px; margin-bottom: 10px; color: #1f2937; }
.job-panel-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 6px 0; font-size: 13px;
  border-top: 1px solid var(--border);
}
.job-panel-row a { color: #0051bc; text-decoration: none; }
.job-panel-row a:hover { text-decoration: underline; }
.job-panel-row.is-current { font-weight: 700; }
.job-panel-row.is-current a { color: #1f2937; }
.job-panel-total {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-top: 10px; padding-top: 10px;
  border-top: 2px solid var(--border); font-size: 13px;
}
.job-badge {
  display: inline-block; margin-top: 4px; font-size: 11px;
  color: #0051bc; background: rgba(0,81,188,0.08);
  padding: 1px 7px; border-radius: 999px; white-space: nowrap;
}

/* ═══ CP-6: Materials & Labour Database ═══════════════════════════ */
.db-banner {
  display: flex; align-items: center; gap: 14px;
  background: #fff8e6; border: 1px solid #f0dca8; border-radius: 12px;
  padding: 12px 16px; margin-bottom: 14px;
}
.db-banner-text { font-size: 13.5px; flex: 1; }

.db-cpi-strip {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 9px 14px; margin-bottom: 14px; font-size: 13px;
}
.db-cpi-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: #c4cdd8;
}
.db-cpi-dot.is-on { background: #18a058; box-shadow: 0 0 0 3px rgba(24,160,88,0.15); }
.db-cpi-text { flex: 1; color: var(--text); }
.db-cpi-text strong { font-weight: 700; }

.db-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.db-tab {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 999px; padding: 7px 16px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; color: var(--text); display: inline-flex; align-items: center; gap: 7px;
}
.db-tab.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.db-tab-count {
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: rgba(0,0,0,0.08);
}
.db-tab.is-active .db-tab-count { background: rgba(255,255,255,0.22); }

.db-layout { display: flex; align-items: stretch; padding: 0; overflow: hidden; }
.db-sidebar {
  width: 240px; flex: none; border-right: 1px solid var(--border);
  padding: 14px 10px; background: var(--surface-alt);
}
.db-main { flex: 1; min-width: 0; padding: 14px 16px; }
.db-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.db-toolbar .db-search { flex: 1; min-width: 180px; }

.db-table td { vertical-align: middle; }
.db-cell-name { cursor: pointer; }
.db-cell-name:hover .db-item-name { color: var(--primary); text-decoration: underline; }
.db-item-name { font-weight: 600; }
.db-badge-quote {
  display: inline-block; margin-left: 8px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.03em;
  color: #9a6700; background: #fff3d1; border: 1px solid #f0dca8;
  padding: 1px 7px; border-radius: 999px; white-space: nowrap;
}
.db-links {
  font-size: 12px; color: #0051bc; background: rgba(0,81,188,0.08);
  padding: 1px 8px; border-radius: 999px; white-space: nowrap;
}
.db-price-wrap { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.db-price-input {
  width: 86px; text-align: right; font: inherit; font-weight: 600;
  border: 1px solid transparent; border-radius: 8px; padding: 5px 8px;
  background: transparent; transition: border-color 0.12s, background 0.12s;
}
.db-price-input:hover { border-color: var(--border); background: var(--surface); }
.db-price-input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.db-price-input.db-price-bad { border-color: #d23b3b; background: #fdf0f0; }
.db-price-input.db-price-saved { border-color: #18a058; background: #effaf3; }

.db-form { display: flex; flex-direction: column; gap: 12px; }
.db-form-row { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.db-form-row > span { font-weight: 600; font-size: 12.5px; }
.db-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.db-form-check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }

.db-history { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; }
.db-history-row {
  display: flex; align-items: baseline; gap: 12px;
  padding: 7px 2px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.db-history-row:last-child { border-bottom: none; }
.db-history-date { color: var(--text-faint); width: 110px; flex: none; font-size: 12px; }
.db-history-change { flex: 1; }
.db-history-src { color: var(--text-faint); font-size: 12px; }

.db-lift-head { margin-bottom: 12px; font-size: 14px; }
.db-lift-pct { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; font-weight: 700; }
.db-lift-preview { max-height: 280px; overflow-y: auto; border-top: 1px solid var(--border); }
.db-lift-row {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 6px 2px; border-bottom: 1px solid var(--border); font-size: 13px;
}

.db-relink { display: flex; flex-direction: column; max-height: 360px; overflow-y: auto; }
.db-relink-row {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 8px 2px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.db-relink-row:last-child { border-bottom: none; }
.db-relink-name { flex: 1; font-weight: 600; }
.db-relink-name .faint { font-weight: 400; }
.db-relink-rates { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Pointer card on Building blocks after cost items moved to the Database */
.db-moved-card {
  display: flex; align-items: center; gap: 16px;
  border: 1px dashed var(--border); border-radius: 12px;
  padding: 18px 20px; background: var(--surface-alt);
}
.db-moved-icon { color: var(--primary); flex: none; }
.db-moved-body { flex: 1; }
.db-moved-title { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.db-moved-text { font-size: 13px; color: var(--text-faint); }

@media (max-width: 800px) {
  .db-layout { flex-direction: column; }
  .db-sidebar { width: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .db-moved-card { flex-direction: column; align-items: flex-start; }
  /* Keep the database table a TABLE on phones (the generic card-list
     transform makes per-row price editing unusable). */
  .db-table, .db-table tbody, .db-table tr, .db-table td { display: revert; }
  .db-table thead { display: revert; }
  .db-table tr { border: none; border-radius: 0; padding: 0; margin: 0; }
  .db-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); }
}

/* Phones: the database table scrolls sideways rather than squashing */
#db-table-wrap { overflow-x: auto; }
@media (max-width: 800px) {
  .db-table { min-width: 560px; }
}

/* Database on tablets/phones: when the layout stacks, the folder tree
   becomes a horizontal chip row (one thumb-scroll) instead of a tall list
   pushing the items off-screen. Depth indents flatten — hierarchy reads
   from the tree on wide screens; on touch the chips are flat filters. */
@media (max-width: 800px) {
  .db-sidebar { padding: 10px 12px; }
  .db-sidebar .pe-lib-folder-list {
    display: flex; overflow-x: auto; gap: 6px;
    padding-bottom: 4px; -webkit-overflow-scrolling: touch;
  }
  .db-sidebar .pe-lib-folder {
    flex: none; white-space: nowrap;
    border: 1px solid var(--border); border-radius: 999px;
    padding: 6px 12px !important; /* beats the inline depth indent */
  }
  .db-sidebar .pe-lib-hint { display: none; }
}

/* ─── Mobile quote cards (proper layout, not a squashed table) ───── */
/* The generic table→block transform stacked unlabeled values and HID the
   product + date columns entirely (Michael 2026-06-10: "clunky, can't see
   dates"). Quote rows and job folders now lay out as designed cards:
   number + status up top, customer, product, date · rep, total. */
@media (max-width: 700px) {
  .table tr[data-quote-id],
  .table tr.job-folder-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "number   status"
      "customer customer"
      "product  product"
      "date     rep"
      "total    actions";
    gap: 3px 12px;
    align-items: center;
  }
  .table tr[data-quote-id] td, .table tr.job-folder-row td {
    display: block; padding: 0; border: none; margin: 0;
  }
  .table tr[data-quote-id] td:nth-child(1), .table tr.job-folder-row td:nth-child(1) { grid-area: number; }
  .table tr[data-quote-id] td:nth-child(2), .table tr.job-folder-row td:nth-child(2) { grid-area: customer; }
  .table tr[data-quote-id] td:nth-child(3), .table tr.job-folder-row td:nth-child(3) {
    grid-area: product; display: block; font-size: 12.5px; color: var(--text-faint);
  }
  .table tr[data-quote-id] td:nth-child(4), .table tr.job-folder-row td:nth-child(4) {
    grid-area: date; display: block; font-size: 12px; color: var(--text-faint);
  }
  .table tr[data-quote-id] td:nth-child(4)::before,
  .table tr.job-folder-row td:nth-child(4)::before { content: 'Created '; }
  .table tr[data-quote-id] td:nth-child(5), .table tr.job-folder-row td:nth-child(5) {
    grid-area: rep; font-size: 12px; color: var(--text-faint); text-align: right !important;
  }
  .table tr[data-quote-id] td:nth-child(5):not(:empty)::before { content: 'Rep: '; }
  .table tr[data-quote-id] td:nth-child(6), .table tr.job-folder-row td:nth-child(6) {
    grid-area: status; justify-self: end; text-align: right !important;
  }
  .table tr[data-quote-id] td:nth-child(7), .table tr.job-folder-row td:nth-child(7) {
    grid-area: total; font-size: 16px; font-weight: 800; text-align: left !important;
    padding-top: 4px;
  }
  .table tr[data-quote-id] td:nth-child(8), .table tr.job-folder-row td:nth-child(8) {
    grid-area: actions; justify-self: end; text-align: right !important;
    border: none; padding: 0; margin: 0;
  }
  /* Job folder cards: slightly tinted so the folder reads as a container */
  .table tr.job-folder-row { background: #f6f8fb; }
  /* Signs inside an expanded job folder indent under their folder card */
  .table tr.job-sign-row { margin-left: 14px; }

  /* Toolbar: search spans the row, filters sit comfortably beneath */
  .toolbar .search { max-width: none; flex-basis: 100%; }
  .toolbar .filter-select { flex: 1; min-width: 0; }
}

/* ─── Boot skeleton (shown if hydration outlasts the splash) ─────── */
.sk-shell { min-height: 100vh; background: var(--bg, #f5f7fa); }
.sk-topbar {
  height: 60px; background: var(--surface, #fff);
  border-bottom: 1px solid var(--border, #e5e7eb);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.sk-topbar-right { display: flex; align-items: center; gap: 12px; }
.sk {
  background: linear-gradient(90deg, #e8ecf1 25%, #f3f5f8 50%, #e8ecf1 75%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.3s infinite linear;
  border-radius: 8px;
}
.sk-logo { width: 110px; height: 22px; }
.sk-pill { width: 96px; height: 32px; border-radius: 999px; }
.sk-avatar { width: 34px; height: 34px; border-radius: 50%; }
.sk-page { max-width: 1280px; margin: 0 auto; padding: 32px 28px; }
.sk-title { width: 220px; height: 26px; margin-bottom: 10px; }
.sk-sub { width: 320px; height: 13px; margin-bottom: 28px; }
.sk-card { height: 64px; border-radius: 12px; margin-bottom: 18px; }
.sk-row { height: 46px; border-radius: 10px; margin-bottom: 10px; }
.sk-row-short { width: 70%; }
@keyframes sk-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

/* Quick profit-margin chips under the totals-panel input */
.cb-chip-row { display: flex; gap: 6px; justify-content: flex-end; padding: 2px 0 8px; }
.cb-chip {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 999px; padding: 3px 11px;
  font-size: 11.5px; font-weight: 700; color: var(--text-faint);
  cursor: pointer; transition: all 0.12s;
}
.cb-chip:hover { border-color: var(--primary); color: var(--primary); }
.cb-chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ─── Keyboard focus visibility (a11y pass, 2026-06-10) ──────────── */
/* Mouse/touch users see nothing new; keyboard users get a clear ring on
   links, buttons and the focusable header rows (months, job folders). */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
tr[tabindex="0"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.db-import-miss span:first-child { color: var(--text-faint); text-decoration: line-through; }

.db-cpi-inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

/* Supplier column (Corey 2026-06-11) — keep long entries from widening rows */
.db-cell-supplier { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
