/* ============================================================
   Job Pricer — warm, approachable, rounded design system
   ============================================================ */

:root {
  /* Type */
  --font-ui: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-num: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, "SFMono-Regular", monospace;
  --font-display: "Fraunces", "Hanken Grotesk", Georgia, serif;
  --fs-base: 16px;

  /* Warm neutrals */
  --bg: oklch(0.975 0.007 75);
  --bg-sunken: oklch(0.955 0.008 75);
  --surface: oklch(0.995 0.003 85);
  --surface-2: oklch(0.985 0.005 80);
  --border: oklch(0.905 0.009 75);
  --border-strong: oklch(0.845 0.012 75);

  --ink: oklch(0.26 0.012 60);
  --ink-soft: oklch(0.46 0.012 62);
  --ink-faint: oklch(0.62 0.011 65);

  /* Accent — teal */
  --accent-h: 180;
  --accent: oklch(0.52 0.085 var(--accent-h));
  --accent-strong: oklch(0.44 0.09 var(--accent-h));
  --accent-soft: oklch(0.95 0.03 var(--accent-h));
  --accent-soft-2: oklch(0.9 0.045 var(--accent-h));
  --accent-ink: oklch(0.38 0.09 var(--accent-h));

  /* Semantic */
  --good: oklch(0.58 0.1 155);
  --good-soft: oklch(0.95 0.04 155);
  --warn: oklch(0.7 0.13 75);
  --warn-soft: oklch(0.95 0.05 80);
  --danger: oklch(0.58 0.16 28);
  --danger-soft: oklch(0.95 0.04 30);
  --info: oklch(0.6 0.1 250);
  --info-soft: oklch(0.95 0.035 250);

  /* Radius — rounded & friendly */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Shadow — soft, warm, layered */
  --sh-sm: 0 1px 1px oklch(0.45 0.02 70 / 0.04), 0 1px 2px oklch(0.45 0.02 70 / 0.05);
  --sh-md: 0 1px 2px oklch(0.45 0.02 70 / 0.04), 0 4px 14px oklch(0.45 0.02 70 / 0.07);
  --sh-lg: 0 2px 6px oklch(0.4 0.02 70 / 0.05), 0 14px 44px oklch(0.4 0.03 70 / 0.12);
  --sh-ring: inset 0 1px 0 oklch(1 0 0 / 0.14);

  /* Density */
  --pad: 22px;
  --gap: 18px;
}

[data-density="compact"] { --pad: 16px; --gap: 13px; }
[data-density="comfy"]   { --pad: 28px; --gap: 24px; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(1100px 560px at 100% -8%, var(--accent-soft) 0%, transparent 55%),
    radial-gradient(900px 500px at -10% 110%, var(--accent-soft) 0%, transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "calt";
  line-height: 1.45;
}

#root { height: 100%; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

::selection { background: var(--accent-soft-2); }

/* Scrollbars */
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb {
  background: oklch(0.85 0.01 75);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: oklch(0.78 0.012 75); background-clip: padding-box; border: 3px solid transparent; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- Layout shell ---------- */
.app {
  display: grid;
  grid-template-columns: 256px 1fr;
  height: 100%;
  overflow: hidden;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 14px;
  overflow-y: auto;
}

.main {
  overflow-y: auto;
  position: relative;
  height: 100%;
}

.main-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 30px 38px 80px;
}

/* Mobile bottom nav hidden on desktop */
.mobile-nav { display: none; }
.mobile-top { display: none; }
.menu-btn { display: none; }
.sidebar-scrim { display: none; }

/* ---------- Brand ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 18px;
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(150deg, var(--accent) 10%, var(--accent-strong) 100%);
  display: grid; place-items: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--sh-sm), var(--sh-ring);
}
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.brand-sub { font-size: 11px; color: var(--ink-faint); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }

/* ---------- Nav items ---------- */
.nav-group-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-faint);
  padding: 16px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  border-radius: var(--r-md);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 14.5px;
  border: none; background: none;
  width: 100%; text-align: left;
  transition: background 0.13s, color 0.13s;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.nav-item.active svg { color: var(--accent); }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 14.5px;
  padding: 11px 18px;
  transition: transform 0.08s, background 0.13s, box-shadow 0.13s, border-color 0.13s;
  white-space: nowrap;
  line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: linear-gradient(180deg, var(--accent), var(--accent-strong)); color: #fff; box-shadow: var(--sh-sm), var(--sh-ring); }
.btn-primary:hover { background: linear-gradient(180deg, var(--accent-strong), var(--accent-strong)); box-shadow: var(--sh-md), var(--sh-ring); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn-soft:hover { background: var(--accent-soft-2); }
.btn-quiet { background: transparent; color: var(--ink-soft); }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn-lg { padding: 15px 24px; font-size: 16px; border-radius: var(--r-lg); }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: var(--r-sm); }
.btn-block { width: 100%; }

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  transition: box-shadow 0.16s ease, transform 0.14s ease, border-color 0.14s ease;
}
.card-pad { padding: var(--pad); }

/* ---------- Badge / pill ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; flex-shrink: 0; }

/* ---------- Inputs ---------- */
.field-label {
  display: block;
  font-size: 13px; font-weight: 700; color: var(--ink-soft);
  margin-bottom: 7px;
}
.input, .select, .textarea {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 13px 15px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  transition: border-color 0.13s, box-shadow 0.13s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.input::placeholder { color: var(--ink-faint); font-weight: 500; }
.input-affix {
  display: flex; align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color 0.13s, box-shadow 0.13s;
}
.input-affix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input-affix .affix {
  padding: 0 13px; color: var(--ink-faint); font-weight: 700; font-size: 15px;
  background: var(--surface-2); align-self: stretch; display: flex; align-items: center;
}
.input-affix input {
  border: none; background: none; padding: 13px 14px; font-size: 16px; font-weight: 700;
  width: 100%; color: var(--ink); outline: none;
}
.input-affix input::-webkit-outer-spin-button,
.input-affix input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }

/* ---------- Misc ---------- */
.page-title { font-family: var(--font-display); font-optical-sizing: auto; font-size: 34px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.08; margin: 0; }
.page-sub { color: var(--ink-soft); font-weight: 500; margin: 6px 0 0; font-size: 15.5px; }

.divider { height: 1px; background: var(--border); border: none; margin: 0; }

.skeleton-img {
  background-color: var(--surface-2);
  background-image: repeating-linear-gradient(
    -45deg, transparent, transparent 9px,
    oklch(0.9 0.01 75 / 0.5) 9px, oklch(0.9 0.01 75 / 0.5) 10px);
  display: grid; place-items: center;
  color: var(--ink-faint); font-family: var(--font-mono); font-size: 12px;
  border-radius: var(--r-md);
}

.tabs { display: flex; gap: 4px; background: var(--bg-sunken); padding: 5px; border-radius: var(--r-pill); }
.tab {
  border: none; background: none; padding: 9px 16px; border-radius: var(--r-pill);
  font-weight: 700; font-size: 13.5px; color: var(--ink-soft); white-space: nowrap;
  transition: background 0.13s, color 0.13s;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-sm); }
.tab .count { color: var(--ink-faint); font-weight: 700; margin-left: 5px; }
.tab.active .count { color: var(--accent); }

/* ---------- Project rows ---------- */
.proj-row {
  display: grid;
  grid-template-columns: minmax(200px, 2.2fr) minmax(140px, 1.6fr) 130px 110px 110px 36px;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
}
.proj-head {
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-faint); padding-top: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.proj-item { border-bottom: 1px solid var(--border); transition: background 0.12s; cursor: pointer; }
.proj-item:last-child { border-bottom: none; }
.proj-item:hover { background: var(--surface-2); }

.proj-card { text-align: left; cursor: pointer; padding: var(--pad); transition: transform 0.1s, box-shadow 0.13s; }
.proj-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }

@media (max-width: 760px) {
  .proj-head { display: none; }
  .proj-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "cust status" "type quote";
    gap: 8px 12px;
    row-gap: 10px;
  }
  .proj-row > :nth-child(1) { grid-area: cust; }
  .proj-row > :nth-child(2) { grid-area: type; }
  .proj-row > :nth-child(3) { grid-area: status; justify-self: end; }
  .proj-row > :nth-child(4) { grid-area: quote; justify-self: end; text-align: right; }
  .proj-row > :nth-child(5), .proj-row > :nth-child(6) { display: none; }
}

.fade-in { animation: fadeIn 0.42s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================
   Builder
   ============================================================ */
.builder { display: flex; flex-direction: column; min-height: calc(100% + 0px); }
.builder-top {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.builder-steps { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; flex: 1; }
.bstep {
  display: flex; align-items: center; gap: 8px; border: none; background: none;
  padding: 8px 12px; border-radius: var(--r-pill); color: var(--ink-faint);
  font-weight: 700; font-size: 13.5px; white-space: nowrap; flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.bstep:hover { background: var(--surface-2); color: var(--ink-soft); }
.bstep.active { background: var(--accent-soft); color: var(--accent-ink); }
.bstep.done { color: var(--ink-soft); }
.bstep-num {
  width: 23px; height: 23px; border-radius: 999px; display: grid; place-items: center;
  background: var(--bg-sunken); font-size: 12.5px; font-weight: 800; flex-shrink: 0;
}
.bstep.active .bstep-num { background: var(--accent); color: #fff; }
.bstep.done .bstep-num { background: var(--good); color: #fff; }

.builder-body { display: grid; gap: 26px; align-items: start; }
.cost-rail { position: relative; }

.builder-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--border);
}

.step-wrap { max-width: 920px; }

/* select tiles */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.select-tile {
  display: flex; flex-direction: column; gap: 5px; text-align: left;
  padding: 18px; border-radius: var(--r-lg); border: 1.5px solid var(--border);
  background: var(--surface); transition: border-color 0.12s, box-shadow 0.12s, transform 0.08s;
}
.select-tile:hover { border-color: var(--border-strong); box-shadow: var(--sh-md); transform: translateY(-2px); }
.select-tile.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--sh-sm); }
.shape-tile { align-items: flex-start; }
.tile-ico {
  width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft);
  color: var(--accent); display: grid; place-items: center; margin-bottom: 6px;
  box-shadow: var(--sh-ring);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* measure */
.measure-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px; align-items: start; }
.model-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; padding: 2px 4px; }
.lock-btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-soft); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.lock-btn:hover { border-color: var(--border-strong); }
.lock-btn.on { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.derived-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }

.lengths-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.length-field { display: flex; flex-direction: column; gap: 7px; }
.length-lab { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.len-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.auto-tag { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; }

.lengths-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.lengths-title { font-size: 13px; font-weight: 800; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.lengths-note { font-size: 12.5px; color: var(--ink-soft); line-height: 1.45; margin: 0 0 18px; }
.lengths-sub { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 11px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.lengths-sub-tag { font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--ink-faint); }
.lengths-derived { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 16px; }
.lengths-derived-cell { display: flex; flex-direction: column; gap: 3px; }
.lengths-derived-lab { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.lengths-derived-val { font-weight: 800; font-size: 19px; }
.lengths-derived-val i { font-style: normal; font-size: 12px; color: var(--ink-faint); margin-left: 2px; }

/* ---------- Bill of quantities & resources ---------- */
.boq-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.boq-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.boq-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 15px 17px; display: flex; flex-direction: column; gap: 3px; }
.boq-stat.accent { background: var(--accent-soft); border-color: transparent; }
.boq-stat-lab { font-size: 11.5px; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.boq-stat.accent .boq-stat-lab { color: var(--accent-ink); }
.boq-stat-val { font-size: 25px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.boq-stat.accent .boq-stat-val { color: var(--accent-ink); }
.boq-stat-sub { font-size: 12px; color: var(--ink-faint); font-weight: 600; }

.boq-doc { margin-top: 26px; }
.boq-sec-title { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 800; margin-bottom: 12px; }
.boq-sec-title svg { color: var(--accent); }

.boq-table { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.boq-head-row, .boq-row { display: grid; align-items: center; gap: 12px; padding: 11px 18px; grid-template-columns: 1fr 52px 62px 58px 76px 98px; }
.boq-head-row { background: var(--bg-sunken); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-faint); }
.boq-row { border-top: 1px solid var(--border); font-size: 14px; }
.boq-head-row.res, .boq-row.res { grid-template-columns: 1.4fr 1.2fr 88px 56px 98px; }
.boq-head-row.plant, .boq-row.plant { grid-template-columns: 1fr 116px 88px 98px; }
.bc-num { text-align: right; white-space: nowrap; }
.bc-unit { text-align: center; color: var(--ink-soft); }
.bc-desc { font-weight: 600; min-width: 0; }
.bc-role { color: var(--ink-soft); font-size: 13px; min-width: 0; }
.boq-row .strong { font-weight: 800; }
.muted { color: var(--ink-faint); }

.boq-group { display: flex; justify-content: space-between; align-items: center; padding: 8px 18px; background: var(--accent-soft); border-top: 1px solid var(--border); font-size: 12px; font-weight: 800; color: var(--accent-ink); text-transform: uppercase; letter-spacing: 0.03em; }
.boq-group .num { font-size: 13px; letter-spacing: 0; }
.boq-total-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 18px; border-top: 2px solid var(--border-strong); font-weight: 800; font-size: 14.5px; }
.boq-total-row .num { font-size: 16px; }
.boq-empty { padding: 22px 18px; color: var(--ink-faint); font-size: 13.5px; text-align: center; }

.boq-res-head { display: flex; justify-content: space-between; align-items: center; margin: 0 0 10px; font-size: 14.5px; font-weight: 800; }
.boq-res-tag { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--ink-faint); }
.boq-ini { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-size: 11px; font-weight: 800; flex-shrink: 0; }

.boq-tasks { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 13px; }
.boq-tasks-lab { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.boq-task-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px; }
.boq-task-chip svg { color: var(--good); }

.boq-summary { margin-top: 26px; padding: 20px 22px; }
.boq-sum-rows { display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.boq-sum-row { display: flex; justify-content: space-between; font-size: 14.5px; font-weight: 600; color: var(--ink-soft); }
.boq-sum-row .num { font-weight: 700; color: var(--ink); }
.boq-grand { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; gap: 14px; }
.boq-grand-lab { font-size: 17px; font-weight: 800; }
.boq-grand-sub { font-size: 12.5px; color: var(--ink-faint); font-weight: 600; margin-top: 2px; }
.boq-grand-val { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }

@media (max-width: 760px) {
  .boq-stats { grid-template-columns: 1fr 1fr; }
}

.trend-chip { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 800; padding: 1px 6px 1px 5px; border-radius: 999px; line-height: 1.55; white-space: nowrap; }

.stepper {
  display: flex; align-items: center; justify-content: space-between;
  border: 1.5px solid var(--border); border-radius: var(--r-md); overflow: hidden;
  background: var(--surface);
}
.stepper button {
  width: 48px; height: 48px; border: none; background: var(--surface-2);
  font-size: 24px; font-weight: 600; color: var(--ink-soft); line-height: 1;
}
.stepper button:hover { background: var(--accent-soft); color: var(--accent); }
.stepper span { font-weight: 800; font-size: 18px; }

/* materials */
.ai-banner, .ai-hint {
  display: flex; align-items: center; gap: 11px;
  background: var(--accent-soft); color: var(--accent-ink);
  padding: 13px 16px; border-radius: var(--r-md); font-size: 13.5px; font-weight: 600;
  margin-bottom: 20px;
}
.ai-hint { font-size: 12.5px; line-height: 1.4; align-items: flex-start; }
.ai-banner svg, .ai-hint svg { flex-shrink: 0; color: var(--accent); }
.ai-banner strong { font-weight: 800; }

.mat-row { display: grid; grid-template-columns: minmax(160px, 1.6fr) auto auto; gap: 16px; align-items: center; padding: 14px 18px; }
.mat-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.eye-toggle { border: none; background: var(--surface-2); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.eye-toggle:hover { background: var(--accent-soft); }
.mat-fields { display: flex; gap: 8px; }
.mini-field { display: flex; flex-direction: column; gap: 3px; }
.mini-field > span:first-child { font-size: 10.5px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.03em; padding-left: 2px; }
.mini-input { width: 60px; border: 1.5px solid var(--border); border-radius: 9px; padding: 8px 9px; font-size: 14px; font-weight: 700; text-align: right; background: var(--surface); color: var(--ink); }
.mini-input:focus { outline: none; border-color: var(--accent); }
.mat-totals { text-align: right; min-width: 80px; }

/* labour */
.seg { display: inline-flex; background: var(--bg-sunken); padding: 4px; border-radius: var(--r-md); gap: 3px; flex-wrap: wrap; }
.seg-btn { border: none; background: none; padding: 9px 15px; border-radius: 10px; font-weight: 700; font-size: 13.5px; color: var(--ink-soft); }
.seg-btn.on { background: var(--surface); color: var(--accent-ink); box-shadow: var(--sh-sm); }
.oh-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; gap: 16px; }
.oh-row .input-affix input { padding: 10px 12px; }
.crew-chip { display: flex; align-items: center; gap: 9px; padding: 8px 13px 8px 8px; border-radius: var(--r-pill); border: 1.5px solid var(--border); background: var(--surface); color: var(--ink); }
.crew-chip:hover { border-color: var(--border-strong); }
.crew-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.crew-ini { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex-shrink: 0; }
.crew-chip.on .crew-ini { background: var(--accent); color: #fff; }

/* ---- conditional flow ---- */
.area-bar { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 22px; }
.area-chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--r-pill); border: 1.5px solid var(--border); background: var(--surface); color: var(--ink-soft); font-weight: 700; font-size: 13.5px; }
.area-chip:hover { border-color: var(--border-strong); }
.area-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.area-chip.add { color: var(--ink-faint); border-style: dashed; }
.area-x { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 999px; background: oklch(0.5 0.02 70 / 0.12); margin-left: 2px; }
.area-x:hover { background: var(--danger); color: #fff; }

.mini-tag { font-size: 11px; font-weight: 700; color: var(--ink-faint); background: var(--surface-2); padding: 2px 8px; border-radius: 999px; align-self: flex-start; margin-top: 4px; }
.mini-tag.warn { color: var(--warn); background: var(--warn-soft); }

.reveal { animation: revealIn 0.3s ease; }
@keyframes revealIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.detail-stack { display: flex; flex-direction: column; gap: 14px; }
.field-note { color: var(--ink-faint); font-weight: 500; }
.q-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.qcard { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; text-align: left; transition: border-color 0.15s, box-shadow 0.15s; }

/* toggles — full-width settings-style rows */
.toggle-stack { display: flex; flex-direction: column; gap: 10px; }
.qtoggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; padding: 14px 18px; }
.qtoggle:hover { border-color: var(--border-strong); }
.qtoggle.on { border-color: var(--accent); background: var(--accent-soft); }
.qt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.qt-label { font-weight: 700; font-size: 14.5px; color: var(--ink); }
.qt-hint { font-size: 12.5px; font-weight: 500; color: var(--ink-faint); line-height: 1.35; }
.qtoggle.on .qt-hint { color: var(--accent-ink); opacity: 0.8; }
.qt-switch { position: relative; width: 46px; height: 27px; border-radius: 999px; background: var(--border-strong); flex-shrink: 0; transition: background 0.15s; }
.qtoggle.on .qt-switch { background: var(--accent); }
.qt-knob { position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 999px; background: #fff; box-shadow: var(--sh-sm); transition: left 0.18s cubic-bezier(.4,0,.2,1); }
.qtoggle.on .qt-knob { left: 22px; }

.opt-row { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-pill { display: inline-flex; align-items: center; gap: 5px; padding: 9px 14px; border-radius: var(--r-pill); border: 1.5px solid var(--border); background: var(--surface); color: var(--ink-soft); font-weight: 700; font-size: 13.5px; }
.opt-pill:hover { border-color: var(--border-strong); color: var(--ink); }
.opt-pill.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.inline-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.feat-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.feat-chip { display: inline-flex; align-items: center; gap: 9px; padding: 11px 16px; border-radius: var(--r-pill); border: 1.5px solid var(--border); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 14.5px; }
.feat-chip:hover { border-color: var(--border-strong); }
.feat-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.feat-check { width: 21px; height: 21px; border-radius: 7px; border: 2px solid var(--border-strong); display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.feat-check.on { background: var(--accent); border-color: var(--accent); }
.feat-risk { font-size: 11px; font-weight: 800; color: var(--warn); background: var(--warn-soft); padding: 1px 6px; border-radius: 999px; }

.detail-card { background: var(--surface); border: 1.5px solid var(--accent-soft-2); border-radius: var(--r-lg); padding: 18px; margin-bottom: 14px; box-shadow: var(--sh-sm); }
.detail-head { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15.5px; margin-bottom: 14px; }
.detail-ico { width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }

.risk-note { display: flex; align-items: flex-start; gap: 11px; background: var(--warn-soft); color: var(--ink-soft); padding: 14px 16px; border-radius: var(--r-md); font-size: 13.5px; font-weight: 600; line-height: 1.45; }
.risk-note svg { color: var(--warn); flex-shrink: 0; margin-top: 1px; }
.risk-bar { height: 10px; border-radius: 999px; background: oklch(0.5 0.02 70 / 0.12); overflow: hidden; }
.risk-bar > div { height: 100%; border-radius: 999px; transition: width 0.3s; }
.risk-tag { font-size: 12px; font-weight: 600; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px; }
.risk-tag b { color: var(--warn); }

@media (max-width: 680px) {
  .q-cards { grid-template-columns: 1fr; }
  .inline-nums { grid-template-columns: 1fr; }
}

/* profit */
.profit-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.margin-chip { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-radius: var(--r-lg); }
.margin-chip.good { background: var(--good-soft); color: var(--good); }
.margin-chip.bad { background: var(--danger-soft); color: var(--danger); }
.risk.bad { background: var(--danger-soft); }
.risk.ok { background: var(--accent-soft); }
.risk svg { color: currentColor; }

/* quote */
.quote-wrap { max-width: 860px; }
.quote-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.quote-paper { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-md); overflow: hidden; }
.quote-body { padding: 38px; }
.quote-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 22px; border-bottom: 2px solid var(--ink); margin-bottom: 24px; flex-wrap: wrap; gap: 14px; }
.quote-logo { width: 52px; height: 52px; border-radius: 14px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 19px; }
.quote-to { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 28px; }
.ql { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.tier-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tier-card { position: relative; text-align: left; padding: 16px; border-radius: var(--r-md); border: 1.5px solid var(--border); background: var(--surface); transition: border-color 0.12s, box-shadow 0.12s; }
.tier-card:hover { border-color: var(--border-strong); }
.tier-card.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tier-card.rec { padding-top: 26px; }
.rec-flag { position: absolute; top: 0; left: 0; right: 0; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px; text-align: center; border-radius: var(--r-md) var(--r-md) 0 0; }
.ai-tag { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--accent); padding: 3px 8px; border-radius: 999px; font-size: 10.5px; }
.scope-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.5; }
.scope-list li::marker { color: var(--accent); }
.quote-total { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 28px; padding: 20px 22px; background: var(--bg-sunken); border-radius: var(--r-lg); flex-wrap: wrap; }
.quote-foot { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--ink-faint); line-height: 1.6; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .builder-body { grid-template-columns: 1fr !important; }
  .cost-rail { order: -1; }
  .cost-rail .card { position: static !important; }
  .measure-grid { grid-template-columns: 1fr; }
  .profit-cols { grid-template-columns: 1fr !important; }
}
@media (max-width: 680px) {
  .form-grid { grid-template-columns: 1fr; }
  .mat-row { grid-template-columns: 1fr; gap: 12px; }
  .mat-fields { flex-wrap: wrap; }
  .quote-body { padding: 22px; }
  .tier-grid { grid-template-columns: 1fr; }
  .quote-to { grid-template-columns: 1fr; }
  .derived-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Materials library + receipt scan
   ============================================================ */
.cat-row { display: grid; grid-template-columns: 34px minmax(160px, 1fr) 130px 110px 92px; gap: 16px; align-items: center; padding: 13px 18px; }
.cat-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; box-shadow: var(--sh-ring); }
.cat-perm2 { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 5px; font-size: 12px; font-weight: 700; color: var(--accent-ink); }
.cat-perm2 svg { color: var(--accent); }
.cat-perm2 .num { font-weight: 800; }
.cat-perm2-sep { color: var(--ink-faint); margin: 0 1px; }

.trim-auto { display: flex; align-items: center; gap: 9px; padding: 12px 15px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent-ink); font-size: 13.5px; font-weight: 600; }
.trim-auto svg { color: var(--accent); flex-shrink: 0; }
.trim-auto .num { font-weight: 800; }

/* covering family cards */
.fam-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.fam-block { display: flex; flex-direction: column; gap: 10px; }
.fam-card { display: flex; flex-direction: column; align-items: flex-start; gap: 11px; padding: 18px; border: 1.5px solid var(--border); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; text-align: left; transition: border-color 0.14s, background 0.14s, box-shadow 0.14s, transform 0.1s; }
.fam-card:hover { border-color: var(--border-strong); box-shadow: var(--sh-md); transform: translateY(-2px); }
.fam-card.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft), var(--sh-sm); }
.fam-ico { width: 48px; height: 48px; border-radius: 14px; background: var(--bg-sunken); color: var(--accent); display: grid; place-items: center; box-shadow: var(--sh-ring); }
.fam-card.on .fam-ico { background: var(--surface); }
.fam-name { font-weight: 800; font-size: 16.5px; }
.fam-select { width: 100%; }
@media (max-width: 680px) {
  .fam-grid { grid-template-columns: 1fr; }
}
.fav-btn { border: none; background: none; padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.fav-btn:hover { background: var(--surface-2); }
.cat-field { display: flex; flex-direction: column; gap: 4px; }
.cat-field > span:first-child { font-size: 10.5px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.03em; }
.cat-input { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: 10px; padding: 0 10px; background: var(--surface); }
.cat-input:focus-within { border-color: var(--accent); }
.cat-input i { font-style: normal; color: var(--ink-faint); font-weight: 700; font-size: 13px; }
.cat-input input { border: none; background: none; padding: 8px 4px; width: 100%; font-size: 14.5px; font-weight: 700; color: var(--ink); outline: none; min-width: 0; }
.cat-input input::-webkit-outer-spin-button, .cat-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cat-sell { text-align: right; min-width: 70px; }

/* modal */
.modal-scrim { position: fixed; inset: 0; background: oklch(0.3 0.02 70 / 0.45); backdrop-filter: blur(3px); z-index: 80; display: grid; place-items: center; padding: 20px; animation: fadeIn 0.2s ease; }
.modal { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-lg); width: 100%; max-width: 640px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-body { display: flex; gap: 20px; padding: 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); background: var(--surface-2); }

