/* MCTS Security Dashboard — premium dark theme */

:root {
  --bg: #030712;
  --sidebar: #071326;
  --card: #0b1730;
  --card-elevated: #0f1d38;
  --border: rgba(255, 255, 255, 0.06);
  --primary: #2563eb;
  --accent: #3b82f6;
  --red: #ef4444;
  --orange: #f97316;
  --yellow: #facc15;
  --green: #22c55e;
  --text: #f8fafc;
  --muted: #94a3b8;
  --sidebar-width: 240px;
  --radius: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --grid-gap: 20px;
  --section-gap: 18px;
  --card-pad: 20px;
  --transition: 200ms ease;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image: radial-gradient(circle at top center, rgba(37, 99, 235, 0.15), transparent 60%);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  z-index: 100;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
  padding: 4px;
  border-radius: 12px;
}

.brand.card-interactive:hover,
.brand.card-interactive:focus-visible {
  background: rgba(255, 255, 255, 0.04);
}

.brand-logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.brand-logo img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
}

.brand-text h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-text p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
}

.nav-label {
  flex: 1;
}

.nav-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.25);
  color: #fecaca;
}

.nav-badge--ok {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.nav-item.active .nav-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.scan-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
  flex: 0 0 auto;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  flex: 0 0 auto;
}

.sidebar-footer .btn-download {
  margin-top: 0;
}

.scan-card h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.scan-meta {
  display: grid;
  gap: 8px;
}

.scan-meta dt {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

.scan-meta dd {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 500;
  word-break: break-all;
}

.btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.12);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-download:hover {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(59, 130, 246, 0.4);
}

.btn-download svg {
  width: 18px;
  height: 18px;
}

/* Main */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  width: calc(100% - var(--sidebar-width));
  padding: 20px 28px 40px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 24px;
}

.badge-version {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
  font-size: 12px;
  font-weight: 600;
}

.export-wrap {
  position: relative;
}

.btn-export {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-export:hover {
  border-color: rgba(59, 130, 246, 0.4);
}

.btn-export svg {
  width: 16px;
  height: 16px;
}

.export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 160px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: none;
  z-index: 50;
}

.export-menu.open {
  display: block;
}

.export-menu button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.export-menu button:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Sections */
.page-section {
  display: none;
}

.page-section.active {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}

.section-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-subtitle {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  max-width: 72ch;
}

/* Overview hero */
.overview-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px;
  border-radius: var(--radius);
  border: 1px solid rgba(59, 130, 246, 0.28);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(11, 23, 48, 0.92));
  box-shadow: var(--shadow);
}

.hero-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #93c5fd;
}

.hero-title {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero-lead {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  max-width: 72ch;
}

.hero-lead strong {
  color: var(--text);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  min-width: min(100%, 320px);
}

.hero-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 1 120px;
  min-width: 110px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
}

.hero-stat-value {
  display: block;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero-stat-label {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
}

.hero-stat--risk .hero-stat-value {
  color: #fdba74;
}

.hero-stat--issues .hero-stat-value {
  color: #fca5a5;
}

.hero-stat--ok .hero-stat-value {
  color: #86efac;
}

.quick-jump-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Equal-height side-by-side grids */
.priority-grid,
.overview-split,
.v2-detail-grid,
.v2-risk-panel,
.exec-summary-grid,
.breakdown-row,
.breakdown-inner,
.metrics-primary-row,
.scores-legend-grid,
.checks-summary-row,
.score-breakdown-row,
.metrics-row,
.risk-guide {
  align-items: stretch;
}

/* Priority grid: issues + risk side by side */
.priority-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(320px, 1.1fr);
  gap: var(--grid-gap);
}

.priority-col {
  display: flex;
  flex-direction: column;
  gap: var(--grid-gap);
  min-width: 0;
  min-height: 100%;
}

.priority-col > .card:not([hidden]),
.priority-col > .v2-risk-panel {
  flex: 1;
  min-height: 0;
  height: 100%;
}

.v2-risk-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--grid-gap);
}

.v2-risk-panel .v2-score-card,
.v2-risk-panel .v2-dimension-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.v2-dimension-card .v2-radar-box {
  flex: 1;
  min-height: 160px;
}

