/* ============================================================
   Window Quote Pro — Premium UI/UX Polish
   Pure visual upgrade. Zero logic changes.
   ============================================================ */

/* ---------- RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Colour tokens */
  --c-bg:        #f0f2f5;
  --c-surface:   #ffffff;
  --c-border:    #e2e5ea;
  --c-border-lt: #eef0f3;
  --c-text:      #111827;
  --c-text-2:    #4b5563;
  --c-text-3:    #6b7280;
  --c-text-4:    #9ca3af;
  --c-primary:   #2563eb;
  --c-primary-d: #1d4ed8;
  --c-primary-l: #eff6ff;
  --c-primary-b: #dbeafe;
  --c-green:     #059669;
  --c-green-l:   #ecfdf5;
  --c-amber:     #f59e0b;
  --c-amber-l:   #fffbeb;
  --c-red:       #dc2626;
  --c-red-l:     #fef2f2;

  /* Spacing */
  --sp-xs: 0.25rem;
  --sp-sm: 0.5rem;
  --sp-md: 0.75rem;
  --sp-lg: 1rem;
  --sp-xl: 1.25rem;
  --sp-2xl: 1.5rem;

  /* Radius */
  --r-sm:  0.5rem;
  --r-md:  0.75rem;
  --r-lg:  1rem;
  --r-xl:  1.25rem;
  --r-full: 9999px;

  /* Shadows */
  --sh-xs:  0 1px 2px rgba(0,0,0,0.04);
  --sh-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --sh-md:  0 4px 12px rgba(0,0,0,0.07);
  --sh-lg:  0 8px 24px rgba(0,0,0,0.09);
  --sh-xl:  0 12px 40px rgba(0,0,0,0.12);
  --sh-pri: 0 4px 14px rgba(37,99,235,0.22);

  /* Transitions */
  --tr: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: -0.01em;
}

input, textarea, select, button { font-family: inherit; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

#app { min-height: 100vh; display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* ---------- MODAL ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--sp-lg);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--sp-2xl);
  position: relative;
  animation: slideUp 0.25s ease;
}

.modal-header {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--c-text);
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.modal-subtitle {
  font-size: 0.84rem;
  color: var(--c-text-3);
  margin-bottom: var(--sp-2xl);
  line-height: 1.4;
}

.modal-close {
  position: absolute;
  top: var(--sp-lg);
  right: var(--sp-lg);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--r-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-3);
  font-size: 1.1rem;
  transition: all var(--tr);
}

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

.inline-action-row {
  display: flex;
  gap: 0.5rem;
}

.onboarding-gst-actions { margin-top: 0.5rem; }
.modal-button-row { margin-top: 1rem; }
.btn-flex { flex: 1; }
.btn-share-primary { font-size: 1rem; padding: 0.85rem 1.25rem; }

.modal-action-divider {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.plans-title {
  text-align: center;
  margin-bottom: 0.35rem;
}

.plans-subtitle {
  text-align: center;
  margin-bottom: 0;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title-row-gapped { gap: 0.75rem; }

.toggle-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
}

.toggle-block-start { margin-bottom: 0.75rem; }
.toggle-block, .form-block { margin-top: 0.8rem; }
.mb-form { margin-bottom: 0.8rem; }
.section-divider { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid #e5e7eb; }
.section-title-spaced { margin-top: 1rem; }
.mt-md { margin-top: 0.6rem; }
.mt-lg { margin-top: 1rem; }
.mb-lg { margin-bottom: 1rem; }
.text-left { text-align: left; }

.desktop-email-summary {
  margin-top: 1rem;
  padding: 0.9rem;
  border-radius: 1rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  color: #374151;
  font-size: 0.86rem;
  line-height: 1.55;
}

.invoice-upsell-copy {
  font-size: 0.88rem;
  color: #4b5563;
  line-height: 1.5;
  margin-bottom: 0.9rem;
}

.helper-copy-tight {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: #6b7280;
}

.settings-divider-text {
  text-align: center;
  font-size: 0.76rem;
  color: #9ca3af;
  margin: 0.4rem 0;
}

.logo-preview-empty {
  text-align: center;
  padding: 0.5rem 0;
}

.muted-note {
  color: #9ca3af;
  font-size: 0.85rem;
}

.helper-copy {
  font-size: 0.78rem;
  color: #6b7280;
}

.helper-copy-block { margin-bottom: 0.75rem; }
.helper-copy-readable { font-size: 0.8rem; }
.clickable-lock { cursor: pointer; }

/* ---------- HEADER ---------- */
.header {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--c-border-lt);
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 0 var(--sp-lg);
}

.header-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
  padding: 0.65rem 0;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.header-logo {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-d) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh-pri);
  flex-shrink: 0;
}

.header-logo svg { color: #fff; }

.header-title {
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.1;
  color: var(--c-text);
  letter-spacing: -0.02em;
}

.header-sub {
  font-size: 0.72rem;
  color: var(--c-text-4);
  margin-top: 1px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* ---------- BADGES ---------- */
.badge-free, .badge-pro {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.3rem 0.65rem;
  border-radius: var(--r-full);
  line-height: 1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-free {
  background: var(--c-bg);
  color: var(--c-text-4);
  border: 1px solid var(--c-border);
}

.badge-pro {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-d) 100%);
  color: #fff;
  box-shadow: var(--sh-pri);
}

/* ---------- MAIN CONTENT ---------- */
.main-content {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
  padding: var(--sp-lg) var(--sp-lg) 10rem;
  flex: 1;
}

/* ---------- CARDS ---------- */
.card {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--c-border-lt);
  box-shadow: var(--sh-sm);
  padding: var(--sp-xl);
  margin-bottom: var(--sp-lg);
  transition: box-shadow var(--tr);
}

.card.premium {
  border: 1.5px solid var(--c-primary-b);
  background: linear-gradient(135deg, var(--c-primary-l) 0%, var(--c-surface) 100%);
  box-shadow: var(--sh-md), 0 0 0 1px rgba(37,99,235,0.06);
}

.card-title {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--c-text);
  margin-bottom: var(--sp-lg);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  letter-spacing: -0.01em;
}

/* ---------- FORM ELEMENTS ---------- */
.field-label {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--c-text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.field-input, .field-select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: var(--r-md);
  border: 1.5px solid var(--c-border);
  background: var(--c-surface);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c-text);
  outline: none;
  transition: all var(--tr);
}

.field-input::placeholder, .field-select::placeholder {
  color: var(--c-text-4);
}

.field-input:focus, .field-select:focus {
  background: var(--c-surface);
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.field-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md);
}

.field-full { grid-column: 1 / -1; }
.field-stack { display: flex; flex-direction: column; gap: var(--sp-md); }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.7rem 1.1rem;
  border-radius: var(--r-md);
  border: none;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--tr);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-d) 100%);
  color: #fff;
  box-shadow: var(--sh-pri);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(37,99,235,0.3);
}

.btn-secondary {
  background: var(--c-bg);
  color: var(--c-text-2);
  border: 1px solid var(--c-border);
}

.btn-secondary:hover {
  background: var(--c-border-lt);
  border-color: #d1d5db;
}

.btn-success {
  background: linear-gradient(135deg, var(--c-green) 0%, #047857 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(5,150,105,0.22);
}

.btn-success:hover {
  box-shadow: 0 6px 20px rgba(5,150,105,0.3);
}

.btn-danger-soft {
  background: var(--c-red-l);
  color: var(--c-red);
  border: 1px solid #fecaca;
}

.btn-danger-soft:hover {
  background: #fee2e2;
}

.btn-full { width: 100%; }
.btn-sm { padding: 0.48rem 0.8rem; font-size: 0.8rem; }

/* ---------- CHIPS ---------- */
.chip-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-md);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.32rem 0.7rem;
  border-radius: var(--r-full);
  font-size: 0.73rem;
  font-weight: 700;
  background: var(--c-primary-l);
  color: var(--c-primary-d);
  border: 1px solid var(--c-primary-b);
  cursor: pointer;
  transition: all var(--tr);
  white-space: nowrap;
}

.chip:hover {
  background: var(--c-primary-b);
}

/* ---------- PREMIUM PRO DASHBOARD ---------- */
.premium-dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
  margin-bottom: var(--sp-lg);
}

.dashboard-hero {
  border-radius: 1.35rem;
  padding: var(--sp-xl);
  color: #fff;
  background:
    radial-gradient(circle at 92% 12%, rgba(45, 212, 191, 0.36), transparent 34%),
    linear-gradient(135deg, #0756d8 0%, #0f7bf3 55%, #15a8c9 100%);
  box-shadow: 0 18px 42px rgba(10, 99, 210, 0.24);
  overflow: hidden;
}

.dashboard-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-md);
}

.dashboard-eyebrow {
  max-width: 11rem;
  font-size: 0.76rem;
  font-weight: 800;
  color: rgba(255,255,255,0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-hero h2 {
  margin-top: 0.1rem;
  font-size: 1.72rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.dashboard-hero p {
  max-width: 14rem;
  margin-top: 0.28rem;
  color: rgba(255,255,255,0.78);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.dashboard-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.38rem;
  flex-wrap: wrap;
  max-width: 52%;
}

.dashboard-plan-badge {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  max-width: 8.8rem;
  padding: 0.38rem 0.62rem;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.16);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-icon-button {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.13);
  color: #fff;
  cursor: pointer;
}

.dashboard-icon-button svg,
.dashboard-status-icon svg,
.dashboard-primary-action svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-primary-action {
  width: 100%;
  min-height: 3.15rem;
  margin-top: var(--sp-xl);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 0;
  border-radius: 1rem;
  background: #fff;
  color: #0756d8;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(5, 38, 96, 0.18);
}

.dashboard-section,
.dashboard-panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border-lt);
  border-radius: 1.15rem;
  padding: var(--sp-lg);
  box-shadow: var(--sh-sm);
}

.dashboard-section-title,
.dashboard-panel-head h3 {
  color: #082047;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0;
}

.dashboard-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-md);
}

.dashboard-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: var(--sp-md);
}

.dashboard-status-card {
  min-width: 0;
  min-height: 6.2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  border: 1px solid var(--dash-border, var(--c-border));
  border-radius: 0.95rem;
  padding: 0.72rem;
  background: var(--dash-bg, #fff);
  color: var(--dash-fg, var(--c-text));
  cursor: pointer;
  text-align: left;
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.03);
}

.dashboard-status-card.active {
  border-color: var(--dash-fg);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
}

.dashboard-status-icon {
  width: 1.85rem;
  height: 1.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  background: rgba(255,255,255,0.72);
}

.dashboard-status-count {
  font-size: 1.38rem;
  line-height: 1;
  font-weight: 800;
  color: #07182f;
  font-variant-numeric: tabular-nums;
}

.dashboard-status-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--dash-fg);
}

.tone-blue { --dash-bg: #eff6ff; --dash-border: #bfdbfe; --dash-fg: #1d4ed8; }
.tone-teal { --dash-bg: #ecfeff; --dash-border: #a5f3fc; --dash-fg: #0e7490; }
.tone-amber { --dash-bg: #fffbeb; --dash-border: #fde68a; --dash-fg: #b45309; }
.tone-green { --dash-bg: #ecfdf5; --dash-border: #bbf7d0; --dash-fg: #047857; }

.dashboard-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-lg);
}

.dashboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.62rem;
}

.dashboard-job-row,
.dashboard-invoice-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-sm);
  padding: 0.78rem;
  border: 1px solid var(--c-border-lt);
  border-radius: 0.9rem;
  background: #fbfdff;
  text-align: left;
}

.dashboard-job-row {
  cursor: pointer;
}

.dashboard-row-main,
.dashboard-row-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
}

.dashboard-row-main {
  flex: 1;
}

