/* ─────────────────────────────────────────────────────────────────────────
 * Screen-specific styles
 * ─────────────────────────────────────────────────────────────────────── */

/* ── OVERVIEW ───────────────────────────────────────────────────────── */
.overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--space-6);
  align-items: start;
}
.overview__main {
  display: flex; flex-direction: column; gap: var(--space-6);
  min-width: 0;
}
.overview__rail {
  display: flex; flex-direction: column; gap: var(--space-4);
  position: sticky; top: 60px;
}

.exec-summary {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  font-size: var(--text-md);
}
.exec-summary p {
  max-width: 70ch;
  color: var(--ink-2);
  line-height: var(--line-loose);
  margin-bottom: var(--space-4);
  font-feature-settings: "ss01", "onum";
}
.exec-summary p:last-child { margin-bottom: 0; }
.exec-summary p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 3.4em;
  float: left;
  line-height: 0.85;
  margin: 4px var(--space-3) 0 0;
  color: var(--accent);
  font-weight: 400;
}
.exec-summary strong { color: var(--ink); font-weight: 600; }

.count-strip {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-2);
  margin-bottom: var(--space-3);
}
.count-strip strong { color: var(--ink); }

.headline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.headline-grid__cell {
  background: var(--paper);
  padding: var(--space-4);
}
.headline-grid__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--space-2);
}
.headline-grid__num {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
.headline-grid__num small {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-3);
  font-weight: normal;
}
.headline-grid__breakdown {
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-3);
  display: flex; flex-wrap: wrap; gap: var(--space-2);
}

/* posture summary by tier */
.tier-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}
.tier-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-4) var(--space-3);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.tier-card__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--ink);
}
.tier-card__row {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-3);
  border-top: 1px dotted var(--rule);
  padding-top: var(--space-1);
}
.tier-card__row > span:last-child { color: var(--ink); }
.tier-card__goals {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  margin-top: var(--space-1);
}

/* headline findings list (top 10) */
.headlines {
  display: flex; flex-direction: column;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--paper);
  overflow: hidden;
}
.headline-row {
  display: grid;
  grid-template-columns: 26px 90px 110px 1fr auto;
  align-items: start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: background 0.15s;
}
.headline-row:last-child { border-bottom: none; }
.headline-row:hover { background: var(--paper-2); }
.headline-row__rank {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--ink-3);
  font-weight: 400;
  font-feature-settings: "lnum";
}
.headline-row__id {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-3);
  padding-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.headline-row__title {
  font-family: var(--font-body);
  font-size: var(--text-md);
  color: var(--ink);
  line-height: 1.35;
}
.headline-row__title em { font-style: normal; color: var(--ink-3); }
.headline-row__chev {
  color: var(--ink-3); padding-top: 4px;
  transition: transform 0.15s;
}
.headline-row:hover .headline-row__chev { transform: translateX(2px); color: var(--ink); }

/* small rail cards */
.rail-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4) var(--space-4);
}
.rail-card__head {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--rule);
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-3);
  display: flex; justify-content: space-between; align-items: baseline;
}
.rail-card__head small {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  text-transform: none;
}
.rail-list {
  display: flex; flex-direction: column; gap: var(--space-2);
  list-style: none; margin: 0; padding: 0;
  font-size: var(--text-sm);
}
.rail-list li {
  display: flex; gap: var(--space-2); align-items: baseline;
  color: var(--ink-2);
}
.rail-list .mono { color: var(--ink); }

.bar {
  height: 4px;
  background: var(--paper-2);
  border-radius: 2px;
  overflow: hidden;
  display: flex;
}
.bar > span { display: block; height: 100%; }


/* ── FINDINGS — two-pane ────────────────────────────────────────────── */
.findings {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: var(--space-4);
  height: calc(100vh - 200px);
  min-height: 600px;
}
.findings--stacked { display: block; height: auto; }
.findings--table {
  display: block; height: auto;
}

.findings__pane {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  display: flex; flex-direction: column;
  min-height: 0; overflow: hidden;
}

.findings__toolbar {
  border-bottom: 1px solid var(--rule);
  padding: var(--space-3);
  display: flex; flex-direction: column; gap: var(--space-2);
  background: var(--paper);
}
.findings__search { position: relative; }
.findings__search .input { padding-left: 28px; font-size: var(--text-sm); }
.findings__search::before {
  content: "⌕"; position: absolute; left: 9px; top: 50%;
  transform: translateY(-50%); color: var(--ink-3);
  font-size: 14px; pointer-events: none;
}
.findings__filters {
  display: flex; flex-wrap: wrap; gap: var(--space-1);
}
.chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  padding: 3px var(--space-2);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  color: var(--ink-3);
  cursor: pointer;
  white-space: nowrap;
}
.chip:hover:not(:disabled) { background: var(--paper-2); color: var(--ink); }
.chip--active {
  background: var(--ink); color: var(--paper);
  border-color: var(--ink);
}
.findings__filter-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-right: var(--space-2);
  align-self: center;
}

