/* ============================================================
   QuantumShield — NeoBrutalist Design System
   Thick borders, hard offset shadows, flat saturated color,
   bold type. Reference: temp/neobrutalism-com-ref-uiuxshowcase-com.md
   (qualitative reference — "hard shadows, thick borders, high
   contrast, type you notice"; tokens below are our own translation
   of that language, not lifted values, since the reference has none).
   ============================================================ */

:root {
  --ink: #111111;
  --paper: #FFFDF7;
  --panel: #FFFFFF;

  --violet: #7C5CFC;
  --violet-deep: #5B3DE0;
  --cyan: #4CE0D2;
  --yellow: #FFD400;
  --pink: #FF6FB0;

  --critical: #FF3B30;
  --critical-bg: #FFE2DE;
  --high: #FF8A00;
  --high-bg: #FFE9CC;
  --medium: #E0B400;
  --medium-bg: #FFF3C2;
  --low: #1FA971;
  --low-bg: #D6F5E6;

  --muted: #55535C;
  --line: var(--ink);

  --font-display: 'Space Grotesk', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --bw: 3px;
  --bw-lg: 4px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-full: 9999px;

  --shadow-sm: 3px 3px 0 var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --shadow-lg: 8px 8px 0 var(--ink);
  --press: transform 0.08s ease, box-shadow 0.08s ease;
}

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

html, body {
  height: 100%;
  font-family: var(--font-body);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--ink) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink) 1px, transparent 1px);
  background-size: 28px 28px;
  background-attachment: fixed;
  background-position: -1px -1px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body { background-color: var(--paper); }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-color: rgba(255, 253, 247, 0.86);
  z-index: -1;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ============================================================ App shell */

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

.sidebar {
  width: 264px;
  background-color: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
  overflow-y: auto;
  border-right: var(--bw-lg) solid var(--ink);
  box-shadow: var(--shadow-lg);
  transition: transform 0.25s ease;
}

.sidebar-header {
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: var(--bw) solid rgba(255, 255, 255, 0.15);
}

.sidebar-brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.35));
}

.sidebar-brand {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--paper);
  text-transform: uppercase;
  white-space: nowrap;
}

.sidebar-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--yellow);
  color: var(--ink);
  border: 1.5px solid var(--paper);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  white-space: nowrap;
}

.sidebar-inner-toggle {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: var(--paper);
  border-radius: var(--radius-sm);
  padding: 5px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--press);
}

.sidebar-inner-toggle:hover {
  background: var(--yellow);
  border-color: var(--paper);
  color: var(--ink);
  box-shadow: 2px 2px 0px var(--paper);
}

.sidebar-nav {
  padding: 18px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.nav-group-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #A8A6B0;
  padding: 0 8px 6px;
  font-weight: 700;
}

.nav-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  color: #D9D7E3;
  font-size: 13.5px;
  font-weight: 600;
  transition: var(--press);
}

.nav-item a:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--paper);
}

.nav-item.active a {
  background-color: var(--cyan);
  color: var(--ink);
  border-color: var(--paper);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.4);
}

.nav-item .nav-tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  color: #8B899490;
  border: 1px solid #8B899460;
  padding: 1px 5px;
  border-radius: 4px;
}

.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 16px 20px;
  border-top: var(--bw) solid rgba(255, 255, 255, 0.15);
}

.user-profile { display: flex; align-items: center; gap: 10px; }

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--violet);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: var(--ink);
  border: 2px solid var(--paper);
}

.user-info { flex: 1; min-width: 0; }

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--paper);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-org { font-size: 11px; color: #A8A6B0; }

.logout-btn {
  color: #D9D7E3;
  padding: 7px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  transition: var(--press);
}

.logout-btn:hover { color: var(--ink); background: var(--yellow); border-color: var(--paper); }

.main-viewport {
  margin-left: 264px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 64px;
  background-color: var(--panel);
  border-bottom: var(--bw-lg) solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }

.topbar-breadcrumb {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.topbar-right { display: flex; align-items: center; gap: 14px; }

.posture-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: var(--critical-bg);
  color: var(--ink);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  box-shadow: var(--shadow-sm);
}

.posture-dot {
  width: 8px; height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--critical);
  border: 1px solid var(--ink);
}

.page-container { padding: 32px; max-width: 1440px; margin: 0 auto; width: 100%; }

.page-heading { margin-bottom: 28px; }

