/* Cost Estimator web app — mirrors the iOS app (SnapGauge, AppTheme.swift): accent #2563EB, cards r14, grouped bg. */
:root{--accent:#2563EB;--accent-l:#3B82F6;--accent-s:#EAF1FE;--ok:#16A34A;--ok-s:#E8F6EE;--warn:#D97706;--warn-s:#FDF3E3;--bad:#DC2626;--bad-s:#FDECEC;
--bg:#F2F4F8;--card:#fff;--ink:#0F172A;--ink2:#475569;--muted:#94A3B8;--line:#E5E9F0;--r:14px;--tab-h:64px;--safe-b:env(safe-area-inset-bottom,0px)}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--ink);font-size:16px;line-height:1.45;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;border:0;background:none}
a{color:var(--accent);text-decoration:none}
img{max-width:100%;display:block}
.boot{min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:22px}.boot img{border-radius:18px}
.spin{width:28px;height:28px;border:3px solid var(--accent-s);border-top-color:var(--accent);border-radius:50%;animation:sp .8s linear infinite}
@keyframes sp{to{transform:rotate(360deg)}}

/* shell */
.shell{min-height:100vh}
.side{display:none}
.main{padding-bottom:calc(var(--tab-h) + var(--safe-b) + 12px)}
.page{max-width:760px;margin:0 auto;padding:12px 16px 24px}
.page.wide{max-width:1000px}
.topbar{position:sticky;top:0;z-index:20;background:rgba(242,244,248,.92);backdrop-filter:saturate(180%) blur(14px);-webkit-backdrop-filter:saturate(180%) blur(14px)}
.topbar-in{max-width:760px;margin:0 auto;display:flex;align-items:center;gap:8px;min-height:52px;padding:6px 16px}
.topbar .back{display:flex;align-items:center;gap:2px;color:var(--accent);font-weight:500;font-size:17px;padding:6px 8px 6px 0}
.topbar .t{flex:1;font-weight:700;font-size:17px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar .act{color:var(--accent);font-weight:600;font-size:16px;padding:6px 0 6px 8px;min-width:48px;text-align:right}
.big-title{font-size:32px;font-weight:800;letter-spacing:-.02em;margin:6px 0 14px}
.tabs{position:fixed;left:0;right:0;bottom:0;z-index:30;height:calc(var(--tab-h) + var(--safe-b));padding-bottom:var(--safe-b);background:rgba(255,255,255,.94);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-top:1px solid var(--line);display:flex}
.tabs a,.tabs button{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;color:var(--muted);font-size:11px;font-weight:600}
.tabs .on{color:var(--accent)}
.tabs svg{width:26px;height:26px}
.tabs .create svg{width:34px;height:34px;color:var(--accent)}
@media(min-width:1024px){
  .shell{display:grid;grid-template-columns:248px 1fr}
  .side{display:flex;flex-direction:column;gap:4px;position:sticky;top:0;height:100vh;padding:20px 14px;background:#fff;border-right:1px solid var(--line)}
  .side .brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:18px;padding:4px 10px 18px}.side .brand img{width:34px;height:34px;border-radius:9px}
  .side a{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:10px;color:var(--ink);font-weight:500;font-size:15px}
  .side a svg{width:20px;height:20px;color:var(--ink2)}
  .side a.on{background:var(--accent-s);color:var(--accent);font-weight:600}.side a.on svg{color:var(--accent)}
  .side .new{margin:8px 0 10px;justify-content:center;background:var(--accent);color:#fff;font-weight:700}.side .new svg{color:#fff}.side .new svg path{stroke:var(--accent)}
  .side .grow{flex:1}
  .side .who{font-size:13px;color:var(--ink2);padding:10px 12px;border-top:1px solid var(--line);word-break:break-all}
  .tabs{display:none}
  .main{padding-bottom:30px}
  .topbar{background:var(--bg)}
}

/* cards & lists */
.card{background:var(--card);border-radius:var(--r);padding:16px;margin-bottom:12px}
.card.p0{padding:0;overflow:hidden}
.sec-h{display:flex;align-items:center;justify-content:space-between;margin:22px 4px 8px;font-size:13px;font-weight:600;color:var(--ink2);text-transform:uppercase;letter-spacing:.04em}
.sec-h a,.sec-h button{text-transform:none;letter-spacing:0;font-size:15px;color:var(--accent);font-weight:600}
.row{display:flex;align-items:center;gap:12px;padding:13px 16px;border-bottom:1px solid var(--line);background:#fff;width:100%;text-align:left;color:inherit}
.row:last-child{border-bottom:0}
button.row:active,a.row:active{background:#F6F8FB}
.row .grow{flex:1;min-width:0}
.row .t1{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row .t2{font-size:13px;color:var(--ink2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row .amt{font-weight:700;white-space:nowrap}
.row .chev{color:#C3CBD8;font-size:20px}
.ic{width:40px;height:40px;border-radius:11px;display:grid;place-items:center;flex:none;background:var(--accent-s);color:var(--accent)}
.ic svg{width:22px;height:22px}
.pill{display:inline-flex;align-items:center;font-size:12px;font-weight:600;border-radius:20px;padding:2px 9px;white-space:nowrap}
.pill.gray{background:#EEF1F5;color:#64748B}.pill.blue{background:var(--accent-s);color:var(--accent)}.pill.orange{background:var(--warn-s);color:var(--warn)}
.pill.green{background:var(--ok-s);color:var(--ok)}.pill.purple{background:#F1EAFE;color:#7C3AED}.pill.red{background:var(--bad-s);color:var(--bad)}
.empty{text-align:center;padding:34px 18px;color:var(--ink2)}.empty b{display:block;color:var(--ink);font-size:17px;margin-bottom:4px}
.muted{color:var(--ink2)}.small{font-size:13px}.tiny{font-size:12px}.center{text-align:center}

/* buttons & forms */
.btn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:52px;border-radius:14px;background:var(--accent);color:#fff;font-weight:700;font-size:17px;padding:12px 18px}
.btn svg{width:20px;height:20px;flex:none}.btn.sm svg{width:17px;height:17px}
.btn:disabled{opacity:.5}
.btn.sec{background:var(--accent-s);color:var(--accent)}
.btn.ghost{background:#fff;color:var(--ink);border:1px solid var(--line)}
.btn.danger{background:var(--bad-s);color:var(--bad)}
.btn.sm{min-height:40px;font-size:15px;border-radius:11px;width:auto;padding:8px 14px}
.btns{display:flex;gap:10px}.btns>*{flex:1}
.field{display:block;margin-bottom:12px}
.field>span{display:block;font-size:13px;font-weight:600;color:var(--ink2);margin:0 4px 6px}
.input,select.input,textarea.input{width:100%;background:#fff;border:1px solid var(--line);border-radius:12px;padding:13px 14px;font-size:16px;outline:none}
.input:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(37,99,235,.12)}
textarea.input{resize:vertical;min-height:110px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.form-row{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--line);background:#fff}
.form-row:last-child{border-bottom:0}
.form-row label{flex:1;font-size:15px}
.form-row input,.form-row select{border:0;text-align:right;font-size:15px;outline:none;background:transparent;max-width:60%;color:var(--ink2)}
.toggle{position:relative;width:51px;height:31px;flex:none}.toggle input{opacity:0;width:0;height:0}
.toggle i{position:absolute;inset:0;background:#E2E8F0;border-radius:31px;transition:.2s}
.toggle i::after{content:"";position:absolute;width:27px;height:27px;left:2px;top:2px;background:#fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2);transition:.2s}
.toggle input:checked+i{background:var(--ok)}.toggle input:checked+i::after{transform:translateX(20px)}

/* dashboard */
.hello{display:flex;align-items:center;justify-content:space-between;margin:8px 2px 14px}
.hello h1{font-size:28px;font-weight:800;letter-spacing:-.02em}
.avatar{width:38px;height:38px;border-radius:50%;background:var(--accent-s);color:var(--accent);display:grid;place-items:center;font-weight:700}
.hero-new{display:flex;align-items:center;gap:14px;background:linear-gradient(135deg,#2563EB,#1E40AF);color:#fff;border-radius:18px;padding:18px;margin-bottom:12px;width:100%;text-align:left}
.hero-new .ic{background:rgba(255,255,255,.18);color:#fff;width:50px;height:50px;border-radius:14px}
.hero-new b{display:block;font-size:18px}.hero-new span{font-size:14px;opacity:.85}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:6px}
.stat{background:#fff;border-radius:var(--r);padding:12px}
.stat span{display:block;font-size:12px;color:var(--ink2);font-weight:500}.stat b{font-size:20px;letter-spacing:-.01em}
.check{color:var(--ink);display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--line);background:#fff;width:100%;text-align:left}
.check:last-child{border-bottom:0}
.check .dot{width:24px;height:24px;border-radius:50%;border:2px solid #CBD5E1;flex:none;display:grid;place-items:center;color:#fff;font-size:14px}
.check.done .dot{background:var(--ok);border-color:var(--ok)}.check.done .t1{text-decoration:line-through;color:var(--muted)}

/* wizard */
.steps{display:flex;gap:6px;margin:4px 0 16px}.steps i{flex:1;height:4px;border-radius:4px;background:#DCE3EE}.steps i.on{background:var(--accent)}
.w-title{font-size:26px;font-weight:800;letter-spacing:-.02em;margin-bottom:4px}
.w-sub{color:var(--ink2);margin-bottom:16px}
.photos{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:8px;margin-bottom:12px}
.photo{position:relative;aspect-ratio:1;border-radius:12px;overflow:hidden;background:#E2E8F0}
.photo img{width:100%;height:100%;object-fit:cover}
.photo button{position:absolute;top:4px;right:4px;width:24px;height:24px;border-radius:50%;background:rgba(15,23,42,.65);color:#fff;font-size:14px;line-height:1}
.snap{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border:2px dashed #BFD1F6;background:#F7FAFF;border-radius:16px;padding:26px 16px;color:var(--accent);width:100%;margin-bottom:12px}
.snap svg{width:44px;height:44px}
.snap b{font-size:18px;color:var(--ink)}.snap span{font-size:14px;color:var(--ink2)}
.methods{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:14px}
.method{position:relative;display:flex;flex-direction:column;align-items:center;gap:6px;background:#fff;border-radius:14px;padding:14px 6px;font-size:13px;font-weight:600}
.method svg{width:26px;height:26px;color:var(--accent)}
.method .new{position:absolute;top:6px;right:6px;background:var(--ok);color:#fff;font-size:9px;font-weight:800;border-radius:6px;padding:1px 5px}
.vin-chip{display:flex;align-items:center;gap:10px;background:var(--ok-s);color:#166534;border-radius:12px;padding:10px 12px;margin-bottom:12px;font-size:14px}
.vin-chip b{color:#14532D}
.bullets .bl{display:flex;align-items:center;gap:8px;padding:6px 10px;border-bottom:1px solid var(--line);background:#fff}
.bullets .bl:last-child{border-bottom:0}
.bullets .bl input{flex:1;border:0;outline:none;font-size:15px;padding:8px 0;background:transparent}
.bullets .bl button{color:var(--muted);font-size:20px;padding:4px 6px}
.analysis{background:#F8FAFC;border:1px solid var(--line);border-radius:12px;padding:12px 14px;font-size:14px;white-space:pre-wrap;color:var(--ink2);margin-bottom:12px}
.q-card{background:#fff;border-radius:16px;padding:18px}
.q-num{font-size:13px;font-weight:600;color:var(--accent);margin-bottom:6px}
.q-text{font-size:20px;font-weight:700;margin-bottom:14px;letter-spacing:-.01em}
.opt{display:flex;align-items:center;gap:12px;width:100%;text-align:left;background:#F6F8FB;border:2px solid transparent;border-radius:12px;padding:14px;margin-bottom:8px;font-weight:500}
.opt.on{border-color:var(--accent);background:var(--accent-s)}
.opt .o{width:22px;height:22px;border-radius:50%;border:2px solid #CBD5E1;flex:none}.opt.on .o{border:7px solid var(--accent)}
.scope-cat{font-size:13px;font-weight:700;color:var(--ink2);text-transform:uppercase;letter-spacing:.04em;margin:16px 4px 6px}
.scope-item{display:flex;align-items:center;gap:12px;padding:12px 14px;background:#fff;border-bottom:1px solid var(--line)}
.scope-item:last-child{border-bottom:0}
.scope-item.off .t1{color:var(--muted);text-decoration:line-through}
.scope-item .t1{flex:1;font-size:15px;font-weight:500}
.cbx{width:24px;height:24px;border-radius:7px;border:2px solid #CBD5E1;display:grid;place-items:center;flex:none;color:#fff;font-size:14px}
.cbx.on{background:var(--accent);border-color:var(--accent)}
.loading-box{text-align:center;padding:48px 16px}
.loading-box .spin{margin:0 auto 18px;width:40px;height:40px}
.loading-box b{display:block;font-size:19px;margin-bottom:6px}
.prog-list{max-width:360px;margin:16px auto 0;text-align:left}
.prog-list div{display:flex;align-items:center;gap:8px;padding:5px 0;font-size:14px;color:var(--ink2)}
.prog-list div::before{content:"✓";color:var(--ok);font-weight:800}
.prog-list div.cur::before{content:"•";color:var(--accent);animation:bl 1s infinite}
@keyframes bl{50%{opacity:.2}}

/* estimate */
.est-head{background:#fff;border-radius:16px;padding:18px;margin-bottom:12px}
.est-head .k{font-size:13px;color:var(--ink2);font-weight:600}
.est-total{font-size:38px;font-weight:800;letter-spacing:-.03em;margin:2px 0 4px}
.est-meta{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.sect{background:#fff;border-radius:var(--r);margin-bottom:12px;overflow:hidden}
.sect-h{display:flex;align-items:center;justify-content:space-between;padding:13px 16px;background:#F8FAFD;border-bottom:1px solid var(--line);font-weight:700}
.sect-h span{font-weight:700;color:var(--ink)}
.li{display:flex;align-items:flex-start;gap:10px;padding:11px 16px;border-bottom:1px solid var(--line);width:100%;text-align:left}
.li:last-child{border-bottom:0}
.li .grow{flex:1;min-width:0}
.li .d{font-weight:500;font-size:15px}
.li .m{font-size:12.5px;color:var(--ink2);margin-top:1px}
.li .p{font-weight:600;white-space:nowrap;font-size:15px}
.li .kind{font-size:10.5px;font-weight:700;border-radius:5px;padding:1px 5px;margin-right:6px;vertical-align:1px}
.kind.lab{background:var(--accent-s);color:var(--accent)}.kind.mat{background:#FEF3E2;color:#B45309}
.totals{background:#fff;border-radius:var(--r);padding:6px 16px;margin-bottom:12px}
.totals div{display:flex;justify-content:space-between;padding:9px 0;border-bottom:1px solid var(--line);font-size:15px}
.totals div:last-child{border-bottom:0}
.totals .gt{font-weight:800;font-size:18px}
.notes-list{font-size:14px;color:var(--ink2);padding-left:18px}.notes-list li{margin:4px 0}
.ups{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--line)}
.ups:last-child{border-bottom:0}
.ups .grow{flex:1}.ups .why{font-size:12.5px;color:var(--ink2)}
.actions-bar{position:sticky;bottom:calc(var(--tab-h) + var(--safe-b));padding:10px 0 4px;background:linear-gradient(transparent,var(--bg) 30%)}
@media(min-width:1024px){.actions-bar{bottom:0}}

/* modal / sheet */
.ov{position:fixed;inset:0;z-index:100;background:rgba(15,23,42,.45);display:flex;align-items:flex-end;justify-content:center;animation:fi .15s}
.sheet{background:var(--bg);width:100%;max-width:560px;max-height:92vh;overflow:auto;border-radius:20px 20px 0 0;padding:8px 16px calc(18px + var(--safe-b));animation:su .2s ease-out}
.sheet .grab{width:38px;height:5px;border-radius:3px;background:#CBD5E1;margin:4px auto 10px}
.sheet h3{font-size:20px;font-weight:800;margin:4px 2px 12px}
@media(min-width:700px){.ov{align-items:center}.sheet{border-radius:20px;padding-bottom:18px}}
@keyframes fi{from{opacity:0}}@keyframes su{from{transform:translateY(40px);opacity:.6}}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(var(--tab-h) + var(--safe-b) + 16px);z-index:200;background:#0F172A;color:#fff;padding:11px 16px;border-radius:12px;font-size:14px;font-weight:500;max-width:90vw;box-shadow:0 10px 30px rgba(0,0,0,.2)}
@media(min-width:1024px){.toast{bottom:24px}}
.err{background:var(--bad-s);color:#991B1B;border-radius:12px;padding:12px 14px;font-size:14px;margin-bottom:12px}

/* auth */
.auth{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px 16px}
.auth-box{width:100%;max-width:400px}
.auth-box .logo{display:flex;align-items:center;gap:12px;margin-bottom:26px}.auth-box .logo img{width:52px;height:52px;border-radius:13px}
.auth-box .logo b{font-size:20px}
.auth-box h1{font-size:28px;font-weight:800;letter-spacing:-.02em;margin-bottom:6px}
.code-in{letter-spacing:.5em;text-align:center;font-size:24px;font-weight:700}
.linkbtn{color:var(--accent);font-weight:600;padding:8px 0}

/* invoice */
.inv-line{display:grid;grid-template-columns:1fr 70px 90px 28px;gap:6px;align-items:center;padding:8px 12px;border-bottom:1px solid var(--line);background:#fff}
.inv-line input{border:1px solid var(--line);border-radius:8px;padding:8px;font-size:14px;width:100%;outline:none}
.inv-line button{color:var(--muted);font-size:20px}
.seg{display:flex;background:#E7EBF2;border-radius:10px;padding:3px;margin-bottom:12px;overflow-x:auto}
.seg button{flex:1;padding:7px 10px;border-radius:8px;font-size:14px;font-weight:600;color:var(--ink2);white-space:nowrap}
.seg button.on{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.1)}
.search{width:100%;background:#E7EBF2;border:0;border-radius:11px;padding:10px 14px;font-size:16px;outline:none;margin-bottom:12px}
.gate{max-width:440px;margin:60px auto;text-align:center;padding:0 16px}
.gate img{width:72px;height:72px;border-radius:18px;margin:0 auto 18px}
.gate h1{font-size:26px;font-weight:800;margin-bottom:8px}
.print-only{display:none}

/* ── Desktop (≥1024px): use the width instead of a stretched phone ── */
@media(min-width:1024px){
  .page{max-width:1120px;padding:28px 36px 40px}
  .topbar-in{max-width:1120px;padding:10px 36px}
  .hello h1{font-size:34px}
  .hero-new{padding:24px 26px}.hero-new b{font-size:21px}
  .stats{grid-template-columns:repeat(3,1fr);gap:14px}.stat{padding:18px}.stat b{font-size:26px}
  .dash-grid{display:grid;grid-template-columns:1.4fr 1fr;gap:22px;align-items:start}
  .dash-grid .sec-h:first-child{margin-top:4px}
  /* estimate: lines left, sticky summary right */
  .est-grid{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:22px;align-items:start}
  .est-side{position:sticky;top:20px;order:2}.est-main{order:1;min-width:0}
  .est-grid{grid-template-columns:minmax(0,1fr) 380px}
  .est-side .est-head{margin-bottom:12px}
  .actions-bar{position:static}
  /* wizard: centered focused column like a dialog */
  #w{max-width:720px}
  .photos{grid-template-columns:repeat(5,1fr)}
  .q-card{padding:26px}.q-text{font-size:22px}
  .opt{padding:16px}
  .sheet{max-width:620px}
  .row{padding:14px 20px}.li{padding:12px 20px}.sect-h{padding:14px 20px}
  .tabs{display:none}
}
@media(min-width:1400px){.page{max-width:1240px}}

.acct-banner{display:flex;gap:14px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin:12px 16px 0;padding:14px 16px;border-radius:14px;background:#fff7e6;border:1px solid #f5d38a}
.acct-banner b{display:block}.acct-banner span{font-size:14px;color:#6b5a2e}
.acct-banner .ab-act{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.acct-banner input{border:1px solid #e2d3a8;border-radius:10px;padding:9px 11px;font:15px inherit;min-width:190px}
