.iw-toast {
  position: fixed;
  z-index: 100001;
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  padding: 11px 18px;
  border-radius: 10px;
  background: #183b72;
  color: #fff;
  box-shadow: 0 12px 32px rgba(18, 42, 78, .24);
  font-size: 13px;
}

/* v36.9: inspection create/edit/view are full pages in the current tab. */
body.inspection-page-mode {
  overflow: hidden !important;
}

.modal-backdrop.inspection-page-surface {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10000 !important;
  display: block !important;
  overflow: auto !important;
  padding: 0 !important;
  background: #f4f7fc !important;
  backdrop-filter: none !important;
}

.modal-backdrop.inspection-page-surface > form.inspection-page-form {
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  min-height: 100vh !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 32px 96px !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #f4f7fc !important;
  box-sizing: border-box !important;
}

.inspection-page-form > .modal-head {
  position: sticky !important;
  top: 0 !important;
  z-index: 30 !important;
  margin: 0 -32px 24px !important;
  padding: 20px 32px !important;
  border-bottom: 1px solid #dbe4f2 !important;
  background: rgba(255, 255, 255, 0.97) !important;
  box-shadow: 0 8px 24px rgba(30, 64, 175, 0.06) !important;
  backdrop-filter: blur(14px) !important;
}

.inspection-page-form > .modal-head h2 {
  font-size: 24px !important;
}