.findings__count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-3);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--rule);
  background: var(--paper-2);
}
.findings__list {
  flex: 1; overflow-y: auto;
}

.finding-row {
  display: grid;
  grid-template-columns: 4px 1fr;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  position: relative;
  transition: background 0.1s;
}
.finding-row:hover { background: var(--paper-2); }
.finding-row--active { background: var(--accent-soft); }
.finding-row--active:hover { background: var(--accent-soft); }
.finding-row__rail {
  background: var(--ink-3);
}
.finding-row--critical .finding-row__rail { background: var(--sev-critical); }
.finding-row--high     .finding-row__rail { background: var(--sev-high); }
.finding-row--medium   .finding-row__rail { background: var(--sev-medium); }
.finding-row--low      .finding-row__rail { background: var(--sev-low); }
.finding-row--info     .finding-row__rail { background: var(--sev-info); }

.finding-row__body { padding: var(--space-3); min-width: 0; }
.finding-row__topline {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-3);
  margin-bottom: var(--space-1);
}
.finding-row__id { color: var(--ink-2); }
.finding-row__title {
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: var(--space-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.finding-row__meta {
  display: flex; gap: var(--space-2); align-items: center;
  flex-wrap: wrap;
}

/* Findings detail */
.finding-detail {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  display: flex; flex-direction: column;
  height: 100%; min-height: 0; overflow: hidden;
}
.finding-detail__head {
  padding: var(--space-5) var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--rule);
}
.finding-detail__head-row {
  display: flex; gap: var(--space-3); align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-3);
}
.finding-detail__id { font-size: var(--text-md); color: var(--ink); }
.finding-detail__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: 1.2;
  margin-bottom: var(--space-3);
  text-wrap: pretty;
}
.finding-detail__chips {
  display: flex; gap: var(--space-2); flex-wrap: wrap;
}
.finding-detail__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5) var(--space-6) var(--space-6);
}
.finding-detail__block {
  margin-bottom: var(--space-5);
}
.finding-detail__block:last-child { margin-bottom: 0; }
.finding-detail__block-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--rule);
}
.finding-detail__block-body p {
  max-width: 72ch;
  line-height: var(--line-loose);
  color: var(--ink-2);
}
.finding-detail__evidence {
  display: flex; flex-direction: column; gap: var(--space-3);
}
.evidence-item {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: var(--space-3);
  font-size: var(--text-sm);
  background: var(--paper-2);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  border-left: 2px solid var(--rule-strong);
}
.evidence-item__where {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-3);
  /* Long, space-less code_recon locators (code:a.b.c:L1-L2@<sha>) must wrap
     inside the grid track rather than overflow into the excerpt column. */
  min-width: 0;
  overflow-wrap: anywhere;
}
.evidence-item__where strong { color: var(--ink); font-weight: 500; }
.evidence-item__excerpt {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-2);
  line-height: 1.5;
  min-width: 0;
  overflow-wrap: anywhere;
}
.recommendation {
  background: var(--paper-2);
  border-left: 3px solid var(--accent);
  padding: var(--space-3) var(--space-4);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.recommendation__posture {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: var(--space-1);
}
.tagrow {
  display: flex; flex-wrap: wrap; gap: var(--space-1);
}
.mapping-group {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-2);
  align-items: start;
}
.mapping-group dt {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 4px;
}

/* Stacked variant — full detail blocks for each finding */
.findings-stack {
  display: flex; flex-direction: column; gap: var(--space-4);
}
.findings-stack .finding-detail { height: auto; }
.findings-stack .finding-detail__body { overflow: visible; }

/* Table variant */
.findings-table-wrap {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.findings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.findings-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: var(--space-3) var(--space-4);
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
}
.findings-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  color: var(--ink-2);
}
.findings-table tr:hover td { background: var(--paper-2); }
.findings-table td.mono { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink); }

