#hazmat-review,
.hm-regulation {
  --hm-review-emphasis: #a32620;
}

#hazmat-review {
  min-width: 0;
  overflow-wrap: anywhere;
}

#hazmat-review h3 {
  margin: 0 0 5px;
}

#hm-file-controls {
  margin: 10px 0 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f3f8f5;
}

.hm-group-help { margin-bottom: 0; }

.hm-page-move,
.hm-review-actions,
.hm-paper-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.hm-page-move { grid-column: 1 / -1; }
.hm-page-move button { padding: 8px 12px; }
.hm-file-kind { font-weight: 400; }

.hm-paper-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 8px;
}

.hm-paper-header h3 { min-width: 0; flex: 1 1 220px; }
.hm-paper-actions { margin-bottom: 4px; }
.hm-paper-actions button { min-height: 48px; }
.hm-paper-actions .hm-task-remove-read { flex: 1 1 220px; }
.hm-read-removal-status { margin: 12px 0; padding: 12px; background: #eef5f1; border: 1px solid var(--border); border-radius: 6px; }
.hm-read-removal-status p { margin: 0 0 8px; }
.hm-remove-read-source { font-weight: 650; }
.hm-remove-read .hm-check { display: flex; align-items: center; gap: 10px; }
.hm-remove-read .hm-question-note textarea { resize: none; }
.hm-review-actions { margin-top: 12px; }
.hm-review-overview h4 { margin: 18px 0 8px; }

.hm-next-actions { list-style: none; margin: 8px 0; padding: 0; }
.hm-next-actions li { margin: 6px 0; }
.hm-next-actions button { width: 100%; text-align: left; justify-content: flex-start; white-space: normal; }
.hm-next-more { margin-bottom: 10px !important; }

.hm-review-history { margin-top: 20px; border-top: 1px solid var(--border); }
.hm-review-history > summary,
.hm-saved-review > summary { min-height: 48px; padding: 12px 4px; cursor: pointer; font-weight: 650; }
.hm-saved-review { padding-inline-start: 8px; }
.hm-review-history .hm-paper { margin-top: 0; }
.hm-line-body > h4 { margin: 14px 0 8px; }
.hm-line-shipment,
.hm-relevant-details { border-top: 1px solid var(--border); }
.hm-description-difference {
  margin: 12px 0;
  padding: 12px;
  color: #802b17;
  background: #fff0e4;
  border-inline-start: 3px solid var(--hm-review-emphasis);
}
.hm-description-difference p { margin: 6px 0 0; }
#hazmat-review .hm-difference-action { color: #802b17; border-color: var(--hm-review-emphasis); }

#hazmat-review button,
#hazmat-review summary,
#hazmat-review label.hm-check,
.hm-page-choice {
  min-height: 48px;
}

#hazmat-review button:not(:disabled):hover {
  filter: brightness(.95);
}

#hazmat-review summary:focus-visible,
.hm-page-choice:focus-within,
.hm-check:focus-within {
  outline: 3px solid #a0d1ba;
  outline-offset: 2px;
}

#hazmat-review a {
  color: var(--green);
  text-underline-offset: .18em;
}

#hazmat-review .hm-citation {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  cursor: pointer;
}

.hm-review-overview {
  margin: 4px 0 14px;
  padding: 12px 14px;
  background: #eef5f1;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.hm-review-overview p {
  margin: 6px 0 0;
}

.hm-review-overview[data-state="review"] > strong {
  color: #802b17;
}

