/* The customer portal's stylesheet (2026-10-07, branch layout: moved out of index.html). */
:root {
  --bg: #f4f5f2; --panel: #ffffff; --ink: #1b2420; --muted: #5c6862; --line: #d8ddd8;
  --accent: #1d6b5a; --accent-ink: #ffffff; --ok: #1d7a46; --warn: #9a5b00; --bad: #b42318;
  --sel: #c2410c; --survey: #2457a6; --soft: #eef1ec;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111614; --panel: #19201d; --ink: #e3e9e5; --muted: #98a59e; --line: #2c3631;
    --accent: #4fbf9f; --accent-ink: #08130f; --ok: #4cc38a; --warn: #f0a33a; --bad: #ff6b5e;
    --sel: #fb923c; --survey: #7aa7ff; --soft: #1f2824; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111614; --panel: #19201d; --ink: #e3e9e5; --muted: #98a59e; --line: #2c3631;
  --accent: #4fbf9f; --accent-ink: #08130f; --ok: #4cc38a; --warn: #f0a33a; --bad: #ff6b5e;
  --sel: #fb923c; --survey: #7aa7ff; --soft: #1f2824; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
header { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 10px 16px;
  background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 8px; font-weight: 650; font-size: 17px; }
.brand .sub { color: var(--muted); font-weight: 400; font-size: 13px; }
nav { display: flex; gap: 4px; }
nav button { border: 0; background: none; padding: 6px 12px; border-radius: 6px; color: var(--muted); font-weight: 550; }
nav button.on { background: var(--soft); color: var(--ink); }
#auth { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
main { padding: 16px; }
/* Pages other than the workspace keep a readable width (2026-10-07, branch layout). */
#tab-jobs { max-width: 1500px; margin: 0 auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.narrow { max-width: 460px; margin: 40px auto; }
h1 { font-size: 20px; margin: 0 0 6px; } h2 { font-size: 15px; margin: 0 0 8px; }
.step h2 .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-size: 12px; margin-right: 8px; }
.step.idle { background: var(--soft); border-style: dashed; }  /* a11y lane: was opacity .55, which took text under 4.5:1 */
.step.idle h2 .n { background: var(--muted); color: var(--panel); }
p { margin: 4px 0 8px; } .muted { color: var(--muted); font-size: 13px; }
label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); }
label.inline { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); }
input, select, button, textarea { font: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; min-width: 0; }
button { cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.link { border: 0; background: none; color: var(--accent); padding: 0 2px; text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.row > label { flex: 1 1 140px; }
/* The New job workspace (2026-10-07, branch layout: "the layout with the map doesnt resize").
   Wide screens: the page is exactly the window's height; the steps column scrolls on its own and
   the map fills the rest of the width and height. The steps column starts at 40 % (never under
   360 px or over 60 %) and the splitter between the two resizes it (portal.js sets --steps-w).
   Under 900 px: one column, the page scrolls, and the map is a fixed share of the window. */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.splitter { display: none; }
.mapcol { display: flex; flex-direction: column; min-width: 0; }
#map { height: max(320px, 60vh); border-radius: 8px; border: 1px solid var(--line); background: var(--soft); }
@media (min-width: 901px) {
  body.ws { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  body.ws > header { flex: none; }
  body.ws > main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  body.ws #banner { flex: none; }
  body.ws #app, body.ws #tab-new { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  body.ws .workspace { flex: 1 1 auto; min-height: 0; gap: 0;
    grid-template-columns: var(--steps-w, clamp(360px, 40%, 60%)) 12px minmax(0, 1fr); }
  body.ws .steps { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
  body.ws .steps > .card:last-child { margin-bottom: 0; }
  body.ws .splitter { display: block; cursor: col-resize; position: relative; touch-action: none; }
  body.ws .splitter::after { content: ""; position: absolute; top: 0; bottom: 0; left: 5px; width: 2px;
    border-radius: 1px; background: var(--line); }
  body.ws .splitter:hover::after, body.ws .splitter:focus-visible::after, body.ws .splitter.drag::after { background: var(--accent); }
  body.ws .splitter:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  body.ws .mapcol { min-height: 0; }
  body.ws #map { flex: 1 1 auto; height: auto; min-height: 240px; }
  body.ws .mapcol details.layers { flex: none; max-height: 45%; overflow-y: auto; margin: 8px 0 0; }
  body.ws .mapcol .attrib { flex: none; }
  body.dragging, body.dragging * { cursor: col-resize !important; user-select: none; }
}
@media (max-width: 900px) { main { padding: 12px; } }
@media (max-width: 480px) { #map { height: max(300px, 55vh); } }
.msg { font-size: 13px; margin-top: 6px; min-height: 1em; } .msg.err { color: var(--bad); } .msg.ok { color: var(--ok); }
.note { border-left: 3px solid var(--line); padding: 4px 10px; margin: 8px 0; font-size: 14px; }
.note.ok { border-color: var(--ok); } .note.warn { border-color: var(--warn); } .note.bad { border-color: var(--bad); }
.banner { padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; font-size: 14px; border: 1px solid var(--line); background: var(--panel); }
.banner.err { border-color: var(--bad); color: var(--bad); } .banner.ok { border-color: var(--ok); color: var(--ok); }
.lines { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
.lines label { padding: 2px 0; font-size: 14px; }
.lines .meta { color: var(--muted); font-size: 12px; margin-left: auto; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
.gst { font-size: 12px; white-space: normal; }
tr.removed td { opacity: .45; }
.reason { color: var(--warn); font-size: 13px; } .reason.bad { color: var(--bad); }
/* A row's reason or note goes on its own row under it, across every column (2026-10-07,
   branch layout): never squeezed into one narrow column. */
table.rows-with-notes { table-layout: auto; }
table.rows-with-notes tr.has-note > td { border-bottom: 0; padding-bottom: 2px; }
table.rows-with-notes tr.note-row > td { white-space: normal; overflow-wrap: anywhere; padding-top: 0;
  padding-bottom: 8px; font-size: 13px; line-height: 1.45; }
table.rows-with-notes tr.note-row .muted { margin-top: 2px; }
/* In a table wider than its scroll box (a phone), the note stays in view and wraps at the box's
   width instead of running off past the right edge with the table. */
.scroll { container-type: inline-size; }
table.rows-with-notes tr.note-row > td > * { position: sticky; left: 8px; max-width: calc(100cqw - 16px); }
#q-table td.inc, #q-table th.inc { text-align: center; width: 1%; white-space: nowrap; }
#q-table td.inc .pill { margin-left: 4px; }
/* the GST line may wrap so the Line column keeps room for a long name (audit fix 4) */
#q-table .gst { white-space: normal; }
#q-table th:first-child, #q-table td:first-child { width: 100%; min-width: 6em; overflow-wrap: anywhere; }
.total { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.total strong { font-size: 18px; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 10px; border: 1px solid currentColor; white-space: nowrap; }
.pill.processing { color: var(--survey); } .pill.in_review { color: var(--warn); } .pill.ready { color: var(--ok); }
.pill.refused, .pill.failed { color: var(--bad); }
.files { display: flex; flex-wrap: wrap; gap: 6px; }
.hits { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-height: 200px; overflow-y: auto; }
.hits button { text-align: left; }
details.layers { margin-top: 10px; } details.layers summary { cursor: pointer; font-weight: 600; font-size: 14px; }
fieldset.grp { border: 1px solid var(--line); border-radius: 6px; margin: 8px 0; padding: 4px 10px 8px; }
fieldset.grp legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.lyr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 6px; font-size: 13px; margin: 3px 0; }
.lyr .st { grid-column: 2; color: var(--muted); font-size: 11.5px; } .lyr .st.err { color: var(--bad); } .lyr .st.warn { color: var(--warn); }
.lyr .jur { color: var(--muted); font-size: 11px; margin-left: 4px; }
.attrib { color: var(--muted); font-size: 11.5px; margin-top: 6px; }
.layer-cols { columns: 2 260px; }
.pop dl { display: grid; grid-template-columns: max-content minmax(0, 240px); gap: 2px 10px; margin: 6px 0 0; font-size: 12px; }
.pop dt { color: var(--muted); } .pop dd { margin: 0; overflow-wrap: anywhere; } .pop .src { color: var(--muted); font-size: 11px; margin-top: 6px; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--ink); }
.leaflet-popup-content { max-height: 340px; overflow-y: auto; }
#map.drawing { cursor: crosshair; }
#map.drawing .leaflet-vectors-pane, #map.drawing .leaflet-survey-pane,
#map.drawing .leaflet-vectors-pane *, #map.drawing .leaflet-survey-pane * { pointer-events: none !important; }
.empty { color: var(--muted); padding: 10px 0; }
/* jobs as cards on a phone */
@media (max-width: 720px) {
  #j-table thead { display: none; }
  #j-table tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); }
  #j-table td { display: block; border: 0; padding: 2px 0; text-align: left; }
  #q-table thead { display: none; }
  #q-table tr { display: block; padding: 6px 0; border-bottom: 1px solid var(--line); }
  #q-table td { display: block; border: 0; padding: 1px 0; text-align: left; width: auto; }
  #q-table td.inc { text-align: left; width: auto; }
  #q-table tr.has-note, #j-table tr.has-note { border-bottom: 0; padding-bottom: 0; }
  #j-table tr.note-row { padding-top: 2px; }
  #q-table tr.note-row { padding-top: 2px; }
  #q-table tr.note-row > td > *, #j-table tr.note-row > td > * { position: static; max-width: none; }
  #q-table td[data-label]::before, #j-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 12px; }
}
/* results viewer (2026-10-06): a released job's section, map, targets and report */
#viewer .vw-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; }
#viewer h3 { font-size: 14px; margin: 14px 0 6px; }
#viewer .rv-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 900px) { #viewer .rv-grid { grid-template-columns: minmax(0, 1fr); } }
#viewer .rv-fig { position: relative; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
#viewer .rv-fig img { display: block; width: 100%; height: auto; }
#viewer .rv-fig svg.rv-over { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#viewer .rv-map { height: 340px; border-radius: 6px; border: 1px solid var(--line); background: var(--soft); }
#viewer .rv-targets { max-height: 300px; overflow: auto; }
#viewer .rv-targets td { font-variant-numeric: tabular-nums; cursor: pointer; white-space: nowrap; }
#viewer tbody tr:hover, #viewer tbody tr.sel { background: color-mix(in srgb, var(--accent) 14%, transparent); }
#viewer .rv-opinion { font-size: 13px; margin: 6px 0 0; padding: 6px 8px; border-left: 3px solid var(--accent); background: var(--soft); min-height: 1.5em; }
#viewer iframe.rv-report { width: 100%; height: 620px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
@media (max-width: 720px) { #viewer iframe.rv-report { height: 460px; } #viewer .rv-map { height: 280px; } }
#viewer .tag { font-size: 12px; color: var(--muted); margin-top: 4px; }
#viewer .warnc { color: var(--warn); }
#viewer .dl { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 10px; }
dialog.rv-full { width: min(1200px, 96vw); height: 92vh; padding: 0; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--ink); }
dialog.rv-full::backdrop { background: rgba(0, 0, 0, .55); }
dialog.rv-full .bar { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line); }
dialog.rv-full iframe { width: 100%; height: calc(92vh - 48px); border: 0; background: #fff; }
#j-table tr.viewable { cursor: pointer; }
#j-table tr.open td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
[hidden] { display: none !important; }
/* utilities (2026-10-07, branch layout: the page carries no style attributes) */
.mt4 { margin-top: 4px; } .mt6 { margin-top: 6px; } .mt8 { margin-top: 8px; } .mt10 { margin-top: 10px; }
.mt12 { margin-top: 12px; } .mb6 { margin-bottom: 6px; } .m0 { margin: 0; } .fs14 { font-size: 14px; }
.grow { flex: 1 1 auto; } .row > label.grow { flex: 1 1 auto; } .ml-auto { margin-left: auto; }
.row.between { justify-content: space-between; align-items: center; }
/* area of interest (2026-10-08, branch area): step 1's card, its tabs and what is inside */
.ar-tabs { gap: 4px; margin: 4px 0 8px; }
.ar-tabs button { border-radius: 6px; padding: 4px 12px; color: var(--muted); }
.ar-tabs button.on { background: var(--soft); color: var(--ink); border-color: var(--accent); }
.ar-pane { margin-bottom: 4px; }
.ar-match { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; align-items: center;
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.ar-match .row { gap: 6px; }
.ar-h { font-size: 13.5px; margin: 10px 0 4px; }
.ar-group { margin: 6px 0; } .ar-gt { font-weight: 600; font-size: 13px; }
.ar-row { font-size: 13px; margin: 2px 0 2px 8px; } .ar-row summary { cursor: pointer; }
.ar-row .jur { color: var(--muted); font-size: 11px; }
.ar-names { margin: 2px 0 4px; padding-left: 20px; max-height: 160px; overflow-y: auto; }
.fs11 { font-size: 11px; }
#map.area-drawing { cursor: crosshair; }
#map.area-drawing .leaflet-vectors-pane, #map.area-drawing .leaflet-survey-pane,
#map.area-drawing .leaflet-vectors-pane *, #map.area-drawing .leaflet-survey-pane * { pointer-events: none !important; }
/* 2026-10-08 (branch batchview): My jobs groups the lines submitted together under a batch row;
   its "View results" opens the survey results page (viewer.css). */
#j-table tr.batch-row td { background: var(--soft); border-top: 2px solid var(--line); }
#j-table tr.batch-row.viewable { cursor: pointer; }
#j-table tr.batch-row.open td { box-shadow: inset 3px 0 0 var(--accent); }
#j-table tr.in-batch td:first-child { padding-left: 18px; }
#batchview { margin-bottom: 14px; }
#batchview .bv-top h2 { font-size: 17px; }

/* -- accessibility (2026-10-08, lane a11y) --------------------------------------------------
   A visible focus ring on every control, a skip link, text only screen readers read, a mark at
   the map's centre while drawing (the keyboard way to add a corner), and no motion for anyone
   who asks their system for less. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible,
a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#map:focus-visible, .rv-map:focus-visible, .bv-map:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
tr[tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 2000; padding: 8px 14px; border-radius: 6px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 8px; }
main:focus { outline: none; }
nav button[aria-current="page"] { background: var(--soft); color: var(--ink); }
#map.area-drawing::after, #map.drawing::after, #map.centre-mark::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px;
  margin: -11px 0 0 -11px; z-index: 900; pointer-events: none; border-radius: 50%;
  border: 2px solid var(--sel); box-shadow: 0 0 0 2px var(--panel); }
/* the selected line chip of the shared results page (viewer.css #e8590c with white was 3.6:1) */
#batchview .bv-chip.on { background: #c2410c; border-color: #c2410c; color: #fff; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Former inline style attributes (2026-10-11, lane assets2; runbook 49): the page's CSP allows
   no inline style, so the script names these classes instead. !important keeps the precedence
   an inline style had over every rule above (e.g. #viewer h3). */
.s-m0 { margin: 0 !important; } .s-mt0 { margin-top: 0 !important; }
.s-mt10 { margin-top: 10px !important; }

/* 2026-10-12 (lane dcclient): the picture of the downward-continued field, on some accounts */
.dcs-fig { margin: 14px 0 0; }
.dcs-fig .dcs-img { display: block; width: 100%; max-width: 980px; height: auto; border: 1px solid var(--line, #d0d7de); background: #fff; }
.dcs-fig figcaption { max-width: 980px; }
/* 2026-10-13 (lane portalux): billing in one place, the demo's first screen, the in-page
   confirmation before Submit, and the new jobs marked on My surveys. */
#tab-billing { max-width: 1500px; margin: 0 auto; }
#owed-table td.pay > * + * { margin-top: 4px; }
.card.intro { border-left: 4px solid var(--accent); }
.card.next { border-left: 4px solid var(--ok); }
.card.next p { margin: 2px 0; }
a.button { display: inline-block; text-decoration: none; padding: 6px 12px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--ink); background: var(--panel); font-weight: 600; }
a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.confirmbox { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--accent); border-radius: 8px;
  background: var(--soft); }
.confirmbox p { margin: 0 0 8px; }
#j-table tr.just-sent > td { background: color-mix(in srgb, var(--ok) 12%, var(--panel)); }
/* phones: nothing on a client page scrolls sideways (finding F12) */
@media (max-width: 720px) {
  #owed-table thead, #pay-table thead, #inv-table thead, #cr-packs thead { display: none; }
  #owed-table tr, #pay-table tr, #inv-table tr, #cr-packs tr { display: block; padding: 8px 0;
    border-bottom: 1px solid var(--line); }
  #owed-table td, #pay-table td, #inv-table td, #cr-packs td { display: block; border: 0; padding: 2px 0;
    text-align: left; }
  #owed-table td[data-label]::before, #pay-table td[data-label]::before, #inv-table td[data-label]::before,
  #cr-packs td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 12px; }
}
