/* Costco Android — Code Review Site
   Shared styles for index + 20 category pages */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --surface-3: #f8f9fb;
  --border: #e2e6ee;
  --border-strong: #cdd3de;
  --text: #0f172a;
  --text-dim: #475467;
  --text-mute: #84899a;
  --accent: #e31837; /* Costco red */
  --accent-dark: #b91529;
  --accent-2: #2563eb;
  --ok: #059669;
  --warn: #d97706;
  --bad: #dc2626;
  --info: #2563eb;
  --critical: #dc2626;
  --high: #ea580c;
  --medium: #d97706;
  --low: #2563eb;
  --pass: #059669;
  --code-bg: #f4f5f8;
  /* Layered shadow system */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.10), 0 4px 8px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 24px 48px rgba(15, 23, 42, 0.14);
  /* chart palette */
  --chart-grid: #e5e7eb;
  --chart-text: #475467;
  /* Tint backgrounds (very subtle) */
  --tint-critical: rgba(220, 38, 38, 0.06);
  --tint-high: rgba(234, 88, 12, 0.06);
  --tint-medium: rgba(217, 119, 6, 0.06);
  --tint-low: rgba(37, 99, 235, 0.06);
  --tint-pass: rgba(5, 150, 105, 0.06);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* Layout */
.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--border);
  padding: 22px 14px;
  position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
  box-shadow: 1px 0 0 rgba(15,23,42,0.02);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 14px;
  text-decoration: none; color: inherit;
  border-radius: 8px;
}
.brand:hover { text-decoration: none; }
.brand .costco-logo {
  width: 78px; height: 26px;
  flex-shrink: 0;
}

/* Platform picker (replaces .brand link) */
.platform-picker {
  position: relative; margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.platform-picker > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 14px;
  border-radius: 8px;
  transition: background .12s ease;
}
.platform-picker > summary::-webkit-details-marker { display: none; }
.platform-picker > summary:hover { background: var(--surface-2); }
.platform-picker > summary .title { display: flex; align-items: center; gap: 6px; }
.platform-picker > summary .chev {
  font-size: 11px; color: var(--text-mute);
  transition: transform .15s ease;
}
.platform-picker[open] > summary .chev { transform: rotate(180deg); }

