/* Karen OS: New orders, Sales orders and the Finance page (sale.js, finance.js). New orders: the drafts waiting in Xero down the
   left, the order being checked on the right, one filled button (Confirm order). Sales orders and Finance use the shared parts in
   styles.css (.vhead, .search, .tabs, .list/.lrow, KarenPop). No inline styles. */

.sale { max-width: 1600px; --s-cust: var(--green-100); --s-ord: var(--blue-bg); --s-date: color-mix(in srgb, var(--amber-bg) 55%, var(--surface));
  --s-note: color-mix(in srgb, var(--amber-bg) 60%, var(--surface)); --s-calc: color-mix(in srgb, var(--divider) 55%, var(--surface)); gap: 14px; }
.sale kbd { font-family: var(--mono); font-size: 11px; padding: 0 5px; margin-left: 4px; color: var(--muted); }

/* Toolbar */
.sale-screen { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sale-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 18px; min-width: 0; }
.sale-acts .link { min-height: 40px; display: inline-flex; align-items: center; text-decoration: none; }
.sale-acts .btn.primary { min-height: 44px; }
.sale-acts .btn.primary kbd { color: rgba(255, 255, 255, 0.8); border-color: rgba(255, 255, 255, 0.35); background: transparent; }

/* The panel under the toolbar: open draft, confirm, invoice it */
.sale-panel { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--green-700); border-radius: var(--r-card); padding: 16px 20px;
  display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sale-pt { margin: 0; font-size: 16px; color: var(--ink); overflow-wrap: anywhere; }