/* Content zones */
.zone {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.zone-header {
  margin-bottom: 2px;
}

.zone-heading {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.zone-intro,
.zone-subintro {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  max-width: 80ch;
}

.zone-subheading {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}

.v2-detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--grid-gap);
}

.v2-detail-grid > .card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.v2-contributors-card .card-microcopy,
.v2-categories-card .card-microcopy {
  flex-shrink: 0;
}

/* Collapsible read guide */
.read-guide {
  border-color: rgba(37, 99, 235, 0.25);
  background: rgba(15, 23, 42, 0.55);
  padding: 0;
  overflow: hidden;
}

.read-guide:hover {
  transform: none;
}

.read-guide-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
}

.read-guide-summary::-webkit-details-marker {
  display: none;
}

.read-guide-title {
  font-size: 15px;
  font-weight: 700;
}

.read-guide-toggle {
  font-size: 12px;
  font-weight: 600;
  color: #93c5fd;
}

.read-guide-toggle::before {
  content: "Show guide";
}

.read-guide[open] .read-guide-toggle::before {
  content: "Hide guide";
}

.read-guide[open] .read-guide-toggle {
  color: var(--muted);
}

.read-guide-body {
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
}

.report-guide-lead {
  margin: 16px 0 14px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}

.report-guide-steps {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--muted);
}

.report-guide-steps li {
  margin-bottom: 6px;
}

.report-guide-steps strong {
  color: var(--text);
}

.quick-jump-btn {
  border: 1px solid rgba(59, 130, 246, 0.4);
  background: rgba(37, 99, 235, 0.15);
  color: #dbeafe;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.quick-jump-btn:hover {
  background: rgba(37, 99, 235, 0.3);
  color: #fff;
}

.checks-summary-help {
  margin: -8px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.checks-summary-help strong {
  color: var(--text);
}

.overview-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--grid-gap);
}

.overview-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.overview-panel .panel-link {
  margin-top: auto;
  padding-top: 8px;
}

.overview-panel .panel-hint {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.overview-panel--passed {
  border-color: rgba(34, 197, 94, 0.25);
}

.overview-panel--issues {
  border-color: rgba(249, 115, 22, 0.25);
}

.overview-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.overview-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.overview-list li:last-child {
  border-bottom: none;
}

.overview-list-text {
  flex: 1;
  font-size: 13px;
}

.overview-list--passed li {
  color: #bbf7d0;
  font-size: 13px;
}

.overview-passed-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.overview-passed-text {
  flex: 1;
  min-width: 0;
}

.overview-passed-text strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--text);
}

.overview-list-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.passed-dot {
  color: #22c55e;
  font-weight: 700;
}

.overview-empty {
  color: var(--muted) !important;
  font-style: italic;
}

.panel-link {
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.panel-link:hover {
  text-decoration: underline;
}

/* Enterprise card system */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--card-pad);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Interactive cards */
.card-interactive {
  cursor: pointer;
  position: relative;
  outline: none;
}

.card-interactive:hover,
.card-interactive:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(59, 130, 246, 0.45) !important;
  box-shadow: 0 14px 44px rgba(37, 99, 235, 0.18);
}

.card-interactive:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.8);
  outline-offset: 2px;
}

.card-cta {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #93c5fd;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.card-interactive:hover .card-cta,
.card-interactive:focus-visible .card-cta {
  opacity: 1;
}

.row-cta {
  color: #93c5fd;
  font-size: 12px;
  font-weight: 600;
}

.issues-table tr.card-interactive:hover {
  background: rgba(37, 99, 235, 0.08);
}

.overview-list li.card-interactive:hover {
  background: rgba(37, 99, 235, 0.06);
  border-radius: 8px;
  margin: 0 -6px;
  padding-left: 6px;
  padding-right: 6px;
}

.category-item.card-interactive:hover {
  background: rgba(37, 99, 235, 0.06);
  border-radius: 8px;
}

.finding-row.card-interactive:hover {
  background: rgba(37, 99, 235, 0.06);
}

.card-flash {
  animation: cardFlash 1.2s ease;
}

@keyframes cardFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.55);
  }
  40% {
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.25);
  }
  100% {
    box-shadow: none;
  }
}

.card-heading {
  margin: 0 0 18px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* Overview layout */
.overview-row {
  margin-bottom: var(--section-gap);
}

.metrics-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.metrics-section-heading {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.metrics-section-intro {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 80ch;
}

.metrics-section-intro strong {
  color: var(--text);
}

.metrics-primary-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.2fr);
  gap: var(--grid-gap);
}