.platform-menu {
  display: flex; flex-direction: column; gap: 4px;
  padding: 6px; margin: 0 0 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow);
}
.platform-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 7px;
  text-decoration: none; color: var(--text);
  font-size: 13.5px;
}
.platform-menu a:hover { background: var(--surface-2); text-decoration: none; }
.platform-menu a.active { background: var(--surface-2); }
.platform-menu a.active::after {
  content: '✓'; margin-left: auto; color: var(--pass); font-weight: 700;
}
.platform-menu .platform-icon {
  width: 28px; height: 28px; border-radius: 7px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px; color: white;
}
.platform-menu .platform-icon.android { background: linear-gradient(135deg, #3ddc84, #1aab63); }
.platform-menu .platform-icon.ios { background: linear-gradient(135deg, #0a84ff, #0660c4); }
.platform-menu .pf-name { font-weight: 600; line-height: 1.1; }
.platform-menu .pf-sub { font-size: 11px; color: var(--text-mute); margin-top: 2px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #8a0d20);
  display: grid; place-items: center;
  color: white; font-weight: 800; font-size: 16px;
}
.brand .title { font-weight: 700; font-size: 15px; letter-spacing: .2px; }
.brand .subtitle { color: var(--text-mute); font-size: 12px; }

.nav-section {
  font-size: 12px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-mute); margin: 16px 8px 6px;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 7px;
  color: var(--text-dim); font-size: 14px;
  text-decoration: none;
}
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.active { background: var(--surface-2); color: var(--text); }
.nav .num {
  font-variant-numeric: tabular-nums;
  font-size: 12px; color: var(--text-mute);
  width: 24px; text-align: right;
}

/* Main content */
.main { padding: 28px 40px 80px; max-width: 1180px; }

.crumb { color: var(--text-mute); font-size: 13px; margin-bottom: 12px; }
.crumb a { color: var(--text-dim); }

h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-size: 21px; margin: 28px 0 12px; }
h3 { font-size: 16px; margin: 18px 0 6px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; }
p { margin: 9px 0; color: var(--text-dim); font-size: 15px; }
.lead { color: var(--text); font-size: 16px; max-width: 880px; }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1fr auto;
  gap: 24px; align-items: center;
  background: linear-gradient(135deg, #ffffff, #eef0f4);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 24px; margin: 4px 0 22px;
  box-shadow: var(--shadow);
}
.hero .meta { color: var(--text-mute); font-size: 13px; margin-top: 8px; }
.score-ring {
  width: 92px; height: 92px; border-radius: 50%;
  background: conic-gradient(var(--score-color, var(--ok)) calc(var(--score, 70) * 1%), #e5e7eb 0);
  display: grid; place-items: center;
  position: relative;
}
.score-ring::after {
  content: ''; position: absolute; inset: 8px; border-radius: 50%; background: var(--surface);
}
.score-ring .num { position: relative; z-index: 1; font-weight: 800; font-size: 24px; }
.score-ring .lbl { position: relative; z-index: 1; font-size: 11px; color: var(--text-mute); margin-top: -3px; letter-spacing: .04em; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .03em;
  border: 1px solid currentColor;
}
.badge.critical { color: var(--critical); }
.badge.high { color: var(--high); }
.badge.medium { color: var(--medium); }
.badge.low { color: var(--low); }
.badge.info { color: var(--info); }
.badge.pass { color: var(--pass); }

.tag {
  display: inline-block; padding: 3px 9px; border-radius: 6px;
  background: var(--surface-2); color: var(--text-dim);
  font-size: 12px; margin-right: 6px;
}

/* Cards */
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px;
}
.card h4 { margin: 0 0 6px; font-size: 15px; }
.card p { margin: 6px 0; color: var(--text-dim); font-size: 14px; }
.card .stat { font-size: 28px; font-weight: 800; color: var(--text); }
.card .stat-lbl { font-size: 12px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .08em; }

.kv { display: grid; grid-template-columns: 200px 1fr; gap: 6px 14px; font-size: 14px; }
.kv .k { color: var(--text-mute); }

/* Findings */
.finding {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--medium);
  border-radius: 10px; padding: 16px 18px; margin: 14px 0;
}
.finding.critical { border-left-color: var(--critical); }
.finding.high { border-left-color: var(--high); }
.finding.medium { border-left-color: var(--medium); }
.finding.low { border-left-color: var(--low); }
.finding.info { border-left-color: var(--info); }
.finding.pass { border-left-color: var(--pass); }
.finding .head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.finding .head h4 { margin: 0; font-size: 16px; }
.finding .body { color: var(--text-dim); font-size: 14.5px; }
.finding .body p { margin: 6px 0; color: inherit; }
.finding .files { margin-top: 10px; }
.finding .rec {
  margin-top: 12px; padding: 11px 14px;
  background: rgba(5, 150, 105, 0.08);
  border-radius: 8px; font-size: 14px; color: var(--text);
}
.finding .rec b { color: var(--pass); }

/* Code blocks */
pre, code {
  font-family: "JetBrains Mono", Menlo, Consolas, monospace;
}
pre {
  background: var(--code-bg); border: 1px solid var(--border);
  padding: 14px 16px; border-radius: 8px;
  overflow-x: auto; font-size: 13.5px; color: #1f2937; line-height: 1.55;
  margin: 10px 0;
}
code:not(pre code) {
  background: var(--surface-2); padding: 2px 7px;
  border-radius: 4px; font-size: 13.5px; color: #1a2233;
}
.path {
  display: inline-block; font-family: "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 12.5px; padding: 3px 8px;
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 5px; color: #2c3a4f; margin: 2px 4px 2px 0; word-break: break-all;
}

/* Table */
table {
  width: 100%; border-collapse: collapse; margin: 12px 0;
  font-size: 14px;
}
th, td {
  padding: 10px 12px; text-align: left;
  border-bottom: 1px solid var(--border);
}
th { color: var(--text-mute); font-weight: 600; text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
tbody tr:hover { background: var(--surface); }

/* Scorecard grid (index) */
.scorecard {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.score-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
  text-decoration: none; color: inherit;
  display: block; transition: transform .12s ease, border-color .12s ease;
}
.score-card:hover { transform: translateY(-1px); border-color: #c1c8d4; text-decoration: none; box-shadow: var(--shadow); }
.score-card .row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.score-card .name { font-weight: 600; font-size: 13.5px; }
.score-card .num-pill {
  font-variant-numeric: tabular-nums;
  font-size: 12px; color: var(--text-mute);
  background: var(--surface-2); padding: 2px 8px; border-radius: 6px;
}
.score-card .desc { font-size: 13.5px; color: var(--text-mute); margin-top: 5px; }
.score-card .meter {
  height: 6px; background: #e5e7eb; border-radius: 999px;
  margin-top: 10px; overflow: hidden;
}
.score-card .meter > span {
  display: block; height: 100%; border-radius: 999px;
  background: var(--score-color, var(--ok));
  width: var(--score, 70%);
}

.legend {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  margin: 12px 0 18px; font-size: 13px; color: var(--text-mute);
}
.legend .dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}
.legend .dot.ok { background: var(--pass); }
.legend .dot.med { background: var(--medium); }
.legend .dot.bad { background: var(--bad); }

.foot {
  margin-top: 40px; padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-mute); font-size: 13px;
}

/* Pagination links */
.pager {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 30px;
}
.pager a {
  flex: 1; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface);
  font-size: 14px; color: var(--text-dim);
}
.pager a:hover { border-color: #c1c8d4; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.pager a.next { text-align: right; }
.pager .lbl { display: block; font-size: 12px; color: var(--text-mute); }

/* Responsive */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .main { padding: 18px; }
  .hero { grid-template-columns: 1fr; }
}

/* === Charts === */
.chart-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  margin: 12px 0 24px;
}
.chart-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px;
}
.chart-card h4 {
  margin: 0 0 4px; font-size: 14px;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em;
}
.chart-card .sub { color: var(--text-mute); font-size: 13px; margin-bottom: 10px; }
.chart-wrap { position: relative; height: 260px; }
.chart-wrap.tall { height: 340px; }

/* === Toolbar / Filters === */
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; margin: 8px 0 16px;
  align-items: center;
}
.toolbar input[type="text"], .toolbar select {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 12px; font-size: 14px; min-width: 150px;
}
.toolbar input[type="text"] { min-width: 220px; }
.toolbar input::placeholder { color: var(--text-mute); }
.toolbar .spacer { flex: 1; }
.toolbar .stat-mini { font-size: 13px; color: var(--text-mute); }
.toolbar .stat-mini b { color: var(--text); }