.page-title {
  font-size: 30px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.page-subtitle { font-size: 14px; color: var(--muted); font-weight: 500; }

/* ============================================================ Cards & grids */

.card {
  background-color: var(--panel);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.card-header-clean {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.card-subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-bottom: 24px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-bottom: 24px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; margin-bottom: 24px; }

.metric-card {
  background-color: var(--panel);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--press);
}

.metric-card:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }

.metric-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

.metric-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.metric-icon-wrap {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background-color: var(--yellow);
  border: 2px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
}

.metric-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 36px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 6px;
}

.metric-footer { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; }

/* ============================================================ Badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 2px solid var(--ink);
}

.badge-critical { background-color: var(--critical); color: var(--ink); }
.badge-high { background-color: var(--high); color: var(--ink); }
.badge-medium { background-color: var(--medium); color: var(--ink); }
.badge-low { background-color: var(--low); color: var(--ink); }
.badge-blue { background-color: var(--cyan); color: var(--ink); }
.badge-neutral { background-color: #EDEBE3; color: var(--ink); }

/* ============================================================ Tables */

.table-responsive { width: 100%; overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 13.5px;
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.data-table th {
  padding: 12px 16px;
  background-color: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 14px 16px;
  border-top: 2px solid var(--ink);
  color: var(--ink);
  vertical-align: middle;
  background: var(--panel);
}

.data-table tbody tr:hover td { background-color: #FFF1B8; }

.asset-cell { display: flex; flex-direction: column; }
.asset-name { font-weight: 700; color: var(--ink); }
.asset-endpoint { font-size: 12px; color: var(--muted); }

.code-badge {
  font-family: var(--font-mono);
  background-color: var(--paper);
  color: var(--ink);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  border: 2px solid var(--ink);
}

/* ============================================================ Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--press);
  border: var(--bw) solid var(--ink);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }

.btn-primary { background-color: var(--cyan); color: var(--ink); }
.btn-primary:hover { background-color: #3FD0C2; }

.btn-secondary { background-color: var(--panel); color: var(--ink); }
.btn-secondary:hover { background-color: var(--yellow); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: transparent;
  box-shadow: none;
  padding: 7px 12px;
  text-transform: none;
}
.btn-ghost:hover { background: #EDEBE3; border-color: var(--ink); }
.btn-ghost:active { transform: none; box-shadow: none; }

.btn-sm { padding: 7px 13px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; box-shadow: var(--shadow); }
.btn-lg:active { transform: translate(4px, 4px); }

/* ============================================================ Forms */

.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius-sm);
  background-color: var(--panel);
  color: var(--ink);
  font-size: 13.5px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  outline: none;
}

.form-control:focus { box-shadow: 4px 4px 0 var(--cyan); transform: translate(-2px, -2px); }
.form-control::placeholder { color: #9C9AA3; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

select.form-control { appearance: none; cursor: pointer; }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 2px solid #EDEBE3;
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-weight: 600; font-size: 13.5px; }
.toggle-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }

.toggle {
  position: relative;
  width: 46px; height: 26px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--press);
}
.toggle-track::before {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: var(--ink);
  border-radius: 50%;
  transition: var(--press);
}
.toggle input:checked + .toggle-track { background: var(--cyan); }
.toggle input:checked + .toggle-track::before { transform: translateX(20px); }

/* ============================================================ Progress / bars */

.progress-bar-container {
  width: 100%;
  height: 12px;
  background-color: var(--panel);
  border: 2px solid var(--ink);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill { height: 100%; transition: width 0.6s ease; }

.bg-critical { background-color: var(--critical); }
.bg-high { background-color: var(--high); }
.bg-medium { background-color: var(--medium); }
.bg-low { background-color: var(--low); }
.bg-blue { background-color: var(--cyan); }
.bg-violet { background-color: var(--violet); }

.bar-chart { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 44px; align-items: center; gap: 12px; }
.bar-row-label { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.bar-row-value { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; text-align: right; }
.bar-track {
  height: 18px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--panel);
  overflow: hidden;
}
.bar-fill { height: 100%; border-right: 2px solid var(--ink); }

.sparkline { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding: 4px; }
.sparkline-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.sparkline-bar { width: 100%; border: 2px solid var(--ink); border-radius: 4px 4px 0 0; background: var(--violet); }
.sparkline-label { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }

/* ============================================================ AI panel */

.ai-panel {
  background: var(--panel);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  position: relative;
}

.ai-panel-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

.ai-badge {
  background: var(--violet);
  color: var(--paper);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
}

.ai-explanation { font-size: 14.5px; color: var(--ink); line-height: 1.65; margin-bottom: 18px; font-weight: 500; }

.key-findings-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.key-findings-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 500;
}
.key-findings-list li::before {
  content: "▲";
  color: var(--violet);
  font-size: 11px;
  line-height: 1.5;
}

