:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #d8dee8;
  --paper: #ffffff;
  --surface: #f3f6fa;
  --navy: #1d3148;
  --teal: #0f766e;
  --amber: #b35b1f;
  --red: #b42318;
  --green: #19704f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(29, 49, 72, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(15, 118, 110, 0.12), transparent 40%),
    var(--surface);
}

button,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
}

button:hover {
  border-color: var(--teal);
}

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

.workspace {
  display: grid;
  gap: 18px;
}

.mast {
  display: grid;
  grid-template-columns: 1fr 150px;
  align-items: end;
  gap: 18px;
  min-height: 150px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
}

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

h1 {
  margin: 0;
  font-size: 44px;
  line-height: 1.05;
}

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

.lead {
  max-width: 720px;
  margin: 12px 0 0;
  color: #435167;
  font-size: 17px;
  line-height: 1.55;
}

.risk-dial {
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  background: conic-gradient(var(--teal) 0deg, var(--teal) 20deg, #dbe4ef 20deg);
  color: var(--paper);
  box-shadow: inset 0 0 0 12px rgba(255, 255, 255, 0.85);
}

.risk-dial span {
  font-size: 34px;
  font-weight: 800;
}

.risk-dial small {
  color: #223047;
  font-weight: 700;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 18px;
  align-items: stretch;
}

.editor-panel,
.results-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  min-width: 0;
}

.panel-header,
.actions,
.decision-strip,
.metrics,
.flow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-header {
  justify-content: space-between;
  margin-bottom: 12px;
}

textarea {
  width: 100%;
  min-height: 530px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  line-height: 1.45;
  color: #111827;
  background: #fbfdff;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.actions {
  justify-content: space-between;
  margin-top: 12px;
}

#evaluate {
  color: white;
  border-color: var(--navy);
  background: var(--navy);
  font-weight: 700;
}

#status {
  color: var(--muted);
  font-size: 14px;
}

.decision-strip {
  justify-content: space-between;
  border-radius: 8px;
  padding: 14px;
  background: var(--navy);
  color: white;
}

.decision-strip span {
  font-size: 24px;
  font-weight: 800;
}

.decision-strip strong {
  font-size: 20px;
}

.decision-strip.allow {
  background: var(--green);
}

.decision-strip.review {
  background: var(--amber);
}

.decision-strip.block {
  background: var(--red);
}

.summary {
  min-height: 72px;
  margin: 14px 0;
  color: #344054;
  line-height: 1.55;
}

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

.metrics div {
  min-height: 80px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

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

.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.flow {
  justify-content: space-between;
  margin: 16px 0 18px;
}

.flow div {
  flex: 1;
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef6f5;
  color: #16443f;
  font-weight: 700;
  font-size: 13px;
}

.findings {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.finding {
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

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

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

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

.finding p {
  margin: 0;
  color: #475467;
  line-height: 1.45;
  font-size: 14px;
}

@media (max-width: 880px) {
  .mast,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .risk-dial {
    width: 132px;
  }

  h1 {
    font-size: 36px;
  }

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

  textarea {
    min-height: 420px;
  }
}
