/* ClawVet Playground. Color is reserved for risk signal; chrome stays neutral. */

:root {
  --bg: #09090b;
  --panel: #0f0f12;
  --raised: #15151a;
  --sunken: #0b0b0e;
  --border: #23232a;
  --border-strong: #32323b;
  --text: #ededf0;
  --text-2: #a8a8b3;
  --muted: #6f6f7b;
  --primary-bg: #ededf0;
  --primary-fg: #09090b;
  --focus: #6aa1ff;
  --hl: rgba(250, 204, 21, 0.13);
  --hl-edge: #facc15;

  --sev-critical: #f43f5e;
  --sev-high: #fb923c;
  --sev-medium: #facc15;
  --sev-low: #60a5fa;
  --ok: #34d399;
  --flow: #a78bfa;

  --grade-A: #34d399;
  --grade-B: #a3e635;
  --grade-C: #facc15;
  --grade-D: #fb923c;
  --grade-F: #f43f5e;

  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --radius: 10px;
  --radius-sm: 6px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --code-size: 12.5px;
  --code-lh: 20px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f7f7f8;
  --panel: #ffffff;
  --raised: #fafafb;
  --sunken: #f4f4f6;
  --border: #e4e4e8;
  --border-strong: #d2d2d9;
  --text: #17171c;
  --text-2: #4c4c57;
  --muted: #7d7d89;
  --primary-bg: #17171c;
  --primary-fg: #ffffff;
  --focus: #2563eb;
  --hl: rgba(234, 179, 8, 0.16);
  --hl-edge: #ca8a04;

  --sev-critical: #e11d48;
  --sev-high: #ea580c;
  --sev-medium: #ca8a04;
  --sev-low: #2563eb;
  --ok: #059669;
  --flow: #7c3aed;

  --grade-A: #059669;
  --grade-B: #65a30d;
  --grade-C: #ca8a04;
  --grade-D: #ea580c;
  --grade-F: #e11d48;

  --shadow: 0 1px 2px rgba(16, 16, 24, 0.04), 0 8px 24px -16px rgba(16, 16, 24, 0.18);
  color-scheme: light;
}

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

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a { color: inherit; }
code, kbd, pre { font-family: var(--mono); }
code { font-size: 0.92em; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }

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

.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;
}

.wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 720px) {
  .wrap { padding: 0 28px; }
}

/* ───────── Top bar ───────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark { color: var(--text); }
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -0.02em; }
.brand-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 7px;
}

.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s, background-color 0.15s;
}
.topnav a:hover { color: var(--text); background: var(--raised); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--raised); }
:root[data-theme="dark"] .ico-moon,
:root[data-theme="light"] .ico-sun { display: none; }

@media (max-width: 520px) {
  .topnav a:not(.nav-gh) { display: none; }
  .brand-tag { display: none; }
}

/* ───────── Intro ───────── */

.intro { padding-top: 36px; padding-bottom: 22px; }
.intro h1 {
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
  max-width: 22ch;
}
.intro h1 em { font-style: normal; color: var(--text-2); }
.lede {
  margin: 12px 0 0;
  max-width: 76ch;
  color: var(--text-2);
  font-size: 15px;
}
.lede code { color: var(--text); }

/* ───────── Buttons ───────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s, transform 0.05s;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; gap: 6px; }

.btn-primary { background: var(--primary-bg); color: var(--primary-fg); }
.btn-primary:hover { opacity: 0.9; }
.btn-primary kbd {
  font-size: 11px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--primary-fg) 22%, transparent);
  opacity: 0.7;
}

.btn-secondary {
  background: var(--raised);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-secondary:hover { border-color: var(--muted); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--raised); }

/* ───────── Workbench ───────── */

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (min-width: 1024px) {
  .workbench { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; }
  .pane-source {
    position: sticky;
    top: 68px;
  }
}

.pane {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px;
}

@media (min-width: 720px) {
  .pane { padding: 18px; }
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pane-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pane-title h2 { font-size: 14px; font-weight: 600; }
.step {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  border: 1px solid var(--border-strong);
}
.source-label {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 34ch;
}

.privacy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ok);
}
.privacy span { color: var(--text-2); }

/* URL bar */

.url-bar {
  position: relative;
  display: flex;
  gap: 8px;
}
.url-ico { position: absolute; left: 11px; top: 11px; color: var(--muted); pointer-events: none; }
.url-bar input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 12px 0 33px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--sunken);
  color: var(--text);
  font: inherit;
  font-family: var(--mono);
  font-size: 12.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.url-bar input::placeholder { color: var(--muted); }
.url-bar input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }

/* Samples */