.sale-pm { margin: 0; font-size: 14px; color: var(--muted); max-width: 70ch; overflow-wrap: anywhere; }
.sale-pm.err { color: var(--red); font-weight: 600; }
.sale-pa { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin-top: 4px; }
/* Brand dots (dot plus word) */
.sale .bdot, .sale-listpage .bdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; flex: none; background: var(--muted); }
.sale .bdot.b-wt, .sale-listpage .bdot.b-wt { background: var(--green-900); }
.sale .bdot.b-c2u, .sale-listpage .bdot.b-c2u { background: #560F1C; }
.sale-listpage .bdot.b-none { background: var(--input); }

.sale-fld { min-width: 0; position: relative; }
.sale-fld.w2 { grid-column: span 2; }
.sale-fld label, .sale-lbl, .sale-notes label { display: block; font-size: 12px; font-weight: 600; color: var(--grey-ink); margin: 0 0 3px; }
.sale-fld input[readonly] { background: transparent; border-style: dashed; color: var(--muted); }
.sale-hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.sale-hint.bad { color: var(--red); font-weight: 600; }
.sale-fld.req select.empty { border-color: var(--red); background: var(--red-bg); color: var(--red); }
.sale-gst { display: inline-flex; border: 1px solid var(--input); border-radius: var(--r-ctl); overflow: hidden; background: var(--surface); max-width: 100%; }
.sale-gst button { border: 0; background: transparent; padding: 0 12px; min-height: 42px; font: 600 14px var(--font); color: var(--muted); cursor: pointer; }
.sale-gst button.on { background: var(--blue); color: #FFFFFF; }
.sale-gst button:focus-visible { outline: 2px solid var(--green-700); outline-offset: -3px; }

/* Customer search list */
.sale-look { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin-top: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-ctl);
  max-height: 320px; overflow-y: auto; box-shadow: 0 6px 20px rgba(22, 35, 29, 0.12); }
.sale-lk-row { display: flex; flex-direction: column; gap: 1px; padding: 9px 12px; cursor: pointer; border-top: 1px solid var(--divider); min-height: 48px; justify-content: center; }
.sale-lk-row:first-child { border-top: 0; }
.sale-lk-row b { font-size: 14px; overflow-wrap: anywhere; }
.sale-lk-row span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.sale-lk-row:hover, .sale-lk-row.on { background: var(--green-100); }
.sale-lk-msg { padding: 12px; font-size: 14px; color: var(--muted); }
.sale-lk-msg.err { color: var(--red); }

/* Customer notes */
.sale-cnotes { margin-top: 10px; background: var(--s-note); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 8px 12px; font-size: 14px; }
.sale-cnotes ul { margin: 4px 0 0; padding: 0; list-style: none; }
.sale-cnotes li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-top: 1px dashed var(--line); }
.sale-cnotes li:first-child { border-top: 0; }
.sale-cnotes li > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sale-cnotes li em { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.sale-cnotes li .link { flex: none; min-height: 40px; }

/* Lines */
.sale-tbl { overflow: auto; }
.sale-lines { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 720px; }
.sale-lines th { background: var(--green-900); color: #FFFFFF; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px; white-space: nowrap; font-weight: 700; }
.sale-lines th.n { text-align: right; }
.sale-lines th.ln, .sale-lines td.ln { width: 40px; text-align: center; }
.sale-lines th:nth-child(3), .sale-lines th:nth-child(5) { width: 88px; }
.sale-lines th:nth-child(4) { width: 140px; }
.sale-lines th:nth-child(6) { width: 130px; }
.sale-lines td { border-bottom: 1px solid var(--divider); padding: 3px 4px; background: var(--surface); }
.sale-lines tbody tr:nth-child(even) td { background: #FAFCFA; }
.sale-lines td.ln { color: var(--muted); font-size: 13px; }
.sale-lines td input { height: 40px; width: 100%; border: 1px solid var(--divider); border-radius: 6px; background: transparent; padding: 0 8px; font: 400 15px var(--font); color: var(--ink); }
.sale-lines td input:hover:not(:disabled) { border-color: var(--line); }
.sale-lines td input:focus { border-color: var(--green-700); background: var(--surface); outline: 2px solid var(--green-700); outline-offset: -1px; }
.sale-lines td input:disabled { background: transparent; color: var(--ink); }
.sale-lines td.n input { text-align: right; font-variant-numeric: tabular-nums; }
.sale-lines td.disc input { color: var(--amber); }
.sale-lines td.tot { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; padding-right: 12px; white-space: nowrap; background: var(--s-calc); }
.sale-lines tbody tr:nth-child(even) td.tot { background: var(--s-calc); }
.sale-lines tr.note td { background: var(--s-note); }
.sale-lines tr.note td input { font-style: italic; color: var(--amber); }
.sale-lines tr.cur td { box-shadow: inset 0 1px 0 var(--green-700), inset 0 -1px 0 var(--green-700); }
.sale-lines tr.cur td.ln { box-shadow: inset 3px 0 0 var(--green-700), inset 0 1px 0 var(--green-700), inset 0 -1px 0 var(--green-700); color: var(--green-700); font-weight: 700; }
.sale-tag { font-size: 12px; font-weight: 700; color: var(--amber); text-transform: uppercase; letter-spacing: 0.04em; }

/* Notes and totals */
.sale-notes textarea { margin-bottom: 10px; }
.sale-notes textarea#sNotes { background: var(--s-note); }
.sale-tot { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0; font-variant-numeric: tabular-nums; }
.sale-tot dt { color: var(--muted); font-size: 14px; }
.sale-tot dd { margin: 0; text-align: right; font-size: 14px; }
.sale-tot .big { font-size: 20px; font-weight: 800; color: var(--ink); border-top: 2px solid var(--green-900); padding-top: 6px; margin-top: 4px; }
.sale-tot .dep { color: var(--amber); font-weight: 700; }
.sale-chk { list-style: none; margin: 12px 0 0; padding: 0; font-size: 14px; }
.sale-chk li { position: relative; padding: 2px 0 2px 20px; color: var(--grey-ink); }
.sale-chk li::before { content: "✓"; position: absolute; left: 0; color: var(--green-700); font-weight: 700; }
.sale-chk li.no { color: var(--red); font-weight: 600; }
.sale-chk li.no::before { content: "✕"; color: var(--red); }

/* Print sheet: only shown when printing */
.sale-sheet { display: none; }

/* Settings */
.sale-set h2 { font-size: 16px; margin: 18px 0 2px; }
.sale-set h2:first-child { margin-top: 0; }
.sale-set p { margin: 0 0 8px; }
.sale-setgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 14px; max-width: 760px; }
.sale-chk1 { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink); min-height: 44px; }

@media (max-width: 760px) {
  /* Lines become small cards: description on top, then qty, price, discount and total */
  .sale-tbl { overflow: visible; }
  .sale-lines { min-width: 0; }
  .sale-lines thead { display: none; }
  .sale-lines, .sale-lines tbody { display: block; }
  .sale-lines tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px 6px; padding: 8px 10px; border-bottom: 1px solid var(--divider); }
  .sale-lines td { display: block; border: 0; padding: 0; background: transparent !important; }
  .sale-lines td.ln { grid-column: 1 / -1; text-align: left; font-size: 12px; }
  .sale-lines td.desc { grid-column: 1 / -1; }
  .sale-lines tr.note td.desc { grid-column: 1 / 4; }
  .sale-lines td[data-l]:not(.desc)::before { content: attr(data-l); display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
  .sale-lines td.tot { text-align: right; padding: 0 4px; align-self: end; }
  .sale-lines tr.note td.tot { grid-column: 4; }
  .sale-lines td input { height: 44px; border-color: var(--line); background: var(--surface); }
  .sale-lines tr.cur td, .sale-lines tr.cur td.ln { box-shadow: none; }
  .sale-lines tr.cur { box-shadow: inset 3px 0 0 var(--green-700); }
}
@media (pointer: coarse) {
  .sale kbd { display: none; }
  .sale-acts .link, .sale-cnotes li .link { min-height: 44px; }
  .sale-lines td input { height: 44px; }
  .sale-gst button { min-height: 44px; }
}

/* Print: the order sheet only */
@media print {
  #app { display: block !important; }
  #app > .side, .demobar, .toast, .gate { display: none !important; }
  #main > .view { display: none !important; }
  #main > #v-sale { display: block !important; }
  #v-sale .view-in { padding: 0; max-width: none; }
  .sale-screen { display: none !important; }
  .so-q { display: none !important; }
  .sale-sheet { display: block !important; color: #000; font-size: 11pt; }
  .sale-sheet h1 { font-size: 20pt; margin: 0; }
  .sale-sheet header p { margin: 2pt 0 12pt; font-size: 11pt; color: #000; }
  .sale-ps { display: grid; grid-template-columns: 130px 1fr; gap: 3pt 10pt; margin: 0 0 12pt; }
  .sale-ps dt { font-weight: 700; }
  .sale-ps dd { margin: 0; }
  .sale-sheet table { width: 100%; border-collapse: collapse; }
  .sale-sheet th, .sale-sheet td { border-bottom: 0.5pt solid #888; padding: 4pt 6pt; text-align: left; font-size: 10.5pt; }
  .sale-sheet th.n, .sale-sheet td.n { text-align: right; }
  .sale-pt2 { margin: 10pt 0 0; font-size: 11pt; color: #000; text-align: right; }
}

/* ---------- New orders: the list on the left, the order on the right ---------- */
.sale.so { max-width: 1600px; }
.so-wrap { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; }
.so-q { flex: 1 1 300px; max-width: 360px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  display: flex; flex-direction: column; position: sticky; top: 16px; max-height: calc(100vh - 32px); }
.so-q > .msg { margin: 0 16px 8px; }
.so-qf { padding: 8px 16px; border-top: 1px solid var(--divider); }

.so-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.so-who { min-width: 0; }
.so-src { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.so-name { margin: 2px 0 0; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.so-sub { margin: 2px 0 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.so-total { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.so-total span { font-size: 13px; color: var(--muted); }
.so-total b { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.so-total .so-dep { color: var(--amber); font-weight: 700; font-size: 14px; }

.so-main input, .so-main select, .so-main textarea { font: 400 15px var(--font); }
.so-main .sale-fld > input, .so-main .sale-fld > select { width: 100%; min-height: 44px; box-sizing: border-box; }
.so-cust { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 12px; align-items: start; }
.so-find #sAcc { font-size: 16px; font-weight: 600; }

.so-more { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.so-more summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; padding: 0 14px; font-size: 14px; font-weight: 600; color: var(--grey-ink); }
.so-moreg { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 12px; padding: 4px 14px 14px; }

.so-lines .sale-lines th { background: transparent; color: var(--muted); border-bottom: 1px solid var(--line); text-transform: none; letter-spacing: 0; font-size: 13px; }
.so-lines .sale-lines td.tot { background: transparent; }
.so-lines .sale-lines tbody tr:nth-child(even) td, .so-lines .sale-lines tbody tr:nth-child(even) td.tot { background: var(--surface); }

.so-notes textarea { width: 100%; box-sizing: border-box; margin: 0; }

.so-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.so-sum { flex: 1 1 260px; min-width: 0; }
.so-tot { max-width: 300px; }
.so-tot .big { font-size: 16px; border-top: 0; padding-top: 0; margin-top: 0; }
.so-acts { justify-content: flex-end; gap: 4px 18px; }
.so-acts .so-go { min-height: 52px; padding: 0 30px; font-size: 17px; font-weight: 800; }

@media (max-width: 900px) {
  .so-q { position: static; max-width: none; max-height: none; flex-basis: 100%; }
  .so-cust { grid-template-columns: minmax(0, 1fr); }
  .so-total { align-items: flex-start; text-align: left; }
  .so-acts { justify-content: stretch; }
  .so-acts .so-go { flex: 1 1 100%; order: -1; }
}

/* Calm pass (Oct 2026): the total shows once (in the header), only what's still missing is listed, nothing is tinted unless
   it's wrong. */
.so-tot { display: none; }
.so-sum .sale-chk:empty { display: none; }
.so-sum .sale-chk { margin: 0; }
.so .so-total .so-dep { color: var(--muted); font-weight: 600; }
.so .sale-fld.req select.empty { border-color: var(--input); background: var(--surface); color: var(--muted); }
.so .sale-notes textarea#sNotes { background: var(--surface); }
.so .sale-lines tr.note td { background: var(--surface); }
.so .sale-lines tr.note td input { color: var(--grey-ink); }
.so .sale-tag { color: var(--muted); }


/* ---------- Design pass (Oct 2026): on the shared parts ---------- */
/* Confirm and the customer's notes are the shared pop-up (dialog.pop) */
dialog.sale-dlg.pop .pop-body input { width: 100%; min-height: 44px; box-sizing: border-box; }
dialog.sale-dlg.pop .pop-body label.l { margin: 0 0 6px; }
dialog.sale-dlg.pop .hint.err { color: var(--red); font-weight: 600; }
dialog.sale-dlg.pop .sale-cnotes { margin: 0; max-height: 50vh; overflow: auto; background: var(--surface); }
@media print { dialog.sale-dlg { display: none; } }

/* Brand: a plain two-way switch with the names */

/* Contact, delivery and GST: the shared fold, no box */
.so-more { border: 0; background: transparent; }
.so-more > summary { padding: 0; }
.so-moreg { padding: 4px 0 0; }

/* Lines: borderless until you're in them; Windowizard lines are plain text */
/* The boxes show, so an empty order doesn't look like a blank row with nowhere to type */
.so-lines .sale-lines td input { border-color: var(--line); background: var(--surface); }
.so-lines .sale-lines td input:hover:not(:disabled) { border-color: var(--input); }
.so-lines .sale-lines td input:disabled { border-color: transparent; background: transparent; }
.so-lines .sale-lines tr.ro td { padding: 12px 10px; font-size: 15px; color: var(--ink); }
.so-lines .sale-lines tr.ro td.n, .so-lines .sale-lines tr.ro td.tot { text-align: right; font-variant-numeric: tabular-nums; }
.so-lines .sale-lines tr.ro td.desc { overflow-wrap: anywhere; }
.so-addline { display: flex; flex-wrap: wrap; gap: 4px 22px; padding: 6px 12px; border-top: 1px solid var(--divider); }
.so-addline .link { min-height: 40px; display: inline-flex; align-items: center; text-decoration: none; }

/* Ready in about: red only after Confirm was pressed with it missing */
.tried .so .sale-fld.req select.empty, .tried .sale-fld.req select.empty { border-color: var(--red); background: var(--surface); color: var(--ink); }

/* The foot: quiet actions, the ⋮, what's missing said beside Confirm */
.so-acts { align-items: center; }
.so-acts .need { margin: 0; flex: 0 1 auto; max-width: 320px; text-align: right; }
.so-acts .need:empty { display: none; }
.so-menu .menu { min-width: 180px; }
.so-menu .menu a { color: var(--ink); text-decoration: none; }

/* The New orders list: Updated sits beside Refresh; on a phone the list folds away once an order is open */
.so-qf { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.so-qf .hint { margin: 0; }
.so-qf .link { min-height: 40px; display: inline-flex; align-items: center; text-decoration: none; }
@media (max-width: 900px) {
  .so-wrap.has-order:not(.show-list) .so-qf { display: none; }
  .so-acts .need { max-width: none; flex-basis: 100%; text-align: left; }
}

/* Sales orders and its settings: the shared header, search, tabs and rows */
.sale-listpage { display: flex; flex-direction: column; gap: 20px; }
.sale-listpage .tabs { margin-bottom: -8px; }
.sale-setpage { display: flex; flex-direction: column; gap: 20px; }
.sale-setpage .sale-setgrid { max-width: none; }

/* The Finance page: one tile per job, the live number first; the whole tile is the link */
.fin { display: flex; flex-direction: column; gap: 20px; }
.fin-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.fin-tile { display: flex; flex-direction: column; gap: 6px; padding: 20px; min-height: 128px; box-sizing: border-box; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); text-decoration: none; color: var(--ink); }
.fin-tile:hover { border-color: var(--grey-ink); color: var(--ink); }
.fin-tile:focus-visible { outline: 2px solid var(--green-700); outline-offset: 2px; }
.fin-name { font-size: 15px; font-weight: 600; color: var(--grey-ink); }
.fin-num { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.15; }
.fin-tile .sub { font-size: 14px; color: var(--muted); }
.fin-soonline { margin: 0; }
.fin-soonline:empty { display: none; }

/* Approving a Windowizard order: what is on it (read only), then the questions as big two-way buttons */
.sale-alines { list-style: none; margin: 0; padding: 8px 12px; max-height: 168px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); font-size: 14px; }
.sale-alines li { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; overflow-wrap: anywhere; }
.sale-alines li.n { color: var(--muted); font-weight: 600; }
.sale-alines .amt { flex: none; font-variant-numeric: tabular-nums; color: var(--muted); }
.sale-aqs { border: 0; margin: 0; padding: 0; min-width: 0; }
.sale-aqs legend { padding: 0; margin: 0 0 6px; font-size: 15px; font-weight: 700; color: var(--ink); }
.sale-aqr { display: flex; flex-wrap: wrap; gap: 8px; }
.sale-aq { flex: 1 1 140px; min-height: 48px; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.sale-aq:hover:not(:disabled) { border-color: var(--green-700); }
.sale-aq.on, .sale-aq[aria-pressed="true"] { border-color: var(--green-700); background: var(--green-700); color: #fff; }
.sale-aq:disabled { opacity: 0.55; cursor: default; }
.sale-aq:focus-visible { outline: 3px solid var(--green-700); outline-offset: 2px; }
.sale-aqs .hint { margin: 6px 0 0; }

/* New orders: the list page and the order page share one view; the order is keyed in a step at a time */
.so-page { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.so-page[hidden], .so-step[hidden] { display: none; }
.so-page > .so-qf { border-top: 0; padding: 0; display: flex; align-items: center; gap: 12px; }
.so-back { align-self: flex-start; min-height: 44px; display: inline-flex; align-items: center; }
.so-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.so-steps[hidden] { display: none; }
.so-stepb { border: 0; background: none; padding: 10px 0; min-height: 44px; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
.so-stepb.on { color: var(--ink); border-bottom-color: var(--green-700); }
.so-step { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.so-about .sale-aqs { max-width: 640px; }
.so-about .so-brand, .so-about > .sale-fld { max-width: 640px; }
.so-rev { margin: 0; font-size: 16px; font-weight: 600; color: var(--ink); max-width: 70ch; overflow-wrap: anywhere; }
.so-rev[hidden], .sale-alines[hidden] { display: none; }
.so-sum .sale-alines { max-width: 640px; }
.so-foot > .so-sum { flex: 1 1 100%; }

/* One Windowizard order on a page of its own: the order and customer on the left, the questions beside it */
.rv-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; }
.rv-back { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }
.rv-nav { display: flex; align-items: center; gap: 0 12px; }
.rv-step { min-height: 44px; display: inline-flex; align-items: center; padding: 0 6px; font-weight: 600; text-decoration: none; }
.rv-step.off { color: var(--muted); opacity: 0.45; }
.rv-pos { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.rv-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
.rv-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rv-card, .rv-ask { padding: 16px 20px; min-width: 0; }
.rv-card .sechead, .rv-ask .sechead { margin: 0 0 12px; }
.rv-ask { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 18px; }
.rv-scroll { overflow-x: auto; }
.rv-lines { width: 100%; border-collapse: collapse; font-size: 15px; }
.rv-lines th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 0 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rv-lines td { padding: 10px 0; border-bottom: 1px solid var(--divider); vertical-align: top; overflow-wrap: anywhere; }
.rv-lines th.n, .rv-lines td.n { text-align: right; padding-left: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rv-lines td.tot { font-weight: 700; }
.rv-lines tr.n td { color: var(--muted); font-weight: 600; white-space: normal; text-align: left; padding-left: 0; }
.rv-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 24px; margin: 0; }
.rv-facts > div { min-width: 0; }
.rv-facts dt { font-size: 13px; color: var(--muted); }
.rv-facts dd { margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.rv-brands { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rv-brand { position: relative; display: flex; align-items: center; justify-content: center; min-height: 92px; padding: 14px 12px 26px; border: 3px solid transparent; border-radius: var(--r-card); cursor: pointer; transition: opacity 0.15s, filter 0.15s; }
.rv-brands.picked .rv-brand:not([aria-pressed="true"]) { opacity: 0.5; filter: saturate(0.4); }
.rv-brand.wt { background: #017D8A; }
.rv-brand.c2u { background: #560F1C; }
.rv-brands.picked .rv-brand:hover:not(:disabled) { opacity: 1; filter: none; }
.rv-brand[aria-pressed="true"] { border-color: var(--ink); }
.rv-brand:focus-visible { outline: 3px solid var(--green-700); outline-offset: 2px; }
.rv-brand:disabled { cursor: default; }
.rv-brand img { display: block; width: 100%; max-width: 150px; height: auto; }
.rv-sel { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; color: #FFFFFF; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
.rv-sum { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.rv-go { width: 100%; min-height: 52px; font-size: 16px; font-weight: 800; }
@media (max-width: 1000px) {
  .rv-grid { grid-template-columns: minmax(0, 1fr); }
  .rv-ask { position: static; order: -1; }
}

/* Keying in an order, step 2: a card of questions that lines up with the page, brand as logo cards like the review page */
.so-about { padding: 20px; display: flex; flex-direction: column; gap: 22px; max-width: 720px; }
.so-about .sale-aqs, .so-about > .sale-fld { max-width: none; }
.so-about .sale-aqs legend { font-size: 16px; }
.so-about .rv-brand { min-height: 110px; }
.so-about .rv-brand img { max-width: 190px; }

/* Step 1: a new customer is keyed in; an existing one is searched for */
.so-newc { display: flex; flex-direction: column; gap: 14px; }
.so-newc[hidden], #sexist[hidden] { display: none; }
.so-ncg { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 16px; }
.so-newc .sale-fld > input { width: 100%; min-height: 44px; box-sizing: border-box; font: 400 15px var(--font); }
.so-dupe { border: 1px solid var(--amber-bar); background: var(--amber-bg); border-radius: var(--r-card); padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.so-dupe[hidden] { display: none; }
.so-dupe p { margin: 0; overflow-wrap: anywhere; }

/* Easydrape portal orders in the To process list are priced ex GST: say so beside the amount */
.so-exgst { font-size: 12px; font-weight: 400; color: var(--muted); }

/* Split this order in two */
.sp-list { margin: 0 0 12px; max-height: 40vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-ctl); }
.sp-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; border-bottom: 1px solid var(--divider); cursor: pointer; }
.sp-row:last-child { border-bottom: 0; }
.sp-row input { width: 20px; height: 20px; accent-color: var(--green-700); }
.sp-row.inst { background: var(--green-100); cursor: default; }
.sp-d { overflow-wrap: anywhere; }
.sp-n { font-size: 13px; color: var(--muted); white-space: nowrap; }
.sp-t { font-weight: 600; text-align: right; min-width: 72px; }
.sp-inst { margin: 0 0 12px; }
@media (max-width: 560px) { .sp-row { grid-template-columns: 24px minmax(0, 1fr) auto; } .sp-n { display: none; } }

/* Review page: the confirmation address, and the "approved but no email went out" card */
.rv-nomail { max-width: 560px; }
.rv-nmgo { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0 0; }

/* ---------- The visual order page and list (Finn, 12 Nov 2026) ----------
   Brand colour is allowed here on purpose: it says which company the order goes out under. Everything else stays on Karen's tokens. */
.oc, .oq-row { --bc: var(--line); --b-bg: var(--surface); --b-ink: var(--ink); --b-tint: var(--green-100); --b-deep: var(--green-700); }
.oc[data-ob="wt"], .oq-row[data-ob="wt"] { --bc: #01A3B3; --b-bg: #F6F6F6; --b-ink: #323232; --b-tint: #E1F3F5; --b-deep: #017D8A; }
.oc[data-ob="c2u"], .oq-row[data-ob="c2u"] { --bc: #FEB91D; --b-bg: #560D20; --b-ink: #FFFFFF; --b-tint: #F6E6E9; --b-deep: #560D20; }
.oc[data-ob="ed"], .oq-row[data-ob="ed"] { --bc: #EB6D20; --b-bg: #FFFFFF; --b-ink: #17153A; --b-tint: #FBEADF; --b-deep: #17153A; }
.oc-i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.oc { display: flex; flex-direction: column; min-width: 0; }
.oc-band { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 20px 28px; background: var(--b-bg); color: var(--b-ink);
  border: 1px solid var(--line); border-bottom: 4px solid var(--bc); border-radius: var(--r-card) var(--r-card) 0 0; }
.oc-band img { display: block; height: 46px; width: auto; max-width: 60%; object-fit: contain; object-position: left center; }
.oc-nobrand { font-size: 15px; font-weight: 600; color: var(--muted); }
.oc.no-total .so-total { visibility: hidden; }
.oc-band .so-total span { color: inherit; opacity: 0.8; }
.oc-title { background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r-card) var(--r-card); padding: 18px 28px 20px; margin-bottom: 18px; min-width: 0; }
.oc-title h1 { margin: 0; overflow-wrap: anywhere; }
.oc-title .dateline { margin: 4px 0 18px; }
.oc-steps { display: flex; list-style: none; margin: 0; padding: 0; }
.oc-steps li { flex: 1 1 0; min-width: 0; position: relative; padding: 34px 8px 0 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.oc-steps li::before { content: ""; position: absolute; top: 12px; left: 0; right: 0; height: 3px; background: var(--line); }
.oc-steps li:last-child { flex: 0 1 auto; }
.oc-steps li:last-child::before { display: none; }
.oc-dot { position: absolute; top: 0; left: 0; width: 27px; height: 27px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line); display: grid; place-items: center; color: #FFFFFF; }
.oc-dot .oc-i { width: 14px; height: 14px; stroke-width: 3; }
.oc-steps li.done, .oc-steps li.now { color: var(--ink); }
.oc-steps li.done::before, .oc-steps li.done .oc-dot { background: var(--b-deep); }
.oc-steps li.done .oc-dot { border-color: var(--b-deep); }
.oc-steps li.now .oc-dot { border-color: var(--b-deep); box-shadow: 0 0 0 5px var(--b-tint); }
.oc-h small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 8px; }
.oc-lines { list-style: none; margin: 0; padding: 0; }
.oc-room { font-size: 14px; font-weight: 600; color: var(--muted); padding: 10px 0 4px; }
.oc-item { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--divider); }
.oc-lines > .oc-item:first-child, .oc-room + .oc-item { border-top: 0; }
.oc-ico, .oc-av { display: grid; place-items: center; background: var(--b-tint); color: var(--b-deep); flex: none; }
.oc-ico { width: 46px; height: 46px; border-radius: 12px; }
.oc-what { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.oc-what b { font-weight: 600; overflow-wrap: anywhere; }
.oc-what span { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.oc-tot { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.oc-cust { display: flex; gap: 16px; align-items: center; min-width: 0; }
.oc-av { width: 54px; height: 54px; border-radius: 50%; font-weight: 800; font-size: 19px; }
.oc-cust b { font-size: 17px; overflow-wrap: anywhere; }
.oc-cust b small { font-size: 13px; font-weight: 500; color: var(--muted); }
.oc-cust p { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 15px; color: var(--grey-ink); }
.oc-cust p span { display: inline-flex; gap: 6px; align-items: center; min-width: 0; overflow-wrap: anywhere; }
.oc-cust p .oc-i { width: 17px; height: 17px; color: var(--muted); }
.rv-ask { gap: 14px; }
.oc-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.oc-opt { flex: 1 1 auto; min-height: 44px; padding: 6px 12px; border: 1px solid var(--input); border-radius: var(--r-ctl); background: var(--surface); color: var(--ink); font: 600 14px var(--font); cursor: pointer; }
.oc-opt:hover:not(:disabled) { border-color: var(--grey-ink); }
.oc-opt[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.oc-opt:disabled { opacity: 0.55; cursor: default; }
.oc-opt:focus-visible, .oq-b:focus-visible { outline: 3px solid var(--green-700); outline-offset: 2px; }
.oc-bopt { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.oc-bopt img, .oq-b img { width: 26px; height: 26px; border-radius: 50%; display: block; }
.rv-ask .rv-sum { font-size: 14px; font-weight: 500; color: var(--grey-ink); }
.oc-under { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 20px; }
.oc-under a.link { display: inline-flex; align-items: center; }
.oc-under .link { min-height: 40px; }

.oq-brands { display: flex; flex-wrap: wrap; gap: 8px; }
.oq-b { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: 600 14px var(--font); cursor: pointer; }
.oq-b:first-child { padding-left: 16px; }
.oq-b span { font-weight: 500; color: var(--muted); }
.oq-b[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.oq-list { --lrow-cols: 44px minmax(0, 1fr) 110px 150px 130px; }
.oq-row { box-shadow: inset 4px 0 0 var(--bc); }
.oq-badge { width: 44px; height: 44px; border-radius: 12px; display: block; }
.oq-state { justify-self: start; font-size: 14px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: var(--green-100); color: var(--green-900); white-space: nowrap; }
.oq-state.bad { background: var(--red-bg); color: var(--red); }
.oq-state.warn { background: var(--amber-bg); color: var(--amber); }
.oq-state.quiet { background: var(--divider); color: var(--grey-ink); }
@media (max-width: 1100px) { .oc-steps li { font-size: 13px; } }
@media (max-width: 720px) {
  .oq-badge, .oq-state { display: none; }
  .oc-band, .oc-title { padding-left: 16px; padding-right: 16px; }
  .oc-band img { height: 36px; }
  .oc-steps li { font-size: 0; padding-right: 0; }
  .oc-steps li.now { font-size: 13px; }
}

/* An order keyed by hand, on the same page as every other order */
.oc > .msg:empty { display: none; }
.oc > .msg, .oc > .sale-panel { margin-bottom: 14px; }
.oc-title .so-sub:empty { display: none; }
.oc-title #ssub { margin: -12px 0 18px; }
.rv-card .so-lines { margin: 0 -8px; }
.rv-card .so-notes { margin-top: 14px; }
.so-custcard { display: flex; flex-direction: column; gap: 14px; }
.so-custcard .oc-opts { margin-top: 0; max-width: 420px; }
.rv-ask .need { margin: 0; color: var(--red); font-weight: 600; font-size: 14px; }
.rv-ask .need:empty, .rv-ask .sale-chk:empty, .rv-ask .rv-sum[hidden] { display: none; }
.rv-ask .sale-acts { justify-content: center; }
.so-addline[hidden] { display: none; }

/* Splitting an order on the page: a tick box on each line that can move */
.oc-lines.pick .oc-item { grid-template-columns: 24px 46px minmax(0, 1fr) auto; }
.oc-tick { width: 22px; height: 22px; margin: 0; accent-color: var(--green-700); }
.oc-item.moving { background: var(--green-100); box-shadow: -12px 0 0 var(--green-100), 12px 0 0 var(--green-100); }
.oc-item.oc-note .oc-what b { font-weight: 500; color: var(--grey-ink); }
#arel:not(:empty) { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--divider); }

/* Change customer, on the order page */
.oc-chg { margin-top: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.oc-chg .rv-mail { width: 100%; max-width: 520px; }
.oc-chg .hint { margin: 0; }
.oc-found { width: 100%; max-width: 520px; display: flex; flex-direction: column; }
.oc-found:empty { display: none; }
.oc-foundrow { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 44px; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--divider); background: var(--surface); text-align: left; font: 400 15px var(--font); color: var(--ink); cursor: pointer; }
.oc-foundrow:hover, .oc-foundrow:focus-visible { background: var(--green-100); }
.oc-foundrow span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }


/* ---------- Design pass, 12 Nov 2026 ----------
   The header is a letterhead: brand, who the order is for, and the total on one line, so the work starts higher up the page.
   The answers are rows in one list, not separate tiles: what it is on the left, the choice on the right. On a laptop the button is in
   view without scrolling. The same parts build all three kinds of order. */
.oc-band { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px 28px; padding: 16px 28px; }
.oc-logo { display: flex; align-items: center; min-height: 44px; padding-right: 28px; border-right: 1px solid color-mix(in srgb, var(--b-ink) 22%, transparent); }
.oc-logo img, .oc-band img { height: 40px; max-width: 240px; }
.oc-name { min-width: 0; }
.oc-name h1 { margin: 0; font-size: 26px; line-height: 1.15; color: inherit; overflow-wrap: anywhere; }
.oc-name p { margin: 3px 0 0; font-size: 14px; color: inherit; opacity: 0.78; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-name p:empty { display: none; }
.oc-band .so-total b { font-size: 28px; }
.oc-band .so-total .so-dep { color: inherit; opacity: 0.85; font-weight: 600; font-size: 13px; }
.oc-title { padding: 16px 28px 14px; margin-bottom: 16px; }
.oc-title #ssub { margin: 0; }
.oc-steps li { padding-top: 32px; font-size: 13.5px; }
.oc .rv-grid { grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; }
.rv-ask { gap: 12px; padding: 18px 20px 16px; }
.rv-ask > .sechead { font-size: 19px; font-weight: 800; margin: 0; }

.oa { border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.oa-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; margin: 0; padding: 10px 14px; border: 0; border-top: 1px solid var(--divider); min-width: 0; }
.oa-row:first-child { border-top: 0; }
.oa-row.stack { grid-template-columns: minmax(0, 1fr); }
.oa-row.ask { background: var(--amber-bg); box-shadow: inset 3px 0 0 var(--amber-bar); }
.oa-what { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.oa-what .oc-i { width: 19px; height: 19px; color: var(--muted); }
.oa-row.ask .oa-what .oc-i, .oa-row.ask .oa-lab { color: var(--amber); }
.oa-lab { font-weight: 600; color: var(--grey-ink); }
.oa-val { margin-left: auto; font-size: 15px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.oa-row:not(.stack) .oa-val { margin-left: 4px; }
.oa-val.off, .oa-num.off { color: var(--muted); font-weight: 600; }
.oa-val:empty { display: none; }
#sDepVal { white-space: normal; }   /* "$300.00 (30%)": an order with its own deposit rate wraps the rate on a phone rather than cutting it off */
.oa-ctl { display: flex; gap: 6px; min-width: 0; }
.oa-row.stack .oa-ctl > * { flex: 1 1 0; min-width: 0; }
.oa-row.stack .oa-ctl > input, .oa-row.stack .oa-ctl > select { width: 100%; min-height: 44px; }
.oa-num { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.oa-row.stack .oa-num { text-align: left; font-weight: 600; }
.oa-row .hint { grid-column: 1 / -1; margin: 0; }
.oa-row .sale-hint { grid-column: 1 / -1; }
label.oa-what { cursor: pointer; }
/* A chosen answer is marked, not filled: the one filled thing on the page is the button */
.oc-opt { min-height: 40px; padding: 4px 12px; font-size: 14px; white-space: nowrap; }
.oa-row:not(.stack) .oc-opt { min-width: 56px; flex: 0 0 auto; }
.oc-opt[aria-pressed="true"] { background: var(--green-100); border-color: var(--green-700); box-shadow: inset 0 0 0 1px var(--green-700); color: var(--green-900); font-weight: 700; }
.oc-opts .oc-opt { min-height: 44px; }
.rv-ask .rv-go { min-height: 50px; }
.rv-ask .rv-sum { font-size: 13.5px; line-height: 1.45; }

/* Lines keyed by hand: the same rows as a read-only order, with boxes you can type in */
.oc-ico.sm { width: 36px; height: 36px; border-radius: 10px; }
.oc-ico.sm .oc-i { width: 19px; height: 19px; }
.so-lines .sale-lines th.ln, .so-lines .sale-lines td.ln { width: 52px; padding-left: 8px; }
.so-lines .sale-lines td { padding: 6px 4px; }
.so-lines .sale-lines td.desc input { font-weight: 600; }
.so-lines .sale-lines td input { height: 42px; }
.so-lines .sale-lines td input::placeholder { font-weight: 400; }
.so-lines .sale-lines tr.cur td, .so-lines .sale-lines tr.cur td.ln { box-shadow: none; background: #FAFCFA; }
.so-lines .sale-lines tr.note .oc-ico { background: var(--divider); color: var(--muted); }

@media (max-width: 900px) {
  .oc-band { grid-template-columns: minmax(0, 1fr) auto; padding: 14px 16px; }
  .oc-logo { grid-column: 1 / -1; border-right: 0; padding-right: 0; min-height: 0; }
  .oc-logo img, .oc-band img { height: 32px; }
  .oc-name h1 { font-size: 22px; }
  .oc-title { padding: 14px 16px 12px; }
  .oc .rv-grid { grid-template-columns: minmax(0, 1fr); }
  .so-lines .sale-lines td.ln { display: none; }
}

/* Tighter, so the button is in view on a laptop */
#sapage, #sopage, #oeOrder { gap: 10px; }
.rv-top { margin-top: -12px; }
.oc-title { padding: 14px 28px 12px; margin-bottom: 14px; }
.rv-ask { padding: 16px; gap: 10px; }
.oa-row { padding: 8px 12px; }
.oa-row .hint:empty { display: none; }
.oc-opt { min-height: 38px; }
.oa-row.stack .oa-ctl > .oc-opt { flex: 1 1 auto; padding: 4px 8px; }
.oa-row .oc-bopt { font-size: 13.5px; padding: 4px 10px 4px 6px; gap: 6px; }
.oa-row .oc-bopt img { width: 22px; height: 22px; }
.oa-row.stack .oa-ctl > input, .oa-row.stack .oa-ctl > select { min-height: 40px; }
@media (pointer: coarse) { .oc-opt { min-height: 44px; } .oa-row.stack .oa-ctl > input, .oa-row.stack .oa-ctl > select { min-height: 44px; } }
.oc-title { margin-bottom: 10px; }
.rv-ask { padding-top: 14px; }
.oc-band .so-total .so-dep { display: none; }   /* the deposit has its own row */

/* Phones and narrow windows */
@media (max-width: 980px) {
  .oc .rv-grid { grid-template-columns: minmax(0, 1fr); }
  #sopage .rv-ask { order: 0; }   /* keying an order: the lines and customer come first, the answers and the button after */
}
@media (max-width: 720px) {
  .oc-steps li { font-size: 0; padding-right: 0; }
  .oc-steps li.now { font-size: 13px; }
  .oa-row.stack .oa-ctl { flex-wrap: wrap; }
  .oa-row.stack .oa-ctl > .oc-opt { flex: 1 1 40%; }
  .oa-row:has(.oc-bopt) { grid-template-columns: minmax(0, 1fr); }
  .oa-row:has(.oc-bopt) .oa-ctl > * { flex: 1 1 0; }
}

/* Send the confirmation again, on a placed order */
.rs-box { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--divider); }
.rs-box label { font-size: 14px; font-weight: 700; }
.rs-box .rv-mail { width: 100%; min-height: 44px; }
.rs-box .hint, .rs-box .msg { margin: 0; }
.rs-box .msg:empty, .rv-ask > .msg:empty { display: none; }
.rv-ask > .msg { margin: 0; }
/* A placed order, read as a record */
.so-facts .oa-row { padding: 9px 14px; }
.so-recgst { margin: 10px 0 0; text-align: right; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.so-recnote { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--divider); }
.so-recnote span { font-size: 13px; font-weight: 700; color: var(--muted); }
.so-recnote p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.so-rec #srelrec:not(:empty) { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--divider); }

/* Order rows on a phone (review, 13 Nov 2026): the status stays on the row, under the date and total, so a quote, a confirmed order and one
   ready to invoice can be told apart. The brand filter is one row that scrolls sideways, not two. */
@media (max-width: 720px) {
  .oq-row .oq-state { display: inline-block; grid-row: 3; grid-column: 1 / -1; justify-self: start; font-size: 13px; padding: 3px 10px; }
  .oq-row .lrow-who { grid-row: 1; grid-column: 1 / -1; }
  .oq-row .lrow-when { grid-row: 2; grid-column: 1; }
  .oq-row .lrow-money { grid-row: 2; grid-column: 2; }
  .oq-brands { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .oq-b { flex: none; }
}

/* Sales orders: Ordered and ETD in columns of their own, with headings (13 Nov 2026). Only this list: To process and Projects keep theirs. */
.so-cols { --lrow-cols: 44px minmax(0, 1fr) 120px 120px 160px 140px; }
.so-nodue { color: var(--muted); font-weight: 400; }
.so-lab { display: none; }
.so-colhead { display: grid; grid-template-columns: var(--lrow-cols); gap: 4px 20px; align-items: end; padding: 12px 20px 8px; border-bottom: 1px solid var(--divider);
  font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.so-colhead > span:last-child { text-align: right; }
@media (max-width: 720px) {
  .so-colhead { display: none; }
  .so-lab { display: inline; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
  .so-cols .oq-row .so-ord { grid-row: 2; grid-column: 1; }
  .so-cols .oq-row .so-etd { grid-row: 3; grid-column: 1; }
  .so-cols .oq-row .lrow-money { grid-row: 2; grid-column: 2; }
  .so-cols .oq-row .oq-state { grid-row: 4; }
}

/* Site jobs: the Site and tenant panel, and the settings list (16 Nov 2026) */
.so-site { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-top: 10px; }
.so-site .wide { grid-column: 1 / -1; }
.so-site input, .so-site textarea, .so-sitecard input { width: 100%; box-sizing: border-box; }
.so-sitecard > .sale-fld { margin-top: 12px; max-width: 420px; }
.so-sitelist { list-style: none; margin: 8px 0 12px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-ctl); }
.so-sitelist li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--divider); }
.so-sitelist li:last-child { border-bottom: 0; }
.so-sitefound { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 8px; }
@media (max-width: 720px) { .so-site { grid-template-columns: 1fr; } }
.so-cbadd { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.so-cbadd .sale-fld { min-width: 120px; }
