/* === ADDED 2026-10-21: GEMELEC Jobs phase 1A, customers and sites ======================== */
/* Loaded after css/style.css and css/jobs.css by /jobs/customers and /jobs/sites only. Its own
   file (not appended to css/jobs.css) so the parallel phase branches never edit the same lines
   and merge without conflicts, as phase 5 did with css/jobs-leads.css. Lists, record pages and
   forms built by js/jobs/forms.js: same panels, inputs and cards as /jobs; everything below
   480px wide stacks into one column for a phone (checked at 375px). */

.jobs-logo-link { text-decoration: none; }

.jobs-crumbs { font-size: 14px; color: var(--gx-muted-2); margin: 0 0 10px; }
.jobs-crumbs a { color: var(--gx-strong); font-weight: 500; text-decoration: none; border-bottom: 2px solid var(--gx-yellow); }

.jobs-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.jobs-title-row h1 { margin: 0 0 6px; }
.jobs-title-row .tech-section-title { flex: 1 1 auto; }
.jobs-save { min-height: 48px; padding: 12px 22px; }

.jobs-section { margin-top: 8px; }
.jobs-main { margin-bottom: 8px; }
.jobs-add-box {
  background: var(--gx-card);
  border: 1.5px solid var(--gx-line-strong);
  border-radius: 10px;
  padding: 4px 14px 14px;
  margin: 0 0 14px;
}
.jobs-add-box > .tech-section-title:first-child { margin-top: 12px; }
.jobs-fill-btn { margin-top: 12px; }

/* Search and results. */
.jobs-search { margin: 6px 0 4px; }
.tech-panel input[type="search"],
.tech-panel input[type="date"] {
  width: 100%;
  box-sizing: border-box;
  font: 400 16px/1.45 'DM Sans', system-ui, sans-serif;
  padding: 13px 14px;
  border: 1.5px solid var(--gx-field-line);
  border-radius: 10px;
  background: var(--gx-field);
  color: var(--gx-strong);
}
.tech-panel input[type="search"] { -webkit-appearance: none; appearance: none; }
.tech-panel input[type="date"] { min-height: 52px; }
.tech-panel input[type="search"]:focus,
.tech-panel input[type="date"]:focus,
.tech-panel select:focus {
  outline: none;
  border-color: var(--gx-focus-line);
  box-shadow: 0 0 0 3px var(--gx-focus-ring);
}
.tech-panel .jobs-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 400;
  font-size: 15px;
  cursor: pointer;
}
.jobs-toggle input { width: 20px; height: 20px; accent-color: var(--gx-accent); }
.jobs-count { margin: 12px 0 8px; }
.jobs-results { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }

a.jobs-row-link { display: block; color: inherit; text-decoration: none; }
a.jobs-row-link:hover, a.jobs-row-link:focus-visible { border-color: var(--gx-line-strong); }
.jobs-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--gx-text-3);
}
.jobs-tag.is-archived { background: var(--gx-bad-bg); color: var(--gx-bad-ink); }
.jobs-tag.is-internal { background: var(--gx-warn-bg-2); color: var(--gx-warn-ink); }