/* ============================================================ HNDL flow diagram */

.hndl-flow-diagram {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 18px;
  background-color: var(--panel);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.flow-step { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 150px; padding: 12px; }

.flow-step-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-full);
  background-color: var(--yellow);
  border: var(--bw) solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.flow-step-title { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.flow-step-desc { font-size: 11.5px; color: var(--muted); }
.flow-arrow { color: var(--ink); font-size: 22px; padding: 0 8px; font-weight: 800; }

/* ============================================================ Scanner */

.scan-progress-box {
  padding: 36px 24px;
  text-align: center;
  border: var(--bw) dashed var(--ink);
  border-radius: var(--radius);
  background: var(--cyan);
}

.spinner {
  width: 38px; height: 38px;
  border: 4px solid var(--ink);
  border-top-color: var(--paper);
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }
.htmx-request.htmx-indicator { display: inline-block; }

/* ============================================================ Login */

.login-split-page { display: flex; min-height: 100vh; }

.login-left-pane {
  flex: 1.2;
  background-color: var(--ink);
  color: var(--paper);
  padding: 64px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: var(--bw-lg) solid var(--ink);
  position: relative;
  overflow: hidden;
}

.login-left-pane::after {
  content: "";
  position: absolute;
  width: 340px; height: 340px;
  border-radius: 50%;
  background: var(--violet);
  filter: blur(0);
  opacity: 0.5;
  bottom: -120px;
  right: -80px;
  border: var(--bw-lg) solid var(--paper);
}

.login-right-pane {
  flex: 1;
  background-color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.login-card { width: 100%; max-width: 400px; position: relative; z-index: 1; }

.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand .sidebar-brand { font-size: 20px; }

.login-headline {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.login-pitch { color: #D9D7E3; font-size: 14.5px; line-height: 1.6; max-width: 420px; position: relative; z-index: 1; }

.login-demo-hint {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--paper);
  position: relative;
  z-index: 1;
}

.alert-banner {
  padding: 12px 16px;
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--critical-bg);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.alert-banner-success { background: var(--low-bg); }

input[type="range"] {
  width: 100%;
  accent-color: var(--violet);
  height: 22px;
}

/* ============================================================ Misc components */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  background: var(--panel);
}

.section-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}

.stat-strip {
  display: flex;
  gap: 0;
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.stat-strip-item {
  flex: 1;
  padding: 20px 22px;
  border-right: 2px solid var(--ink);
  background: var(--panel);
}
.stat-strip-item:last-child { border-right: none; }
.stat-strip-value { font-family: var(--font-mono); font-size: 30px; font-weight: 700; line-height: 1; margin-bottom: 6px; }
.stat-strip-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; }

.roadmap-list { display: flex; flex-direction: column; gap: 20px; }
.roadmap-phase {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  background: var(--panel);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.roadmap-phase-num {
  width: 44px; height: 44px;
  border: var(--bw) solid var(--ink);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  background: var(--yellow);
}
.roadmap-phase-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.roadmap-phase-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.roadmap-timeline { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin-bottom: 12px; }
.roadmap-tasks { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.roadmap-tasks li { font-size: 13px; padding-left: 18px; position: relative; }
.roadmap-tasks li::before { content: "—"; position: absolute; left: 0; color: var(--violet); font-weight: 700; }
.roadmap-deliverable {
  font-size: 12.5px;
  background: #EDEBE3;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 12px;
  font-weight: 600;
}

.rec-card, .report-card {
  background: var(--panel);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  font-weight: 600;
}

/* ============================================================ Responsive */

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
  .stat-strip { flex-direction: column; }
  .stat-strip-item { border-right: none; border-bottom: 2px solid var(--ink); }
  .stat-strip-item:last-child { border-bottom: none; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 264px !important;
  }
  .sidebar.open {
    transform: translateX(0) !important;
  }
  .main-viewport {
    margin-left: 0 !important;
  }
  .page-container { padding: 20px 16px; }
  .topbar { padding: 0 16px; }
  .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 90px 1fr 36px; }
  .login-split-page { flex-direction: column; }
  .login-left-pane { padding: 32px 24px; }
  .login-right-pane { padding: 32px 24px; }
  .login-headline { font-size: 28px; }
  .roadmap-phase { grid-template-columns: 1fr; }
}

/* ============================================================ Tab bar */

.tab-bar {
  display: flex;
  gap: 0;
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.tab-btn {
  flex: 1;
  padding: 14px 20px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  border: none;
  border-right: var(--bw) solid var(--ink);
  background: var(--panel);
  color: var(--muted);
  transition: var(--press);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-btn:last-child { border-right: none; }
.tab-btn:hover { background: #FFF1B8; color: var(--ink); }
.tab-btn.active { background: var(--cyan); color: var(--ink); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================ TLS Probe */

.tls-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.tls-detail-item {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.tls-detail-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 4px;
}

.tls-detail-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  word-break: break-all;
}

.tls-connection-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--low-bg);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 13px;
}

.tls-connection-banner.error {
  background: var(--critical-bg);
}

/* ============================================================ Horizon Simulator */

.horizon-card {
  background: var(--panel);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.horizon-slider-wrap {
  position: relative;
  margin: 24px 0 32px;
}

.horizon-year-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 8px;
}

.horizon-year-display {
  text-align: center;
  margin-bottom: 8px;
}

.horizon-year-value {
  font-family: var(--font-mono);
  font-size: 56px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1;
}

.horizon-era-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.horizon-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.horizon-metric-card {
  background: var(--paper);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--press);
}

.horizon-metric-value {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
}

.horizon-metric-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}