/* ── CAPABILITIES ────────────────────────────────────────────────────── */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}
.cap-tier {
  display: flex; flex-direction: column; gap: var(--space-3);
}
.cap-tier__head {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: var(--space-2);
}
.cap-goal {
  display: flex; flex-direction: column; gap: var(--space-2);
}
.cap-goal__head {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  display: flex; justify-content: space-between;
  padding-top: var(--space-2);
}
.cap-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  display: grid;
  grid-template-columns: 4px 1fr;
  gap: var(--space-3);
}
.cap-card__rail {
  background: var(--sev-low);
  border-radius: 2px;
}
.cap-card--designed .cap-card__rail      { background: var(--sev-info); }
.cap-card--tested .cap-card__rail        { background: var(--sev-low); }
.cap-card--implemented .cap-card__rail   { background: var(--ink-3); }
.cap-card--merged { border-color: var(--accent); }
.cap-card__title {
  font-size: var(--text-sm);
  color: var(--ink);
  margin-bottom: var(--space-1);
  line-height: 1.35;
  font-weight: 500;
}
.cap-card__id {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  margin-bottom: var(--space-2);
}
.cap-card__scope {
  font-size: var(--text-xs);
  color: var(--ink-2);
  line-height: 1.5;
}
.cap-card__foot {
  margin-top: var(--space-2);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
}
.cap-card__lenses {
  display: flex; gap: 2px; flex-wrap: wrap;
}
.cap-card__lens-pill {
  font-family: var(--font-mono);
  font-size: 9.5px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0 4px;
  border-radius: 2px;
  letter-spacing: 0.02em;
}

/* Strengths-with-caveats */
.strength {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--sev-medium);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}
.strength__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: var(--space-2); flex-wrap: wrap; gap: var(--space-2);
}
.strength__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
}
.strength__caveats {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: var(--space-2);
}
.strength__caveats li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--ink-2);
  line-height: 1.5;
}
.strength__caveats li::before {
  content: "—";
  color: var(--sev-medium);
  font-family: var(--font-mono);
  padding-top: 1px;
}
.strength__caveats li > span:first-of-type { display: none; }

/* ── COVERAGE ────────────────────────────────────────────────────────── */
.cov-tabs {
  display: flex; gap: var(--space-2);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--space-5);
}
.cov-tab {
  padding: var(--space-2) var(--space-4);
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.cov-tab:hover { color: var(--ink); }
.cov-tab--active { color: var(--ink); border-bottom-color: var(--accent); }

.nist-table, .attack-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: var(--text-sm);
}
.nist-table th, .attack-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--rule);
  color: var(--ink-3);
  background: var(--paper-2);
}
.nist-table td, .attack-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  color: var(--ink-2);
}
.nist-table tr:last-child td, .attack-table tr:last-child td { border-bottom: none; }
.nist-table tr:hover td, .attack-table tr:hover td { background: var(--paper-2); }
.nist-table .num, .attack-table .num {
  font-family: var(--font-mono);
  color: var(--ink);
  text-align: right;
}
.coverage-bar {
  display: flex; height: 6px; background: var(--paper-2);
  border-radius: 3px; overflow: hidden;
  min-width: 100px;
}
.coverage-bar span { display: block; height: 100%; }
.coverage-bar .seg-covered { background: var(--cell-covered); }
.coverage-bar .seg-both    { background: var(--cell-both); }
.coverage-bar .seg-gapped  { background: var(--cell-gapped); }

.cov-cell {
  display: inline-block;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}
.cov-cell--covered { background: var(--cell-covered); color: var(--cell-covered-text); }
.cov-cell--gapped  { background: var(--cell-gapped); color: var(--cell-gapped-text); }
.cov-cell--both    { background: var(--cell-both); color: var(--cell-both-text); }
.cov-cell--silent  { background: var(--cell-silent); color: var(--cell-silent-text); }

/* APD matrix */
.apd-matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.apd-matrix th, .apd-matrix td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  font-size: var(--text-sm);
}
.apd-matrix th:last-child, .apd-matrix td:last-child { border-right: none; }
.apd-matrix tr:last-child td { border-bottom: none; }
.apd-matrix th {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: center;
  background: var(--paper-2);
}
.apd-matrix th:first-child, .apd-matrix td:first-child {
  text-align: left;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--ink);
  font-weight: normal;
  background: var(--paper-2);
  position: sticky; left: 0;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  min-width: 220px;
}
.apd-matrix td:first-child { background: var(--paper); }
.apd-matrix td { text-align: center; }
.matrix-cell {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; height: 28px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  border-radius: 2px;
  letter-spacing: 0.02em;
}
.matrix-cell--covered { background: var(--cell-covered); color: var(--cell-covered-text); }
.matrix-cell--gapped  { background: var(--cell-gapped); color: var(--cell-gapped-text); }
.matrix-cell--both    { background: var(--cell-both); color: var(--cell-both-text); }
.matrix-cell--partial { background: var(--cell-both); color: var(--cell-both-text); }
.matrix-cell--silent  { background: var(--cell-silent); color: var(--cell-silent-text); opacity: 0.6; }

.legend {
  display: flex; gap: var(--space-4); flex-wrap: wrap;
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-3);
}
.legend__swatch {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 2px;
  margin-right: var(--space-2);
  vertical-align: -3px;
}