/* A record's details: label / value rows, one column on a phone. */
.jobs-details {
  display: grid;
  grid-template-columns: minmax(120px, 28%) 1fr;
  gap: 8px 16px;
  margin: 0 0 12px;
  font-size: 15px;
}
.jobs-details dt { color: var(--gx-muted-2); font-weight: 500; }
.jobs-details dd { margin: 0; color: var(--gx-strong); overflow-wrap: anywhere; }
/* Phone numbers and emails are tap targets: underlined in the brand yellow, like the crumbs. */
.jobs-details a, .jobs-ways a, .jobs-row a {
  color: var(--gx-strong);
  text-decoration: underline;
  text-decoration-color: var(--gx-link-line);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
@media (max-width: 480px) {
  .jobs-details { grid-template-columns: 1fr; gap: 0; }
  .jobs-details dd { margin-bottom: 10px; }
}
.jobs-pre { white-space: pre-wrap; }
.jobs-ways { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
.jobs-details .jobs-ways { margin-left: 12px; }
.jobs-contact-line { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }

/* Forms. */
.jobs-form { margin: 0; }
.jobs-field { min-width: 0; }
.tech-panel .jobs-field-hint { margin: 6px 0 0; }
.jobs-field-label { display: block; font-weight: 500; font-size: 14px; margin: 14px 0 6px; color: var(--gx-strong); }
.jobs-form select { width: 100%; }
.tech-panel textarea.jobs-textarea { min-height: 84px; }
.jobs-field .jobs-unit-row { margin-top: 0; flex-wrap: nowrap; }
.tech-panel .jobs-unit-row input.jobs-num { flex: 0 1 160px; }
.jobs-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.jobs-form-row.jobs-address-row { grid-template-columns: 1fr 100px 110px; }
@media (max-width: 480px) {
  .jobs-form-row { grid-template-columns: 1fr; }
  .jobs-form-row.jobs-address-row { grid-template-columns: 1fr 1fr; }
  .jobs-form-row.jobs-address-row > .jobs-field:first-child { grid-column: 1 / -1; }
}
.tech-panel .jobs-check { margin-top: 14px; }
.jobs-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.tech-panel [aria-invalid="true"] { border-color: var(--gx-bad-line); }

/* Named custom fields on a site: name, value, remove. */
.jobs-custom-rows { display: grid; gap: 8px; margin-bottom: 8px; }
.jobs-custom-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto; gap: 8px; align-items: center; }
@media (max-width: 480px) {
  .jobs-custom-row { grid-template-columns: 1fr auto; padding-bottom: 8px; border-bottom: 1px solid var(--gx-line-2); }
  .jobs-custom-row input:nth-child(2) { grid-column: 1 / 2; grid-row: 2; }
  .jobs-custom-row button { grid-row: 1 / 3; grid-column: 2; }
}

/* A record's own change history, folded away. */
.jobs-history { margin-top: 26px; }
.jobs-history summary {
  cursor: pointer;
  font-family: 'Barlow Condensed', system-ui, sans-serif;
  font-size: 20px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--gx-strong);
  padding: 6px 0;
}
.jobs-history-body { margin-top: 8px; }

/* === ADDED 2026-10-24: new customer, site and contact while making a quote or a job ======= */
/* js/jobs/customer-picker.js, on /jobs/quotes and /jobs/list (both load this file). The search,
   "+ New customer" and its short form, the "Already on file?" matches, and the site and contact
   boxes with "+ New site" / "+ New contact". Tokens only, so dark mode needs nothing extra.
   Every button here is at least 44px tall (a thumb, not a pointer); checked at 375px. */
.cp { margin-bottom: 4px; }
.cp-search[hidden], .cp-new[hidden], .cp-add[hidden], .cp-actions[hidden] { display: none; }
.cp .jobs-link-btn, .cp-field .jobs-link-btn { min-height: 44px; }
.cp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* Search results: one tap picks the customer. */
.cp-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.cp-pick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-height: 48px;
  text-align: left;
  background: var(--gx-card);
  border: 1.5px solid var(--gx-line-3);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  color: var(--gx-strong);
  cursor: pointer;
}
.cp-pick:hover, .cp-pick:focus-visible { border-color: var(--gx-line-strong); }
.cp-none { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.tech-panel .cp-none .tech-hint { margin: 0; }

/* The short forms, sunk into the New quote / New job box. */
.cp-form {
  background: var(--gx-well);
  border: 1.5px solid var(--gx-line-2);
  border-radius: 10px;
  padding: 2px 12px 14px;
  margin-top: 10px;
}
.cp-form-title {
  font-family: 'Barlow Condensed', system-ui, sans-serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--gx-strong);
  margin: 12px 0 2px;
}
.tech-panel .cp-form > .tech-hint { margin: 0 0 2px; }

