/* ============================================================================
   GSB — INSPECTION CHECKLIST TAB
   Mobile-first survey UI on the GSB design system (gsb-tokens.css).
   All selectors are namespaced .insp-* to avoid the global style.css leaks
   (bare table/td rules) — injected tables set min-width:0 below.
   ============================================================================ */

/* gsb-clean.css flattens any [class*="-card"] inside [id$="-screen"] with
   !important (radius 4px, no shadow); re-assert the inspection card look. */
#insp-list-screen .insp-proj-card,
#insp-list-screen .insp-group-card,
#insp-list-screen .insp-health-card {
  border-radius: 12px !important;
  box-shadow: var(--shadow-sm) !important;
}

/* ---- Toolbar / breadcrumb ------------------------------------------------ */
.insp-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.insp-toolbar .insp-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.insp-crumb-back {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  font-size: 18px;
  color: var(--gsb-soil-ink);
  cursor: pointer;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.insp-crumb-title {
  font-family: var(--font-display, Georgia, serif);
  font-weight: 500;
  font-size: 22px;
  color: var(--gsb-soil-ink);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.insp-crumb-sub {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gsb-stone);
  margin-top: 2px;
}

.insp-spacer { flex: 1 1 auto; }

/* ---- Chip buttons (secondary actions row) -------------------------------- */
.insp-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

.insp-chip {
  border: 1px solid var(--color-border);
  background: var(--color-surface, #fff);
  color: var(--gsb-soil-ink);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.insp-chip:active { transform: scale(0.98); }
.insp-chip.primary {
  background: var(--gsb-shoot-green);
  border-color: var(--gsb-shoot-green);
  color: #fff;
}
.insp-chip.danger { color: var(--gsb-clay); border-color: rgba(181, 83, 46, 0.4); }
.insp-chip.warn { color: var(--gsb-ochre); border-color: rgba(185, 139, 50, 0.45); }
.insp-chip:disabled { opacity: 0.45; cursor: default; }

/* ---- Segmented control ---------------------------------------------------- */
.insp-seg {
  display: inline-flex;
  background: var(--gsb-oat);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.insp-seg button {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gsb-stone);
  cursor: pointer;
  min-height: 40px;
}

.insp-seg button.active {
  background: var(--gsb-soil-ink);
  color: var(--gsb-paper);
}

/* ---- Project cards --------------------------------------------------------- */
.insp-proj-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--motion-fast, 120ms) ease;
}

.insp-proj-card:hover { border-color: var(--gsb-shoot-green); }

.insp-proj-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--gsb-soil-ink);
}

.insp-proj-meta {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--gsb-stone);
  margin-top: 3px;
}

.insp-icon-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  padding: 8px;
  cursor: pointer;
  opacity: 0.55;
  border-radius: 8px;
  min-width: 40px;
  min-height: 40px;
}
.insp-icon-btn:hover { opacity: 1; background: var(--gsb-paper); }

/* ---- Store group cards (inside a project) ---------------------------------- */
.insp-group-card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.insp-group-head {
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(0deg, rgba(232, 224, 209, 0.35), rgba(232, 224, 209, 0.35));
}

.insp-group-name { font-size: 15px; font-weight: 700; color: var(--gsb-soil-ink); }
.insp-group-meta {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--gsb-stone);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.insp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-top: 1px solid var(--color-border);
  cursor: pointer;
  min-height: 56px;
}
.insp-row:first-of-type { border-top: none; }
.insp-row:active { background: var(--gsb-paper); }

.insp-row-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.insp-type-pill {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.insp-type-pill.pre { color: var(--gsb-ochre); background: rgba(185, 139, 50, 0.12); border-color: rgba(185, 139, 50, 0.35); }
.insp-type-pill.post { color: var(--gsb-shoot-green); background: rgba(47, 107, 69, 0.10); border-color: rgba(47, 107, 69, 0.30); }
.insp-type-pill.plain { color: var(--gsb-stone); background: var(--gsb-oat); }

.insp-row-date {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  color: var(--gsb-soil-ink);
}

.insp-row-pct {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--gsb-stone);
}
.insp-row-pct.done { color: var(--gsb-shoot-green); font-weight: 600; }

.insp-group-foot {
  display: flex;
  gap: 8px;
  padding: 10px 16px 12px;
  border-top: 1px dashed var(--color-border);
  flex-wrap: wrap;
}

.insp-chevron { font-size: 20px; color: var(--gsb-stone); font-weight: 300; flex: 0 0 auto; }

/* select-mode checkbox */
.insp-check {
  width: 22px; height: 22px;
  border: 2px solid var(--gsb-stone);
  border-radius: 6px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  background: transparent;
}
.insp-check.on { background: var(--gsb-shoot-green); border-color: var(--gsb-shoot-green); }