.inspection-page-form .inspection-page-back {
  width: auto !important;
  min-width: 148px !important;
  height: 40px !important;
  padding: 0 16px !important;
  border: 1px solid #c8d6ee !important;
  border-radius: 10px !important;
  color: #174ea6 !important;
  background: #fff !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

.inspection-page-form .inspection-page-back:hover {
  border-color: #2f63d8 !important;
  background: #edf4ff !important;
}

.inspection-page-new > :not(.modal-head),
.inspection-page-edit > :not(.modal-head),
.inspection-page-view > :not(.modal-head) {
  width: min(1380px, 100%) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.inspection-page-form > .modal-actions,
.inspection-page-form > .report-actions {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 25 !important;
  padding: 14px 18px !important;
  border: 1px solid #dbe4f2 !important;
  border-radius: 14px 14px 0 0 !important;
  background: rgba(255, 255, 255, 0.97) !important;
  box-shadow: 0 -10px 30px rgba(15, 42, 90, 0.08) !important;
  backdrop-filter: blur(12px) !important;
}

/* New-task order: contracts, assignment/settings, then product details. */
.new-inspection-modal .iw-new-task-settings,
.new-inspection-modal .iw-new-task-people {
  padding: 18px !important;
  border: 1px solid #d7e3f5 !important;
  background: #fff !important;
}

.new-inspection-modal .iw-new-task-settings {
  margin-top: 16px !important;
  border-radius: 14px 14px 0 0 !important;
  border-bottom: 0 !important;
}

.new-inspection-modal .iw-new-task-people {
  margin-top: 0 !important;
  margin-bottom: 18px !important;
  border-radius: 0 0 14px 14px !important;
}

/* Web video evidence. */
.iw-video-panel {
  margin: 14px 12px 18px !important;
  padding: 16px !important;
  border: 1px solid #cad9f1 !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, #f9fbff 0%, #f2f7ff 100%) !important;
}

.iw-video-panel > header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  margin-bottom: 14px !important;
}

.iw-video-panel > header > div {
  display: grid !important;
  gap: 4px !important;
}

.iw-video-panel > header strong {
  color: #102a56 !important;
  font-size: 15px !important;
}

.iw-video-panel > header span {
  color: #7183a3 !important;
  font-size: 12px !important;
}

.iw-video-upload-button,
.iw-video-replace {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  user-select: none !important;
}

.iw-video-upload-button {
  min-height: 38px !important;
  padding: 0 15px !important;
  border: 1px solid #2f63d8 !important;
  border-radius: 9px !important;
  color: #fff !important;
  background: #2f63d8 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

.iw-video-upload-button.busy,
.iw-video-replace.busy {
  cursor: wait !important;
  opacity: 0.65 !important;
  pointer-events: none !important;
}

.iw-video-empty {
  display: grid !important;
  min-height: 96px !important;
  place-items: center !important;
  margin: 0 !important;
  border: 1px dashed #bdcdea !important;
  border-radius: 10px !important;
  color: #8797b2 !important;
  background: #fff !important;
}

.iw-video-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  gap: 14px !important;
}

.iw-video-grid > article {
  overflow: hidden !important;
  border: 1px solid #d6e1f2 !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 8px 20px rgba(38, 74, 138, 0.06) !important;
}

.iw-video-grid video {
  display: block !important;
  width: 100% !important;
  aspect-ratio: 16 / 9 !important;
  background: #0b1220 !important;
  object-fit: contain !important;
}

.iw-video-grid article > div {
  display: grid !important;
  gap: 4px !important;
  padding: 11px 12px !important;
}

.iw-video-grid article > div strong {
  overflow: hidden !important;
  color: #18365f !important;
  font-size: 13px !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.iw-video-grid article > div span {
  color: #15935f !important;
  font-size: 12px !important;
}

.iw-video-grid article > footer {
  display: flex !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  padding: 0 12px 12px !important;
}

.iw-video-replace,
.iw-video-delete {
  min-height: 34px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.iw-video-replace {
  border: 1px solid #9fb7e4 !important;
  color: #2455b4 !important;
  background: #f5f8ff !important;
}

.iw-video-delete {
  border: 1px solid #f1b7bc !important;
  color: #c73542 !important;
  background: #fff7f7 !important;
}

@media (max-width: 760px) {
  .modal-backdrop.inspection-page-surface > form.inspection-page-form {
    padding: 0 12px 84px !important;
  }

  .inspection-page-form > .modal-head {
    margin: 0 -12px 16px !important;
    padding: 14px 12px !important;
  }

  .inspection-page-form .inspection-page-back {
    min-width: auto !important;
    padding: 0 11px !important;
  }

  .iw-video-panel > header {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  .iw-video-grid {
    grid-template-columns: 1fr !important;
  }
}
.iw-toast.error { background: #c93636; }

.inspection-edit-modal .iw-order-decision-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  align-items: center;
  gap: 20px;
  margin: 0 20px 14px;
  padding: 16px 18px;
  border: 1px solid #bdd0f6;
  border-radius: 12px;
  background: linear-gradient(135deg, #edf3ff 0%, #f7f9ff 100%);
}
.iw-order-decision-panel > div b,
.iw-order-decision-panel > div span { display: block; }
.iw-order-decision-panel > div b { color: #163d78; font-size: 15px; }
.iw-order-decision-panel > div span { margin-top: 4px; color: #71829f; font-size: 12px; }
.iw-order-decision-panel label { margin: 0 !important; }
.iw-order-decision-panel select {
  width: 100%;
  height: 42px;
  border: 1px solid #96b2ec;
  border-radius: 9px;
  background: #fff;
  color: #173f7a;
  font-weight: 700;
}

.inspection-edit-modal .iw-product-editor {
  margin: 16px 20px;
  padding: 0;
  border: 1px solid #d7e2f5;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.iw-product-editor > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #dfe8f7;
  background: #f4f7fd;
}
.iw-product-editor > header b,
.iw-product-editor > header span { display: block; }
.iw-product-editor > header b { color: #173b72; font-size: 14px; }
.iw-product-editor > header span { margin-top: 3px; color: #7586a2; font-size: 12px; }
.iw-product-editor > header strong {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e7efff;
  color: #245be8;
  font-size: 12px;
}
.iw-product-editor-list { display: grid; gap: 10px; padding: 14px 16px; }
.iw-product-editor-list article {
  display: grid;
  grid-template-columns: 92px minmax(180px, .8fr) minmax(260px, 1.4fr);
  align-items: end;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e0e8f5;
  border-radius: 11px;
  background: #fbfcff;
}
.iw-product-editor-list label { min-width: 0; margin: 0 !important; color: #3a5276; font-size: 12px; }
.iw-product-editor-list input,
.iw-product-editor-list textarea {
  box-sizing: border-box;
  width: 100%;
  margin-top: 6px;
}
.iw-product-editor-list textarea {
  min-height: 76px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.55;
}
.iw-product-sequence {
  align-self: center;
  color: #245be8;
  font-size: 13px;
  font-weight: 800;
}
.iw-product-empty { margin: 0; padding: 10px; color: #b14b4b; background: #fff6f6; border-radius: 8px; }
.iw-check-product-banner {
  grid-column: 1 / -1 !important;
  align-self: stretch;
  box-sizing: border-box;
  display: grid !important;
  grid-template-columns: 82px minmax(180px, .7fr) minmax(0, 1.5fr) !important;
  align-items: stretch;
  gap: 10px;
  width: auto !important;
  min-width: 0;
  margin: -1px -1px 14px;
  padding: 12px;
  border: 1px solid #c9d9f7;
  border-radius: 12px;
  background: linear-gradient(135deg, #f5f8ff 0%, #edf3ff 100%);
}
.iw-check-product-banner .iw-product-banner-sequence {
  align-self: center;
  justify-self: start;
  padding: 7px 10px;
  border: 1px solid #bfd2fb;
  border-radius: 999px;
  background: #fff;
  color: #245be8;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.iw-product-banner-field {
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid #d8e3f7;
  border-radius: 9px;
  background: rgba(255, 255, 255, .9);
}
.iw-product-banner-field small {
  display: block;
  margin-bottom: 4px;
  color: #7183a0;
  font-size: 11px;
}
.iw-product-banner-field strong,
.iw-product-banner-field b {
  display: -webkit-box;
  overflow: hidden;
  color: #173e78;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-box-orient: vertical;
}
.iw-product-banner-name strong { -webkit-line-clamp: 2; }
.iw-product-banner-model b { -webkit-line-clamp: 3; }
.inspection-edit-modal .iw-removed-check-field { display: none !important; }

/* Keep destructive actions in the card footer instead of the status field. */
.standard-card {
  position: relative;
  padding-bottom: 62px !important;
}
.standard-card .iw-delete-standard {
  position: absolute !important;
  right: 20px !important;
  bottom: 17px !important;
  width: auto !important;
  min-width: 72px;
  height: 34px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  padding: 0 15px !important;
  border: 1px solid #f0b9bd !important;
  border-radius: 9px !important;
  background: #fff7f7 !important;
  color: #c93636 !important;
  font-size: 12px !important;
  font-weight: 600;
  line-height: 1;
  box-shadow: none !important;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.standard-card .iw-delete-standard::before {
  content: "×";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
}
.standard-card .iw-delete-standard:hover {
  border-color: #dc727a !important;
  background: #ffeded !important;
  transform: translateY(-1px);
}
.standard-card .iw-delete-standard:disabled {
  opacity: .55;
  cursor: wait;
  transform: none;
}
.standard-card .iw-copy-standard {
  position: absolute !important;
  right: 108px !important;
  bottom: 17px !important;
  width: auto !important;
  min-width: 72px;
  height: 34px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 15px !important;
  border: 1px solid #b9cdf8 !important;
  border-radius: 9px !important;
  background: #f4f7ff !important;
  color: #2458cf !important;
  font-size: 12px !important;
  font-weight: 600;
  line-height: 1;
  box-shadow: none !important;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.standard-card .iw-copy-standard::before {
  content: "⧉";
  margin-right: 6px;
  font-size: 15px;
}
.standard-card .iw-copy-standard:hover {
  border-color: #7da3f4 !important;
  background: #eaf0ff !important;
  transform: translateY(-1px);
}
.standard-card .iw-copy-standard:disabled {
  opacity: .55;
  cursor: wait;
  transform: none;
}

/* Give draft, cancel and final-save actions equal breathing room. */
.inspection-edit-modal .modal-actions {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 16px 24px !important;
  border-top: 1px solid #e5ebf5;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -8px 24px rgba(38, 67, 116, .045);
}
.inspection-edit-modal .iw-save-draft {
  min-width: 94px;
  height: 42px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0 !important;
  padding: 0 17px !important;
  border: 1px solid #a8bff3 !important;
  border-radius: 9px !important;
  background: #f4f7ff !important;
  color: #245be8 !important;
  font-size: 14px;
  box-shadow: none !important;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.inspection-edit-modal .iw-save-draft span:not(.iw-button-spinner) {
  font-size: 17px;
  line-height: 1;
}
.inspection-edit-modal .iw-save-draft b { font-weight: 600; }
.inspection-edit-modal .iw-save-draft:hover {
  border-color: #6f96eb !important;
  background: #eaf0ff !important;
  transform: translateY(-1px);
}
.inspection-edit-modal .iw-save-draft:disabled {
  opacity: .7;
  cursor: wait;
  transform: none;
}
.inspection-edit-modal .iw-draft-status {
  min-height: 18px;
  margin-right: auto;
  color: #19845c;
  font-size: 12px;
}
.inspection-edit-modal .modal-actions > button:not(.iw-save-draft) {
  margin: 0 !important;
}

@media (max-width: 760px) {
  .inspection-edit-modal .iw-order-decision-panel { grid-template-columns: 1fr; }
  .iw-product-editor-list article { grid-template-columns: 1fr; }
  .iw-check-product-banner { grid-template-columns: 1fr !important; }
  .iw-product-banner-model b { -webkit-line-clamp: 4; }
}
.iw-button-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #b8c9ef;
  border-top-color: #245be8;
  border-radius: 50%;
  animation: iw-spin .7s linear infinite;
}
@keyframes iw-spin { to { transform: rotate(360deg); } }

.iw-replace-photo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 5px 8px;
  border: 1px solid #9bb7ec;
  border-radius: 7px;
  color: #245be8;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
}
.iw-replace-photo.busy { opacity: .65; pointer-events: none; }
.iw-replace-photo.saved { border-color: #79c7a5; color: #168054; }
.iw-replace-photo.failed { border-color: #df8e8e; color: #c93636; }
.iw-upload-status { font-size: 11px; }
.iw-product-downloads {
  margin: 18px 0 24px;
  padding: 18px;
  border: 1px solid #d8e3f7;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8faff 0%, #f3f7ff 100%);
  box-shadow: 0 8px 24px rgba(30, 66, 124, .06);
}
.iw-product-downloads-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.iw-product-downloads-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #e8f0ff;
  color: #245be8;
  font-size: 22px;
  font-weight: 800;
}
.iw-product-downloads-heading { flex: 1; min-width: 0; }
.iw-product-downloads-heading strong { display: block; color: #183a70; font-size: 15px; line-height: 1.35; }
.iw-product-downloads-heading span { display: block; margin-top: 3px; color: #7b8ba5; font-size: 12px; }
.iw-product-downloads-count { flex: 0 0 auto; padding: 5px 10px; border-radius: 999px; background: #e9f7f0; color: #178158; font-size: 12px; font-weight: 700; }
.iw-product-download-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.iw-product-download-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dce6f7;
  border-radius: 12px;
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.iw-product-download-card:hover { border-color: #a9c0ed; box-shadow: 0 8px 18px rgba(36, 91, 232, .08); transform: translateY(-1px); }
.iw-product-download-number { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: #edf3ff; color: #245be8; font-size: 12px; font-weight: 800; }
.iw-product-download-meta { min-width: 0; }
.iw-product-download-meta strong { display: block; overflow: hidden; color: #223d68; font-size: 13px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.iw-product-download-meta span { display: block; margin-top: 4px; overflow: hidden; color: #71829e; font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.iw-model-download-button {
  min-width: 86px;
  height: 34px;
  padding: 0 13px !important;
  border: 1px solid #9ab5ed !important;
  border-radius: 9px !important;
  background: #fff !important;
  color: #245be8 !important;
  font-size: 12px !important;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.iw-model-download-button:hover { border-color: #245be8 !important; background: #edf3ff !important; }
.iw-model-download-button.busy { opacity: .65; cursor: wait; }
.iw-download-all-photos,
.iw-download-pdf {
  border: 1px solid #8ca9e8 !important;
  background: #fff !important;
  color: #245be8 !important;
}
.iw-download-pdf {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 132px;
}
.iw-pdf-stage {
  position: absolute;
  z-index: -99999;
  top: 0;
  left: 0;
  width: 720px;
  overflow: visible;
  pointer-events: none;
  background: #fff;
}
.iw-pdf-source {
  position: static !important;
  display: block !important;
  width: 720px !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #fff !important;
  color: #102a52 !important;
}
.iw-pdf-source,
.iw-pdf-source * { box-sizing: border-box !important; }
.iw-pdf-source * {
  min-width: 0 !important;
  max-height: none !important;
}
.iw-pdf-source .iw-pdf-cover {
  display: block !important;
  margin: 0 0 16px !important;
  padding: 18px 20px !important;
  border: 1px solid #cbd9ef !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #123b78, #245fd7) !important;
  color: #fff !important;
  break-inside: avoid !important;
  page-break-inside: avoid !important;
}
.iw-pdf-source .iw-pdf-cover span {
  display: block !important;
  font-size: 10px !important;
  letter-spacing: .16em !important;
  opacity: .82 !important;
}
.iw-pdf-source .iw-pdf-cover h1 {
  margin: 5px 0 4px !important;
  color: #fff !important;
  font-size: 24px !important;
  line-height: 1.25 !important;
}
.iw-pdf-source .iw-pdf-cover p {
  margin: 0 !important;
  color: #eaf1ff !important;
  font-size: 12px !important;
  overflow-wrap: anywhere !important;
}
.iw-pdf-source .full-inspection-detail {
  display: block !important;
  margin: 0 !important;
}
.iw-pdf-source .fid-title { margin-bottom: 14px !important; }
.iw-pdf-source .fid-section { margin: 0 0 14px !important; }
.iw-pdf-source .full-inspection-detail,
.iw-pdf-source .fid-section,
.iw-pdf-source .fid-product-content,
.iw-pdf-source .fid-products,
.iw-pdf-source .fid-product,
.iw-pdf-source .fid-check {
  overflow: visible !important;
}
.iw-pdf-source .fid-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.iw-pdf-source .fid-check .fid-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.iw-pdf-source .fid-product,
.iw-pdf-source .fid-check {
  break-inside: auto !important;
  page-break-inside: auto !important;
}
.iw-pdf-source .fid-field,
.iw-pdf-source .fid-section-head,
.iw-pdf-source .fid-product > summary,
.iw-pdf-source .fid-check > header,
.iw-pdf-source .fid-signatures article,
.iw-pdf-source .fid-evidence a,
.iw-pdf-source tr {
  break-inside: avoid !important;
  page-break-inside: avoid !important;
}
.iw-pdf-source .fid-section-head,
.iw-pdf-source .fid-product > summary,
.iw-pdf-source .fid-check > header {
  break-after: avoid !important;
  page-break-after: avoid !important;
}
.iw-pdf-source .fid-timeline li { grid-template-columns: 110px 130px 1fr !important; }
.iw-pdf-source .fid-timeline li small { grid-column: 3 !important; }
.iw-pdf-source .fid-evidence { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.iw-pdf-source .fid-evidence img,
.iw-pdf-source .fid-evidence video { height: 145px !important; object-fit: contain !important; }

@media (max-width: 720px) {
  .standard-card { padding-bottom: 154px !important; }
  .standard-card .iw-copy-standard { left: 20px !important; right: 20px !important; bottom: 58px !important; width: calc(100% - 40px) !important; }
  .standard-card .iw-delete-standard { left: 20px !important; right: 20px !important; bottom: 16px !important; width: calc(100% - 40px) !important; }
  .inspection-edit-modal .modal-actions { gap: 9px !important; padding: 12px 14px !important; }
  .inspection-edit-modal .iw-draft-status { width: 100%; flex-basis: 100%; }
  .inspection-edit-modal .iw-save-draft { flex: 1; }
  .iw-product-downloads { padding: 14px; }
  .iw-product-downloads-count { display: none; }
  .iw-product-download-grid { grid-template-columns: 1fr; }
  .iw-product-download-card { grid-template-columns: 32px minmax(0, 1fr); }
  .iw-model-download-button { grid-column: 1 / -1; width: 100%; }
}

/* v37.0: independent onsite inspector, editable task header, append-only products. */
.new-inspection-modal .iw-onsite-inspector-field small {
  display: block;
  margin-top: 6px;
  color: #7183a0;
  font-size: 11px;
}
.iw-task-header-editor {
  margin: 0 20px 16px;
  overflow: hidden;
  border: 1px solid #c7d8f5;
  border-radius: 14px;
  background: #fff;
}
.iw-task-header-editor > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #dfe8f7;
  background: linear-gradient(135deg, #edf3ff, #f8faff);
}
.iw-task-header-editor > header b,
.iw-task-header-editor > header span { display: block; }
.iw-task-header-editor > header b { color: #173b72; font-size: 15px; }
.iw-task-header-editor > header span { margin-top: 4px; color: #7485a1; font-size: 12px; }
.iw-task-header-editor > header em {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e8f7f0;
  color: #168158;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}
.iw-task-header-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}
.iw-task-header-grid label { min-width: 0; margin: 0 !important; color: #3a5276; font-size: 12px; }
.iw-task-header-grid input,
.iw-task-header-grid select {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  margin-top: 7px;
  border: 1px solid #c5d5ef;
  border-radius: 9px;
  background: #fff;
}
.iw-product-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.iw-product-tools strong { margin-right: 4px; }
.iw-product-tools button,
.iw-import-products {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid #96b2ec;
  border-radius: 8px;
  background: #fff;
  color: #245be8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.iw-import-products.busy { opacity: .65; pointer-events: none; }
.iw-add-product-panel {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 1.5fr) minmax(130px, .55fr) minmax(100px, .4fr) auto;
  align-items: end;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #dfe8f7;
  background: #f9fbff;
}
.iw-add-product-panel[hidden] { display: none !important; }
.iw-add-product-panel label { min-width: 0; margin: 0 !important; color: #3a5276; font-size: 12px; }
.iw-add-product-panel input,
.iw-add-product-panel textarea { box-sizing: border-box; width: 100%; margin-top: 6px; }
.iw-add-product-panel textarea { min-height: 42px; padding: 9px 11px; resize: vertical; }
.iw-add-product-panel > div { display: flex; gap: 7px; }
.iw-add-product-panel button { min-height: 38px; padding: 0 12px; border: 1px solid #b6c9eb; border-radius: 8px; background: #fff; color: #31578f; white-space: nowrap; cursor: pointer; }
.iw-add-product-panel .iw-confirm-add { border-color: #245be8; background: #245be8; color: #fff; }
.iw-created-task-highlight { animation: iw-created-highlight 3.5s ease-out 1; outline: 3px solid rgba(36, 91, 232, .35); outline-offset: 2px; }
@keyframes iw-created-highlight { 0%, 35% { background: #eaf1ff; } 100% { background: transparent; } }

@media (max-width: 900px) {
  .iw-task-header-grid { grid-template-columns: 1fr; }
  .iw-add-product-panel { grid-template-columns: 1fr; }
  .iw-add-product-panel > div { justify-content: flex-end; }
  .iw-product-editor > header { align-items: flex-start; flex-direction: column; }
  .iw-product-tools { justify-content: flex-start; }
}

/* v37.0.1: compact, balanced assignment card on the new-inspection page. */
.new-inspection-modal .inspection-people-row.iw-new-task-people {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-rows: auto !important;
  align-items: stretch !important;
  gap: 14px 16px !important;
  padding: 16px !important;
  border-color: #d8e4f5 !important;
  background: linear-gradient(180deg, #fbfdff 0%, #f7faff 100%) !important;
  box-shadow: 0 10px 28px rgba(27, 67, 130, .06) !important;
}

.new-inspection-modal .inspection-people-row.iw-new-task-people::before {
  content: "人员与审批安排";
  display: block !important;
  grid-column: 1 / -1 !important;
  padding: 0 2px 11px !important;
  border-bottom: 1px solid #e2eaf6 !important;
  color: #173b72 !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  letter-spacing: .01em;
}

.new-inspection-modal .inspection-people-row.iw-new-task-people > label,
.new-inspection-modal .inspection-people-row.iw-new-task-people > label:last-child {
  box-sizing: border-box !important;
  display: flex !important;
  grid-column: auto !important;
  min-width: 0 !important;
  min-height: 92px !important;
  margin: 0 !important;
  padding: 12px 14px !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  border: 1px solid #dce6f4 !important;
  border-radius: 11px !important;
  background: rgba(255, 255, 255, .92) !important;
  color: #3b567c !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.new-inspection-modal .inspection-people-row.iw-new-task-people > label:focus-within {
  border-color: #8ca9e9 !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(47, 99, 216, .09) !important;
}

.new-inspection-modal .inspection-people-row.iw-new-task-people > label select {
  box-sizing: border-box !important;
  width: 100% !important;
  min-height: 42px !important;
  margin-top: 7px !important;
  padding: 0 12px !important;
  border: 1px solid #c4d4ec !important;
  border-radius: 9px !important;
  background-color: #fff !important;
  color: #173968 !important;
  font-size: 13px !important;
  font-weight: 650 !important;
}

.new-inspection-modal .inspection-people-row.iw-new-task-people .iw-onsite-inspector-field small {
  display: block !important;
  margin-top: 7px !important;
  color: #6e82a2 !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  line-height: 1.45 !important;
}

@media (max-width: 760px) {
  .new-inspection-modal .inspection-people-row.iw-new-task-people {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 13px !important;
  }

  .new-inspection-modal .inspection-people-row.iw-new-task-people::before {
    grid-column: 1 !important;
  }

  .new-inspection-modal .inspection-people-row.iw-new-task-people > label,
  .new-inspection-modal .inspection-people-row.iw-new-task-people > label:last-child {
    grid-column: 1 !important;
    min-height: 0 !important;
  }
}
