:root {
  color-scheme: dark;
  --bg: #08110f;
  --surface: #0d1917;
  --surface-2: #12211f;
  --line: #21413b;
  --line-strong: #2f645a;
  --text: #eef9f5;
  --muted: #9bbab1;
  --soft: #d5eee7;
  --green: #28d17c;
  --green-strong: #57f29d;
  --cyan: #36c7df;
  --yellow: #f2bf4d;
  --red: #ff6b6b;
  --orange: #ff9860;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(26, 95, 75, 0.22), rgba(8, 17, 15, 0) 420px),
    repeating-linear-gradient(90deg, rgba(82, 255, 178, 0.045) 0 1px, transparent 1px 92px),
    repeating-linear-gradient(0deg, rgba(82, 255, 178, 0.035) 0 1px, transparent 1px 92px),
    var(--bg);
}

button,
textarea,
a {
  font: inherit;
}

a {
  color: inherit;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(40, 209, 124, 0.18), rgba(54, 199, 223, 0.12));
}

.brand-mark svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--green-strong);
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.brand strong {
  font-size: 1rem;
  letter-spacing: 0;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 25, 23, 0.8);
  color: var(--soft);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: stretch;
  padding: 28px 0 24px;
}

.hero-copy {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(20, 58, 48, 0.92), rgba(10, 21, 19, 0.95)),
    radial-gradient(circle at top right, rgba(54, 199, 223, 0.18), transparent 42%);
  box-shadow: var(--shadow);
}

.eyebrow {
  width: fit-content;
  padding: 7px 10px;
  border: 1px solid rgba(40, 209, 124, 0.35);
  border-radius: 8px;
  background: rgba(40, 209, 124, 0.09);
  color: var(--green-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin: 18px 0 16px;
  font-size: 3.7rem;
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 740px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-actions,
.input-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  border: 0;
  cursor: pointer;
}

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

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 800;
}

.primary-action {
  background: var(--green);
  color: #04100c;
}

.secondary-action {
  border: 1px solid var(--line-strong);
  background: rgba(14, 31, 28, 0.78);
  color: var(--soft);
}

.primary-action svg,
.secondary-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-panel,
.input-pane,
.results-pane {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 24, 22, 0.9);
  box-shadow: var(--shadow);
}

.status-panel {
  padding: 18px;
  align-self: stretch;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  border-bottom: 1px solid rgba(47, 100, 90, 0.45);
}

.status-row:last-child {
  border-bottom: 0;
}

.status-row span {
  color: var(--muted);
  font-size: 0.86rem;
}

.status-row strong {
  color: var(--soft);
  font-size: 0.9rem;
  text-align: right;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 0.78fr) minmax(0, 1.22fr);
  gap: 20px;
  align-items: start;
  padding-bottom: 24px;
}

.input-pane,
.results-pane {
  padding: 20px;
}

.pane-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.pane-heading h2 {
  margin-bottom: 5px;
  font-size: 1rem;
}

.pane-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

#input-count,
.run-state {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

textarea {
  display: block;
  width: 100%;
  min-height: 520px;
  resize: vertical;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #07100e;
  color: var(--text);
  line-height: 1.55;
}

textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(40, 209, 124, 0.14);
}

.input-actions {
  margin-top: 14px;
}

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

.metric {
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

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

.metric span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  margin-top: 9px;
  font-size: 1.8rem;
}

.metric.critical strong {
  color: var(--red);
}

.metric.high strong {
  color: var(--orange);
}

.metric.medium strong {
  color: var(--yellow);
}

.next-actions {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid rgba(54, 199, 223, 0.28);
  border-radius: 8px;
  background: rgba(54, 199, 223, 0.07);
}

.next-actions h3 {
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.next-actions ol {
  margin: 0;
  padding-left: 22px;
  color: var(--soft);
  line-height: 1.6;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 330px;
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: rgba(18, 33, 31, 0.6);
  text-align: center;
}

.empty-state svg {
  width: 76px;
  height: 76px;
  margin-bottom: 16px;
  fill: none;
  stroke: var(--green-strong);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-state h3 {
  margin-bottom: 8px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.finding-list {
  display: grid;
  gap: 14px;
}

.finding-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 18, 16, 0.86);
}

.finding-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.severity-pill,
.owner {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.severity-pill {
  background: rgba(155, 186, 177, 0.14);
  color: var(--soft);
}

.severity-pill.critical {
  background: rgba(255, 107, 107, 0.15);
  color: #ffaaaa;
}

.severity-pill.high {
  background: rgba(255, 152, 96, 0.15);
  color: #ffc2a2;
}

.severity-pill.medium {
  background: rgba(242, 191, 77, 0.15);
  color: #ffe1a0;
}

.severity-pill.low {
  background: rgba(54, 199, 223, 0.14);
  color: #a7eff9;
}

.owner {
  border: 1px solid var(--line);
  color: var(--muted);
}

.finding-card h3 {
  margin-bottom: 9px;
  font-size: 1.1rem;
  line-height: 1.35;
}

.impact,
.context {
  color: var(--muted);
  line-height: 1.6;
}

.context {
  padding: 10px 12px;
  border-left: 3px solid var(--line-strong);
  background: rgba(18, 33, 31, 0.7);
  font-size: 0.88rem;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.check-grid section {
  padding: 14px;
  border: 1px solid rgba(47, 100, 90, 0.55);
  border-radius: 8px;
  background: rgba(18, 33, 31, 0.45);
}

.check-grid h4 {
  margin-bottom: 10px;
  font-size: 0.86rem;
}

.check-grid ul {
  margin: 0;
  padding-left: 18px;
  color: var(--soft);
  line-height: 1.55;
}

.check-grid li + li {
  margin-top: 7px;
}

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

  h1 {
    font-size: 2.65rem;
  }

  textarea {
    min-height: 360px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .pane-heading,
  .finding-header {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions a {
    flex: 1;
  }

  .hero-copy,
  .input-pane,
  .results-pane {
    padding: 16px;
  }

  h1 {
    font-size: 2.1rem;
  }

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

  .primary-action,
  .secondary-action {
    width: 100%;
  }
}
