/*
 * INQUIRIES, on the Law Enforcement page (public/inquiries.js). Every rule is under .sp-inq, so
 * nothing here reaches the rest of the CAD and the CAD's own .note, .empty and .primary are
 * overridden where they would leak in. The colours are the CAD's, so it follows the theme.
 *
 * Moved from the MDT's Inquiries page (D-165) with its rules: big targets for a thumb, the open
 * search type obvious at a glance, the returns roll a fixed-width sheet, and the return itself 80
 * columns of the server's own text.
 */
.sp-inq {
  --inq-ink: var(--text);
  --inq-btn: var(--panel2);
  --inq-bad: var(--danger);
  --inq-radius: 8px;
  --inq-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--inq-ink);
  max-width: 960px;
}
.sp-inq .main { padding: 4px 0; }

.sp-inq .card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--inq-radius); margin-bottom: 14px; overflow: hidden;
}
.sp-inq .card > h2 {
  margin: 0; padding: 10px 14px; font-size: 12px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); border-bottom: 1px solid var(--line);
}
.sp-inq .card > .body { padding: 14px; }

.sp-inq button {
  font: inherit; color: var(--inq-ink); background: var(--inq-btn); border: 1px solid var(--line);
  border-radius: var(--inq-radius); padding: 12px; cursor: pointer; text-align: center;
  min-height: 44px; font-weight: 400;
}
.sp-inq button:hover { border-color: var(--accent); }
.sp-inq button[disabled] { opacity: .45; cursor: not-allowed; }
.sp-inq button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.sp-inq button.small { padding: 8px 12px; min-height: 0; font-size: 13px; }

/* The search types across the top: big enough for a thumb, and the open one obvious. */
.sp-inq .kinds { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); margin-bottom: 14px; }
.sp-inq .kinds button { min-height: 48px; font-size: 13px; }
.sp-inq .kinds button.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }

.sp-inq label.f { display: block; margin-bottom: 10px; }
.sp-inq label.f > b { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: .06em; }
/* "not searched on" is an aside, and an aside in capitals reads as a warning. */
.sp-inq label.f > b .note { text-transform: none; letter-spacing: 0; font-size: 11px; opacity: .75; font-weight: 400; }
.sp-inq .fields { display: grid; gap: 0 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.sp-inq .fields label.f.wide { grid-column: 1 / -1; }

.sp-inq .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sp-inq .note { color: var(--muted); font-size: 13px; margin: 0; padding: 0; background: none; border: 0; }
.sp-inq .err { color: var(--inq-bad); }
.sp-inq .mono { font-family: var(--inq-mono); letter-spacing: .03em; }
.sp-inq .empty { color: var(--muted); padding: 10px 0; text-align: left; }

/* The returns roll: a table, monospace, one run a row and the same fact in the same column. */
.sp-inq .sheet { width: 100%; overflow-x: auto; }
.sp-inq table.runs { border-collapse: collapse; width: 100%; font-family: var(--inq-mono); font-size: 12px; }
.sp-inq table.runs th {
  text-align: left; font-weight: 600; color: var(--muted); padding: 7px 8px; border-bottom: 1px solid var(--line);
  text-transform: uppercase; letter-spacing: .08em; font-size: 11px; background: var(--panel); white-space: nowrap;
}
.sp-inq table.runs td { padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sp-inq table.runs tbody tr { cursor: pointer; }
.sp-inq table.runs tbody tr:hover td { background: var(--inq-btn); }
/* Picked: an edge as well as a tint, because a tint alone is lost on a sunlit screen. */
.sp-inq table.runs tbody tr.on td { background: var(--inq-btn); }
.sp-inq table.runs tbody tr.on td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.sp-inq table.runs td.pick { width: 1%; text-align: center; color: var(--muted); }
.sp-inq table.runs tr.on td.pick { color: var(--accent); }
.sp-inq table.runs td.code { color: var(--accent); font-weight: 600; letter-spacing: .05em; }
.sp-inq table.runs td.sum { white-space: normal; color: var(--muted); }
.sp-inq table.runs td.sum.hit { color: var(--inq-bad); }
.sp-inq table.runs td.num { text-align: right; color: var(--muted); }
.sp-inq table.runs td.at { color: var(--muted); }

.sp-inq .sheetbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.sp-inq .sheetbar .count { color: var(--muted); font-size: 12px; margin-right: auto; font-family: var(--inq-mono); }
.sp-inq .sheetbar button { min-height: 0; padding: 6px 9px; font-size: 11px; }
.sp-inq .sheetbar button.warn { border-color: var(--inq-bad); color: var(--inq-bad); }
.sp-inq .pager { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 10px 14px;
  border-top: 1px solid var(--line); color: var(--muted); font-family: var(--inq-mono); font-size: 12px; }
.sp-inq .pager button { min-height: 0; padding: 6px 12px; font-size: 12px; }

.sp-inq .sheet-ret + .sheet-ret { border-top: 1px solid var(--line); }
.sp-inq .sheet-ret > .cap { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 9px 14px;
  font-family: var(--inq-mono); font-size: 12px; color: var(--muted); }
.sp-inq .sheet-ret > .cap .code { color: var(--accent); font-weight: 600; }
.sp-inq .sheet-ret > .cap button { min-height: 0; padding: 5px 9px; font-size: 11px; }

/* The return: 80 columns built on the server, printed as given. The type shrinks on a narrow
   screen until the whole width fits; the scrollbar is the safety net, never a cut-off line. */
.sp-inq pre.ret {
  white-space: pre; overflow-x: auto; margin: 0; padding: 14px 10px;
  font-family: var(--inq-mono); font-size: clamp(8px, 1.82vw, 13px); line-height: 1.35;
  background: #080a08; color: #cfe3cf;
}
.sp-inq pre.ret .hit { color: #ffd166; }