/* ============================================================================
   SURVEY (detail screen)
   ============================================================================ */

.insp-detail-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.insp-detail-names { flex: 1 1 auto; min-width: 0; }

.insp-detail-name {
  font-family: var(--font-display, Georgia, serif);
  font-size: 22px;
  font-weight: 500;
  margin: 0;
  color: var(--gsb-soil-ink);
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insp-detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--gsb-stone);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.insp-health-chip {
  flex: 0 0 auto;
  text-align: center;
  border-radius: 10px;
  padding: 6px 12px;
  background: var(--gsb-paper);
  border: 1px solid var(--color-border);
}
.insp-health-chip .num {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  font-weight: 700;
  display: block;
  line-height: 1.1;
}
.insp-health-chip .lbl {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--gsb-stone);
  text-transform: uppercase;
}

/* ---- Category accordion ----------------------------------------------------- */
.insp-cat { margin-bottom: 14px; }

.insp-cat-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--gsb-soil-ink);
  padding: 10px 2px 8px;
  cursor: pointer;
  text-align: left;
}

.insp-cat-title {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gsb-soil-ink);
  flex: 1 1 auto;
}

.insp-cat-count {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--gsb-stone);
}
.insp-cat-count.done { color: var(--gsb-shoot-green); font-weight: 600; }

.insp-cat-chev { color: var(--gsb-stone); font-size: 14px; transition: transform var(--motion-fast, 120ms) ease; }
.insp-cat.collapsed .insp-cat-chev { transform: rotate(-90deg); }
.insp-cat.collapsed .insp-cat-body { display: none; }

/* ---- Item rows ---------------------------------------------------------------- */
.insp-item {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  margin-top: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.insp-item.flash { animation: inspFlash 1.2s ease; }
@keyframes inspFlash {
  0% { box-shadow: 0 0 0 3px rgba(47, 107, 69, 0.45); }
  100% { box-shadow: var(--shadow-sm); }
}

.insp-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  cursor: pointer;
  min-height: 56px;
}
.insp-item-head:active { background: var(--gsb-paper); }

.insp-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--gsb-oat-dk, #D8CFBA);
  border: 1px solid rgba(34, 30, 24, 0.15);
}
.insp-dot.working { background: var(--gsb-shoot-green); border-color: var(--gsb-shoot-green); }
.insp-dot.bad { background: var(--gsb-clay); border-color: var(--gsb-clay); }
.insp-dot.na { background: var(--gsb-stone); border-color: var(--gsb-stone); }

.insp-item-label { flex: 1 1 auto; min-width: 0; }
.insp-item-title { font-size: 14px; font-weight: 600; color: var(--gsb-soil-ink); line-height: 1.25; }
.insp-item-std {
  font-size: 11.5px;
  color: var(--gsb-stone);
  margin-top: 2px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.insp-item.open .insp-item-std { -webkit-line-clamp: unset; }

.insp-item-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }

.insp-mini-chip {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gsb-oat);
  color: var(--gsb-soil-ink);
}
.insp-mini-chip.working { background: rgba(47, 107, 69, 0.12); color: var(--gsb-shoot-green); }
.insp-mini-chip.bad { background: rgba(181, 83, 46, 0.12); color: var(--gsb-clay); }
.insp-mini-chip.q-good { background: rgba(47, 107, 69, 0.10); color: var(--gsb-shoot-green); }
.insp-mini-chip.q-avg { background: rgba(185, 139, 50, 0.14); color: var(--gsb-ochre); }
.insp-mini-chip.q-poor { background: rgba(181, 83, 46, 0.12); color: var(--gsb-clay); }
.insp-mini-chip.na { background: var(--gsb-oat); color: var(--gsb-stone); }

.insp-item-side { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

.insp-photo-count {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--gsb-stone);
}

.insp-allgood {
  border: 1px solid rgba(47, 107, 69, 0.4);
  background: rgba(47, 107, 69, 0.06);
  color: var(--gsb-shoot-green);
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  min-height: 40px;
  white-space: nowrap;
}
.insp-allgood:active { background: rgba(47, 107, 69, 0.16); }

.insp-item-chev { color: var(--gsb-stone); font-size: 13px; transition: transform var(--motion-fast, 120ms) ease; }
.insp-item.open .insp-item-chev { transform: rotate(90deg); }

/* ---- Item editor ----------------------------------------------------------------- */
.insp-editor {
  border-top: 1px solid var(--color-border);
  padding: 12px 14px 14px;
  background: linear-gradient(0deg, rgba(243, 238, 227, 0.35), rgba(243, 238, 227, 0.35));
  display: grid;
  gap: 12px;
}

.insp-flabel {
  display: block;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gsb-stone);
  margin-bottom: 6px;
}