.samples {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0;
}
.samples-label {
  flex: none;
  padding-top: 7px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.sample-list { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }

.sample-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--raised);
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.sample-pill:hover { color: var(--text); border-color: var(--border-strong); }
.sample-pill[aria-pressed="true"] { color: var(--text); border-color: var(--text-2); background: var(--panel); }
.sample-pill .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--muted); }
.sample-pill[data-tone="safe"] .dot { background: var(--grade-A); }
.sample-pill[data-tone="danger"] .dot { background: var(--grade-F); }
.sample-pill .intent { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sample-pill .name { white-space: nowrap; font-weight: 550; }

@media (max-width: 640px) {
  .samples { flex-direction: column; gap: 6px; }
  .samples-label { padding-top: 0; }
  .sample-pill .intent { display: none; }
}

/* Editor */

.editor {
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--sunken);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.editor:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }

.editor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 4px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--raised);
}
.editor-filename {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.editor-actions { display: flex; gap: 2px; flex: none; }

.editor-body {
  display: flex;
  height: clamp(300px, 52vh, 560px);
}

.gutter {
  flex: none;
  margin: 0;
  padding: 12px 10px 48px 12px;
  min-width: 44px;
  text-align: right;
  font-size: var(--code-size);
  line-height: var(--code-lh);
  color: var(--muted);
  opacity: 0.75;
  border-right: 1px solid var(--border);
  overflow: hidden;
  user-select: none;
  white-space: pre;
}

.code-area { position: relative; flex: 1; min-width: 0; }

.code-area textarea {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  resize: none;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: var(--code-size);
  line-height: var(--code-lh);
  white-space: pre;
  overflow: auto;
  tab-size: 2;
  caret-color: var(--text);
  z-index: 1;
}
.code-area textarea:focus { outline: none; }
.code-area textarea::placeholder { color: var(--muted); }

.line-hl {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--code-lh);
  background: var(--hl);
  box-shadow: inset 2px 0 0 var(--hl-edge);
  pointer-events: none;
  z-index: 0;
  animation: hl-in 0.5s ease;
}
@keyframes hl-in { from { background: color-mix(in srgb, var(--hl-edge) 35%, transparent); } }

.drop-zone {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(2px);
  border: 1.5px dashed var(--focus);
  border-radius: var(--radius);
}
.drop-zone[hidden] { display: none; }
.drop-card { display: grid; justify-items: center; gap: 6px; color: var(--text); text-align: center; }
.drop-card span { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); }

/* Scan row */

