/* Field workflow: common actions first; source detail remains available. */
#stop #arm-print{display:inline-flex;align-items:center;justify-content:center;gap:10px;box-sizing:border-box;flex:none;width:min(100%,24rem);min-height:72px;line-height:1.3;white-space:normal}
#arm-print .print-readiness-icon{width:24px;height:24px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;visibility:hidden}
#arm-print[data-print-state="waiting"]{background:var(--green);color:#fff;border-color:var(--green);opacity:1;cursor:default}
#arm-print[data-print-state="waiting"] .print-readiness-icon{visibility:visible}
#arm-print[data-print-state="arming"]{cursor:wait}
#arm-print .print-readiness-label{min-width:0;overflow-wrap:anywhere}
#stop .workflow-panel{padding:20px 24px;box-shadow:none}
#stop .workflow-panel>summary{min-height:48px;display:list-item;align-content:center;font-size:1.15rem}
#stop .workflow-panel[open]>summary{margin-bottom:12px}
#stop .workflow-panel>p{max-width:72ch;margin:8px 0 16px}
#stop-owner{font-size:.95rem;text-transform:none;letter-spacing:0}
#stop-meta{font-size:.9rem;color:#38594d}
#truck-panel .dot-label input{font-size:clamp(1.8rem,5vw,3rem);min-height:72px;letter-spacing:.04em;font-variant-numeric:tabular-nums}
#truck-panel #dot-state{border:1px solid #dbcea7;border-radius:6px;font-size:.9rem}
#scan-status{display:block;margin:12px 0;line-height:1.5}
#scan-truck{margin-top:12px;min-height:48px}
#active-carrier-list{font-size:.9rem}#active-carrier-list-text{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.carrier-confirm{border-top:1px solid #ccdcd6;padding-top:18px;margin-top:22px}
#engine-dialog,#list-row-dialog{width:min(720px,94vw);max-height:88dvh;padding:24px;border:1px solid #99b5a9;border-radius:14px;color:#142e2a}
#engine-dialog h2,#list-row-dialog h2{margin-top:0}#engine-dialog .engine-grid label{padding:12px;min-height:60px}
#list-row-content{overflow-wrap:anywhere}#watchlist-content section{padding:12px 0;border-top:1px solid #ccdcd6}#watchlist-content section>button{margin:5px 8px 5px 0}
#documents-panel .capture-controls{margin-bottom:20px}
#documents-panel #evidence-category-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
#evidence-category-buttons button{min-height:48px;padding:10px;font-size:.9rem}
#documents-panel .other-document-type{font-size:.9rem;max-width:380px}

#license-read-progress:not([hidden]) {
  display: block;
  width: min(100%, 22rem);
  margin: 10px 0 4px;
  accent-color: var(--green);
}

#evidence-capture-dialog {
  width: min(42rem, calc(100% - 1.5rem));
  max-height: calc(100vh - 1.5rem);
  max-height: calc(100dvh - 1.5rem);
  padding: clamp(14px, 3vw, 24px);
  overscroll-behavior: contain;
}

.evidence-capture-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.evidence-capture-header h2 {
  margin: 0;
  overflow-wrap: anywhere;
}

#evidence-capture-preview:not([hidden]) {
  display: block;
  width: 100%;
  max-height: 52vh;
  max-height: 52dvh;
  margin: 0;
  border-radius: 8px;
  background: #142e2a;
  object-fit: contain;
}

#evidence-capture-status {
  margin: 12px 0 0;
}

#evidence-capture-status:empty {
  display: none;
}

.evidence-capture-options {
  margin-bottom: 0;
}

#evidence-capture-dialog button {
  min-height: 48px;
}

@media (max-width: 420px) {
  #evidence-capture-dialog .evidence-capture-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .evidence-capture-options button {
    padding-inline: 8px;
  }
}

:root:has(#evidence-capture-dialog[data-capture-kind="photo"][open]) {
  overflow: hidden;
}