.insp-pills { display: flex; gap: 8px; }

.insp-pill {
  flex: 1 1 0;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface, #fff);
  color: var(--gsb-soil-ink);
  border-radius: 10px;
  padding: 11px 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  transition: all var(--motion-fast, 120ms) ease;
}
.insp-pill:active { transform: scale(0.98); }

.insp-pill.sel-good { background: var(--gsb-shoot-green); border-color: var(--gsb-shoot-green); color: #fff; }
.insp-pill.sel-bad { background: var(--gsb-clay); border-color: var(--gsb-clay); color: #fff; }
.insp-pill.sel-warn { background: var(--gsb-ochre); border-color: var(--gsb-ochre); color: #fff; }
.insp-pill.sel-muted { background: var(--gsb-stone); border-color: var(--gsb-stone); color: #fff; }

/* three status pills (Working / Not working / N/A) — keep them on one line */
.insp-pills .insp-pill { padding-left: 4px; padding-right: 4px; font-size: 13px; }

.insp-two { display: grid; grid-template-columns: 110px 1fr; gap: 12px; }

.insp-qty, .insp-notes {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface, #fff);
  color: var(--gsb-soil-ink);
  padding: 11px 12px;
  font-size: 16px; /* prevents iOS focus zoom */
  font-family: inherit;
  outline: none;
  min-height: 48px;
}
.insp-qty:focus, .insp-notes:focus { border-color: var(--gsb-shoot-green); box-shadow: 0 0 0 2px rgba(47, 107, 69, 0.12); }
.insp-notes { resize: vertical; line-height: 1.4; }

.insp-notes-wrap { position: relative; }
.insp-saved {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  color: var(--gsb-shoot-green);
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 7px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}
.insp-saved.show { opacity: 1; }

/* ---- Photos ------------------------------------------------------------------------ */
.insp-photo-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.insp-photo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
}

.insp-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--gsb-oat);
  cursor: pointer;
  padding: 0;
}
.insp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.insp-thumb .sel-overlay {
  position: absolute; inset: 0;
  background: rgba(47, 107, 69, 0.45);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}
.insp-thumb.selected .sel-overlay { display: flex; }
.insp-thumb.selectable { outline: 2px dashed rgba(47, 107, 69, 0.5); outline-offset: -2px; }

.insp-thumb.pending .pct {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  font-weight: 700;
  color: var(--gsb-soil-ink);
  background: rgba(243, 238, 227, 0.85);
}
.insp-thumb.pending .bar { width: 70%; height: 4px; border-radius: 2px; background: rgba(34, 30, 24, 0.15); overflow: hidden; }
.insp-thumb.pending .bar i { display: block; height: 100%; background: var(--gsb-shoot-green); width: 0%; }
.insp-thumb.failed .pct { color: var(--gsb-clay); }

/* ---- Sticky progress footer --------------------------------------------------------- */
.insp-sticky {
  position: sticky;
  bottom: 10px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--gsb-soil-ink);
  color: var(--gsb-paper);
  border-radius: 14px;
  padding: 10px 14px;
  margin-top: 16px;
  box-shadow: 0 6px 20px rgba(34, 30, 24, 0.35);
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px) * 0.4);
}

.insp-sticky .track { flex: 1 1 auto; height: 6px; background: rgba(243, 238, 227, 0.22); border-radius: 3px; overflow: hidden; }
.insp-sticky .fill { height: 100%; background: var(--gsb-leaf); border-radius: 3px; width: 0%; transition: width 220ms ease; }
.insp-sticky .count {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  white-space: nowrap;
}
.insp-sticky .next-btn {
  border: 1px solid rgba(243, 238, 227, 0.4);
  background: transparent;
  color: var(--gsb-paper);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;
}
.insp-sticky .next-btn:disabled { opacity: 0.45; }

/* ============================================================================
   MODALS / SHEETS
   ============================================================================ */
.insp-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(34, 30, 24, 0.5);
  /* below .toast (1000) so validation toasts stay visible over the sheet,
     above nav/cards/sticky */
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.insp-modal {
  background: #fff;
  border-radius: 14px;
  width: min(440px, 92vw);
  max-height: 86vh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(34, 30, 24, 0.3);
}

.insp-modal h3 {
  margin: 0 0 12px;
  font-family: var(--font-display, Georgia, serif);
  font-weight: 500;
  font-size: 20px;
  color: var(--gsb-soil-ink);
}

.insp-modal .insp-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.insp-brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.insp-brand-chip {
  border: 1.5px solid var(--color-border);
  background: #fff;
  border-radius: 10px;
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gsb-soil-ink);
  cursor: pointer;
  min-height: 44px;
}
.insp-brand-chip.sel { background: var(--gsb-shoot-green); border-color: var(--gsb-shoot-green); color: #fff; }

.insp-input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 12px;
  font-size: 16px;
  background: #fff;
  color: var(--gsb-soil-ink);
  outline: none;
  min-height: 48px;
}
.insp-input:focus { border-color: var(--gsb-shoot-green); box-shadow: 0 0 0 2px rgba(47, 107, 69, 0.12); }

