:root {
  /* HPF brand theme (see docs/brand.md). Legacy alias names (--green-*) are kept so
     existing rules pick up the new palette without renaming; they now hold HPF
     Orange values, not green. Neutral/soft steps are [derived] from HPF
     Grey/Silver/Orange. */
  --green-900: #711a0e;  /* Orange Extra Dark — deepest accent */
  --green-800: #973000;  /* Orange Dark — hover / pressed */
  --green-700: #ef8b00;  /* HPF Orange — primary */
  --green-600: #f0a94d;  /* [derived] lighter orange */
  --green-500: #f7c77e;  /* [derived] soft orange */
  --green-soft: #f7dcbe; /* [derived] disabled validate */
  --gold: #ef8b00;       /* HPF Orange — accent on tinted surfaces */
  --tint: #fdf0df;       /* [derived] soft orange surface */
  --tint-line: #f5d9b4;  /* [derived] soft orange border */
  /* Semantic success — HPF Green family (Social & Conservation) */
  --pass-700: #223b26;
  --pass-600: #315837;
  --pass-bg: #e4f6eb;
  --ink: #373c42;        /* HPF Grey */
  --ink-soft: #6b7075;   /* [derived] secondary text */
  --line: #e3e3e4;       /* [derived] hairline */
  --bg: #f4f5f6;         /* [derived] page background */
  --card: #ffffff;       /* White */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

button, label, a, input { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

#invoice-form {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 920px;
  margin: 0 auto;
  background: var(--bg);
}

/* ── Top bar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 16px 24px;
  background: rgba(253, 250, 247, .9);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--green-700);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar { justify-content: space-between; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.brand-accent { color: var(--green-600); }
.brand-sub { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }

.btn-new {
  display: none;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--foreground);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16,24,40,.05);
  transition: background .12s, border-color .12s;
}
.btn-new:hover { background: var(--surface-soft); border-color: var(--border-strong); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ── Organization menu (dropdown) ── */
.org-menu { position: relative; }
.org-trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px 6px 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(28, 25, 23, .05);
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.org-trigger:hover { background: var(--tint); border-color: var(--tint-line); }
.org-menu.open .org-trigger { background: var(--tint); border-color: var(--tint-line); }
.org-trigger:focus-visible { outline: 2px solid var(--green-700); outline-offset: 2px; }
.org-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green-700);
  color: #fff; font-size: 14px; font-weight: 800;
}
.org-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-caret { color: var(--ink-soft); transition: transform .15s ease; }
.org-menu.open .org-caret { transform: rotate(180deg); }

.org-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(16,24,40,.12);
  z-index: 30;
}
.org-dropdown[hidden] { display: none; }
.org-dropdown form { margin: 0; }
.org-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: none;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--foreground);
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
.org-item:hover { background: var(--surface-soft); }
.org-item svg { color: var(--green-700); flex-shrink: 0; }
.org-item.is-active { color: var(--green-700); }
.org-item--clear { color: var(--faint-foreground); }
.org-item--clear svg { color: var(--faint-foreground); }
.org-item--clear:hover { color: var(--fix); }
.org-item--clear:hover svg { color: var(--fix); }
.org-item .org-tick { margin-left: auto; }
.org-avatar--sm {
  width: 22px; height: 22px; font-size: 11px;
  background: var(--green-600);
}
.org-group {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--faint-foreground);
  padding: 6px 12px 4px; text-transform: uppercase;
}
.org-empty { padding: 8px 12px; font-size: 13.5px; color: var(--ink-soft); }
.org-divider { height: 1px; background: var(--line); margin: 6px 0; }
.org-dropdown { max-height: 70vh; overflow-y: auto; }

/* ── View switching ── */
.view-results { display: none; }
body[data-view="results"] .view-upload { display: none; }
body[data-view="results"] .view-results { display: block; }
body[data-view="results"] .btn-new { display: inline-flex; }
body[data-view="loading"] .dock { pointer-events: none; }

/* ── Content ── */
.content {
  flex: 1;
  padding: 40px 24px 220px;
}

.headline {
  font-size: clamp(16px, 1.8vw, 20px);
  font-weight: 500;
  letter-spacing: -.005em;
  line-height: 1.4;
  max-width: 680px;
  color: var(--ink-soft);
}
.lede {
  margin-top: 18px;
  max-width: 640px;
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ── Panels ── */
.panel {
  margin-top: 28px;
  background: var(--card);
  border-radius: 16px;
  padding: 26px 28px;
  border: 1px solid var(--line);
}
.panel-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--faint-foreground);
  margin-bottom: 18px;
}