.dashboard-row-main strong {
  color: #0f172a;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-row-main small,
.dashboard-row-date {
  color: var(--c-text-3);
  font-size: 0.72rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dashboard-row-side {
  flex: 0 0 auto;
  align-items: flex-end;
  max-width: 42%;
}

.dashboard-status-badge,
.dashboard-pay-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 0.18rem 0.48rem;
  border-radius: var(--r-full);
  font-size: 0.62rem;
  font-weight: 600;
  white-space: nowrap;
}

.dashboard-status-badge {
  background: #e0f2fe;
  color: #075985;
}

.dashboard-pay-badge.paid {
  background: var(--c-green-l);
  color: var(--c-green);
}

.dashboard-pay-badge.partial {
  background: var(--c-amber-l);
  color: #b45309;
}

.dashboard-pay-badge.due {
  background: var(--c-red-l);
  color: var(--c-red);
}

.dashboard-row-money {
  color: #0f172a;
  font-weight: 700;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.dashboard-mini-action {
  border: 0;
  border-radius: 0.72rem;
  padding: 0.38rem 0.62rem;
  background: #0b63e5;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.dashboard-empty {
  padding: 1.25rem 0.6rem;
  color: var(--c-text-3);
  font-size: 0.86rem;
  text-align: center;
  background: #fbfdff;
  border: 1px dashed var(--c-border);
  border-radius: 0.9rem;
}

/* ---------- STEPPER ROWS ---------- */
.stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
  padding: 0.7rem 0.85rem;
  border-radius: var(--r-lg);
  border: 1.5px solid var(--c-border-lt);
  background: var(--c-surface);
  margin-bottom: var(--sp-sm);
  transition: all var(--tr);
}

.stepper-row.active {
  background: var(--c-primary-l);
  border-color: var(--c-primary-b);
  box-shadow: 0 2px 8px rgba(37,99,235,0.06);
}

.stepper-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--c-text-2);
  min-width: 0;
}

.stepper-row.active .stepper-label { color: var(--c-primary-d); font-weight: 700; }
.stepper-label svg { color: var(--c-text-4); flex-shrink: 0; }
.stepper-row.active .stepper-label svg { color: var(--c-primary); }

.stepper-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.stepper-val {
  width: 2rem;
  text-align: center;
  font-weight: 800;
  font-size: 1rem;
  color: var(--c-text-3);
  font-variant-numeric: tabular-nums;
}

.stepper-row.active .stepper-val { color: var(--c-primary-d); }

.btn-stepper {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--r-md);
  border: 1.5px solid var(--c-border);
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-surface);
  color: var(--c-text-2);
  transition: all var(--tr);
}

.btn-stepper:active { transform: scale(0.92); }

.btn-stepper.plus {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-d) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--sh-pri);
}

.btn-stepper.minus:disabled { opacity: 0.3; cursor: default; }

/* ---------- QUOTE PREVIEW ---------- */
.quote-preview-pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.82rem;
  color: var(--c-text-2);
  background: var(--c-bg);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  border: 1px solid var(--c-border-lt);
  font-family: 'DM Sans', system-ui, sans-serif;
  line-height: 1.6;
}

.quote-preview-html {
  white-space: normal;
}

.quote-preview-block {
  display: grid;
  gap: 0.75rem;
}

.quote-preview-heading {
  font-weight: 700;
  color: var(--c-text);
}

.quote-preview-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--c-border-lt);
}

.quote-preview-line:last-child {
  border-bottom: 0;
}

.quote-preview-label {
  color: var(--c-text-3);
  font-weight: 700;
}

.quote-preview-value {
  color: var(--c-text);
  font-weight: 800;
  text-align: right;
}

.quote-preview-total {
  margin-top: 0.2rem;
  padding-top: 0.65rem;
  border-top: 2px solid var(--c-primary);
  font-size: 1.05rem;
}

.second-storey-adjustment {
  display: grid;
  gap: 0.6rem;
}

.final-quote-editor {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid #bddcf8;
  border-radius: var(--r-lg);
  background: #eef7ff;
}

.final-quote-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.final-quote-breakdown span {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--c-text-3);
}

.final-quote-breakdown small { font-weight: 700; }
.final-quote-breakdown strong { color: var(--c-text); font-variant-numeric: tabular-nums; }
.final-quote-breakdown strong.positive { color: #047857; }
.final-quote-breakdown strong.negative { color: #b91c1c; }

.currency-input-wrap {
  position: relative;
}

.currency-input-wrap > span {
  position: absolute;
  z-index: 1;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-text-3);
  font-weight: 800;
}

.currency-input-wrap .field-input {
  width: 100%;
  padding-left: 2rem;
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.quote-rounding-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.quote-rounding-presets .btn { min-height: 2.7rem; }

.field-warning {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #fde68a;
  border-radius: var(--r-md);
  background: #fffbeb;
  color: #92400e;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.45;
}

.text-link {
  border: 0;
  background: transparent;
  color: var(--c-primary);
  font: inherit;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.auth-forgot-link {
  align-self: center;
  margin-top: -0.2rem;
}

.auth-status-message {
  padding: 0.65rem 0.75rem;
  border-radius: var(--r-md);
  background: var(--c-bg);
  border: 1px solid var(--c-border-lt);
  color: var(--c-text-2);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
}

.auth-status-message.success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.auth-status-message.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

/* ---------- SUMMARY STATS ---------- */
.summary-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-md);
}

.summary-stat {
  background: var(--c-bg);
  border: 1px solid var(--c-border-lt);
  border-radius: var(--r-lg);
  padding: 0.65rem 0.8rem;
  transition: all var(--tr);
}

.summary-stat-label {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--c-text-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-stat-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--c-text);
  margin-top: 0.15rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- QUOTE FOOTER ---------- */
.quote-footer {
  position: fixed;
  bottom: 4.5rem;
  left: 0;
  right: 0;
  z-index: 40;
  pointer-events: none;
}

.quote-footer-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 var(--sp-md);
  pointer-events: auto;
}

.quote-footer-card {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--c-border-lt);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  padding: 0.75rem var(--sp-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
}

.quote-price {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--c-text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.quote-price-sub {
  font-size: 0.72rem;
  color: var(--c-text-4);
  margin-top: 0.15rem;
  font-weight: 600;
}

.quote-footer-actions {
  display: flex;
  gap: var(--sp-sm);
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ---------- AUTH TABS ---------- */
.auth-tabs {
  display: flex;
  gap: 0.2rem;
  margin-bottom: var(--sp-lg);
  background: var(--c-bg);
  border-radius: var(--r-lg);
  padding: 0.2rem;
}

.auth-tab {
  flex: 1;
  padding: 0.62rem;
  border-radius: var(--r-md);
  border: none;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--c-text-3);
  cursor: pointer;
  text-align: center;
  transition: all var(--tr);
}

.auth-tab.active {
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: var(--sh-sm);
}

/* ---------- TAB BAR ---------- */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--c-border-lt);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 16px rgba(0,0,0,0.05);
}

.tab-bar-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0.4rem var(--sp-lg);
  gap: 0.2rem;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.45rem 0.5rem;
  border-radius: var(--r-md);
  border: none;
  background: none;
  cursor: pointer;
  color: var(--c-text-4);
  transition: color var(--tr);
}

.tab-btn.active { color: var(--c-primary); }

.tab-btn-icon {
  width: 2.5rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  transition: background var(--tr);
}

.tab-btn.active .tab-btn-icon {
  background: var(--c-primary-l);
}

.tab-btn-label {
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
}

/* ---------- CUSTOMERS ---------- */
.customers-toolbar-card { padding-bottom: var(--sp-lg); }

.customers-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-lg);
  margin-bottom: var(--sp-lg);
}

.customers-list {
  display: grid;
  gap: var(--sp-md);
}

.customer-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border-lt);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  padding: var(--sp-lg);
}

.customer-card-main {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 0.25rem;
  padding: 0;
}

.customer-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--c-text);
}

.customer-card-meta,
.customer-card-address {
  font-size: 0.83rem;
  color: var(--c-text-3);
  overflow-wrap: anywhere;
}

.customer-card-actions {
  display: flex;
  gap: var(--sp-sm);
  margin-top: var(--sp-md);
}

.customer-empty-state {
  text-align: center;
  padding: var(--sp-2xl);
}

.customer-sync-status {
  display: inline-flex;
  width: fit-content;
  margin-top: 0.35rem;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.68rem;
  font-weight: 700;
}

.customer-empty-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--r-lg);
  background: var(--c-primary-l);
  color: var(--c-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-md);
}

.quote-customer-results {
  margin-top: var(--sp-sm);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  box-shadow: var(--sh-md);
  overflow: hidden;
}

.quote-customer-option {
  width: 100%;
  display: grid;
  gap: 0.15rem;
  padding: 0.7rem 0.8rem;
  border: 0;
  border-bottom: 1px solid var(--c-border-lt);
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--c-text);
}

.quote-customer-option:last-child { border-bottom: 0; }
.quote-customer-option:hover { background: var(--c-primary-l); }
.quote-customer-option span { font-weight: 800; }
.quote-customer-option small { color: var(--c-text-3); overflow-wrap: anywhere; }

.site-address-list {
  display: grid;
  gap: var(--sp-sm);
}

.site-address-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--sp-sm);
  align-items: center;
}

.customer-detail-panel {
  border: 1px solid var(--c-border-lt);
  border-radius: var(--r-md);
  background: #f9fafb;
  padding: var(--sp-lg);
  margin-bottom: var(--sp-lg);
  display: grid;
  gap: var(--sp-sm);
  font-size: 0.86rem;
  color: var(--c-text-2);
}

.customer-detail-panel strong {
  color: var(--c-text);
}

@media (max-width: 520px) {
  .customers-toolbar,
  .customer-card-actions,
  .site-address-row {
    grid-template-columns: 1fr;
  }

  .customers-toolbar {
    display: grid;
  }

  .customer-card-actions .btn {
    width: 100%;
  }
}

/* ---------- PRO / TEAM ---------- */
.team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-lg);
  gap: var(--sp-lg);
}

.team-name {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--c-text);
  letter-spacing: -0.02em;
}

.team-meta {
  font-size: 0.74rem;
  color: var(--c-text-3);
  margin-top: 2px;
}

.role-badge {
  font-size: 0.66rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: var(--r-full);
  white-space: nowrap;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.role-owner {
  background: var(--c-primary-l);
  color: var(--c-primary-d);
  border: 1px solid var(--c-primary-b);
}

.role-staff {
  background: var(--c-bg);
  color: var(--c-text-3);
  border: 1px solid var(--c-border);
}

/* ---------- KPI / REVENUE DASHBOARD ---------- */
.kpi-grid,
.revenue-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md);
  margin-bottom: var(--sp-lg);
}

.kpi-card,
.revenue-card {
  background: var(--c-bg);
  border: 1px solid var(--c-border-lt);
  border-radius: var(--r-lg);
  padding: 0.85rem var(--sp-lg);
  transition: all var(--tr);
}

.kpi-label,
.revenue-label {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--c-text-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--c-text);
  margin-top: 0.2rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.revenue-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--c-green);
  margin-top: 0.2rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.revenue-pending { color: var(--c-amber); }

/* ---------- JOB CARDS ---------- */
.job-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border-lt);
  border-radius: var(--r-xl);
  margin-bottom: var(--sp-md);
  overflow: hidden;
  box-shadow: var(--sh-xs);
  transition: box-shadow var(--tr);
}

.job-card-header {
  padding: 0.85rem var(--sp-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-lg);
  cursor: pointer;
  transition: background var(--tr);
}

.job-card-header:hover {
  background: var(--c-bg);
}

.job-card-header svg {
  color: var(--c-text-4);
  flex-shrink: 0;
  transition: transform var(--tr);
}

.job-card-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--c-text);
  letter-spacing: -0.01em;
}

.job-card-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
  font-size: 0.73rem;
  color: var(--c-text-4);
  font-weight: 500;
}

