
/* Layout: single phone-width column, sticky top bar, fixed bottom tab bar, bottom sheets for forms. */
:root{
  --bg:#EDF0F5; --surface:#FFFFFF; --surface-2:#F5F7FB; --ink:#131A27; --muted:#5A6477; --line:#D8DDE7;
  --accent:#1D3A9C; --accent-ink:#FFFFFF; --accent-soft:#E2E8FA;
  --hivis:#F2C200; --hivis-ink:#1B1600; --hivis-soft:#FFF3C2;
  --ok:#1B7A48; --ok-soft:#DDF1E5; --warn:#9A5800; --warn-soft:#FBEACF; --bad:#B42318; --bad-soft:#FBE2DF;
  --hazard-a:#F2C200; --hazard-b:#151515;
  --scrim:rgba(13,18,27,.45);
  --f-display:"Barlow Condensed","Arial Narrow","Roboto Condensed",sans-serif;
  --f-body:"Source Sans 3","Segoe UI",system-ui,-apple-system,sans-serif;
  --f-mono:"IBM Plex Mono",ui-monospace,"SFMono-Regular",Menlo,monospace;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#0C111A; --surface:#141B28; --surface-2:#1A2232; --ink:#E6EAF2; --muted:#9AA4B7; --line:#273148;
  --accent:#8DA5FF; --accent-ink:#0C111A; --accent-soft:#1D2950;
  --hivis-soft:#3A3110; --ok:#5BCF8E; --ok-soft:#14352A; --warn:#F0B35A; --warn-soft:#3A2A12; --bad:#FF8B80; --bad-soft:#3D1A18;
  --scrim:rgba(0,0,0,.6); color-scheme:dark;
}}
:root[data-theme="dark"]{
  --bg:#0C111A; --surface:#141B28; --surface-2:#1A2232; --ink:#E6EAF2; --muted:#9AA4B7; --line:#273148;
  --accent:#8DA5FF; --accent-ink:#0C111A; --accent-soft:#1D2950;
  --hivis-soft:#3A3110; --ok:#5BCF8E; --ok-soft:#14352A; --warn:#F0B35A; --warn-soft:#3A2A12; --bad:#FF8B80; --bad-soft:#3D1A18;
  --scrim:rgba(0,0,0,.6); color-scheme:dark;
}
*{box-sizing:border-box}
html,body{height:100%}
body{background:var(--bg);color:var(--ink);font-family:var(--f-body);font-size:16px;line-height:1.45;-webkit-font-smoothing:antialiased}
body::before{content:"";position:fixed;inset:0 0 auto;height:env(safe-area-inset-top,0px);z-index:30;background:var(--surface)}
body.noscroll{overflow:hidden}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.gut{padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
.mono{font-family:var(--f-mono);font-size:.92em;letter-spacing:-.01em}
.num,.amt,.clock,.totals,.doc-tbl{font-variant-numeric:tabular-nums}

/* type */
.h1{font-family:var(--f-display);font-weight:700;font-size:2rem;line-height:1.05;letter-spacing:.01em;margin:0;text-wrap:balance}
.h2{font-family:var(--f-display);font-weight:700;font-size:1.45rem;line-height:1.1;margin:0;letter-spacing:.01em}
.label{font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.09em;color:var(--muted);margin:0}
.eyebrow{font-size:.85rem;color:var(--muted);margin:0 0 4px;font-weight:600}
.fine{font-size:.85rem;color:var(--muted);margin:0}
.center{text-align:center}
.opt{font-weight:400;color:var(--muted);font-size:.85rem}

/* top bar */
.top{position:sticky;top:env(safe-area-inset-top,0px);z-index:20;background:var(--surface);border-bottom:1px solid var(--line)}
.top-in{max-width:560px;margin:0 auto;display:flex;align-items:center;gap:10px;height:56px}
.logo{font-family:var(--f-display);font-weight:700;font-size:1.5rem;letter-spacing:.04em;text-transform:uppercase}
.sp{flex:1}
.chip{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:3px 10px;font-size:.78rem;font-weight:700;letter-spacing:.04em;border:0}
.chip.pro{background:var(--hivis);color:var(--hivis-ink)}
.chip.free{background:var(--accent-soft);color:var(--accent)}
.lang{border:1px solid var(--line);background:var(--surface-2);border-radius:8px;padding:4px 10px;font-weight:700;font-size:.85rem}

main{max-width:560px;margin:0 auto;padding-block:18px calc(100px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:22px}
section{display:flex;flex-direction:column;gap:10px}
.sec-h{display:flex;align-items:baseline;justify-content:space-between;gap:12px}

/* bottom nav */
.nav{position:fixed;left:0;right:0;bottom:0;z-index:20;background:var(--surface);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom,0px)}
.nav-in{max-width:560px;margin:0 auto;display:grid;grid-template-columns:repeat(5,1fr)}
.tab{display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 2px 9px;border:0;background:none;color:var(--muted);font-size:.72rem;font-weight:600;min-width:0}
.tab svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.tab[aria-current="page"]{color:var(--accent)}
.tab span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:10px 16px;border-radius:12px;border:1px solid var(--line);background:var(--surface);font-weight:700;font-size:1rem;text-decoration:none}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.btn.hivis{background:var(--hivis);border-color:var(--hivis);color:var(--hivis-ink)}
.btn.ghost{background:transparent;border-color:transparent;color:var(--accent)}
.btn.danger-ghost{background:transparent;border-color:transparent;color:var(--bad)}
.btn.block{width:100%}
.btn:disabled{opacity:.5;cursor:not-allowed}
.link{border:0;background:none;color:var(--accent);font-weight:700;padding:4px 0;font-size:.95rem}
.link.sm{font-size:.85rem}
.back{border:0;background:none;color:var(--accent);font-weight:700;padding:0;align-self:flex-start;font-size:.95rem}
.quick{display:grid;grid-template-columns:1fr 1fr;gap:10px}