/* ── Attach rows ── */
.attach-row { display: flex; align-items: center; gap: 16px; padding: 6px 0; }
.attach-divider { height: 1px; background: var(--line); margin: 14px 0; }

.attach-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.attach-icon--invoice {
  background: var(--tint);
  color: var(--green-700);
}
.attach-icon--contract { background: var(--surface-soft); color: var(--muted-foreground); }

.attach-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.attach-title { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.attach-meta {
  font-size: 15px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* State badge on the right of each row */
.attach-state { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; }
.attach-state .dash { width: 16px; height: 2px; background: var(--border-strong); border-radius: 2px; }
.attach-row[data-empty="false"] .attach-state {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--green-600); color: #fff;
}
.attach-row[data-empty="false"] .attach-state .dash { display: none; }
.attach-row[data-empty="false"] .attach-state::after {
  content: "";
  width: 16px; height: 16px;
  background-repeat: no-repeat;
  background-position: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Per-row "Remove" text button — only visible once a file is attached. */
.attach-remove {
  flex-shrink: 0;
  display: none;
  border: none;
  background: none;
  padding: 6px 10px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fix);
  border-radius: 8px;
  cursor: pointer;
}
.attach-remove:hover { background: var(--fix-soft); }
.attach-row[data-empty="false"] .attach-remove { display: inline-flex; }

/* ── What we check grid ── */
.check-grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 28px;
}
.check-grid li {
  position: relative;
  padding-left: 30px;
  font-size: 18px;
  color: var(--ink);
}
.check-grid li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background-repeat: no-repeat;
  background-position: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7' stroke='%23f97316' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ── Action dock ── */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 16px 24px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 72%, rgba(253, 250, 247, 0));
}
.dock-pills {
  max-width: 920px;
  margin: 0 auto 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.pill {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: none;
  border-radius: 20px;
  padding: 16px 18px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
}
.pill:active { transform: scale(.99); }

.pill-icon {
  width: 44px; height: 44px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pill-icon-check { display: none; }
.pill-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pill-title { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.pill-meta {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill-action {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.ico-x { display: none; }

/* Invoice pill (primary, flat orange) */
.pill--invoice {
  background: var(--green-700);
  color: #fff;
}
.pill--invoice .pill-icon { background: rgba(255, 255, 255, .18); color: #fff; }
.pill--invoice .pill-meta { color: rgba(255, 255, 255, .82); }
.pill--invoice .pill-action { background: rgba(255, 255, 255, .2); color: #fff; }

/* Contract pill (light, flat) */
.pill--contract {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
}
.pill--contract .pill-icon { background: var(--surface-soft); color: var(--muted-foreground); }
.pill--contract .pill-meta { color: var(--ink-soft); }
.pill--contract .pill-action { background: var(--surface-soft); color: var(--muted-foreground); }

/* Filled state — both pills go flat orange with check + X */
.pill[data-empty="false"] {
  background: var(--green-700);
  color: #fff;
  border-color: transparent;
}
.pill[data-empty="false"] .pill-icon { background: rgba(255,255,255,.2); color: #fff; box-shadow: none; }
.pill[data-empty="false"] .pill-icon-doc { display: none; }
.pill[data-empty="false"] .pill-icon-check { display: block; }
.pill[data-empty="false"] .pill-meta { color: rgba(255,255,255,.82); }
.pill[data-empty="false"] .pill-action { background: rgba(255,255,255,.2); color: #fff; }
.pill[data-empty="false"] .ico-plus { display: none; }
.pill[data-empty="false"] .ico-x { display: block; }

/* ── Validate button ── */
.btn-validate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  border: none;
  border-radius: 20px;
  padding: 20px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: var(--green-soft);
  transition: background .15s ease, transform .12s ease;
}
.btn-validate:disabled { cursor: not-allowed; background: var(--green-soft); }
.btn-validate:not(:disabled) {
  background: var(--green-700);
}
.btn-validate:not(:disabled):hover { background: var(--green-800); }
.btn-validate:not(:disabled):active { transform: scale(.99); }

/* ── Results: verdict hero ── */
.view-results { padding-bottom: 60px; }

.verdict {
  display: flex;
  align-items: center;
  gap: 36px;
  background: var(--green-700);
  border-radius: 20px;
  padding: 36px 40px;
  color: #fff;
}
.verdict-ring { position: relative; flex-shrink: 0; width: 132px; height: 132px; }
.ring-track { stroke: rgba(255, 255, 255, .14); }
.ring-value {
  stroke: #fff;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1s cubic-bezier(.22, 1, .36, 1);
}
.verdict-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-pct { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.ring-cap { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: rgba(255, 255, 255, .72); margin-top: 2px; }

.verdict-copy { min-width: 0; }
.verdict-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .18em; color: rgba(255, 255, 255, .68); }
.verdict-title { font-size: clamp(26px, 4vw, 38px); font-weight: 800; letter-spacing: -.02em; margin-top: 8px; }
.verdict-sub { margin-top: 12px; font-size: clamp(15px, 2vw, 18px); line-height: 1.5; color: rgba(255, 255, 255, .85); }

/* ── Stat chips ── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 22px; }
.stat { border-radius: 18px; padding: 18px 22px; }
.stat-num { display: block; font-size: 34px; font-weight: 800; line-height: 1; }
.stat-cap { display: block; margin-top: 8px; font-size: 13px; font-weight: 700; letter-spacing: .08em; }
.stat--pass   { background: var(--pass-bg); } .stat--pass   .stat-num { color: var(--pass-700); } .stat--pass   .stat-cap { color: var(--pass-700); }
.stat--fix    { background: var(--fix-soft); } .stat--fix    .stat-num { color: var(--fix); }        .stat--fix    .stat-cap { color: var(--fix); }
.stat--review { background: var(--review-soft); } .stat--review .stat-num { color: var(--review); }        .stat--review .stat-cap { color: var(--review); }

/* Clickable stat cards jump to the matching checks in the list below. */
.stat--jump { cursor: pointer; transition: transform .12s ease, box-shadow .15s ease; }
.stat--jump:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(28, 25, 23, .08); }
.stat--jump:focus-visible { outline: 2px solid var(--green-700); outline-offset: 3px; }
.stat--jump.stat--disabled { cursor: default; transform: none; box-shadow: none; opacity: .55; }

/* Brief highlight on the check a stat card scrolled to. */
@keyframes detail-flash {
  0%, 15% { background: var(--tint); box-shadow: inset 3px 0 0 var(--green-700); }
  100%    { background: transparent; box-shadow: inset 3px 0 0 transparent; }
}
.detail-item--flash { animation: detail-flash 1.4s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .stat--jump:hover { transform: none; }
  .detail-item--flash { animation: none; }
}

/* ── Document preview (rasterised pages, click to enlarge) ── */
.doc-preview { margin-top: 8px; }
.doc-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.doc-thumb {
  position: relative;
  width: 132px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  cursor: zoom-in;
  overflow: hidden;
  transition: border-color .15s ease;
}
.doc-thumb:hover {
  border-color: var(--green-500);
}
.doc-thumb img { display: block; width: 100%; height: auto; }
.doc-thumb-num {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(12, 17, 22, .72);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

/* ── Lightbox overlay ── */
body.lightbox-open { overflow: hidden; }
.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(12, 17, 22, .82);
  backdrop-filter: blur(4px);
}
.lightbox-img {
  max-width: min(900px, 92vw);
  max-height: 92vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  background: #fff;
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  cursor: pointer;
  transition: background .15s ease;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .26); }

/* Page navigation inside the enlarged view (multi-page documents). */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  cursor: pointer;
  z-index: 1;
  transition: background .15s ease;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, .26); }
.lightbox-nav[hidden] { display: none; }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }
.lightbox-count {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
}
.lightbox-count[hidden] { display: none; }
@media (max-width: 560px) {
  .lightbox-nav { width: 42px; height: 42px; }
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
}

/* ── Detailed checks (scannable, expand for detail) ── */
.checks-eyebrow { margin: 34px 0 14px; font-size: 13px; font-weight: 700; letter-spacing: .12em; color: var(--faint-foreground); }
.panel--flush { padding: 6px 10px; margin-top: 0; }
.detail-list { list-style: none; }
.detail-item { border-top: 1px solid var(--line); }
.detail-item:first-child { border-top: none; }

/* Collapsible category (e.g. "Invoice Basics", "Company policy rules") */
.detail-cat { border-top: 1px solid var(--line); }
.detail-cat:first-child { border-top: none; }
.cat-head {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
  padding: 18px 14px;
  border-radius: 14px;
  transition: background .12s ease;
}
.cat-head:hover { background: var(--surface-soft); }
.cat-title {
  flex: 1;
  min-width: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ink);
}
.detail-cat.open .cat-head .detail-chevron { transform: rotate(180deg); }
.cat-body { list-style: none; padding: 2px 0 10px; }
.cat-body .detail-item:first-child { border-top: none; }

/* Placeholder (upcoming) category — header only, no checks yet */
.cat-head--static { cursor: default; }
.cat-head--static:hover { background: none; }
.detail-cat.is-placeholder .cat-title { color: var(--faint-foreground); }
.cat-soon {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--faint-foreground);
  background: var(--na-soft);
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Section header inside the checks list */
.detail-group {
  padding: 20px 14px 12px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ink);
}
.detail-group:first-child { padding-top: 8px; }
.detail-group + .detail-item { border-top: none; }

.detail-head {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
  padding: 16px 14px;
  border-radius: 14px;
  transition: background .12s ease;
}
.detail-head:hover { background: var(--surface-soft); }

.detail-ic {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--na-soft);
  color: var(--muted-foreground);
  display: flex; align-items: center; justify-content: center;
}
.detail-ic svg { width: 20px; height: 20px; }