.scan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.scan-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.counter { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.status {
  font-size: 12.5px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status[data-tone="busy"] { color: var(--text); }
.status[data-tone="busy"]::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  border-top-color: var(--text);
  vertical-align: -1px;
  animation: spin 0.7s linear infinite;
}
.status[data-tone="ok"] { color: var(--ok); }
.status[data-tone="error"] { color: var(--sev-critical); white-space: normal; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────── Verdict pane ───────── */

.engine {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}
.engine-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.engine[data-state="loading"] .engine-dot { background: var(--sev-medium); animation: pulse 1s ease-in-out infinite; }
.engine[data-state="ready"] .engine-dot { background: var(--ok); }
.engine[data-state="flow"] { color: var(--flow); }
.engine[data-state="flow"] .engine-dot { background: var(--flow); box-shadow: 0 0 0 3px color-mix(in srgb, var(--flow) 22%, transparent); }
.engine[data-state="error"] .engine-dot { background: var(--sev-critical); }
@keyframes pulse { 50% { opacity: 0.35; } }

.empty-state {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.empty-state p { margin: 0; max-width: 36ch; }
.empty-grade {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 6px solid var(--border);
  font-weight: 700;
  font-size: 22px;
  color: var(--muted);
}

.results { display: grid; gap: 12px; }
.results[hidden] { display: none; }
.results.is-fresh > .card { animation: rise 0.35s ease both; }
.results.is-fresh > .card:nth-child(2) { animation-delay: 0.04s; }
.results.is-fresh > .card:nth-child(3) { animation-delay: 0.08s; }
.results.is-fresh > .card:nth-child(4) { animation-delay: 0.12s; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--raised);
  padding: 14px;
  min-width: 0;
}
@media (min-width: 720px) { .card { padding: 16px; } }

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.card-head h3 { font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.card-sub { font-size: 12px; color: var(--muted); }
.count-pill {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0 7px;
}

/* Verdict card */

.verdict-card {
  --g: var(--grade-A);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  border-color: color-mix(in srgb, var(--g) 35%, var(--border));
  background:
    linear-gradient(color-mix(in srgb, var(--g) 6%, transparent), transparent 70%),
    var(--raised);
}
.verdict-card[data-grade="B"] { --g: var(--grade-B); }
.verdict-card[data-grade="C"] { --g: var(--grade-C); }
.verdict-card[data-grade="D"] { --g: var(--grade-D); }
.verdict-card[data-grade="F"] { --g: var(--grade-F); }

@media (max-width: 460px) {
  .verdict-card { grid-template-columns: minmax(0, 1fr); justify-items: start; }
}

.gauge-wrap { position: relative; width: 128px; height: 128px; }
.gauge { width: 100%; height: 100%; }
.gauge .track { stroke: var(--border); }
.gauge .fill { stroke: var(--g); transition: stroke-dashoffset 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.gauge .tick { stroke: var(--border-strong); }
.gauge-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  line-height: 1;
}
.grade-letter { font-size: 46px; font-weight: 700; letter-spacing: -0.04em; color: var(--g); }
.grade-caption {
  margin-top: 4px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.verdict-body { min-width: 0; width: 100%; }
.verdict-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.verdict-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  --v: var(--ok);
  color: var(--v);
  background: color-mix(in srgb, var(--v) 13%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--v) 35%, transparent);
}
.verdict-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.verdict-pill[data-verdict="warn"] { --v: var(--sev-medium); }
.verdict-pill[data-verdict="block"] { --v: var(--sev-critical); }
.score { font-family: var(--mono); font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.score span { font-size: 11.5px; font-weight: 500; color: var(--muted); margin-left: 2px; }

.skill-name {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 650;
  font-family: var(--mono);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.verdict-summary { margin: 2px 0 12px; color: var(--text-2); font-size: 13px; }

.sev-bar {
  display: flex;
  gap: 2px;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--border);
}
.sev-bar i { display: block; height: 100%; min-width: 4px; transition: flex-grow 0.4s ease; }
.sev-bar i[data-sev="critical"] { background: var(--sev-critical); }
.sev-bar i[data-sev="high"] { background: var(--sev-high); }
.sev-bar i[data-sev="medium"] { background: var(--sev-medium); }
.sev-bar i[data-sev="low"] { background: var(--sev-low); }
.sev-bar i[data-sev="none"] { background: color-mix(in srgb, var(--ok) 55%, transparent); }

.sev-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--text-2);
}
.sev-legend li { display: inline-flex; align-items: center; gap: 6px; }
.sev-legend li i { width: 8px; height: 8px; border-radius: 2px; }
.sev-legend b { font-family: var(--mono); font-weight: 600; color: var(--text); }
.sev-legend li[data-zero="true"] { opacity: 0.45; }
.sev-legend [data-sev="critical"] i { background: var(--sev-critical); }
.sev-legend [data-sev="high"] i { background: var(--sev-high); }
.sev-legend [data-sev="medium"] i { background: var(--sev-medium); }
.sev-legend [data-sev="low"] i { background: var(--sev-low); }

.verdict-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}
.df-flag { display: inline-flex; align-items: center; gap: 5px; color: var(--flow); }
.df-flag[hidden] { display: none; }

/* Permissions */

.perm-grid { display: grid; gap: 8px; }
.perm-group {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.perm-group:first-child { border-top: 0; padding-top: 0; }
@media (max-width: 560px) {
  .perm-group { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
.perm-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text);
  padding-top: 3px;
}
.perm-label svg { flex: none; color: var(--text-2); }
.perm-group[data-tone="danger"] .perm-label svg { color: var(--sev-critical); }
.perm-group[data-tone="warn"] .perm-label svg { color: var(--sev-high); }
.perm-label .n { font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 400; }

.perm-items { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.perm-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 4px 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}
.perm-item .v { overflow-wrap: anywhere; }
.perm-item:not(:has(.line-chip)) { padding-right: 9px; }
.perm-item[data-tone="danger"] {
  border-color: color-mix(in srgb, var(--sev-critical) 45%, var(--border));
  background: color-mix(in srgb, var(--sev-critical) 8%, var(--panel));
}
.perm-item[data-tone="warn"] {
  border-color: color-mix(in srgb, var(--sev-high) 40%, var(--border));
  background: color-mix(in srgb, var(--sev-high) 7%, var(--panel));
}
.perm-item[data-tone="safe"] { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }

.perm-more {
  height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.perm-more:hover { color: var(--text); border-color: var(--muted); }

.tag {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0 5px;
  border-radius: 4px;
  line-height: 16px;
  white-space: nowrap;
}
.tag-risky, .tag-undeclared { color: var(--sev-critical); background: color-mix(in srgb, var(--sev-critical) 14%, transparent); }
.tag-declared { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }

.empty-ok {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 13px;
}
.empty-ok svg { color: var(--ok); flex: none; }

/* Line chip */

.line-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--raised);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
.line-chip:hover { color: var(--text); border-color: var(--hl-edge); background: var(--hl); }

/* Findings */

.findings { display: grid; gap: 8px; }

.finding {
  --s: var(--sev-low);
  position: relative;
  padding: 12px 12px 12px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}
.finding::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--s);
}
.finding[data-sev="critical"] { --s: var(--sev-critical); }
.finding[data-sev="high"] { --s: var(--sev-high); }
.finding[data-sev="medium"] { --s: var(--sev-medium); }