/* ── ANNEXES ────────────────────────────────────────────────────────── */
.annex {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}
.annex__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: var(--space-4); gap: var(--space-2);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--rule);
}
.contradiction {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px dashed var(--rule);
}
.contradiction:last-child { border-bottom: none; }
.contradiction__col {
  display: flex; flex-direction: column; gap: var(--space-2);
}
.contradiction__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.contradiction__assertion {
  font-size: var(--text-sm);
  color: var(--ink-2);
  line-height: var(--line-body);
}
.contradiction__resolution {
  grid-column: 1 / -1;
  margin-top: var(--space-2);
  padding: var(--space-3);
  background: var(--paper-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--ink-2);
  line-height: var(--line-body);
  border-left: 2px solid var(--accent);
}
.contradiction__id {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-3);
  grid-column: 1 / -1;
  margin-bottom: var(--space-1);
}

.sev-disagreement {
  padding: var(--space-3) 0;
  border-bottom: 1px dashed var(--rule);
}
.sev-disagreement:last-child { border-bottom: none; }
.sev-disagreement__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: var(--space-3); gap: var(--space-3);
}
.sev-disagreement__lenses {
  display: grid; grid-template-columns: 1fr auto; gap: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--paper-2);
  border-radius: var(--radius-sm);
}
.sev-disagreement__lenses dt {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
.sev-disagreement__lenses dd { margin: 0; }
.sev-disagreement__rationale {
  font-size: var(--text-sm);
  color: var(--ink-2);
  line-height: var(--line-body);
  font-style: italic;
}

/* ── NEXT STEPS ─────────────────────────────────────────────────────── */
.next-steps {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: var(--space-3);
}
.next-step {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: var(--space-3);
  align-items: start;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}
.next-step__rank {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--ink-3);
  line-height: 1;
}
.next-step__text {
  font-size: var(--text-md);
  line-height: var(--line-body);
  color: var(--ink-2);
}
.next-step__refs {
  display: flex; flex-direction: column; gap: 2px;
  align-items: flex-end;
}

/* utility */
.empty-state {
  padding: var(--space-6);
  text-align: center;
  color: var(--ink-3);
  font-size: var(--text-sm);
}
.empty-state--info {
  text-align: left;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: color-mix(in srgb, var(--accent) 6%, var(--paper));
  color: var(--ink-2);
  line-height: var(--line-loose);
}

.copy-toast {
  position: fixed;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 200;
  box-shadow: var(--shadow-md);
  animation: copyToast 1.6s ease-out forwards;
}
@keyframes copyToast {
  0%   { opacity: 0; transform: translateX(-50%) translateY(6px); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  85%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-4px); }
}

/* =====================================================================
   Attack Paths tab
   ===================================================================== */
.attack-paths {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.attack-paths__section-h {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
  color: var(--ink);
}
.report-graph__wrapper {
  position: relative;  /* anchor for the absolute-positioned toolbar */
}
.report-graph__toolbar {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  background: var(--paper);
  border: 1px solid var(--border-2);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  z-index: 2;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
.report-graph__toolbar button {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 3px;
  font: inherit;
  line-height: 1;
}
.report-graph__toolbar button:hover {
  background: var(--surface-2);
}
.report-graph__toolbar button:disabled {
  color: var(--ink-3);
  cursor: not-allowed;
}
.report-graph__toolbar .zoom-level {
  min-width: 44px;
  text-align: center;
  color: var(--ink-2);
}
.report-graph__canvas {
  width: 100%;
  height: 520px;
  background: var(--paper);
  border: 1px solid var(--border-2);
  border-radius: 8px;
}
.report-graph__tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 3px;
  max-width: 280px;
}
.attack-pair {
  border: 1px solid var(--border-2);
  border-radius: 6px;
  margin-bottom: var(--space-2);
  padding: var(--space-3);
}
.attack-pair > summary { cursor: pointer; display: flex; gap: var(--space-3); align-items: center; }
.attack-pair__arrow { color: var(--ink-3); }
.attack-pair__count {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--ink-3);
}
.attack-pair__paths { list-style: none; padding: var(--space-3) 0 0 0; margin: 0; }
.attack-path { border-left: 3px solid var(--border-2); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-2); }
.attack-path--high { border-left-color: var(--sev-high); }
.attack-path--medium { border-left-color: var(--sev-medium); }
.attack-path--low { border-left-color: var(--sev-low); }
.attack-path__head {
  display: flex; gap: var(--space-3);
  font-size: var(--text-xs); color: var(--ink-2);
  margin-bottom: var(--space-2);
}
.attack-path__edges { list-style: none; padding-left: var(--space-3); margin: 0; }
.attack-path__edges li { font-size: var(--text-xs); padding: 2px 0; }
.attack-path__edge--bottleneck { color: var(--sev-high); font-weight: 600; }
.overlay-card { border: 1px solid var(--border-2); border-radius: 6px; padding: var(--space-3); margin-bottom: var(--space-3); }
.overlay-card__head { display: flex; justify-content: space-between; margin-bottom: var(--space-2); font-size: var(--text-sm); }
.overlay-card__row { display: flex; gap: var(--space-3); margin-bottom: var(--space-2); align-items: flex-start; }
.overlay-card__label { min-width: 140px; font-size: var(--text-xs); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }

/* ── FINDINGS LAYOUT SELECT ─────────────────────────────────────────── */
.findings__layout-select {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--ink-2);
}
.findings__layout-select select {
  font: inherit;
  background: var(--surface-1);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 4px;
}

/* ── Start-here reading guide ───────────────────────────────────────── */
.guide {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--space-6);
  align-items: start;
}
.guide__rail {
  position: sticky;
  top: 60px;
  align-self: start;
}
.guide__chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-3);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-4);
}
.guide__chip strong { color: var(--ink); }
.guide__anchors { display: flex; flex-direction: column; gap: 2px; }
.guide__anchor {
  text-align: left;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  padding: var(--space-1) var(--space-2);
  color: var(--ink-3);
  font: inherit;
  cursor: pointer;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.guide__anchor:hover { color: var(--ink); background: var(--paper-2); }
.guide__anchor--active {
  color: var(--ink);
  font-weight: 600;
  border-left-color: var(--accent);
  background: var(--accent-soft);
}
.guide__content { min-width: 0; }
.guide__section {
  padding-bottom: var(--space-6);
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--rule);
}
.guide__section:last-child { border-bottom: none; margin-bottom: 0; }
.guide__lead {
  color: var(--ink-2);
  line-height: var(--line-loose);
  max-width: 72ch;
  margin-bottom: var(--space-4);
}
.guide__pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.guide__pillar { padding: var(--space-3); }
.guide__pillar-title {
  font-family: var(--font-display);
  font-size: var(--text-md);
  margin: 0 0 var(--space-2);
}
.guide__pillar ul { margin: 0; padding-left: var(--space-4); color: var(--ink-2); }
.guide__subhead {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin: 0 0 var(--space-2);
}
.guide__tabmap {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-1) var(--space-4);
  max-width: 72ch;
  margin: 0;
}
.guide__tabmap dt { font-weight: 600; color: var(--ink); }
.guide__tabmap dd { margin: 0; color: var(--ink-2); }
.guide__note {
  margin-top: var(--space-3);
  color: var(--ink-2);
  font-size: var(--text-sm);
}
.guide-voc { border-collapse: collapse; width: 100%; max-width: 72ch; }
.guide-voc td {
  padding: var(--space-2);
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  color: var(--ink-2);
  line-height: var(--line-body);
}
.guide-voc td:first-child { white-space: nowrap; width: 1%; }
.guide-do { color: var(--ink-3); }
.guide-cell {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 1px var(--space-2);
  border-radius: var(--radius-sm);
}
.guide-cell--covered { background: var(--cell-covered); color: var(--cell-covered-text); }
.guide-cell--both { background: var(--cell-both); color: var(--cell-both-text); }
.guide__steps {
  color: var(--ink-2);
  line-height: var(--line-loose);
  max-width: 72ch;
  padding-left: var(--space-5);
}
.guide__steps li { margin-bottom: var(--space-2); }
.guide__link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}
.guide__roles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.guide__role { padding: var(--space-3); }
.guide__role h3 { font-family: var(--font-display); font-size: var(--text-md); margin: 0 0 var(--space-1); }
.guide__role p { margin: 0; color: var(--ink-2); line-height: var(--line-body); }
@media (max-width: 860px) {
  .guide { grid-template-columns: 1fr; }
  .guide__rail { position: static; }
  .guide__pillars, .guide__roles { grid-template-columns: 1fr; }
}