.btn {
  background: var(--accent); color: white; border: none;
  border-radius: 6px; padding: 9px 14px; font-size: 14px;
  font-weight: 600; cursor: pointer;
}
.btn:hover { background: #c41330; }
.btn.ghost {
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn.ghost:hover { color: var(--text); border-color: #c1c8d4; background: var(--surface-2); }

/* === Findings Table === */
.findings-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
  font-size: 14px;
}
.findings-table thead th {
  background: var(--surface-2); color: var(--text-dim);
  font-weight: 600; font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; padding: 11px 12px; text-align: left;
  border-bottom: 1px solid var(--border);
  cursor: pointer; user-select: none;
}
.findings-table thead th:hover { color: var(--text); }
.findings-table tbody td {
  padding: 11px 12px; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.findings-table tbody tr:last-child td { border-bottom: none; }
.findings-table tbody tr:hover { background: #f6f8fb; }
.findings-table .col-id { color: var(--text-mute); font-family: "JetBrains Mono", Menlo, monospace; font-size: 12.5px; width: 64px; }
.findings-table .col-sev { width: 96px; }
.findings-table .col-mod { color: var(--text-mute); font-size: 13px; white-space: nowrap; }
.findings-table .col-loc { font-family: "JetBrains Mono", Menlo, monospace; font-size: 12.5px; color: var(--text-dim); word-break: break-all; max-width: 380px; }
.findings-table .col-loc .lineno { color: var(--accent-2); }
.findings-table .col-title { color: var(--text); font-weight: 500; }
.findings-table .col-note { color: var(--text-dim); font-size: 13.5px; }

.row-rec {
  background: rgba(5, 150, 105, 0.06);
  font-size: 13.5px; color: var(--text);
}
.row-rec td {
  padding: 10px 16px 14px 90px; color: var(--text-dim);
}
.row-rec b { color: var(--pass); }

.expand-toggle {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-mute); font-size: 13px; padding: 0;
}
.expand-toggle:hover { color: var(--text); }

.empty-state {
  padding: 44px; text-align: center; color: var(--text-mute);
  background: var(--surface); border: 1px dashed var(--border); border-radius: 10px;
  font-size: 14px;
}

/* === Module heatmap (in dashboard) === */
.heatmap {
  display: grid; gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.heat-cell {
  padding: 12px 14px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.heat-cell .name { font-size: 13px; color: var(--text-dim); }
.heat-cell .num { font-size: 20px; font-weight: 700; color: var(--text); margin-top: 4px; }
.heat-cell::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--cell-color, var(--medium));
}

/* Severity dots in tables */
.sev-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}
.sev-dot.critical { background: var(--critical); }
.sev-dot.high { background: var(--high); }
.sev-dot.medium { background: var(--medium); }
.sev-dot.low { background: var(--low); }
.sev-dot.info { background: var(--info); }

/* Linkable pre with line indicator */
.code-cite {
  font-family: "JetBrains Mono", Menlo, monospace;
  font-size: 12.5px; color: var(--text-dim);
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 7px 10px; display: inline-block;
}
.code-cite .lineno { color: var(--accent-2); }

/* === Leadership view === */
.exec-hero {
  background:
    radial-gradient(1200px 400px at 80% -20%, rgba(227, 24, 55, 0.10), transparent),
    linear-gradient(135deg, #ffffff, #eef0f4);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 28px 32px; margin: 4px 0 22px;
  display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center;
  box-shadow: var(--shadow);
}
.exec-hero h1 { font-size: 34px; margin: 0 0 4px; letter-spacing: -.015em; }
.exec-hero .verdict { font-size: 18px; color: var(--text); line-height: 1.55; max-width: 720px; }
.exec-hero .meta { color: var(--text-mute); font-size: 13px; margin-top: 10px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(217, 119, 6, 0.12); color: var(--medium);
  border: 1px solid var(--medium);
}
.status-pill.red { background: rgba(220, 38, 38, 0.10); color: var(--critical); border-color: var(--critical); }
.status-pill.amber { background: rgba(217, 119, 6, 0.12); color: var(--medium); border-color: var(--medium); }
.status-pill.green { background: rgba(5, 150, 105, 0.12); color: var(--pass); border-color: var(--pass); }
.status-pill .blip { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(15,23,42,0.04); }

.kpi-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin: 4px 0 22px;
}
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 18px 16px;
  position: relative; overflow: hidden;
}
.kpi::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--kpi-color, var(--accent-2));
}
.kpi .lbl { font-size: 12px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .08em; }
.kpi .v { font-size: 34px; font-weight: 800; color: var(--text); margin: 6px 0 4px; line-height: 1.05; }
.kpi .v small { font-size: 15px; font-weight: 600; color: var(--text-mute); }
.kpi .desc { font-size: 13.5px; color: var(--text-dim); margin-top: 4px; }
.kpi .arrow { display: inline-block; font-size: 12px; padding: 2px 7px; border-radius: 4px; margin-left: 6px; }
.kpi .arrow.up { color: var(--pass); background: rgba(5,150,105,0.10); }
.kpi .arrow.down { color: var(--critical); background: rgba(220,38,38,0.10); }
.kpi .arrow.flat { color: var(--text-mute); background: var(--surface-2); }