/* cards & lists */
.card{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:16px}
.list{background:var(--surface);border:1px solid var(--line);border-radius:14px;overflow:hidden}
.row{display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:13px 14px;background:none;border:0;border-bottom:1px solid var(--line)}
.list>:last-child{border-bottom:0}
.row:hover{background:var(--surface-2)}
.when{display:flex;flex-direction:column;align-items:flex-start;width:64px;flex:none}
.when .t{font-family:var(--f-display);font-weight:700;font-size:1.2rem;line-height:1}
.when .d{font-size:.78rem;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
.what{display:flex;flex-direction:column;min-width:0;flex:1}
.ttl{font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sub{font-size:.88rem;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.right{display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex:none}
.amt{font-weight:700}
.pill{display:inline-block;flex:none;border-radius:999px;padding:2px 9px;font-size:.75rem;font-weight:700;white-space:nowrap}
.p-planned,.p-sent{background:var(--accent-soft);color:var(--accent)}
.p-progress{background:var(--hivis-soft);color:var(--warn)}
.p-done,.p-accepted,.p-paid,.p-ok{background:var(--ok-soft);color:var(--ok)}
.p-draft,.p-muted{background:var(--surface-2);color:var(--muted);border:1px solid var(--line)}
.p-unpaid{background:var(--warn-soft);color:var(--warn)}
.empty{padding:18px;border:1px dashed var(--line);border-radius:14px;color:var(--muted);text-align:center}
.note{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap;background:var(--hivis-soft);border-radius:12px;padding:10px 14px;font-size:.9rem}

/* home stats */
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.stat{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:12px;min-width:0;font-size:.8rem;color:var(--muted);font-weight:600}
.stat .num{font-family:var(--f-display);font-weight:700;font-size:1.55rem;line-height:1;color:var(--ink);white-space:nowrap}
.lock{font-family:var(--f-body);font-size:.75rem;background:var(--hivis);color:var(--hivis-ink);padding:2px 8px;border-radius:999px;vertical-align:middle}

/* segmented */
.seg{display:grid;gap:4px;background:var(--surface-2);border:1px solid var(--line);border-radius:12px;padding:4px}
.seg2{grid-template-columns:1fr 1fr}.seg3{grid-template-columns:repeat(3,1fr)}.seg4{grid-template-columns:repeat(4,1fr)}
.seg button,.seg label{border:0;background:none;border-radius:9px;padding:9px 4px;font-weight:700;font-size:.88rem;color:var(--muted);text-align:center;min-width:0;cursor:pointer}
.seg .on,.seg input:checked+label{background:var(--surface);color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.12)}
.seg input{position:absolute;opacity:0;pointer-events:none}
.seg input:focus-visible+label{outline:2px solid var(--accent)}

/* meter */
.meter{display:flex;flex-direction:column;gap:6px;font-size:.85rem;color:var(--muted)}
.bar{height:8px;border-radius:99px;background:var(--surface-2);border:1px solid var(--line);overflow:hidden}
.bar i{display:block;height:100%;background:var(--accent);border-radius:99px}
.bar.full i{background:var(--warn)}

/* job detail */
.client{margin:8px 0 0;line-height:1.5}
.timer{display:flex;align-items:center;justify-content:space-between;gap:12px}
.timer.running{border-color:var(--hivis);box-shadow:inset 4px 0 0 var(--hivis)}
.clock{font-family:var(--f-display);font-weight:700;font-size:2.3rem;line-height:1;margin:4px 0 0}
.check{display:flex;gap:12px;align-items:center;width:100%;text-align:left;padding:12px 14px;background:none;border:0;border-bottom:1px solid var(--line)}
.check .box{width:22px;height:22px;border-radius:6px;border:2px solid var(--line);flex:none;display:grid;place-items:center}
.check.done .box{background:var(--ok);border-color:var(--ok)}
.check.done .box::after{content:"";width:6px;height:11px;border:solid var(--surface);border-width:0 2.5px 2.5px 0;transform:rotate(45deg) translate(-1px,-1px)}
.check.done span:last-child{color:var(--muted);text-decoration:line-through}
.count{font-weight:600;letter-spacing:0;color:var(--muted)}
.photos{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.ph{position:relative;margin:0;aspect-ratio:1;max-width:100%;border-radius:10px;overflow:hidden;border:1px solid var(--line)}
.ph img{width:100%;height:100%;object-fit:cover;display:block}
.ph-x{position:absolute;top:4px;right:4px;width:26px;height:26px;border-radius:50%;border:0;background:var(--scrim);color:#fff;font-size:1rem;line-height:1}
.ph-add{aspect-ratio:1;border-radius:10px;border:1.5px dashed var(--line);background:var(--surface);color:var(--accent);font-size:1.6rem;font-weight:700;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1}
.ph-add span{font-size:.75rem;margin-top:4px}
textarea,input,select{width:100%;border:1px solid var(--line);background:var(--surface);border-radius:10px;padding:11px 12px;font-size:16px}
textarea{resize:vertical}
input:focus,select:focus,textarea:focus{border-color:var(--accent);outline:none;box-shadow:0 0 0 3px var(--accent-soft)}
.sig img{display:block;width:100%;max-width:100%;border-radius:8px;border:1px solid var(--line);margin-bottom:8px}
.sigpad{width:100%;height:190px;border-radius:12px;border:1px solid var(--line);touch-action:none;display:block;background:#fff}
.actions{display:flex;flex-direction:column;gap:6px}

/* forms */
.form{display:flex;flex-direction:column;gap:6px}
.form label,.form legend{font-weight:700;font-size:.92rem;margin-top:8px}
.form fieldset{border:0;padding:0;margin:0;display:flex;flex-direction:column;gap:6px}
.form .btn{margin-top:10px}
.two{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.two>div{display:flex;flex-direction:column;gap:6px;min-width:0}
.err{color:var(--bad);font-weight:600;font-size:.9rem;margin:6px 0 0}
.checkline{display:flex;gap:10px;align-items:center;font-weight:600;margin-top:8px}
.checkline input{width:20px;height:20px;flex:none}

/* quote editor */
.line{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;padding:12px;border-bottom:1px solid var(--line);align-items:end}
.line .d{grid-column:1/-1}
.line .f{display:flex;flex-direction:column;gap:4px;min-width:0}
.line .f span{font-size:.75rem;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.line .lt{font-weight:700;padding-bottom:12px;text-align:right;min-width:84px}
.line .x{border:0;background:none;color:var(--bad);font-weight:700;font-size:.85rem;grid-column:1/-1;justify-self:start;padding:0}
.totals{display:flex;flex-direction:column;gap:6px;padding:14px 16px}
.totals>div{display:flex;justify-content:space-between;gap:12px}
.totals .grand{border-top:1px solid var(--line);padding-top:8px;margin-top:2px;font-weight:700;font-size:1.15rem}

/* locked + plan */
.locked{display:flex;flex-direction:column;gap:10px;border-style:dashed}
.locked h3{margin:0;font-size:1.05rem}
.locked p{margin:0;color:var(--muted)}
.lk-h{display:flex;align-items:center;gap:10px}
.cmp{width:100%;border-collapse:collapse;font-size:.92rem}
.cmp th,.cmp td{padding:9px 6px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
.cmp th:not(:first-child),.cmp td:not(:first-child){text-align:center;width:24%}
.cmp thead th{font-size:.78rem;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}
.cmp .yes{color:var(--ok);font-weight:700}.cmp .no{color:var(--muted)}
.price{font-family:var(--f-display);font-weight:700;font-size:2.4rem;line-height:1}
.price small{font-family:var(--f-body);font-size:.95rem;font-weight:600;color:var(--muted)}
.lic-num{font-family:var(--f-mono);font-size:1.35rem;margin:4px 0 2px;letter-spacing:.02em}
.ce-top{display:flex;align-items:baseline;justify-content:space-between;gap:10px;flex-wrap:wrap}
.ce-hrs{font-family:var(--f-display);font-weight:700;font-size:1.8rem;line-height:1}
.ce-hrs small{font-family:var(--f-body);font-size:.95rem;color:var(--muted);font-weight:600}
.road{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.road li{display:grid;grid-template-columns:62px 1fr;gap:10px;padding:11px 0;border-bottom:1px solid var(--line)}
.road li:last-child{border-bottom:0}
.road b{display:block}
.road .tag{font-family:var(--f-display);font-weight:700;font-size:1.05rem;color:var(--muted)}
.road .now .tag{color:var(--accent)}
.road p{margin:2px 0 0;font-size:.9rem;color:var(--muted)}

/* sheet */
.scrim{position:fixed;inset:0;background:var(--scrim);z-index:40;animation:fade .18s ease-out}
.sheet{position:fixed;left:50%;bottom:0;transform:translateX(-50%);width:min(560px,100%);max-height:90dvh;overflow:auto;z-index:41;background:var(--surface);border-radius:18px 18px 0 0;padding-top:8px;padding-bottom:calc(22px + env(safe-area-inset-bottom,0px));padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));animation:up .22s ease-out;display:flex;flex-direction:column;gap:10px}
.grab{width:40px;height:5px;border-radius:9px;background:var(--line);margin:0 auto 6px;flex:none}
.benefits{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:6px}
.sum{display:flex;flex-direction:column;gap:6px;background:var(--surface-2);border-radius:12px;padding:14px}
.sum>div{display:flex;justify-content:space-between;gap:10px}
.sum .grand{border-top:1px solid var(--line);padding-top:8px;font-weight:700}
.copybox{min-height:200px;font-family:var(--f-mono);font-size:13px}
@keyframes up{from{transform:translate(-50%,24px);opacity:.6}to{transform:translate(-50%,0);opacity:1}}
@keyframes fade{from{opacity:0}to{opacity:1}}

/* document preview (paper) */
.doc{background:var(--surface-2);border:1px solid var(--line);border-radius:12px;padding:16px;font-size:.9rem;display:flex;flex-direction:column;gap:14px}
.doc-h{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
.doc-t{display:flex;flex-direction:column;align-items:flex-end;text-align:right}
.doc-t .k{font-family:var(--f-display);font-weight:700;font-size:1.3rem;text-transform:uppercase;letter-spacing:.05em}
.doc-wrap{overflow-x:auto}
.doc-tbl{width:100%;border-collapse:collapse;min-width:300px}
.doc-tbl th,.doc-tbl td{padding:6px 4px;border-bottom:1px solid var(--line);text-align:right}
.doc-tbl th:first-child,.doc-tbl td:first-child{text-align:left}
.doc-tbl th{font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}

/* onboarding */
.onb{max-width:560px;margin:0 auto;padding-block:18px 40px;display:flex;flex-direction:column;gap:18px}
.onb-top{display:flex;justify-content:flex-end}
.brand-word{font-family:var(--f-display);font-weight:700;font-size:clamp(3.6rem,17vw,5.2rem);line-height:.85;text-transform:uppercase;letter-spacing:.02em}
.hazard{height:12px;margin:12px 0 14px;border-radius:2px;background:repeating-linear-gradient(-45deg,var(--hazard-a) 0 12px,var(--hazard-b) 12px 24px);max-width:260px}
.lead{font-size:1.15rem;margin:0;max-width:30em;text-wrap:balance}
.feat{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.feat li{padding-left:14px;border-left:3px solid var(--hivis);font-size:.97rem}
.feat b{display:block}

#toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(84px + env(safe-area-inset-bottom,0px));z-index:60;background:var(--ink);color:var(--bg);padding:10px 16px;border-radius:10px;font-weight:600;font-size:.92rem;max-width:calc(100% - 32px);text-align:center}

@media (prefers-reduced-motion: reduce){*{animation:none!important;transition:none!important}}
@media (max-width:380px){.stats{grid-template-columns:1fr 1fr}.stats .stat:last-child{grid-column:1/-1}.photos{grid-template-columns:repeat(3,1fr)}}

/* ── Production additions ───────────────────────────────── */
a{color:var(--accent)}
a.row,a.tab,a.stat,a.btn,a.logo{text-decoration:none;color:inherit}
a.btn.primary{color:var(--accent-ink)}
a.logo{color:var(--ink)}
.seg a{border-radius:9px;padding:9px 4px;font-weight:700;font-size:.88rem;color:var(--muted);text-align:center;text-decoration:none}
.seg a.on{background:var(--surface);color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.12)}
.boot{min-height:100%;max-width:560px;margin:0 auto;display:flex;flex-direction:column;justify-content:center;gap:12px;padding-block:40px}
.brand-word.sm{font-size:2.6rem}
.offline{background:var(--warn-soft);color:var(--warn);font-size:.88rem;font-weight:600;padding-block:8px;text-align:center}
.code-input{font-family:var(--f-mono);font-size:1.6rem;letter-spacing:.3em;text-align:center}
.steps{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:6px}
.stack{display:flex;flex-direction:column;gap:10px}
.stack-sm{display:flex;flex-direction:column;gap:6px}
.m0{margin:0}.mt8{margin-top:8px}
.flush{padding:0}
.pad-y-sm{padding-block:4px}
.row.static{cursor:default}
.row.static:hover{background:none}
.row.top-align{align-items:flex-start}
.ttl.wrap,.sub.wrap{white-space:normal}
.link.danger{color:var(--bad)}
.form label.first{margin-top:0}
.line .f label{font-size:.75rem;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;margin:0}
.add-line{padding:10px 14px}
.scroll-x{overflow-x:auto}
.warn-text{color:var(--warn);font-weight:600}
.p-late{background:var(--bad-soft);color:var(--bad)}
.ph-load{display:block;width:100%;height:100%;background:var(--surface-2)}
.ph-add{cursor:pointer}
.client a{color:inherit}
.client a.mono{color:var(--accent)}
.doc .totals{padding:0}

@media print{
  @page{margin:16mm}
  body{background:#fff;color:#000}
  body::before,#app,#toast,.no-print,.scrim{display:none!important}
  .sheet{position:static!important;transform:none!important;width:100%!important;max-height:none!important;overflow:visible!important;padding:0!important;animation:none!important;border-radius:0;background:#fff}
  .doc{background:#fff!important;border:0!important;padding:0!important;color:#000;font-size:11pt}
  .doc .fine,.doc .label,.doc-tbl th{color:#444!important}
  .doc-tbl th,.doc-tbl td,.totals .grand{border-color:#bbb!important}
}
.when{width:auto;min-width:60px}
.when .t{white-space:nowrap}
.tab span{font-size:.68rem;letter-spacing:-.01em}
