/* Proline Quote — phone-first styles. Breakpoints: 700px (tablet), 1000px (split view). */
:root{
  --accent:#111111; --accent-dark:#000000; --accent-soft:#f0f0f0;
  --ink:#000000; --bg:#f4f4f4; --card:#fff; --text:#1a1a1a; --muted:#666666; --line:#e4e4e4; --line-strong:#d0d0d0;
  --danger:#9b2226; --warn-bg:#f6f6f6; --warn-line:#cfcfcf;
  --radius:12px; --tap:48px;
  /* Capacitor 8 SystemBars injects --safe-area-inset-* on Android; iOS/browsers use env() */
  --sat:var(--safe-area-inset-top,env(safe-area-inset-top,0px)); --sab:var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px));
  --sal:var(--safe-area-inset-left,env(safe-area-inset-left,0px)); --sar:var(--safe-area-inset-right,env(safe-area-inset-right,0px));
  --topbar-h:56px; --bar-h:72px;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;max-width:100%}
/* Do not set overflow-x on html/body: on iOS Safari it makes position:fixed behave like absolute, so the save bar scrolls with the page. */
.layout{max-width:100%;overflow-x:hidden}
@supports (overflow:clip){.layout{overflow-x:clip}}
body{font:16px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;background:var(--bg);color:var(--text);-webkit-text-size-adjust:100%}
[hidden]{display:none!important}