.detail-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.005em;
  color: var(--ink);
  line-height: 1.35;
}

/* Status chip */
.detail-status {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
}
.detail-status svg { width: 15px; height: 15px; }
/* Per-item chip colours — scoped to the item so a category's roll-up state
   (on the ancestor .detail-cat) can't cascade in and recolour passed rows. */
.detail-item.is-checked .detail-status { background: var(--pass-bg); color: var(--pass-600); }
.detail-item.is-missing .detail-status { background: var(--fix-soft); color: var(--fix); }
.detail-item.is-check   .detail-status { background: var(--review-soft); color: var(--review); }
.detail-item.is-na      .detail-status { background: var(--na-soft); color: var(--muted-foreground); }

/* Category roll-up badge colours — scoped to the category header only. */
.detail-cat.is-checked > .cat-head .detail-status { background: var(--pass-bg); color: var(--pass-600); }
.detail-cat.is-missing > .cat-head .detail-status { background: var(--fix-soft); color: var(--fix); }
.detail-cat.is-check   > .cat-head .detail-status { background: var(--review-soft); color: var(--review); }
.detail-cat.is-na      > .cat-head .detail-status { background: var(--na-soft); color: var(--muted-foreground); }

.detail-chevron { flex-shrink: 0; color: var(--border-strong); transition: transform .2s ease; }
.detail-item.open .detail-chevron { transform: rotate(180deg); }

