
:root {
  --bg: #07100e;
  --panel: #0b1714;
  --panel-2: #10211c;
  --line: #1c3c32;
  --text: #ecfff8;
  --muted: #86a99d;
  --accent: #5dffb0;
  --accent-2: #1ecf88;
  --amber: #ffc857;
  --red: #ff647c;
  --blue: #69b9ff;
  --shadow: 0 18px 50px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% 10%, rgba(32, 122, 91, .18), transparent 32rem),
    linear-gradient(180deg, #07100e, #050b09);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(93,255,176,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(93,255,176,.025) 1px, transparent 1px);
  background-size: 34px 34px;
}
.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .13;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(255,255,255,.03) 4px);
  z-index: 10;
}
.topbar {
  min-height: 82px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(14px);
  background: rgba(7,16,14,.78);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 48px; height: 48px;
  border: 1px solid var(--accent);
  color: var(--accent);
  display: grid; place-items: center;
  font: 700 16px "IBM Plex Mono";
  box-shadow: inset 0 0 24px rgba(93,255,176,.09), 0 0 18px rgba(93,255,176,.08);
  clip-path: polygon(12% 0,100% 0,100% 88%,88% 100%,0 100%,0 12%);
}
h1,h2,h3,p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 19px; letter-spacing: .03em; }
h2 { font-size: clamp(26px, 4vw, 42px); line-height: 1.05; margin-bottom: 12px; }
p { color: var(--muted); line-height: 1.65; }
.eyebrow, label, .section-title, .metric span, footer, .system-state {
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: .12em;
  font-size: 11px;
  color: var(--accent);
}
.system-state { display: flex; gap: 8px; align-items: center; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.layout {
  width: min(1500px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: calc(100vh - 124px);
}
.sidebar {
  border-right: 1px solid var(--line);
  padding: 26px 18px;
}
.panel {
  background: linear-gradient(180deg, rgba(16,33,28,.94), rgba(10,23,19,.94));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.panel.compact { padding: 17px; }
.identity p { margin: 10px 0 0; font-size: 13px; }
.nav { display: grid; gap: 8px; margin: 22px 0; }
.nav-item, button {
  border: 1px solid var(--line);
  color: var(--text);
  background: #0a1512;
  padding: 12px 14px;
  font: 600 12px "IBM Plex Mono";
  cursor: pointer;
  transition: .2s ease;
}
.nav-item { text-align: left; width: 100%; border-radius: 8px; color: var(--muted); }
.nav-item:hover, .nav-item.active, button:hover {
  border-color: var(--accent-2);
  color: var(--accent);
  transform: translateY(-1px);
}
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.tags span, .control-tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 8px;
  font: 500 10px "IBM Plex Mono";
  color: var(--muted);
  background: #08120f;
}
.workspace { padding: 34px; min-width: 0; }
.view { display: none; }
.view.active { display: block; animation: rise .22s ease; }
@keyframes rise { from { opacity: .5; transform: translateY(6px); } }
.hero {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
  margin-bottom: 28px;
}
.hero.small h2 { font-size: 32px; }
.threat-meter {
  min-width: 150px; text-align: center;
  border: 1px solid var(--line); padding: 16px;
  background: rgba(8,18,15,.7);
}
.threat-meter span, .threat-meter small { display: block; color: var(--muted); font: 10px "IBM Plex Mono"; }
.threat-meter strong { display: block; color: var(--accent); font: 700 36px "IBM Plex Mono"; margin: 6px 0; }
.query-panel {
  border: 1px solid var(--line);
  background: rgba(11,23,20,.9);
  padding: 18px;
  border-radius: 14px;
  position: relative;
}
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 10px; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #050d0b;
  color: var(--text);
  padding: 14px;
  border-radius: 8px;
  outline: none;
  font: 15px Inter;
}
input:focus, textarea:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(93,255,176,.08); }
.primary {
  border-radius: 8px;
  color: #04110d;
  background: var(--accent);
  border-color: var(--accent);
}
.suggestions { position: absolute; left: 18px; right: 174px; top: 82px; z-index: 4; }
.suggestion {
  width: 100%; text-align: left; display: block;
  border-top: 0; background: #0d1c18; color: var(--text);
}
.empty-state {
  min-height: 410px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}