.job-card-body {
  padding: var(--sp-lg);
  border-top: 1px solid var(--c-border-lt);
  background: var(--c-bg);
}

.job-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-sm) var(--sp-md);
  margin-bottom: var(--sp-md);
}

.job-detail-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--c-text-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.job-detail-val {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-text-2);
  word-break: break-word;
  margin-top: 1px;
}

.job-actions {
  display: flex;
  gap: var(--sp-sm);
  flex-wrap: wrap;
  margin-top: var(--sp-lg);
}

/* ---------- RATE CARDS (Settings) ---------- */
.rate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-sm);
}

.rate-card {
  background: var(--c-bg);
  border: 1px solid var(--c-border-lt);
  border-radius: var(--r-md);
  padding: var(--sp-md);
  transition: all var(--tr);
}

.rate-card-label {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--c-text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.rate-card-input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--c-border);
  background: var(--c-surface);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--c-text);
  outline: none;
  transition: all var(--tr);
}

.rate-card-input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* ---------- TOAST ---------- */
#toast-container {
  position: fixed;
  top: var(--sp-lg);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  pointer-events: none;
}

.toast {
  padding: 0.65rem var(--sp-lg);
  border-radius: var(--r-md);
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  background: #1f2937;
  box-shadow: var(--sh-lg);
  pointer-events: auto;
  animation: slideUp 0.2s ease;
}

.toast.success { background: var(--c-green); }
.toast.error { background: var(--c-red); }
.toast.warning { background: #d97706; }

/* ---------- SHARE MODAL ---------- */
.share-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md);
}

.share-option {
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-lg) var(--sp-md);
  text-align: center;
  cursor: pointer;
  transition: all var(--tr);
}

.share-option:hover {
  border-color: var(--c-primary-b);
  background: var(--c-primary-l);
  box-shadow: var(--sh-sm);
}

.share-option:active {
  transform: scale(0.97);
}

.share-option-icon { font-size: 1.5rem; margin-bottom: 0.35rem; }
.share-option-label { font-size: 0.73rem; font-weight: 700; color: var(--c-text-3); }

.share-option:hover .share-option-label { color: var(--c-primary-d); }

/* ---------- SETTINGS LOCK ---------- */
.settings-lock {
  padding: var(--sp-2xl);
  text-align: center;
  color: var(--c-text-3);
  font-size: 0.88rem;
  font-weight: 500;
  background: var(--c-bg);
  border-radius: var(--r-md);
  border: 1.5px dashed var(--c-border);
  line-height: 1.5;
}

/* ---------- SUBSCRIPTION ---------- */
.sub-status-card {
  background: linear-gradient(135deg, var(--c-primary-l) 0%, var(--c-surface) 100%);
  border: 1.5px solid var(--c-primary-b);
  border-radius: var(--r-xl);
  padding: var(--sp-xl);
  margin-bottom: var(--sp-lg);
}

.sub-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-md);
}

.sub-plan-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.28rem 0.65rem;
  border-radius: var(--r-full);
  line-height: 1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.sub-plan-trial {
  background: var(--c-amber-l);
  color: #92400e;
  border: 1px solid #fde68a;
}

.sub-plan-active {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-d) 100%);
  color: #fff;
}

.sub-plan-free {
  background: var(--c-bg);
  color: var(--c-text-3);
  border: 1px solid var(--c-border);
}

.sub-plan-expired {
  background: var(--c-red-l);
  color: var(--c-red);
  border: 1px solid #fecaca;
}

.sub-status-detail {
  font-size: 0.78rem;
  color: var(--c-text-3);
  margin-bottom: var(--sp-sm);
}

.sub-warning {
  background: var(--c-red-l);
  border: 1px solid #fecaca;
  border-radius: var(--r-md);
  padding: var(--sp-md);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-red);
  margin-bottom: var(--sp-md);
}

.sub-trial-bar {
  height: 5px;
  background: var(--c-border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: var(--sp-md);
}

.sub-trial-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-primary), var(--c-primary-d));
  border-radius: 3px;
  transition: width 0.4s ease;
}

.sub-trial-bar-fill.low {
  background: linear-gradient(90deg, var(--c-amber), #d97706);
}

.sub-trial-bar-fill.critical {
  background: linear-gradient(90deg, var(--c-red), #b91c1c);
}

/* ---------- ONBOARDING ---------- */
.onboarding-step { margin-bottom: var(--sp-2xl); }

.onboarding-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-d) 100%);
  color: #fff;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: var(--sp-sm);
  box-shadow: var(--sh-pri);
}

.onboarding-step-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--c-text);
  margin-bottom: var(--sp-sm);
}

.onboarding-step .btn.gst-active {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}

/* ---------- TOGGLE SWITCH ---------- */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 2.75rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--c-border);
  border-radius: var(--r-full);
  transition: all var(--tr);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 1.15rem;
  width: 1.15rem;
  left: 0.18rem;
  bottom: 0.175rem;
  background: var(--c-surface);
  border-radius: 50%;
  transition: all var(--tr);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--c-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(1.25rem);
}

/* ---------- CHECKBOX UPGRADE ---------- */
.toggle-switch input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
  border: none;
  background: none;
}

.toggle-switch input[type="checkbox"]:checked {
  background: none;
  border-color: transparent;
}

.toggle-switch input[type="checkbox"]:checked::after {
  content: none;
}

.toggle-switch input[type="checkbox"]:focus {
  box-shadow: none;
}

input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid var(--c-border);
  border-radius: 0.3rem;
  background: var(--c-surface);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all var(--tr);
}

input[type="checkbox"]:checked {
  background: var(--c-primary);
  border-color: var(--c-primary);
}

input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

/* ---------- V73 ACCESSIBLE FOCUS STATES ---------- */
:where(
  a,
  button,
  .btn,
  input,
  select,
  textarea,
  [role="button"],
  [tabindex]:not([tabindex="-1"]),
  .tab-btn,
  .dash-action,
  .dashboard-action,
  .dashboard-card,
  .modal-close,
  .modal-action,
  .rate-card,
  .rate-card-input
):focus-visible {
  outline: 3px solid rgba(37,99,235,0.72);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(37,99,235,0.16);
}

:where(
  .field-input,
  .field-select,
  textarea,
  .rate-card-input
):focus-visible {
  border-color: rgba(37,99,235,0.82);
}

:where(.toggle-switch, label):has(input[type="checkbox"]:focus-visible) {
  outline: 3px solid rgba(37,99,235,0.72);
  outline-offset: 4px;
  border-radius: var(--r-md);
}

.toggle-switch input[type="checkbox"]:focus-visible {
  box-shadow: none;
}

input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(37,99,235,0.72);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(37,99,235,0.16);
}

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-text-4); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 520px) {
  .field-grid-2,
  .summary-stats,
  .kpi-grid,
  .revenue-grid,
  .job-detail-grid,
  .rate-grid {
    grid-template-columns: 1fr 1fr;
  }

  .field-grid-2 { gap: var(--sp-sm); }

  .card { padding: var(--sp-lg); }

  .quote-footer-card { padding: 0.7rem var(--sp-md); }
  .quote-price { font-size: 1.5rem; }
  .header-sub { max-width: 120px; }
  .quote-footer-actions .btn { padding-left: 0.75rem; padding-right: 0.75rem; }

  .modal { padding: var(--sp-xl); }

  .kpi-val, .revenue-val { font-size: 1.2rem; }

  .dashboard-hero {
    padding: var(--sp-lg);
  }

  .dashboard-hero-top {
    align-items: flex-start;
  }

  .dashboard-overview-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-status-card {
    min-height: 5.7rem;
  }
}

@media (max-width: 380px) {
  .field-grid-2 { grid-template-columns: 1fr; }
  .summary-stats { grid-template-columns: 1fr 1fr; }
  .kpi-grid, .revenue-grid { grid-template-columns: 1fr 1fr; }
  .rate-grid { grid-template-columns: 1fr; }
  .job-detail-grid { grid-template-columns: 1fr; }
  .dashboard-hero-top { flex-direction: column; }
  .dashboard-hero-actions { max-width: 100%; justify-content: flex-start; }
  .dashboard-row-side { max-width: 46%; }
  .dashboard-row-main strong { white-space: normal; }
}

/* ---------- PRINT ---------- */
@media print {
  body { background: #fff; }
  .header, .tab-bar, .quote-footer, #toast-container { display: none !important; }
  .final-quote-editor, #quote-summary-stats { display: none !important; }
  .main-content { padding: 0; }
  .modal-overlay { display: none !important; }
}
/* ---------- PAYMENT BADGES ---------- */
.pay-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--r-full);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
  margin-left: 0.4rem;
}
.pay-badge-paid {
  background: var(--c-green-l);
  color: var(--c-green);
  border: 1px solid #a7f3d0;
}
.pay-badge-partial {
  background: var(--c-amber-l);
  color: #b45309;
  border: 1px solid #fde68a;
}
.pay-badge-unpaid {
  background: var(--c-red-l);
  color: var(--c-red);
  border: 1px solid #fecaca;
}
/* ---------- COMPLETION MODAL OPTIONS ---------- */
.completion-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}
.completion-options .btn {
  font-size: 0.92rem;
  padding: 0.85rem 1rem;
}
.btn-icon-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
/* ---------- JOB COMPLETED ACTIONS ---------- */
.job-completed-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.job-completed-actions .btn {
  flex: 1;
  min-width: 120px;
}
/* ---------- LOGO UPLOAD ---------- */
#logo-upload-section .field-input[type="file"] {
  padding: 0.5rem;
  font-size: 0.85rem;
}
#logo-preview img {
  display: block;
  margin: 0 auto;
}


