:root {
  --bg: #0B1220; --surface: #111A2E; --surface-2: #1A2540;
  --border: #25324D; --text: #E6EAF2; --text-muted: #8B96AD;
  --accent: #008CFF; --accent-hover: #1FA0FF;
  --fail: #EF4444; --pass: #10B981; --manual: #94A3B8; --advisory: #60A5FA;
  --p1: #C0392B; --p2: #E67E22; --p3: #F1C40F; --p4: #27AE60;
  --d-access: #8E44AD; --d-conn: #2980B9; --d-cyber: #C0392B;
  --d-data: #E67E22; --d-platform: #2C3E50;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 Inter, system-ui, sans-serif;
  display: flex; flex-direction: column; height: 100vh;
}
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo { height: 28px; }
.divider { width: 1px; height: 24px; background: var(--border); }
.topbar h1 { margin: 0; font-size: 18px; font-weight: 700; }
.subtitle { color: var(--text-muted); font-size: 13px; }
.status { display: flex; align-items: center; gap: 8px;
  color: var(--text-muted); font-size: 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted); }
.status-dot.connected { background: var(--pass); }
.stepper {
  display: flex; gap: 8px; padding: 12px 24px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.step {
  flex: 1; padding: 10px 14px; border-radius: 8px;
  background: var(--surface-2); color: var(--text-muted);
  font-weight: 600; cursor: default;
  border-bottom: 3px solid transparent;
}
.step .num {
  display: inline-flex; width: 22px; height: 22px; border-radius: 50%;
  background: var(--border); align-items: center; justify-content: center;
  margin-right: 8px; font-size: 12px;
}
.step.active { color: var(--text); border-bottom-color: var(--accent); }
.step.active .num { background: var(--accent); color: #fff; }
.step.done { color: var(--text); }
.step.done .num { background: var(--pass); color: #fff; }
.step.clickable { cursor: pointer; }
.step.clickable:hover { background: var(--surface); }
.layout { flex: 1; display: flex; min-height: 0; }
.main-pane { flex: 1; padding: 24px; overflow-y: auto; }
.chat-panel {
  width: 360px; display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--border);
}
.chat-panel[hidden] { display: none; }
.chat-header {
  padding: 12px 16px; font-weight: 700;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase; font-size: 11px; letter-spacing: 0.08em;
  color: var(--text-muted);
}
.chat-scroll { flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px; }
.msg { padding: 10px 12px; border-radius: 10px; max-width: 90%;
  font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.msg.user { background: var(--accent); color: #fff; align-self: flex-end; }
.msg.assistant { background: var(--surface-2);
  border: 1px solid var(--border); align-self: flex-start; }
.msg .chip-dl {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  padding: 6px 10px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; color: var(--accent); text-decoration: none;
  font-size: 12px;
}
.msg .chip-dl:hover { border-color: var(--accent); }
.chat-composer { display: flex; gap: 8px; padding: 12px;
  border-top: 1px solid var(--border); }
.chat-composer textarea {
  flex: 1; resize: none; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  font: inherit;
}
.chat-composer textarea:focus { outline: none; border-color: var(--accent); }
.btn {
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit;
  font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--surface); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent);
  color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
}
input[type=text], select {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font: inherit;
}
input[type=text]:focus, select:focus {
  outline: none; border-color: var(--accent);
}
/* Step 1 */
.step1 { max-width: 640px; margin: 40px auto;
  display: flex; flex-direction: column; gap: 20px; }
.dropzone {
  border: 2px dashed var(--border); border-radius: 12px;
  padding: 48px 24px; text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent); background: var(--surface);
}
.dropzone .hint { color: var(--text-muted); font-size: 13px;
  margin-top: 8px; }
.dropzone.has-file { border-style: solid; border-color: var(--pass); }
.skip-link { text-align: center; color: var(--accent); cursor: pointer;
  font-size: 13px; }
.skip-link:hover { text-decoration: underline; }
/* Step 2 */
.stat-row { display: flex; gap: 12px; margin-bottom: 20px; }
.stat-card { flex: 1; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 14px;
  transition: border-color .12s, transform .12s, box-shadow .12s; }
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { border-color: var(--accent);
  transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,140,255,.18); }