/* Status traffic light grid */
.tlg {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.tlc {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center;
}
.tlc .light {
  width: 14px; height: 14px; border-radius: 50%;
  box-shadow: 0 0 12px var(--light-color, var(--medium));
  background: var(--light-color, var(--medium));
}
.tlc.red { --light-color: var(--critical); }
.tlc.amber { --light-color: var(--medium); }
.tlc.green { --light-color: var(--pass); }
.tlc .name { font-weight: 600; font-size: 14.5px; color: var(--text); }
.tlc .note { font-size: 12.5px; color: var(--text-mute); margin-top: 3px; }

/* Detailed area cards (replaces small tlc grid) */
.areas {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  margin: 14px 0 24px;
}
.area {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 20px 16px;
  border-top: 4px solid var(--area-color, var(--medium));
  box-shadow: var(--shadow);
}
.area.red { --area-color: var(--critical); }
.area.amber { --area-color: var(--medium); }
.area.green { --area-color: var(--pass); }
.area .ahead {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border); padding-bottom: 10px;
}
.area .title { font-size: 17px; font-weight: 700; color: var(--text); }
.area .meta-row { display: flex; align-items: center; gap: 10px; }
.area .score-num {
  color: var(--area-color); font-variant-numeric: tabular-nums;
  font-weight: 700; font-size: 14px;
}
.area .row { margin: 9px 0 4px; }
.area .label {
  display: block; font-size: 11px; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px;
  font-weight: 600;
}
.area .row p { margin: 2px 0; font-size: 14px; color: var(--text-dim); line-height: 1.6; }
.area code { font-size: 12.5px; }

/* Risk cards (business impact framing) */
.risk-list { display: grid; gap: 12px; }
.risk {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px;
  display: grid; grid-template-columns: 36px 1fr auto; gap: 14px; align-items: start;
}
.risk .num {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px;
  background: var(--surface-2); color: var(--text);
}
.risk.r1 .num { background: var(--critical); color: white; }
.risk.r2 .num { background: var(--high); color: white; }
.risk.r3 .num { background: var(--medium); color: #ffffff; }
.risk.r4 .num, .risk.r5 .num, .risk.r6 .num, .risk.r7 .num { background: var(--surface-2); color: var(--text); }
.risk h4 { margin: 0 0 4px; font-size: 16px; }
.risk .subtitle { font-size: 13px; color: var(--text-mute); margin-bottom: 8px; }
.risk .impact {
  font-size: 14px; color: var(--text-dim); line-height: 1.6;
}
.risk .meta-tags {
  display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap;
}
.risk .scoring {
  display: grid; grid-template-rows: auto auto; gap: 6px;
  text-align: right; min-width: 110px;
}
.risk .scoring .lbl { font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .08em; }
.risk .scoring .badge { justify-self: end; }

/* Roadmap */
.roadmap {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.lane {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
}
.lane h4 { margin: 0 0 4px; font-size: 15px; }
.lane .horizon { font-size: 12px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.lane ul { margin: 0; padding-left: 18px; color: var(--text-dim); font-size: 14px; line-height: 1.65; }
.lane li { margin: 4px 0; }
.lane.now { border-top: 3px solid var(--critical); }
.lane.next { border-top: 3px solid var(--high); }
.lane.later { border-top: 3px solid var(--medium); }
.lane.future { border-top: 3px solid var(--pass); }

/* Comparable / benchmarks */
.bench-bar {
  display: grid; grid-template-columns: 220px 1fr 80px;
  gap: 12px; align-items: center;
  margin: 8px 0; font-size: 14px;
}
.bench-bar .label { color: var(--text-dim); }
.bench-bar .track {
  height: 10px; border-radius: 999px;
  background: var(--surface-2); position: relative; overflow: hidden;
}
.bench-bar .track .you {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, var(--bench-color, var(--accent-2)), color-mix(in srgb, var(--bench-color, var(--accent-2)) 70%, transparent));
  width: var(--score, 50%);
}
.bench-bar .track .ind {
  position: absolute; top: -3px; bottom: -3px;
  width: 2px; background: white;
  left: var(--industry, 70%);
}
.bench-bar .num { font-weight: 700; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }

/* === Upload zones === */
.upload-grid {
  display: grid; gap: 14px;
  grid-template-columns: 1fr 1fr;
  margin: 8px 0 22px;
}
@media (max-width: 760px) { .upload-grid { grid-template-columns: 1fr; } }
.dropzone {
  background: var(--surface); border: 2px dashed var(--border);
  border-radius: 12px; padding: 22px 20px; text-align: center;
  transition: all .15s ease; cursor: pointer; position: relative;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent-2); background: rgba(37,99,235,0.04);
}
.dropzone .dz-icon { font-size: 28px; line-height: 1; margin-bottom: 6px; color: var(--accent-2); }
.dropzone .dz-title { font-weight: 600; font-size: 15px; color: var(--text); margin-bottom: 4px; }
.dropzone .dz-sub { font-size: 12.5px; color: var(--text-mute); }
.dropzone .dz-formats {
  display: inline-block; margin-top: 8px; font-family: "JetBrains Mono", Menlo, monospace;
  font-size: 11.5px; color: var(--text-mute); background: var(--surface-2);
  padding: 3px 10px; border-radius: 6px;
}
.dropzone input[type=file] { display: none; }
.dropzone.loaded {
  border-style: solid; border-color: var(--pass);
  background: rgba(5,150,105,0.04);
}
.dropzone.loaded .dz-icon { color: var(--pass); }
.dropzone.loaded .dz-title { color: var(--pass); }
.dropzone.error {
  border-color: var(--critical); background: rgba(220,38,38,0.04);
}
.dropzone.error .dz-icon, .dropzone.error .dz-title { color: var(--critical); }

.upload-status {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 18px; font-size: 13.5px;
}
.upload-status .pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-dim);
  font-size: 12.5px; border: 1px solid var(--border);
}
.upload-status .pill b { color: var(--text); }
.upload-status .pill.live { color: var(--pass); border-color: var(--pass); background: rgba(5,150,105,0.06); }
.upload-status .pill.sample { color: var(--medium); border-color: var(--medium); background: rgba(217,119,6,0.06); }