/* ---------- PAYWALL / PLANS ---------- */
.plans-modal { max-width: 760px; }
.plans-hero { margin-bottom: 1rem; }
.plans-kicker { text-align:center; font-size:0.72rem; font-weight:800; letter-spacing:0.08em; text-transform:uppercase; color:#2563eb; margin-bottom:0.4rem; }
.plans-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:0.85rem; margin-bottom:1rem; }
.plan-card { position:relative; border:1px solid var(--c-border); border-radius:1rem; padding:1rem; background:#fff; box-shadow:var(--shadow-sm); }
.plan-card-featured { border:2px solid #2563eb; box-shadow:0 12px 24px rgba(37,99,235,0.12); }
.plan-badge { position:absolute; top:-0.65rem; left:1rem; background:#2563eb; color:#fff; border-radius:999px; padding:0.22rem 0.55rem; font-size:0.68rem; font-weight:800; letter-spacing:0.03em; text-transform:uppercase; }
.plan-tier { font-size:1rem; font-weight:800; color:#111827; margin-bottom:0.25rem; }
.plan-price { font-size:1.75rem; font-weight:800; color:#111827; line-height:1; margin-bottom:0.35rem; }
.plan-price span { font-size:0.82rem; font-weight:700; color:#6b7280; margin-left:0.2rem; }
.plan-price-sub { font-size:0.8rem; color:#6b7280; margin-bottom:0.8rem; min-height:2.2em; }
.plan-feature-list { display:flex; flex-direction:column; gap:0.42rem; margin-bottom:0.9rem; }
.plan-feature-item { font-size:0.82rem; color:#374151; }
.plans-table-wrap { overflow:auto; border:1px solid var(--c-border); border-radius:1rem; }
.plans-table { width:100%; border-collapse:collapse; font-size:0.82rem; background:#fff; }
.plans-table th, .plans-table td { padding:0.72rem 0.8rem; border-bottom:1px solid #e5e7eb; text-align:center; }
.plans-table th:first-child, .plans-table td:first-child { text-align:left; font-weight:700; color:#111827; }
.plans-table thead th { background:#f8fafc; font-size:0.74rem; text-transform:uppercase; letter-spacing:0.05em; color:#6b7280; }
.paywall-chip { display:inline-flex; align-items:center; justify-content:center; padding:0.2rem 0.48rem; border-radius:999px; background:#eff6ff; color:#1d4ed8; border:1px solid #bfdbfe; font-size:0.7rem; font-weight:800; letter-spacing:0.03em; }
.plan-card-dim { opacity:0.7; transform:scale(0.985); }
@media (max-width: 700px) { .plans-grid { grid-template-columns:1fr; } .plans-modal { max-width: 94vw; } }


/* ---------- REBOOKING / REPEAT REVENUE TRACKER ---------- */
.rebook-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-lg);
}

.rebook-stat {
  background: var(--c-bg);
  border: 1px solid var(--c-border-lt);
  border-radius: var(--r-lg);
  padding: 0.65rem 0.8rem;
  text-align: center;
}

.rebook-stat-val {
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  margin-bottom: 0.1rem;
}

.rebook-stat-label {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--c-text-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rebook-stat-overdue { color: var(--c-red); }
.rebook-stat-due { color: var(--c-amber); }
.rebook-stat-upcoming { color: var(--c-primary); }

.rebook-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border-lt);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  margin-bottom: var(--sp-sm);
  transition: box-shadow var(--tr);
}

.rebook-card:hover {
  box-shadow: var(--sh-sm);
}

.rebook-card-header {
  margin-bottom: var(--sp-sm);
}

.rebook-card-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--c-text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.rebook-card-address {
  font-size: 0.78rem;
  color: var(--c-text-3);
  margin-top: 0.15rem;
}

.rebook-card-dates {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-md);
}

.rebook-date-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--c-text-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rebook-date-val {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-text-2);
  margin-top: 1px;
}

.rebook-card-actions {
  display: flex;
  gap: var(--sp-sm);
  flex-wrap: wrap;
}

.rebook-card-actions .btn {
  flex: 1;
  min-width: 80px;
}

/* Rebooking status badges */
.rebook-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--r-full);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
}

.rebook-badge-overdue {
  background: var(--c-red-l);
  color: var(--c-red);
  border: 1px solid #fecaca;
}

.rebook-badge-due {
  background: var(--c-amber-l);
  color: #b45309;
  border: 1px solid #fde68a;
}

.rebook-badge-upcoming {
  background: var(--c-primary-l);
  color: var(--c-primary-d);
  border: 1px solid var(--c-primary-b);
}

.rebook-badge-contacted {
  background: var(--c-green-l);
  color: var(--c-green);
  border: 1px solid #a7f3d0;
}

.rebook-badge-dismissed {
  background: var(--c-bg);
  color: var(--c-text-4);
  border: 1px solid var(--c-border);
}

/* Inline rebooking display on completed job cards */
.rebook-inline {
  margin-top: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  background: var(--c-primary-l);
  border: 1px solid var(--c-primary-b);
  border-radius: var(--r-md);
}

.rebook-set-btn {
  margin-top: var(--sp-sm);
}

@media (max-width: 520px) {
  .rebook-stats {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .rebook-card-dates {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 380px) {
  .rebook-stats {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .rebook-card-dates {
    grid-template-columns: 1fr;
  }
}

/* ---------- JOB OVERFLOW MENU (Cancel / Delete) ---------- */
.job-overflow-wrap {
  position: relative;
  flex-shrink: 0;
  z-index: 5;
}

.job-overflow-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--c-text-4);
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  border-radius: var(--r-md);
  transition: all var(--tr);
  letter-spacing: 0.1em;
  padding: 0;
  line-height: 1;
}

.job-overflow-btn:hover {
  background: var(--c-bg);
  color: var(--c-text-2);
}

.job-overflow-btn:active {
  transform: scale(0.92);
}

.job-overflow-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 50;
  min-width: 150px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  padding: 0.3rem 0;
  animation: fadeIn 0.12s ease;
}

.job-overflow-menu button {
  display: block;
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: none;
  background: none;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-text-2);
  cursor: pointer;
  transition: background var(--tr);
  min-height: 44px;
  line-height: 1.3;
}

.job-overflow-menu button:hover {
  background: var(--c-bg);
}

.job-overflow-menu button.danger {
  color: var(--c-red);
}

.job-overflow-menu button.danger:hover {
  background: var(--c-red-l);
}

/* ---------- JOB GROUP ACCORDION (Completed / Scheduled) ---------- */
.job-group {
  margin-bottom: var(--sp-md);
}

.job-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem var(--sp-lg);
  background: var(--c-surface);
  border: 1px solid var(--c-border-lt);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all var(--tr);
  min-height: 44px;
  user-select: none;
  -webkit-user-select: none;
}

.job-group-header:hover {
  background: var(--c-bg);
  box-shadow: var(--sh-xs);
}

.job-group-header:active {
  transform: scale(0.99);
}

.job-group-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--c-text);
  letter-spacing: -0.01em;
}

.job-group-count {
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--c-text-3);
}

.job-group-chevron {
  color: var(--c-text-4);
  flex-shrink: 0;
  transition: transform var(--tr);
}

.job-group-content {
  padding-top: var(--sp-sm);
  transition: max-height 0.25s ease;
}

/* Collapsed state */
.job-group.collapsed .job-group-content {
  display: none;
}

.job-group.collapsed .job-group-chevron {
  transform: rotate(-90deg);
}

.job-group.collapsed .job-group-header {
  border-radius: var(--r-lg);
}


/* ---------- APP SHELL COMPAT FIXES ---------- */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--c-border-lt);
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 0 var(--sp-lg);
}

.app-header-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
  padding: 0.65rem 0;
}

.app-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.1;
  color: var(--c-text);
  letter-spacing: -0.02em;
}

.app-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-logo {
  width: 2.25rem;
  height: 2.25rem;
  max-width: 2.25rem;
  max-height: 2.25rem;
  object-fit: contain;
  border-radius: var(--r-md);
  flex-shrink: 0;
  display: block;
}

.app-content {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
  padding: var(--sp-lg) var(--sp-lg) 10rem;
  flex: 1;
}

.plans-launch-note {
  margin: 0.75rem 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.10);
  border: 1px solid rgba(16, 185, 129, 0.22);
  color: #065f46;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

/* ============================================================
   WQP HARDEN PASS — Conversion-grade premium UI layer
   Visual-only upgrade. No pricing/maths/business logic touched.
   ============================================================ */
:root {
  --c-bg: #eaf3ff;
  --c-surface: rgba(255,255,255,0.96);
  --c-border: #c9ddf7;
  --c-border-lt: rgba(255,255,255,0.72);
  --c-text: #07182f;
  --c-text-2: #2f4666;
  --c-text-3: #5f7490;
  --c-text-4: #8aa1bd;
  --c-primary: #0077ff;
  --c-primary-d: #004fc7;
  --c-primary-l: #e8f3ff;
  --c-primary-b: #b8dcff;
  --c-green: #09a66d;
  --c-amber: #ffbf00;
  --sh-sm: 0 4px 16px rgba(6, 45, 99, 0.07);
  --sh-md: 0 12px 34px rgba(6, 45, 99, 0.12);
  --sh-lg: 0 18px 50px rgba(6, 45, 99, 0.16);
  --sh-xl: 0 24px 70px rgba(3, 30, 74, 0.24);
  --sh-pri: 0 12px 30px rgba(0, 119, 255, 0.30);
}

