:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5f6d7a;
  --line: #d7dee8;
  --panel: #ffffff;
  --bg: #f6f8fb;
  --teal: #0f766e;
  --blue: #2563eb;
  --red: #b42318;
  --amber: #a15c07;
  --green: #157347;
  --shadow: 0 16px 38px rgba(31, 41, 55, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  position: sticky;
  top: 0;
  z-index: 5;
}

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

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

.brand small,
.label,
.eyebrow,
.safety-note,
footer {
  color: var(--muted);
}

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

nav,
footer {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

nav a,
footer a {
  color: var(--muted);
  text-decoration: none;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 470px);
  gap: clamp(22px, 5vw, 52px);
  padding: clamp(34px, 7vw, 72px) 0 24px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.82rem;
  text-transform: uppercase;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 16px;
  font-size: clamp(2.35rem, 5vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.98rem;
  margin-bottom: 10px;
}

.lede {
  font-size: 1.08rem;
  line-height: 1.65;
  max-width: 720px;
  color: #334155;
}

.scan-panel,
article,
.score-strip,
.status-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.scan-panel {
  padding: 20px;
}

.mode-tabs,
.actions,
.result-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mode-tabs {
  padding: 4px;
  background: #e8edf4;
  border-radius: 8px;
  margin-bottom: 18px;
}

button {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.mode-tab {
  flex: 1;
  background: transparent;
  color: var(--muted);
}

.mode-tab.active,
.primary {
  background: var(--teal);
  color: #fff;
}

.secondary {
  background: #e7edf5;
  color: #1f2937;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid #bdc8d6;
  border-radius: 8px;
  padding: 12px 13px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

textarea,
pre,
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

textarea {
  resize: vertical;
}

.actions {
  margin-top: 12px;
}

.safety-note {
  margin: 14px 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.status-row {
  margin: 10px 0 20px;
}

.status-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  box-shadow: none;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  flex: 0 0 auto;
}

.status-card.good .dot {
  background: var(--green);
}

.status-card.warn .dot {
  background: var(--amber);
}

.status-card.bad .dot {
  background: var(--red);
}

.results {
  display: grid;
  gap: 16px;
  padding-bottom: 44px;
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 16px;
  gap: 12px;
}

.score-strip > div {
  padding: 10px;
  border-left: 3px solid var(--teal);
  background: #f8fafc;
  min-width: 0;
}

.label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  font-weight: 800;
}

.score-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 1.5rem;
  overflow-wrap: anywhere;
}

.result-tools {
  justify-content: flex-end;
}

article {
  padding: 18px;
}

.meta-list {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
}

.meta-list div,
.header-list div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid #e7edf5;
}

dt,
.header-list span {
  font-weight: 800;
  color: #334155;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 16px;
}

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

.finding {
  border: 1px solid #dce3ec;
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

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

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

.severity-low {
  border-left-color: var(--blue);
}

.severity {
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7edf5;
  font-size: 0.74rem;
  text-transform: uppercase;
}

.evidence {
  color: #334155;
  background: #f3f6fa;
  padding: 10px;
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.positive-card {
  border: 1px solid #b9dfcc;
  background: #eefaf3;
  color: #14532d;
  border-radius: 8px;
  padding: 14px;
}

.sample-output {
  max-height: 460px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-radius: 8px;
  background: #111827;
  color: #e5e7eb;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.header-list {
  color: #334155;
}

.header-list code {
  overflow-wrap: anywhere;
}

footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 34px;
  border-top: 1px solid var(--line);
}

.hidden {
  display: none !important;
}

.busy {
  opacity: 0.75;
  pointer-events: none;
}

@media (max-width: 820px) {
  .topbar,
  .hero,
  .content-grid,
  .score-strip,
  .meta-list div,
  .header-list div {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    align-items: start;
  }

  nav {
    gap: 12px;
  }

  .hero {
    padding-top: 28px;
  }

  .scan-panel {
    padding: 16px;
  }

  .result-tools {
    justify-content: stretch;
  }

  .result-tools button,
  .actions button {
    flex: 1 1 140px;
  }
}