/* out-specify the legacy global input[type="date"] rule inside our modals */
.insp-modal input.insp-input {
  padding: 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--color-border);
  min-height: 48px;
}

@media (max-width: 640px) {
  .insp-modal-backdrop { align-items: flex-end; }
  .insp-modal {
    width: 100vw;
    max-height: 88vh;
    border-radius: 18px 18px 0 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    animation: inspSheetUp 220ms var(--ease-out, ease-out);
  }
  @keyframes inspSheetUp { from { transform: translateY(30%); opacity: 0.6; } to { transform: translateY(0); opacity: 1; } }
}

/* ============================================================================
   PORTFOLIO VIEW + COMPARISON
   ============================================================================ */
.insp-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.insp-tile {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.insp-tile .num {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 700;
  color: var(--gsb-soil-ink);
  line-height: 1.15;
}
.insp-tile .lbl {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gsb-stone);
  margin-top: 3px;
}
.insp-tile .num.pos { color: var(--gsb-shoot-green); }
.insp-tile .num.neg { color: var(--gsb-clay); }
.insp-tile .num.warn { color: var(--gsb-ochre); }

.insp-dist { display: flex; height: 22px; border-radius: 8px; overflow: hidden; background: var(--gsb-oat); margin-bottom: 6px; }
.insp-dist > div {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-mono, ui-monospace, monospace); font-size: 11px; font-weight: 700;
}
.insp-dist .d-ex { background: var(--gsb-shoot-green); }
.insp-dist .d-gd { background: var(--gsb-ochre); }
.insp-dist .d-na { background: var(--gsb-clay); }

.insp-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--gsb-stone);
  font-family: var(--font-mono, ui-monospace, monospace);
  margin-bottom: 14px;
}

.insp-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.insp-health-card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  position: relative;
  width: 100%;
}
.insp-health-card:hover { border-color: var(--gsb-shoot-green); }

.insp-health-bar { height: 6px; border-radius: 3px; background: var(--gsb-oat); overflow: hidden; margin: 8px 0; }
.insp-health-bar i { display: block; height: 100%; border-radius: 3px; }

.insp-issue-pill {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(181, 83, 46, 0.1);
  color: var(--gsb-clay);
  font-weight: 600;
}

/* Data tables injected by JS: neutralize the global style.css table leak */
.insp-table-wrap { overflow-x: auto; }
.insp-table-wrap table { min-width: 0; width: 100%; border-collapse: collapse; background: #fff; }
.insp-table-wrap th {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gsb-stone);
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1.5px solid var(--gsb-soil-ink);
  background: transparent;
}
.insp-table-wrap td {
  font-size: 13px;
  padding: 10px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  color: var(--gsb-soil-ink);
}

/* ---- Comparison ------------------------------------------------------------- */
.insp-cmp-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.insp-cmp-item {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.insp-cmp-item.changed { border-left: 3px solid var(--gsb-ochre); }

.insp-cmp-cell { min-width: 0; }
.insp-cmp-cell .who {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gsb-stone);
  margin-bottom: 4px;
}
.insp-cmp-cell.hl { background: rgba(185, 139, 50, 0.08); border-radius: 8px; padding: 6px 8px; margin: -6px -8px; }

.insp-cmp-note { font-size: 12px; font-style: italic; color: var(--gsb-stone); margin-top: 4px; overflow-wrap: anywhere; }

.insp-status-txt { font-size: 13px; font-weight: 700; }
.insp-status-txt.working { color: var(--gsb-shoot-green); }
.insp-status-txt.bad { color: var(--gsb-clay); }
.insp-status-txt.none { color: var(--gsb-stone); font-weight: 400; }

/* ---- Small-screen density tweaks ------------------------------------------------- */
@media (max-width: 640px) {
  .insp-two { grid-template-columns: 90px 1fr; }
  .insp-crumb-title { font-size: 19px; }
  .insp-health-grid { grid-template-columns: 1fr 1fr; }
  .insp-chip { padding: 9px 12px; }

  /* survey header: pin the back arrow to the title line and let the name wrap */
  .insp-detail-bar { align-items: flex-start; }
  .insp-crumb-back { width: 40px; height: 40px; }
  .insp-detail-bar .insp-crumb-back { margin-top: 2px; }
  .insp-detail-name {
    white-space: normal;
    font-size: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .insp-health-chip { padding: 5px 10px; }
  .insp-health-chip .num { font-size: 16px; }
}
