/* Privacy X-ray — the on-screen exposure summary: a hero count, the
   failed-redaction proof (recovered text shown inline, soft RED = a failure),
   the not-yet-redacted section (tiered counts + examples, soft AMBER = a caution,
   not a failure), and the report action bar. Shared token system so both themes
   track automatically; meaning is carried by weight and a soft alert tint, never
   a colored edge stripe. The entrance (kpRise) is applied from JS, gated by
   prefersReducedMotion(). */

.xray-result-holder { margin-top: 18px; }

/* ── Risk hero ──────────────────────────────────────────────────────────── */
.xray-hero {
  display: flex; align-items: center; gap: 18px;
  padding: 20px 22px; margin-bottom: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 7%, var(--bg-elev)), var(--bg-elev));
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.xray-hero.is-clean {
  background: linear-gradient(135deg, color-mix(in srgb, var(--success) 8%, var(--bg-elev)), var(--bg-elev));
}
.xray-hero-count {
  flex: none; min-width: 66px; height: 66px; padding: 0 10px; border-radius: 16px;
  display: grid; place-items: center; color: #fff;
  font-size: 30px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--primary) 70%, transparent);
}
.xray-hero-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.xray-hero-text strong { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.xray-hero-cats { color: var(--danger); font-size: 13.5px; font-weight: 600; }
.xray-hero-versions, .xray-hero-text span { color: var(--text-soft); font-size: 13px; line-height: 1.5; }

/* ── Primary action — fix first, above the evidence ─────────────────────── */
.xray-primary-action { margin: 0 0 18px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.xray-primary-action .btn { font-size: 14.5px; }
.xray-primary-action-note { margin: 0; color: var(--text-soft); font-size: 13px; line-height: 1.5; }

/* ── Per-finding list — the recovered text IS the proof ─────────────────── */
.xray-findings { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.xray-finding {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.xray-finding:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.xray-finding-loc {
  flex: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-soft); background: var(--bg-soft); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.xray-finding-kind { font-size: 12.5px; color: var(--text-mute); }
.xray-finding-text {
  flex: 1 1 100%; margin: 2px 0 0;
  font-family: var(--font-mono, ui-monospace, 'SF Mono', Menlo, Consolas, monospace);
  font-size: 13px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere;
  background: color-mix(in srgb, var(--danger) 9%, var(--bg-soft));
  border-radius: var(--radius-sm, 8px); padding: 8px 10px;
}

/* ── Not-yet-redacted PII — CAUTION, not failure ────────────────────────────
   A failed redaction is red (it failed); info you simply haven't redacted yet
   is amber (an opportunity to fix before sending). No global amber token exists,
   so define one locally with a dark-mode variant that keeps contrast on dark
   surfaces. --xray-amber-solid is the badge fill (white text reads on it in both
   themes); --xray-amber tints surfaces/borders/labels. Meaning via tint, never a
   colored edge stripe. */
.xray-result-holder { --xray-amber: #b45309; --xray-amber-solid: #d97706; }
html[data-theme="dark"] .xray-result-holder { --xray-amber: #fbbf24; --xray-amber-solid: #d97706; }

.xray-hero.is-caution {
  background: linear-gradient(135deg, color-mix(in srgb, var(--xray-amber) 12%, var(--bg-elev)), var(--bg-elev));
}
.xray-hero.is-caution .xray-hero-count {
  background: linear-gradient(135deg, var(--xray-amber-solid), color-mix(in srgb, var(--xray-amber-solid) 72%, #7c2d12));
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--xray-amber-solid) 60%, transparent);
}
.xray-hero-exposed { color: var(--xray-amber); font-size: 13.5px; font-weight: 600; }

.xray-section { margin: 0 0 18px; }
.xray-section-head { margin-bottom: 10px; }
.xray-section-head h3 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.xray-section-head p { color: var(--text-soft); font-size: 13px; margin-top: 2px; }

.xray-exposed-tier { margin-bottom: 12px; }
.xray-exposed-tier-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-mute); margin-bottom: 6px;
}
.xray-exposed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.xray-exposed-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.xray-exposed-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.xray-exposed-count {
  flex: none; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px;
  display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800;
  font-variant-numeric: tabular-nums; background: var(--xray-amber-solid);
}
.xray-exposed-row.is-review .xray-exposed-count { background: var(--text-mute); }
.xray-exposed-label { font-size: 14px; font-weight: 600; color: var(--text); }
.xray-exposed-ex { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.xray-exposed-ex code {
  font-family: var(--font-mono, ui-monospace, 'SF Mono', Menlo, Consolas, monospace);
  font-size: 12px; color: var(--text);
  background: color-mix(in srgb, var(--xray-amber) 12%, var(--bg-soft));
  border: 1px solid color-mix(in srgb, var(--xray-amber) 22%, var(--border));
  border-radius: var(--radius-sm); padding: 2px 7px;
  white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis;
}
.xray-exposed-row.is-review .xray-exposed-ex code { background: var(--bg-soft); border-color: var(--border); }
.xray-redact-cta { margin-top: 2px; }
.xray-redact-cta:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ── Report action bar ──────────────────────────────────────────────────── */
.xray-actionbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
.xray-actionbar .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