.hm-regulation {
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
  max-width: min(900px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

.hm-regulation > .weight-heading {
  position: sticky;
  top: 0;
  background: #fff;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.hm-regulation-actions,
.hm-code-list,
.hm-provision-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.hm-regulation button,
.hm-provision-code,
.hm-regulation .hm-citation {
  min-height: 48px;
  min-width: 48px;
  cursor: pointer;
}

.hm-regulation .hm-citation {
  display: inline-flex;
  align-items: center;
  color: var(--green);
  text-underline-offset: .18em;
}

.hm-provision-code {
  flex: 0 0 72px;
  width: 72px;
  height: 48px;
  padding: 8px 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hm-provision-row {
  padding-block: 4px;
}

#hazmat-review .hm-bulk-code {
  color: var(--hm-review-emphasis);
  font-weight: 800;
}

.hm-technical-name {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.hm-technical-name strong {
  font-size: .88rem;
}

.hm-technical-name p {
  margin: 4px 0 0;
}

.hm-values > .hm-packaging-selected,
.hm-values > .hm-packaging-possible {
  padding: 8px;
  border: 2px solid var(--hm-review-emphasis);
  border-radius: 0;
}

.hm-values > .hm-packaging-possible {
  border-style: dashed;
}

.hm-packaging-cue {
  margin: 6px 0 0;
  color: var(--hm-review-emphasis);
  font-size: .88rem;
  font-weight: 700;
}

.hm-source-hash {
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.hm-regulation a:hover,
.hm-regulation button:hover,
#hazmat-review .hm-provision-code:hover {
  filter: brightness(.9);
}

.hm-regulation :is(a, button, [tabindex]):focus-visible,
#hazmat-review .hm-provision-code:focus-visible {
  outline: 3px solid var(--focus, #2877a8);
  outline-offset: 2px;
}

.hm-regulation .hm-reference-unavailable {
  color: #802b17;
}

.hm-regulation-body {
  white-space: pre-line;
  line-height: 1.55;
}

.hm-regulation-body > a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
}

.hm-regulation-body .hm-reference-action {
  display: flex;
  align-items: center;
  width: fit-content;
  min-height: 48px;
  margin-block: 4px;
}

.hm-provision-explanation {
  margin-block: 12px;
}

.hm-regulation .hm-explanation-toggle {
  width: auto;
  padding: 8px 14px;
}

.hm-explanation-body {
  margin-top: 12px;
  padding-block: 4px;
  white-space: normal;
}

.hm-explanation-body h3,
.hm-explanation-body h4 {
  margin-block: 12px 6px;
}

.hm-explanation-body p,
.hm-explanation-body ul,
.hm-explanation-terms {
  margin-block: 6px 12px;
}

.hm-explanation-body ul {
  padding-inline-start: 24px;
}

.hm-explanation-body li + li {
  margin-top: 6px;
}

.hm-explanation-terms dt {
  font-weight: 700;
}

.hm-explanation-terms dd {
  margin: 0 0 10px;
}

.hm-page-list,
.hm-findings {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hm-page-list > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.hm-page-choice,
.hm-check {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin: 0;
}

.hm-page-choice input,
.hm-check input {
  width: 22px;
  min-height: 22px;
  margin: 0;
  padding: 0;
  accent-color: var(--green);
}

.hm-page-order,
.hm-paper-state,
.hm-form-status {
  color: #3d5d51;
}

.hm-page-order {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.hm-read-actions {
  margin: 12px 0 2px;
}

#hm-selection {
  min-height: 1.4em;
  margin: 2px 0;
}

#hm-status:not(:empty) {
  padding: 8px 12px;
  background: #e1efe8;
  border-radius: 6px;
}

#hm-status.error {
  color: #802b17;
  background: #fff0e4;
}

.hm-paper {
  border-top: 1px solid var(--border);
  margin-top: 20px;
  padding: 16px 0 3px;
}

.hm-paper-state {
  margin: 0 0 10px;
  font-size: .88rem;
  font-weight: 600;
}

.hm-line-summary-status {
  padding-inline-start: 10px;
  color: #3d5d51;
  font-weight: 600;
}

.hm-review-form details {
  padding: 0;
  margin: 0;
}

.hm-review-form summary {
  align-content: center;
  padding: 10px 4px;
}

.hm-line-body {
  padding: 0 0 14px;
}

.hm-evidence {
  background: #eef5f1;
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 12px;
}

.hm-evidence h4,
.hm-evidence p,
.hm-evidence blockquote {
  margin: 0 0 8px;
}

.hm-evidence .hm-captured-description {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 10px 0;
}
.hm-captured-description > div { min-width: 0; }
.hm-captured-description dt { font-size: .88rem; font-weight: 650; color: #3d5d51; }
.hm-captured-description dd { margin: 4px 0 0; white-space: pre-wrap; }
#hazmat-review button.hm-table-entry-link {
  min-height: 48px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: .18em;
  justify-content: flex-start;
}
.hm-original-scan { margin-top: 10px !important; }
.hm-source-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .85rem; }
.hm-name-pending { color: #802b17; margin: 10px 0; }
.hm-lookup-fact { font-weight: 650; }
.hm-table-rows { display: grid; gap: 18px; }
.hm-table-row { border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.hm-table-row h3 { margin: 0 0 10px; }
.hm-table-row .hm-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hm-table-linked { color: var(--green); font-weight: 700; }
.hm-material-label { overflow-wrap: anywhere; }
.hm-material-difference { color: var(--hm-review-emphasis); font-weight: 800; }
#hazmat-review .hm-task-material > .hm-discrepancies {
  min-height: 48px;
  min-width: 48px;
  padding: 8px 12px;
  margin: 4px 0 4px 12px;
  background: #fff;
  border: 1px solid var(--hm-review-emphasis);
  color: var(--hm-review-emphasis);
  font-weight: 700;
  vertical-align: middle;
}
#hazmat-review .hm-task-material > .hm-discrepancies:hover { background: #fff1f1; }
#hazmat-review .hm-task-material > .hm-discrepancies[hidden] { display: none; }
.hm-saved-discrepancy { border-bottom: 1px solid var(--border); padding: 12px 0; }
.hm-saved-discrepancy h3 { margin-top: 0; }
.hm-paperwork-issues { margin-block: 16px; padding-block: 12px; border-top: 1px solid var(--border); }
.hm-paperwork-issues h3 { margin-block: 0 8px; }
.hm-captured-header { margin-block: 0 18px; }
.hm-captured-header .hm-values { grid-template-columns: minmax(0, 1fr); }
.hm-header-value { white-space: pre-line; overflow-wrap: anywhere; }
.hm-captured-header .hm-values p { margin-block: 4px 8px; }
.hm-header-evidence { margin-block: 12px; }
.hm-missing-description { list-style: none; padding: 0; margin: 0; }
.hm-missing-description li { margin-block: 8px; }
.hm-shipment-date { max-width: 36rem; margin: 10px 0 18px; }
.hm-shipment-date-note { display: block; margin-top: 6px; color: #3d5d51; font-weight: 400; }
.hm-date-candidates { display: flex; flex-wrap: wrap; gap: 8px; }
.hm-date-candidates > p { flex-basis: 100%; margin: 4px 0; }
.hm-expected-communications { margin-block: 16px; }
.hm-expected-vehicle,
.hm-expected-packages { padding-block: 12px; border-block-start: 1px solid var(--border); }
.hm-expected-communications h4 { margin: 0 0 10px; }
.hm-expected-communications h5 { font-size: 1rem; margin: 8px 0; }
.hm-expected-state { font-weight: 650; }
.hm-expected-pending { color: #802b17; }
.hm-expected-symbols { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.hm-expected-symbol { flex: 0 1 160px; min-width: 0; }
.hm-expected-package { padding-block: 8px 14px; border-block-end: 1px solid var(--border); }
.hm-expected-facts { list-style: none; margin: 8px 0; padding: 0; }
.hm-expected-facts li { margin-block: 6px; }
.hm-expected-facts button { text-align: left; white-space: normal; }
.hm-task-section { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-block: 10px; }
#hazmat-review .hm-task-trigger {
  flex: 1 1 220px;
  min-height: 52px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #9bb5a9;
  border-radius: 8px;
  text-align: left;
  white-space: normal;
}
.hm-task-trigger .hm-line-summary-status { display: block; }
.hm-task-dialog { max-width: min(900px, calc(100vw - 24px)); }
.hm-task-dialog > .inspection-window-bar .inspection-window-title { color: #142e2a; }
.hm-task-content > details[data-hm-popup-content] { margin: 0; padding: 0; border: 0; }
.hm-task-content > details[data-hm-popup-content] > summary { display: none; }
.hm-task-content > details[data-hm-popup-content] > .hm-line-body { padding: 0; margin: 0; }
.hm-task-message { overflow-wrap: anywhere; }
.hm-question-host > .hm-task-trigger { display: none; }
.hm-question-host { margin: 0; padding: 0; border: 0; }
.hm-question-note { display: grid; gap: 6px; margin-top: 18px; }
.hm-question-note textarea { width: 100%; min-height: 96px; resize: none; }
.hm-question-actions { flex-wrap: wrap; gap: 8px; }
.hm-question-actions button { white-space: normal; }
.hm-question-message:empty { display: none; }
.hm-question-recorded-note { margin-top: 4px; }.hm-direct-question {  min-width: 0; margin: 10px 0; padding: 12px;  border: 1px solid var(--border); border-radius: 6px;}.hm-direct-question > legend { padding-inline: 4px; font-weight: 600; }.hm-direct-question > p { margin: 8px 0 0; }.hm-boolean-answers { display: flex; flex-wrap: wrap; gap: 8px; }.hm-boolean-choice {  display: flex; align-items: center; gap: 8px; flex: 1 1 84px;  min-height: 48px; padding: 8px 12px; margin: 0;  border: 2px solid var(--border); border-radius: 6px; cursor: pointer;  background: white;}.hm-boolean-choice:last-child { flex-basis: 180px; }.hm-boolean-choice[data-selected="true"] { border-color: currentColor; font-weight: 700; }.hm-boolean-choice:hover { background: #edf4f1; }.hm-boolean-choice:focus-within { outline: 3px solid var(--focus, #2877a8); outline-offset: 2px; }#hazmat-review .hm-boolean-choice > input {  appearance: auto; flex: 0 0 20px; width: 20px; height: 20px;  min-height: 20px; margin: 0; padding: 0; accent-color: currentColor;}.hm-boolean-choice:has(input:disabled) { cursor: default; opacity: .65; }.hm-question-edit-note { margin-top: 8px; }.hm-entered-answers { margin-top: 14px; }
.hm-derived-packaging { margin-bottom: 14px; }
.hm-derived-packaging p { margin: 4px 0; }
.hm-applicable-provisions { margin-block: 16px; }
.hm-applicable-provision { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 4px 12px; }
.hm-applicable-provision p { flex: 1 1 180px; }
.hm-table-names { margin-block: 12px; }
#hazmat-review .hm-review-actions .hm-difference-action { flex-basis: 100%; text-align: left; justify-content: flex-start; }

.hm-evidence blockquote {
  white-space: pre-line;
  font-variant-numeric: tabular-nums;
}

.hm-findings {
  margin: 8px 0;
}

.hm-findings li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.hm-findings li p {
  margin: 2px 0 4px;
}

.hm-findings li[data-state="possible_discrepancy"] strong,
.hm-findings li[data-state="discrepancy"] strong {
  color: #802b17;
}

.hm-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

.hm-fields input,
.hm-fields select {
  min-height: 48px;
}

.hm-fields label {
  margin: 6px 0 10px;
}

.hm-fields small {
  display: block;
  margin-top: 4px;
  color: #3d5d51;
  font-weight: 400;
}

.hm-clarification {
  margin: 8px 0;
  color: #3d5d51;
}

.hm-confirm-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 10px 0;
}

.hm-reference,
.hm-review-form .hm-reference .hm-rule {
  padding-inline-start: 6px;
}

.hm-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 8px 14px;
  margin: 0 0 12px;
}

.hm-values dt {
  font-weight: 600;
}

.hm-values dd {
  margin: 2px 0 0;
}

.hm-form-status:not(:empty) {
  margin: 8px 0;
}

.hm-form-status:empty {
  display: none;
}

.hm-rule-table {
  max-width: 100%;
  overflow: auto;
  margin: 8px 0;
}

.hm-rule-table table {
  width: 100%;
  border-collapse: collapse;
}

.hm-rule-table th,
.hm-rule-table td {
  min-width: 96px;
  padding: 8px;
  border: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
}

.hm-rule-table th {
  background: #eef5f1;
}

.hm-packaging-mark {
  margin: 8px 0 14px;
}

.hm-packaging-result {
  margin: 8px 0;
  padding: 12px;
  background: #eef5f1;
  border-radius: 6px;
}

.hm-packaging-result > h4 {
  margin: 0;
}

.hm-packaging-result > p {
  margin: 5px 0 12px;
}

.hm-packaging-result[data-state="fail"],
.hm-packaging-result .hm-findings li[data-state="fail"] strong {
  color: #802b17;
}

.hm-packaging-status,
.hm-packaging-photo-status {
  color: #3d5d51;
}

.hm-packaging-status:empty,
.hm-packaging-photo-status:empty {
  display: none;
}

.hm-packaging-citations,
.hm-mark-candidates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.hm-mark-candidates .hm-rule {
  flex-basis: 100%;
  min-width: 0;
}

.hm-packaging-photo blockquote {
  margin: 8px 0;
  white-space: pre-wrap;
}

@media (min-width: 700px) {
  .hm-captured-header .hm-values { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hm-captured-header .hm-values > div:nth-child(4) { grid-column: span 2; }
}

@media (max-width: 540px) {
  .hm-evidence .hm-captured-description,
  .hm-table-row .hm-values { grid-template-columns: minmax(0, 1fr); }
  #hm-file-controls { padding: 12px; }
  .hm-paper-actions { width: 100%; }
  .hm-paper-actions button { flex: 1 1 150px; }
  .hm-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .hm-page-list button {
    padding-inline: 10px;
  }
  .hm-page-order {
    margin-left: 0;
  }
}


/* Review attention belongs below the material list, quiet until actionable. */
.hm-review-changes { margin-top: 16px; border-top: 1px solid var(--border); }
.hm-review-changes > summary { min-height: 48px; padding: 12px 0; font-weight: 600; }
.hm-review-notice { display: block; margin: 4px 0 0 18px; font-size: .9rem; font-weight: 400; }
.hm-review-inactive > summary { color: #68747d; cursor: default; user-select: none; }
.hm-review-inactive > summary::marker { color: #68747d; }
.hm-review-changes .hm-review-overview { margin-top: 8px; }
#hazmat-review .hm-segregation-alert { margin: 12px 0 18px; }#hazmat-review .hm-segregation-trigger {  width: 100%; min-height: 64px; padding: 16px; white-space: normal;  font-size: 1.1rem; font-weight: 800;}#hazmat-review .hm-segregation-trigger[data-severity="violation"] {  background: var(--hm-review-emphasis); color: white;  border: 2px solid var(--hm-review-emphasis);}#hazmat-review .hm-segregation-trigger[data-severity="violation"]:hover:not(:disabled) { filter: brightness(.92); }#hazmat-review .hm-segregation-alert p { margin: 6px 0; }.hm-regulation .hm-segregation-pair { margin: 12px 0 20px; }.hm-regulation .hm-segregation-pair > h3 { margin: 12px 0 6px; }.hm-regulation .hm-matrix-focus-row > *,.hm-regulation .hm-rule-table .hm-matrix-focus-axis { background: #fff0e4; font-weight: 700; }.hm-regulation .hm-rule-table .hm-matrix-intersection {  background: var(--hm-review-emphasis); color: white; font-weight: 900;  border: 2px solid var(--hm-review-emphasis); text-align: center;}.hm-regulation .hm-segregation-cell { max-width: 100%; }.hm-regulation .hm-segregation-cell table { table-layout: fixed; }.hm-regulation .hm-segregation-cell th,.hm-regulation .hm-segregation-cell td { min-width: 0; overflow-wrap: anywhere; }