/* ---------- Top bar ---------- */
.topbar{position:sticky;top:0;z-index:30;display:flex;align-items:center;gap:8px;
  padding:calc(8px + var(--sat)) calc(12px + var(--sar)) 8px calc(12px + var(--sal));
  min-height:calc(var(--topbar-h) + var(--sat));background:var(--ink);color:#fff}
.brand{display:flex;align-items:center;gap:10px;min-width:0;flex:1}
.logo{display:grid;place-items:center;width:36px;height:36px;border-radius:9px;background:var(--accent);color:#fff;font-weight:800;letter-spacing:.5px;flex:none}
.logo.big{width:72px;height:72px;font-size:1.6rem;border-radius:18px;margin:0 auto 12px}
.topbar h1{font-size:1.05rem;margin:0;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar .sub{font-weight:500;color:#c8c8c8}
.topbar .dash{color:#666666}
.topbar-actions{display:flex;align-items:center;gap:8px}
.proto-tag{display:none;font-size:.72rem;padding:3px 8px;border:1px solid #333333;border-radius:999px;color:#9a9a9a}
.icon-btn{background:none;border:0;color:#fff;font-size:2rem;line-height:1;width:44px;height:44px;margin-left:-6px;cursor:pointer;display:none}
#newQuoteBtn{display:none}
/* phone: hide title words to fit */
.topbar .dash,.topbar .sub{display:none}

/* ---------- Views / routing ---------- */
.layout{min-height:calc(100vh - var(--topbar-h))}
.list-view{padding:14px calc(14px + var(--sar)) calc(100px + var(--sab)) calc(14px + var(--sal))}
.editor-view{display:none}
body.route-editor .list-view{display:none}
body.route-editor .editor-view{display:block}
body.route-list .action-bar{display:none}
body.route-editor .icon-btn.back{display:block}
body.route-editor .brand .logo{display:none}
.editor-empty{display:none}

/* ---------- Home list ---------- */
.list-head h2{font-size:1.4rem;margin:4px 0 10px}
.quote-list li.ql-resume{border-color:var(--ink);background:#fff}
.ql-kicker{font-size:.7rem;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin:0 0 4px}
.quote-list{list-style:none;margin:12px 0 0;padding:0;display:flex;flex-direction:column;gap:10px}
.quote-list li{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px;cursor:pointer;min-height:var(--tap)}
.quote-list li:active{background:#fafafa}
.quote-list li.active{border-color:var(--accent);background:var(--accent-soft)}
.quote-list li.empty{background:none;border:1px dashed var(--line-strong);color:var(--muted);text-align:center;cursor:default}
.ql-top{display:flex;justify-content:space-between;align-items:center;gap:6px}
.ql-num{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.8rem;color:var(--muted)}
.ql-name{font-weight:700;font-size:1.05rem;margin:3px 0 2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ql-sub{font-size:.85rem;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ql-date{font-size:.75rem;color:#9a9a9a;margin-top:4px}
.status{font-size:.72rem;font-weight:700;padding:2px 9px;border-radius:999px;background:#f4f4f4;color:#333333}
.status.Sent{background:#f2f2f2;color:#333333}
.fab{position:fixed;right:calc(18px + var(--sar));bottom:calc(18px + var(--sab));z-index:20;height:58px;padding:0 22px;border-radius:29px;border:0;
  background:var(--accent);color:#fff;font:inherit;font-weight:700;font-size:1.05rem;box-shadow:0 6px 18px rgba(0,0,0,.35);cursor:pointer}
body.route-editor .fab{display:none}

/* ---------- Editor ---------- */
#editor{padding:12px calc(12px + var(--sar)) 0 calc(12px + var(--sal))}
.editor-title{display:flex;justify-content:space-between;align-items:flex-end;gap:10px;margin:2px 4px 10px}
.title-name{font-size:1.2rem;font-weight:700;line-height:1.2;word-break:break-word}
.save-state{font-size:.72rem;color:var(--muted);text-align:right;flex:none;letter-spacing:.04em;text-transform:uppercase;min-width:4.8em;min-height:1em;opacity:0;pointer-events:none}
.save-state.on{opacity:1}
.save-state.dirty{color:var(--muted);font-weight:400}
.bottom-spacer{height:calc(var(--bar-h) + var(--sab) + 16px)}

.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);margin-bottom:12px;box-shadow:0 1px 2px rgba(0,0,0,.03);overflow:hidden}
.step-head{all:unset;box-sizing:border-box;display:flex;align-items:center;gap:10px;width:100%;padding:14px 16px;min-height:56px;cursor:pointer}
.step-head-wrap{display:flex;align-items:center;gap:8px;padding-right:12px}
.step-head-wrap .step-head{flex:1;min-width:0;width:auto}
.scope-gen{flex:none;min-height:36px;height:36px;padding:0 12px;margin:0;font-size:.85rem;font-weight:700;border-radius:10px;white-space:nowrap;background:var(--accent);color:#fff;border:0}
.scope-gen.busy{opacity:.75}
.step-head:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.step-head h2{font-size:1.05rem;margin:0;flex:none}
.sec-sum{flex:1;min-width:0;font-size:.82rem;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:right}
.chev{width:10px;height:10px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:rotate(45deg);margin:0 4px 4px 4px;transition:transform .15s;flex:none}
.step.collapsed .chev{transform:rotate(-45deg);margin-bottom:0}
.step-body{padding:0 16px 16px}
.step.collapsed .step-body{display:none}
.step:not(.collapsed) .sec-sum{visibility:hidden}
.num{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--accent);color:#fff;font-weight:700;font-size:.85rem;flex:none}
.subhead{font-size:.8rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin:18px 0 8px}

/* Forms */
.grid{display:grid;gap:12px;grid-template-columns:1fr}
.grid.meta{grid-template-columns:1fr 1fr;margin-bottom:12px}
.grid.meta label:first-child{grid-column:1 / -1}
.bo-job{display:flex;flex-direction:column;gap:5px;margin:0 0 12px;max-width:280px;font-size:.85rem;font-weight:600;color:#333}
.bo-job input{font-family:ui-monospace,Menlo,Consolas,monospace}
.grid.g3{grid-template-columns:1fr 1fr}
.span-all-sm{grid-column:1 / -1}
label{display:flex;flex-direction:column;gap:5px;font-size:.85rem;font-weight:600;color:#333333}
label.mt{margin-top:12px}
input,select,textarea{font:inherit;font-size:16px;color:inherit;border:1px solid var(--line-strong);border-radius:10px;padding:11px 12px;min-height:var(--tap);background:#fff;width:100%;min-width:0;-webkit-appearance:none;appearance:none}
select{background-image:linear-gradient(45deg,transparent 50%,#666666 50%),linear-gradient(135deg,#666666 50%,transparent 50%);background-position:calc(100% - 18px) 50%,calc(100% - 12px) 50%;background-size:6px 6px;background-repeat:no-repeat;padding-right:32px}
input[type=date]{min-height:var(--tap)}
textarea{resize:vertical;line-height:1.5}
textarea.desc-input{resize:none;overflow:hidden;line-height:1.35;padding:12px;min-height:var(--tap);display:block}
#scopeText{min-height:150px;overflow:hidden;resize:none}
input:focus,select:focus,textarea:focus{outline:2px solid var(--accent);outline-offset:-1px;border-color:var(--accent)}
input:disabled{background:#f4f4f4;color:#9a9a9a}
#quoteNumber{background:#fafafa;font-family:ui-monospace,Menlo,Consolas,monospace}
#scopeText{margin-top:10px}

/* Buttons */
.btn{font:inherit;font-weight:600;min-height:var(--tap);padding:0 16px;border-radius:10px;border:1px solid var(--line-strong);background:#fff;color:var(--text);cursor:pointer;white-space:nowrap;touch-action:manipulation}
.btn:active{background:#f4f4f4}
.btn:disabled{opacity:.5;cursor:not-allowed}
.btn.accent{background:var(--accent);border-color:var(--accent);color:#fff}
.btn.accent:active{background:var(--accent-dark)}
.btn.block{width:100%;margin-top:10px}
.row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:10px}
.hint{color:var(--muted);font-size:.85rem;margin:0 0 10px}
.row .hint{margin:0}

/* Badges */
.badge{display:inline-block;font-size:.72rem;font-weight:700;padding:4px 10px;border-radius:999px}
.badge.placeholder{background:var(--warn-bg);border:1px dashed var(--warn-line);color:#333333}
.badge.opt{background:#f2f2f2;color:#222222;border:1px solid #d6d6d6;font-size:.68rem;padding:2px 8px}
.badge.sample{background:#e8e8e8;color:#222222}
.banner{border-radius:var(--radius);padding:12px 14px;margin-bottom:12px;font-size:.9rem}
.banner.sample{background:var(--warn-bg);border:1px dashed var(--warn-line);color:#333333}

.suggestion{display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--accent-soft);border:1px solid #d6d6d6;border-radius:10px;padding:8px 8px 8px 12px;font-size:.92rem;margin-top:10px}
.suggestion .btn{min-height:40px}

/* ---------- Parts: cards on phone ---------- */
.parts-head{display:none}
.parts-list{display:flex;flex-direction:column;gap:10px}
.part{display:grid;grid-template-columns:auto minmax(0,1fr) 76px auto;grid-template-areas:"inc desc desc desc" "inc qty unit del";
  gap:8px 10px;align-items:center;border:1px solid var(--line);border-radius:12px;padding:10px;background:#fff}
.part.excluded{background:#fafafa}
.part.excluded .desc-input,.part.excluded .qty-wrap,.part.excluded .unit-input{opacity:.55}
.part.excluded .desc-input{text-decoration:line-through;text-decoration-color:#9a9a9a}
.p-inc{grid-area:inc;align-self:start;display:flex;flex-direction:column;align-items:center;gap:2px;font-size:.65rem;color:var(--muted);font-weight:600;padding-top:6px;min-width:44px}
.p-desc{grid-area:desc;min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:4px}
.p-qty{grid-area:qty;min-width:0}
.p-unit{grid-area:unit}
.p-del{grid-area:del}
.p-price{display:none}
.qty-wrap{display:flex;gap:6px}
.qty-input{text-align:center;font-weight:600}
.unit-lbl{display:flex;align-items:center;justify-content:center;min-height:var(--tap);font-size:.85rem;font-weight:600;color:#111;padding:0 4px}
.tbd-btn{min-height:var(--tap);padding:0 10px;font-size:.8rem}
.tbd-btn.on{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}
.del-btn{width:var(--tap);padding:0;font-size:1.3rem;color:var(--danger);border-color:#f3b8b2}
.toggle{width:28px;height:28px;accent-color:var(--accent);cursor:pointer;min-height:0;-webkit-appearance:auto;appearance:auto;margin:0}
.empty{color:var(--muted);font-style:italic;margin:6px 0}
.price-note{font-size:.8rem;color:#9a9a9a;font-style:italic;margin:8px 0 0}

/* Labour */
.labour{display:grid;gap:14px}
.labour > div > label{margin-bottom:6px;display:block}
.stepper{display:flex;gap:8px}
.stepper input{width:110px;text-align:center;font-size:1.3rem;font-weight:700}
.stepper .btn{width:56px;padding:0;font-size:1.5rem}
.suggested{font-weight:600}
.suggested .reset{margin-left:8px;min-height:38px;padding:0 12px;font-size:.85rem}
.note{margin:6px 0 0;font-size:.85rem;color:var(--muted)}
.soon{color:#9a9a9a}
.totals.soon{margin-top:12px;padding:10px 14px;border:1px dashed var(--line-strong);border-radius:10px;font-size:.85rem;background:#fafafa}
.tech2-toggle{display:flex;flex-direction:row;align-items:center;gap:10px;font-weight:600;color:#111;padding:2px 0;margin:0}
.tech2-toggle .toggle{accent-color:#111}
#labourTech2Block{display:grid;gap:14px}
#labourTech2Block[hidden]{display:none}

/* ---------- Fixed bottom action bar. Plain bottom:0 — no JS visual-viewport offset (that lifted the bar mid-screen on iOS PWAs). ---------- */
.action-bar{position:fixed;left:0;right:0;bottom:0;z-index:25;display:grid;grid-template-columns:1fr 56px;gap:10px;
  padding:10px calc(12px + var(--sar)) calc(10px + env(safe-area-inset-bottom, var(--sab))) calc(12px + var(--sal));
  background:#fff;border-top:1px solid var(--line);box-shadow:0 -4px 16px rgba(0,0,0,.05);
  backdrop-filter:none;-webkit-backdrop-filter:none;
  transform:none;filter:none;contain:none;will-change:auto}
.action-bar .btn{min-height:50px;font-size:1rem}
.icon-more{width:56px;padding:0;font-size:1.5rem}

/* Sheet */
.sheet{position:fixed;inset:0;z-index:50}
.sheet-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.45)}
.sheet-panel{position:absolute;left:0;right:0;bottom:0;background:#fff;border-radius:16px 16px 0 0;padding:8px calc(12px + var(--sar)) calc(12px + var(--sab)) calc(12px + var(--sal));display:flex;flex-direction:column}
.sheet-item{font:inherit;font-weight:600;font-size:1.05rem;text-align:left;background:none;border:0;border-bottom:1px solid var(--line);min-height:56px;padding:0 8px;color:var(--text);cursor:pointer}
.sheet-item.danger{color:var(--danger)}
.sheet-item:disabled{color:#9a9a9a}
.sheet-item.cancel{border:0;text-align:center;color:var(--accent)}

.toast{position:fixed;left:50%;bottom:calc(var(--bar-h) + var(--sab) + 14px);transform:translateX(-50%) translateY(10px);max-width:calc(100% - 32px);
  background:var(--ink);color:#fff;padding:12px 18px;border-radius:10px;opacity:0;pointer-events:none;transition:.2s;z-index:60;font-size:.92rem;text-align:center}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* ---------- Tablet (≥700px) ---------- */
@media (min-width:700px){
  .topbar .dash,.topbar .sub{display:inline}
  #newQuoteBtn{display:inline-block}
  .fab span{display:inline}
  #editor{padding:16px 20px 0}
  .grid.g2{grid-template-columns:1fr 1fr}
  .grid.g2 .span2{grid-column:span 2}
  .grid.g3{grid-template-columns:repeat(3,1fr)}
  .grid.meta{grid-template-columns:repeat(3,1fr)}
  .grid.meta label:first-child{grid-column:auto}
  .span-all-sm{grid-column:auto}
  .labour{grid-template-columns:auto 1fr;align-items:start}
  .labour .labour-info{padding-top:28px}
  .labour label.soon{grid-column:1 / -1;max-width:260px}
  .labour .tech2-toggle,#labourTech2Block{grid-column:1 / -1}
}

/* v0.9.49: table-like parts rows only when the viewport is wide enough that the
   description column will not collapse (landscape phones / tablets keep cards). */
@media (min-width:1100px){
  .parts-head,.part{grid-template-columns:52px minmax(14rem,1fr) 150px 80px 52px;grid-template-areas:none}
  .parts-head{display:grid;gap:10px;padding:0 10px 6px;font-size:.72rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:700}
  .parts-head .soon{display:none}
  .parts-head small{display:block;text-transform:none;font-weight:500;letter-spacing:0}
  .parts-list{gap:6px}
  .part{grid-template-areas:none;gap:10px;padding:6px 10px}
  .p-inc,.p-desc,.p-qty,.p-unit,.p-del{grid-area:auto}
  .p-inc{padding-top:0;align-self:center}
  .p-inc small{display:none}
  .p-unit{width:auto}
  .p-desc{flex-direction:row;flex-wrap:wrap;align-items:flex-start;gap:6px;min-width:0}
  .p-desc .badge.opt{order:2;flex:none}
}

/* ---------- Desktop split view (≥1000px) ---------- */
@media (min-width:1000px){
  .proto-tag{display:inline-block}
  .layout{display:grid;grid-template-columns:320px 1fr}
  .list-view{display:block!important;position:sticky;top:var(--topbar-h);height:calc(100vh - var(--topbar-h));overflow:auto;background:#fff;border-right:1px solid var(--line);padding:16px}
  .list-head h2{font-size:1.05rem}
  .quote-list li{padding:10px 12px;border-radius:10px}
  .ql-name{font-size:.98rem}
  .fab{display:none}
  .editor-view{display:block;position:relative;max-width:1100px}
  body.route-list #editor,body.route-list .action-bar{display:none}
  body.route-list .editor-empty{display:block;text-align:center;color:var(--muted);padding:120px 20px}
  .icon-btn.back,body.route-editor .icon-btn.back{display:none}
  body.route-editor .brand .logo{display:grid}
  .action-bar{position:fixed;left:320px;right:0;bottom:0;margin:0;border:0;border-top:1px solid var(--line);border-left:1px solid var(--line);border-radius:0;grid-template-columns:240px 56px;justify-content:end}
  .bottom-spacer{height:calc(var(--bar-h) + var(--sab) + 16px)}
  .parts-head,.part{grid-template-columns:52px minmax(14rem,1fr) 150px 80px 90px 90px 52px}
  .parts-head .soon{display:block}
  .p-price{display:grid;place-items:center;min-height:var(--tap);border-radius:8px;font-size:.8rem;font-style:italic;color:#9a9a9a;background:repeating-linear-gradient(45deg,#fafafa,#fafafa 6px,#f4f4f4 6px,#f4f4f4 12px)}
  .price-note{display:none}
  .toast{bottom:90px}
}

/* v0.3.1 — scope feedback, keyboard, stacking */
.app-version{font-size:.7rem;font-weight:500;color:#9a9a9a;margin-left:4px}
.scope-status{margin-top:10px;padding:10px 12px;border-radius:10px;font-size:.9rem;line-height:1.4}
.scope-status.ok{background:#f4f4f4;border:1px solid #d6d6d6;color:#222222}
.scope-status.warn{background:var(--warn-bg);border:1px solid var(--warn-line);color:#333333}
.scope-status.error{background:#fef3f2;border:1px solid #fecdca;color:#7f1d1d}
.step{scroll-margin-top:calc(var(--topbar-h) + var(--sat) + 8px)}
@keyframes pqflash{0%{box-shadow:0 0 0 0 rgba(0,0,0,.55)}100%{box-shadow:0 0 0 12px rgba(0,0,0,0)}}
.flash{animation:pqflash .9s ease-out 2}
label.flash{border-radius:10px}
.action-bar{z-index:1000}
.sheet{z-index:1100}
.toast{z-index:1200}
@media (max-width:699px){ body.kb-open .action-bar{display:none} body.kb-open .bottom-spacer{height:24px} }

/* v0.3.2 */
.top-version{font-size:.7rem;font-weight:600;color:#9a9a9a;background:#1a1a1a;border:1px solid #333333;border-radius:999px;padding:1px 7px;margin-left:4px;vertical-align:middle}
.topbar .top-version{display:inline-block!important}
.editor-version{font-size:.72rem;color:#9a9a9a;margin-top:2px;font-family:ui-monospace,Menlo,Consolas,monospace}
#generateScopeRepair{margin-top:14px}
#generateScopeInline{margin-top:10px}
.mt-s{margin-top:8px}
.undo-btn{min-height:36px;padding:0 12px;margin-left:4px;font-size:.85rem;vertical-align:middle}
.ask{z-index:1250}
.ask-panel{padding:18px calc(16px + var(--sar)) calc(16px + var(--sab)) calc(16px + var(--sal))}
.ask-msg{font-size:1.05rem;font-weight:600;margin:4px 0 16px;line-height:1.4}
.ask-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.btn.danger-solid{background:var(--danger);border-color:var(--danger);color:#fff}
@media (min-width:700px){.ask-panel{left:50%;right:auto;bottom:auto;top:30%;transform:translateX(-50%);width:440px;border-radius:16px}}

/* v0.4 AI scope */
.badge.ai { background: #f0f0f0; color: #000000; border: 1px solid #d6d6d6; }
.btn.busy { opacity: .85; pointer-events: none; }
.spinner { display: inline-block; width: 1em; height: 1em; vertical-align: -0.15em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: pqspin .8s linear infinite; }
@keyframes pqspin { to { transform: rotate(360deg); } }
#scopeText.busy { opacity: .55; }
.opt-label { font-weight: 400; color: #666666; font-size: .9em; }
.sheet-title{margin:4px 4px 2px;font-size:1.05rem}
.ut-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 4px;border-bottom:1px solid #e4e4e4}
.btn.danger-outline{border:1px solid #9b2226;color:#9b2226;background:#fff;padding:6px 12px;min-height:36px}
.export-btn{width:100%;margin-top:12px;min-height:48px;border:2px solid var(--accent);color:var(--accent);background:#fff;font-weight:700}
.sheet-item.accent-item{background:var(--accent);color:#fff;font-weight:700;border-radius:10px}
.pdf-tech{display:block;margin:8px 4px}
.pdf-file{margin:4px;font-size:.82rem;color:#666666;word-break:break-all}
.pdf-status{margin:6px 4px;font-size:.88rem;color:#333333;min-height:1.1em}
#pdfSheet .sheet-item[hidden]{display:none}
.rate-wrap{grid-column:1/-1;margin-top:6px}
.rate-label{display:block;font-weight:600;margin-bottom:6px}
.seg{display:grid;grid-template-columns:repeat(3,1fr);gap:0;border:2px solid var(--accent);border-radius:12px;overflow:hidden}
.seg button{min-height:52px;border:0;border-left:1px solid var(--accent);background:#fff;color:var(--accent);font:inherit;font-weight:700;font-size:1rem;padding:6px 4px;cursor:pointer;-webkit-tap-highlight-color:transparent}
.seg button:first-child{border-left:0}
.seg button.on{background:var(--accent);color:#fff}
.seg button:focus-visible{outline:3px solid var(--accent-dark);outline-offset:-3px}
/* v0.6.0 Open / Completed */
.list-tabs{grid-template-columns:1fr 1fr;margin:10px 0}
.list-tabs button{min-height:50px;font-size:1.02rem}
.tab-count{display:inline-block;min-width:1.6em;padding:1px 7px;margin-left:4px;border-radius:999px;background:var(--accent-soft);color:var(--accent);font-size:.85rem}
.list-tabs button.on .tab-count{background:#fff;color:var(--accent)}
.ql-foot{display:flex;flex-direction:column;align-items:stretch;gap:8px;margin-top:4px}
.ql-acts{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.ql-act{min-height:44px;min-width:0;width:100%;padding:0 12px;border-radius:10px;font:inherit;font-weight:700;cursor:pointer;-webkit-tap-highlight-color:transparent;flex:none}
.ql-act.complete{border:2px solid #111111;color:#111111;background:#fff}
.ql-act.complete:active{background:#111111;color:#fff}
.ql-act.reopen,.ql-act.duplicate{border:2px solid var(--line-strong);color:var(--ink);background:#fff}
.ql-act.duplicate:active,.ql-act.reopen:active{background:#f2f2f2}
.banner.completed{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#f2f2f2;border:1px solid #cfcfcf;color:#111111;font-weight:700}
.banner.completed[hidden]{display:none}
.btn.small{min-height:40px;padding:0 14px}
.toast.has-action{pointer-events:auto;display:flex;align-items:center;gap:14px}
.toast-act{background:none;border:0;color:#ffffff;font:inherit;font-weight:800;padding:8px 6px;min-height:40px;cursor:pointer}

/* ===== v0.7.0 brand: minimal black & white; v0.9.54 Quoteknect logo ===== */
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.topbar{background:#000;border-bottom:1px solid #222}
.brand-logo{height:34px;width:auto;flex:none;display:block}
.topbar h1{display:flex;align-items:center;gap:8px;font-size:.95rem}
.topbar .sub{color:#bdbdbd;font-weight:600;letter-spacing:.04em;text-transform:uppercase;font-size:.78rem;border-left:1px solid #444;padding-left:10px}
.brand-mark-big{display:block;width:280px;height:auto;margin:0 auto 14px;opacity:.9}
.btn.accent,.fab{background:#111;color:#fff;border-color:#111}
.fab{box-shadow:0 6px 18px rgba(0,0,0,.28)}
.ql-act.complete{border:2px solid #111;color:#111;background:#fff}
.ql-act.complete:active{background:#111;color:#fff}
.banner.completed{background:#f2f2f2;border:1px solid #cfcfcf;color:#111}
.seg{border-color:#111}.seg button{color:#111;border-left-color:#111}.seg button.on{background:#111;color:#fff}
.tab-count{background:#ececec;color:#111}.list-tabs button.on .tab-count{background:#fff;color:#111}
.project-name{display:block;margin-bottom:12px;font-weight:600}
.project-name input{font-size:1.1rem;font-weight:700}
/* Quotes | Projects switch: bottom tab bar on phones (list screen only), top of list on wider screens */
.kind-bar{display:grid;grid-template-columns:1fr 1fr;background:#000;border-top:1px solid #222}
.kind-bar button{min-height:58px;border:0;background:none;color:#9a9a9a;font:inherit;font-weight:700;font-size:1rem;display:flex;align-items:center;justify-content:center;gap:8px;cursor:pointer;position:relative}
.kind-bar button.on{color:#fff}
.kind-bar button.on::before{content:"";position:absolute;top:0;left:22%;right:22%;height:3px;background:#fff;border-radius:0 0 3px 3px}
.kb-ico{font-size:1.1rem}
.kb-count{font-size:.78rem;min-width:1.6em;padding:1px 7px;border-radius:999px;background:#2a2a2a;color:#ddd}
.kind-bar button.on .kb-count{background:#fff;color:#000}
@media (max-width:999px){
  .kind-bar{position:fixed;left:0;right:0;bottom:0;z-index:24;padding:0 var(--sar) var(--sab) var(--sal)}
  body.route-editor .kind-bar{display:none}
  body.route-list .fab{bottom:calc(76px + var(--sab))}
  body.route-list .quote-list{padding-bottom:150px}
  body.route-list .toast{bottom:calc(150px + var(--sab))}
}
@media (min-width:1000px){ .kind-bar{position:static;border-radius:12px;overflow:hidden;margin:0 0 10px;order:-1} }
.subj-row{display:flex;gap:8px;align-items:center}.subj-row input{flex:1;min-width:0}.subj-row .btn{flex:none;min-width:44px}
/* v0.8.0 project type / repipe / LOA */
.seg.seg2{grid-template-columns:1fr 1fr}
body.editing-project #repairTypeWrap{display:none}
.loa-total{margin:10px 0 0;padding:10px 12px;border:1px solid var(--line-strong);border-radius:10px;background:#fafafa;font-weight:700;font-size:1.05rem}
#loaRate,#loaNights{font-size:1.05rem}
/* v0.8.0 PM */
.kind-bar{grid-template-columns:repeat(4,1fr)}
.kind-bar button{gap:2px;flex-direction:column;font-size:.78rem;padding:8px 2px 6px;min-height:62px}
.kind-bar button .kb-count{font-size:.7rem;padding:0 5px;min-width:1.35em}
@media (min-width:700px){
  .kind-bar button{flex-direction:row;font-size:1rem;gap:6px;min-height:58px;padding:0 8px}
  .kind-bar button .kb-count{font-size:.78rem;padding:1px 7px;min-width:1.6em}
}
body:not(.editing-pm) .pm-only{display:none!important}
body.editing-pm #secRepair,body.editing-pm #eqBlock,body.editing-pm #generateScope,body.editing-pm #generateScopeInline,body.editing-pm #loaWrap{display:none!important}
body:not(.editing-takeoff) .takeoff-only{display:none!important}
body.editing-takeoff #secRepair,body.editing-takeoff #secScope,body.editing-takeoff #secParts,body.editing-takeoff #secPhotos,body.editing-takeoff #secLabour,body.editing-takeoff #eqBlock,body.editing-takeoff #generateScope,body.editing-takeoff #generateScopeInline,body.editing-takeoff #generateScopeRepair,body.editing-takeoff .notes-export-hint,body.editing-takeoff #projectNameWrap{display:none!important}
body.editing-takeoff .action-bar{grid-template-columns:1fr 56px}
.tk-rows{display:flex;flex-direction:column;gap:8px}
.tk-row{display:grid;grid-template-columns:1fr 78px 44px;gap:8px;align-items:end;padding:10px;border:1px solid var(--line);border-radius:12px;background:#fafafa}
.tk-row select,.tk-row input{min-height:48px;font-size:16px;width:100%}
.tk-row .tk-custom{grid-column:1/-1}
.tk-row .tk-del{min-height:48px;padding:0;font-size:1.4rem;line-height:1}
.tk-row label{font-size:.78rem;font-weight:700;color:#555;display:flex;flex-direction:column;gap:4px}
.tk-total{margin:10px 0 0;font-weight:700}
.pm-freq-wrap{margin:0 0 12px}
.seg.seg4{display:grid;grid-template-columns:1fr 1fr;gap:8px}
@media (min-width:700px){.seg.seg4{grid-template-columns:repeat(4,1fr)}}
.seg.seg4 button{min-height:56px;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.15}
.seg.seg4 button small{font-weight:500;font-size:.78rem;opacity:.75;margin-top:2px}
.pm-rows{display:flex;flex-direction:column;gap:8px}
.pm-row{display:grid;grid-template-columns:1fr 78px 44px;gap:8px;align-items:end;padding:10px;border:1px solid var(--line);border-radius:12px;background:#fafafa}
.pm-row select,.pm-row input{min-height:48px;font-size:16px;width:100%}
.pm-row .pm-other{grid-column:1/-1}
.pm-row .pm-del{min-height:48px;padding:0;font-size:1.4rem;line-height:1}
.pm-row label{font-size:.78rem;font-weight:700;color:#555;display:flex;flex-direction:column;gap:4px}
.pm-row .pm-yr{grid-column:1/-1;font-size:.82rem;color:#555;margin:-2px 0 0}
.pm-total{margin:10px 0 0;font-weight:700}
.pm-hours{margin-top:10px;display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.pm-hours div{border:1px solid var(--line);border-radius:10px;padding:8px 10px;background:#fafafa}
.pm-hours small{display:block;font-size:.72rem;font-weight:700;color:#666;text-transform:uppercase;letter-spacing:.03em}
.pm-hours strong{font-size:1.1rem}
/* v0.8.2 filter pricing rows: size + × on top, Qty / $ each below, line subtotal under */
.pm-row.f{grid-template-columns:1fr 1fr 44px;grid-template-areas:"type type del" "qty price price" "other other other" "yr yr yr"}
.pm-row.f .pm-l-type{grid-area:type}.pm-row.f .pm-l-qty{grid-area:qty}.pm-row.f .pm-l-price{grid-area:price}
.pm-row.f .pm-del{grid-area:del}.pm-row.f .pm-other{grid-area:other}.pm-row.f .pm-yr{grid-area:yr;font-weight:600;color:#222}
#pmFilterCost{margin-top:8px}
#pmPriceNote{font-size:.78rem;color:#666}
/* v0.8.2 LOA: $/night full width, Nights + # of techs side by side on phones */
/* v0.9.26: LOA $/night | Hotel $/night / Nights | # techs */
#loaFields.loa-fields{grid-template-columns:1fr 1fr}
#loaFields .loa-rate-field[hidden],#loaTotal[hidden]{display:none!important}
#loaFields.loa-fields label:first-child{grid-column:auto}
@media (min-width:700px){#loaFields.loa-fields{grid-template-columns:1fr 1fr 1fr 1fr}}
/* ---------- v0.9.0 supplier-quote import + part costs ---------- */
.vh{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.import-box{margin:0 0 12px;padding:0 0 12px;border-bottom:1px solid var(--line)}
.import-btn{display:flex;align-items:center;justify-content:center;cursor:pointer;text-align:center}
.supplier-quotes{margin-top:8px;display:flex;flex-direction:column;gap:4px;font-size:.85rem}
.supplier-quotes .sq-note{padding:6px 10px;border:1px solid var(--line);border-radius:8px;background:#fafafa}
.badge.supplier{background:#111;color:#fff}
.badge.nsr{background:#fff;color:#111;border:1px solid #111}
.p-desc .p-meta{display:flex;flex-wrap:wrap;gap:6px;align-items:center;font-size:.78rem;color:#555}
.p-desc .pn-input{min-height:34px;font-size:.85rem;padding:4px 8px;width:150px;font-family:ui-monospace,Menlo,monospace}
/* phone card: 3rd row = cost each + subtotal */
.part{grid-template-areas:"inc desc desc desc" "inc qty unit del" "inc cost cost sub"}
.part .p-cost,.part .p-sub{display:flex;align-items:center;gap:6px;background:none;font-style:normal;color:var(--text);min-height:0}
.part .p-cost{grid-area:cost}.part .p-sub{grid-area:sub;justify-content:flex-end;font-weight:700;font-size:.92rem;white-space:nowrap}
.p-cost span{font-size:.75rem;color:#666;font-weight:600;white-space:nowrap}
.cost-input{min-height:44px;width:100%;max-width:130px;text-align:right}
.parts-cost-total{margin:10px 0 6px;padding:10px 12px;border:1px solid var(--line-strong);border-radius:10px;background:#fafafa;font-weight:700}
.parts-cost-total small{display:block;font-weight:500;color:#666}
@media (min-width:1100px){
  .parts-head,.part{grid-template-columns:52px minmax(14rem,1fr) 140px 70px 110px 90px 52px;grid-template-areas:none}
  .part .p-cost,.part .p-sub{grid-area:auto}
  .p-cost span{display:none}
  .parts-head span:nth-child(5),.parts-head span:nth-child(6){display:block}
}
@media (min-width:1000px){ .part .p-cost,.part .p-sub{display:flex;background:none;font-style:normal} }
/* review sheet: full screen on phones */
.import-sheet .import-panel{top:calc(8px + var(--sat, 0px));max-height:none;overflow:hidden;padding-bottom:0}
@media (min-width:700px){.import-sheet .import-panel{left:50%;right:auto;transform:translateX(-50%);width:720px;top:40px;bottom:40px;border-radius:16px}}
.import-top{display:flex;justify-content:space-between;align-items:center;padding:4px 0 8px}
.import-progress{padding:6px 4px;font-weight:600}
.import-progress.err{color:var(--danger)}
#importBody{flex:1;overflow:auto;-webkit-overflow-scrolling:touch;padding:0 2px 12px}
.import-doc{margin-bottom:8px}
.import-warn{margin:6px 0;padding:8px 10px;border:1px solid #8c1e1e;border-radius:8px;color:#8c1e1e;font-size:.85rem;font-weight:600}
.import-allbar{display:flex;justify-content:space-between;align-items:center;margin:6px 2px}
.imp-all{display:flex;align-items:center;gap:8px;font-weight:600}
.import-lines{display:flex;flex-direction:column;gap:10px}
.imp-line{border:1px solid var(--line);border-radius:12px;padding:10px;display:grid;grid-template-columns:auto 1fr;gap:8px 10px;background:#fff}
.imp-line.off{background:#fafafa;opacity:.7}
.imp-line.low{border-color:#8c1e1e}
.imp-line .imp-chk{width:26px;height:26px;margin-top:4px}
.imp-fields{display:grid;grid-template-columns:1fr 1fr;gap:6px 8px;min-width:0}
.imp-fields label{font-size:.72rem;font-weight:700;color:#555;display:flex;flex-direction:column;gap:3px;min-width:0}
.imp-fields .full{grid-column:1/-1}
.imp-fields textarea,.imp-fields input,.imp-fields select{min-height:40px;font-size:16px;width:100%}
.imp-fields textarea{resize:none;line-height:1.3}
.imp-flags{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px;align-items:center;font-size:.78rem}
.imp-flags .warn{color:#8c1e1e;font-weight:700}
.imp-total{grid-column:1/-1;text-align:right;font-weight:700}
.import-foot{border-top:1px solid var(--line);padding:10px 0 calc(10px + var(--sab));background:#fff}
.import-total{font-weight:700;margin:0 2px 8px}
.import-info{margin:6px 0;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:#fafafa;color:#444;font-size:.85rem}
.imp-all{flex-direction:row}
.imp-line .imp-chk{width:28px;height:28px;margin-top:4px}
.part label.p-cost{flex-direction:row;font-weight:600}
.imp-fields label{gap:3px}

/* ---------- v0.9.2 supplier-quote attachments ---------- */
.att-chip{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;gap:8px;align-items:center;padding:8px 10px;border:1px solid var(--line-strong);border-radius:10px;background:#fff}
.supplier-quotes .att-chip{background:#fff}
.att-ico{font-size:.68rem;font-weight:800;letter-spacing:.04em;border:1.5px solid #111;border-radius:6px;padding:6px 5px;min-width:34px;text-align:center}
.att-txt{min-width:0;display:flex;flex-direction:column}
.att-txt strong{font-size:.9rem;line-height:1.25;overflow-wrap:anywhere}
.att-txt small{color:#555;font-size:.75rem}
.att-chip .btn.small{min-height:40px;padding:0 12px}
.supplier-quotes .sq-note{font-size:.82rem;color:#555}
.attach-view-body{flex:1;overflow:auto;-webkit-overflow-scrolling:touch;display:flex;flex-direction:column;gap:10px;padding-bottom:16px}
.attach-view-body img{width:100%;height:auto;border:1px solid var(--line);border-radius:6px;background:#fff}
.pdf-inc{flex-direction:row;align-items:flex-start;gap:12px;margin:8px 4px;padding:10px 12px;border:1px solid var(--line-strong);border-radius:10px}
.pdf-inc span{display:flex;flex-direction:column;gap:2px}
.pdf-inc small{font-weight:500;color:#555}
.pdf-status.warn{color:#8c1e1e;font-weight:700}

/* ---- v0.9.3 per-part supplier lookup ---- */
.p-look{display:flex;gap:6px;align-items:center;margin-top:4px}
.p-look .sup-select{flex:0 1 auto;width:auto;min-width:0;max-width:62%;min-height:34px;padding:4px 26px 4px 8px;font-size:.85rem;font-weight:600;border:1px solid #111;border-radius:8px;background-color:#fff;color:#111}
.p-look .sup-other{flex:1 1 110px;min-width:0;max-width:100%;min-height:34px;padding:4px 8px;font-size:.85rem;font-weight:600;border:1px solid #111;border-radius:8px;background:#fff;color:#111}
.set-suppliers .set-sup-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px solid #e4e4e4;color:#111}
.set-suppliers .set-sup-row:last-child{border-bottom:0}
.p-look .find-btn{min-height:34px;padding:0 12px;font-size:.85rem;font-weight:700;background:#111;color:#fff;border:1px solid #111;border-radius:8px}
.p-look .find-btn.muted-btn{background:#fff;color:#777;border-color:#bbb;font-weight:600}
.p-meta .est-tag{font-weight:600;color:#111}
.p-meta .p-link{color:#111;font-weight:600}
.lookup-panel{gap:6px}
.lk-search{display:flex;gap:8px}
.lk-search input{flex:1;min-width:0;font-size:1rem;min-height:44px;padding:0 10px;border:1px solid #111;border-radius:10px}
.lk-search .btn{min-height:44px}
.lk-status{padding:4px 2px;font-size:.88rem;color:#333;min-height:1.2em}
.lk-status.err{color:var(--danger);font-weight:600}.lk-status.busy{font-weight:600}
.lk-results{flex:1;overflow:auto;-webkit-overflow-scrolling:touch;display:flex;flex-direction:column;gap:8px;padding-bottom:6px}
.lk-item{display:flex;gap:10px;align-items:flex-start;justify-content:space-between;text-align:left;font:inherit;color:#111;background:#fff;border:1px solid #111;border-radius:10px;padding:10px;cursor:pointer;width:100%}
.lk-item:active{background:#f0f0f0}
.lk-main{display:flex;flex-direction:column;gap:3px;min-width:0}
.lk-name{font-weight:700;font-size:.95rem;line-height:1.25}
.lk-sub{color:#555;font-size:.78rem;word-break:break-word}
.lk-price{display:flex;flex-direction:column;align-items:flex-end;text-align:right;flex:0 0 auto;max-width:42%}
.lk-price strong{font-size:1.1rem}.lk-price small{font-size:.72rem;color:#555}.lk-price .lk-est{color:#111;font-weight:600}
.lk-foot{border-top:1px solid var(--line);padding:8px 2px calc(8px + var(--sab, 0px));display:flex;flex-direction:column;gap:4px}
.lk-disc{display:flex;flex-direction:row;align-items:center;gap:6px;font-weight:600;font-size:.88rem}
.lk-disc input{width:64px;min-height:36px;text-align:right;padding:0 8px;border:1px solid #111;border-radius:8px}
.lk-disc[hidden]{display:none}

/* ---- v0.9.5 equipment category (HVAC/R | Plumbing) ---- */
.eq-cat{display:flex;flex-direction:column;gap:6px}
.eq-cat-lbl{font-weight:600;font-size:.9rem}
.seg.seg2{grid-template-columns:1fr 1fr}
.seg.seg2 button{min-height:46px}
#eqRefrigerantWrap[hidden]{display:none}

/* ---- v0.9.6 learned jobs ---- */
.learn-note{margin:4px 0 8px;padding:8px 10px;border:1px solid #111;border-radius:10px;background:#f4f4f4;font-size:.88rem;font-weight:600;color:#111}
.learn-note[hidden]{display:none}
.learn-hours{font-weight:700;color:#111}
.learn-panel{max-height:85vh;overflow:auto}
.learn-toggle{display:flex;flex-direction:row;align-items:center;gap:10px;font-weight:700;padding:6px 4px}
.learn-list{display:flex;flex-direction:column;gap:8px;margin:6px 0}
.lj-row{display:flex;gap:8px;align-items:flex-start;border:1px solid var(--line-strong);border-radius:10px;padding:8px}
.lj-txt{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.lj-txt small{color:#555}
.lj-parts{font-size:.8rem;color:#333;margin-top:4px;display:flex;flex-direction:column;gap:2px}
.lj-parts[hidden]{display:none}
.p-look .sup-select{min-width:min(150px,100%)}

/* v0.9.7 Backup / Restore */
body.route-list .icon-btn.app-menu{display:block;margin:0 -6px 0 0;font-size:1.7rem;letter-spacing:1px}
@media (min-width:900px){ .icon-btn.app-menu{display:block!important;margin:0} }
.backup-note{margin:2px 4px 6px;padding:8px 10px;border-radius:8px;background:#f3f3f3;color:#444;font-size:.85rem}
.backup-note.warn{background:#fff4e0;color:#7a4b00}
.sheet-item .backup-sub{display:block;font-weight:500;font-size:.78rem;color:var(--muted);margin-top:-2px}
.sheet-item.ready{color:var(--accent)}
.restore-summary{margin:4px 4px 8px;font-size:.92rem;line-height:1.45}
.restore-summary ul{margin:6px 0;padding-left:18px}
.restore-summary .ok{color:#1a7f37;font-weight:600}
.restore-summary .bad{color:var(--danger);font-weight:600}
.restore-summary .now{color:var(--muted);font-size:.85rem}
.restore-modes{display:grid;gap:8px;margin:4px 4px 6px}
.rmode{display:flex;gap:10px;align-items:flex-start;border:1px solid var(--line);border-radius:10px;padding:10px;font-weight:400;cursor:pointer}
.rmode input{margin-top:3px;width:20px;height:20px;flex:none}
.rmode small{display:block;color:var(--muted);font-size:.8rem;margin-top:2px}
.rmode.danger b{color:var(--danger)}
.rmode:has(input:checked){border-color:var(--accent);background:#fafafa}
.restore-panel .btn.big{width:100%;margin-top:4px}
#restoreGo.danger-solid{background:var(--danger);border-color:var(--danger);color:#fff}

/* v0.9.8 red ✕ delete on list cards (44 px hit area, small glyph; red is the only colour) */
.quote-list li{position:relative}
.quote-list li:not(.empty) .ql-top{padding-right:34px}
.ql-del{position:absolute;top:0;right:0;width:44px;height:44px;display:grid;place-items:center;background:none;border:0;padding:0;margin:0;cursor:pointer;
  color:#d11a1a;font-size:1.05rem;font-weight:700;line-height:1;-webkit-tap-highlight-color:transparent;border-radius:0 var(--radius) 0 10px}
.ql-del span{display:grid;place-items:center;width:26px;height:26px;border-radius:50%}
.ql-del:active span,.ql-del:focus-visible span{background:#fdeaea}
/* v0.9.8 supplier placeholder */
.sup-select.sup-none{color:#8a8a8a;font-style:italic}
.sup-select.sup-need{outline:2px solid #d11a1a;outline-offset:1px}
.sup-select option{color:#111;font-style:normal}
.restore-modes .rmode{display:flex!important;flex-direction:row;grid-template-columns:none}
.restore-modes .rmode input[type=radio]{-webkit-appearance:radio;appearance:auto;width:22px;height:22px;min-height:0;min-width:22px;padding:0;margin:2px 0 0;border:0;border-radius:50%;box-shadow:none;accent-color:#111;flex:none}
.restore-modes .rmode.danger input[type=radio]{accent-color:var(--danger)}
.restore-modes .rmode span{flex:1}

/* v0.9.9 Photos */
.ph-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:10px}
.ph-actions .btn{display:flex;align-items:center;justify-content:center;text-align:center;cursor:pointer;min-height:52px}
.ph-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
@media (min-width:700px){.ph-grid{grid-template-columns:repeat(5,1fr)}}
.ph-tile{position:relative;aspect-ratio:1/1;border:1px solid var(--line);border-radius:10px;overflow:hidden;padding:0;background:#f2f2f2;cursor:pointer;-webkit-tap-highlight-color:transparent}
.ph-tile img{width:100%;height:100%;object-fit:cover;display:block}
.ph-tile.missing::after{content:"Not on this device";position:absolute;inset:0;display:grid;place-items:center;font-size:.7rem;color:var(--muted)}
.ph-tag{position:absolute;top:5px;left:5px;background:#111;color:#fff;font-size:.66rem;font-weight:700;padding:2px 6px;border-radius:6px}
.ph-cap{position:absolute;left:0;right:0;bottom:0;background:rgba(0,0,0,.62);color:#fff;font-size:.7rem;padding:3px 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left}
.ph-btn{position:relative;min-width:40px;min-height:40px;padding:0 8px;font-size:1rem;flex:none}
.ph-btn .ph-n{position:absolute;top:-6px;right:-6px;background:#111;color:#fff;border-radius:999px;font-size:.65rem;font-weight:800;min-width:17px;height:17px;line-height:17px;padding:0 4px}
.ph-btn.has{border-color:#111}
.ph-view{width:100%;max-height:52vh;object-fit:contain;background:#111;border-radius:10px;display:block}
.ph-panel .btn.big{width:100%;margin-top:8px}
.ph-panel .danger-outline{min-height:48px}
/* v0.9.9 Nameplate */
.eq-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.np-scan{min-height:40px;white-space:nowrap}
.np-top{display:flex;gap:12px;align-items:flex-start;margin-bottom:6px}
.np-preview{width:92px;height:92px;object-fit:cover;border-radius:10px;background:#eee;flex:none}
.np-status{margin:4px 0 0}
.np-status.bad{color:#b31b1b;font-weight:600}
.np-form{display:grid;gap:8px;margin:6px 0 8px}
.np-row{display:flex;flex-direction:column;gap:3px}
.np-row .np-lbl{display:flex;align-items:center;gap:6px;font-size:.8rem}
.np-conf{font-size:.66rem;font-weight:800;padding:1px 6px;border-radius:6px;border:1px solid #111;text-transform:uppercase;letter-spacing:.3px}
.np-conf.ok{border:0;padding:0;font-size:.85rem}
.np-conf.check{background:#efefef}
.np-conf.low{border-color:#d11a1a;color:#d11a1a}
.np-row.np-low input,.np-row.np-empty input{border-color:#d11a1a}
.np-row.np-none input{border-style:dashed}
.np-note{color:var(--muted);font-size:.74rem;font-weight:500}
.np-typ{flex-direction:row!important;align-items:center;gap:10px;font-weight:600;padding:6px 2px}
.np-panel .btn.big{width:100%;margin-top:6px;display:flex;align-items:center;justify-content:center;cursor:pointer}

/* v0.9.9 hosting move banner (old flypod address only) */
.move-banner{margin:0 0 12px;padding:12px 14px;border:2px solid #111;border-radius:12px;background:#fff;font-size:.9rem;line-height:1.4}
.move-banner a{color:#111;font-weight:800;text-decoration:underline;word-break:break-all}
/* ---------- v0.9.12 Truck charge (fixed row under the parts list) + Settings - black & white ---------- */
.truck-box{margin-top:10px}
.part.truck-row{border:2px solid #111;background:#fff}
.part.truck-row .truck-pin{justify-content:center}
.part.truck-row .truck-pin small{display:block!important;font-size:.62rem;letter-spacing:.06em;text-transform:uppercase;color:#111;border:1px solid #111;border-radius:4px;padding:1px 4px}
.truck-name{font-size:1rem;font-weight:800;color:#111;padding:6px 0 0}
.truck-meta{gap:8px}
.truck-sup{color:#555}
.truck-need{font-size:.7rem;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:#fff;background:#111;border-radius:4px;padding:2px 6px}
.truck-unit{display:flex;align-items:center;justify-content:center;min-height:44px;color:#444;font-weight:600}
.cost-input.need-entry{border:2px dashed #111;background:#fff;font-weight:700}
.cost-input.need-entry::placeholder{color:#111;opacity:1;font-weight:700}
.part.truck-row.need .p-sub{color:#777}
.add-row{display:grid;grid-template-columns:1fr auto;gap:8px;margin-top:8px}
.add-row #addLine{margin:0}
.add-row .add-truck{border:2px solid #111;background:#fff;color:#111;font-weight:700;white-space:nowrap}
.add-row .add-truck[hidden]{display:none}
.add-row:has(.add-truck[hidden]){grid-template-columns:1fr}
.set-field{display:flex;flex-direction:column;gap:6px;margin:6px 0 4px}
.set-label{font-weight:700}
.money-in{display:flex;align-items:center;gap:8px;border:1px solid var(--line-strong,#bbb);border-radius:10px;padding:0 12px;background:#fff}
.money-in input{border:0;outline:0;min-height:48px;font-size:1.05rem;flex:1;background:transparent;padding:0}
.money-in:focus-within{border-color:#111;box-shadow:0 0 0 2px #111}
/* v0.9.13 coil cleaning: "Which coil?" prompt (B&W) + PM option */
.coil-ask { border: 2px solid #111; border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; background: #f4f4f4; color: #111; }
.coil-ask .coil-q { margin: 0 0 8px; font-size: 14px; line-height: 1.35; }
.coil-ask .coil-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.coil-ask .coil-btns .btn { min-height: 44px; font-weight: 600; }
.pm-coil button { min-height: 44px; }
/* v0.9.14 truck rate tag (B&W) */
.truck-meta .truck-rate { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid #111; border-radius: 6px; font-size: 12px; font-weight: 600; color: #111; background: #fff; }
.p-meta.ref-rate .ref-rate-tag { display: inline-block; padding: 1px 7px; border: 1px solid #111; border-radius: 6px; font-size: 12px; font-weight: 600; color: #111; background: #fff; }
/* v0.9.15: a hidden toast never catches taps */
.toast:not(.show), .toast:not(.show).has-action { pointer-events: none !important; }
/* v0.9.15: 'No live lookup' (Sheret) wraps / fits at 390 px */
.p-look { flex-wrap: wrap; min-width: 0; }
.p-look .find-btn.muted-btn { white-space: normal; line-height: 1.1; flex: 0 1 auto; min-width: 0; max-width: 100%; padding: 4px 8px; text-align: center; }

/* v0.9.17 standard-rate lines: no amount on screen (PDF only) */
.part .p-auto{display:flex;align-items:center;gap:10px;flex-wrap:wrap;grid-row:3;grid-column:2/-1;justify-content:flex-end;font-size:13px;color:#666;background:none;min-height:0}
@media (min-width:1100px){.part .p-auto{grid-row:auto;grid-column:span 2}}
.p-auto .auto-note{font-style:italic}
.link-btn.edit-price{background:none;border:1px solid #ccc;color:#111;padding:4px 10px;min-height:32px;font-weight:600}

/* v0.9.20 labour $/hr */
.lab-rate-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:13px;color:#666}
.lab-rate-row .auto-note{font-style:italic}
.lab-rate-in{display:flex;align-items:center;gap:6px;font-weight:600;color:#111}.lab-rate-in input{max-width:120px;min-height:44px;text-align:right}

/* ---------- v0.9.32 visual polish (design review fixes 1–12; 7 already landed in v0.9.31) ---------- */
/* Compact part cards on phones, landscape phones, tablets, and the desktop split
   view when the editor is not wide enough for a table row (v0.9.49: was 699px). */
@media (max-width: 1099px) {
  .part {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 44px;
    grid-template-areas: none;
    gap: 8px;
    padding: 10px 10px 10px 8px;
    align-items: start;
    overflow-x: hidden;
  }
  .p-inc, .p-desc, .p-qty, .p-unit, .p-del,
  .part .p-cost, .part label.p-cost, .part .p-sub, .part .p-auto,
  .p-metrics { grid-area: auto; }
  .p-inc { grid-column: 1; grid-row: 1 / 3; align-self: start; padding-top: 10px; min-width: 36px; }
  .p-inc small { display: none; }
  .p-desc { grid-column: 2; grid-row: 1; min-width: 0; gap: 6px; }
  .p-desc .desc-input { min-height: 44px; padding: 10px 12px; }
  .p-del { grid-column: 3; grid-row: 1; align-self: start; }
  .p-del .del-btn { width: 44px; min-width: 44px; min-height: 44px; }
  .p-look { flex-wrap: nowrap; gap: 6px; margin-top: 0; width: 100%; min-width: 0; }
  .p-look .sup-select {
    flex: 1 1 auto; min-width: 0 !important; max-width: none;
    min-height: 44px; padding: 4px 28px 4px 8px;
  }
  .p-look .find-btn {
    flex: 0 0 auto; min-height: 44px; min-width: 52px; padding: 0 10px; font-size: .88rem;
  }
  .p-look .ph-btn, .p-look .ph-btn.small {
    flex: 0 0 44px; min-height: 44px; min-width: 44px; width: 44px; padding: 0;
  }
  .p-metrics {
    grid-column: 1 / -1; grid-row: 2;
    display: flex; gap: 4px; align-items: center; min-width: 0;
  }
  .p-metrics .p-qty, .p-metrics .p-unit, .p-metrics .p-cost, .p-metrics .p-sub, .p-metrics .p-auto { display: flex; min-width: 0; }
  .p-metrics .qty-wrap { display: flex; gap: 4px; flex: 0 0 auto; }
  .qty-input, .tbd-btn, .unit-input, .unit-lbl, .cost-input { min-height: 44px; }
  .qty-input { width: 48px; text-align: center; padding-left: 4px; padding-right: 4px; font-variant-numeric: tabular-nums; }
  .tbd-btn { padding: 0 6px; font-size: .78rem; flex: 0 0 auto; min-width: 44px; }
  .p-metrics .p-unit { flex: 0 0 44px; }
  .p-metrics .unit-input { width: 44px; padding-left: 4px; padding-right: 4px; }
  .p-metrics .p-cost, .p-metrics label.p-cost {
    flex: 1 1 64px; flex-direction: row; gap: 0; min-width: 64px;
  }
  .p-cost .cost-lbl, .p-metrics .p-cost span { display: none; }
  .cost-input { max-width: none; width: 100%; padding: 8px 6px; }
  .p-metrics .p-sub {
    flex: 0 0 auto; min-width: 3.8em; max-width: 5em;
    justify-content: flex-end; font-size: .88rem; font-weight: 700; padding-right: 2px;
  }
  .p-metrics .p-auto { flex: 1 1 auto; justify-content: flex-end; gap: 8px; flex-wrap: nowrap; grid-row: auto; grid-column: auto; }
  .p-metrics .edit-price { min-height: 44px; min-width: 44px; padding: 0 10px; }
  .truck-meta .truck-sup { display: none; }
  .part.truck-row .truck-name { padding-top: 2px; }
  .part.truck-row .p-inc { grid-row: 1 / 3; }
}
@media (min-width: 1100px) {
  .p-metrics { display: contents; }
}

/* One Generate control: the bottom bar. Inline Repair/Scope duplicates are hidden. */
#generateScopeRepair, #generateScopeInline { display: none !important; }

/* PM: Generate is hidden, so don't leave a 3-column hole (Save + ⋯ only). */
body.editing-pm .action-bar, body.editing-takeoff .action-bar { grid-template-columns: 1fr 56px; }
@media (min-width: 700px) {
  body.editing-pm .action-bar { grid-template-columns: 1fr 56px; justify-content: stretch; }
}

/* Version once, brighter badge; drop the list-page repeat and the editor build hash */
.app-version, .editor-version { display: none !important; }
.top-version {
  color: #f0f0f0; background: #2a2a2a; border: 1px solid #5a5a5a;
  font-size: .72rem; font-weight: 700; padding: 2px 8px; letter-spacing: .02em;
}

/* Equipment title (Scan nameplate is a full-width primary below, v0.9.33) */
.eq-head { margin-top: 8px; align-items: center; }
.eq-head .subhead, .eq-title { margin: 0; }
@media (max-width: 699px) {
  .eq-electrical { grid-column: 1 / -1; }
  #eqElectrical { overflow-wrap: anywhere; }
}

/* Home list: quieter 1px tabs, smaller Complete, more room above the FAB */
.list-head h2 { font-size: 1.45rem; margin: 2px 0 12px; letter-spacing: -.02em; }
.seg.list-tabs { border-width: 1px; border-radius: 12px; margin: 0 0 12px; }
.list-tabs button { min-height: 46px; font-size: 1rem; font-weight: 700; }
.quote-list { gap: 12px; }
.ql-act.complete, .ql-act.duplicate, .ql-act.reopen {
  min-height: 44px; min-width: 0; padding: 0 12px;
  border-width: 1px; font-size: .9rem; font-weight: 700;
}
.ql-foot { margin-top: 8px; align-items: stretch; }
.fab { box-shadow: 0 8px 24px rgba(0,0,0,.28); }
@media (max-width: 999px) {
  body.route-list .fab { bottom: calc(88px + var(--sab)); }
  body.route-list .quote-list { padding-bottom: 200px; }
}

/* Saved-jobs Delete was a 48px square and clipped the word */
#learnList .lj-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  max-width: 100%; box-sizing: border-box; align-items: center;
}
#learnList .lj-txt { min-width: 0; }
#learnList .lj-del.del-btn {
  width: auto; min-width: 44px; min-height: 44px; padding: 0 12px;
  font-size: .9rem; font-weight: 700;
}
.learn-panel { padding-bottom: 8px; overflow-x: hidden; }

/* Settings: cap height, start at the title, grouped sections, sticky Done */
#settingsSheet .settings-panel {
  max-height: 92vh; display: flex; flex-direction: column;
  overflow: hidden; padding-bottom: 0;
}
#settingsSheet .sheet-handle {
  width: 36px; height: 4px; border-radius: 2px; background: #d0d0d0;
  margin: 8px auto 4px; flex: none;
}
#settingsSheet .sheet-title { flex: none; margin: 4px 4px 8px; }
#settingsSheet .settings-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 0 8px;
}
#settingsSheet .set-group {
  padding: 12px 0 14px; border-top: 1px solid var(--line);
}
#settingsSheet .set-group:first-child { border-top: 0; padding-top: 0; }
#settingsSheet .set-group > .set-label:first-child { margin: 0 0 8px; }
#settingsSheet .settings-foot {
  flex: none; background: #fff; border-top: 1px solid var(--line);
  padding: 4px 0 calc(10px + var(--sab));
}
#settingsSheet .settings-foot .sheet-item.cancel { min-height: 48px; }

/* Settings / More: "truck charge" on its own muted line; hide coming-soon */
.sheet-item small:not(.backup-sub) {
  display: block; font-weight: 500; font-size: .78rem; color: var(--muted); margin-top: 1px;
}
.soon-item, .totals.soon { display: none !important; }

/* Backup warning stays in the black/white/grey palette (no amber) */
.backup-note.warn { background: #f3f3f3; color: #444; }

/* Empty states: short roman sentences, not italic grey lectures */
.empty, .quote-list li.empty { font-style: normal; color: #666; }
.ph-actions, .ph-actions .btn { min-width: 0; }
.card { max-width: 100%; }

/* Scope status sits tighter now that the inline Generate is gone */
.scope-status { margin-top: 0; margin-bottom: 8px; }
#scopeBadge { margin-bottom: 8px; }
.action-bar { padding: 10px calc(12px + var(--sar)) calc(10px + var(--sab)) calc(12px + var(--sal)); gap: 8px; }
.action-bar .btn { min-height: 50px; border-radius: 12px; }


/* v0.9.32 monochrome inline SVG icons + labour-rate tidy */
.ico {
  width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.18em;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
  flex: none; pointer-events: none;
}
.btn[data-ico], label[data-ico], .sheet-item[data-ico], .import-btn[data-ico] {
  display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px;
}
.btn.block[data-ico], .import-btn[data-ico] { display: flex; justify-content: center; }
.sheet-item[data-ico] { display: flex; justify-content: flex-start; gap: 10px; }
.sheet-item.accent-item[data-ico] { justify-content: center; }
.ph-actions .btn[data-ico] { justify-content: center; }
[data-ico][hidden], .btn[data-ico][hidden], label[data-ico][hidden], .sheet-item[data-ico][hidden] { display: none !important; }
.icon-btn.back .ico { width: 22px; height: 22px; display: block; margin: 0 auto; stroke-width: 2.2; }
body.route-editor .icon-btn.back { display: grid; place-items: center; }
.kb-ico { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.kb-ico .ico { width: 1.15em; height: 1.15em; }
.np-scan { display: inline-flex; align-items: center; gap: 6px; }
.ph-btn { display: inline-flex; align-items: center; justify-content: center; }
.ph-btn .ico { width: 20px; height: 20px; }

/* Labour $/hr + Contract/Non-contract stay visible */
#labRateWrap { margin-top: 14px; }
#labRateWrap .rate-label { margin-bottom: 8px; }
#labRateWrap .seg { width: 100%; }
.lab-rate-row { margin-top: 10px; font-size: 14px; color: #111; gap: 10px; }

/* v0.9.33: no Edit rate / truck Edit price; legacy stored amounts are read-only */
.lab-rate-view { font-size: 1.05rem; font-weight: 700; color: #111; font-variant-numeric: tabular-nums; }
.lab-rate-row { margin-top: 2px; }
#setLab_noncontract, label[for="setLab_noncontract"][hidden] { display: none !important; }

.truck-stored { display: flex; align-items: center; gap: 6px; font-weight: 600; color: #111; }
.truck-amt-ro { font-variant-numeric: tabular-nums; }

/* v0.9.33: prominent full-width Scan nameplate at the top of Equipment */
.eq-title { margin: 8px 0 10px; }
.np-scan-panel {
  background: #f3f3f3; border-radius: 12px;
  padding: 10px 10px 8px; margin: 0 0 14px;
}
#eqBlock .np-scan {
  display: flex; width: 100%; min-height: 52px; margin: 0;
  background: #111; border-color: #111; color: #fff;
  font-weight: 700; font-size: 1.05rem;
  justify-content: center; align-items: center; gap: 10px;
  white-space: nowrap; border-radius: 12px;
}
#eqBlock .np-scan .ico { width: 1.3em; height: 1.3em; stroke-width: 2; }
.np-scan-hint {
  margin: 8px 4px 2px; font-size: .82rem; font-weight: 500;
  color: #666; line-height: 1.3;
}


/* v0.9.49: long part labels must wrap as normal text; supplier / Find / camera
   drop to their own line when the description column is narrow.
   Root cause: at ≥700px the table-like parts grid (and a nowrap .p-desc row
   plus .sup-select min-width:150px) starved the description column down to
   ~30px, wrapping labels such as "Evacuation materials (vacuum pump oil,
   core tools, micron gauge consumables)" to 1–2 characters per line — on
   landscape phones, tablets, and the desktop split view. Portrait phones
   already used stacked cards and were fine.
   Card layout now runs through 1099px; the table layout starts at 1100px
   with a 14rem minimum on the description column, and lookup controls wrap
   to their own line. */
@media (max-width: 1099px) {
  .parts-head { display: none; }
}
@media (min-width: 1100px) {
  .p-desc {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
  }
  .p-desc .desc-input {
    flex: 1 1 14rem;
    min-width: min(14rem, 100%);
    max-width: 100%;
  }
  .p-desc .badge.opt { order: 2; flex: 0 0 auto; }
  .p-look {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    margin-top: 0;
    order: 3;
  }
  .p-look .sup-select {
    min-width: 0;
    max-width: 100%;
    flex: 1 1 10rem;
  }
  .p-meta, .p-desc .ref-rate { flex: 1 1 100%; width: 100%; min-width: 0; order: 4; }
}

/* ---------- v0.9.50 Help & feedback chat ---------- */
.fb-panel{display:flex;flex-direction:column}
.fb-log{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:4px 2px 10px;display:flex;flex-direction:column;gap:8px}
.fb-intro{color:var(--muted);font-size:.88rem;margin:0 0 4px;padding:10px 12px;background:var(--accent-soft);border-radius:10px}
.fb-msg{max-width:86%;padding:9px 12px;border-radius:14px;font-size:.95rem;line-height:1.38;word-wrap:break-word;overflow-wrap:anywhere}
.fb-msg p{margin:0;white-space:pre-wrap}
.fb-me{align-self:flex-end;background:var(--ink);color:#fff;border-bottom-right-radius:4px}
.fb-bot{align-self:flex-start;background:#fff;border:1px solid var(--line);border-bottom-left-radius:4px}
.fb-tag{display:block;margin-top:4px;font-size:.7rem;letter-spacing:.04em;text-transform:uppercase;opacity:.7}
.fb-compose{flex:none;border-top:1px solid var(--line);padding:8px 0 calc(8px + var(--sab));background:#fff}
.fb-chips{display:flex;gap:6px;overflow-x:auto;padding-bottom:6px}
.fb-chips button{font:inherit;font-size:.82rem;font-weight:600;min-height:34px;padding:0 12px;border-radius:17px;border:1px solid var(--line-strong);background:#fff;color:var(--text);cursor:pointer;flex:none}
.fb-chips button.on{background:var(--ink);border-color:var(--ink);color:#fff}
.fb-name{min-height:40px;padding:8px 12px;margin-bottom:6px}
.fb-row{display:flex;gap:8px;align-items:flex-end}
.fb-text{flex:1;resize:none;min-height:var(--tap);max-height:30vh;line-height:1.35}
.fb-send{flex:none}
.fb-status{margin:6px 2px 0;min-height:1em}
.fb-status:empty{display:none}
.fb-set-btn{text-align:center;font-weight:600;color:var(--text)}

/* v0.9.51 tech view / office mode */
.tech-mode .office-only{display:none!important}
.office-mode .tech-only{display:none!important}
.office-unlock{display:flex;gap:8px;align-items:flex-end;flex-wrap:wrap}
.office-unlock .set-field{flex:1;min-width:140px}
#officeLock{margin-top:6px}
.pdf-queue{margin:4px 2px 8px;font-size:12.5px;color:#555}
.std-tag{color:#666;font-size:11.5px;line-height:1.2}
