:root {
  --bg: #f5f6f3;
  --surface: #ffffff;
  --line: #d9ddd5;
  --text: #18201c;
  --muted: #667069;
  --accent: #176b4d;
  --accent-strong: #0f5139;
  --critical: #b42318;
  --high: #d76a03;
  --medium: #9a6b00;
  --low: #357a38;
  --unknown: #586174;
  --shadow: 0 20px 55px rgba(33, 42, 36, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  border-right: 1px solid var(--line);
  background: #eef1ec;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--text);
  color: #ffffff;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

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

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 11px 12px;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
}

.nav-item.active,
.nav-item:hover {
  background: #ffffff;
  color: var(--text);
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  font-size: 16px;
}

p {
  margin: 0;
}

.topbar p,
.muted,
.status-line {
  color: var(--muted);
  font-size: 13px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.split {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.upload-panel,
.api-panel,
.import-panel {
  padding: 18px;
}

.panel-head {
  min-height: 54px;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.upload-panel .panel-head,
.api-panel .panel-head,
.import-panel .panel-head {
  padding: 0 0 16px;
  border-bottom: 0;
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.field.compact {
  margin-top: auto;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfa;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 92px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 107, 77, 0.12);
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.file-drop {
  min-height: 82px;
  border: 1px dashed #b7c0b7;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #f8faf7;
  cursor: pointer;
}

.file-drop input {
  display: none;
}

.button {
  border: 0;
  border-radius: 7px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

.button.primary {
  width: 100%;
  margin-top: 16px;
  background: var(--accent);
  color: white;
}

.button.primary:hover {
  background: var(--accent-strong);
}

.button.secondary {
  border: 1px solid var(--line);
  color: var(--text);
  background: #ffffff;
}

.import-panel {
  margin-top: 18px;
}

.import-form textarea {
  min-height: 130px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.checkbox-line input {
  width: auto;
}

.check-list,
.registry-list {
  display: grid;
}

.check-row,
.registry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}

.check-row:last-child,
.registry-row:last-child {
  border-bottom: 0;
}

.check-row {
  cursor: pointer;
}

.check-row:hover {
  background: #f7f9f6;
}

.check-title {
  font-weight: 720;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.risk-badge {
  min-width: 84px;
  text-align: center;
  border-radius: 999px;
  padding: 6px 10px;
  color: #fff;
  background: var(--unknown);
  font-size: 12px;
  font-weight: 800;
}

.risk-critical {
  background: var(--critical);
}

.risk-high {
  background: var(--high);
}

.risk-medium {
  background: var(--medium);
}

.risk-low {
  background: var(--low);
}

.risk-unknown {
  background: var(--unknown);
}

.risk-none {
  background: #79827a;
}

.report-panel {
  margin-top: 18px;
}

.hidden {
  display: none;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  border-bottom: 1px solid var(--line);
}

.summary-item {
  padding: 14px 18px;
  border-right: 1px solid var(--line);
}

.summary-item:last-child {
  border-right: 0;
}

.summary-item strong {
  display: block;
  font-size: 20px;
}

.summary-item span {
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: #f9faf8;
}

td.fragment {
  max-width: 220px;
}

td.context-cell {
  max-width: 430px;
  line-height: 1.45;
}

mark {
  background: #fff1a8;
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

.event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 12px;
}

pre {
  margin: 0;
  background: #18201c;
  color: #f6f8f4;
  border-radius: 8px;
  padding: 18px;
  overflow: auto;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .split,
  .two,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .summary-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    padding: 18px;
  }
}

.landing-body {
  min-height: 100vh;
  background: #eef1ec;
}

.landing-header {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 72px);
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}

.pilot-status {
  border: 1px solid rgba(24, 32, 28, 0.16);
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  font-weight: 700;
}

.landing-hero {
  min-height: 92vh;
  padding: 136px clamp(20px, 5vw, 72px) 64px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.8fr);
  gap: clamp(32px, 7vw, 96px);
  align-items: center;
  background:
    linear-gradient(110deg, rgba(238, 241, 236, 0.98) 0%, rgba(238, 241, 236, 0.9) 45%, rgba(218, 226, 219, 0.82) 100%),
    repeating-linear-gradient(0deg, rgba(24, 32, 28, 0.045) 0, rgba(24, 32, 28, 0.045) 1px, transparent 1px, transparent 18px);
}

.hero-copy {
  max-width: 760px;
  animation: landingFade 680ms ease-out both;
}

.eyebrow {
  margin-bottom: 18px;
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
}

.landing-hero h1 {
  max-width: 760px;
  font-size: clamp(44px, 7vw, 86px);
  line-height: 0.98;
  font-weight: 850;
}

.hero-lead {
  max-width: 660px;
  margin-top: 24px;
  color: #435048;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.52;
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions span {
  border: 1px solid rgba(24, 32, 28, 0.14);
  border-radius: 999px;
  padding: 10px 13px;
  background: rgba(255, 255, 255, 0.55);
  color: #34413a;
  font-size: 14px;
  font-weight: 750;
}

.scan-visual {
  position: relative;
  min-height: 520px;
  animation: landingRise 760ms 120ms ease-out both;
}

.scan-sheet {
  position: absolute;
  inset: 0 6% 0 0;
  padding: clamp(28px, 4vw, 46px);
  border: 1px solid rgba(24, 32, 28, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 28px 80px rgba(33, 42, 36, 0.13);
  display: grid;
  align-content: start;
  gap: 18px;
}

.scan-sheet span,
.scan-sheet mark {
  display: block;
  height: 18px;
  border-radius: 3px;
}

.scan-sheet span {
  background: rgba(24, 32, 28, 0.1);
}

.scan-sheet span:nth-child(1) {
  width: 74%;
  height: 28px;
  background: rgba(24, 32, 28, 0.18);
}

.scan-sheet span:nth-child(2) {
  width: 92%;
}

.scan-sheet span:nth-child(3) {
  width: 85%;
}

.scan-sheet span:nth-child(5) {
  width: 78%;
}

.scan-sheet span:nth-child(6) {
  width: 89%;
}

.scan-sheet span:nth-child(8) {
  width: 68%;
}

.scan-sheet mark {
  width: 58%;
  background: rgba(215, 106, 3, 0.22);
  box-shadow: inset 4px 0 0 var(--high);
}

.scan-ruler {
  position: absolute;
  top: 8%;
  bottom: 8%;
  right: 0;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 9px rgba(23, 107, 77, 0.11);
  animation: scanMove 4.8s ease-in-out infinite;
}

.scan-meta {
  position: absolute;
  right: 3%;
  bottom: 10%;
  min-width: 210px;
  padding: 16px;
  border: 1px solid rgba(24, 32, 28, 0.12);
  border-radius: 8px;
  background: rgba(24, 32, 28, 0.92);
  color: #ffffff;
}

.scan-meta strong,
.scan-meta span {
  display: block;
}

.scan-meta strong {
  margin-bottom: 8px;
}

.scan-meta span {
  color: #cbd5ce;
  font-size: 13px;
  margin-top: 4px;
}

.landing-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(24, 32, 28, 0.12);
  background: #ffffff;
}

.landing-band div {
  min-height: 220px;
  padding: clamp(24px, 4vw, 46px);
  border-right: 1px solid rgba(24, 32, 28, 0.12);
}

.landing-band div:last-child {
  border-right: 0;
}

.landing-band h2 {
  font-size: 22px;
}

.landing-band p {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.55;
}

@keyframes landingFade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes landingRise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes scanMove {
  0%,
  100% {
    transform: translateY(-16px);
  }
  50% {
    transform: translateY(16px);
  }
}

@media (max-width: 980px) {
  .landing-header {
    height: auto;
    padding-top: 18px;
  }

  .landing-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 112px;
  }

  .landing-hero h1 {
    font-size: 42px;
  }

  .scan-visual {
    min-height: 380px;
  }

  .landing-band {
    grid-template-columns: 1fr;
  }

  .landing-band div {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(24, 32, 28, 0.12);
  }
}