body {
  background:
    radial-gradient(circle at 16% 5%, rgba(0,119,255,0.22), transparent 30rem),
    radial-gradient(circle at 86% 0%, rgba(255,214,10,0.20), transparent 24rem),
    linear-gradient(180deg, #f7fbff 0%, #eaf3ff 42%, #f7fbff 100%);
}

.app-header {
  background: linear-gradient(135deg, rgba(0,92,220,0.96), rgba(0,119,255,0.90));
  border-bottom: 1px solid rgba(255,255,255,0.20);
  box-shadow: 0 10px 30px rgba(0, 72, 170, 0.20);
}

.app-title { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.app-logo { border-radius: 1rem; box-shadow: 0 10px 24px rgba(0,0,0,0.26); background: #fff; }
.app-header .badge-free {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.32);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.20);
}
.app-header .badge-pro {
  background: linear-gradient(135deg, #ffd60a, #ffb703);
  color: #072044;
  border: 1px solid rgba(255,255,255,0.45);
  box-shadow: 0 10px 24px rgba(255, 183, 3, 0.28);
}

.app-content { max-width: 760px; padding-top: 1rem; }

.card {
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(255,255,255,0.78);
  box-shadow: var(--sh-md);
  backdrop-filter: blur(14px);
}
.card-title { font-size: 0.95rem; color: #072044; }
.card-title::before {
  content: '';
  width: 0.42rem;
  height: 1.1rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #0077ff, #ffd60a);
  box-shadow: 0 6px 14px rgba(0,119,255,0.24);
}

.field-input, .field-select {
  min-height: 3rem;
  background: rgba(255,255,255,0.94);
  border-color: rgba(0, 93, 210, 0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 2px 8px rgba(7,24,47,0.03);
}
.field-input:hover, .field-select:hover { border-color: rgba(0,119,255,0.38); }
.field-label { color: #426383; font-weight: 600; }

.btn { min-height: 2.85rem; border-radius: 1rem; font-weight: 700; }
.btn-primary {
  background: linear-gradient(135deg, #0084ff 0%, #0054d8 72%, #003d99 100%);
  box-shadow: 0 12px 26px rgba(0, 92, 220, 0.28);
}
.btn-secondary {
  background: rgba(255,255,255,0.78);
  color: #12345c;
  border: 1px solid rgba(0, 93, 210, 0.18);
}

.stepper-row {
  min-height: 4.15rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,250,255,0.95));
  border-color: rgba(0, 93, 210, 0.13);
  box-shadow: 0 8px 18px rgba(6,45,99,0.06);
}
.stepper-row.active {
  background: linear-gradient(135deg, rgba(0,119,255,0.12), rgba(255,255,255,0.98));
  border-color: rgba(0,119,255,0.36);
  box-shadow: 0 10px 24px rgba(0,119,255,0.14);
}
.btn-stepper { border-radius: 0.95rem; }
.btn-stepper.plus { background: linear-gradient(135deg, #0084ff, #004fc7); }

.summary-stat, .kpi-card, .revenue-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(234,244,255,0.88));
  border-color: rgba(0, 93, 210, 0.13);
  box-shadow: 0 8px 20px rgba(6,45,99,0.06);
}
.summary-stat-value, .kpi-val, .revenue-val { color: #0054d8; }
.quote-preview-pre { background: #07182f; color: #dcecff; border-color: rgba(255,255,255,0.12); box-shadow: inset 0 1px 0 rgba(255,255,255,0.06); }

.quote-footer-card {
  background: linear-gradient(135deg, rgba(6,24,47,0.96), rgba(0,70,165,0.94));
  color: #fff;
  border: 1px solid rgba(255,255,255,0.20);
  box-shadow: 0 22px 56px rgba(3,30,74,0.38);
}
.quote-price { color: #fff; }
.quote-price-sub { color: rgba(255,255,255,0.72); }
.quote-footer-card .btn-secondary { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.22); }
.quote-footer-card .btn-primary { background: linear-gradient(135deg, #ffd60a, #ffb703); color: #07182f; box-shadow: 0 12px 26px rgba(255,183,3,0.25); }

.tab-bar {
  background: rgba(7,24,47,0.88);
  border-top: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 -18px 42px rgba(3,30,74,0.24);
}
.tab-btn { color: rgba(255,255,255,0.62); }
.tab-btn.active { color: #fff; }
.tab-btn.active .tab-btn-icon { background: rgba(0,119,255,0.30); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); }

.plans-modal { max-width: 960px; }
.plan-card { border-radius: 1.5rem; box-shadow: var(--sh-md); }
.plan-card-featured { box-shadow: 0 24px 60px rgba(0,92,220,0.22); }

@media (max-width: 640px) {
  .quote-rounding-presets,
  .final-quote-breakdown { grid-template-columns: 1fr 1fr; }
  .app-content { padding-left: 0.8rem; padding-right: 0.8rem; }
  .field-grid-2, .field-grid-3 { grid-template-columns: 1fr; }
}

/* WQP FINAL COSMETIC HARDEN PASS — premium product UI, no maths/logic touched */
.app-content > .card,
#tab-quote > .card,
#tab-jobs > .card,
#tab-settings > .card {
  border-radius: 1.35rem;
  border: 1px solid rgba(221,236,255,0.90);
  background: rgba(255,255,255,0.94);
  box-shadow: 0 14px 38px rgba(6,45,99,0.08);
}

.card-title {
  letter-spacing: -0.01em;
}

.field-input:focus,
.field-select:focus {
  border-color: rgba(0,119,255,0.72);
  box-shadow: 0 0 0 4px rgba(0,119,255,0.12), inset 0 1px 0 rgba(255,255,255,0.85);
}

/* ---------- V70 TRIAL ACTIVATION STATUS ---------- */
.plan-trial-status {
  min-height: 1.15rem;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  line-height: 1.35;
  font-weight: 700;
  text-align: center;
  color: #64748b;
}
.plan-trial-status.info { color: #2563eb; }
.plan-trial-status.success { color: #059669; }
.plan-trial-status.error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.9rem;
  padding: 0.65rem 0.75rem;
}
#plan-pro-action-btn[disabled] {
  opacity: 0.72;
  cursor: wait;
  filter: grayscale(0.1);
}

/* ============================================================
   V76 SAFE PREMIUM CONSOLIDATION
   Authoritative visual layer only. Keeps existing DOM, ids, and handlers.
   ============================================================ */
:root {
  --c-bg: #f7fbff;
  --c-bg-2: #eef6ff;
  --c-surface: #ffffff;
  --c-surface-soft: #f9fbfe;
  --c-border: #d8e4f2;
  --c-border-lt: #eaf1f8;
  --c-text: #102033;
  --c-text-2: #344960;
  --c-text-3: #63758a;
  --c-text-4: #8da0b4;
  --c-primary: #0077ff;
  --c-primary-d: #005bd1;
  --c-primary-l: #eaf4ff;
  --c-primary-b: #b9dcff;
  --c-green: #098b63;
  --c-green-l: #ecfdf6;
  --c-amber: #b77900;
  --c-amber-l: #fff7df;
  --c-red: #c93030;
  --c-red-l: #fff0f0;
  --r-sm: 0.45rem;
  --r-md: 0.7rem;
  --r-lg: 0.95rem;
  --r-xl: 1.15rem;
  --sh-xs: 0 1px 2px rgba(16, 32, 51, 0.04);
  --sh-sm: 0 4px 14px rgba(16, 32, 51, 0.06);
  --sh-md: 0 10px 28px rgba(16, 32, 51, 0.08);
  --sh-lg: 0 16px 42px rgba(16, 32, 51, 0.12);
  --sh-xl: 0 24px 64px rgba(16, 32, 51, 0.18);
  --sh-pri: 0 10px 22px rgba(0, 119, 255, 0.22);
}

html { scroll-behavior: auto; }

body {
  background: linear-gradient(180deg, var(--c-bg) 0%, var(--c-bg-2) 46%, var(--c-bg) 100%);
  color: var(--c-text);
  font-weight: 400;
  letter-spacing: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-header,
.tab-bar,
.quote-footer-card {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.app-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--c-border-lt);
  box-shadow: 0 10px 28px rgba(16, 32, 51, 0.06);
}

.app-title {
  color: var(--c-text);
  text-shadow: none;
  font-weight: 700;
}

.app-logo {
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: var(--sh-xs);
}

.app-header .badge-free {
  background: var(--c-surface-soft);
  color: var(--c-text-3);
  border: 1px solid var(--c-border);
  box-shadow: none;
}

.app-header .badge-pro {
  background: var(--c-primary);
  color: #fff;
  border: 1px solid var(--c-primary);
  box-shadow: var(--sh-pri);
}

.app-content {
  max-width: 760px;
  padding-top: 0.9rem;
}

.card,
.dashboard-section,
.dashboard-panel,
.job-card,
.rebook-card,
.modal,
.sub-status-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border-lt);
  box-shadow: var(--sh-sm);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.card,
.modal,
.job-card {
  border-radius: var(--r-xl);
}

.card-title,
.modal-header,
.team-name,
.plan-tier,
.dashboard-section-title,
.dashboard-panel-head h3,
.job-card-name,
.rebook-card-name {
  font-weight: 700;
  letter-spacing: 0;
}

.modal-header { font-size: 1.24rem; }
.card-title { font-size: 0.98rem; color: var(--c-text); }
.card-title::before { background: var(--c-primary); box-shadow: none; }

.field-label,
.summary-stat-label,
.kpi-label,
.revenue-label,
.job-detail-label,
.rebook-date-label,
.rate-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--c-text-3);
  letter-spacing: 0.045em;
}

.field-input,
.field-select,
.rate-card-input {
  min-height: 3.05rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  font-weight: 500;
  box-shadow: none;
}

.field-input:hover,
.field-select:hover,
.rate-card-input:hover {
  border-color: #bdd1e6;
}

.field-input:focus,
.field-select:focus,
.rate-card-input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 4px rgba(0, 119, 255, 0.12);
}

.btn {
  min-height: 2.9rem;
  border-radius: var(--r-md);
  font-weight: 700;
  box-shadow: none;
}

.btn-primary {
  background: var(--c-primary);
  color: #fff;
  box-shadow: var(--sh-pri);
}

.btn-primary:hover { background: var(--c-primary-d); box-shadow: var(--sh-pri); }

.btn-secondary {
  background: var(--c-surface);
  color: var(--c-text-2);
  border: 1px solid var(--c-border);
}

.btn-secondary:hover { background: var(--c-surface-soft); border-color: #bdd1e6; }

.btn-success {
  background: var(--c-green);
  box-shadow: 0 8px 18px rgba(9, 139, 99, 0.18);
}

.btn-sm {
  min-height: 2.65rem;
  padding: 0.62rem 0.9rem;
  font-size: 0.84rem;
}

.btn:disabled,
button:disabled,
[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  filter: saturate(0.75);
  transform: none;
}

.stepper-row {
  min-height: 4.4rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border-lt);
  box-shadow: var(--sh-xs);
}

.stepper-row.active {
  background: var(--c-primary-l);
  border-color: var(--c-primary-b);
  box-shadow: 0 8px 20px rgba(0, 119, 255, 0.10);
}

.btn-stepper {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--r-md);
  font-weight: 800;
}

.btn-stepper.plus {
  background: var(--c-primary);
  box-shadow: var(--sh-pri);
}

.btn-stepper.minus:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.summary-stat,
.kpi-card,
.revenue-card,
.rebook-stat,
.rate-card,
.settings-lock {
  background: var(--c-surface-soft);
  border: 1px solid var(--c-border-lt);
  box-shadow: none;
}

.summary-stat-value,
.kpi-val,
.revenue-val {
  color: var(--c-text);
  font-weight: 800;
}

.quote-preview-pre {
  background: var(--c-surface-soft);
  color: var(--c-text-2);
  border: 1px solid var(--c-border-lt);
  box-shadow: none;
}

.quote-preview-heading,
.quote-preview-value,
.quote-preview-total {
  font-weight: 700;
}

.quote-footer {
  bottom: calc(4.15rem + env(safe-area-inset-bottom));
}

.quote-footer-card {
  background: rgba(255, 255, 255, 0.94);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: 1rem;
  box-shadow: var(--sh-lg);
}

.quote-price {
  color: var(--c-text);
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0;
}

.quote-price-sub { color: var(--c-text-3); }
.quote-footer-card .btn-secondary { background: var(--c-surface-soft); color: var(--c-text-2); border-color: var(--c-border); }
.quote-footer-card .btn-primary { background: var(--c-primary); color: #fff; box-shadow: var(--sh-pri); }

.tab-bar {
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--c-border-lt);
  box-shadow: 0 -10px 28px rgba(16, 32, 51, 0.08);
}

.tab-btn { color: var(--c-text-4); min-height: 3.35rem; }
.tab-btn.active { color: var(--c-primary); }
.tab-btn.active .tab-btn-icon { background: var(--c-primary-l); box-shadow: none; }
.tab-btn-label { font-size: 0.72rem; font-weight: 600; }

#toast-container {
  top: auto;
  bottom: calc(5.25rem + env(safe-area-inset-bottom));
  width: min(92vw, 420px);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  padding: 0.8rem 0.95rem;
  border-radius: var(--r-lg);
  color: var(--c-text);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--c-border);
  box-shadow: var(--sh-lg);
  font-size: 0.9rem;
  font-weight: 600;
}

.toast-status {
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.34rem;
  border-radius: 999px;
  background: var(--c-primary);
  flex: 0 0 auto;
}

.toast.success .toast-status { background: var(--c-green); }
.toast.error .toast-status { background: var(--c-red); }
.toast.warning .toast-status { background: var(--c-amber); }
.toast.success,
.toast.error,
.toast.warning { background: rgba(255, 255, 255, 0.96); color: var(--c-text); }

.onboarding-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.35rem;
  padding-right: 2.6rem;
}

.onboarding-logo {
  width: 3rem;
  height: 3rem;
  border-radius: 0.9rem;
  border: 1px solid var(--c-border-lt);
  box-shadow: var(--sh-sm);
  object-fit: contain;
  background: #fff;
}

.onboarding-step {
  margin-bottom: 1rem;
  padding: 0.95rem;
  border: 1px solid var(--c-border-lt);
  border-radius: var(--r-lg);
  background: var(--c-surface-soft);
}

.onboarding-step-number {
  width: 1.65rem;
  height: 1.65rem;
  background: var(--c-primary);
  font-weight: 700;
  box-shadow: none;
}

.onboarding-helper {
  margin: -0.2rem 0 0.55rem;
  color: var(--c-text-3);
  font-size: 0.82rem;
  line-height: 1.4;
}

.plans-modal { max-width: 920px; }
.plans-hero { margin-bottom: 1.15rem; }
.plans-kicker { color: var(--c-primary); font-weight: 700; }
.plans-grid {
  grid-template-columns: 0.9fr 1.2fr 0.95fr;
  align-items: stretch;
}
.plan-card {
  border-radius: var(--r-xl);
  border: 1px solid var(--c-border-lt);
  box-shadow: var(--sh-sm);
  background: var(--c-surface);
}
.plan-card-featured {
  border: 2px solid var(--c-primary);
  box-shadow: 0 18px 46px rgba(0, 119, 255, 0.16);
  transform: translateY(-0.25rem);
}
.plan-badge { background: var(--c-primary); font-weight: 700; }
.plan-price { font-weight: 800; letter-spacing: 0; }
.plan-price-sub { min-height: 0; color: var(--c-text-3); }
.plan-feature-item { color: var(--c-text-2); line-height: 1.35; }
.plans-launch-note {
  background: var(--c-surface-soft);
  border: 1px solid var(--c-border-lt);
  color: var(--c-text-2);
  font-weight: 600;
}
.plans-table-wrap { border-color: var(--c-border-lt); }
.plans-table th { background: var(--c-surface-soft); }

.job-card-header { min-height: 4.2rem; }
.job-card-body { background: var(--c-surface-soft); }
.job-card-name { font-size: 0.98rem; }
.job-card-meta { color: var(--c-text-3); font-size: 0.78rem; }
.pay-badge,
.rebook-badge,
.role-badge,
.sub-plan-badge,
.paywall-chip {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.025em;
}
.job-overflow-btn {
  background: var(--c-surface-soft);
  border: 1px solid var(--c-border-lt);
}
.rebook-card-actions .btn,
.job-actions .btn,
.job-completed-actions .btn { min-height: 2.75rem; }