.receipt-paper { flex-shrink: 0; width: 180px; }
.receipt-img { position: relative; height: 240px; border-radius: var(--r-md); overflow: hidden; display: grid; place-items: center; color: var(--ink-faint);
  background-color: var(--surface-2);
  background-image: repeating-linear-gradient(0deg, transparent, transparent 16px, oklch(0.9 0.01 75 / 0.6) 16px, oklch(0.9 0.01 75 / 0.6) 17px);
  border: 1.5px solid var(--border); }
.scan-line { position: absolute; left: 0; right: 0; height: 40px; background: linear-gradient(var(--accent-soft), transparent); border-top: 2px solid var(--accent); animation: scanmove 1.9s ease-in-out infinite; }
@keyframes scanmove { 0% { top: -40px; } 100% { top: 240px; } }
.spinner { width: 34px; height: 34px; border-radius: 999px; border: 3.5px solid var(--accent-soft); border-top-color: var(--accent); margin: 0 auto; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.scan-line-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 13px; border-radius: var(--r-md); border: 1.5px solid var(--border); background: var(--surface); }
.scan-line-item:hover { border-color: var(--border-strong); }
.scan-line-item.on { border-color: var(--accent); background: var(--accent-soft); }
.chk { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border-strong); flex-shrink: 0; display: grid; place-items: center; color: #fff; }
.chk.on { background: var(--accent); border-color: var(--accent); }

/* team */
.team-row { display: grid; grid-template-columns: minmax(160px, 1fr) auto auto; gap: 16px; align-items: center; padding: 14px 18px; }
.team-rate .input-affix input { padding: 10px 10px; width: 100%; }

@media (max-width: 720px) {
  .cat-row { grid-template-columns: 28px 1fr; grid-template-areas: "fav main" ". fields"; row-gap: 12px; }
  .cat-row > :nth-child(1) { grid-area: fav; }
  .cat-row > :nth-child(2) { grid-area: main; }
  .cat-row > :nth-child(n+3) { grid-row: 2; }
  .cat-row > :nth-child(3), .cat-row > :nth-child(4), .cat-row > :nth-child(5) { display: inline-flex; }
  .modal-body { flex-direction: column; }
  .receipt-paper { width: 100%; }
  .receipt-img { height: 150px; }
  @keyframes scanmove { 0% { top: -40px; } 100% { top: 150px; } }
  .team-row { grid-template-columns: 1fr auto; grid-template-areas: "person rate" "jobs rate"; }
  .team-row > :nth-child(1) { grid-area: person; }
  .team-row > :nth-child(2) { grid-area: jobs; }
  .team-row > :nth-child(3) { grid-area: rate; }
}

/* ---------- Responsive (shell) ---------- */
@media (max-width: 1100px) {
  .main-inner { padding: 26px 26px 100px; }
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 270px; z-index: 60;
    transform: translateX(-105%); transition: transform 0.25s ease;
    box-shadow: var(--sh-lg);
  }
  .app[data-menu="open"] .sidebar { transform: none; }
  .app[data-menu="open"] .sidebar-scrim {
    display: block; position: fixed; inset: 0; background: oklch(0.3 0.02 70 / 0.4); z-index: 55;
  }
  .menu-btn { display: inline-grid; }
  .mobile-top { display: flex; }
  .main-inner { padding: 18px 18px 110px; }
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .mobile-nav .nav-item {
    flex-direction: column; gap: 4px; font-size: 11px; padding: 6px 4px; width: auto; flex: 1;
    border-radius: var(--r-sm);
  }
  .mobile-nav .nav-item span { font-weight: 700; }
  .page-title { font-size: 25px; }
}

/* ---- additions: persistence, shape selector, empty states ---- */
.builder-save { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.select-sm { width: auto; padding: 8px 30px 8px 12px; font-size: 13px; font-weight: 700; border-radius: var(--r-md); }
.shape-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.shape-seg { flex-wrap: wrap; }
.empty-hero { text-align: center; padding: 48px 24px; }
.empty-ico {
  display: inline-grid; place-items: center; width: 64px; height: 64px;
  border-radius: 18px; background: var(--accent-soft); color: var(--accent);
  box-shadow: var(--sh-ring);
}

/* ============================================================
   Accessibility & polish pass — applying ui-ux-pro-max rules
   (focus-states, reduced-motion, disabled affordance, touch
   targets) + frontend-design restraint: deepen the existing
   warm-teal identity, don't replace it.
   ============================================================ */

/* Visible keyboard focus on every interactive element — shown only
   for keyboard users, never removed (a11y CRITICAL). */
:where(a, button, [tabindex], summary, [role="button"]):focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
/* Inputs already show an accent ring on :focus — don't double it. */
.input:focus-visible, .select:focus-visible, .textarea:focus-visible,
.mini-input:focus-visible, .cat-input input:focus-visible { outline: none; }

/* Disabled controls read as non-interactive. */
button:disabled, .btn:disabled, button[aria-disabled="true"] { cursor: not-allowed; }

/* On-site touch comfort: the quote-visibility toggle was 36px. */
.eye-toggle { width: 40px; height: 40px; }

/* Honour prefers-reduced-motion: keep meaning, remove movement. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   "Premium trade craft" beauty pass — display serif voice,
   atmospheric empty state, orchestrated entrance.
   Identity preserved: warm teal, rounded, high-legibility.
   ============================================================ */

/* Fraunces display serif is the product's "voice": page + section
   headings, brand, and the customer quote. UI/body stays Hanken;
   figures stay Spline Mono. Force 600 for refined serif weight. */
h1, h2 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600 !important;
  letter-spacing: -0.015em;
}
.brand-name { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
.quote-logo { font-family: var(--font-display); }

/* Orchestrated page-load: hero elements rise in sequence. */
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.stat-grid > * { animation: riseIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.stat-grid > *:nth-child(1) { animation-delay: 0.04s; }
.stat-grid > *:nth-child(2) { animation-delay: 0.10s; }
.stat-grid > *:nth-child(3) { animation-delay: 0.16s; }
.stat-grid > *:nth-child(4) { animation-delay: 0.22s; }

/* Beautiful empty state — atmosphere + roofline motif, not a bare icon. */
.empty-hero {
  position: relative; overflow: hidden;
  padding: 64px 28px 60px;
  background:
    radial-gradient(620px 300px at 50% -10%, var(--accent-soft) 0%, transparent 60%),
    var(--surface);
}
.empty-hero::before {
  /* faint repeating roof chevrons across the top */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 140px; opacity: 0.5;
  background-image:
    repeating-linear-gradient(135deg, var(--accent-soft) 0 2px, transparent 2px 22px),
    repeating-linear-gradient(45deg, var(--accent-soft) 0 2px, transparent 2px 22px);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
  mask-image: linear-gradient(to bottom, #000, transparent);
  pointer-events: none;
}
.empty-hero > * { position: relative; }
.empty-ico {
  width: 76px; height: 76px; border-radius: 22px;
  background: linear-gradient(160deg, var(--accent), var(--accent-ink));
  color: #fff; box-shadow: var(--sh-md), inset 0 1px 0 rgba(255,255,255,0.25);
}
.empty-title { font-family: var(--font-display); font-weight: 600; font-size: 26px; letter-spacing: -0.015em; margin-top: 18px; }

/* ---- "Where the money goes" labelled bar + profit pots ---- */
.money-bar { display: flex; height: 48px; border-radius: var(--r-md); overflow: hidden; gap: 3px; margin-bottom: 20px; }
.money-seg {
  position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; min-width: 0;
  padding: 0 4px; color: #fff; line-height: 1.12; overflow: hidden;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.money-seg-pct { font-weight: 800; font-size: 13px; text-shadow: 0 1px 2px rgba(0,0,0,0.4); white-space: nowrap; }
.money-seg-val { font-size: 10.5px; font-weight: 700; opacity: 0.95; text-shadow: 0 1px 2px rgba(0,0,0,0.4); white-space: nowrap; }

.pot-bar { height: 30px; margin: 4px 0 0; }
.pot-retained {
  background: repeating-linear-gradient(45deg, var(--surface-2) 0 6px, var(--bg-sunken) 6px 12px);
}
.pot-retained .money-seg-pct { color: var(--ink-soft); text-shadow: none; }

.pot-row { display: flex; align-items: center; gap: 10px; }
.pot-dot { width: 11px; height: 11px; border-radius: 4px; flex-shrink: 0; }
.pot-name {
  flex: 1; min-width: 0; border: 1.5px solid transparent; background: var(--surface-2);
  border-radius: var(--r-sm); padding: 9px 12px; font-weight: 700; font-size: 14px;
  color: var(--ink); font-family: inherit;
}
.pot-name:hover { border-color: var(--border); }
.pot-name:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pot-pct { display: inline-flex; align-items: center; border: 1.5px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); flex-shrink: 0; }
.pot-pct button { width: 34px; height: 36px; border: none; background: var(--surface-2); color: var(--ink-soft); font-size: 19px; line-height: 1; }
.pot-pct button:hover { background: var(--accent-soft); color: var(--accent); }
.pot-pct span { min-width: 44px; text-align: center; font-weight: 800; font-size: 13px; }
.pot-amt { min-width: 66px; text-align: right; font-weight: 800; font-size: 14.5px; flex-shrink: 0; }
.pot-x { width: 28px; height: 28px; border: none; background: none; color: var(--ink-faint); border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.pot-x:hover { background: var(--danger-soft); color: var(--danger); }
.pot-retained-row { padding-top: 6px; }
.pot-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.pot-chip { display: inline-flex; align-items: center; gap: 5px; padding: 7px 12px; border-radius: var(--r-pill); border: 1.5px dashed var(--border-strong); background: var(--surface); color: var(--ink-soft); font-weight: 700; font-size: 13px; }
.pot-chip:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-ink); border-style: solid; }
.pot-chip:disabled { opacity: 0.4; cursor: not-allowed; }
.pot-chip-custom { border-style: solid; border-color: var(--border); }

/* ---- row actions menu (pipeline / archive / delete) ---- */
.row-menu { position: relative; display: inline-grid; place-items: center; }
.row-menu-btn { width: 34px; height: 34px; border: none; background: none; color: var(--ink-faint); border-radius: 9px; display: grid; place-items: center; }
.row-menu-btn:hover { background: var(--surface-2); color: var(--ink); }
.row-menu-pop { z-index: 200; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--sh-lg); padding: 6px; display: flex; flex-direction: column; gap: 2px; animation: revealIn 0.14s ease; }
.rm-label { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-faint); padding: 8px 10px 4px; }
.rm-item { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: none; background: none; border-radius: var(--r-sm); font-weight: 600; font-size: 13.5px; color: var(--ink); text-align: left; width: 100%; }
.rm-item:hover { background: var(--surface-2); }
.rm-item.on { color: var(--accent-ink); font-weight: 700; }
.rm-item .dot { width: 9px; height: 9px; }
.rm-item.danger { color: var(--danger); }
.rm-item.danger:hover { background: var(--danger-soft); }
.rm-sep { height: 1px; background: var(--border); margin: 5px 2px; }

/* ---- print: show only the customer quote, branded & clean ---- */
@media print {
  body { background: #fff !important; }
  body::before, body::after { display: none !important; }
  .sidebar, .mobile-nav, .mobile-top, .sidebar-scrim,
  .builder-top, .builder-foot, .quote-toolbar, .cost-rail,
  .tweaks-fab, .tweaks-panel, .row-menu, .quote-editor, .no-print { display: none !important; }
  .app, .main, .main-inner, .builder, .builder-body, .builder-main,
  .step-wrap, .quote-wrap, .quote-stage {
    display: block !important; height: auto !important; overflow: visible !important;
    max-width: none !important; margin: 0 !important; padding: 0 !important;
    grid-template-columns: 1fr !important;
  }
  .quote-paper { box-shadow: none !important; border: none !important; margin: 0 !important; max-width: none !important; }
  @page { margin: 14mm; }
}

/* ---- branded quote: hero, logo, itemised table, gallery ---- */
.quote-hero { width: 100%; max-height: 300px; overflow: hidden; }
.quote-hero img { width: 100%; height: 100%; max-height: 300px; object-fit: cover; display: block; }
.quote-logo-img { height: 52px; max-width: 200px; width: auto; object-fit: contain; border-radius: 10px; }

.quote-items { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.qi-row { display: grid; grid-template-columns: 1fr auto auto; gap: 18px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.qi-row:last-child { border-bottom: none; }
.qi-head { background: var(--bg-sunken); font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); padding-top: 10px; padding-bottom: 10px; }
.qi-row b { font-weight: 700; font-size: 14.5px; display: block; }
.qi-row small { color: var(--ink-faint); font-size: 13px; }
.qi-qty { min-width: 84px; text-align: right; color: var(--ink-soft); font-weight: 700; font-size: 14px; }
.qi-price { min-width: 92px; text-align: right; font-weight: 800; font-size: 15px; }
.qi-sub { background: var(--bg-sunken); font-weight: 800; }
.qi-sub span:first-child { color: var(--ink-soft); }

.quote-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.qg-img { aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden; background: var(--bg-sunken); }
.qg-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- quote customise editor ---- */
.quote-editor { margin-bottom: 18px; display: flex; flex-direction: column; gap: 4px; }
.qe-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qe-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); min-width: 96px; }
.qe-toggles { display: flex; gap: 22px; flex-wrap: wrap; }
.qe-toggles > button { width: auto; gap: 10px; }
.qe-sep { height: 1px; background: var(--border); margin: 14px 0; }
.qe-thumb { position: relative; width: 54px; height: 40px; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.qe-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qe-thumb button { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border: none; border-radius: 999px; background: rgba(0,0,0,0.55); color: #fff; display: grid; place-items: center; cursor: pointer; }
.qe-item { display: flex; align-items: center; gap: 8px; }
.qe-desc { flex: 1; min-width: 0; border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--r-sm); padding: 8px 11px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.qe-desc:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.qe-num { width: 58px; border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--r-sm); padding: 8px 8px; font-family: var(--font-mono); font-size: 13px; text-align: right; color: var(--ink); }
.qe-unit { width: 50px; border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--r-sm); padding: 8px; font: inherit; font-size: 12.5px; color: var(--ink-soft); }
.qe-num:focus, .qe-unit:focus { outline: none; border-color: var(--accent); }
.qe-price-in { display: inline-flex; align-items: center; gap: 2px; }
.qe-price-in i { font-style: normal; color: var(--ink-faint); font-weight: 700; }