.metrics-primary-row > * {
  height: 100%;
  min-height: 0;
}

.scores-legend {
  margin-top: 8px;
  padding: 14px 0 0;
  border-top: 1px solid var(--border);
}

.scores-legend-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
}

.scores-legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.scores-legend-grid:has(#legend-v2-block:not([hidden])) {
  grid-template-columns: repeat(3, 1fr);
}

.scores-legend-block {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.scores-legend-block p {
  margin: 0;
  flex: 1;
}

.scores-legend-block strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
  font-size: 13px;
}

.scores-legend-block--scores {
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(37, 99, 235, 0.08);
}

.scores-legend-block--counts {
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(148, 163, 184, 0.06);
}

.scores-legend-block--v2 {
  border-color: rgba(249, 115, 22, 0.35);
  background: rgba(249, 115, 22, 0.08);
}

.score-pts-suffix,
.gauge-denom {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.breakdown-not-pct,
.card-microcopy {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

.card-microcopy {
  margin: -8px 0 14px;
  font-style: normal;
}

.checks-type-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.15);
  vertical-align: middle;
}

.checks-count {
  font-variant-numeric: tabular-nums;
}

.score-scale-hint {
  margin: -4px 0 12px;
  font-size: 12px;
  color: var(--muted);
}

.score-detail {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.issues-summary-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.issues-summary-card .card-heading {
  margin-bottom: 4px;
}

.issues-summary-card .tools-stat {
  margin-top: auto;
}

.issues-summary-intro {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
}

.issues-total-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.issues-total {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.issues-total-label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.issues-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.issues-table th,
.issues-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.issues-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.issues-table tfoot td {
  border-bottom: none;
  padding-top: 10px;
}

.issues-count {
  font-weight: 700;
  font-size: 16px;
  width: 56px;
}

.issues-meaning {
  color: var(--muted);
  font-size: 12px;
}

.tools-stat {
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.score-breakdown-section,
.checks-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.breakdown-caption {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.checks-sublabel {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

/* Legacy metrics row (unused in template; kept for print compat) */
.metrics-row {
  display: grid;
  grid-template-columns: minmax(280px, 300px) repeat(5, minmax(0, 1fr));
  gap: var(--grid-gap);
}

.tool-discovery-banner,
.scan-notes-banner {
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.tool-discovery-banner {
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.35);
  color: #fde68a;
}

.scan-notes-banner {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #bae6fd;
}

.score-breakdown-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--grid-gap);
  margin-bottom: var(--section-gap);
}

.score-breakdown-row .breakdown-score-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.score-breakdown-row .breakdown-score-card .breakdown-not-pct {
  margin-top: auto;
}

.score-breakdown-row .breakdown-score-card h4 {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.score-breakdown-row .breakdown-score-card .value {
  font-size: 28px;
  font-weight: 700;
}

.checks-summary-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--grid-gap);
  margin-bottom: var(--section-gap);
}

.checks-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.85);
}

.checks-card .checks-sublabel {
  margin-top: auto;
}

.checks-card.passed {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.checks-card.issues {
  border-color: rgba(249, 115, 22, 0.35);
  background: rgba(249, 115, 22, 0.08);
}

.checks-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}

.checks-label {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.section-lead {
  color: var(--muted);
  margin: -8px 0 18px;
}

.subsection-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
}

.passed-title {
  color: #86efac;
}

.issues-title {
  color: #fdba74;
}

.analyzer-section + .analyzer-section {
  margin-top: 24px;
}

.analyzer-card--passed {
  border-color: rgba(34, 197, 94, 0.28);
}

.analyzer-card--issues {
  border-color: rgba(249, 115, 22, 0.22);
}

.analyzer-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.passed-pill,
.issues-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.passed-pill {
  color: #166534;
  background: #86efac;
}

.issues-pill {
  color: #9a3412;
  background: #fdba74;
}

.analyzer-passed-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.analyzer-passed-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: var(--muted);
}

.analyzer-passed-detail p {
  margin: 0 0 6px;
}

.analyzer-card--open {
  border-color: rgba(34, 197, 94, 0.35) !important;
}