.privacy-note {
  font-size: 12.5px; color: var(--text-mute); margin-top: 10px;
  padding: 8px 12px; background: var(--surface-2); border-radius: 8px;
}
.privacy-note b { color: var(--text); }

/* ============================================================
   ANIMATIONS — keep subtle, respect motion preferences
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideRight {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes blip {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.85); }
}
@keyframes pulseRing {
  0%   { box-shadow: 0 0 0 0    rgba(220, 38, 38, 0.5); }
  70%  { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0    rgba(220, 38, 38, 0); }
}
@keyframes fillMeter {
  from { width: 0; }
  to   { width: var(--score, 70%); }
}
@keyframes fillBench {
  from { width: 0; }
  to   { width: var(--score, 50%); }
}
@keyframes drawRing {
  from { background: conic-gradient(var(--score-color, var(--ok)) 0%, #e5e7eb 0); }
  to   { background: conic-gradient(var(--score-color, var(--ok)) calc(var(--score, 70) * 1%), #e5e7eb 0); }
}

/* Page-level entry */
html { scroll-behavior: smooth; }
.sidebar { animation: slideRight .35s cubic-bezier(.4,0,.2,1); }
.hero, .exec-hero { animation: fadeInUp .45s cubic-bezier(.4,0,.2,1); }
.crumb { animation: fadeIn .4s ease-out; }

/* Score ring — animate the conic-gradient fill */
.score-ring {
  animation: drawRing .9s cubic-bezier(.4,0,.2,1), scaleIn .5s cubic-bezier(.4,0,.2,1);
}
.score-ring .num, .score-ring .lbl {
  animation: fadeIn .6s ease-out .25s backwards;
}

/* Status pill blip — pulsing dot */
.status-pill .blip { animation: blip 1.8s ease-in-out infinite; }

/* Meter bar fill */
.score-card .meter > span {
  animation: fillMeter 1s cubic-bezier(.4,0,.2,1) .15s backwards;
}

/* Bench bars fill */
.bench-bar .track .you {
  animation: fillBench 1s cubic-bezier(.4,0,.2,1) .25s backwards;
}

/* Generic grid stagger — applies to .cards, .kpi-grid, .scorecard, .areas, .risk-list, .chart-grid, .upload-grid, .roadmap, .heatmap, .tlg */
.cards > *, .kpi-grid > *, .scorecard > *, .areas > *, .risk-list > *,
.chart-grid > *, .upload-grid > *, .roadmap > *, .heatmap > *, .tlg > * {
  animation: fadeInUp .4s cubic-bezier(.4,0,.2,1) backwards;
}
/* Stagger up to 20 children */
.cards > *:nth-child(1), .kpi-grid > *:nth-child(1), .scorecard > *:nth-child(1),
.areas > *:nth-child(1), .risk-list > *:nth-child(1), .chart-grid > *:nth-child(1),
.upload-grid > *:nth-child(1), .roadmap > *:nth-child(1) { animation-delay: .04s; }
.cards > *:nth-child(2), .kpi-grid > *:nth-child(2), .scorecard > *:nth-child(2),
.areas > *:nth-child(2), .risk-list > *:nth-child(2), .chart-grid > *:nth-child(2),
.upload-grid > *:nth-child(2), .roadmap > *:nth-child(2) { animation-delay: .08s; }
.cards > *:nth-child(3), .kpi-grid > *:nth-child(3), .scorecard > *:nth-child(3),
.areas > *:nth-child(3), .risk-list > *:nth-child(3), .chart-grid > *:nth-child(3),
.upload-grid > *:nth-child(3), .roadmap > *:nth-child(3) { animation-delay: .12s; }
.cards > *:nth-child(4), .kpi-grid > *:nth-child(4), .scorecard > *:nth-child(4),
.areas > *:nth-child(4), .risk-list > *:nth-child(4), .chart-grid > *:nth-child(4),
.upload-grid > *:nth-child(4), .roadmap > *:nth-child(4) { animation-delay: .16s; }
.cards > *:nth-child(5), .kpi-grid > *:nth-child(5), .scorecard > *:nth-child(5),
.areas > *:nth-child(5), .risk-list > *:nth-child(5), .chart-grid > *:nth-child(5) { animation-delay: .20s; }
.cards > *:nth-child(6), .kpi-grid > *:nth-child(6), .scorecard > *:nth-child(6),
.areas > *:nth-child(6), .risk-list > *:nth-child(6), .chart-grid > *:nth-child(6) { animation-delay: .24s; }
.kpi-grid > *:nth-child(7), .scorecard > *:nth-child(7),
.areas > *:nth-child(7), .risk-list > *:nth-child(7) { animation-delay: .28s; }
.kpi-grid > *:nth-child(8), .scorecard > *:nth-child(8),
.areas > *:nth-child(8) { animation-delay: .32s; }
.scorecard > *:nth-child(9), .areas > *:nth-child(9) { animation-delay: .36s; }
.scorecard > *:nth-child(10), .areas > *:nth-child(10) { animation-delay: .40s; }
.scorecard > *:nth-child(11), .areas > *:nth-child(11) { animation-delay: .44s; }
.scorecard > *:nth-child(12), .areas > *:nth-child(12) { animation-delay: .48s; }
.scorecard > *:nth-child(n+13) { animation-delay: .52s; }

