
    :root {
      --navy: #0B3251;
      --blue: #1F80C4;
      --red: #CE3143;
      --red-soft: #FDECEE;
      --amber: #B86A00;
      --amber-soft: #FFF4E0;
      --ok: #1F7A4D;
      --ok-soft: #E8F6EE;
      --bg: #E8EEF3;
      --card: #FFFFFF;
      --ink: #0B3251;
      --muted: #5B6E7D;
      --line: #D3DCE4;
      --shadow: 0 1px 3px rgba(11,50,81,.08);
      --tap: 44px;
    }
    * { box-sizing: border-box; }
    html, body { margin: 0; padding: 0; background: #C5D0DA; color: var(--ink);
      font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
      -webkit-font-smoothing: antialiased; }
    body { min-height: 100vh; }
    .stage {
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 16px 12px 24px;
    }
    .preview-note {
      width: 390px;
      max-width: 100%;
      font-size: 12px;
      color: #31485A;
      margin: 0 0 8px;
      line-height: 1.4;
    }
    .phone {
      width: 390px;
      max-width: 100%;
      height: 844px;
      min-height: 844px;
      max-height: 844px;
      background: var(--bg);
      border: 1px solid #9AADB8;
      border-radius: 28px;
      overflow: hidden;
      box-shadow: 0 12px 40px rgba(11,50,81,.18);
      display: flex;
      flex-direction: column;
      position: relative;
    }
    header.app-bar {
      background: var(--navy);
      color: #fff;
      padding: 12px 16px 14px;
      display: flex;
      align-items: center;
      gap: 10px;
      min-height: 64px;
      flex-shrink: 0;
    }
    header.app-bar img.logo {
      height: 28px;
      width: auto;
      max-width: 160px;
      object-fit: contain;
      background: #fff;
      border-radius: 4px;
      padding: 3px 6px;
      flex-shrink: 0;
    }
    header.app-bar .titles { min-width: 0; flex: 1; }
    header.app-bar h1 {
      margin: 0;
      font-size: 16px;
      font-weight: 700;
      letter-spacing: .01em;
      line-height: 1.2;
      overflow-wrap: anywhere;
    }
    header.app-bar p {
      margin: 2px 0 0;
      font-size: 12px;
      color: #C9D7E3;
      line-height: 1.3;
      overflow-wrap: anywhere;
    }
    header.app-bar button.linkish {
      background: transparent;
      border: 0;
      color: #fff;
      font-size: 13px;
      font-weight: 600;
      padding: 8px 4px;
      min-height: var(--tap);
      cursor: pointer;
      flex-shrink: 0;
    }
    .sample-banner {
      background: #FFF4E0;
      color: #6A3E00;
      font-size: 11px;
      line-height: 1.35;
      padding: 7px 16px;
      border-bottom: 1px solid #F0D39A;
      flex-shrink: 0;
    }
    main {
      flex: 1;
      min-height: 0;
      padding: 12px 14px 88px;
      overflow-x: hidden;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }
    h2 { margin: 0 0 8px; font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
    .lede { margin: 0 0 16px; font-size: 14px; color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; }
    .who-grid { display: grid; gap: 10px; }
    .who-btn {
      display: flex; align-items: center; gap: 12px;
      background: var(--card); border: 1px solid var(--line);
      border-radius: 14px; padding: 14px 14px;
      min-height: 68px; width: 100%; text-align: left;
      cursor: pointer; box-shadow: var(--shadow);
      color: var(--ink); font: inherit;
    }
    .who-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
    .who-btn .avatar {
      width: 44px; height: 44px; border-radius: 50%;
      background: var(--navy); color: #fff;
      display: flex; align-items: center; justify-content: center;
      font-weight: 700; font-size: 16px; flex-shrink: 0;
    }
    .who-btn.office .avatar { background: var(--blue); }
    .who-btn .meta { min-width: 0; }
    .who-btn .meta strong { display: block; font-size: 16px; overflow-wrap: anywhere; }
    .who-btn .meta span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }

    .cat {
      margin: 18px 0 8px;
      font-size: 12px; font-weight: 700; letter-spacing: .04em;
      text-transform: uppercase; color: var(--blue);
    }
    .cat:first-child { margin-top: 4px; }
    .item-row {
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 10px 10px 10px 12px;
      margin: 0 0 8px;
      box-shadow: var(--shadow);
    }
    .item-row.low { border-color: #E8C070; background: #FFFaf0; }
    .item-row.out { border-color: #E8A0A8; background: var(--red-soft); }
    .item-row .top { display: flex; gap: 8px; align-items: flex-start; }
    .item-row .name {
      flex: 1; min-width: 0;
      font-size: 14px; font-weight: 650; line-height: 1.3;
      overflow-wrap: anywhere;
    }
    .pill {
      flex-shrink: 0;
      font-size: 11px; font-weight: 700;
      padding: 3px 8px; border-radius: 999px;
      line-height: 1.2; white-space: nowrap;
    }
    .pill.ok { background: var(--ok-soft); color: var(--ok); }
    .pill.low { background: var(--amber-soft); color: var(--amber); }
    .pill.out { background: var(--red-soft); color: var(--red); }
    .item-row .sub {
      margin: 3px 0 8px;
      font-size: 12px; color: var(--muted); line-height: 1.35;
      overflow-wrap: anywhere;
    }
    .stepper {
      display: flex; align-items: center; gap: 8px;
    }
    .stepper button {
      width: var(--tap); height: var(--tap);
      border-radius: 10px; border: 0; cursor: pointer;
      font-size: 22px; font-weight: 700; line-height: 1;
      flex-shrink: 0;
    }
    .stepper button.minus { background: var(--navy); color: #fff; }
    .stepper button.plus { background: var(--blue); color: #fff; }
    .stepper button:disabled { opacity: .35; cursor: default; }
    .stepper .qty {
      min-width: 48px; text-align: center;
      font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums;
    }
    .stepper .unit {
      font-size: 11px; color: var(--muted); margin-left: 2px;
      overflow-wrap: anywhere; max-width: 110px; line-height: 1.2;
    }

    .van-summary {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 8px;
      margin: 0 0 14px;
    }
    .van-card {
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 10px 8px;
      text-align: center;
      box-shadow: var(--shadow);
      min-width: 0;
    }
    .van-card h3 { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
    .van-card .reg { font-size: 10px; color: var(--muted); margin: 2px 0 6px; overflow-wrap: anywhere; line-height: 1.3; }
    .van-card .stat { font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
    .van-card .stat strong { font-size: 16px; display: block; }
    .van-card .stat.bad strong { color: var(--red); }
    .van-card .stat.warn strong { color: var(--amber); }

    .table-wrap {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--card);
      margin-bottom: 12px;
    }
    table.grid {
      border-collapse: collapse;
      width: 100%;
      min-width: 360px;
      font-size: 12px;
    }
    table.grid th, table.grid td {
      padding: 8px 6px;
      text-align: center;
      border-bottom: 1px solid var(--line);
      vertical-align: middle;
      font-variant-numeric: tabular-nums;
    }
    table.grid th {
      background: var(--navy); color: #fff;
      font-weight: 650; font-size: 11px;
      position: sticky; top: 0;
    }
    table.grid th.item, table.grid td.item {
      text-align: left;
      padding-left: 10px;
      width: 42%;
      overflow-wrap: anywhere;
      line-height: 1.3;
    }
    table.grid tr.low td { background: var(--amber-soft); }
    table.grid tr.out td { background: var(--red-soft); }
    table.grid td.bad { color: var(--red); font-weight: 700; }
    table.grid td.warn { color: var(--amber); font-weight: 700; }
    table.grid caption {
      caption-side: top; text-align: left;
      font-size: 12px; color: var(--muted);
      padding: 0 0 6px; background: transparent;
    }

    .group { margin: 0 0 16px; }
    .group h3 {
      margin: 0 0 8px; font-size: 15px;
      padding: 6px 0; border-bottom: 2px solid var(--blue);
      overflow-wrap: anywhere;
    }
    .reorder-row {
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 10px 12px;
      margin: 0 0 8px;
      box-shadow: var(--shadow);
    }
    .reorder-row h4 { margin: 0 0 4px; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
    .reorder-row p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.4; overflow-wrap: anywhere; }
    .need {
      margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--red);
      overflow-wrap: anywhere;
    }
    .empty {
      background: var(--ok-soft); color: var(--ok);
      padding: 14px; border-radius: 12px; font-size: 14px; line-height: 1.4;
    }

    .transfer-bar {
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 12px;
      margin: 0 0 14px;
      box-shadow: var(--shadow);
    }
    .transfer-bar label {
      display: block; font-size: 12px; font-weight: 650; margin: 0 0 6px;
    }
    select, input[type="number"] {
      width: 100%;
      min-height: var(--tap);
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 8px 10px;
      font: inherit; font-size: 15px;
      background: #fff; color: var(--ink);
    }
    .send-btn {
      margin-top: 8px;
      width: 100%;
      min-height: var(--tap);
      background: var(--blue); color: #fff;
      border: 0; border-radius: 10px;
      font-weight: 700; font-size: 15px; cursor: pointer;
    }
    .send-btn:disabled { opacity: .4; cursor: default; background: var(--navy); }
    .toast {
      position: absolute; left: 16px; right: 16px; bottom: 80px;
      background: var(--navy); color: #fff;
      padding: 12px 14px; border-radius: 12px;
      font-size: 13px; line-height: 1.35;
      overflow-wrap: anywhere;
      box-shadow: 0 8px 24px rgba(11,50,81,.3);
      z-index: 20;
      display: none;
    }
    .toast.show { display: block; }

    nav.tabbar {
      position: absolute; left: 0; right: 0; bottom: 0;
      background: #fff;
      border-top: 1px solid var(--line);
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      padding: 4px 4px 10px;
      z-index: 10;
    }
    nav.tabbar button {
      background: none; border: 0; cursor: pointer;
      min-height: 52px; font: inherit;
      font-size: 11px; font-weight: 650; color: var(--muted);
      padding: 6px 4px; line-height: 1.2;
      overflow-wrap: anywhere;
    }
    nav.tabbar button.active { color: var(--navy); }
    nav.tabbar button span { display: block; font-size: 16px; margin-bottom: 2px; }

    .hidden { display: none !important; }
    footer.legal {
      width: 390px; max-width: 100%;
      font-size: 11px; color: #3E5463;
      margin-top: 10px; line-height: 1.4;
    }
  
/* Live app shell (not the phone preview frame) */
html, body { height: 100%; }
body.app {
  margin: 0;
  background: #e8eef3;
  min-height: 100%;
}
.app-shell {
  max-width: 1100px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg, #e8eef3);
  position: relative;
}
.app-shell header.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
}
.app-shell main {
  flex: 1;
  overflow: auto;
  padding-bottom: 96px;
}
.app-shell nav#office-nav {
  position: relative;
  bottom: auto;
  left: auto;
  right: auto;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(11,50,81,.08);
}
.login-card label { display: block; font-weight: 600; color: var(--navy); margin: 12px 0 6px; }
.login-card input[type=email] {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid #c5d0da;
  border-radius: 10px;
  font: inherit;
  color: var(--navy);
}
.btn-primary {
  display: block;
  width: 100%;
  margin-top: 16px;
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary:disabled { opacity: .6; }
.flash { margin-top: 12px; padding: 10px 12px; border-radius: 10px; }
.flash.ok { background: #e7f6ed; color: #146c2e; }
.flash.err { background: #fde8ea; color: var(--red); }
.hidden { display: none !important; }
.desk-note { display: none; }
@media (min-width: 800px) {
  .app-shell { min-height: 100vh; box-shadow: 0 0 0 1px #d5dee6; }
  .desk-note { display: block; color: var(--muted); font-size: 13px; margin: 0 20px 8px; }
}

body.app { background: var(--bg); }
.app-shell {
  position: relative;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 1px var(--line);
}
.app-shell header.app-bar,
.app-shell .sample-banner { flex-shrink: 0; }
.app-shell main {
  flex: 1;
  min-height: 0;
  padding: 12px 14px 88px;
  overflow-y: auto;
}
.login-card label { display: block; font-size: 12px; font-weight: 650; margin: 12px 0 6px; }
.login-card input[type=email] {
  width: 100%; min-height: var(--tap);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; font: inherit; font-size: 15px;
}
.flash { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.err { background: var(--red-soft); color: var(--red); }
@media (min-width: 900px) {
  body.app { background: #c5d0da; }
  .app-shell { max-width: 980px; min-height: 100vh; }
}


/* Live app: tab bar is part of the column, not absolutely placed, so the list
   scrolls in main and the bar stays on screen. */
.app-shell {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
.app-shell nav.tabbar,
.app-shell nav#office-nav,
.app-shell nav#tech-nav {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  flex-shrink: 0;
}
.app-shell nav.tabbar.hidden { display: none !important; }

/* Technician tab bar has two tabs (My van | Store). Office stays 3-col. */
nav#tech-nav {
  grid-template-columns: 1fr 1fr;
}

/* Technician Store tab: name, unit, and quantity only — no status pills. */
.item-row.store-read .sub { margin-bottom: 0; }
.item-row.store-read .store-qty {
  flex-shrink: 0;
  text-align: right;
  align-self: center;
  line-height: 1.1;
}
.item-row.store-read .store-qty .qty {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.item-row.store-read .store-qty .unit {
  font-size: 11px;
  color: var(--muted);
}

/* Desktop: keep the dashboard table as one grid. overflow-x + sticky
   <th> was splitting the header from the body on wide screens. */
.app-shell table.grid {
  width: 100%;
  table-layout: fixed;
}
.app-shell table.grid thead { display: table-header-group; }
.app-shell table.grid tbody { display: table-row-group; }
.app-shell table.grid th { position: static; }
.app-shell .table-wrap { overflow-x: visible; }
@media (max-width: 600px) {
  .app-shell .table-wrap { overflow-x: auto; }
  .app-shell table.grid { table-layout: auto; min-width: 360px; }
  .app-shell table.grid th { position: sticky; top: 0; }
}


.van-pick-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
button.van-pick {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  width: 100%; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; font: inherit; color: var(--navy); cursor: pointer;
}
button.van-pick strong { font-size: 18px; }
button.van-pick span { color: var(--muted); font-size: 13px; }
button.van-pick:disabled { opacity: .5; cursor: default; }
button.van-pick:not(:disabled):hover { border-color: var(--blue); }
.van-card label.assign { display: block; margin-top: 10px; font-size: 12px; font-weight: 650; color: var(--muted); }
.van-card label.assign select {
  display: block; width: 100%; margin-top: 4px;
  min-height: 40px; border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 8px; font: inherit; color: var(--navy); background: #fff;
}

.login-card + .login-card { margin-top: 12px; }
.login-card input#code {
  width: 100%;
  min-height: var(--tap);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.35em;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--navy);
  box-sizing: border-box;
}

/* ================= RS Staff app: shell, home, sections ================= */
:root { --rs-red: #C8202F; --navy-2: #12406A; --soft: #F3F6F9; }
[hidden] { display: none !important; }
header.app-bar { border-bottom: 3px solid var(--rs-red); }
header.app-bar .home-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex-shrink: 0;
  background: rgba(255,255,255,.12); color: #fff;
  border: 1px solid rgba(255,255,255,.25); border-radius: 10px; cursor: pointer;
}
header.app-bar .home-btn:focus-visible { outline: 3px solid #8CC4EE; outline-offset: 2px; }
.app-shell[data-section="quotes"] header.app-bar img.logo,
.app-shell[data-section="admin"] header.app-bar img.logo { display: none; }
@media (min-width: 700px) {
  .app-shell[data-section="quotes"] header.app-bar img.logo,
  .app-shell[data-section="admin"] header.app-bar img.logo { display: block; }
}

.home-hi { margin: 6px 0 2px; font-size: 22px; font-weight: 750; color: var(--navy); }
.tiles { display: grid; gap: 10px; }
@media (min-width: 700px) { .tiles { grid-template-columns: 1fr 1fr; gap: 14px; } }
button.tile {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 14px; min-height: 84px; text-align: left; cursor: pointer;
  font: inherit; color: var(--navy); box-shadow: var(--shadow);
}
button.tile:not(.soon):hover { border-color: var(--blue); }
button.tile:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.tile-ic {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center;
}
.tile-txt { flex: 1; min-width: 0; }
.tile-txt strong { display: block; font-size: 16px; }
.tile-txt span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.tile-go { font-size: 26px; color: var(--blue); line-height: 1; }
button.tile.soon { background: #F1F4F7; color: #7B8B98; cursor: default; box-shadow: none; border-style: dashed; }
button.tile.soon .tile-ic { background: #C9D3DC; }
.tile-soon { font-size: 11px; font-weight: 700; background: #E1E7ED; color: #5B6E7D; border-radius: 999px; padding: 4px 8px; white-space: nowrap; }

/* ---------- Quotes ---------- */
.app-shell.wide main { padding-bottom: 110px; }
@media (min-width: 900px) {
  .app-shell.wide { max-width: 1240px; }
  .app-shell.wide main { padding: 16px 18px 24px; }
}
.q-wrap { display: block; }
.q-col.build > * + * { margin-top: 10px; }
.q-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.q-h { margin: 0 0 10px; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: #5B6E7D; font-weight: 750; }
.q-label { display: block; font-size: 12px; color: #5B6E7D; margin-bottom: 4px; }
.q-jobrow { display: flex; gap: 8px; align-items: flex-end; }
.q-jobfield { flex: 1; min-width: 0; }
.q-field { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; min-height: 44px; background: var(--soft); }
.q-field .hash { color: var(--blue); font-weight: 700; }
.q-field input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 16px; font-weight: 700; color: var(--navy); padding: 8px 0; outline: none; }
.q-pill.ok { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; color: var(--ok); background: var(--ok-soft); border: 1px solid #BFE3CE; border-radius: 999px; padding: 2px 8px 2px 5px; white-space: nowrap; }
.q-pill.ok svg { width: 13px; height: 13px; }
.q-btn-sm { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 0; background: var(--navy); color: #fff; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.q-note { font-size: 12.5px; color: #6A3E00; background: var(--amber-soft); border-radius: 8px; padding: 7px 10px; margin: 8px 0 0; }
.q-note.strong { margin: 0 0 10px; }
.q-fields { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
.q-fields label, .q-add label { display: block; font-size: 12px; color: #5B6E7D; font-weight: 600; }
.q-fields input, .q-add input { display: block; width: 100%; margin-top: 4px; min-height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font: inherit; font-size: 15px; color: var(--navy); }
@media (min-width: 560px) { .q-fields { grid-template-columns: 1fr 1fr; } .q-fields .wide { grid-column: span 1; } }
.q-details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-top: 12px; }
.q-details .k { font-size: 11.5px; color: #5B6E7D; }
.q-details .v { font-size: 14.5px; font-weight: 650; overflow-wrap: anywhere; }
.q-details .v.muted { font-weight: 500; color: #31485A; }
.q-link { background: none; border: 0; color: var(--blue); font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer; padding: 10px 0 0; min-height: 36px; }
.q-link.add { display: block; padding-top: 12px; }
.q-jobs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.q-job { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 92px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--navy); font: inherit; font-size: 13px; font-weight: 700; text-align: center; line-height: 1.2; cursor: pointer; }
.q-job.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.q-job.has-work:not(.active) { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
@media (min-width: 900px) {
  .q-job { flex-direction: row; min-height: 44px; gap: 8px; font-size: 13px; }
  .q-job svg { width: 18px; height: 18px; }
}
.q-steps { display: grid; gap: 8px; }
@media (min-width: 560px) { .q-steps.two { grid-template-columns: 1fr 1fr; } }
.q-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; padding: 10px 10px 10px 12px; background: var(--soft); }
.q-row .info { flex: 1; min-width: 0; }
.q-row .name { font-size: 14.5px; font-weight: 700; line-height: 1.25; }
.q-row .hint { font-size: 12px; color: #5B6E7D; margin-top: 2px; line-height: 1.3; }
.q-row .price { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-toggles { display: grid; gap: 8px; margin-top: 8px; }
.q-row.tog:not(.on) { background: #fff; }
.q-step { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; flex-shrink: 0; }
.q-step button { width: 42px; min-height: 42px; border: 0; background: #fff; font-size: 20px; font-weight: 700; color: var(--navy); cursor: pointer; }
.q-step button:disabled { color: #B9C5CF; cursor: default; }
.q-step .val { min-width: 42px; display: flex; align-items: center; justify-content: center; font-weight: 750; font-size: 17px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.q-switch { width: 50px; height: 30px; border-radius: 999px; border: 0; background: #C5D0DA; position: relative; cursor: pointer; flex-shrink: 0; padding: 0; }
.q-switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .12s; }
.q-switch.on { background: var(--navy); }
.q-switch.on i { left: 23px; }
.q-price { display: flex; align-items: center; gap: 2px; font-weight: 700; flex-shrink: 0; }
.q-price .q-from { font-size: .72rem; font-weight: 600; color: var(--muted, #667); margin-right: 4px; }
.q-price input { width: 84px; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-weight: 700; text-align: right; color: var(--navy); }
.q-x { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 20px; color: var(--red); cursor: pointer; }
.q-add { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; padding: 10px; border: 1px dashed var(--line); border-radius: 11px; }
.q-add .wide { grid-column: 1 / -1; }
.q-add-btns { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; }
.q-foot { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
@media (min-width: 560px) { .q-foot { grid-template-columns: 1.4fr 1fr; } }
.q-margin { border-radius: 11px; padding: 9px 12px; background: var(--soft); border: 1px solid var(--line); }
.q-margin:empty { display: none; }
.q-margin .t { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; font-weight: 750; }
.q-margin .v { font-weight: 700; font-size: 14px; margin-top: 2px; }
.q-margin.healthy { background: var(--ok-soft); border-color: #BFE3CE; color: var(--ok); }
.q-margin.tight { background: var(--amber-soft); border-color: #F0D39A; color: var(--amber); }
.q-margin.low { background: var(--red-soft); border-color: #E8A0A8; color: var(--red); }
.q-queue-link { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: inherit; font-weight: 700; color: var(--blue); cursor: pointer; }

/* Summary panel */
.q-summary { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); display: none; }
.q-sum-head h2 { margin: 0; font-size: 18px; }
.q-sum-head p { margin: 3px 0 10px; font-size: 12.5px; color: #5B6E7D; }
.q-warn { background: #FFF6DD; border: 1px solid #F0D39A; color: #7A4A00; font-size: 13px; font-weight: 650; border-radius: 9px; padding: 9px 12px; text-align: center; }
.q-warn.info { background: #EAF3FB; border-color: #BFD9EE; color: #1B5A8A; }
.q-lines { border: 1px solid var(--line); border-radius: 11px; margin-top: 10px; overflow: hidden; }
.q-lines.plain { border: 0; border-radius: 0; border-top: 1px solid var(--line); margin-top: 12px; }
.q-line { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; padding: 10px 12px; }
.q-lines.plain .q-line { padding: 10px 0; }
.q-line + .q-line { border-top: 1px solid var(--line); }
.q-line .code { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); font-weight: 750; }
.q-line .desc { font-size: 14px; font-weight: 600; margin-top: 1px; overflow-wrap: anywhere; }
.q-line .amt { font-weight: 750; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.q-line .amt small { display: block; font-size: 11px; color: #5B6E7D; font-weight: 500; }
.q-empty { margin: 0; padding: 14px; color: #5B6E7D; font-size: 14px; }
.q-tot { margin-top: 12px; }
.q-tot .r { display: flex; justify-content: space-between; font-size: 14px; color: #31485A; padding: 2px 4px; font-variant-numeric: tabular-nums; }
.q-tot .r span:last-child { font-weight: 700; color: var(--navy); }
.q-tot .r.big { border-top: 2px solid var(--navy); margin-top: 8px; padding-top: 10px; font-size: 16px; font-weight: 750; color: var(--navy); }
.q-tot .r.big span:last-child { font-size: 24px; font-weight: 800; }
.q-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.q-chip { font-size: 12px; background: #EDF1F5; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; color: #31485A; font-weight: 600; }
.q-alert { margin: 10px 0 0; font-size: 13px; background: var(--amber-soft); color: #6A3E00; border-radius: 9px; padding: 8px 10px; }
.q-flags { margin-top: 10px; font-size: 12.5px; color: #31485A; background: var(--soft); border-radius: 9px; padding: 8px 10px; }
.q-flags summary { cursor: pointer; font-weight: 700; }
.q-flags ul { margin: 6px 0 0; padding-left: 18px; }
.q-actions { display: grid; gap: 8px; margin-top: 14px; }
.q-primary { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; border: 0; border-radius: 11px; background: var(--rs-red); color: #fff; font: inherit; font-size: 15.5px; font-weight: 750; cursor: pointer; text-decoration: none; padding: 0 14px; }
.q-primary:disabled { opacity: .5; cursor: default; }
.q-secondary { min-height: 48px; border: 1.5px solid var(--navy); border-radius: 11px; background: #fff; color: var(--navy); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.q-secondary:disabled { opacity: .5; }
.q-actions .q-link { padding: 6px 0; text-align: center; }

/* Mobile bottom bar */
.q-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(11,50,81,.08); }
.q-bar .tot { flex: 1; min-width: 0; }
.q-bar .tot strong { display: block; font-size: 19px; font-weight: 800; white-space: nowrap; }
.q-bar .tot span { display: block; font-size: 12px; color: #5B6E7D; white-space: normal; line-height: 1.3; overflow: visible; }
.q-bar .tot.contract-tot strong { font-size: 17px; white-space: normal; }
.q-bar .tot.contract-tot span { white-space: normal; line-height: 1.3; overflow: visible; }
.q-bar .q-primary { min-height: 52px; font-size: 15px; flex-shrink: 0; }
@media (min-width: 431px) { .q-bar { left: 50%; right: auto; width: 430px; transform: translateX(-50%); } }
.q-wrap.reviewing .q-col.build, .q-wrap.reviewing .q-bar { display: none; }
.q-wrap.reviewing .q-summary { display: block; }

@media (min-width: 900px) {
  .q-wrap { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .q-summary, .q-wrap.reviewing .q-summary { display: block; position: sticky; top: 0; }
  .q-wrap.reviewing .q-col.build { display: block; }
  .q-bar, .q-wrap.reviewing .q-bar { display: none; }
  .q-summary .q-link[data-act="back"] { display: none; }
}

/* Done screen */
.q-done { max-width: 560px; margin: 0 auto; }
.q-ok { display: flex; gap: 12px; align-items: center; background: #E7F5EC; border: 1px solid #BFE3CE; border-radius: 14px; padding: 14px; color: #155C38; margin-bottom: 12px; }
.q-ok svg { width: 38px; height: 38px; padding: 8px; background: #1F7A4D; color: #fff; border-radius: 50%; flex-shrink: 0; }
.q-ok strong { display: block; font-size: 16.5px; }
.q-ok span { display: block; font-size: 13.5px; margin-top: 2px; }
.q-ok.preview { background: #FFF6DD; border-color: #F0D39A; color: #6A3E00; }
.q-ok.preview svg { background: #B86A00; }
.q-draft-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.q-draft-top h2 { margin: 0; font-size: 24px; }
.q-badge { font-size: 12px; font-weight: 750; background: #1F7A4D; color: #fff; border-radius: 999px; padding: 5px 11px; white-space: nowrap; }
.q-badge.muted { background: #E1E7ED; color: #31485A; }
.q-meta { margin: 8px 0 12px; font-size: 14px; color: #31485A; line-height: 1.5; }
.q-sm8 { display: flex; gap: 10px; align-items: center; background: #EAF3FB; border: 1px solid #BFD9EE; border-radius: 11px; padding: 10px 12px; color: var(--navy); }
.q-sm8 svg { color: var(--blue); flex-shrink: 0; }
.q-sm8 .code { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); font-weight: 750; }
.q-sm8 strong { font-size: 14px; }
.q-small { font-size: 13px; color: #5B6E7D; border-top: 1px solid var(--line); margin: 12px 0 0; padding-top: 10px; line-height: 1.45; }
.q-saved { margin-top: 10px; }
.q-saved .top { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; }
.q-saved .sub { font-size: 12.5px; color: #5B6E7D; margin-top: 3px; }
.q-saved .q-btn-sm, .q-saved .q-badge { margin-top: 10px; display: inline-block; }

/* ---------- Staff & Access ---------- */
.a-h { font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: #5B6E7D; margin: 18px 0 8px; }
.a-list { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.a-person { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.a-person + .a-person { border-top: 1px solid var(--line); }
.a-av { width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 750; flex-shrink: 0; }
.a-who { flex: 1; min-width: 0; }
.a-who strong { display: block; font-size: 15px; }
.a-who span { display: block; font-size: 12.5px; color: #5B6E7D; overflow-wrap: anywhere; }
.a-who .a-changed { color: var(--amber); font-weight: 650; }
.a-role select { min-height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; font: inherit; font-weight: 700; color: var(--navy); background: #fff; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.a-roles { display: grid; gap: 10px; }
@media (min-width: 700px) { .a-roles { grid-template-columns: repeat(3, 1fr); } }
.a-rolecard { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.a-rolecard h3 { margin: 0; font-size: 16px; }
.a-rolecard p { margin: 4px 0 8px; font-size: 12.5px; color: #5B6E7D; line-height: 1.4; }
.a-rolecard ul { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.6; }
.a-rolecard li.soon { color: #8A99A6; }
.a-flags { display: flex; gap: 12px; margin-top: 8px; font-size: 12.5px; font-weight: 700; }
.a-flags .yes { color: var(--ok); }
.a-flags .no { color: #8A99A6; }
.minlbl { color: #5B6E7D; font-weight: 400; }
.q-compact { display: none; align-items: center; gap: 12px; }
.q-jobchip { background: #EAF3FB; color: var(--blue); font-weight: 800; border-radius: 8px; padding: 8px 10px; font-size: 15px; flex-shrink: 0; }
.q-compact .who { flex: 1; min-width: 0; }
.q-compact .who strong { display: block; font-size: 16px; }
.q-compact .who span { display: block; font-size: 13px; color: #5B6E7D; margin-top: 1px; }
.q-compact .q-link { padding: 0 4px; }
@media (max-width: 899px) {
  .q-cust.loaded .q-compact { display: flex; }
  .q-cust.loaded > .q-h, .q-cust.loaded > .q-jobrow, .q-cust.loaded > .q-note,
  .q-cust.loaded > .q-details, .q-cust.loaded > .q-link { display: none; }
}
.q-secondary { display: flex; align-items: center; justify-content: center; gap: 8px; }
.a-who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- ServiceM8 job picker ---------- */
.q-seg { display: grid; grid-template-columns: 1fr 1fr; background: #EDF1F5; border-radius: 10px; padding: 3px; margin-bottom: 10px; }
.q-seg button { min-height: 38px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-weight: 700; font-size: 14px; color: #5B6E7D; cursor: pointer; }
.q-seg button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(11,50,81,.15); }
.q-search { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); border-radius: 11px; padding: 0 12px; min-height: 46px; background: #fff; color: #5B6E7D; }
.q-search:focus-within { border-color: var(--blue); }
.q-search input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; font-size: 16px; color: var(--navy); background: transparent; padding: 10px 0; }
.q-techsel { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: #5B6E7D; margin-bottom: 6px; }
.q-techsel select { flex: 1; min-height: 40px; border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; font: inherit; font-weight: 700; color: var(--navy); background: #fff; }
.q-picklist { margin-top: 8px; display: grid; gap: 8px; max-height: 460px; overflow-y: auto; }
.q-muted { margin: 6px 2px; font-size: 13.5px; color: #5B6E7D; }
.q-day { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 800; color: var(--blue); margin: 6px 2px 0; }
.q-jobpick { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font: inherit; color: var(--navy); cursor: pointer; }
.q-jobpick:hover, .q-jobpick:focus-visible { border-color: var(--blue); background: #fff; }
.q-jobpick .q-time { font-weight: 800; font-size: 15px; min-width: 46px; padding-top: 1px; font-variant-numeric: tabular-nums; }
.q-jobpick .m { flex: 1; min-width: 0; }
.q-jobpick .m strong { display: block; font-size: 15px; }
.q-jobpick .m span { display: block; font-size: 13px; color: #31485A; margin-top: 2px; }
.q-jobpick .m em { display: block; font-style: normal; font-size: 12px; color: #5B6E7D; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-jobno { font-weight: 800; color: var(--blue); font-size: 13.5px; white-space: nowrap; text-align: right; }
.q-jobno small { display: block; font-weight: 600; color: #5B6E7D; font-size: 11px; margin-top: 2px; }
.q-jobhead { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.q-jobhead .sp { flex: 1; }
.q-jobhead .q-link { padding: 0; }
.q-pill { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: #EDF1F5; color: #31485A; }
.q-jobdesc { margin: 10px 0 0; font-size: 13px; color: #31485A; background: var(--soft); border-radius: 9px; padding: 8px 10px; }
.q-row-links { display: flex; align-items: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.q-row-links .q-link { padding: 0; }
.q-cust.picking .q-link[data-act="manual"] { padding-top: 12px; }
@media (max-width: 899px) {
  .q-cust.loaded > .q-jobhead { display: none; }
}

/* ---------- Full price list ---------- */
.q-browse-btn { display: block; width: 100%; margin-top: 10px; min-height: 46px; border: 1.5px dashed var(--blue); border-radius: 11px; background: #F4F9FD; color: var(--blue); font: inherit; font-weight: 750; font-size: 14.5px; cursor: pointer; }
.q-browse { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #FBFCFD; }
.q-browse-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.q-browse-head strong { font-size: 15px; }
.q-browse-head span { font-size: 12px; color: #5B6E7D; flex: 1; }
.q-browse-head .q-link { padding: 0; }
#q-browse-list { margin-top: 8px; display: grid; gap: 6px; }
.q-group { background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.q-group summary { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; cursor: pointer; font-weight: 750; font-size: 14.5px; list-style: none; }
.q-group summary::-webkit-details-marker { display: none; }
.q-group summary::after { content: "›"; font-size: 20px; color: var(--blue); transform: rotate(90deg); margin-left: 8px; }
.q-group[open] summary::after { transform: rotate(-90deg); }
.q-group summary span { flex: 1; }
.q-group summary small { background: #EDF1F5; border-radius: 999px; padding: 2px 8px; font-size: 11.5px; color: #31485A; }
.q-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); }
.q-item .info { flex: 1; min-width: 0; }
.q-item .name { font-size: 14px; font-weight: 650; }
.q-item .hint { font-size: 11.5px; color: #5B6E7D; margin-top: 1px; }
.q-item .price { font-weight: 750; white-space: nowrap; font-variant-numeric: tabular-nums; }
.q-item .price small { font-weight: 500; color: #5B6E7D; }
.q-noprice { font-size: 11.5px; font-weight: 750; color: var(--amber); background: var(--amber-soft); border-radius: 999px; padding: 3px 8px; }
.q-flagtxt { color: var(--amber); }
.q-add-item { min-height: 36px; min-width: 64px; border: 0; border-radius: 9px; background: var(--navy); color: #fff; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.q-add-item.added { background: var(--ok-soft); color: var(--ok); }
.q-row.extra .q-step button { width: 36px; }
.q-row.extra .q-step .val { min-width: 34px; }

/* picker: keep cards inside the list */
.q-picklist { grid-template-columns: minmax(0, 1fr); }
.q-jobpick { min-width: 0; }
.q-jobpick .m strong, .q-jobpick .m span { overflow-wrap: anywhere; }
.q-jobpick .q-time small { display: block; font-size: 11.5px; font-weight: 700; color: var(--blue); margin-top: 3px; }
.q-jobpick .q-time { min-width: 56px; }
.q-jobdesc { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.q-jobdesc { padding-bottom: 0; border-bottom: 8px solid var(--soft); }
.q-item { flex-wrap: wrap; row-gap: 6px; }
.q-item .info { flex: 1 1 200px; }
.q-item .acts { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }
@media (max-width: 599px) {
  .q-row.extra { flex-wrap: wrap; row-gap: 8px; }
  .q-row.extra .info { flex: 1 1 100%; }
  .q-row.extra .q-x { margin-left: auto; }
}
/* loft insulation (area-priced lines) */
.q-area { display: flex; align-items: center; gap: 6px; flex-shrink: 0; font-weight: 700; color: var(--navy); }
.q-area input { width: 96px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font: inherit; font-size: 18px; font-weight: 750; text-align: right; color: var(--navy); background: #fff; }
.q-area input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.q-areacalc { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 5px; }
.q-minsub { font-size: 12.5px; color: #31485A; font-variant-numeric: tabular-nums; }
.q-minpill { display: inline-flex; font-size: 11.5px; font-weight: 750; border-radius: 999px; padding: 2px 8px; background: #FFF1D6; color: #8A5300; }
.q-dirnote { margin-top: 6px; font-size: 11.5px; line-height: 1.35; color: #5B4A00; background: #FFF8E1; border-radius: 7px; padding: 5px 8px; }
.q-row.arealine .info .name { font-size: 14.5px; line-height: 1.3; }
.q-row.arealine .price small { font-weight: 500; color: #5B6E7D; }
.q-margin .s { font-size: 11.5px; margin-top: 3px; opacity: .85; }
/* reusable area measurer (public/sections/area-input.js) */
.q-row.area-box { display: block; grid-column: 1 / -1; }
.ai-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ai-title { font-weight: 750; font-size: 15px; color: var(--navy); }
.ai-mode { border: 0; background: none; padding: 4px 0; font: inherit; font-size: 13px; font-weight: 700; color: var(--blue); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ai-rect + .ai-rect { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.ai-rhead { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #5B6E7D; margin-bottom: 6px; }
.ai-rm { border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--red); cursor: pointer; padding: 2px 0; }
.ai-dims { display: flex; align-items: flex-end; gap: 8px; }
.ai-dims .ai-f { flex: 1; min-width: 0; }
.ai-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: #5B6E7D; }
.ai-in { display: flex; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; min-height: 48px; }
.ai-in:focus-within { outline: 2px solid var(--blue); outline-offset: 1px; }
.ai-in input { flex: 1; min-width: 0; width: 100%; border: 0; background: none; font: inherit; font-size: 19px; font-weight: 750; color: var(--navy); text-align: right; padding: 8px 6px 8px 0; outline: none; }
.ai-in em { font-style: normal; font-weight: 700; font-size: 15px; color: #31485A; }
.ai-x { font-size: 20px; font-weight: 700; color: #5B6E7D; padding-bottom: 12px; }
.ai-direct .ai-f { max-width: 220px; }
.ai-rsum { margin-top: 5px; font-size: 12.5px; color: #31485A; font-variant-numeric: tabular-nums; }
.ai-add { margin-top: 10px; border: 1px dashed var(--blue); background: #fff; color: var(--blue); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; width: 100%; }
.ai-total { margin-top: 10px; background: #EAF3FB; color: var(--navy); border-radius: 10px; padding: 10px 12px; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.ai-total.empty { background: #EDF1F5; color: #5B6E7D; font-weight: 600; font-size: 13.5px; }
.q-line .work { font-size: 12.5px; line-height: 1.4; color: #44596A; margin-top: 4px; font-weight: 500; }
/* multiple area units (lofts) */
.q-units { display: grid; gap: 12px; margin-bottom: 12px; }
.q-unit.many { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; background: #fff; }
.q-unit .q-toggles { margin-top: 8px; }
.q-unit-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.q-unit-name { flex: 1; min-width: 0; }
.q-unit-name input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 17px; font-weight: 800; color: var(--navy); background: var(--soft); }
.q-unit-name input:focus { outline: 2px solid var(--blue); outline-offset: 1px; background: #fff; }
.q-unit-rm { border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--red); cursor: pointer; padding: 6px 2px; }
.q-unit-add { border: 1.5px dashed var(--blue); background: #fff; color: var(--blue); border-radius: 12px; padding: 12px; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; width: 100%; }
.q-unitmin { display: grid; gap: 6px; }
.q-umin { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: #31485A; background: var(--soft); border-radius: 10px; padding: 8px 10px; }
.q-umin.short { background: #FFF8E1; color: #5B4A00; }

/* Quote title + summary (auto, editable) */
.q-ts { display: grid; gap: 8px; margin: 10px 0; }
.q-ts label { display: block; font-size: 12px; color: #5B6E7D; font-weight: 600; }
.q-ts input, .q-ts textarea { display: block; width: 100%; margin-top: 4px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font: inherit; font-size: 15px; color: var(--navy); background: #fff; resize: vertical; }
.q-ts input { font-weight: 700; min-height: 42px; }
.q-ts textarea { font-weight: 500; min-height: 10.5em; line-height: 1.4; }
.q-ts-hint { margin: 0; font-size: 11.5px; color: #6B7C89; }
.q-ts-hint .q-link { display: inline; padding: 0; font-size: inherit; font-weight: 700; }
.q-ts-show { margin: 8px 0 4px; display: grid; gap: 2px; }
.q-ts-show strong { font-size: 15px; color: var(--navy); }
.q-ts-show span { font-size: 13px; color: #44596A; }
.q-warn .q-warn-btn { display: block; margin: 8px auto 0; }

/* Saved by technicians: approve & send */
.q-tabs { display: flex; gap: 6px; margin: 12px 0 4px; background: #E9EEF3; border-radius: 12px; padding: 4px; }
.q-tabs button { flex: 1; min-height: 42px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-size: 14px; font-weight: 700; color: #31485A; cursor: pointer; }
.q-tabs button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.q-saved .sub.t { color: var(--navy); font-weight: 650; font-size: 13.5px; }
.q-saved-st { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.q-saved .q-saved-st .q-badge { margin-top: 0; white-space: normal; }
.q-saved-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; }
.q-saved .q-saved-acts .q-btn-sm { margin-top: 0; display: inline-flex; align-items: center; text-decoration: none; }
.q-btn-sm.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.q-link.sm { padding: 0; min-height: 44px; font-size: 13px; color: #8A2A1F; }
.q-badge.new { background: #DCEBFA; color: #0F4C81; }
.q-badge.amber { background: var(--amber-soft); color: #6A3E00; }
.q-saved.done { opacity: .92; }
.q-approve { background: #1F7A4D; }
.q-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(10,25,40,.55); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.q-modal-box { background: #fff; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 30px rgba(0,0,0,.25); }
@media (min-width: 700px) { .q-modal { align-items: center; } .q-modal-box { border-radius: 16px; } }
.q-modal-box h2 { margin: 0 0 12px; font-size: 19px; color: var(--navy); }
.q-ap-cust { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.q-ap-cust span { font-size: 13px; color: #5B6E7D; }
.q-ap-email { display: block; margin-top: 14px; font-size: 13px; font-weight: 700; color: #31485A; }
.q-ap-email input { display: block; width: 100%; box-sizing: border-box; margin-top: 6px; min-height: 48px; padding: 0 12px; border: 2px solid var(--navy); border-radius: 10px; font: inherit; font-size: 16.5px; font-weight: 700; color: var(--navy); }
.q-ap-tot { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; padding: 12px; background: #F3F6F9; border-radius: 10px; font-size: 14px; }
.q-ap-tot strong { white-space: nowrap; }
.q-ap-steps { margin: 14px 0 0; padding-left: 20px; font-size: 13.5px; line-height: 1.45; color: #22384A; }
.q-ap-steps li { margin-bottom: 6px; }
.q-modal-box .q-warn { margin-top: 10px; }
.q-modal-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }
.q-modal-actions .q-primary { flex: 1; background: #1F7A4D; }
.q-modal-actions .q-link { padding: 0 8px; min-height: 48px; }
.q-pick-hint { margin: 2px 0 10px; font-size: 14px; color: #5B6E7D; }
.q-link.sm2 { padding: 0 0 0 4px; min-height: 0; font-size: 12.5px; }
.q-row.area-x { flex-wrap: wrap; }
.q-area-x { display: flex; gap: 8px; }
.q-area-x .q-price input { width: 64px; }
.q-unset { color: #8A2A1F !important; font-weight: 650; }
.q-rate-row { display: block; }
.q-rates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.q-rates label { font-size: 13px; font-weight: 700; color: #31485A; }
.q-rates input { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; min-height: 44px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 9px; font: inherit; font-size: 16px; }
.q-rates .q-add-btns, .q-rates .q-ts-hint { grid-column: 1 / -1; }
.q-row.q-bb { display: block; }
.q-segs { display: flex; gap: 6px; margin-top: 10px; }
.q-seg { flex: 1; text-align: center; line-height: 1.2; padding: 6px; min-height: 44px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 14px; font-weight: 700; color: var(--navy); cursor: pointer; }
.q-seg.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.q-bands { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.q-band { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 54px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font: inherit; cursor: pointer; color: var(--navy); }
.q-band strong { font-size: 14px; }
.q-band span { font-size: 12.5px; color: #5B6E7D; }
.q-band.on { border-color: var(--navy); background: #E8EEF4; box-shadow: inset 0 0 0 1px var(--navy); }
.q-bb-staff { margin-top: 8px; font-size: 12.5px; color: #6A3E00; }

/* Tasks to quote (Charlie 30 Nov 23:10) */
.q-taskpick .m strong { white-space: normal; }
.q-task-help { margin: 0 0 8px; color: var(--muted, #5b6b7b); }
.q-jobno .q-pill { display: block; margin-top: 4px; font-size: 11px; }
.q-seg[role="tablist"]:has(> button:nth-child(3)) { grid-template-columns: 1fr 1fr 1.35fr; }
.q-seg[role="tablist"] button { font-size: 13.5px; padding: 0 4px; }
.q-travel .q-small { display: block; border-top: 0; margin: 4px 0 0; padding: 0; }

/* Job photos (Charlie 1 Dec 11:28) */
.q-photos { display: grid; gap: 12px; padding: 4px 0 24px; }
.q-photos-toolbar {
  position: sticky; top: 0; z-index: 6;
  background: var(--bg, #e8eef3);
  padding: 4px 0 8px;
  margin: -4px 0 0;
}
.q-photos-back, .q-photos-toolbar [data-act="photos-back"] {
  min-height: 48px; font-size: 16px; font-weight: 700; padding: 8px 4px;
}
.q-photogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
.q-thumb { display: grid; gap: 6px; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.q-thumb img { width: 100%; height: 148px; object-fit: cover; background: #D6DEE6; display: block; }
.q-thumb span { display: block; padding: 0 8px 8px; font-size: 12px; color: #44596A; line-height: 1.3; }
/* Portaled to document.body so it is not clipped by main/app-shell overflow. */
.q-lightbox {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(11, 32, 51, 0.94);
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.q-lb-bar {
  flex-shrink: 0;
  display: flex; align-items: center;
  padding: 10px 12px;
  background: rgba(8, 22, 36, 0.96);
  position: relative; z-index: 2;
}
.q-lb-close {
  position: static;
  background: #fff; color: var(--navy);
  border: 0; border-radius: 12px;
  min-height: 52px; padding: 0 18px;
  font: inherit; font-size: 17px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.28);
}
.q-lb-stage {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  padding: 8px 56px 8px;
}
.q-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.q-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border: 0; border-radius: 24px; background: #fff; color: var(--navy); font-size: 28px; line-height: 1; cursor: pointer; }
.q-lb-nav.prev { left: 10px; }
.q-lb-nav.next { right: 10px; }
.q-lb-nav:disabled { opacity: 0.35; }
.q-lb-cap { flex-shrink: 0; margin: 0; padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); text-align: center; color: #fff; font-size: 14px; }
.q-photos-btn { flex-shrink: 0; }
.q-jobhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Saved custom proofing items (Charlie 1 Dec 11:30) */
.q-proof-add { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); display: grid; gap: 10px; }
.q-proof-add.open { background: #F4F8FB; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.q-proof-add h3 { margin: 0; font-size: 16px; }
.q-proof-add label { display: grid; gap: 4px; font-size: 12px; color: #5B6E7D; font-weight: 600; }
.q-proof-add input, .q-proof-add textarea, .q-proof-add select { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font: inherit; font-size: 15px; color: var(--navy); background: #fff; }
.q-proof-add textarea { resize: vertical; min-height: 4.5em; line-height: 1.4; font-weight: 500; }
.q-proof-prices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.q-proof-acts { display: flex; gap: 10px; margin-top: 4px; }
.q-proof-hidden { margin-top: 8px; display: grid; gap: 6px; }
.q-proof-hidden h3 { margin: 0; font-size: 13px; color: #5B6E7D; }
.q-proof-hidrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }


/* Commercial contract builder (ECOA-89) */
.q-contract { display: grid; gap: 16px; margin: 8px 0 4px; }
.q-contract h3 { margin: 0 0 8px; font-size: 15px; color: var(--navy); }
.q-c-visits { grid-template-columns: 1fr 1fr; }
.q-c-rate { display: grid; gap: 8px; }
.q-c-rate label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 700; color: var(--navy); }
.q-c-unit { font-size: 12.5px; font-weight: 600; color: #5B6E7D; }
.q-c-addon { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; margin-top: 8px; }
.q-c-addon.on { border-color: var(--navy); background: #F4F8FB; }
.q-c-addon.needs-price { border-color: #C47A12; background: #FFF8EE; }
.q-c-addon input[type="checkbox"] { width: 22px; height: 22px; flex-shrink: 0; }
.q-c-addon .lab { flex: 1 1 140px; font-weight: 700; color: var(--navy); font-size: 14px; }
.q-c-n { width: 56px; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-weight: 700; text-align: right; color: var(--navy); }
.q-c-customs { display: grid; gap: 8px; margin-top: 10px; }
.q-c-custom { display: flex; align-items: center; gap: 8px; }
.q-c-custom input[data-ccust-name] { flex: 1; min-height: 44px; border: 1.5px solid var(--line); border-radius: 9px; padding: 0 10px; font: inherit; font-size: 15px; }
.q-ceq { padding: 12px 14px; border-radius: 12px; background: #E8EEF4; color: var(--navy); }
.q-ceq .y { font-size: 18px; font-weight: 800; }
.q-ceq .s { margin-top: 4px; font-size: 13px; font-weight: 600; color: #31485A; }
.q-placeholder { margin: 6px 0 0; flex: 1 1 100%; font-size: 12.5px; font-weight: 700; color: #8A4B08; }

.q-ts textarea.q-summ-contract { min-height: 22em; }