/* ── Per-finding attack-path strip ("subway map") ── */
.apath-strip { margin: 0; }
.apath-strip__head {
  display: flex; align-items: center; gap: var(--space-3);
  font-family: var(--font-mono); font-size: var(--text-xs);
  color: var(--ink-3); margin-bottom: var(--space-2); flex-wrap: wrap;
}
.apath-strip__pid {
  background: var(--paper-2); border: 1px solid var(--rule);
  border-radius: 3px; padding: 1px 5px; color: var(--ink-3);
}
.apath-strip__open {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--accent); font-size: var(--text-xs); padding: 0;
  text-decoration: underline; font-family: inherit;
}
.apath-strip__rail {
  display: flex; align-items: center; overflow-x: auto;
  padding: 40px 4px 38px;
  gap: 0; min-height: 120px;
}
.apath-strip__station {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; flex: 0 0 auto; max-width: 96px; text-align: center;
}
.apath-strip__dot { border-radius: 50%; flex: 0 0 auto; }
.apath-strip__name {
  font-size: 11px; color: var(--ink); line-height: 1.15; word-break: break-word;
}
.apath-strip__seg {
  position: relative; flex: 1 1 64px; min-width: 64px;
  display: flex; flex-direction: column; justify-content: center;
}
.apath-strip__line { border-radius: 3px; width: 100%; }
.apath-strip__above, .apath-strip__below {
  position: absolute; left: 50%; transform: translateX(-50%);
  max-width: 150px; white-space: normal; overflow-wrap: anywhere;
  line-height: 1.15; font-size: 10px; font-weight: 700; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.apath-strip__above { bottom: calc(50% + 6px); }
.apath-strip__below { top: calc(50% + 6px); }

/* ── C4 architecture scene ────────────────────────────────────────────── */
.c4-scene {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.c4-scene__section-h {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: var(--space-3) 0 var(--space-1);
}
.c4-banner {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}
.c4-banner__warn {
  color: var(--sev-high);
  font-weight: 600;
}
.c4-crumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-3);
}
.c4-crumbs__sep { color: var(--rule); }
.c4-crumbs__here { color: var(--ink); font-weight: 600; }
.c4-node-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.c4-node-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--paper);
}
/* not_analyzed: distinctly muted + striped — must NOT read as a clean container */
.c4-node-row--not-analyzed {
  background: repeating-linear-gradient(
    135deg,
    var(--paper-2),
    var(--paper-2) 6px,
    var(--paper) 6px,
    var(--paper) 12px
  );
  border-style: dashed;
  border-color: var(--ink-3);
  opacity: 0.85;
}
.c4-node-row__name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: none;
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
}
.c4-node-row__name:hover { color: var(--accent); }
.c4-level-chip {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--paper-2);
  color: var(--ink-3);
  border: 1px solid var(--rule);
  white-space: nowrap;
}
.c4-level-chip--container { color: var(--accent); border-color: var(--accent); }
.c4-level-chip--component { color: var(--ink-2); }
.c4-level-chip--code { color: var(--ink-3); }
/* EN2: C4-style typing chip — a small muted pill next to a node row carrying
   its container/code kind (service / data_store / external_system / function …).
   Distinct from the level chip (which carries the C4 tier) so a reader can see
   both the L1–L4 level AND the C4 element kind at a glance. */
.c4-kind-chip {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.02em;
  padding: 1px 5px;
  margin-left: var(--space-1);
  border-radius: 3px;
  background: var(--paper-2);
  color: var(--ink-3);
  border: 1px solid var(--rule);
  white-space: nowrap;
}
/* Two distinctive kinds get a subtle accent so they read at a glance; all
   other kinds use the muted default above (no per-kind rule required). */
.c4-kind-chip--data_store { color: var(--accent); border-color: var(--accent); }
.c4-kind-chip--external_system { border-style: dashed; }
.c4-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  color: var(--ink-3);
}
.c4-badge--finding {
  background: color-mix(in srgb, var(--sev-high) 15%, var(--paper));
  color: var(--sev-high);
  border-color: var(--sev-high);
  cursor: pointer;
}
.c4-badge--finding:hover { text-decoration: underline; }
.c4-badge--capability {
  background: color-mix(in srgb, var(--sev-low) 15%, var(--paper));
  color: var(--sev-low);
  border-color: var(--sev-low);
}
.c4-badge--clean { color: var(--ink-3); }
.c4-badge--not-analyzed {
  color: var(--ink-3);
  border-style: dashed;
  border-color: var(--ink-3);
  font-style: italic;
}

/* ── C4 attack-path overlay (stretch) ─────────────────────────────────── */
.c4-overlay {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-3);
}
.c4-overlay__label { color: var(--ink-2); }
.c4-overlay__select {
  font: inherit;
  padding: 2px 6px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  max-width: 28rem;
}
.c4-overlay-strip {
  border: 1px dashed var(--sev-high);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--sev-high) 6%, var(--paper));
  padding: var(--space-2) var(--space-3);
}
.c4-overlay-strip__head {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-2);
  margin-bottom: var(--space-2);
}
.c4-overlay-strip__hops {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.c4-overlay-strip__hop {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
}
.c4-overlay-strip__hop--unmapped {
  border-left: 3px solid var(--sev-high);
  padding-left: var(--space-2);
}
.c4-overlay-strip__arrow { color: var(--ink-3); }

/* ── C4 tiered scene (system-map) — lifted from the design-handoff prototype ──
   <style> block (.archx/.tier/.nb/.edge-layer), scoped under .c4-scene. Reuses
   the existing .c4-banner/.c4-crumbs/.c4-kind-chip/.chip rules above. All colors
   are tokens so light/dark/paper themes recolor live. */

.c4-scene .archx-stage-wrap {
  position: relative;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink-3) 18%, transparent) 1px, transparent 0);
  background-size: 22px 22px;
  background-color: var(--paper);
  overflow: auto;
  box-shadow: var(--shadow-md);
}
.c4-scene .archx-toolbar {
  position: absolute; top: var(--space-2); right: var(--space-2);
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 6px; background: var(--paper);
  border: 1px solid var(--rule); border-radius: 6px;
  box-shadow: var(--shadow-sm); z-index: 5;
  font-family: var(--font-mono); font-size: var(--text-xs);
}
.c4-scene .archx-toolbar button {
  appearance: none; background: transparent; border: none; color: var(--ink);
  cursor: pointer; padding: 2px 9px; border-radius: 3px; font: inherit; line-height: 1;
}
.c4-scene .archx-toolbar button:hover { background: var(--paper-2); }
.c4-scene .archx-toolbar .zoom-level { min-width: 42px; text-align: center; color: var(--ink-3); }