/* Findings appear progressively — but only first few to avoid noise */
.finding { animation: fadeInUp .35s ease-out backwards; }
.finding:nth-of-type(1)  { animation-delay: .05s; }
.finding:nth-of-type(2)  { animation-delay: .08s; }
.finding:nth-of-type(3)  { animation-delay: .11s; }
.finding:nth-of-type(4)  { animation-delay: .14s; }
.finding:nth-of-type(5)  { animation-delay: .17s; }
.finding:nth-of-type(n+6){ animation-delay: .20s; }

/* Lane (roadmap) entrance */
.lane { animation: fadeInUp .4s cubic-bezier(.4,0,.2,1) backwards; }
.roadmap > .lane:nth-child(1) { animation-delay: .04s; }
.roadmap > .lane:nth-child(2) { animation-delay: .12s; }
.roadmap > .lane:nth-child(3) { animation-delay: .20s; }
.roadmap > .lane:nth-child(4) { animation-delay: .28s; }

/* Toolbar fade in slightly later than content above */
.toolbar { animation: fadeIn .4s ease-out .15s backwards; }

/* Findings table reveal */
.findings-table { animation: fadeIn .35s ease-out .1s backwards; }

/* Upload-status pills — staggered scale-in */
.upload-status .pill { animation: scaleIn .35s cubic-bezier(.4,0,.2,1) backwards; }
.upload-status .pill:nth-child(1) { animation-delay: .15s; }
.upload-status .pill:nth-child(2) { animation-delay: .20s; }
.upload-status .pill:nth-child(3) { animation-delay: .25s; }
.upload-status .pill:nth-child(4) { animation-delay: .30s; }
.upload-status .pill:nth-child(5) { animation-delay: .35s; }

/* Critical badges get a one-time attention pulse */
.finding.critical > .head .badge.critical { animation: pulseRing 2.4s cubic-bezier(.4,0,.6,1) 1; }

/* Sidebar nav links — smooth entrance */
.nav a { transition: background .15s ease, color .15s ease, padding-left .15s ease; }
.nav a:hover { padding-left: 14px; }

/* Card hover lift */
.card { transition: transform .15s cubic-bezier(.4,0,.2,1), box-shadow .15s ease, border-color .15s ease; }
.card:hover { transform: translateY(-2px); border-color: #c1c8d4; box-shadow: var(--shadow); }

/* Score card hover (already has transition) — enhance */
.score-card { transition: transform .15s cubic-bezier(.4,0,.2,1), box-shadow .15s ease, border-color .15s ease; }

/* KPI cards subtle hover */
.kpi { transition: transform .15s cubic-bezier(.4,0,.2,1), box-shadow .15s ease; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* Area cards subtle hover */
.area { transition: transform .15s cubic-bezier(.4,0,.2,1), box-shadow .15s ease; }
.area:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* Risk cards hover */
.risk { transition: transform .15s cubic-bezier(.4,0,.2,1), box-shadow .15s ease, border-color .15s ease; }
.risk:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #c1c8d4; }

/* TLC (legacy traffic light) cards hover */
.tlc { transition: transform .15s cubic-bezier(.4,0,.2,1), box-shadow .15s ease; }
.tlc:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

/* Buttons — subtle press feedback */
.btn, .btn.ghost { transition: transform .08s ease, background .15s ease, color .15s ease, border-color .15s ease; }
.btn:active, .btn.ghost:active { transform: scale(0.97); }

/* Findings table row hover */
.findings-table tbody tr { transition: background .12s ease; }

/* Expand toggle ▼ rotation hint */
.expand-toggle { transition: color .15s ease; }
.expand-toggle:hover { color: var(--accent-2); }

/* ============================================================
   UI POLISH PASS — applied last to override earlier rules
   ============================================================ */

/* Body — better default rendering */
body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern", "liga", "calt";
}

/* Custom scrollbars (sidebar) */
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: #d8dde7; border-radius: 999px; border: 2px solid #ffffff;
}
.sidebar::-webkit-scrollbar-thumb:hover { background: #a8b0bd; }

/* Sidebar polish */
.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--border);
  box-shadow: 1px 0 0 rgba(15,23,42,0.02), 4px 0 12px rgba(15,23,42,0.02);
  padding: 20px 16px 32px;
}
.nav-section {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--text-mute);
  margin: 18px 10px 6px;
  text-transform: uppercase;
}
.nav a {
  position: relative;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-dim);
  padding: 8px 12px 8px 14px;
  border-radius: 8px;
  margin-bottom: 1px;
}
.nav a:hover {
  background: rgba(227, 24, 55, 0.04);
  color: var(--text);
  padding-left: 16px;
}
.nav a:hover::before {
  content: ''; position: absolute; left: 4px; top: 8px; bottom: 8px;
  width: 2px; background: var(--accent); border-radius: 2px;
}
.nav a.active {
  background: rgba(227, 24, 55, 0.08);
  color: var(--text);
  font-weight: 600;
}
.nav a.active::before {
  content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px;
  width: 3px; background: var(--accent); border-radius: 2px;
}
.nav .num {
  font-variant-numeric: tabular-nums;
  color: var(--text-mute);
}