/* A site or contact box with its "+ New" button beside it (below it on a phone). */
.cp-select-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tech-panel .cp-select-row select { flex: 1 1 240px; min-width: 0; width: auto; max-width: 100%; }

/* "Already on file?": the customers that look the same, each with Use this one. */
.cp-matches {
  background: var(--gx-warn-bg-3);
  border-left: 3px solid var(--gx-warn-line);
  color: var(--gx-warn-text);
  border-radius: 6px;
  padding: 10px 12px 12px;
  margin: 16px 0 0;
}
.cp-matches-title { font-size: 16px; font-weight: 700; margin: 0 0 2px; color: var(--gx-warn-text); }
.cp-matches-title:focus { outline: none; }
.cp-matches-lede { font-size: 14px; margin: 0; }
.cp-match-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.cp-match {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  background: var(--gx-card);
  border: 1.5px solid var(--gx-line-2);
  border-radius: 8px;
  padding: 10px 12px;
}
.cp-match-text { display: grid; gap: 2px; flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; color: var(--gx-strong); }
.cp-match-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.cp-match-why { font-size: 13px; color: var(--gx-text-3); }
/* One match: its "Use this one" is the yellow button (the form's own button turns quiet). */
.cp-match .btn.cp-use { margin: 0; }

/* === ADDED 2026-10-24: "Fill from a screenshot" ========================================= */
/* js/jobs/scan.js, on the new customer forms of /jobs/quotes, /jobs/list and /jobs/customers
   (all three load this file): the button, the reading line with the screenshot's thumbnail,
   the boxes it filled (teal) and the ones to check (amber, with a "Check this" chip), and the
   suggested visit card. Tokens only, so dark mode needs nothing extra; every button is at
   least 44px tall; checked at 375px. */
.scan-bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 12px 0 2px; }
/* The hidden file box behind the button. The form's own input rules (full width, 44px tall)
   would otherwise stretch it past the edge of a phone screen and scroll the page sideways. */
.scan-bar input.scan-file { width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0; margin: 0; border: 0; left: 0; top: 0; }
.scan-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; }
.scan-btn .gx-ico { width: 20px; height: 20px; color: var(--gx-teal-text); }
.tech-panel .scan-tip { margin: 0; font-size: 13px; }
/* Paste and drop are for a computer; a phone has the photo picker behind the button. */
@media (hover: none) { .tech-panel .scan-tip { display: none; } }

.scan-status { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; font-size: 14px; margin: 8px 0 0; color: var(--gx-text-3); }
.scan-status:empty { display: none; }
.scan-status.is-ok { color: var(--gx-good-ink-2); }
.scan-status.is-error { color: var(--gx-bad); }
.scan-status.is-warn { color: var(--gx-warn-ink); }
.scan-status-text { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; line-height: 1.45; }
.scan-spin {
  display: inline-block;
  width: 13px; height: 13px;
  margin: 0 8px -2px 0;
  border: 2px solid var(--gx-line-3);
  border-top-color: var(--gx-teal);
  border-radius: 50%;
  animation: scan-spin 0.8s linear infinite;
}
@keyframes scan-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .scan-spin { animation: none; border-top-color: var(--gx-teal); } }

/* The screenshot, small; a tap shows it at full width to check the marked boxes against. */
.scan-thumb {
  flex: 0 0 auto;
  width: 56px; height: 72px;
  padding: 0;
  border: 1.5px solid var(--gx-line-3);
  border-radius: 6px;
  overflow: hidden;
  background: var(--gx-paper);
  cursor: zoom-in;
}
.scan-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.scan-thumb.is-big { flex-basis: 100%; width: 100%; height: auto; max-width: 420px; cursor: zoom-out; }
.scan-thumb.is-big img { height: auto; max-height: 75vh; object-fit: contain; }