#evidence-capture-dialog[data-capture-kind="photo"][open] {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  background: #101918;
  color: #fff;
}

#evidence-capture-dialog[data-capture-kind="photo"] .evidence-capture-header {
  margin: 0;
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    10px max(16px, env(safe-area-inset-left));
}

#evidence-capture-dialog[data-capture-kind="photo"] #evidence-capture-preview:not([hidden]) {
  grid-row: 2;
  height: 100%;
  min-height: 0;
  max-height: none;
  border-radius: 0;
  background: #080d0c;
  object-fit: contain;
}

#evidence-capture-dialog[data-capture-kind="photo"] #evidence-capture-status {
  grid-row: 3;
  margin: 0;
  padding: 6px max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  color: #e4f0ed;
  text-align: center;
}

#evidence-capture-dialog[data-capture-kind="photo"] .evidence-capture-options {
  grid-row: 4;
  justify-self: center;
  width: min(100%, 42rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(58px, 11vw, 74px) minmax(0, 1fr);
  grid-template-areas: "device shutter upload";
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 10px max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
}

#evidence-capture-dialog[data-capture-kind="photo"] button:not(#capture-evidence-photo) {
  padding: 8px 10px;
  background: #263735;
  color: #fff;
  border-color: #6b807a;
  font-size: .85rem;
}

#evidence-capture-dialog[data-capture-kind="photo"] #capture-evidence-photo {
  grid-area: shutter;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  padding: 4px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: transparent;
  font-size: 0;
}

#evidence-capture-dialog[data-capture-kind="photo"] #capture-evidence-photo::before {
  content: "";
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
}

#evidence-capture-dialog[data-capture-kind="photo"] #capture-evidence-photo:active::before {
  background: #b6c8c3;
}

#evidence-capture-dialog[data-capture-kind="photo"] #capture-evidence-device {
  grid-area: device;
  justify-self: center;
}

#evidence-capture-dialog[data-capture-kind="photo"] #capture-evidence-upload {
  grid-area: upload;
  justify-self: center;
}

@media (orientation: landscape) and (max-height: 500px) {
  #evidence-capture-dialog[data-capture-kind="photo"] .evidence-capture-header {
    padding-top: max(4px, env(safe-area-inset-top));
    padding-bottom: 4px;
  }
  #evidence-capture-dialog[data-capture-kind="photo"] .evidence-capture-options {
    grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr);
    padding-top: 4px;
    padding-bottom: max(4px, env(safe-area-inset-bottom));
  }
}