/* Brand polish */
.brand {
  padding: 10px 10px 16px;
}
.brand:hover { background: rgba(227, 24, 55, 0.04); }
.brand .title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.005em;
}
.brand .subtitle {
  font-size: 11.5px;
  color: var(--text-mute);
  margin-top: 1px;
}
.brand .chev {
  font-size: 10px;
  color: var(--text-mute);
  margin-left: 2px;
}

/* Hero — bigger, more premium */
.hero {
  background: linear-gradient(135deg, #ffffff 0%, #f6f7f9 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 36px;
  margin: 4px 0 28px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, #ff5571 100%);
  border-radius: 16px 16px 0 0;
}
.hero h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 0 0 10px;
  color: var(--text);
}
.hero .lead {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-dim);
  max-width: 760px;
}
.hero .meta {
  font-size: 12.5px;
  color: var(--text-mute);
  margin-top: 12px;
  font-weight: 500;
}

/* Exec hero (leadership) — premium feel */
.exec-hero {
  background:
    radial-gradient(900px 360px at 90% -30%, rgba(227,24,55,0.08), transparent 60%),
    linear-gradient(135deg, #ffffff 0%, #f6f7f9 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 40px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.exec-hero::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, #ff5571 50%, var(--accent) 100%);
  border-radius: 18px 18px 0 0;
}
.exec-hero h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.1;
}
.exec-hero .verdict {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
}

/* Score ring polish */
.score-ring {
  width: 104px; height: 104px;
  background: conic-gradient(var(--score-color, var(--ok)) calc(var(--score, 70) * 1%), #e8eaf0 0);
  filter: drop-shadow(0 2px 8px rgba(15,23,42,0.06));
}
.score-ring::after { inset: 9px; }
.score-ring .num {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.score-ring .lbl {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--text-mute);
}

/* H2 polish — section headings */
h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--text);
  margin: 36px 0 16px;
  position: relative;
  padding-left: 14px;
}
h2::before {
  content: ''; position: absolute;
  left: 0; top: 5px; bottom: 6px;
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
}
h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--text-mute);
  text-transform: uppercase;
  margin: 22px 0 10px;
}
.lead { font-size: 16px; line-height: 1.7; }

/* Cards — consistent shadow + hover */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-xs);
  transition: transform .18s cubic-bezier(.4,0,.2,1),
              box-shadow .18s ease,
              border-color .18s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.card .stat {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.025em;
  color: var(--text);
  line-height: 1.05;
}
.card .stat-lbl {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--text-mute);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.card h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* Score cards — elevated treatment */
.score-card {
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
}
.score-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.score-card .name {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -.005em;
  color: var(--text);
}
.score-card .num-pill {
  background: var(--surface-2);
  font-weight: 600;
  letter-spacing: .04em;
}
.score-card .meter {
  height: 4px;
  background: #e8eaf0;
  margin-top: 12px;
}
.score-card .meter > span {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--score-color, var(--ok)) 0%, color-mix(in srgb, var(--score-color, var(--ok)) 70%, white) 100%);
}

/* KPI cards — bigger, more confident */
.kpi {
  background: var(--surface);
  border-radius: 12px;
  padding: 20px 22px 18px;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border);
}
.kpi::before {
  width: 3px;
}
.kpi .lbl {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}
.kpi .v {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.05;
  margin-top: 8px;
  color: var(--kpi-color, var(--text));
}
.kpi .v small {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-mute);
}
.kpi .desc { font-size: 13px; color: var(--text-dim); margin-top: 6px; }

/* Severity badges — refined with tint */
.badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 2px currentColor;
  opacity: 0.25;
}
.badge.critical { background: var(--tint-critical); color: var(--critical); }
.badge.high     { background: var(--tint-high);     color: var(--high); }
.badge.medium   { background: var(--tint-medium);   color: var(--medium); }
.badge.low      { background: var(--tint-low);      color: var(--low); }
.badge.info     { background: rgba(107,114,128,.08); color: #6b7280; }
.badge.pass     { background: var(--tint-pass);     color: var(--pass); }

/* Findings — refined treatment */
.finding {
  background: var(--surface);
  border-radius: 12px;
  padding: 18px 22px;
  box-shadow: var(--shadow-xs);
  margin: 12px 0;
  border: 1px solid var(--border);
  border-left: 4px solid var(--medium);
  transition: box-shadow .15s ease, transform .15s ease;
}
.finding:hover {
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}
.finding.critical { border-left-color: var(--critical); background: linear-gradient(90deg, var(--tint-critical) 0%, var(--surface) 80px); }
.finding.high     { border-left-color: var(--high);     background: linear-gradient(90deg, var(--tint-high)     0%, var(--surface) 80px); }
.finding.medium   { border-left-color: var(--medium);   background: linear-gradient(90deg, var(--tint-medium)   0%, var(--surface) 80px); }
.finding.low      { border-left-color: var(--low);      background: linear-gradient(90deg, var(--tint-low)      0%, var(--surface) 80px); }
.finding.info     { border-left-color: var(--info);     }
.finding.pass     { border-left-color: var(--pass);     background: linear-gradient(90deg, var(--tint-pass)     0%, var(--surface) 80px); }
.finding .head h4 {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -.005em;
  color: var(--text);
}
.finding .body { font-size: 14.5px; line-height: 1.65; color: var(--text-dim); }
.finding .rec {
  background: var(--tint-pass);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  border-left: 3px solid var(--pass);
}

/* Buttons */
.btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -.005em;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(227,24,55,.20), inset 0 -1px 0 rgba(0,0,0,.06);
  transition: background .15s ease, transform .08s ease, box-shadow .15s ease;
}
.btn:hover {
  background: var(--accent-dark);
  box-shadow: 0 4px 10px rgba(227,24,55,.25), inset 0 -1px 0 rgba(0,0,0,.08);
}
.btn:active { transform: scale(0.97); box-shadow: 0 1px 2px rgba(227,24,55,.20); }
.btn.ghost {
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn.ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--text-mute);
}

