:root {
  --bg: #f6f6f7; --surface: #fff; --border: #e1e3e5; --text: #202223;
  --muted: #6d7175; --accent: #2c6ecb; --good: #007f5f; --warn: #b98900; --bad: #d72c0d;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.app { max-width: 1000px; margin: 0 auto; padding: 20px; }
.header h1 { font-size: 20px; margin: 0 0 4px; }
.muted { color: var(--muted); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 16px; margin-bottom: 16px;
}
.card__header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* The primary action sits in its own bar rather than inside a card, so that collapsing or
   reordering any card cannot hide it — which is how it went missing. */
.actions { display: flex; justify-content: space-between; align-items: center; gap: 12px;
           flex-wrap: wrap; margin-bottom: 16px; }
.actions p { margin: 0; }
.card--error { border-left: 4px solid var(--bad); }
.card--warning { border-left: 4px solid var(--warn); }
/* The three sections sit side by side so no one of them reads as the headline result. */
.sections { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.section { border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.section h3 { font-size: 13px; font-weight: 600; margin: 0 0 8px; }
.section__value { font-size: 24px; font-weight: 650; margin: 0 0 2px; }
.section__verdict { font-size: 13px; margin: 0 0 6px; }

/* A pending section is muted rather than coloured: it is not a grade, and colouring it
   would read as a poor one. */
.section--pending { background: var(--muted-bg, transparent); }
.section--pending .section__value { color: var(--muted-fg, inherit); font-size: 18px; }

/* Manual confirmations are set apart from the checks above them, because they are the one
   thing on the page the audit is not claiming to have verified. */
.manual { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.manual h4 { font-size: 12px; font-weight: 600; margin: 0 0 4px; }
.manual ul { margin: 6px 0 0; padding-left: 18px; font-size: 12px; }

.gate { font-size: 20px; font-weight: 600; margin: 0 0 4px; }
.gate--good { color: var(--good); }
.gate--warn { color: var(--warn); }
.gate--bad { color: var(--bad); }
.card--notice, .card--empty { border-left: 4px solid var(--accent); }
.card--running { display: flex; gap: 16px; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat__label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat__value { font-size: 32px; font-weight: 600; }
.stat__value--small { font-size: 18px; }
.stat__unit { color: var(--muted); font-size: 12px; }
.score--good { color: var(--good); }
.score--warn { color: var(--warn); }
.score--bad { color: var(--bad); }
.score--none { color: var(--muted); }
.nav { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.nav__tab {
  background: none; border: none; padding: 10px 14px; cursor: pointer;
  color: var(--muted); font-size: 14px; border-bottom: 2px solid transparent;
}
.nav__tab.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.button {
  border: 1px solid var(--border); border-radius: 6px; padding: 8px 16px;
  background: var(--surface); cursor: pointer; font-size: 14px;
}
.button--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.banner { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.banner--info { background: #eaf4ff; border: 1px solid #b3d4f5; }
.banner--warn { background: #fff5ea; border: 1px solid #ffd79d; }

/* Deliberately louder than banner--warn. This one says the numbers below are not
   comparable, which a merchant tracking progress between runs has to see before reading
   them — not after. */
.banner--stop {
  background: #fdeceb;
  border: 1px solid #e0b3b0;
  border-left: 4px solid #c9312a;
  line-height: 1.5;
}
.banner--stop strong { display: block; margin-bottom: 4px; }
.table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.pill {
  display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px;
  background: #f1f2f3; color: var(--muted);
}
.pill--critical, .pill--high { background: #fde7e5; color: var(--bad); }
.pill--medium { background: #fff2d9; color: var(--warn); }
.pill--type { background: #eef2f8; color: var(--accent); }
.finding__header { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.finding__meta { color: var(--muted); font-size: 12px; margin: 0 0 6px; }
.finding h3 { margin: 0 0 6px; font-size: 15px; }
.finding p { margin: 0 0 8px; }
.finding--critical { border-left: 4px solid var(--bad); }
.finding--high { border-left: 4px solid #e06636; }
.product-list { max-height: 240px; overflow-y: auto; font-family: ui-monospace, monospace; font-size: 12px; }
.checklist { padding-left: 18px; }
.checklist li { margin-bottom: 4px; }
.details { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
/* The per-category table is diagnostic detail, not the merchant's first question. Collapsed
   by default so the dashboard opens on findings and actions; the summary stays a real
   heading so it is still obvious what is inside. */
.technical > summary { cursor: pointer; list-style: revert; }
.technical > summary h2 { display: inline; font-size: inherit; }
.technical[open] > summary { margin-bottom: 4px; }

.notes { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.notes h3 { font-size: 13px; margin: 0 0 6px; }
.spinner {
  width: 24px; height: 24px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 40px; text-align: center; color: var(--muted); }