.analyzer-card--issues.analyzer-card--open {
  border-color: rgba(249, 115, 22, 0.45) !important;
}

.analyzer-knowledge {
  margin-top: 10px;
}

.analyzer-knowledge--compact .analyzer-knowledge-summary {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.analyzer-knowledge-label {
  margin: 12px 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #93c5fd;
}

.analyzer-knowledge-label:first-child {
  margin-top: 0;
}

.analyzer-knowledge-summary,
.analyzer-knowledge-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #cbd5e1;
}

.analyzer-knowledge-note {
  color: #fde68a !important;
  font-size: 12px !important;
}

.analyzer-knowledge-id {
  margin: 12px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.analyzer-finding-list {
  margin: 6px 0 10px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.analyzer-view-findings {
  appearance: none;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(37, 99, 235, 0.12);
  color: #93c5fd;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.subsection-lead {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 14px;
  max-width: 72ch;
}

body.modal-open {
  overflow: hidden;
}

.analyzer-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(4px);
  z-index: 200;
}

.analyzer-modal {
  position: fixed;
  inset: 0;
  z-index: 201;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.analyzer-modal[hidden],
.analyzer-modal-backdrop[hidden] {
  display: none !important;
}

.analyzer-modal-dialog {
  position: relative;
  width: min(640px, 100%);
  max-height: min(82vh, 900px);
  overflow: auto;
  background: var(--card-elevated);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  padding: 24px 24px 20px;
}

.analyzer-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.analyzer-modal-close:hover {
  background: rgba(255, 255, 255, 0.14);
}

.analyzer-modal-head {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  padding-right: 36px;
}

.analyzer-modal-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.analyzer-modal-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.analyzer-modal-stats {
  margin-bottom: 8px;
}

.category-item--passed .passed-badge {
  color: #86efac;
  font-weight: 600;
}

.category-bar--passed span {
  background: #22c55e !important;
}

.v2-meta-dl dt {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.term-label {
  font-weight: 600;
  color: var(--muted);
}

.term-hint {
  font-size: 11px;
  font-weight: 400;
  color: rgba(148, 163, 184, 0.85);
  line-height: 1.35;
}

.v2-score-card {
  display: flex;
  flex-direction: column;
  text-align: center;
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.1), rgba(11, 23, 48, 1));
}

.v2-dimension-card {
  display: flex;
  flex-direction: column;
}

.v2-score-card .v2-meta-dl {
  margin-top: auto;
}

.v2-absolute-risk {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
  margin: 4px 0;
}

.v2-meta-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 10px 0 0;
  text-align: left;
  font-size: 12px;
}

.v2-meta-dl dt {
  color: var(--muted);
}

.v2-meta-dl dd {
  margin: 0;
  font-weight: 600;
}

.v2-radar-box {
  min-height: 160px;
  max-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.v2-radar-box canvas {
  max-height: 100%;
}

.score-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  height: 100%;
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.08), rgba(11, 23, 48, 1));
}

#score-card[hidden] {
  display: none !important;
}

.score-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-bottom: 4px;
}

.score-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.score-info-wrap {
  position: relative;
}

.score-info {
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  cursor: help;
  transition: var(--transition);
}

.score-info:hover,
.score-info:focus {
  color: var(--text);
  background: rgba(59, 130, 246, 0.2);
  outline: none;
}