.c4-scene .archx-stage {
  position: relative;
  transform-origin: 0 0;
  width: 1120px;
  padding: var(--space-5) var(--space-5) var(--space-5) 0;
}

/* tiers */
.c4-scene .tier { position: relative; display: grid; grid-template-columns: 132px 1fr; }
.c4-scene .tier + .tier { margin-top: var(--space-3); }
.c4-scene .tier-gutter {
  position: relative;
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-4);
  display: flex; flex-direction: column; gap: 2px; justify-content: center;
  border-right: 1px dashed var(--rule-strong);
}
.c4-scene .tier-gutter .t-l1 { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; color: var(--accent); font-weight: 600; }
.c4-scene .tier-gutter .t-l2 { font-family: var(--font-display); font-size: 15px; color: var(--ink); line-height: 1.15; }
.c4-scene .tier-gutter .t-l3 { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-3); }
.c4-scene .tier-body { padding: var(--space-3) 0 var(--space-3) var(--space-4); position: relative; }

/* node boxes */
.c4-scene .nb {
  position: relative;
  box-sizing: border-box;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  padding: 8px 10px 7px;
  display: flex; flex-direction: column; gap: 5px;
  box-shadow: var(--shadow-sm);
  cursor: default;
  transition: border-color .14s, box-shadow .14s, transform .14s;
}
.c4-scene .nb__head { display: flex; align-items: center; gap: 6px; }
.c4-scene .nb__head:empty { display: none; }
.c4-scene .nb__kind {
  font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 1px 5px; border-radius: 3px;
  background: var(--paper-2); color: var(--ink-3); border: 1px solid var(--rule);
  white-space: nowrap;
}
.c4-scene .nb__name {
  font-family: var(--font-body); font-weight: 600; font-size: 12.5px; color: var(--ink);
  line-height: 1.25; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.c4-scene .nb__sub { color: var(--ink-3); font-size: 10.5px; font-family: var(--font-mono); }
.c4-scene .nb__badges { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.c4-scene .bdg {
  font-family: var(--font-mono); font-size: 10px; line-height: 1.4;
  padding: 1px 6px; border-radius: 3px; white-space: nowrap;
  border: 1px solid var(--rule); background: var(--paper-2); color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 3px;
}
.c4-scene .bdg--find {
  background: color-mix(in srgb, var(--sev-high) 14%, var(--paper));
  color: var(--sev-high); border-color: color-mix(in srgb, var(--sev-high) 55%, var(--rule));
}
.c4-scene .bdg--find[role="button"] { cursor: pointer; }
.c4-scene .bdg--find[role="button"]:hover { text-decoration: underline; }
.c4-scene .bdg--cap {
  background: color-mix(in srgb, var(--sev-low) 16%, var(--paper));
  color: var(--sev-low); border-color: color-mix(in srgb, var(--sev-low) 55%, var(--rule));
}
.c4-scene .bdg--clean { color: var(--ink-3); }
.c4-scene .bdg--na { color: var(--ink-3); border-style: dashed; border-color: var(--ink-3); font-style: italic; }

/* kind cues */
.c4-scene .nb--data_store { border-radius: var(--radius-md) var(--radius-md) 14px 14px; }
.c4-scene .nb--data_store .nb__kind { color: var(--accent); border-color: var(--accent); }
.c4-scene .nb--external,
.c4-scene .nb--external_dependency,
.c4-scene .nb--external_system { border-style: dashed; background: color-mix(in srgb, var(--paper-2) 60%, var(--paper)); }
.c4-scene .nb--external_party { border-style: dashed; }

.c4-scene .nb--hot { border-left: 3px solid color-mix(in srgb, var(--sev-high) 60%, var(--rule-strong)); }
.c4-scene .nb--clickable { cursor: pointer; }
.c4-scene .nb--clickable:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.c4-scene .nb--selected { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent), var(--shadow-md); }

/* not analyzed = striped + muted (never reads as clean) */
.c4-scene .nb--na {
  background: repeating-linear-gradient(135deg, var(--paper-2), var(--paper-2) 6px, var(--paper) 6px, var(--paper) 12px);
  border-style: dashed; border-color: var(--ink-3); opacity: 0.8; box-shadow: none;
}

/* system node (L1 centre) */
.c4-scene .nb--system { background: var(--accent); border-color: var(--accent); box-shadow: var(--shadow-md); }
.c4-scene .nb--system .nb__name { color: var(--bg); font-size: 14px; }
.c4-scene .nb--system .nb__kind { background: color-mix(in srgb, var(--bg) 20%, transparent); color: var(--bg); border-color: transparent; }
.c4-scene .nb--system .nb__sub { color: color-mix(in srgb, var(--bg) 85%, var(--accent)); }

/* L1 layout */
.c4-scene .l1-body { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--space-4); align-items: center; }
.c4-scene .l1-group { display: flex; flex-direction: column; gap: 5px; }
.c4-scene .l1-group__h { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 2px; }
.c4-scene .l1-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.c4-scene .l1-grid--ext { grid-template-columns: 1fr; }
.c4-scene .nb--mini { padding: 5px 8px; gap: 2px; }
.c4-scene .nb--mini .nb__name { font-size: 11px; font-weight: 500; -webkit-line-clamp: 2; }
.c4-scene .l1-center { display: flex; justify-content: center; }
.c4-scene .nb--system.nb--big { min-width: 188px; padding: 12px 16px; text-align: left; }

