/* VerifyScreen — vendor integrity screening.
   Visual language: clean blue-on-white console. Tier colour is carried by soft pastel
   badges (red / amber / green) rather than solid fills. */

:root {
  --blue: #1d4ed8;
  --blue-600: #2563eb;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;

  --ink: #111827;
  --body: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e5e7eb;
  --line-soft: #f1f3f5;
  --bg: #f6f7f9;
  --card: #ffffff;

  --high: #dc2626;  --high-bg: #fee2e2;
  --elev: #d97706;  --elev-bg: #fef3c7;
  --low:  #16a34a;  --low-bg:  #dcfce7;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --r: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; color: inherit; }
a { color: var(--blue); }

:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; border-radius: 6px; }

.tabnum { font-variant-numeric: tabular-nums; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip { position: absolute; left: -9999px; top: 0; background: var(--blue); color: #fff; padding: 10px 16px; z-index: 40; }
.skip:focus { left: 0; }

/* ---------------------------------------------------------------- header */

header { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line); }

.head-in {
  max-width: 1560px; margin: 0 auto; padding: 12px 26px;
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
}

.wordmark { display: flex; align-items: center; gap: 10px; flex: none; }
.wordmark svg { width: 30px; height: 30px; color: var(--blue); flex: none; }
.wordmark .name { font-weight: 800; font-size: 16.5px; letter-spacing: .6px; color: var(--blue); line-height: 1.15; }
.wordmark .sub { font-size: 11px; color: var(--muted); font-weight: 500; }

.modeline { flex: 1 1 320px; min-width: 0; }
.modeline .title { font-size: 15.5px; font-weight: 700; color: var(--blue); letter-spacing: -.1px; }
.modeline .title .dot { color: var(--blue-100); font-weight: 700; margin: 0 7px; }
.modeline .title .lede { font-weight: 600; }
.modeline .sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

.head-right { display: flex; align-items: center; gap: 14px; flex: none; }

/* sliding two-state switch */
.switch {
  display: flex; position: relative; background: #f1f3f7; border: 1px solid var(--line);
  border-radius: 999px; padding: 3px; width: 236px;
}
.switch button {
  position: relative; z-index: 1; flex: 1 1 0; border: 0; background: none; cursor: pointer;
  border-radius: 999px; padding: 7px 10px; font-size: 13px; font-weight: 600; color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap; transition: color .18s;
}
.switch button:hover { color: var(--body); }
.switch button[aria-pressed="true"] { color: #fff; }
.switch button .knob {
  width: 15px; height: 15px; border-radius: 50%; background: #fff; flex: none;
  opacity: 0; transition: opacity .18s;
}
.switch button[aria-pressed="true"] .knob { opacity: 1; }
.switch button#btn-A .knob { order: 2; }
.switch .glider {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  border-radius: 999px; background: var(--blue-600); transition: left .22s ease; z-index: 0;
}
body[data-mode="B"] .switch .glider { left: 50%; }

.icon-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 0; background: none; cursor: pointer;
  color: var(--faint); display: grid; place-items: center; transition: color .15s, background .15s;
}
.icon-btn:hover { color: var(--blue); background: var(--blue-50); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------------------------------------------------------------- layout */

.wrap {
  max-width: 1560px; margin: 0 auto; padding: 18px 26px 6px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr); gap: 18px;
  align-items: start;
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card > .pad { padding: 18px 20px 16px; }

.card-title { font-size: 15.5px; font-weight: 700; color: var(--ink); margin: 0 0 14px; letter-spacing: -.1px; }

/* ---------------------------------------------------------------- controls */

.controls { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }

.search { position: relative; flex: 1 1 190px; min-width: 0; }
.search input { width: 100%; padding: 9px 34px 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 13px; }
.search input::placeholder { color: var(--faint); }
.search svg { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); pointer-events: none; }

.controls select {
  padding: 9px 30px 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
  font-size: 13px; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%239ca3af' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='m4 6.5 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 15px;
}

/* ---------------------------------------------------------------- worklist */

table { width: 100%; border-collapse: collapse; }

thead th {
  text-align: left; font-size: 12px; color: var(--muted); font-weight: 600;
  padding: 0 10px 9px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
th.num, td.num { text-align: right; }
th.mid, td.mid { text-align: center; }

tbody td { padding: 11px 10px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; vertical-align: middle; }

tr.row { cursor: pointer; transition: background .12s; }
tr.row:hover td { background: #fafbfc; }
tr.row[aria-selected="true"] td { background: var(--blue-50); }
tr.row:focus-visible { outline: 2px solid var(--blue-600); outline-offset: -2px; }

td.rank { color: var(--muted); width: 44px; font-variant-numeric: tabular-nums; }
td.vend { font-weight: 600; color: var(--blue); }
td.score { font-weight: 700; font-variant-numeric: tabular-nums; width: 110px; text-align: center; }
th.score-h { text-align: center; width: 110px; }
th.tier-h, td.tier { text-align: center; width: 190px; }

.badge {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
}
.badge.HIGH     { background: var(--high-bg); color: var(--high); }
.badge.ELEVATED { background: var(--elev-bg); color: var(--elev); }
.badge.LOW      { background: var(--low-bg);  color: var(--low); }

.shift { display: inline-block; margin-left: 7px; font-size: 11px; font-weight: 600; color: var(--high); white-space: nowrap; }
.shift.down { color: var(--low); }

.tag-edit {
  display: inline-block; margin-left: 7px; padding: 2px 8px; border-radius: 999px;
  background: var(--elev-bg); color: var(--elev); font-size: 10px; font-weight: 700; letter-spacing: .3px;
}

.list-foot {
  border-top: 1px solid var(--line); padding: 12px 20px; font-size: 12.5px; color: var(--muted);
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.list-foot .hint .kbd {
  font: 11px var(--mono); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 4px; padding: 1px 5px; background: #fafbfc; color: var(--body);
}

.empty { padding: 30px 10px; color: var(--muted); font-size: 13.5px; text-align: center; }

/* ---------------------------------------------------------------- verdict */

.vd-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.vd-head .vname { font-size: 17px; font-weight: 700; margin: 0; letter-spacing: -.2px; }
.vd-head .right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.risk-badge { padding: 4px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .3px; }

.btn {
  border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 12px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--body); white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}
.btn:hover { border-color: var(--blue-600); color: var(--blue); }
.btn[aria-pressed="true"] { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }

/* score + scale */

.score-row { display: grid; grid-template-columns: minmax(150px, auto) minmax(0, 1fr); gap: 8px 30px; align-items: start; }
.score-row .lab { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.score-row .big { font-size: 34px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.score-row .big .of { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }

.scale { padding-top: 4px; }
.scale .track { height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; }
.scale .fill {
  height: 100%; border-radius: 999px;
  background-image: linear-gradient(90deg, #16a34a 0%, #84cc16 26%, #eab308 44%, #f97316 68%, #dc2626 100%);
  background-repeat: no-repeat; transition: width .3s ease;
}
.scale .ticks { position: relative; height: 17px; margin-top: 5px; }
.scale .ticks span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.scale .ticks span:first-child { transform: none; }
.scale .ticks span:last-child { transform: translateX(-100%); }
.scale .zones { display: flex; border-top: 1px solid var(--line); }
.scale .zones span { text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .4px; padding: 5px 2px; }
.scale .zones span + span { border-left: 1px solid var(--line); }
.scale .zones .z-low  { color: var(--low); }
.scale .zones .z-mid  { color: var(--elev); }
.scale .zones .z-high { color: var(--high); }

/* mode B score trio */

.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.trio .lab { font-size: 12.5px; color: var(--muted); }
.trio .lab b { color: var(--body); font-weight: 600; }
.trio .num { font-size: 30px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.8px; margin-top: 1px; }
.trio .num .of { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.trio .bar { height: 4px; border-radius: 999px; background: var(--line); margin-top: 8px; overflow: hidden; }
.trio .bar i { display: block; height: 100%; border-radius: 999px; }

.blend { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.blend .t { font-size: 13px; font-weight: 600; color: var(--body); flex: none; }
.blend .split { flex: 1 1 200px; min-width: 140px; height: 7px; border-radius: 999px; overflow: hidden; display: flex; background: var(--line); }
.blend .split i.ml { background: var(--blue-600); }
.blend .split i.rules { background: #cbd5e1; }
.blend .k { font-size: 12.5px; color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
.blend .k b { color: var(--ink); font-weight: 700; }

.chip {
  display: inline-flex; align-items: center; gap: 7px; background: var(--blue-50); color: var(--blue);
  font-size: 11.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
}
.chip svg { width: 13px; height: 13px; }

/* boxed data table */

.box { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-top: 18px; }
.box > .bt { padding: 10px 14px; font-size: 12.5px; font-weight: 700; color: var(--body); border-bottom: 1px solid var(--line); background: #fcfcfd; }
.box table { font-size: 12.5px; }
.box thead th { padding: 9px 12px; font-size: 11.5px; border-bottom: 1px solid var(--line); background: #fff; }
.box tbody td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); }
.box tbody tr:last-child td { border-bottom: 0; }

.n-circle {
  display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 50%;
  background: var(--blue-100); color: var(--blue); font-size: 10.5px; font-weight: 700;
  margin-right: 9px; vertical-align: -4px; flex: none;
}
tr.clean .n-circle { background: #f1f3f5; color: var(--faint); }
tr.clean td { color: var(--muted); }

.box td:first-child { min-width: 205px; }
.box .sig { font-weight: 600; color: var(--ink); }
tr.clean .sig { font-weight: 500; color: var(--muted); }
.box .val { font-variant-numeric: tabular-nums; white-space: nowrap; }
.box .val .thr { display: block; font-size: 11px; color: var(--faint); }
.box .why { color: var(--muted); }
.box .contrib { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--high); text-align: right; white-space: nowrap; }
.box .sev { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--body); text-align: right; }
tr.clean .contrib { color: var(--faint); font-weight: 600; }
.box tfoot td { padding: 11px 12px; border-top: 1px solid var(--line); font-weight: 700; font-size: 12.5px; background: #fcfcfd; }

/* info bar */

.info {
  display: flex; gap: 11px; align-items: flex-start; margin-top: 16px; padding: 12px 14px;
  background: var(--blue-50); border-radius: 10px; font-size: 12.5px; color: #1e40af; line-height: 1.55;
}
.info svg { width: 18px; height: 18px; flex: none; color: var(--blue-600); margin-top: 1px; }
.info code { font: 11.5px var(--mono); background: #fff; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--blue-100); }
.info.warn { background: var(--high-bg); color: #991b1b; }
.info.warn svg { color: var(--high); }
.info.calm { background: var(--low-bg); color: #14532d; }
.info.calm svg { color: var(--low); }

/* what-if */

.whatif { margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; padding: 15px 16px 6px; background: #fcfcfd; }
.whatif .hd { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.whatif .hd .t { font-size: 12.5px; font-weight: 700; color: var(--body); }
.whatif .warn-txt { font-size: 12px; color: var(--muted); margin: 0 0 14px; line-height: 1.55; }
.field { display: grid; grid-template-columns: 1fr 72px; gap: 5px 12px; align-items: center; margin-bottom: 12px; }
.field .fl { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: var(--body); display: flex; justify-content: space-between; gap: 8px; }
.field .fl .rule { color: var(--faint); font-weight: 500; font-variant-numeric: tabular-nums; }
.field input[type="range"] { width: 100%; accent-color: var(--blue-600); margin: 0; }
.field input[type="number"] {
  width: 100%; padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 12.5px; font-variant-numeric: tabular-nums; text-align: right; background: #fff;
}
.field.breached input[type="range"] { accent-color: var(--high); }
.field.breached .fl { color: var(--high); }

/* ---------------------------------------------------------------- footer */

footer { max-width: 1560px; margin: 0 auto; padding: 12px 26px 44px; }

.method { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 2px 20px; margin-bottom: 14px; box-shadow: var(--shadow); }
.method summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--body); padding: 14px 0; list-style: none; }
.method summary::-webkit-details-marker { display: none; }
.method summary::before { content: "▸"; color: var(--blue-600); display: inline-block; width: 16px; }
.method[open] summary::before { content: "▾"; }
.method .body { padding-bottom: 18px; font-size: 13.5px; color: var(--body); max-width: 82ch; }
.method .body h3 { font-size: 13.5px; margin: 18px 0 6px; color: var(--ink); }
.method .body p, .method .body li { margin: 6px 0; line-height: 1.6; }
.method .body code { font: 12.5px var(--mono); background: #f3f4f6; padding: 1px 5px; border-radius: 4px; }
.method .body ul { padding-left: 20px; }
.method .body .box { max-width: 100%; }

.note { font-size: 12px; color: var(--muted); line-height: 1.7; max-width: 96ch; }
.note a { color: var(--blue); font-weight: 600; }
.note .kbd {
  font: 11px var(--mono); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 4px; padding: 1px 5px; background: #fff; color: var(--body);
}
.note .rule { border: 0; border-top: 1px solid var(--line); margin: 11px 0; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1180px) {
  .wrap { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .head-in { padding: 12px 16px; gap: 14px; }
  .modeline { flex-basis: 100%; order: 3; }
  .head-right { margin-left: auto; }
  .wrap, footer { padding-left: 16px; padding-right: 16px; }
  .trio { grid-template-columns: 1fr; gap: 14px; }
  .score-row { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .box .why, .list-foot .hint { display: none; }
  .score-row .big { font-size: 30px; }
  .switch button { padding: 7px 12px; font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  body { background: #fff; }
  header { position: static; }
  .controls, .switch, .btn, .icon-btn, .skip, .whatif, .list-foot { display: none !important; }
  .wrap { display: block; max-width: none; padding: 0; }
  .card { break-inside: avoid; box-shadow: none; margin-bottom: 14px; }
  .method .body { display: block !important; }
}