.score-tooltip {
  display: none;
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 200;
  width: 260px;
  padding: 12px 14px;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.score-tooltip strong {
  display: block;
  color: var(--text);
  margin-bottom: 8px;
  font-size: 12px;
}

.score-tooltip ul {
  margin: 0;
  padding-left: 16px;
}

.score-tooltip li {
  margin-bottom: 4px;
}

.score-info-wrap:hover .score-tooltip,
.score-info-wrap:focus-within .score-tooltip {
  display: block;
}

.gauge-wrap {
  position: relative;
  width: 180px;
  height: 100px;
  margin: 12px auto 0;
}

.gauge-wrap canvas {
  width: 180px !important;
  height: 100px !important;
}

.gauge-center {
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  text-align: center;
  width: 100%;
}

.gauge-score {
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
}

.gauge-denom {
  font-size: 18px;
  color: var(--muted);
  font-weight: 500;
}

.gauge-grade {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.score-brief {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  max-width: 240px;
}

.risk-pill {
  display: inline-block;
  margin-top: 0;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.risk-pill.critical {
  background: rgba(239, 68, 68, 0.2);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.risk-pill.high {
  background: rgba(249, 115, 22, 0.2);
  color: var(--orange);
  border: 1px solid rgba(249, 115, 22, 0.35);
}

.risk-pill.medium {
  background: rgba(250, 204, 21, 0.15);
  color: var(--yellow);
  border: 1px solid rgba(250, 204, 21, 0.35);
}

.risk-pill.low {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 3px 12px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.grade-badge.grade-a {
  background: rgba(34, 197, 94, 0.2);
  color: var(--green);
}
.grade-badge.grade-b {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}
.grade-badge.grade-c {
  background: rgba(250, 204, 21, 0.15);
  color: var(--yellow);
}
.grade-badge.grade-d {
  background: rgba(249, 115, 22, 0.2);
  color: var(--orange);
}
.grade-badge.grade-f {
  background: rgba(239, 68, 68, 0.2);
  color: var(--red);
}

/* Executive summary — two columns */
.exec-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--grid-gap);
}

.exec-summary-grid > .exec-col {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.exec-col-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.exec-paragraphs p {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}

.exec-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.exec-action-item {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.exec-action-item .priority-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.exec-action-item .priority-badge.p1 {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}
.exec-action-item .priority-badge.p2 {
  background: rgba(249, 115, 22, 0.2);
  color: #fdba74;
}
.exec-action-item .priority-badge.p3 {
  background: rgba(250, 204, 21, 0.12);
  color: #fde047;
}

.exec-action-item p {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
}

/* Severity metric cards */
.severity-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 14px;
  overflow: hidden;
  border-top: 4px solid transparent;
}

.severity-card--critical {
  border-top-color: var(--red);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.18), rgba(239, 68, 68, 0.02)), var(--card);
}
.severity-card--high {
  border-top-color: var(--orange);
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.16), rgba(249, 115, 22, 0.02)), var(--card);
}
.severity-card--medium {
  border-top-color: var(--yellow);
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.14), rgba(250, 204, 21, 0.02)), var(--card);
}
.severity-card--low {
  border-top-color: var(--green);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.14), rgba(34, 197, 94, 0.02)), var(--card);
}
.severity-card--tools {
  border-top-color: var(--accent);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.18), rgba(37, 99, 235, 0.02)), var(--card);
}

.severity-icon-wrap {
  position: absolute;
  top: 18px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.severity-icon {
  width: 28px;
  height: 28px;
}

.severity-card--critical .severity-icon { color: var(--red); }
.severity-card--high .severity-icon { color: var(--orange); }
.severity-card--medium .severity-icon { color: var(--yellow); }
.severity-card--low .severity-icon { color: var(--green); }
.severity-card--tools .severity-icon { color: var(--accent); width: 32px; height: 32px; }

.severity-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 8px;
}

.severity-card .count {
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}

.severity-tier {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text);
  margin-bottom: 4px;
}

.severity-desc {
  font-size: 13px;
  color: var(--muted);
}

.severity-footer-badge {
  margin-top: auto;
  padding-top: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  padding: 8px 10px;
  border-radius: 8px;
}

.severity-card--critical .severity-footer-badge {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.severity-card--high .severity-footer-badge {
  background: rgba(249, 115, 22, 0.15);
  color: #fdba74;
  border: 1px solid rgba(249, 115, 22, 0.25);
}
.severity-card--medium .severity-footer-badge {
  background: rgba(250, 204, 21, 0.1);
  color: #fde047;
  border: 1px solid rgba(250, 204, 21, 0.2);
}
.severity-card--low .severity-footer-badge {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.22);
}
.severity-card--tools .severity-footer-badge {
  background: rgba(37, 99, 235, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.25);
  font-size: 10px;
}

/* Breakdown row */
.breakdown-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--grid-gap);
}

.breakdown-row:has(#legacy-breakdown-card[hidden]) {
  grid-template-columns: 1fr;
}

.breakdown-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.breakdown-card .chart-box.trend,
.breakdown-card .breakdown-inner {
  flex: 1;
  min-height: 0;
}

.v2-contributors-table-wrap {
  flex: 1;
  min-height: 0;
  max-height: 280px;
  overflow-y: auto;
  margin-top: 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.v2-contributors-table-wrap .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card);
}