/* ---- quote customise sidebar (docked rail on the Quote step) ---- */
/* Container query on the wrap, not the viewport, so the split respects the
   real space left by the app nav rather than the window width. */
.quote-wrap { container-type: inline-size; }
.quote-stage { display: grid; grid-template-columns: 1fr; gap: 22px; align-items: start; }
.quote-wrap[data-editing="1"] { max-width: 1220px; }
@container (min-width: 900px) {
  .quote-wrap[data-editing="1"] .quote-stage { grid-template-columns: minmax(0, 1fr) 330px; }
}

.quote-side { position: sticky; top: 12px; align-self: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-md); max-height: calc(100vh - 24px); overflow-y: auto; }
.quote-side-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.qs-close { width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink-soft); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.qs-close:hover { background: var(--surface-2); color: var(--ink); }
.qs-sec { padding: 16px; border-top: 1px solid var(--border); }
.qs-sec:first-of-type { border-top: none; }
.qs-title { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); margin-bottom: 14px; display: flex; align-items: center; gap: 7px; }
.qs-sub { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
/* Site survey (mobile-first capture) */
.survey-wrap { max-width: 640px; margin: 0 auto; padding-bottom: 90px; }
.survey-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.survey-card { margin-bottom: 16px; }
.survey-sec-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; margin-bottom: 14px; }
.survey-sec-title svg { color: var(--accent); }
.survey-hint { font-size: 12.5px; color: var(--ink-faint); margin: 12px 0 0; }
.survey-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.survey-chip { border: 1.5px solid var(--border); background: var(--surface); color: var(--ink-soft); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer; }
.survey-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.survey-photos { display: flex; flex-wrap: wrap; gap: 10px; }
.survey-thumb { position: relative; width: 84px; height: 84px; border-radius: var(--r-md); overflow: hidden; flex-shrink: 0; }
.survey-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.survey-thumb button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border: none; border-radius: 999px; background: rgba(0,0,0,0.6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.survey-add { width: 84px; height: 84px; border: 2px dashed var(--border-strong); border-radius: var(--r-md); background: var(--bg-sunken); color: var(--ink-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; font-size: 11.5px; font-weight: 700; }
.survey-add:hover { border-color: var(--accent); color: var(--accent); }
.survey-foot { position: sticky; bottom: 0; display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 24%); margin-top: 4px; }
.survey-foot .btn-lg { justify-content: center; }
.survey-build { display: flex; align-items: center; gap: 12px; }
.survey-build .btn-lg { flex: 1; }
.survey-missing { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; font-weight: 700; color: var(--warn); text-align: right; }
.survey-missing span { display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end; white-space: nowrap; }
.survey-missing.soft, .survey-missing.soft span { color: var(--ink-faint); }
@media (max-width: 520px) { .survey-build { flex-direction: column; align-items: stretch; gap: 8px; } .survey-missing { text-align: left; } .survey-missing span { justify-content: flex-start; } }
@media (max-width: 560px) { .survey-foot { padding: 12px 16px; margin: 0 -16px; } }

/* BOQ buying list by supplier */
.buy-groups { display: flex; flex-direction: column; gap: 12px; }
.buy-group { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.buy-group-head { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--bg-sunken); border-bottom: 1px solid var(--border); }
.buy-merchant { font-weight: 800; font-size: 14.5px; }
.buy-meta { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.buy-group-head .btn { margin-left: auto; }
.buy-items { display: flex; flex-direction: column; }
.buy-item { display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.buy-item:last-child { border-bottom: none; }
.buy-item-qty { color: var(--ink-soft); font-weight: 700; }
.buy-item-amt { font-weight: 800; }
.buy-note { font-size: 12.5px; color: var(--ink-faint); margin: 10px 2px 0; }

/* Reports: lost-reasons breakdown */
.lost-bar-row { display: grid; grid-template-columns: 160px 1fr 32px; gap: 12px; align-items: center; padding: 6px 0; }
.lost-bar-label { font-size: 13.5px; font-weight: 700; }
.lost-bar-track { height: 10px; border-radius: 999px; background: var(--bg-sunken); overflow: hidden; }
.lost-bar-track > span { display: block; height: 100%; border-radius: 999px; background: var(--danger); }
.lost-bar-count { text-align: right; font-weight: 800; font-size: 14px; }
@media (max-width: 480px) { .lost-bar-row { grid-template-columns: 110px 1fr 28px; } }

/* Lost-reason capture + follow-ups */
.lost-reason { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: var(--r-md); background: var(--surface); font-weight: 700; font-size: 13.5px; color: var(--ink); cursor: pointer; text-align: left; }
.lost-reason.on { border-color: var(--accent); background: var(--accent-soft); }
.lost-radio { width: 18px; height: 18px; border-radius: 999px; border: 2px solid var(--border-strong); display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.lost-reason.on .lost-radio { border-color: var(--accent); background: var(--accent); }
.followup-card { margin-bottom: 22px; border: 1px solid var(--warn-soft); }
.followup-ico, .today-ico { width: 30px; height: 30px; border-radius: 9px; background: var(--warn-soft); color: var(--warn); display: grid; place-items: center; flex-shrink: 0; }
.today-card { margin-bottom: 22px; border: 1px solid var(--warn-soft); }
.today-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.today-group-lbl { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-faint); margin-bottom: 8px; }
.today-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.today-action { display: flex; align-items: center; gap: 10px; }
.today-action-ico { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); color: var(--ink-soft); display: grid; place-items: center; flex-shrink: 0; }
.today-action-lbl { font-size: 13.5px; font-weight: 700; min-width: 0; }
.today-action .btn { margin-left: auto; flex-shrink: 0; }
.followup-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.followup-row:last-child { border-bottom: none; }
.followup-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
@media (max-width: 560px) { .followup-row { flex-direction: column; align-items: stretch; gap: 8px; } .followup-actions { justify-content: flex-end; } }

/* Dashboard onboarding checklist */
.onboard-card { margin-bottom: 22px; border: 1px solid var(--accent-soft); background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface) 60%); }
.onboard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.onboard-x { width: 30px; height: 30px; border: none; border-radius: 8px; background: transparent; color: var(--ink-faint); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.onboard-x:hover { background: var(--surface-2); color: var(--ink); }
.onboard-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 14px; }
.onboard-bar > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; }
.onboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.onboard-item { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); font-size: 13.5px; font-weight: 700; color: var(--ink); cursor: pointer; text-align: left; }
.onboard-item:hover:not(:disabled) { border-color: var(--accent); }
.onboard-item.done { opacity: 0.72; }
.onboard-item.done:hover { opacity: 1; border-color: var(--accent); }
.onboard-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onboard-check { width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-2); color: var(--ink-faint); }
.onboard-item.done .onboard-check { background: var(--good); color: #fff; }
.qs-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.qs-preset { border: 1.5px solid var(--border); background: var(--surface); color: var(--ink-soft); border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 700; cursor: pointer; }
.qs-preset:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.qs-toggles { display: flex; flex-direction: column; gap: 14px; }
/* Materials: customer-visibility pill */
.vis-pill { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--surface-2); color: var(--ink-faint); border-radius: 999px; padding: 2px 8px 2px 6px; font-size: 11px; font-weight: 800; cursor: pointer; flex-shrink: 0; }
.vis-pill.on { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.vis-pill:hover { border-color: var(--border-strong); }
.mode-seg { flex-shrink: 0; }
.autosave { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.autosave.dirty { color: var(--warn); }
.autosave.ok { color: var(--good); }
.autosave.idle { display: none; }
.autosave-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--warn); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@media (max-width: 760px) { .autosave { display: none; } }
.mat-tabs { margin-bottom: 16px; flex-wrap: wrap; }
.mat-tab-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--surface-2); color: var(--ink-soft); font-size: 11px; font-weight: 800; }
.seg-btn.on .mat-tab-count { background: var(--accent); color: #fff; }
.qs-toggles > button, .qs-toggles > div > button { width: 100%; }
.qs-note { font-size: 12px; color: var(--ink-soft); line-height: 1.4; margin-top: 12px; background: var(--bg-sunken); padding: 8px 10px; border-radius: var(--r-sm); }
.qs-media { display: flex; flex-direction: column; gap: 10px; }
.qs-media-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qs-photo { display: flex; gap: 10px; align-items: center; }
.qs-cap { flex: 1; min-width: 0; border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--r-sm); padding: 7px 10px; font: inherit; font-size: 12.5px; color: var(--ink); }
.qs-cap:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.qs-add { align-self: flex-start; }
.qs-items { display: flex; flex-direction: column; gap: 10px; }
.qs-item { border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--bg-sunken); }
.qs-item.off { opacity: 0.62; }
.qs-item-top { display: flex; align-items: center; gap: 7px; }
.qs-item-top .eye-toggle { width: 32px; height: 32px; border-radius: 8px; }
.qs-item-bot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.qs-photo-btn { width: 32px; height: 32px; border: 1.5px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--ink-soft); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.qs-photo-btn:hover { border-color: var(--border-strong); color: var(--ink); }
.qs-photo-btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.qs-item-thumb { position: relative; width: 34px; height: 34px; border-radius: 7px; overflow: hidden; flex-shrink: 0; }
.qs-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qs-item-thumb button { position: absolute; top: 1px; right: 1px; width: 15px; height: 15px; border: none; border-radius: 999px; background: rgba(0,0,0,0.55); color: #fff; display: grid; place-items: center; cursor: pointer; }
.qs-item-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.qs-subtotal { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-weight: 800; font-size: 14px; }
.qs-subtotal .num { font-size: 15.5px; }

/* itemised table: per-item example photo + VAT row */
.qi-desc { display: flex; align-items: center; gap: 12px; min-width: 0; }
.qi-thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); }
.qi-vat { font-weight: 700; }
.qi-vat span:first-child { color: var(--ink-soft); }

/* gallery captions */
.qg-cap { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; line-height: 1.35; }

/* Stacked layout (narrow container): sidebar drops below the quote, full width */
@container (max-width: 899.98px) {
  .quote-side { position: static; max-height: none; }
}

/* logo upload preview in Settings */
.logo-edit { display: flex; align-items: center; gap: 16px; }
.logo-preview { height: 60px; max-width: 200px; object-fit: contain; border: 1px solid var(--border); border-radius: var(--r-md); padding: 8px; background: var(--surface); }

/* ============================================================
   Schedule — month calendar board
   ============================================================ */
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-month { font-family: var(--font-display); font-weight: 600; font-size: 20px; margin-left: 6px; letter-spacing: -0.01em; }

.cal-controls { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-legend { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ws-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--warn); display: inline-block; flex-shrink: 0; }
.cal-filter { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 13px; color: var(--ink-soft); background: var(--surface); border: 1.5px solid var(--border); padding: 8px 14px; border-radius: var(--r-pill); cursor: pointer; }
.cal-filter.on { border-color: var(--accent); color: var(--accent-ink); }
.cal-filter input[type="range"] { width: 110px; accent-color: var(--accent); }
.cal-filter input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }

.sched-grid { display: grid; grid-template-columns: 280px 1fr; gap: var(--gap); align-items: start; }
.sched-rail { max-height: calc(100vh - 220px); overflow-y: auto; position: sticky; top: 0; }
.rail-head { font-weight: 800; font-size: 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.rail-head .count { background: var(--accent-soft); color: var(--accent-ink); border-radius: 999px; font-size: 12px; padding: 1px 8px; }
.rail-job { border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; margin-bottom: 10px; }
.rail-job-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.rail-job-name { font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-job-sub { font-size: 12.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-miles { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; flex-shrink: 0; }
.rail-job-controls { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.rail-date { padding: 8px 10px; font-size: 13px; width: auto; flex: 1; min-width: 120px; }
.rail-ws { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--warn); }

.cal { overflow: hidden; }
.cal-weekrow, .cal-body { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-weekhead { background: var(--bg-sunken); border-bottom: 1px solid var(--border); }
.cal-wd { padding: 9px 12px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); }
.cal-cell { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px 7px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.out { background: var(--bg-sunken); }
.cal-cell.out .cal-date { color: var(--ink-faint); }
.cal-cell.today { background: var(--accent-soft); }
.cal-cell-top { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.cal-date { font-weight: 800; font-size: 13.5px; }
.cal-wx { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }
.cal-wx i { font-style: normal; color: var(--ink-faint); }
.cal-wx.wet { color: var(--info); }
.cal-jobs { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.job-chip { display: flex; align-items: center; gap: 5px; padding: 4px 7px; border: none; border-radius: 4px; font-weight: 700; font-size: 11.5px; min-width: 0; text-align: left; cursor: pointer; }
.job-chip.start { border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
.job-chip.end { border-top-right-radius: 999px; border-bottom-right-radius: 999px; }
.job-chip.danger { background: var(--danger-soft); color: var(--danger); }
.job-chip-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-chip-day { opacity: 0.75; font-size: 10.5px; flex-shrink: 0; }
.job-chip .ws-dot { width: 7px; height: 7px; }

@media (max-width: 900px) {
  .sched-grid { grid-template-columns: 1fr; }
  .sched-rail { position: static; max-height: none; }
  .cal-cell { min-height: 84px; }
  .job-chip-day { display: none; }
}

/* ---- schedule: insights, wages, drag, crew ---- */
.ins-bar { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.ins-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.ins-stat { min-width: 0; }
.ins-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-faint); }
.ins-val { font-weight: 800; font-size: 22px; letter-spacing: -0.01em; line-height: 1.1; margin-top: 2px; }
.ins-sub { font-size: 11.5px; color: var(--ink-faint); font-weight: 600; }
.ins-seg { flex-shrink: 0; }

/* week-total column (8th) */
.cal-weekhead { display: grid; grid-template-columns: repeat(7, 1fr) 116px; background: var(--bg-sunken); border-bottom: 1px solid var(--border); }
.cal-body { display: grid; grid-template-columns: repeat(7, 1fr) 116px; }
.cal-wd-tot { text-align: right; }
.cal-weektot { border-bottom: 1px solid var(--border); background: var(--bg-sunken); padding: 8px 12px; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; text-align: right; min-width: 0; }
.cal-wt-val { font-weight: 800; font-size: 15px; }
.cal-wt-sub { font-size: 10.5px; color: var(--ink-faint); font-weight: 600; }
.cal-wt-empty { color: var(--border-strong); }

/* drag & drop */
.cal-cell.drop-hover { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.job-chip[draggable="true"] { cursor: grab; }
.job-chip[draggable="true"]:active { cursor: grabbing; }
.rail-grip { display: grid; place-items: center; width: 22px; height: 28px; color: var(--ink-faint); cursor: grab; flex-shrink: 0; border-radius: 6px; }
.rail-grip:hover { background: var(--surface-2); color: var(--ink); }
.rail-grip:active { cursor: grabbing; }

/* crew avatars */
.crew-dots { display: inline-flex; align-items: center; }
.crew-av { width: 18px; height: 18px; border-radius: 999px; background: var(--accent-soft-2); color: var(--accent-ink); display: grid; place-items: center; font-size: 9px; font-weight: 800; margin-left: -5px; border: 1.5px solid var(--surface); flex-shrink: 0; }
.crew-av:first-child { margin-left: 0; }
.crew-av.more { background: var(--surface-2); color: var(--ink-soft); }
.job-chip-mi { font-size: 10px; opacity: 0.8; flex-shrink: 0; }
.rail-job-mid { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.rail-rate { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.rail-miles.long { color: var(--warn); }

/* crew rows in editor */
.editor-crew { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.crew-row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; }
.crew-row .crew-av { width: 24px; height: 24px; font-size: 10px; margin: 0; }
.crew-row b { margin-left: auto; }
.crew-total { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 9px; margin-top: 3px; font-weight: 700; color: var(--ink-soft); }
.crew-total b { color: var(--ink); font-size: 15px; }

@media (max-width: 900px) {
  .cal-weekhead, .cal-body { grid-template-columns: repeat(7, 1fr); }
  .cal-wd-tot, .cal-weektot { display: none; }
  .ins-stats { gap: 18px; }
}

/* ---- calendar month toolbar ---- */
.cal-toolbar { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.cal-arrow { width: 36px; height: 36px; border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--r-md); display: grid; place-items: center; color: var(--ink-soft); flex-shrink: 0; }
.cal-arrow:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--ink); }
.cal-toolbar .cal-month { margin: 0 6px; }
.cal-today { margin-left: auto; }

/* ---- team view ---- */
.team-view { margin-top: 22px; }
.tv-head { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.tv-head .count { font-family: var(--font-ui); background: var(--accent-soft); color: var(--accent-ink); border-radius: 999px; font-size: 12px; font-weight: 700; padding: 2px 9px; }
.tv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); }
.tv-card { padding: 15px; }
.tv-card-top { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.tv-av { width: 38px; height: 38px; font-size: 13px; margin: 0; border: none; flex-shrink: 0; }
.tv-name { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-role { font-size: 12.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-booked { font-size: 11.5px; font-weight: 800; color: var(--ink-faint); background: var(--surface-2); padding: 3px 9px; border-radius: 999px; flex-shrink: 0; }
.tv-booked.on { color: var(--accent-ink); background: var(--accent-soft); }
.tv-jobs { display: flex; flex-direction: column; gap: 6px; }
.tv-job { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: none; background: var(--surface-2); border-radius: var(--r-sm); width: 100%; text-align: left; }
.tv-job:hover { background: var(--accent-soft); }
.tv-job-cust { font-weight: 700; font-size: 13.5px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-job-meta { font-size: 11.5px; color: var(--ink-faint); font-weight: 700; flex-shrink: 0; }
.tv-free { font-size: 13px; color: var(--ink-faint); }

/* ---- clickable status badge (stage picker) ---- */
.status-pick { display: inline-flex; }
.badge-btn { border: none; cursor: pointer; transition: filter 0.12s, box-shadow 0.12s; }
.badge-btn:hover { filter: saturate(1.15) brightness(0.98); box-shadow: var(--sh-sm); }

/* ---- overhead fixed/per-day controls ---- */
.oh-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.seg-xs { padding: 3px; }
.seg-xs .seg-btn { padding: 6px 11px; font-size: 12.5px; }
.oh-perday { font-size: 12.5px; color: var(--ink-faint); font-weight: 700; white-space: nowrap; min-width: 96px; text-align: right; }
.oh-perday b { color: var(--ink); }

/* ============================================================
   Reports
   ============================================================ */
.rep-heroes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); margin-bottom: 26px; }
.rep-kpi { display: flex; flex-direction: column; gap: 8px; }
.rep-kpi.hero { background: linear-gradient(170deg, var(--surface), var(--accent-soft) 220%); }
.rep-kpi-label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.rep-kpi-val { font-weight: 800; font-size: 30px; letter-spacing: -0.02em; line-height: 1; }
.rep-kpi.hero .rep-kpi-val { font-size: 34px; }
.rep-kpi-foot { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.rep-kpi-sub { font-size: 12.5px; color: var(--ink-faint); font-weight: 600; }
.rep-trend { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.rep-trend.good { color: var(--good); background: var(--good-soft); }
.rep-trend.bad { color: var(--danger); background: var(--danger-soft); }
.rep-trend.none { color: var(--ink-faint); background: var(--surface-2); font-weight: 700; }

.rep-section { margin-bottom: 26px; }
.rep-section-head { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; margin-bottom: 12px; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--gap); }
.rep-cols { display: flex; gap: var(--gap); align-items: stretch; flex-wrap: wrap; }
.rep-cols > * { min-width: 260px; }

.rep-card-title { font-weight: 800; font-size: 15px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rep-card-hint { font-size: 12.5px; color: var(--ink-faint); font-weight: 600; }
.rep-empty { font-size: 13.5px; color: var(--ink-faint); }

.rep-bar { display: flex; height: 18px; border-radius: 999px; overflow: hidden; gap: 3px; margin-bottom: 16px; }
.rep-bar > div { border-radius: 5px; }
.rep-bar-legend { display: flex; flex-direction: column; gap: 9px; }
.rep-bar-leg { display: flex; align-items: center; gap: 9px; }
.rep-bar-name { font-weight: 700; font-size: 13.5px; flex: 1; }
.rep-bar-val { font-weight: 800; font-size: 14px; }
.rep-bar-pct { font-size: 12px; color: var(--ink-faint); font-weight: 700; min-width: 34px; text-align: right; }
.rep-matpct { margin-top: 14px; font-size: 13.5px; color: var(--ink-soft); }
.rep-matpct b { color: var(--ink); }

.rep-margins { flex: 1; }
.rep-mrow { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.rep-mrow + .rep-mrow { border-top: 1px solid var(--border); }
.rep-mrow-name { font-weight: 700; font-size: 13.5px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-mrow-bar { flex: 1.2; height: 8px; background: var(--bg-sunken); border-radius: 999px; overflow: hidden; }
.rep-mrow-bar > span { display: block; height: 100%; border-radius: 999px; }
.rep-mrow-pct { font-weight: 800; font-size: 13.5px; min-width: 56px; text-align: right; }
.rep-mrow-pct.low { color: var(--danger); }
.rep-note { font-size: 12px; color: var(--ink-faint); text-align: center; margin-top: 8px; }

@media (max-width: 760px) { .rep-cols { flex-direction: column; } .rep-cols > * { min-width: 0; } }

/* reports toolbar */
.rep-toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* ============================================================
   Supplier prices
   ============================================================ */
.px-grid { display: grid; grid-template-columns: 290px 1fr; gap: var(--gap); align-items: start; }
.px-rail { position: sticky; top: 0; max-height: calc(100vh - 200px); overflow-y: auto; }
.px-mat { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; border: 1.5px solid transparent; background: none; padding: 11px 12px; border-radius: var(--r-md); margin-bottom: 3px; }
.px-mat:hover { background: var(--surface-2); }
.px-mat.on { background: var(--accent-soft); border-color: var(--accent); }
.px-mat-name { display: block; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.px-mat-sub { display: block; font-size: 12px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.px-mat-sub b { color: var(--ink-soft); }
.px-mat-price { font-weight: 800; font-size: 14px; white-space: nowrap; flex-shrink: 0; }
.px-mat-price i { font-style: normal; color: var(--ink-faint); font-size: 11px; font-weight: 600; }

.px-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.px-detail-title { font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: -0.01em; }
.px-detail-sub { font-size: 13px; color: var(--ink-faint); font-weight: 600; }
.px-save { background: var(--good-soft); border-radius: var(--r-md); padding: 10px 14px; text-align: right; }
.px-save-lab { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--good); }
.px-save-merchant { font-weight: 800; font-size: 15px; color: var(--ink); }
.px-save-amt { font-size: 12px; color: var(--ink-soft); font-weight: 600; }

.px-compare { display: flex; flex-direction: column; }
.px-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.px-row:last-child { border-bottom: none; }
.px-row.best { }
.px-dot { width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0; }
.px-merchant { font-weight: 700; font-size: 14.5px; flex: 1; display: flex; align-items: center; gap: 9px; min-width: 0; }
.px-best-tag { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--good); background: var(--good-soft); padding: 2px 8px; border-radius: 999px; }
.px-updated { font-size: 12px; color: var(--ink-faint); font-weight: 600; white-space: nowrap; }
.px-price { font-weight: 800; font-size: 17px; min-width: 70px; text-align: right; }
.px-row.best .px-price { color: var(--good); }

.px-chart { display: block; }
.px-chart-empty { color: var(--ink-faint); font-size: 13.5px; padding: 24px 0; text-align: center; }
.px-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.px-leg { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }

.px-receipt { position: relative; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); }
.px-receipt img { width: 100%; max-height: 200px; object-fit: cover; display: block; }
.qe-thumb-x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: none; border-radius: 999px; background: rgba(0,0,0,0.55); color: #fff; display: grid; place-items: center; cursor: pointer; }
.px-scan-lines { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.px-scan-line { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: var(--r-sm); background: var(--surface-2); }
.px-scan-line.off { opacity: 0.5; }
.px-scan-name { flex: 1; font-weight: 700; font-size: 13.5px; min-width: 0; }
.px-scan-old { font-size: 12px; color: var(--ink-faint); font-weight: 700; }
.px-price-in { display: inline-flex; align-items: center; gap: 2px; }
.px-price-in i { font-style: normal; color: var(--ink-faint); font-weight: 700; }
.px-price-in .mini-input { width: 64px; text-align: right; }

@media (max-width: 900px) { .px-grid { grid-template-columns: 1fr; } .px-rail { position: static; max-height: none; } }

/* ---- Google Places autocomplete dropdown ---- */
.pac-container { border-radius: var(--r-md); border: 1px solid var(--border); box-shadow: var(--sh-lg); margin-top: 4px; background: var(--surface); font-family: var(--font-ui); z-index: 9999; }
.pac-item { padding: 9px 13px; border-top: 1px solid var(--border); color: var(--ink-soft); font-size: 13.5px; cursor: pointer; }
.pac-item:hover, .pac-item-selected { background: var(--surface-2); }
.pac-item-query { color: var(--ink); font-size: 14px; font-weight: 600; }
.pac-icon { display: none; }

/* ---- editable number stepper (click & type) ---- */
.stepper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stepper-val { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 3px; }
.stepper-input { width: 100%; min-width: 0; border: none; background: transparent; text-align: center; font-weight: 800; font-size: 18px; color: var(--ink); outline: none; font-family: inherit; -moz-appearance: textfield; padding: 0; }
.stepper-input::-webkit-outer-spin-button, .stepper-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-fix { color: var(--ink-faint); font-size: 14px; font-weight: 700; flex-shrink: 0; }

/* counter battens row in the lengths card */
.cb-row { display: flex; align-items: center; gap: 11px; width: 100%; margin-top: 16px; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: var(--r-md); background: var(--surface); font-weight: 700; font-size: 14.5px; color: var(--ink); }
.cb-row:hover { border-color: var(--border-strong); }
.cb-box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; color: #fff; flex-shrink: 0; transition: background 0.13s, border-color 0.13s; }
.cb-box.on { background: var(--accent); border-color: var(--accent); }

/* ============ Past Jobs & Performance ============ */
/* dismissable learning hint surfaced during estimating */
.learn-hint { display: flex; align-items: flex-start; gap: 11px; background: var(--accent-soft); color: var(--accent-ink); padding: 12px 14px; border-radius: var(--r-md); font-size: 13px; line-height: 1.5; font-weight: 600; margin-bottom: 18px; }
.learn-hint > svg { flex-shrink: 0; color: var(--accent); margin-top: 1px; }
.learn-hint .learn-hint-body { flex: 1; min-width: 0; }
.learn-hint strong { font-weight: 800; }
.learn-hint.warn { background: var(--warn-soft); color: var(--ink); }
.learn-hint.warn > svg { color: var(--warn); }
.learn-hint.good { background: var(--good-soft); color: var(--ink); }
.learn-hint.good > svg { color: var(--good); }
.learn-hint-x { border: none; background: transparent; color: inherit; opacity: 0.45; cursor: pointer; padding: 2px; flex-shrink: 0; border-radius: 6px; line-height: 0; }
.learn-hint-x:hover { opacity: 1; background: rgba(0,0,0,0.06); }
.learn-apply { display: inline-block; margin-left: 7px; vertical-align: baseline; border: none; background: var(--accent); color: #fff; font-weight: 700; font-size: 12px; padding: 4px 11px; border-radius: 999px; cursor: pointer; }
.learn-apply:hover { filter: brightness(1.06); }

/* ============ InfoTip — hover/focus explainer popover ============ */
.infotip { position: relative; display: inline-flex; vertical-align: middle; }
.infotip-btn { border: none; background: transparent; color: var(--ink-faint); padding: 0; margin-left: 4px; line-height: 0; cursor: help; display: inline-flex; }
.infotip-btn:hover, .infotip-btn:focus-visible { color: var(--accent); outline: none; }
/* bubble is portaled to <body> and fixed-positioned from the icon, centred above it */
.infotip-bubble {
  position: fixed; z-index: 60; transform: translate(-50%, -100%);
  width: 244px; max-width: calc(100vw - 24px); padding: 11px 13px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  font-size: 12px; font-weight: 600; line-height: 1.5; text-align: left;
  text-transform: none; letter-spacing: 0; pointer-events: none;
  animation: infotip-in 0.12s ease-out;
}
@keyframes infotip-in { from { opacity: 0; transform: translate(-50%, calc(-100% + 4px)); } to { opacity: 1; transform: translate(-50%, -100%); } }
.infotip-head { font-weight: 800; font-size: 12.5px; margin-bottom: 6px; }
.infotip-row { display: flex; justify-content: space-between; gap: 14px; font-family: var(--font-mono); font-size: 11px; margin-top: 3px; }
.infotip-row span:last-child { font-weight: 700; white-space: nowrap; }
.infotip-row.tot { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); color: var(--accent-ink); }
.infotip-note { color: var(--ink-soft); font-weight: 600; font-size: 11px; line-height: 1.45; margin-top: 8px; }

/* past jobs list */
.past-row { width: 100%; display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 14px 18px; background: transparent; border: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.past-row:hover { background: var(--surface-2); }

/* variance chip — goodWhenOver flips good/bad in JSX */
.var-chip { font-family: var(--font-mono); font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-faint); white-space: nowrap; }
.var-chip.good { background: var(--good-soft); color: var(--good); }
.var-chip.bad { background: var(--warn-soft); color: var(--warn); }

/* review screen */
.rev-block { margin-bottom: 16px; }
.rev-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.rev-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15.5px; }
.rev-title svg { color: var(--accent); }
.rev-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rev-lbl { display: block; font-size: 12px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 6px; }
.rev-val { font-weight: 800; font-size: 18px; }
.rev-est { background: var(--surface-2); border-radius: var(--r-md); padding: 12px 14px; }
.rev-input { display: flex; align-items: center; position: relative; }
.rev-input .input { width: 100%; }
.rev-input .rev-pre + .input, .rev-input .input.num { padding-left: 26px; }
.rev-pre { position: absolute; left: 12px; font-weight: 700; color: var(--ink-faint); pointer-events: none; z-index: 1; }
.rev-suf { margin-left: 9px; font-size: 13px; color: var(--ink-faint); font-weight: 700; }
.rev-cat { display: grid; grid-template-columns: 1fr 78px 120px 96px; gap: 12px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--border); }
.rev-cat-name { font-weight: 600; font-size: 14px; min-width: 0; }
.rev-cat-est { text-align: right; color: var(--ink-faint); font-weight: 700; font-size: 13.5px; }
.rev-cat-input .input { padding: 9px 12px 9px 26px; }
.rev-cat-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }
.rev-qty { display: grid; grid-template-columns: minmax(0, 1fr) 70px 110px 96px; gap: 10px; align-items: center; padding: 9px 18px; border-top: 1px solid var(--border); }
.rev-qty-name { display: flex; flex-direction: column; min-width: 0; font-weight: 600; font-size: 13.5px; }
.rev-qty-name > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rev-qty-cat { font-size: 11.5px; color: var(--ink-faint); font-weight: 600; }
.rev-qty .rev-cat-input .input { padding-left: 12px; }

/* ============ Supplier CSV import ============ */
.csv-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.csv-row { display: grid; grid-template-columns: 28px minmax(0, 1.4fr) 1.3fr 1.2fr 86px; gap: 8px; align-items: center; }
.csv-row.off { opacity: 0.5; }
.csv-src { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.csv-price { display: inline-flex; align-items: center; gap: 2px; }
.csv-price i { font-style: normal; color: var(--ink-faint); font-weight: 700; }
.csv-price .mini-input { width: 60px; text-align: right; }
.csv-check { width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; color: #fff; cursor: pointer; flex-shrink: 0; }
.csv-check.on { background: var(--accent); border-color: var(--accent); }

/* ============ Merchant pricing on the estimate ============ */
.merchant-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.merchant-select { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.merchant-total { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.merchant-tip { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 600; line-height: 1.45; }
.merchant-tip svg { flex-shrink: 0; color: var(--accent); margin-top: 1px; }
.merchant-tip strong { font-weight: 800; }
.merchant-tip.ok { background: var(--good-soft); color: var(--ink); }
.merchant-tip.ok svg { color: var(--good); }
.supplier-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); padding: 1px 7px; border-radius: 999px; }
.supplier-badge svg { color: var(--accent); }

/* per-line best-price recommendation (Materials step) */
.mat-rec { display: flex; align-items: center; gap: 8px; padding: 8px 18px 12px 64px; font-size: 12.5px; font-weight: 600; color: var(--good); }
.mat-rec svg { color: var(--good); flex-shrink: 0; }
.mat-rec span { color: var(--ink-soft); }
.mat-rec strong { color: var(--ink); font-weight: 800; }
.mat-rec .learn-apply { margin-left: auto; background: var(--good); }

/* best-price opportunities panel (BOQ) */
.boq-rec { margin-top: 14px; background: var(--good-soft); border: 1.5px solid transparent; }
.boq-rec-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.boq-rec-title { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.boq-rec-title svg { color: var(--good); flex-shrink: 0; margin-top: 1px; }
.boq-rec-title strong { font-weight: 800; }
.boq-rec-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.boq-rec-row { display: grid; grid-template-columns: minmax(0, 1.5fr) 1fr auto; gap: 12px; align-items: center; font-size: 13px; padding-top: 8px; border-top: 1px solid var(--border); }
.boq-rec-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boq-rec-mch { color: var(--ink-soft); font-weight: 600; }
.boq-rec-save { color: var(--good); font-weight: 800; text-align: right; }

/* like-for-like estimate ↔ rate-book mapping modal */
.link-head { display: grid; grid-template-columns: minmax(0, 1.1fr) 1.7fr 76px minmax(0, 1fr); gap: 10px; align-items: center; font-size: 11.5px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.03em; padding: 0 2px 8px; }
.link-row { display: grid; grid-template-columns: minmax(0, 1.1fr) 1.7fr 76px minmax(0, 1fr); gap: 10px; align-items: center; padding: 7px 2px; border-top: 1px solid var(--border); }
.link-item { display: flex; flex-direction: column; min-width: 0; }
.link-item > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-factor .mini-input { width: 100%; text-align: center; }
.link-eff { font-size: 12px; font-weight: 700; color: var(--good); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) {
  .link-head { display: none; }
  .link-row { grid-template-columns: 1fr 1fr; }
  .link-row .link-item { grid-column: 1 / -1; }
  .link-eff { grid-column: 1 / -1; }
}
.rev-extra { display: grid; grid-template-columns: 1fr 184px 116px 40px; gap: 10px; align-items: center; padding: 8px 18px; }
.rev-extra .input, .rev-extra .select { padding: 9px 12px; }
.rev-extra-total { display: flex; justify-content: space-between; padding: 10px 18px 14px; font-weight: 700; font-size: 13.5px; color: var(--ink-soft); }
.rev-save { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

/* learnings summary cards */
.learn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 14px; }
.learn-card { display: flex; flex-direction: column; gap: 4px; }
.learn-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.learn-card-title { font-weight: 800; font-size: 15px; }
.learn-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--ink-faint); background: var(--surface-2); padding: 3px 9px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.learn-badge.on { color: var(--accent-ink); background: var(--accent-soft); }
.learn-card-sub { font-size: 12.5px; color: var(--ink-faint); font-weight: 600; margin-bottom: 8px; }
.learn-rows { display: flex; flex-direction: column; gap: 7px; }
.learn-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }

/* ============ Material use report ============ */
.mu-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.mu-kpi { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.mu-kpi-lbl { font-size: 12px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.03em; }
.mu-kpi-val { font-weight: 800; font-size: 22px; }
.mu-controls { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.mu-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.mu-sort { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.mu-row { display: grid; grid-template-columns: minmax(0, 1.7fr) 110px 56px 116px 116px; gap: 14px; align-items: center; padding: 12px 18px; }
.mu-head { font-size: 12px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.03em; }
@media (max-width: 640px) {
  .mu-row { grid-template-columns: minmax(0, 1.5fr) 1fr 1fr; }
  .mu-row > :nth-child(3), .mu-head > :nth-child(3) { display: none; }
}

@media (max-width: 580px) {
  .rev-grid { grid-template-columns: 1fr; }
  .rev-cat { grid-template-columns: 1fr auto; row-gap: 6px; }
  .rev-cat-est { grid-column: 2; }
  .rev-extra { grid-template-columns: 1fr 1fr; }
}

/* ---- consolidated mobile pass ---- */
@media (max-width: 720px) {
  /* Builder header: Exit + status + Save on row 1, the step strip full-width below */
  .builder-top { gap: 10px 12px; margin-bottom: 16px; }
  .builder-steps { order: 3; flex-basis: 100%; flex: 1 1 100%; gap: 2px; }
  .bstep { padding: 7px 9px; gap: 6px; }
  .bstep-label { display: none; }
  .bstep.active .bstep-label { display: inline; }
  .builder-save { margin-left: auto; }
  /* Quote toolbar: title on its own line, actions wrap full-width and stay tappable */
  .quote-toolbar .btn { flex: 1 1 auto; justify-content: center; }
}
/* NOTE: mobile overrides for the assistant/modal live at the very end of this
   file so they win the cascade over those components' base rules. */

/* ---- Day-rate / break-even sensitivity (cost rail) ---- */
.be-card { margin-top: 16px; padding-top: 16px; border-top: 1.5px solid var(--border); }
.be-flat { margin-top: 16px; padding: 11px 13px; border-radius: var(--r-md); background: var(--bg-sunken); display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); line-height: 1.35; }
.be-flat svg { flex-shrink: 0; margin-top: 1px; color: var(--ink-faint); }
.be-flat.danger { background: var(--danger-soft); color: var(--danger); }
.be-flat.danger svg { color: var(--danger); }
.be-head { display: flex; justify-content: space-between; align-items: center; }
.be-title { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-faint); }
.be-title svg { color: var(--ink-faint); }
.be-rate { font-size: 13px; font-weight: 800; color: var(--ink); }
.be-sub { font-size: 12px; color: var(--ink-soft); font-weight: 600; line-height: 1.35; margin: 6px 0 12px; }
.be-track { position: relative; margin-top: 26px; cursor: crosshair; }
.be-marks { position: relative; height: 14px; }
.be-mark { position: absolute; transform: translateX(-50%); font-size: 10px; font-weight: 800; white-space: nowrap; }
.be-mark.warn { color: var(--warn-ink, var(--warn)); }
.be-mark.danger { color: var(--danger); }
.be-mark::after { content: ""; display: block; width: 1.5px; height: 5px; margin: 1px auto -1px; background: currentColor; opacity: 0.55; }
.be-tip { position: absolute; top: -8px; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; z-index: 3; white-space: nowrap; }
.be-tip-bub { background: var(--ink); color: var(--surface); font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 6px; box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.18)); }
.be-tip-day { font-size: 10px; font-weight: 700; color: var(--ink-faint); }
.be-bar { position: relative; height: 9px; border-radius: 999px; overflow: hidden; background: var(--bg-sunken); }
.be-hover-line { position: absolute; top: -3px; bottom: -3px; width: 2px; transform: translateX(-50%); background: var(--ink); opacity: 0.85; border-radius: 2px; }
.be-zone { position: absolute; top: 0; bottom: 0; }
.be-zone.good { background: var(--good); }
.be-zone.warn { background: var(--warn); }
.be-zone.danger { background: var(--danger); }
.be-now { position: absolute; top: -3px; bottom: -3px; width: 3px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
.be-scale { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; font-weight: 700; color: var(--ink-faint); }
.be-table { margin-top: 13px; border: 1.5px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.be-thead, .be-trow { display: grid; grid-template-columns: 44px 58px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 11px; }
.be-thead { font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-faint); background: var(--bg-sunken); }
.be-trow { border-top: 1.5px solid var(--border); font-size: 13px; }
.be-trow .be-td-days { font-weight: 800; }
.be-trow .be-td-days i { font-size: 10px; font-weight: 700; font-style: normal; color: var(--ink-faint); margin-left: 1px; }
.be-td-pct { font-weight: 700; color: var(--ink-soft); }
.be-td-prof { font-weight: 700; color: var(--ink); }
.be-td-lab { font-size: 11px; font-weight: 700; color: var(--ink-faint); text-align: right; white-space: nowrap; }
.be-trow.warn .be-td-pct { color: var(--warn-ink, var(--warn)); }
.be-trow.danger .be-td-pct { color: var(--danger); }
.be-trow.be .be-td-prof, .be-trow.be .be-td-days { color: var(--ink); }
.be-trow.now { background: var(--accent-soft); }
.be-trow.now .be-td-days, .be-trow.now .be-td-pct, .be-trow.now .be-td-prof, .be-trow.now .be-td-lab { color: var(--accent-ink); }
.be-warn { display: flex; align-items: flex-start; gap: 8px; margin-top: 11px; padding: 10px 12px; border-radius: var(--r-md); background: var(--warn-soft); font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--ink-soft); }
.be-warn svg { flex-shrink: 0; margin-top: 1px; color: var(--warn-ink, var(--warn)); }
.be-warn strong { color: var(--ink); font-weight: 800; }
.be-warn.danger { background: var(--danger-soft); }
.be-warn.danger svg { color: var(--danger); }
.be-warn.danger strong { color: var(--danger); }
.be-red-edit { display: inline-flex; align-items: center; }
.be-red-input { width: 26px; border: none; background: transparent; border-bottom: 1.5px dashed var(--danger); color: var(--danger); font-weight: 800; font-size: 11px; padding: 0 0 1px; text-align: center; -moz-appearance: textfield; }
.be-red-input::-webkit-outer-spin-button, .be-red-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.be-red-input:focus { outline: none; border-bottom-color: var(--danger); }

/* ---- Quote-time savings (cost rail · internal only) ---- */
.rail-savings { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 12px; border-radius: var(--r-md); background: var(--good-soft); color: var(--ink); font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.rail-savings svg { flex-shrink: 0; color: var(--good); }
.rail-savings strong { color: var(--good); font-weight: 800; }

/* ---- Invoices page ---- */
.inv-card { padding: 16px 18px; }
.inv-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.inv-job { display: flex; align-items: center; gap: 12px; min-width: 0; }
.inv-name { font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-type { font-size: 12.5px; color: var(--ink-faint); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-amount { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.inv-amount .num { font-weight: 800; font-size: 16px; }
.inv-state { font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.inv-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; align-items: end; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.inv-cell { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.inv-lbl { font-size: 11px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.02em; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.inv-val { font-size: 15px; font-weight: 800; }
.inv-date { padding: 7px 9px; font-size: 13px; width: 100%; }
.inv-days.slow { color: var(--warn); }
.inv-saved { display: inline-flex; align-items: center; gap: 5px; color: var(--good); }
.inv-saved svg { color: var(--good); }
.inv-tag { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; padding: 1px 6px; border-radius: 999px; background: var(--bg-sunken); color: var(--ink-faint); }
.inv-tag.good { background: var(--good-soft); color: var(--good); }
.inv-action { justify-content: flex-end; }
.inv-paid-note { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--good); }
@media (max-width: 720px) {
  .inv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inv-top { flex-wrap: wrap; }
}

/* ---- Customers page ---- */
.cust-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cust-search { flex: 1 1 220px; max-width: 320px; }
.cust-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.cust-sort { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.cust-row { display: grid; grid-template-columns: minmax(0, 1.7fr) 124px 130px 132px 120px; gap: 12px; align-items: center; width: 100%; text-align: left; background: none; border: none; border-top: 1px solid var(--border); padding: 12px 18px; cursor: pointer; font: inherit; color: inherit; }
.cust-row:first-child { border-top: none; }
.cust-row:not(.cust-head):hover { background: var(--bg-sunken); }
.cust-head { font-size: 11.5px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.03em; cursor: default; background: var(--bg-sunken); }
.cust-head:hover { background: var(--bg-sunken); }
.cust-row-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cust-name { font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-sub { font-size: 12.5px; color: var(--ink-faint); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-type { font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.cust-metric-cell { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; text-align: right; }
.cust-metric-val { font-size: 15px; font-weight: 800; }
.cust-metric-lbl { font-size: 11.5px; color: var(--ink-faint); font-weight: 600; }
.cust-last { flex-direction: row; align-items: center; gap: 6px; justify-content: flex-end; }
.cust-job-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 11px 18px; }
@media (max-width: 760px) {
  .cust-row { grid-template-columns: minmax(0, 1.5fr) auto auto; }
  .cust-row > :nth-child(2), .cust-head > :nth-child(2) { display: none; }
  .cust-row > :nth-child(5), .cust-head > :nth-child(5) { display: none; }
  .cust-sort { margin-left: 0; }
}

/* ---- Returning-customer autofill (estimate details step) ---- */
.cust-fill { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; padding: 11px 13px; border-radius: var(--r-md); background: var(--accent-soft); }
.cust-fill > svg { color: var(--accent-ink); flex-shrink: 0; }
.cust-fill-lab { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700; color: var(--accent-ink); }
.cust-fill-ok { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--good); }

/* ---- Trends page + interactive charts ---- */
.trend-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.trend-title { font-size: 15.5px; font-weight: 800; letter-spacing: -0.01em; }
.trend-hint { font-size: 12.5px; color: var(--ink-faint); font-weight: 600; margin-top: 2px; }
.trend-foot { font-size: 12px; color: var(--ink-faint); font-weight: 500; margin: 10px 2px 0; }

/* interactive price-history chart */
.pxc-wrap { position: relative; cursor: crosshair; }
.pxc-tip { position: absolute; transform: translate(-50%, -118%); pointer-events: none; z-index: 4; background: var(--ink); color: var(--surface); padding: 6px 9px; border-radius: 7px; box-shadow: 0 2px 10px rgba(0,0,0,0.22); display: flex; flex-direction: column; gap: 3px; white-space: nowrap; font-size: 12px; font-weight: 700; }
.pxc-tip-date { font-size: 11px; opacity: 0.7; }
.pxc-tip-row { display: flex; align-items: center; gap: 6px; }
.pxc-tip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.px-leg { cursor: pointer; transition: opacity 0.12s; }
.px-leg.on { text-decoration: underline; text-underline-offset: 3px; }

/* interactive quotes chart */
.qc-wrap { position: relative; cursor: crosshair; }
.qc-tip { position: absolute; top: 6px; transform: translateX(-50%); pointer-events: none; z-index: 4; background: var(--ink); color: var(--surface); padding: 6px 9px; border-radius: 7px; box-shadow: 0 2px 10px rgba(0,0,0,0.22); display: flex; flex-direction: column; gap: 3px; white-space: nowrap; font-size: 12px; font-weight: 700; }
.qc-tip-mon { font-size: 11px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.03em; }
.qc-tip-row { display: flex; align-items: center; gap: 6px; }
.qc-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.qc-tip-val { font-size: 11.5px; opacity: 0.85; margin-top: 1px; }

/* ---- Schedule jobs map ---- */
.cal-viewseg { flex-shrink: 0; }
.map-card { overflow: hidden; padding: 0; }
.map-wrap { position: relative; aspect-ratio: 3 / 2; background: var(--bg-sunken); }
.map-svg { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; }
.map-pin { transition: r 0.1s; }
.map-base { fill: var(--ink); stroke: #fff; stroke-width: 2; }
.map-ring { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0.7; }
.map-ring-max { fill: none; stroke: var(--danger); stroke-width: 2; stroke-dasharray: 5 4; opacity: 0.9; }
.map-ring-label { fill: var(--accent-ink, var(--accent)); stroke: #fff; stroke-width: 2.5; paint-order: stroke; font-size: 10px; font-weight: 800; font-family: var(--font-mono); }
.map-layers { position: absolute; bottom: 10px; left: 10px; display: flex; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 5px rgba(0,0,0,0.25); }
.map-lbtn { border: none; background: var(--surface); color: var(--ink-soft); font-size: 12px; font-weight: 700; padding: 6px 13px; cursor: pointer; }
.map-lbtn + .map-lbtn { border-left: 1px solid var(--border); }
.map-lbtn.on { background: var(--accent); color: #fff; }
.map-attr { position: absolute; bottom: 4px; right: 6px; font-size: 9.5px; color: #333; background: rgba(255,255,255,0.7); padding: 1px 5px; border-radius: 4px; pointer-events: none; }
.map-toolbar { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 6px; }
.map-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; font-weight: 800; font-size: 16px; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.12); color: var(--ink); }
.map-btn:hover { background: var(--bg-sunken); }
.map-btn-w { width: auto; padding: 0 10px; font-size: 12.5px; }
.map-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.map-tip { position: absolute; transform: translate(-50%, -135%); pointer-events: none; z-index: 4; background: var(--ink); color: var(--surface); padding: 5px 9px; border-radius: 7px; font-size: 12px; font-weight: 700; white-space: nowrap; box-shadow: 0 2px 10px rgba(0,0,0,0.22); display: flex; flex-direction: column; gap: 1px; }
.map-tip-sub { font-size: 10.5px; opacity: 0.7; font-weight: 600; }
.map-popup-wrap { position: absolute; transform: translate(-50%, -112%); z-index: 5; }
.map-popup { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: 0 6px 24px rgba(0,0,0,0.18); padding: 12px 14px; width: 210px; }
.map-popup-x { position: absolute; top: 8px; right: 8px; background: none; border: none; cursor: pointer; color: var(--ink-faint); padding: 2px; }
.map-popup-name { font-weight: 800; font-size: 14.5px; padding-right: 16px; }
.map-popup-type { font-size: 12px; color: var(--ink-faint); margin-top: 1px; }
.map-popup-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.map-popup-q { font-weight: 800; font-size: 14px; }
.map-popup-sub { font-size: 11.5px; color: var(--ink-faint); margin-top: 6px; }
.map-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 11px 16px; border-top: 1px solid var(--border); }
.map-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.map-leg { display: inline-flex; align-items: center; gap: 6px; }
.map-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.map-dot-base { background: var(--ink); }
.map-foot-count { font-size: 12px; color: var(--ink-faint); font-weight: 600; }
.map-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 60px 20px; min-height: 360px; }
.map-note { margin-top: 10px; font-size: 12.5px; color: var(--warn); font-weight: 600; }
@media (max-width: 900px) { .map-wrap { aspect-ratio: 4 / 5; } }

/* ============================================================
   App-wide additions: toasts, generic modal, validation,
   storage meter, quote deposit + acceptance, demo tags
   ============================================================ */

/* ---- toasts ---- */
.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 36px)); }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 12px 14px; border-radius: var(--r-md); box-shadow: var(--sh-lg); font-size: 13.5px; font-weight: 600; line-height: 1.35; animation: toastIn .22s cubic-bezier(.2,.8,.2,1); }
.toast > svg { flex-shrink: 0; }
.toast-success { background: var(--good); }
.toast-error { background: var(--danger); }
.toast-warn { background: var(--warn); color: #3a2e08; }
.toast-x { margin-left: auto; background: rgba(255,255,255,.2); border: none; color: inherit; width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.toast-warn .toast-x { background: rgba(0,0,0,.12); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .toast-wrap { left: 18px; right: 18px; max-width: none; } }

/* ---- generic modal (components.jsx Modal; distinct from the .modal used elsewhere) ---- */
.modal-card { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-lg); width: 100%; max-width: 460px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; animation: popIn .16s ease; }
.modal-card.wide { max-width: 660px; }
.modal-card .modal-body { display: block; padding: 20px 22px; overflow-y: auto; }
.modal-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.modal-title { font-weight: 800; font-size: 16.5px; line-height: 1.2; }
.modal-sub { font-size: 12.5px; color: var(--ink-faint); margin-top: 1px; }
.modal-x { width: 32px; height: 32px; border: none; border-radius: 9px; background: var(--surface-2); color: var(--ink-soft); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.modal-x:hover { background: var(--border); color: var(--ink); }
@keyframes popIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

/* ---- inline validation ---- */
.input-bad, .input-bad:focus { border-color: var(--danger) !important; box-shadow: 0 0 0 3px var(--danger-soft) !important; }
.field-err { display: block; margin-top: 5px; font-size: 12px; color: var(--danger); font-weight: 600; }

/* ---- demo tag (mock features, honestly flagged) ---- */
.demo-tag { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }

/* ---- overheads editor + storage meter ---- */
.oh-edit-row { display: flex; align-items: center; gap: 10px; }
.storage-meter { background: var(--bg-sunken); border-radius: var(--r-md); padding: 12px 14px; }
.storage-meter-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.storage-bar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.storage-bar > div { height: 100%; border-radius: 999px; transition: width .3s ease; }

/* ---- team remove ---- */
.team-x { color: var(--ink-faint); flex-shrink: 0; }
.team-x:hover { color: var(--danger); }

/* ---- quote: deposit link + customer acceptance/signature ---- */
.quote-pay { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 14px 18px; border-radius: var(--r-md); background: var(--accent); color: #fff; font-weight: 700; font-size: 14.5px; text-decoration: none; box-shadow: var(--sh-sm); }
.quote-pay:hover { filter: brightness(1.06); }
.quote-pay > span { flex: 1; }
.quote-accept { margin-top: 18px; padding: 18px; border: 1.6px dashed var(--border-strong); border-radius: var(--r-md); background: var(--bg-sunken); }
.quote-accept.signed { border-style: solid; border-color: var(--good); background: var(--good-soft); }
.qa-form { display: flex; flex-direction: column; gap: 12px; }
.qa-row { display: flex; gap: 10px; }
.qa-row .input { flex: 1; min-width: 0; }
.qa-signed { display: flex; align-items: center; gap: 14px; }
.qa-stamp { width: 40px; height: 40px; border-radius: 999px; background: var(--good); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.qa-sign-name { font-family: "Segoe Script", "Brush Script MT", "Snell Roundhand", cursive; font-size: 23px; color: var(--ink); margin-top: 2px; line-height: 1; }
.qa-line { display: none; align-items: flex-end; gap: 10px; margin-top: 10px; }
.qa-line > span { flex: 1; border-bottom: 1.5px solid var(--ink); height: 30px; }
.qa-line > em { font-size: 12px; color: var(--ink-faint); font-style: normal; }
.print-only { display: none; }
.paid-badge { display: inline-flex; align-items: center; gap: 4px; background: var(--good); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }

/* Quote terms (programme, exclusions, payment stages, validity, guarantee) */
.quote-terms { display: flex; flex-direction: column; gap: 11px; }
.qt-row { display: grid; grid-template-columns: 130px 1fr; gap: 14px; font-size: 14px; line-height: 1.5; color: var(--ink); }
.qt-lbl { font-weight: 800; color: var(--ink-faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 2px; }
@media (max-width: 480px) { .qt-row { grid-template-columns: 1fr; gap: 3px; } }
/* Customise sidebar: quote-detail fields */
.qs-fields { display: flex; flex-direction: column; gap: 12px; }
.qs-fields label { display: block; }
.qs-flabel { display: block; font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-bottom: 5px; }
.qs-fields .input, .qs-fields .textarea { width: 100%; }

/* Simple-mode assumptions summary (trader-facing, above the quote) */
.assume-card { background: var(--accent-soft); border: 1px solid var(--accent-soft); border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 18px; }
.assume-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--accent-ink); margin-bottom: 10px; flex-wrap: wrap; }
.assume-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.assume-chip { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 700; color: var(--ink); }
.assume-hidden { font-size: 12.5px; color: var(--ink-soft); margin-top: 10px; line-height: 1.45; }

/* Mobile sticky total bar on the quote step */
.quote-mobile-bar { display: none; }
@media (max-width: 640px) {
  .quote-mobile-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; bottom: 0; margin: 14px -16px 0; padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(0,0,0,0.06); z-index: 5; }
  .qmb-label { font-size: 11.5px; font-weight: 700; color: var(--ink-faint); }
  .qmb-total { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
  .quote-mobile-bar .btn { flex-shrink: 0; }
}

/* ---- pre-send quote checklist ---- */
.presend-list { display: flex; flex-direction: column; gap: 2px; }
.presend-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.presend-row:last-child { border-bottom: none; }
.presend-ico { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; flex-shrink: 0; }
.presend-row.ok .presend-ico { background: var(--good-soft); color: var(--good); }
.presend-row.warn .presend-ico { background: var(--warn-soft); color: var(--warn); }
.presend-row.info .presend-ico { background: var(--surface-2); color: var(--ink-faint); }
.presend-label { font-weight: 700; }
.presend-val { margin-left: auto; color: var(--ink-soft); font-weight: 600; text-align: right; }
.presend-row.warn .presend-val { color: var(--warn); }
.presend-fix { border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); border-radius: var(--r-sm); padding: 3px 10px; font-size: 12px; font-weight: 700; cursor: pointer; flex-shrink: 0; }
.presend-fix:hover { background: var(--surface-2); }

/* ---- AI assistant: floating button + right drawer ---- */
.ai-fab { position: fixed; right: 22px; bottom: 22px; z-index: 70; display: inline-flex; align-items: center; gap: 8px; padding: 13px 18px; border: none; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 800; font-size: 14.5px; cursor: pointer; box-shadow: var(--sh-lg); transition: transform .12s, filter .12s; }
.ai-fab:hover { transform: translateY(-1px); filter: brightness(1.06); }
.ai-drawer-scrim { position: fixed; inset: 0; background: oklch(0.3 0.02 70 / 0.4); backdrop-filter: blur(2px); z-index: 90; display: flex; justify-content: flex-end; animation: fadeIn .18s ease; }
.ai-drawer { width: 400px; max-width: 92vw; background: var(--surface); height: 100%; display: flex; flex-direction: column; box-shadow: var(--sh-lg); animation: slideInRight .22s cubic-bezier(.2,.8,.2,1); }
@keyframes slideInRight { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.ai-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.ai-drawer-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.ai-drawer-body { padding: 16px 18px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 11px; }
.ai-insight { border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--r-md); padding: 12px 14px; background: var(--surface); }
.ai-insight-top { display: flex; align-items: center; gap: 8px; }
.ai-insight-title { font-weight: 800; font-size: 14px; }
.ai-insight-body { font-size: 13px; color: var(--ink-soft); margin-top: 5px; line-height: 1.45; }
.ai-ask { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 16px; }
.ai-answer { background: var(--accent-soft); border-radius: var(--r-md); padding: 12px 14px; font-size: 13px; color: var(--ink); line-height: 1.5; margin-bottom: 10px; white-space: pre-wrap; }

/* ---- Auth screen (cloud accounts) ---- */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 410px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 28px 26px; box-shadow: var(--sh-lg); }
.auth-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; }
.auth-title { font-weight: 800; font-size: 20px; letter-spacing: -0.01em; }
.auth-sub { font-size: 13.5px; color: var(--ink-soft); margin-top: 1px; }
.auth-tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: var(--r-md); margin-bottom: 18px; }
.auth-tab { flex: 1; border: none; background: none; padding: 9px; border-radius: var(--r-sm); font: inherit; font-weight: 700; font-size: 13.5px; color: var(--ink-soft); cursor: pointer; }
.auth-tab.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-sm); }
.auth-form { display: flex; flex-direction: column; gap: 13px; }
.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-field > span { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.auth-msg { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; padding: 9px 12px; border-radius: var(--r-md); }
.auth-msg.err { background: var(--danger-soft); color: var(--danger); }
.auth-msg.ok { background: var(--good-soft); color: var(--good); }
.auth-foot { margin-top: 16px; text-align: center; font-size: 13px; color: var(--ink-soft); }
.auth-link { border: none; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--accent-ink); cursor: pointer; }
.auth-leg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-faint); font-weight: 600; }
.auth-leg svg { color: var(--good); }
.cloud-splash { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.cloud-splash-spin { width: 26px; height: 26px; border: 3px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Admin · Users dashboard ---- */
.admin-table { display: flex; flex-direction: column; }
.admin-head, .admin-row { display: grid; grid-template-columns: 1.4fr 1.8fr 0.8fr 0.7fr 1fr 1fr; gap: 12px; align-items: center; padding: 12px 16px; }
.admin-head { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-faint); font-weight: 700; border-bottom: 1px solid var(--border); }
.admin-row + .admin-row { border-top: 1px solid var(--border); }
.admin-row { font-size: 13.5px; }
.admin-biz { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-email { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-muted { color: var(--ink-faint); font-size: 12.5px; }
.admin-num { font-weight: 700; }
.admin-role { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--ink-soft); text-transform: capitalize; }
.admin-role.is-admin { background: var(--accent-soft); color: var(--accent-ink); }
.admin-empty { padding: 28px 16px; text-align: center; color: var(--ink-faint); font-size: 13.5px; }
.cloud-acct { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--r-md); }
@media (max-width: 720px) {
  .admin-head { display: none; }
  .admin-row { grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 12px 14px; }
  .admin-row .admin-email { grid-column: 1 / -1; }
}

/* ---- Proactive pricing-check alerts on the cost rail ---- */
.rail-alerts { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--r-md); padding: 11px 12px 8px; background: var(--surface); }
.rail-alerts-head { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; }
.rail-alerts-head svg { color: var(--warn); }
.rail-alerts-n { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; }
.rail-alert { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: none; background: none; padding: 7px 6px; border-radius: var(--r-sm); font: inherit; cursor: default; }
.rail-alert + .rail-alert { border-top: 1px solid var(--border); }
.rail-alert.jump { cursor: pointer; }
.rail-alert.jump:hover { background: var(--surface-2); }
.rail-alert .ra-ico { flex-shrink: 0; display: inline-flex; }
.rail-alert .ra-title { flex: 1; font-size: 12.5px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.rail-alert > svg:last-child { color: var(--ink-faint); flex-shrink: 0; }

.buy-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* ---- Drawn signature pad ---- */
.sigpad { margin: 10px 0; }
.sigpad-canvas { display: block; width: 100%; height: 120px; background: #fff; border: 1px dashed var(--border-strong); border-radius: var(--r-md); touch-action: none; cursor: crosshair; }
.sigpad-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.sigpad-hint { font-size: 12px; color: var(--ink-faint); font-weight: 600; }
.qa-sign-img { display: block; max-height: 64px; max-width: 100%; margin-top: 4px; }

/* ---- Quote revision history ---- */
.quote-revhist { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 9px 13px; border-radius: var(--r-md); background: var(--warn-soft); color: var(--ink); font-size: 13px; font-weight: 600; flex-wrap: wrap; }
.quote-revhist svg { color: var(--warn); flex-shrink: 0; }
.quote-revhist .rev-prev { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; }


/* ---- Labour productivity suggestion ---- */
.labour-suggest { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r-md); background: var(--accent-soft); border: 1px solid transparent; font-size: 13.5px; }
.labour-suggest.low { background: var(--warn-soft); border-color: color-mix(in oklch, var(--warn) 30%, transparent); }
.labour-suggest .ls-main { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); }
.labour-suggest .ls-main svg { color: var(--accent); flex-shrink: 0; }
.labour-suggest.low .ls-main svg { color: var(--warn); }
.labour-suggest .ls-basis { color: var(--ink-soft); font-weight: 600; }
.labour-suggest .ls-actions { display: inline-flex; align-items: center; gap: 10px; }
.labour-suggest .ls-low { font-weight: 700; color: var(--warn); font-size: 12.5px; }

/* ---- Win rate by margin band ---- */
.wl-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.wl-row + .wl-row { border-top: 1px solid var(--border); }
.wl-band { flex: 0 0 92px; font-weight: 700; font-size: 13.5px; }
.wl-track { flex: 1; height: 9px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.wl-fill { display: block; height: 100%; border-radius: 999px; transition: width .3s ease; }
.wl-rate { flex: 0 0 44px; text-align: right; font-weight: 800; font-size: 14px; }
.wl-count { flex: 0 0 72px; text-align: right; font-size: 12.5px; color: var(--ink-faint); font-weight: 600; }
.wl-insight { margin-top: 12px; display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 600; line-height: 1.45; }
.wl-insight svg { flex-shrink: 0; margin-top: 1px; }

/* ---- Admin account drill-down + change password ---- */
.admin-row-btn { border: none; background: none; font: inherit; width: 100%; text-align: left; cursor: pointer; }
.admin-row-btn:hover { background: var(--surface-2); }
.admin-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 11px 18px; }
.admin-kv > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.admin-kv > div > span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-faint); font-weight: 700; }
.admin-kv > div > strong { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.admin-proj { display: flex; flex-direction: column; }
.admin-proj-head, .admin-proj-row { display: grid; grid-template-columns: 1.3fr 1.6fr 1fr 0.9fr 0.9fr 0.6fr; gap: 12px; align-items: center; padding: 11px 16px; }
.admin-proj-head { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-faint); font-weight: 700; border-bottom: 1px solid var(--border); }
.admin-proj-row { border: none; background: none; font: inherit; width: 100%; text-align: left; cursor: pointer; border-top: 1px solid var(--border); font-size: 13.5px; }
.admin-proj-row:hover { background: var(--surface-2); }
.admin-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.admin-proj-detail { padding: 14px 16px; background: var(--bg-sunken); border-top: 1px solid var(--border); }
.admin-areas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.admin-area-chip { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.admin-cust { display: flex; flex-direction: column; }
.admin-cust-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 2px; font-size: 13.5px; }
.admin-cust-row + .admin-cust-row { border-top: 1px solid var(--border); }
.cloud-pw { margin-top: 14px; }
.cloud-pw-form { display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
@media (max-width: 720px) {
  .admin-proj-head { display: none; }
  .admin-proj-row { grid-template-columns: 1fr 1fr; gap: 4px 12px; }
  .admin-proj-row > span:nth-child(2) { grid-column: 1 / -1; }
}

/* Mobile overrides for late-defined overlays (placed last so they win the cascade) */
@media (max-width: 560px) {
  .ai-fab { right: 16px; bottom: 86px; padding: 14px; gap: 0; }
  .ai-fab > span { display: none; }
  .modal-scrim { padding: 0; align-items: flex-end; }
  .modal-card { max-width: none; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92vh; }
  .ai-drawer { width: 100%; max-width: 100%; }
}

@media print {
  .toast-wrap, .modal-scrim, .quote-pay { display: none !important; }
  .print-only { display: flex !important; }
  .quote-accept { background: #fff !important; border-color: var(--ink) !important; }
}