.mosca-panel {
  background: var(--paper);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.mosca-formula {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  padding: 14px;
  margin-bottom: 14px;
  color: var(--ink);
  line-height: 1.6;
}

.mosca-formula .mosca-danger { color: var(--critical); }
.mosca-formula .mosca-safe { color: var(--low); }

.mosca-narrative {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  font-weight: 500;
}

.horizon-threats {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.horizon-threats li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 500;
  padding: 10px 14px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
}

.horizon-threats li::before {
  content: "\26A0";
  font-size: 14px;
  flex-shrink: 0;
}

.horizon-trajectory {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 140px;
  padding: 4px;
}

.horizon-traj-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.horizon-traj-bar {
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: 4px 4px 0 0;
  transition: height 0.4s ease, background-color 0.4s ease;
}

.horizon-traj-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  font-weight: 700;
}

.horizon-traj-value {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

input[type="range"].horizon-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 14px;
  background: var(--panel);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

input[type="range"].horizon-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  background: var(--violet);
  border: var(--bw) solid var(--ink);
  border-radius: 50%;
  cursor: grab;
  box-shadow: var(--shadow-sm);
}

input[type="range"].horizon-range::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.1);
}

/* ============================================================ Upload drop zone */

.upload-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 24px;
  border: var(--bw) dashed var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  cursor: pointer;
  transition: var(--press);
  text-align: center;
}

.upload-drop-zone:hover {
  background: #FFF1B8;
  border-color: var(--violet);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow);
}

.upload-drop-zone.drag-over {
  background: var(--cyan);
  border-color: var(--ink);
  border-style: solid;
}

.upload-drop-text {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

.upload-drop-hint {
  font-size: 12px;
  color: var(--muted);
}

/* ============================================================ Company Assessment Banner */

.company-banner-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  margin-bottom: 24px;
  background: var(--paper);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.company-banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.company-banner-icon {
  width: 44px;
  height: 44px;
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  background: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.company-banner-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.company-banner-title strong,
.highlight-company {
  color: var(--violet);
  background: #EAE5FF;
  padding: 2px 8px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  box-shadow: 1px 1px 0px var(--ink);
  font-weight: 800;
}

.company-banner-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}

.company-switcher-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.switcher-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}

.company-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  padding: 4px 10px;
  font-size: 12.5px;
  box-shadow: var(--shadow-sm);
}

.company-pill strong {
  color: var(--violet);
}

@media (max-width: 768px) {
  .company-banner-card { flex-direction: column; align-items: flex-start; }
  .tls-detail-grid { grid-template-columns: 1fr; }
  .horizon-metrics { grid-template-columns: 1fr; }
  .horizon-year-value { font-size: 40px; }
  .mosca-formula { font-size: 14px; }
}