.v2-contributors-card .data-table td:nth-child(1),
.v2-contributors-card .data-table td:nth-child(4) {
  max-width: 220px;
}

.v2-contributors-card .data-table td:nth-child(4) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.v2-contributors-card .data-table td:nth-child(3) {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.v2-categories-list-wrap {
  flex: 1;
  min-height: 0;
  max-height: 280px;
  margin-top: 4px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.v2-categories-card .category-list {
  margin: 0;
  padding: 8px 10px;
  justify-content: flex-start;
}

.breakdown-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--grid-gap);
  min-height: 200px;
}

.breakdown-inner > * {
  height: 100%;
  min-height: 0;
}

.metrics-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.breakdown-inner .metrics-panel .category-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.category-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.category-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.category-list .name {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.category-list .score-val {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.category-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.category-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width var(--transition);
}

.radar-box {
  position: relative;
  min-height: 200px;
  height: 100%;
}

.radar-box canvas {
  min-height: 200px !important;
}

.chart-box.trend {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.trend-chart-wrap {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  height: 160px;
  min-height: 160px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.trend-sparkline {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  vertical-align: top;
}

.trend-sparkline .trend-axis-label {
  fill: var(--muted);
  font-size: 11px;
}

.trend-sparkline .trend-grid-line {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1;
}

.trend-sparkline .trend-line {
  fill: none;
  stroke: #ef4444;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-sparkline .trend-dot {
  fill: #ef4444;
  stroke: #fff;
  stroke-width: 1.5;
}

.trend-sparkline .trend-flat-label {
  fill: #f87171;
  font-size: 12px;
  font-weight: 600;
}

.trend-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 160px;
  text-align: center;
  padding: var(--card-pad);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.trend-empty.visible {
  display: flex;
}

.trend-empty-icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.9;
}

.trend-empty h4 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.trend-empty p {
  margin: 0;
  max-width: 320px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

.trend-empty p code {
  font-size: 12px;
  color: var(--text);
}

.trend-note {
  flex-shrink: 0;
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.trend-table-wrap {
  flex: 1;
  min-height: 0;
  max-height: 280px;
  margin-top: 0;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.trend-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.trend-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card);
}

.trend-table th,
.trend-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.trend-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.trend-table th.num,
.trend-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.trend-table .sev-badge {
  text-transform: capitalize;
}

.trend-card .chart-box.trend {
  min-height: 200px;
}

/* Risk level guide — mini product cards */
.risk-guide-card .card-heading {
  margin-bottom: 20px;
}

.risk-guide {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grid-gap);
}

.guide-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card-elevated);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.guide-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.guide-card.active {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.guide-card-top {
  height: 4px;
  margin: -20px -18px 14px;
  border-radius: 14px 14px 0 0;
}

.guide-card-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
}

.guide-card h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}