#documents-panel #license-exception-form{max-width:none;margin:12px 0;background:transparent;border-radius:0;padding:0 0 12px}
#documents-panel #license-exception-form .check-label{justify-content:flex-start}
#documents-panel #asset-list:empty::after{content:'No documents saved yet.';color:#38594d;display:block;padding:12px 0}
#documents-panel .photo-card h3{font-size:.9rem;margin:0 0 8px}
#documents-panel details>summary{min-height:48px;align-content:center}
#report-panel #driver-copy-panel>summary{padding:16px;background:#146b4d;color:white;border-radius:8px;min-height:56px;font-weight:750}
#report-panel #driver-copy-panel[open]>summary{margin-bottom:16px}
#stop button,#stop .file-button,dialog button{min-height:48px}
#stop :focus-visible,dialog :focus-visible{outline:3px solid #2877a8;outline-offset:3px}
@media(max-width:600px){#stop .workflow-panel{padding:16px}#documents-panel #evidence-category-buttons{grid-template-columns:repeat(2,minmax(0,1fr))}.carrier-confirm>*{width:100%}#engine-dialog,#list-row-dialog{padding:18px}}

/* DOT-first truck capture: shared row, compact evidence thumbnail, immediate source results. */
#truck-panel > .actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
#truck-panel #scan-truck{margin:0}
#truck-panel .truck-identity-row{display:flex;align-items:center;gap:20px;flex-wrap:wrap}
#truck-panel .dot-label{width:auto;max-width:100%;margin:0}
#truck-panel #carrier-dot{box-sizing:content-box;width:9ch;max-width:calc(100% - 24px);padding:12px;min-height:0;font-size:clamp(2.25rem,12vw,6rem);line-height:1.1;letter-spacing:0;font-weight:750;text-align:center;font-variant-numeric:tabular-nums}
#truck-panel .truck-preview{width:120px;flex:0 0 120px;margin:0}
#truck-panel #truck-preview{display:block;width:100%;height:80px;object-fit:contain;border-radius:4px}
#truck-panel #truck-file-name{font-size:11px;line-height:1.3;overflow-wrap:anywhere;margin:4px 0 0}
#truck-panel #carrier-display-name{font-size:1.2rem;line-height:1.35;margin:12px 0 8px}
#truck-panel #carrier-source-home{margin:0 0 12px}
#truck-panel #carrier-profile,#truck-panel #texas-profile{padding:8px 0;margin:0;border:0}
#truck-panel #carrier-source-home h3{margin:4px 0;font-size:1rem}
#truck-panel #scan-status{font-size:.85rem;margin:8px 0}
#ocr-readings{width:min(760px,92vw);max-height:85dvh;overflow:auto;padding:20px;border:1px solid #99b5a9;border-radius:10px;color:#142e2a}
#ocr-readings::backdrop{background:rgb(0 0 0 / .45)}
#ocr-readings .actions{display:flex;justify-content:space-between;align-items:center}#ocr-readings h2{margin:0}
@media(max-width:600px){#truck-panel .truck-identity-row{gap:8px}#truck-panel .truck-preview{width:80px;flex-basis:80px}#truck-panel #truck-preview{height:54px}#truck-panel #carrier-dot{font-size:clamp(2rem,8vw,3rem)}}

/* Compact carrier toolbar fits tablet widths; wraps on phones. */
#truck-panel > .actions > button, #truck-panel > .actions > .file-button {font-size:13px;padding:10px 12px;min-height:48px}

/* Truck image remains available in saved evidence. */
#truck-panel .truck-preview {display:none !important}

#ocr-engine-progress{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}
#ocr-engine-progress:empty{display:none}
.ocr-engine-chip{display:inline-flex;align-items:center;gap:7px;padding:6px 10px;border-radius:999px;background:#edf3f5;color:#23434c;border:1px solid #c9d7db;font-size:13px;font-weight:600}
.ocr-engine-icon{display:inline-block;width:14px;height:14px;line-height:14px;text-align:center}
.ocr-engine-chip[data-state="running"] .ocr-engine-icon{border:2px solid #bdced3;border-top-color:#176b50;border-radius:50%;animation:ridge-ocr-spin .8s linear infinite}
.ocr-engine-chip[data-state="complete"]{background:#e6f4eb;color:#176239;border-color:#badbc6}
.ocr-engine-chip[data-state="error"]{background:#fff0eb;color:#9e3522;border-color:#e5b7aa}
@keyframes ridge-ocr-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.ocr-engine-chip[data-state="running"] .ocr-engine-icon{animation:none}}

.inspection-outcomes { display:flex; flex-wrap:wrap; gap: .25rem 1.5rem; }
.inspection-outcomes .inspection-oos { color:#b42318; font-weight:700; }
.inspection-outcomes .inspection-cvsa { color:#175cd3; font-weight:700; }

.inspection-card-meta { display:flex; flex-wrap:wrap; align-items:baseline; gap:.25rem 1rem; }
.inspection-card-meta .inspection-hm { color:#b42318; font-weight:700; }
.inspection-card-meta .inspection-pcv { color:#167044; font-weight:700; }
.inspection-card-meta .inspection-weighed { color:#a34700; font-weight:700; }

.carrier-search-capsule {display:inline-flex;align-items:center;gap:.75rem;padding:2px 4px 2px 14px;border:1px solid #9bbab0;border-radius:999px;background:#edf6f2;color:#173e33;font-size:14px;max-width:100%;}
.carrier-search-capsule .carrier-search-cancel {display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:0;border:0;border-radius:50%;font-size:26px;background:transparent;color:#173e33;cursor:pointer;}
.carrier-search-capsule .carrier-search-cancel:focus-visible {outline:3px solid #2877a8;outline-offset:1px;}

#texas-summary .texas-certificate-adverse {color:#b42318;font-weight:700;}

.evidence-tools {display:flex;flex-wrap:wrap;gap:8px;margin-top:16px;}
.evidence-tools button {min-height:48px;padding:10px 14px;}
.evidence-tool-dialog {box-sizing:border-box;width:min(720px,calc(100vw - 24px));max-height:85dvh;overflow:auto;border:1px solid #b5ccc4;border-radius:12px;padding:20px;}
.evidence-tool-dialog::backdrop {background:rgba(15,35,30,.5);}
.evidence-popup-header {display:flex;align-items:center;justify-content:space-between;gap:16px;position:sticky;top:-20px;background:white;padding:12px 0;z-index:1;}
.evidence-popup-header h2 {margin:0;}
.evidence-popup-close {min-height:48px;}
.evidence-tool-dialog pre {white-space:pre-wrap;overflow-wrap:anywhere;}

.carrier-tools {display:flex;flex-wrap:wrap;gap:8px;margin:12px 0;}
.carrier-tools button {min-height:48px;}
#texas-watchlist:disabled {opacity:.5;cursor:not-allowed;}

#texas-watchlist[hidden] {display:none !important;}
#texas-watchlist:not([hidden]) {background:#b42318;color:#fff;border:2px solid #b42318;font-weight:700;animation:ridge-match-pulse 2s ease-in-out infinite;}
@keyframes ridge-match-pulse {0%,100% {box-shadow:0 0 0 0 rgba(180,35,24,.12);}50% {box-shadow:0 0 0 6px rgba(180,35,24,.28);}}
@media (prefers-reduced-motion:reduce) {#texas-watchlist:not([hidden]) {animation:none;box-shadow:0 0 0 3px rgba(180,35,24,.2);}}

#start-inspection.inspection-start-loading {display:inline-flex;align-items:center;gap:10px;opacity:1;cursor:wait;}
#start-inspection.inspection-start-loading::before {content:'';width:16px;height:16px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:ridge-start-spin .8s linear infinite;flex-shrink:0;}
@keyframes ridge-start-spin {to {transform:rotate(360deg);}}
@media(prefers-reduced-motion:reduce) {#start-inspection.inspection-start-loading::before {animation:none;}}

#truck-panel .truck-identity-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 12px;align-items:center}
#truck-panel .dot-label{grid-column:1/-1}
#truck-panel .dot-entry-controls{display:flex;gap:8px;align-items:center;min-width:0}
#truck-panel .dot-entry-controls #carrier-dot{min-width:0;margin:0;font-size:clamp(1.35rem,6vw,2.2rem);font-variant-numeric:tabular-nums}
#truck-panel .dot-entry-controls button{flex:none;min-height:48px;font-family:inherit;font-size:1rem}
@media(max-width:600px){#truck-panel .dot-entry-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}#truck-panel .dot-entry-controls #carrier-dot{grid-column:1/-1}#truck-panel .dot-entry-controls button{width:100%}}
#carrier-search-progress:empty{display:none}
#carrier-search-progress .carrier-search-capsule{display:grid;grid-template-columns:minmax(0,1fr) auto;border-radius:8px;padding:2px 8px 8px 12px;margin:8px 0}
#carrier-search-progress progress{grid-column:1/-1;width:100%;height:8px;accent-color:#146b4d}


#stop #report-intake > .actions{align-items:stretch}
#stop #refresh-print-report{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:72px;line-height:1.3}