.radar {
  width: 150px; height: 150px; border-radius: 50%;
  border: 1px solid var(--line); position: relative; overflow: hidden;
  background: repeating-radial-gradient(circle, rgba(93,255,176,.11) 0 1px, transparent 1px 24px);
}
.radar::before, .radar::after {
  content:""; position:absolute; background:rgba(93,255,176,.18);
}
.radar::before { width:1px;height:100%;left:50%; }
.radar::after { height:1px;width:100%;top:50%; }
.radar-sweep {
  position:absolute; inset:0; border-radius:50%;
  background: conic-gradient(from 0deg, rgba(93,255,176,.42), transparent 18%);
  animation: sweep 2.8s linear infinite;
}
.radar-core {
  position:absolute;width:8px;height:8px;border-radius:50%;background:var(--accent);
  top:50%;left:50%;transform:translate(-50%,-50%);box-shadow:0 0 16px var(--accent);
}
@keyframes sweep { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.result-panel { display: grid; gap: 18px; margin-top: 24px; }
.result-header { display: flex; justify-content: space-between; gap: 22px; align-items: flex-start; }
.result-header h2 { font-size: 34px; margin-top: 6px; }
.severity-badge {
  min-width: 125px; text-align: center; padding: 12px;
  border: 1px solid; font: 700 12px "IBM Plex Mono"; border-radius: 8px;
}
.severity-critical, .severity-high { color: var(--red); border-color: var(--red); background: rgba(255,100,124,.08); }
.severity-medium { color: var(--amber); border-color: var(--amber); background: rgba(255,200,87,.08); }
.severity-low { color: var(--blue); border-color: var(--blue); background: rgba(105,185,255,.08); }
.metric-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.metric { border: 1px solid var(--line); background: #0a1512; border-radius: 10px; padding: 16px; }
.metric span { color: var(--muted); display: block; margin-bottom: 8px; }
.metric strong { font-size: 17px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.section-title { margin-bottom: 14px; }
ul,ol { margin: 0; padding-left: 20px; }
li { color: #cce5dc; line-height: 1.55; margin-bottom: 10px; }
.remediation { counter-reset: steps; list-style: none; padding: 0; }
.remediation li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; }
.remediation li::before {
  counter-increment: steps; content: counter(steps);
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 1px solid var(--accent-2); color: var(--accent);
  font: 600 11px "IBM Plex Mono";
}
.control-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.control-card { background: #08120f; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.control-card strong { display: block; font-size: 13px; margin-bottom: 7px; }
.control-card span { color: var(--muted); font-size: 12px; line-height: 1.5; }
textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.library-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.library-card {
  border: 1px solid var(--line); background: rgba(11,23,20,.9);
  border-radius: 12px; padding: 18px; cursor: pointer; transition: .2s ease;
}
.library-card:hover { border-color: var(--accent-2); transform: translateY(-2px); }
.library-card .meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.library-card h3 { font-size: 17px; }
.library-card p { font-size: 13px; margin-bottom: 0; }
.risk-domain { color: var(--accent); font: 10px "IBM Plex Mono"; }
.register-list { display: grid; gap: 12px; }
.register-item { border: 1px solid var(--line); background: #0b1714; padding: 18px; border-radius: 10px; }
.register-item .top { display: flex; justify-content: space-between; gap: 12px; }
.register-item h3 { margin-bottom: 5px; }
.register-item small { color: var(--muted); font-family: "IBM Plex Mono"; }
.danger-outline { color: var(--red); border-color: rgba(255,100,124,.5); border-radius: 8px; }
footer {
  border-top: 1px solid var(--line);
  min-height: 42px; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  color: #4e776a;
}
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 20;
  background: #0d1d18; border: 1px solid var(--accent-2);
  color: var(--text); padding: 12px 14px; border-radius: 8px;
  box-shadow: var(--shadow); font: 12px "IBM Plex Mono";
}
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { grid-template-columns: repeat(3, 1fr); }
  .library-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .topbar { padding: 14px 16px; }
  .system-state { display: none; }
  .workspace { padding: 22px 14px; }
  .sidebar { padding: 14px; }
  .identity, .sidebar .compact { display: none; }
  .nav { margin: 0; }
  .nav-item { font-size: 10px; }
  .hero, .result-header { flex-direction: column; }
  .search-row, .metric-grid, .two-col, .control-grid, .library-grid { grid-template-columns: 1fr; }
  .suggestions { right: 18px; top: 132px; }
}