.guide-card .range {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

.guide-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.guide-card p {
  margin: 0 0 14px;
  flex: 1;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.guide-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.guide-progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
}

/* Findings table */
.table-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.search-wrap input,
.filter-select {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
}

.filter-select {
  width: auto;
  min-width: 140px;
  padding-left: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.data-table th:hover {
  color: var(--text);
}

.data-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.sev-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sev-badge.critical {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}
.sev-badge.high {
  background: rgba(249, 115, 22, 0.18);
  color: #fdba74;
}
.sev-badge.medium {
  background: rgba(250, 204, 21, 0.12);
  color: #fde047;
}
.sev-badge.low {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

/* OWASP */
.owasp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.owasp-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
}

.owasp-card .meta-row {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.owasp-tools {
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

.owasp-subsection-title {
  margin: 28px 0 8px;
  font-size: 18px;
  font-weight: 600;
}

.owasp-subsection-title:first-of-type {
  margin-top: 0;
}

.owasp-subsection-lead {
  margin-top: 0;
  margin-bottom: 16px;
}

.owasp-card--gap {
  border-color: rgba(250, 204, 21, 0.35);
  background: rgba(250, 204, 21, 0.06);
}

.owasp-gap-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fde047;
  margin-bottom: 8px;
}

.findings-location {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

.findings-technique a {
  font-size: 12px;
  font-weight: 600;
}

.confidence-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

.finding-row--expandable {
  cursor: pointer;
}

.finding-row--expandable:hover {
  background: rgba(255, 255, 255, 0.03);
}

.finding-row--open {
  background: rgba(37, 99, 235, 0.08);
}

.finding-expand-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.finding-detail-panel {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.finding-evidence-json {
  margin: 10px 0 0;
  padding: 12px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.45;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  color: #cbd5e1;
}

.finding-evidence-empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.technique-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.technique-grid--full {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.technique-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.technique-filter {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.technique-filter.active {
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(59, 130, 246, 0.45);
  color: #dbeafe;
}

.technique-card--clear {
  opacity: 0.82;
  border-color: rgba(255, 255, 255, 0.04);
}

.technique-card h4 {
  margin: 0 0 4px;
  font-size: 14px;
}

.technique-card .technique-name {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.technique-card--detected {
  border-color: rgba(239, 68, 68, 0.35);
}

.technique-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.capability-table-wrap {
  overflow-x: auto;
}

.capability-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.capability-table th,
.capability-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.capability-table th.cap-tool-name,
.capability-table th:first-child {
  text-align: left;
  min-width: 140px;
}

.cap-cell {
  color: var(--muted);
}

.cap-cell--on {
  color: #f87171;
  font-weight: 700;
}

/* Recommendations */
.rec-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rec-card {
  border-left: 3px solid var(--primary);
}

.rec-priority {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.rec-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.rec-meta {
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: var(--muted);
}

.rec-meta strong {
  color: var(--text);
}

/* Attack graph */
.graph-wrap {
  min-height: 400px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.graph-wrap svg {
  width: 100%;
  height: 400px;
}

.graph-node {
  cursor: pointer;
  transition: var(--transition);
}

.graph-node circle {
  fill: var(--card);
  stroke: var(--accent);
  stroke-width: 2;
}

.graph-node text {
  fill: var(--text);
  font-size: 11px;
  font-family: inherit;
}

.graph-edge {
  stroke: rgba(59, 130, 246, 0.5);
  stroke-width: 1.5;
  fill: none;
  marker-end: url(#arrowhead);
}

/* Analyzers */
.analyzer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.analyzer-card h4 {
  margin: 0 0 10px;
}

.analyzer-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}

/* Appendix */
.appendix pre {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  overflow: auto;
  font-size: 12px;
  color: var(--muted);
  max-height: 480px;
}

/* Print */
@media print {
  .sidebar,
  .header .export-wrap,
  .btn-download,
  .table-toolbar {
    display: none !important;
  }
  .main {
    margin-left: 0;
    padding: 16px;
  }
  .page-section {
    display: block !important;
    page-break-inside: avoid;
  }
  body {
    background: #fff;
    color: #111;
  }
  .card {
    box-shadow: none;
    border-color: #ddd;
  }
}

@media (max-width: 1280px) {
  .priority-grid,
  .v2-risk-panel,
  .v2-detail-grid {
    grid-template-columns: 1fr;
  }

  .issues-summary-card,
  .v2-risk-panel {
    min-height: 0;
  }

  .overview-panel {
    min-height: 0;
  }
  .scores-legend-grid,
  .scores-legend-grid:has(#legend-v2-block:not([hidden])) {
    grid-template-columns: 1fr;
  }
  .metrics-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .metrics-row .score-card {
    grid-column: 1 / -1;
    max-width: 320px;
    margin: 0 auto;
    width: 100%;
  }
  .exec-summary-grid {
    grid-template-columns: 1fr;
  }
  .breakdown-row {
    grid-template-columns: 1fr;
  }
  .risk-guide {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: relative;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .main {
    margin-left: 0;
    width: 100%;
    padding: 16px;
  }
  .app {
    flex-direction: column;
  }
  .priority-grid,
  .v2-risk-panel,
  .v2-detail-grid {
    grid-template-columns: 1fr;
  }

  .issues-summary-card,
  .v2-risk-panel {
    min-height: 0;
  }

  .overview-panel {
    min-height: 0;
  }
  .scores-legend-grid,
  .scores-legend-grid:has(#legend-v2-block:not([hidden])) {
    grid-template-columns: 1fr;
  }
  .metrics-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metrics-row .score-card {
    grid-column: 1 / -1;
  }
  .breakdown-inner {
    grid-template-columns: 1fr;
  }
}