/* The boxes the screenshot filled: teal until changed; doubtful ones amber. */
.tech-panel input.scan-filled,
.tech-panel select.scan-filled,
.tech-panel textarea.scan-filled { border-color: var(--gx-teal); box-shadow: 0 0 0 3px var(--gx-teal-tint); }
.tech-panel input.scan-check,
.tech-panel select.scan-check,
.tech-panel textarea.scan-check { border-color: var(--gx-warn-line); box-shadow: 0 0 0 3px var(--gx-warn-bg); }
.scan-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.5;
  border-radius: 999px;
  padding: 1px 8px;
  background: var(--gx-warn-bg-2);
  color: var(--gx-warn-ink);
  vertical-align: 1px;
  white-space: nowrap;
}
/* A screenshot dragged over the form. */
.scan-drop { outline: 2px dashed var(--gx-teal); outline-offset: 4px; }

.scan-after:empty { display: none; }
.tech-panel .scan-note { font-size: 14px; margin: 8px 0 0; color: var(--gx-text-3); overflow-wrap: anywhere; }
.tech-panel .scan-note.is-warn { color: var(--gx-warn-text); background: var(--gx-warn-bg-3); border-left: 3px solid var(--gx-warn-line); border-radius: 6px; padding: 8px 10px; }
.scan-note-who { font-weight: 700; }

/* The suggested visit: "They asked for Tue 27 Oct, afternoon", Add to schedule, Ignore. */
.scan-visit {
  background: var(--gx-card);
  border: 1.5px solid var(--gx-line-2);
  border-left: 4px solid var(--gx-teal);
  border-radius: 8px;
  padding: 10px 12px 12px;
  margin: 12px 0 4px;
  overflow-wrap: anywhere;
}
.scan-visit.is-check { border-left-color: var(--gx-warn-line); }
.scan-visit.is-done { padding-bottom: 10px; }
.tech-panel .scan-visit-head { margin: 0; font-size: 15px; line-height: 1.45; color: var(--gx-strong); }
.scan-visit-words { color: var(--gx-text-3); }
.tech-panel .scan-visit-check { margin: 6px 0 0; font-size: 14px; line-height: 1.45; color: var(--gx-warn-text); }
.scan-visit-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; margin-top: 10px; }
.tech-panel .scan-visit-day { display: grid; gap: 4px; margin: 0; font-size: 14px; flex: 1 1 180px; min-width: 0; }
.tech-panel .scan-visit-day input[type="date"] { min-height: 48px; }
/* From and To on the suggested visit (the schedule, 30 Oct 2026). */
.tech-panel .scan-visit-day.scan-visit-at { flex: 1 1 110px; }
.tech-panel .scan-visit-time { width: 100%; min-height: 48px; box-sizing: border-box; padding: 10px 12px; border: 1.5px solid var(--gx-field-line); border-radius: 10px; background: var(--gx-field); color: var(--gx-strong); font: 400 16px/1.45 'DM Sans', system-ui, sans-serif; }
.tech-panel .scan-visit-time:focus { outline: none; border-color: var(--gx-focus-line); box-shadow: 0 0 0 3px var(--gx-focus-ring); }
.scan-visit .btn.scan-add { margin: 0; }
.scan-visit .jobs-link-btn { min-height: 44px; }
.scan-again { margin-left: 4px; }
.tech-panel .scan-visit-hint { margin: 8px 0 0; }

/* /jobs/share (Android "Share" to GEMELEC): the screenshot and where it goes. */
.sh-choices { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; }
.sh-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; text-decoration: none; box-sizing: border-box; }
.sh-preview { display: block; max-width: 100%; max-height: 55vh; margin: 4px 0 12px; border: 1.5px solid var(--gx-line-3); border-radius: 8px; background: var(--gx-paper); }