/* Toolbar — premium feel */
.toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow-xs);
}
.toolbar input[type="text"], .toolbar select {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.toolbar input[type="text"]:focus, .toolbar select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(227,24,55,.12);
}

/* Findings table — sticky header + zebra */
.findings-table {
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.findings-table thead th {
  background: var(--surface-3);
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.findings-table tbody tr {
  transition: background .12s ease;
}
.findings-table tbody tr:nth-child(4n+1) {
  background: var(--surface-3);
}
.findings-table tbody tr:hover {
  background: rgba(227,24,55,.03);
}
.findings-table tbody td {
  padding: 12px 14px;
  font-size: 13.5px;
}
.findings-table .col-id {
  font-weight: 600;
  color: var(--text-mute);
}

/* Status pill — premium */
.status-pill {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  box-shadow: var(--shadow-xs);
}

/* Areas (leadership) — better borders + hover */
.area {
  border-radius: 14px;
  padding: 22px 24px 20px;
  box-shadow: var(--shadow-xs);
  border-top-width: 5px;
  transition: transform .18s cubic-bezier(.4,0,.2,1), box-shadow .18s ease;
}
.area:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.area .title { font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.area .ahead { padding-bottom: 12px; }
.area .label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .14em;
}
.area .row p { font-size: 14.5px; line-height: 1.65; }

/* Risk cards — premium */
.risk {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: var(--shadow-xs);
  transition: transform .18s cubic-bezier(.4,0,.2,1), box-shadow .18s ease, border-color .18s ease;
}
.risk:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.risk h4 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--text);
}
.risk .num {
  width: 38px; height: 38px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

/* Lanes (roadmap) */
.lane {
  border-radius: 14px;
  padding: 18px 22px 16px;
  border-top-width: 4px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow .15s ease, transform .15s ease;
}
.lane:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* Score ring sizing on hero */
.hero .score-ring, .exec-hero .score-ring { width: 116px; height: 116px; }
.hero .score-ring .num, .exec-hero .score-ring .num { font-size: 30px; }

/* Code blocks — premium */
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.6;
  position: relative;
  overflow-x: auto;
}
pre::-webkit-scrollbar { height: 6px; }
pre::-webkit-scrollbar-thumb { background: #cdd3de; border-radius: 999px; }

/* Inline code */
code:not(pre code) {
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 12.5px;
  color: var(--text);
  border: 1px solid var(--border);
}

/* Pager */
.pager a {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  box-shadow: var(--shadow-xs);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.pager a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  color: var(--text);
}
.pager .lbl {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--text-mute);
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* Charts — better card containers */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow .15s ease;
}
.chart-card:hover { box-shadow: var(--shadow-md); }
.chart-card h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--text-mute);
}
.chart-card .sub { font-size: 13px; color: var(--text-mute); margin-bottom: 14px; }

/* Severity dot in tables */
.sev-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
  box-shadow: 0 0 0 2px currentColor;
  opacity: 0.85;
}

/* Tag pills — refined */
.tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid var(--border);
}

/* Path chips — code-like */
.path {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--code-bg);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

/* Score-ring score-num override on areas */
.area .score-num {
  font-weight: 800;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

/* Dropdown polish */
.platform-menu {
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.platform-menu a {
  border-radius: 8px;
  padding: 10px 12px;
  transition: background .12s ease, transform .08s ease;
}
.platform-menu a:hover { background: rgba(227,24,55,.05); transform: translateX(2px); }
.platform-menu a.active { background: rgba(227,24,55,.08); font-weight: 600; }

/* Dropzone polish */
.dropzone {
  border-radius: 14px;
  padding: 28px 22px;
  border-width: 2px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: all .18s cubic-bezier(.4,0,.2,1);
}
.dropzone:hover {
  border-color: var(--accent-2);
  background: rgba(37,99,235,.03);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.dropzone .dz-icon { font-size: 32px; margin-bottom: 10px; }

/* Print friendliness */
@media print {
  .sidebar, .toolbar, .pager, .btn { display: none !important; }
  .app { grid-template-columns: 1fr; }
  body { background: white; color: black; }
  .main { padding: 0; max-width: none; }
  .exec-hero, .kpi, .tlc, .risk, .lane { background: #fafafa; border-color: #ddd; color: black; }
}