.dashboard-hero {
  background: linear-gradient(135deg, #0b4fb3 0%, var(--c-primary) 100%);
  box-shadow: 0 18px 42px rgba(0, 119, 255, 0.18);
}
.dashboard-status-count { font-weight: 800; }

@media (max-width: 700px) {
  .plans-grid { grid-template-columns: 1fr; }
  .plan-card-featured { transform: none; }
  .plans-table-wrap { display: none; }
}

@media (max-width: 520px) {
  .app-content {
    padding-left: calc(0.75rem + env(safe-area-inset-left));
    padding-right: calc(0.75rem + env(safe-area-inset-right));
    padding-bottom: calc(9.5rem + env(safe-area-inset-bottom));
  }
  .card { padding: 1rem; margin-bottom: 0.85rem; }
  .modal-overlay { align-items: flex-end; padding: 0.75rem; }
  .modal {
    max-height: min(88vh, 760px);
    padding: 1.15rem;
    border-radius: 1.1rem;
  }
  .btn-sm {
    min-height: 2.75rem;
    padding: 0.66rem 0.82rem;
    font-size: 0.86rem;
  }
  .quote-footer-card {
    padding: 0.68rem 0.75rem;
    gap: 0.7rem;
  }
  .quote-price { font-size: 1.45rem; }
  .quote-footer-actions {
    gap: 0.45rem;
    flex-wrap: nowrap;
  }
  .quote-footer-actions .btn { min-width: 4.8rem; }
  .field-grid-2,
  .field-grid-3 { grid-template-columns: 1fr; }
  .summary-stats,
  .kpi-grid,
  .revenue-grid,
  .rebook-stats { grid-template-columns: 1fr 1fr; }
  .rebook-card-dates { grid-template-columns: 1fr; }
}

/* Fixed/sticky mobile surfaces must remain clear of device cut-outs and the
   virtual keyboard. The quote content reserve includes both fixed bars. */
.header {
  padding-top: env(safe-area-inset-top);
  padding-left: calc(var(--sp-lg) + env(safe-area-inset-left));
  padding-right: calc(var(--sp-lg) + env(safe-area-inset-right));
}
.tab-bar {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}
.quote-footer-inner {
  padding-left: calc(var(--sp-md) + env(safe-area-inset-left));
  padding-right: calc(var(--sp-md) + env(safe-area-inset-right));
}
.app-content {
  padding-bottom: calc(10rem + env(safe-area-inset-bottom));
}
.modal-overlay {
  padding-top: calc(var(--sp-lg) + env(safe-area-inset-top));
  padding-right: calc(var(--sp-lg) + env(safe-area-inset-right));
  padding-bottom: calc(var(--sp-lg) + env(safe-area-inset-bottom));
  padding-left: calc(var(--sp-lg) + env(safe-area-inset-left));
}
.modal {
  max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - (2 * var(--sp-lg)));
  overscroll-behavior: contain;
  scroll-padding-bottom: calc(5rem + env(safe-area-inset-bottom));
}