/* L2 backbone canvas */
.c4-scene .l2-backbone { position: relative; }
.c4-scene .l2-backbone .nb-pos { position: absolute; }
.c4-scene .l2-backbone .nb { width: 162px; }
.c4-scene .l2-cap {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3); margin: var(--space-3) 0 var(--space-2);
  display: flex; align-items: center; gap: var(--space-2);
}
.c4-scene .l2-cap::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* shelves */
.c4-scene .shelf { display: flex; flex-wrap: wrap; gap: 6px; }
.c4-scene .shelf .nb { width: auto; max-width: 220px; min-width: 132px; flex: 0 1 auto; }
.c4-scene .shelf--infra .nb { min-width: 0; }
.c4-scene .shelf .nb__name { -webkit-line-clamp: 1; }

/* L4 code tier */
.c4-scene .code-hint {
  font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-3);
  padding: var(--space-4) var(--space-4); border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-md); background: color-mix(in srgb, var(--paper-2) 50%, transparent);
}
.c4-scene .code-wrap { position: relative; }
.c4-scene .code-parent { margin-bottom: var(--space-3); }
.c4-scene .code-parent .nb { width: 220px; }
.c4-scene .code-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 7px; }
.c4-scene .code-grid .nb__name { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; -webkit-line-clamp: 2; }

/* edges (SVG overlay) */
/* Origin-positioned + sized by its width/height ATTRIBUTES (= the stage scroll
   box) so the viewBox maps to pixels 1:1. NOT inset:0/width:100%/height:100% —
   when the data-driven backbone overflows the fixed-width stage (scrollWidth >
   the stage's rendered width, .archx-stage-wrap then scrolls), a percentage size
   makes the rendered box differ from the viewBox and preserveAspectRatio
   ("xMidYMid meet") scales + centers every connector away from the un-scaled DOM
   boxes. See test_c4_edge_layer_svg_is_sized_one_to_one. */
.c4-scene .edge-layer { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; z-index: 1; }
.c4-scene .edge-layer path.edge { fill: none; stroke: var(--rule-strong); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.c4-scene .edge-layer path.edge.live { stroke: var(--accent); stroke-width: 2; }
.c4-scene .edge-layer .port { fill: var(--accent); }
.c4-scene .edge-layer marker path { fill: var(--accent); }
.c4-scene .edge-layer .elabel {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500; fill: var(--accent);
}
.c4-scene .edge-layer .elabel-bg { fill: var(--paper); opacity: 0.92; }
.c4-scene .nb[data-dim="1"] { opacity: 0.32; }

/* Attack-path overlay highlight (Task 8) — set-membership dim + induced live edges.
   Colors read from CSS vars (--accent) so the theme MutationObserver redraw in
   C4EdgeLayer recolors live — matching _graphStylesheet's getComputedStyle
   approach. .nb--dim is class-based (not inline opacity) so it composes with the
   tier styles; it sits beside the legacy .nb[data-dim="1"] attribute rule. */
.nb--dim {
  opacity: 0.32;
  filter: saturate(0.6);
  transition: opacity 0.15s ease;
}
.edge-layer__path--live {
  stroke: var(--accent);
  stroke-width: 2.5;
}
.edge-layer__port--live { fill: var(--accent); }
.edge-layer__arrow--live path { fill: var(--accent); }