.stat-card.clickable:focus-visible { outline: 2px solid var(--accent);
  outline-offset: 2px; }
.stat-card.active { border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent); }
.stat-card .v { font-size: 28px; font-weight: 800; }
.stat-card .l { color: var(--text-muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.05em; }
.pill.nis { background: #475569; }
.topic-line { display: flex; align-items: center; gap: 8px; }
.evidence-line { color: var(--text-muted); font-size: 12px;
  margin-top: 3px; max-width: 640px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-badge { display: inline-block; padding: 1px 7px; border-radius: 9px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; flex-shrink: 0; }
.src-badge.src-checker { background: #1f2937; color: #cbd5e1;
  border: 1px solid #334155; }
.src-badge.src-llm { background: var(--accent); color: #fff; }
.src-badge.src-router { background: #475569; color: #fff; }
.src-badge.src-default { background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); }
.src-badge.src-entitlement { background: #7F8C8D; color: #fff; }
.dz-files { list-style: none; padding: 0; margin: 12px 0 0;
  text-align: left; }
.dz-files li { display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 10px; margin: 4px 0;
  font-size: 13px; }
.dz-files .dz-name { flex: 1; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.dz-files .dz-size { color: var(--text-muted); font-size: 11px; }
.dz-files .dz-rm { background: transparent; border: none;
  color: var(--text-muted); cursor: pointer; font-size: 13px;
  padding: 2px 6px; }
.dz-files .dz-rm:hover { color: var(--fail); }
.dropzone { position: relative; }
.dz-native-input { position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; z-index: 1; }
.dz-files, .dz-rm { position: relative; z-index: 2; }
.iso-warn { background: #3b2a05; border: 1px solid #7a5a0a;
  border-radius: 8px; padding: 12px 14px; color: #fde68a;
  font-size: 13px; line-height: 1.5; margin-bottom: 14px; }
.iso-warn b { color: #fbbf24; }
.iso-warn code { background: rgba(255,255,255,.08); padding: 1px 5px;
  border-radius: 4px; }
.ana-progress { margin-top: 14px; }
.ana-bar { height: 8px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 999px;
  overflow: hidden; }
.ana-fill { height: 100%; width: 0%; background: var(--accent);
  transition: width .3s ease; }
.ana-label { color: var(--text-muted); font-size: 12px;
  margin-top: 6px; font-variant-numeric: tabular-nums; }
.arch-tile.clickable { cursor: pointer; transition: transform .1s,
  box-shadow .1s; }
.arch-tile.clickable:hover { transform: translateY(-1px);
  box-shadow: 0 0 0 2px var(--accent); }
.arch-tile.muted { cursor: not-allowed; opacity: .85; }
.arch-row-label.clickable { cursor: pointer; }
.arch-row-label.clickable:hover { color: var(--accent); }
.llm-banner { position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; background: #3b2a05;
  border-bottom: 1px solid #7a5a0a; color: #fde68a; font-size: 13px; }
.llm-banner b { color: #fbbf24; }
.llm-banner-dot { width: 8px; height: 8px; border-radius: 50%;
  background: #f59e0b; box-shadow: 0 0 6px #f59e0b; flex-shrink: 0; }
.llm-banner-reason { color: #d6c47a; font-family: ui-monospace, monospace;
  font-size: 12px; margin-left: auto; max-width: 50%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.llm-banner-x { background: transparent; border: none; color: #fde68a;
  cursor: pointer; font-size: 14px; padding: 2px 6px; }
.llm-banner-x:hover { color: #fff; }
.heatmap { border-collapse: separate; border-spacing: 0; width: 100%;
  margin-bottom: 22px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.heatmap th, .heatmap td { padding: 10px 14px; text-align: center;
  border-bottom: 1px solid var(--border); font-size: 13px; }
.heatmap tr:last-child td { border-bottom: none; }
.heatmap th { background: var(--surface2); color: var(--text-muted);
  font-weight: 600; font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; }
.heatmap th.dom-h { text-align: left; padding-left: 18px; }
.heatmap th.tot-h { color: var(--text); }
.heatmap .prio-dot { display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.heatmap td.dom { text-align: left; color: var(--text); font-weight: 600;
  cursor: pointer; padding-left: 14px;
  background: linear-gradient(90deg, rgba(255,255,255,.02), transparent); }
.heatmap td.dom:hover { color: var(--accent); }
.heatmap td.dom .dom-nis { display: inline-block; margin-left: 8px;
  padding: 1px 7px; border-radius: 9px; background: var(--surface2);
  color: var(--text-muted); font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .04em; }
.heatmap td.cell { cursor: pointer; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums;
  transition: box-shadow .1s, transform .1s; }
.heatmap td.cell:hover { box-shadow: inset 0 0 0 2px var(--accent);
  transform: scale(1.02); }
.heatmap td.cell.zero { color: var(--text-muted); cursor: default;
  font-weight: 400; background: transparent !important; }
.heatmap td.cell.zero:hover { box-shadow: none; transform: none; }
.heatmap td.tot { font-weight: 700; color: var(--text);
  background: var(--surface2); font-variant-numeric: tabular-nums; }
.heatmap tr.muted-row td { opacity: .55; }
.heatmap tr.muted-row td.dom { opacity: .8; }
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px;
  align-items: center; }
.filter-bar select { min-width: 160px; }
.findings-table { width: 100%; border-collapse: collapse; }
.findings-table th { text-align: left; padding: 10px;
  border-bottom: 1px solid var(--border); color: var(--text-muted);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.findings-table td { padding: 10px;
  border-bottom: 1px solid var(--border); }
.findings-table tr.row { cursor: pointer; }
.findings-table tr.row:hover { background: var(--surface-2); }
.findings-table tr.detail td { background: var(--surface);
  font-size: 13px; color: var(--text-muted); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 700; color: #fff; }
.pill.p1 { background: var(--p1); } .pill.p2 { background: var(--p2); }
.pill.p3 { background: var(--p3); color: #1a1a1a; }
.pill.p4 { background: var(--p4); }
.pill.fail { background: var(--fail); } .pill.pass { background: var(--pass); }
.pill.manual { background: var(--manual); }
.pill.advisory { background: var(--advisory); }
.actions-bar { display: flex; justify-content: flex-end;
  margin-top: 20px; gap: 10px; }
/* Step 3 */
.report-grid { display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; }
.report-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
  display: flex; flex-direction: column; gap: 12px; }
.report-card h3 { margin: 0; }
.report-card p { margin: 0; color: var(--text-muted); font-size: 13px; }
.report-card .actions { display: flex; gap: 8px; align-items: center; }
.report-card .result { display: flex; gap: 8px; align-items: center;
  margin-top: 4px; }
.report-card a.dl { color: var(--accent); text-decoration: none;
  font-weight: 600; }
.report-card a.dl:hover { text-decoration: underline; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.preview-frame { width: 100%; height: 400px; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; margin-top: 12px; }

/* Architecture tile heatmap — 7 rows × variable tiles. */
.arch-heatmap {
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.arch-title {
  font-weight: 700; font-size: 14px; color: var(--text);
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.05em;
}
.arch-row {
  display: flex; gap: 4px; margin-bottom: 4px;
}
.arch-row-label {
  flex: 0 0 160px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 10px;
  font-weight: 700;
  font-size: 11px;
  border-radius: 6px;
  display: flex; align-items: center;
}
.arch-row-tiles {
  flex: 1; display: flex; gap: 4px; flex-wrap: wrap;
}
.arch-tile {
  flex: 1 1 90px;
  min-height: 34px;
  padding: 4px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  line-height: 1.2;
  border: 1px solid rgba(255,255,255,0.15);
  cursor: default;
}
.arch-legend {
  display: flex; gap: 16px; margin-top: 12px;
  padding-top: 10px; border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.arch-legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-muted);
}
.arch-swatch {
  display: inline-block; width: 14px; height: 14px; border-radius: 3px;
}
