/* Approxi price page + contractor view.
   Layout: phone-width price page centred on a soft background; dashboard is a fluid two-column app.
   Business colours (--brand, --accent...) are set per contractor from config.js. Single light theme by design. */
:root {
  --bg: #F3F4F1;
  --card: #FFFFFF;
  --ink: #16181B;
  --ink-2: #3E4247;
  --ink-3: #5F646A;
  --line: #E1E2DE;
  --line-2: #CFD1CC;
  --approxi: #00EB65;
  --approxi-dark: #0B3B26;
  --error: #B42318;
  --ok: #0A6B3D;
  --brand: #1E3A5F;
  --brand-text: #FFFFFF;
  --accent: #F2A541;
  --accent-text: #1E2A3A;
  --soft: #EEF2F7;
  --display: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --body: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 16px/1.55 var(--body); }
img, svg { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Demo ribbon (Approxi branded, sits above the contractor's page) */
.ribbon { background: var(--approxi-dark); color: #E7F1EB; font-size: 14px; }
.ribbon-in { max-width: 1100px; margin: 0 auto; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.ribbon b { color: var(--approxi); letter-spacing: .5px; font-size: 12px; }
.ribbon-links { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.ribbon a { color: #fff; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; min-height: 36px; }
.ribbon a:hover { text-decoration: underline; }
.ribbon .r-cta { background: var(--approxi); color: var(--approxi-dark); padding: 6px 12px; border-radius: 10px; }
.ribbon .r-cta:hover { text-decoration: none; background: #12F273; }
.trade-pick { display: inline-flex; gap: 4px; background: rgba(255,255,255,.1); padding: 3px; border-radius: 10px; }
.trade-pick a { min-height: 32px; padding: 4px 10px; border-radius: 8px; font-size: 13px; color: #CFE3D7; }
.trade-pick a[aria-current="page"] { background: #fff; color: var(--approxi-dark); }

/* ---------- Homeowner price page ---------- */
.pp { max-width: 480px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); }
.pp-card { background: var(--card); border-radius: 24px; box-shadow: 0 20px 50px rgba(20,24,30,.10); overflow: hidden; }
.pp-head { background: var(--brand); color: var(--brand-text); padding: 22px 22px 20px; display: flex; flex-direction: column; gap: 12px; }
.pp-biz { display: flex; align-items: center; gap: 12px; }
.pp-badge { width: 48px; height: 48px; border-radius: 14px; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; font: 800 18px/1 var(--display); flex: none; }
.pp-name { font: 800 21px/1.15 var(--display); letter-spacing: -.3px; overflow-wrap: anywhere; }
.pp-meta { font-size: 14px; opacity: .85; }
.pp-promise { font-size: 14px; display: flex; align-items: center; gap: 8px; opacity: .95; }
.pp-promise svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.pp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 16px 22px 0; }
.pp-steps span { height: 5px; border-radius: 999px; background: var(--line); }
.pp-steps span.on { background: var(--brand); }
.pp-body { padding: 16px 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.pp-step-label { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.pp-title { font: 800 24px/1.2 var(--display); letter-spacing: -.4px; margin: 0; text-wrap: balance; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .field > .flabel { font-size: 14px; font-weight: 800; color: var(--ink-2); }
.opt { font-weight: 600; color: var(--ink-3); }
.num { width: 100%; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 13px; font: 600 16px var(--body); background: #fff; color: var(--ink); min-height: 48px; }
.num[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
.dims { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.dims span { font-weight: 800; color: var(--ink-3); }
.seg { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 6px; }
.seg button { min-height: 48px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); border-radius: 12px; font: 700 14px/1.2 var(--body); padding: 8px 6px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-text); }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; font: 800 22px var(--body); color: var(--ink); cursor: pointer; }
.stepper output { min-width: 2ch; text-align: center; font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 20px; border-radius: 14px; border: 0; font: 800 17px/1.2 var(--body); cursor: pointer; text-decoration: none; }
.btn-main { background: var(--accent); color: var(--accent-text); width: 100%; }
.btn-main:hover { filter: brightness(1.05); }
.btn-main[disabled] { opacity: .7; cursor: progress; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line-2); }
.linkbtn { background: none; border: 0; color: var(--ink-2); font: 700 15px var(--body); text-decoration: underline; cursor: pointer; min-height: 44px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(0,0,0,.2); border-top-color: currentColor; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.note { font-size: 13px; color: var(--ink-3); margin: 0; text-align: center; }
.consent { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.consent input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--brand); cursor: pointer; }
.consent.is-invalid input { outline: 2px solid var(--error); outline-offset: 2px; }
.ferr { color: var(--error); font-size: 14px; font-weight: 700; }
.ferr:empty { display: none; }
.ts-box { min-height: 65px; }
.estimate { background: var(--soft); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.estimate .elabel { font-size: 12px; font-weight: 800; letter-spacing: .7px; color: var(--brand); }
.estimate .erange { font: 800 34px/1.1 var(--display); letter-spacing: -.6px; color: var(--ink); font-variant-numeric: tabular-nums; }
.estimate .espec { font-size: 14px; color: var(--ink-2); }
.estimate .enote { font-size: 13px; color: var(--ink-3); }
.next { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; counter-reset: n; }
.next li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: start; counter-increment: n; font-size: 15px; color: var(--ink-2); }
.next li::before { content: counter(n); width: 32px; height: 32px; border-radius: 10px; background: var(--brand); color: var(--brand-text); display: grid; place-items: center; font: 800 15px/1 var(--display); }
.next b { color: var(--ink); display: block; }
.sent { display: flex; gap: 10px; align-items: flex-start; background: #E9F7EF; color: var(--ok); border-radius: 14px; padding: 12px 14px; font-size: 14px; font-weight: 600; }
.sent.warn { background: #FFF4E5; color: #7A4B05; }
.sent svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.pp-foot { text-align: center; font-size: 13px; color: var(--ink-3); padding: 18px 8px 0; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.pp-foot a { color: var(--ink-2); font-weight: 700; }
.powered { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.powered svg, .powered img { width: 18px; height: 18px; }
.pp-tip { background: #fff; border: 1px dashed var(--line-2); border-radius: 16px; padding: 14px 16px; margin-top: 16px; font-size: 14px; color: var(--ink-2); display: flex; flex-direction: column; gap: 8px; }
.pp-tip b { color: var(--ink); }
.pp-tip a { color: var(--approxi-dark); font-weight: 800; }

/* ---------- Contractor dashboard ---------- */
.app { max-width: 1100px; margin: 0 auto; padding: 20px max(16px, env(safe-area-inset-right, 0px)) 56px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 20px; }
.app-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.app-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.app-who .pp-badge { width: 44px; height: 44px; font-size: 16px; }
.app-who h1 { margin: 0; font: 800 22px/1.15 var(--display); letter-spacing: -.3px; }
.app-who p { margin: 0; font-size: 14px; color: var(--ink-3); }
.tabs { display: inline-flex; gap: 4px; background: #E6E7E3; padding: 4px; border-radius: 14px; }
.tabs button { min-height: 40px; padding: 8px 16px; border: 0; border-radius: 10px; background: transparent; font: 700 14px var(--body); color: var(--ink-2); cursor: pointer; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat span { font-size: 13px; color: var(--ink-3); font-weight: 700; }
.stat b { font: 800 26px/1.15 var(--display); letter-spacing: -.4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat small { font-size: 12px; color: var(--ink-3); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font: 800 18px/1.2 var(--display); }
.panel-head p { margin: 0; font-size: 13px; color: var(--ink-3); }
.leads { list-style: none; margin: 0; padding: 0; }
.lead { border-bottom: 1px solid #EEEFEB; }
.lead:last-child { border-bottom: 0; }
.l-row { width: 100%; text-align: left; background: none; border: 0; padding: 14px 18px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) auto 32px; gap: 6px 16px; align-items: center; cursor: pointer; font: inherit; color: inherit; }
.l-row:hover { background: #F6F7F3; }
.l-row:hover .l-open { background: var(--soft); color: var(--brand); }
.lead.is-open { background: #FBFBF9; box-shadow: inset 4px 0 0 var(--brand); }
.l-open { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #F0F1ED; color: var(--ink-2); transition: transform .2s, background .2s; }
.l-open svg { width: 18px; height: 18px; }
.lead.is-open .l-open { transform: rotate(180deg); background: var(--brand); color: var(--brand-text); }
@media (prefers-reduced-motion: reduce) { .l-open { transition: none; } }
@media (max-width: 640px) { .l-row { grid-template-columns: minmax(0, 1fr) auto 32px; } .lead .l-job { grid-column: 1 / -1; order: 3; } }
.l-name { font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.l-when { display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.l-job { font-size: 14px; color: var(--ink-2); }
.l-price { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.chip { font-size: 11px; font-weight: 800; letter-spacing: .4px; padding: 3px 8px; border-radius: 999px; background: #E9F7EF; color: var(--ok); }
.chip.you { background: var(--approxi); color: var(--approxi-dark); }
.chip.phone { background: #EEF2F7; color: #1E3A5F; }
.lead-detail { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 14px; font-size: 14px; }
.lead-detail dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; }
@media (max-width: 640px) { .lead-detail dl { grid-template-columns: minmax(0, 1fr); } }
.lead-detail dt { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.lead-detail dd { margin: 0; overflow-wrap: anywhere; }
.lead-detail .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lead-detail .actions .btn { min-height: 44px; font-size: 15px; padding: 10px 16px; }
.btn-brand { background: var(--brand); color: var(--brand-text); }
.empty { padding: 28px 18px; text-align: center; color: var(--ink-3); font-size: 15px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.box { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.copyrow { display: flex; gap: 8px; align-items: stretch; }
.copyrow input, .copyrow textarea { flex: 1; min-width: 0; border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 12px; font: 600 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: #FAFAF8; color: var(--ink); resize: none; }
.copyrow .btn { min-height: 44px; font-size: 14px; padding: 8px 14px; }
.qr { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.qr-code { width: 168px; height: 168px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; display: grid; place-items: center; }
.qr-code img, .qr-code canvas { width: 148px !important; height: 148px !important; }
.qr p { margin: 0; font-size: 14px; color: var(--ink-2); max-width: 260px; }
.prices { width: 100%; border-collapse: collapse; font-size: 14px; }
.prices th, .prices td { text-align: left; padding: 12px 18px; border-bottom: 1px solid #EEEFEB; vertical-align: top; }
.prices th { font-weight: 700; color: var(--ink-2); }
.prices td { font-variant-numeric: tabular-nums; }
.prices tr:last-child th, .prices tr:last-child td { border-bottom: 0; }
.hint { font-size: 13px; color: var(--ink-3); margin: 0; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; z-index: 50; }

/* Floating demo bar (closeable) */
body.has-demo-bar { padding-bottom: 92px; }
.demo-bar { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: max-content; max-width: calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; background: rgba(11,59,38,.96); color: #E7F1EB; border-radius: 18px; box-shadow: 0 18px 40px rgba(0,0,0,.28); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: barIn .4s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes barIn { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
.db-tag { font-size: 11px; font-weight: 800; letter-spacing: .7px; color: var(--approxi); }
.db-switch { display: flex; gap: 3px; background: rgba(255,255,255,.1); padding: 3px; border-radius: 13px; min-width: 0; }
.db-switch a { min-height: 40px; display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 10px; color: #CFE3D7; font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; }
.db-switch a:hover { color: #fff; }
.db-switch a[aria-current="page"] { background: #fff; color: var(--approxi-dark); }
.db-close { width: 40px; height: 40px; flex: none; border: 0; border-radius: 12px; background: transparent; color: #CFE3D7; cursor: pointer; display: grid; place-items: center; }
.db-close:hover { background: rgba(255,255,255,.12); color: #fff; }
.db-close svg { width: 18px; height: 18px; }
.demo-reopen { position: fixed; z-index: 60; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: 48px; height: 48px; border: 0; padding: 0; border-radius: 14px; background: none; cursor: pointer; box-shadow: 0 10px 24px rgba(0,0,0,.22); }
.demo-reopen svg, .demo-reopen img { width: 48px; height: 48px; display: block; }
@media (max-width: 420px) { .db-switch a { padding: 6px 9px; font-size: 13px; } .db-tag { display: none; } .demo-bar { padding-left: 6px; } }

/* Logo in the badge */
.pp-badge.has-logo { background: #fff; padding: 4px; overflow: hidden; }
.pp-badge.has-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Branding tab */
.logo-row { display: flex; align-items: center; gap: 14px; }
.logo-current { width: 72px !important; height: 72px !important; border-radius: 18px !important; font-size: 24px !important; }
.upload { min-height: 44px; font-size: 15px; padding: 8px 16px; cursor: pointer; }
.color-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; align-items: center; max-width: 280px; }
.color-row input[type="color"] { width: 56px; height: 48px; border: 1px solid var(--line-2); border-radius: 12px; padding: 4px; background: #fff; cursor: pointer; }
.color-row .num { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.brand-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.brand-actions .btn { min-height: 44px; font-size: 15px; padding: 10px 18px; }
.mini { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; }
.mini-head { background: var(--brand); color: var(--brand-text); padding: 16px; display: flex; gap: 12px; align-items: center; }
.mini-name { font: 800 18px/1.2 var(--display); }
.mini-meta { font-size: 13px; opacity: .85; }
.mini-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.mini-q { height: 44px; border-radius: 12px; background: var(--soft); }
.mini-q.short { width: 60%; }
.mini-body .btn { min-height: 46px; font-size: 15px; cursor: default; }

/* Price builder */
.builder { padding: 4px 18px 8px; }
.bsec { padding: 18px 0; border-bottom: 1px solid #EEEFEB; display: flex; flex-direction: column; gap: 12px; }
.bsec:last-child { border-bottom: 0; }
.bsec h3 { margin: 0; font: 800 16px/1.2 var(--display); }
.bgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 10px; }
.bl { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bl > span { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.bl .num { min-height: 44px; padding: 9px 11px; font-size: 15px; }
select.num { appearance: auto; }
.lohi { display: grid; grid-template-columns: repeat(2, minmax(0, 140px)); gap: 10px; }
.qcard { border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #FCFCFA; }
.qtop { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.kind { align-self: center; font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; background: var(--soft); color: var(--brand); white-space: nowrap; }
.optrow { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.feerow { display: grid; grid-template-columns: auto minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.minrow { grid-template-columns: auto minmax(0, 160px); align-items: center; margin-top: 6px; }
@media (max-width: 560px) {
  .optrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; } .optrow > .bl:first-child { grid-column: 1 / -1; }
  .feerow { grid-template-columns: auto minmax(0, 1fr) auto; } .feerow > .bl:nth-of-type(n+2) { grid-column: span 1; }
  .qtop { grid-template-columns: minmax(0, 1fr) auto; } .qtop .kind { grid-column: 1 / -1; justify-self: start; }
}
.iconbtn { width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; font: 700 20px/1 var(--body); color: var(--ink-3); cursor: pointer; }
.iconbtn:hover:not([disabled]) { color: var(--error); border-color: var(--error); }
.iconbtn[disabled] { opacity: .35; cursor: not-allowed; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); min-height: 44px; cursor: pointer; }
.chk input { width: 20px; height: 20px; accent-color: var(--brand); }
.addbtn { align-self: flex-start; text-decoration: none; color: var(--brand); }
.addrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.btn.sm { min-height: 40px; font-size: 14px; padding: 8px 12px; }
.btest { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; background: var(--soft); border-top: 1px solid var(--line); }
body.has-demo-bar .btest { bottom: 0; }
.btest .bt-l { display: block; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.btest b { font: 800 22px/1.2 var(--display); font-variant-numeric: tabular-nums; }
.btest small { display: block; font-size: 12px; color: var(--ink-3); max-width: 46ch; }
.bt-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bt-actions .btn { min-height: 44px; font-size: 15px; padding: 10px 18px; }
@media (max-width: 560px) {
  .feerow:not(.minrow) { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto; grid-template-areas: "c l l x" ". a b ."; }
  .feerow:not(.minrow) > :nth-child(1) { grid-area: c; }
  .feerow:not(.minrow) > :nth-child(2) { grid-area: l; }
  .feerow:not(.minrow) > :nth-child(3) { grid-area: a; }
  .feerow:not(.minrow) > :nth-child(4) { grid-area: b; }
  .feerow:not(.minrow) > :nth-child(5) { grid-area: x; }
}

/* Company tab */
.ctitle { margin: 6px 0 0; font: 800 15px/1.2 var(--display); padding-top: 12px; border-top: 1px solid #EEEFEB; }
.box > .ctitle:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.areas { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.areas li { display: inline-flex; align-items: center; gap: 4px; background: var(--soft); color: var(--ink); border-radius: 999px; padding: 4px 4px 4px 12px; font-size: 14px; font-weight: 700; }
.areas li.none { background: none; padding: 0; color: var(--ink-3); font-weight: 600; }
.areas button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); font: 700 18px/1 var(--body); cursor: pointer; }
.areas button:hover { background: #fff; color: var(--error); }

#area-new { font: 600 16px var(--body); background: #fff; }

/* Automatic follow-up */
.fu-panel { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; border-color: #BFEFD3; background: linear-gradient(180deg, #F2FCF6, #fff); }
.fu-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; }
.fu-copy { min-width: 0; flex: 1 1 280px; }
.fu-copy h2 { margin: 0 0 4px; font: 800 18px/1.2 var(--display); }
.fu-copy p { margin: 0; font-size: 14px; color: var(--ink-2); max-width: 44rem; }
.fu-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.fu-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; }
.fu-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fu-switch span { width: 46px; height: 28px; border-radius: 999px; background: #C9CCC6; position: relative; transition: background .2s; flex: none; }
.fu-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.fu-switch input:checked + span { background: #0A9F4E; }
.fu-switch input:checked + span::after { transform: translateX(18px); }
.fu-switch input:focus-visible + span { outline: 3px solid #0A9F4E; outline-offset: 2px; }
.fu-days { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.fu-days select { width: auto; min-height: 44px; }
.fu-stat { margin: 0; font-size: 13px; font-weight: 700; color: #0A7A3E; }
.chip.fu.soon { background: #FFF4DE; color: #8A5A00; }
.chip.fu.sent { background: #E9F7EF; color: #0A7A3E; }
.chip.fu.booked { background: #0B3B26; color: #fff; }
@media (prefers-reduced-motion: reduce) { .fu-switch span, .fu-switch span::after { transition: none; } }

/* QR sticker download */
.sticker { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.sticker-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.sticker-btns .btn { min-height: 44px; font-size: 14px; padding: 8px 14px; width: auto; }

/* Demo bar: back to the home page */
.db-home { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 10px 0 6px; border-radius: 999px; color: #E7F1EB; text-decoration: none; font-weight: 700; font-size: 14px; }
.db-home:hover { background: rgba(255,255,255,.12); color: #fff; }
.db-home svg { width: 18px; height: 18px; }
@media (max-width: 520px) { .db-home span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .db-home { padding: 0 8px; } }
.db-short { display: none; }
@media (max-width: 440px) { .db-long { display: none; } .db-short { display: inline; } }

/* Lead stages */
.lead-filter { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.lead-filter button { font: inherit; font-size: 14px; font-weight: 700; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); cursor: pointer; }
.lead-filter button span { display: inline-block; min-width: 20px; margin-left: 4px; padding: 1px 6px; border-radius: 999px; background: #F0F1ED; font-size: 12px; color: var(--ink-2); }
.lead-filter button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-text); }
.lead-filter button[aria-pressed="true"] span { background: rgba(255,255,255,.22); color: inherit; }
.lead-empty { padding: 28px 18px; text-align: center; color: var(--ink-3); font-size: 14px; }
.move { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid #EEEFEB; }
.move-l { font-size: 12px; font-weight: 700; color: var(--ink-3); margin-right: 4px; }
.move button { font: inherit; font-size: 14px; font-weight: 700; min-height: 40px; padding: 6px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); cursor: pointer; }
.move button[aria-pressed="true"] { background: #16181B; border-color: #16181B; color: #fff; }
.move button[data-stage="booked"][aria-pressed="true"] { background: #0B3B26; border-color: #0B3B26; }
.move button[data-stage="lost"][aria-pressed="true"] { background: #8A2A1E; border-color: #8A2A1E; }
.chip.fu.lost { background: #FBE9E6; color: #8A2A1E; }
.lead.stage-lost .l-name, .lead.stage-lost .l-price, .lead.stage-lost .l-job { opacity: .6; }
@media (max-width: 440px) { .lead-filter { gap: 4px; padding: 10px 12px; } .lead-filter button { padding: 6px 9px; font-size: 13px; } .lead-filter button span { margin-left: 2px; padding: 1px 5px; } }

/* Edit the follow-up email */
.fu-edit { border-top: 1px solid #CDEEDB; padding-top: 10px; }
.fu-edit summary { cursor: pointer; font-weight: 800; font-size: 15px; color: #0A7A3E; min-height: 40px; display: flex; align-items: center; gap: 8px; list-style: none; }
.fu-edit summary::-webkit-details-marker { display: none; }
.fu-edit summary::before { content: "+"; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #0A9F4E; color: #fff; font-size: 16px; line-height: 1; }
.fu-edit[open] summary::before { content: "\2212"; }
.fu-edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; padding-top: 10px; }
@media (max-width: 860px) { .fu-edit-grid { grid-template-columns: minmax(0, 1fr); } }
.fu-fields { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fu-fields textarea { resize: vertical; min-height: 180px; font: inherit; line-height: 1.5; }
.fu-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); font-weight: 700; }
.fu-tags button { font: inherit; font-size: 13px; min-height: 36px; padding: 4px 10px; border-radius: 999px; border: 1px dashed #0A9F4E; background: #fff; color: #0A7A3E; cursor: pointer; }
.fu-tags button:hover { background: #F2FCF6; }
.fu-preview { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fu-mail { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.fu-mail-subj { padding: 14px 16px; background: var(--brand); color: var(--brand-text); font-weight: 800; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.fu-mail-body { padding: 14px 16px 4px; font-size: 14px; line-height: 1.55; color: var(--ink-2); overflow-wrap: anywhere; }
.fu-mail-body p { margin: 0 0 10px; }
.fu-mail-sig { padding: 0 16px 16px; font-size: 14px; color: var(--ink); }

/* Demo bar: Get started */
.db-cta { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; background: var(--approxi); color: var(--approxi-dark); font-weight: 800; font-size: 14px; text-decoration: none; white-space: nowrap; }
.db-cta:hover { filter: brightness(1.06); color: var(--approxi-dark); }
@media (max-width: 440px) { .db-cta { padding: 0 12px; font-size: 13px; } .demo-bar { gap: 4px; } .db-switch a { padding: 6px 8px; } }

/* Plan tab */
.plan-card { background: var(--soft); border-radius: 14px; padding: 16px 18px; }
.plan-badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .6px; padding: 3px 9px; border-radius: 999px; background: var(--brand); color: var(--brand-text); }
.plan-price { display: block; font: 800 34px/1.1 var(--display); margin: 8px 0 4px; }
.plan-price small { font-size: 16px; font-weight: 700; color: var(--ink-3); }
.plan-card p { margin: 0; font-size: 14px; color: var(--ink-2); }
.plan-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); }
.tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
@media (max-width: 520px) { .tabs button { padding: 8px 11px; } }
.tabs button { white-space: nowrap; }
@media (max-width: 440px) {
  .demo-bar { padding-left: 4px; padding-right: 4px; }
  .db-home { padding: 0 4px; min-width: 32px; justify-content: center; }
  .db-switch a { padding: 6px 7px; font-size: 12.5px; }
  .db-cta { padding: 0 10px; font-size: 12.5px; }
  .db-close { width: 34px; }
}
@media (max-width: 440px) { .db-cta .db-long { display: inline; } .db-cta .db-short { display: none; } }
@media (max-width: 380px) { .db-cta .db-long { display: none; } .db-cta .db-short { display: inline; } }
@media (max-width: 420px) { .tabs { gap: 2px; } .tabs button { padding: 8px 9px; font-size: 13px; } }

/* Team invites */
.invite { display: flex; flex-direction: column; gap: 12px; }
.invite .btn { align-self: flex-start; width: auto; }
.team { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.team li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #EEEFEB; }
.t-av { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-text); font-weight: 800; font-size: 13px; }
.t-av.t-pending { background: #E6E7E3; color: var(--ink-2); }
.t-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.t-who b { font-size: 14px; overflow-wrap: anywhere; }
.t-who small { font-size: 12px; color: var(--ink-3); }

/* Emails tab */
#view-email { display: flex; flex-direction: column; gap: 20px; }
.em-grid, .fu-edit-wrap { padding: 18px; }
.em-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .em-grid { grid-template-columns: minmax(0, 1fr); } }
.em-fields { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.em-fields textarea { resize: vertical; font: inherit; line-height: 1.5; }
.em-toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
@media (max-width: 420px) { .em-toggles { grid-template-columns: minmax(0, 1fr); } }
.em-toggle b { font-size: 14px; }
.em-socials { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .em-socials { grid-template-columns: minmax(0, 1fr); } }
.em-preview { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.em-mail { background: #F3F4F1; border-radius: 16px; padding: 14px; }
.emp-head { border-radius: 14px 14px 0 0; padding: 16px 18px; }
.emp-row { display: flex; align-items: center; gap: 14px; }
.emp-logo { width: 64px; height: 64px; border-radius: 14px; flex: none; object-fit: contain; background: #fff; }
.emp-ini { display: grid; place-items: center; font: 800 22px var(--display); }
.emp-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.emp-name b { font: 800 19px/1.2 var(--display); overflow-wrap: anywhere; }
.emp-name span { font-size: 13px; opacity: .85; }
.emp-phone { text-align: right; flex: none; }
.emp-phone small { display: block; font-size: 11px; opacity: .8; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.emp-phone b { font: 800 18px/1.2 var(--display); white-space: nowrap; }
@media (max-width: 420px) { .emp-row { flex-wrap: wrap; } .emp-phone { text-align: left; width: 100%; } }
.emp-promise { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.2); font-size: 13px; opacity: .9; }
.emp-body { background: #fff; border-radius: 0 0 14px 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.emp-body h4 { margin: 0; font: 800 18px/1.25 var(--display); color: var(--ink); }
.emp-body p { margin: 0; }
.emp-est { border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.emp-est small { font-size: 11px; font-weight: 800; letter-spacing: .6px; }
.emp-est b { font: 800 24px/1.2 var(--display); color: var(--ink); }
.emp-est span { font-size: 13px; }
.emp-btn { align-self: flex-start; font-weight: 800; padding: 10px 16px; border-radius: 10px; font-size: 14px; }
.emp-sig { color: var(--ink); }
.emp-social { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.emp-social span { font-size: 12px; font-weight: 800; padding: 4px 10px; border: 1.5px solid; border-radius: 999px; }
.fu-mail-subjline { padding: 10px 14px; font-size: 13px; background: #fff; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.fu-mail-subjline small { color: var(--ink-3); font-weight: 700; margin-right: 4px; }
.fu-mail-subjline span { font-weight: 800; color: var(--ink); }
.fu-mail #fu-prev-head .emp-head { border-radius: 0; }
.fu-mail-social { padding: 0 16px 16px; }
.fu-mail-social .emp-social { padding-top: 10px; }
.fu-link { align-self: flex-start; background: none; border: 0; padding: 4px 0; font: inherit; font-size: 15px; font-weight: 800; color: #0A7A3E; cursor: pointer; min-height: 40px; }
.fu-link:hover { text-decoration: underline; }

/* Demo notice pop-up */
.dm-wrap { position: fixed; inset: 0; z-index: 200; background: rgba(11,24,18,.55); display: grid; place-items: center; padding: 16px; }
.dm { background: #fff; border-radius: 20px; padding: 24px; max-width: 420px; width: 100%; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 30px 60px rgba(0,0,0,.25); }
.dm-tag { align-self: flex-start; background: #0B3B26; color: #00EB65; font-size: 11px; font-weight: 800; letter-spacing: 1px; padding: 4px 10px; border-radius: 999px; }
.dm h2 { margin: 0; font: 800 22px/1.2 var(--display); }
.dm p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.dm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.dm-actions .btn { width: auto; min-height: 44px; }
.dm-actions .dm-go { background: var(--approxi); color: var(--approxi-dark); border-color: var(--approxi); }

.sticker-size { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sticker-size button { font: inherit; font-weight: 800; font-size: 15px; min-height: 52px; padding: 6px 8px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sticker-size button small { font-size: 11px; font-weight: 700; color: var(--ink-3); }
.sticker-size button[aria-pressed="true"] { border: 2px solid var(--brand); background: var(--soft); }

/* Send a test */
.test-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
@media (max-width: 640px) { .test-row { grid-template-columns: minmax(0, 1fr); } }
.test-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.test-btns .btn { width: auto; min-height: 48px; }
#test-msg.ok { color: #0A7A3E; }
#test-msg:empty { display: none; }

/* Sticker builder */
.sticker-panel { margin-top: 20px; }
.st-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 24px; padding: 18px; align-items: start; }
@media (max-width: 760px) { .st-grid { grid-template-columns: minmax(0, 1fr); } }
.st-fields { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.st-branded { display: flex; flex-direction: column; gap: 12px; }
.st-style { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.st-style button { font: inherit; font-weight: 800; font-size: 15px; min-height: 56px; padding: 8px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.st-style button small { font-size: 11px; font-weight: 700; color: var(--ink-3); }
.st-style button[aria-pressed="true"] { border: 2px solid var(--brand); background: var(--soft); }
.st-preview { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 8px; }
.st-stage { background: repeating-conic-gradient(#ECEDE9 0% 25%, #F6F6F3 0% 50%) 50% / 20px 20px; border-radius: 16px; padding: 22px; display: grid; place-items: center; }
.st-stage canvas { width: 100%; max-width: 240px; height: auto; box-shadow: 0 10px 30px rgba(0,0,0,.18); background: #fff; }