.finding-head { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.sev-badge {
  flex: none;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 1px;
  color: var(--s);
  background: color-mix(in srgb, var(--s) 13%, transparent);
}
.finding-title { flex: 1 1 200px; min-width: 0; font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }
.finding-meta { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.pass-badge {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.pass-badge[data-pass="dataflow"] {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--flow);
  border-color: color-mix(in srgb, var(--flow) 45%, transparent);
  background: color-mix(in srgb, var(--flow) 12%, transparent);
  font-weight: 600;
}
.conf { font-family: var(--mono); font-size: 11px; color: var(--muted); }

.finding-desc { margin: 6px 0 0; color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }

.finding-evidence {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--sunken);
  border: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 140px;
  overflow: auto;
}

.finding-fix {
  display: flex;
  gap: 7px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-2);
}
.finding-fix svg { flex: none; margin-top: 2px; color: var(--ok); }
.finding-fix > span { min-width: 0; overflow-wrap: anywhere; }
.finding-fix b { color: var(--text); font-weight: 600; }

/* Share */

.share-card .card-head { align-items: center; }
.badge-img { height: 20px; display: block; }
.copy-field { display: flex; gap: 8px; }
.copy-field + .copy-field { margin-top: 8px; }
.copy-field[hidden] { display: none; }
.copy-field input {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--sunken);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11.5px;
}
.copy-field input:focus { outline: none; border-color: var(--focus); }
.hint { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.hint[hidden] { display: none; }

/* ───────── CTA ───────── */

.cta {
  display: grid;
  gap: 18px;
  align-items: center;
  margin-top: 48px;
}
@media (min-width: 960px) {
  .cta { grid-template-columns: minmax(0, 1fr) auto; gap: 32px; }
}
.cta h2 { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.cta p { margin: 8px 0 0; color: var(--text-2); max-width: 68ch; }
.cta p code { color: var(--text); }

.cli {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.cli-prompt { font-family: var(--mono); color: var(--muted); user-select: none; }
.cli code {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.cli code::-webkit-scrollbar { display: none; }

/* ───────── Proof strip ───────── */

.proof { margin-top: 40px; }
.proof-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.proof-head h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
.proof-head a { font-size: 13px; color: var(--text-2); text-decoration: none; }
.proof-head a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

.proof-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 860px) {
  .proof-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); }
  .proof-grid .stat + .stat { border-left: 1px solid var(--border); }
}
.stat { padding: 18px 0; display: grid; gap: 6px; align-content: start; }
.stat + .stat { border-top: 1px solid var(--border); }
@media (min-width: 860px) {
  .stat { padding: 18px 24px; }
  .stat:first-child { padding-left: 0; }
  .stat + .stat { border-top: 0; }
}
.stat-label { font-size: 12px; color: var(--muted); }
.stat-figs { font-size: 13px; color: var(--text-2); }
.stat-figs b { font-family: var(--mono); font-size: 22px; font-weight: 650; color: var(--text); letter-spacing: -0.03em; }
.stat-figs .sep { color: var(--muted); margin: 0 4px; }
.stat-figs .small { font-size: 12.5px; }
.stat-note { font-size: 12px; color: var(--muted); }
.stat-note b { color: var(--text-2); font-family: var(--mono); }

.bench { list-style: none; margin: 6px 0 2px; padding: 0; display: grid; gap: 5px; }
.bench li {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-2);
}
.bench i {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--border-strong) var(--w), transparent var(--w));
  background-color: var(--sunken);
}
.bench li:first-child { color: var(--text); font-weight: 550; }
.bench li:first-child i { background: linear-gradient(to right, var(--text) var(--w), transparent var(--w)); background-color: var(--sunken); }
.bench em { font-style: normal; font-family: var(--mono); text-align: right; }

/* ───────── Footer ───────── */

.foot {
  display: flex;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
  margin-top: 32px;
  padding-top: 18px;
  padding-bottom: 32px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.foot a { color: var(--text-2); text-decoration: none; }
.foot a:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
