:root {
  color-scheme: light;
  --ink: #14242b;
  --muted: #5f6f76;
  --line: #d9e3e7;
  --panel: #ffffff;
  --paper: #f7fafc;
  --brand: #165a72;
  --brand-2: #0f766e;
  --accent: #b23b2d;
  --warn: #b7791f;
  --ok: #237a4b;
  --shadow: 0 18px 50px rgba(20, 36, 43, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 250, 252, 0.95);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.brand:hover {
  text-decoration: none;
}

.mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

nav {
  display: flex;
  gap: 16px;
  font-weight: 650;
}

.shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 52px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-2);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 800px;
  margin-bottom: 12px;
  font-size: 42px;
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.lede {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
}

.score-card {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 174px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

#scoreValue {
  display: block;
  color: var(--brand);
  font-size: 54px;
  font-weight: 850;
  line-height: 1;
}

#scoreGrade {
  display: block;
  font-size: 17px;
}

#scoreMeta {
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(20, 36, 43, 0.06);
}

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

.panel-head span {
  color: var(--muted);
  font-size: 13px;
}

.actions,
.run-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  padding: 8px 12px;
}

button:hover:not(:disabled) {
  border-color: var(--brand);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

textarea {
  display: block;
  width: 100%;
  min-height: 540px;
  resize: vertical;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
  background: #fbfdfe;
  color: #102027;
  font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  outline: none;
  tab-size: 2;
}

.run-row {
  min-height: 64px;
  padding: 12px 18px;
  justify-content: space-between;
}

#statusText {
  color: var(--muted);
  font-size: 13px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 18px 0;
}

.metric {
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f9fbfc;
}

.metric strong {
  display: block;
  font-size: 22px;
}

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

.findings {
  display: grid;
  gap: 12px;
  padding: 16px 18px 18px;
  max-height: 640px;
  overflow: auto;
}

.findings.empty {
  color: var(--muted);
}

.finding {
  border: 1px solid var(--line);
  border-left: 5px solid var(--muted);
  border-radius: 7px;
  padding: 12px;
  background: #fff;
}

.finding.critical,
.finding.high {
  border-left-color: var(--accent);
}

.finding.medium {
  border-left-color: var(--warn);
}

.finding.low,
.finding.info {
  border-left-color: var(--brand-2);
}

.finding h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.finding p {
  margin: 6px 0;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  margin-right: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eaf1f3;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.snippet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px 18px 18px;
}

.snippet {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.snippet h3 {
  margin: 0;
  padding: 10px 12px;
  font-size: 14px;
  background: #eef6f6;
}

pre {
  margin: 0;
  overflow: auto;
  padding: 12px;
  background: #102027;
  color: #e9f5f8;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.sources {
  margin-top: 26px;
}

.sources ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  padding-left: 20px;
}

.sources li span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 920px) {
  .hero,
  .workspace,
  .snippet-grid,
  .sources ul {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 34px;
  }

  textarea {
    min-height: 380px;
  }
}

@media (max-width: 560px) {
  .topbar,
  .panel-head,
  .run-row {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  h1 {
    font-size: 30px;
  }

  .metrics {
    grid-template-columns: 1fr 1fr;
  }

  button,
  .primary {
    width: 100%;
  }
}