/* Expandable explanation */
.detail-extra {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .25s ease, opacity .2s ease, padding .25s ease;
  padding: 0 16px 0 72px;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--muted-foreground);
}
.detail-item.open .detail-extra {
  max-height: 320px;
  opacity: 1;
  padding-bottom: 18px;
}

/* Neutral info rows (OCR metadata — no status / not expandable) */
.detail-head--info { cursor: default; }
.detail-head--info:hover { background: none; }
.detail-meta {
  flex-shrink: 0;
  max-width: 55%;
  font-size: 15px;
  color: var(--ink-soft);
  text-align: right;
  word-break: break-word;
}

/* ── Loading overlay: now the shared ticker (ui/loader.css) ── */

/* ── Responsive ── */
@media (max-width: 640px) {
  .content { padding: 28px 18px 230px; }
  .view-results { padding-bottom: 48px; }
  .panel { padding: 22px 18px; border-radius: 18px; }
  .check-grid { grid-template-columns: 1fr; gap: 14px; }
  .dock-pills { grid-template-columns: 1fr; }
  .verdict { flex-direction: column; text-align: center; gap: 22px; padding: 28px 22px; }
  .verdict-copy { text-align: center; }
  .stats { gap: 12px; }
  .stat { padding: 16px; }
  .stat-num { font-size: 28px; }
  .detail-head { gap: 12px; padding: 16px 8px; }
  .detail-extra { padding-left: 8px; }
}