@media (max-width: 520px) {
  .modal-overlay {
    padding-top: calc(0.75rem + env(safe-area-inset-top));
    padding-right: calc(0.75rem + env(safe-area-inset-right));
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    padding-left: calc(0.75rem + env(safe-area-inset-left));
  }
  .modal {
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 1.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   WQP PREMIUM PRODUCT SYSTEM — visual layer only
   Preserves the existing DOM ids, event handlers, and workflows.
   ============================================================ */
:root {
  /* Product colour tokens — premium teal / slate SaaS */
  --primary: #0f766e;
  --primary-hover: #0d9488;
  --primary-soft: #ecfdf5;
  --secondary: #0b1220;
  --accent: #0f766e;
  --success: #047857;
  --warning: #92400e;
  --danger: #b91c1c;
  --surface: #f5f7fa;
  --surface-raised: #ffffff;
  --surface-dark: #0b1220;
  --surface-dark-raised: #132033;
  --border: #e2e8f0;
  --text-primary: #0b1220;
  --text-secondary: #475569;
  --muted: #64748b;

  /* Compatibility aliases used throughout the existing interface */
  --c-bg: var(--surface);
  --c-bg-2: #eef2f6;
  --c-surface: var(--surface-raised);
  --c-surface-soft: #f8fafc;
  --c-border: var(--border);
  --c-border-lt: #eef2f6;
  --c-text: var(--text-primary);
  --c-text-2: var(--text-secondary);
  --c-text-3: var(--muted);
  --c-text-4: #94a3b8;
  --c-primary: var(--primary);
  --c-primary-d: #115e59;
  --c-primary-l: var(--primary-soft);
  --c-primary-b: #ccfbf1;
  --c-green: var(--success);
  --c-green-l: #ecfdf5;
  --c-amber: var(--warning);
  --c-amber-l: #fffbeb;
  --c-red: var(--danger);
  --c-red-l: #fef2f2;

  /* Product geometry */
  --r-sm: 0.5rem;
  --r-md: 0.75rem;
  --r-lg: 1rem;
  --r-xl: 1.25rem;
  --sh-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --sh-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --sh-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --sh-lg: 0 16px 40px rgba(15, 23, 42, 0.10);
  --sh-xl: 0 24px 60px rgba(15, 23, 42, 0.12);
  --sh-pri: 0 10px 22px rgba(15, 118, 110, 0.22);
  --tr: 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
}

body {
  background:
    linear-gradient(180deg, rgba(236, 253, 245, 0.55), transparent 18rem),
    var(--surface);
  color: var(--text-primary);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 16px;
}

::selection {
  background: rgba(8, 124, 240, 0.2);
  color: var(--text-primary);
}

/* ---------- Branded shell and navigation ---------- */
.app-header {
  background:
    radial-gradient(circle at 78% -140%, rgba(19, 184, 166, 0.34), transparent 19rem),
    linear-gradient(120deg, #061321 0%, #0a1c30 58%, #0c2741 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 14px 34px rgba(7, 21, 37, 0.22);
}

.app-header-inner {
  max-width: 900px;
  min-height: 4.55rem;
  padding: 0.65rem 0;
}

.app-title {
  color: #fff;
  gap: 0.8rem;
}

.app-logo {
  width: 2.7rem;
  height: 2.7rem;
  max-width: 2.7rem;
  max-height: 2.7rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.85rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.app-brand-copy {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.app-brand-copy > span {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.018em;
}

.app-brand-copy small {
  color: rgba(223, 238, 251, 0.68);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.app-header .badge-free,
.app-header .badge-pro {
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.68rem;
  border-radius: var(--r-full);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.065em;
}

.app-header .badge-free {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(236, 246, 255, 0.82);
  border-color: rgba(255, 255, 255, 0.16);
}

.app-header .badge-pro {
  background: linear-gradient(135deg, #2bd3bd, #13a996);
  color: #041c20;
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 8px 20px rgba(19, 184, 166, 0.2);
}

.app-content {
  max-width: 900px;
  padding-top: 1.35rem;
}

.tab-bar {
  background: rgba(7, 21, 37, 0.97);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 -16px 42px rgba(7, 21, 37, 0.22);
}

.tab-bar-inner { max-width: 900px; }

.tab-btn {
  color: rgba(210, 224, 239, 0.58);
  min-height: 4.15rem;
  position: relative;
}

.tab-btn::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0.2rem;
  width: 1.6rem;
  height: 2px;
  border-radius: 99px;
  background: transparent;
  transform: translateX(-50%);
  transition: background var(--tr), width var(--tr);
}

.tab-btn:hover { color: rgba(255, 255, 255, 0.9); }
.tab-btn.active { color: #fff; }
.tab-btn.active::after { width: 2.3rem; background: #29c7b3; }
.tab-btn.active .tab-btn-icon {
  background: rgba(19, 184, 166, 0.15);
  color: #5ce0d0;
  box-shadow: inset 0 0 0 1px rgba(92, 224, 208, 0.1);
}

.tab-btn-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.015em;
}

/* ---------- Page hierarchy ---------- */
.page-intro {
  margin: 0 0 1.15rem;
  padding: 0.3rem 0.15rem 0.1rem;
}

.page-eyebrow,
.section-kicker {
  color: var(--primary-hover);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  line-height: 1.35;
}

.page-intro h1 {
  margin-top: 0.28rem;
  color: var(--text-primary);
  font-size: clamp(1.52rem, 3.2vw, 2rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.page-intro p,
.section-copy {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.page-intro p { margin-top: 0.42rem; }
.section-copy { margin: -0.45rem 0 1.05rem; }

.quote-flow {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 0 1rem;
  padding: 0.62rem;
  border: 1px solid #20374e;
  border-radius: var(--r-lg);
  background: var(--surface-dark-raised);
  box-shadow: var(--sh-sm);
}

.quote-flow li {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  padding: 0.45rem 0.35rem;
  color: rgba(227, 239, 249, 0.72);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.quote-flow li:last-child { border-right: 0; }

.quote-flow span {
  width: 1.45rem;
  height: 1.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.08);
  color: #65dccc;
  font-size: 0.58rem;
  font-weight: 800;
}

/* ---------- Cards, forms, and controls ---------- */
.card,
.dashboard-section,
.dashboard-panel,
.job-card,
.rebook-card,
.sub-status-card {
  background: var(--surface-raised);
  border: 1px solid var(--c-border-lt);
  box-shadow: var(--sh-sm);
}

.card {
  padding: 1.35rem;
  margin-bottom: 1rem;
  border-radius: var(--r-xl);
}

.quote-stage-card {
  position: relative;
  overflow: hidden;
  border-top: 3px solid #17334f;
}

.quote-stage-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 7rem;
  height: 7rem;
  background: radial-gradient(circle at top right, rgba(8, 124, 240, 0.08), transparent 68%);
  pointer-events: none;
}

.quote-review-card { border-top-color: var(--accent); }

.quote-upsell-card {
  background: #eef4fa;
  border-color: #d5e1ec;
  box-shadow: none;
}

.card-title {
  color: var(--text-primary);
  font-size: 1.04rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.card-title::before { display: none; }
.section-kicker + .card-title { margin-top: 0.24rem; }

.field-stack { gap: 0.95rem; }

.field-label,
.summary-stat-label,
.kpi-label,
.revenue-label,
.job-detail-label,
.rebook-date-label,
.rate-card-label {
  color: #5c7086;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.055em;
}

.field-input,
.field-select,
.rate-card-input {
  min-height: 3.25rem;
  border: 1px solid #ccd8e4;
  border-radius: 0.8rem;
  background: #fbfcfe;
  color: var(--text-primary);
  font-size: 0.94rem;
  font-weight: 600;
  box-shadow: inset 0 1px 1px rgba(7, 21, 37, 0.025);
  transition: border-color var(--tr), box-shadow var(--tr), background var(--tr);
}

.field-input::placeholder { color: #8999aa; font-weight: 500; }
.field-input:hover,
.field-select:hover,
.rate-card-input:hover { border-color: #aebfd0; background: #fff; }

.field-input:focus,
.field-select:focus,
.rate-card-input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(8, 124, 240, 0.13);
  outline: none;
}

.helper-copy { color: #718398; font-size: 0.82rem; line-height: 1.45; }

.toggle-field {
  min-height: 3rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 700;
}

.toggle-slider { background: #bdc9d5; }
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }

/* ---------- Tactile action system ---------- */
.btn {
  min-height: 3.15rem;
  padding: 0.78rem 1.08rem;
  border-radius: 0.8rem;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: -0.005em;
  box-shadow: none;
  transition: transform 0.12s ease, box-shadow var(--tr), background var(--tr), border-color var(--tr);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.985); }
.btn:focus-visible,
.tab-btn:focus-visible,
.dashboard-status-card:focus-visible,
.customer-card-main:focus-visible,
.quote-customer-option:focus-visible {
  outline: 3px solid rgba(8, 124, 240, 0.3);
  outline-offset: 2px;
}

.btn-primary {
  border: 1px solid #1188fa;
  background: linear-gradient(180deg, #188df8 0%, var(--primary) 52%, #0870d8 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(8, 124, 240, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  border-color: #0872db;
  background: linear-gradient(180deg, #0e7fe9, var(--primary-hover));
  box-shadow: 0 13px 28px rgba(8, 100, 199, 0.29);
}

.btn-secondary {
  border: 1px solid #cbd7e2;
  background: linear-gradient(180deg, #fff, #f2f5f8);
  color: #253c54;
  box-shadow: 0 4px 10px rgba(7, 21, 37, 0.055);
}

.btn-secondary:hover { border-color: #aebfd0; background: #fff; }
.btn-success {
  background: linear-gradient(180deg, #1ca67f, var(--success));
  box-shadow: 0 10px 22px rgba(20, 138, 104, 0.23);
}

.btn-danger-soft {
  border-color: #e7caca;
  background: #fff3f3;
  color: #aa3535;
}

.btn-sm {
  min-height: 2.9rem;
  padding: 0.68rem 0.95rem;
  font-size: 0.84rem;
}

/* ---------- Quote workspace ---------- */
.stepper-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; }

.stepper-row {
  min-height: 4.8rem;
  margin: 0;
  padding: 0.75rem;
  border: 1px solid #dce5ee;
  border-radius: 0.95rem;
  background: #f8fafc;
  box-shadow: none;
}

.stepper-row:hover { border-color: #c1d1e0; background: #fff; }

.stepper-row.active {
  border-color: #8fc5f9;
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary), 0 8px 18px rgba(8, 124, 240, 0.09);
}

.stepper-label { color: #30475f; font-size: 0.84rem; font-weight: 700; }
.stepper-row.active .stepper-label,
.stepper-row.active .stepper-val { color: #074f99; }

.btn-stepper {
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  border-radius: 0.82rem;
  border-color: #cbd7e2;
  background: #fff;
  color: var(--secondary);
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(7, 21, 37, 0.06);
}

.btn-stepper.plus {
  background: linear-gradient(180deg, #188df8, #0872da);
  box-shadow: 0 8px 17px rgba(8, 124, 240, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-stepper:active { transform: scale(0.94); }

.summary-stats { grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: 0.65rem; }

.summary-stat {
  padding: 0.85rem;
  border-color: #dce5ee;
  background: #f2f6fa;
  box-shadow: none;
}

.summary-stat-value { color: var(--secondary); font-size: 1.16rem; }
.summary-stat:nth-child(2) { background: #e9f4ff; border-color: #c8e2fc; }
.summary-stat:nth-child(2) .summary-stat-value { color: #075fb7; }

.quote-preview-pre {
  padding: 1.1rem;
  border-color: #d5e0ea;
  background: #f7f9fb;
  font-size: 0.88rem;
}

.quote-preview-total {
  margin-top: 0.5rem;
  padding-top: 0.85rem;
  border-top: 2px solid var(--accent);
  color: var(--secondary);
  font-size: 1.12rem;
}

.quote-footer { bottom: calc(4.15rem + env(safe-area-inset-bottom)); }
.quote-footer-inner { max-width: 900px; }

.quote-footer-card {
  min-height: 5.3rem;
  padding: 0.75rem 0.85rem 0.75rem 1.15rem;
  border: 1px solid #17324d;
  border-radius: 1.1rem;
  background:
    radial-gradient(circle at 22% 160%, rgba(19, 184, 166, 0.2), transparent 17rem),
    rgba(7, 21, 37, 0.97);
  color: #fff;
  box-shadow: 0 24px 58px rgba(7, 21, 37, 0.34);
}

.quote-price {
  color: #fff;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.quote-price-sub { color: rgba(220, 234, 247, 0.7); font-size: 0.72rem; }
.quote-footer-actions { flex-wrap: nowrap; gap: 0.55rem; }
.quote-footer-actions .btn { min-width: 7rem; }

.quote-footer-card .btn-secondary {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  box-shadow: none;
}

.quote-footer-card .btn-primary {
  background: linear-gradient(180deg, #30d0bd, #12ad9b);
  border-color: #3ed6c4;
  color: #032a2e;
  box-shadow: 0 10px 24px rgba(19, 184, 166, 0.23), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

/* ---------- Customers, jobs, dashboard, and commerce ---------- */
.customers-toolbar-card {
  border-top: 3px solid var(--primary);
  background: linear-gradient(145deg, #fff, #f7fbff);
}

.customer-card {
  border: 1px solid #dce5ee;
  border-left: 3px solid var(--primary);
  border-radius: 1rem;
  box-shadow: var(--sh-sm);
  transition: transform var(--tr), box-shadow var(--tr), border-color var(--tr);
}

.customer-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: #bed5eb; }
.customer-card-title { color: var(--secondary); font-size: 1.02rem; }
.customer-card-actions .btn { flex: 1; }

.quote-customer-results { border-radius: 0.95rem; box-shadow: var(--sh-lg); }
.quote-customer-option { min-height: 3.6rem; }
.quote-customer-option:hover { background: var(--primary-soft); }

.dashboard-hero {
  padding: 1.45rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.35rem;
  background:
    radial-gradient(circle at 92% -20%, rgba(19, 184, 166, 0.38), transparent 16rem),
    linear-gradient(135deg, #061321 0%, #0c2947 100%);
  box-shadow: 0 24px 54px rgba(7, 21, 37, 0.28);
}

.dashboard-eyebrow { color: #62dfd0; letter-spacing: 0.08em; }
.dashboard-hero h2 { font-size: 1.82rem; font-weight: 800; letter-spacing: -0.035em; }
.dashboard-hero p { color: rgba(227, 239, 249, 0.7); }

.dashboard-primary-action {
  min-height: 3.45rem;
  background: linear-gradient(180deg, #31d1be, #12ad9a);
  color: #03272d;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(19, 184, 166, 0.2);
}

.dashboard-icon-button { min-width: 44px; min-height: 44px; }
.dashboard-plan-badge { min-height: 2.25rem; }

.dashboard-section,
.dashboard-panel { padding: 1.15rem; border-radius: 1.15rem; }
.dashboard-section-title,
.dashboard-panel-head h3 { color: var(--secondary); font-size: 1rem; }

.dashboard-status-card {
  min-height: 6.6rem;
  border-radius: 0.95rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
  transition: transform var(--tr), box-shadow var(--tr), border-color var(--tr);
}

.dashboard-status-card:hover { transform: translateY(-2px); box-shadow: var(--sh-sm); }
.tone-blue { --dash-bg: #e9f4ff; --dash-border: #bddcfa; --dash-fg: #075fb7; }
.tone-teal { --dash-bg: #e5f8f5; --dash-border: #b6e9e1; --dash-fg: #087c70; }
.tone-amber { --dash-bg: #fff3de; --dash-border: #f1d39d; --dash-fg: #9c640b; }
.tone-green { --dash-bg: #e7f5ef; --dash-border: #bfdfd2; --dash-fg: #126d55; }

.dashboard-job-row,
.dashboard-invoice-row {
  min-height: 4.6rem;
  border-color: #dce5ee;
  background: #f8fafc;
}

.dashboard-job-row:hover { border-color: #bed5eb; background: #fff; }
.dashboard-mini-action { min-height: 2.4rem; padding: 0.48rem 0.72rem; background: var(--primary); }

.job-card { border-color: #dce5ee; border-left: 3px solid #1c466b; }
.job-card-header { min-height: 4.65rem; }
.job-card-header:hover { background: #f5f8fb; }
.job-card-body { background: #f5f8fb; }
.job-actions .btn,
.job-completed-actions .btn,
.rebook-card-actions .btn { min-height: 3rem; }

.paywall-chip {
  background: #dff7f3;
  border-color: #aee8df;
  color: #087769;
}

.modal-overlay { background: rgba(3, 13, 24, 0.7); }
.modal { border: 1px solid rgba(255, 255, 255, 0.72); box-shadow: var(--sh-xl); }
.modal-header { color: var(--secondary); font-size: 1.32rem; }
.modal-close { border-color: #d5e0ea; background: #f1f5f8; }

.plan-card { border-color: #d8e3ed; box-shadow: var(--sh-sm); }
.plan-card-featured {
  border-color: var(--primary);
  box-shadow: 0 24px 56px rgba(8, 124, 240, 0.18);
}
.plan-badge { background: var(--secondary); }

.auth-tabs { background: #edf2f6; padding: 0.28rem; }
.auth-tab { min-height: 2.85rem; }
.auth-tab.active { color: var(--secondary); box-shadow: 0 5px 14px rgba(7, 21, 37, 0.09); }

.toast { border-left: 4px solid var(--primary); }
.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.error { border-left-color: var(--danger); }

/* ---------- Desktop app navigation ---------- */
@media (min-width: 760px) {
  .tab-bar {
    top: 4.55rem;
    bottom: auto;
    border-top: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 30px rgba(7, 21, 37, 0.14);
  }

  .tab-bar-inner { height: 3.65rem; }

  .tab-btn {
    min-height: 3.65rem;
    flex-direction: row;
    gap: 0.5rem;
    font-size: 0.8rem;
  }

  .tab-btn-icon { margin-bottom: 0; }
  .tab-btn::after { bottom: 0; }
  .app-content { padding-top: 5rem; padding-bottom: 8.5rem; }
  .quote-footer { bottom: 1.1rem; }
  .dashboard-split { grid-template-columns: 1fr 1fr; }
}

/* ---------- Mobile-first action clarity ---------- */
@media (max-width: 759px) {
  .app-header-inner { min-height: 4.2rem; }
  .app-content { padding-top: 1.05rem; }
  .app-brand-copy small { display: none; }
  .quote-flow {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .quote-flow li {
    min-width: 0;
    flex-direction: column;
    gap: 0.28rem;
    padding-inline: 0.12rem;
    font-size: 0.61rem;
    white-space: normal;
    text-align: center;
    line-height: 1.15;
  }
  .tab-btn { min-height: 4.35rem; }
}

@media (max-width: 620px) {
  .stepper-grid { grid-template-columns: 1fr; }
  .summary-stats { grid-template-columns: 1fr 1fr; }
  .quote-footer-card { min-height: 5rem; }
  .quote-footer-actions .btn { min-width: 6.3rem; }
}

@media (max-width: 430px) {
  .app-header { padding-left: 0.85rem; padding-right: 0.85rem; }
  .app-logo {
    width: 2.4rem;
    height: 2.4rem;
    max-width: 2.4rem;
    max-height: 2.4rem;
  }
  .app-brand-copy > span { font-size: 0.95rem; }
  .app-header .badge-free,
  .app-header .badge-pro { font-size: 0.62rem; padding-inline: 0.55rem; }
  .page-intro { margin-bottom: 0.9rem; }
  .page-intro h1 { font-size: 1.48rem; }
  .page-intro p { font-size: 0.86rem; }
  .card { padding: 1rem; }
  .section-copy { font-size: 0.84rem; }
  .stepper-row { min-height: 4.65rem; }
  .quote-price { font-size: 1.55rem; }
  .quote-footer-actions { gap: 0.4rem; }
  .quote-footer-actions .btn {
    min-width: 5.4rem;
    min-height: 3rem;
    padding-inline: 0.68rem;
    font-size: 0.8rem;
  }
  .tab-btn-label { font-size: 0.69rem; }
}

@media (max-width: 375px) {
  .app-content {
    padding-left: calc(0.62rem + env(safe-area-inset-left));
    padding-right: calc(0.62rem + env(safe-area-inset-right));
  }
  .app-title { gap: 0.55rem; }
  .app-brand-copy > span { font-size: 0.88rem; }
  .quote-footer-inner { padding-inline: 0.45rem; }
  .quote-footer-card { padding-left: 0.8rem; padding-right: 0.58rem; }
  .quote-price { font-size: 1.4rem; }
  .quote-price-sub { max-width: 7.4rem; font-size: 0.65rem; }
  .quote-footer-actions .btn { min-width: 4.9rem; padding-inline: 0.52rem; }
}

.quote-editor-context {
  margin-top: 0.8rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.65rem;
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.78rem;
  font-weight: 700;
}

.saved-quotes-list { display: grid; gap: 0.7rem; margin-top: 0.9rem; }
.saved-quote-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem;
  border: 1px solid var(--c-border, #e5e7eb);
  border-radius: 0.8rem;
  background: var(--c-surface-soft, #f8fafc);
}
.saved-quote-title { font-weight: 800; color: var(--c-text, #111827); }
.saved-quote-meta { margin-top: 0.2rem; color: var(--c-text-3, #6b7280); font-size: 0.75rem; }
.saved-quote-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.4rem; }
.saved-quote-empty { color: var(--c-text-3, #6b7280); font-size: 0.85rem; padding: 0.7rem 0; }

@media (max-width: 600px) {
  .saved-quote-row { grid-template-columns: 1fr; }
  .saved-quote-actions { justify-content: flex-start; }
}

/* ============================================================
   PHASE 2 — QUOTE WORKFLOW OPTIMISATION
   Targeted interaction improvements on the premium product system.
   ============================================================ */
.quote-flow li { padding: 0; }

.quote-flow li > button {
  width: 100%;
  min-height: 2.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  padding: 0.4rem 0.3rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.quote-flow li.complete span {
  background: var(--accent);
  color: #032a2e;
}

.quote-flow li.current > button {
  color: #fff;
  background: rgba(8, 124, 240, 0.13);
}

.quote-flow li.current span {
  background: var(--primary);
  color: #fff;
}

.customer-picker-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.42rem;
}

.customer-picker-heading .field-label { margin-bottom: 0; }
.customer-quick-add { min-height: 2.65rem; }

.quote-recent-customers {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.65rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.quote-recent-customers::-webkit-scrollbar { display: none; }

.quote-recent-customers > span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.quote-recent-customers button {
  min-height: 2.5rem;
  flex: 0 0 auto;
  padding: 0.52rem 0.72rem;
  border: 1px solid #cbd9e6;
  border-radius: var(--r-full);
  background: #f3f7fa;
  color: #29425c;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.quote-recent-customers button:hover { border-color: #8dbfec; background: var(--primary-soft); }

.selected-quote-customer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.12rem 0.75rem;
  margin-top: 0.7rem;
  padding: 0.72rem 0.82rem;
  border: 1px solid #b6e3db;
  border-radius: 0.85rem;
  background: #e9f8f5;
}

.selected-quote-customer strong { color: #075d54; font-size: 0.88rem; }
.selected-quote-customer span { color: #4a746e; font-size: 0.75rem; }
.selected-quote-customer button {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 2.45rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid #9cd8cf;
  border-radius: 0.68rem;
  background: #fff;
  color: #086f64;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.stepper-service {
  min-width: 0;
  display: grid;
  gap: 0.35rem;
}

.stepper-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-left: 1.65rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.stepper-meta strong {
  color: var(--secondary);
  font-size: 0.73rem;
}

.stepper-meta span::after {
  content: '·';
  margin-left: 0.45rem;
  color: #a6b3bf;
}

input.stepper-val {
  width: 3.15rem;
  height: 46px;
  padding: 0.2rem;
  border: 1px solid #cbd7e2;
  border-radius: 0.72rem;
  background: #fff;
  color: var(--secondary);
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
  box-shadow: inset 0 1px 2px rgba(7, 21, 37, 0.04);
}

input.stepper-val:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(8, 124, 240, 0.14);
}

.quote-footer-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.quote-footer-total { min-width: 0; }

.quote-total-toggle {
  min-height: 1.7rem;
  margin-top: 0.12rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6cddcf;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
}

.quote-footer-details {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.25rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.quote-footer-details span { display: grid; gap: 0.08rem; }
.quote-footer-details small { color: rgba(220, 234, 247, 0.62); font-size: 0.62rem; }
.quote-footer-details strong { color: #fff; font-size: 0.82rem; }

.quote-action-status {
  grid-column: 1 / -1;
  padding-top: 0.45rem;
  color: rgba(222, 236, 248, 0.78);
  font-size: 0.72rem;
  font-weight: 700;
}

.quote-action-status.success { color: #6ee7d4; }
.quote-action-status.error { color: #ffc1c1; }

@media (max-width: 759px) {
  .quote-flow li > button {
    min-height: 3.25rem;
    flex-direction: column;
    gap: 0.28rem;
    font-size: 0.61rem;
    line-height: 1.15;
  }
}

@media (max-width: 620px) {
  .stepper-row { align-items: center; }
  .stepper-service { max-width: calc(100% - 9.2rem); }
  .stepper-controls { gap: 0.28rem; }
  .quote-footer-card { align-items: center; }
}

@media (max-width: 390px) {
  .customer-picker-heading { align-items: flex-end; }
  .customer-quick-add {
    min-height: 2.5rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.75rem;
  }
  .stepper-row { padding-inline: 0.62rem; }
  .stepper-service { max-width: calc(100% - 8.7rem); }
  .stepper-label { font-size: 0.8rem; }
  .stepper-meta { padding-left: 0; gap: 0.28rem; }
  .stepper-meta span::after { margin-left: 0.28rem; }
  .btn-stepper { width: 42px; height: 42px; min-width: 42px; min-height: 42px; }
  input.stepper-val { width: 2.75rem; height: 42px; }
  .quote-footer-details { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Phase 1 commercial readiness: clickable plan badge + legal footer + locks */
button.badge-free,
button.badge-pro {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}
.app-legal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  justify-content: center;
  padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
  margin-bottom: 4.25rem;
  font-size: 0.78rem;
  color: var(--c-text-3);
}
.app-legal-footer a {
  color: var(--c-text-2);
  text-decoration: none;
  font-weight: 600;
}
.feature-locked {
  position: relative;
}
.feature-locked::after {
  content: "Pro";
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--c-primary-l);
  color: var(--c-primary-d);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
}

/* ============================================================
   Premium SaaS polish layer (v90) — visual only
   Softens navy/blue harden pass into restrained teal SaaS UI.
   ============================================================ */

.app-header {
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom: 1px solid var(--c-border) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: none !important;
}

.app-title,
.app-brand-copy,
.app-brand-copy strong,
.app-brand-copy span {
  color: var(--text-primary) !important;
}

.app-brand-copy strong,
.page-intro h1,
.card-title,
.modal-header {
  font-family: "Sora", "DM Sans", system-ui, sans-serif;
  letter-spacing: -0.025em;
}

.badge-free,
.badge-pro,
button.badge-free,
button.badge-pro {
  border-radius: 0.45rem !important;
  letter-spacing: 0.04em;
}

.badge-pro,
button.badge-pro {
  background: var(--primary-soft) !important;
  color: #115e59 !important;
  border: 1px solid #99f6e4 !important;
}

.badge-free,
button.badge-free {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}

.quote-flow {
  border: 1px solid var(--c-border) !important;
  background: var(--surface-raised) !important;
  box-shadow: var(--sh-xs) !important;
}

.quote-flow li {
  color: var(--text-secondary) !important;
  border-right-color: var(--c-border) !important;
}

.quote-flow span {
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
}

.quote-flow li > button {
  color: inherit;
}

.quote-stage-card {
  border-top: 3px solid var(--primary) !important;
}

.quote-stage-card::after {
  background: radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 68%) !important;
}

.quote-upsell-card {
  background: var(--primary-soft) !important;
  border-color: #99f6e4 !important;
}

.field-input:focus,
.field-select:focus,
.rate-card-input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.22) !important;
}

.btn:focus-visible,
.tab-btn:focus-visible,
.dashboard-status-card:focus-visible,
.customer-card-main:focus-visible,
.quote-customer-option:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.28) !important;
}

.btn-primary {
  border: 1px solid #0f766e !important;
  background: var(--primary) !important;
  color: #fff !important;
  box-shadow: var(--sh-pri) !important;
}

.btn-primary:hover {
  border-color: #0d9488 !important;
  background: var(--primary-hover) !important;
  box-shadow: 0 12px 26px rgba(15, 118, 110, 0.28) !important;
}

.btn-secondary {
  border: 1px solid var(--c-border) !important;
  background: #fff !important;
  color: var(--text-primary) !important;
  box-shadow: var(--sh-xs) !important;
}

.btn-stepper.plus {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
  box-shadow: var(--sh-pri) !important;
}

.stepper-row.active {
  border-color: #5eead4 !important;
  background: var(--primary-soft) !important;
  box-shadow: inset 3px 0 0 var(--primary), 0 6px 16px rgba(15, 118, 110, 0.08) !important;
}

.stepper-row.active .stepper-label,
.stepper-row.active .stepper-val {
  color: #115e59 !important;
}

.summary-stat:nth-child(2) {
  background: var(--primary-soft) !important;
  border-color: #99f6e4 !important;
}

.summary-stat:nth-child(2) .summary-stat-value {
  color: #115e59 !important;
}

.tab-bar {
  background: rgba(255, 255, 255, 0.96) !important;
  border-top: 1px solid var(--c-border) !important;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.05) !important;
}

.tab-btn.active {
  color: var(--primary) !important;
}

.tab-btn.active .tab-icon,
.tab-btn.active svg {
  color: var(--primary) !important;
}

.quote-footer-card {
  background: var(--surface-dark) !important;
  border: 1px solid #1e293b !important;
  box-shadow: var(--sh-lg) !important;
}

.quote-total-toggle { color: #5eead4 !important; }
.quote-action-status.success { color: #5eead4 !important; }

.auth-card,
.plans-modal .modal,
#auth-modal .modal,
#onboarding-modal .modal {
  border: 1px solid var(--c-border);
  box-shadow: var(--sh-lg);
}

.plan-card.featured,
.pricing-card.featured,
.plan.featured {
  border-color: rgba(15, 118, 110, 0.45) !important;
  box-shadow: var(--sh-md) !important;
}

.empty-state,
.empty-state-card {
  border: 1px dashed var(--c-border);
  background: #f8fafc;
  border-radius: var(--r-lg);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-secondary);
}

.feature-locked::after {
  background: var(--primary-soft) !important;
  color: #115e59 !important;
  border-radius: 0.4rem !important;
}

.app-legal-footer {
  color: var(--muted);
}

.app-legal-footer a:hover {
  color: var(--primary);
}

/* Soften residual blue accents from earlier layers */
.dashboard-kpi,
.kpi-card,
.stat-pill {
  border-radius: var(--r-lg);
}

@media (max-width: 759px) {
  .btn,
  .field-input,
  .field-select,
  .btn-stepper {
    min-height: 44px;
  }
  .stepper-row {
    min-height: 4.5rem;
  }
}

/* Shell contrast fix after lightening header/tab bar */
::selection {
  background: rgba(15, 118, 110, 0.22);
  color: var(--text-primary);
}

.app-title,
.app-brand-copy > span {
  color: var(--text-primary) !important;
}

.app-brand-copy small {
  color: var(--muted) !important;
}

.app-logo {
  border: 1px solid var(--c-border) !important;
  box-shadow: var(--sh-xs) !important;
}

.app-header .badge-free {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}

.app-header .badge-pro {
  background: var(--primary-soft) !important;
  color: #115e59 !important;
  border: 1px solid #99f6e4 !important;
  box-shadow: none !important;
}

.tab-btn {
  color: var(--muted) !important;
}

.tab-btn:hover {
  color: var(--text-primary) !important;
}

.tab-btn.active {
  color: var(--primary) !important;
}

.tab-btn.active::after {
  background: var(--primary) !important;
}

.tab-btn.active .tab-btn-icon {
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
  box-shadow: none !important;
}

.quote-footer {
  /* Keep sticky total readable on mobile */
  z-index: 30;
}
