/* GH #115 Loggers tab (manufacturing.html). Theme-aware via the page's CSS vars. */
.lg-wrap {
  max-width: 1400px;
  margin: 0 auto;
}
.lg-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.lg-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.lg-stat {
  color: var(--muted, #64748b);
  font-size: 14px;
}
.lg-stat b {
  color: var(--text, #0f172a);
  font-size: 18px;
}
.lg-stat-warn b {
  color: #b45309;
}
.lg-hint {
  color: var(--muted, #64748b);
  font-size: 13px;
  line-height: 1.5;
  margin: 4px 0 16px;
}
.lg-empty {
  color: var(--muted, #64748b);
  font-size: 13px;
  padding: 6px 0 2px;
}

.lg-section {
  margin-bottom: 22px;
}
.lg-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.lg-h3 {
  font-size: 15px;
  margin: 0 0 8px;
  color: var(--text, #0f172a);
}
.lg-count {
  display: inline-block;
  background: var(--border, #e2e8f0);
  color: var(--text, #0f172a);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 12px;
  margin-left: 4px;
}
.lg-count-warn {
  background: #fef3c7;
  color: #b45309;
}

.lg-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  font-size: 13px;
}
.lg-table th {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 2px solid var(--border, #e2e8f0);
  color: var(--muted, #64748b);
  font-weight: 600;
  white-space: nowrap;
}
.lg-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  vertical-align: middle;
}
.lg-table code {
  font-size: 12px;
  background: var(--border, #e2e8f0);
  padding: 1px 4px;
  border-radius: 3px;
}
.lg-detail {
  color: var(--muted, #64748b);
  max-width: 320px;
  /* bad-signature rows carry a ~2KB forensic blob (unbroken base64) — contain
     it instead of letting one row wrap into a page-tall cell (2026-08-06). */
  max-height: 96px;
  overflow-y: auto;
  word-break: break-all;
  display: block;
}
.lg-short {
  color: #b45309;
  font-weight: 600;
}

.lg-badge {
  display: inline-block;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.lg-prog {
  display: inline-block;
  width: 60px;
  height: 8px;
  background: var(--border, #e2e8f0);
  border-radius: 4px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 6px;
}
.lg-prog-fill {
  height: 100%;
  background: #22c55e;
}
.lg-prog-txt {
  font-size: 12px;
  color: var(--muted, #64748b);
}

.lg-btn {
  border: 1px solid var(--border, #cbd5e1);
  background: var(--panel, #fff);
  color: var(--text, #0f172a);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.lg-btn:hover {
  background: var(--bg, #f6f7fb);
}
.lg-btn-primary {
  background: var(--accent, #2563eb);
  color: #fff;
  border-color: var(--accent, #2563eb);
}
.lg-btn-primary:hover {
  filter: brightness(1.06);
  background: var(--accent, #2563eb);
}
.lg-btn-warn {
  background: #b45309;
  color: #fff;
  border-color: #b45309;
}
.lg-btn-warn:hover {
  filter: brightness(1.06);
  background: #b45309;
}
/* A door that cannot open says so (Shipped section: Place for a lapsed customer). */
.lg-btn:disabled,
.lg-btn:disabled:hover {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
}

.lg-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.lg-modal-card {
  background: var(--panel, #fff);
  color: var(--text, #0f172a);
  border-radius: 10px;
  padding: 22px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  /* The overlay is inset:0 + centred, so a card taller than the viewport
     overflows BOTH edges and neither it nor the page can scroll to the buttons.
     The manual-enrol form is the tallest one here (4 fields + error banner). */
  max-height: calc(100vh - 32px);
  /* biome-ignore lint/suspicious/noDuplicateProperties: dvh with a vh fallback for browsers without dvh */
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}
.lg-modal-card h3 {
  margin: 0 0 12px;
}
.lg-modal-card label {
  display: block;
  font-size: 13px;
  color: var(--muted, #64748b);
  margin-bottom: 10px;
}
.lg-modal-card input,
.lg-modal-card select {
  display: block;
  width: 100%;
  margin-top: 3px;
  padding: 8px 10px;
  font-size: 16px;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 6px;
  background: var(--panel, #fff);
  color: var(--text, #0f172a);
  box-sizing: border-box;
}
.lg-row {
  display: flex;
  gap: 10px;
}
.lg-row label {
  flex: 1;
}
.lg-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.lg-modal-err {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  margin-bottom: 10px;
}
.lg-opt {
  color: var(--muted, #64748b);
  font-size: 11px;
  font-style: italic;
  margin-left: 4px;
}

/* Input with an in-field status affordance (the mote-number → SIM lookup). */
.lg-field {
  position: relative;
  display: block;
}
.lg-field input {
  padding-right: 32px;
}
.lg-spinner {
  position: absolute;
  right: 10px;
  top: 50%;
  margin-top: -6px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--border, #cbd5e1);
  border-top-color: var(--accent, #2563eb);
  animation: lg-spin 0.7s linear infinite;
}
.lg-spinner[hidden] {
  display: none;
}
@keyframes lg-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .lg-spinner {
    animation: none;
  }
}
.lg-field-hint {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-style: italic;
  color: var(--muted, #64748b);
}
.lg-field-hint[hidden] {
  display: none;
}
/* Replace modal (autodev #203): the probes going in, and where the old logger goes. */
.lg-probes,
.lg-outgoing {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 8px 12px 10px;
  margin: 10px 0;
  min-width: 0;
}
.lg-probes legend,
.lg-outgoing legend {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #64748b);
  padding: 0 4px;
}
.lg-probes label {
  margin-top: 6px;
}
.lg-probes input[type="text"] {
  font-family: ui-monospace, Menlo, monospace;
}
.lg-radio {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
  cursor: pointer;
}
.lg-radio input {
  margin-top: 3px;
  flex: none;
}
/* The probes the block will end with differ from the pairing: the question and its confirmation. */
.lg-pair-flag {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  background: #fffbeb;
  color: #78350f;
  font-size: 13px;
  line-height: 1.45;
}
.lg-pair-flag[hidden] {
  display: none;
}
/* The pairings the logger's own readings fit (409 PROBE_FIT), one button each. */
.lg-fit-use {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.lg-fit-use:empty {
  display: none;
}
.lg-toolbar-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── SIM state on a unit row (GH #377) ─────────────────────────────────── */
.lg-sim-cell {
  white-space: nowrap;
}
.lg-sim-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--text, #0f172a);
}
.lg-sim-none {
  color: var(--muted, #64748b);
}
.lg-sim-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}
a.lg-sim-badge:hover {
  text-decoration: underline;
}
.lg-sim-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.lg-sim-ok {
  background: #dcfce7;
  color: #166534;
}
.lg-sim-ok .lg-sim-dot {
  background: #16a34a;
}
.lg-sim-amber {
  background: #fef3c7;
  color: #92400e;
}
.lg-sim-amber .lg-sim-dot {
  background: #d97706;
}
.lg-sim-red {
  background: #fee2e2;
  color: #b91c1c;
}
.lg-sim-red .lg-sim-dot {
  background: #dc2626;
}

@media (pointer: coarse) {
  a.lg-sim-badge {
    min-height: 40px;
  }
}

@media (max-width: 820px) {
  .lg-toolbar {
    align-items: flex-start;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIMs TAB (GH #377 SIM registry) — js/sims/index.js
   Sits with the loggers styles because the two tabs are the same board seen
   from opposite ends (a logger's SIM, a SIM's logger) and share .lg-btn.
   Light-only, like the rest of manufacturing.html.
   ═══════════════════════════════════════════════════════════════════════════ */
.sims-wrap {
  max-width: 1400px;
  margin: 0 auto;
}
.sims-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted, #64748b);
}
.sims-state-err {
  color: var(--c-strong, #d33);
}
.sims-state-actions {
  margin-top: 14px;
}
.sims-muted {
  color: var(--muted, #64748b);
}
.sims-fixture {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* ── Summary strip ─────────────────────────────────────────────────────── */
.sims-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.sims-card {
  flex: 1 1 150px;
  max-width: 280px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--panel, #fff);
  padding: 9px 12px;
}
.sims-card-total {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.sims-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.sims-card-main {
  font-size: 13px;
  color: var(--muted, #64748b);
  margin-top: 2px;
}
.sims-card-main b {
  font-size: 19px;
  color: var(--text, #0f172a);
}
.sims-card-of {
  color: var(--muted, #64748b);
}
.sims-card-sub {
  font-size: 13px;
  color: var(--text, #0f172a);
}
.sims-card-pills {
  margin-top: 4px;
  min-height: 18px;
  font-size: 11px;
}
.sims-pill {
  display: inline-block;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 4px;
}
.sims-pill-red {
  background: #fee2e2;
  color: #b91c1c;
}
.sims-pill-amber {
  background: #fef3c7;
  color: #92400e;
}
/* A registry-vs-statement delta a person has explained: state, not a finding. */
.sims-pill-muted {
  background: #f1f5f9;
  color: #475569;
}

.sims-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.sims-synced {
  font-size: 13px;
  color: var(--muted, #64748b);
}
.sims-toolbar-btns {
  display: flex;
  gap: 8px;
}

/* ── Filter chips ──────────────────────────────────────────────────────── */
.sims-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.sims-chip {
  border: 1px solid var(--border, #cbd5e1);
  background: var(--panel, #fff);
  color: var(--text, #0f172a);
  border-radius: 14px;
  padding: 4px 11px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  min-height: 28px;
}
.sims-chip:hover {
  background: var(--bg, #f6f7fb);
}
.sims-chip-n {
  display: inline-block;
  margin-left: 5px;
  color: var(--muted, #64748b);
  font-variant-numeric: tabular-nums;
}
.sims-chip-on {
  border-color: var(--accent, #2563eb);
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}
.sims-chip-on .sims-chip-n {
  color: #1d4ed8;
}
.sims-chip-red.sims-chip-on {
  border-color: #dc2626;
  background: #fee2e2;
  color: #b91c1c;
}
.sims-chip-red.sims-chip-on .sims-chip-n {
  color: #b91c1c;
}
.sims-chip-amber.sims-chip-on {
  border-color: #d97706;
  background: #fef3c7;
  color: #92400e;
}
.sims-chip-amber.sims-chip-on .sims-chip-n {
  color: #92400e;
}
.sims-chip-sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: var(--border, #e2e8f0);
  margin: 0 2px;
}

/* ── Search row ────────────────────────────────────────────────────────── */
.sims-searchrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.sims-search {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 380px;
  padding: 7px 10px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 6px;
  background: var(--panel, #fff);
  color: var(--text, #0f172a);
  box-sizing: border-box;
}
.sims-count {
  font-size: 13px;
  color: var(--muted, #64748b);
  font-variant-numeric: tabular-nums;
}

/* ── Table ─────────────────────────────────────────────────────────────── */
.sims-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1080px;
  font-size: 13px;
}
.sims-table th {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 2px solid var(--border, #e2e8f0);
  color: var(--muted, #64748b);
  font-weight: 600;
  white-space: nowrap;
}
/* The sort control is a real <button> inside the <th> so it takes focus and
   fires on Enter/Space; the th keeps its table semantics + aria-sort. */
.sims-th-btn {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.sims-th-btn:hover {
  color: var(--text, #0f172a);
}
.sims-th-on .sims-th-btn {
  color: var(--accent, #2563eb);
}
/* EVERY body cell is one line. This is not only density: js/sims/index.js
   windows the table and sizes its two spacer rows from ONE measured row height,
   so a cell that wraps makes the scrollbar lie. Long values truncate with an
   ellipsis and carry the full text in title=. */
.sims-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Spacer rows stand in for the un-rendered remainder above and below the
   window. No borders, no padding — they must contribute height and nothing
   else. */
.sims-spacer td {
  padding: 0;
  border: none;
}
.sims-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sims-td-cust {
  max-width: 220px;
}
/* "Company · 2025-04-18" from the order ledger (GH #377) — same ellipsis rule as
   every other cell; the order id rides in title=. */
.sims-td-paid {
  max-width: 200px;
}
.sims-td-flags {
  max-width: 300px;
}
/* Level tint + a left rail, so the severity reads without relying on colour
   alone (and survives a greyscale print). */
.sims-row-red {
  background: #fef2f2;
}
.sims-row-red td:first-child {
  border-left: 3px solid #dc2626;
}
.sims-row-amber {
  background: #fffbeb;
}
.sims-row-amber td:first-child {
  border-left: 3px solid #d97706;
}
.sims-row:not(.sims-row-red):not(.sims-row-amber) td:first-child {
  border-left: 3px solid transparent;
}

.sims-iccid {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  border: none;
  background: none;
  color: var(--text, #0f172a);
  padding: 4px 2px;
  cursor: pointer;
  white-space: nowrap;
}
.sims-iccid b {
  font-weight: 700;
  color: var(--accent, #2563eb);
}
.sims-iccid:hover {
  text-decoration: underline;
}
.sims-link {
  color: var(--accent, #2563eb);
  text-decoration: none;
  font-weight: 600;
}
.sims-link:hover {
  text-decoration: underline;
}
/* First-reg cell: the provider's history was read and holds NO registration —
   never in a powered device (osc-michael, multi-year history). */
.sims-td-never {
  color: #991b1b;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.02em;
}
.sims-stale {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #92400e;
  background: #fef3c7;
  border-radius: 3px;
  padding: 0 4px;
  margin-left: 2px;
}

.sims-flag {
  display: inline-block;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  margin: 1px 2px 1px 0;
  white-space: nowrap;
}
.sims-flag-red {
  background: #fee2e2;
  color: #b91c1c;
}
.sims-flag-amber {
  background: #fef3c7;
  color: #92400e;
}
.sims-flag-plain {
  background: var(--border, #e2e8f0);
  color: #334155;
}

.sims-note {
  min-width: 150px;
  max-width: 260px;
}
/* Button, not a click-handled <td> — keyboard-reachable, but styled to read as
   the cell's text so the table doesn't sprout a column of buttons. */
.sims-note-open {
  display: block;
  width: 100%;
  border: none;
  background: none;
  padding: 2px 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: text;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sims-note-open:hover .sims-note-add,
.sims-note-open:focus-visible .sims-note-add {
  color: var(--accent, #2563eb);
}
.sims-note-add {
  color: var(--muted, #64748b);
  font-size: 12px;
}
.sims-note-edit {
  display: flex;
  gap: 5px;
  align-items: center;
}
.sims-note-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 5px 7px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--accent, #2563eb);
  border-radius: 5px;
  background: var(--panel, #fff);
  color: var(--text, #0f172a);
}
.sims-note-btn {
  padding: 4px 9px;
  font-size: 12px;
}
.sims-offscreen {
  position: fixed;
  top: -1000px;
  left: -1000px;
  opacity: 0;
}

/* ── Legend ────────────────────────────────────────────────────────────── */
.sims-legend {
  margin-top: 18px;
  border-top: 1px solid var(--border, #e2e8f0);
  padding-top: 12px;
}
.sims-legend-h {
  font-size: 13px;
  margin: 0 0 6px;
  color: var(--text, #0f172a);
}
.sims-legend-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: 1.7;
}
.sims-guard {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 8px 11px;
}

/* ── Toast ─────────────────────────────────────────────────────────────── */
.sims-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  max-width: calc(100vw - 24px);
  background: #0f172a;
  color: #fff;
  border-radius: 8px;
  padding: 9px 15px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  z-index: 1100;
}
.sims-toast-err {
  background: #b91c1c;
}
.sims-toast[hidden] {
  display: none;
}

@media (pointer: coarse) {
  .sims-chip,
  .sims-iccid,
  .sims-note-btn,
  .sims-note-open,
  .sims-pin,
  .sims-pin-date,
  .sims-pin-reason,
  .sims-th-btn {
    min-height: 40px;
  }
}
@media (max-width: 820px) {
  .sims-card {
    max-width: none;
  }
  .sims-search {
    max-width: none;
  }
  .sims-toolbar {
    align-items: flex-start;
  }
}

/* ── SIMs tab: the disposition pin (GH #377, 2026-09-03) ───────────────────── */
.sims-pin {
  font: inherit;
  font-size: 16px; /* 16px on every focusable control — iOS zooms on anything smaller */
  padding: 1px 2px;
  max-width: 108px;
  background: #fff;
  border: 1px solid #cfd6df;
  border-radius: 4px;
}
.sims-pin-after {
  margin-left: 4px;
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
}
.sims-pin-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
/* The server refused a pin that could never fall due (deadPinVerdict): the
   reason and the "Pin anyway" override sit under the editor's fields. */
.sims-pin-warn {
  flex-basis: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  color: #b45309;
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
  max-width: 34em;
}
.sims-pin-warn .lg-btn {
  margin-top: 2px;
}
.sims-pin-date,
.sims-pin-reason {
  font: inherit;
  font-size: 16px;
  padding: 1px 2px;
}
.sims-pin-reason {
  width: 11em;
}
.sims-card-death .sims-card-main b {
  color: #b91c1c;
}
.sims-card-cold .sims-card-main b {
  color: #b45309;
}

/* ── GH #431: lifecycle actions on the Loggers tab ───────────────────────── */
.lg-toast {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #14532d;
}
.lg-toast-warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #78350f;
}
.lg-toast-err {
  border-color: #fecaca;
  background: #fef2f2;
  color: #7f1d1d;
}
.lg-sub {
  font-size: 11px;
  color: var(--muted);
}
.lg-modal-card select,
.lg-modal-card input[type="date"] {
  font-size: 16px;
}
/* A checkbox is not a text field. The `.lg-modal-card input { display:block;
   width:100% }` rule above stretched every modal checkbox into a full-width
   block sitting ABOVE its own label — the deploy force box, the return modal's
   "it is on the bench" box, and (2026-09-18) the deploy hand-over box, which is
   the one control that decides whether a unit lands `shipped` or `deployed`.
   Placed after the base rule on purpose: same specificity, source order wins. */
.lg-modal-card input[type="checkbox"] {
  display: inline-block;
  width: auto;
  min-width: 18px;
  min-height: 18px;
  margin: 0 7px 0 0;
  vertical-align: baseline;
}
@media (pointer: coarse) {
  .lg-modal-card input[type="checkbox"] {
    min-width: 22px;
    min-height: 22px;
  }
  /* The label is the touch target: the box itself stays visually small. */
  .lg-modal-card label:has(> input[type="checkbox"]) {
    min-height: 40px;
    padding: 6px 0;
  }
}
/* The countdown cards on the SIMs tab (GH #431). */
.sims-card-countdown .sims-card-main b {
  color: #9a3412;
}
.sims-card-statement .sims-card-main b {
  color: #1e40af;
}
.sims-statement-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.sims-statement-form input,
.sims-statement-form select {
  font-size: 16px;
  padding: 4px 6px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  min-width: 0;
}
.sims-statement-form input[type="number"] {
  width: 90px;
}
.sims-statement-form input[type="month"] {
  width: 130px;
}
.sims-statement-line {
  font-size: 12px;
  color: var(--muted);
}
.sims-statement-line b {
  color: var(--text, #0f172a);
}

/* Pulled-logger detector card (GH #431): problems read as a warning line. */
.lg-warn-text {
  color: #9a3412;
}

/* SIMs "Last night" card (GH #431): errors read as a warning line. */
.sims-warn-text {
  color: #b91c1c;
}

/* ── Ledger (GH #440): every number, the doors, the shelf count ─────────────── */
.lg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.lg-chip {
  border: 1px solid var(--border, #e2e8f0);
  background: var(--panel, #fff);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
  min-height: 32px;
}
.lg-chip-on {
  background: var(--accent, #2563eb);
  color: #fff;
  border-color: var(--accent, #2563eb);
}
.lg-chip .lg-count {
  margin-left: 4px;
}
.lg-ledger-search input {
  font-size: 16px;
  min-width: 220px;
}
.lg-ledger-table {
  min-width: 900px;
}
.lg-ledger-alarm td:first-child {
  border-left: 3px solid #f59e0b;
}
.lg-ledger-actions {
  white-space: nowrap;
}
.lg-ledger-actions .lg-btn {
  margin-right: 4px;
}
.lg-badge-none {
  background: #fee2e2;
  color: #991b1b;
}
.lg-shelf {
  margin: 8px 0 12px;
  padding: 8px 12px;
  border: 1px dashed var(--border, #e2e8f0);
  border-radius: 8px;
}
.lg-shelf summary {
  cursor: pointer;
  font-weight: 600;
}
.lg-shelf-lists > div,
.lg-shelf-diff > div {
  margin: 6px 0;
}
.lg-shelf textarea {
  width: 100%;
  font-size: 16px;
  margin-top: 6px;
  box-sizing: border-box;
}
.lg-shelf-diff {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border, #e2e8f0);
}
/* A shelf count's "not found" list (2026-10-08): ticked rows retire in one pass. */
.lg-shelf-lost {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.lg-lost-list {
  list-style: none;
  margin: 6px 0 8px;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}
.lg-lost-list li {
  margin: 2px 0;
}
.lg-lost-list label {
  display: block;
  cursor: pointer;
}
/* Returned list: heard SINCE the return — powered somewhere, worth a look. */
.lg-heard-after {
  color: #9a3412;
}
@media (pointer: coarse) {
  .lg-chip {
    min-height: 40px;
  }
  .lg-lost-list label {
    min-height: 40px;
    padding: 8px 0;
    box-sizing: border-box;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SHELF QC TAB (GH #572) — js/loggers/shelf-qc.js
   Built for a phone held at the office shelf: one card per logger, the number
   large, one colour chip carrying the verdict. Surfaces ride the page tokens
   (--panel / --text / --muted / --border); the four verdict colours are fixed
   semantic pairs chosen for contrast on either surface.
   ═══════════════════════════════════════════════════════════════════════════ */
.sq-wrap {
  max-width: 900px;
  margin: 0 auto;
}
.sq-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
}
.sq-counts {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  font-size: 15px;
  color: var(--muted, #64748b);
  min-width: 0;
}
.sq-count b {
  font-size: 20px;
  margin-right: 3px;
}
.sq-count-pass b {
  color: #15803d;
}
.sq-count-gathering b {
  color: #a16207;
}
.sq-count-fail b {
  color: #b91c1c;
}
.sq-count-unheard b {
  color: var(--muted, #64748b);
}
.sq-asof {
  font-size: 12px;
}
.sq-count-refurb {
  font-size: 13px;
}
.sq-count-refurb b {
  font-size: 15px;
  color: #9a3412;
}
/* A verdict the server could not save — full width under the counts line */
.sq-stamp-err {
  flex: 1 1 100%;
  list-style: none;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #7f1d1d;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.sq-muted {
  color: var(--muted, #64748b);
  font-size: 13px;
}
.sq-error {
  color: #b91c1c;
  font-size: 14px;
}
/* One line above the rows when several loggers report the same old firmware: the Flasher, not the loggers */
.sq-banner {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef3c7;
  color: #78350f;
  border: 1px solid #f59e0b;
  font-size: 14px;
  line-height: 1.35;
}
.sq-loading,
.sq-empty {
  padding: 24px 4px;
  text-align: center;
}

/* The shelf list box */
.sq-shelfbox {
  background: var(--panel, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.sq-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--text, #0f172a);
  margin-bottom: 6px;
}
.sq-addrow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sq-addrow input {
  flex: 1 1 180px;
  min-width: 0;
  font-size: 16px; /* never below 16px: iOS zooms the page on focus */
  padding: 8px 10px;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 6px;
  background: var(--panel, #fff);
  color: var(--text, #0f172a);
}
.sq-help {
  margin-top: 6px;
  font-size: 12px;
}
.sq-btn {
  min-height: 36px;
}
.sq-toast {
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}

/* One card per logger */
.sq-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sq-row {
  background: var(--panel, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-left: 6px solid #94a3b8;
  border-radius: 10px;
  min-width: 0;
}
.sq-v-pass {
  border-left-color: #16a34a;
}
.sq-v-fail,
.sq-v-silent {
  border-left-color: #dc2626;
}
.sq-v-gathering {
  border-left-color: #eab308;
}
.sq-head {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  /* right padding keeps the wrapped chip clear of the pinned caret */
  padding: 10px 34px 10px 12px;
  position: relative;
  cursor: pointer;
  color: var(--text, #0f172a);
  font: inherit;
  border-radius: 10px;
}
.sq-head:focus-visible {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: -2px;
}
.sq-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  min-width: 0;
}
.sq-num {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}
.sq-chip {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
}
.sq-chip-pass {
  background: #dcfce7;
  color: #14532d;
}
.sq-chip-fail,
.sq-chip-silent {
  background: #fee2e2;
  color: #7f1d1d;
}
.sq-chip-gathering {
  background: #fef9c3;
  color: #713f12;
}
.sq-chip-unheard {
  background: #e2e8f0;
  color: #334155;
}
.sq-caret {
  position: absolute;
  top: 16px;
  right: 12px;
  color: var(--muted, #64748b);
  font-size: 18px;
  line-height: 1;
}
.sq-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted, #64748b);
}
.sq-bit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sq-bad {
  color: #b91c1c;
  font-weight: 600;
}
.sq-spark {
  color: var(--accent, #2563eb);
  vertical-align: middle;
}
.sq-lc {
  display: inline-block;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 12px;
  background: var(--border, #e2e8f0);
  color: var(--text, #0f172a);
  overflow-wrap: anywhere;
}
.sq-lc-warn {
  background: #ffedd5;
  color: #9a3412;
  font-weight: 600;
}
.sq-lc-listed {
  background: #dbeafe;
  color: #1e3a8a;
}
.sq-lc-muted {
  background: none;
  border: 1px dashed var(--border, #cbd5e1);
  color: var(--muted, #64748b);
}

/* A row-level reason no check line carries ("no data path … reflash") */
.sq-why {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: #b91c1c;
  overflow-wrap: anywhere;
}
.sq-reasons {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: #b91c1c;
  overflow-wrap: anywhere;
}

/* Expanded: the check list, the facts, the row's door */
.sq-detail {
  padding: 0 12px 12px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.sq-checks,
.sq-facts {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}
.sq-check {
  display: grid;
  grid-template-columns: 20px minmax(0, auto) minmax(0, 1fr);
  gap: 2px 8px;
  align-items: baseline;
  padding: 3px 0;
  font-size: 13px;
  color: var(--text, #0f172a);
}
.sq-ico {
  font-weight: 700;
  text-align: center;
}
.sq-check-good .sq-ico {
  color: #15803d;
}
.sq-check-bad .sq-ico,
.sq-check-bad .sq-check-detail {
  color: #b91c1c;
}
.sq-check-warn .sq-ico {
  color: #a16207;
}
.sq-check-na {
  color: var(--muted, #64748b);
}
.sq-check-detail {
  color: var(--muted, #64748b);
  overflow-wrap: anywhere;
}
.sq-nochecks {
  margin: 10px 0 0;
}
.sq-facts li {
  font-size: 12px;
  color: var(--muted, #64748b);
  padding: 2px 0;
  overflow-wrap: anywhere;
}
.sq-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* The two collapsed strips */
.sq-strip {
  margin-top: 16px;
  border: 1px dashed var(--border, #cbd5e1);
  border-radius: 10px;
  padding: 8px 12px;
}
.sq-strip summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--text, #0f172a);
  padding: 4px 0;
}
.sq-strip-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.sq-misfiled {
  padding: 10px 12px;
}
.sq-mis-body {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text, #0f172a);
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-wrap: anywhere;
}
.sq-mis-body a {
  color: var(--accent, #2563eb);
}
.sq-hint {
  margin-top: 16px;
}

@media (pointer: coarse) {
  .sq-btn {
    min-height: 40px;
  }
  /* padding, not display:flex — a flex <summary> loses its disclosure marker */
  .sq-strip summary {
    padding: 10px 0;
  }
}

@media (max-width: 480px) {
  .sq-num {
    font-size: 26px;
  }
  .sq-addrow .sq-btn {
    flex: 1 1 100%;
  }
  .sq-check {
    grid-template-columns: 20px minmax(0, 1fr);
  }
  .sq-check-detail {
    grid-column: 2;
  }
}

/* Deploy modal: one named override line per refusal (GH #572) */
.lg-force-rows label {
  display: block;
  margin: 6px 0;
}

/* The armed second step of "Back in the office" (Shelf QC misfiled rows) — outranks .lg-btn:hover, which otherwise paints the light background under the white text the moment the armed button renders under the pointer */
.lg-btn.sq-btn-armed,
.lg-btn.sq-btn-armed:hover,
.lg-btn.sq-btn-armed:focus {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

/* Shelf QC verdict chip on the Loggers tab rows (GH #572) */
.lg-qc {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.lg-qc-pass {
  background: #dcfce7;
  color: #166534;
}
.lg-qc-gathering {
  background: #fef3c7;
  color: #b45309;
}
.lg-qc-fail {
  background: #fee2e2;
  color: #b91c1c;
}
.lg-qc-silent {
  background: #e2e8f0;
  color: #475569;
}
.lg-qc-none {
  color: var(--muted, #64748b);
  font-weight: 400;
}

/* The Where column (autofix #431): what the towers say about a unit with no
   site of its own. A customer's or shared ground is the one worth a look —
   a swap or an install nobody has recorded. */
.lg-where {
  color: var(--muted, #64748b);
  font-size: 12px;
  white-space: nowrap;
}
.lg-where-field {
  color: #b45309;
  font-weight: 600;
}
